Prev: A1D3 Up: Map Next: A219
A1F3: Print a string of tiles in a single colour
Used by the routines at DRAW_MENU, GAME_OVER, DRAW_SUMMARY and SHOW_END_SCREEN.
Draws consecutive tiles left to right, writing one attribute byte per cell as it goes. It keeps the display address and the attribute address live at the same time in the two register banks, swapping with EXX between the pixel write and the colour write rather than recomputing either.
Input
HL H = y (0-191), L = x -- where to start
DE The string: one attribute byte, then the tile codes. Bit 7 set on a code marks it as the last one.
PRINT_STRING A1F3 PUSH HL
A1F4 CALL PIXEL_TO_SCREEN Display address into the main bank...
A1F7 LD A,(DE) The first byte is the colour, not a character; it is kept in A' for the whole run.
A1F8 EX AF,AF'
A1F9 INC DE
A1FA EXX
A1FB POP HL
A1FC CALL PIXEL_TO_ATTR ...and the attribute address into the alternate one.
This entry point is used by the routine at PRINT_MENU_LINE.
PRINT_STRING_REST A1FF EXX }
A200 LD A,(DE)
A201 BIT 7,A Bit 7 is the end marker, not part of the code.
A203 JR NZ,PRINT_STRING_0
A205 CALL PLOT_TILE
A208 INC DE
A209 EXX
A20A EX AF,AF'
A20B LD (HL),A Colour the cell PLOT_TILE just drew into.
A20C INC L
A20D EX AF,AF'
A20E JR PRINT_STRING_REST
PRINT_STRING_0 A210 AND $7F Strip the end marker before drawing the final character.
A212 CALL PLOT_TILE
A215 EXX
A216 EX AF,AF'
A217 LD (HL),A
A218 RET
Prev: A1D3 Up: Map Next: A219