Prev: 24561 Up: Map Next: 24658
24591: Prepare New Game
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 22 and 23 until a location description moves it.
PrepareGame 24591 LD A,23 The text window uses rows 22 and 23.
24593 LD (23447),A
24596 LD A,22 The cursor starts on row 22.
24598 LD (23433),A
24601 CALL HomeRow Call HomeRow to home that row.
24604 XOR A Column 0.
24605 LD (23434),A
24608 CALL ClearScreen Call ClearScreen to blank the display.
Forget the verb, the noun and the three counters.
24611 LD HL,23423 Point at the five command bytes at Verb.
24614 LD B,5 Five bytes: the verb, the noun and the three counters.
PrepareGame_ClearCommand 24616 LD (HL),0 Clear one byte and step on.
24618 INC HL
24619 DJNZ PrepareGame_ClearCommand
24621 XOR A There is no comma left over from a previous game.
24622 LD (23429),A
A new game starts in room 0 with empty flags, then the authored state is copied in.
24625 LD HL,23943 Point at the state and flag area at CurrentRoom.
24628 LD B,65 65 bytes, through the last flag.
PrepareGame_ClearState 24630 LD (HL),0 Clear one byte and step on.
24632 INC HL
24633 DJNZ PrepareGame_ClearState
24635 LD HL,46760 Copy the initial object locations from InitialObjects.
24638 LD DE,24010
24641 LD BC,256
24644 LDIR
24646 LD HL,24658 Copy the six initial state bytes from InitialState onto Darkness.
24649 LD DE,23944
24652 LD BC,6
24655 LDIR
24657 RET Return.
Prev: 24561 Up: Map Next: 24658