Prev: 49791 Up: Map Next: 49980
49969: 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 23.
Input
A Height
H Row at the bottom
Output
B Limited height
LimitHeight 49969 LD B,A B=A.
49970 LD A,H A=H.
49971 SUB 23 Subtract 23 from A.
49973 SUB B Subtract B from A.
49974 RET NC Return if the carry flag is clear.
49975 LD A,H A=H.
49976 SUB 23 Subtract 23 from A.
49978 LD B,A B=A.
49979 RET Return.
Prev: 49791 Up: Map Next: 49980