Prev: 83F5 Up: Map Next: 8451
842E: Print: Percentage Digit
Used by the routine at GameOver_Start.
Turns one decimal digit of the score into ASCII, counting up from '0'.
Converts e.g. "0075" into "7.5" in ASCII for display purposes.
PercentageAscii 842E LD A,$2F Start the quotient digit one below '0'.
PercentageAscii_Loop 8430 INC A Count the digit up by one.
8431 AND A Clear carry for the subtraction.
8432 SBC HL,DE Subtract the power of ten in DE from HL.
8434 JR NC,PercentageAscii_Loop Jump back to PercentageAscii_Loop to count another digit unless the subtraction went below zero.
8436 ADD HL,DE Add the power of ten back to leave the remainder.
8437 CP $30 Compare against 30 (ASCII "0") to set flags for the return.
8439 RET Return.
Reached through the special-key table at 8271, dispatched from Command_MatchASpecialKey.
843A LD A,$04 Set the border to 04 (green).
843C OUT ($FE),A
843E CALL DebounceAnyKey Call DebounceAnyKey to debounce keyboard.
Wait_ForKey 8441 XOR A Read from the keyboard port.
8442 IN A,($FE)
8444 AND %00011111 Keep bits 0-4, one for each key in the half-row. XOR A then IN A,(FE) reads every half-row at once, and a pressed key reads as a reset bit.
8446 CP $1F Loop back to Wait_ForKey while a key is being pressed.
8448 JR NZ,Wait_ForKey
844A LD A,$07 Set the border to 07 (white).
844C OUT ($FE),A
844E JP CommandDispatchAControl Jump back to CommandDispatchAControl to dispatch a control.
Prev: 83F5 Up: Map Next: 8451