Prev: C38D Up: Map Next: CB0A
CAB3: Print Numbers
Used by the routines at Print_HighScoreTable, Messaging_GameOver and Print_Bonus.
PrintNumbers CAB3 LD A,$00 A=00.
CAB5 RLD RLD.
CAB7 PUSH AF Stash AF on the stack.
CAB8 CP $00 Jump to PrintNumbers_1 if A is not 00.
CABA JR NZ,PrintNumbers_1
CABC LD A,$20 A=20.
CABE CALL PrintNumbers_Print Call PrintNumbers_Print.
CAC1 POP AF Restore AF from the stack.
CAC2 RLD RLD.
CAC4 PUSH AF Stash AF on the stack.
CAC5 CP $00 Jump to PrintNumbers_2 if A is not 00.
CAC7 JR NZ,PrintNumbers_2
CAC9 LD A,$20 A=20.
CACB CALL PrintNumbers_Print Call PrintNumbers_Print.
CACE POP AF Restore AF from the stack.
CACF RLD RLD.
CAD1 DEC HL Decrease HL by one.
CAD2 DJNZ PrintNumbers Decrease counter by one and loop back to PrintNumbers until counter is zero.
CAD4 RET Return.
PrintNumbers_0 CAD5 LD A,$00 A=00.
CAD7 RLD RLD.
CAD9 PUSH AF Stash AF on the stack.
PrintNumbers_1 CADA ADD A,$30 A+=30.
CADC CALL PrintNumbers_Print Call PrintNumbers_Print.
CADF POP AF Restore AF from the stack.
CAE0 RLD RLD.
CAE2 PUSH AF Stash AF on the stack.
PrintNumbers_2 CAE3 ADD A,$30 A+=30.
CAE5 CALL PrintNumbers_Print Call PrintNumbers_Print.
CAE8 POP AF Restore AF from the stack.
CAE9 RLD RLD.
CAEB DEC HL Decrease HL by one.
CAEC DJNZ PrintNumbers_0 Decrease counter by one and loop back to PrintNumbers_0 until counter is zero.
CAEE RET Return.
This is similar in functionality to PrintString. It differs as it doesn't use a terminator rather the length is known.
PrintNumbers_Print CAEF PUSH HL Stash HL and BC on the stack.
CAF0 PUSH BC
CAF1 LD L,A L=A.
CAF2 LD H,$00 H=00.
CAF4 ADD HL,HL HL*=08.
CAF5 ADD HL,HL
CAF6 ADD HL,HL
CAF7 LD BC,$E417 BC=Font.
CAFA DEC B Decrease B by one.
CAFB ADD HL,BC HL+=BC.
CAFC PUSH DE Stash DE on the stack.
CAFD LD B,$08 B=08 (counter).
PrintNumbers_Print_Loop CAFF LD A,(HL) A=*HL.
CB00 LD (DE),A Write A to *DE.
CB01 INC HL Increment HL by one.
CB02 INC D Increment D by one.
CB03 DJNZ PrintNumbers_Print_Loop Decrease counter by one and loop back to PrintNumbers_Print_Loop until counter is zero.
CB05 POP DE Restore DE from the stack.
CB06 INC DE Increment DE by one.
CB07 POP BC Restore BC and HL from the stack.
CB08 POP HL
CB09 RET Return.
Prev: C38D Up: Map Next: CB0A