![]() |
Routines |
| Prev: C86D | Up: Map | Next: C891 |
|
Used by the routines at handle_pickup_drop and player_controls.
Compares the player's distance from the room's centre, $80 on each axis, with the room's half-size less the player's own half-width. Carry means the whole of the player's footprint is inside on both X and Y; no carry means it touches or crosses the line of a wall, which only an archway allows.
Also used by handle_pickup_drop.
|
||||||||||
| chk_plyr_OOB | C87A | LD HL,($5BAB) | L = X half-size less our half-width, H = the same for Y | |||||||
| C87D | LD A,L | |||||||||
| C87E | SUB (IX+$04) | |||||||||
| C881 | LD L,A | |||||||||
| C882 | LD A,H | |||||||||
| C883 | SUB (IX+$05) | |||||||||
| C886 | LD H,A | |||||||||
| C887 | LD A,(IX+$01) | A = |X - $80| | ||||||||
| C88A | SUB $80 | |||||||||
| C88C | JP P,oob_test_x | |||||||||
| C88F | NEG | |||||||||
| Prev: C86D | Up: Map | Next: C891 |