Prev: 28976 Up: Map Next: 29028
28997: End Of Pass
The housekeeping which is done at the end of every pass through the objects: this pauses the game while "SHIFT" is held down, adds one to the game timer and updates the random number. In the fast pass the instruction at 29007 is changed to jump to ResetModifiedInFrame instead.
Holding "SHIFT" pauses the game.
Pause_Loop 28997 LD A,254 Read from the keyboard;
Port Number Bit
0 1 2 3 4
254 SHIFT Z X C V
28999 OUT (253),A
29001 IN A,(254)
29003 BIT 0,A Jump to Pause_Loop if the "SHIFT" key has been pressed.
29005 JR Z,Pause_Loop
29007 LD HL,(24087) HL=see 28958.
29010 INC HL Increment the game timer by one.
29011 LD (24087),HL Write the game timer back to GameTimer.
The random number is the old random number added to the byte of the ROM found using the low byte of the game timer, and added to the refresh register.
29014 LD H,0 H=0.
29016 LD A,R A=the refresh register.
29018 LD C,A C=A.
29019 LD A,(24089) A=RandomNumber.
29022 ADD A,(HL) Add the byte from the ROM.
29023 ADD A,C Add the refresh register.
29024 LD (24089),A Write the new random number to RandomNumber.
29027 EX AF,AF' Keep a copy of the random number in AF'.
Prev: 28976 Up: Map Next: 29028