Prev: A5C6 Up: Map Next: A605
A5CA: Save Game
Used by the routines at Action_Save and Action_Quit.
SaveGame A5CA LD A,($A7F0) Read the configurable-exit count into A.
A5CD OR A Jump to SaveGame_PrintSaving if there are no configurable exits to pack.
A5CE JR Z,SaveGame_PrintSaving
A5D0 LD B,A Copy the configurable-exit count into B.
A5D1 LD IX,($A7DC) IX=*A7DC.
A5D5 LD DE,$A791 DE=Buffer_LoadSave.
A5D8 JR SaveGame_StoreFlag Jump to SaveGame_StoreFlag.
Move on to the next configurable-exit address.
SaveGame_Copy A5DA INC IX Move IX on to the next exit address.
A5DC INC IX
A5DE INC DE Move DE on to the next packed exit byte.
SaveGame_StoreFlag A5DF LD L,(IX+$00) Fetch the exit address from *IX into HL.
A5E2 LD H,(IX+$01)
A5E5 LD A,(HL) Copy the exit byte into the packed save buffer.
A5E6 LD (DE),A
A5E7 DJNZ SaveGame_Copy Decrease the pack counter and loop back to SaveGame_Copy until every exit byte is packed.
Print "SAVING. Position tape. Press REC & PLAY,then any key.".
SaveGame_PrintSaving A5E9 LD HL,$A950 HL=Messaging_Saving.
A5EC CALL PrintStringAndNewline Call PrintStringAndNewline.
A5EF CALL GetUserInput Call GetUserInput.
A5F2 LD IX,$A66C Load the starting address into IX at Table_ItemEventLocations.
A5F6 LD DE,$0186 Set the block length in DE to 0186 bytes.
A5F9 LD A,$FF Set A to FF which indicates this is a data block.
A5FB CALL $04C2 Call SA_BYTES.
Print "Stop tape.Saving complete.".
A5FE LD HL,$A986 HL=Messaging_StopTapeSavingComplete.
A601 CALL PrintStringAndNewline Call PrintStringAndNewline.
A604 RET Return.
Prev: A5C6 Up: Map Next: A605