Prev: 39832 Up: Map Next: 40040
40007: AdvanceJonesPos
Increments JonesPos by 4. If the new value >= 136 the tail sweep is complete: freeze the Y animation (JonesPhase |= 128) and return. Otherwise store the new position, cycle the phase counter (0->1->2->3->4->0) and jump back to BlitJonesFrame.
40007 LD A,(39750) A = JonesPos
40010 ADD A,4 advance by 4 pixels
40012 CP 136 reached bottom of sweep area?
40014 JR C,40022 no: update position
40016 LD A,128 yes: A = freeze flag
40018 LD (39753),A JonesPhase = 128 (frozen)
40021 RET done
40022 LD (39750),A JonesPos = new value
40025 LD A,(39753) A = current phase (0-4)
40028 INC A
40029 CP 5 wrapped past phase 4?
40031 JR C,40034 no: keep incremented value
40033 XOR A yes: wrap to 0
40034 LD (39753),A JonesPhase = new phase
40037 JP 39832 blit next tail frame
Prev: 39832 Up: Map Next: 40040