[stella] Atari 2600 BASIC compiler

Subject: [stella] Atari 2600 BASIC compiler
From: "Fred Quimby" <c9r@xxxxxxxxxxx>
Date: Thu, 7 Jul 2005 06:05:42 -0400
I'm probably going to get a mix of praise and criticism for this.  Anyway, 
I've written a BASIC compiler for the Atari 2600.  Yes, you read that right. 
  This is not a joke!

Of course there is no "print" statement, string operations or arrays... But 
I've managed to abstract some of the harder things to simple BASIC keywords 
and functions.

Also, it doesn't generate binaries directly, instead it converts them to an 
assembly file in DASM syntax, then invokes DASM to make a binary.  It comes 
with a canned kernel with two players, two missiles, and asymmetric 
playfield and a 6-digit score, but there's no reason why one must use this 
kernel - in fact it is possible for a somewhat-experienced programmer to 
make it work with almost any kernel.

It is my hope that folks will use this BASIC as a stepping stone to serious 
2600/6502 programming, much like we all did in the past on our C-64's, 
Apples or Atari 8-bits.  Since it generates meaningful assemblies instead of 
binaries, I think this is likely, or at least I remain hopeful.

The included kernel uses a bitmapped 32x12 playfield and has easy to use 
scrolling routines too, which could be used to make a car racing game or 
something of that sort.  Calling the display kernel is not automatic - you 
must use the drawscreen function.

Also, the compiler generates pretty efficient code, or at least I think so.  
As long as you're not using too many of the playfield scrolling routines, I 
think (I hope) it's unlikely that you will exceed the time alloted for 
overscan/vblank.  The compiler also inserts conditional compilation flags to 
prevent player graphics from wrapping page boundaries and can also be 
configured to automatically use branches instead of jumps where the target 
is near.

Also, I haven't abstracted out all 2600 intricacies - you still have direct 
access to any TIA register and can include inline assembly.  In fact you 
must use TIA regs for some things, like colors and sound, but you access 
them just like any other variable.

To learn more, read the README file or ask me questions, or tell me I'm 
crazy or something since I have been critical about this very thing in the 

Please try it out and tell me what you all think!

Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://stella.biglist.com

[demime 1.01d removed an attachment of type application/x-zip which had a name of 2600basic.zip]

Current Thread