Prev: C3F4 Up: Map Next: C435
C400: A footstep
Used by the routine at WALK_ON.
WALK_ON calls this for every step of the knight's walk; FOOTSTEPS counts them. Walking (speed under 12) every fourth plays four waves, at a half-wave count of 64 and 96 by turns; at the faster speed a bonus gives, every second, so the steps come twice as often. Pentagram's footstep plays two waves, and has no faster half.
Input
IX the knight's legs
FOOTSTEP C400 LD HL,FOOTSTEPS one more step; how fast is he going?
C403 INC (HL)
C404 LD A,(IX+$05)
C407 CP $0C
C409 JR NC,FOOTSTEP_1
C40B LD A,(HL) walking: every fourth step, four waves at 64...
C40C BIT 2,A
C40E JR Z,FOOTSTEP_0
C410 AND $03
C412 RET NZ
C413 LD BC,$4004
C416 JR BEEP
FOOTSTEP_0 C418 AND $03 ...or at 96
C41A RET NZ
C41B LD BC,$6004
C41E JR BEEP
FOOTSTEP_1 C420 LD A,(HL) faster: every second, at 64...
C421 BIT 1,A
C423 JR Z,FOOTSTEP_2
C425 AND $01
C427 RET NZ
C428 LD BC,$4004
C42B JR BEEP
FOOTSTEP_2 C42D AND $01 ...or at 96
C42F RET NZ
C430 LD BC,$6004
C433 JR BEEP
Prev: C3F4 Up: Map Next: C435