Prev: 52088 Up: Map Next: 52216
52100: Update Long Slots
Used by the routine at Update_Phase.
Subtracts the words at Object_Compare from each occupied slot at Long_Object_Slots, then decreases the timer.
Update_Long_Slots 52100 LD B,8 Set the slot counter to 8 in B.
52102 LD IX,58496 Point IX at Long_Object_Slots.
52106 LD IY,61273 Point IY at Object_Compare.
Update one slot.
Update_Long_Slots_0 52110 BIT 0,(IX+0) Jump to Update_Long_Slots_1 if the slot is not occupied.
52114 JR Z,Update_Long_Slots_1
52116 LD A,(IX+1) Subtract the first compare word from the slot.
52119 SUB (IY+0)
52122 LD (IX+1),A
52125 LD A,(IX+2)
52128 SBC A,(IY+1)
52131 LD (IX+2),A
52134 LD A,(IX+3) Subtract the second compare word from the slot.
52137 SUB (IY+2)
52140 LD (IX+3),A
52143 LD A,(IX+4)
52146 SBC A,(IY+3)
52149 LD (IX+4),A
52152 LD A,(IX+6) Decrease the timer by one.
52155 DEC A
52156 LD (IX+6),A
52159 JR NZ,Update_Long_Slots_1 Jump to Update_Long_Slots_1 if the timer is not zero.
Clear the slot, then award the gauge if it qualifies.
52161 LD (IX+0),A Clear the occupied flag.
52164 LD A,(61312) Decrease *Hit_Count by one.
52167 DEC A
52168 LD (61312),A
52171 BIT 0,(IX+7) Jump to Update_Long_Slots_1 if bit 0 of offset 7 is reset.
52175 JR Z,Update_Long_Slots_1
52177 LD A,(IX+11) Jump to Update_Long_Slots_1 if offset 11 is not zero.
52180 AND A
52181 JR NZ,Update_Long_Slots_1
52183 LD A,(IX+13) Jump to Update_Long_Slots_1 if offset 13 is not zero.
52186 AND A
52187 JR NZ,Update_Long_Slots_1
52189 BIT 7,(IX+12) Jump to Update_Long_Slots_1 if bit 7 of offset 12 is set.
52193 JR NZ,Update_Long_Slots_1
52195 LD A,(61388) Add *61388 to *Gauge_A.
52198 LD HL,61311
52201 ADD A,(HL)
52202 LD (HL),A
Advance to the next slot.
Update_Long_Slots_1 52203 LD DE,16 Advance IX by 16.
52206 ADD IX,DE
52208 LD DE,4 Advance IY by 4.
52211 ADD IY,DE
52213 DJNZ Update_Long_Slots_0 Decrease the slot counter by one and loop back to Update_Long_Slots_0 until it is zero.
52215 RET Return.
Prev: 52088 Up: Map Next: 52216