Prev: 23550 Up: Map Next: 24100
24000: Game Initialise
Game_Initialise 24000 DI Disable interrupts.
24001 XOR A Set A to 0 for clearing the flags below.
Put the stack pointer somewhere safe.
24002 LD SP,23550 SP=Stack.
24005 LD (24508),A Write 0 to;
24008 LD (24490),A
24011 OUT (254),A Set border to: BLACK.
Open channel 2 (upper screen) via CHAN_OPEN.
24013 CALL 5633 Call CHAN_OPEN.
Clear the screen.
24016 LD HL,23295 Clear the screen and attribute buffers by filling 6911 bytes from 23294 downwards with 0.
24019 LD DE,23294
24022 LD (HL),0
24024 LD BC,6911
24027 LDDR
Sets the border colour to use when calling CLS.
24029 LD A,15 Write WHITE to *BORDCR.
24031 LD (23624),A
24034 LD IX,56000 IX=Percy_X_Position.
24038 LD (IX+35),0 Write 0 to *IX+35 (Egg_Frame_ID).
24042 LD (IX+2),7 Write WHITE to *IX+2 (Percy_Colour).
24046 LD (IX+34),255 Write 255 to *IX+34 (Egg_Colour).
24050 CALL Initialise_Lives Call Initialise_Lives.
24053 LD A,255 Write 255 to *Pause_Flag.
24055 LD (24508),A
Game pause input loop.
Pause_InputLoop 24058 CALL MainGameLoop Call MainGameLoop.
24061 LD A,253 Read from the keyboard;
Port Number Bit
0 1 2 3 4
253 A S D F G
24063 IN A,(254)
24065 AND %00000010 Keep only the bit which relates to the "S" key (bit 1).
24067 CALL Z,Pause_BorderEffect Call Pause_BorderEffect if the "S" key was pressed.
24070 CALL Run_Game_Frame Call Run_Game_Frame.
24073 NOP No operation.
24074 NOP
24075 XOR A Write 0 to;
24076 LD (24507),A
24079 LD (24509),A
24082 LD BC,32766 Read from the keyboard;
Port Number Bit
0 1 2 3 4
127 SPACE FULL-STOP M N B
24085 IN A,(C)
24087 RRA Jump back to Pause_InputLoop if "SPACE" was not pressed.
24088 JR C,Pause_InputLoop
The "SPACE" key has been pressed.
24090 LD B,254 Read from the keyboard;
Port Number Bit
0 1 2 3 4
254 SHIFT Z X C V
24092 IN A,(C)
24094 RRA Jump back to Pause_InputLoop if "CAPS SHIFT" was not pressed.
24095 JR C,Pause_InputLoop
Both "SPACE" and "CAPS SHIFT" were held down, so reset the game.
24097 EI Enable interrupts.
24098 JR Game_Initialise Jump to Game_Initialise.
Prev: 23550 Up: Map Next: 24100