Prev: AC69 Up: Map Next: ACA8
AC6D: 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 AC6D LD A,($AEFA) Read the configurable-exit count into A.
AC70 OR A Jump to SaveGame_StartTape if there are no configurable exits to pack.
AC71 JR Z,SaveGame_StartTape
B counts the exits, IX walks their addresses and DE the save buffer.
AC73 LD B,A Take the exit count and point at the exit table and the save buffer.
AC74 LD IX,($AEE6)
AC78 LD DE,$AE9B
AC7B JR SaveGame_StoreFlag Start with the first configurable exit.
Move on to the next configurable-exit address.
SaveGame_CopyExit AC7D INC IX Move IX on to the next exit address and DE on to the next packed exit byte.
AC7F INC IX
AC81 INC DE
SaveGame_StoreFlag AC82 LD L,(IX+$00) 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.
AC85 LD H,(IX+$01)
AC88 LD A,(HL)
AC89 LD (DE),A
AC8A DJNZ SaveGame_CopyExit
SaveGame_StartTape AC8C LD HL,$B05A Print "SAVING. Start tape,press any key." and start a new line.
AC8F CALL PrintStringAndNewline
AC92 CALL GetUserInput Call GetUserInput to read the player's key.
AC95 LD IX,$AD76 Load the starting address into IX at the item-location table.
AC99 LD DE,$0186 Set the block length in DE to 0186 bytes.
AC9C LD A,$FF Set A to FF which indicates this is a data block.
AC9E CALL $04C2 Call SA_BYTES.
ACA1 LD HL,$B07C Print "Stop tape.Saving complete." and start a new line.
ACA4 CALL PrintStringAndNewline
ACA7 RET Return.
Prev: AC69 Up: Map Next: ACA8