some clean up but there are too many references to g_CoreStartupParameter directly:(
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1912 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
8fdf439c9a
commit
a6447d1758
|
@ -36,6 +36,7 @@
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
#include "ARDecrypt.h"
|
#include "ARDecrypt.h"
|
||||||
#include "LogManager.h"
|
#include "LogManager.h"
|
||||||
|
#include "ConfigManager.h"
|
||||||
|
|
||||||
namespace ActionReplay
|
namespace ActionReplay
|
||||||
{
|
{
|
||||||
|
@ -73,7 +74,8 @@ bool SetLineSkip(int codetype, u8 subtype, bool *pSkip, bool skip, int *pCount);
|
||||||
void LoadCodes(IniFile &ini, bool forceLoad)
|
void LoadCodes(IniFile &ini, bool forceLoad)
|
||||||
{
|
{
|
||||||
// Parses the Action Replay section of a game ini file.
|
// Parses the Action Replay section of a game ini file.
|
||||||
if (!Core::GetStartupParameter().bEnableCheats && !forceLoad)
|
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats
|
||||||
|
&& !forceLoad)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::vector<std::string> lines;
|
std::vector<std::string> lines;
|
||||||
|
@ -197,7 +199,7 @@ void LogInfo(const char *format, ...)
|
||||||
|
|
||||||
void RunAllActive()
|
void RunAllActive()
|
||||||
{
|
{
|
||||||
if (Core::GetStartupParameter().bEnableCheats) {
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats) {
|
||||||
for (std::vector<ARCode>::iterator i = activeCodes.begin(); i != activeCodes.end(); ++i)
|
for (std::vector<ARCode>::iterator i = activeCodes.begin(); i != activeCodes.end(); ++i)
|
||||||
{
|
{
|
||||||
if (i->active)
|
if (i->active)
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#include "../PowerPC/SymbolDB.h"
|
#include "../PowerPC/SymbolDB.h"
|
||||||
#include "../MemTools.h"
|
#include "../MemTools.h"
|
||||||
|
|
||||||
|
#include "ConfigManager.h"
|
||||||
#include "VolumeCreator.h" // DiscIO
|
#include "VolumeCreator.h" // DiscIO
|
||||||
|
|
||||||
void CBoot::Load_FST(bool _bIsWii)
|
void CBoot::Load_FST(bool _bIsWii)
|
||||||
|
@ -91,7 +92,7 @@ std::string CBoot::GenerateMapFilename()
|
||||||
std::string strMapFilename;
|
std::string strMapFilename;
|
||||||
BuildCompleteFilename(strMapFilename, strDriveDirectory, strFullfilename);
|
BuildCompleteFilename(strMapFilename, strDriveDirectory, strFullfilename);
|
||||||
*/
|
*/
|
||||||
return FULL_MAPS_DIR + Core::GetStartupParameter().GetUniqueID() + ".map";
|
return FULL_MAPS_DIR + SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID() + ".map";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBoot::LoadMapFromFilename(const std::string &_rFilename, const char *_gameID)
|
bool CBoot::LoadMapFromFilename(const std::string &_rFilename, const char *_gameID)
|
||||||
|
@ -154,9 +155,11 @@ bool CBoot::Load_BIOS(const std::string& _rBiosFilename)
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Third boot step after BootManager and Core. See Call schedule in BootManager.cpp
|
// Third boot step after BootManager and Core. See Call schedule in BootManager.cpp
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
bool CBoot::BootUp(const SCoreStartupParameter& _StartupPara)
|
bool CBoot::BootUp()
|
||||||
{
|
{
|
||||||
const bool bDebugIsoBootup = false;
|
const bool bDebugIsoBootup = false;
|
||||||
|
SCoreStartupParameter& _StartupPara =
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
|
|
||||||
g_symbolDB.Clear();
|
g_symbolDB.Clear();
|
||||||
VideoInterface::PreInit(_StartupPara.bNTSC);
|
VideoInterface::PreInit(_StartupPara.bNTSC);
|
||||||
|
@ -171,7 +174,7 @@ bool CBoot::BootUp(const SCoreStartupParameter& _StartupPara)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
bool isoWii = DiscIO::IsVolumeWiiDisc(pVolume);
|
bool isoWii = DiscIO::IsVolumeWiiDisc(pVolume);
|
||||||
if (isoWii != Core::GetStartupParameter().bWii)
|
if (isoWii != _StartupPara.bWii)
|
||||||
{
|
{
|
||||||
PanicAlert("Warning - starting ISO in wrong console mode!");
|
PanicAlert("Warning - starting ISO in wrong console mode!");
|
||||||
}
|
}
|
||||||
|
@ -192,7 +195,7 @@ bool CBoot::BootUp(const SCoreStartupParameter& _StartupPara)
|
||||||
EmulatedBIOS(bDebugIsoBootup);
|
EmulatedBIOS(bDebugIsoBootup);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Core::g_CoreStartupParameter.bWii = true;
|
_StartupPara.bWii = true;
|
||||||
EmulatedBIOS_Wii(bDebugIsoBootup);
|
EmulatedBIOS_Wii(bDebugIsoBootup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -206,7 +209,7 @@ bool CBoot::BootUp(const SCoreStartupParameter& _StartupPara)
|
||||||
EmulatedBIOS(bDebugIsoBootup);
|
EmulatedBIOS(bDebugIsoBootup);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Core::g_CoreStartupParameter.bWii = true;
|
_StartupPara.bWii = true;
|
||||||
EmulatedBIOS_Wii(bDebugIsoBootup);
|
EmulatedBIOS_Wii(bDebugIsoBootup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,7 +251,7 @@ bool CBoot::BootUp(const SCoreStartupParameter& _StartupPara)
|
||||||
|
|
||||||
// Check if we have gotten a Wii file or not
|
// Check if we have gotten a Wii file or not
|
||||||
bool elfWii = IsElfWii(_StartupPara.m_strFilename.c_str());
|
bool elfWii = IsElfWii(_StartupPara.m_strFilename.c_str());
|
||||||
if (elfWii != Core::GetStartupParameter().bWii)
|
if (elfWii != _StartupPara.bWii)
|
||||||
{
|
{
|
||||||
PanicAlert("Warning - starting ELF in wrong console mode!");
|
PanicAlert("Warning - starting ELF in wrong console mode!");
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
BOOT_BIOS
|
BOOT_BIOS
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool BootUp(const SCoreStartupParameter& _StartupPara);
|
static bool BootUp();
|
||||||
static bool IsElfWii(const char *filename);
|
static bool IsElfWii(const char *filename);
|
||||||
|
|
||||||
static std::string GenerateMapFilename();
|
static std::string GenerateMapFilename();
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "../PatchEngine.h"
|
#include "../PatchEngine.h"
|
||||||
#include "../MemTools.h"
|
#include "../MemTools.h"
|
||||||
|
|
||||||
|
#include "ConfigManager.h"
|
||||||
#include "VolumeCreator.h"
|
#include "VolumeCreator.h"
|
||||||
#include "Boot.h"
|
#include "Boot.h"
|
||||||
|
|
||||||
|
@ -152,10 +153,11 @@ void CBoot::EmulatedBIOS(bool _bDebug)
|
||||||
Memory::Write_U32(0x1cf7c580, 0x800000FC);
|
Memory::Write_U32(0x1cf7c580, 0x800000FC);
|
||||||
|
|
||||||
// fake the VI Init of the BIOS
|
// fake the VI Init of the BIOS
|
||||||
Memory::Write_U32(Core::g_CoreStartupParameter.bNTSC ? 0 : 1, 0x800000CC);
|
Memory::Write_U32(SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC
|
||||||
|
? 0 : 1, 0x800000CC);
|
||||||
|
|
||||||
// preset time base ticks
|
// preset time base ticks
|
||||||
Memory::Write_U64( (u64)CEXIIPL::GetGCTime() * (u64)40500000, 0x800030D8);
|
Memory::Write_U64( (u64)CEXIIPL::GetGCTime() * (u64)40500000, 0x800030D8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -289,8 +291,8 @@ bool CBoot::EmulatedBIOS_Wii(bool _bDebug)
|
||||||
Memory::Write_U8(0x00, 0x00000007); // DVDInit
|
Memory::Write_U8(0x00, 0x00000007); // DVDInit
|
||||||
Memory::Write_U16(0x0000, 0x000030e0); // PADInit
|
Memory::Write_U16(0x0000, 0x000030e0); // PADInit
|
||||||
|
|
||||||
// Fake the VI Init of the BIOS
|
// Fake the VI Init of the BIOS
|
||||||
Memory::Write_U32(Core::g_CoreStartupParameter.bNTSC ? 0 : 1, 0x000000CC);
|
Memory::Write_U32(SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC ? 0 : 1, 0x000000CC);
|
||||||
|
|
||||||
// Clear exception handler. Why? Don't we begin with only zeroes?
|
// Clear exception handler. Why? Don't we begin with only zeroes?
|
||||||
for (int i = 0x3000; i <= 0x3038; i += 4)
|
for (int i = 0x3000; i <= 0x3038; i += 4)
|
||||||
|
|
|
@ -106,9 +106,7 @@ bool g_bHwInit = false;
|
||||||
bool g_bRealWiimote = false;
|
bool g_bRealWiimote = false;
|
||||||
HWND g_pWindowHandle = NULL;
|
HWND g_pWindowHandle = NULL;
|
||||||
Common::Thread* g_pThread = NULL;
|
Common::Thread* g_pThread = NULL;
|
||||||
|
SCoreStartupParameter g_CoreStartupParameter;
|
||||||
SCoreStartupParameter g_CoreStartupParameter; //uck
|
|
||||||
|
|
||||||
Common::Event emuThreadGoing;
|
Common::Event emuThreadGoing;
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
|
|
||||||
|
@ -139,11 +137,6 @@ void Callback_DebuggerBreak()
|
||||||
CCPU::EnableStepping(true);
|
CCPU::EnableStepping(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
const SCoreStartupParameter& GetStartupParameter()
|
|
||||||
{
|
|
||||||
return g_CoreStartupParameter;
|
|
||||||
}
|
|
||||||
|
|
||||||
void* GetWindowHandle()
|
void* GetWindowHandle()
|
||||||
{
|
{
|
||||||
return g_pWindowHandle;
|
return g_pWindowHandle;
|
||||||
|
@ -159,7 +152,7 @@ bool GetRealWiimote()
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// This is called from the GUI thread. See the booting call schedule in BootManager.cpp
|
// This is called from the GUI thread. See the booting call schedule in BootManager.cpp
|
||||||
//
|
//
|
||||||
bool Init(const SCoreStartupParameter _CoreParameter)
|
bool Init()
|
||||||
{
|
{
|
||||||
if (g_pThread != NULL) {
|
if (g_pThread != NULL) {
|
||||||
PanicAlert("ERROR: Emu Thread already running. Report this bug.");
|
PanicAlert("ERROR: Emu Thread already running. Report this bug.");
|
||||||
|
@ -167,7 +160,9 @@ bool Init(const SCoreStartupParameter _CoreParameter)
|
||||||
}
|
}
|
||||||
|
|
||||||
CPluginManager &pManager = CPluginManager::GetInstance();
|
CPluginManager &pManager = CPluginManager::GetInstance();
|
||||||
|
SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
|
|
||||||
|
g_CoreStartupParameter = _CoreParameter;
|
||||||
LogManager::Init();
|
LogManager::Init();
|
||||||
Host_SetWaitCursor(true);
|
Host_SetWaitCursor(true);
|
||||||
|
|
||||||
|
@ -177,11 +172,9 @@ bool Init(const SCoreStartupParameter _CoreParameter)
|
||||||
if (!pManager.InitPlugins())
|
if (!pManager.InitPlugins())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
g_CoreStartupParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
|
||||||
|
|
||||||
emuThreadGoing.Init();
|
emuThreadGoing.Init();
|
||||||
// This will execute EmuThread() further down in this file
|
// This will execute EmuThread() further down in this file
|
||||||
g_pThread = new Common::Thread(EmuThread, (void*)&g_CoreStartupParameter);
|
g_pThread = new Common::Thread(EmuThread, NULL);
|
||||||
emuThreadGoing.Wait();
|
emuThreadGoing.Wait();
|
||||||
emuThreadGoing.Shutdown();
|
emuThreadGoing.Shutdown();
|
||||||
// all right ... here we go
|
// all right ... here we go
|
||||||
|
@ -237,8 +230,9 @@ THREAD_RETURN CpuThread(void *pArg)
|
||||||
{
|
{
|
||||||
Common::SetCurrentThreadName("CPU thread");
|
Common::SetCurrentThreadName("CPU thread");
|
||||||
|
|
||||||
const SCoreStartupParameter& _CoreParameter = g_CoreStartupParameter;
|
const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
if (!g_CoreStartupParameter.bUseDualCore)
|
|
||||||
|
if (!_CoreParameter.bUseDualCore)
|
||||||
{
|
{
|
||||||
//wglMakeCurrent
|
//wglMakeCurrent
|
||||||
CPluginManager::GetInstance().GetVideo()->Video_Prepare();
|
CPluginManager::GetInstance().GetVideo()->Video_Prepare();
|
||||||
|
@ -287,7 +281,8 @@ THREAD_RETURN CpuThread(void *pArg)
|
||||||
THREAD_RETURN EmuThread(void *pArg)
|
THREAD_RETURN EmuThread(void *pArg)
|
||||||
{
|
{
|
||||||
Common::SetCurrentThreadName("Emuthread - starting");
|
Common::SetCurrentThreadName("Emuthread - starting");
|
||||||
const SCoreStartupParameter _CoreParameter = *(SCoreStartupParameter*)pArg;
|
const SCoreStartupParameter _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
|
|
||||||
CPluginManager &pm = CPluginManager::GetInstance();
|
CPluginManager &pm = CPluginManager::GetInstance();
|
||||||
if (_CoreParameter.bLockThreads)
|
if (_CoreParameter.bLockThreads)
|
||||||
Common::Thread::SetCurrentThreadAffinity(2); // Force to second core
|
Common::Thread::SetCurrentThreadAffinity(2); // Force to second core
|
||||||
|
@ -359,7 +354,7 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||||
|
|
||||||
// Load GCM/DOL/ELF whatever ... we boot with the interpreter core
|
// Load GCM/DOL/ELF whatever ... we boot with the interpreter core
|
||||||
PowerPC::SetMode(PowerPC::MODE_INTERPRETER);
|
PowerPC::SetMode(PowerPC::MODE_INTERPRETER);
|
||||||
CBoot::BootUp(_CoreParameter);
|
CBoot::BootUp();
|
||||||
|
|
||||||
if( g_pUpdateFPSDisplay != NULL )
|
if( g_pUpdateFPSDisplay != NULL )
|
||||||
g_pUpdateFPSDisplay("Loading...");
|
g_pUpdateFPSDisplay("Loading...");
|
||||||
|
@ -387,7 +382,7 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||||
// ENTER THE VIDEO THREAD LOOP
|
// ENTER THE VIDEO THREAD LOOP
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
if (!Core::GetStartupParameter().bUseDualCore)
|
if (!_CoreParameter.bUseDualCore)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
cpuThread = new Common::Thread(CpuThread, pArg);
|
cpuThread = new Common::Thread(CpuThread, pArg);
|
||||||
|
@ -528,11 +523,13 @@ void Callback_VideoLog(const TCHAR *_szMessage, int _bDoBreak)
|
||||||
// We do not touch anything outside this function here
|
// We do not touch anything outside this function here
|
||||||
void Callback_VideoCopiedToXFB()
|
void Callback_VideoCopiedToXFB()
|
||||||
{
|
{
|
||||||
|
SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
//count FPS
|
//count FPS
|
||||||
static Common::Timer Timer;
|
static Common::Timer Timer;
|
||||||
static u32 frames = 0;
|
static u32 frames = 0;
|
||||||
static u64 ticks = 0;
|
static u64 ticks = 0;
|
||||||
static u64 idleTicks = 0;
|
static u64 idleTicks = 0;
|
||||||
|
|
||||||
frames++;
|
frames++;
|
||||||
|
|
||||||
if (Timer.GetTimeDifference() >= 1000)
|
if (Timer.GetTimeDifference() >= 1000)
|
||||||
|
@ -550,15 +547,15 @@ void Callback_VideoCopiedToXFB()
|
||||||
char temp[256];
|
char temp[256];
|
||||||
sprintf(temp, "FPS:%8.2f - Core: %s | %s - Speed: %i MHz [Real: %i + IdleSkip: %i] / %i MHz",
|
sprintf(temp, "FPS:%8.2f - Core: %s | %s - Speed: %i MHz [Real: %i + IdleSkip: %i] / %i MHz",
|
||||||
(float)frames / t,
|
(float)frames / t,
|
||||||
g_CoreStartupParameter.bUseJIT ? "JIT" : "Interpreter",
|
_CoreParameter.bUseJIT ? "JIT" : "Interpreter",
|
||||||
g_CoreStartupParameter.bUseDualCore ? "DC" : "SC",
|
_CoreParameter.bUseDualCore ? "DC" : "SC",
|
||||||
(int)(diff),
|
(int)(diff),
|
||||||
(int)(diff-idleDiff),
|
(int)(diff-idleDiff),
|
||||||
(int)(idleDiff),
|
(int)(idleDiff),
|
||||||
SystemTimers::GetTicksPerSecond()/1000000);
|
SystemTimers::GetTicksPerSecond()/1000000);
|
||||||
|
|
||||||
if (g_pUpdateFPSDisplay != NULL)
|
if (g_pUpdateFPSDisplay != NULL)
|
||||||
g_pUpdateFPSDisplay(temp);
|
g_pUpdateFPSDisplay(temp);
|
||||||
|
|
||||||
Host_UpdateStatusBar(temp);
|
Host_UpdateStatusBar(temp);
|
||||||
|
|
||||||
|
@ -600,8 +597,9 @@ void Callback_PADLog(const TCHAR* _szMessage)
|
||||||
//std::string Callback_ISOName(void)
|
//std::string Callback_ISOName(void)
|
||||||
const char *Callback_ISOName(void)
|
const char *Callback_ISOName(void)
|
||||||
{
|
{
|
||||||
if (g_CoreStartupParameter.m_strName.length() > 0)
|
SCoreStartupParameter& params = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
return (const char *)g_CoreStartupParameter.m_strName.c_str();
|
if (params.m_strName.length() > 0)
|
||||||
|
return (const char *)params.m_strName.c_str();
|
||||||
else
|
else
|
||||||
return (const char *)"";
|
return (const char *)"";
|
||||||
}
|
}
|
||||||
|
@ -630,4 +628,10 @@ void Callback_WiimoteLog(const TCHAR* _szMessage, int _v)
|
||||||
LOGV(WII_IPC_WIIMOTE, _v, _szMessage);
|
LOGV(WII_IPC_WIIMOTE, _v, _szMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Get rid of at some point
|
||||||
|
const SCoreStartupParameter& GetStartupParameter() {
|
||||||
|
return SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
|
}
|
||||||
|
|
||||||
} // end of namespace Core
|
} // end of namespace Core
|
||||||
|
|
||||||
|
|
|
@ -41,35 +41,36 @@ namespace Core
|
||||||
};
|
};
|
||||||
|
|
||||||
// Init core
|
// Init core
|
||||||
bool Init(const SCoreStartupParameter _CoreParameter);
|
bool Init();
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|
||||||
bool SetState(EState _State);
|
bool SetState(EState _State);
|
||||||
EState GetState();
|
EState GetState();
|
||||||
|
|
||||||
// Save/Load state
|
// Save/Load state
|
||||||
void SaveState();
|
void SaveState();
|
||||||
void LoadState();
|
void LoadState();
|
||||||
|
|
||||||
// Get core parameters
|
// Get core parameters kill use SConfig instead
|
||||||
extern SCoreStartupParameter g_CoreStartupParameter; //uck
|
|
||||||
const SCoreStartupParameter& GetStartupParameter();
|
const SCoreStartupParameter& GetStartupParameter();
|
||||||
|
extern SCoreStartupParameter g_CoreStartupParameter;
|
||||||
|
|
||||||
|
|
||||||
// Make a screen shot
|
// Make a screen shot
|
||||||
bool MakeScreenshot(const std::string& _rFilename);
|
bool MakeScreenshot(const std::string& _rFilename);
|
||||||
void* GetWindowHandle();
|
void* GetWindowHandle();
|
||||||
bool GetRealWiimote();
|
bool GetRealWiimote();
|
||||||
|
|
||||||
extern bool bReadTrace;
|
extern bool bReadTrace;
|
||||||
extern bool bWriteTrace;
|
extern bool bWriteTrace;
|
||||||
|
|
||||||
void StartTrace(bool write);
|
void StartTrace(bool write);
|
||||||
void DisplayMessage(const std::string &message, int time_in_ms); // This displays messages in a user-visible way.
|
void DisplayMessage(const std::string &message, int time_in_ms); // This displays messages in a user-visible way.
|
||||||
void DisplayMessage(const char *message, int time_in_ms); // This displays messages in a user-visible way.
|
void DisplayMessage(const char *message, int time_in_ms); // This displays messages in a user-visible way.
|
||||||
|
|
||||||
int SyncTrace();
|
int SyncTrace();
|
||||||
void SetBlockStart(u32 addr);
|
void SetBlockStart(u32 addr);
|
||||||
void StopTrace();
|
void StopTrace();
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
#include "../PowerPC/PowerPC.h"
|
#include "../PowerPC/PowerPC.h"
|
||||||
#include "../CoreTiming.h"
|
#include "../CoreTiming.h"
|
||||||
#include "../PluginManager.h"
|
#include "../PluginManager.h"
|
||||||
|
#include "../ConfigManager.h"
|
||||||
#include "MathUtil.h"
|
#include "MathUtil.h"
|
||||||
#include "Thread.h"
|
#include "Thread.h"
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ void Read16(u16& _rReturnValue, const u32 _Address)
|
||||||
|
|
||||||
bool AllowIdleSkipping()
|
bool AllowIdleSkipping()
|
||||||
{
|
{
|
||||||
return !Core::g_CoreStartupParameter.bUseDualCore || (!m_CPCtrlReg.CPIntEnable && !m_CPCtrlReg.BPEnable);
|
return !SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore || (!m_CPCtrlReg.CPIntEnable && !m_CPCtrlReg.BPEnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write16(const u16 _Value, const u32 _Address)
|
void Write16(const u16 _Value, const u32 _Address)
|
||||||
|
@ -342,7 +342,7 @@ void Write16(const u16 _Value, const u32 _Address)
|
||||||
//Spin until queue is empty - it WILL become empty because this is the only thread
|
//Spin until queue is empty - it WILL become empty because this is the only thread
|
||||||
//that submits data
|
//that submits data
|
||||||
|
|
||||||
if (Core::g_CoreStartupParameter.bUseDualCore)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore)
|
||||||
{
|
{
|
||||||
// Force complete fifo flush if we attempt to set/reset the fifo (API GXSetGPFifo or equivalent)
|
// Force complete fifo flush if we attempt to set/reset the fifo (API GXSetGPFifo or equivalent)
|
||||||
// It's kind of an API hack but it works for lots of games... and I hope it's the same way for every games.
|
// It's kind of an API hack but it works for lots of games... and I hope it's the same way for every games.
|
||||||
|
@ -551,7 +551,7 @@ void Write16(const u16 _Value, const u32 _Address)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(mb2): better. Check if it help: avoid CPReadPointer overwrites when stupidly done like in Super Monkey Ball
|
// TODO(mb2): better. Check if it help: avoid CPReadPointer overwrites when stupidly done like in Super Monkey Ball
|
||||||
if ((!fifo.bFF_GPReadEnable && fifo.CPReadIdle) || !Core::g_CoreStartupParameter.bUseDualCore) // TOCHECK(mb2): check again if thread safe?
|
if ((!fifo.bFF_GPReadEnable && fifo.CPReadIdle) || !SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore) // TOCHECK(mb2): check again if thread safe?
|
||||||
UpdateFifoRegister();
|
UpdateFifoRegister();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -572,7 +572,7 @@ void STACKALIGN GatherPipeBursted()
|
||||||
if (!fifo.bFF_GPLinkEnable)
|
if (!fifo.bFF_GPLinkEnable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Core::g_CoreStartupParameter.bUseDualCore)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore)
|
||||||
{
|
{
|
||||||
// update the fifo-pointer
|
// update the fifo-pointer
|
||||||
fifo.CPWritePointer += GPFifo::GATHER_PIPE_SIZE;
|
fifo.CPWritePointer += GPFifo::GATHER_PIPE_SIZE;
|
||||||
|
@ -703,7 +703,7 @@ void UpdateFifoRegister()
|
||||||
//fifo.CPReadWriteDistance = dist;
|
//fifo.CPReadWriteDistance = dist;
|
||||||
Common::SyncInterlockedExchange((LONG*)&fifo.CPReadWriteDistance, dist);
|
Common::SyncInterlockedExchange((LONG*)&fifo.CPReadWriteDistance, dist);
|
||||||
|
|
||||||
if (!Core::g_CoreStartupParameter.bUseDualCore)
|
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore)
|
||||||
CatchUpGPU();
|
CatchUpGPU();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "AudioInterface.h"
|
#include "AudioInterface.h"
|
||||||
#include "../PowerPC/PowerPC.h"
|
#include "../PowerPC/PowerPC.h"
|
||||||
#include "../PluginManager.h"
|
#include "../PluginManager.h"
|
||||||
|
#include "../ConfigManager.h"
|
||||||
|
|
||||||
namespace DSP
|
namespace DSP
|
||||||
{
|
{
|
||||||
|
@ -178,7 +179,7 @@ u16 g_AR_MODE = 0x43; // 0x23 -> Zelda standard mode (standard ARAM access ??)
|
||||||
|
|
||||||
void DoState(PointerWrap &p)
|
void DoState(PointerWrap &p)
|
||||||
{
|
{
|
||||||
if (!Core::GetStartupParameter().bWii)
|
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
||||||
p.DoArray(g_ARAM, ARAM_SIZE);
|
p.DoArray(g_ARAM, ARAM_SIZE);
|
||||||
p.Do(g_dspState);
|
p.Do(g_dspState);
|
||||||
p.Do(g_audioDMA);
|
p.Do(g_audioDMA);
|
||||||
|
@ -203,7 +204,7 @@ void GenerateDSPInterrupt_Wrapper(u64 userdata, int cyclesLate)
|
||||||
|
|
||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
if (Core::GetStartupParameter().bWii)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
||||||
{
|
{
|
||||||
// On the Wii, ARAM is simply mapped to EXRAM.
|
// On the Wii, ARAM is simply mapped to EXRAM.
|
||||||
g_ARAM = Memory::GetPointer(0x00000000);
|
g_ARAM = Memory::GetPointer(0x00000000);
|
||||||
|
@ -220,7 +221,7 @@ void Init()
|
||||||
|
|
||||||
void Shutdown()
|
void Shutdown()
|
||||||
{
|
{
|
||||||
if (!Core::GetStartupParameter().bWii)
|
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
||||||
FreeMemoryPages(g_ARAM, ARAM_SIZE);
|
FreeMemoryPages(g_ARAM, ARAM_SIZE);
|
||||||
g_ARAM = NULL;
|
g_ARAM = NULL;
|
||||||
}
|
}
|
||||||
|
@ -626,7 +627,7 @@ u8 ReadARAM(u32 _iAddress)
|
||||||
//LOGV(DSPINTERFACE, 0, "ARAM (r) 0x%08x", _iAddress);
|
//LOGV(DSPINTERFACE, 0, "ARAM (r) 0x%08x", _iAddress);
|
||||||
|
|
||||||
// _dbg_assert_(DSPINTERFACE,(_iAddress) < ARAM_SIZE);
|
// _dbg_assert_(DSPINTERFACE,(_iAddress) < ARAM_SIZE);
|
||||||
if(Core::GetStartupParameter().bWii)
|
if(SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
||||||
{
|
{
|
||||||
//LOGV(DSPINTERFACE, 0, "ARAM (r) 0x%08x 0x%08x 0x%08x", WII_MASK, _iAddress, (_iAddress & WII_MASK));
|
//LOGV(DSPINTERFACE, 0, "ARAM (r) 0x%08x 0x%08x 0x%08x", WII_MASK, _iAddress, (_iAddress & WII_MASK));
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "EXI_DeviceEthernet.h"
|
#include "EXI_DeviceEthernet.h"
|
||||||
|
|
||||||
#include "../Core.h"
|
#include "../Core.h"
|
||||||
|
#include "../ConfigManager.h"
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// --- interface IEXIDevice ---
|
// --- interface IEXIDevice ---
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -131,11 +131,11 @@ IEXIDevice* EXIDevice_Create(TEXIDevices _EXIDevice)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EXIDEVICE_MEMORYCARD_A:
|
case EXIDEVICE_MEMORYCARD_A:
|
||||||
return new CEXIMemoryCard("MemoryCardA", Core::GetStartupParameter().m_strMemoryCardA, 0);
|
return new CEXIMemoryCard("MemoryCardA", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strMemoryCardA, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EXIDEVICE_MEMORYCARD_B:
|
case EXIDEVICE_MEMORYCARD_B:
|
||||||
return new CEXIMemoryCard("MemoryCardB", Core::GetStartupParameter().m_strMemoryCardB, 1);
|
return new CEXIMemoryCard("MemoryCardB", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strMemoryCardB, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EXIDEVICE_IPL:
|
case EXIDEVICE_IPL:
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
#include "EXI_DeviceIPL.h"
|
#include "EXI_DeviceIPL.h"
|
||||||
#include "../Core.h"
|
#include "../Core.h"
|
||||||
|
#include "../ConfigManager.h"
|
||||||
|
|
||||||
#include "MemoryUtil.h"
|
#include "MemoryUtil.h"
|
||||||
|
|
||||||
// english
|
// english
|
||||||
|
@ -109,7 +111,7 @@ CEXIIPL::CEXIIPL() :
|
||||||
memset(m_RTC, 0, sizeof(m_RTC));
|
memset(m_RTC, 0, sizeof(m_RTC));
|
||||||
|
|
||||||
// SRAM
|
// SRAM
|
||||||
pStream = fopen(Core::GetStartupParameter().m_strSRAM.c_str(), "rb");
|
pStream = fopen(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strSRAM.c_str(), "rb");
|
||||||
if (pStream != NULL)
|
if (pStream != NULL)
|
||||||
{
|
{
|
||||||
fread(m_SRAM, 1, 64, pStream);
|
fread(m_SRAM, 1, 64, pStream);
|
||||||
|
@ -120,7 +122,7 @@ CEXIIPL::CEXIIPL() :
|
||||||
memcpy(m_SRAM, sram_dump, sizeof(m_SRAM));
|
memcpy(m_SRAM, sram_dump, sizeof(m_SRAM));
|
||||||
}
|
}
|
||||||
// We Overwrite it here since it's possible on the GC to change the language as you please
|
// We Overwrite it here since it's possible on the GC to change the language as you please
|
||||||
m_SRAM[0x12] = Core::GetStartupParameter().SelectedLanguage;
|
m_SRAM[0x12] = SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage;
|
||||||
|
|
||||||
WriteProtectMemory(m_pIPL, ROM_SIZE);
|
WriteProtectMemory(m_pIPL, ROM_SIZE);
|
||||||
m_uAddress = 0;
|
m_uAddress = 0;
|
||||||
|
@ -140,7 +142,7 @@ CEXIIPL::~CEXIIPL()
|
||||||
}
|
}
|
||||||
|
|
||||||
// SRAM
|
// SRAM
|
||||||
FILE *file = fopen(Core::GetStartupParameter().m_strSRAM.c_str(), "wb");
|
FILE *file = fopen(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strSRAM.c_str(), "wb");
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
fwrite(m_SRAM, 1, 64, file);
|
fwrite(m_SRAM, 1, 64, file);
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include "VideoInterface.h"
|
#include "VideoInterface.h"
|
||||||
#include "WII_IPC.h"
|
#include "WII_IPC.h"
|
||||||
#include "../PluginManager.h"
|
#include "../PluginManager.h"
|
||||||
|
#include "../ConfigManager.h"
|
||||||
#include "../CoreTiming.h"
|
#include "../CoreTiming.h"
|
||||||
#include "SystemTimers.h"
|
#include "SystemTimers.h"
|
||||||
#include "../IPC_HLE/WII_IPC_HLE.h"
|
#include "../IPC_HLE/WII_IPC_HLE.h"
|
||||||
|
@ -63,7 +64,7 @@ namespace HW
|
||||||
ExpansionInterface::Init();
|
ExpansionInterface::Init();
|
||||||
CCPU::Init();
|
CCPU::Init();
|
||||||
SystemTimers::Init();
|
SystemTimers::Init();
|
||||||
if (Core::GetStartupParameter().bWii)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
||||||
{
|
{
|
||||||
WII_IPC_HLE_Interface::Init();
|
WII_IPC_HLE_Interface::Init();
|
||||||
WII_IPCInterface::Init();
|
WII_IPCInterface::Init();
|
||||||
|
@ -81,7 +82,7 @@ namespace HW
|
||||||
SerialInterface::Shutdown();
|
SerialInterface::Shutdown();
|
||||||
AudioInterface::Shutdown();
|
AudioInterface::Shutdown();
|
||||||
|
|
||||||
if (Core::GetStartupParameter().bWii)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
||||||
{
|
{
|
||||||
WII_IPC_HLE_Interface::Shutdown();
|
WII_IPC_HLE_Interface::Shutdown();
|
||||||
WII_IPCInterface::Shutdown();
|
WII_IPCInterface::Shutdown();
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "MemoryInterface.h"
|
#include "MemoryInterface.h"
|
||||||
#include "WII_IOB.h"
|
#include "WII_IOB.h"
|
||||||
#include "WII_IPC.h"
|
#include "WII_IPC.h"
|
||||||
|
#include "../ConfigManager.h"
|
||||||
#include "../Debugger/Debugger_BreakPoints.h"
|
#include "../Debugger/Debugger_BreakPoints.h"
|
||||||
#include "../Debugger/Debugger_SymbolMap.h"
|
#include "../Debugger/Debugger_SymbolMap.h"
|
||||||
|
|
||||||
|
@ -1091,7 +1091,7 @@ bool IsRAMAddress(const u32 addr, bool allow_locked_cache)
|
||||||
case 0x10:
|
case 0x10:
|
||||||
case 0x90:
|
case 0x90:
|
||||||
case 0xD0:
|
case 0xD0:
|
||||||
if (Core::g_CoreStartupParameter.bWii && (addr & 0x0FFFFFFF) < EXRAM_SIZE)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii && (addr & 0x0FFFFFFF) < EXRAM_SIZE)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "CommandProcessor.h"
|
#include "CommandProcessor.h"
|
||||||
#include "CPU.h"
|
#include "CPU.h"
|
||||||
#include "../Core.h"
|
#include "../Core.h"
|
||||||
|
#include "../ConfigManager.h"
|
||||||
|
|
||||||
namespace PixelEngine
|
namespace PixelEngine
|
||||||
{
|
{
|
||||||
|
@ -145,7 +146,7 @@ void Write16(const u16 _iValue, const u32 _iAddress)
|
||||||
|
|
||||||
bool AllowIdleSkipping()
|
bool AllowIdleSkipping()
|
||||||
{
|
{
|
||||||
return !Core::g_CoreStartupParameter.bUseDualCore || (!g_ctrlReg.PETokenEnable && !g_ctrlReg.PEFinishEnable);
|
return !SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore || (!g_ctrlReg.PETokenEnable && !g_ctrlReg.PEFinishEnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateInterrupts()
|
void UpdateInterrupts()
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "WII_IPC_HLE_WiiMote.h" // Core
|
#include "WII_IPC_HLE_WiiMote.h" // Core
|
||||||
#include "WII_IPC_HLE_Device_usb.h"
|
#include "WII_IPC_HLE_Device_usb.h"
|
||||||
#include "../PluginManager.h"
|
#include "../PluginManager.h"
|
||||||
|
#include "../ConfigManager.h"
|
||||||
#include "../Host.h"
|
#include "../Host.h"
|
||||||
#include "../Core.h"
|
#include "../Core.h"
|
||||||
|
|
||||||
|
@ -385,8 +386,9 @@ void CWII_IPC_HLE_WiiMote::SendACLFrame(u8* _pData, u32 _Size)
|
||||||
void CWII_IPC_HLE_WiiMote::ShowStatus(const void* _pData)
|
void CWII_IPC_HLE_WiiMote::ShowStatus(const void* _pData)
|
||||||
{
|
{
|
||||||
// Check if it's enabled
|
// Check if it's enabled
|
||||||
bool LedsOn = Core::g_CoreStartupParameter.bWiiLeds;
|
SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
bool SpeakersOn = Core::g_CoreStartupParameter.bWiiSpeakers;
|
bool LedsOn = StartUp.bWiiLeds;
|
||||||
|
bool SpeakersOn = StartUp.bWiiSpeakers;
|
||||||
|
|
||||||
const u8* data = (const u8*)_pData;
|
const u8* data = (const u8*)_pData;
|
||||||
|
|
||||||
|
@ -438,7 +440,7 @@ void CWII_IPC_HLE_WiiMote::ShowStatus(const void* _pData)
|
||||||
void CWII_IPC_HLE_WiiMote::UpdateStatus()
|
void CWII_IPC_HLE_WiiMote::UpdateStatus()
|
||||||
{
|
{
|
||||||
// Check if it's enabled
|
// Check if it's enabled
|
||||||
if (!Core::g_CoreStartupParameter.bWiiSpeakers)
|
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bWiiSpeakers)
|
||||||
return;
|
return;
|
||||||
Host_UpdateStatus();
|
Host_UpdateStatus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,13 +250,9 @@ void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename)
|
||||||
void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename, PLUGIN_TYPE Type, bool Show)
|
void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename, PLUGIN_TYPE Type, bool Show)
|
||||||
{
|
{
|
||||||
if (Type == PLUGIN_TYPE_VIDEO) {
|
if (Type == PLUGIN_TYPE_VIDEO) {
|
||||||
if(!m_video)
|
GetVideo()->Debug((HWND)_Parent, Show);
|
||||||
m_video = (Common::PluginVideo*)LoadPlugin(_rFilename);
|
|
||||||
m_video->Debug((HWND)_Parent, Show);
|
|
||||||
} else if (Type == PLUGIN_TYPE_DSP) {
|
} else if (Type == PLUGIN_TYPE_DSP) {
|
||||||
if (!m_dsp)
|
GetDSP()->Debug((HWND)_Parent, Show);
|
||||||
m_dsp = (Common::PluginDSP*)LoadPlugin(_rFilename);
|
|
||||||
m_dsp->Debug((HWND)_Parent, Show);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,6 @@ bool BootCore(const std::string& _rFilename)
|
||||||
|
|
||||||
StartUp.m_BootType = SCoreStartupParameter::BOOT_ISO;
|
StartUp.m_BootType = SCoreStartupParameter::BOOT_ISO;
|
||||||
StartUp.m_strFilename = _rFilename;
|
StartUp.m_strFilename = _rFilename;
|
||||||
// SConfig::GetInstance().m_LastFilename = StartUp.m_strFilename;
|
|
||||||
StartUp.bRunCompareClient = false;
|
StartUp.bRunCompareClient = false;
|
||||||
StartUp.bRunCompareServer = false;
|
StartUp.bRunCompareServer = false;
|
||||||
std::string BaseDataPath;
|
std::string BaseDataPath;
|
||||||
|
@ -183,11 +182,6 @@ bool BootCore(const std::string& _rFilename)
|
||||||
}
|
}
|
||||||
// ---------
|
// ---------
|
||||||
|
|
||||||
// Save some values to our local version of SCoreStartupParameter
|
|
||||||
// SConfig::GetInstance().m_LocalCoreStartupParameter.bWii = StartUp.bWii;
|
|
||||||
// SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC = StartUp.bNTSC;
|
|
||||||
// SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID = StartUp.m_strUniqueID;
|
|
||||||
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
if(main_frame)
|
if(main_frame)
|
||||||
{
|
{
|
||||||
|
@ -198,7 +192,7 @@ bool BootCore(const std::string& _rFilename)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// init the core
|
// init the core
|
||||||
if (!Core::Init(StartUp))
|
if (!Core::Init())
|
||||||
{
|
{
|
||||||
PanicAlert("Couldn't init the core.\nCheck your configuration.");
|
PanicAlert("Couldn't init the core.\nCheck your configuration.");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue