Prev: 26657 Up: Map Next: 26686
26661: Play Chirp
Used by the routine at GamePlay_Start.
Plays a short chirp of seven square wave cycles. The period of each cycle depends on a counter, and on the value of FrameCounter.
PlayChirp 26661 LD C,7 Set the cycle counter to 7.
PlayChirp_Loop 26663 LD A,C Fetch the cycle counter.
26664 DAA Decimal adjust the counter, to vary the period of the cycle.
26665 XOR %11110000 Flip bits 4-7.
26667 RLCA Rotate A left.
26668 LD D,A Put the result in D (the period).
26669 LD A,(24349) Fetch the frame counter.
26672 RRCA Divide by 8 (rotating the bits).
26673 RRCA
26674 RRCA
26675 AND %01100000 Keep only bits 5-6.
26677 XOR D Combine with the period.
26678 LD D,A Update the period.
26679 CALL PlaySquareWave Play a cycle using PlaySquareWave.
26682 DEC C Decrease the cycle counter by one.
26683 JR NZ,PlayChirp_Loop Loop back to PlayChirp_Loop until the cycle counter is zero.
26685 RET Return.
Prev: 26657 Up: Map Next: 26686