Prev: 60BD Up: Map Next: 60FD
60E2: Print Tile Block
Used by the routines at DrawPantry and DrawShelf.
Prints a block of tiles (using the font set up by DrawPantry).
Input
A Width of the block in tiles
C Number of rows
DE Address of the tile numbers
HL Position of the block
Output
DE Address of the tile numbers after the block
HL Position of the row below the block
PrintTileBlock 60E2 LD ($5F28),A Record the width of the block at TileBlockWidth.
PrintTileBlock_Row 60E5 LD A,($5F28) Fetch the width of the block.
60E8 LD B,A Set the column counter to the width.
60E9 PUSH HL Stash the position of the row on the stack.
60EA CALL ScreenAddress Convert the position to a screen address using ScreenAddress.
PrintTileBlock_Loop 60ED LD A,(DE) Fetch the tile number.
60EE CALL PrintScreen Print the tile using PrintScreen.
60F1 INC DE Move onto the next tile.
60F2 DJNZ PrintTileBlock_Loop Decrease the column counter by one and loop back to PrintTileBlock_Loop until the row has been printed.
60F4 POP HL Restore the position of the row from the stack.
60F5 LD A,H Fetch the vertical position of the row.
60F6 ADD A,$08 Add 08 to move down one row of tiles.
60F8 LD H,A Update the vertical position of the row.
60F9 DEC C Decrease the row counter by one.
60FA JR NZ,PrintTileBlock_Row Loop back to PrintTileBlock_Row until all of the rows have been done.
60FC RET Return.
Prev: 60BD Up: Map Next: 60FD