Prev: 5BFE Up: Map Next: 5E24
5DC0: Game Initialise
Game_Initialise 5DC0 DI Disable interrupts.
5DC1 XOR A Set A to 00 for clearing the flags below.
Put the stack pointer somewhere safe.
5DC2 LD SP,$5BFE SP=Stack.
5DC5 LD ($5FBC),A Write 00 to;
5DC8 LD ($5FAA),A
5DCB OUT ($FE),A Set border to: BLACK.
Open channel 02 (upper screen) via CHAN_OPEN.
5DCD CALL $1601 Call CHAN_OPEN.
Clear the screen.
5DD0 LD HL,$5AFF Clear the screen and attribute buffers by filling 1AFF bytes from 5AFE downwards with 00.
5DD3 LD DE,$5AFE
5DD6 LD (HL),$00
5DD8 LD BC,$1AFF
5DDB LDDR
Sets the border colour to use when calling CLS.
5DDD LD A,$0F Write WHITE to *BORDCR.
5DDF LD ($5C48),A
5DE2 LD IX,$DAC0 IX=Percy_X_Position.
5DE6 LD (IX+$23),$00 Write 00 to *IX+23 (Egg_Frame_ID).
5DEA LD (IX+$02),$07 Write WHITE to *IX+02 (Percy_Colour).
5DEE LD (IX+$22),$FF Write FF to *IX+22 (Egg_Colour).
5DF2 CALL Initialise_Lives Call Initialise_Lives.
5DF5 LD A,$FF Write FF to *Pause_Flag.
5DF7 LD ($5FBC),A
Game pause input loop.
Pause_InputLoop 5DFA CALL MainGameLoop Call MainGameLoop.
5DFD LD A,$FD Read from the keyboard;
Port Number Bit
0 1 2 3 4
FD A S D F G
5DFF IN A,($FE)
5E01 AND %00000010 Keep only the bit which relates to the "S" key (bit 1).
5E03 CALL Z,Pause_BorderEffect Call Pause_BorderEffect if the "S" key was pressed.
5E06 CALL Run_Game_Frame Call Run_Game_Frame.
5E09 NOP No operation.
5E0A NOP
5E0B XOR A Write 00 to;
5E0C LD ($5FBB),A
5E0F LD ($5FBD),A
5E12 LD BC,$7FFE Read from the keyboard;
Port Number Bit
0 1 2 3 4
7F SPACE FULL-STOP M N B
5E15 IN A,(C)
5E17 RRA Jump back to Pause_InputLoop if "SPACE" was not pressed.
5E18 JR C,Pause_InputLoop
The "SPACE" key has been pressed.
5E1A LD B,$FE Read from the keyboard;
Port Number Bit
0 1 2 3 4
FE SHIFT Z X C V
5E1C IN A,(C)
5E1E RRA Jump back to Pause_InputLoop if "CAPS SHIFT" was not pressed.
5E1F JR C,Pause_InputLoop
Both "SPACE" and "CAPS SHIFT" were held down, so reset the game.
5E21 EI Enable interrupts.
5E22 JR Game_Initialise Jump to Game_Initialise.
Prev: 5BFE Up: Map Next: 5E24