mips3: add r4000 and r4400 variants (nw)

This commit is contained in:
Patrick Mackinlay 2018-09-19 20:07:43 +07:00
parent 0e5c458544
commit 9014ba4c17
3 changed files with 52 additions and 0 deletions

View File

@ -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)")

View File

@ -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

View File

@ -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;