CoreParameter: add enum CPUBackend

This commit is contained in:
Tillmann Karras 2014-04-28 21:00:35 +02:00
parent 20a16beabd
commit 311e9e655a
13 changed files with 44 additions and 32 deletions

View File

@ -49,7 +49,8 @@ struct ConfigCache
{ {
bool valid, bCPUThread, bSkipIdle, bEnableFPRF, bMMU, bDCBZOFF, m_EnableJIT, bDSPThread, bool valid, bCPUThread, bSkipIdle, bEnableFPRF, bMMU, bDCBZOFF, m_EnableJIT, bDSPThread,
bVBeamSpeedHack, bSyncGPU, bFastDiscSpeed, bMergeBlocks, bDSPHLE, bHLE_BS2, bTLBHack, bProgressive; bVBeamSpeedHack, bSyncGPU, bFastDiscSpeed, bMergeBlocks, bDSPHLE, bHLE_BS2, bTLBHack, bProgressive;
int iCPUCore, Volume; CPUBackend iCPUCore;
int Volume;
int iWiimoteSource[MAX_BBMOTES]; int iWiimoteSource[MAX_BBMOTES];
SIDevices Pads[MAX_SI_CHANNELS]; SIDevices Pads[MAX_SI_CHANNELS];
unsigned int framelimit, frameSkip; unsigned int framelimit, frameSkip;
@ -154,7 +155,7 @@ bool BootCore(const std::string& _rFilename)
core_section->Get("DSPHLE", &StartUp.bDSPHLE, StartUp.bDSPHLE); core_section->Get("DSPHLE", &StartUp.bDSPHLE, StartUp.bDSPHLE);
core_section->Get("DSPThread", &StartUp.bDSPThread, StartUp.bDSPThread); core_section->Get("DSPThread", &StartUp.bDSPThread, StartUp.bDSPThread);
core_section->Get("GFXBackend", &StartUp.m_strVideoBackend, StartUp.m_strVideoBackend); core_section->Get("GFXBackend", &StartUp.m_strVideoBackend, StartUp.m_strVideoBackend);
core_section->Get("CPUCore", &StartUp.iCPUCore, StartUp.iCPUCore); core_section->Get("CPUCore", (int*)&StartUp.iCPUCore, StartUp.iCPUCore);
core_section->Get("HLE_BS2", &StartUp.bHLE_BS2, StartUp.bHLE_BS2); core_section->Get("HLE_BS2", &StartUp.bHLE_BS2, StartUp.bHLE_BS2);
core_section->Get("ProgressiveScan", &StartUp.bProgressive, StartUp.bProgressive); core_section->Get("ProgressiveScan", &StartUp.bProgressive, StartUp.bProgressive);
if (core_section->Get("FrameLimit", &SConfig::GetInstance().m_Framelimit, SConfig::GetInstance().m_Framelimit)) if (core_section->Get("FrameLimit", &SConfig::GetInstance().m_Framelimit, SConfig::GetInstance().m_Framelimit))

View File

@ -479,11 +479,11 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, false); core->Get("HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, false);
#ifdef _M_X86 #ifdef _M_X86
core->Get("CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 1); core->Get("CPUCore", (int*)&m_LocalCoreStartupParameter.iCPUCore, CPU_JIT_X64);
#elif _M_ARM_32 #elif _M_ARM_32
core->Get("CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 3); core->Get("CPUCore", (int*)&m_LocalCoreStartupParameter.iCPUCore, CPU_JIT_ARM);
#else #else
core->Get("CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 0); core->Get("CPUCore", (int*)&m_LocalCoreStartupParameter.iCPUCore, CPU_INTERPRETER);
#endif #endif
core->Get("Fastmem", &m_LocalCoreStartupParameter.bFastmem, true); core->Get("Fastmem", &m_LocalCoreStartupParameter.bFastmem, true);
core->Get("DSPThread", &m_LocalCoreStartupParameter.bDSPThread, false); core->Get("DSPThread", &m_LocalCoreStartupParameter.bDSPThread, false);

View File

@ -424,11 +424,16 @@ void EmuThread()
CBoot::BootUp(); CBoot::BootUp();
// Setup our core, but can't use dynarec if we are compare server // Setup our core, but can't use dynarec if we are compare server
if (_CoreParameter.iCPUCore && (!_CoreParameter.bRunCompareServer || if (_CoreParameter.iCPUCore != CPU_INTERPRETER &&
_CoreParameter.bRunCompareClient)) (!_CoreParameter.bRunCompareServer ||
_CoreParameter.bRunCompareClient))
{
PowerPC::SetMode(PowerPC::MODE_JIT); PowerPC::SetMode(PowerPC::MODE_JIT);
}
else else
{
PowerPC::SetMode(PowerPC::MODE_INTERPRETER); PowerPC::SetMode(PowerPC::MODE_INTERPRETER);
}
// Update the window again because all stuff is initialized // Update the window again because all stuff is initialized
Host_UpdateDisasmDialog(); Host_UpdateDisasmDialog();

View File

@ -65,7 +65,7 @@ void SCoreStartupParameter::LoadDefaults()
iGDBPort = -1; iGDBPort = -1;
#endif #endif
iCPUCore = 1; iCPUCore = CPU_JIT_X64;
bCPUThread = false; bCPUThread = false;
bSkipIdle = false; bSkipIdle = false;
bRunCompareServer = false; bRunCompareServer = false;

View File

@ -83,6 +83,15 @@ enum Hotkey
NUM_HOTKEYS, NUM_HOTKEYS,
}; };
enum CPUBackend : u8
{
CPU_INTERPRETER = 0,
CPU_JIT_X64 = 1,
CPU_JIT_IL_X64 = 2,
CPU_JIT_ARM = 3,
CPU_JIT_IL_ARM = 4,
};
struct SCoreStartupParameter struct SCoreStartupParameter
{ {
void* hInstance; // HINSTANCE but we don't want to include <windows.h> void* hInstance; // HINSTANCE but we don't want to include <windows.h>
@ -95,11 +104,7 @@ struct SCoreStartupParameter
bool bAutomaticStart; bool bAutomaticStart;
bool bBootToPause; bool bBootToPause;
// 0 = Interpreter CPUBackend iCPUCore;
// 1 = Jit
// 2 = JitIL
// 3 = JIT ARM
int iCPUCore;
// JIT (shared between JIT and JITIL) // JIT (shared between JIT and JITIL)
bool bJITNoBlockCache, bJITBlockLinking; bool bJITNoBlockCache, bJITBlockLinking;

View File

@ -61,7 +61,7 @@ u64 g_recordingStartTime; // seconds since 1970 that recording started
bool bSaveConfig = false, bSkipIdle = false, bDualCore = false, bProgressive = false, bDSPHLE = false, bFastDiscSpeed = false; bool bSaveConfig = false, bSkipIdle = false, bDualCore = false, bProgressive = false, bDSPHLE = false, bFastDiscSpeed = false;
bool g_bClearSave = false, bSyncGPU = false, bNetPlay = false; bool g_bClearSave = false, bSyncGPU = false, bNetPlay = false;
std::string videoBackend = "unknown"; std::string videoBackend = "unknown";
int iCPUCore = 1; CPUBackend iCPUCore = CPU_JIT_X64;
bool g_bDiscChange = false; bool g_bDiscChange = false;
std::string g_discChange = ""; std::string g_discChange = "";
std::string author = ""; std::string author = "";
@ -356,7 +356,7 @@ bool IsFastDiscSpeed()
return bFastDiscSpeed; return bFastDiscSpeed;
} }
int GetCPUMode() CPUBackend GetCPUMode()
{ {
return iCPUCore; return iCPUCore;
} }

View File

@ -8,7 +8,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/Common.h" #include "Common/Common.h"
#include "Core/CoreParameter.h"
#include "InputCommon/GCPadStatus.h" #include "InputCommon/GCPadStatus.h"
namespace WiimoteEmu namespace WiimoteEmu
@ -99,7 +99,7 @@ struct DTMHeader
bool bProgressive; bool bProgressive;
bool bDSPHLE; bool bDSPHLE;
bool bFastDiscSpeed; bool bFastDiscSpeed;
u8 CPUCore; // 0 = interpreter, 1 = JIT, 2 = JITIL CPUBackend CPUCore;
bool bEFBAccessEnable; bool bEFBAccessEnable;
bool bEFBCopyEnable; bool bEFBCopyEnable;
bool bCopyEFBToTexture; bool bCopyEFBToTexture;
@ -144,7 +144,7 @@ bool IsProgressive();
bool IsSkipIdle(); bool IsSkipIdle();
bool IsDSPHLE(); bool IsDSPHLE();
bool IsFastDiscSpeed(); bool IsFastDiscSpeed();
int GetCPUMode(); CPUBackend GetCPUMode();
bool IsStartingFromClearSave(); bool IsStartingFromClearSave();
bool IsUsingMemcard(int memcard); bool IsUsingMemcard(int memcard);
bool IsSyncGPU(); bool IsSyncGPU();

View File

@ -266,7 +266,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
std::lock_guard<std::recursive_mutex> lkg(m_crit.game); std::lock_guard<std::recursive_mutex> lkg(m_crit.game);
packet >> m_current_game; packet >> m_current_game;
packet >> g_NetPlaySettings.m_CPUthread; packet >> g_NetPlaySettings.m_CPUthread;
packet >> g_NetPlaySettings.m_CPUcore; packet >> (u8&)g_NetPlaySettings.m_CPUcore;
packet >> g_NetPlaySettings.m_DSPEnableJIT; packet >> g_NetPlaySettings.m_DSPEnableJIT;
packet >> g_NetPlaySettings.m_DSPHLE; packet >> g_NetPlaySettings.m_DSPHLE;
packet >> g_NetPlaySettings.m_WriteToMemcard; packet >> g_NetPlaySettings.m_WriteToMemcard;

View File

@ -6,13 +6,13 @@
#include "Common/Common.h" #include "Common/Common.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Core/CoreParameter.h"
#include "Core/HW/EXI_Device.h" #include "Core/HW/EXI_Device.h"
struct NetSettings struct NetSettings
{ {
bool m_CPUthread; bool m_CPUthread;
int m_CPUcore; CPUBackend m_CPUcore;
bool m_DSPHLE; bool m_DSPHLE;
bool m_DSPEnableJIT; bool m_DSPEnableJIT;
bool m_WriteToMemcard; bool m_WriteToMemcard;
@ -28,7 +28,7 @@ struct Rpt : public std::vector<u8>
typedef std::vector<u8> NetWiimote; typedef std::vector<u8> NetWiimote;
#define NETPLAY_VERSION "Dolphin NetPlay 2014-01-08" #define NETPLAY_VERSION "Dolphin NetPlay 2014-06-13"
const int NETPLAY_INITIAL_GCTIME = 1272737767; const int NETPLAY_INITIAL_GCTIME = 1272737767;

View File

@ -548,7 +548,7 @@ bool NetPlayServer::StartGame(const std::string &path)
spac << (MessageId)NP_MSG_START_GAME; spac << (MessageId)NP_MSG_START_GAME;
spac << m_current_game; spac << m_current_game;
spac << m_settings.m_CPUthread; spac << m_settings.m_CPUthread;
spac << m_settings.m_CPUcore; spac << (u8)m_settings.m_CPUcore;
spac << m_settings.m_DSPEnableJIT; spac << m_settings.m_DSPEnableJIT;
spac << m_settings.m_DSPHLE; spac << m_settings.m_DSPHLE;
spac << m_settings.m_WriteToMemcard; spac << m_settings.m_WriteToMemcard;

View File

@ -135,7 +135,7 @@ void Init(int cpu_core)
switch (cpu_core) switch (cpu_core)
{ {
case 0: case CPU_INTERPRETER:
{ {
cpu_core_base = interpreter; cpu_core_base = interpreter;
break; break;

View File

@ -32,6 +32,7 @@
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "Core/CoreParameter.h"
#include "Core/Movie.h" #include "Core/Movie.h"
#include "Core/NetPlayProto.h" #include "Core/NetPlayProto.h"
#include "Core/HW/EXI.h" #include "Core/HW/EXI.h"
@ -57,17 +58,17 @@
struct CPUCore struct CPUCore
{ {
int CPUid; CPUBackend CPUid;
const char *name; const char *name;
}; };
const CPUCore CPUCores[] = { const CPUCore CPUCores[] = {
{0, wxTRANSLATE("Interpreter (VERY slow)")}, {CPU_INTERPRETER, wxTRANSLATE("Interpreter (VERY slow)")},
#ifdef _M_ARM #ifdef _M_ARM
{3, wxTRANSLATE("Arm JIT (experimental)")}, {CPU_JIT_ARM, wxTRANSLATE("Arm JIT (experimental)")},
{4, wxTRANSLATE("Arm JITIL (experimental)")}, {CPU_JIT_IL_ARM, wxTRANSLATE("Arm JITIL (experimental)")},
#else #else
{1, wxTRANSLATE("JIT Recompiler (recommended)")}, {CPU_JIT_X64, wxTRANSLATE("JIT Recompiler (recommended)")},
{2, wxTRANSLATE("JITIL Recompiler (slower, experimental)")}, {CPU_JIT_IL_X64, wxTRANSLATE("JITIL Recompiler (slower, experimental)")},
#endif #endif
}; };
@ -907,7 +908,7 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event)
SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore = CPUCores[CPUEngine->GetSelection()].CPUid; SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore = CPUCores[CPUEngine->GetSelection()].CPUid;
if (main_frame->g_pCodeWindow) if (main_frame->g_pCodeWindow)
main_frame->g_pCodeWindow->GetMenuBar()->Check(IDM_INTERPRETER, main_frame->g_pCodeWindow->GetMenuBar()->Check(IDM_INTERPRETER,
SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore?false:true); SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore == CPU_INTERPRETER);
break; break;
case ID_NTSCJ: case ID_NTSCJ:
SConfig::GetInstance().m_LocalCoreStartupParameter.bForceNTSCJ = _NTSCJ->IsChecked(); SConfig::GetInstance().m_LocalCoreStartupParameter.bForceNTSCJ = _NTSCJ->IsChecked();

View File

@ -369,7 +369,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
" and stepping to work as explained in the Developer Documentation. But it can be very" " and stepping to work as explained in the Developer Documentation. But it can be very"
" slow, perhaps slower than 1 fps."), " slow, perhaps slower than 1 fps."),
wxITEM_CHECK); wxITEM_CHECK);
interpreter->Check(_LocalCoreStartupParameter.iCPUCore == 0); interpreter->Check(_LocalCoreStartupParameter.iCPUCore == CPU_INTERPRETER);
pCoreMenu->AppendSeparator(); pCoreMenu->AppendSeparator();
pCoreMenu->Append(IDM_JITBLOCKLINKING, _("&JIT Block Linking off"), pCoreMenu->Append(IDM_JITBLOCKLINKING, _("&JIT Block Linking off"),