Prev: A579 Up: Map Next: A623
A60E: Cycles the three frame counters
Called once a frame. anim_counter cycles 0 to 3 every frame and frame_toggle alternates 0 and 1. The RET Z after the XOR bails out on the frames where frame_toggle becomes zero, so slow_anim_counter only cycles 0 to 3 on every other frame.
Used by the routines at main_loop and drive_attract_demo.
cycle_counters A60E LD HL,$A234 Cycle counter_A 0-1-2-3
A611 LD A,(HL)
A612 INC A
A613 AND $03
A615 LD (HL),A
A616 INC HL Cycle counter_B 0-1
A617 LD A,(HL)
A618 XOR $01
A61A LD (HL),A
A61B RET Z Return if it's zero
A61C INC HL Cycle counter_C 0-1-2-3 at half rate
A61D LD A,(HL)
A61E INC A
A61F AND $03
A621 LD (HL),A
A622 RET Return
Prev: A579 Up: Map Next: A623