Prev: 38427 Up: Map Next: 38575
38465: Show Game Statistics
Used by the routines at GameOver and GameComplete.
Prints the time, score and percentage of rooms visited, each with its label, on the game over screen.
Before After
statistics-before statistics-after
GameStats 38465 CALL CalculateRoomsVisited Call CalculateRoomsVisited to calculate the percentage of rooms visited.
Handle printing the time.
38468 LD HL,16448 HL=16448 (screen buffer location).
38471 LD DE,38527 Point DE at the label for the time at StringTime.
38474 CALL PrintStringColour Call PrintStringColour to print the string.
Handle printing the score.
38477 LD HL,20544 HL=20544 (screen buffer location).
38480 LD DE,38543 Point DE at the label for the score at StringScore.
38483 CALL PrintStringColour Call PrintStringColour to print the string.
Handle printing the percentage label.
38486 LD HL,24640 HL=24640 (screen buffer location).
38489 LD DE,38559 Point DE at the label for the percentage at StringPercentage.
38492 CALL PrintStringColour Call PrintStringColour to print the string.
Handle printing the clock.
38495 LD HL,49100 Write main font "0" to FontPointer.
38498 LD (24065),HL
38501 LD HL,16512 HL=16512 (screen buffer location).
38504 CALL PrintClock Call PrintClock to print the clock.
Handle printing the score.
38507 LD HL,20608 HL=20608 (screen buffer location).
38510 CALL PrintScore Call PrintScore to print the score.
Handle printing the percentage of rooms visited.
38513 LD HL,24704 HL=24704 (screen buffer location).
38516 CALL ScreenAddress Call ScreenAddress to get the screen address.
38519 LD DE,24148 Point DE at the visited percentage at VisitedPercentage.
38522 LD B,1 B=1.
38524 JP PrintScore_Loop Jump to PrintScore_Loop to print the score.
The strings for the three labels. Each is in the format that PrintStringColour prints: an attribute, followed by the characters, with bit 7 set on the last character.
StringTime 38527 DEFM 69 Attribute: INK:CYAN, PAPER:BLACK (BRIGHT) + "TIME" and a colon (character code 35 is drawn as ":" in the font).
38528 DEFM "TIME # "," "+128
StringScore 38543 DEFM 69 Attribute: INK:CYAN, PAPER:BLACK (BRIGHT) + "SCORE".
38544 DEFM "SCORE "," "+128
StringPercentage 38559 DEFM 69 Attribute: INK:CYAN, PAPER:BLACK (BRIGHT) + a percent sign (character code 36 is drawn as "%" in the font).
38560 DEFM "$ "," "+128
Prev: 38427 Up: Map Next: 38575