diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 9bfe6bdf3..6b4b9c732 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -181,6 +181,7 @@ bool CN64System::RunFileImage(const char * FileLoc) return false; } WriteTrace(TraceDebug, __FUNCTION__ ": Mark Rom as loading"); + g_Settings->SaveString(Game_File, ""); //Mark the rom as loading g_Settings->SaveBool(GameRunning_LoadingInProgress, true); @@ -201,10 +202,7 @@ bool CN64System::RunFileImage(const char * FileLoc) { g_System->RefreshGameSettings(); - WriteTrace(TraceDebug, __FUNCTION__ ": Add Recent Rom"); - Notify().AddRecentRom(FileLoc); - Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str()); - + g_Settings->SaveString(Game_File, FileLoc); g_Settings->SaveBool(GameRunning_LoadingInProgress, false); if (g_Settings->LoadDword(Setting_AutoStart) != 0) @@ -275,9 +273,6 @@ void CN64System::StartEmulation2(bool NewThread) if (NewThread) { WriteTrace(TraceDebug, __FUNCTION__ ": Starting"); - - Notify().HideRomBrowser(); - if (bHaveDebugger()) { g_LogOptions.GenerateLog = g_Settings->LoadBool(Debugger_GenerateDebugLog); @@ -1805,7 +1800,7 @@ bool CN64System::LoadState(LPCSTR FileName) SetActiveSystem(true); SyncCPU(m_SyncCPU); } - } +} WriteTrace(TraceDebug, __FUNCTION__ ": 13"); std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE); g_Notify->DisplayMessage(5, stdstr_f("%s %s", LoadMsg.c_str(), CPath(FileNameStr).GetNameExtension()).ToUTF16().c_str()); diff --git a/Source/Project64/Settings/Settings Class.cpp b/Source/Project64/Settings/Settings Class.cpp index 6e1e943c2..b6a4a6400 100644 --- a/Source/Project64/Settings/Settings Class.cpp +++ b/Source/Project64/Settings/Settings Class.cpp @@ -35,7 +35,7 @@ CSettings * g_Settings = NULL; CSettings::CSettings() : - m_NextAutoSettingId(0x200000) +m_NextAutoSettingId(0x200000) { } @@ -63,14 +63,14 @@ CSettings::~CSettings() } } -void CSettings::AddHandler ( SettingID TypeID, CSettingType * Handler ) +void CSettings::AddHandler(SettingID TypeID, CSettingType * Handler) { - SETTING_MAP::_Pairib res = m_SettingInfo.insert(SETTING_MAP::value_type(TypeID,Handler)); + SETTING_MAP::_Pairib res = m_SettingInfo.insert(SETTING_MAP::value_type(TypeID, Handler)); if (!res.second) { delete res.first->second; m_SettingInfo.erase(res.first); - res = m_SettingInfo.insert(SETTING_MAP::value_type(TypeID,Handler)); + res = m_SettingInfo.insert(SETTING_MAP::value_type(TypeID, Handler)); if (!res.second) { delete Handler; @@ -78,183 +78,184 @@ void CSettings::AddHandler ( SettingID TypeID, CSettingType * Handler ) } } -void CSettings::AddHowToHandleSetting () +void CSettings::AddHowToHandleSetting() { //information - temp keys - AddHandler(Info_ShortCutsChanged, new CSettingTypeTempBool(false)); + AddHandler(Info_ShortCutsChanged, new CSettingTypeTempBool(false)); //Support Files - AddHandler(SupportFile_Settings, new CSettingTypeApplicationPath("","ConfigFile",SupportFile_SettingsDefault)); - AddHandler(SupportFile_SettingsDefault, new CSettingTypeRelativePath("Config","Project64.cfg")); - AddHandler(SupportFile_RomDatabase, new CSettingTypeApplicationPath("","RomDatabase",SupportFile_RomDatabaseDefault)); - AddHandler(SupportFile_RomDatabaseDefault, new CSettingTypeRelativePath("Config","Project64.rdb")); - AddHandler(SupportFile_Glide64RDB, new CSettingTypeApplicationPath("","Glide64RDB",SupportFile_Glide64RDBDefault)); - AddHandler(SupportFile_Glide64RDBDefault, new CSettingTypeRelativePath("Config","Glide64.rdb")); - AddHandler(SupportFile_Cheats, new CSettingTypeApplicationPath("","Cheats",SupportFile_CheatsDefault)); - AddHandler(SupportFile_CheatsDefault, new CSettingTypeRelativePath("Config","Project64.cht")); - AddHandler(SupportFile_Notes, new CSettingTypeApplicationPath("","Notes",SupportFile_NotesDefault)); - AddHandler(SupportFile_NotesDefault, new CSettingTypeRelativePath("Config","Project64.rdn")); - AddHandler(SupportFile_ExtInfo, new CSettingTypeApplicationPath("","ExtInfo",SupportFile_ExtInfoDefault)); - AddHandler(SupportFile_ExtInfoDefault, new CSettingTypeRelativePath("Config","Project64.rdx")); - AddHandler(SupportFile_ShortCuts, new CSettingTypeApplicationPath("","ShortCuts",SupportFile_ShortCutsDefault)); - AddHandler(SupportFile_ShortCutsDefault, new CSettingTypeRelativePath("Config","Project64.sc3")); - AddHandler(SupportFile_RomListCache, new CSettingTypeApplicationPath("","RomListCache",SupportFile_RomListCacheDefault)); - AddHandler(SupportFile_RomListCacheDefault,new CSettingTypeRelativePath("Config","Project64.cache3")); - AddHandler(SupportFile_7zipCache, new CSettingTypeApplicationPath("","7zipCache",SupportFile_7zipCacheDefault)); - AddHandler(SupportFile_7zipCacheDefault, new CSettingTypeRelativePath("Config","Project64.zcache")); + AddHandler(SupportFile_Settings, new CSettingTypeApplicationPath("", "ConfigFile", SupportFile_SettingsDefault)); + AddHandler(SupportFile_SettingsDefault, new CSettingTypeRelativePath("Config", "Project64.cfg")); + AddHandler(SupportFile_RomDatabase, new CSettingTypeApplicationPath("", "RomDatabase", SupportFile_RomDatabaseDefault)); + AddHandler(SupportFile_RomDatabaseDefault, new CSettingTypeRelativePath("Config", "Project64.rdb")); + AddHandler(SupportFile_Glide64RDB, new CSettingTypeApplicationPath("", "Glide64RDB", SupportFile_Glide64RDBDefault)); + AddHandler(SupportFile_Glide64RDBDefault, new CSettingTypeRelativePath("Config", "Glide64.rdb")); + AddHandler(SupportFile_Cheats, new CSettingTypeApplicationPath("", "Cheats", SupportFile_CheatsDefault)); + AddHandler(SupportFile_CheatsDefault, new CSettingTypeRelativePath("Config", "Project64.cht")); + AddHandler(SupportFile_Notes, new CSettingTypeApplicationPath("", "Notes", SupportFile_NotesDefault)); + AddHandler(SupportFile_NotesDefault, new CSettingTypeRelativePath("Config", "Project64.rdn")); + AddHandler(SupportFile_ExtInfo, new CSettingTypeApplicationPath("", "ExtInfo", SupportFile_ExtInfoDefault)); + AddHandler(SupportFile_ExtInfoDefault, new CSettingTypeRelativePath("Config", "Project64.rdx")); + AddHandler(SupportFile_ShortCuts, new CSettingTypeApplicationPath("", "ShortCuts", SupportFile_ShortCutsDefault)); + AddHandler(SupportFile_ShortCutsDefault, new CSettingTypeRelativePath("Config", "Project64.sc3")); + AddHandler(SupportFile_RomListCache, new CSettingTypeApplicationPath("", "RomListCache", SupportFile_RomListCacheDefault)); + AddHandler(SupportFile_RomListCacheDefault, new CSettingTypeRelativePath("Config", "Project64.cache3")); + AddHandler(SupportFile_7zipCache, new CSettingTypeApplicationPath("", "7zipCache", SupportFile_7zipCacheDefault)); + AddHandler(SupportFile_7zipCacheDefault, new CSettingTypeRelativePath("Config", "Project64.zcache")); //AddHandler(SyncPluginDir, new CSettingTypeRelativePath("SyncPlugin","")); //Settings location AddHandler(Setting_ApplicationName, new CSettingTypeTempString("")); - AddHandler(Setting_UseFromRegistry, new CSettingTypeApplication("Settings","Use Registry",(uint32_t)false)); - AddHandler(Setting_RdbEditor, new CSettingTypeApplication("","Rdb Editor", false)); - AddHandler(Setting_PluginPageFirst, new CSettingTypeApplication("","Plugin Page First", false)); - AddHandler(Setting_DisableScrSaver, new CSettingTypeApplication("","Disable Screen Saver",(uint32_t)true)); - AddHandler(Setting_AutoSleep, new CSettingTypeApplication("","Auto Sleep", (uint32_t)true)); - AddHandler(Setting_AutoStart, new CSettingTypeApplication("","Auto Start", (uint32_t)true)); - AddHandler(Setting_AutoFullscreen, new CSettingTypeApplication("","Auto Full Screen", (uint32_t)false)); - AddHandler(Setting_AutoZipInstantSave,new CSettingTypeApplication("","Auto Zip Saves", (uint32_t)true)); - AddHandler(Setting_EraseGameDefaults, new CSettingTypeApplication("","Erase on default", (uint32_t)true)); - AddHandler(Setting_CheckEmuRunning, new CSettingTypeApplication("","Check Running", (uint32_t)true)); + AddHandler(Setting_UseFromRegistry, new CSettingTypeApplication("Settings", "Use Registry", (uint32_t)false)); + AddHandler(Setting_RdbEditor, new CSettingTypeApplication("", "Rdb Editor", false)); + AddHandler(Setting_PluginPageFirst, new CSettingTypeApplication("", "Plugin Page First", false)); + AddHandler(Setting_DisableScrSaver, new CSettingTypeApplication("", "Disable Screen Saver", (uint32_t)true)); + AddHandler(Setting_AutoSleep, new CSettingTypeApplication("", "Auto Sleep", (uint32_t)true)); + AddHandler(Setting_AutoStart, new CSettingTypeApplication("", "Auto Start", (uint32_t)true)); + AddHandler(Setting_AutoFullscreen, new CSettingTypeApplication("", "Auto Full Screen", (uint32_t)false)); + AddHandler(Setting_AutoZipInstantSave, new CSettingTypeApplication("", "Auto Zip Saves", (uint32_t)true)); + AddHandler(Setting_EraseGameDefaults, new CSettingTypeApplication("", "Erase on default", (uint32_t)true)); + AddHandler(Setting_CheckEmuRunning, new CSettingTypeApplication("", "Check Running", (uint32_t)true)); - AddHandler(Setting_RememberCheats, new CSettingTypeApplication("","Remember Cheats", (uint32_t)false)); - AddHandler(Setting_CurrentLanguage, new CSettingTypeApplication("","Current Language","")); - AddHandler(Setting_LanguageDirDefault, new CSettingTypeRelativePath("Lang","")); - AddHandler(Setting_LanguageDir, new CSettingTypeApplicationPath("Directory","Lang",Setting_LanguageDirDefault)); + AddHandler(Setting_RememberCheats, new CSettingTypeApplication("", "Remember Cheats", (uint32_t)false)); + AddHandler(Setting_CurrentLanguage, new CSettingTypeApplication("", "Current Language", "")); + AddHandler(Setting_LanguageDirDefault, new CSettingTypeRelativePath("Lang", "")); + AddHandler(Setting_LanguageDir, new CSettingTypeApplicationPath("Directory", "Lang", Setting_LanguageDirDefault)); - AddHandler(Rdb_GoodName, new CSettingTypeRomDatabase("Good Name",Game_GameName)); - AddHandler(Rdb_SaveChip, new CSettingTypeRDBSaveChip("Save Type",SaveChip_Auto)); + AddHandler(Rdb_GoodName, new CSettingTypeRomDatabase("Good Name", Game_GameName)); + AddHandler(Rdb_SaveChip, new CSettingTypeRDBSaveChip("Save Type", SaveChip_Auto)); #ifdef _DEBUG - AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type",CPU_SyncCores)); + AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type", CPU_SyncCores)); #else - AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type",CPU_Recompiler)); + AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type", CPU_Recompiler)); #endif - AddHandler(Rdb_RDRamSize, new CSettingTypeRDBRDRamSize("RDRAM Size",0x400000)); - AddHandler(Rdb_CounterFactor, new CSettingTypeRomDatabase("Counter Factor",2)); - AddHandler(Rdb_UseTlb, new CSettingTypeRDBYesNo("Use TLB",true)); - AddHandler(Rdb_DelayDP, new CSettingTypeRDBYesNo("Delay DP",true)); - AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI",false)); - AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit",true)); - AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP",true)); - AddHandler(Rdb_Status, new CSettingTypeRomDatabase("Status","Unknown")); - AddHandler(Rdb_NotesCore, new CSettingTypeRomDatabase("Core Note","")); - AddHandler(Rdb_NotesPlugin, new CSettingTypeRomDatabase("Plugin Note","")); + AddHandler(Rdb_RDRamSize, new CSettingTypeRDBRDRamSize("RDRAM Size", 0x400000)); + AddHandler(Rdb_CounterFactor, new CSettingTypeRomDatabase("Counter Factor", 2)); + AddHandler(Rdb_UseTlb, new CSettingTypeRDBYesNo("Use TLB", true)); + AddHandler(Rdb_DelayDP, new CSettingTypeRDBYesNo("Delay DP", true)); + AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI", false)); + AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit", true)); + AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP", true)); + AddHandler(Rdb_Status, new CSettingTypeRomDatabase("Status", "Unknown")); + AddHandler(Rdb_NotesCore, new CSettingTypeRomDatabase("Core Note", "")); + AddHandler(Rdb_NotesPlugin, new CSettingTypeRomDatabase("Plugin Note", "")); #ifdef _DEBUG - AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio",true)); + AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", true)); #else - AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio",false)); + AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", false)); #endif - AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Sync Audio",true)); - AddHandler(Rdb_RspAudioSignal, new CSettingTypeRDBYesNo("Audio Signal",false)); - AddHandler(Rdb_TLB_VAddrStart, new CSettingTypeRomDatabase("TLB: Vaddr Start",0)); - AddHandler(Rdb_TLB_VAddrLen, new CSettingTypeRomDatabase("TLB: Vaddr Len",0)); - AddHandler(Rdb_TLB_PAddrStart, new CSettingTypeRomDatabase("TLB: PAddr Start",0)); - AddHandler(Rdb_UseHleGfx, new CSettingTypeRomDatabase("HLE GFX",Plugin_UseHleGfx)); - AddHandler(Rdb_UseHleAudio, new CSettingTypeRomDatabase("HLE Audio",Plugin_UseHleAudio)); - AddHandler(Rdb_LoadRomToMemory, new CSettingTypeRomDatabase("Rom In Memory",false)); - AddHandler(Rdb_ScreenHertz, new CSettingTypeRomDatabase("ScreenHertz",0)); - AddHandler(Rdb_FuncLookupMode, new CSettingTypeRomDatabase("FuncFind",FuncFind_PhysicalLookup)); - AddHandler(Rdb_RegCache, new CSettingTypeRDBYesNo("Reg Cache",true)); - AddHandler(Rdb_BlockLinking, new CSettingTypeRDBOnOff("Linking",true)); - AddHandler(Rdb_SMM_Cache, new CSettingTypeRomDatabase("SMM-Cache",true)); - AddHandler(Rdb_SMM_StoreInstruc, new CSettingTypeRomDatabase("SMM-StoreInstr",false)); - AddHandler(Rdb_SMM_PIDMA, new CSettingTypeRomDatabase("SMM-PI DMA",true)); - AddHandler(Rdb_SMM_TLB, new CSettingTypeRomDatabase("SMM-TLB",true)); - AddHandler(Rdb_SMM_Protect, new CSettingTypeRomDatabase("SMM-Protect",false)); - AddHandler(Rdb_SMM_ValidFunc, new CSettingTypeRomDatabase("SMM-FUNC",true)); - AddHandler(Rdb_GameCheatFix, new CSettingTypeRomDatabaseIndex("Cheat","","")); - AddHandler(Rdb_GameCheatFixPlugin, new CSettingTypeRomDatabaseIndex("CheatPlugin","","")); - AddHandler(Rdb_ViRefreshRate, new CSettingTypeRomDatabase("ViRefresh",1500)); - AddHandler(Rdb_AiCountPerBytes, new CSettingTypeRomDatabase("AiCountPerBytes",400)); - AddHandler(Rdb_AudioResetOnLoad, new CSettingTypeRDBYesNo("AudioResetOnLoad", false)); - AddHandler(Rdb_AllowROMWrites, new CSettingTypeRDBYesNo("AllowROMWrites", false)); - AddHandler(Rdb_CRC_Recalc, new CSettingTypeRDBYesNo("CRC-Recalc", false)); + AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Sync Audio", true)); + AddHandler(Rdb_RspAudioSignal, new CSettingTypeRDBYesNo("Audio Signal", false)); + AddHandler(Rdb_TLB_VAddrStart, new CSettingTypeRomDatabase("TLB: Vaddr Start", 0)); + AddHandler(Rdb_TLB_VAddrLen, new CSettingTypeRomDatabase("TLB: Vaddr Len", 0)); + AddHandler(Rdb_TLB_PAddrStart, new CSettingTypeRomDatabase("TLB: PAddr Start", 0)); + AddHandler(Rdb_UseHleGfx, new CSettingTypeRomDatabase("HLE GFX", Plugin_UseHleGfx)); + AddHandler(Rdb_UseHleAudio, new CSettingTypeRomDatabase("HLE Audio", Plugin_UseHleAudio)); + AddHandler(Rdb_LoadRomToMemory, new CSettingTypeRomDatabase("Rom In Memory", false)); + AddHandler(Rdb_ScreenHertz, new CSettingTypeRomDatabase("ScreenHertz", 0)); + AddHandler(Rdb_FuncLookupMode, new CSettingTypeRomDatabase("FuncFind", FuncFind_PhysicalLookup)); + AddHandler(Rdb_RegCache, new CSettingTypeRDBYesNo("Reg Cache", true)); + AddHandler(Rdb_BlockLinking, new CSettingTypeRDBOnOff("Linking", true)); + AddHandler(Rdb_SMM_Cache, new CSettingTypeRomDatabase("SMM-Cache", true)); + AddHandler(Rdb_SMM_StoreInstruc, new CSettingTypeRomDatabase("SMM-StoreInstr", false)); + AddHandler(Rdb_SMM_PIDMA, new CSettingTypeRomDatabase("SMM-PI DMA", true)); + AddHandler(Rdb_SMM_TLB, new CSettingTypeRomDatabase("SMM-TLB", true)); + AddHandler(Rdb_SMM_Protect, new CSettingTypeRomDatabase("SMM-Protect", false)); + AddHandler(Rdb_SMM_ValidFunc, new CSettingTypeRomDatabase("SMM-FUNC", true)); + AddHandler(Rdb_GameCheatFix, new CSettingTypeRomDatabaseIndex("Cheat", "", "")); + AddHandler(Rdb_GameCheatFixPlugin, new CSettingTypeRomDatabaseIndex("CheatPlugin", "", "")); + AddHandler(Rdb_ViRefreshRate, new CSettingTypeRomDatabase("ViRefresh", 1500)); + AddHandler(Rdb_AiCountPerBytes, new CSettingTypeRomDatabase("AiCountPerBytes", 400)); + AddHandler(Rdb_AudioResetOnLoad, new CSettingTypeRDBYesNo("AudioResetOnLoad", false)); + AddHandler(Rdb_AllowROMWrites, new CSettingTypeRDBYesNo("AllowROMWrites", false)); + AddHandler(Rdb_CRC_Recalc, new CSettingTypeRDBYesNo("CRC-Recalc", false)); - AddHandler(Game_IniKey, new CSettingTypeTempString("")); - AddHandler(Game_GameName, new CSettingTypeTempString("")); - AddHandler(Game_GoodName, new CSettingTypeGame("Good Name",Rdb_GoodName)); - AddHandler(Game_TempLoaded, new CSettingTypeTempBool(false)); - AddHandler(Game_SystemType, new CSettingTypeTempNumber(SYSTEM_NTSC)); - AddHandler(Game_EditPlugin_Gfx, new CSettingTypeGame("Plugin-Gfx",Default_None)); - AddHandler(Game_EditPlugin_Audio, new CSettingTypeGame("Plugin-Audio",Default_None)); - AddHandler(Game_EditPlugin_Contr, new CSettingTypeGame("Plugin-Controller",Default_None)); - AddHandler(Game_EditPlugin_RSP, new CSettingTypeGame("Plugin-RSP",Default_None)); - AddHandler(Game_Plugin_Gfx, new CSettingTypeGame("Plugin-Gfx",Plugin_GFX_Current)); - AddHandler(Game_Plugin_Audio, new CSettingTypeGame("Plugin-Audio",Plugin_AUDIO_Current)); - AddHandler(Game_Plugin_Controller, new CSettingTypeGame("Plugin-Controller",Plugin_CONT_Current)); - AddHandler(Game_Plugin_RSP, new CSettingTypeGame("Plugin-RSP",Plugin_RSP_Current)); - AddHandler(Game_SaveChip, new CSettingTypeGame("SaveChip",Rdb_SaveChip)); - AddHandler(Game_CpuType, new CSettingTypeGame("CpuType",Rdb_CpuType)); - AddHandler(Game_LastSaveSlot, new CSettingTypeGame("Last Used Save Slot",(uint32_t)0)); - AddHandler(Game_FixedAudio, new CSettingTypeGame("Fixed Audio",Rdb_FixedAudio)); - AddHandler(Game_RDRamSize, new CSettingTypeGame("RDRamSize",Rdb_RDRamSize)); - AddHandler(Game_CounterFactor, new CSettingTypeGame("Counter Factor",Rdb_CounterFactor)); - AddHandler(Game_UseTlb, new CSettingTypeGame("Use TLB",Rdb_UseTlb)); - AddHandler(Game_DelayDP, new CSettingTypeGame("Delay DP",Rdb_DelayDP)); - AddHandler(Game_DelaySI, new CSettingTypeGame("Delay SI",Rdb_DelaySi)); - AddHandler(Game_RspAudioSignal, new CSettingTypeGame("Audio Signal",Rdb_RspAudioSignal)); - AddHandler(Game_32Bit, new CSettingTypeGame("32bit",Rdb_32Bit)); - AddHandler(Game_FastSP, new CSettingTypeGame("Fast SP",Rdb_FastSP)); - AddHandler(Game_CurrentSaveState, new CSettingTypeTempNumber(0)); - AddHandler(Game_SyncViaAudio, new CSettingTypeGame("Sync Audio",Rdb_SyncViaAudio)); - AddHandler(Game_UseHleGfx, new CSettingTypeGame("HLE GFX",Rdb_UseHleGfx)); - AddHandler(Game_UseHleAudio, new CSettingTypeGame("HLE Audio",Rdb_UseHleAudio)); - AddHandler(Game_LoadRomToMemory, new CSettingTypeGame("Rom In Memory",Rdb_LoadRomToMemory)); - AddHandler(Game_ScreenHertz, new CSettingTypeGame("ScreenHertz",Rdb_ScreenHertz)); - AddHandler(Game_FuncLookupMode, new CSettingTypeGame("FuncFind",Rdb_FuncLookupMode)); - AddHandler(Game_RegCache, new CSettingTypeGame("Reg Cache",Rdb_RegCache)); - AddHandler(Game_BlockLinking, new CSettingTypeGame("Linking",Rdb_BlockLinking)); - AddHandler(Game_SMM_StoreInstruc, new CSettingTypeGame("SMM-StoreInst",Rdb_SMM_StoreInstruc)); - AddHandler(Game_SMM_Cache, new CSettingTypeGame("SMM-Cache",Rdb_SMM_Cache)); - AddHandler(Game_SMM_PIDMA, new CSettingTypeGame("SMM-PI DMA",Rdb_SMM_PIDMA)); - AddHandler(Game_SMM_TLB, new CSettingTypeGame("SMM-TLB",Rdb_SMM_TLB)); - AddHandler(Game_SMM_Protect, new CSettingTypeGame("SMM-Protect",Rdb_SMM_Protect)); - AddHandler(Game_SMM_ValidFunc, new CSettingTypeGame("SMM-FUNC",Rdb_SMM_ValidFunc)); - AddHandler(Game_ViRefreshRate, new CSettingTypeGame("ViRefresh",Rdb_ViRefreshRate)); - AddHandler(Game_AiCountPerBytes, new CSettingTypeGame("AiCountPerBytes",Rdb_AiCountPerBytes)); - AddHandler(Game_AudioResetOnLoad, new CSettingTypeGame("AudioResetOnLoad", Rdb_AudioResetOnLoad)); - AddHandler(Game_AllowROMWrites, new CSettingTypeGame("AllowROMWrites", Rdb_AllowROMWrites)); - AddHandler(Game_CRC_Recalc, new CSettingTypeGame("CRC-Recalc", Rdb_CRC_Recalc)); + AddHandler(Game_IniKey, new CSettingTypeTempString("")); + AddHandler(Game_File, new CSettingTypeTempString("")); + AddHandler(Game_GameName, new CSettingTypeTempString("")); + AddHandler(Game_GoodName, new CSettingTypeGame("Good Name", Rdb_GoodName)); + AddHandler(Game_TempLoaded, new CSettingTypeTempBool(false)); + AddHandler(Game_SystemType, new CSettingTypeTempNumber(SYSTEM_NTSC)); + AddHandler(Game_EditPlugin_Gfx, new CSettingTypeGame("Plugin-Gfx", Default_None)); + AddHandler(Game_EditPlugin_Audio, new CSettingTypeGame("Plugin-Audio", Default_None)); + AddHandler(Game_EditPlugin_Contr, new CSettingTypeGame("Plugin-Controller", Default_None)); + AddHandler(Game_EditPlugin_RSP, new CSettingTypeGame("Plugin-RSP", Default_None)); + AddHandler(Game_Plugin_Gfx, new CSettingTypeGame("Plugin-Gfx", Plugin_GFX_Current)); + AddHandler(Game_Plugin_Audio, new CSettingTypeGame("Plugin-Audio", Plugin_AUDIO_Current)); + AddHandler(Game_Plugin_Controller, new CSettingTypeGame("Plugin-Controller", Plugin_CONT_Current)); + AddHandler(Game_Plugin_RSP, new CSettingTypeGame("Plugin-RSP", Plugin_RSP_Current)); + AddHandler(Game_SaveChip, new CSettingTypeGame("SaveChip", Rdb_SaveChip)); + AddHandler(Game_CpuType, new CSettingTypeGame("CpuType", Rdb_CpuType)); + AddHandler(Game_LastSaveSlot, new CSettingTypeGame("Last Used Save Slot", (uint32_t)0)); + AddHandler(Game_FixedAudio, new CSettingTypeGame("Fixed Audio", Rdb_FixedAudio)); + AddHandler(Game_RDRamSize, new CSettingTypeGame("RDRamSize", Rdb_RDRamSize)); + AddHandler(Game_CounterFactor, new CSettingTypeGame("Counter Factor", Rdb_CounterFactor)); + AddHandler(Game_UseTlb, new CSettingTypeGame("Use TLB", Rdb_UseTlb)); + AddHandler(Game_DelayDP, new CSettingTypeGame("Delay DP", Rdb_DelayDP)); + AddHandler(Game_DelaySI, new CSettingTypeGame("Delay SI", Rdb_DelaySi)); + AddHandler(Game_RspAudioSignal, new CSettingTypeGame("Audio Signal", Rdb_RspAudioSignal)); + AddHandler(Game_32Bit, new CSettingTypeGame("32bit", Rdb_32Bit)); + AddHandler(Game_FastSP, new CSettingTypeGame("Fast SP", Rdb_FastSP)); + AddHandler(Game_CurrentSaveState, new CSettingTypeTempNumber(0)); + AddHandler(Game_SyncViaAudio, new CSettingTypeGame("Sync Audio", Rdb_SyncViaAudio)); + AddHandler(Game_UseHleGfx, new CSettingTypeGame("HLE GFX", Rdb_UseHleGfx)); + AddHandler(Game_UseHleAudio, new CSettingTypeGame("HLE Audio", Rdb_UseHleAudio)); + AddHandler(Game_LoadRomToMemory, new CSettingTypeGame("Rom In Memory", Rdb_LoadRomToMemory)); + AddHandler(Game_ScreenHertz, new CSettingTypeGame("ScreenHertz", Rdb_ScreenHertz)); + AddHandler(Game_FuncLookupMode, new CSettingTypeGame("FuncFind", Rdb_FuncLookupMode)); + AddHandler(Game_RegCache, new CSettingTypeGame("Reg Cache", Rdb_RegCache)); + AddHandler(Game_BlockLinking, new CSettingTypeGame("Linking", Rdb_BlockLinking)); + AddHandler(Game_SMM_StoreInstruc, new CSettingTypeGame("SMM-StoreInst", Rdb_SMM_StoreInstruc)); + AddHandler(Game_SMM_Cache, new CSettingTypeGame("SMM-Cache", Rdb_SMM_Cache)); + AddHandler(Game_SMM_PIDMA, new CSettingTypeGame("SMM-PI DMA", Rdb_SMM_PIDMA)); + AddHandler(Game_SMM_TLB, new CSettingTypeGame("SMM-TLB", Rdb_SMM_TLB)); + AddHandler(Game_SMM_Protect, new CSettingTypeGame("SMM-Protect", Rdb_SMM_Protect)); + AddHandler(Game_SMM_ValidFunc, new CSettingTypeGame("SMM-FUNC", Rdb_SMM_ValidFunc)); + AddHandler(Game_ViRefreshRate, new CSettingTypeGame("ViRefresh", Rdb_ViRefreshRate)); + AddHandler(Game_AiCountPerBytes, new CSettingTypeGame("AiCountPerBytes", Rdb_AiCountPerBytes)); + AddHandler(Game_AudioResetOnLoad, new CSettingTypeGame("AudioResetOnLoad", Rdb_AudioResetOnLoad)); + AddHandler(Game_AllowROMWrites, new CSettingTypeGame("AllowROMWrites", Rdb_AllowROMWrites)); + AddHandler(Game_CRC_Recalc, new CSettingTypeGame("CRC-Recalc", Rdb_CRC_Recalc)); //User Interface - AddHandler(UserInterface_BasicMode, new CSettingTypeApplication("","Basic Mode", (uint32_t)true)); - AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("","Display CPU Usage", (uint32_t)false)); - AddHandler(UserInterface_DisplayFrameRate, new CSettingTypeApplication("","Display Frame Rate", (uint32_t)true)); - AddHandler(UserInterface_InFullScreen, new CSettingTypeTempBool(false)); - AddHandler(UserInterface_FrameDisplayType, new CSettingTypeApplication("","Frame Rate Display Type", (uint32_t)FR_VIs)); - AddHandler(UserInterface_MainWindowTop, new CSettingTypeApplication("Main Window","Top" ,Default_None)); - AddHandler(UserInterface_MainWindowLeft, new CSettingTypeApplication("Main Window","Left" ,Default_None)); - AddHandler(UserInterface_AlwaysOnTop, new CSettingTypeApplication("","Always on top", (uint32_t)false)); + AddHandler(UserInterface_BasicMode, new CSettingTypeApplication("", "Basic Mode", (uint32_t)true)); + AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("", "Display CPU Usage", (uint32_t)false)); + AddHandler(UserInterface_DisplayFrameRate, new CSettingTypeApplication("", "Display Frame Rate", (uint32_t)true)); + AddHandler(UserInterface_InFullScreen, new CSettingTypeTempBool(false)); + AddHandler(UserInterface_FrameDisplayType, new CSettingTypeApplication("", "Frame Rate Display Type", (uint32_t)FR_VIs)); + AddHandler(UserInterface_MainWindowTop, new CSettingTypeApplication("Main Window", "Top", Default_None)); + AddHandler(UserInterface_MainWindowLeft, new CSettingTypeApplication("Main Window", "Left", Default_None)); + AddHandler(UserInterface_AlwaysOnTop, new CSettingTypeApplication("", "Always on top", (uint32_t)false)); - AddHandler(RomBrowser_Enabled, new CSettingTypeApplication("Rom Browser","Rom Browser",true)); - AddHandler(RomBrowser_ColoumnsChanged, new CSettingTypeTempBool(false)); - AddHandler(RomBrowser_Top, new CSettingTypeApplication("Rom Browser","Top" ,Default_None)); - AddHandler(RomBrowser_Left, new CSettingTypeApplication("Rom Browser","Left" ,Default_None)); - AddHandler(RomBrowser_Width, new CSettingTypeApplication("Rom Browser","Width", (uint32_t)640)); - AddHandler(RomBrowser_Height, new CSettingTypeApplication("Rom Browser","Height", (uint32_t)480)); - AddHandler(RomBrowser_PosIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Pos","Field",Default_None)); - AddHandler(RomBrowser_WidthIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Width","Field",Default_None)); - AddHandler(RomBrowser_SortFieldIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Field", Default_None)); - AddHandler(RomBrowser_SortAscendingIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Ascending", Default_None)); - AddHandler(RomBrowser_Recursive, new CSettingTypeApplication("Rom Browser","Recursive", false)); - AddHandler(RomBrowser_Maximized, new CSettingTypeApplication("Rom Browser","Maximized", false)); + AddHandler(RomBrowser_Enabled, new CSettingTypeApplication("Rom Browser", "Rom Browser", true)); + AddHandler(RomBrowser_ColoumnsChanged, new CSettingTypeTempBool(false)); + AddHandler(RomBrowser_Top, new CSettingTypeApplication("Rom Browser", "Top", Default_None)); + AddHandler(RomBrowser_Left, new CSettingTypeApplication("Rom Browser", "Left", Default_None)); + AddHandler(RomBrowser_Width, new CSettingTypeApplication("Rom Browser", "Width", (uint32_t)640)); + AddHandler(RomBrowser_Height, new CSettingTypeApplication("Rom Browser", "Height", (uint32_t)480)); + AddHandler(RomBrowser_PosIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Pos", "Field", Default_None)); + AddHandler(RomBrowser_WidthIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Width", "Field", Default_None)); + AddHandler(RomBrowser_SortFieldIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Field", Default_None)); + AddHandler(RomBrowser_SortAscendingIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Ascending", Default_None)); + AddHandler(RomBrowser_Recursive, new CSettingTypeApplication("Rom Browser", "Recursive", false)); + AddHandler(RomBrowser_Maximized, new CSettingTypeApplication("Rom Browser", "Maximized", false)); - AddHandler(Directory_RecentGameDirCount, new CSettingTypeApplication("","Remembered Rom Dirs",(uint32_t)10)); - AddHandler(Directory_RecentGameDirIndex, new CSettingTypeApplicationIndex("Recent Dir","Recent Dir",Default_None)); + AddHandler(Directory_RecentGameDirCount, new CSettingTypeApplication("", "Remembered Rom Dirs", (uint32_t)10)); + AddHandler(Directory_RecentGameDirIndex, new CSettingTypeApplicationIndex("Recent Dir", "Recent Dir", Default_None)); //Directory_Game, - AddHandler(Directory_Game, new CSettingTypeSelectedDirectory("Dir:Game",Directory_GameInitial,Directory_GameSelected,Directory_GameUseSelected)); - AddHandler(Directory_GameInitial, new CSettingTypeRelativePath("Game Directory","")); - AddHandler(Directory_GameSelected, new CSettingTypeApplication("Directory","Game",Directory_GameInitial)); - AddHandler(Directory_GameUseSelected, new CSettingTypeApplication("Directory","Game - Use Selected",false)); + AddHandler(Directory_Game, new CSettingTypeSelectedDirectory("Dir:Game", Directory_GameInitial, Directory_GameSelected, Directory_GameUseSelected)); + AddHandler(Directory_GameInitial, new CSettingTypeRelativePath("Game Directory", "")); + AddHandler(Directory_GameSelected, new CSettingTypeApplication("Directory", "Game", Directory_GameInitial)); + AddHandler(Directory_GameUseSelected, new CSettingTypeApplication("Directory", "Game - Use Selected", false)); - AddHandler(Directory_Plugin, new CSettingTypeSelectedDirectory("Dir:Plugin",Directory_PluginInitial,Directory_PluginSelected,Directory_PluginUseSelected)); + AddHandler(Directory_Plugin, new CSettingTypeSelectedDirectory("Dir:Plugin", Directory_PluginInitial, Directory_PluginSelected, Directory_PluginUseSelected)); #ifdef _M_IX86 - AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin", "")); - AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory","Plugin",Directory_PluginInitial)); - AddHandler(Directory_PluginUseSelected, new CSettingTypeApplication("Directory","Plugin - Use Selected",false)); - AddHandler(Directory_PluginSync, new CSettingTypeRelativePath("SyncPlugin","")); + AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin", "")); + AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory", "Plugin", Directory_PluginInitial)); + AddHandler(Directory_PluginUseSelected, new CSettingTypeApplication("Directory", "Plugin - Use Selected", false)); + AddHandler(Directory_PluginSync, new CSettingTypeRelativePath("SyncPlugin", "")); #else AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin64", "")); AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory", "Plugin64", Directory_PluginInitial)); @@ -262,79 +263,79 @@ void CSettings::AddHowToHandleSetting () AddHandler(Directory_PluginSync, new CSettingTypeRelativePath("SyncPlugin64", "")); #endif - AddHandler(Directory_SnapShot, new CSettingTypeSelectedDirectory("Dir:Snapshot",Directory_SnapShotInitial,Directory_SnapShotSelected,Directory_SnapShotUseSelected)); - AddHandler(Directory_SnapShotInitial, new CSettingTypeRelativePath("Screenshots","")); - AddHandler(Directory_SnapShotSelected, new CSettingTypeApplicationPath("Directory","Snap Shot",Directory_SnapShotInitial)); - AddHandler(Directory_SnapShotUseSelected, new CSettingTypeApplication("Directory","Snap Shot - Use Selected",false)); + AddHandler(Directory_SnapShot, new CSettingTypeSelectedDirectory("Dir:Snapshot", Directory_SnapShotInitial, Directory_SnapShotSelected, Directory_SnapShotUseSelected)); + AddHandler(Directory_SnapShotInitial, new CSettingTypeRelativePath("Screenshots", "")); + AddHandler(Directory_SnapShotSelected, new CSettingTypeApplicationPath("Directory", "Snap Shot", Directory_SnapShotInitial)); + AddHandler(Directory_SnapShotUseSelected, new CSettingTypeApplication("Directory", "Snap Shot - Use Selected", false)); - AddHandler(Directory_NativeSave, new CSettingTypeSelectedDirectory("Dir:NativeSave",Directory_NativeSaveInitial,Directory_NativeSaveSelected,Directory_NativeSaveUseSelected)); - AddHandler(Directory_NativeSaveInitial, new CSettingTypeRelativePath("Save","")); - AddHandler(Directory_NativeSaveSelected, new CSettingTypeApplicationPath("Directory","Save",Directory_NativeSaveInitial)); - AddHandler(Directory_NativeSaveUseSelected,new CSettingTypeApplication("Directory","Save - Use Selected",false)); + AddHandler(Directory_NativeSave, new CSettingTypeSelectedDirectory("Dir:NativeSave", Directory_NativeSaveInitial, Directory_NativeSaveSelected, Directory_NativeSaveUseSelected)); + AddHandler(Directory_NativeSaveInitial, new CSettingTypeRelativePath("Save", "")); + AddHandler(Directory_NativeSaveSelected, new CSettingTypeApplicationPath("Directory", "Save", Directory_NativeSaveInitial)); + AddHandler(Directory_NativeSaveUseSelected, new CSettingTypeApplication("Directory", "Save - Use Selected", false)); - AddHandler(Directory_InstantSave, new CSettingTypeSelectedDirectory("Dir:InstantSave",Directory_InstantSaveInitial,Directory_InstantSaveSelected,Directory_InstantSaveUseSelected)); - AddHandler(Directory_InstantSaveInitial, new CSettingTypeRelativePath("Save","")); - AddHandler(Directory_InstantSaveSelected, new CSettingTypeApplicationPath("Directory","Instant Save",Directory_InstantSaveInitial)); - AddHandler(Directory_InstantSaveUseSelected,new CSettingTypeApplication("Directory","Instant Save - Use Selected",false)); + AddHandler(Directory_InstantSave, new CSettingTypeSelectedDirectory("Dir:InstantSave", Directory_InstantSaveInitial, Directory_InstantSaveSelected, Directory_InstantSaveUseSelected)); + AddHandler(Directory_InstantSaveInitial, new CSettingTypeRelativePath("Save", "")); + AddHandler(Directory_InstantSaveSelected, new CSettingTypeApplicationPath("Directory", "Instant Save", Directory_InstantSaveInitial)); + AddHandler(Directory_InstantSaveUseSelected, new CSettingTypeApplication("Directory", "Instant Save - Use Selected", false)); - AddHandler(Directory_Texture, new CSettingTypeSelectedDirectory("Dir:Texture",Directory_TextureInitial,Directory_TextureSelected,Directory_TextureUseSelected)); - AddHandler(Directory_TextureInitial, new CSettingTypeRelativePath("Textures","")); - AddHandler(Directory_TextureSelected, new CSettingTypeApplicationPath("Directory","Texture Dir",Directory_InstantSaveInitial)); - AddHandler(Directory_TextureUseSelected, new CSettingTypeApplication("Directory","Texture Dir - Use Selected",false)); + AddHandler(Directory_Texture, new CSettingTypeSelectedDirectory("Dir:Texture", Directory_TextureInitial, Directory_TextureSelected, Directory_TextureUseSelected)); + AddHandler(Directory_TextureInitial, new CSettingTypeRelativePath("Textures", "")); + AddHandler(Directory_TextureSelected, new CSettingTypeApplicationPath("Directory", "Texture Dir", Directory_InstantSaveInitial)); + AddHandler(Directory_TextureUseSelected, new CSettingTypeApplication("Directory", "Texture Dir - Use Selected", false)); - AddHandler(Directory_LastSave, new CSettingTypeApplication("Directory","Last Save Directory", Directory_InstantSave)); + AddHandler(Directory_LastSave, new CSettingTypeApplication("Directory", "Last Save Directory", Directory_InstantSave)); - AddHandler(GameRunning_LoadingInProgress, new CSettingTypeTempBool(false)); - AddHandler(GameRunning_CPU_Running, new CSettingTypeTempBool(false)); - AddHandler(GameRunning_CPU_Paused, new CSettingTypeTempBool(false)); - AddHandler(GameRunning_CPU_PausedType, new CSettingTypeTempNumber(Default_None)); - AddHandler(GameRunning_InstantSaveFile, new CSettingTypeTempString("")); - AddHandler(GameRunning_LimitFPS, new CSettingTypeTempBool(true)); - AddHandler(GameRunning_ScreenHertz, new CSettingTypeTempNumber(60)); - AddHandler(GameRunning_InReset, new CSettingTypeTempBool(false)); + AddHandler(GameRunning_LoadingInProgress, new CSettingTypeTempBool(false)); + AddHandler(GameRunning_CPU_Running, new CSettingTypeTempBool(false)); + AddHandler(GameRunning_CPU_Paused, new CSettingTypeTempBool(false)); + AddHandler(GameRunning_CPU_PausedType, new CSettingTypeTempNumber(Default_None)); + AddHandler(GameRunning_InstantSaveFile, new CSettingTypeTempString("")); + AddHandler(GameRunning_LimitFPS, new CSettingTypeTempBool(true)); + AddHandler(GameRunning_ScreenHertz, new CSettingTypeTempNumber(60)); + AddHandler(GameRunning_InReset, new CSettingTypeTempBool(false)); - AddHandler(File_RecentGameFileCount, new CSettingTypeApplication("","Remembered Rom Files",(uint32_t)10)); - AddHandler(File_RecentGameFileIndex, new CSettingTypeApplicationIndex("Recent File","Recent Rom",Default_None)); + AddHandler(File_RecentGameFileCount, new CSettingTypeApplication("", "Remembered Rom Files", (uint32_t)10)); + AddHandler(File_RecentGameFileIndex, new CSettingTypeApplicationIndex("Recent File", "Recent Rom", Default_None)); - AddHandler(Debugger_Enabled, new CSettingTypeApplication("Debugger","Debugger",false)); - AddHandler(Debugger_ShowTLBMisses, new CSettingTypeApplication("Debugger","Show TLB Misses",false)); - AddHandler(Debugger_ShowUnhandledMemory, new CSettingTypeApplication("Debugger","Show Unhandled Memory",false)); - AddHandler(Debugger_ShowPifErrors, new CSettingTypeApplication("Debugger","Show Pif Errors",false)); - AddHandler(Debugger_DisableGameFixes, new CSettingTypeApplication("Debugger","Disable Game Fixes",false)); - AddHandler(Debugger_ShowDListAListCount, new CSettingTypeApplication("Debugger","Show Dlist Alist Count",false)); - AddHandler(Debugger_ShowRecompMemSize, new CSettingTypeApplication("Debugger","Show Recompiler Memory size",false)); - AddHandler(Debugger_ShowDivByZero, new CSettingTypeApplication("Debugger","Show Div by zero",false)); - AddHandler(Debugger_GenerateDebugLog, new CSettingTypeApplication("Debugger","Generate Debug Code",false)); - AddHandler(Debugger_ProfileCode, new CSettingTypeApplication("Debugger","Profile Code",(uint32_t)false)); - AddHandler(Debugger_AppLogLevel, new CSettingTypeApplication("Logging","Log Level",(uint32_t)TraceError)); - AddHandler(Debugger_AppLogFlush, new CSettingTypeApplication("Logging","Log Auto Flush",(uint32_t)false)); - AddHandler(Debugger_GenerateLogFiles, new CSettingTypeApplication("Debugger","Generate Log Files", false)); + AddHandler(Debugger_Enabled, new CSettingTypeApplication("Debugger", "Debugger", false)); + AddHandler(Debugger_ShowTLBMisses, new CSettingTypeApplication("Debugger", "Show TLB Misses", false)); + AddHandler(Debugger_ShowUnhandledMemory, new CSettingTypeApplication("Debugger", "Show Unhandled Memory", false)); + AddHandler(Debugger_ShowPifErrors, new CSettingTypeApplication("Debugger", "Show Pif Errors", false)); + AddHandler(Debugger_DisableGameFixes, new CSettingTypeApplication("Debugger", "Disable Game Fixes", false)); + AddHandler(Debugger_ShowDListAListCount, new CSettingTypeApplication("Debugger", "Show Dlist Alist Count", false)); + AddHandler(Debugger_ShowRecompMemSize, new CSettingTypeApplication("Debugger", "Show Recompiler Memory size", false)); + AddHandler(Debugger_ShowDivByZero, new CSettingTypeApplication("Debugger", "Show Div by zero", false)); + AddHandler(Debugger_GenerateDebugLog, new CSettingTypeApplication("Debugger", "Generate Debug Code", false)); + AddHandler(Debugger_ProfileCode, new CSettingTypeApplication("Debugger", "Profile Code", (uint32_t)false)); + AddHandler(Debugger_AppLogLevel, new CSettingTypeApplication("Logging", "Log Level", (uint32_t)TraceError)); + AddHandler(Debugger_AppLogFlush, new CSettingTypeApplication("Logging", "Log Auto Flush", (uint32_t)false)); + AddHandler(Debugger_GenerateLogFiles, new CSettingTypeApplication("Debugger", "Generate Log Files", false)); //Plugin - AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin","RSP Dll", "RSP\\RSP 1.7.dll")); - AddHandler(Plugin_GFX_Current, new CSettingTypeApplication("Plugin","Graphics Dll", "GFX\\Jabo_Direct3D8.dll")); - AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin","Audio Dll", "Audio\\Jabo_Dsound.dll")); - AddHandler(Plugin_CONT_Current, new CSettingTypeApplication("Plugin","Controller Dll","Input\\PJ64_NRage.dll")); + AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin", "RSP Dll", "RSP\\RSP 1.7.dll")); + AddHandler(Plugin_GFX_Current, new CSettingTypeApplication("Plugin", "Graphics Dll", "GFX\\Jabo_Direct3D8.dll")); + AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin", "Audio Dll", "Audio\\Jabo_Dsound.dll")); + AddHandler(Plugin_CONT_Current, new CSettingTypeApplication("Plugin", "Controller Dll", "Input\\PJ64_NRage.dll")); - AddHandler(Plugin_RSP_CurVer, new CSettingTypeApplication("Plugin","RSP Dll Ver", "")); - AddHandler(Plugin_GFX_CurVer, new CSettingTypeApplication("Plugin","Graphics Dll Ver", "")); - AddHandler(Plugin_AUDIO_CurVer, new CSettingTypeApplication("Plugin","Audio Dll Ver", "")); - AddHandler(Plugin_CONT_CurVer, new CSettingTypeApplication("Plugin","Controller Dll Ver", "")); + AddHandler(Plugin_RSP_CurVer, new CSettingTypeApplication("Plugin", "RSP Dll Ver", "")); + AddHandler(Plugin_GFX_CurVer, new CSettingTypeApplication("Plugin", "Graphics Dll Ver", "")); + AddHandler(Plugin_AUDIO_CurVer, new CSettingTypeApplication("Plugin", "Audio Dll Ver", "")); + AddHandler(Plugin_CONT_CurVer, new CSettingTypeApplication("Plugin", "Controller Dll Ver", "")); - AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP","HLE GFX",true)); - AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP","HLE Audio",false)); + AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP", "HLE GFX", true)); + AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP", "HLE Audio", false)); // cheats - AddHandler(Cheat_Entry, new CSettingTypeCheats("")); - AddHandler(Cheat_Active, new CSettingTypeGameIndex("Cheat","",(uint32_t)false)); - AddHandler(Cheat_Extension, new CSettingTypeGameIndex("Cheat",".exten","??? - Not Set")); - AddHandler(Cheat_Notes, new CSettingTypeCheats("_N")); - AddHandler(Cheat_Options, new CSettingTypeCheats("_O")); - AddHandler(Cheat_Range, new CSettingTypeCheats("_R")); - AddHandler(Cheat_RangeNotes, new CSettingTypeCheats("_RN")); + AddHandler(Cheat_Entry, new CSettingTypeCheats("")); + AddHandler(Cheat_Active, new CSettingTypeGameIndex("Cheat", "", (uint32_t)false)); + AddHandler(Cheat_Extension, new CSettingTypeGameIndex("Cheat", ".exten", "??? - Not Set")); + AddHandler(Cheat_Notes, new CSettingTypeCheats("_N")); + AddHandler(Cheat_Options, new CSettingTypeCheats("_O")); + AddHandler(Cheat_Range, new CSettingTypeCheats("_R")); + AddHandler(Cheat_RangeNotes, new CSettingTypeCheats("_RN")); } -uint32_t CSettings::FindSetting ( CSettings * _this, const char * Name ) +uint32_t CSettings::FindSetting(CSettings * _this, const char * Name) { for (SETTING_MAP::iterator iter = _this->m_SettingInfo.begin(); iter != _this->m_SettingInfo.end(); iter++) { @@ -342,7 +343,7 @@ uint32_t CSettings::FindSetting ( CSettings * _this, const char * Name ) if (Setting->GetSettingType() == SettingType_GameSetting) { CSettingTypeGame * GameSetting = (CSettingTypeGame *)Setting; - if (_stricmp(GameSetting->GetKeyName(),Name) != 0) + if (_stricmp(GameSetting->GetKeyName(), Name) != 0) { continue; } @@ -351,7 +352,7 @@ uint32_t CSettings::FindSetting ( CSettings * _this, const char * Name ) if (Setting->GetSettingType() == SettingType_CfgFile) { CSettingTypeApplication * CfgSetting = (CSettingTypeApplication *)Setting; - if (_stricmp(CfgSetting->GetKeyName(),Name) != 0) + if (_stricmp(CfgSetting->GetKeyName(), Name) != 0) { continue; } @@ -360,7 +361,7 @@ uint32_t CSettings::FindSetting ( CSettings * _this, const char * Name ) if (Setting->GetSettingType() == SettingType_SelectedDirectory) { CSettingTypeSelectedDirectory * SelectedDirectory = (CSettingTypeSelectedDirectory *)Setting; - if (_stricmp(SelectedDirectory->GetName(),Name) != 0) + if (_stricmp(SelectedDirectory->GetName(), Name) != 0) { continue; } @@ -370,58 +371,58 @@ uint32_t CSettings::FindSetting ( CSettings * _this, const char * Name ) return 0; } -void CSettings::FlushSettings ( CSettings * /*_this*/ ) +void CSettings::FlushSettings(CSettings * /*_this*/) { CSettingTypeCheats::FlushChanges(); CSettingTypeApplication::Flush(); } -uint32_t CSettings::GetSetting ( CSettings * _this, SettingID Type ) +uint32_t CSettings::GetSetting(CSettings * _this, SettingID Type) { return _this->LoadDword(Type); } -const char * CSettings::GetSettingSz ( CSettings * _this, SettingID Type, char * Buffer, int BufferSize ) +const char * CSettings::GetSettingSz(CSettings * _this, SettingID Type, char * Buffer, int BufferSize) { if (Buffer && BufferSize > 0) { Buffer[0] = 0; - _this->LoadStringVal(Type, Buffer,BufferSize); + _this->LoadStringVal(Type, Buffer, BufferSize); } return Buffer; } -void CSettings::SetSetting ( CSettings * _this, SettingID ID, unsigned int Value ) +void CSettings::SetSetting(CSettings * _this, SettingID ID, unsigned int Value) { - _this->SaveDword(ID,Value); + _this->SaveDword(ID, Value); } -void CSettings::SetSettingSz ( CSettings * _this, SettingID ID, const char * Value ) +void CSettings::SetSettingSz(CSettings * _this, SettingID ID, const char * Value) { - _this->SaveString(ID,Value); + _this->SaveString(ID, Value); } -void CSettings::RegisterSetting ( CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType, - SettingType Type, const char * Category, const char * DefaultStr, - uint32_t Value ) +void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType, + SettingType Type, const char * Category, const char * DefaultStr, + uint32_t Value) { switch (Type) { case SettingType_ConstValue: if (DataType != Data_DWORD) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return; } - _this->AddHandler(ID,new CSettingTypeTempNumber(Value)); + _this->AddHandler(ID, new CSettingTypeTempNumber(Value)); break; case SettingType_ConstString: if (DataType != Data_String) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return; } - _this->AddHandler(ID,new CSettingTypeTempString(DefaultStr)); + _this->AddHandler(ID, new CSettingTypeTempString(DefaultStr)); break; case SettingType_CfgFile: case SettingType_Registry: @@ -430,73 +431,79 @@ void CSettings::RegisterSetting ( CSettings * _this, SettingID ID, SettingID Def case Data_DWORD: if (DefaultID == Default_None) { - _this->AddHandler(ID,new CSettingTypeApplication(Category,DefaultStr,Value)); - } else { - _this->AddHandler(ID,new CSettingTypeApplication(Category,DefaultStr,DefaultID)); + _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, Value)); + } + else { + _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID)); } break; case Data_String: if (DefaultID == Default_None) { - _this->AddHandler(ID,new CSettingTypeApplication(Category,DefaultStr,"")); - } else { - _this->AddHandler(ID,new CSettingTypeApplication(Category,DefaultStr,DefaultID)); + _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, "")); + } + else { + _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID)); } break; default: - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } break; case SettingType_GameSetting: + { + stdstr_f Name("%s-%s", Category, DefaultStr); + switch (DataType) { - stdstr_f Name("%s-%s",Category,DefaultStr); - switch (DataType) + case Data_DWORD: + if (DefaultID == Default_None) { - case Data_DWORD: - if (DefaultID == Default_None) - { - SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId; - _this->m_NextAutoSettingId += 1; - _this->AddHandler(RdbSetting,new CSettingTypeRomDatabase(Name.c_str(),(int)Value)); - _this->AddHandler(ID,new CSettingTypeGame(Name.c_str(),RdbSetting)); - } else { - _this->AddHandler(ID,new CSettingTypeGame(Name.c_str(),DefaultID)); - } - break; - case Data_String: - if (DefaultID == Default_None) - { - _this->AddHandler(ID,new CSettingTypeGame(Name.c_str(),"")); - } else { - _this->AddHandler(ID,new CSettingTypeGame(Name.c_str(),DefaultID)); - } - break; - default: - g_Notify->BreakPoint(__FILEW__,__LINE__); + SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId; + _this->m_NextAutoSettingId += 1; + _this->AddHandler(RdbSetting, new CSettingTypeRomDatabase(Name.c_str(), (int)Value)); + _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), RdbSetting)); } + else { + _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID)); + } + break; + case Data_String: + if (DefaultID == Default_None) + { + _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), "")); + } + else { + _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID)); + } + break; + default: + g_Notify->BreakPoint(__FILEW__, __LINE__); } - break; + } + break; case SettingType_RomDatabase: switch (DataType) { case Data_DWORD: if (DefaultID == Default_None) { - _this->AddHandler(ID,new CSettingTypeRomDatabase(DefaultStr,(int)Value,true)); - } else { - _this->AddHandler(ID,new CSettingTypeRomDatabase(DefaultStr,(SettingID)Value,true)); + _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (int)Value, true)); + } + else { + _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (SettingID)Value, true)); } break; case Data_String: if (DefaultID == Default_None) { - _this->AddHandler(ID,new CSettingTypeRomDatabase(DefaultStr,"",true)); - } else { - _this->AddHandler(ID,new CSettingTypeRomDatabase(DefaultStr,DefaultID,true)); + _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, "", true)); + } + else { + _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, DefaultID, true)); } break; default: - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } break; case SettingType_RdbSetting: @@ -505,24 +512,25 @@ void CSettings::RegisterSetting ( CSettings * _this, SettingID ID, SettingID Def case Data_DWORD: if (DefaultID == Default_None) { - _this->AddHandler(ID,new CSettingTypeRomDatabaseSetting(Category, DefaultStr,(int)Value,true)); - } else { + _this->AddHandler(ID, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, (int)Value, true)); + } + else { SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId; _this->m_NextAutoSettingId += 1; - _this->AddHandler(RdbSetting,new CSettingTypeRomDatabaseSetting(Category, DefaultStr,DefaultID,true)); - _this->AddHandler(ID,new CSettingTypeApplication(Category,DefaultStr,RdbSetting)); + _this->AddHandler(RdbSetting, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, DefaultID, true)); + _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, RdbSetting)); } break; default: - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } break; default: - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } } -bool CSettings::Initialize( const char * AppName ) +bool CSettings::Initialize(const char * AppName) { AddHowToHandleSetting(); CSettingTypeApplication::Initialize(AppName); @@ -530,18 +538,18 @@ bool CSettings::Initialize( const char * AppName ) CSettingTypeGame::Initialize(); CSettingTypeCheats::Initialize(); - g_Settings->SaveString(Setting_ApplicationName,AppName); + g_Settings->SaveString(Setting_ApplicationName, AppName); return true; } -bool CSettings::LoadBool ( SettingID Type ) +bool CSettings::LoadBool(SettingID Type) { bool Value = false; - LoadBool(Type,Value); + LoadBool(Type, Value); return Value; } -bool CSettings::LoadBool ( SettingID Type, bool & Value ) +bool CSettings::LoadBool(SettingID Type, bool & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -552,21 +560,22 @@ bool CSettings::LoadBool ( SettingID Type, bool & Value ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - return FindInfo->second->Load(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + return FindInfo->second->Load(0, Value); } return false; } -bool CSettings::LoadBoolIndex( SettingID Type, int index ) +bool CSettings::LoadBoolIndex(SettingID Type, int index) { bool Value = false; - LoadBoolIndex(Type,index,Value); + LoadBoolIndex(Type, index, Value); return Value; } -bool CSettings::LoadBoolIndex( SettingID Type, int index , bool & Value ) +bool CSettings::LoadBoolIndex(SettingID Type, int index, bool & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -577,21 +586,22 @@ bool CSettings::LoadBoolIndex( SettingID Type, int index , bool & Value ) } if (FindInfo->second->IndexBasedSetting()) { - return FindInfo->second->Load(index,Value); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + return FindInfo->second->Load(index, Value); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } return false; } -uint32_t CSettings::LoadDword ( SettingID Type ) +uint32_t CSettings::LoadDword(SettingID Type) { uint32_t Value = 0; - LoadDword(Type,Value); + LoadDword(Type, Value); return Value; } -bool CSettings::LoadDword ( SettingID Type, uint32_t & Value) +bool CSettings::LoadDword(SettingID Type, uint32_t & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -602,21 +612,22 @@ bool CSettings::LoadDword ( SettingID Type, uint32_t & Value) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - return FindInfo->second->Load(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + return FindInfo->second->Load(0, Value); } return false; } -uint32_t CSettings::LoadDwordIndex( SettingID Type, int index) +uint32_t CSettings::LoadDwordIndex(SettingID Type, int index) { uint32_t Value; - LoadDwordIndex(Type,index,Value); + LoadDwordIndex(Type, index, Value); return Value; } -bool CSettings::LoadDwordIndex( SettingID Type, int index, uint32_t & Value) +bool CSettings::LoadDwordIndex(SettingID Type, int index, uint32_t & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -627,21 +638,22 @@ bool CSettings::LoadDwordIndex( SettingID Type, int index, uint32_t & Value) } if (FindInfo->second->IndexBasedSetting()) { - return FindInfo->second->Load(index,Value); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + return FindInfo->second->Load(index, Value); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } return false; } -stdstr CSettings::LoadStringVal ( SettingID Type ) +stdstr CSettings::LoadStringVal(SettingID Type) { stdstr Value; - LoadStringVal(Type,Value); + LoadStringVal(Type, Value); return Value; } -bool CSettings::LoadStringVal ( SettingID Type, stdstr & Value ) +bool CSettings::LoadStringVal(SettingID Type, stdstr & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -652,14 +664,15 @@ bool CSettings::LoadStringVal ( SettingID Type, stdstr & Value ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - return FindInfo->second->Load(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + return FindInfo->second->Load(0, Value); } return false; } -bool CSettings::LoadStringVal ( SettingID Type, char * Buffer, int BufferSize ) +bool CSettings::LoadStringVal(SettingID Type, char * Buffer, int BufferSize) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -671,28 +684,29 @@ bool CSettings::LoadStringVal ( SettingID Type, char * Buffer, int BufferSize ) bool bRes = false; if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { stdstr Value; - bRes = FindInfo->second->Load(0,Value); + bRes = FindInfo->second->Load(0, Value); int len = BufferSize; if ((Value.length() + 1) < (size_t)len) { len = Value.length() + 1; } - strncpy(Buffer,Value.c_str(),len); + strncpy(Buffer, Value.c_str(), len); } return bRes; } -stdstr CSettings::LoadStringIndex ( SettingID Type, int index ) +stdstr CSettings::LoadStringIndex(SettingID Type, int index) { stdstr Value; - LoadStringIndex(Type,index,Value); + LoadStringIndex(Type, index, Value); return Value; } -bool CSettings::LoadStringIndex ( SettingID Type, int index, stdstr & Value ) +bool CSettings::LoadStringIndex(SettingID Type, int index, stdstr & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -703,136 +717,143 @@ bool CSettings::LoadStringIndex ( SettingID Type, int index, stdstr & Value ) } if (FindInfo->second->IndexBasedSetting()) { - return FindInfo->second->Load(index,Value); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + return FindInfo->second->Load(index, Value); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } return false; } -bool CSettings::LoadStringIndex ( SettingID /*Type*/, int /*index*/, char * /*Buffer*/, int /*BufferSize*/ ) +bool CSettings::LoadStringIndex(SettingID /*Type*/, int /*index*/, char * /*Buffer*/, int /*BufferSize*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return false; } //Load the default value for the setting -bool CSettings::LoadDefaultBool ( SettingID Type ) +bool CSettings::LoadDefaultBool(SettingID Type) { bool Value = false; - LoadDefaultBool(Type,Value); + LoadDefaultBool(Type, Value); return Value; } -void CSettings::LoadDefaultBool ( SettingID Type, bool & Value ) +void CSettings::LoadDefaultBool(SettingID Type, bool & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) { //if not found do nothing UnknownSetting(Type); - } else { + } + else { if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->LoadDefault(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->LoadDefault(0, Value); } } } -bool CSettings::LoadDefaultBoolIndex ( SettingID /*Type*/, int /*index*/ ) +bool CSettings::LoadDefaultBoolIndex(SettingID /*Type*/, int /*index*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return false; } -void CSettings::LoadDefaultBoolIndex ( SettingID /*Type*/, int /*index*/, bool & /*Value*/ ) +void CSettings::LoadDefaultBoolIndex(SettingID /*Type*/, int /*index*/, bool & /*Value*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -uint32_t CSettings::LoadDefaultDword ( SettingID Type ) +uint32_t CSettings::LoadDefaultDword(SettingID Type) { uint32_t Value = 0; - LoadDefaultDword(Type,Value); + LoadDefaultDword(Type, Value); return Value; } -void CSettings::LoadDefaultDword ( SettingID Type, uint32_t & Value) +void CSettings::LoadDefaultDword(SettingID Type, uint32_t & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) { //if not found do nothing UnknownSetting(Type); - } else { + } + else { if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->LoadDefault(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->LoadDefault(0, Value); } } } -uint32_t CSettings::LoadDefaultDwordIndex ( SettingID /*Type*/, int /*index*/ ) +uint32_t CSettings::LoadDefaultDwordIndex(SettingID /*Type*/, int /*index*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return false; } -void CSettings::LoadDefaultDwordIndex ( SettingID /*Type*/, int /*index*/, uint32_t & /*Value*/) +void CSettings::LoadDefaultDwordIndex(SettingID /*Type*/, int /*index*/, uint32_t & /*Value*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -stdstr CSettings::LoadDefaultString ( SettingID Type ) +stdstr CSettings::LoadDefaultString(SettingID Type) { stdstr Value; - LoadDefaultString(Type,Value); + LoadDefaultString(Type, Value); return Value; } -void CSettings::LoadDefaultString ( SettingID Type, stdstr & Value ) +void CSettings::LoadDefaultString(SettingID Type, stdstr & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) { //if not found do nothing UnknownSetting(Type); - } else { + } + else { if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->LoadDefault(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->LoadDefault(0, Value); } } } -void CSettings::LoadDefaultString ( SettingID /*Type*/, char * /*Buffer*/, int /*BufferSize*/ ) +void CSettings::LoadDefaultString(SettingID /*Type*/, char * /*Buffer*/, int /*BufferSize*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -stdstr CSettings::LoadDefaultStringIndex ( SettingID /*Type*/, int /*index*/ ) +stdstr CSettings::LoadDefaultStringIndex(SettingID /*Type*/, int /*index*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return false; } -void CSettings::LoadDefaultStringIndex ( SettingID /*Type*/, int /*index*/, stdstr & /*Value*/ ) +void CSettings::LoadDefaultStringIndex(SettingID /*Type*/, int /*index*/, stdstr & /*Value*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -void CSettings::LoadDefaultStringIndex ( SettingID /*Type*/, int /*index*/, char * /*Buffer*/, int /*BufferSize*/ ) +void CSettings::LoadDefaultStringIndex(SettingID /*Type*/, int /*index*/, char * /*Buffer*/, int /*BufferSize*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -void CSettings::SaveBool ( SettingID Type, bool Value ) +void CSettings::SaveBool(SettingID Type, bool Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -843,14 +864,15 @@ void CSettings::SaveBool ( SettingID Type, bool Value ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->Save(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->Save(0, Value); } NotifyCallBacks(Type); } -void CSettings::SaveBoolIndex( SettingID Type, int index, bool Value ) +void CSettings::SaveBoolIndex(SettingID Type, int index, bool Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -861,14 +883,15 @@ void CSettings::SaveBoolIndex( SettingID Type, int index, bool Value ) } if (FindInfo->second->IndexBasedSetting()) { - FindInfo->second->Save(index,Value); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + FindInfo->second->Save(index, Value); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); } -void CSettings::SaveDword ( SettingID Type, uint32_t Value ) +void CSettings::SaveDword(SettingID Type, uint32_t Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -879,14 +902,15 @@ void CSettings::SaveDword ( SettingID Type, uint32_t Value ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->Save(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->Save(0, Value); } NotifyCallBacks(Type); } -void CSettings::SaveDwordIndex ( SettingID Type, int index, uint32_t Value ) +void CSettings::SaveDwordIndex(SettingID Type, int index, uint32_t Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -897,14 +921,15 @@ void CSettings::SaveDwordIndex ( SettingID Type, int index, uint32_t Value ) } if (FindInfo->second->IndexBasedSetting()) { - FindInfo->second->Save(index,Value); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + FindInfo->second->Save(index, Value); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); } -void CSettings::SaveString ( SettingID Type, const stdstr & Value ) +void CSettings::SaveString(SettingID Type, const stdstr & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -915,14 +940,15 @@ void CSettings::SaveString ( SettingID Type, const stdstr & Value ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->Save(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->Save(0, Value); } NotifyCallBacks(Type); } -void CSettings::SaveString ( SettingID Type, const char * Buffer ) +void CSettings::SaveString(SettingID Type, const char * Buffer) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -932,14 +958,15 @@ void CSettings::SaveString ( SettingID Type, const char * Buffer ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->Save(0,Buffer); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->Save(0, Buffer); } NotifyCallBacks(Type); } -void CSettings::SaveStringIndex( SettingID Type, int index, const char * Buffer ) +void CSettings::SaveStringIndex(SettingID Type, int index, const char * Buffer) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -949,19 +976,20 @@ void CSettings::SaveStringIndex( SettingID Type, int index, const char * Buffer } if (FindInfo->second->IndexBasedSetting()) { - FindInfo->second->Save(index,Buffer); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + FindInfo->second->Save(index, Buffer); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); } -void CSettings::SaveStringIndex( SettingID Type, int index, const stdstr & Value ) +void CSettings::SaveStringIndex(SettingID Type, int index, const stdstr & Value) { - SaveStringIndex(Type,index,Value.c_str()); + SaveStringIndex(Type, index, Value.c_str()); } -void CSettings::DeleteSetting( SettingID Type ) +void CSettings::DeleteSetting(SettingID Type) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -971,14 +999,15 @@ void CSettings::DeleteSetting( SettingID Type ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { FindInfo->second->Delete(0); } NotifyCallBacks(Type); } -void CSettings::DeleteSettingIndex( SettingID Type, int index ) +void CSettings::DeleteSettingIndex(SettingID Type, int index) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -989,13 +1018,14 @@ void CSettings::DeleteSettingIndex( SettingID Type, int index ) if (FindInfo->second->IndexBasedSetting()) { FindInfo->second->Delete(index); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); } -SettingType CSettings::GetSettingType ( SettingID Type ) +SettingType CSettings::GetSettingType(SettingID Type) { if (Type == Default_None || Type == Default_Constant) { @@ -1010,7 +1040,7 @@ SettingType CSettings::GetSettingType ( SettingID Type ) return FindInfo->second->GetSettingType(); } -bool CSettings::IndexBasedSetting ( SettingID Type ) +bool CSettings::IndexBasedSetting(SettingID Type) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -1020,7 +1050,7 @@ bool CSettings::IndexBasedSetting ( SettingID Type ) return FindInfo->second->IndexBasedSetting(); } -void CSettings::SettingTypeChanged( SettingType Type ) +void CSettings::SettingTypeChanged(SettingType Type) { for (SETTING_MAP::iterator iter = m_SettingInfo.begin(); iter != m_SettingInfo.end(); iter++) { @@ -1030,14 +1060,14 @@ void CSettings::SettingTypeChanged( SettingType Type ) } } } -void CSettings::UnknownSetting (SettingID /*Type*/) +void CSettings::UnknownSetting(SettingID /*Type*/) { #ifdef _DEBUG - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); #endif } -void CSettings::NotifyCallBacks( SettingID Type ) +void CSettings::NotifyCallBacks(SettingID Type) { SETTING_CALLBACK::iterator Callback = m_Callback.find(Type); if (Callback == m_Callback.end()) @@ -1051,7 +1081,7 @@ void CSettings::NotifyCallBacks( SettingID Type ) } } -void CSettings::RegisterChangeCB(SettingID Type,void * Data, SettingChangedFunc Func) +void CSettings::RegisterChangeCB(SettingID Type, void * Data, SettingChangedFunc Func) { SETTING_CHANGED_CB * new_item = new SETTING_CHANGED_CB; new_item->Data = Data; @@ -1067,12 +1097,13 @@ void CSettings::RegisterChangeCB(SettingID Type,void * Data, SettingChangedFunc item = item->Next; } item->Next = new_item; - } else { - m_Callback.insert(SETTING_CALLBACK::value_type(Type,new_item)); + } + else { + m_Callback.insert(SETTING_CALLBACK::value_type(Type, new_item)); } } -void CSettings::UnregisterChangeCB(SettingID Type,void * Data, SettingChangedFunc Func) +void CSettings::UnregisterChangeCB(SettingID Type, void * Data, SettingChangedFunc Func) { bool bRemoved = false; @@ -1095,11 +1126,13 @@ void CSettings::UnregisterChangeCB(SettingID Type,void * Data, SettingChangedFun SettingID Type = Callback->first; SETTING_CHANGED_CB * Next = item->Next; m_Callback.erase(Callback); - m_Callback.insert(SETTING_CALLBACK::value_type(Type,Next)); - } else { + m_Callback.insert(SETTING_CALLBACK::value_type(Type, Next)); + } + else { m_Callback.erase(Callback); } - } else { + } + else { PrevItem->Next = item->Next; } delete item; @@ -1109,13 +1142,14 @@ void CSettings::UnregisterChangeCB(SettingID Type,void * Data, SettingChangedFun PrevItem = item; item = item->Next; } - } else { + } + else { UnknownSetting(Type); return; } if (!bRemoved) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -} +} \ No newline at end of file diff --git a/Source/Project64/Settings/Settings.h b/Source/Project64/Settings/Settings.h index f51b9700c..24b241421 100644 --- a/Source/Project64/Settings/Settings.h +++ b/Source/Project64/Settings/Settings.h @@ -105,6 +105,7 @@ enum SettingID //Individual Game Settings Game_IniKey, + Game_File, Game_GameName, Game_GoodName, Game_TempLoaded, diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index 843a8d89c..49e5ca6f8 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -50,6 +50,7 @@ m_ResetInfo(NULL) g_Settings->RegisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); g_Settings->RegisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); g_Settings->RegisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged); + g_Settings->RegisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded); } //if this fails then it has already been created @@ -66,6 +67,7 @@ CMainGui::~CMainGui(void) g_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); g_Settings->UnregisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); g_Settings->UnregisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged); + g_Settings->UnregisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded); } if (m_hMainWindow) { @@ -118,6 +120,19 @@ void CMainGui::LoadingInProgressChanged(CMainGui * Gui) Gui->RefreshMenu(); } +void CMainGui::GameLoaded(CMainGui * Gui) +{ + stdstr FileLoc = g_Settings->LoadStringVal(Game_File); + if (FileLoc.length() > 0) + { + WriteTrace(TraceDebug, __FUNCTION__ ": Add Recent Rom"); + Notify().AddRecentRom(FileLoc.c_str()); + Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str()); + + Gui->HideRomList(); + } +} + void RomBowserColoumnsChanged(CMainGui * Gui) { Gui->ResetRomBrowserColomuns(); diff --git a/Source/Project64/User Interface/Gui Class.h b/Source/Project64/User Interface/Gui Class.h index 6cbdc625f..0032a1327 100644 --- a/Source/Project64/User Interface/Gui Class.h +++ b/Source/Project64/User Interface/Gui Class.h @@ -112,6 +112,7 @@ private: friend void RomBowserColoumnsChanged(CMainGui * Gui); friend void RomBrowserRecursiveChanged(CMainGui * Gui); static void LoadingInProgressChanged(CMainGui * Gui); + static void GameLoaded(CMainGui * Gui); CBaseMenu * m_Menu;