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 Write 23 to BottomRow.
24593 LD (23447),A
24596 LD A,22 Write 22 to PrintRow.
24598 LD (23433),A
24601 CALL HomeRow Call HomeRow.
24604 XOR A Write 0 to PrintColumn.
24605 LD (23434),A
24608 CALL ClearScreen Call ClearScreen.
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.
Clear the command bytes.
PrepareGame_ClearCommand 24616 LD (HL),0 Write 0.
24618 INC HL Advance.
24619 DJNZ PrepareGame_ClearCommand Jump to PrepareGame_ClearCommand until the five bytes are done.
24621 XOR A Write 0 to Continuation.
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.
Clear the state and flags.
PrepareGame_ClearState 24630 LD (HL),0 Write 0.
24632 INC HL Advance.
24633 DJNZ PrepareGame_ClearState Jump to PrepareGame_ClearState until the state is cleared.
24635 LD HL,46760 Point HL at InitialObjects.
24638 LD DE,24010 Point DE at ObjectLocations.
24641 LD BC,256 256 bytes.
24644 LDIR Copy them.
24646 LD HL,24658 Point HL at InitialState.
24649 LD DE,23944 Point DE at Darkness.
24652 LD BC,6 0006 bytes.
24655 LDIR Copy them.
24657 RET Return.
Prev: 24561 Up: Map Next: 24658