![]() |
Routines |
| Prev: 5FF1 | Up: Map | Next: 6052 |
|
Used by the routine at GameLoop.
Clears the screen, forgets the previous command and copies the initial object locations and state into place.
|
||||
|
The text window sits on rows 16 and 17 until a location description moves it.
|
||||
| PrepareGame | 600F | LD A,$17 | The text window uses rows 16 and 17. | |
| 6011 | LD ($5B97),A | |||
| 6014 | LD A,$16 | The cursor starts on row 16. | ||
| 6016 | LD ($5B89),A | |||
| 6019 | CALL HomeRow | Call HomeRow to home that row. | ||
| 601C | XOR A | Column 0. | ||
| 601D | LD ($5B8A),A | |||
| 6020 | CALL ClearScreen | Call ClearScreen to blank the display. | ||
|
Forget the verb, the noun and the three counters.
|
||||
| 6023 | LD HL,$5B7F | Point at the five command bytes at Verb. | ||
| 6026 | LD B,$05 | Five bytes: the verb, the noun and the three counters. | ||
| PrepareGame_ClearCommand | 6028 | LD (HL),$00 | Clear one byte and step on. | |
| 602A | INC HL | |||
| 602B | DJNZ PrepareGame_ClearCommand | |||
| 602D | XOR A | There is no comma left over from a previous game. | ||
| 602E | LD ($5B85),A | |||
|
A new game starts in room 0 with empty flags, then the authored state is copied in.
|
||||
| 6031 | LD HL,$5D87 | Point at the state and flag area at CurrentRoom. | ||
| 6034 | LD B,$41 | 41 bytes, through the last flag. | ||
| PrepareGame_ClearState | 6036 | LD (HL),$00 | Clear one byte and step on. | |
| 6038 | INC HL | |||
| 6039 | DJNZ PrepareGame_ClearState | |||
| 603B | LD HL,$B6A8 | Copy the initial object locations from InitialObjects. | ||
| 603E | LD DE,$5DCA | |||
| 6041 | LD BC,$0100 | |||
| 6044 | LDIR | |||
| 6046 | LD HL,$6052 | Copy the six initial state bytes from InitialState onto Darkness. | ||
| 6049 | LD DE,$5D88 | |||
| 604C | LD BC,$0006 | |||
| 604F | LDIR | |||
| 6051 | RET | Return. | ||
| Prev: 5FF1 | Up: Map | Next: 6052 |