diff options
Diffstat (limited to 'src/devices/bus/nes/konami.cpp')
-rw-r--r-- | src/devices/bus/nes/konami.cpp | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/src/devices/bus/nes/konami.cpp b/src/devices/bus/nes/konami.cpp index 320ceb1eb9b..2d3f20863cb 100644 --- a/src/devices/bus/nes/konami.cpp +++ b/src/devices/bus/nes/konami.cpp @@ -81,7 +81,7 @@ nes_konami_vrc6_device::nes_konami_vrc6_device(const machine_config &mconfig, co } nes_konami_vrc7_device::nes_konami_vrc7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_konami_vrc4_device(mconfig, NES_VRC7, tag, owner, clock), m_ym2413(*this, "ym") + : nes_konami_vrc4_device(mconfig, NES_VRC7, tag, owner, clock), m_vrc7snd(*this, "vrc7snd") { } @@ -239,7 +239,7 @@ void nes_konami_vrc7_device::pcb_reset() -------------------------------------------------*/ -WRITE8_MEMBER(nes_konami_vrc1_device::write_h) +void nes_konami_vrc1_device::write_h(offs_t offset, uint8_t data) { LOG_MMC(("VRC-1 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -280,7 +280,7 @@ WRITE8_MEMBER(nes_konami_vrc1_device::write_h) -------------------------------------------------*/ -READ8_MEMBER(nes_konami_vrc2_device::read_m) +uint8_t nes_konami_vrc2_device::read_m(offs_t offset) { LOG_MMC(("VRC-2 read_m, offset: %04x\n", offset)); @@ -289,10 +289,10 @@ READ8_MEMBER(nes_konami_vrc2_device::read_m) else if (!m_prgram.empty()) return m_prgram[offset & (m_prgram.size() - 1)]; else // sort of protection? it returns open bus in $7000-$7fff and (open bus & 0xfe) | m_latch in $6000-$6fff - return (offset < 0x1000) ? ((m_open_bus & 0xfe) | (m_latch & 1)) : m_open_bus; + return (offset < 0x1000) ? ((get_open_bus() & 0xfe) | (m_latch & 1)) : get_open_bus(); } -WRITE8_MEMBER(nes_konami_vrc2_device::write_m) +void nes_konami_vrc2_device::write_m(offs_t offset, uint8_t data) { LOG_MMC(("VRC-2 write_m, offset: %04x, data: %02x\n", offset, data)); @@ -304,7 +304,7 @@ WRITE8_MEMBER(nes_konami_vrc2_device::write_m) m_latch = data; } -WRITE8_MEMBER(nes_konami_vrc2_device::write_h) +void nes_konami_vrc2_device::write_h(offs_t offset, uint8_t data) { uint8_t bank, shift, mask; uint16_t add_lines = ((offset << (9 - m_vrc_ls_prg_a)) & 0x200) | ((offset << (8 - m_vrc_ls_prg_b)) & 0x100); @@ -385,7 +385,7 @@ void nes_konami_vrc3_device::device_timer(emu_timer &timer, device_timer_id id, } } -WRITE8_MEMBER(nes_konami_vrc3_device::write_h) +void nes_konami_vrc3_device::write_h(offs_t offset, uint8_t data) { LOG_MMC(("VRC-3 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -482,7 +482,7 @@ void nes_konami_vrc4_device::set_prg() } } -WRITE8_MEMBER(nes_konami_vrc4_device::write_h) +void nes_konami_vrc4_device::write_h(offs_t offset, uint8_t data) { uint8_t bank, shift, mask; uint16_t add_lines = ((offset << (9 - m_vrc_ls_prg_a)) & 0x200) | ((offset << (8 - m_vrc_ls_prg_b)) & 0x100); @@ -564,7 +564,7 @@ WRITE8_MEMBER(nes_konami_vrc4_device::write_h) -------------------------------------------------*/ -WRITE8_MEMBER(nes_konami_vrc6_device::write_h) +void nes_konami_vrc6_device::write_h(offs_t offset, uint8_t data) { uint8_t bank; uint16_t add_lines = ((offset << (9 - m_vrc_ls_prg_a)) & 0x200) | ((offset << (8 - m_vrc_ls_prg_b)) & 0x100); @@ -579,10 +579,10 @@ WRITE8_MEMBER(nes_konami_vrc6_device::write_h) prg8_cd(data); break; case 0x1000: // pulse 1 & global control - m_vrc6snd->write(space, add_lines>>8, data); + m_vrc6snd->write(add_lines>>8, data); break; case 0x2000: // pulse 2 - m_vrc6snd->write(space, (add_lines>>8) | 0x100, data); + m_vrc6snd->write((add_lines>>8) | 0x100, data); break; case 0x3000: if (add_lines == 0x300) @@ -596,7 +596,7 @@ WRITE8_MEMBER(nes_konami_vrc6_device::write_h) } } else // saw - m_vrc6snd->write(space, (add_lines>>8) | 0x200, data); + m_vrc6snd->write((add_lines>>8) | 0x200, data); break; case 0x5000: case 0x6000: @@ -637,16 +637,15 @@ WRITE8_MEMBER(nes_konami_vrc6_device::write_h) // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(nes_konami_vrc6_device::device_add_mconfig) - +void nes_konami_vrc6_device::device_add_mconfig(machine_config &config) +{ // additional sound hardware SPEAKER(config, "addon").front_center(); // TODO: this is not how VRC6 clock signaling works! // The board uses the CLK pin in reality, not hardcoded NTSC values! - MCFG_DEVICE_ADD("vrc6snd", VRC6, XTAL(21'477'272)/12) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.5) -MACHINE_CONFIG_END + VRC6(config, m_vrc6snd, XTAL(21'477'272)/12).add_route(ALL_OUTPUTS, "addon", 0.5); +} /*------------------------------------------------- @@ -660,7 +659,7 @@ MACHINE_CONFIG_END -------------------------------------------------*/ -WRITE8_MEMBER(nes_konami_vrc7_device::write_h) +void nes_konami_vrc7_device::write_h(offs_t offset, uint8_t data) { uint8_t bank; LOG_MMC(("VRC-7 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -682,11 +681,11 @@ WRITE8_MEMBER(nes_konami_vrc7_device::write_h) case 0x1010: case 0x1018: - m_ym2413->register_port_w(space, 0, data); + m_vrc7snd->register_port_w(data); break; case 0x1030: case 0x1038: - m_ym2413->data_port_w(space, 0, data); + m_vrc7snd->data_port_w(data); break; case 0x2000: @@ -759,15 +758,12 @@ WRITE8_MEMBER(nes_konami_vrc7_device::write_h) // and has one output pin for audio, multiplexed for all 6 channels; OPLL has two output pins, one for // FM and one for Rhythm, and has no special status pin. -// FIXME: we currently emulate this as a base YM2413! - -MACHINE_CONFIG_START(nes_konami_vrc7_device::device_add_mconfig) - +void nes_konami_vrc7_device::device_add_mconfig(machine_config &config) +{ // additional sound hardware SPEAKER(config, "addon").front_center(); // TODO: this is not how VRC7 clock signaling works! // The board uses the CLK pin in reality, not hardcoded NTSC values! - MCFG_DEVICE_ADD("ym", YM2413, XTAL(21'477'272)/12) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.5) -MACHINE_CONFIG_END + VRC7(config, m_vrc7snd, XTAL(21'477'272)/6).add_route(0, "addon", 1.0).add_route(1, "addon", 0.0); +} |