Prev: CD8D Up: Map Next: CDAE
CD90: Draw Score To The Screen
Used by the routines at Draw_Score_Alias, Prep_Display_Phase and Scoring.
Draw_Score CD90 LD HL,$CD8B Starting values;
Source Screen Buffer Counter
Scoredigit01 $50C8 06
CD93 LD DE,$50C8
CD96 LD B,$06
Scoredigit_Loop CD98 PUSH BC Stash the lot.
CD99 PUSH DE
CD9A PUSH HL
CD9B LD A,(HL) Grab the number at the source memory location;
  • If it's zero then add $0A (as the numbers are stored 1-2-3-4-5-6-7-8-9-0 whereas ASCII uses 0-1-2-3-4-5-6-7-8-9)
  • add $23 (so for example "2" will be "$25" - see Draw_Number)
  • Call Draw_Number
CD9C AND A
CD9D JR NZ,Scoredigit_Non_Zero
CD9F ADD A,$0A
Scoredigit_Non_Zero CDA1 ADD A,$23
CDA3 CALL Draw_Number
CDA6 POP HL Retrieve our current source, destination and counter from the stack.
CDA7 POP DE
CDA8 POP BC
CDA9 INC DE Increase the screen buffer memory location by one, decrease the source memory location and loop round to Scoredigit_Loop until it is zero.
CDAA DEC HL
CDAB DJNZ Scoredigit_Loop
CDAD RET Return.
Prev: CD8D Up: Map Next: CDAE