diff options
Diffstat (limited to 'src/devices/cpu/m6502')
-rw-r--r-- | src/devices/cpu/m6502/n2a03.cpp | 19 | ||||
-rw-r--r-- | src/devices/cpu/m6502/n2a03.h | 29 |
2 files changed, 38 insertions, 10 deletions
diff --git a/src/devices/cpu/m6502/n2a03.cpp b/src/devices/cpu/m6502/n2a03.cpp index f303f1bf1b6..e1731b62e75 100644 --- a/src/devices/cpu/m6502/n2a03.cpp +++ b/src/devices/cpu/m6502/n2a03.cpp @@ -12,6 +12,7 @@ #include "n2a03.h" #include "n2a03d.h" +DEFINE_DEVICE_TYPE(N2A03_CORE, n2a03_core_device, "n2a03_core", "Ricoh N2A03 core") // needed for some VT systems with XOP instead of standard APU DEFINE_DEVICE_TYPE(N2A03, n2a03_device, "n2a03", "Ricoh N2A03") uint8_t n2a03_device::psg1_4014_r() @@ -51,15 +52,29 @@ void n2a03_device::n2a03_map(address_map &map) +n2a03_core_device::n2a03_core_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : m6502_device(mconfig, type, tag, owner, clock) +{ +} + +n2a03_core_device::n2a03_core_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : n2a03_core_device(mconfig, N2A03_CORE, tag, owner, clock) +{ +} + + + n2a03_device::n2a03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : m6502_device(mconfig, N2A03, tag, owner, clock) + : n2a03_core_device(mconfig, N2A03, tag, owner, clock) , device_mixer_interface(mconfig, *this, 1) , m_apu(*this, "nesapu") { program_config.m_internal_map = address_map_constructor(FUNC(n2a03_device::n2a03_map), this); } -std::unique_ptr<util::disasm_interface> n2a03_device::create_disassembler() + + +std::unique_ptr<util::disasm_interface> n2a03_core_device::create_disassembler() { return std::make_unique<n2a03_disassembler>(); } diff --git a/src/devices/cpu/m6502/n2a03.h b/src/devices/cpu/m6502/n2a03.h index 5a57bcbed2b..4232093c7a5 100644 --- a/src/devices/cpu/m6502/n2a03.h +++ b/src/devices/cpu/m6502/n2a03.h @@ -15,22 +15,18 @@ #include "m6502.h" #include "sound/nes_apu.h" -class n2a03_device : public m6502_device, public device_mixer_interface { +class n2a03_core_device : public m6502_device { public: - n2a03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + n2a03_core_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; virtual void do_exec_full() override; virtual void do_exec_partial() override; - uint8_t psg1_4014_r(); - uint8_t psg1_4015_r(); - void psg1_4015_w(uint8_t data); - void psg1_4017_w(uint8_t data); - - void n2a03_map(address_map &map); protected: + n2a03_core_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + #define O(o) void o ## _full(); void o ## _partial() // n2a03 opcodes - same as 6502 with D disabled @@ -42,6 +38,21 @@ protected: #undef O +private: +}; + +class n2a03_device : public n2a03_core_device, public device_mixer_interface { +public: + n2a03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + uint8_t psg1_4014_r(); + uint8_t psg1_4015_r(); + void psg1_4015_w(uint8_t data); + void psg1_4017_w(uint8_t data); + + void n2a03_map(address_map &map); +protected: + required_device<nesapu_device> m_apu; virtual void device_add_mconfig(machine_config &config) override; @@ -52,6 +63,7 @@ private: }; + /* These are the official XTAL values and clock rates used by Nintendo for manufacturing throughout the production of the 2A03. PALC_APU_CLOCK is the clock rate devised by UMC(?) for PAL Famicom clone hardware. */ @@ -69,6 +81,7 @@ enum { N2A03_SET_OVERFLOW = m6502_device::V_LINE }; +DECLARE_DEVICE_TYPE(N2A03_CORE, n2a03_core_device) DECLARE_DEVICE_TYPE(N2A03, n2a03_device) #endif // MAME_CPU_M6502_N2A03_H |