Skip to content

Commit

Permalink
Various volume level adjustements to avoid hitting limiter. (#8553)
Browse files Browse the repository at this point in the history
* Adjusted levels in mustache.cpp, metlfrzr.cpp, xyonix.cpp, labybug.cpp, pgm.cpp, terracre.cpp, boogwing.cpp, astrocde.cpp, and gottlieb.cpp.
* Re-balanced some Votrax stuff, attempting to keep the chip output between +/-1.0.
  • Loading branch information
David Haywood committed Sep 23, 2021
1 parent 56d3608 commit 5d7a519
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/devices/sound/votrax.cpp
Expand Up @@ -633,7 +633,7 @@ stream_buffer::sample_t votrax_sc01_device::analog_calc()
vn = apply_filter(m_vn_5, m_vn_6, m_fx_a, m_fx_b);
shift_hist(vn, m_vn_6);

return vn*1.5;
return vn*0.35;
}

/*
Expand Down
9 changes: 6 additions & 3 deletions src/mame/audio/gottlieb.cpp
Expand Up @@ -13,7 +13,6 @@
#include "emu.h"
#include "audio/gottlieb.h"

#include "sound/dac.h"
#include "machine/input_merger.h"


Expand Down Expand Up @@ -171,6 +170,7 @@ gottlieb_sound_r1_device::gottlieb_sound_r1_device(
uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
, device_mixer_interface(mconfig, *this)
, m_dac(*this, "dac")
, m_riot(*this, "riot")
{
}
Expand Down Expand Up @@ -256,7 +256,7 @@ void gottlieb_sound_r1_device::device_add_mconfig(machine_config &config)
m_riot->irq_callback().set_inputline("audiocpu", M6502_IRQ_LINE);

// sound devices
DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, *this, 0.25); // unknown DAC
DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, *this, 0.25); // unknown DAC
}


Expand Down Expand Up @@ -306,10 +306,13 @@ void gottlieb_sound_r1_with_votrax_device::device_add_mconfig(machine_config &co
{
gottlieb_sound_r1_device::device_add_mconfig(config);

m_dac->reset_routes();
m_dac->add_route(ALL_OUTPUTS, *this, 0.20);

// add the VOTRAX
VOTRAX_SC01(config, m_votrax, 720000);
m_votrax->ar_callback().set("nmi", FUNC(input_merger_device::in_w<1>));
m_votrax->add_route(ALL_OUTPUTS, *this, 0.5);
m_votrax->add_route(ALL_OUTPUTS, *this, 0.80);
}


Expand Down
4 changes: 4 additions & 0 deletions src/mame/audio/gottlieb.h
Expand Up @@ -10,6 +10,7 @@
#include "machine/mos6530.h"
#include "machine/6532riot.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "sound/sp0250.h"
#include "sound/votrax.h"

Expand Down Expand Up @@ -88,6 +89,9 @@ class gottlieb_sound_r1_device : public device_t, public device_mixer_interface

virtual void gottlieb_sound_r1_map(address_map &map);

protected:
required_device<dac_8bit_r2r_device> m_dac;

private:
// devices
required_device<riot6532_device> m_riot;
Expand Down
20 changes: 13 additions & 7 deletions src/mame/drivers/astrocde.cpp
Expand Up @@ -563,7 +563,7 @@ void astrocde_state::port_map_mono_pattern(address_map &map)
void astrocde_state::port_map_stereo_pattern(address_map &map)
{
port_map_mono_pattern(map);
map(0x0050, 0x0058).select(0xff00).w("astrocade2", FUNC(astrocade_io_device::write));
map(0x0050, 0x0058).select(0xff00).w(m_astrocade_sound2, FUNC(astrocade_io_device::write));
}


Expand Down Expand Up @@ -1236,9 +1236,9 @@ void astrocde_state::astrocade_stereo_sound(machine_config &config)
ASTROCADE_IO(config, m_astrocade_sound1, ASTROCADE_CLOCK/4);
m_astrocade_sound1->si_cb().set(FUNC(astrocde_state::input_mux_r));
m_astrocade_sound1->so_cb<0>().set("watchdog", FUNC(watchdog_timer_device::reset_w));
m_astrocade_sound1->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
m_astrocade_sound1->add_route(ALL_OUTPUTS, "lspeaker", 1.00);

ASTROCADE_IO(config, "astrocade2", ASTROCADE_CLOCK/4).add_route(ALL_OUTPUTS, "rspeaker", 1.0);
ASTROCADE_IO(config, m_astrocade_sound2, ASTROCADE_CLOCK/4).add_route(ALL_OUTPUTS, "rspeaker", 1.00);

WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 128); // MC14024B on CPU board at U18, CLK = VERTDR, Q7 used for RESET
}
Expand Down Expand Up @@ -1357,9 +1357,15 @@ void astrocde_state::wow(machine_config &config)
m_astrocade_sound1->so_cb<5>().set("outlatch", FUNC(cd4099_device::write_nibble_d0));
m_astrocade_sound1->so_cb<7>().set(FUNC(astrocde_state::votrax_speech_w));

m_astrocade_sound1->reset_routes();
m_astrocade_sound1->add_route(ALL_OUTPUTS, "lspeaker", 0.35);

m_astrocade_sound2->reset_routes();
m_astrocade_sound2->add_route(ALL_OUTPUTS, "lspeaker", 0.35);

VOTRAX_SC01(config, m_votrax, 756000);

m_votrax->add_route(0, "f1", 0.85);
m_votrax->add_route(0, "f1", 0.65);
FILTER_RC(config, "f1").set_lowpass(110e3, 560e-12).add_route(0, "f2", 1.00);
FILTER_RC(config, "f2").set_lowpass(110e3, 560e-12).add_route(0, "f3", 1.00);
FILTER_RC(config, "f3").set_lowpass(110e3, 560e-12).add_route(0, "f4", 1.00);
Expand Down Expand Up @@ -1409,12 +1415,12 @@ void astrocde_state::gorf(machine_config &config)
m_astrocade_sound1->so_cb<5>().set("outlatch", FUNC(cd4099_device::write_nibble_d0));
m_astrocade_sound1->so_cb<6>().set("lamplatch", FUNC(cd4099_device::write_nibble_d0));
m_astrocade_sound1->so_cb<7>().set(FUNC(astrocde_state::votrax_speech_w));
m_astrocade_sound1->add_route(ALL_OUTPUTS, "upper", 1.0);
m_astrocade_sound1->add_route(ALL_OUTPUTS, "upper", 0.45);

ASTROCADE_IO(config, "astrocade2", ASTROCADE_CLOCK/4).add_route(ALL_OUTPUTS, "lower", 1.0);
ASTROCADE_IO(config, m_astrocade_sound2, ASTROCADE_CLOCK/4).add_route(ALL_OUTPUTS, "lower", 0.45);

VOTRAX_SC01(config, m_votrax, 756000);
m_votrax->add_route(ALL_OUTPUTS, "upper", 0.85);
m_votrax->add_route(ALL_OUTPUTS, "upper", 0.55);
}

void astrocde_state::robby(machine_config &config)
Expand Down
12 changes: 6 additions & 6 deletions src/mame/drivers/boogwing.cpp
Expand Up @@ -396,16 +396,16 @@ void boogwing_state::boogwing(machine_config &config)
ym2151_device &ymsnd(YM2151(config, "ymsnd", SOUND_XTAL/9));
ymsnd.irq_handler().set_inputline(m_audiocpu, 1); /* IRQ2 */
ymsnd.port_write_handler().set(FUNC(boogwing_state::sound_bankswitch_w));
ymsnd.add_route(0, "lspeaker", 0.80);
ymsnd.add_route(1, "rspeaker", 0.80);
ymsnd.add_route(0, "lspeaker", 0.32);
ymsnd.add_route(1, "rspeaker", 0.32);

OKIM6295(config, m_oki[0], SOUND_XTAL/32, okim6295_device::PIN7_HIGH);
m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.40);
m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.40);
m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.56);
m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.56);

OKIM6295(config, m_oki[1], SOUND_XTAL/16, okim6295_device::PIN7_HIGH);
m_oki[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.30);
m_oki[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.30);
m_oki[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.12);
m_oki[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.12);
}

/**********************************************************************************/
Expand Down
24 changes: 12 additions & 12 deletions src/mame/drivers/ladybug.cpp
Expand Up @@ -852,8 +852,8 @@ void ladybug_state::ladybug(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();

SN76489(config, "sn1", 4_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn2", 4_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn1", 4_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 0.5);
SN76489(config, "sn2", 4_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 0.5);
}

void dorodon_state::dorodon(machine_config &config)
Expand Down Expand Up @@ -893,11 +893,11 @@ void mrsdyna_state::mrsdyna(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();

SN76489(config, "sn1", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn2", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn3", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn4", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn5", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn1", 4000000).add_route(ALL_OUTPUTS, "mono", 0.2);
SN76489(config, "sn2", 4000000).add_route(ALL_OUTPUTS, "mono", 0.2);
SN76489(config, "sn3", 4000000).add_route(ALL_OUTPUTS, "mono", 0.2);
SN76489(config, "sn4", 4000000).add_route(ALL_OUTPUTS, "mono", 0.2);
SN76489(config, "sn5", 4000000).add_route(ALL_OUTPUTS, "mono", 0.2);
}

void sraider_state::sraider(machine_config &config)
Expand Down Expand Up @@ -931,11 +931,11 @@ void sraider_state::sraider(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();

SN76489(config, "sn1", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn2", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn3", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn4", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn5", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn1", 4000000).add_route(ALL_OUTPUTS, "mono", 0.2);
SN76489(config, "sn2", 4000000).add_route(ALL_OUTPUTS, "mono", 0.2);
SN76489(config, "sn3", 4000000).add_route(ALL_OUTPUTS, "mono", 0.2);
SN76489(config, "sn4", 4000000).add_route(ALL_OUTPUTS, "mono", 0.2);
SN76489(config, "sn5", 4000000).add_route(ALL_OUTPUTS, "mono", 0.2);
}


Expand Down
4 changes: 2 additions & 2 deletions src/mame/drivers/metlfrzr.cpp
Expand Up @@ -406,8 +406,8 @@ void metlfrzr_state::metlfrzr(machine_config &config)

ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(14'318'181) / 4)); /* 3.579545 MHz */
ymsnd.irq_handler().set("t5182", FUNC(t5182_device::ym2151_irq_handler));
ymsnd.add_route(0, "mono", 1.0);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(0, "mono", 0.5);
ymsnd.add_route(1, "mono", 0.5);
}


Expand Down
4 changes: 2 additions & 2 deletions src/mame/drivers/mustache.cpp
Expand Up @@ -190,8 +190,8 @@ void mustache_state::mustache(machine_config &config)

ym2151_device &ymsnd(YM2151(config, "ymsnd", 14.318181_MHz_XTAL/4));
ymsnd.irq_handler().set("t5182", FUNC(t5182_device::ym2151_irq_handler));
ymsnd.add_route(0, "mono", 1.0);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(0, "mono", 0.5);
ymsnd.add_route(1, "mono", 0.5);
}

ROM_START( mustache )
Expand Down
2 changes: 1 addition & 1 deletion src/mame/drivers/pgm.cpp
Expand Up @@ -523,7 +523,7 @@ void pgm_state::pgmbase(machine_config &config)

ICS2115(config, m_ics, 33.8688_MHz_XTAL);
m_ics->irq().set_inputline("soundcpu", 0);
m_ics->add_route(ALL_OUTPUTS, "mono", 5.0);
m_ics->add_route(ALL_OUTPUTS, "mono", 1.0);
}

void pgm_state::pgm(machine_config &config)
Expand Down
14 changes: 7 additions & 7 deletions src/mame/drivers/terracre.cpp
Expand Up @@ -482,10 +482,10 @@ void terracre_state::ym3526(machine_config &config)

GENERIC_LATCH_8(config, m_soundlatch);

YM3526(config, "ymsnd", XTAL(16'000'000)/4).add_route(ALL_OUTPUTS, "speaker", 1.0); // 4MHz verified on PCB
YM3526(config, "ymsnd", XTAL(16'000'000)/4).add_route(ALL_OUTPUTS, "speaker", 0.5); // 4MHz verified on PCB

DAC_8BIT_R2R(config, "dac1", 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC
DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC
DAC_8BIT_R2R(config, "dac1", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC
DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC
}

void terracre_state::ym2203(machine_config &config)
Expand All @@ -496,10 +496,10 @@ void terracre_state::ym2203(machine_config &config)
config.device_remove("ymsnd");

ym2203_device &ym1(YM2203(config, "ym1", XTAL(16'000'000)/4)); // 4MHz verified on PCB
ym1.add_route(0, "speaker", 0.2);
ym1.add_route(1, "speaker", 0.2);
ym1.add_route(2, "speaker", 0.2);
ym1.add_route(3, "speaker", 0.4);
ym1.add_route(0, "speaker", 0.1);
ym1.add_route(1, "speaker", 0.1);
ym1.add_route(2, "speaker", 0.1);
ym1.add_route(3, "speaker", 0.2);
}

void terracre_state::amazon_base(machine_config &config)
Expand Down
4 changes: 2 additions & 2 deletions src/mame/drivers/xyonix.cpp
Expand Up @@ -430,8 +430,8 @@ void xyonix_state::xyonix(machine_config &config)
// sound hardware
SPEAKER(config, "mono").front_center();

SN76496(config, "sn1", 16000000/4).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76496(config, "sn2", 16000000/4).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76496(config, "sn1", 16000000/4).add_route(ALL_OUTPUTS, "mono", 0.5);
SN76496(config, "sn2", 16000000/4).add_route(ALL_OUTPUTS, "mono", 0.5);
}

/* ROM Loading ***************************************************************/
Expand Down
2 changes: 2 additions & 0 deletions src/mame/includes/astrocde.h
Expand Up @@ -41,6 +41,7 @@ class astrocde_state : public driver_device
m_maincpu(*this, "maincpu"),
m_votrax(*this, "votrax"),
m_astrocade_sound1(*this, "astrocade1"),
m_astrocade_sound2(*this, "astrocade2"),
m_videoram(*this, "videoram"),
m_protected_ram(*this, "protected_ram"),
m_nvram(*this, "nvram"),
Expand All @@ -56,6 +57,7 @@ class astrocde_state : public driver_device
required_device<cpu_device> m_maincpu;
optional_device<votrax_sc01_device> m_votrax;
optional_device<astrocade_io_device> m_astrocade_sound1;
optional_device<astrocade_io_device> m_astrocade_sound2;
optional_shared_ptr<uint8_t> m_videoram;
optional_shared_ptr<uint8_t> m_protected_ram;
optional_shared_ptr<uint8_t> m_nvram;
Expand Down

0 comments on commit 5d7a519

Please sign in to comment.