Prev: $27AA Up: Map Next: $27D1
$27AB: Make a character walk up and down a few times or until a certain time
This corresponds to $6B3D in the ZX Spectrum version.
Used by command lists $B6, $C0, $C2, $C4 and $CC.
$27AB LDA $3F Reset bit 1 of the flags byte at $3F: the character is not running continuously.
$27AD AND #$FC
$27AF STA $3F
$27B1 JSR $3BE7 Collect the next byte (the number of walkabouts) from the command list and store it at $A8.
$27B4 STA $A8
$27B6 JSR $3BE7 Collect the next byte (the event identifier, always 0) from the command list and store it at $A6.
$27B9 STA $A6
$27BB LDA $FC Pick up the character's x-coordinate from $FC and store it at $A7. This will be the walkabout origin.
$27BD STA $A7
$27BF LDA #$27 Replace the address of this primary command routine in the character's buffer with that of $27C7 below.
$27C1 STA $2A
$27C3 LDA #$C7
$27C5 STA $29
$27C7 DEC $A8 Decrement the number of mini-walkabouts remaining.
$27C9 BNE $27CE Branch unless it's now zero.
$27CB JMP $1D2D Terminate this primary command.
$27CE JMP $1A1B Set the character off on a mini-walkabout.
Prev: $27AA Up: Map Next: $27D1