![]() |
Routines |
| Prev: A19C | Up: Map | Next: A1F3 |
|
Copies eight bytes from the current tile source to a character cell. The source base is the pointer at $5E01, so the meaning of the tile code depends on what that currently points at -- see PLOT_TILE's note below.
|
||||||||||
| PLOT_TILE | A1D3 | PUSH BC | ||||||||
| A1D4 | PUSH DE | |||||||||
| A1D5 | PUSH HL | |||||||||
| A1D6 | LD L,A | A * 8 -- eight bytes per tile. | ||||||||
| A1D7 | LD H,$00 | |||||||||
| A1D9 | ADD HL,HL | |||||||||
| A1DA | ADD HL,HL | |||||||||
| A1DB | ADD HL,HL | |||||||||
| A1DC | LD DE,($5E01) | The current tile source. Not a fixed font: callers repoint it. | ||||||||
| A1E0 | ADD HL,DE | |||||||||
| A1E1 | EX DE,HL | |||||||||
| A1E2 | POP HL | |||||||||
| A1E3 | LD B,$08 | INC H walks down the eight scan lines of a character cell, which works because the cell never crosses a third boundary. | ||||||||
| PLOT_TILE_0 | A1E5 | LD A,(DE) | ||||||||
| A1E6 | LD (HL),A | |||||||||
| A1E7 | INC DE | |||||||||
| A1E8 | INC H | |||||||||
| A1E9 | DJNZ PLOT_TILE_0 | |||||||||
| A1EB | POP DE | |||||||||
| A1EC | POP BC | |||||||||
| A1ED | LD A,H | Undo the eight INC Hs, then INC L to land on the next cell to the right. | ||||||||
| A1EE | SUB $08 | |||||||||
| A1F0 | LD H,A | |||||||||
| A1F1 | INC L | |||||||||
| A1F2 | RET | |||||||||
|
The tile source at $5E01 is deliberately biased by its callers. Initialised to TEXT_FONT less $100, where a tile code is simply an ASCII character, it is repointed during play -- while the score is on screen it holds FONT_DIGITS, which is TEXT_FONT + $80, so that a raw digit 0-9 indexes the characters '0' to '9' directly with no adjustment at the call site.
|
||||||||||
| Prev: A19C | Up: Map | Next: A1F3 |