Prev: D877 Up: Map Next: D904
D894: Handler: Moving Objects
Used by the routine at Dispatch_Handlers.
Animates the 13-byte records at *ReferenceMovingObjects.
Handler_MovingObjects D894 LD IX,($642A) IX=*ReferenceMovingObjects.
Handler_MovingObjects_Loop D898 LD A,(IX+$00) Jump to Handler_MovingObjects_Done if the terminator FF is reached.
D89B CP $FF
D89D JR Z,Handler_MovingObjects_Done Jump to Handler_MovingObjects_Next if this object is inactive.
D89F BIT 7,A
D8A1 JR NZ,Handler_MovingObjects_Next Deactivate the object if its timer is zero.
D8A3 XOR A
D8A4 CP (IX+$01)
D8A7 JR NZ,Handler_MovingObjects_Draw
D8A9 SET 7,(IX+$00) Jump to Handler_MovingObjects_Next.
D8AD JR Handler_MovingObjects_Next
Handler_MovingObjects_Draw D8AF LD HL,$7C70 Use Buffer_ActiveFont, or Graphics_TileFont when the stored font ID differs.
D8B2 CP (IX+$12)
D8B5 JR Z,Handler_MovingObjects_Font
D8B7 LD HL,$9070
Handler_MovingObjects_Font D8BA LD ($5C36),HL Write HL to *CHARS.
D8BD LD C,(IX+$10) Write the object's clip window to *ClipWindow.
D8C0 LD B,(IX+$11)
D8C3 LD ($6419),BC
D8C7 CALL JumpTable_AdvanceEntity Call JumpTable_AdvanceEntity.
D8CA LD A,(IX+$09) Compare the moving edge against the stored limit.
D8CD OR A
D8CE LD A,B
D8CF JR NZ,Handler_MovingObjects_LimitHit
D8D1 LD A,C Jump to Handler_MovingObjects_Update if they differ.
Handler_MovingObjects_LimitHit D8D2 CP (IX+$0E)
D8D5 JR NZ,Handler_MovingObjects_Update
Reverse at the stored limit.
D8D7 CALL Reverse_Direction Call Reverse_Direction.
D8DA LD A,(IX+$0E) Swap the two limit bytes.
D8DD LD B,(IX+$0F)
D8E0 LD (IX+$0F),A
D8E3 LD (IX+$0E),B
D8E6 CALL JumpTable_AdvanceEntity Call JumpTable_AdvanceEntity.
Handler_MovingObjects_Update D8E9 CALL JumpTable_StorePosition Call JumpTable_StorePosition.
D8EC CALL JumpTable_MoveEntity Call JumpTable_MoveEntity.
D8EF CALL JumpTable_DrawEntity Call JumpTable_DrawEntity.
D8F2 CALL JumpTable_EraseEntity Call JumpTable_EraseEntity.
Handler_MovingObjects_Next D8F5 LD DE,$0013 IX+=0013.
D8F8 ADD IX,DE
D8FA JR Handler_MovingObjects_Loop Jump to Handler_MovingObjects_Loop.
Handler_MovingObjects_Done D8FC LD BC,$0218 Write 0218 to *ClipWindow.
D8FF LD ($6419),BC
D903 RET Return.
Prev: D877 Up: Map Next: D904