Prev: 44137 Up: Map Next: 44200
44141: Save Game
Used by the routines at Action_Save and Action_Quit.
Copy the configurable exits into the save buffer and write them to tape.
SaveGame 44141 LD A,(44794) Read the configurable-exit count into A.
44144 OR A Jump to SaveGame_StartTape if there are no configurable exits to pack.
44145 JR Z,SaveGame_StartTape
B counts the exits, IX walks their addresses and DE the save buffer.
44147 LD B,A Take the exit count and point at the exit table and the save buffer.
44148 LD IX,(44774)
44152 LD DE,44699
44155 JR SaveGame_StoreFlag Start with the first configurable exit.
Move on to the next configurable-exit address.
SaveGame_CopyExit 44157 INC IX Move IX on to the next exit address and DE on to the next packed exit byte.
44159 INC IX
44161 INC DE
SaveGame_StoreFlag 44162 LD L,(IX+0) Fetch the exit address from *IX into HL, copy the exit byte into the packed save buffer, and repeat until every exit byte is packed.
44165 LD H,(IX+1)
44168 LD A,(HL)
44169 LD (DE),A
44170 DJNZ SaveGame_CopyExit
SaveGame_StartTape 44172 LD HL,45146 Print "SAVING. Start tape,press any key." and start a new line.
44175 CALL PrintStringAndNewline
44178 CALL GetUserInput Call GetUserInput to read the player's key.
44181 LD IX,44406 Load the starting address into IX at the item-location table.
44185 LD DE,390 Set the block length in DE to 390 bytes.
44188 LD A,255 Set A to 255 which indicates this is a data block.
44190 CALL 1218 Call SA_BYTES.
44193 LD HL,45180 Print "Stop tape.Saving complete." and start a new line.
44196 CALL PrintStringAndNewline
44199 RET Return.
Prev: 44137 Up: Map Next: 44200