Prev: 6992 Up: Map Next: 69F7
69A7: Run Main Loop Body
Used by the routine at Run_Game_Frame.
Processes one frame of the main game loop. Clears all sprite frame IDs, then calls the various game handlers for Percy, hazards and level-specific logic. Resets the lives backup flag and restores the border colour before returning.
Run_Main_Loop_Body 69A7 DI Disable interrupts.
69A8 PUSH IX Stash IX and IY on the stack.
69AA PUSH IY
69AC LD B,$07 Set the sprite counter to 07 in B.
69AE LD HL,$DAC7 Point HL at Sprite01_3Wide_Frame_ID (first 3-wide sprite frame ID).
69B1 LD C,$00 Set the clear value in C to 00.
Clear_3Wide_Frames_Loop 69B3 LD (HL),C Write 00 to the sprite frame ID at *HL.
69B4 INC HL Advance HL by four bytes to the next sprite entry.
69B5 INC HL
69B6 INC HL
69B7 INC HL
69B8 DJNZ Clear_3Wide_Frames_Loop Decrease the counter and loop back to Clear_3Wide_Frames_Loop until all seven 3-wide sprite frame IDs are cleared.
69BA LD HL,$DAEB Point HL at Sprite01_2WideFrame_ID (first 2-wide sprite frame ID).
69BD LD B,$06 Set the sprite counter to 06 in B.
Clear_2Wide_Frames_Loop 69BF LD (HL),C Write 00 to the sprite frame ID at *HL.
69C0 INC HL Advance HL by four bytes to the next sprite entry.
69C1 INC HL
69C2 INC HL
69C3 INC HL
69C4 DJNZ Clear_2Wide_Frames_Loop Decrease the counter and loop back to Clear_2Wide_Frames_Loop until all six 2-wide sprite frame IDs are cleared.
Call the game handlers.
69C6 LD A,($5FBE) Call ResetRedBird if *Lives_Backup is non-zero.
69C9 OR A
69CA CALL NZ,ResetRedBird
69CD CALL Handler_RedBird Call Handler_RedBird.
69D0 CALL Handler_Cars Call Handler_Cars.
69D3 CALL RoomHandlerDispatch Call RoomHandlerDispatch.
69D6 LD A,($5FC5) Call Handler_Frogs if *CurrentRoom is equal to 04.
69D9 CP $04
69DB CALL Z,Handler_Frogs
69DE LD A,($5FAD) Call UpdateEnergyBar_Refill if *LandedOnPlatformFlag (worm Y adjustment flag) is set.
69E1 OR A
69E2 CALL NZ,UpdateEnergyBar_Refill
Tidy up at end of frame.
69E5 LD A,($5FB3) Copy *LivesDisplayCharacter to *Lives_Display_Previous.
69E8 LD ($6CC3),A
69EB XOR A Write 00 to *Lives_Backup.
69EC LD ($5FBE),A
69EF INC A Set border to BLUE.
69F0 OUT ($FE),A
69F2 POP IY Restore IY and IX from the stack.
69F4 POP IX
69F6 RET Return.
Prev: 6992 Up: Map Next: 69F7