Prev: C32D Up: Map Next: C380
C345: Save Game
Used by the routines at Action_Save and Action_Quit.
Ask for a tape and write the game state out.
SaveGame C345 LD A,($BB02) Jump to SaveGame_PrintSaving when *Count_ConfigurableExits is zero, so there are no configurable exits to pack.
C348 OR A
C349 JR Z,SaveGame_PrintSaving
C34B LD B,A Take the exit addresses and the save area.
C34C LD IX,($BAF2)
C350 LD DE,$BA69
C353 JR SaveGame_StoreFlag
Move on to the next configurable-exit address.
SaveGame_Copy C355 INC IX Move IX on to the next exit address and DE on to the next packed exit byte.
C357 INC IX
C359 INC DE
SaveGame_StoreFlag C35A 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.
C35D LD H,(IX+$01)
C360 LD A,(HL)
C361 LD (DE),A
C362 DJNZ SaveGame_Copy
Print "SAVING. Start tape,press any key.".
SaveGame_PrintSaving C364 LD HL,$BC48 Print "SAVING. Start tape,press any key." and wait for a key.
C367 CALL PrintStringAndNewline
C36A CALL GetUserInput
C36D LD IX,$B9C8 Load the starting address into IX at Table_ItemLocations.
C371 LD DE,$013C Set the block length in DE to 013C bytes.
C374 LD A,$FF Set A to FF which indicates this is a data block.
C376 CALL $04C2 Call SA_BYTES.
Print "Stop tape.Saving complete.".
C379 LD HL,$BC6A Print "Stop tape.Saving complete.".
C37C CALL PrintStringAndNewline
C37F RET Return.
Prev: C32D Up: Map Next: C380