Prev: BA36 Up: Map Next: BA7E
BA57: Print the number of lives
Used by the routines at COLOUR_PANEL and EXTRA_LIFE.
LIVES as two BCD digits into the buffer at pixel x 128, y 7, on the panel. Called when the panel is drawn (COLOUR_PANEL) and when an extra life is taken (EXTRA_LIFE), which then copies the two characters to the screen (BLIT_2X8).
LIVES counts in binary (START sets 5, NEW_LIFE takes one, EXTRA_LIFE adds one), so the display is right only while he has fewer than ten -- as in Knight Lore.
PRINT_LIVES BA57 LD DE,LIVES one byte, LIVES, into the buffer at pixel row 7, byte column 16
BA5A LD B,$01
BA5C LD HL,$D2F0
BA5F JP PRINT_BCD_NUMBER
This entry point is used by the routine at PRINT_CHAMBERS.
Print B bytes of BCD from DE into the buffer at HL, two digits each, the high digit first. Also used by PRINT_CHAMBERS for the chambers activated.
PRINT_BCD_NUMBER BA62 PUSH HL the font itself as FONT_BASE: digits are codes 0 to 9
BA63 LD HL,FONT
BA66 LD (FONT_BASE),HL
BA69 POP HL
This entry point is used by the routine at PRINT_SUMMARY_COUNTS.
PRINT_BCD_BYTE BA6A LD A,(DE) the high digit
BA6B RRCA
BA6C RRCA
BA6D RRCA
BA6E RRCA
BA6F AND $0F
BA71 CALL PRINT_CHAR
This entry point is used by the routine at PRINT_SUMMARY_COUNTS.
PRINT_BCD_LSD BA74 LD A,(DE) the low digit; coming in here prints only the low digit of the first byte (PRINT_SUMMARY_COUNTS)
BA75 AND $0F
BA77 CALL PRINT_CHAR
BA7A INC DE the next byte
BA7B DJNZ PRINT_BCD_BYTE
BA7D RET
Prev: BA36 Up: Map Next: BA7E