From 0409e0415107d047e95b15b267ad2575e16d076e Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 24 Jul 2023 18:25:27 +0200 Subject: m6502: add 6503 cpu --- scripts/src/cpu.lua | 3 +++ src/devices/cpu/m6502/deco16.cpp | 2 +- src/devices/cpu/m6502/dm6502.lst | 2 +- src/devices/cpu/m6502/m4510.h | 2 +- src/devices/cpu/m6502/m6500_1.cpp | 2 +- src/devices/cpu/m6502/m6502.txt | 10 ++++++++-- src/devices/cpu/m6502/m6503.cpp | 23 +++++++++++++++++++++++ src/devices/cpu/m6502/m6503.h | 28 ++++++++++++++++++++++++++++ src/devices/cpu/m6502/m6504.cpp | 4 +++- src/devices/cpu/m6502/m6504.h | 4 +--- src/devices/cpu/m6502/m6507.cpp | 4 +++- src/devices/cpu/m6502/m6507.h | 4 +--- src/devices/cpu/m6502/m6509.cpp | 2 +- src/devices/cpu/m6502/m6510.cpp | 2 +- src/devices/cpu/m6502/m6510.h | 1 + src/devices/cpu/m6502/m6510t.cpp | 2 +- src/devices/cpu/m6502/m65c02.cpp | 2 +- src/devices/cpu/m6502/m65ce02.cpp | 2 +- src/devices/cpu/m6502/m65sc02.cpp | 2 +- src/devices/cpu/m6502/m740.cpp | 2 +- src/devices/cpu/m6502/m7501.cpp | 2 +- src/devices/cpu/m6502/m8502.cpp | 2 +- src/devices/cpu/m6502/r65c02.cpp | 2 +- src/devices/cpu/m6502/xavix2000.cpp | 5 ----- src/mame/pinball/spectra.cpp | 5 ++--- src/mame/shared/gottlieb_a.cpp | 6 ++---- src/mame/shared/gottlieb_a.h | 5 +++-- 27 files changed, 92 insertions(+), 38 deletions(-) create mode 100644 src/devices/cpu/m6502/m6503.cpp create mode 100644 src/devices/cpu/m6502/m6503.h diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index c860aa6441d..78fa1036f2c 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -1600,6 +1600,7 @@ end --@src/devices/cpu/m6502/m5074x.h,CPUS["M6502"] = true --@src/devices/cpu/m6502/m6500_1.h,CPUS["M6502"] = true --@src/devices/cpu/m6502/m6502.h,CPUS["M6502"] = true +--@src/devices/cpu/m6502/m6503.h,CPUS["M6502"] = true --@src/devices/cpu/m6502/m6504.h,CPUS["M6502"] = true --@src/devices/cpu/m6502/m6507.h,CPUS["M6502"] = true --@src/devices/cpu/m6502/m6509.h,CPUS["M6502"] = true @@ -1645,6 +1646,8 @@ if CPUS["M6502"] then MAME_DIR .. "src/devices/cpu/m6502/m6502.h", MAME_DIR .. "src/devices/cpu/m6502/m6502mcu.h", MAME_DIR .. "src/devices/cpu/m6502/m6502mcu.ipp", + MAME_DIR .. "src/devices/cpu/m6502/m6503.cpp", + MAME_DIR .. "src/devices/cpu/m6502/m6503.h", MAME_DIR .. "src/devices/cpu/m6502/m6504.cpp", MAME_DIR .. "src/devices/cpu/m6502/m6504.h", MAME_DIR .. "src/devices/cpu/m6502/m6507.cpp", diff --git a/src/devices/cpu/m6502/deco16.cpp b/src/devices/cpu/m6502/deco16.cpp index acd9983cc12..d2437f03499 100644 --- a/src/devices/cpu/m6502/deco16.cpp +++ b/src/devices/cpu/m6502/deco16.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - deco16.c + deco16.cpp 6502, reverse-engineered DECO variant diff --git a/src/devices/cpu/m6502/dm6502.lst b/src/devices/cpu/m6502/dm6502.lst index 654a2f1fe74..99f3a05edb9 100644 --- a/src/devices/cpu/m6502/dm6502.lst +++ b/src/devices/cpu/m6502/dm6502.lst @@ -1,6 +1,6 @@ # license:BSD-3-Clause # copyright-holders:Olivier Galibert -# m6502_family_device - 6502, 6504 +# m6502_family_device - 6502, 6503, 6504, 6507 brk_imp ora_idx kil_non slo_idx nop_zpg ora_zpg asl_zpg slo_zpg php_imp ora_imm asl_acc anc_imm nop_aba ora_aba asl_aba slo_aba bpl_rel ora_idy kil_non slo_idy nop_zpx ora_zpx asl_zpx slo_zpx clc_imp ora_aby nop_imp slo_aby nop_abx ora_abx asl_abx slo_abx jsr_adr and_idx kil_non rla_idx bit_zpg and_zpg rol_zpg rla_zpg plp_imp and_imm rol_acc anc_imm bit_aba and_aba rol_aba rla_aba diff --git a/src/devices/cpu/m6502/m4510.h b/src/devices/cpu/m6502/m4510.h index 929df0dbea2..6f5692fb3df 100644 --- a/src/devices/cpu/m6502/m4510.h +++ b/src/devices/cpu/m6502/m4510.h @@ -4,7 +4,7 @@ m4510.h - 65ce02 with a mmu and a port + 65ce02 with a mmu and a cia integrated ***************************************************************************/ diff --git a/src/devices/cpu/m6502/m6500_1.cpp b/src/devices/cpu/m6502/m6500_1.cpp index 7d32aa1030a..6ba2f9c3919 100644 --- a/src/devices/cpu/m6502/m6500_1.cpp +++ b/src/devices/cpu/m6502/m6500_1.cpp @@ -2,7 +2,7 @@ // copyright-holders:Vas Crabb /*************************************************************************** - m6500_1.h + m6500_1.cpp MOS Technology 6500/1, original NMOS variant with onboard peripherals: * 6502 CPU diff --git a/src/devices/cpu/m6502/m6502.txt b/src/devices/cpu/m6502/m6502.txt index b510da18c5b..788ab6fad3d 100644 --- a/src/devices/cpu/m6502/m6502.txt +++ b/src/devices/cpu/m6502/m6502.txt @@ -25,9 +25,15 @@ timer b-flag always 1! (only pushed as 0 when break executed!) memory changing opcodes accesses memory: read, write data, write modified data -6504 +6503 only 12 address pins a11..a0 +6504 +only 13 address pins a12..a0 + +6507 +only 13 address pins a12..a0 + 6508 8 io pins (p0 bis p7) @@ -159,5 +165,5 @@ MUL, DIV not in all variants Set Overflow Pin ---------------- in 6502 and pin compatibles (65C02 65SC02 65SC802 65CE02), M6509 -no SO pin 6510/7501/8500/8501/8502/65sc816 +no SO pin 6503/6504/6507/6510/7501/8500/8501/8502/65sc816 6510T ? diff --git a/src/devices/cpu/m6502/m6503.cpp b/src/devices/cpu/m6502/m6503.cpp new file mode 100644 index 00000000000..1c1b2a71a55 --- /dev/null +++ b/src/devices/cpu/m6502/m6503.cpp @@ -0,0 +1,23 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/*************************************************************************** + + m6503.cpp + + MOS Technology 6502, NMOS variant with reduced address bus + + 28-pin package, address bus is 12 bits, no NMI, no SO, no SYNC, no RDY. + +***************************************************************************/ + +#include "emu.h" +#include "m6503.h" + +DEFINE_DEVICE_TYPE(M6503, m6503_device, "m6503", "MOS Technology 6503") + +m6503_device::m6503_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + m6502_device(mconfig, M6503, tag, owner, clock) +{ + program_config.m_addr_width = 12; + sprogram_config.m_addr_width = 12; +} diff --git a/src/devices/cpu/m6502/m6503.h b/src/devices/cpu/m6502/m6503.h new file mode 100644 index 00000000000..dadffe3d095 --- /dev/null +++ b/src/devices/cpu/m6502/m6503.h @@ -0,0 +1,28 @@ +// license:BSD-3-Clause +// copyright-holders:Olivier Galibert +/*************************************************************************** + + m6503.h + + MOS Technology 6502, NMOS variant with reduced address bus + +***************************************************************************/ + +#ifndef MAME_CPU_M6502_M6503_H +#define MAME_CPU_M6502_M6503_H + +#include "m6502.h" + +class m6503_device : public m6502_device { +public: + m6503_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +}; + + +enum { + M6503_IRQ_LINE = m6502_device::IRQ_LINE +}; + +DECLARE_DEVICE_TYPE(M6503, m6503_device); + +#endif // MAME_CPU_M6502_M6503_H diff --git a/src/devices/cpu/m6502/m6504.cpp b/src/devices/cpu/m6502/m6504.cpp index 51859f178f5..393abfa667c 100644 --- a/src/devices/cpu/m6502/m6504.cpp +++ b/src/devices/cpu/m6502/m6504.cpp @@ -2,10 +2,12 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - m6504.c + m6504.cpp MOS Technology 6502, NMOS variant with reduced address bus + 28-pin package, address bus is 13 bits, no NMI, no SO, no SYNC, no RDY. + ***************************************************************************/ #include "emu.h" diff --git a/src/devices/cpu/m6502/m6504.h b/src/devices/cpu/m6502/m6504.h index bf4dee43a76..b33f3713062 100644 --- a/src/devices/cpu/m6502/m6504.h +++ b/src/devices/cpu/m6502/m6504.h @@ -20,9 +20,7 @@ public: enum { - M6504_IRQ_LINE = m6502_device::IRQ_LINE, - M6504_NMI_LINE = m6502_device::NMI_LINE, - M6504_SET_OVERFLOW = m6502_device::V_LINE + M6504_IRQ_LINE = m6502_device::IRQ_LINE }; DECLARE_DEVICE_TYPE(M6504, m6504_device); diff --git a/src/devices/cpu/m6502/m6507.cpp b/src/devices/cpu/m6502/m6507.cpp index 7a102e4b110..ce95b35807d 100644 --- a/src/devices/cpu/m6502/m6507.cpp +++ b/src/devices/cpu/m6502/m6507.cpp @@ -2,10 +2,12 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - m6507.c + m6507.cpp MOS Technology 6502, NMOS variant with reduced address bus + 28-pin package, address bus is 13 bits, no NMI, no SO, no SYNC. + ***************************************************************************/ #include "emu.h" diff --git a/src/devices/cpu/m6502/m6507.h b/src/devices/cpu/m6502/m6507.h index 50466608d2a..30b51dce74c 100644 --- a/src/devices/cpu/m6502/m6507.h +++ b/src/devices/cpu/m6502/m6507.h @@ -20,9 +20,7 @@ public: enum { - M6507_IRQ_LINE = m6502_device::IRQ_LINE, - M6507_NMI_LINE = m6502_device::NMI_LINE, - M6507_SET_OVERFLOW = m6502_device::V_LINE + M6507_IRQ_LINE = m6502_device::IRQ_LINE }; DECLARE_DEVICE_TYPE(M6507, m6507_device) diff --git a/src/devices/cpu/m6502/m6509.cpp b/src/devices/cpu/m6502/m6509.cpp index 3ffbeda05fc..dd4eca50c83 100644 --- a/src/devices/cpu/m6502/m6509.cpp +++ b/src/devices/cpu/m6502/m6509.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - m6509.c + m6509.cpp 6502 with banking and extended address bus diff --git a/src/devices/cpu/m6502/m6510.cpp b/src/devices/cpu/m6502/m6510.cpp index 0a6a0b90fe3..fa9d36731c5 100644 --- a/src/devices/cpu/m6502/m6510.cpp +++ b/src/devices/cpu/m6502/m6510.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - m6510.c + m6510.cpp 6502 with 6 i/o pins, also known as 8500 diff --git a/src/devices/cpu/m6502/m6510.h b/src/devices/cpu/m6502/m6510.h index 284bc885180..6f9bac1fff8 100644 --- a/src/devices/cpu/m6502/m6510.h +++ b/src/devices/cpu/m6502/m6510.h @@ -7,6 +7,7 @@ 6502 with 6 i/o pins, also known as 8500 ***************************************************************************/ + #ifndef MAME_CPU_M6502_M6510_H #define MAME_CPU_M6502_M6510_H diff --git a/src/devices/cpu/m6502/m6510t.cpp b/src/devices/cpu/m6502/m6510t.cpp index a8b543a8198..3290040c0ab 100644 --- a/src/devices/cpu/m6502/m6510t.cpp +++ b/src/devices/cpu/m6502/m6510t.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - m6510t.c + m6510t.cpp 6510 with the full 8 i/o pins at the expense of the NMI and RDY lines. diff --git a/src/devices/cpu/m6502/m65c02.cpp b/src/devices/cpu/m6502/m65c02.cpp index fbfd2964f20..e79380fe83d 100644 --- a/src/devices/cpu/m6502/m65c02.cpp +++ b/src/devices/cpu/m6502/m65c02.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - m65c02.c + m65c02.cpp WDC W65C02, CMOS variant with some additional instructions (but not the bitwise ones) diff --git a/src/devices/cpu/m6502/m65ce02.cpp b/src/devices/cpu/m6502/m65ce02.cpp index e6f80e4df09..a787eb9dcef 100644 --- a/src/devices/cpu/m6502/m65ce02.cpp +++ b/src/devices/cpu/m6502/m65ce02.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - m65ce02.c + m65ce02.cpp 6502 with Z register and some more stuff diff --git a/src/devices/cpu/m6502/m65sc02.cpp b/src/devices/cpu/m6502/m65sc02.cpp index 93a9f18c7b6..b9245b5fe13 100644 --- a/src/devices/cpu/m6502/m65sc02.cpp +++ b/src/devices/cpu/m6502/m65sc02.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - m65sc02.c + m65sc02.cpp Rockwell-class 65c02 with internal static registers, making clock stoppable? diff --git a/src/devices/cpu/m6502/m740.cpp b/src/devices/cpu/m6502/m740.cpp index d9feb8071d5..04b672ede56 100644 --- a/src/devices/cpu/m6502/m740.cpp +++ b/src/devices/cpu/m6502/m740.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - m740.c + m740.cpp Mitsubishi M740 series (M507xx/M509xx) diff --git a/src/devices/cpu/m6502/m7501.cpp b/src/devices/cpu/m6502/m7501.cpp index 912a7a023dd..59f62ed8046 100644 --- a/src/devices/cpu/m6502/m7501.cpp +++ b/src/devices/cpu/m6502/m7501.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - m7501.c + m7501.cpp 6510 derivative, essentially identical. Also known as the 8501. diff --git a/src/devices/cpu/m6502/m8502.cpp b/src/devices/cpu/m6502/m8502.cpp index 356ed95c0fe..3227d2b0c88 100644 --- a/src/devices/cpu/m6502/m8502.cpp +++ b/src/devices/cpu/m6502/m8502.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - m8502.c + m8502.cpp 6510 derivative, capable of running at 2MHz. diff --git a/src/devices/cpu/m6502/r65c02.cpp b/src/devices/cpu/m6502/r65c02.cpp index 190f370c933..80187c5fb83 100644 --- a/src/devices/cpu/m6502/r65c02.cpp +++ b/src/devices/cpu/m6502/r65c02.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert /*************************************************************************** - r65c02.c + r65c02.cpp Rockwell 65c02, CMOS variant with bitwise instructions diff --git a/src/devices/cpu/m6502/xavix2000.cpp b/src/devices/cpu/m6502/xavix2000.cpp index 35da0f522b3..a33218423e4 100644 --- a/src/devices/cpu/m6502/xavix2000.cpp +++ b/src/devices/cpu/m6502/xavix2000.cpp @@ -24,7 +24,6 @@ the 2002 chip seems to be the one that was officially dubbed 'SuperXaviX' and has additional video capabilities on top of the extended opcodes. - ***************************************************************************/ #include "emu.h" @@ -39,10 +38,6 @@ DEFINE_DEVICE_TYPE(XAVIX2002, xavix2002_device, "xavix2002", "XaviX (SSD 2002) ( xavix2000_device::xavix2000_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : xavix_device(mconfig, type, tag, owner, clock) { - program_config.m_addr_width = 24; - program_config.m_logaddr_width = 24; - sprogram_config.m_addr_width = 24; - sprogram_config.m_logaddr_width = 24; } xavix2000_device::xavix2000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : diff --git a/src/mame/pinball/spectra.cpp b/src/mame/pinball/spectra.cpp index 34e4e49f7fd..976e6a2c247 100644 --- a/src/mame/pinball/spectra.cpp +++ b/src/mame/pinball/spectra.cpp @@ -40,7 +40,7 @@ ToDo: #include "emu.h" #include "genpin.h" -#include "cpu/m6502/m6502.h" +#include "cpu/m6502/m6503.h" #include "machine/mos6530n.h" #include "machine/timer.h" #include "sound/sn76477.h" @@ -97,7 +97,6 @@ private: void spectra_state::spectra_map(address_map &map) { map.unmap_value_high(); - map.global_mask(0xfff); map(0x0000, 0x00ff).ram().share("nvram"); // battery backed, 2x 5101L map(0x0100, 0x017f).m(m_riot, FUNC(mos6532_new_device::ram_map)); map(0x0180, 0x019f).m(m_riot, FUNC(mos6532_new_device::io_map)); @@ -265,7 +264,7 @@ void spectra_state::machine_reset() void spectra_state::spectra(machine_config &config) { /* basic machine hardware */ - M6502(config, m_maincpu, XTAL(3'579'545)/4); // actually a M6503 + M6503(config, m_maincpu, XTAL(3'579'545)/4); m_maincpu->set_addrmap(AS_PROGRAM, &spectra_state::spectra_map); MOS6532_NEW(config, m_riot, XTAL(3'579'545)/4); diff --git a/src/mame/shared/gottlieb_a.cpp b/src/mame/shared/gottlieb_a.cpp index c743dde8c4c..901cfa859f1 100644 --- a/src/mame/shared/gottlieb_a.cpp +++ b/src/mame/shared/gottlieb_a.cpp @@ -88,7 +88,6 @@ void gottlieb_sound_p2_device::write(uint8_t data) void gottlieb_sound_p2_device::p2_map(address_map &map) { - map.global_mask(0x0fff); map.unmap_value_high(); map(0x0000, 0x017f).ram(); map(0x0200, 0x03ff).rw(m_r6530, FUNC(mos6530_device::read), FUNC(mos6530_device::write)); @@ -127,7 +126,7 @@ INPUT_CHANGED_MEMBER( gottlieb_sound_p2_device::audio_nmi ) void gottlieb_sound_p2_device::device_add_mconfig(machine_config &config) { // audio CPU - M6502(config, m_cpu, 800'000); // M6503 - clock is a gate, a resistor and a capacitor. Freq 675-1000kHz. + M6503(config, m_cpu, 800'000); // clock is a gate, a resistor and a capacitor. Freq 675-1000kHz. m_cpu->set_addrmap(AS_PROGRAM, &gottlieb_sound_p2_device::p2_map); // I/O configuration @@ -222,7 +221,6 @@ void gottlieb_sound_p3_device::write(uint8_t data) void gottlieb_sound_p3_device::p3_map(address_map &map) { - map.global_mask(0x0fff); map.unmap_value_high(); map(0x0000, 0x017f).ram(); map(0x0200, 0x03ff).rw(m_r6530, FUNC(mos6530_device::read), FUNC(mos6530_device::write)); @@ -237,7 +235,7 @@ void gottlieb_sound_p3_device::p3_map(address_map &map) void gottlieb_sound_p3_device::device_add_mconfig(machine_config &config) { // audio CPU - M6502(config, m_cpu, 800'000); // M6503 - clock is a gate, a resistor and a capacitor. Freq 675-1000kHz. + M6503(config, m_cpu, 800'000); // clock is a gate, a resistor and a capacitor. Freq 675-1000kHz. m_cpu->set_addrmap(AS_PROGRAM, &gottlieb_sound_p3_device::p3_map); // I/O configuration diff --git a/src/mame/shared/gottlieb_a.h b/src/mame/shared/gottlieb_a.h index 4f098e695b1..b60ac3e2043 100644 --- a/src/mame/shared/gottlieb_a.h +++ b/src/mame/shared/gottlieb_a.h @@ -7,6 +7,7 @@ ***************************************************************************/ #include "cpu/m6502/m6502.h" +#include "cpu/m6502/m6503.h" #include "machine/mos6530.h" #include "machine/6532riot.h" #include "sound/ay8910.h" @@ -60,7 +61,7 @@ protected: private: // devices - required_device m_cpu; + required_device m_cpu; required_device m_r6530; uint8_t m_sndcmd = 0; @@ -89,7 +90,7 @@ protected: private: // devices - required_device m_cpu; + required_device m_cpu; required_device m_r6530; uint8_t m_sndcmd = 0; -- cgit v1.2.3