This is an old revision of the document!
Cartridges
In the Astrocade's memory map, 8KB ($2000–$3FFF) is allotted to interchangeable cartridges (otherwise known as cassettes or Videocades).
Cartridge Types
Two types of cartridges may be used with the Bally Professional Arcade. The first type, called an autostart cartridge, is entered immediately after reset. The only initialization that is performed before entry is the setup of the stack pointer to point just below system RAM and the establishment of “consumer mode” in the custom chips. RAM is not altered in this mode.
An autostart cartridge is indicated by a jump instruction (opcode $C3) at location $2000. This jump instruction should branch to the starting address of the cartridge.
[examples of games that autostart]
The second type, called a standard cartridge, is entered after a game selection process is completed. The system does considerably more initialization before control transfer:
- System RAM is cleared to 0
- The ACTINT interrupt routine is enabled
- The MENU colors are set in the left color map
- Vertical blank is set at line 96, horizontal boundary at 41, and interrupt mode at 8
- The screen displays the menu frame
- The shifter is cleared
A standard cartridge is indicated by a sentinel byte of $55 (or ASCII “U” for User Mode) at location $2000. Following this byte is the first node of the cartridge's menu data structure. This data structure gives the name and starting address of each program in the cartridge.
[examples of standard cart games]
When the user selects a cartridge game, control transfers to the starting address with the address of the program name string in the registers. The cartridge program will use the GETPAR system routine to prompt for game parameters (e.g., score to play to, game time limit, number of players).
Cartridge Memory Diagram
Restart Vectors
needs significant editing/explanation
The cartridge has access to six unused restart (RST) instructions: RST8, RST16, RST24, RST32, RST40, and RST48.
Executing any of these instructions causes the program to jump to a location in memory. At that location, the user executes a jump instruction to vector the program to a new location.
RST n instructions are useful for optimization because they require less space and time (1 byte, 11 cycles) than an equivalent CALL (3 bytes, 17 cycles). RST pushes the PC onto the stack, so you can return with a RET call. RST does not alter flags.
['RST is a “small and fast” CALL to one of eight special memory locations.'] [The Z80's RST instruction is a legacy instruction for compatibility with the Intel 8080.]
[Efficiency - six functions can now be called using 1 byte instead of 3 - good for small, common subroutines - e.g. Football uses them (but how?) ]
Cartridge Memory Structure
Location | Contents | |
---|---|---|
2000 | 55 | C3 |
2001,2 | *Address of next menu table | RST0 or RESET jumps to 2000 immediately after DI and outputs 00 to port 08. |
2003,4 | Address of this menu string literal | |
2005,6 | Address to jump to if selected |
2007 | RST 8 jumps here. | |
200A | RST 10H jumps here. | |
200D | RST 18H jumps here. | |
2010 | RST 20H jumps here. | |
2013 | RST 28H jumps here. | |
2016 | RST 30H jumps here. | |
2019 | Player input routine (SR66) jumps here if location $4FFA contains 0AAH. |
*0218 = First onboard menu, 0000 = last menu.
[NM:72–4] Reference: Bally On-Board ROM Subroutines [PDF]