Prev: 43155 Up: Map Next: 43224
43183: Print Sprite Tiles
Used by the routine at DrawRoom.
Prints a sprite to the screen using PrintUDG, using the same width, height and starting ID as WriteSpriteBuffer.
Input
A Starting sprite ID
B Vertical position
C Horizontal position
D Height
E Width
PrintSpriteTiles 43183 PUSH HL Stash HL on the stack.
43184 DEC A Start one ID before the first tile so the increment lands on it.
43185 LD (47778),A Write the tile ID to *DrawSpriteID.
43188 LD A,E Remember the remaining width in *DrawSpriteWidth.
43189 LD (47779),A
PrintSpriteTiles_NextRow 43192 LD A,(47779) Reload the remaining width.
43195 LD E,A
43196 PUSH BC Stash the position and size.
43197 PUSH DE
43198 CALL 3545 Set the cursor to this tile.
43201 POP DE Restore the position and size.
43202 POP BC
PrintSpriteTiles_NextTile 43203 LD A,(47778) Advance *DrawSpriteID to the next tile ID.
43206 INC A
43207 LD (47778),A
43210 CALL PrintUDG Print that tile.
43213 DEC E Move one column across.
43214 JR NZ,PrintSpriteTiles_NextTile Jump to PrintSpriteTiles_NextTile until this row is complete.
43216 DEC D Move on to the next row of tiles.
43217 JR Z,PrintSpriteTiles_Done Jump to PrintSpriteTiles_Done if every row is printed.
43219 DEC B Move one row up.
43220 JR PrintSpriteTiles_NextRow Jump to PrintSpriteTiles_NextRow.
PrintSpriteTiles_Done 43222 POP HL Restore HL from the stack.
43223 RET Return.
Prev: 43155 Up: Map Next: 43224