![]() |
Routines |
| Prev: 47957 | Up: Map | Next: 48020 |
|
Used by the routines at Action_Save and Action_Quit.
Ask for a tape and write the game state out.
|
||||
| SaveGame | 47961 | LD A,(48434) | Read the configurable-exit count into A. | |
| 47964 | OR A | Jump to SaveGame_PrintSaving if there are no configurable exits to pack. | ||
| 47965 | JR Z,SaveGame_PrintSaving | |||
| 47967 | LD B,A | Copy the configurable-exit count into B. | ||
| 47968 | LD IX,(48418) | IX=*48418. | ||
| 47972 | LD DE,48281 | DE=LoadSaveBuffer. | ||
| 47975 | JR SaveGame_StoreFlag | Jump to SaveGame_StoreFlag. | ||
|
Move on to the next configurable-exit address.
|
||||
| SaveGame_Copy | 47977 | INC IX | Move IX on to the next exit address. | |
| 47979 | INC IX | |||
| 47981 | INC DE | Move DE on to the next packed exit byte. | ||
| SaveGame_StoreFlag | 47982 | LD L,(IX+0) | Fetch the exit address from *IX into HL. | |
| 47985 | LD H,(IX+1) | |||
| 47988 | LD A,(HL) | Copy the exit byte into the packed save buffer. | ||
| 47989 | LD (DE),A | |||
| 47990 | DJNZ SaveGame_Copy | Decrease the pack counter and loop back to SaveGame_Copy until every exit byte is packed. | ||
|
Print "SAVING.
Start tape,press any key.".
|
||||
| SaveGame_PrintSaving | 47992 | LD HL,48760 | HL=Messaging_SavingStartTape. | |
| 47995 | CALL PrintStringAndNewline | Call PrintStringAndNewline. | ||
| 47998 | CALL GetUserInput | Call GetUserInput. | ||
| 48001 | LD IX,48112 | Load the starting address into IX at Table_ItemLocations. | ||
| 48005 | LD DE,324 | Set the block length in DE to 324 bytes. | ||
| 48008 | LD A,255 | Set A to 255 which indicates this is a data block. | ||
| 48010 | CALL 1218 | Call SA_BYTES. | ||
|
Print "Stop tape.Saving complete.".
|
||||
| 48013 | LD HL,48794 | HL=Messaging_StopTape. | ||
| 48016 | CALL PrintStringAndNewline | Call PrintStringAndNewline. | ||
| 48019 | RET | Return. | ||
|
View the equivalent code in;
|
||||
| Prev: 47957 | Up: Map | Next: 48020 |