Routines |
Prev: 33051 | Up: Map | Next: 33115 |
|
||||
Second menu (33051) - checks for one of two key press options (both checked using the same keyboard port).
|
||||
33069 | LD BC,49150 | Keyboard port address for keys H, J, K, L, Enter | ||
33072 | IN A,(C) | Read port input | ||
33074 | LD C,A | Temp store value in C register for next check | ||
Check if ENTER is being pressed
|
||||
33075 | OR %11111110 | Need to check bit 0, so set all other bits | ||
33077 | CP %11111110 | Check for the ENTER key | ||
33079 | LD A,0 | Set "New Game" flag (0) in advance of a positive check | ||
33081 | JR Z,33104 | Finish check/jump out here if ENTER is pressed | ||
Check if LOAD ("J") is being pressed
|
||||
33083 | LD A,C | Retrieve keyboard port address input from C register | ||
33084 | OR %11110111 | Need to check bit 3, so set all other bits | ||
33086 | CP %11111111 | Check for "J" key | ||
33088 | JR Z,33069 | If it's not being pressed, jump back and keep scanning for ENTER or LOAD keys | ||
LOAD ("J") has been pressed
|
||||
33090 | CALL 33115 | LOAD has been selected. Clear the screen (pixels) | ||
33093 | LD DE,36045 | Get address of text string ("LOAD SAVED GAME") | ||
33096 | LD HL,18632 | Set screen position for printing text | ||
33099 | CALL 33145 | Print "LOAD SAVED GAME" on screen | ||
33102 | LD A,1 | Set "Load game" flag (1) | ||
ENTER or LOAD has now been selected, and the A register contains flag for either new game (0) or load game (1)
|
||||
33104 | LD (35755),A | Store game flag (0 = New Game, 1 = Load Saved Game) | ||
33107 | CP 1 | |||
33109 | JR Z,33114 | Load game - don't clear the screen (skip the next instruction to leave "LOAD SAVED GAME" message on-screen) | ||
33111 | CALL 33115 | New game - clear the screen (pixels) | ||
33114 | RET |
Prev: 33051 | Up: Map | Next: 33115 |