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 *BB02 is zero, so there is no flag state to copy.
C348 OR A
C349 JR Z,SaveGame_PrintSaving
C34B LD B,A Take the flag addresses and the save area.
C34C LD IX,($BAF2)
C350 LD DE,$BA69
C353 JR SaveGame_StoreFlag
SaveGame_Copy C355 INC IX Step to the next flag address and the next save byte.
C357 INC IX
C359 INC DE
SaveGame_StoreFlag C35A LD L,(IX+$00) Copy that flag into the save area and repeat until every flag is stored.
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 PrintStringAndANewline
C36A CALL GetUserInput
C36D LD IX,$B9C8 Point the save at the game state (GameState) for 013C bytes, marked as a data block.
C371 LD DE,$013C
C374 LD A,$FF
C376 CALL $04C2 Call SA_BYTES.
Print "Stop tape.Saving complete.".
C379 LD HL,$BC6A Print "Stop tape.Saving complete.".
C37C CALL PrintStringAndANewline
C37F RET Return.
Prev: C32D Up: Map Next: C380