Core: Add MIPSInterfaceHandler
This commit is contained in:
parent
3e322955c0
commit
928dfe3a16
|
@ -54,21 +54,9 @@ void CLogging::Log_LW(uint32_t PC, uint32_t VAddr)
|
|||
return;
|
||||
}
|
||||
if (VAddr >= 0xA4300000 && VAddr <= 0xA430000C)
|
||||
{
|
||||
if (!LogMIPSInterface())
|
||||
{
|
||||
return;
|
||||
}
|
||||
g_MMU->LW_VAddr(VAddr, Value);
|
||||
|
||||
switch (VAddr)
|
||||
{
|
||||
case 0xA4300000: LogMessage("%08X: read from MI_INIT_MODE_REG/MI_MODE_REG (%08X)", PC, Value); return;
|
||||
case 0xA4300004: LogMessage("%08X: read from MI_VERSION_REG/MI_NOOP_REG (%08X)", PC, Value); return;
|
||||
case 0xA4300008: LogMessage("%08X: read from MI_INTR_REG (%08X)", PC, Value); return;
|
||||
case 0xA430000C: LogMessage("%08X: read from MI_INTR_MASK_REG (%08X)", PC, Value); return;
|
||||
}
|
||||
}
|
||||
if (VAddr >= 0xA4400000 && VAddr <= 0xA4400034)
|
||||
{
|
||||
if (!LogVideoInterface())
|
||||
|
@ -260,19 +248,9 @@ void CLogging::Log_SW(uint32_t PC, uint32_t VAddr, uint32_t Value)
|
|||
}
|
||||
|
||||
if (VAddr >= 0xA4300000 && VAddr <= 0xA430000C)
|
||||
{
|
||||
if (!LogMIPSInterface())
|
||||
{
|
||||
return;
|
||||
}
|
||||
switch (VAddr)
|
||||
{
|
||||
case 0xA4300000: LogMessage("%08X: Writing 0x%08X to MI_INIT_MODE_REG/MI_MODE_REG", PC, Value); return;
|
||||
case 0xA4300004: LogMessage("%08X: Writing 0x%08X to MI_VERSION_REG/MI_NOOP_REG", PC, Value); return;
|
||||
case 0xA4300008: LogMessage("%08X: Writing 0x%08X to MI_INTR_REG", PC, Value); return;
|
||||
case 0xA430000C: LogMessage("%08X: Writing 0x%08X to MI_INTR_MASK_REG", PC, Value); return;
|
||||
}
|
||||
}
|
||||
if (VAddr >= 0xA4400000 && VAddr <= 0xA4400034)
|
||||
{
|
||||
if (!LogVideoInterface())
|
||||
|
|
|
@ -0,0 +1,169 @@
|
|||
#include "stdafx.h"
|
||||
#include "MIPSInterfaceHandler.h"
|
||||
#include <Project64-core\N64System\SystemGlobals.h>
|
||||
#include <Project64-core\N64System\Mips\Register.h>
|
||||
|
||||
MIPSInterfaceReg::MIPSInterfaceReg(uint32_t * MipsInterface) :
|
||||
MI_INIT_MODE_REG(MipsInterface[0]),
|
||||
MI_MODE_REG(MipsInterface[0]),
|
||||
MI_VERSION_REG(MipsInterface[1]),
|
||||
MI_NOOP_REG(MipsInterface[1]),
|
||||
MI_INTR_REG(MipsInterface[2]),
|
||||
MI_INTR_MASK_REG(MipsInterface[3])
|
||||
{
|
||||
}
|
||||
|
||||
MIPSInterfaceHandler::MIPSInterfaceHandler(CRegisters & Reg) :
|
||||
MIPSInterfaceReg(Reg.m_Mips_Interface),
|
||||
m_Reg(Reg),
|
||||
m_PC(Reg.m_PROGRAM_COUNTER)
|
||||
{
|
||||
}
|
||||
|
||||
bool MIPSInterfaceHandler::Read32(uint32_t Address, uint32_t & Value)
|
||||
{
|
||||
switch (Address & 0x1FFFFFFF)
|
||||
{
|
||||
case 0x04300000: Value = MI_MODE_REG; break;
|
||||
case 0x04300004: Value = MI_VERSION_REG; break;
|
||||
case 0x04300008: Value = MI_INTR_REG; break;
|
||||
case 0x0430000C: Value = MI_INTR_MASK_REG; break;
|
||||
default:
|
||||
Value = 0;
|
||||
if (HaveDebugger())
|
||||
{
|
||||
g_Notify->BreakPoint(__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
if (LogMIPSInterface())
|
||||
{
|
||||
switch (Address & 0x1FFFFFFF)
|
||||
{
|
||||
case 0x04300000: LogMessage("%08X: read from MI_INIT_MODE_REG/MI_MODE_REG (%08X)", m_PC, Value); break;
|
||||
case 0x04300004: LogMessage("%08X: read from MI_VERSION_REG/MI_NOOP_REG (%08X)", m_PC, Value); break;
|
||||
case 0x04300008: LogMessage("%08X: read from MI_INTR_REG (%08X)", m_PC, Value); break;
|
||||
case 0x0430000C: LogMessage("%08X: read from MI_INTR_MASK_REG (%08X)", m_PC, Value); break;
|
||||
default:
|
||||
if (HaveDebugger())
|
||||
{
|
||||
g_Notify->BreakPoint(__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MIPSInterfaceHandler::Write32(uint32_t Address, uint32_t Value, uint32_t Mask)
|
||||
{
|
||||
if (LogMIPSInterface())
|
||||
{
|
||||
switch (Address & 0x1FFFFFFF)
|
||||
{
|
||||
case 0x04300000: LogMessage("%08X: Writing 0x%08X (Mask: 0x%08X) to MI_INIT_MODE_REG/MI_MODE_REG", m_PC, Value, Mask); break;
|
||||
case 0x04300004: LogMessage("%08X: Writing 0x%08X (Mask: 0x%08X) to MI_VERSION_REG/MI_NOOP_REG", m_PC, Value, Mask); break;
|
||||
case 0x04300008: LogMessage("%08X: Writing 0x%08X (Mask: 0x%08X) to MI_INTR_REG", m_PC, Value, Mask); break;
|
||||
case 0x0430000C: LogMessage("%08X: Writing 0x%08X (Mask: 0x%08X) to MI_INTR_MASK_REG", m_PC, Value, Mask); break;
|
||||
default:
|
||||
if (HaveDebugger())
|
||||
{
|
||||
g_Notify->BreakPoint(__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t MaskedValue = Value & Mask;
|
||||
switch (Address & 0x1FFFFFFF)
|
||||
{
|
||||
case 0x04300000:
|
||||
MI_MODE_REG &= ~0x7F;
|
||||
MI_MODE_REG |= (MaskedValue & 0x7F);
|
||||
if ((MaskedValue & MI_CLR_INIT) != 0)
|
||||
{
|
||||
MI_MODE_REG &= ~MI_MODE_INIT;
|
||||
}
|
||||
if ((MaskedValue & MI_SET_INIT) != 0)
|
||||
{
|
||||
MI_MODE_REG |= MI_MODE_INIT;
|
||||
}
|
||||
if ((MaskedValue & MI_CLR_EBUS) != 0)
|
||||
{
|
||||
MI_MODE_REG &= ~MI_MODE_EBUS;
|
||||
}
|
||||
if ((MaskedValue & MI_SET_EBUS) != 0)
|
||||
{
|
||||
MI_MODE_REG |= MI_MODE_EBUS;
|
||||
}
|
||||
if ((MaskedValue & MI_CLR_DP_INTR) != 0)
|
||||
{
|
||||
MI_INTR_REG &= ~MI_INTR_DP;
|
||||
m_Reg.m_GfxIntrReg &= ~MI_INTR_DP;
|
||||
m_Reg.CheckInterrupts();
|
||||
}
|
||||
if ((MaskedValue & MI_CLR_RDRAM) != 0)
|
||||
{
|
||||
MI_MODE_REG &= ~MI_MODE_RDRAM;
|
||||
}
|
||||
if ((MaskedValue & MI_SET_RDRAM) != 0)
|
||||
{
|
||||
MI_MODE_REG |= MI_MODE_RDRAM;
|
||||
}
|
||||
break;
|
||||
case 0x0430000C:
|
||||
if ((MaskedValue & MI_INTR_MASK_CLR_SP) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG &= ~MI_INTR_MASK_SP;
|
||||
}
|
||||
if ((MaskedValue & MI_INTR_MASK_SET_SP) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG |= MI_INTR_MASK_SP;
|
||||
}
|
||||
if ((MaskedValue & MI_INTR_MASK_CLR_SI) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG &= ~MI_INTR_MASK_SI;
|
||||
}
|
||||
if ((MaskedValue & MI_INTR_MASK_SET_SI) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG |= MI_INTR_MASK_SI;
|
||||
}
|
||||
if ((MaskedValue & MI_INTR_MASK_CLR_AI) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG &= ~MI_INTR_MASK_AI;
|
||||
}
|
||||
if ((MaskedValue & MI_INTR_MASK_SET_AI) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG |= MI_INTR_MASK_AI;
|
||||
}
|
||||
if ((MaskedValue & MI_INTR_MASK_CLR_VI) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG &= ~MI_INTR_MASK_VI;
|
||||
}
|
||||
if ((MaskedValue & MI_INTR_MASK_SET_VI) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG |= MI_INTR_MASK_VI;
|
||||
}
|
||||
if ((MaskedValue & MI_INTR_MASK_CLR_PI) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG &= ~MI_INTR_MASK_PI;
|
||||
}
|
||||
if ((MaskedValue & MI_INTR_MASK_SET_PI) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG |= MI_INTR_MASK_PI;
|
||||
}
|
||||
if ((MaskedValue & MI_INTR_MASK_CLR_DP) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG &= ~MI_INTR_MASK_DP;
|
||||
}
|
||||
if ((MaskedValue & MI_INTR_MASK_SET_DP) != 0)
|
||||
{
|
||||
MI_INTR_MASK_REG |= MI_INTR_MASK_DP;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (HaveDebugger())
|
||||
{
|
||||
g_Notify->BreakPoint(__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
#pragma once
|
||||
#include "MemoryHandler.h"
|
||||
#include <Project64-core\Settings\DebugSettings.h>
|
||||
#include <Project64-core\Logging.h>
|
||||
#include <stdint.h>
|
||||
|
||||
class MIPSInterfaceReg
|
||||
{
|
||||
protected:
|
||||
MIPSInterfaceReg(uint32_t * MipsInterface);
|
||||
|
||||
public:
|
||||
uint32_t & MI_INIT_MODE_REG;
|
||||
uint32_t & MI_MODE_REG;
|
||||
uint32_t & MI_VERSION_REG;
|
||||
uint32_t & MI_NOOP_REG;
|
||||
uint32_t & MI_INTR_REG;
|
||||
uint32_t & MI_INTR_MASK_REG;
|
||||
|
||||
private:
|
||||
MIPSInterfaceReg();
|
||||
MIPSInterfaceReg(const MIPSInterfaceReg&);
|
||||
MIPSInterfaceReg& operator=(const MIPSInterfaceReg&);
|
||||
};
|
||||
|
||||
class CRegisters;
|
||||
|
||||
class MIPSInterfaceHandler :
|
||||
public MemoryHandler,
|
||||
private MIPSInterfaceReg,
|
||||
private CDebugSettings,
|
||||
private CLogging
|
||||
{
|
||||
public:
|
||||
MIPSInterfaceHandler(CRegisters & Reg);
|
||||
|
||||
bool Read32(uint32_t Address, uint32_t & Value);
|
||||
bool Write32(uint32_t Address, uint32_t Value, uint32_t Mask);
|
||||
|
||||
private:
|
||||
MIPSInterfaceHandler();
|
||||
MIPSInterfaceHandler(const MIPSInterfaceHandler &);
|
||||
MIPSInterfaceHandler & operator=(const MIPSInterfaceHandler &);
|
||||
|
||||
CRegisters & m_Reg;
|
||||
uint32_t & m_PC;
|
||||
};
|
|
@ -30,6 +30,7 @@ CMipsMemoryVM::CMipsMemoryVM(CN64System & System, CRegisters & Reg, bool SavesRe
|
|||
m_RDRAMRegistersHandler(Reg),
|
||||
m_RomMapped(false),
|
||||
m_DPCommandRegistersHandler(System, System.GetPlugins(), Reg),
|
||||
m_MIPSInterfaceHandler(Reg),
|
||||
m_PeripheralInterfaceHandler(*this, Reg),
|
||||
m_RDRAMInterfaceHandler(Reg),
|
||||
m_SPRegistersHandler(System, *this, Reg),
|
||||
|
@ -644,7 +645,7 @@ bool CMipsMemoryVM::LW_NonMemory(uint32_t PAddr, uint32_t* Value)
|
|||
case 0x03F00000: m_RDRAMRegistersHandler.Read32(PAddr, m_MemLookupValue.UW[0]); break;
|
||||
case 0x04000000: m_SPRegistersHandler.Read32(PAddr, m_MemLookupValue.UW[0]); break;
|
||||
case 0x04100000: m_DPCommandRegistersHandler.Read32(PAddr, m_MemLookupValue.UW[0]); break;
|
||||
case 0x04300000: Load32MIPSInterface(); break;
|
||||
case 0x04300000: m_MIPSInterfaceHandler.Read32(PAddr, m_MemLookupValue.UW[0]); break;
|
||||
case 0x04400000: Load32VideoInterface(); break;
|
||||
case 0x04500000: Load32AudioInterface(); break;
|
||||
case 0x04600000: m_PeripheralInterfaceHandler.Read32(PAddr, m_MemLookupValue.UW[0]); break;
|
||||
|
@ -764,7 +765,7 @@ bool CMipsMemoryVM::SW_NonMemory(uint32_t PAddr, uint32_t Value)
|
|||
}
|
||||
break;
|
||||
case 0x04100000: m_DPCommandRegistersHandler.Write32(PAddr, Value, 0xFFFFFFFF); break;
|
||||
case 0x04300000: Write32MIPSInterface(); break;
|
||||
case 0x04300000: m_MIPSInterfaceHandler.Write32(PAddr, Value, 0xFFFFFFFF); break;
|
||||
case 0x04400000: Write32VideoInterface(); break;
|
||||
case 0x04500000: Write32AudioInterface(); break;
|
||||
case 0x04600000: m_PeripheralInterfaceHandler.Write32(PAddr, Value, 0xFFFFFFFF); break;
|
||||
|
@ -1120,23 +1121,6 @@ void CMipsMemoryVM::ChangeMiIntrMask()
|
|||
}
|
||||
}
|
||||
|
||||
void CMipsMemoryVM::Load32MIPSInterface(void)
|
||||
{
|
||||
switch (m_MemLookupAddress & 0x1FFFFFFF)
|
||||
{
|
||||
case 0x04300000: m_MemLookupValue.UW[0] = g_Reg->MI_MODE_REG; break;
|
||||
case 0x04300004: m_MemLookupValue.UW[0] = g_Reg->MI_VERSION_REG; break;
|
||||
case 0x04300008: m_MemLookupValue.UW[0] = g_Reg->MI_INTR_REG; break;
|
||||
case 0x0430000C: m_MemLookupValue.UW[0] = g_Reg->MI_INTR_MASK_REG; break;
|
||||
default:
|
||||
m_MemLookupValue.UW[0] = 0;
|
||||
if (HaveDebugger())
|
||||
{
|
||||
g_Notify->BreakPoint(__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMipsMemoryVM::Load32VideoInterface(void)
|
||||
{
|
||||
switch (m_MemLookupAddress & 0x1FFFFFFF)
|
||||
|
@ -1366,102 +1350,6 @@ void CMipsMemoryVM::Load32Rom(void)
|
|||
}
|
||||
}
|
||||
|
||||
void CMipsMemoryVM::Write32MIPSInterface(void)
|
||||
{
|
||||
switch ((m_MemLookupAddress & 0xFFFFFFF))
|
||||
{
|
||||
case 0x04300000:
|
||||
g_Reg->MI_MODE_REG &= ~0x7F;
|
||||
g_Reg->MI_MODE_REG |= (m_MemLookupValue.UW[0] & 0x7F);
|
||||
if ((m_MemLookupValue.UW[0] & MI_CLR_INIT) != 0)
|
||||
{
|
||||
g_Reg->MI_MODE_REG &= ~MI_MODE_INIT;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_SET_INIT) != 0)
|
||||
{
|
||||
g_Reg->MI_MODE_REG |= MI_MODE_INIT;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_CLR_EBUS) != 0)
|
||||
{
|
||||
g_Reg->MI_MODE_REG &= ~MI_MODE_EBUS;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_SET_EBUS) != 0)
|
||||
{
|
||||
g_Reg->MI_MODE_REG |= MI_MODE_EBUS;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_CLR_DP_INTR) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_REG &= ~MI_INTR_DP;
|
||||
g_Reg->m_GfxIntrReg &= ~MI_INTR_DP;
|
||||
g_Reg->CheckInterrupts();
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_CLR_RDRAM) != 0)
|
||||
{
|
||||
g_Reg->MI_MODE_REG &= ~MI_MODE_RDRAM;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_SET_RDRAM) != 0)
|
||||
{
|
||||
g_Reg->MI_MODE_REG |= MI_MODE_RDRAM;
|
||||
}
|
||||
break;
|
||||
case 0x0430000C:
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_CLR_SP) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG &= ~MI_INTR_MASK_SP;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_SET_SP) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG |= MI_INTR_MASK_SP;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_CLR_SI) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG &= ~MI_INTR_MASK_SI;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_SET_SI) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG |= MI_INTR_MASK_SI;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_CLR_AI) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG &= ~MI_INTR_MASK_AI;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_SET_AI) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG |= MI_INTR_MASK_AI;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_CLR_VI) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG &= ~MI_INTR_MASK_VI;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_SET_VI) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG |= MI_INTR_MASK_VI;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_CLR_PI) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG &= ~MI_INTR_MASK_PI;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_SET_PI) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG |= MI_INTR_MASK_PI;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_CLR_DP) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG &= ~MI_INTR_MASK_DP;
|
||||
}
|
||||
if ((m_MemLookupValue.UW[0] & MI_INTR_MASK_SET_DP) != 0)
|
||||
{
|
||||
g_Reg->MI_INTR_MASK_REG |= MI_INTR_MASK_DP;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (HaveDebugger())
|
||||
{
|
||||
g_Notify->BreakPoint(__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMipsMemoryVM::Write32VideoInterface(void)
|
||||
{
|
||||
switch ((m_MemLookupAddress & 0xFFFFFFF))
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <Project64-core\N64System\Mips\Sram.h>
|
||||
#include <Project64-core\N64System\Mips\Dma.h>
|
||||
#include <Project64-core\N64System\MemoryHandler\DisplayControlRegHandler.h>
|
||||
#include <Project64-core\N64System\MemoryHandler\MIPSInterfaceHandler.h>
|
||||
#include <Project64-core\N64System\MemoryHandler\PeripheralInterfaceHandler.h>
|
||||
#include <Project64-core\N64System\MemoryHandler\RDRAMInterfaceHandler.h>
|
||||
#include <Project64-core\N64System\MemoryHandler\RDRAMRegistersHandler.h>
|
||||
|
@ -136,7 +137,6 @@ private:
|
|||
bool SH_NonMemory(uint32_t PAddr, uint16_t Value);
|
||||
bool SW_NonMemory(uint32_t PAddr, uint32_t Value);
|
||||
|
||||
static void Load32MIPSInterface(void);
|
||||
static void Load32VideoInterface(void);
|
||||
static void Load32AudioInterface(void);
|
||||
static void Load32SerialInterface(void);
|
||||
|
@ -147,7 +147,6 @@ private:
|
|||
static void Load32PifRam(void);
|
||||
static void Load32Rom(void);
|
||||
|
||||
static void Write32MIPSInterface(void);
|
||||
static void Write32VideoInterface(void);
|
||||
static void Write32AudioInterface(void);
|
||||
static void Write32SerialInterface(void);
|
||||
|
@ -182,6 +181,7 @@ private:
|
|||
static uint8_t * m_Reserve1, *m_Reserve2;
|
||||
CRegisters & m_Reg;
|
||||
DisplayControlRegHandler m_DPCommandRegistersHandler;
|
||||
MIPSInterfaceHandler m_MIPSInterfaceHandler;
|
||||
PeripheralInterfaceHandler m_PeripheralInterfaceHandler;
|
||||
RDRAMInterfaceHandler m_RDRAMInterfaceHandler;
|
||||
RDRAMRegistersHandler m_RDRAMRegistersHandler;
|
||||
|
|
|
@ -75,16 +75,6 @@ CP0registers::CP0registers(uint32_t * _CP0) :
|
|||
{
|
||||
}
|
||||
|
||||
Mips_InterfaceReg::Mips_InterfaceReg(uint32_t * _MipsInterface) :
|
||||
MI_INIT_MODE_REG(_MipsInterface[0]),
|
||||
MI_MODE_REG(_MipsInterface[0]),
|
||||
MI_VERSION_REG(_MipsInterface[1]),
|
||||
MI_NOOP_REG(_MipsInterface[1]),
|
||||
MI_INTR_REG(_MipsInterface[2]),
|
||||
MI_INTR_MASK_REG(_MipsInterface[3])
|
||||
{
|
||||
}
|
||||
|
||||
Video_InterfaceReg::Video_InterfaceReg(uint32_t * _VideoInterface) :
|
||||
VI_STATUS_REG(_VideoInterface[0]),
|
||||
VI_CONTROL_REG(_VideoInterface[0]),
|
||||
|
@ -171,7 +161,7 @@ Disk_InterfaceReg::Disk_InterfaceReg(uint32_t * DiskInterface) :
|
|||
CRegisters::CRegisters(CN64System * System, CSystemEvents * SystemEvents) :
|
||||
CP0registers(m_CP0),
|
||||
RDRAMRegistersReg(m_RDRAM_Registers),
|
||||
Mips_InterfaceReg(m_Mips_Interface),
|
||||
MIPSInterfaceReg(m_Mips_Interface),
|
||||
Video_InterfaceReg(m_Video_Interface),
|
||||
AudioInterfaceReg(m_Audio_Interface),
|
||||
PeripheralInterfaceReg(m_Peripheral_Interface),
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <Common/Platform.h>
|
||||
#include <Project64-core\N64System\N64Types.h>
|
||||
#include <Project64-core\N64System\MemoryHandler\DisplayControlRegHandler.h>
|
||||
#include <Project64-core\N64System\MemoryHandler\MIPSInterfaceHandler.h>
|
||||
#include <Project64-core\N64System\MemoryHandler\PeripheralInterfaceHandler.h>
|
||||
#include <Project64-core\N64System\MemoryHandler\RDRAMInterfaceHandler.h>
|
||||
#include <Project64-core\N64System\MemoryHandler\RDRAMRegistersHandler.h>
|
||||
|
@ -115,25 +116,6 @@ enum
|
|||
FPCSR_RM_RM = 0x00000003, // Round to negative infinity
|
||||
};
|
||||
|
||||
// MIPS interface registers
|
||||
class Mips_InterfaceReg
|
||||
{
|
||||
protected:
|
||||
Mips_InterfaceReg (uint32_t * _MipsInterface);
|
||||
|
||||
public:
|
||||
uint32_t & MI_INIT_MODE_REG;
|
||||
uint32_t & MI_MODE_REG;
|
||||
uint32_t & MI_VERSION_REG;
|
||||
uint32_t & MI_NOOP_REG;
|
||||
uint32_t & MI_INTR_REG;
|
||||
uint32_t & MI_INTR_MASK_REG;
|
||||
|
||||
private:
|
||||
Mips_InterfaceReg();
|
||||
Mips_InterfaceReg(const Mips_InterfaceReg&);
|
||||
Mips_InterfaceReg& operator=(const Mips_InterfaceReg&);
|
||||
};
|
||||
|
||||
// MIPS interface flags
|
||||
enum
|
||||
|
@ -429,7 +411,7 @@ class CRegisters :
|
|||
protected CSystemRegisters,
|
||||
public CP0registers,
|
||||
public RDRAMRegistersReg,
|
||||
public Mips_InterfaceReg,
|
||||
public MIPSInterfaceReg,
|
||||
public Video_InterfaceReg,
|
||||
public AudioInterfaceReg,
|
||||
public PeripheralInterfaceReg,
|
||||
|
|
|
@ -11095,7 +11095,14 @@ void CX86RecompilerOps::SW_Register(x86Reg Reg, uint32_t VAddr)
|
|||
MoveX86regToVariable(Reg, &CMipsMemoryVM::m_MemLookupValue.UW[0], "CMipsMemoryVM::m_MemLookupValue.UW[0]");
|
||||
MoveConstToVariable(PAddr, &CMipsMemoryVM::m_MemLookupAddress, "m_MemLookupAddress");
|
||||
m_RegWorkingSet.BeforeCallDirect();
|
||||
Call_Direct((void *)CMipsMemoryVM::Write32MIPSInterface, "CMipsMemoryVM::Write32MIPSInterface");
|
||||
#ifdef _MSC_VER
|
||||
MoveConstToX86reg((uint32_t)(MemoryHandler*)&g_MMU->m_MIPSInterfaceHandler, x86_ECX);
|
||||
Call_Direct((void*)((long**)(MemoryHandler*)&g_MMU->m_MIPSInterfaceHandler)[0][1], "MIPSInterfaceHandler::Write32");
|
||||
#else
|
||||
PushImm32((uint32_t)&g_MMU->m_MIPSInterfaceHandler);
|
||||
Call_Direct(AddressOf(&SPRegistersHandler::Write32), "MIPSInterfaceHandler::Write32");
|
||||
AddConstToX86Reg(x86_ESP, 16);
|
||||
#endif
|
||||
m_RegWorkingSet.AfterCallDirect();
|
||||
break;
|
||||
case 0x0430000C:
|
||||
|
|
|
@ -60,7 +60,7 @@ typedef struct
|
|||
void(*FlushSettings) (void * handle);
|
||||
} PLUGIN_SETTINGS3;
|
||||
|
||||
typedef struct
|
||||
typedef struct _PLUGIN_SETTINGS_NOTIFICATION
|
||||
{
|
||||
typedef void(*SettingChangedFunc)(void *);
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
<ClCompile Include="N64System\Interpreter\InterpreterOps.cpp" />
|
||||
<ClCompile Include="N64System\Interpreter\InterpreterOps32.cpp" />
|
||||
<ClCompile Include="N64System\MemoryHandler\DisplayControlRegHandler.cpp" />
|
||||
<ClCompile Include="N64System\MemoryHandler\MIPSInterfaceHandler.cpp" />
|
||||
<ClCompile Include="N64System\MemoryHandler\PeripheralInterfaceHandler.cpp" />
|
||||
<ClCompile Include="N64System\MemoryHandler\RDRAMInterfaceHandler.cpp" />
|
||||
<ClCompile Include="N64System\MemoryHandler\RDRAMRegistersHandler.cpp" />
|
||||
|
@ -155,6 +156,7 @@
|
|||
<ClInclude Include="N64System\Interpreter\InterpreterOps.h" />
|
||||
<ClInclude Include="N64System\MemoryHandler\DisplayControlRegHandler.h" />
|
||||
<ClInclude Include="N64System\MemoryHandler\MemoryHandler.h" />
|
||||
<ClInclude Include="N64System\MemoryHandler\MIPSInterfaceHandler.h" />
|
||||
<ClInclude Include="N64System\MemoryHandler\PeripheralInterfaceHandler.h" />
|
||||
<ClInclude Include="N64System\MemoryHandler\RDRAMInterfaceHandler.h" />
|
||||
<ClInclude Include="N64System\MemoryHandler\RDRAMRegistersHandler.h" />
|
||||
|
|
|
@ -372,6 +372,9 @@
|
|||
<ClCompile Include="N64System\MemoryHandler\DisplayControlRegHandler.cpp">
|
||||
<Filter>Source Files\N64 System\MemoryHandler</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="N64System\MemoryHandler\MIPSInterfaceHandler.cpp">
|
||||
<Filter>Source Files\N64 System\MemoryHandler</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
|
@ -710,6 +713,9 @@
|
|||
<ClInclude Include="N64System\MemoryHandler\DisplayControlRegHandler.h">
|
||||
<Filter>Header Files\N64 System\MemoryHandler</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="N64System\MemoryHandler\MIPSInterfaceHandler.h">
|
||||
<Filter>Header Files\N64 System\MemoryHandler</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Version.h.in">
|
||||
|
|
Loading…
Reference in New Issue