Prev: CC11 Up: Map Next: CC4B
CC31: Reset the drop timer: 80 turns while the first quest item is still to do, 8 after
Used by the routines at START and SKY_DROP.
Meant, by its shape, to count the quest items still to do -- records of QUEST_RECORDS whose graphic is 112 to 115; a quest item done becomes 116 to 119 -- and set DROP_TIMER to four times two more than that: 8 to 24 turns. But DE is loaded with the record length and never added to HL, so it tests the first record eighteen times: 80 turns while the first quest item is to do, 8 once it is done, whatever the other three are. Measured in the simulator: 80 with none done, 80 with the other three done, 8 with only the first done.
It runs at the start of every room (START) as well as after each drop, so the first drop in a room is always at least that many turns away.
RESET_DROP_TIMER CC31 LD HL,QUEST_RECORDS Eighteen records of 16 bytes, C starting at 2 -- but HL never moves on
CC34 LD DE,$0010
CC37 LD BC,$1202
RESET_DROP_TIMER_0 CC3A LD A,(HL) A quest item still to do?
CC3B AND $FC
CC3D CP $70
CC3F JR NZ,RESET_DROP_TIMER_1
CC41 INC C
RESET_DROP_TIMER_1 CC42 DJNZ RESET_DROP_TIMER_0
CC44 LD A,C Four turns for each
CC45 ADD A,A
CC46 ADD A,A
CC47 LD (DROP_TIMER),A
CC4A RET
Prev: CC11 Up: Map Next: CC4B