Prev: CA53 Up: Map Next: CA5E
CA5A: Shorten dZ at the floor
Used by the routine at adj_for_out_of_bounds.
The floor is the only limit on Z: there is no ceiling. $5BAE holds the floor's height, $80 in all three room sizes. A move that would take the object's base below it is shortened a unit at a time until it would not, and bit 2 of +$0C records that the move was stopped.
Input
IX the object
H dZ
H on exit, dZ shortened
adj_dZ_for_out_of_bounds CA5A LD A,($5BAE) D = the floor
CA5D LD D,A
Prev: CA53 Up: Map Next: CA5E