diff options
author | 2019-03-25 23:13:40 +0100 | |
---|---|---|
committer | 2019-03-25 23:13:40 +0100 | |
commit | b380514764cf857469bae61c11143a19f79a74c5 (patch) | |
tree | 63c8012e262618f08a332da31dd714281aa2c5ed /src/devices/bus/nes/konami.cpp | |
parent | c24473ddff715ecec2e258a6eb38960cf8c8e98e (diff) |
Revert "conflict resolution (nw)"
This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing
changes made to 009cba4fb8102102168ef32870892438327f3705.
Diffstat (limited to 'src/devices/bus/nes/konami.cpp')
-rw-r--r-- | src/devices/bus/nes/konami.cpp | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/src/devices/bus/nes/konami.cpp b/src/devices/bus/nes/konami.cpp index 2d3f20863cb..320ceb1eb9b 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_vrc7snd(*this, "vrc7snd") + : nes_konami_vrc4_device(mconfig, NES_VRC7, tag, owner, clock), m_ym2413(*this, "ym") { } @@ -239,7 +239,7 @@ void nes_konami_vrc7_device::pcb_reset() -------------------------------------------------*/ -void nes_konami_vrc1_device::write_h(offs_t offset, uint8_t data) +WRITE8_MEMBER(nes_konami_vrc1_device::write_h) { LOG_MMC(("VRC-1 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -280,7 +280,7 @@ void nes_konami_vrc1_device::write_h(offs_t offset, uint8_t data) -------------------------------------------------*/ -uint8_t nes_konami_vrc2_device::read_m(offs_t offset) +READ8_MEMBER(nes_konami_vrc2_device::read_m) { LOG_MMC(("VRC-2 read_m, offset: %04x\n", offset)); @@ -289,10 +289,10 @@ uint8_t nes_konami_vrc2_device::read_m(offs_t offset) 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) ? ((get_open_bus() & 0xfe) | (m_latch & 1)) : get_open_bus(); + return (offset < 0x1000) ? ((m_open_bus & 0xfe) | (m_latch & 1)) : m_open_bus; } -void nes_konami_vrc2_device::write_m(offs_t offset, uint8_t data) +WRITE8_MEMBER(nes_konami_vrc2_device::write_m) { LOG_MMC(("VRC-2 write_m, offset: %04x, data: %02x\n", offset, data)); @@ -304,7 +304,7 @@ void nes_konami_vrc2_device::write_m(offs_t offset, uint8_t data) m_latch = data; } -void nes_konami_vrc2_device::write_h(offs_t offset, uint8_t data) +WRITE8_MEMBER(nes_konami_vrc2_device::write_h) { 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, } } -void nes_konami_vrc3_device::write_h(offs_t offset, uint8_t data) +WRITE8_MEMBER(nes_konami_vrc3_device::write_h) { LOG_MMC(("VRC-3 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -482,7 +482,7 @@ void nes_konami_vrc4_device::set_prg() } } -void nes_konami_vrc4_device::write_h(offs_t offset, uint8_t data) +WRITE8_MEMBER(nes_konami_vrc4_device::write_h) { 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 @@ void nes_konami_vrc4_device::write_h(offs_t offset, uint8_t data) -------------------------------------------------*/ -void nes_konami_vrc6_device::write_h(offs_t offset, uint8_t data) +WRITE8_MEMBER(nes_konami_vrc6_device::write_h) { 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 @@ void nes_konami_vrc6_device::write_h(offs_t offset, uint8_t data) prg8_cd(data); break; case 0x1000: // pulse 1 & global control - m_vrc6snd->write(add_lines>>8, data); + m_vrc6snd->write(space, add_lines>>8, data); break; case 0x2000: // pulse 2 - m_vrc6snd->write((add_lines>>8) | 0x100, data); + m_vrc6snd->write(space, (add_lines>>8) | 0x100, data); break; case 0x3000: if (add_lines == 0x300) @@ -596,7 +596,7 @@ void nes_konami_vrc6_device::write_h(offs_t offset, uint8_t data) } } else // saw - m_vrc6snd->write((add_lines>>8) | 0x200, data); + m_vrc6snd->write(space, (add_lines>>8) | 0x200, data); break; case 0x5000: case 0x6000: @@ -637,15 +637,16 @@ void nes_konami_vrc6_device::write_h(offs_t offset, uint8_t data) // device_add_mconfig - add device configuration //------------------------------------------------- -void nes_konami_vrc6_device::device_add_mconfig(machine_config &config) -{ +MACHINE_CONFIG_START(nes_konami_vrc6_device::device_add_mconfig) + // 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! - VRC6(config, m_vrc6snd, XTAL(21'477'272)/12).add_route(ALL_OUTPUTS, "addon", 0.5); -} + MCFG_DEVICE_ADD("vrc6snd", VRC6, XTAL(21'477'272)/12) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.5) +MACHINE_CONFIG_END /*------------------------------------------------- @@ -659,7 +660,7 @@ void nes_konami_vrc6_device::device_add_mconfig(machine_config &config) -------------------------------------------------*/ -void nes_konami_vrc7_device::write_h(offs_t offset, uint8_t data) +WRITE8_MEMBER(nes_konami_vrc7_device::write_h) { uint8_t bank; LOG_MMC(("VRC-7 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -681,11 +682,11 @@ void nes_konami_vrc7_device::write_h(offs_t offset, uint8_t data) case 0x1010: case 0x1018: - m_vrc7snd->register_port_w(data); + m_ym2413->register_port_w(space, 0, data); break; case 0x1030: case 0x1038: - m_vrc7snd->data_port_w(data); + m_ym2413->data_port_w(space, 0, data); break; case 0x2000: @@ -758,12 +759,15 @@ void nes_konami_vrc7_device::write_h(offs_t offset, uint8_t data) // 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. -void nes_konami_vrc7_device::device_add_mconfig(machine_config &config) -{ +// FIXME: we currently emulate this as a base YM2413! + +MACHINE_CONFIG_START(nes_konami_vrc7_device::device_add_mconfig) + // 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! - VRC7(config, m_vrc7snd, XTAL(21'477'272)/6).add_route(0, "addon", 1.0).add_route(1, "addon", 0.0); -} + MCFG_DEVICE_ADD("ym", YM2413, XTAL(21'477'272)/12) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.5) +MACHINE_CONFIG_END |