Prev: B21E Up: Map Next: B2AA
B258: Process Special Entity Flags
Used by the routine at GameStart.
Process Special Entity Flags walking the entity tables at StateData_SimpleEntities / StateData_Boney.
Process_Special_Entity_Flags B258 LD HL,$72B3 Point HL at the game event flags (GameEventFlags).
B25B BIT 0,(HL) Is "room / script event raised" (bit 00 of GameEventFlags) set? If not, return.
B25D RET Z
B25E RES 0,(HL) Clear "room / script event raised" (bit 00 of GameEventFlags).
B260 LD DE,$000E Each entity record is 000E bytes long, then load that length into DE.
B263 LD IX,$8EE9 Point IX at Boney's complex entity state (StateData_Boney).
Scan special-flag entities: raise them while y < 28, else deactivate, or try an entity-slot update.
Process_Special_Entity_Flags_Scan B267 LD A,(IX+$00) Fetch the current entity's type for the type test.
B26A CP $32 Is the current entity's entity type equal to 32? If so, return.
B26C RET Z
B26D BIT 5,(IX+$02) Is bit 05 of the current entity's flags byte 2 set? If not, jump to Process_Special_Entity_Flags_TryUpdateSlot.
B271 JR Z,Process_Special_Entity_Flags_TryUpdateSlot
B273 LD A,(IX+$05) Load A with the current entity's y-coordinate.
B276 CP $28 Is the current entity's y-coordinate less than 28? If so, jump to Process_Special_Entity_Flags_RaiseY.
B278 JR C,Process_Special_Entity_Flags_RaiseY
B27A LD (IX+$00),$00 Write 00 to the current entity's entity type.
B27E RES 7,(IX+$01) Reset bit 07 of the current entity's flags byte 1.
B282 RES 5,(IX+$02) Reset bit 05 of the current entity's flags byte 2.
B286 JR Process_Special_Entity_Flags_Branch Jump to Process_Special_Entity_Flags_Branch to finish this special-flag entity.
Raise the special-flag entity two characters and keep the room/script event latched.
Process_Special_Entity_Flags_RaiseY B288 INC (IX+$05) Move this entity two characters down.
B28B INC (IX+$06)
B28E INC (IX+$05)
B291 INC (IX+$06)
B294 SET 0,(HL) Set "room / script event raised" (bit 00 of GameEventFlags).
B296 JR Process_Special_Entity_Flags_Branch Jump to Process_Special_Entity_Flags_Branch to finish this special-flag entity.
When bit 07 is set, call Update_Entity_Slot to update the entity slot (once or twice).
Process_Special_Entity_Flags_TryUpdateSlot B298 BIT 7,(IX+$01) Is bit 07 of the current entity's flags byte 1 set? If not, jump to Process_Special_Entity_Flags_Branch.
B29C JR Z,Process_Special_Entity_Flags_Branch
B29E CALL Update_Entity_Slot Call Update_Entity_Slot to update Entity Slot? If so, jump to Process_Special_Entity_Flags_Branch.
B2A1 JR C,Process_Special_Entity_Flags_Branch
B2A3 CALL Update_Entity_Slot Call Update_Entity_Slot to update Entity Slot.
Advance to the next entity and continue the special-flag scan.
Process_Special_Entity_Flags_Branch B2A6 ADD IX,DE Advance IX to the next entity record.
B2A8 JR Process_Special_Entity_Flags_Scan Jump to Process_Special_Entity_Flags_Scan to advance to the next special-flag entity.
Prev: B21E Up: Map Next: B2AA