Prev: 39832 Up: Map Next: 40040
40007: AdvanceJonesPos
Moves the cat 4 pixels right. If the new JonesPos >= 136 it has run off the right edge of its 17-column track: freeze the animation (JonesPhase |= 128) and return — the erase pass has already removed it from the screen. Otherwise store the new position, cycle the run-cycle frame (0->1->2->3->4->0) and jump back to BlitJonesFrame to redraw.
40007 LD A,(39750) A = JonesPos
40010 ADD A,4 advance by 4 pixels
40012 CP 136 run off the right edge (past column 16)?
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 draw the cat at its new position
Prev: 39832 Up: Map Next: 40040