From 50345461a2278fa03665ed9dd83a0ae1871f6c4f Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 13 Feb 2024 19:01:07 -0500 Subject: mcs51: Add placeholder device types for P87C552 and P80C562, with custom SFR definitions for their disassemblers --- src/devices/cpu/mcs51/mcs51.cpp | 27 ++++++++ src/devices/cpu/mcs51/mcs51.h | 24 +++++++ src/devices/cpu/mcs51/mcs51dasm.cpp | 122 ++++++++++++++++++++++++++++++++++++ src/devices/cpu/mcs51/mcs51dasm.h | 16 +++++ src/mame/midway/midqslvr.cpp | 3 + src/mame/misc/funeball.cpp | 12 +++- 6 files changed, 202 insertions(+), 2 deletions(-) diff --git a/src/devices/cpu/mcs51/mcs51.cpp b/src/devices/cpu/mcs51/mcs51.cpp index 45ae5a5851b..6fd711a781c 100644 --- a/src/devices/cpu/mcs51/mcs51.cpp +++ b/src/devices/cpu/mcs51/mcs51.cpp @@ -266,6 +266,8 @@ DEFINE_DEVICE_TYPE(DS80C320, ds80c320_device, "ds80c320", "Dallas DS80C320 HSM") DEFINE_DEVICE_TYPE(SAB80C535, sab80c535_device, "sab80c535", "Siemens SAB80C535") DEFINE_DEVICE_TYPE(I8344, i8344_device, "i8344", "Intel 8344AH RUPI-44") DEFINE_DEVICE_TYPE(I8744, i8744_device, "i8744", "Intel 8744H RUPI-44") +DEFINE_DEVICE_TYPE(P87C552, p87c552_device, "p87c552", "Philips P87C552") +DEFINE_DEVICE_TYPE(P80C562, p80c562_device, "p80c562", "Philips P80C562") DEFINE_DEVICE_TYPE(DS5002FP, ds5002fp_device, "ds5002fp", "Dallas DS5002FP") @@ -452,6 +454,21 @@ i8744_device::i8744_device(const machine_config &mconfig, const char *tag, devic { } +p80c562_device::p80c562_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int program_width, int data_width, uint8_t features) + : i80c51_device(mconfig, type, tag, owner, clock, program_width, data_width, features) +{ +} + +p80c562_device::p80c562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : p80c562_device(mconfig, P80C562, tag, owner, clock, 0, 8) +{ +} + +p87c552_device::p87c552_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : p80c562_device(mconfig, P87C552, tag, owner, clock, 12, 8) +{ +} + /* program width field is set to 0 because technically the SRAM isn't internal */ ds5002fp_device::ds5002fp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs51_cpu_device(mconfig, DS5002FP, tag, owner, clock, 0, 7, FEATURE_DS5002FP | FEATURE_CMOS) @@ -2752,3 +2769,13 @@ std::unique_ptr ds5002fp_device::create_disassembler() { return std::make_unique(); } + +std::unique_ptr p80c562_device::create_disassembler() +{ + return std::make_unique(); +} + +std::unique_ptr p87c552_device::create_disassembler() +{ + return std::make_unique(); +} diff --git a/src/devices/cpu/mcs51/mcs51.h b/src/devices/cpu/mcs51/mcs51.h index f145e20d4df..676f6709357 100644 --- a/src/devices/cpu/mcs51/mcs51.h +++ b/src/devices/cpu/mcs51/mcs51.h @@ -340,6 +340,8 @@ DECLARE_DEVICE_TYPE(AT89C52, at89c52_device) DECLARE_DEVICE_TYPE(AT89S52, at89s52_device) DECLARE_DEVICE_TYPE(DS80C320, ds80c320_device) DECLARE_DEVICE_TYPE(SAB80C535, sab80c535_device) +DECLARE_DEVICE_TYPE(P87C552, p87c552_device) +DECLARE_DEVICE_TYPE(P80C562, p80c562_device) /* 4k internal perom and 128 internal ram and 2 analog comparators */ DECLARE_DEVICE_TYPE(AT89C4051, at89c4051_device) @@ -552,6 +554,28 @@ protected: virtual std::unique_ptr create_disassembler() override; }; +class p80c562_device : public i80c51_device +{ +public: + // construction/destruction + p80c562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + p80c562_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int program_width, int data_width, uint8_t features = 0); + + virtual std::unique_ptr create_disassembler() override; +}; + +class p87c552_device : public p80c562_device +{ +public: + // construction/destruction + p87c552_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual std::unique_ptr create_disassembler() override; +}; + /* * The DS5002FP has 2 16 bits data address buses (the byte-wide bus and the expanded bus). The exact memory position accessed depends on the * partition mode, the memory range and the expanded bus select. The partition mode and the expanded bus select can be changed at any time. diff --git a/src/devices/cpu/mcs51/mcs51dasm.cpp b/src/devices/cpu/mcs51/mcs51dasm.cpp index 13ec8a161e7..0d43d7c77d6 100644 --- a/src/devices/cpu/mcs51/mcs51dasm.cpp +++ b/src/devices/cpu/mcs51/mcs51dasm.cpp @@ -649,6 +649,120 @@ const mcs51_disassembler::mem_info mcs51_disassembler::rupi44_names[] = { { -1 } }; +const mcs51_disassembler::mem_info mcs51_disassembler::p8xc562_names[] = { + { 0xa8, "ien0" }, + { 0xa9, "cml0" }, + { 0xaa, "cml1" }, + { 0xab, "cml2" }, + { 0xac, "ctl0" }, + { 0xad, "ctl1" }, + { 0xae, "ctl2" }, + { 0xaf, "ctl3" }, + { 0xb8, "ip0" }, + { 0xc0, "p4" }, + { 0xc4, "p5" }, + { 0xc5, "adcon" }, + { 0xc6, "adch" }, + { 0xc8, "tm2ir" }, + { 0xc9, "cmh0" }, + { 0xca, "cmh1" }, + { 0xcb, "cmh2" }, + { 0xcc, "cth0" }, + { 0xcd, "cth1" }, + { 0xce, "cth2" }, + { 0xcf, "cth3" }, + { 0xe8, "ien1" }, + { 0xea, "tm2con" }, + { 0xeb, "ctcon" }, + { 0xec, "tml2" }, + { 0xed, "tmh2" }, + { 0xee, "ste" }, + { 0xef, "rte" }, + { 0xf8, "ip1" }, + { 0xfc, "pwm0" }, + { 0xfd, "pwm1" }, + { 0xfe, "pwmp" }, + { 0xff, "t3" }, + + { 0x190, "ct0i" }, + { 0x191, "ct1i" }, + { 0x192, "ct2i" }, + { 0x193, "ct3i" }, + { 0x194, "t2" }, + { 0x195, "rt2" }, + + { 0x1ae, "ead" }, + + { 0x1be, "pad" }, + + { 0x1c0, "cmsr0" }, + { 0x1c1, "cmsr1" }, + { 0x1c2, "cmsr2" }, + { 0x1c3, "cmsr3" }, + { 0x1c4, "cmsr4" }, + { 0x1c5, "cmsr5" }, + { 0x1c6, "cmt0" }, + { 0x1c7, "cmt1" }, + + { 0x1c8, "cti0" }, + { 0x1c9, "cti1" }, + { 0x1ca, "cti2" }, + { 0x1cb, "cti3" }, + { 0x1cc, "cmi0" }, + { 0x1cd, "cmi1" }, + { 0x1ce, "cmi2" }, + { 0x1cf, "t2ov" }, + + { 0x1e8, "ect0" }, + { 0x1e9, "ect1" }, + { 0x1ea, "ect2" }, + { 0x1eb, "ect3" }, + { 0x1ec, "ecm0" }, + { 0x1ed, "ecm1" }, + { 0x1ee, "ecm2" }, + { 0x1ef, "et2" }, + + { 0x1f8, "pct0" }, + { 0x1f9, "pct1" }, + { 0x1fa, "pct2" }, + { 0x1fb, "pct3" }, + { 0x1fc, "pcm0" }, + { 0x1fd, "pcm1" }, + { 0x1fe, "pcm2" }, + { 0x1ff, "pt2" }, + + { -1 } +}; + +const mcs51_disassembler::mem_info mcs51_disassembler::p8xc552_names[] = { + { 0x98, "s0con" }, + { 0x99, "s0buf" }, + { 0xd8, "s1con" }, + { 0xd9, "s1sta" }, + { 0xda, "s1dat" }, + { 0xdb, "s1adr" }, + + { 0x196, "scl" }, + { 0x197, "sda" }, + + { 0x1ac, "es0" }, + { 0x1ad, "es1" }, + + { 0x1bc, "ps0" }, + { 0x1bd, "ps1" }, + + { 0x1d8, "cr0" }, + { 0x1d9, "cr1" }, + { 0x1da, "aa" }, + { 0x1db, "si" }, + { 0x1dc, "sto" }, + { 0x1dd, "sta" }, + { 0x1de, "ens1" }, + { 0x1df, "cr2" }, + + { -1 } +}; + mcs51_disassembler::mcs51_disassembler() { } @@ -1582,3 +1696,11 @@ sab80c515_disassembler::sab80c515_disassembler() : mcs51_disassembler(default_na rupi44_disassembler::rupi44_disassembler() : mcs51_disassembler(rupi44_names) { } + +p8xc552_disassembler::p8xc552_disassembler() : mcs51_disassembler(default_names, p8xc562_names, p8xc552_names) +{ +} + +p8xc562_disassembler::p8xc562_disassembler() : mcs51_disassembler(default_names, p8xc562_names) +{ +} diff --git a/src/devices/cpu/mcs51/mcs51dasm.h b/src/devices/cpu/mcs51/mcs51dasm.h index b643ed150b9..f1e0fccdd74 100644 --- a/src/devices/cpu/mcs51/mcs51dasm.h +++ b/src/devices/cpu/mcs51/mcs51dasm.h @@ -50,6 +50,8 @@ public: static const mem_info sab80515_names[]; static const mem_info sab80c515_names[]; static const mem_info rupi44_names[]; + static const mem_info p8xc552_names[]; + static const mem_info p8xc562_names[]; template mcs51_disassembler(Names &&... names) : mcs51_disassembler() { add_names(names...); @@ -158,5 +160,19 @@ public: virtual ~rupi44_disassembler() = default; }; +class p8xc552_disassembler : public mcs51_disassembler +{ +public: + p8xc552_disassembler(); + virtual ~p8xc552_disassembler() = default; +}; + +class p8xc562_disassembler : public mcs51_disassembler +{ +public: + p8xc562_disassembler(); + virtual ~p8xc562_disassembler() = default; +}; + #endif diff --git a/src/mame/midway/midqslvr.cpp b/src/mame/midway/midqslvr.cpp index d8a3e60fb41..85b29bb6ccc 100644 --- a/src/mame/midway/midqslvr.cpp +++ b/src/mame/midway/midqslvr.cpp @@ -275,6 +275,7 @@ Notes: #include "emu.h" #include "cpu/i386/i386.h" +#include "cpu/mcs51/mcs51.h" #include "machine/pci.h" #include "machine/pci-ide.h" #include "machine/pci-smbus.h" @@ -378,6 +379,8 @@ void midway_quicksilver2_state::midqslvr(machine_config &config) m_maincpu->set_irq_acknowledge_callback("pci:07.0:pic8259_master", FUNC(pic8259_device::inta_cb)); m_maincpu->smiact().set("pci:00.0", FUNC(i82443bx_host_device::smi_act_w)); + P87C552(config, "iocpu", 16'000'000).set_disable(); + PCI_ROOT(config, "pci", 0); I82443BX_HOST(config, "pci:00.0", 0, "maincpu", 64*1024*1024); I82443BX_BRIDGE(config, "pci:01.0", 0 ); //"pci:01.0:00.0"); diff --git a/src/mame/misc/funeball.cpp b/src/mame/misc/funeball.cpp index 1a14818a452..7a071690cea 100644 --- a/src/mame/misc/funeball.cpp +++ b/src/mame/misc/funeball.cpp @@ -24,16 +24,24 @@ public: void funeball(machine_config &config); -protected: +private: + void prog_map(address_map &map); + required_device m_maincpu; }; +void funeball_state::prog_map(address_map &map) +{ + map(0x0000, 0x7fff).rom().region("maincpu", 0); +} + INPUT_PORTS_START(funeball) INPUT_PORTS_END void funeball_state::funeball(machine_config &config) { - I80C51(config, m_maincpu, 8_MHz_XTAL); // Actually a Philips P80C562EBA + P80C562(config, m_maincpu, 8_MHz_XTAL); // Philips P80C562EBA + m_maincpu->set_addrmap(AS_PROGRAM, &funeball_state::prog_map); SPEAKER(config, "mono").front_center(); } -- cgit v1.2.3