Prev: 30004 Up: Map Next: 30039
30026: Clip Sprite
Used by the routines at PrepareOldSprite and PrepareActorSprite.
The vertical co-ordinate is the bottom edge of a sprite. This stops sprites being drawn below the play area, which ends at 159.
Input
H Vertical co-ordinate
Output
C The number of pixel rows which are below the play area
H The vertical co-ordinate (limited to 159)
ClipSprite 30026 LD A,H Fetch the vertical co-ordinate.
30027 SUB 159 Subtract 159 (the bottom of the play area).
30029 JP M,ClipSprite_Visible Jump to ClipSprite_Visible if the sprite is above the bottom of the play area.
30032 LD H,159 Limit the vertical co-ordinate to 159.
30034 LD C,A Keep the number of rows to clip in C.
30035 RET Return.
ClipSprite_Visible 30036 LD C,0 Flag that no rows need to be clipped (C=0).
30038 RET Return.
Prev: 30004 Up: Map Next: 30039