Prev: 24490 Up: Map Next: 24561
24526: Find Room In Exit Table
Used by the routines at TakeExit and DescribeLocation.
Looks through ExitTable for the current room. The room is stored as itself plus 128.
Output
HL The matching room key, or the end of a full sweep of the table
FindExits 24526 LD A,(23943) Fetch CurrentRoom.
24529 ADD A,128 Write that room plus 128 to ExitKey.
24531 LD (23428),A
24534 XOR A Write 0 to SearchHit.
24535 LD (23418),A
24538 LD DE,43879 Point DE at ExitTable.
24541 LD HL,23428 Point HL at ExitKey.
Scan the exit table.
FindExits_Scan 24544 LD A,(DE) Fetch this key.
24545 CP (HL) Jump to FindExits_Found if it matches this room.
24546 JR Z,FindExits_Found
24548 INC DE Advance the table pointer.
24549 LD A,E Jump to FindExits_Scan until DE is 13518.
24550 CP 206
24552 JR NZ,FindExits_Scan
24554 LD A,D
24555 CP 52
24557 JR NZ,FindExits_Scan
The matching room key, or the end of the table.
FindExits_Found 24559 EX DE,HL Put the table pointer in HL.
24560 RET Return.
Prev: 24490 Up: Map Next: 24561