GPL-A (2K ROM)
Information
I expect GPL-A stands for Game Programming Language, version A.
GPL-A (2K ROM) is used in the gamed 'Tag-Bowling' and 'Katch' running on the RCA Video Coin Arcade machine (and FRED 2). Katch looks like an early version of Tag-Bowling.
The two GPL-A versions described here are very similar, obviously the 2K RAM version will fit into that whereas the 2K ROM version will need RAM located at 0800-09FF as it uses screen location 0900-09FF and V0-F are stored on 0880-088F. Interrupt routines are different and they have slightly different code for the timers. Command syntax is more or less the same for both with differences in:
- SUB Vz, Vy-Vx on GPL 1 and SUB Vz, Vx-Vy on GPL 2
- SE Vx, [6aa] on GPL 1 and SNE Vx, kk on GPL 2
- SNE Vx, [6aa] on GPL 1 and SNE Vx, [8aa] on GPL 2
- LD [6aa], Vx on GPL 1 and LD [8aa], Vx on GPL 2
Definitions
aaa | 12 bit address |
kk | 8 bit constant |
d | 4 bit constant |
n | 4 bit constant |
x | Register number Vx (x = 0 to F) |
y | Register number Vy (y = 0 to F) |
z | Register number Vz (y = 0 to F) |
[8aa] | Memory value of address aa within page 8 (RAM) |
[Vy] | Memory value of address in register Vy within in page 8 (RAM) |
F= | Tone frequency |
. | Not used, value doesn't matter |
1..9, A..F | Hexadecimal digits |
Syntax
Opcode | Mnemonic | Parameter | Definition |
---|---|---|---|
6xyz | ADD | Vz, Vx+Vy | Vz = Vx + Vy, V0 = carry |
6xyx | ADD | Vx, Vy | Vx = Vx + Vy, V0 = carry |
Bxyx | ADD8 | Vx, Vy, Vz | If (Vx+Vy)&0x7 = 8 THEN Vz = 0xFF ELSE Vx = Vx+Vy |
9dkk | BEEP | F=kk, d kk, d |
Beep with a frequency kk and duration d |
1aaa | CALL | aaa | Call subroutine at aaa. The subroutine must end in C0 (which is the 'GPL' equivalent of RETURN) |
Axyn | DRW | Vx, Vy, n | Draw 8*8 graphics: n: bit 0-2, specify the number of graphics to draw - 1 (0 will draw one graphic, 7 will draw 8 graphics) n: bit 3, 0 = next graphic, 1 = repeat same graphic Page 6 [Vx to Vx+8] contains the graphic memory location start, calculated as: - bit 0 defines the lower byte of graphic memory location bit 3 - bit 1-3 defines page number 0=Page 5, 1=Page 4, 2=Page 3, 3=Page 2 etc. - bit 4-7 defines the lower byte of graphic memory location bit 4-7 e.g. B0 points to memory 5B0, B2 points to 4B0, B3 points to 4B8. Graphic memory location bit 0-2 are always 0, the graphic memory should contain 8 bytes to make up the 8*8 graphic which will be stored on screen location Vy-0xA0. Where A0 is top left corner A8 to right corner, D0 bottom left corner and D8 bottom right corner. The memory location values used (from page 6) are copied to 08A0-08D8 RAM |
Faaa | JP | aaa | Jump to address aaa |
5xy. | LD | B, Vy, Vx | Store BCD value of Vx in Vy, Vy+1 and Vy+2, Vy will point to last byte of the converted number |
Ex.0 | LD | Vx, COIN | Load status coin detector to Vx, no coin Vx = 0, coin Vx = 1 |
Ex.1 | LD | Vx, FIREA | Load status fire key player A to Vx, no fire pressed Vx = 0, fire pressed Vx = 1 |
Ex.2 | LD | Vx, FIREB | Load status fire key player B to Vx, no fire pressed Vx = 0, fire pressed Vx = 1 |
Ex.4 | LD | Vx, JOYA | Load status joystick keys player A to Vx |
Ex.8 | LD | Vx, JOYB | Load status joystick keys player B to Vx |
4xkk | LD | Vx, kk | Vx = kk |
C8y. | LD | Vy, PAR | Load input parameter switch to Vy |
6xyz | LD | Vz, Vx+Vy | Same as ADD: Vz = Vx + Vy, V0 = carry |
7xyz | LD | Vz, Vx-Vy | Same as SUB: Vz = Vx - Vy, V0 = carry |
Dxaa | LD | [8aa], Vx 8aa, vx |
Memory Location [8aa] = Vx |
C4 | NO | OP | Do nothing (same as CC) |
C0 | RETURN | Return from subroutine | |
8xkk | RND | Vx, kk | Vx = random AND kk |
2xkk | SNE | Vx, kk | Skip next instruction if Vx != kk |
3xaa | SNE | Vx, [8aa] Vx, 8aa |
Skip next instruction if Vx != memory location [8aa] |
7xyz | SUB | Vz, Vx-Vy | Vz = Vx - Vy, V0 = carry |
7xyx | SUB | Vx, Vy | Vx = Vx - Vy, V0 = carry |
0aaa | SYS | aaa | Call CDP1801 code at aaa. The subroutine must end in a RET (D4) |
C1kk | TONE | F=kk kk |
Tone on with frequency kk (same as C3kk, C5kk, C7kk, C9kk, CBkk, CDkk, CFkk) |
C2.. | TONE | OFF | Tone off (same as C6.., CA.., CE..) |