Prev: 33775 Up: Map Next: 33838
33781: Game Over: Print The Score
Used by the routines at Command_FollowTheGrammarFlag, GameOver and YouAreDead.
Prints the score as a percentage of the adventure, taken from the percentage complete, and finishes the game-over text.
Actions "game over".
GameOver_Start 33781 PUSH HL Write 0 to WaitCountdown.
33782 PUSH DE
33783 XOR A
33784 LD (46849),A
33787 LD HL,46164 Point at the message "you have mastered [0x16]" (46164).
33790 CALL PrintMessage Call PrintMessage to print message.
33793 LD HL,(46839) Read the percentage complete from PercentageComplete.
33796 LD DE,100 Divide by 0100 (100).
33799 CALL PercentageAscii Call PercentageAscii to make the hundreds digit.
33802 CALL NZ,Print_Character Call Print_Character if PercentageAscii made a hundreds digit other than zero.
33805 LD DE,10 Divide by 0010 (10).
33808 CALL PercentageAscii Call PercentageAscii to make the tens digit.
33811 CALL Print_Character Call Print_Character to print one character.
33814 LD A,46 Use the character '.'.
33816 CALL Print_Character Call Print_Character to print one character.
33819 LD A,L Copy the remainder into A as the percentage digit.
33820 ADD A,48 Add 48 to make the ASCII digit.
33822 CALL Print_Character Call Print_Character to print one character.
33825 XOR A Clear the capitalise-the-next-letter flag.
33826 LD (46852),A
33829 LD HL,46178 Point at the message "% of this adventure" (46178).
33832 CALL PrintMessage Call PrintMessage to print message.
33835 POP DE Restore DE and HL from the stack.
33836 POP HL
33837 RET Return.
Prev: 33775 Up: Map Next: 33838