Prev: F2A2 Up: Map Next: F2F1
F2B6: Plays engine effect.
Used by the routine at play_turbo_sfx_128k.
engine_sfx_from_speed_128k F2B6 LD HL,($A24A) Load speed into HL
F2B9 RR H Bottom bit of H moves to carry -- is H now empty?
F2BB LD A,L Speed low byte
F2BC RRA Halve speed, shifting carry in as MSB
F2BD CPL L = ~A -- why complement?
F2BE LD L,A
F2BF LD A,($A253) Jump if in low gear
F2C2 AND A
F2C3 JR Z,esfs_1
F2C5 SLA L
F2C7 RL H
esfs_1 F2C9 SLA L
F2CB RL H
F2CD SLA L
F2CF RL H
F2D1 LD A,($A23B) Read tunnel_sfx
F2D4 AND A Set flags
F2D5 LD DE,$0190 Non-tunnel tone value
F2D8 LD A,$0F Non-tunnel volume
F2DA JR Z,esfs_2 Jump if tunnel_sfx was zero (not in tunnel)
In tunnel.
F2DC LD DE,$0258 In-tunnel tone value
F2DF LD A,$0C In-tunnel volume
esfs_2 F2E1 ADD HL,DE -- speed value + tone?
F2E2 LD ($A217),HL Set channel C pitch (both fine and coarse)
F2E5 LD ($A21D),A Set channel C volume
F2E8 LD A,($A21A) Set mixer to enable tone C
F2EB AND $3B
F2ED LD ($A21A),A
F2F0 RET Return
Prev: F2A2 Up: Map Next: F2F1