Prev: C27F Up: Map Next: C33C
C331: Limit Height
Used by the routines at ApplyPlayerCollision, SetPairAttributes and DrawPiece.
Stops a height from reaching above the top of the playfield, which is at row 17.
Input
A Height
H Row at the bottom
Output
B Limited height
LimitHeight C331 LD B,A B=A.
C332 LD A,H A=H.
C333 SUB $17 Subtract 17 from A.
C335 SUB B Subtract B from A.
C336 RET NC Return if the carry flag is clear.
C337 LD A,H A=H.
C338 SUB $17 Subtract 17 from A.
C33A LD B,A B=A.
C33B RET Return.
Prev: C27F Up: Map Next: C33C