Routines |
Prev: 6B46 | Up: Map | Next: 6BB2 |
|
||||||||
6B69 | PUSH DE | Save the display file address | ||||||
6B6A | LD HL,$E31F | Clear the 21-byte buffer at E30B, which will hold the graphic data for the number to be printed (21 bytes = 7 pixel rows, 3 bytes per row) | ||||||
6B6D | LD B,$15 | |||||||
6B6F | LD (HL),$00 | |||||||
6B71 | DEC L | |||||||
6B72 | DJNZ $6B6F | |||||||
6B74 | LD L,B | HL=E300 (where the ASCII codes of the digits are stored) | ||||||
6B75 | LD A,(HL) | Pick up the ASCII code of the next digit | ||||||
6B76 | AND A | Have we done all the digits? | ||||||
6B77 | JR Z,$6BA0 | Jump if so | ||||||
6B79 | LD E,A | E=ASCII code for the digit (0x30-0x39) | ||||||
6B7A | LD D,$D7 | Point DE at the appropriate entry in the table of font character bitmap widths at D720 | ||||||
6B7C | INC HL | Point HL at the next digit and save this address for later | ||||||
6B7D | PUSH HL | |||||||
6B7E | LD A,(DE) | A=width of the font character bitmap (in pixels) | ||||||
6B7F | LD C,A | Copy this to C | ||||||
6B80 | INC D | Point DE at the next bitmap pixel column | ||||||
6B81 | LD A,(DE) | A=next pixel column of bitmap data for this digit | ||||||
6B82 | LD L,$1F | Point HL at the last byte of the graphic data buffer | ||||||
6B84 | LD B,$07 | There are 7 rows of pixels in the buffer | ||||||
6B86 | RRCA | Skip the bottom row of pixels in the bitmap data | ||||||
6B87 | RRCA | Roll a pixel column into the buffer | ||||||
6B88 | RL (HL) | |||||||
6B8A | DEC HL | |||||||
6B8B | RL (HL) | |||||||
6B8D | DEC HL | |||||||
6B8E | RL (HL) | |||||||
6B90 | DEC HL | |||||||
6B91 | DJNZ $6B87 | |||||||
6B93 | DEC C | Next pixel column | ||||||
6B94 | JP M,$6B9C | Jump if we've done them all (plus a blank column) | ||||||
6B97 | JR NZ,$6B80 | Jump back until all the pixel columns of the bitmap for the digit have been done | ||||||
6B99 | XOR A | Then jump back to add a blank pixel column | ||||||
6B9A | JR $6B82 | |||||||
6B9C | POP HL | HL=address of the next digit | ||||||
6B9D | NOP | |||||||
6B9E | JR $6B75 | Jump back to deal with this digit | ||||||
The graphic data for the digits has been rolled into the buffer at E30B. Now we copy the buffer to the screen.
|
||||||||
6BA0 | LD L,$0B | HL=E30B (start address of the buffer) | ||||||
6BA2 | LD BC,$07FF | B=7 (number of pixel rows), C=0xFF | ||||||
6BA5 | POP DE | DE=appropriate display file address | ||||||
6BA6 | LD A,E | |||||||
6BA7 | LDI | Copy three bytes (one pixel row) from the buffer to the screen | ||||||
6BA9 | LDI | |||||||
6BAB | LDI | |||||||
6BAD | LD E,A | Point DE at the start of the next row down | ||||||
6BAE | INC D | |||||||
6BAF | DJNZ $6BA7 | Jump back until all 7 pixel rows are done | ||||||
6BB1 | RET |
Prev: 6B46 | Up: Map | Next: 6BB2 |