![]() |
Routines |
| Prev: C3DC | Up: Map | Next: C42F |
|
Used by the routine at GameLoop.
If this room has a scenic event, run it.
|
||||
| Handler_ScenicEvents | C3FA | LD HL,$BA48 | Start at the scenic list. | |
| C3FD | LD BC,($BB00) | |||
| Handler_ScenicEvents_Loop | C401 | LD A,($BA9B) | Read the current room. Jump to Handler_ScenicEvents_Next if the search did not find a match. | |
| C404 | CPIR | |||
| C406 | JR NZ,Handler_ScenicEvents_Next | |||
| C408 | LD ($BB4D),HL | Save the scenic search and turn the match into a handler index. | ||
| C40B | LD ($BB4F),BC | |||
| C40F | INC BC | |||
| C410 | LD HL,($BB00) | |||
| C413 | AND A | |||
| C414 | SBC HL,BC | |||
| C416 | EX DE,HL | |||
| C417 | LD IX,($BAF4) | Call GetTableEntry to fetch this room's scenic handler. | ||
| C41B | CALL GetTableEntry | |||
| C41E | LD DE,$C423 | Return to C423 afterwards and jump to that handler. | ||
| C421 | PUSH DE | |||
| C422 | JP (HL) | |||
| C423 | LD HL,($BB4D) | Restore the scenic search and repeat while entries remain. | ||
| C426 | LD BC,($BB4F) | |||
| C42A | XOR A | |||
| C42B | OR C | |||
| C42C | JR NZ,Handler_ScenicEvents_Loop | |||
| Handler_ScenicEvents_Next | C42E | RET | Return. | |
|
View the equivalent code in;
|
||||
| Prev: C3DC | Up: Map | Next: C42F |