![]() |
Routines |
| Prev: A5B1 | Up: Map | Next: A647 |
|
Used by the routine at ENTRY.
Entered from ENTRY when the game is first run. Clears the variables and all 56 object records, from SEED up to BELOW_BLOCK, keeping only the ROM's frame counter, which becomes the seed (SEED): a machine switched on for a different time gets a different game. The frame counter has to be read first because it lies inside the object records (FRAMES, in record 7), which the clear wipes.
As Knight Lore's cold start, but for the call to R_CHECK_LEFTOVER, which does nothing that lasts.
|
||||
| START | A631 | LD HL,SEED | from SEED up to BELOW_BLOCK: the variables and the 56 object records | |
| A634 | LD BC,$0788 | |||
| A637 | LD A,(FRAMES) | FRAMES, the ROM's frame counter, kept on the stack | ||
| A63A | PUSH AF | |||
| A63B | CALL CLR_MEM | clear them, and the counter becomes the seed | ||
| A63E | POP AF | |||
| A63F | LD (SEED),A | |||
| A642 | CALL R_CHECK_LEFTOVER | a leftover that returns at once | ||
| A645 | JR MAIN_NEW_GAME | and set up a game | ||
| Prev: A5B1 | Up: Map | Next: A647 |