Prev: BA22 Up: Map Next: BA79
BA29: The game-over summary screen
Used by the routine at game_complete_msg.
Clears the screen and its buffer and writes the six-line summary -- time taken, percentage of the quest completed, charms collected and an overall rating -- then fills in the numbers. The text goes into the buffer at screen_buffer while the attributes go straight to the screen, so nothing shows until print_charms_and_show copies the buffer across.
The rating is one of eight words from rating_tbl. Bit 0 of $5BC3 (the quest finished) picks the better four; bits 5 and 6 of $5BC6, the number of rooms visited less one, pick one of those four. So the rating moves up a step for every 32 rooms seen, and a player who finishes having seen more of the castle is rated higher than one who took a short cut.
game_over_summary BA29 CALL clear_scrn_buffer blank the buffer and the screen
BA2C CALL clear_scrn
BA2F LD DE,gameover_colours six lines: colours from gameover_colours, positions from gameover_xy, text from gameover_text
BA32 EXX
BA33 LD HL,gameover_xy
BA36 LD DE,gameover_text
BA39 LD B,$06
BA3B CALL display_text_list
BA3E LD HL,$E8E2 the days taken, two BCD digits from $5BB9, into the buffer at y=127, column 15
BA41 LD DE,$5BB9
BA44 LD B,$01
BA46 CALL print_BCD_number
BA49 CALL calc_and_display_percent count the rooms visited and print the percentage
BA4C LD A,($5BC6) bits 6 and 5 of rooms-visited-less-one, moved up to bits 7 and 6
BA4F RLCA
BA50 AND $C0
BA52 LD C,A
BA53 LD A,($5BC3) add the quest-complete flag as bit 0
BA56 AND $01
BA58 OR C
BA59 RLCA rotate into place: complete*8 + visited bits * 2, a word offset
BA5A RLCA
BA5B RLCA
BA5C AND $0E
BA5E LD L,A DE = the rating text's address from rating_tbl
BA5F LD H,$00
BA61 LD BC,rating_tbl
BA64 ADD HL,BC
BA65 LD E,(HL)
BA66 INC HL
BA67 LD D,(HL)
BA68 LD HL,$2758 print it at x=$58, y=$27; its first byte is its colour
BA6B CALL print_text_std_font
BA6E LD DE,$5BBB the charms count is kept in binary (0 to 14): turn 10 to 14 into BCD for printing -- harmless, since the game is over
BA71 LD A,(DE)
BA72 SUB $0A
BA74 JR C,print_charms_and_show
BA76 OR $10
BA78 LD (DE),A
Prev: BA22 Up: Map Next: BA79