Prev: 50140 Up: Map Next: 50223
50170: Handler: Scenic Events
Used by the routine at GameLoop.
If this room has a scenic event, run it.
Handler_ScenicEvents 50170 LD HL,47688 Start at the scenic list.
50173 LD BC,(47872)
Handler_ScenicEvents_Loop 50177 LD A,(47771) Read the current room. Jump to Handler_ScenicEvents_Next if the search did not find a match.
50180 CPIR
50182 JR NZ,Handler_ScenicEvents_Next
50184 LD (47949),HL Save the scenic search and turn the match into a handler index.
50187 LD (47951),BC
50191 INC BC
50192 LD HL,(47872)
50195 AND A
50196 SBC HL,BC
50198 EX DE,HL
50199 LD IX,(47860) Call GetTableEntry to fetch this room's scenic handler.
50203 CALL GetTableEntry
50206 LD DE,50211 Return to 50211 afterwards and jump to that handler.
50209 PUSH DE
50210 JP (HL)
50211 LD HL,(47949) Restore the scenic search and repeat while entries remain.
50214 LD BC,(47951)
50218 XOR A
50219 OR C
50220 JR NZ,Handler_ScenicEvents_Loop
Handler_ScenicEvents_Next 50222 RET Return.
View the equivalent code in;
Prev: 50140 Up: Map Next: 50223