![]()  | 
Routines | 
| Prev: E978 | Up: Map | Next: E99F | 
| 
 
Used by the routine at ChangeRoom.
 
  | 
||||||||||||||
| EventRouting | E98E | PUSH BC | Stash the item count on the stack. | |||||||||||
| E98F | CPIR | Search for the room ID in the table. | ||||||||||||
| 
 
At this point, if the room ID is found, BC contains the index in the table of where it is location.
 
 | 
||||||||||||||
| E991 | POP HL | Restore the item count into HL from the stack. | ||||||||||||
| E992 | RET NZ | Return if the room ID wasn't found in the table. | ||||||||||||
| 
 
The room ID was found in the table, so jump to the appropriate action.
 
 | 
||||||||||||||
| E993 | PUSH DE | Load the actions table into IX (using the stack). | ||||||||||||
| E994 | POP IX | |||||||||||||
| E996 | INC BC | Adjust the room index for the sum. | ||||||||||||
| E997 | AND A | Subtract the room index from the item count. | ||||||||||||
| E998 | SBC HL,BC | |||||||||||||
| E99A | LD E,L | Load the index into E to find the appropriate action routine. | ||||||||||||
| E99B | CALL GetTableEntry | Call GetTableEntry. | ||||||||||||
| E99E | JP (HL) | Jump to the action routine held in *HL. | ||||||||||||
| Prev: E978 | Up: Map | Next: E99F |