[Project64] N64 Class.cpp tabs to spaces
This commit is contained in:
parent
70a368a861
commit
66b6be4bd7
File diff suppressed because it is too large
Load Diff
|
@ -21,145 +21,145 @@ class CRecompiler;
|
||||||
//#define TEST_SP_TRACKING //track the SP to make sure all ops pick it up fine
|
//#define TEST_SP_TRACKING //track the SP to make sure all ops pick it up fine
|
||||||
|
|
||||||
class CN64System :
|
class CN64System :
|
||||||
public CMipsMemory_CallBack,
|
public CMipsMemory_CallBack,
|
||||||
public CTLB_CB,
|
public CTLB_CB,
|
||||||
private CSystemEvents,
|
private CSystemEvents,
|
||||||
protected CN64SystemSettings,
|
protected CN64SystemSettings,
|
||||||
public CGameSettings,
|
public CGameSettings,
|
||||||
protected CDebugSettings
|
protected CDebugSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CN64System(CPlugins * Plugins, bool SavesReadOnly);
|
CN64System(CPlugins * Plugins, bool SavesReadOnly);
|
||||||
virtual ~CN64System(void);
|
virtual ~CN64System(void);
|
||||||
|
|
||||||
struct ThreadInfo {
|
struct ThreadInfo {
|
||||||
HANDLE * ThreadHandle;
|
HANDLE * ThreadHandle;
|
||||||
DWORD ThreadID;
|
DWORD ThreadID;
|
||||||
};
|
};
|
||||||
|
|
||||||
CProfiling m_Profile;
|
CProfiling m_Profile;
|
||||||
CCheats m_Cheats;
|
CCheats m_Cheats;
|
||||||
bool m_EndEmulation;
|
bool m_EndEmulation;
|
||||||
SAVE_CHIP_TYPE m_SaveUsing;
|
SAVE_CHIP_TYPE m_SaveUsing;
|
||||||
|
|
||||||
//Methods
|
//Methods
|
||||||
static bool RunFileImage(const char * FileLoc);
|
static bool RunFileImage(const char * FileLoc);
|
||||||
static void CloseSystem(void);
|
static void CloseSystem(void);
|
||||||
|
|
||||||
void CloseCpu();
|
void CloseCpu();
|
||||||
void ExternalEvent(SystemEvent action); //covers gui interacting and timers etc..
|
void ExternalEvent(SystemEvent action); //covers gui interacting and timers etc..
|
||||||
stdstr ChooseFileToOpen(HWND hParent);
|
stdstr ChooseFileToOpen(HWND hParent);
|
||||||
void DisplayRomInfo(HWND hParent);
|
void DisplayRomInfo(HWND hParent);
|
||||||
void StartEmulation(bool NewThread);
|
void StartEmulation(bool NewThread);
|
||||||
void SyncToAudio();
|
void SyncToAudio();
|
||||||
void IncreaseSpeed() { m_Limitor.IncreaseSpeed(); }
|
void IncreaseSpeed() { m_Limitor.IncreaseSpeed(); }
|
||||||
void DecreaseSpeed() { m_Limitor.DecreaseSpeed(); }
|
void DecreaseSpeed() { m_Limitor.DecreaseSpeed(); }
|
||||||
void Reset(bool bInitReg, bool ClearMenory);
|
void Reset(bool bInitReg, bool ClearMenory);
|
||||||
void GameReset();
|
void GameReset();
|
||||||
void PluginReset();
|
void PluginReset();
|
||||||
|
|
||||||
void Pause();
|
void Pause();
|
||||||
void RunRSP();
|
void RunRSP();
|
||||||
bool SaveState();
|
bool SaveState();
|
||||||
bool LoadState(LPCSTR FileName);
|
bool LoadState(LPCSTR FileName);
|
||||||
bool LoadState();
|
bool LoadState();
|
||||||
|
|
||||||
bool DmaUsed() const { return m_DMAUsed; }
|
bool DmaUsed() const { return m_DMAUsed; }
|
||||||
void SetDmaUsed(bool DMAUsed) { m_DMAUsed = DMAUsed; }
|
void SetDmaUsed(bool DMAUsed) { m_DMAUsed = DMAUsed; }
|
||||||
void SetCheatsSlectionChanged(bool changed) { m_CheatsSlectionChanged = changed; }
|
void SetCheatsSlectionChanged(bool changed) { m_CheatsSlectionChanged = changed; }
|
||||||
bool HasCheatsSlectionChanged(void) const { return m_CheatsSlectionChanged; }
|
bool HasCheatsSlectionChanged(void) const { return m_CheatsSlectionChanged; }
|
||||||
DWORD GetButtons(int Control) const { return m_Buttons[Control]; }
|
DWORD GetButtons(int Control) const { return m_Buttons[Control]; }
|
||||||
|
|
||||||
//Variable used to track that the SP is being handled and stays the same as the real SP in sync core
|
//Variable used to track that the SP is being handled and stays the same as the real SP in sync core
|
||||||
#ifdef TEST_SP_TRACKING
|
#ifdef TEST_SP_TRACKING
|
||||||
DWORD m_CurrentSP;
|
DWORD m_CurrentSP;
|
||||||
#endif
|
#endif
|
||||||
//For Sync CPU
|
//For Sync CPU
|
||||||
void UpdateSyncCPU(CN64System * const SecondCPU, DWORD const Cycles);
|
void UpdateSyncCPU(CN64System * const SecondCPU, DWORD const Cycles);
|
||||||
void SyncCPU(CN64System * const SecondCPU);
|
void SyncCPU(CN64System * const SecondCPU);
|
||||||
void SyncCPUPC(CN64System * const SecondCPU);
|
void SyncCPUPC(CN64System * const SecondCPU);
|
||||||
void SyncSystem();
|
void SyncSystem();
|
||||||
void SyncSystemPC();
|
void SyncSystemPC();
|
||||||
private:
|
private:
|
||||||
//Make sure plugins can directly access this information
|
//Make sure plugins can directly access this information
|
||||||
friend CGfxPlugin;
|
friend CGfxPlugin;
|
||||||
friend CAudioPlugin;
|
friend CAudioPlugin;
|
||||||
friend CRSP_Plugin;
|
friend CRSP_Plugin;
|
||||||
friend CControl_Plugin;
|
friend CControl_Plugin;
|
||||||
|
|
||||||
//Recompiler has access to manipulate and call functions
|
//Recompiler has access to manipulate and call functions
|
||||||
friend CSystemTimer;
|
friend CSystemTimer;
|
||||||
|
|
||||||
//Used for loading and potentially executing the CPU in its own thread.
|
//Used for loading and potentially executing the CPU in its own thread.
|
||||||
static void StartEmulationThread(ThreadInfo * Info);
|
static void StartEmulationThread(ThreadInfo * Info);
|
||||||
static bool EmulationStarting(HANDLE hThread, DWORD ThreadId);
|
static bool EmulationStarting(HANDLE hThread, DWORD ThreadId);
|
||||||
|
|
||||||
void ExecuteCPU();
|
void ExecuteCPU();
|
||||||
void RefreshScreen();
|
void RefreshScreen();
|
||||||
void DumpSyncErrors(CN64System * SecondCPU);
|
void DumpSyncErrors(CN64System * SecondCPU);
|
||||||
void StartEmulation2(bool NewThread);
|
void StartEmulation2(bool NewThread);
|
||||||
bool SetActiveSystem(bool bActive = true);
|
bool SetActiveSystem(bool bActive = true);
|
||||||
void InitRegisters(bool bPostPif, CMipsMemory & MMU);
|
void InitRegisters(bool bPostPif, CMipsMemory & MMU);
|
||||||
void DisplayRSPListCount();
|
void DisplayRSPListCount();
|
||||||
|
|
||||||
//CPU Methods
|
//CPU Methods
|
||||||
void ExecuteRecompiler();
|
void ExecuteRecompiler();
|
||||||
void ExecuteInterpret();
|
void ExecuteInterpret();
|
||||||
void ExecuteSyncCPU();
|
void ExecuteSyncCPU();
|
||||||
|
|
||||||
//Mark information saying that the CPU has stopped
|
//Mark information saying that the CPU has stopped
|
||||||
void CpuStopped();
|
void CpuStopped();
|
||||||
|
|
||||||
//Function in CMipsMemory_CallBack
|
//Function in CMipsMemory_CallBack
|
||||||
virtual bool WriteToProtectedMemory(uint32_t Address, int length);
|
virtual bool WriteToProtectedMemory(uint32_t Address, int length);
|
||||||
|
|
||||||
//Functions in CTLB_CB
|
//Functions in CTLB_CB
|
||||||
void TLB_Mapped(uint32_t VAddr, uint32_t Len, uint32_t PAddr, bool bReadOnly);
|
void TLB_Mapped(uint32_t VAddr, uint32_t Len, uint32_t PAddr, bool bReadOnly);
|
||||||
void TLB_Unmaped(uint32_t VAddr, uint32_t Len);
|
void TLB_Unmaped(uint32_t VAddr, uint32_t Len);
|
||||||
void TLB_Changed();
|
void TLB_Changed();
|
||||||
|
|
||||||
CPlugins * const m_Plugins; //The plugin container
|
CPlugins * const m_Plugins; //The plugin container
|
||||||
CN64System * m_SyncCPU;
|
CN64System * m_SyncCPU;
|
||||||
CPlugins * m_SyncPlugins;
|
CPlugins * m_SyncPlugins;
|
||||||
CMainGui * m_SyncWindow;
|
CMainGui * m_SyncWindow;
|
||||||
CMipsMemoryVM m_MMU_VM; //Memory of the n64
|
CMipsMemoryVM m_MMU_VM; //Memory of the n64
|
||||||
CTLB m_TLB;
|
CTLB m_TLB;
|
||||||
CRegisters m_Reg;
|
CRegisters m_Reg;
|
||||||
CFramePerSecond m_FPS;
|
CFramePerSecond m_FPS;
|
||||||
CProfiling m_CPU_Usage; //used to track the cpu usage
|
CProfiling m_CPU_Usage; //used to track the cpu usage
|
||||||
CRecompiler * m_Recomp;
|
CRecompiler * m_Recomp;
|
||||||
CAudio m_Audio;
|
CAudio m_Audio;
|
||||||
CSpeedLimitor m_Limitor;
|
CSpeedLimitor m_Limitor;
|
||||||
bool m_InReset;
|
bool m_InReset;
|
||||||
int m_NextTimer;
|
int m_NextTimer;
|
||||||
CSystemTimer m_SystemTimer;
|
CSystemTimer m_SystemTimer;
|
||||||
bool m_bCleanFrameBox;
|
bool m_bCleanFrameBox;
|
||||||
bool m_bInitialized;
|
bool m_bInitialized;
|
||||||
bool m_RspBroke;
|
bool m_RspBroke;
|
||||||
bool m_DMAUsed;
|
bool m_DMAUsed;
|
||||||
DWORD m_Buttons[4];
|
DWORD m_Buttons[4];
|
||||||
bool m_TestTimer;
|
bool m_TestTimer;
|
||||||
DWORD m_NextInstruction;
|
DWORD m_NextInstruction;
|
||||||
DWORD m_JumpToLocation;
|
DWORD m_JumpToLocation;
|
||||||
uint32_t m_TLBLoadAddress;
|
uint32_t m_TLBLoadAddress;
|
||||||
uint32_t m_TLBStoreAddress;
|
uint32_t m_TLBStoreAddress;
|
||||||
DWORD m_SyncCount;
|
DWORD m_SyncCount;
|
||||||
bool m_CheatsSlectionChanged;
|
bool m_CheatsSlectionChanged;
|
||||||
|
|
||||||
//When Syncing cores this is the PC where it last Sync'ed correctly
|
//When Syncing cores this is the PC where it last Sync'ed correctly
|
||||||
DWORD m_LastSuccessSyncPC[10];
|
DWORD m_LastSuccessSyncPC[10];
|
||||||
int m_CyclesToSkip;
|
int m_CyclesToSkip;
|
||||||
|
|
||||||
//Handle to the cpu thread
|
//Handle to the cpu thread
|
||||||
HANDLE m_CPU_Handle;
|
HANDLE m_CPU_Handle;
|
||||||
DWORD m_CPU_ThreadID;
|
DWORD m_CPU_ThreadID;
|
||||||
|
|
||||||
//Handle to pause mutex
|
//Handle to pause mutex
|
||||||
void * m_hPauseEvent;
|
SyncEvent m_hPauseEvent;
|
||||||
|
|
||||||
//No of Alist and Dlist sent to the RSP
|
//No of Alist and Dlist sent to the RSP
|
||||||
DWORD m_AlistCount, m_DlistCount, m_UnknownCount;
|
DWORD m_AlistCount, m_DlistCount, m_UnknownCount;
|
||||||
|
|
||||||
//list of function that have been called .. used in profiling
|
//list of function that have been called .. used in profiling
|
||||||
FUNC_CALLS m_FunctionCalls;
|
FUNC_CALLS m_FunctionCalls;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue