From 334b279e603b683050952ed02303dfa98fda1394 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 13 Jul 2024 11:11:34 +0200 Subject: terracren: assume SSG channel C resistor is 1k instead of 10k (brown,black,red instead of brown,black,orange) --- src/mame/nichibutsu/armedf.cpp | 1 + src/mame/nichibutsu/galivan.cpp | 2 +- src/mame/nichibutsu/terracre.cpp | 22 ++++++++++------------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/mame/nichibutsu/armedf.cpp b/src/mame/nichibutsu/armedf.cpp index f2eb9e75a38..dd6dca1f18c 100644 --- a/src/mame/nichibutsu/armedf.cpp +++ b/src/mame/nichibutsu/armedf.cpp @@ -1330,6 +1330,7 @@ void bigfghtr_state::bigfghtr(machine_config &config) sound_config_3812(config); } + /************************************* * * ROM definition(s) diff --git a/src/mame/nichibutsu/galivan.cpp b/src/mame/nichibutsu/galivan.cpp index e85d678e3f4..8a7f681b2d1 100644 --- a/src/mame/nichibutsu/galivan.cpp +++ b/src/mame/nichibutsu/galivan.cpp @@ -564,7 +564,6 @@ void galivan_state::galivan_common(machine_config &config) // Sum: 0.67015 // Multiply all 3 values by 1 / 0.67015 (i.e. 1.492203): // Final values are: ym: 0.492203; dac1: 0.209505; dac2: 0.298291 - FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); // R15, R14, nothing(infinite resistance), wire(short), C9, C11 m_ymfilter->add_route(ALL_OUTPUTS, "speaker", 1.0); FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R11, R10, nothing(infinite resistance), wire(short), C7, C17 @@ -632,6 +631,7 @@ void galivan_state::youmab(machine_config &config) config.device_remove("nb1414m4"); } + /*************************************************************************** Game driver(s) diff --git a/src/mame/nichibutsu/terracre.cpp b/src/mame/nichibutsu/terracre.cpp index 0e161f2bd3e..404ab24de20 100644 --- a/src/mame/nichibutsu/terracre.cpp +++ b/src/mame/nichibutsu/terracre.cpp @@ -731,11 +731,11 @@ GFXDECODE_END void terracre_state::tc_base(machine_config &config) { - M68000(config, m_maincpu, XTAL(16'000'000) / 2); // 8MHz verified on PCB + M68000(config, m_maincpu, XTAL(16'000'000) / 2); // 8MHz verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &terracre_state::terracre_map); m_maincpu->set_vblank_int("screen", FUNC(terracre_state::irq1_line_hold)); - Z80(config, m_audiocpu, XTAL(16'000'000) / 4); // 4MHz verified on PCB + Z80(config, m_audiocpu, XTAL(16'000'000) / 4); // 4MHz verified on PCB m_audiocpu->set_addrmap(AS_PROGRAM, &terracre_state::sound_map); // z80 io map set in 2203 or 3526 configs below m_audiocpu->set_periodic_int(FUNC(terracre_state::irq0_line_hold), attotime::from_hz(XTAL(16'000'000) / 4 / 512)); // ? @@ -784,7 +784,6 @@ void terracre_state::ym3526(machine_config &config) // Sum: 0.796296 // Multiply all 3 values by 1 / 0.796296 (i.e. 1.255814): // Final values are: ym: 0.255814; dac1: 0.232558; dac2: 0.511628) - FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); // R10, R11, nothing(infinite resistance), wire(short), C11, C12 m_ymfilter->add_route(ALL_OUTPUTS, "speaker", 1.0); FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(22), RES_K(22), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R17, R18, nothing(infinite resistance), wire(short), C19, C17 @@ -796,14 +795,12 @@ void terracre_state::ym3526(machine_config &config) DAC_8BIT_R2R(config, "dac1", 0).add_route(ALL_OUTPUTS, m_dacfilter1, 0.2326); // SIP R2R DAC @ RA-1 with 74HC374P latch DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, m_dacfilter2, 0.5116); // SIP R2R DAC @ RA-2 with 74HC374P latch - } void terracre_state::ym2203(machine_config &config) { tc_base(config); m_audiocpu->set_addrmap(AS_IO, &terracre_state::sound_2203_io_map); - //subdevice("audiocpu")->set_addrmap(AS_IO, &terracre_state::sound_2203_io_map); // Note: The Terra Cresta filters are not identical to the later Nichibutsu filters(galivan.cpp, armedf.cpp) // While the yamaha (ym2203/ym3526 digital/FM portion) filter is the same, the dac filters are not, @@ -813,7 +810,7 @@ void terracre_state::ym2203(machine_config &config) // R12 - DAC1 - 2.2kohm = 0.1590 of total // R8 - DAC2 - 1kohm = 0.3500 of total // Yamaha (analog/SSG, channels A and B) - 3.3k = 0.1060 - // Yamaha (analog/SSG, channel C) - 10k = 0.0350 + // Yamaha (analog/SSG, channel C) - 1k = 0.3500 // However, the actual volume output by the ym3014 dac and the r2r resistors // is not the same range on each! // The YM3014 dac has a DC offset of 1/2 VDD, then +- 1/4 VDD of signal, @@ -828,11 +825,10 @@ void terracre_state::ym2203(machine_config &config) // DAC1: 0.159000 * 1.0 = 0.159 // DAC2: 0.350000 * 1.0 = 0.350 // SSGA+B:0.106000 * 0.46 = 0.04876 - // SSGC: 0.035000 * 0.23 = 0.00805 + // SSGC: 0.350000 * 0.23 = 0.0805 // Sum: 0.74081 // Multiply all 5 values by 1 / 0.74081 (i.e. 1.349873): - // ym: 0.236228; dac1: 0.21463; dac2: 0.472456, ssgA+B: 0.06582; ssg3: 0.010866) - + // ym: 0.236228; dac1: 0.21463; dac2: 0.472456, ssgA+B: 0.065819; ssg3: 0.108664) FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); // R10, R11, nothing(infinite resistance), wire(short), C11, C12 m_ymfilter->add_route(ALL_OUTPUTS, "speaker", 1.0); FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(22), RES_K(22), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R17, R18, nothing(infinite resistance), wire(short), C19, C17 @@ -846,9 +842,11 @@ void terracre_state::ym2203(machine_config &config) // Technically there may be some capacitance from YC3, although that is intended to be part of the SK filter below. FILTER_BIQUAD(config, m_ssgfilter_abgain).opamp_mfb_lowpass_setup(RES_K(4.7), 0.0, RES_K(10), 0.0, CAP_N(22)/100.0); // YR12, N/A(short), YR15, N/A(unpopulated), (parasitic capacitance from YC3) m_ssgfilter_abgain->add_route(ALL_OUTPUTS, "speaker", 1.0); + // This filter is a 2nd order sallen-key lowpass, unity gain. FILTER_BIQUAD(config, m_ssgfilter_abfilt).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(22), CAP_N(10)); // YR3, YR5, nothing(infinite resistance), wire(short), YC3, YC6 m_ssgfilter_abfilt->add_route(ALL_OUTPUTS, m_ssgfilter_abgain, 1.0); + // This filter is a first order inverting op-amp lowpass circuit with a gain of -4.54545 and a // cutoff at 10.1hz (YR8, YR7, YC1). // Technically it was probably intended as first order MFB lowpass, but the cap ("YC0") @@ -859,12 +857,12 @@ void terracre_state::ym2203(machine_config &config) m_ssgfilter_cgain->add_route(ALL_OUTPUTS, "speaker", 1.0); MIXER(config, m_ssgmixer); - m_ssgmixer->add_route(0, m_ssgfilter_abfilt, 0.06582); + m_ssgmixer->add_route(0, m_ssgfilter_abfilt, 0.065819); - ym2203_device &ym1(YM2203(config, "ym1", XTAL(16'000'000) / 4)); // 4MHz verified on PCB + ym2203_device &ym1(YM2203(config, "ym1", XTAL(16'000'000) / 4)); // 4MHz verified on PCB ym1.add_route(0, m_ssgmixer, 1.0); ym1.add_route(1, m_ssgmixer, 1.0); - ym1.add_route(2, m_ssgfilter_cgain, 0.010866); + ym1.add_route(2, m_ssgfilter_cgain, 0.108664); ym1.add_route(3, m_ymfilter, 0.2362); DAC_8BIT_R2R(config, "dac1", 0).add_route(ALL_OUTPUTS, m_dacfilter1, 0.2146); // SIP R2R DAC @ RA-1 with 74HC374P latch -- cgit v1.2.3