jetpac | Routines |
Prev: 70f5 | Up: Map | Next: 7115 |
Scores are stored as decimal values in 3-bytes (making 999999 the maximum score). A score of 15,120 decimal is stored in hex as: $01,$51,$20. This routine displays each byte (reading left-to-right) of the score in two steps.
|
||||||||||
70fb | ld b,$03 | Loop counter for the 3 bytes | ||||||||
70fd | ld a,(de) | Score value. Example, if 85 points: | ||||||||
70fe | rrca | A=11000010, C=1 | ||||||||
70ff | rrca | A=01100001, C=0 | ||||||||
7100 | rrca | A=10110000, C=1 | ||||||||
7101 | rrca | A=01011000, C=0 | ||||||||
7102 | and $0f | A=00001000 | ||||||||
7104 | add a,$30 | A=00111000 - $30 + $08 = ASCII char `8` | ||||||||
7106 | call $7115 | Display font character | ||||||||
7109 | ld a,(de) | And again with the same byte: | ||||||||
710a | and $0f | A=00000101 | ||||||||
710c | add a,$30 | A=00110101 - $30 + $05 = ASCII char `5` | ||||||||
710e | call $7115 | Display font character | ||||||||
7111 | inc de | Process next score byte | ||||||||
7112 | djnz $70fd | |||||||||
7114 | ret |
Prev: 70f5 | Up: Map | Next: 7115 |