Prev: EE89 Up: Map Next: EEAE
EE91: Action: Quit
Ask whether to abandon the game and, if so, offer to save it.
Action_Quit EE91 CALL Parser_ValidateNoDirectObject Call Parser_ValidateNoDirectObject.
The "QUIT" command can only be called on its own.
EE94 RET C Return if there's any token set in UserInput_SecondToken.
Print "Want to save the game? Y/N.".
EE95 LD HL,$BC85 HL=Messaging_WantToSaveTheGameYN.
EE98 CALL PrintStringAndNewline Call PrintStringAndNewline.
WantToSave_Loop EE9B CALL GetUserInput Call GetUserInput.
The player just wants to quit.
EE9E CP $4E Jump to QuitGame if the keypress is "N".
EEA0 JR Z,QuitGame
EEA2 CP $59 Jump back to WantToSave_Loop if the keypress is anything other than "Y".
EEA4 JR NZ,WantToSave_Loop
The player does want to save before quitting...
EEA6 CALL SaveGame Call SaveGame.
Jump to asking if the player "wants another game?"
QuitGame EEA9 LD HL,$EB29 Switch WantAnotherGameInput onto the stack so the next return action is asking if the player would "Want another game? Y/N.".
EEAC EX (SP),HL
EEAD RET Return.
Prev: EE89 Up: Map Next: EEAE