![]() |
Routines |
| Prev: 68A4 | Up: Map | Next: 6900 |
|
Used by the routines at Parser_ResolvePhrase, HandlerAndroidAttack, HandlerSlugAttack, HandlerSecondAndroid, MovePlayerToRoom, ActionHelp, ActionExamine, HandlerPickUpObject, ActionDrop, ActionEnter, ActionLeave, ActionCut, ActionKill, ActionOpen, ActionClose, ActionShoot, ActionTurn, ActionType, ActionTouch and ActionUse.
Report whether the given object is in the current room or is being carried.
|
||||||||||||
| IsObjectInCurrentRoom | 68E0 | PUSH HL | Keep the caller's registers while the location is tested. | |||||||||
| 68E1 | PUSH DE | |||||||||||
| 68E2 | LD E,A | Index the location tables by this object. | ||||||||||
| 68E3 | LD D,$00 | |||||||||||
| 68E5 | BIT 7,E | Bit 7 selects a scenic slot rather than an ordinary object. | ||||||||||
| 68E7 | JR NZ,IsObjectInCurrentRoom_Step1 | |||||||||||
| 68E9 | LD HL,$61AB | Continue at IsObjectInCurrentRoom_Step2 to compare an ordinary object's location. | ||||||||||
| 68EC | JR IsObjectInCurrentRoom_Step2 | |||||||||||
| IsObjectInCurrentRoom_Step1 | 68EE | RES 7,E | The scenic marker is not part of the object number. | |||||||||
| 68F0 | LD HL,$6224 | A scenic object is kept with the scenic rooms. | ||||||||||
| IsObjectInCurrentRoom_Step2 | 68F3 | ADD HL,DE | Index this object's byte in the location table. | |||||||||
| 68F4 | LD A,($6223) | Fetch the current room. | ||||||||||
| 68F7 | CP (HL) | The object is here when its location is the current room. | ||||||||||
| 68F8 | JR Z,IsObjectInCurrentRoom_Step3 | |||||||||||
| 68FA | LD A,$01 | A carried object counts as present too. | ||||||||||
| 68FC | CP (HL) | |||||||||||
| IsObjectInCurrentRoom_Step3 | 68FD | POP DE | Restore the registers the caller needs from the stack. | |||||||||
| 68FE | POP HL | |||||||||||
| 68FF | RET | Return. | ||||||||||
| Prev: 68A4 | Up: Map | Next: 6900 |