![]() |
Routines |
| Prev: 9BA9 | Up: Map | Next: 9BCA |
|
Used by the routines at Table_AddressPastTheLocation, Action_CheckTheObjectFlags, Action_CarryOnWithTheObject, YouSeePreposition, YouSeeStart, YouSeeController, TableFindAnExit, GetObjectLocationInIX, ExitsFindTheExitToANamedPlace, ExitsPointAtTheList, Event_TheBarrel and Event_TheDeepBog.
Finds a location record from its id.
|
||||||||||||
| LocateLocation | 9BB1 | CP $50 | If the location ID is less than 50 jump to LocateLocation_Action to process it. | |||||||||
| 9BB3 | JR C,LocateLocation_Action | |||||||||||
| 9BB5 | XOR A | Reset A to 00. | ||||||||||
| 9BB6 | RET | Return. | ||||||||||
|
Work out the location now A is validated as a legitimate location ID.
|
||||||||||||
| LocateLocation_Action | 9BB7 | PUSH DE | Point at the location table. | |||||||||
| 9BB8 | LD DE,$B9E0 | |||||||||||
| 9BBB | PUSH HL | Store offset in the HL register pair. | ||||||||||
| 9BBC | LD L,A | |||||||||||
| 9BBD | LD H,$00 | |||||||||||
| 9BBF | ADD HL,HL | Multiply the offset by 02 and add the table base. | ||||||||||
| 9BC0 | ADD HL,DE | |||||||||||
| 9BC1 | LD E,(HL) | Read the low byte of the token. | ||||||||||
| 9BC2 | INC HL | Step to the next letter. | ||||||||||
| 9BC3 | LD D,(HL) | Read the high byte of the token. | ||||||||||
| 9BC4 | PUSH DE | Copy DE into IX, restore HL and DE. | ||||||||||
| 9BC5 | POP IX | |||||||||||
| 9BC7 | POP HL | |||||||||||
| 9BC8 | POP DE | |||||||||||
| 9BC9 | RET | Return. | ||||||||||
|
View the equivalent code in;
|
||||||||||||
| Prev: 9BA9 | Up: Map | Next: 9BCA |