mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
Kill some horribly ugly hackery :( It's just not right to pass entire IniFile objects across DLLs. Only POD (plain-old-data, like int, float, char, char[] etc) are safe to pass across DLL boundaries.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4257 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
700f2ff694
commit
512053fa5e
@ -705,7 +705,7 @@ void Callback_VideoCopiedToXFB(bool video_update)
|
|||||||
double wait_frametime = (1000.0 / targetfps);
|
double wait_frametime = (1000.0 / targetfps);
|
||||||
|
|
||||||
if (Timer.GetTimeDifference() >= wait_frametime * frames)
|
if (Timer.GetTimeDifference() >= wait_frametime * frames)
|
||||||
no_framelimit=Timer.GetTimeDifference();
|
no_framelimit = (u32)Timer.GetTimeDifference();
|
||||||
|
|
||||||
while (Timer.GetTimeDifference() < wait_frametime * frames)
|
while (Timer.GetTimeDifference() < wait_frametime * frames)
|
||||||
{
|
{
|
||||||
@ -756,7 +756,7 @@ void Callback_VideoCopiedToXFB(bool video_update)
|
|||||||
|
|
||||||
int TargetVPS = (int)(VideoInterface::TargetRefreshRate + 0.5);
|
int TargetVPS = (int)(VideoInterface::TargetRefreshRate + 0.5);
|
||||||
|
|
||||||
float Speed = ((VPS > 0 ? VPS : VideoInterface::ActualRefreshRate) / TargetVPS) * 100.0f;
|
float Speed = ((VPS > 0.0f ? VPS : VideoInterface::ActualRefreshRate) / TargetVPS) * 100.0f;
|
||||||
|
|
||||||
// Settings are shown the same for both extended and summary info
|
// Settings are shown the same for both extended and summary info
|
||||||
std::string SSettings = StringFromFormat(" | Core: %s %s",
|
std::string SSettings = StringFromFormat(" | Core: %s %s",
|
||||||
|
@ -47,8 +47,6 @@ void SCoreStartupParameter::LoadDefaults()
|
|||||||
bWii = false;
|
bWii = false;
|
||||||
SelectedLanguage = 0;
|
SelectedLanguage = 0;
|
||||||
iTLBHack = 0;
|
iTLBHack = 0;
|
||||||
delete gameIni;
|
|
||||||
gameIni = NULL;
|
|
||||||
|
|
||||||
bJITOff = false; // debugger only settings
|
bJITOff = false; // debugger only settings
|
||||||
bJITLoadStoreOff = false;
|
bJITLoadStoreOff = false;
|
||||||
|
@ -37,9 +37,6 @@ struct SCoreStartupParameter
|
|||||||
// Windows/GUI related
|
// Windows/GUI related
|
||||||
void* hMainWindow;
|
void* hMainWindow;
|
||||||
|
|
||||||
// game ini
|
|
||||||
IniFile *gameIni;
|
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
bool bEnableDebugging; bool bAutomaticStart; bool bBootToPause;
|
bool bEnableDebugging; bool bAutomaticStart; bool bBootToPause;
|
||||||
bool bUseJIT;
|
bool bUseJIT;
|
||||||
@ -116,6 +113,7 @@ struct SCoreStartupParameter
|
|||||||
std::string m_strDVDRoot;
|
std::string m_strDVDRoot;
|
||||||
std::string m_strUniqueID;
|
std::string m_strUniqueID;
|
||||||
std::string m_strName;
|
std::string m_strName;
|
||||||
|
std::string m_strGameIni;
|
||||||
|
|
||||||
// Constructor just calls LoadDefaults
|
// Constructor just calls LoadDefaults
|
||||||
SCoreStartupParameter();
|
SCoreStartupParameter();
|
||||||
|
@ -338,8 +338,8 @@ static u32 s_lineCount = 0;
|
|||||||
static u32 s_upperFieldBegin = 0;
|
static u32 s_upperFieldBegin = 0;
|
||||||
static u32 s_lowerFieldBegin = 0;
|
static u32 s_lowerFieldBegin = 0;
|
||||||
|
|
||||||
double TargetRefreshRate = 0.0;
|
float TargetRefreshRate = 0.0;
|
||||||
double ActualRefreshRate = 0.0;
|
float ActualRefreshRate = 0.0;
|
||||||
s64 SyncTicksProgress = 0;
|
s64 SyncTicksProgress = 0;
|
||||||
|
|
||||||
void DoState(PointerWrap &p)
|
void DoState(PointerWrap &p)
|
||||||
|
@ -44,8 +44,8 @@ namespace VideoInterface
|
|||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
// urgh, ugly externs.
|
// urgh, ugly externs.
|
||||||
extern double ActualRefreshRate;
|
extern float ActualRefreshRate;
|
||||||
extern double TargetRefreshRate;
|
extern float TargetRefreshRate;
|
||||||
extern s64 SyncTicksProgress;
|
extern s64 SyncTicksProgress;
|
||||||
|
|
||||||
// UpdateInterrupts: check if we have to generate a new VI Interrupt
|
// UpdateInterrupts: check if we have to generate a new VI Interrupt
|
||||||
|
@ -15,15 +15,11 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// File description
|
// File description
|
||||||
/* ------------
|
/* ------------
|
||||||
|
|
||||||
This file controls when plugins are loaded and unloaded from memory. Its functions scan for valid
|
This file controls when plugins are loaded and unloaded from memory. Its functions scan for valid
|
||||||
plugins when Dolphin is booted, and open the debugging and config windows. The PluginManager is
|
plugins when Dolphin is booted, and open the debugging and config windows. The PluginManager is
|
||||||
created once when Dolphin starts and is closed when Dolphin is closed.
|
created once when Dolphin starts and is closed when Dolphin is closed.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Include
|
// Include
|
||||||
@ -58,7 +54,6 @@ CPluginManager::CPluginManager()
|
|||||||
// Start LogManager
|
// Start LogManager
|
||||||
m_PluginGlobals->logManager = LogManager::GetInstance();
|
m_PluginGlobals->logManager = LogManager::GetInstance();
|
||||||
m_PluginGlobals->eventHandler = EventHandler::GetInstance();
|
m_PluginGlobals->eventHandler = EventHandler::GetInstance();
|
||||||
m_PluginGlobals->config = (void *)&SConfig::GetInstance();
|
|
||||||
|
|
||||||
m_params = &(SConfig::GetInstance().m_LocalCoreStartupParameter);
|
m_params = &(SConfig::GetInstance().m_LocalCoreStartupParameter);
|
||||||
|
|
||||||
@ -104,6 +99,13 @@ CPluginManager::~CPluginManager()
|
|||||||
// Function: Point the m_pad[] and other variables to a certain plugin
|
// Function: Point the m_pad[] and other variables to a certain plugin
|
||||||
bool CPluginManager::InitPlugins()
|
bool CPluginManager::InitPlugins()
|
||||||
{
|
{
|
||||||
|
// Update pluginglobals.
|
||||||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.size() == 0)
|
||||||
|
{
|
||||||
|
PanicAlert("Bad gameini filename");
|
||||||
|
}
|
||||||
|
strcpy(m_PluginGlobals->game_ini, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
|
||||||
|
strcpy(m_PluginGlobals->unique_id, SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID().c_str());
|
||||||
if (!GetDSP()) {
|
if (!GetDSP()) {
|
||||||
PanicAlert("Can't init DSP Plugin");
|
PanicAlert("Can't init DSP Plugin");
|
||||||
return false;
|
return false;
|
||||||
|
@ -71,7 +71,7 @@ private:
|
|||||||
bool m_Initialized;
|
bool m_Initialized;
|
||||||
|
|
||||||
CPluginInfos m_PluginInfos;
|
CPluginInfos m_PluginInfos;
|
||||||
PLUGIN_GLOBALS* m_PluginGlobals;
|
PLUGIN_GLOBALS *m_PluginGlobals;
|
||||||
Common::PluginPAD *m_pad[4];
|
Common::PluginPAD *m_pad[4];
|
||||||
Common::PluginVideo *m_video;
|
Common::PluginVideo *m_video;
|
||||||
Common::PluginWiimote *m_wiimote[4];
|
Common::PluginWiimote *m_wiimote[4];
|
||||||
|
@ -71,11 +71,7 @@ namespace BootManager
|
|||||||
extern "C" HINSTANCE wxGetInstance();
|
extern "C" HINSTANCE wxGetInstance();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Boot the ISO or file
|
// Boot the ISO or file
|
||||||
// ----------------
|
|
||||||
bool BootCore(const std::string& _rFilename)
|
bool BootCore(const std::string& _rFilename)
|
||||||
{
|
{
|
||||||
SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
@ -117,40 +113,28 @@ bool BootCore(const std::string& _rFilename)
|
|||||||
|
|
||||||
// ====================================================
|
// ====================================================
|
||||||
// Load game specific settings
|
// Load game specific settings
|
||||||
// ----------------
|
IniFile game_ini;
|
||||||
// Released when you LoadDefaults
|
|
||||||
IniFile *ini = new IniFile();
|
|
||||||
std::string unique_id = StartUp.GetUniqueID();
|
std::string unique_id = StartUp.GetUniqueID();
|
||||||
if (unique_id.size() == 6 && ini->Load((FULL_GAMECONFIG_DIR + unique_id + ".ini").c_str()))
|
StartUp.m_strGameIni = FULL_GAMECONFIG_DIR + unique_id + ".ini";
|
||||||
|
if (unique_id.size() == 6 && game_ini.Load(StartUp.m_strGameIni.c_str()))
|
||||||
{
|
{
|
||||||
StartUp.gameIni = ini;
|
|
||||||
// ------------------------------------------------
|
|
||||||
// General settings
|
// General settings
|
||||||
// ----------------
|
game_ini.Get("Core", "UseDualCore", &StartUp.bUseDualCore, StartUp.bUseDualCore);
|
||||||
ini->Get("Core", "UseDualCore", &StartUp.bUseDualCore, StartUp.bUseDualCore);
|
game_ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
|
||||||
ini->Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
|
game_ini.Get("Core", "OptimizeQuantizers", &StartUp.bOptimizeQuantizers, StartUp.bOptimizeQuantizers);
|
||||||
ini->Get("Core", "OptimizeQuantizers", &StartUp.bOptimizeQuantizers, StartUp.bOptimizeQuantizers);
|
game_ini.Get("Core", "EnableFPRF", &StartUp.bEnableFPRF, StartUp.bEnableFPRF);
|
||||||
ini->Get("Core", "EnableFPRF", &StartUp.bEnableFPRF, StartUp.bEnableFPRF);
|
game_ini.Get("Core", "TLBHack", &StartUp.iTLBHack, StartUp.iTLBHack);
|
||||||
ini->Get("Core", "TLBHack", &StartUp.iTLBHack, StartUp.iTLBHack);
|
|
||||||
|
|
||||||
// ------------------------------------------------
|
|
||||||
// Wii settings
|
// Wii settings
|
||||||
// ----------------
|
|
||||||
if (StartUp.bWii)
|
if (StartUp.bWii)
|
||||||
{
|
{
|
||||||
//bRefreshList = false;
|
game_ini.Get("Wii", "ProgressiveScan", &StartUp.bProgressiveScan, StartUp.bProgressiveScan);
|
||||||
FILE* pStream; // file handle
|
game_ini.Get("Wii", "Widescreen", &StartUp.bWidescreen, StartUp.bWidescreen);
|
||||||
u16 IPL_PGS = 0x17CC; // progressive scan
|
|
||||||
u16 IPL_AR = 0x04D9; // widescreen
|
|
||||||
|
|
||||||
ini->Get("Wii", "ProgressiveScan", &StartUp.bProgressiveScan, StartUp.bProgressiveScan);
|
|
||||||
ini->Get("Wii", "Widescreen", &StartUp.bWidescreen, StartUp.bWidescreen);
|
|
||||||
|
|
||||||
// Save the update Wii SYSCONF settings
|
// Save the update Wii SYSCONF settings
|
||||||
pStream = NULL;
|
FILE* pStream = fopen(WII_SYSCONF_FILE, "r+b");
|
||||||
pStream = fopen(WII_SYSCONF_FILE, "r+b");
|
if (pStream)
|
||||||
if (pStream != NULL)
|
|
||||||
{
|
{
|
||||||
|
const int IPL_PGS = 0x17CC; // progressive scan
|
||||||
|
const int IPL_AR = 0x04D9; // widescreen
|
||||||
fseek(pStream, IPL_PGS, 0);
|
fseek(pStream, IPL_PGS, 0);
|
||||||
fputc(StartUp.bProgressiveScan ? 1 : 0, pStream);
|
fputc(StartUp.bProgressiveScan ? 1 : 0, pStream);
|
||||||
fseek(pStream, IPL_AR, 0);
|
fseek(pStream, IPL_AR, 0);
|
||||||
@ -162,15 +146,8 @@ bool BootCore(const std::string& _rFilename)
|
|||||||
PanicAlert("Could not write to %s", WII_SYSCONF_FILE);
|
PanicAlert("Could not write to %s", WII_SYSCONF_FILE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ---------------
|
}
|
||||||
} else {
|
|
||||||
delete ini;
|
|
||||||
ini = NULL;
|
|
||||||
}
|
|
||||||
// =====================
|
|
||||||
|
|
||||||
|
|
||||||
// =================================================================
|
|
||||||
// Run the game
|
// Run the game
|
||||||
// --------------
|
// --------------
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
|
@ -105,40 +105,20 @@ void Config::Load(const char *ini_file)
|
|||||||
SetEnableAlert(bTmp);
|
SetEnableAlert(bTmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::GameIniLoad(IniFile *iniFile)
|
void Config::GameIniLoad(const char *ini_file)
|
||||||
{
|
{
|
||||||
if (! iniFile)
|
IniFile iniFile;
|
||||||
return;
|
iniFile.Load(ini_file);
|
||||||
|
iniFile.Get("Video", "ForceFiltering", &bForceFiltering, 0);
|
||||||
if (iniFile->Exists("Video", "ForceFiltering"))
|
iniFile.Get("Video", "MaxAnisotropy", &iMaxAnisotropy, 3); // NOTE - this is x in (1 << x)
|
||||||
iniFile->Get("Video", "ForceFiltering", &bForceFiltering, 0);
|
iniFile.Get("Video", "EFBCopyDisable", &bEFBCopyDisable, 0);
|
||||||
|
iniFile.Get("Video", "EFBCopyDisableHotKey", &bEFBCopyDisableHotKey, 0);
|
||||||
if (iniFile->Exists("Video", "MaxAnisotropy"))
|
iniFile.Get("Video", "EFBToRAMEnable", &bCopyEFBToRAM, 0);
|
||||||
iniFile->Get("Video", "MaxAnisotropy", &iMaxAnisotropy, 3); // NOTE - this is x in (1 << x)
|
iniFile.Get("Video", "SafeTextureCache", &bSafeTextureCache, false);
|
||||||
|
iniFile.Get("Video", "MSAA", &iMultisampleMode, 0);
|
||||||
if (iniFile->Exists("Video", "EFBCopyDisable"))
|
iniFile.Get("Video", "DstAlphaPass", &bDstAlphaPass, false);
|
||||||
iniFile->Get("Video", "EFBCopyDisable", &bEFBCopyDisable, 0);
|
iniFile.Get("Video", "UseXFB", &bUseXFB, 0);
|
||||||
|
iniFile.Get("Video", "ProjectionHack", &iPhackvalue, 0);
|
||||||
if (iniFile->Exists("Video", "EFBCopyDisableHotKey"))
|
|
||||||
iniFile->Get("Video", "EFBCopyDisableHotKey", &bEFBCopyDisableHotKey, 0);
|
|
||||||
|
|
||||||
if (iniFile->Exists("Video", "EFBToRAMEnable"))
|
|
||||||
iniFile->Get("Video", "EFBToRAMEnable", &bCopyEFBToRAM, 0);
|
|
||||||
|
|
||||||
if (iniFile->Exists("Video", "SafeTextureCache"))
|
|
||||||
iniFile->Get("Video", "SafeTextureCache", &bSafeTextureCache, false);
|
|
||||||
|
|
||||||
if (iniFile->Exists("Video", "MSAA"))
|
|
||||||
iniFile->Get("Video", "MSAA", &iMultisampleMode, 0);
|
|
||||||
|
|
||||||
if (iniFile->Exists("Video", "DstAlphaPass"))
|
|
||||||
iniFile->Get("Video", "DstAlphaPass", &bDstAlphaPass, false);
|
|
||||||
|
|
||||||
if (iniFile->Exists("Video", "UseXFB"))
|
|
||||||
iniFile->Get("Video", "UseXFB", &bUseXFB, 0);
|
|
||||||
|
|
||||||
if (iniFile->Exists("Video", "ProjectionHack"))
|
|
||||||
iniFile->Get("Video", "ProjectionHack", &iPhackvalue, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::Save(const char *ini_file)
|
void Config::Save(const char *ini_file)
|
||||||
|
@ -55,7 +55,7 @@ struct Config
|
|||||||
{
|
{
|
||||||
Config();
|
Config();
|
||||||
void Load(const char *ini_file);
|
void Load(const char *ini_file);
|
||||||
void GameIniLoad(IniFile *iniFile);
|
void GameIniLoad(const char *ini_file);
|
||||||
void Save(const char *ini_file);
|
void Save(const char *ini_file);
|
||||||
void UpdateProjectionHack();
|
void UpdateProjectionHack();
|
||||||
|
|
||||||
|
@ -84,9 +84,6 @@ enum PLUGIN_TYPE {
|
|||||||
#define STATE_MODE_MEASURE 3
|
#define STATE_MODE_MEASURE 3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Export structs
|
// Export structs
|
||||||
// ------------
|
// ------------
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -96,16 +93,16 @@ typedef struct
|
|||||||
char Name[100]; // Name of the DLL
|
char Name[100]; // Name of the DLL
|
||||||
} PLUGIN_INFO;
|
} PLUGIN_INFO;
|
||||||
|
|
||||||
|
// TODO: Remove, or at least remove the void pointers and replace with data.
|
||||||
|
// This design is just wrong and ugly - the plugins shouldn't have this much access.
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
void *eventHandler;
|
void *eventHandler;
|
||||||
void *config;
|
|
||||||
void *logManager;
|
void *logManager;
|
||||||
|
char game_ini[MAX_PATH];
|
||||||
|
char unique_id[16];
|
||||||
} PLUGIN_GLOBALS;
|
} PLUGIN_GLOBALS;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// GLOBAL I N T E R F A C E
|
// GLOBAL I N T E R F A C E
|
||||||
// ____________________________________________________________________________
|
// ____________________________________________________________________________
|
||||||
// Function: GetDllInfo
|
// Function: GetDllInfo
|
||||||
|
@ -49,12 +49,13 @@ void CConfig::Save()
|
|||||||
file.Save(FULL_CONFIG_DIR "DSP.ini");
|
file.Save(FULL_CONFIG_DIR "DSP.ini");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConfig::GameIniLoad() {
|
void CConfig::GameIniLoad(const char *game_ini)
|
||||||
IniFile *iniFile = ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.gameIni;
|
{
|
||||||
if (! iniFile)
|
if (game_ini && strlen(game_ini))
|
||||||
return;
|
{
|
||||||
|
IniFile iniFile;
|
||||||
if (iniFile->Exists("HLEaudio", "UseRE0Fix"))
|
iniFile.Load(game_ini);
|
||||||
iniFile->Get("HLEaudio", "UseRE0Fix", &m_EnableRE0Fix, 0);
|
iniFile.Get("HLEaudio", "UseRE0Fix", &m_EnableRE0Fix, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ struct CConfig
|
|||||||
CConfig();
|
CConfig();
|
||||||
|
|
||||||
void Load();
|
void Load();
|
||||||
void GameIniLoad();
|
void GameIniLoad(const char *game_ini);
|
||||||
void Save();
|
void Save();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,10 +31,6 @@ END_EVENT_TABLE()
|
|||||||
DSPConfigDialogHLE::DSPConfigDialogHLE(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
|
DSPConfigDialogHLE::DSPConfigDialogHLE(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
|
||||||
: wxDialog(parent, id, title, position, size, style)
|
: wxDialog(parent, id, title, position, size, style)
|
||||||
{
|
{
|
||||||
// Load config settings
|
|
||||||
g_Config.Load();
|
|
||||||
g_Config.GameIniLoad();
|
|
||||||
|
|
||||||
// Center window
|
// Center window
|
||||||
CenterOnParent();
|
CenterOnParent();
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ void CUCode_AX::SaveLogFile(std::string f, int resizeTo, bool type, bool Wii)
|
|||||||
ci << (resizeTo - 1); // write ci
|
ci << (resizeTo - 1); // write ci
|
||||||
cType << type; // write cType
|
cType << type; // write cType
|
||||||
|
|
||||||
std::string FileName = FULL_MAIL_LOGS_DIR + ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.GetUniqueID();
|
std::string FileName = FULL_MAIL_LOGS_DIR + std::string(globals->unique_id);
|
||||||
FileName += "_sep"; FileName += ci.str(); FileName += "_sep"; FileName += cType.str();
|
FileName += "_sep"; FileName += ci.str(); FileName += "_sep"; FileName += cType.str();
|
||||||
FileName += Wii ? "_sepWii_sep" : "_sepGC_sep"; FileName += ".log";
|
FileName += Wii ? "_sepWii_sep" : "_sepGC_sep"; FileName += ".log";
|
||||||
|
|
||||||
@ -98,25 +98,24 @@ void CUCode_AX::SaveLog_(bool Wii, const char* _fmt, va_list ap)
|
|||||||
vsprintf(Msg, _fmt, ap);
|
vsprintf(Msg, _fmt, ap);
|
||||||
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
if(m_DebuggerFrame->ScanMails)
|
if (m_DebuggerFrame->ScanMails)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(strcmp(Msg, "Begin") == 0)
|
if (strcmp(Msg, "Begin") == 0)
|
||||||
{
|
{
|
||||||
TmpMailLog = "";
|
TmpMailLog = "";
|
||||||
}
|
}
|
||||||
else if(strcmp(Msg, "End") == 0)
|
else if (strcmp(Msg, "End") == 0)
|
||||||
{
|
{
|
||||||
if(saveNext && saveNext < 100) // limit because saveNext is not initialized
|
if (saveNext && saveNext < 100) // limit because saveNext is not initialized
|
||||||
{
|
{
|
||||||
|
|
||||||
// Save the timestamps and comment
|
// Save the timestamps and comment
|
||||||
std::ostringstream ci;
|
std::ostringstream ci;
|
||||||
ci << (saveNext - 1);
|
ci << (saveNext - 1);
|
||||||
TmpMailLog += "\n\n";
|
TmpMailLog += "\n\n";
|
||||||
TmpMailLog += "-----------------------------------------------------------------------\n";
|
TmpMailLog += "-----------------------------------------------------------------------\n";
|
||||||
TmpMailLog += "Current mail: " + ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.GetUniqueID() + " mail " + ci.str() + "\n";
|
// TmpMailLog += "Current mail: " + std::string(globals->unique_id) + " mail " + ci + "\n";
|
||||||
if(Wii)
|
if (Wii)
|
||||||
TmpMailLog += "Current CRC: " + StringFromFormat("0x%08x \n\n", _CRC);
|
TmpMailLog += "Current CRC: " + StringFromFormat("0x%08x \n\n", _CRC);
|
||||||
|
|
||||||
for (u32 i = 0; i < sMailTime.size(); i++)
|
for (u32 i = 0; i < sMailTime.size(); i++)
|
||||||
@ -128,7 +127,7 @@ if(m_DebuggerFrame->ScanMails)
|
|||||||
|
|
||||||
sMailLog.push_back(TmpMailLog);
|
sMailLog.push_back(TmpMailLog);
|
||||||
// Save file to disc
|
// Save file to disc
|
||||||
if(m_DebuggerFrame->StoreMails)
|
if (m_DebuggerFrame->StoreMails)
|
||||||
{
|
{
|
||||||
SaveLogFile(TmpMailLog, saveNext, 1, Wii);
|
SaveLogFile(TmpMailLog, saveNext, 1, Wii);
|
||||||
}
|
}
|
||||||
@ -158,7 +157,7 @@ void CUCode_AX::SaveMail(bool Wii, u32 _uMail)
|
|||||||
{
|
{
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
if (!m_DebuggerFrame) return;
|
if (!m_DebuggerFrame) return;
|
||||||
if(m_DebuggerFrame->ScanMails)
|
if (m_DebuggerFrame->ScanMails)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
std::string sTemp;
|
std::string sTemp;
|
||||||
@ -171,7 +170,7 @@ if(m_DebuggerFrame->ScanMails)
|
|||||||
{
|
{
|
||||||
// Make a new row for each AX-Command
|
// Make a new row for each AX-Command
|
||||||
u16 axcomm = Memory_Read_U16(_uMail + i);
|
u16 axcomm = Memory_Read_U16(_uMail + i);
|
||||||
if(axcomm < 15 && axcomm != 0) // we can at most write 8 messages per log
|
if (axcomm < 15 && axcomm != 0) // we can at most write 8 messages per log
|
||||||
{
|
{
|
||||||
*sAct += "\n";
|
*sAct += "\n";
|
||||||
}
|
}
|
||||||
@ -195,7 +194,7 @@ if(m_DebuggerFrame->ScanMails)
|
|||||||
u32 addnew = 0;
|
u32 addnew = 0;
|
||||||
for (u32 j = 0; j < m_DebuggerFrame->sMail.size(); j++)
|
for (u32 j = 0; j < m_DebuggerFrame->sMail.size(); j++)
|
||||||
{
|
{
|
||||||
if(m_DebuggerFrame->sMail.at(j).length() != sTemp.length())
|
if (m_DebuggerFrame->sMail.at(j).length() != sTemp.length())
|
||||||
{
|
{
|
||||||
//wxMessageBox( wxString::Format("%s \n\n%s", m_DebuggerFrame->sMail.at(i).c_str(),
|
//wxMessageBox( wxString::Format("%s \n\n%s", m_DebuggerFrame->sMail.at(i).c_str(),
|
||||||
// sTemp.c_str()) );
|
// sTemp.c_str()) );
|
||||||
@ -205,7 +204,7 @@ if(m_DebuggerFrame->ScanMails)
|
|||||||
|
|
||||||
|
|
||||||
// In case the mail didn't match any saved mail, save it
|
// In case the mail didn't match any saved mail, save it
|
||||||
if(addnew == m_DebuggerFrame->sMail.size())
|
if (addnew == m_DebuggerFrame->sMail.size())
|
||||||
{
|
{
|
||||||
//Console::Print("%i | %i\n", addnew, m_DebuggerFrame->sMail.size());
|
//Console::Print("%i | %i\n", addnew, m_DebuggerFrame->sMail.size());
|
||||||
u32 resizeTo = (u32)(m_DebuggerFrame->sMail.size() + 1);
|
u32 resizeTo = (u32)(m_DebuggerFrame->sMail.size() + 1);
|
||||||
@ -225,7 +224,7 @@ if(m_DebuggerFrame->ScanMails)
|
|||||||
m_DebuggerFrame->sFullMail.push_back(lMail);
|
m_DebuggerFrame->sFullMail.push_back(lMail);
|
||||||
|
|
||||||
// enable the radio button and update view
|
// enable the radio button and update view
|
||||||
if(resizeTo <= m_DebuggerFrame->m_RadioBox[3]->GetCount())
|
if (resizeTo <= m_DebuggerFrame->m_RadioBox[3]->GetCount())
|
||||||
{
|
{
|
||||||
m_DebuggerFrame->m_RadioBox[3]->Enable(resizeTo - 1, true);
|
m_DebuggerFrame->m_RadioBox[3]->Enable(resizeTo - 1, true);
|
||||||
m_DebuggerFrame->m_RadioBox[3]->Select(resizeTo - 1);
|
m_DebuggerFrame->m_RadioBox[3]->Select(resizeTo - 1);
|
||||||
@ -236,7 +235,7 @@ if(m_DebuggerFrame->ScanMails)
|
|||||||
|
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
// Save as file
|
// Save as file
|
||||||
if(m_DebuggerFrame->StoreMails)
|
if (m_DebuggerFrame->StoreMails)
|
||||||
{
|
{
|
||||||
//Console::Print("m_DebuggerFrame->sMail.size(): %i | resizeTo:%i\n", m_DebuggerFrame->sMail.size(), resizeTo);
|
//Console::Print("m_DebuggerFrame->sMail.size(): %i | resizeTo:%i\n", m_DebuggerFrame->sMail.size(), resizeTo);
|
||||||
SaveLogFile(lMail, resizeTo, 0, Wii);
|
SaveLogFile(lMail, resizeTo, 0, Wii);
|
||||||
@ -294,7 +293,7 @@ static void ProcessUpdates(AXParamBlock &PB)
|
|||||||
const u16 updpar = Memory_Read_U16(updaddr + k);
|
const u16 updpar = Memory_Read_U16(updaddr + k);
|
||||||
const u16 upddata = Memory_Read_U16(updaddr + k + 2);
|
const u16 upddata = Memory_Read_U16(updaddr + k + 2);
|
||||||
// some safety checks, I hope it's enough
|
// some safety checks, I hope it's enough
|
||||||
if(updaddr > 0x80000000 && updaddr < 0x817fffff
|
if (updaddr > 0x80000000 && updaddr < 0x817fffff
|
||||||
&& updpar < 63 && updpar > 3 && upddata >= 0 // updpar > 3 because we don't want to change
|
&& updpar < 63 && updpar > 3 && upddata >= 0 // updpar > 3 because we don't want to change
|
||||||
// 0-3, those are important
|
// 0-3, those are important
|
||||||
//&& (upd0 || upd1 || upd2 || upd3 || upd4) // We should use these in some way to I think
|
//&& (upd0 || upd1 || upd2 || upd3 || upd4) // We should use these in some way to I think
|
||||||
@ -408,7 +407,7 @@ void CUCode_AX::SaveLog(const char* _fmt, ...)
|
|||||||
{
|
{
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
va_list ap; va_start(ap, _fmt);
|
va_list ap; va_start(ap, _fmt);
|
||||||
if(m_DebuggerFrame) SaveLog_(false, _fmt, ap);
|
if (m_DebuggerFrame) SaveLog_(false, _fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -443,7 +442,7 @@ bool CUCode_AX::AXTask(u32& _uMail)
|
|||||||
bool bExecuteList = true;
|
bool bExecuteList = true;
|
||||||
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
if(m_DebuggerFrame) SaveMail(false, _uMail); // Save mail for debugging
|
if (m_DebuggerFrame) SaveMail(false, _uMail); // Save mail for debugging
|
||||||
#endif
|
#endif
|
||||||
while (bExecuteList)
|
while (bExecuteList)
|
||||||
{
|
{
|
||||||
|
@ -179,6 +179,10 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
|
|||||||
void DllConfig(HWND _hParent)
|
void DllConfig(HWND _hParent)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
|
// Load config settings
|
||||||
|
g_Config.Load();
|
||||||
|
g_Config.GameIniLoad(globals->game_ini);
|
||||||
|
|
||||||
if (!m_ConfigFrame)
|
if (!m_ConfigFrame)
|
||||||
m_ConfigFrame = new DSPConfigDialogHLE(GetParentedWxWindow(_hParent));
|
m_ConfigFrame = new DSPConfigDialogHLE(GetParentedWxWindow(_hParent));
|
||||||
else if (!m_ConfigFrame->GetParent()->IsShown())
|
else if (!m_ConfigFrame->GetParent()->IsShown())
|
||||||
|
@ -33,8 +33,6 @@
|
|||||||
#include "TextureDecoder.h"
|
#include "TextureDecoder.h"
|
||||||
#include "TextureCache.h"
|
#include "TextureCache.h"
|
||||||
|
|
||||||
#include "../../../Core/Core/Src/ConfigManager.h" // FIXME
|
|
||||||
|
|
||||||
u8 *TextureCache::temp = NULL;
|
u8 *TextureCache::temp = NULL;
|
||||||
TextureCache::TexCache TextureCache::textures;
|
TextureCache::TexCache TextureCache::textures;
|
||||||
|
|
||||||
@ -235,7 +233,7 @@ TextureCache::TCacheEntry *TextureCache::Load(int stage, u32 address, int width,
|
|||||||
|
|
||||||
char szTemp[MAX_PATH];
|
char szTemp[MAX_PATH];
|
||||||
char szDir[MAX_PATH];
|
char szDir[MAX_PATH];
|
||||||
const char* uniqueId = ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.GetUniqueID().c_str();
|
const char* uniqueId = globals->unique_id;
|
||||||
bool bCheckedDumpDir = false;
|
bool bCheckedDumpDir = false;
|
||||||
|
|
||||||
sprintf(szDir,"%s/%s",FULL_DUMP_TEXTURES_DIR,uniqueId);
|
sprintf(szDir,"%s/%s",FULL_DUMP_TEXTURES_DIR,uniqueId);
|
||||||
|
@ -177,8 +177,7 @@ void UpdateFPSDisplay(const char *text)
|
|||||||
bool Init()
|
bool Init()
|
||||||
{
|
{
|
||||||
g_Config.Load(FULL_CONFIG_DIR "gfx_dx9.ini");
|
g_Config.Load(FULL_CONFIG_DIR "gfx_dx9.ini");
|
||||||
IniFile *iniFile = ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.gameIni;
|
g_Config.GameIniLoad(globals->game_ini);
|
||||||
g_Config.GameIniLoad(iniFile);
|
|
||||||
UpdateProjectionHack(g_Config.iPhackvalue); // DX9 projection hack could be disabled by commenting out this line
|
UpdateProjectionHack(g_Config.iPhackvalue); // DX9 projection hack could be disabled by commenting out this line
|
||||||
|
|
||||||
if (initCount == 0)
|
if (initCount == 0)
|
||||||
|
@ -52,8 +52,6 @@
|
|||||||
#include "FileUtil.h"
|
#include "FileUtil.h"
|
||||||
#include "HiresTextures.h"
|
#include "HiresTextures.h"
|
||||||
|
|
||||||
#include "../../../Core/Core/Src/ConfigManager.h" // FIXME
|
|
||||||
|
|
||||||
u8 *TextureMngr::temp = NULL;
|
u8 *TextureMngr::temp = NULL;
|
||||||
TextureMngr::TexCache TextureMngr::textures;
|
TextureMngr::TexCache TextureMngr::textures;
|
||||||
|
|
||||||
@ -161,7 +159,7 @@ void TextureMngr::Init()
|
|||||||
{
|
{
|
||||||
temp = (u8*)AllocateMemoryPages(TEMP_SIZE);
|
temp = (u8*)AllocateMemoryPages(TEMP_SIZE);
|
||||||
TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);
|
TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);
|
||||||
HiresTextures::Init(((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.GetUniqueID().c_str());
|
HiresTextures::Init(globals->unique_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureMngr::Invalidate(bool shutdown)
|
void TextureMngr::Invalidate(bool shutdown)
|
||||||
@ -342,7 +340,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
|
|||||||
int oldWidth = width;
|
int oldWidth = width;
|
||||||
int oldHeight = height;
|
int oldHeight = height;
|
||||||
|
|
||||||
sprintf(texPathTemp, "%s_%08x_%i", ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.GetUniqueID().c_str(), texHash, tex_format);
|
sprintf(texPathTemp, "%s_%08x_%i", globals->unique_id, texHash, tex_format);
|
||||||
dfmt = HiresTextures::GetHiresTex(texPathTemp, &width, &height, tex_format, temp);
|
dfmt = HiresTextures::GetHiresTex(texPathTemp, &width, &height, tex_format, temp);
|
||||||
|
|
||||||
if (dfmt != PC_TEX_FMT_NONE)
|
if (dfmt != PC_TEX_FMT_NONE)
|
||||||
@ -467,7 +465,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
|
|||||||
|
|
||||||
char szTemp[MAX_PATH];
|
char szTemp[MAX_PATH];
|
||||||
char szDir[MAX_PATH];
|
char szDir[MAX_PATH];
|
||||||
const char* uniqueId = ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.GetUniqueID().c_str();
|
const char* uniqueId = globals->unique_id;
|
||||||
bool bCheckedDumpDir = false;
|
bool bCheckedDumpDir = false;
|
||||||
|
|
||||||
sprintf(szDir,"%s/%s",FULL_DUMP_TEXTURES_DIR,uniqueId);
|
sprintf(szDir,"%s/%s",FULL_DUMP_TEXTURES_DIR,uniqueId);
|
||||||
|
@ -70,11 +70,6 @@ GFXDebuggerOGL *m_DebuggerFrame = NULL;
|
|||||||
#endif // HAVE_WX
|
#endif // HAVE_WX
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
// Having to include this is TERRIBLY ugly. FIXME x100
|
|
||||||
#include "Globals.h"
|
|
||||||
#include "../../../Core/Core/Src/ConfigManager.h" // FIXME
|
|
||||||
|
|
||||||
#include "LookUpTables.h"
|
#include "LookUpTables.h"
|
||||||
#include "ImageWrite.h"
|
#include "ImageWrite.h"
|
||||||
#include "Render.h"
|
#include "Render.h"
|
||||||
@ -286,9 +281,7 @@ void CocaAddResolutions() {
|
|||||||
void DllConfig(HWND _hParent)
|
void DllConfig(HWND _hParent)
|
||||||
{
|
{
|
||||||
g_Config.Load(FULL_CONFIG_DIR "gfx_opengl.ini");
|
g_Config.Load(FULL_CONFIG_DIR "gfx_opengl.ini");
|
||||||
// UGLY
|
g_Config.GameIniLoad(globals->game_ini);
|
||||||
IniFile *iniFile = ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.gameIni;
|
|
||||||
g_Config.GameIniLoad(iniFile);
|
|
||||||
g_Config.UpdateProjectionHack();
|
g_Config.UpdateProjectionHack();
|
||||||
UpdateActiveConfig();
|
UpdateActiveConfig();
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
@ -326,9 +319,7 @@ void Initialize(void *init)
|
|||||||
InitXFBConvTables();
|
InitXFBConvTables();
|
||||||
|
|
||||||
g_Config.Load(FULL_CONFIG_DIR "gfx_opengl.ini");
|
g_Config.Load(FULL_CONFIG_DIR "gfx_opengl.ini");
|
||||||
// UGLY
|
g_Config.GameIniLoad(globals->game_ini);
|
||||||
IniFile *iniFile = ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.gameIni;
|
|
||||||
g_Config.GameIniLoad(iniFile);
|
|
||||||
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
g_Config.UpdateProjectionHack();
|
g_Config.UpdateProjectionHack();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user