Prev: D08B Up: Map Next: D0E6
D0A7: Print Wave Number
Used by the routine at RenderHUD.
Prints the current wave number at pixel position X=*WaveDisplay_X_PixelPosition, Y=BB using the print dispatch system at PrintDispatch. The wave number is stored in packed BCD at WaveNumber: the high nibble holds the tens digit and the low nibble holds the units digit; each is OR'd with 30 to convert it to an ASCII decimal character before dispatch. Font 00 is selected for rendering and font 01 is restored on return.
PrintWaveNumber D0A7 LD A,$1A Call PrintDispatch with 1A (Select Font control code).
D0A9 CALL PrintDispatch
D0AC LD A,$00 Call PrintDispatch with 00 (font 00).
D0AE CALL PrintDispatch
D0B1 LD A,$16 Call PrintDispatch with 16 (PRINT AT control code).
D0B3 CALL PrintDispatch
D0B6 LD A,($C41D) A=*WaveDisplay_X_PixelPosition (X pixel position for the wave number display).
D0B9 CALL PrintDispatch Call PrintDispatch; the PRINT AT X handler stores the X position and installs the Y handler.
D0BC LD A,$BB A=BB (Y pixel position).
D0BE CALL PrintDispatch Call PrintDispatch; the PRINT AT Y handler stores the Y position and restores the default handler.
D0C1 LD A,($C408) A=*WaveNumber (BCD wave number).
D0C4 SRL A Shift A right four positions to isolate the tens digit (high nibble, 00–09).
D0C6 SRL A
D0C8 SRL A
D0CA SRL A
D0CC OR %00110000 Convert the tens digit to its ASCII character ("0"–"9").
D0CE CALL PrintDispatch Call PrintDispatch to print the tens digit.
D0D1 LD A,($C408) A=*WaveNumber (BCD wave number again).
D0D4 AND %00001111 Isolate the units digit (low nibble, 00–09).
D0D6 OR %00110000 Convert the units digit to its ASCII character ("0"–"9").
D0D8 CALL PrintDispatch Call PrintDispatch to print the units digit.
D0DB LD A,$1A Call PrintDispatch with 1A (Select Font control code).
D0DD CALL PrintDispatch
D0E0 LD A,$01 Call PrintDispatch with 01 (restore font 01).
D0E2 CALL PrintDispatch
D0E5 RET Return.
Prev: D08B Up: Map Next: D0E6