The SuperGame Format
From 8BitDev.org - Atari 7800 Development Wiki
SuperGame Format
General Info
The SuperGame cart mapper was created by GCC/Atari, and is still in use by modern homebrewers. The actual feature specification of SuperGame is a bit loose. The following is a quote from Eckhard Stolberg's ATARI 7800 BANKSWITCHING GUIDE.
[...]there are several different types of Atari's SuperGame bankswitching. It basically consists of 8 16KB banks (0-7) that can be mapped in at $8000-$bfff. Bank 7 always is fixed at $c000-$ffff. To map in a chosen bank into $8000-$bfff you write it's bank number (0-7) to any address between $8000-bfff. The contend of $4000-$7fff differs between different variations of this type: Some games have nothing connected in this area and return only random data. Some games have bank 6 fixed at this area. Some games have 16K of extra ROM there. Those games are 144K in size and are marked as 78S9 in the list. Some games have either 8K of RAM at $6000-$7fff or 16K of RAM at $4000-$7fff. Some games have a POKEY chip mapped in at this area. It has 16 addresses that get repeated all the way between $4000 and $7fff. Some games only have 4 ROM banks at $8000-$bfff (0-3). Banks 4-7 either return the same data as banks 0-3 or completely random data. PAL Karateka is a special case. It only uses banks 4-7. Banks 0-3 are random data and bank 6 is also fixed at $4000-$7fff.
When you generate rom files, any extra hardware features at $4000 can just be flagged via the A78 header, with the exception of having an extra 16K bank of rom placed there - for that you need to add an extra bank at the start of your rom with it's ORG being $4000, in addition to A78 header flagging.
A basic 128k 7800 SuperGame Skeleton
; basic 128k 7800 supergame skeleton, with no rom@4000. ; banks 1-7 live at $8000-BFFF in 6502 address space ; bank 8 lives at $C000-FFFF in 6502 address space ORG $8000 RORG $8000 ; bank 1 code goes here ($8000-$BFFF) ORG $C000 RORG $8000 ; bank 2 code goes here ($8000-$BFFF) ORG $10000 RORG $8000 ; bank 3 code goes here ($8000-$BFFF) ORG $14000 RORG $8000 ; bank 4 code goes here ($8000-$BFFF) ORG $18000 RORG $8000 ; bank 5 code goes here ($8000-$BFFF) ORG $1C000 RORG $8000 ; bank 6 code goes here ($8000-$BFFF) ORG $20000 RORG $8000 ; bank 7 code goes here ($8000-$BFFF) ORG $24000 RORG $C000 ; bank 8 code goes here ($C000-$FFFF) ORG $27FF8 RORG $FFF8 ; 7800 bytes and 6502 vectors go here .byte.b $FF ; region verification. $FF=all regions .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. .word.w NMI .word.w START .word.w IRQ