FastBasic 4.6 Beta Adds an Atari 5200 Target
At the start of March 2022, dmsc (Daniel Serpell) released a FastBasic 4.6 beta with an unusual pitch. He felt the Atari 5200 was under-represented in the BASIC 10-Liner contest, so the FastBasic PC cross-compiler could now build Atari 5200 cartridges as well as 8-bit computer programs. The 5200 port was developed with help from vitoco. The final 4.6 release followed in August 2022.
What the 5200 target supports
The 5200 shares the 8-bit computers' ANTIC, GTIA and POKEY chips but has a different memory map and no BASIC-friendly OS, so not everything carries over. The 5200 target supports:
- all integer and string functions, including
STICK()andSTRIG()that behave like the computer versions; - graphics modes 0, 1, 2, 7–13 and 15, with
PLOTandDRAWTO; - display list interrupts and Player/Missile graphics;
PRINTto the screen, andGETfor reading the 5200 keypads.
The announcement included joyas, an existing FastBasic game ported to the 5200, as both source (joyas.bas) and a cartridge binary (joyas.bin).
A multi-target compiler
Getting there required a lot of internal changes. The compiler now supports targets, and the old "integer-only" and "floating-point" compilers are now just two of them. Version 4.6 can build:
- Atari 8-bit binary load files (XEX), with or without floating point;
- Atari 8-bit cartridge images (CAR), with or without floating point;
- Atari 5200 cartridge images (BIN).
Advanced users can also extend the language without changing the compiler sources, by writing new target files that define new statements and functions. The compiler manual has a worked example. The thread soon filled with questions about this, for instance how a new statement receives its parameters and what CA65 directives such as .importzp mean in the runtime sources. The FastBasic PC compiler uses the CA65 assembler and LD65 linker.
Smaller language changes
- A
TAB()function insidePRINTmoves to the next column that is a multiple of a given number. DIMcan declare ordinary variables (e.g.DIM X$, Z), which start at 0 or an empty string.- The comma in
PRINTnow usesTABinternally, so it behaves more consistently on screen. This is different from Atari BASIC, which matters if you port old listings.
Where to get it
Download from the FastBasic GitHub releases (tag v4.6-beta, later superseded by the final 4.6). The 5200 details are in a5200.md, and compiler usage and language extension are covered in compiler/USAGE.md in the repository.
Credits
- AtariAge — 10-liners for the Atari 5200? - FastBasic 4.6-beta is here! — AtariAge forum members
