Prev: CB78 Up: Map Next: CBF8
CB84: 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 CB84 LD B,$08 Set the slot counter to 08 in B.
CB86 LD IX,$E480 Point IX at Long_Object_Slots.
CB8A LD IY,$EF59 Point IY at Object_Compare.
Update one slot.
Update_Long_Slots_0 CB8E BIT 0,(IX+$00) Jump to Update_Long_Slots_1 if the slot is not occupied.
CB92 JR Z,Update_Long_Slots_1
CB94 LD A,(IX+$01) Subtract the first compare word from the slot.
CB97 SUB (IY+$00)
CB9A LD (IX+$01),A
CB9D LD A,(IX+$02)
CBA0 SBC A,(IY+$01)
CBA3 LD (IX+$02),A
CBA6 LD A,(IX+$03) Subtract the second compare word from the slot.
CBA9 SUB (IY+$02)
CBAC LD (IX+$03),A
CBAF LD A,(IX+$04)
CBB2 SBC A,(IY+$03)
CBB5 LD (IX+$04),A
CBB8 LD A,(IX+$06) Decrease the timer by one.
CBBB DEC A
CBBC LD (IX+$06),A
CBBF 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.
CBC1 LD (IX+$00),A Clear the occupied flag.
CBC4 LD A,($EF80) Decrease *Hit_Count by one.
CBC7 DEC A
CBC8 LD ($EF80),A
CBCB BIT 0,(IX+$07) Jump to Update_Long_Slots_1 if bit 0 of offset 07 is reset.
CBCF JR Z,Update_Long_Slots_1
CBD1 LD A,(IX+$0B) Jump to Update_Long_Slots_1 if offset 0B is not zero.
CBD4 AND A
CBD5 JR NZ,Update_Long_Slots_1
CBD7 LD A,(IX+$0D) Jump to Update_Long_Slots_1 if offset 0D is not zero.
CBDA AND A
CBDB JR NZ,Update_Long_Slots_1
CBDD BIT 7,(IX+$0C) Jump to Update_Long_Slots_1 if bit 7 of offset 0C is set.
CBE1 JR NZ,Update_Long_Slots_1
CBE3 LD A,($EFCC) Add *EFCC to *Gauge_A.
CBE6 LD HL,$EF7F
CBE9 ADD A,(HL)
CBEA LD (HL),A
Advance to the next slot.
Update_Long_Slots_1 CBEB LD DE,$0010 Advance IX by 10.
CBEE ADD IX,DE
CBF0 LD DE,$0004 Advance IY by 04.
CBF3 ADD IY,DE
CBF5 DJNZ Update_Long_Slots_0 Decrease the slot counter by one and loop back to Update_Long_Slots_0 until it is zero.
CBF7 RET Return.
Prev: CB78 Up: Map Next: CBF8