From 155562e0f5262a654dd132ad9801768296589b27 Mon Sep 17 00:00:00 2001 From: "fabio.olimpieri" Date: Sun, 10 Jun 2012 20:22:30 +0000 Subject: [PATCH] Filtered out tone frequencies outside dsp range in AY-3-8912 --- src/spk_ay.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/spk_ay.c b/src/spk_ay.c index 2e8aa8e..206c4f7 100644 --- a/src/spk_ay.c +++ b/src/spk_ay.c @@ -184,29 +184,39 @@ inline void play_ay (unsigned int tstados) { tone_period_b= ((unsigned int) ordenador.ay_registers[2]) + 256 * ((unsigned int) ((ordenador.ay_registers[3]) & 0x0F)); tone_period_c= ((unsigned int) ordenador.ay_registers[4]) + 256 * ((unsigned int) ((ordenador.ay_registers[5]) & 0x0F)); noise_period= ((unsigned int) ordenador.ay_registers[6]) & 0x1F; - - if (!tone_period_a) tone_period_a = 1; - if (!tone_period_b) tone_period_b = 1; - if (!tone_period_c) tone_period_c = 1; if (!noise_period) noise_period = 1; - if (ordenador.aych_a cpufreq/(2*16*tone_period) + ordenador.aych_a =1; else { - ordenador.ayval_a = !ordenador.ayval_a; - ordenador.aych_a =0; + if (ordenador.aych_a cpufreq/(2*16*tone_period) + ordenador.aych_b =1; else { - ordenador.ayval_b = !ordenador.ayval_b; - ordenador.aych_b =0; + if (ordenador.aych_b cpufreq/(2*16*tone_period) + ordenador.aych_c =1; + else + { if (ordenador.aych_c