Prev: 54629 Up: Map Next: 54702
54677: Draw Tile Block
Draws a block of tiles, which are held as one byte for each tile, row by row from left to right and top to bottom. The tiles are from the tile set whose address is in TileSetAddress.
Input
B The width of the block
C The height of the block
DE The address of the numbers of the tiles
HL The screen address of the top left
A' The attribute
Draw each row from left to right.
DrawTileBlock 54677 PUSH BC Stash the size and the screen address on the stack.
54678 PUSH HL
Draw a tile.
DrawTileBlock_Tile 54679 LD A,(DE) Fetch the number of the tile.
54680 INC DE
54681 PUSH BC Stash the counters on the stack.
54682 LD BC,(41487) Fetch TileSetAddress.
54686 CALL DrawTile Call DrawTile.
54689 POP BC Restore the counters from the stack.
54690 INC L Move on to the next column.
54691 DJNZ DrawTileBlock_Tile Jump to DrawTileBlock_Tile if there are tiles left in the row.
Move down a row.
54693 POP HL Restore the screen address of the row from the stack.
54694 CALL MoveDownRow Call MoveDownRow.
54697 POP BC Restore the size from the stack.
54698 DEC C Count down the rows.
54699 JR NZ,DrawTileBlock Jump to DrawTileBlock if there are rows left.
54701 RET Return.
Prev: 54629 Up: Map Next: 54702