Prev: 45035 Up: Map Next: 45150
45087: Routine at B01F
Used by the routine at 60176.
45087 LD C,A C=A.
45088 LD A,(42990) A=*Count_ScenicEvents.
45091 AND A Jump to 45117 if *Count_ScenicEvents is zero.
45092 JR Z,45117
45094 LD B,A B=A.
45095 LD HL,(42978) HL=*Pointer_ScenicEventLocations.
45098 JR 45101 Jump to 45101.
45100 INC HL Increment HL by one.
45101 LD A,(HL) A=*HL.
45102 CALL ValidateItemPresent Call ValidateItemPresent.
45105 JR NZ,45115 Jump to 45115 if HL is not equal to A.
45107 PUSH HL Stash HL and BC on the stack.
45108 PUSH BC
45109 LD B,(HL) B=*HL.
45110 CALL 44808 Call 44808.
45113 POP BC Restore BC and HL from the stack.
45114 POP HL
45115 DJNZ 45100 Decrease counter by one and loop back to 45100 until counter is zero.
45117 LD A,C Write C to *CurrentRoom.
45118 LD (42947),A
45121 LD A,(42887) A=*42887.
45124 AND A Return if *42887 is zero.
45125 RET Z
45126 LD B,8 B=8.
45128 LD HL,42888 HL=42888.
45131 LD C,A C=A.
45132 JR 45135 Jump to 45135.
45134 INC HL Increment HL by one.
45135 SRL C Shift C right.
45137 JR NC,45147 Jump to 45147 if HL is greater than or equal to A.
45139 LD A,(HL) A=*HL.
45140 PUSH HL Stash HL and BC on the stack.
45141 PUSH BC
45142 CALL Handler_UpdateItemEventCurrentRoom Call Handler_UpdateItemEventCurrentRoom.
45145 POP BC Restore BC and HL from the stack.
45146 POP HL
45147 DJNZ 45134 Decrease counter by one and loop back to 45134 until counter is zero.
45149 RET Return.
View the equivalent code in The Jewels Of Babylon.
Prev: 45035 Up: Map Next: 45150