![]() |
Routines |
| Prev: 39849 | Up: Map | Next: 39882 |
|
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 | 39857 | CP 80 | If the location ID is less than 80 jump to LocateLocation_Action to process it. | |||||||||
| 39859 | JR C,LocateLocation_Action | |||||||||||
| 39861 | XOR A | Reset A to 0. | ||||||||||
| 39862 | RET | Return. | ||||||||||
|
Work out the location now A is validated as a legitimate location ID.
|
||||||||||||
| LocateLocation_Action | 39863 | PUSH DE | Point at the location table. | |||||||||
| 39864 | LD DE,47584 | |||||||||||
| 39867 | PUSH HL | Store offset in the HL register pair. | ||||||||||
| 39868 | LD L,A | |||||||||||
| 39869 | LD H,0 | |||||||||||
| 39871 | ADD HL,HL | Multiply the offset by 2 and add the table base. | ||||||||||
| 39872 | ADD HL,DE | |||||||||||
| 39873 | LD E,(HL) | Read the low byte of the token. | ||||||||||
| 39874 | INC HL | Step to the next letter. | ||||||||||
| 39875 | LD D,(HL) | Read the high byte of the token. | ||||||||||
| 39876 | PUSH DE | Copy DE into IX, restore HL and DE. | ||||||||||
| 39877 | POP IX | |||||||||||
| 39879 | POP HL | |||||||||||
| 39880 | POP DE | |||||||||||
| 39881 | RET | Return. | ||||||||||
|
View the equivalent code in;
|
||||||||||||
| Prev: 39849 | Up: Map | Next: 39882 |