summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2019-03-30 11:44:23 -0400
committer GitHub <noreply@github.com>2019-03-30 11:44:23 -0400
commit2d1edb51cb66a3ace4fc20091341f9fa8f35e27c (patch)
tree9d7939bde5c1a075a2fc0df166da950ddf63a505
parente517fff98cfb4b1b4bb96922f372895f877aa530 (diff)
parent494954502705bab262bf9f25f4fcd27c56e561f3 (diff)
Merge pull request #4826 from cam900/mmc5_temp
devices/bus/nes/mmc5.cpp : Correct sound behavior
-rw-r--r--src/devices/bus/nes/mmc5.cpp16
-rw-r--r--src/devices/bus/nes/mmc5.h1
2 files changed, 16 insertions, 1 deletions
diff --git a/src/devices/bus/nes/mmc5.cpp b/src/devices/bus/nes/mmc5.cpp
index b512f914e8b..1feef95aa67 100644
--- a/src/devices/bus/nes/mmc5.cpp
+++ b/src/devices/bus/nes/mmc5.cpp
@@ -18,6 +18,7 @@
#include "emu.h"
#include "mmc5.h"
+#include "speaker.h"
#ifdef NES_PCB_DEBUG
#define VERBOSE 1
@@ -46,7 +47,7 @@ nes_exrom_device::nes_exrom_device(const machine_config &mconfig, const char *ta
, m_prg_mode(0), m_chr_mode(0), m_wram_protect_1(0), m_wram_protect_2(0), m_exram_control(0), m_wram_base(0), m_last_chr(0), m_ex1_chr(0)
, m_split_chr(0), m_ex1_bank(0), m_high_chr(0), m_split_scr(0), m_split_rev(0), m_split_ctrl(0), m_split_yst(0), m_split_bank(0), m_vcount(0)
, m_ppu(*this, ":ppu") // FIXME: this dependency should not exist
- , m_sound(*this, ":maincpu:nesapu") // FIXME: this is a hack, it should have extra channels, not pass to the existing APU!!!
+ , m_sound(*this, "mmc5snd") // FIXME: this is a hack, it should be separated device, similar not same as NES APU!!!
{
}
@@ -677,3 +678,16 @@ void nes_exrom_device::write_h(offs_t offset, uint8_t data)
else if (!m_prgram.empty())
m_prgram[(((m_ram_hi_banks[bank] & 3) * 0x2000) + (offset & 0x1fff)) & (m_prgram.size() - 1)] = data;
}
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void nes_exrom_device::device_add_mconfig(machine_config &config)
+{
+ // additional sound hardware
+ SPEAKER(config, "addon").front_center();
+
+ // TODO: temporary; will be separated device
+ NES_APU(config, m_sound, XTAL(21'477'272)/12).add_route(ALL_OUTPUTS, "addon", 0.50);
+}
diff --git a/src/devices/bus/nes/mmc5.h b/src/devices/bus/nes/mmc5.h
index 093a64471d0..86914fec177 100644
--- a/src/devices/bus/nes/mmc5.h
+++ b/src/devices/bus/nes/mmc5.h
@@ -36,6 +36,7 @@ public:
protected:
// device-level overrides
+ virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
void set_mirror(int page, int src);