Prev: 42571 Up: Map Next: 42595
42578: Check Active Scenic Events
Input
HL Pointer to scenic data
Output
A The listed item that is here, or 255 if there is none
F The zero flag is set when an item on the list is here or carried
CheckActiveScenicEvents 42578 JR ActiveScenicEvents_CheckNext Jump to ActiveScenicEvents_CheckNext.
ActiveScenicEvents_Loop 42580 INC HL Move to the next event ID.
ActiveScenicEvents_CheckNext 42581 LD A,(HL) Jump to NoActiveScenicEvents if *HL is equal to 255.
42582 CP 255
42584 JR Z,NoActiveScenicEvents
42586 CALL ValidateItemPresent Call ValidateItemPresent.
42589 JR NZ,ActiveScenicEvents_Loop Jump to ActiveScenicEvents_Loop if the Z flag is not set.
42591 LD A,(HL) A=*HL.
42592 RET Return.
NoActiveScenicEvents 42593 AND A Clear the zero flag (A holds the 255 end marker) to report that nothing on the list is here.
42594 RET Return.
View the equivalent code in;
Prev: 42571 Up: Map Next: 42595