Prev: C23D Up: Map Next: C296
C25E: Step the legs
Used by the routine at PLAYER_LEGS.
The legs' graphics 16-23 are two views (bit 2) of four frames (bits 0-1): a stride, legs together, the other stride, together again -- frames 1 and 3 share a drawing (GRAPHICS). While the robot walks, jumps or walks into a room the legs step on through the four, with a sound (FOOTSTEP) on leaving a stride, frames 0 and 2. Otherwise they carry on, silently, to frame 1 and stop there. Nothing happens on the turn a turn starts: HANDLE_LEFT_RIGHT, called just before, has given the legs an in-between view, 24-27.
Pentagram's is the same with frame 2 the standing pose and a footstep every fourth frame; Knight Lore's walk has six frames.
Input
IX the legs' record
C the controls
HANDLE_FORWARD C25E LD A,(IX+$00) Graphics 24-27: a turn has just started
C261 SUB $18
C263 CP $04
C265 RET C
C266 LD A,(IX+$0C) Walking into a room: step
C269 AND $F0
C26B JR NZ,HANDLE_FORWARD_0
C26D BIT 3,(IX+$0C) Jumping: step
C271 JR NZ,HANDLE_FORWARD_0
C273 BIT 2,C Walk not held: on to the standing frame
C275 JR Z,HANDLE_FORWARD_2
HANDLE_FORWARD_0 C277 PUSH BC The step's sound, on frames 0 and 2 only; the controls kept
C278 CALL FOOTSTEP
C27B POP BC
HANDLE_FORWARD_1 C27C LD A,(IX+$00) The next frame of four, in the graphic's low two bits
C27F LD E,A
C280 INC A
C281 AND $03
C283 LD D,A
C284 LD A,E
C285 AND $FC
C287 OR D
C288 LD (IX+$00),A
C28B RET
HANDLE_FORWARD_2 C28C LD A,(IX+$00) Frame 1, legs together: stand
C28F AND $03
C291 CP $01
C293 RET Z
C294 JR HANDLE_FORWARD_1 Otherwise step on towards it, silently
Prev: C23D Up: Map Next: C296