[Project64] Remove __interface CMipsMemory_CallBack

This commit is contained in:
zilmar 2015-12-21 18:35:22 +11:00
parent a480b60f6f
commit 012e247514
23 changed files with 45 additions and 124 deletions

View File

@ -13,7 +13,7 @@
#include <Common/path.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/TranslateVaddr.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/N64RomClass.h>
CFile * CLogging::m_hLogFile = NULL;

View File

@ -210,7 +210,7 @@ uint16_t ConvertXP64Value(uint16_t Value)
return tmpValue;
}
void CCheats::ApplyCheats(CMipsMemory * MMU)
void CCheats::ApplyCheats(CMipsMemoryVM * MMU)
{
for (size_t CurrentCheat = 0; CurrentCheat < m_Codes.size(); CurrentCheat++)
{
@ -222,7 +222,7 @@ void CCheats::ApplyCheats(CMipsMemory * MMU)
}
}
void CCheats::ApplyGSButton(CMipsMemory * MMU)
void CCheats::ApplyGSButton(CMipsMemoryVM * MMU)
{
uint32_t Address;
for (size_t CurrentCheat = 0; CurrentCheat < m_Codes.size(); CurrentCheat++)
@ -333,7 +333,7 @@ bool CCheats::IsValid16BitCode(const char * CheatString)
return true;
}
int CCheats::ApplyCheatEntry(CMipsMemory * MMU, const CODES & CodeEntry, int CurrentEntry, bool Execute)
int CCheats::ApplyCheatEntry(CMipsMemoryVM * MMU, const CODES & CodeEntry, int CurrentEntry, bool Execute)
{
if (CurrentEntry < 0 || CurrentEntry >= (int)CodeEntry.size())
{

View File

@ -10,7 +10,7 @@
****************************************************************************/
#pragma once
#include "N64RomClass.h"
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/Plugins/PluginClass.h>
class CCheats
@ -25,8 +25,8 @@ public:
MaxGSEntries = 100,
};
void ApplyCheats(CMipsMemory * MMU);
void ApplyGSButton(CMipsMemory * MMU);
void ApplyCheats(CMipsMemoryVM * MMU);
void ApplyGSButton(CMipsMemoryVM * MMU);
void LoadCheats(bool DisableSelected, CPlugins * Plugins);
static bool IsValid16BitCode(const char * CheatString);
@ -47,5 +47,5 @@ private:
CODES_ARRAY m_Codes;
bool LoadCode(int32_t CheatNo, const char * CheatString);
int32_t ApplyCheatEntry(CMipsMemory * MMU, const CODES & CodeEntry, int32_t CurrentEntry, bool Execute);
int32_t ApplyCheatEntry(CMipsMemoryVM * MMU, const CODES & CodeEntry, int32_t CurrentEntry, bool Execute);
};

View File

@ -12,7 +12,7 @@
#include "InterpreterCPU.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/OpcodeName.h>
#include <Project64-core/N64System/Interpreter/InterpreterOps32.h>
#include <Project64-core/Plugins/PluginClass.h>
@ -292,12 +292,12 @@ void CInterpreterCPU::ExecuteCPU()
continue;
}
/* if (PROGRAM_COUNTER > 0x80000300 && PROGRAM_COUNTER < 0x80380000)
{
WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %s",*_PROGRAM_COUNTER,R4300iOpcodeName(Opcode.Hex,*_PROGRAM_COUNTER));
// WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %s t9: %08X v1: %08X",*_PROGRAM_COUNTER,R4300iOpcodeName(Opcode.Hex,*_PROGRAM_COUNTER),_GPR[0x19].UW[0],_GPR[0x03].UW[0]);
// WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %d %d",*_PROGRAM_COUNTER,*g_NextTimer,g_SystemTimer->CurrentType());
} */
/* if (PROGRAM_COUNTER > 0x80000300 && PROGRAM_COUNTER < 0x80380000)
{
WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %s",*_PROGRAM_COUNTER,R4300iOpcodeName(Opcode.Hex,*_PROGRAM_COUNTER));
// WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %s t9: %08X v1: %08X",*_PROGRAM_COUNTER,R4300iOpcodeName(Opcode.Hex,*_PROGRAM_COUNTER),_GPR[0x19].UW[0],_GPR[0x03].UW[0]);
// WriteTraceF((TraceType)(TraceError | TraceNoHeader),"%X: %d %d",*_PROGRAM_COUNTER,*g_NextTimer,g_SystemTimer->CurrentType());
} */
m_R4300i_Opcode[Opcode.op]();
NextTimer -= CountPerOp;

View File

@ -12,7 +12,7 @@
#include "InterpreterOps.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/SystemTiming.h>
#include <Project64-core/N64System/Mips/TLBClass.h>
#include <Project64-core/N64System/Mips/OpcodeName.h>
@ -64,7 +64,7 @@ const int32_t R4300iOp::LWR_SHIFT[4] = { 24, 16, 8, 0 };
m_NextInstruction = JUMP;\
m_JumpToLocation = (*_PROGRAM_COUNTER);\
return;\
}
}
#define TLB_READ_EXCEPTION(Address) \
g_Reg->DoTLBReadMiss(m_NextInstruction == JUMP,Address);\

View File

@ -11,7 +11,7 @@
#include "stdafx.h"
#include "InterpreterOps32.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/SystemTiming.h>
#include <Project64-core/N64System/Interpreter/InterpreterCPU.h>
#include <Project64-core/Logging.h>
@ -31,7 +31,7 @@ bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2);
m_NextInstruction = JUMP;\
m_JumpToLocation = (*_PROGRAM_COUNTER);\
return;\
}
}
#define TLB_READ_EXCEPTION(Address) \
g_Reg->DoTLBReadMiss(m_NextInstruction == JUMP,Address);\

View File

@ -12,7 +12,7 @@
#include "Dma.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64RomClass.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/N64Class.h>
#include <Windows.h>

View File

@ -11,7 +11,7 @@
#include "stdafx.h"
#include "FlashRam.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Common/path.h>
#include <Windows.h>

View File

@ -1,84 +0,0 @@
/****************************************************************************
* *
* Project64 - A Nintendo 64 emulator. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2012 Project64. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#pragma once
__interface CMipsMemory_CallBack
{
//Protected memory has been written to, returns true if that memory has been unprotected
virtual bool WriteToProtectedMemory (uint32_t Address, int32_t length) = 0;
};
__interface CMipsMemory
{
virtual uint8_t * Rdram () = 0;
virtual uint32_t RdramSize() = 0;
virtual uint8_t * Dmem () = 0;
virtual uint8_t * Imem () = 0;
virtual uint8_t * PifRam () = 0;
virtual bool LB_VAddr ( uint32_t VAddr, uint8_t & Value ) = 0;
virtual bool LH_VAddr ( uint32_t VAddr, uint16_t & Value ) = 0;
virtual bool LW_VAddr ( uint32_t VAddr, uint32_t & Value ) = 0;
virtual bool LD_VAddr ( uint32_t VAddr, uint64_t & Value ) = 0;
virtual bool LB_PAddr ( uint32_t PAddr, uint8_t & Value ) = 0;
virtual bool LH_PAddr ( uint32_t PAddr, uint16_t & Value ) = 0;
virtual bool LW_PAddr ( uint32_t PAddr, uint32_t & Value ) = 0;
virtual bool LD_PAddr ( uint32_t PAddr, uint64_t & Value ) = 0;
virtual bool SB_VAddr ( uint32_t VAddr, uint8_t Value ) = 0;
virtual bool SH_VAddr ( uint32_t VAddr, uint16_t Value ) = 0;
virtual bool SW_VAddr ( uint32_t VAddr, uint32_t Value ) = 0;
virtual bool SD_VAddr ( uint32_t VAddr, uint64_t Value ) = 0;
virtual bool SB_PAddr ( uint32_t PAddr, uint8_t Value ) = 0;
virtual bool SH_PAddr ( uint32_t PAddr, uint16_t Value ) = 0;
virtual bool SW_PAddr ( uint32_t PAddr, uint32_t Value ) = 0;
virtual bool SD_PAddr ( uint32_t PAddr, uint64_t Value ) = 0;
virtual bool ValidVaddr ( uint32_t VAddr ) const = 0;
virtual int32_t MemoryFilter ( uint32_t dwExptCode, void * lpExceptionPointer ) = 0;
virtual void UpdateFieldSerration ( uint32_t interlaced ) = 0;
//Protect the Memory from being written to
virtual void ProtectMemory ( uint32_t StartVaddr, uint32_t EndVaddr ) = 0;
virtual void UnProtectMemory ( uint32_t StartVaddr, uint32_t EndVaddr ) = 0;
//Compilation Functions
virtual void ResetMemoryStack () = 0;
virtual void Compile_LB () = 0;
virtual void Compile_LBU () = 0;
virtual void Compile_LH () = 0;
virtual void Compile_LHU () = 0;
virtual void Compile_LW () = 0;
virtual void Compile_LL () = 0;
virtual void Compile_LWC1 () = 0;
virtual void Compile_LWU () = 0;
virtual void Compile_LWL () = 0;
virtual void Compile_LWR () = 0;
virtual void Compile_LD () = 0;
virtual void Compile_LDC1 () = 0;
virtual void Compile_LDL () = 0;
virtual void Compile_LDR () = 0;
virtual void Compile_SB () = 0;
virtual void Compile_SH () = 0;
virtual void Compile_SW () = 0;
virtual void Compile_SWL () = 0;
virtual void Compile_SWR () = 0;
virtual void Compile_SD () = 0;
virtual void Compile_SDL () = 0;
virtual void Compile_SDR () = 0;
virtual void Compile_SC () = 0;
virtual void Compile_SWC1 () = 0;
virtual void Compile_SDC1 () = 0;
};

View File

@ -9,7 +9,7 @@
* *
****************************************************************************/
#pragma once
#include "MemoryClass.h"
#include "MemoryVirtualMem.h"
#include "TranslateVaddr.h"
#include <Project64-core/N64System/Recompiler/RecompilerOps.h>
#include <Project64-core/N64System/Interpreter/InterpreterOps.h>
@ -18,6 +18,12 @@
#include <Project64-core/N64System/Mips/Sram.h>
#include <Project64-core/N64System/Mips/Dma.h>
__interface CMipsMemory_CallBack
{
//Protected memory has been written to, returns true if that memory has been unprotected
virtual bool WriteToProtectedMemory(uint32_t Address, int32_t length) = 0;
};
/*
* 64-bit Windows exception recovery facilities will expect to interact with
* the 64-bit registers of the Intel architecture (e.g., rax instead of eax).
@ -50,7 +56,6 @@
*/
class CMipsMemoryVM :
public CMipsMemory,
public CTransVaddr,
private CRecompilerOps,
private R4300iOp,

View File

@ -13,7 +13,7 @@
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/Plugins/ControllerPlugin.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/Mips/Rumblepak.h>
#include <Project64-core/N64System/Mips/Mempak.H>

View File

@ -569,7 +569,7 @@ bool CN64System::SetActiveSystem(bool bActive)
return bRes;
}
void CN64System::InitRegisters(bool bPostPif, CMipsMemory & MMU)
void CN64System::InitRegisters(bool bPostPif, CMipsMemoryVM & MMU)
{
m_Reg.Reset();

View File

@ -19,7 +19,7 @@
#include <Project64-core/Logging.h>
#include "Mips/SystemEvents.h"
#include "Mips/MemoryClass.h"
#include "Mips/MemoryVirtualMem.h"
#include "Mips/TLBClass.h"
#include "Mips/Audio.h"
#include "Mips/SystemTiming.h"
@ -118,7 +118,7 @@ private:
void DumpSyncErrors(CN64System * SecondCPU);
void StartEmulation2(bool NewThread);
bool SetActiveSystem(bool bActive = true);
void InitRegisters(bool bPostPif, CMipsMemory & MMU);
void InitRegisters(bool bPostPif, CMipsMemoryVM & MMU);
void DisplayRSPListCount();
//CPU Methods

View File

@ -12,7 +12,7 @@
#include "CodeSection.h"
#include <Project64-core/N64System/Mips/OpCode.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Recompiler/x86CodeLog.h>
#include <Project64-core/N64System/Recompiler/CodeBlock.h>
#include <Project64-core/N64System/N64Class.h>

View File

@ -14,7 +14,7 @@
#include <Project64-core/N64System/Recompiler/CodeBlock.h>
#include <Project64-core/N64System/Recompiler/x86CodeLog.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/OpcodeName.h>
#ifdef _DEBUG

View File

@ -11,7 +11,7 @@
#include "stdafx.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/OpcodeName.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Interpreter/InterpreterOps.h>
#include <Project64-core/N64System/Interpreter/InterpreterCPU.h>
#include <Project64-core/N64System/N64Class.h>

View File

@ -10,7 +10,7 @@
****************************************************************************/
#include "stdafx.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include "X86ops.h"
#include "x86CodeLog.h"

View File

@ -15,10 +15,10 @@ CN64System * g_System = NULL;
CN64System * g_BaseSystem = NULL;
CN64System * g_SyncSystem = NULL;
CRecompiler * g_Recompiler = NULL;
CMipsMemory * g_MMU = NULL; //Memory of the n64
CMipsMemoryVM * g_MMU = NULL; //Memory of the n64
CTLB * g_TLB = NULL; //TLB Unit
CRegisters * g_Reg = NULL; //Current Register Set attacted to the g_MMU
CNotification * g_Notify = NULL;
CNotification * g_Notify = NULL;
CPlugins * g_Plugins = NULL;
CN64Rom * g_Rom = NULL; //The current rom that this system is executing.. it can only execute one file at the time
CAudio * g_Audio = NULL;
@ -29,4 +29,4 @@ uint32_t * g_TLBLoadAddress = NULL;
uint32_t * g_TLBStoreAddress = NULL;
CDebugger * g_Debugger = NULL;
int * g_NextTimer;
int * g_NextTimer;

View File

@ -21,8 +21,8 @@ extern CN64System * g_SyncSystem;
class CRecompiler;
extern CRecompiler * g_Recompiler;
__interface CMipsMemory;
extern CMipsMemory * g_MMU; //Memory of the n64
class CMipsMemoryVM;
extern CMipsMemoryVM * g_MMU; //Memory of the n64
class CTLB;
extern CTLB * g_TLB; //TLB Unit

View File

@ -11,7 +11,7 @@
#include "stdafx.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64RomClass.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/N64Class.h>
#include "AudioPlugin.h"

View File

@ -11,7 +11,7 @@
#include "stdafx.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64RomClass.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include "GFXPlugin.h"
#include <Windows.h>

View File

@ -10,7 +10,7 @@
****************************************************************************/
#include "stdafx.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include "RSPPlugin.h"
#include "GFXPlugin.h"

View File

@ -37,7 +37,7 @@
#include <Project64-core/N64System/Mips/TranslateVaddr.h>
#include <Project64-core/N64System/Mips/TLBClass.h>
#include <Project64-core/N64System/Mips/MemoryLabelsClass.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/Mips/Audio.h>
#include <Project64-core/N64System/Mips/SystemTiming.h>
#include <Project64-core/N64System/Mips/SystemEvents.h>