From 9014ba4c17cbac10d64aa360c60f732b4f876134 Mon Sep 17 00:00:00 2001 From: Patrick Mackinlay Date: Wed, 19 Sep 2018 20:07:43 +0700 Subject: mips3: add r4000 and r4400 variants (nw) --- src/devices/cpu/mips/mips3.cpp | 4 ++++ src/devices/cpu/mips/mips3.h | 42 +++++++++++++++++++++++++++++++++++++++ src/devices/cpu/mips/mips3com.cpp | 6 ++++++ 3 files changed, 52 insertions(+) diff --git a/src/devices/cpu/mips/mips3.cpp b/src/devices/cpu/mips/mips3.cpp index 21e757cbb30..039d4259e02 100644 --- a/src/devices/cpu/mips/mips3.cpp +++ b/src/devices/cpu/mips/mips3.cpp @@ -102,6 +102,10 @@ static const uint8_t fpmode_source[4] = #define ROPCODE(pc) m_lr32(pc) +DEFINE_DEVICE_TYPE(R4000BE, r4000be_device, "r4000be", "MIPS R4000 (big)") +DEFINE_DEVICE_TYPE(R4000LE, r4000le_device, "r4000le", "MIPS R4000 (little)") +DEFINE_DEVICE_TYPE(R4400BE, r4400be_device, "r4400be", "MIPS R4400 (big)") +DEFINE_DEVICE_TYPE(R4400LE, r4400le_device, "r4400le", "MIPS R4400 (little)") DEFINE_DEVICE_TYPE(VR4300BE, vr4300be_device, "vr4300be", "NEC VR4300 (big)") DEFINE_DEVICE_TYPE(VR4300LE, vr4300le_device, "vr4300le", "NEC VR4300 (little)") DEFINE_DEVICE_TYPE(VR4310BE, vr4310be_device, "vr4310be", "NEC VR4310 (big)") diff --git a/src/devices/cpu/mips/mips3.h b/src/devices/cpu/mips/mips3.h index e36a5aa5fc8..a5d603c15fb 100644 --- a/src/devices/cpu/mips/mips3.h +++ b/src/devices/cpu/mips/mips3.h @@ -20,6 +20,10 @@ MIPS III/IV emulator. #include "cpu/drcuml.h" #include "ps2vu.h" +DECLARE_DEVICE_TYPE(R4000BE, r4000be_device) +DECLARE_DEVICE_TYPE(R4000LE, r4000le_device) +DECLARE_DEVICE_TYPE(R4400BE, r4400be_device) +DECLARE_DEVICE_TYPE(R4400LE, r4400le_device) // NEC VR4300 series is MIPS III with 32-bit address bus and slightly custom COP0/TLB DECLARE_DEVICE_TYPE(VR4300BE, vr4300be_device) DECLARE_DEVICE_TYPE(VR4300LE, vr4300le_device) @@ -278,6 +282,8 @@ protected: enum mips3_flavor { /* MIPS III variants */ MIPS3_TYPE_MIPS_III, + MIPS3_TYPE_R4000, + MIPS3_TYPE_R4400, MIPS3_TYPE_VR4300, MIPS3_TYPE_R4600, MIPS3_TYPE_R4650, @@ -633,6 +639,42 @@ private: }; +class r4000be_device : public mips3_device { +public: + // construction/destruction + r4000be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R4000BE, tag, owner, clock, MIPS3_TYPE_R4000, ENDIANNESS_BIG, 32) + { + } +}; + +class r4000le_device : public mips3_device { +public: + // construction/destruction + r4000le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R4000LE, tag, owner, clock, MIPS3_TYPE_R4000, ENDIANNESS_LITTLE, 32) + { + } +}; + +class r4400be_device : public mips3_device { +public: + // construction/destruction + r4400be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R4400BE, tag, owner, clock, MIPS3_TYPE_R4400, ENDIANNESS_BIG, 32) + { + } +}; + +class r4400le_device : public mips3_device { +public: + // construction/destruction + r4400le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R4400LE, tag, owner, clock, MIPS3_TYPE_R4400, ENDIANNESS_LITTLE, 32) + { + } +}; + class vr4300be_device : public mips3_device { public: // construction/destruction diff --git a/src/devices/cpu/mips/mips3com.cpp b/src/devices/cpu/mips/mips3com.cpp index 3893dfb19e0..94c7d2d9683 100644 --- a/src/devices/cpu/mips/mips3com.cpp +++ b/src/devices/cpu/mips/mips3com.cpp @@ -303,6 +303,12 @@ uint32_t mips3_device::compute_prid_register() { switch (m_flavor) { + case MIPS3_TYPE_R4000: + return 0x0400; + + case MIPS3_TYPE_R4400: + return 0x0440; + case MIPS3_TYPE_VR4300: return 0x0b00; -- cgit v1.2.3