Prev: F6E1 Up: Map Next: F804
F7AA: Print Sprite
Used by the routine at JumpTable_PrintSprite.
Prints a sprite of width E and height D.
Input
A Sprite ID
B Vertical co-ordinate
C Horizontal co-ordinate
D Height (in character blocks)
E Width (in character blocks)
Print_Sprite F7AA LD L,A Keep the sprite ID minus one in L.
F7AB DEC L
F7AC LD A,E Store the width in *Print_Width.
F7AD LD ($6416),A
Print_Sprite_Target F7B0 LD A,($6416) Reload the remaining width from *Print_Width.
F7B3 LD E,A
F7B4 LD A,($6419) Jump to Print_Sprite_Branch if this row is inside *ClipWindow.
F7B7 CP B
F7B8 JR NC,Print_Sprite_Branch
Print_Sprite_Continue F7BA LD A,($6416) Skip down until the row is inside the clip window.
F7BD ADD A,L
F7BE LD L,A
F7BF DEC D
F7C0 RET Z
F7C1 DEC B
F7C2 LD A,($6419)
F7C5 CP B
F7C6 JR NZ,Print_Sprite_Continue
Print_Sprite_Branch F7C8 LD A,($641A) Return if this row is below *ClipWindow_MaximumRow.
F7CB CP B
F7CC RET NC
F7CD LD A,($641C) Return if this column is past *641C.
F7D0 CP C
F7D1 RET NC
F7D2 PUSH BC Jump to Print_Sprite_Branch3 if this column is inside *ClipWindow_MinimumColumn.
F7D3 LD A,($641B)
F7D6 CP C
F7D7 JR NC,Print_Sprite_Branch3
Print_Sprite_Branch2 F7D9 INC L Skip left until the column is inside the clip window.
F7DA DEC E
F7DB JR Z,Print_Sprite_Skip
F7DD DEC C
F7DE CP C
F7DF JR C,Print_Sprite_Branch2
Print_Sprite_Branch3 F7E1 CALL Set_PrintPosition Call Set_PrintPosition.
F7E4 INC L Call Print_Character with the next glyph.
F7E5 LD A,L
F7E6 CALL Print_Character
F7E9 CALL Write_Tile Call Write_Tile.
F7EC DEC C Move left one column and loop back to Print_Sprite_Branch3 until the row is done.
F7ED LD A,($641C)
F7F0 CP C
F7F1 JR NC,Print_Sprite_Branch4
F7F3 DEC E
F7F4 JR NZ,Print_Sprite_Branch3
Print_Sprite_Skip F7F6 POP BC Restore the position from the stack.
F7F7 DEC D Return if the remaining height is zero.
F7F8 RET Z
F7F9 DEC B Move up one row.
F7FA JR Print_Sprite_Target Jump to Print_Sprite_Target.
Print_Sprite_Branch4 F7FC DEC E Jump to Print_Sprite_Skip if the remaining width is zero.
F7FD JR Z,Print_Sprite_Skip
F7FF LD A,L Advance the glyph past the clipped cells.
F800 ADD A,E
F801 LD L,A
F802 JR Print_Sprite_Skip Jump to Print_Sprite_Skip.
View the equivalent code in Booty.
Prev: F6E1 Up: Map Next: F804