Prev: 52621 Up: Map Next: 52654
52624: Draw Score To The Screen
Used by the routines at Draw_Score_Alias, Prep_Display_Phase and Scoring.
Draw_Score 52624 LD HL,52619 Starting values;
Source Screen Buffer Counter
Scoredigit01 $50C8 6
52627 LD DE,20680
52630 LD B,6
Scoredigit_Loop 52632 PUSH BC Stash the lot.
52633 PUSH DE
52634 PUSH HL
52635 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
52636 AND A
52637 JR NZ,Scoredigit_Non_Zero
52639 ADD A,10
Scoredigit_Non_Zero 52641 ADD A,35
52643 CALL Draw_Number
52646 POP HL Retrieve our current source, destination and counter from the stack.
52647 POP DE
52648 POP BC
52649 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.
52650 DEC HL
52651 DJNZ Scoredigit_Loop
52653 RET Return.
Prev: 52621 Up: Map Next: 52654