Prev: 54499 Up: Map Next: 54533
54505: Load B with index of room to right of an entity's current room
Used by the routines at 48593, 52193, 54283 and 54313.
Input
IX Address of complex state data for an entity
D (entry at 54508 only) Index of base room for check
Output
B Index of room found if there is one, undefined otherwise
F Zero flag set if there is no room to the right, reset otherwise
54505 LD D,(IX+0) Load current room of entity pointed to by IX into D
This entry point is used by the routine at 53194.
54508 LD IY,(34250) Load start address of current level's horizontal room connectivity data into IY
54512 LD A,(IY+0) Load first byte (left room index) of current entry into A
54515 CP 255 If byte is 255 (i.e. the end marker)...
54517 RET Z ...then return
54518 CP D If byte is not the same as the room index in D...
54519 JR NZ,54527 ...then skip ahead to 54527
54521 LD B,(IY+1) Load second byte (right room index) of current entry into B
54524 CP 255 Reset zero flag (as current room cannot be 255)
54526 RET Return
54527 INC IY Advance by two bytes to the next entry...
54529 INC IY ...
54531 JR 54512 Loop back to 54512
Prev: 54499 Up: Map Next: 54533