Cleaned up some of the initialization code from the C Core refactoring

This commit is contained in:
zilmar 2012-10-03 05:42:06 +10:00
parent 6dc3d85ff6
commit aa76a1d641
2 changed files with 23 additions and 31 deletions

View File

@ -4,26 +4,6 @@
#include <windows.h> #include <windows.h>
void CN64System::InitializeCPUCore ( void )
{
switch (_Rom->GetCountry())
{
case Germany: case french: case Italian:
case Europe: case Spanish: case Australia:
case X_PAL: case Y_PAL:
m_SystemType = SYSTEM_PAL;
break;
default:
m_SystemType = SYSTEM_NTSC;
break;
}
#ifndef EXTERNAL_RELEASE
LogOptions.GenerateLog = _Settings->LoadDword(Debugger_GenerateDebugLog);
LoadLogOptions(&LogOptions, FALSE);
StartLog();
#endif
}
CN64System::CN64System ( CPlugins * Plugins, bool SavesReadOnly ) : CN64System::CN64System ( CPlugins * Plugins, bool SavesReadOnly ) :
m_MMU_VM(this,SavesReadOnly), m_MMU_VM(this,SavesReadOnly),
m_TLB(this), m_TLB(this),
@ -47,11 +27,25 @@ CN64System::CN64System ( CPlugins * Plugins, bool SavesReadOnly ) :
m_NextInstruction(0), m_NextInstruction(0),
m_JumpToLocation(0), m_JumpToLocation(0),
m_TLBLoadAddress(0), m_TLBLoadAddress(0),
m_TLBStoreAddress(0) m_TLBStoreAddress(0),
m_SaveUsing((SAVE_CHIP_TYPE)_Settings->LoadDword(Game_SaveChip)),
m_SystemType(SYSTEM_NTSC)
{ {
m_hPauseEvent = CreateEvent(NULL,true,false,NULL); m_hPauseEvent = CreateEvent(NULL,true,false,NULL);
m_Limitor.SetHertz(_Settings->LoadDword(Game_ScreenHertz)); m_Limitor.SetHertz(_Settings->LoadDword(Game_ScreenHertz));
m_Cheats.LoadCheats(!_Settings->LoadDword(Setting_RememberCheats)); m_Cheats.LoadCheats(!_Settings->LoadDword(Setting_RememberCheats));
switch (_Rom->GetCountry())
{
case Germany: case french: case Italian:
case Europe: case Spanish: case Australia:
case X_PAL: case Y_PAL:
m_SystemType = SYSTEM_PAL;
break;
default:
m_SystemType = SYSTEM_NTSC;
break;
}
} }
CN64System::~CN64System ( void ) { CN64System::~CN64System ( void ) {
@ -778,10 +772,11 @@ void CN64System::ExecuteCPU ( void )
m_EndEmulation = false; m_EndEmulation = false;
_Notify->RefreshMenu(); _Notify->RefreshMenu();
//Check me #ifndef EXTERNAL_RELEASE
// _Rom->m_RomFileSize = _Rom->GetRomSize(); LogOptions.GenerateLog = _Settings->LoadDword(Debugger_GenerateDebugLog);
LoadLogOptions(&LogOptions, FALSE);
m_SaveUsing = (SAVE_CHIP_TYPE)_Settings->LoadDword(Game_SaveChip); StartLog();
#endif
CInterpreterCPU::BuildCPU(); CInterpreterCPU::BuildCPU();
@ -795,7 +790,6 @@ void CN64System::ExecuteCPU ( void )
} }
void CN64System::ExecuteInterpret () { void CN64System::ExecuteInterpret () {
InitializeCPUCore();
SetActiveSystem(); SetActiveSystem();
CInterpreterCPU::ExecuteCPU(); CInterpreterCPU::ExecuteCPU();
} }
@ -803,7 +797,6 @@ void CN64System::ExecuteInterpret () {
void CN64System::ExecuteRecompiler () void CN64System::ExecuteRecompiler ()
{ {
//execute opcodes while no errors //execute opcodes while no errors
InitializeCPUCore();
m_Recomp = new CRecompiler(m_Profile,m_EndEmulation); m_Recomp = new CRecompiler(m_Profile,m_EndEmulation);
SetActiveSystem(); SetActiveSystem();
m_Recomp->Run(); m_Recomp->Run();
@ -824,7 +817,6 @@ void CN64System::ExecuteSyncCPU ()
m_SyncCPU->SetActiveSystem(); m_SyncCPU->SetActiveSystem();
SetActiveSystem(); SetActiveSystem();
InitializeCPUCore();
m_Recomp->Run(); m_Recomp->Run();
} }
@ -938,6 +930,7 @@ void CN64System::SyncCPU (CN64System * const SecondCPU) {
if (m_MMU_VM.Rdram()[0x00206970 + z] != SecondCPU->m_MMU_VM.Rdram()[0x00206970 + z]) if (m_MMU_VM.Rdram()[0x00206970 + z] != SecondCPU->m_MMU_VM.Rdram()[0x00206970 + z])
{ {
ErrorFound = true; ErrorFound = true;
break;
} }
}*/ }*/

View File

@ -33,8 +33,8 @@ public:
CProfiling m_Profile; CProfiling m_Profile;
CCheats m_Cheats; CCheats m_Cheats;
bool m_EndEmulation; bool m_EndEmulation;
enum SAVE_CHIP_TYPE m_SaveUsing; SAVE_CHIP_TYPE m_SaveUsing;
enum SystemType m_SystemType;; SystemType m_SystemType;
//Methods //Methods
static bool CN64System::RunFileImage ( const char * FileLoc ); static bool CN64System::RunFileImage ( const char * FileLoc );
@ -85,7 +85,6 @@ private:
static void StartEmulationThread ( FileImageInfo * Info ); static void StartEmulationThread ( FileImageInfo * Info );
static bool EmulationStarting ( HANDLE hThread, DWORD ThreadId ); static bool EmulationStarting ( HANDLE hThread, DWORD ThreadId );
void InitializeCPUCore( void );
void ExecuteCPU ( void ); void ExecuteCPU ( void );
void RefreshScreen ( void ); void RefreshScreen ( void );
bool InternalEvent ( void ); bool InternalEvent ( void );