English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 29 August 2003, 00:23   #1
Steve
I Identify as an Ewok
 
Steve's Avatar
 
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
Cool Clash of the Tight-Uns: Blitz Basic Vs C

I was thinking about this while on me short holiday. I've recently (re) purchased Blitz Basic 2.1 just to bring back some memories of my Blitz coding days. Mainly just to flick through the manual. I'm not really interested in coding in Blitz any more.

Anyway onto the point. I also purchased the Amiga Shopper book called Complete Amiga C. This came with a registered C compiler called DICE. So I'm going to try out some Amiga C and see how quick it is for games compared to Blitz.

Now every Amiga programmer knows that assembler is the daddy when it comes to speed but who comes second? Amos is a bag 'o' shite as everyone knows but Blitz is superb and runs very fast thanks to the compiler. What I want to know is does anyone know the difference in speed between programs written in Blitz Basic and programs written in C. I'm talking about hardware hitting games programs.

I know C is the daddy when it comes to Amiga Workbench applications but how fast is it when it comes to writing Amiga games in C?

Has anyone here written an Amiga game in C?

Were any commercial Amiga games written using the C language?

How big is the speed gap between C & assembler?

Is C fast enough for an arcade style AGA Amiga game or should it just be used for Amiga Workbench applications?

I look forward to your comments...
Steve is offline  
Old 29 August 2003, 02:09   #2
Codetapper
2 contact me: email only!
 
Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,187
Thumbs down C is a poor choice for arcade games!

The answer depends!

If you are doing a game of tic-tac-toe on a workbench window, then C is fine and writing the AI routines would be much easier in C than say assembler and perhaps Blitz.

I would guess that Blitz would probably be a little slower at doing the computational stuff than C.

However if you are talking about arcade style games, Blitz would leave C for dead. There are quite a large number of games written in C - a lot of early 1988 ones use Manx C which is a pain as WHDLoad has to handle a bug in the compiler. But I've never seen anything in C like Defender which can be knocked up nicely in Blitz...

You might get away with something like Bubble Ghost in C (static backgrounds, few moving objects) but other than that I'd stay well clear unless you really want portability to other machines.

One final note - a lot of C programs are really slow because of the bloatware library that is included in many games. To open a file for example:

Asm: Using a macro, 3 lines included into the code or a subroutine called

C: Push all parameters onto the stack, call the routine. Which jumps to the real routine, which pulls the values off the stack, moves them into the registers, calls the same 3 lines of assembler than any decent coder would have done, then pushes the return code onto the stack and returns twice. Program reads the return code from the stack.

As you can see, the C implementation does a tonne of extra work moving stuff to/from the stack which slows programs down a lot. This is especially true for graphics.library functions.
Codetapper is offline  
Old 29 August 2003, 14:08   #3
Steve
I Identify as an Ewok
 
Steve's Avatar
 
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
Interesting...

Are there any Amiga games written in C from 1994 onwards?

I'm pretty sure that FIFA International Soccer was written in C as it's a straight port of the (very slow) Megadrive version which was definitely written in C because I've seen the source code. So if FIFA was written in C then that explains the painstakingly slow speed of the game.

Another game which could have been written in C is Sabre Team as that's not exactly nippy either.
Steve is offline  
Old 29 August 2003, 16:02   #4
ant512
Registered User
 
Join Date: Dec 2002
Location: California
Posts: 965
It's worth noting that the Amiga's OS was mainly written in C - it's the language to go for if you want speed but don't want to learn assember.

It's also worth remembering that Blitz Basic features an in-line 68K assembler, and *all* of the commercial games written in Blitz (Gloom, Super Skidmarks, Guardian, etc) were mostly written using Blitz's assembler. The BASIC language was only ever used to do simple things like disk I/O or setting up displays.

If you want to write pure BASIC programs, Blitz is much faster than AMOS but still not really fast enough for commercial-quality games.
ant512 is offline  
Old 29 August 2003, 16:20   #5
Severin
Registered User
 
Severin's Avatar
 
Join Date: Dec 2002
Location: Gloucester / UK
Posts: 700
Send a message via ICQ to Severin
Don't forget to go to http://www.blitz-2000.co.uk/ for the latest version of AmiBlitz, there have been alot of improvements since 2.1...
Severin is offline  
Old 29 August 2003, 17:39   #6
7-Zark-7
Zone Friend
 
7-Zark-7's Avatar
 
Join Date: Aug 2001
Location: Brisbane/Australia
Posts: 1,270
Lightbulb

Not that I'm programming inclined, but I recall a preview in The One of Sim City 2000, which used a derivative called C++, I think. (I remember because Akira said the Miggy version absolutely crawls,apparently!). That being the case, would it be probable that most of Maxis other Amiga game conversions at that time probably using C too?

Certain bits of Amiga Wing Commander used C according to a The One WIP,(but did also mix assembler).
What about the U.S. based PC ports of the early Sierra & Lucasarts adventure titles,what programming language would they have used? They were usually OS friendly & not noted for speed.
7-Zark-7 is offline  
Old 30 August 2003, 00:19   #7
fiath
Moderator
 
fiath's Avatar
 
Join Date: Jan 2002
Location: South East / UK
Age: 46
Posts: 1,930
Quote:
Originally posted by ant512
It's worth noting that the Amiga's OS was mainly written in C - it's the language to go for if you want speed but don't want to learn assember.
Just out of interest, anyone know when they started going over from BCPL? Perhaps KS 2 or 3?
fiath is offline  
Old 30 August 2003, 00:34   #8
Severin
Registered User
 
Severin's Avatar
 
Join Date: Dec 2002
Location: Gloucester / UK
Posts: 700
Send a message via ICQ to Severin
Quote:
Originally posted by fiath
Just out of interest, anyone know when they started going over from BCPL? Perhaps KS 2 or 3?
IIRC, parts of WB1.4 were done in C...
Severin is offline  
Old 30 August 2003, 20:05   #9
ant512
Registered User
 
Join Date: Dec 2002
Location: California
Posts: 965
If I remember correctly, I think that the filesystem was written in BCPL by a third-party as a last-minute replacement for whatever system Amiga hadn't finished in time. Most of the rest of the system was written in C.

Here's a bit of code from the NTSC A1000 Kickstart disk, which due to Commodore's incompetence includes the sourcecode:

PHP Code:
struct ViewPort
{
    
struct ViewPort *Next;
    
struct ColorMap    *ColorMap;  /* table of colors for this viewport */
                        /* if this is nil, MakeVPort assumes default values */
    
struct CopList  *DspIns;    /* user by MakeView() */
    
struct CopList  0èRÿ£u*SprIns;    /* used by sprite stuff */
    
struct CopList  *ClrIns;    /* used by sprite stuff */
    
struct UCopList *UCopIns;   /* User copper list */
    
SHORT   DWidth,DHeight;
    
SHORT   DxOffset,DyOffset;
    
UWORD   Modes;
    
UWORD    reserved;
    
struct    RasInfo *RasInfo;
}; 
Looks like C to me. If you want to see the rest of the code, get the A1000 Kickstart ADF and load it into a text editor.
ant512 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blitz Basic Questions diablothe2nd Coders. Blitz Basic 161 06 September 2019 12:09
Blitz basic 2 Help Havie Coders. Blitz Basic 30 08 September 2013 09:15
blitz basic petza request.Apps 11 08 April 2007 01:49
Blitz Basic 2 anyone? jobro request.Apps 12 28 November 2005 18:15
Blitz Basic 2 LaundroMat Retrogaming General Discussion 5 24 July 2001 08:10

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:25.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07301 seconds with 13 queries