![]() |
Routines |
| Prev: 7130 | Up: Map | Next: 7164 |
|
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 714F is changed to jump to ResetModifiedInFrame instead.
|
||||||||||||||||||||
|
Holding "SHIFT" pauses the game.
|
||||||||||||||||||||
| Pause_Loop | 7145 | LD A,$FE | Read from the keyboard;
|
|||||||||||||||||
| 7147 | OUT ($FD),A | |||||||||||||||||||
| 7149 | IN A,($FE) | |||||||||||||||||||
| 714B | BIT 0,A | Jump to Pause_Loop if the "SHIFT" key has been pressed. | ||||||||||||||||||
| 714D | JR Z,Pause_Loop | |||||||||||||||||||
| 714F | LD HL,($5E17) | HL=see 711E. | ||||||||||||||||||
| 7152 | INC HL | Increment the game timer by one. | ||||||||||||||||||
| 7153 | LD ($5E17),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.
|
||||||||||||||||||||
| 7156 | LD H,$00 | H=00. | ||||||||||||||||||
| 7158 | LD A,R | A=the refresh register. | ||||||||||||||||||
| 715A | LD C,A | C=A. | ||||||||||||||||||
| 715B | LD A,($5E19) | A=RandomNumber. | ||||||||||||||||||
| 715E | ADD A,(HL) | Add the byte from the ROM. | ||||||||||||||||||
| 715F | ADD A,C | Add the refresh register. | ||||||||||||||||||
| 7160 | LD ($5E19),A | Write the new random number to RandomNumber. | ||||||||||||||||||
| 7163 | EX AF,AF' | Keep a copy of the random number in AF'. | ||||||||||||||||||
| Prev: 7130 | Up: Map | Next: 7164 |