git-svn-id: https://localhost/svn/Project64/trunk@6 111125ac-702d-7242-af9c-5ba8ae61c1ef

This commit is contained in:
zilmar 2008-11-14 20:51:06 +00:00
parent f8f2f24aad
commit 20429ef4e3
139 changed files with 8397 additions and 2264 deletions

Binary file not shown.

Binary file not shown.

View File

@ -216,6 +216,7 @@ enum LanguageStringID{
PLUG_CTRL = 424, PLUG_CTRL = 424,
PLUG_HLE_GFX = 425, PLUG_HLE_GFX = 425,
PLUG_HLE_AUDIO = 426, PLUG_HLE_AUDIO = 426,
PLUG_DEFAULT = 427,
//Directory Dialog //Directory Dialog
DIR_PLUGIN = 440, DIR_PLUGIN = 440,

View File

@ -167,6 +167,7 @@ void CLanguage::LoadDefaultStrings (void) {
DEF_STR(PLUG_CTRL, " Input (controller) plugin: "); DEF_STR(PLUG_CTRL, " Input (controller) plugin: ");
DEF_STR(PLUG_HLE_GFX, "Use High Level GFX?"); DEF_STR(PLUG_HLE_GFX, "Use High Level GFX?");
DEF_STR(PLUG_HLE_AUDIO,"Use High Level Audio?"); DEF_STR(PLUG_HLE_AUDIO,"Use High Level Audio?");
DEF_STR(PLUG_DEFAULT, "** Use System Plugin **");
//Directory Dialog //Directory Dialog
DEF_STR(DIR_PLUGIN, " Plugin Directoy: "); DEF_STR(DIR_PLUGIN, " Plugin Directoy: ");
@ -461,7 +462,7 @@ void CLanguage::LoadCurrentStrings ( bool ShowSelectDialog )
{ {
if (ShowSelectDialog) if (ShowSelectDialog)
{ {
m_SelectedLanguage = _Settings->LoadString(CurrentLanguage); m_SelectedLanguage = _Settings->LoadString(Setting_CurrentLanguage);
} }
LanguageList LangList = GetLangList(); LanguageList LangList = GetLangList();
@ -917,9 +918,9 @@ LANG_STR CLanguage::GetNextLangString (void * OpenFile) {
void CLanguage::SetLanguage ( char * LanguageName ) void CLanguage::SetLanguage ( char * LanguageName )
{ {
_Settings->SaveString(CurrentLanguage,LanguageName);
m_SelectedLanguage = LanguageName; m_SelectedLanguage = LanguageName;
LoadCurrentStrings(false); LoadCurrentStrings(false);
_Settings->SaveString(Setting_CurrentLanguage,LanguageName);
} }
bool CLanguage::IsCurrentLang( LanguageFile & File ) bool CLanguage::IsCurrentLang( LanguageFile & File )

View File

@ -176,35 +176,35 @@ void CC_Core::SetSettings ( )
g_Settings = _Settings; g_Settings = _Settings;
if (g_Settings) if (g_Settings)
{ {
g_HaveDebugger = g_Settings->LoadDword(Debugger); g_HaveDebugger = g_Settings->LoadBool(Debugger_Enabled);
if (g_HaveDebugger) if (g_HaveDebugger)
{ {
g_ShowUnhandledMemory = g_Settings->LoadDword(ShowUnhandledMemory); g_ShowUnhandledMemory = g_Settings->LoadBool(Debugger_ShowUnhandledMemory);
g_ShowDListAListCount = g_Settings->LoadDword(ShowDListAListCount); g_ShowDListAListCount = g_Settings->LoadDword(Debugger_ShowDListAListCount);
} else { } else {
g_ShowUnhandledMemory = false; g_ShowUnhandledMemory = false;
g_ShowUnhandledMemory = false; g_ShowUnhandledMemory = false;
} }
g_ShowCPUPer = g_Settings->LoadDword(ShowCPUPer); g_ShowCPUPer = g_Settings->LoadDword(UserInterface_ShowCPUPer);
g_ShowTLBMisses = false; g_ShowTLBMisses = false;
g_UseTlb = g_Settings->LoadDword(UseTLB); g_UseTlb = g_Settings->LoadBool(Game_UseTlb);
g_CPU_Type = (CPU_TYPE)g_Settings->LoadDword(CPUType); g_CPU_Type = (CPU_TYPE)g_Settings->LoadDword(Game_CpuType);
g_SaveUsing = (SAVE_CHIP_TYPE)g_Settings->LoadDword(SaveChipType); g_SaveUsing = (SAVE_CHIP_TYPE)g_Settings->LoadDword(Game_SaveChip);
g_AudioSignal = g_Settings->LoadDword(AudioSignal); g_AudioSignal = g_Settings->LoadBool(Game_RspAudioSignal);
g_RdramSize = g_Settings->LoadDword(RamSize); g_RdramSize = g_Settings->LoadDword(Game_RDRamSize);
g_ShowPifRamErrors = g_Settings->LoadDword(ShowPifRamErrors); g_ShowPifRamErrors = g_Settings->LoadDword(Debugger_ShowPifErrors);
g_CountPerOp = g_Settings->LoadDword(CounterFactor); g_CountPerOp = g_Settings->LoadDword(Game_CounterFactor);
g_GenerateLog = g_Settings->LoadDword(GenerateDebugLog); g_GenerateLog = g_Settings->LoadDword(Debugger_GenerateDebugLog);
g_DelaySI = g_Settings->LoadDword(DelaySI); g_DelaySI = g_Settings->LoadBool(Game_DelaySI);
g_SPHack = g_Settings->LoadDword(ROM_SPHack); g_SPHack = g_Settings->LoadBool(Game_SPHack);
g_FixedAudio = g_Settings->LoadDword(ROM_FixedAudio); g_FixedAudio = g_Settings->LoadBool(Game_FixedAudio);
g_LogX86Code = g_Settings->LoadDword(GenerateLogFiles); g_LogX86Code = g_Settings->LoadBool(Debugger_GenerateLogFiles);
g_LookUpMode = (FUNC_LOOKUP_METHOD)g_Settings->LoadDword(FuncLookupMode); g_LookUpMode = (FUNC_LOOKUP_METHOD)g_Settings->LoadDword(Game_FuncLookupMode);
g_DisableRegCaching = !g_Settings->LoadDword(ROM_RegCache); g_DisableRegCaching = !g_Settings->LoadBool(Game_RegCache);
g_UseLinking = g_Settings->LoadDword(BlockLinking); g_UseLinking = g_Settings->LoadBool(Game_BlockLinking);
g_ShowCompMem = false; g_ShowCompMem = false;
strcpy(g_RomName, g_Settings->LoadString(ROM_NAME).c_str()); strcpy(g_RomName, g_Settings->LoadString(Game_GameName).c_str());
} }
} }
@ -422,20 +422,18 @@ void DisplayMessage2 ( const char * Message, ... )
const char * GetAppName ( void ) const char * GetAppName ( void )
{ {
static stdstr szAppName = g_Settings->LoadString(ApplicationName); static stdstr szAppName = g_Settings->LoadString(Setting_ApplicationName);
return szAppName.c_str(); return szAppName.c_str();
} }
void GetAutoSaveDir( char * Directory ) void GetAutoSaveDir( char * Directory )
{ {
SettingID Dir = g_Settings->LoadDword(UseSaveDirSelected) ? SelectedSaveDirectory : InitialSaveDirectory ; strcpy(Directory,g_Settings->LoadString(Directory_NativeSave).c_str());
strcpy(Directory,g_Settings->LoadString(Dir).c_str());
} }
void GetInstantSaveDir( char * Directory ) void GetInstantSaveDir( char * Directory )
{ {
SettingID Dir = g_Settings->LoadDword(UseInstantDirSelected) ? SelectedInstantSaveDirectory : InitialInstantSaveDirectory ; strcpy(Directory,g_Settings->LoadString(Directory_InstantSave).c_str());
strcpy(Directory,g_Settings->LoadString(Dir).c_str());
} }
void SetFpuLocations( void ) void SetFpuLocations( void )
@ -445,7 +443,7 @@ void SetFpuLocations( void )
BOOL Limit_FPS ( void ) BOOL Limit_FPS ( void )
{ {
return g_Settings->LoadDword(LimitFPS); return g_Settings->LoadDword(GameRunning_LimitFPS);
} }
void DacrateChanged ( enum SystemType Type ) void DacrateChanged ( enum SystemType Type )
@ -455,7 +453,7 @@ void DacrateChanged ( enum SystemType Type )
BOOL Close_C_CPU ( void ) BOOL Close_C_CPU ( void )
{ {
if (g_Settings == NULL || !g_Settings->LoadDword(CPU_Running)) if (g_Settings == NULL || !g_Settings->LoadBool(GameRunning_CPU_Running))
{ {
return true; return true;
} }
@ -533,7 +531,8 @@ void ApplyGSButtonCheats ( void )
void ChangePluginFunc ( void ) void ChangePluginFunc ( void )
{ {
g_Notify->DisplayMessage(0,MSG_PLUGIN_INIT); g_Notify->DisplayMessage(0,MSG_PLUGIN_INIT);
if (g_Settings->LoadDword(GFX_PluginChanged)) BreakPoint(__FILE__,__LINE__);
/*if (g_Settings->LoadDword(GFX_PluginChanged))
{ {
g_Plugins->Reset(PLUGIN_TYPE_GFX); g_Plugins->Reset(PLUGIN_TYPE_GFX);
} }
@ -555,7 +554,7 @@ void ChangePluginFunc ( void )
g_Settings->SaveDword(AUDIO_PluginChanged,(DWORD)false); g_Settings->SaveDword(AUDIO_PluginChanged,(DWORD)false);
g_Settings->SaveDword(GFX_PluginChanged, (DWORD)false); g_Settings->SaveDword(GFX_PluginChanged, (DWORD)false);
g_Settings->SaveDword(CONT_PluginChanged, (DWORD)false); g_Settings->SaveDword(CONT_PluginChanged, (DWORD)false);
*/
g_Notify->RefreshMenu(); g_Notify->RefreshMenu();
if (!g_Plugins->Initiate(g_N64System)) { if (!g_Plugins->Initiate(g_N64System)) {
g_Notify->DisplayMessage(5,MSG_PLUGIN_NOT_INIT); g_Notify->DisplayMessage(5,MSG_PLUGIN_NOT_INIT);

View File

@ -100,10 +100,9 @@ void PI_DMA_WRITE (void) {
DWORD i; DWORD i;
PI_STATUS_REG |= PI_STATUS_DMA_BUSY; PI_STATUS_REG |= PI_STATUS_DMA_BUSY;
if ( PI_DRAM_ADDR_REG + PI_WR_LEN_REG + 1 > RdramSize) { if ( PI_DRAM_ADDR_REG + PI_WR_LEN_REG + 1 > RdramSize)
#ifndef EXTERNAL_RELEASE {
DisplayError("PI_DMA_WRITE not in Memory"); if (ShowUnhandledMemory) { DisplayError("PI_DMA_WRITE not in Memory"); }
#endif
PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
MI_INTR_REG |= MI_INTR_PI; MI_INTR_REG |= MI_INTR_PI;
CheckInterrupts(); CheckInterrupts();
@ -164,7 +163,7 @@ void PI_DMA_WRITE (void) {
CPU_Action.DMAUsed = TRUE; CPU_Action.DMAUsed = TRUE;
OnFirstDMA(); OnFirstDMA();
} }
if (g_Recompiler && g_Recompiler->bSMM_PIDMA) if (g_Recompiler && g_Recompiler->bSMM_PIDMA())
{ {
g_Recompiler->ClearRecompCode_Phys(PI_DRAM_ADDR_REG, PI_WR_LEN_REG,CRecompiler::Remove_DMA); g_Recompiler->ClearRecompCode_Phys(PI_DRAM_ADDR_REG, PI_WR_LEN_REG,CRecompiler::Remove_DMA);
} }
@ -176,9 +175,7 @@ void PI_DMA_WRITE (void) {
return; return;
} }
#ifndef EXTERNAL_RELEASE
if (ShowUnhandledMemory) { DisplayError("PI_DMA_WRITE not in ROM"); } if (ShowUnhandledMemory) { DisplayError("PI_DMA_WRITE not in ROM"); }
#endif
PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
MI_INTR_REG |= MI_INTR_PI; MI_INTR_REG |= MI_INTR_PI;
CheckInterrupts(); CheckInterrupts();

View File

@ -135,7 +135,7 @@ void Compile_R4300i_Branch (CBlockSection * Section, void (*CompareFunc)(CBlockS
CompareFunc(Section); CompareFunc(Section);
if ((Section->CompilePC & 0xFFC) == 0xFFC) { if ((Section->CompilePC & 0xFFC) == 0xFFC) {
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
NextInstruction = END_BLOCK; NextInstruction = END_BLOCK;
return; return;
} }
@ -220,7 +220,7 @@ void Compile_R4300i_Branch (CBlockSection * Section, void (*CompareFunc)(CBlockS
memcpy(&Section->Cont.RegSet,&Section->RegWorking,sizeof(CRegInfo)); memcpy(&Section->Cont.RegSet,&Section->RegWorking,sizeof(CRegInfo));
memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo)); memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo));
} }
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
NextInstruction = END_BLOCK; NextInstruction = END_BLOCK;
} else { } else {
#ifndef EXTERNAL_RELEASE #ifndef EXTERNAL_RELEASE
@ -276,7 +276,7 @@ void Compile_R4300i_BranchLikely (CBlockSection * Section, void (*CompareFunc)(C
Section->JumpSection->DelaySlotSection = true; Section->JumpSection->DelaySlotSection = true;
Section->Jump.TargetPC = Section->CompilePC + 4; Section->Jump.TargetPC = Section->CompilePC + 4;
Section->Jump.RegSet = Section->RegWorking; Section->Jump.RegSet = Section->RegWorking;
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
NextInstruction = END_BLOCK; NextInstruction = END_BLOCK;
} else { } else {
if (Section->Cont.FallThrough) { if (Section->Cont.FallThrough) {
@ -285,7 +285,7 @@ void Compile_R4300i_BranchLikely (CBlockSection * Section, void (*CompareFunc)(C
DisplayError("WTF .. problem with Compile_R4300i_BranchLikely"); DisplayError("WTF .. problem with Compile_R4300i_BranchLikely");
#endif #endif
} }
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
NextInstruction = END_BLOCK; NextInstruction = END_BLOCK;
} else { } else {
if ((Section->CompilePC & 0xFFC) == 0xFFC) { if ((Section->CompilePC & 0xFFC) == 0xFFC) {
@ -313,7 +313,7 @@ void Compile_R4300i_BranchLikely (CBlockSection * Section, void (*CompareFunc)(C
g_N64System->GetRecompiler()->CompileExit (Section,Section->CompilePC, Section->CompilePC + 8,Section->RegWorking,CExitInfo::Normal,TRUE,NULL); g_N64System->GetRecompiler()->CompileExit (Section,Section->CompilePC, Section->CompilePC + 8,Section->RegWorking,CExitInfo::Normal,TRUE,NULL);
CPU_Message(" "); CPU_Message(" ");
CPU_Message(" DoDelaySlot"); CPU_Message(" DoDelaySlot");
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
NextInstruction = END_BLOCK; NextInstruction = END_BLOCK;
} else { } else {
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
@ -323,7 +323,7 @@ void Compile_R4300i_BranchLikely (CBlockSection * Section, void (*CompareFunc)(C
} else if (NextInstruction == DELAY_SLOT_DONE ) { } else if (NextInstruction == DELAY_SLOT_DONE ) {
Section->ResetX86Protection(); Section->ResetX86Protection();
memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo)); memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo));
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
NextInstruction = END_BLOCK; NextInstruction = END_BLOCK;
} else { } else {
#ifndef EXTERNAL_RELEASE #ifndef EXTERNAL_RELEASE
@ -1105,12 +1105,12 @@ void Compile_R4300i_J (CBlockSection * Section) {
NextInstruction = DO_DELAY_SLOT; NextInstruction = DO_DELAY_SLOT;
if ((Section->CompilePC & 0xFFC) == 0xFFC) { if ((Section->CompilePC & 0xFFC) == 0xFFC) {
memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo)); memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo));
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
NextInstruction = END_BLOCK; NextInstruction = END_BLOCK;
} }
} else if (NextInstruction == DELAY_SLOT_DONE ) { } else if (NextInstruction == DELAY_SLOT_DONE ) {
memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo)); memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo));
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
NextInstruction = END_BLOCK; NextInstruction = END_BLOCK;
} else { } else {
#ifndef EXTERNAL_RELEASE #ifndef EXTERNAL_RELEASE
@ -1169,12 +1169,12 @@ void Compile_R4300i_JAL (CBlockSection * Section) {
Section->Jump.LinkLocation2 = NULL; Section->Jump.LinkLocation2 = NULL;
if ((Section->CompilePC & 0xFFC) == 0xFFC) { if ((Section->CompilePC & 0xFFC) == 0xFFC) {
memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo)); memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo));
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
NextInstruction = END_BLOCK; NextInstruction = END_BLOCK;
} }
} else if (NextInstruction == DELAY_SLOT_DONE ) { } else if (NextInstruction == DELAY_SLOT_DONE ) {
memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo)); memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo));
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
NextInstruction = END_BLOCK; NextInstruction = END_BLOCK;
} else { } else {
#ifndef EXTERNAL_RELEASE #ifndef EXTERNAL_RELEASE
@ -2406,7 +2406,7 @@ void Compile_R4300i_SDR (CBlockSection * Section) {
void Compile_R4300i_CACHE (CBlockSection * Section){ void Compile_R4300i_CACHE (CBlockSection * Section){
CPU_Message(" %X %s",Section->CompilePC,R4300iOpcodeName(Opcode.Hex,Section->CompilePC)); CPU_Message(" %X %s",Section->CompilePC,R4300iOpcodeName(Opcode.Hex,Section->CompilePC));
if (_Settings->LoadDword(SMM_Cache) == 0) if (_Settings->LoadDword(Game_SMM_Cache) == 0)
{ {
return; return;
} }
@ -2933,7 +2933,7 @@ void Compile_R4300i_SPECIAL_JR (CBlockSection * Section) {
Section->Cont.LinkLocation = NULL; Section->Cont.LinkLocation = NULL;
Section->Cont.LinkLocation2 = NULL; Section->Cont.LinkLocation2 = NULL;
if ((Section->CompilePC & 0xFFC) == 0xFFC) { if ((Section->CompilePC & 0xFFC) == 0xFFC) {
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
NextInstruction = END_BLOCK; NextInstruction = END_BLOCK;
return; return;
} }
@ -2969,7 +2969,7 @@ void Compile_R4300i_SPECIAL_JR (CBlockSection * Section) {
} else { } else {
if (Section->IsConst(Opcode.rs)) { if (Section->IsConst(Opcode.rs)) {
memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo)); memcpy(&Section->Jump.RegSet,&Section->RegWorking,sizeof(CRegInfo));
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
} else { } else {
if (Section->IsMapped(Opcode.rs)) { if (Section->IsMapped(Opcode.rs)) {
MoveX86regToVariable(Section->MipsRegLo(Opcode.rs),&PROGRAM_COUNTER, "PROGRAM_COUNTER"); MoveX86regToVariable(Section->MipsRegLo(Opcode.rs),&PROGRAM_COUNTER, "PROGRAM_COUNTER");
@ -3027,7 +3027,7 @@ void Compile_R4300i_SPECIAL_JALR (CBlockSection * Section) {
Section->Cont.LinkLocation = NULL; Section->Cont.LinkLocation = NULL;
Section->Cont.LinkLocation2 = NULL; Section->Cont.LinkLocation2 = NULL;
GenerateSectionLinkage(Section); g_N64System->GetRecompiler()->GenerateSectionLinkage(Section);
} else { } else {
if (Section->IsMapped(Opcode.rs)) { if (Section->IsMapped(Opcode.rs)) {
MoveX86regToVariable(Section->MipsRegLo(Opcode.rs),&PROGRAM_COUNTER, "PROGRAM_COUNTER"); MoveX86regToVariable(Section->MipsRegLo(Opcode.rs),&PROGRAM_COUNTER, "PROGRAM_COUNTER");

View File

@ -48,18 +48,18 @@ bool CCheats::LoadCode (int CheatNo, LPCSTR CheatString)
if (strncmp(ReadPos,"????",4) == 0) { if (strncmp(ReadPos,"????",4) == 0) {
if (CheatNo < 0 || CheatNo > MaxCheats) { return false; } if (CheatNo < 0 || CheatNo > MaxCheats) { return false; }
stdstr CheatExt = _Settings->LoadString((SettingID)(CheatExtension + CheatNo)); stdstr CheatExt = _Settings->LoadStringIndex(Cheat_Extension,CheatNo);
if (CheatExt.empty()) { return false; } if (CheatExt.empty()) { return false; }
CodeEntry.Value = CheatExt[0] == '$'?(WORD)AsciiToHex(&CheatExt.c_str()[1]):(WORD)atol(CheatExt.c_str()); CodeEntry.Value = CheatExt[0] == '$'?(WORD)AsciiToHex(&CheatExt.c_str()[1]):(WORD)atol(CheatExt.c_str());
} else if (strncmp(ReadPos,"??",2) == 0) { } else if (strncmp(ReadPos,"??",2) == 0) {
if (CheatNo < 0 || CheatNo > MaxCheats) { return false; } if (CheatNo < 0 || CheatNo > MaxCheats) { return false; }
stdstr CheatExt = _Settings->LoadString((SettingID)(CheatExtension + CheatNo)); stdstr CheatExt = _Settings->LoadStringIndex(Cheat_Extension,CheatNo);
if (CheatExt.empty()) { return false; } if (CheatExt.empty()) { return false; }
CodeEntry.Value = (BYTE)(AsciiToHex(ReadPos)); CodeEntry.Value = (BYTE)(AsciiToHex(ReadPos));
CodeEntry.Value |= (CheatExt[0] == '$'?(BYTE)AsciiToHex(&CheatExt.c_str()[1]):(BYTE)atol(CheatExt.c_str())) << 16; CodeEntry.Value |= (CheatExt[0] == '$'?(BYTE)AsciiToHex(&CheatExt.c_str()[1]):(BYTE)atol(CheatExt.c_str())) << 16;
} else if (strncmp(&ReadPos[2],"??",2) == 0) { } else if (strncmp(&ReadPos[2],"??",2) == 0) {
if (CheatNo < 0 || CheatNo > MaxCheats) { return false; } if (CheatNo < 0 || CheatNo > MaxCheats) { return false; }
stdstr CheatExt = _Settings->LoadString((SettingID)(CheatExtension + CheatNo)); stdstr CheatExt = _Settings->LoadStringIndex(Cheat_Extension,CheatNo);
if (CheatExt.empty()) { return false; } if (CheatExt.empty()) { return false; }
CodeEntry.Value = (WORD)(AsciiToHex(ReadPos) << 16); CodeEntry.Value = (WORD)(AsciiToHex(ReadPos) << 16);
CodeEntry.Value |= CheatExt[0] == '$'?(BYTE)AsciiToHex(&CheatExt.c_str()[1]):(BYTE)atol(CheatExt.c_str()); CodeEntry.Value |= CheatExt[0] == '$'?(BYTE)AsciiToHex(&CheatExt.c_str()[1]):(BYTE)atol(CheatExt.c_str());
@ -86,14 +86,17 @@ bool CCheats::LoadCode (int CheatNo, LPCSTR CheatString)
void CCheats::LoadPermCheats (void) void CCheats::LoadPermCheats (void)
{ {
if (_Settings->LoadDword(DisableGameFixes)) if (_Settings->LoadBool(Debugger_DisableGameFixes))
{ {
return; return;
} }
for (int CheatNo = 0; CheatNo < MaxCheats; CheatNo ++ ) for (int CheatNo = 0; CheatNo < MaxCheats; CheatNo ++ )
{ {
stdstr LineEntry = _Settings->LoadString((SettingID)(CheatPermEntry + CheatNo)); stdstr LineEntry;
if (LineEntry.empty()) { break; } if (!_Settings->LoadStringIndex(Rdb_GameCheatFix,CheatNo,LineEntry) || LineEntry.empty())
{
break;
}
LoadCode(-1, LineEntry.c_str()); LoadCode(-1, LineEntry.c_str());
} }
} }
@ -105,19 +108,19 @@ void CCheats::LoadCheats(bool DisableSelected) {
for (int CheatNo = 0; CheatNo < MaxCheats; CheatNo ++ ) for (int CheatNo = 0; CheatNo < MaxCheats; CheatNo ++ )
{ {
stdstr LineEntry = _Settings->LoadString((SettingID)(CheatEntry + CheatNo)); stdstr LineEntry = _Settings->LoadStringIndex(Cheat_Entry,CheatNo);
if (LineEntry.empty()) { break; } if (LineEntry.empty()) { break; }
if (!_Settings->LoadDword((SettingID)(CheatActive + CheatNo))) if (!_Settings->LoadBoolIndex(Cheat_Active,CheatNo))
{ {
continue; continue;
} }
if (DisableSelected) if (DisableSelected)
{ {
_Settings->SaveDword((SettingID)(CheatActive + CheatNo),(DWORD)false); _Settings->SaveBoolIndex(Cheat_Active,CheatNo,false);
continue; continue;
} }
//Find the start and end of the name which is surronded in "" //Find the start and end of the name which is surrounded in ""
int StartOfName = LineEntry.find("\""); int StartOfName = LineEntry.find("\"");
if (StartOfName == -1) { continue; } if (StartOfName == -1) { continue; }
int EndOfName = LineEntry.find("\"",StartOfName + 1); int EndOfName = LineEntry.find("\"",StartOfName + 1);
@ -514,12 +517,13 @@ void CCheats::AddCodeLayers (int CheatNumber, stdstr &CheatName, WND_HANDLE hPar
AddCodeLayers(CheatNumber,(stdstr)(CheatName.substr(strlen(Text) + 1)), hParent, CheatActive); AddCodeLayers(CheatNumber,(stdstr)(CheatName.substr(strlen(Text) + 1)), hParent, CheatActive);
} }
stdstr CCheats::GetCheatName(int CheatNo, bool AddExtension) const { stdstr CCheats::GetCheatName(int CheatNo, bool AddExtension) const
{
if (CheatNo > MaxCheats) { _Notify->BreakPoint(__FILE__,__LINE__); } if (CheatNo > MaxCheats) { _Notify->BreakPoint(__FILE__,__LINE__); }
stdstr LineEntry = _Settings->LoadString((SettingID)(CheatEntry + CheatNo)); stdstr LineEntry = _Settings->LoadStringIndex(Cheat_Entry,CheatNo);
if (LineEntry.length() == 0) { return LineEntry; } if (LineEntry.length() == 0) { return LineEntry; }
//Find the start and end of the name which is surronded in "" //Find the start and end of the name which is surrounded in ""
int StartOfName = LineEntry.find("\""); int StartOfName = LineEntry.find("\"");
if (StartOfName == -1) { return stdstr(""); } if (StartOfName == -1) { return stdstr(""); }
int EndOfName = LineEntry.find("\"",StartOfName + 1); int EndOfName = LineEntry.find("\"",StartOfName + 1);
@ -533,7 +537,7 @@ stdstr CCheats::GetCheatName(int CheatNo, bool AddExtension) const {
Name.replace("\\","\\*** "); Name.replace("\\","\\*** ");
} }
if (AddExtension && CheatUsesCodeExtensions(LineEntry)) { if (AddExtension && CheatUsesCodeExtensions(LineEntry)) {
stdstr CheatValue(_Settings->LoadString((SettingID)(CheatExtension + CheatNo))); stdstr CheatValue(_Settings->LoadStringIndex(Cheat_Extension,CheatNo));
Name.Format("%s (=>%s)",Name.c_str(),CheatValue.c_str()); Name.Format("%s (=>%s)",Name.c_str(),CheatValue.c_str());
} }
@ -563,7 +567,8 @@ bool CCheats::CheatUsesCodeExtensions (const stdstr &LineEntry) {
return CodeExtension; return CodeExtension;
} }
void CCheats::RefreshCheatManager(void) { void CCheats::RefreshCheatManager(void)
{
if (m_Window == NULL) { return; } if (m_Window == NULL) { return; }
int CurrentEdit = m_EditCheat; int CurrentEdit = m_EditCheat;
@ -575,7 +580,7 @@ void CCheats::RefreshCheatManager(void) {
stdstr Name = GetCheatName(count,true); stdstr Name = GetCheatName(count,true);
if (Name.length() == 0) { break; } if (Name.length() == 0) { break; }
AddCodeLayers(count,Name,(WND_HANDLE)TVI_ROOT, _Settings->LoadDword((SettingID)(CheatActive + count)) != 0); AddCodeLayers(count,Name,(WND_HANDLE)TVI_ROOT, _Settings->LoadBoolIndex(Cheat_Active,count) != 0);
} }
} }
@ -771,9 +776,9 @@ int CALLBACK CCheats::CheatAddProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam, DWO
stdstr_f Cheat("\"%s\"%s",NewCheatName.c_str(),ReadCodeString(hDlg,validcodes,validoptions,nooptions,CodeFormat).c_str()); stdstr_f Cheat("\"%s\"%s",NewCheatName.c_str(),ReadCodeString(hDlg,validcodes,validoptions,nooptions,CodeFormat).c_str());
stdstr Options = ReadOptionsString(hDlg,validcodes,validoptions,nooptions,CodeFormat); stdstr Options = ReadOptionsString(hDlg,validcodes,validoptions,nooptions,CodeFormat);
_Settings->SaveString((SettingID)(CheatEntry + _this->m_EditCheat),Cheat.c_str()); _Settings->SaveStringIndex(Cheat_Entry, _this->m_EditCheat,Cheat.c_str());
_Settings->SaveString((SettingID)(CheatNotes + _this->m_EditCheat),GetDlgItemStr(hDlg,IDC_NOTES).c_str()); _Settings->SaveStringIndex(Cheat_Notes, _this->m_EditCheat,GetDlgItemStr(hDlg,IDC_NOTES));
_Settings->SaveString((SettingID)(CheatOptions + _this->m_EditCheat),Options.c_str()); _Settings->SaveStringIndex(Cheat_Options, _this->m_EditCheat,Options);
_this->RecordCheatValues(hDlg); _this->RecordCheatValues(hDlg);
_this->RefreshCheatManager(); _this->RefreshCheatManager();
} }
@ -815,7 +820,7 @@ int CALLBACK CCheats::CheatAddProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam, DWO
break; break;
} }
stdstr CheatEntryStr = _Settings->LoadString((SettingID)(CheatEntry + _this->m_EditCheat)); stdstr CheatEntryStr = _Settings->LoadStringIndex(Cheat_Entry,_this->m_EditCheat);
LPCSTR String = CheatEntryStr.c_str(); LPCSTR String = CheatEntryStr.c_str();
//Set Cheat Name //Set Cheat Name
@ -845,7 +850,7 @@ int CALLBACK CCheats::CheatAddProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam, DWO
SetDlgItemText((HWND)hDlg,IDC_CHEAT_CODES,Buffer.c_str()); SetDlgItemText((HWND)hDlg,IDC_CHEAT_CODES,Buffer.c_str());
//Add option values to screen //Add option values to screen
stdstr CheatOptionStr = _Settings->LoadString((SettingID)(CheatOptions + _this->m_EditCheat)); stdstr CheatOptionStr = _Settings->LoadStringIndex(Cheat_Options,_this->m_EditCheat);
ReadPos = strchr(CheatOptionStr.c_str(),'$'); ReadPos = strchr(CheatOptionStr.c_str(),'$');
Buffer.erase(); Buffer.erase();
if (ReadPos) { if (ReadPos) {
@ -868,7 +873,7 @@ int CALLBACK CCheats::CheatAddProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam, DWO
SetDlgItemText((HWND)hDlg,IDC_CHEAT_OPTIONS,Buffer.c_str()); SetDlgItemText((HWND)hDlg,IDC_CHEAT_OPTIONS,Buffer.c_str());
//Add cheat Notes //Add cheat Notes
stdstr CheatNotesStr = _Settings->LoadString((SettingID)(CheatNotes + _this->m_EditCheat)); stdstr CheatNotesStr = _Settings->LoadStringIndex(Cheat_Notes,_this->m_EditCheat);
SetDlgItemText((HWND)hDlg,IDC_NOTES,CheatNotesStr.c_str()); SetDlgItemText((HWND)hDlg,IDC_NOTES,CheatNotesStr.c_str());
@ -984,7 +989,7 @@ int CALLBACK CCheats::CheatListProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam, DW
TreeView_HitTest(lpnmh->hwndFrom, &ht); TreeView_HitTest(lpnmh->hwndFrom, &ht);
_this->m_hSelectedItem = (WND_HANDLE)ht.hItem; _this->m_hSelectedItem = (WND_HANDLE)ht.hItem;
if (_Settings->LoadDword(BasicMode)) { return true; } if (_Settings->LoadBool(UserInterface_BasicMode)) { return true; }
//Show Menu //Show Menu
HMENU hMenu = LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_CHEAT_MENU)); HMENU hMenu = LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_CHEAT_MENU));
@ -1031,12 +1036,13 @@ int CALLBACK CCheats::CheatListProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam, DW
item.mask = TVIF_PARAM ; item.mask = TVIF_PARAM ;
item.hItem = (HTREEITEM)ht.hItem; item.hItem = (HTREEITEM)ht.hItem;
TreeView_GetItem((HWND)_this->m_hCheatTree,&item); TreeView_GetItem((HWND)_this->m_hCheatTree,&item);
stdstr LineEntry = _Settings->LoadString((SettingID)(CheatEntry + item.lParam)); stdstr LineEntry = _Settings->LoadStringIndex(Cheat_Entry,item.lParam);
if (CheatUsesCodeExtensions(LineEntry)) { if (CheatUsesCodeExtensions(LineEntry))
if (_Settings->LoadString((SettingID)(CheatExtension + item.lParam)) ==_Settings->LoadString(Default_CheatExt)) { {
stdstr CheatExtension;
if (!_Settings->LoadStringIndex(Cheat_Extension,item.lParam,CheatExtension))
{
SendMessage((HWND)hDlg, UM_CHANGECODEEXTENSION, 0, (LPARAM)ht.hItem); SendMessage((HWND)hDlg, UM_CHANGECODEEXTENSION, 0, (LPARAM)ht.hItem);
}
if (_Settings->LoadString((SettingID)(CheatExtension + item.lParam)) ==_Settings->LoadString(Default_CheatExt)) {
TV_SetCheckState(_this->m_hCheatTree,(WND_HANDLE)ht.hItem,TV_STATE_CLEAR); TV_SetCheckState(_this->m_hCheatTree,(WND_HANDLE)ht.hItem,TV_STATE_CLEAR);
break; break;
} }
@ -1089,7 +1095,7 @@ int CALLBACK CCheats::CheatListProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam, DW
item.hItem = hItem; item.hItem = hItem;
TreeView_GetItem((HWND)_this->m_hCheatTree,&item); TreeView_GetItem((HWND)_this->m_hCheatTree,&item);
stdstr Notes(_Settings->LoadString((SettingID)(CheatNotes + item.lParam))); stdstr Notes(_Settings->LoadStringIndex(Cheat_Notes,item.lParam));
SetDlgItemText((HWND)hDlg,IDC_NOTES,Notes.c_str()); SetDlgItemText((HWND)hDlg,IDC_NOTES,Notes.c_str());
if (_this->m_AddCheat) if (_this->m_AddCheat)
{ {
@ -1113,15 +1119,17 @@ int CALLBACK CCheats::CheatListProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam, DW
TreeView_GetItem((HWND)_this->m_hCheatTree,&item); TreeView_GetItem((HWND)_this->m_hCheatTree,&item);
//Make sure the selected line can use code extensions //Make sure the selected line can use code extensions
stdstr LineEntry = _Settings->LoadString((SettingID)(CheatEntry + item.lParam)); stdstr LineEntry = _Settings->LoadStringIndex(Cheat_Entry,item.lParam);
if (!CheatUsesCodeExtensions(LineEntry)) { break; } if (!CheatUsesCodeExtensions(LineEntry)) { break; }
stdstr Options(_Settings->LoadString((SettingID)(CheatOptions + item.lParam))); stdstr Options;
if (Options.length() > 0) { if (_Settings->LoadStringIndex(Cheat_Options,item.lParam,Options) && Options.length() > 0)
{
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_CodeEx),(HWND)hDlg,(DLGPROC)CheatsCodeExProc,(LPARAM)_this); DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_CodeEx),(HWND)hDlg,(DLGPROC)CheatsCodeExProc,(LPARAM)_this);
} else { } else {
stdstr Range(_Settings->LoadString((SettingID)(CheatRange + item.lParam))); stdstr Range;
if (Range.length() > 0) { if (_Settings->LoadStringIndex(Cheat_Range,item.lParam,Range) && Range.length() > 0)
{
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_Range),(HWND)hDlg,(DLGPROC)CheatsCodeQuantProc,(LPARAM)_this); DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_Range),(HWND)hDlg,(DLGPROC)CheatsCodeQuantProc,(LPARAM)_this);
} }
} }
@ -1168,8 +1176,8 @@ int CALLBACK CCheats::CheatsCodeExProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam,
SetDlgItemText((HWND)hDlg,IDC_CHEAT_NAME,CheatName.c_str()); SetDlgItemText((HWND)hDlg,IDC_CHEAT_NAME,CheatName.c_str());
//Read through and add all options to the list box //Read through and add all options to the list box
stdstr Options(_Settings->LoadString((SettingID)(CheatOptions + item.lParam))); stdstr Options(_Settings->LoadStringIndex(Cheat_Options,item.lParam));
stdstr CurrentExt(_Settings->LoadString((SettingID)(CheatExtension + item.lParam))); stdstr CurrentExt(_Settings->LoadStringIndex(Cheat_Extension,item.lParam));
const char * ReadPos = Options.c_str(); const char * ReadPos = Options.c_str();
while (*ReadPos != 0) { while (*ReadPos != 0) {
const char * NextComma = strchr(ReadPos,','); const char * NextComma = strchr(ReadPos,',');
@ -1206,7 +1214,7 @@ int CALLBACK CCheats::CheatsCodeExProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam,
if (index < 0) { index = 0; } if (index < 0) { index = 0; }
SendMessage(GetDlgItem((HWND)hDlg,IDC_CHEAT_LIST),LB_GETTEXT,index,(LPARAM)CheatExten); SendMessage(GetDlgItem((HWND)hDlg,IDC_CHEAT_LIST),LB_GETTEXT,index,(LPARAM)CheatExten);
_Settings->SaveString((SettingID)(CheatExtension + item.lParam),CheatExten); _Settings->SaveStringIndex(Cheat_Extension,item.lParam,CheatExten);
_this->m_CheatSelectionChanged = true; _this->m_CheatSelectionChanged = true;
} }
RemoveProp((HWND)hDlg,"Class"); RemoveProp((HWND)hDlg,"Class");
@ -1238,9 +1246,9 @@ int CALLBACK CCheats::CheatsCodeQuantProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wPar
item.mask = TVIF_PARAM ; item.mask = TVIF_PARAM ;
TreeView_GetItem((HWND)_this->m_hCheatTree,&item); TreeView_GetItem((HWND)_this->m_hCheatTree,&item);
stdstr CheatName = _this->GetCheatName(item.lParam,false); stdstr CheatName = _this->GetCheatName(item.lParam,false);
stdstr RangeNote(_Settings->LoadString((SettingID)(CheatRangeNotes + item.lParam))); stdstr RangeNote(_Settings->LoadStringIndex(Cheat_RangeNotes, item.lParam));
stdstr Range(_Settings->LoadString((SettingID)(CheatRange + item.lParam))); stdstr Range(_Settings->LoadStringIndex(Cheat_Range,item.lParam));
stdstr Value(_Settings->LoadString((SettingID)(CheatExtension + item.lParam))); stdstr Value(_Settings->LoadStringIndex(Cheat_Extension,item.lParam));
//Set up language support for dialog //Set up language support for dialog
SetWindowText((HWND)hDlg, GS(CHEAT_CODE_EXT_TITLE)); SetWindowText((HWND)hDlg, GS(CHEAT_CODE_EXT_TITLE));
@ -1306,7 +1314,7 @@ int CALLBACK CCheats::CheatsCodeQuantProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wPar
if (Value < Start) { Value = Start; } if (Value < Start) { Value = Start; }
sprintf(CheatExten,"$%X",Value); sprintf(CheatExten,"$%X",Value);
_Settings->SaveString((SettingID)(CheatExtension + item.lParam),CheatExten); _Settings->SaveStringIndex(Cheat_Extension, item.lParam,CheatExten);
_this->m_CheatSelectionChanged = true; _this->m_CheatSelectionChanged = true;
} }
RemoveProp((HWND)hDlg,"Class"); RemoveProp((HWND)hDlg,"Class");
@ -1350,7 +1358,7 @@ int CALLBACK CCheats::ManageCheatsProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam,
ShowWindow((HWND)_this->m_hSelectCheat,SW_SHOW); ShowWindow((HWND)_this->m_hSelectCheat,SW_SHOW);
RECT * rc = &WndPlac.rcNormalPosition; RECT * rc = &WndPlac.rcNormalPosition;
if (_Settings->LoadDword(BasicMode)) if (_Settings->LoadDword(UserInterface_BasicMode))
{ {
RECT * rcAdd = (RECT *)_this->m_rcAdd, * rcList = (RECT *)_this->m_rcList; RECT * rcAdd = (RECT *)_this->m_rcAdd, * rcList = (RECT *)_this->m_rcList;
GetWindowRect(GetDlgItem((HWND)_this->m_hSelectCheat, IDC_CHEATSFRAME), rcList); GetWindowRect(GetDlgItem((HWND)_this->m_hSelectCheat, IDC_CHEATSFRAME), rcList);
@ -1538,16 +1546,18 @@ void CCheats::ChangeChildrenStatus(WND_HANDLE hParent, bool Checked) {
//if cheat uses a extension and it is not set then do not set it //if cheat uses a extension and it is not set then do not set it
if (Checked) { if (Checked) {
stdstr LineEntry = _Settings->LoadString((SettingID)(CheatEntry + item.lParam)); stdstr LineEntry = _Settings->LoadStringIndex(Cheat_Entry,item.lParam);
if (CheatUsesCodeExtensions(LineEntry)) { if (CheatUsesCodeExtensions(LineEntry)) {
if (_Settings->LoadString((SettingID)(CheatExtension + item.lParam)) ==_Settings->LoadString(Default_CheatExt)) { stdstr CheatExten;
if (!_Settings->LoadStringIndex(Cheat_Extension,item.lParam,CheatExten) || CheatExten.empty())
{
return; return;
} }
} }
} }
//Save Cheat //Save Cheat
TV_SetCheckState(m_hCheatTree,hParent,Checked?TV_STATE_CHECKED:TV_STATE_CLEAR); TV_SetCheckState(m_hCheatTree,hParent,Checked?TV_STATE_CHECKED:TV_STATE_CLEAR);
_Settings->SaveDword((SettingID)(CheatActive + item.lParam),Checked); _Settings->SaveDwordIndex(Cheat_Active,item.lParam,Checked);
return; return;
} }
TV_CHECK_STATE state = TV_STATE_UNKNOWN; TV_CHECK_STATE state = TV_STATE_UNKNOWN;

View File

@ -7,6 +7,7 @@ class CCheats {
typedef std::vector<GAMESHARK_CODE> CODES; typedef std::vector<GAMESHARK_CODE> CODES;
typedef std::vector<CODES> CODES_ARRAY; typedef std::vector<CODES> CODES_ARRAY;
enum { MaxCheats = 50000 };
CNotification * const _Notify; CNotification * const _Notify;
CN64Rom * const _Rom; CN64Rom * const _Rom;

View File

@ -86,7 +86,7 @@ void CMipsMemory::AllocateSystemMemory (void)
} }
DWORD RdramMemorySize = 0x20000000; DWORD RdramMemorySize = 0x20000000;
if ((CPU_TYPE)_Settings->LoadDword(ROM_CPUType) == CPU_SyncCores) if ((CPU_TYPE)_Settings->LoadDword(Game_CpuType) == CPU_SyncCores)
{ {
RdramMemorySize = 0x18000000; RdramMemorySize = 0x18000000;
} }
@ -107,7 +107,7 @@ void CMipsMemory::AllocateSystemMemory (void)
DMEM = (unsigned char *)(RDRAM+0x04000000); DMEM = (unsigned char *)(RDRAM+0x04000000);
IMEM = (unsigned char *)(RDRAM+0x04001000); IMEM = (unsigned char *)(RDRAM+0x04001000);
if (_Settings->LoadDword(RomInMemory)) if (_Settings->LoadBool(Game_LoadRomToMemory))
{ {
if(VirtualAlloc(RDRAM + 0x10000000, m_RomFileSize, MEM_COMMIT, PAGE_READWRITE)==NULL) { if(VirtualAlloc(RDRAM + 0x10000000, m_RomFileSize, MEM_COMMIT, PAGE_READWRITE)==NULL) {
_Notify->FatalError(GS(MSG_MEM_ALLOC_ERROR)); _Notify->FatalError(GS(MSG_MEM_ALLOC_ERROR));
@ -129,7 +129,7 @@ bool CMipsMemory::AllocateRecompilerMemory ( bool AllocateJumpTable )
JumpTable = NULL; JumpTable = NULL;
if (AllocateJumpTable) if (AllocateJumpTable)
{ {
DWORD JumpTableSize = _Settings->LoadDword(RomInMemory) ? 0x20000000 : 0x10000000; DWORD JumpTableSize = _Settings->LoadDword(Game_LoadRomToMemory) ? 0x20000000 : 0x10000000;
JumpTable = (void **)VirtualAlloc( NULL, JumpTableSize, MEM_RESERVE | MEM_TOP_DOWN, PAGE_READWRITE ); JumpTable = (void **)VirtualAlloc( NULL, JumpTableSize, MEM_RESERVE | MEM_TOP_DOWN, PAGE_READWRITE );
if( JumpTable == NULL ) { if( JumpTable == NULL ) {
_Notify->DisplayError(MSG_MEM_ALLOC_ERROR); _Notify->DisplayError(MSG_MEM_ALLOC_ERROR);
@ -147,7 +147,7 @@ bool CMipsMemory::AllocateRecompilerMemory ( bool AllocateJumpTable )
return FALSE; return FALSE;
} }
if (_Settings->LoadDword(RomInMemory)) if (_Settings->LoadDword(Game_LoadRomToMemory))
{ {
if(VirtualAlloc((BYTE *)JumpTable + 0x10000000, m_RomFileSize, MEM_COMMIT, PAGE_READWRITE)==NULL) { if(VirtualAlloc((BYTE *)JumpTable + 0x10000000, m_RomFileSize, MEM_COMMIT, PAGE_READWRITE)==NULL) {
_Notify->DisplayError(MSG_MEM_ALLOC_ERROR); _Notify->DisplayError(MSG_MEM_ALLOC_ERROR);
@ -193,7 +193,7 @@ void CMipsMemory::CheckRecompMem( BYTE * RecompPos )
} }
void CMipsMemory::FixRDramSize ( void ) { void CMipsMemory::FixRDramSize ( void ) {
if (_Settings->LoadDword(RamSize) != m_AllocatedRdramSize) { if (_Settings->LoadDword(Game_RDRamSize) != m_AllocatedRdramSize) {
if (m_AllocatedRdramSize == 0x400000) { if (m_AllocatedRdramSize == 0x400000) {
if (VirtualAlloc(RDRAM + 0x400000, 0x400000, MEM_COMMIT, PAGE_READWRITE)==NULL) { if (VirtualAlloc(RDRAM + 0x400000, 0x400000, MEM_COMMIT, PAGE_READWRITE)==NULL) {
_Notify->FatalError(GS(MSG_MEM_ALLOC_ERROR)); _Notify->FatalError(GS(MSG_MEM_ALLOC_ERROR));
@ -213,25 +213,31 @@ bool CMipsMemory::Store64 ( DWORD VAddr, QWORD Value, MemorySize Size ) {
_Notify->BreakPoint(__FILE__,__LINE__); _Notify->BreakPoint(__FILE__,__LINE__);
return false; return false;
} }
if (PAddr > _Settings->LoadDword(RamSize) && if (PAddr > _Settings->LoadDword(Game_RDRamSize) &&
(PAddr < 0x04000000 || PAddr > 0x04002000)) (PAddr < 0x04000000 || PAddr > 0x04002000))
{ {
// switch (Size) { switch (Size) {
// case _16Bit: case _8Bit:
// if (!StoreHalf_NonMemory(PAddr,static_cast<WORD>(Value))) { if (!StoreByte_NonMemory(PAddr,static_cast<BYTE>(Value))) {
//MemoryFilterFailed("Store word",PAddr,PROGRAM_COUNTER, static_cast<WORD>(Value)); //MemoryFilterFailed("Store word",PAddr,PROGRAM_COUNTER, static_cast<WORD>(Value));
// } }
// return true; return true;
// break; break;
// case _32Bit: case _16Bit:
// if (!StoreWord_NonMemory(PAddr,static_cast<DWORD>(Value))) { if (!StoreHalf_NonMemory(PAddr,static_cast<WORD>(Value))) {
//MemoryFilterFailed("Store word",PAddr,PROGRAM_COUNTER, static_cast<WORD>(Value));
}
return true;
break;
case _32Bit:
if (!StoreWord_NonMemory(PAddr,static_cast<DWORD>(Value))) {
//MemoryFilterFailed("Store word",PAddr,PROGRAM_COUNTER, static_cast<DWORD>(Value)); //MemoryFilterFailed("Store word",PAddr,PROGRAM_COUNTER, static_cast<DWORD>(Value));
// } }
// return true; return true;
// break; break;
// default: default:
_Notify->BreakPoint(__FILE__,__LINE__); _Notify->BreakPoint(__FILE__,__LINE__);
// } }
return false; return false;
} }
@ -356,7 +362,7 @@ bool CMipsMemory::LoadPhysical32 ( DWORD PAddr, DWORD & Variable, MemorySize Siz
} }
void CMipsMemory::MemoryFilterFailed( char * FailureType, DWORD MipsAddress, DWORD x86Address, DWORD Value) { void CMipsMemory::MemoryFilterFailed( char * FailureType, DWORD MipsAddress, DWORD x86Address, DWORD Value) {
if (_Settings->LoadDword(ShowUnhandledMemory)) { if (_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
_Notify->DisplayError("Failed to %s\n\nProgram Counter: %X\nMIPS Address: %08X\nX86 Address: %X\n Value: %X", _Notify->DisplayError("Failed to %s\n\nProgram Counter: %X\nMIPS Address: %08X\nX86 Address: %X\n Value: %X",
FailureType, _Reg->PROGRAM_COUNTER, MipsAddress, x86Address, Value); FailureType, _Reg->PROGRAM_COUNTER, MipsAddress, x86Address, Value);
} }
@ -373,7 +379,7 @@ bool CMipsMemory::Load64 ( DWORD VAddr, QWORD & Variable, MemorySize Size, bool
if (!TranslateVaddr(VAddr,PAddr)) { if (!TranslateVaddr(VAddr,PAddr)) {
return false; return false;
} }
if (PAddr > _Settings->LoadDword(RamSize) && if (PAddr > _Settings->LoadDword(Game_RDRamSize) &&
(PAddr < 0x04000000 || PAddr > 0x04002000)) (PAddr < 0x04000000 || PAddr > 0x04002000))
{ {
switch (Size) { switch (Size) {
@ -629,7 +635,7 @@ bool CMipsMemory::Store64 ( DWORD VAddr, QWORD Value, MemorySize Size ) {
_Notify->BreakPoint(__FILE__,__LINE__); _Notify->BreakPoint(__FILE__,__LINE__);
return false; return false;
} }
if (PAddr > _Settings->LoadDword(RamSize) && if (PAddr > _Settings->LoadDword(Game_RDRamSize) &&
(PAddr < 0x04000000 || PAddr > 0x04002000)) (PAddr < 0x04000000 || PAddr > 0x04002000))
{ {
switch (Size) { switch (Size) {
@ -699,7 +705,7 @@ bool CMipsMemory::StoreByte_NonMemory ( DWORD PAddr, BYTE Value ) {
case 0x00500000: case 0x00500000:
case 0x00600000: case 0x00600000:
case 0x00700000: case 0x00700000:
if (PAddr < _Settings->LoadDword(RamSize)) { if (PAddr < _Settings->LoadDword(Game_RDRamSize)) {
// CRecompiler * Recomp = _System->GetRecompiler(); // CRecompiler * Recomp = _System->GetRecompiler();
// if (Recomp) { // if (Recomp) {
// Recomp->ClearRecomplierCode(PAddr + 0x80000000,1); // Recomp->ClearRecomplierCode(PAddr + 0x80000000,1);
@ -727,7 +733,7 @@ bool CMipsMemory::StoreHalf_NonMemory ( DWORD PAddr, WORD Value ) {
case 0x00500000: case 0x00500000:
case 0x00600000: case 0x00600000:
case 0x00700000: case 0x00700000:
if (PAddr < _Settings->LoadDword(RamSize)) { if (PAddr < _Settings->LoadDword(Game_RDRamSize)) {
// CRecompiler * Recomp = _System->GetRecompiler(); // CRecompiler * Recomp = _System->GetRecompiler();
// if (Recomp) { // if (Recomp) {
// Recomp->ClearRecomplierCode(PAddr + 0x80000000,1); // Recomp->ClearRecomplierCode(PAddr + 0x80000000,1);
@ -765,7 +771,7 @@ bool CMipsMemory::StoreWord_NonMemory ( DWORD PAddr, DWORD Value ) {
case 0x00500000: case 0x00500000:
case 0x00600000: case 0x00600000:
case 0x00700000: case 0x00700000:
if (PAddr < _Settings->LoadDword(RamSize)) { if (PAddr < _Settings->LoadDword(Game_RDRamSize)) {
// CRecompiler * Recomp = _System->GetRecompiler(); // CRecompiler * Recomp = _System->GetRecompiler();
// if (Recomp) { // if (Recomp) {
// Recomp->ClearRecomplierCode(PAddr + 0x80000000,4); // Recomp->ClearRecomplierCode(PAddr + 0x80000000,4);
@ -1144,7 +1150,7 @@ int CMipsMemory::SystemMemoryFilter( DWORD dwExptCode, void * lpExceptionPointer
int End = (Start + (lpEP->ContextRecord->Ecx << 2) - 1); int End = (Start + (lpEP->ContextRecord->Ecx << 2) - 1);
if ((int)Start < 0) { _Notify->BreakPoint(__FILE__,__LINE__); } if ((int)Start < 0) { _Notify->BreakPoint(__FILE__,__LINE__); }
if ((int)End < _Settings->LoadDword(RamSize)) { if ((int)End < _Settings->LoadDword(Game_RDRamSize)) {
for ( int count = Start & ~0x1000; count < End; count += 0x1000 ) { for ( int count = Start & ~0x1000; count < End; count += 0x1000 ) {
CBClass->WriteToProtectedMemory(Start, 0xFFF); CBClass->WriteToProtectedMemory(Start, 0xFFF);
} }

View File

@ -27,8 +27,8 @@ COpcode::COpcode ( CMipsMemory * MMU, DWORD VirtualAddress ):
_MMU(MMU), _MMU(MMU),
_Reg(MMU->SystemRegisters()), _Reg(MMU->SystemRegisters()),
m_OpLen(OpCode_Size), m_OpLen(OpCode_Size),
m_OpcodeCount(_Settings->LoadDword(CounterFactor)), m_OpcodeCount(_Settings->LoadDword(Game_CounterFactor)),
m_FixedOpcodeCount(_Settings->LoadDword(CounterFactor) != 0) m_FixedOpcodeCount(_Settings->LoadDword(Game_CounterFactor) != 0)
{ {
//setup details about handling opcodes //setup details about handling opcodes
m_NextStep = StepNormal; m_NextStep = StepNormal;

View File

@ -55,11 +55,11 @@ void CTLB::TLB_Reset (bool InvalidateTLB) {
for (count = 0; count < 32; count ++) { SetupTLB_Entry(count,false); } for (count = 0; count < 32; count ++) { SetupTLB_Entry(count,false); }
//GE Hack //GE Hack
if (_Settings->LoadDword(ROM_TLB_VAddrStart) != 0) if (_Settings->LoadDword(Rdb_TLB_VAddrStart) != 0)
{ {
DWORD Start = _Settings->LoadDword(ROM_TLB_VAddrStart); //0x7F000000; DWORD Start = _Settings->LoadDword(Rdb_TLB_VAddrStart); //0x7F000000;
DWORD Len = _Settings->LoadDword(ROM_TLB_VAddrLen); //0x01000000; DWORD Len = _Settings->LoadDword(Rdb_TLB_VAddrLen); //0x01000000;
DWORD PAddr = _Settings->LoadDword(ROM_TLB_PAddrStart); //0x10034b30; DWORD PAddr = _Settings->LoadDword(Rdb_TLB_PAddrStart); //0x10034b30;
DWORD End = Start + Len; DWORD End = Start + Len;
for (count = Start; count < End; count += 0x1000) { for (count = Start; count < End; count += 0x1000) {
TLB_ReadMap[count >> 12] = ((DWORD)m_BasePAddr + (count - Start + PAddr)) - count; TLB_ReadMap[count >> 12] = ((DWORD)m_BasePAddr + (count - Start + PAddr)) - count;

View File

@ -10,7 +10,8 @@
CN64System::CN64System ( CNotification * Notify, CPlugins * Plugins ): CN64System::CN64System ( CNotification * Notify, CPlugins * Plugins ):
CDebugger(this,_MMU),_Notify(Notify),FPS(Notify),m_CPU_Usage(Notify),m_Profile(Notify), m_Limitor(Notify), CDebugger(this,_MMU),_Notify(Notify),FPS(Notify),m_CPU_Usage(Notify),m_Profile(Notify), m_Limitor(Notify),
_Plugins(Plugins),_Cheats(NULL),_SyncCPU(NULL),_Recomp(NULL), _Plugins(Plugins),_Cheats(NULL),_SyncCPU(NULL),_Recomp(NULL),
m_InReset(false), EndEmulation(false), m_OwnRomObject(false), _Audio(NULL) m_InReset(false), EndEmulation(false), m_OwnRomObject(false), _Audio(NULL),
m_bCleanFrameBox(true)
{ {
_Rom = 0; //No rom loaded _Rom = 0; //No rom loaded
_MMU = 0; //Since no rom can be loaded, then no system has been created _MMU = 0; //Since no rom can be loaded, then no system has been created
@ -77,60 +78,60 @@ void CN64System::ExternalEvent ( SystemEvent Event ) {
g_CPU_Action->DoSomething = TRUE; g_CPU_Action->DoSomething = TRUE;
break; break;
case CPUUsageTimerChanged: case CPUUsageTimerChanged:
g_ShowCPUPer = _Settings->LoadDword(ShowCPUPer); g_ShowCPUPer = _Settings->LoadDword(UserInterface_ShowCPUPer);
break; break;
case PauseCPU_FromMenu: case PauseCPU_FromMenu:
if (!_Settings->LoadDword(CPU_Paused)) if (!_Settings->LoadBool(GameRunning_CPU_Paused))
{ {
_Settings->SaveDword(CPU_Paused_type, PauseType_FromMenu); _Settings->SaveDword(GameRunning_CPU_PausedType, PauseType_FromMenu);
g_CPU_Action->Pause = TRUE; g_CPU_Action->Pause = TRUE;
g_CPU_Action->DoSomething = TRUE; g_CPU_Action->DoSomething = TRUE;
} }
break; break;
case PauseCPU_AppLostFocus: case PauseCPU_AppLostFocus:
if (!_Settings->LoadDword(CPU_Paused) && !g_CPU_Action->Pause) if (!_Settings->LoadBool(GameRunning_CPU_Paused) && !g_CPU_Action->Pause)
{ {
_Settings->SaveDword(CPU_Paused_type, PauseType_AppLostFocus); _Settings->SaveDword(GameRunning_CPU_PausedType, PauseType_AppLostFocus);
g_CPU_Action->Pause = TRUE; g_CPU_Action->Pause = TRUE;
g_CPU_Action->DoSomething = TRUE; g_CPU_Action->DoSomething = TRUE;
} }
break; break;
case PauseCPU_AppLostActive: case PauseCPU_AppLostActive:
if (!_Settings->LoadDword(CPU_Paused)) if (!_Settings->LoadBool(GameRunning_CPU_Paused))
{ {
g_CPU_Action->Pause = TRUE; g_CPU_Action->Pause = TRUE;
g_CPU_Action->DoSomething = TRUE; g_CPU_Action->DoSomething = TRUE;
_Settings->SaveDword(CPU_Paused_type, PauseType_AppLostActive); _Settings->SaveDword(GameRunning_CPU_PausedType, PauseType_AppLostActive);
} }
break; break;
case PauseCPU_SaveGame: case PauseCPU_SaveGame:
if (!_Settings->LoadDword(CPU_Paused)) if (!_Settings->LoadBool(GameRunning_CPU_Paused))
{ {
_Settings->SaveDword(CPU_Paused_type, PauseType_SaveGame); _Settings->SaveDword(GameRunning_CPU_PausedType, PauseType_SaveGame);
g_CPU_Action->Pause = TRUE; g_CPU_Action->Pause = TRUE;
g_CPU_Action->DoSomething = TRUE; g_CPU_Action->DoSomething = TRUE;
} }
break; break;
case PauseCPU_LoadGame: case PauseCPU_LoadGame:
if (!_Settings->LoadDword(CPU_Paused)) if (!_Settings->LoadBool(GameRunning_CPU_Paused))
{ {
_Settings->SaveDword(CPU_Paused_type, PauseType_LoadGame); _Settings->SaveDword(GameRunning_CPU_PausedType, PauseType_LoadGame);
g_CPU_Action->Pause = TRUE; g_CPU_Action->Pause = TRUE;
g_CPU_Action->DoSomething = TRUE; g_CPU_Action->DoSomething = TRUE;
} }
break; break;
case PauseCPU_DumpMemory: case PauseCPU_DumpMemory:
if (!_Settings->LoadDword(CPU_Paused)) if (!_Settings->LoadBool(GameRunning_CPU_Paused))
{ {
_Settings->SaveDword(CPU_Paused_type, PauseType_DumpMemory); _Settings->SaveDword(GameRunning_CPU_PausedType, PauseType_DumpMemory);
g_CPU_Action->Pause = TRUE; g_CPU_Action->Pause = TRUE;
g_CPU_Action->DoSomething = TRUE; g_CPU_Action->DoSomething = TRUE;
} }
break; break;
case PauseCPU_SearchMemory: case PauseCPU_SearchMemory:
if (!_Settings->LoadDword(CPU_Paused)) if (!_Settings->LoadBool(GameRunning_CPU_Paused))
{ {
_Settings->SaveDword(CPU_Paused_type, PauseType_SearchMemory); _Settings->SaveDword(GameRunning_CPU_PausedType, PauseType_SearchMemory);
g_CPU_Action->Pause = TRUE; g_CPU_Action->Pause = TRUE;
g_CPU_Action->DoSomething = TRUE; g_CPU_Action->DoSomething = TRUE;
} }
@ -140,37 +141,37 @@ void CN64System::ExternalEvent ( SystemEvent Event ) {
SetEvent(m_hPauseEvent); SetEvent(m_hPauseEvent);
break; break;
case ResumeCPU_AppGainedFocus: case ResumeCPU_AppGainedFocus:
if (_Settings->LoadDword(CPU_Paused_type) == PauseType_AppLostFocus ) if (_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostFocus )
{ {
SetEvent(m_hPauseEvent); SetEvent(m_hPauseEvent);
} }
break; break;
case ResumeCPU_AppGainedActive: case ResumeCPU_AppGainedActive:
if (_Settings->LoadDword(CPU_Paused_type) == PauseType_AppLostActive ) if (_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostActive )
{ {
SetEvent(m_hPauseEvent); SetEvent(m_hPauseEvent);
} }
break; break;
case ResumeCPU_SaveGame: case ResumeCPU_SaveGame:
if (_Settings->LoadDword(CPU_Paused_type) == PauseType_SaveGame ) if (_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SaveGame )
{ {
SetEvent(m_hPauseEvent); SetEvent(m_hPauseEvent);
} }
break; break;
case ResumeCPU_LoadGame: case ResumeCPU_LoadGame:
if (_Settings->LoadDword(CPU_Paused_type) == PauseType_LoadGame ) if (_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_LoadGame )
{ {
SetEvent(m_hPauseEvent); SetEvent(m_hPauseEvent);
} }
break; break;
case ResumeCPU_DumpMemory: case ResumeCPU_DumpMemory:
if (_Settings->LoadDword(CPU_Paused_type) == PauseType_DumpMemory ) if (_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_DumpMemory )
{ {
SetEvent(m_hPauseEvent); SetEvent(m_hPauseEvent);
} }
break; break;
case ResumeCPU_SearchMemory: case ResumeCPU_SearchMemory:
if (_Settings->LoadDword(CPU_Paused_type) == PauseType_SearchMemory ) if (_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SearchMemory )
{ {
SetEvent(m_hPauseEvent); SetEvent(m_hPauseEvent);
} }
@ -188,7 +189,7 @@ void CN64System::ExternalEvent ( SystemEvent Event ) {
Reset(); Reset();
_Rom = TempRom; _Rom = TempRom;
m_Limitor.SetHertz(_Settings->LoadDword(ScreenHertz)); //Is set in LoadRomSettings m_Limitor.SetHertz(_Settings->LoadDword(Game_ScreenHertz)); //Is set in LoadRomSettings
//Recreate Memory //Recreate Memory
_MMU = new CMipsMemory(this,this,_Rom,_Notify, new CRegisters(this, _Notify)); _MMU = new CMipsMemory(this,this,_Rom,_Notify, new CRegisters(this, _Notify));
@ -241,17 +242,17 @@ void CN64System::ExternalEvent ( SystemEvent Event ) {
void CN64System::RunFileImage ( const char * FileLoc ) void CN64System::RunFileImage ( const char * FileLoc )
{ {
bool RomLoading = _Settings->LoadBool(LoadingRom); bool RomLoading = _Settings->LoadBool(Info_RomLoading);
if (!RomLoading) if (!RomLoading)
{ {
FileImageInfo * Info = new FileImageInfo; _Settings->SaveBool(Info_RomLoading,true);
HANDLE * hThread = new HANDLE; HANDLE * hThread = new HANDLE;
*hThread = NULL; *hThread = NULL;
_Settings->SaveDword(LoadingRom,(DWORD)true);
//create the needed info into a structure to pass as one paramater //create the needed info into a structure to pass as one paramater
//for createing a thread //for createing a thread
FileImageInfo * Info = new FileImageInfo;
Info->_this = this; Info->_this = this;
Info->FileName = FileLoc; Info->FileName = FileLoc;
Info->ThreadHandle = hThread; Info->ThreadHandle = hThread;
@ -260,10 +261,11 @@ void CN64System::RunFileImage ( const char * FileLoc )
} }
} }
void CN64System::LoadFileImage ( FileImageInfo * Info ) { void CN64System::LoadFileImage ( FileImageInfo * Info )
{
CoInitialize(NULL); CoInitialize(NULL);
//Make a copy of the passed infomation on to the stack, then free //Make a copy of the passed information on to the stack, then free
//the memory used //the memory used
WriteTrace(TraceDebug,"CN64System::LoadFileImage 1"); WriteTrace(TraceDebug,"CN64System::LoadFileImage 1");
FileImageInfo ImageInfo = *Info; FileImageInfo ImageInfo = *Info;
@ -275,7 +277,7 @@ void CN64System::LoadFileImage ( FileImageInfo * Info ) {
WriteTrace(TraceDebug,"CN64System::LoadFileImage 2"); WriteTrace(TraceDebug,"CN64System::LoadFileImage 2");
//Mark the rom as loading //Mark the rom as loading
_Settings->SaveDword(LoadingRom,(DWORD)true); _Settings->SaveBool(Info_RomLoading,true);
_this->_Notify->RefreshMenu(); _this->_Notify->RefreshMenu();
WriteTrace(TraceDebug,"CN64System::LoadFileImage 3"); WriteTrace(TraceDebug,"CN64System::LoadFileImage 3");
@ -285,7 +287,7 @@ void CN64System::LoadFileImage ( FileImageInfo * Info ) {
if (!Rom->LoadN64Image(ImageInfo.FileName.c_str())) { if (!Rom->LoadN64Image(ImageInfo.FileName.c_str())) {
_this->_Notify->DisplayError(Rom->GetError()); _this->_Notify->DisplayError(Rom->GetError());
delete Rom; delete Rom;
_Settings->SaveDword(LoadingRom,(DWORD)false); _Settings->SaveBool(Info_RomLoading,false);
_this->_Notify->RefreshMenu(); _this->_Notify->RefreshMenu();
return; return;
} }
@ -296,19 +298,19 @@ void CN64System::LoadFileImage ( FileImageInfo * Info ) {
WriteTrace(TraceDebug,"CN64System::LoadFileImage 5"); WriteTrace(TraceDebug,"CN64System::LoadFileImage 5");
Rom->SaveRomSettingID(); Rom->SaveRomSettingID();
{ /*{
stdstr &Name = Rom->GetRomName(); stdstr &Name = Rom->GetRomName();
_Settings->SaveString(ROM_InternalName,Name.c_str()); _Settings->SaveString(ROM_InternalName,Name.c_str());
} }*/
WriteTrace(TraceDebug,"CN64System::LoadFileImage 6"); WriteTrace(TraceDebug,"CN64System::LoadFileImage 6");
_this->_Notify->AddRecentRom(ImageInfo.FileName.c_str()); _this->_Notify->AddRecentRom(ImageInfo.FileName.c_str());
WriteTrace(TraceDebug,"CN64System::LoadFileImage 7"); WriteTrace(TraceDebug,"CN64System::LoadFileImage 7");
_this->SetupSystem(Rom,true); _this->SetupSystem(Rom,true);
WriteTrace(TraceDebug,"CN64System::LoadFileImage 8"); WriteTrace(TraceDebug,"CN64System::LoadFileImage 8");
_Settings->SaveDword(LoadingRom,(DWORD)false); _Settings->SaveBool(Info_RomLoading,false);
_this->_Notify->RefreshMenu(); _this->_Notify->RefreshMenu();
WriteTrace(TraceDebug,"CN64System::LoadFileImage 9"); WriteTrace(TraceDebug,"CN64System::LoadFileImage 9");
if (_Settings->LoadDword(AutoStart) != 0) if (_Settings->LoadDword(Setting_AutoStart) != 0)
{ {
_this->CPU_Handle = (void *)(*((DWORD *)ImageInfo.ThreadHandle)); _this->CPU_Handle = (void *)(*((DWORD *)ImageInfo.ThreadHandle));
_this->CPU_ThreadID = ImageInfo.ThreadID; _this->CPU_ThreadID = ImageInfo.ThreadID;
@ -332,7 +334,6 @@ void CN64System::LoadFileImage ( FileImageInfo * Info ) {
} else { } else {
delete ImageInfo.ThreadHandle; delete ImageInfo.ThreadHandle;
//Load rom settings //Load rom settings
_this->_Rom->LoadRomSettings();
_this->_Notify->DisplayMessage(5,MSG_WAITING_FOR_START); _this->_Notify->DisplayMessage(5,MSG_WAITING_FOR_START);
} }
WriteTrace(TraceDebug,"CN64System::LoadFileImage 10"); WriteTrace(TraceDebug,"CN64System::LoadFileImage 10");
@ -362,13 +363,13 @@ void CN64System::StartEmulation2 ( bool NewThread )
_Notify->HideRomBrowser(); _Notify->HideRomBrowser();
WriteTrace(TraceDebug,"CN64System::StartEmulation 3"); WriteTrace(TraceDebug,"CN64System::StartEmulation 3");
RefreshSettings(); //RefreshSettings();
WriteTrace(TraceDebug,"CN64System::StartEmulation 4"); WriteTrace(TraceDebug,"CN64System::StartEmulation 4");
m_Limitor.SetHertz(_Settings->LoadDword(ScreenHertz)); //Is set in LoadRomSettings m_Limitor.SetHertz(_Settings->LoadDword(Game_ScreenHertz));
WriteTrace(TraceDebug,"CN64System::StartEmulation 5"); WriteTrace(TraceDebug,"CN64System::StartEmulation 5");
_MMU->FixRDramSize(); _MMU->FixRDramSize();
_Notify->SetWindowCaption(_Settings->LoadString(ROM_NAME).c_str()); _Notify->SetWindowCaption(_Settings->LoadString(Game_GoodName).c_str());
WriteTrace(TraceDebug,"CN64System::StartEmulation 6"); WriteTrace(TraceDebug,"CN64System::StartEmulation 6");
_Notify->DisplayMessage(5,MSG_PLUGIN_INIT); _Notify->DisplayMessage(5,MSG_PLUGIN_INIT);
@ -377,7 +378,7 @@ void CN64System::StartEmulation2 ( bool NewThread )
WriteTrace(TraceDebug,"CN64System::StartEmulation 8"); WriteTrace(TraceDebug,"CN64System::StartEmulation 8");
if (!_Plugins->Initiate(this)) { if (!_Plugins->Initiate(this)) {
WriteTrace(TraceDebug,"CN64System::StartEmulation 8a"); WriteTrace(TraceDebug,"CN64System::StartEmulation 8a");
_Settings->SaveDword(LoadingRom,(DWORD)false); _Settings->SaveBool(Info_RomLoading,false);
_Notify->DisplayError(MSG_PLUGIN_NOT_INIT); _Notify->DisplayError(MSG_PLUGIN_NOT_INIT);
//Set handle to NULL so this thread is not terminated //Set handle to NULL so this thread is not terminated
CPU_Handle = NULL; CPU_Handle = NULL;
@ -392,15 +393,15 @@ void CN64System::StartEmulation2 ( bool NewThread )
WriteTrace(TraceDebug,"CN64System::StartEmulation 9"); WriteTrace(TraceDebug,"CN64System::StartEmulation 9");
_Cheats = new CCheats(_Rom,_Notify); _Cheats = new CCheats(_Rom,_Notify);
WriteTrace(TraceDebug,"CN64System::StartEmulation 10"); WriteTrace(TraceDebug,"CN64System::StartEmulation 10");
_Cheats->LoadCheats(!_Settings->LoadDword(RememberCheats)); _Cheats->LoadCheats(!_Settings->LoadDword(Setting_RememberCheats));
WriteTrace(TraceDebug,"CN64System::StartEmulation 11"); WriteTrace(TraceDebug,"CN64System::StartEmulation 11");
_Notify->DisplayMessage(5,"Done"); _Notify->DisplayMessage(5,"Done");
WriteTrace(TraceDebug,"CN64System::StartEmulation 12"); WriteTrace(TraceDebug,"CN64System::StartEmulation 12");
_Notify->MakeWindowOnTop(_Settings->LoadDword(AlwaysOnTop) != 0); _Notify->MakeWindowOnTop(_Settings->LoadBool(UserInterface_AlwaysOnTop));
WriteTrace(TraceDebug,"CN64System::StartEmulation 13"); WriteTrace(TraceDebug,"CN64System::StartEmulation 13");
if (!_Settings->LoadDword(IsValidExe)) if (!_Settings->LoadBool(Beta_IsValidExe))
{ {
Reset(); Reset();
return; return;
@ -409,10 +410,10 @@ void CN64System::StartEmulation2 ( bool NewThread )
//mark the emulation as starting and fix up menus //mark the emulation as starting and fix up menus
_Notify->DisplayMessage(5,MSG_EMULATION_STARTED); _Notify->DisplayMessage(5,MSG_EMULATION_STARTED);
WriteTrace(TraceDebug,"CN64System::StartEmulation 15"); WriteTrace(TraceDebug,"CN64System::StartEmulation 15");
if (_Settings->LoadDword(AutoFullScreen)) if (_Settings->LoadBool(Setting_AutoFullscreen))
{ {
CIniFile RomIniFile(_Settings->LoadString(RomDatabaseFile).c_str()); CIniFile RomIniFile(_Settings->LoadString(SupportFile_RomDatabase).c_str());
stdstr Status = _Settings->LoadString(ROM_Status); stdstr Status = _Settings->LoadString(Rdb_Status);
char String[100]; char String[100];
RomIniFile.GetString("Rom Status",stdstr_f("%s.AutoFullScreen", Status.c_str).c_str(),"true",String,sizeof(String)); RomIniFile.GetString("Rom Status",stdstr_f("%s.AutoFullScreen", Status.c_str).c_str(),"true",String,sizeof(String));
@ -458,7 +459,7 @@ void CN64System::CloseCpu ( void ) {
if (CPU_Handle == NULL) { return; } if (CPU_Handle == NULL) { return; }
Debug_Reset(); Debug_Reset();
if (_Settings->LoadDword(CPU_Paused)) if (_Settings->LoadBool(GameRunning_CPU_Paused))
{ {
SetEvent(m_hPauseEvent); SetEvent(m_hPauseEvent);
} }
@ -515,12 +516,12 @@ void CN64System::DisplayRomInfo ( WND_HANDLE hParent ) {
void CN64System::Pause(void) void CN64System::Pause(void)
{ {
ResetEvent(m_hPauseEvent); ResetEvent(m_hPauseEvent);
_Settings->SaveDword(CPU_Paused,true); _Settings->SaveBool(GameRunning_CPU_Paused,true);
_Notify->RefreshMenu(); _Notify->RefreshMenu();
_Notify->DisplayMessage(5,MSG_CPU_PAUSED); _Notify->DisplayMessage(5,MSG_CPU_PAUSED);
WaitForSingleObject(m_hPauseEvent, INFINITE); WaitForSingleObject(m_hPauseEvent, INFINITE);
ResetEvent(m_hPauseEvent); ResetEvent(m_hPauseEvent);
_Settings->SaveDword(CPU_Paused,(DWORD)false); _Settings->SaveBool(GameRunning_CPU_Paused,(DWORD)false);
_Notify->RefreshMenu(); _Notify->RefreshMenu();
_Notify->DisplayMessage(5,MSG_CPU_RESUMED); _Notify->DisplayMessage(5,MSG_CPU_RESUMED);
} }
@ -532,7 +533,7 @@ stdstr CN64System::ChooseFileToOpen ( WND_HANDLE hParent ) {
memset(&FileName, 0, sizeof(FileName)); memset(&FileName, 0, sizeof(FileName));
memset(&openfilename, 0, sizeof(openfilename)); memset(&openfilename, 0, sizeof(openfilename));
strcpy(Directory,_Settings->LoadString(RomDirectory).c_str()); strcpy(Directory,_Settings->LoadString(Directory_Game).c_str());
openfilename.lStructSize = sizeof( openfilename ); openfilename.lStructSize = sizeof( openfilename );
openfilename.hwndOwner = (HWND)hParent; openfilename.hwndOwner = (HWND)hParent;
@ -614,9 +615,6 @@ void CN64System::SetupSystem ( CN64Rom * Rom, bool OwnRomObject, bool SavesRead
m_OwnRomObject = OwnRomObject; m_OwnRomObject = OwnRomObject;
_Rom = Rom; _Rom = Rom;
//Load rom settings
_Rom->LoadRomSettings();
//Create New system //Create New system
_MMU = new CMipsMemory(this,this,_Rom,_Notify,new CRegisters(this, _Notify),SavesReadOnly); _MMU = new CMipsMemory(this,this,_Rom,_Notify,new CRegisters(this, _Notify),SavesReadOnly);
_Reg = _MMU->SystemRegisters(); _Reg = _MMU->SystemRegisters();
@ -639,11 +637,10 @@ void CN64System::SetupSystem ( CN64Rom * Rom, bool OwnRomObject, bool SavesRead
} }
void CN64System::ExecuteCPU ( void ) { void CN64System::ExecuteCPU ( void )
m_SPHack = _Settings->LoadDword(ROM_SPHack) != 0; {
_Settings->SaveBool(GameRunning_CPU_Running,true);
_Settings->SaveDword(CPU_Running,true); _Settings->SaveBool(GameRunning_CPU_Paused,false);
_Settings->SaveDword(CPU_Paused,(DWORD)false);
_Notify->DisplayMessage(5,MSG_EMULATION_STARTED); _Notify->DisplayMessage(5,MSG_EMULATION_STARTED);
EndEmulation = false; EndEmulation = false;
@ -654,7 +651,7 @@ void CN64System::ExecuteCPU ( void ) {
// C_Core.SetN64System(NULL); // C_Core.SetN64System(NULL);
C_Core.SetSyncCpu(NULL); C_Core.SetSyncCpu(NULL);
switch ((CPU_TYPE)_Settings->LoadDword(CPUType)) { switch ((CPU_TYPE)_Settings->LoadDword(Game_CpuType)) {
case CPU_Recompiler: ExecuteRecompiler(C_Core); break; case CPU_Recompiler: ExecuteRecompiler(C_Core); break;
case CPU_SyncCores: ExecuteSyncCPU(C_Core); break; case CPU_SyncCores: ExecuteSyncCPU(C_Core); break;
default: ExecuteInterpret(C_Core); break; default: ExecuteInterpret(C_Core); break;
@ -677,8 +674,10 @@ void CN64System::ExecuteRecompiler (CC_Core & C_Core) {
Recompiler.Run(); Recompiler.Run();
} }
void CN64System::ExecuteSyncCPU (CC_Core & C_Core) { void CN64System::ExecuteSyncCPU (CC_Core & C_Core)
//execute opcodes while no errors {
Notify().BreakPoint(__FILE__,__LINE__);
/* //execute opcodes while no errors
_Notify->DisplayMessage(5,"Copy Plugins"); _Notify->DisplayMessage(5,"Copy Plugins");
_Plugins->CopyPlugins(_Settings->LoadString(SyncPluginDir)); _Plugins->CopyPlugins(_Settings->LoadString(SyncPluginDir));
//copy the plugins //copy the plugins
@ -710,23 +709,20 @@ void CN64System::ExecuteSyncCPU (CC_Core & C_Core) {
InitializeCPUCore(); InitializeCPUCore();
Recompiler.Run(); Recompiler.Run();
SyncSystem._Rom = NULL; SyncSystem._Rom = NULL;
} }*/
} }
void CN64System::CpuStopped ( void ) { void CN64System::CpuStopped ( void ) {
void * lCPU_Handle = CPU_Handle; void * lCPU_Handle = CPU_Handle;
_Settings->SaveDword(CPU_Running,(DWORD)false); _Settings->SaveBool(GameRunning_CPU_Running,(DWORD)false);
CleanCMemory(); CleanCMemory();
if (_Settings->LoadDword(InFullScreen)) _Notify->WindowMode();
{
_Notify->ChangeFullScreen();
}
if (!m_InReset) if (!m_InReset)
{ {
_Notify->RefreshMenu(); _Notify->RefreshMenu();
_Notify->MakeWindowOnTop(false); _Notify->MakeWindowOnTop(false);
_Notify->DisplayMessage(5,MSG_EMULATION_ENDED); _Notify->DisplayMessage(5,MSG_EMULATION_ENDED);
if (_Settings->LoadDword(RomBrowser)) { if (_Settings->LoadDword(RomBrowser_Enabled)) {
_Notify->ShowRomBrowser(); _Notify->ShowRomBrowser();
} }
} }
@ -785,7 +781,7 @@ void CN64System::SyncCPU (CN64System * const SecondCPU) {
} }
} }
if (m_SPHack) if (bSPHack())
{ {
if (_MMU->m_MemoryStack != (DWORD)(_MMU->RDRAM + (_Reg->GPR[29].W[0] & 0x1FFFFFFF))) if (_MMU->m_MemoryStack != (DWORD)(_MMU->RDRAM + (_Reg->GPR[29].W[0] & 0x1FFFFFFF)))
{ {
@ -851,7 +847,7 @@ void CN64System::DumpSyncErrors (CN64System * SecondCPU) {
{ {
Error.LogF("Current Time Type is Different: %X %X\r\n",_Reg->GetCurrentTimerType(),SecondCPU->_Reg->GetCurrentTimerType()); Error.LogF("Current Time Type is Different: %X %X\r\n",_Reg->GetCurrentTimerType(),SecondCPU->_Reg->GetCurrentTimerType());
} }
if (_Settings->LoadDword(ROM_SPHack)) if (_Settings->LoadDword(Game_SPHack))
{ {
if (_MMU->m_MemoryStack != (DWORD)(_MMU->RDRAM + (_Reg->GPR[29].W[0] & 0x1FFFFFFF))) if (_MMU->m_MemoryStack != (DWORD)(_MMU->RDRAM + (_Reg->GPR[29].W[0] & 0x1FFFFFFF)))
{ {
@ -909,7 +905,8 @@ void CN64System::DumpSyncErrors (CN64System * SecondCPU) {
// AddEvent(CloseCPU); // AddEvent(CloseCPU);
} }
bool CN64System::SaveState(void) { bool CN64System::SaveState(void)
{
WriteTrace(TraceDebug,"CN64System::SaveState 1"); WriteTrace(TraceDebug,"CN64System::SaveState 1");
if (_Reg->GetTimer(AiTimerDMA) != 0) { return false; } if (_Reg->GetTimer(AiTimerDMA) != 0) { return false; }
@ -919,35 +916,35 @@ bool CN64System::SaveState(void) {
if ((_Reg->STATUS_REGISTER & STATUS_EXL) != 0) { return false; } if ((_Reg->STATUS_REGISTER & STATUS_EXL) != 0) { return false; }
//Get the file Name //Get the file Name
stdstr FileName, CurrentSaveName = _Settings->LoadString(InstantSaveFile); stdstr FileName, CurrentSaveName = _Settings->LoadString(GameRunning_InstantSaveFile);
if (CurrentSaveName.empty()) if (CurrentSaveName.empty())
{ {
int Slot = _Settings->LoadDword(CurrentSaveState); int Slot = _Settings->LoadDword(Game_CurrentSaveState);
if (Slot != 0) { if (Slot != 0) {
CurrentSaveName.Format("%s.pj%d",_Settings->LoadString(ROM_GoodName).c_str(), Slot); CurrentSaveName.Format("%s.pj%d",_Settings->LoadString(Game_GoodName).c_str(), Slot);
} else { } else {
CurrentSaveName.Format("%s.pj",_Settings->LoadString(ROM_GoodName).c_str()); CurrentSaveName.Format("%s.pj",_Settings->LoadString(Game_GoodName).c_str());
} }
FileName.Format("%s%s",_Settings->LoadString(InstantSaveDirectory).c_str(),CurrentSaveName.c_str()); FileName.Format("%s%s",_Settings->LoadString(Directory_InstantSave).c_str(),CurrentSaveName.c_str());
stdstr_f ZipFileName("%s.zip",FileName.c_str()); stdstr_f ZipFileName("%s.zip",FileName.c_str());
//Make sure the target dir exists //Make sure the target dir exists
CreateDirectory(_Settings->LoadString(InstantSaveDirectory).c_str(),NULL); CreateDirectory(_Settings->LoadString(Directory_InstantSave).c_str(),NULL);
//delete any old save //delete any old save
DeleteFile(FileName.c_str()); DeleteFile(FileName.c_str());
DeleteFile(ZipFileName.c_str()); DeleteFile(ZipFileName.c_str());
//If ziping save add .zip on the end //If ziping save add .zip on the end
if (_Settings->LoadDword(AutoZip)) { if (_Settings->LoadDword(Setting_AutoZipInstantSave)) {
FileName = ZipFileName; FileName = ZipFileName;
} }
_Settings->SaveDword(Game_LastSaveSlot,_Settings->LoadDword(CurrentSaveState)); _Settings->SaveDword(Game_LastSaveSlot,_Settings->LoadDword(Game_CurrentSaveState));
} else { } else {
FileName.Format("%s%s",CurrentSaveName.c_str(), _Settings->LoadDword(AutoZip) ? ".pj.zip" : ".pj"); FileName.Format("%s%s",CurrentSaveName.c_str(), _Settings->LoadDword(Setting_AutoZipInstantSave) ? ".pj.zip" : ".pj");
} }
if (FileName.empty()) { return true; } if (FileName.empty()) { return true; }
//Open the file //Open the file
if (_Settings->LoadDword(FuncLookupMode) == FuncFind_ChangeMemory) if (_Settings->LoadDword(Game_FuncLookupMode) == FuncFind_ChangeMemory)
{ {
if (GetRecompiler()) if (GetRecompiler())
{ {
@ -956,11 +953,11 @@ bool CN64System::SaveState(void) {
} }
DWORD dwWritten, SaveID_0 = 0x23D8A6C8; DWORD dwWritten, SaveID_0 = 0x23D8A6C8;
DWORD RdramSize = _Settings->LoadDword(RamSize); DWORD RdramSize = _Settings->LoadDword(Game_RDRamSize);
DWORD NextViTimer = _Reg->GetTimer(ViTimer); DWORD NextViTimer = _Reg->GetTimer(ViTimer);
DWORD MiInterReg = _Reg->MI_INTR_REG; DWORD MiInterReg = _Reg->MI_INTR_REG;
if (_Reg->GetTimer(AiTimer) != 0) { _Reg->MI_INTR_REG |= MI_INTR_AI; } if (_Reg->GetTimer(AiTimer) != 0) { _Reg->MI_INTR_REG |= MI_INTR_AI; }
if (_Settings->LoadDword(AutoZip)) { if (_Settings->LoadDword(Setting_AutoZipInstantSave)) {
zipFile file; zipFile file;
file = zipOpen(FileName.c_str(),0); file = zipOpen(FileName.c_str(),0);
@ -1032,7 +1029,7 @@ bool CN64System::SaveState(void) {
CloseHandle(hSaveFile); CloseHandle(hSaveFile);
} }
_Reg->MI_INTR_REG = MiInterReg; _Reg->MI_INTR_REG = MiInterReg;
_Settings->SaveString(InstantSaveFile,""); _Settings->SaveString(GameRunning_InstantSaveFile,"");
stdstr SaveMessage = _Lang->GetString(MSG_SAVED_STATE); stdstr SaveMessage = _Lang->GetString(MSG_SAVED_STATE);
CPath SavedFileName(FileName); CPath SavedFileName(FileName);
@ -1043,27 +1040,28 @@ bool CN64System::SaveState(void) {
return true; return true;
} }
bool CN64System::LoadState(void) { bool CN64System::LoadState(void)
stdstr InstantFileName = _Settings->LoadString(InstantSaveFile); {
stdstr InstantFileName = _Settings->LoadString(GameRunning_InstantSaveFile);
if (!InstantFileName.empty()) if (!InstantFileName.empty())
{ {
bool Result = LoadState(InstantFileName.c_str()); bool Result = LoadState(InstantFileName.c_str());
_Settings->SaveString(InstantSaveFile,""); _Settings->SaveString(GameRunning_InstantSaveFile,"");
return Result; return Result;
} }
CPath FileName; CPath FileName;
FileName.SetDriveDirectory(_Settings->LoadString(InstantSaveDirectory).c_str()); FileName.SetDriveDirectory(_Settings->LoadString(Directory_InstantSave).c_str());
if (_Settings->LoadDword(CurrentSaveState) != 0) { if (_Settings->LoadDword(Game_CurrentSaveState) != 0) {
FileName.SetNameExtension(stdstr_f("%s.pj%d",_Settings->LoadString(ROM_GoodName).c_str(),_Settings->LoadDword(CurrentSaveState)).c_str()); FileName.SetNameExtension(stdstr_f("%s.pj%d",_Settings->LoadString(Game_GoodName).c_str(),_Settings->LoadDword(Game_CurrentSaveState)).c_str());
} else { } else {
FileName.SetNameExtension(stdstr_f("%s.pj",_Settings->LoadString(ROM_GoodName).c_str()).c_str()); FileName.SetNameExtension(stdstr_f("%s.pj",_Settings->LoadString(Game_GoodName).c_str()).c_str());
} }
CPath ZipFileName; CPath ZipFileName;
ZipFileName = (stdstr&)FileName + ".zip"; ZipFileName = (stdstr&)FileName + ".zip";
if ((_Settings->LoadDword(AutoZip) && ZipFileName.Exists()) || FileName.Exists()) if ((_Settings->LoadDword(Setting_AutoZipInstantSave) && ZipFileName.Exists()) || FileName.Exists())
{ {
if (LoadState(FileName)) if (LoadState(FileName))
{ {
@ -1072,10 +1070,10 @@ bool CN64System::LoadState(void) {
} }
//Use old file Name //Use old file Name
if (_Settings->LoadDword(CurrentSaveState) != 0) { if (_Settings->LoadDword(Game_CurrentSaveState) != 0) {
FileName.SetNameExtension(stdstr_f("%s.pj%d",_Settings->LoadString(ROM_NAME).c_str(),_Settings->LoadDword(CurrentSaveState)).c_str()); FileName.SetNameExtension(stdstr_f("%s.pj%d",_Settings->LoadString(Game_GameName).c_str(),_Settings->LoadDword(Game_CurrentSaveState)).c_str());
} else { } else {
FileName.SetNameExtension(stdstr_f("%s.pj",_Settings->LoadString(ROM_NAME).c_str()).c_str()); FileName.SetNameExtension(stdstr_f("%s.pj",_Settings->LoadString(Game_GameName).c_str()).c_str());
} }
return LoadState(FileName); return LoadState(FileName);
} }
@ -1090,7 +1088,7 @@ bool CN64System::LoadState(LPCSTR FileName) {
_splitpath(FileName, drive, dir, fname, ext); _splitpath(FileName, drive, dir, fname, ext);
stdstr FileNameStr(FileName); stdstr FileNameStr(FileName);
if (_Settings->LoadDword(AutoZip) || _stricmp(ext,".zip") == 0) if (_Settings->LoadDword(Setting_AutoZipInstantSave) || _stricmp(ext,".zip") == 0)
{ {
//If ziping save add .zip on the end //If ziping save add .zip on the end
if (_stricmp(ext,".zip") != 0) if (_stricmp(ext,".zip") != 0)
@ -1137,10 +1135,10 @@ bool CN64System::LoadState(LPCSTR FileName) {
MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2); MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2);
if (result == IDNO) { return FALSE; } if (result == IDNO) { return FALSE; }
} }
_MMU->UnProtectMemory(0x80000000,0x80000000 + _Settings->LoadDword(RamSize) - 4); _MMU->UnProtectMemory(0x80000000,0x80000000 + _Settings->LoadDword(Game_RDRamSize) - 4);
_MMU->UnProtectMemory(0xA4000000,0xA4001FFC); _MMU->UnProtectMemory(0xA4000000,0xA4001FFC);
if (SaveRDRAMSize != _Settings->LoadDword(RamSize)) { if (SaveRDRAMSize != _Settings->LoadDword(Game_RDRamSize)) {
_Settings->SaveDword(RamSize,SaveRDRAMSize); _Settings->SaveDword(Game_RDRamSize,SaveRDRAMSize);
_MMU->FixRDramSize(); _MMU->FixRDramSize();
} }
unzReadCurrentFile(file,&NextVITimer,sizeof(NextVITimer)); unzReadCurrentFile(file,&NextVITimer,sizeof(NextVITimer));
@ -1190,10 +1188,10 @@ bool CN64System::LoadState(LPCSTR FileName) {
MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2); MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2);
if (result == IDNO) { return FALSE; } if (result == IDNO) { return FALSE; }
} }
_MMU->UnProtectMemory(0x80000000,0x80000000 + _Settings->LoadDword(RamSize) - 4); _MMU->UnProtectMemory(0x80000000,0x80000000 + _Settings->LoadDword(Game_RDRamSize) - 4);
_MMU->UnProtectMemory(0xA4000000,0xA4001FFC); _MMU->UnProtectMemory(0xA4000000,0xA4001FFC);
if (SaveRDRAMSize != _Settings->LoadDword(RamSize)) { if (SaveRDRAMSize != _Settings->LoadDword(Game_RDRamSize)) {
_Settings->SaveDword(RamSize,SaveRDRAMSize); _Settings->SaveDword(Game_RDRamSize,SaveRDRAMSize);
_MMU->FixRDramSize(); _MMU->FixRDramSize();
} }
ReadFile( hSaveFile,&NextVITimer,sizeof(NextVITimer),&dwRead,NULL); ReadFile( hSaveFile,&NextVITimer,sizeof(NextVITimer),&dwRead,NULL);
@ -1267,7 +1265,7 @@ bool CN64System::LoadState(LPCSTR FileName) {
#endif #endif
_MMU->m_MemoryStack = (DWORD)(_MMU->RDRAM + (_Reg->GPR[29].W[0] & 0x1FFFFFFF)); _MMU->m_MemoryStack = (DWORD)(_MMU->RDRAM + (_Reg->GPR[29].W[0] & 0x1FFFFFFF));
if (_Settings->LoadDword(CPUType) == CPU_SyncCores) { if (_Settings->LoadDword(Game_CpuType) == CPU_SyncCores) {
if (_SyncCPU) if (_SyncCPU)
{ {
for (int i = 0; i < (sizeof(m_LastSuccessSyncPC)/sizeof(m_LastSuccessSyncPC[0])); i++) { for (int i = 0; i < (sizeof(m_LastSuccessSyncPC)/sizeof(m_LastSuccessSyncPC[0])); i++) {
@ -1285,7 +1283,7 @@ bool CN64System::LoadState(LPCSTR FileName) {
// } // }
} }
WriteTrace(TraceDebug,"CN64System::LoadState 13"); WriteTrace(TraceDebug,"CN64System::LoadState 13");
_Settings->SaveDword(RamSize,SaveRDRAMSize); _Settings->SaveDword(Game_RDRamSize,SaveRDRAMSize);
WriteTrace(TraceDebug,"CN64System::LoadState 14"); WriteTrace(TraceDebug,"CN64System::LoadState 14");
stdstr LoadMsg = _Lang->GetString(MSG_LOADED_STATE); stdstr LoadMsg = _Lang->GetString(MSG_LOADED_STATE);
WriteTrace(TraceDebug,"CN64System::LoadState 15"); WriteTrace(TraceDebug,"CN64System::LoadState 15");
@ -1322,10 +1320,10 @@ void CN64System::RunRSP ( void ) {
m_UnknownCount += 1; m_UnknownCount += 1;
break; break;
} }
if (bShowDListAListCount) { if (bShowDListAListCount()) {
_Notify->DisplayMessage(0,"Dlist: %d Alist: %d Unknown: %d",m_DlistCount,m_AlistCount,m_UnknownCount); _Notify->DisplayMessage(0,"Dlist: %d Alist: %d Unknown: %d",m_DlistCount,m_AlistCount,m_UnknownCount);
} }
if (bShowCPUPer) { if (bShowCPUPer()) {
switch (Task) { switch (Task) {
case 1: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Dlist); break; case 1: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Dlist); break;
case 2: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Alist); break; case 2: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Alist); break;
@ -1353,7 +1351,7 @@ void CN64System::RunRSP ( void ) {
SP_STATUS_REG &= ~SP_STATUS_SIG2; SP_STATUS_REG &= ~SP_STATUS_SIG2;
}*/ }*/
if (bShowCPUPer) { m_CPU_Usage.StartTimer(CPU_UsageAddr); } if (bShowCPUPer()) { m_CPU_Usage.StartTimer(CPU_UsageAddr); }
//if (bProfiling) { m_Profile.StartTimer(ProfileAddr); } //if (bProfiling) { m_Profile.StartTimer(ProfileAddr); }
WriteTrace(TraceRSP, "RunRSP: check interrupts"); WriteTrace(TraceRSP, "RunRSP: check interrupts");
@ -1363,15 +1361,15 @@ void CN64System::RunRSP ( void ) {
} }
void CN64System::SyncToAudio ( void ) { void CN64System::SyncToAudio ( void ) {
if (!bBasicMode && !bLimitFPS ) if (!bBasicMode() && !bLimitFPS() )
{ {
return; return;
} }
if (!bFixedAudio) if (!bFixedAudio())
{ {
return; return;
} }
if (!bSyncToAudio) if (!bSyncToAudio())
{ {
return; return;
} }
@ -1391,7 +1389,7 @@ void CN64System::SyncToAudio ( void ) {
} }
DWORD CPU_UsageAddr = Timer_None; DWORD CPU_UsageAddr = Timer_None;
if (bShowCPUPer) if (bShowCPUPer())
{ {
CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_Idel); CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_Idel);
} }
@ -1403,7 +1401,7 @@ void CN64System::SyncToAudio ( void ) {
break; break;
} }
} }
if (bShowCPUPer) if (bShowCPUPer())
{ {
m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300 ); m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300 );
} }
@ -1414,7 +1412,7 @@ void CN64System::RefreshScreen ( void ) {
DWORD CPU_UsageAddr = Timer_None, ProfilingAddr = Timer_None; DWORD CPU_UsageAddr = Timer_None, ProfilingAddr = Timer_None;
DWORD OLD_VI_V_SYNC_REG = 0, VI_INTR_TIME = 500000; DWORD OLD_VI_V_SYNC_REG = 0, VI_INTR_TIME = 500000;
if (bShowCPUPer) { CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RefreshScreen); } if (bShowCPUPer()) { CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RefreshScreen); }
//if (bProfiling) { ProfilingAddr = m_Profile.StartTimer(Timer_RefreshScreen); } //if (bProfiling) { ProfilingAddr = m_Profile.StartTimer(Timer_RefreshScreen); }
//Calculate how many cycles to next refresh //Calculate how many cycles to next refresh
@ -1433,7 +1431,7 @@ void CN64System::RefreshScreen ( void ) {
} }
// _Plugins->Control()->UpdateKeys(); // _Plugins->Control()->UpdateKeys();
if (bShowCPUPer) { m_CPU_Usage.StartTimer(Timer_UpdateScreen); } if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_UpdateScreen); }
// if (bProfiling) { m_Profile.StartTimer(Timer_UpdateScreen); } // if (bProfiling) { m_Profile.StartTimer(Timer_UpdateScreen); }
__try __try
@ -1446,26 +1444,26 @@ void CN64System::RefreshScreen ( void ) {
WriteTrace(TraceError,"Exception caught in UpdateScreen"); WriteTrace(TraceError,"Exception caught in UpdateScreen");
} }
if ((bBasicMode || bLimitFPS ) && !bSyncToAudio) { if ((bBasicMode() || bLimitFPS() ) && !bSyncToAudio()) {
if (bShowCPUPer) { m_CPU_Usage.StartTimer(Timer_Idel); } if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_Idel); }
DWORD FrameRate; DWORD FrameRate;
if (m_Limitor.Timer_Process(&FrameRate) && bDisplayFrameRate) { if (m_Limitor.Timer_Process(&FrameRate) && bDisplayFrameRate()) {
FPS.DisplayViCounter(FrameRate); FPS.DisplayViCounter(FrameRate);
bCleanFrameBox = true; m_bCleanFrameBox = true;
} }
} else if (bDisplayFrameRate) { } else if (bDisplayFrameRate()) {
if (bShowCPUPer) { m_CPU_Usage.StartTimer(Timer_UpdateFPS); } if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_UpdateFPS); }
FPS.UpdateViCounter(); FPS.UpdateViCounter();
bCleanFrameBox = true; m_bCleanFrameBox = true;
} }
if (bCleanFrameBox && !bDisplayFrameRate) if (m_bCleanFrameBox && !bDisplayFrameRate())
{ {
FPS.Reset (true); FPS.Reset (true);
bCleanFrameBox = false; m_bCleanFrameBox = false;
} }
if (bShowCPUPer) { if (bShowCPUPer()) {
m_CPU_Usage.StopTimer(); m_CPU_Usage.StopTimer();
m_CPU_Usage.ShowCPU_Usage(); m_CPU_Usage.ShowCPU_Usage();
m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300 ); m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300 );
@ -1491,7 +1489,7 @@ void CN64System::TLB_Changed ( void )
void CN64System::TLB_Unmapping ( int TlbEntry, int FastTlbEntry, DWORD Vaddr, DWORD Len ) void CN64System::TLB_Unmapping ( int TlbEntry, int FastTlbEntry, DWORD Vaddr, DWORD Len )
{ {
if (_Recomp && _Recomp->bSMM_TLB) if (_Recomp && _Recomp->bSMM_TLB())
{ {
_Recomp->ClearRecompCode_Virt(Vaddr,Len,CRecompiler::Remove_TLB); _Recomp->ClearRecompCode_Virt(Vaddr,Len,CRecompiler::Remove_TLB);
} }

View File

@ -53,11 +53,11 @@ class CN64System :
CSpeedLimitor m_Limitor; CSpeedLimitor m_Limitor;
bool m_InReset; bool m_InReset;
SystemType m_SystemType; SystemType m_SystemType;
bool m_bCleanFrameBox;
//When Syncing cores this is the PC where it last Sync'ed correctly //When Syncing cores this is the PC where it last Sync'ed correctly
DWORD m_LastSuccessSyncPC[10]; DWORD m_LastSuccessSyncPC[10];
int m_CyclesToSkip; int m_CyclesToSkip;
bool m_SPHack;
//List of Internal events that need to be acted on by CPU //List of Internal events that need to be acted on by CPU
EVENT_LIST EventList; EVENT_LIST EventList;

View File

@ -456,69 +456,18 @@ bool CN64Rom::LoadN64Image ( const char * FileLoc, bool LoadBootCodeOnly ) {
return true; return true;
} }
void CN64Rom::LoadRomSettings (void) {
//Load Rom Settings
DWORD CPU_Type = _Settings->LoadDword(ROM_CPUType);
DWORD RDRamSize = _Settings->LoadDword(ROM_RamSize);
DWORD LookUpMode = _Settings->LoadDword(ROM_FunctionLookup);
bool UseCustomSMM = _Settings->LoadDword(ROM_CustomSMM) != 0;
if (RDRamSize != -1 && RDRamSize != 8) { RDRamSize = 0x400000; }
if (RDRamSize == 8) { RDRamSize = 0x800000; }
//Load system settings if need be
if (CPU_Type == -1) { CPU_Type = _Settings->LoadDword(SYSTEM_CPUType); }
if (RDRamSize == -1) { RDRamSize = _Settings->LoadDword(SYSTEM_RDRamSize); }
if (LookUpMode == -1) { LookUpMode = _Settings->LoadDword(SYSTEM_FunctionLookup); }
//Save execution settings
_Settings->SaveDword(CPUType, CPU_Type);
_Settings->SaveDword(RamSize, RDRamSize);
_Settings->SaveDword(FuncLookupMode, LookUpMode);
_Settings->SaveDword(SaveChipType, _Settings->LoadDword(ROM_SaveChip));
_Settings->SaveDword(SMM_Cache, _Settings->LoadDword(UseCustomSMM ? ROM_SMM_Cache : SYSTEM_SMM_Cache));
_Settings->SaveDword(SMM_PIDMA, _Settings->LoadDword(UseCustomSMM ? ROM_SMM_PIDMA : SYSTEM_SMM_PIDMA));
_Settings->SaveDword(SMM_TLB, _Settings->LoadDword(UseCustomSMM ? ROM_SMM_TLB : SYSTEM_SMM_TLB));
_Settings->SaveDword(SMM_Protect, _Settings->LoadDword(UseCustomSMM ? ROM_SMM_Protect : SYSTEM_SMM_Protect));
_Settings->SaveDword(SMM_ValidFunc, _Settings->LoadDword(UseCustomSMM ? ROM_SMM_ValidFunc : SYSTEM_SMM_ValidFunc));
_Settings->SaveDword(CounterFactor, _Settings->LoadDword(ROM_CounterFactor));
_Settings->SaveDword(BlockLinking, _Settings->LoadDword(ROM_BlockLinking));
_Settings->SaveDword(DelayDlists, _Settings->LoadDword(ROM_DelayDlists));
_Settings->SaveDword(DelaySI, _Settings->LoadDword(ROM_DelaySI));
_Settings->SaveDword(UseTLB, _Settings->LoadDword(ROM_UseTlb));
_Settings->SaveDword(AudioSignal, _Settings->LoadDword(ROM_AudioSignal));
_Settings->SaveDword(UseJumpTable, _Settings->LoadDword(ROM_UseJumpTable));
_Settings->SaveDword(RomInMemory, _Settings->LoadDword(ROM_RomInMemory));
_Settings->SaveDword(SyncViaAudio, _Settings->LoadDword(ROM_SyncAudio));
_Settings->SaveDword(FirstDMA, true);
_Settings->SaveDword(CurrentSaveState,_Settings->LoadDword(Game_LastSaveSlot));
if (_Settings->LoadDword(CounterFactor) == -1) { _Settings->SaveDword(CounterFactor, (DWORD)2); }
if (_Settings->LoadDword(BlockLinking) == -1) { _Settings->SaveDword(BlockLinking, _Settings->LoadDword(SYSTEM_BlockLinking)); }
DWORD hertz = 60;
switch (m_Country) {
case 0x44: //Germany
case 0x46: //french
case 0x49: //Italian
case 0x50: //Europe
case 0x53: //Spanish
case 0x55: //Australia
case 0x58: // X (PAL)
case 0x59: // X (PAL)
hertz = 50;
break;
}
_Settings->SaveDword(ScreenHertz,hertz);
}
//Save the settings of the loaded rom, so all loaded settings about rom will be identified with //Save the settings of the loaded rom, so all loaded settings about rom will be identified with
//this rom //this rom
void CN64Rom::SaveRomSettingID ( void ) { void CN64Rom::SaveRomSettingID ( void )
_Settings->SaveString(ROM_NAME,m_RomName.c_str()); {
_Settings->SaveString(ROM_IniKey,m_RomIdent.c_str()); _Settings->SaveString(Game_GameName,m_RomName.c_str());
_Settings->SaveString(Game_IniKey,m_RomIdent.c_str());
}
void CN64Rom::ClearRomSettingID ( void )
{
_Settings->SaveString(Game_GameName,"");
_Settings->SaveString(Game_IniKey,"");
} }
void CN64Rom::SetError ( LanguageStringID ErrorMsg ) { void CN64Rom::SetError ( LanguageStringID ErrorMsg ) {

View File

@ -28,7 +28,7 @@ public:
~CN64Rom ( void ); ~CN64Rom ( void );
bool LoadN64Image ( const char * FileLoc, bool LoadBootCodeOnly = false ); bool LoadN64Image ( const char * FileLoc, bool LoadBootCodeOnly = false );
void SaveRomSettingID ( void ); void SaveRomSettingID ( void );
void LoadRomSettings ( void ); void ClearRomSettingID ( void );
CICChip CicChipID ( void ); CICChip CicChipID ( void );
BYTE * GetRomAddress ( void ) { return m_ROMImage; } BYTE * GetRomAddress ( void ) { return m_ROMImage; }
DWORD GetRomSize ( void ) { return m_RomFileSize; } DWORD GetRomSize ( void ) { return m_RomFileSize; }

View File

@ -21,6 +21,7 @@ enum SystemEvent {
CloseCPU, CloseCPU,
PauseCPU_FromMenu, PauseCPU_FromMenu,
PauseCPU_AppLostActive, PauseCPU_AppLostActive,
PauseCPU_AppLostActiveDelay,
PauseCPU_AppLostFocus, PauseCPU_AppLostFocus,
PauseCPU_SaveGame, PauseCPU_SaveGame,
PauseCPU_LoadGame, PauseCPU_LoadGame,

View File

@ -6,8 +6,9 @@
#undef PROGRAM_COUNTER #undef PROGRAM_COUNTER
#undef RdramSize #undef RdramSize
#undef LookUpMode
#define LinkBlocks #undef LinkBlocks
#undef CountPerOp
CRecompiler::CRecompiler(CMipsMemory * MMU, CProfiling & Profile, bool & EndEmulation, bool SyncSystem) : CRecompiler::CRecompiler(CMipsMemory * MMU, CProfiling & Profile, bool & EndEmulation, bool SyncSystem) :
_MMU(MMU), _MMU(MMU),
@ -16,12 +17,6 @@ CRecompiler::CRecompiler(CMipsMemory * MMU, CProfiling & Profile, bool & EndEmul
PROGRAM_COUNTER(_Reg->PROGRAM_COUNTER), PROGRAM_COUNTER(_Reg->PROGRAM_COUNTER),
m_EndEmulation(EndEmulation), m_EndEmulation(EndEmulation),
m_SyncSystem(SyncSystem), m_SyncSystem(SyncSystem),
m_LookUpMode((FUNC_LOOKUP_METHOD)_Settings->LoadDword(FuncLookupMode)),
m_LinkBlocks(_Settings->LoadDword(BlockLinking) != 0),
m_DisableRegCaching(_Settings->LoadDword(ROM_RegCache) == 0),
m_RdramSize(_Settings->LoadDword(RamSize)),
m_CountPerOp(_Settings->LoadDword(CounterFactor)),
m_ValidateFuncs(_Settings->LoadDword(SMM_ValidFunc) != 0),
m_Functions(), m_Functions(),
m_FunctionsDelaySlot() m_FunctionsDelaySlot()
{ {
@ -41,7 +36,7 @@ void CRecompiler::Run()
Start_x86_Log(); Start_x86_Log();
} }
if (!g_MMU->AllocateRecompilerMemory(m_LookUpMode != FuncFind_VirtualLookup && m_LookUpMode != FuncFind_ChangeMemory)) if (!g_MMU->AllocateRecompilerMemory(LookUpMode() != FuncFind_VirtualLookup && LookUpMode() != FuncFind_ChangeMemory))
{ {
return; return;
} }
@ -52,16 +47,16 @@ void CRecompiler::Run()
m_EndEmulation = false; m_EndEmulation = false;
__try { __try {
if (m_LookUpMode == FuncFind_VirtualLookup) if (LookUpMode() == FuncFind_VirtualLookup)
{ {
if (m_ValidateFuncs) if (bSMM_ValidFunc())
{ {
RecompilerMain_VirtualTable_validate(); RecompilerMain_VirtualTable_validate();
} else { } else {
RecompilerMain_VirtualTable(); RecompilerMain_VirtualTable();
} }
} }
else if (m_LookUpMode == FuncFind_ChangeMemory) else if (LookUpMode() == FuncFind_ChangeMemory)
{ {
RecompilerMain_ChangeMemory(); RecompilerMain_ChangeMemory();
} }
@ -267,7 +262,7 @@ void CRecompiler::RecompilerMain_VirtualTable_validate ( void )
break; break;
} }
} }
if (m_ValidateFuncs) if (bSMM_ValidFunc())
{ {
if ((*Info->MemLocation[0] != Info->MemContents[0]) || if ((*Info->MemLocation[0] != Info->MemContents[0]) ||
(*Info->MemLocation[1] != Info->MemContents[1])) (*Info->MemLocation[1] != Info->MemContents[1]))
@ -299,7 +294,7 @@ void CRecompiler::RecompilerMain_VirtualTable_validate ( void )
break; break;
} }
} }
if (m_ValidateFuncs) if (bSMM_ValidFunc())
{ {
if ((*Info->MemLocation[0] != Info->MemContents[0]) || if ((*Info->MemLocation[0] != Info->MemContents[0]) ||
(*Info->MemLocation[1] != Info->MemContents[1])) (*Info->MemLocation[1] != Info->MemContents[1]))
@ -355,7 +350,7 @@ void CRecompiler::RecompilerMain_Lookup( void )
break; break;
} }
} }
if (m_ValidateFuncs) if (bSMM_ValidFunc())
{ {
if ((*Info->MemLocation[0] != Info->MemContents[0]) || if ((*Info->MemLocation[0] != Info->MemContents[0]) ||
(*Info->MemLocation[1] != Info->MemContents[1])) (*Info->MemLocation[1] != Info->MemContents[1]))
@ -378,7 +373,7 @@ void CRecompiler::RecompilerMain_Lookup( void )
__try { __try {
if (Addr > 0x10000000) if (Addr > 0x10000000)
{ {
if (bRomInMemory) if (bRomInMemory())
{ {
if (Addr > 0x20000000) if (Addr > 0x20000000)
{ {
@ -429,7 +424,7 @@ void CRecompiler::RecompilerMain_Lookup( void )
// VirtualProtect(N64MEM + Addr, 4, PAGE_READONLY, &OldProtect); // VirtualProtect(N64MEM + Addr, 4, PAGE_READONLY, &OldProtect);
// } // }
} }
if (m_ValidateFuncs) if (bSMM_ValidFunc())
{ {
if ((*Info->MemLocation[0] != Info->MemContents[0]) || if ((*Info->MemLocation[0] != Info->MemContents[0]) ||
(*Info->MemLocation[1] != Info->MemContents[1])) (*Info->MemLocation[1] != Info->MemContents[1]))
@ -479,7 +474,7 @@ void CRecompiler::ResetRecompCode()
memset(JumpTable,0,g_MMU->RdramSize()); memset(JumpTable,0,g_MMU->RdramSize());
memset(JumpTable + (0x04000000 >> 2),0,0x1000); memset(JumpTable + (0x04000000 >> 2),0,0x1000);
memset(JumpTable + (0x04001000 >> 2),0,0x1000); memset(JumpTable + (0x04001000 >> 2),0,0x1000);
if (bRomInMemory) if (bRomInMemory())
{ {
memset(JumpTable + (0x10000000 >> 2),0,RomFileSize); memset(JumpTable + (0x10000000 >> 2),0,RomFileSize);
} }
@ -559,7 +554,7 @@ FUNCTION_INFO * CRecompiler::CompileDelaySlot(DWORD PC)
{ {
return NULL; return NULL;
} }
if (StartAddress < m_RdramSize) { if (StartAddress < RdramSize()) {
CPU_Message("====== RDRAM: Delay Slot ======"); CPU_Message("====== RDRAM: Delay Slot ======");
} else if (StartAddress >= 0x04000000 && StartAddress <= 0x04000FFC) { } else if (StartAddress >= 0x04000000 && StartAddress <= 0x04000FFC) {
CPU_Message("====== DMEM: Delay Slot ======"); CPU_Message("====== DMEM: Delay Slot ======");
@ -575,7 +570,7 @@ FUNCTION_INFO * CRecompiler::CompileDelaySlot(DWORD PC)
CPU_Message("====== recompiled code ======"); CPU_Message("====== recompiled code ======");
Section->AddParent(NULL); Section->AddParent(NULL);
Section->BlockCycleCount() += CountPerOp; Section->BlockCycleCount() += CountPerOp();
Section->BlockRandomModifier() += 1; Section->BlockRandomModifier() += 1;
switch (Opcode.op) { switch (Opcode.op) {
@ -738,7 +733,7 @@ FUNCTION_INFO * CRecompiler::CompileDelaySlot(DWORD PC)
bool CRecompiler::AnalyseBlock ( CBlockInfo & BlockInfo) bool CRecompiler::AnalyseBlock ( CBlockInfo & BlockInfo)
{ {
if (m_LinkBlocks) if (bLinkBlocks())
{ {
CBlockSection * Section = &BlockInfo.ParentSection; CBlockSection * Section = &BlockInfo.ParentSection;
if (!CreateSectionLinkage (Section)) { return false; } if (!CreateSectionLinkage (Section)) { return false; }
@ -1857,13 +1852,13 @@ bool CRecompiler::Compiler4300iBlock(FUNCTION_INFO * info) {
DWORD StartTime = timeGetTime(); DWORD StartTime = timeGetTime();
WriteTraceF(TraceRecompiler,"Compile Block-Start: %X-%X",info->VStartPC(),info->VEndPC()); WriteTraceF(TraceRecompiler,"Compile Block-Start: %X-%X",info->VStartPC(),info->VEndPC());
if (bProfiling) { m_Profile.StartTimer(Timer_GetBlockInfo); } if (bProfiling()) { m_Profile.StartTimer(Timer_GetBlockInfo); }
CBlockInfo BlockInfo(PROGRAM_COUNTER, RecompPos); CBlockInfo BlockInfo(PROGRAM_COUNTER, RecompPos);
if (bProfiling) { m_Profile.StartTimer(Timer_AnalyseBlock); } if (bProfiling()) { m_Profile.StartTimer(Timer_AnalyseBlock); }
if (!AnalyseBlock(BlockInfo)) { return false; } if (!AnalyseBlock(BlockInfo)) { return false; }
if (bProfiling) { m_Profile.StartTimer(Timer_CompileBlock); } if (bProfiling()) { m_Profile.StartTimer(Timer_CompileBlock); }
DWORD StartAddress; DWORD StartAddress;
if (!_MMU->TranslateVaddr(BlockInfo.StartVAddr,StartAddress)) if (!_MMU->TranslateVaddr(BlockInfo.StartVAddr,StartAddress))
{ {
@ -1872,7 +1867,7 @@ bool CRecompiler::Compiler4300iBlock(FUNCTION_INFO * info) {
} }
/* MarkCodeBlock(StartAddress); /* MarkCodeBlock(StartAddress);
if (StartAddress < m_RdramSize) { if (StartAddress < RdramSize()) {
CPU_Message("====== RDRAM: block (%X:%d) ======", StartAddress>>12,N64_Blocks.NoOfRDRamBlocks[StartAddress>>12]); CPU_Message("====== RDRAM: block (%X:%d) ======", StartAddress>>12,N64_Blocks.NoOfRDRamBlocks[StartAddress>>12]);
} else if (StartAddress >= 0x04000000 && StartAddress <= 0x04000FFC) { } else if (StartAddress >= 0x04000000 && StartAddress <= 0x04000FFC) {
CPU_Message("====== DMEM: block (%d) ======", N64_Blocks.NoOfDMEMBlocks); CPU_Message("====== DMEM: block (%d) ======", N64_Blocks.NoOfDMEMBlocks);
@ -1892,7 +1887,7 @@ bool CRecompiler::Compiler4300iBlock(FUNCTION_INFO * info) {
CPU_Message("Start of Block: %X",BlockInfo.StartVAddr ); CPU_Message("Start of Block: %X",BlockInfo.StartVAddr );
CPU_Message("No of Sections: %d",BlockInfo.NoOfSections ); CPU_Message("No of Sections: %d",BlockInfo.NoOfSections );
CPU_Message("====== recompiled code ======"); CPU_Message("====== recompiled code ======");
if (m_LinkBlocks) { if (bLinkBlocks()) {
for (int count = 0; count < BlockInfo.NoOfSections; count ++) { for (int count = 0; count < BlockInfo.NoOfSections; count ++) {
DisplaySectionInformation(&BlockInfo.ParentSection,count + 1,CBlockSection::GetNewTestValue()); DisplaySectionInformation(&BlockInfo.ParentSection,count + 1,CBlockSection::GetNewTestValue());
} }
@ -1904,7 +1899,7 @@ bool CRecompiler::Compiler4300iBlock(FUNCTION_INFO * info) {
BlockInfo.ParentSection.RegStart.Initilize(); BlockInfo.ParentSection.RegStart.Initilize();
BlockInfo.ParentSection.RegWorking = BlockInfo.ParentSection.RegStart; BlockInfo.ParentSection.RegWorking = BlockInfo.ParentSection.RegStart;
if (m_LinkBlocks) { if (bLinkBlocks()) {
while (GenerateX86Code(BlockInfo,&BlockInfo.ParentSection,CBlockSection::GetNewTestValue())); while (GenerateX86Code(BlockInfo,&BlockInfo.ParentSection,CBlockSection::GetNewTestValue()));
} else { } else {
GenerateX86Code(BlockInfo,&BlockInfo.ParentSection,CBlockSection::GetNewTestValue()); GenerateX86Code(BlockInfo,&BlockInfo.ParentSection,CBlockSection::GetNewTestValue());
@ -1912,7 +1907,7 @@ bool CRecompiler::Compiler4300iBlock(FUNCTION_INFO * info) {
CompileExitCode(BlockInfo); CompileExitCode(BlockInfo);
CPU_Message("====== End of recompiled code ======"); CPU_Message("====== End of recompiled code ======");
if (bProfiling) { m_Profile.StartTimer(Timer_CompileDone); } if (bProfiling()) { m_Profile.StartTimer(Timer_CompileDone); }
info->SetVEndPC(BlockInfo.EndVAddr); info->SetVEndPC(BlockInfo.EndVAddr);
info->SetFunctionAddr(BlockInfo.CompiledLocation); info->SetFunctionAddr(BlockInfo.CompiledLocation);
@ -1920,13 +1915,13 @@ bool CRecompiler::Compiler4300iBlock(FUNCTION_INFO * info) {
info->MemLocation[1] = info->MemLocation[0] + 1; info->MemLocation[1] = info->MemLocation[0] + 1;
info->MemContents[0] = *info->MemLocation[0]; info->MemContents[0] = *info->MemLocation[0];
info->MemContents[1] = *info->MemLocation[1]; info->MemContents[1] = *info->MemLocation[1];
if (bSMM_Protect) if (bSMM_Protect())
{ {
_MMU->ProtectMemory(info->VStartPC(),info->VEndPC()); _MMU->ProtectMemory(info->VStartPC(),info->VEndPC());
} }
NextInstruction = NORMAL; NextInstruction = NORMAL;
if (bShowRecompMemSize) if (bShowRecompMemSize())
{ {
DWORD Size = RecompPos - RecompCode; DWORD Size = RecompPos - RecompCode;
DWORD MB = Size / 0x100000; DWORD MB = Size / 0x100000;
@ -1938,7 +1933,7 @@ bool CRecompiler::Compiler4300iBlock(FUNCTION_INFO * info) {
DisplayMessage(0,"Memory used: %d mb %-3d kb %-3d bytes Total Available: %d mb",MB,KB,Size, TotalAvaliable); DisplayMessage(0,"Memory used: %d mb %-3d kb %-3d bytes Total Available: %d mb",MB,KB,Size, TotalAvaliable);
} }
if (bProfiling) { m_Profile.StopTimer(); } if (bProfiling()) { m_Profile.StopTimer(); }
DWORD TimeTaken = timeGetTime() - StartTime; DWORD TimeTaken = timeGetTime() - StartTime;
WriteTraceF(TraceRecompiler,"Compile Block-Done: %X-%X - Taken: %d",info->VStartPC(),info->VEndPC(),TimeTaken); WriteTraceF(TraceRecompiler,"Compile Block-Done: %X-%X - Taken: %d",info->VStartPC(),info->VEndPC(),TimeTaken);
@ -2600,7 +2595,7 @@ bool CRecompiler::GenerateX86Code(CBlockInfo & BlockInfo, CBlockSection * Sectio
{ {
Section->BlockInfo->EndVAddr = Section->CompilePC; Section->BlockInfo->EndVAddr = Section->CompilePC;
} }
Section->BlockCycleCount() += m_CountPerOp; Section->BlockCycleCount() += CountPerOp();
//CPU_Message("BlockCycleCount = %d",BlockCycleCount); //CPU_Message("BlockCycleCount = %d",BlockCycleCount);
Section->BlockRandomModifier() += 1; Section->BlockRandomModifier() += 1;
//CPU_Message("BlockRandomModifier = %d",BlockRandomModifier); //CPU_Message("BlockRandomModifier = %d",BlockRandomModifier);
@ -2842,7 +2837,7 @@ bool CRecompiler::GenerateX86Code(CBlockInfo & BlockInfo, CBlockSection * Sectio
Compile_R4300i_UnknownOpcode(Section); break; Compile_R4300i_UnknownOpcode(Section); break;
} }
if (m_DisableRegCaching) { WriteBackRegisters(Section); } if (!bRegCaching()) { WriteBackRegisters(Section); }
Section->ResetX86Protection(); Section->ResetX86Protection();
/*if ((DWORD)RecompPos > 0x60B452E6) { /*if ((DWORD)RecompPos > 0x60B452E6) {
@ -2899,7 +2894,7 @@ bool CRecompiler::GenerateX86Code(CBlockInfo & BlockInfo, CBlockSection * Sectio
break; break;
case DELAY_SLOT: case DELAY_SLOT:
NextInstruction = DELAY_SLOT_DONE; NextInstruction = DELAY_SLOT_DONE;
Section->BlockCycleCount() -= m_CountPerOp; Section->BlockCycleCount() -= CountPerOp();
Section->BlockRandomModifier() -= 1; Section->BlockRandomModifier() -= 1;
Section->CompilePC -= 4; Section->CompilePC -= 4;
break; break;
@ -2967,7 +2962,7 @@ void CRecompiler::CompileExit ( CBlockSection * Section, DWORD JumpPC, DWORD Tar
#ifdef LinkBlocks #ifdef LinkBlocks
if (bSMM_ValidFunc == false) if (bSMM_ValidFunc == false)
{ {
if (LookUpMode == FuncFind_ChangeMemory) if (LookUpMode() == FuncFind_ChangeMemory)
{ {
BreakPoint(__FILE__,__LINE__); BreakPoint(__FILE__,__LINE__);
// BYTE * Jump, * Jump2; // BYTE * Jump, * Jump2;
@ -3002,7 +2997,7 @@ void CRecompiler::CompileExit ( CBlockSection * Section, DWORD JumpPC, DWORD Tar
// *((BYTE *)(Jump2))=(BYTE)(RecompPos - Jump2 - 1); // *((BYTE *)(Jump2))=(BYTE)(RecompPos - Jump2 - 1);
// } // }
} }
else if (LookUpMode == FuncFind_VirtualLookup) else if (LookUpMode() == FuncFind_VirtualLookup)
{ {
MoveConstToX86reg(TargetPC,x86_EDX); MoveConstToX86reg(TargetPC,x86_EDX);
MoveConstToX86reg((DWORD)&m_Functions,x86_ECX); MoveConstToX86reg((DWORD)&m_Functions,x86_ECX);
@ -3015,7 +3010,7 @@ void CRecompiler::CompileExit ( CBlockSection * Section, DWORD JumpPC, DWORD Tar
CPU_Message(" NullPointer:"); CPU_Message(" NullPointer:");
*((BYTE *)(Jump))=(BYTE)(RecompPos - Jump - 1); *((BYTE *)(Jump))=(BYTE)(RecompPos - Jump - 1);
} }
else if (LookUpMode == FuncFind_PhysicalLookup) else if (LookUpMode() == FuncFind_PhysicalLookup)
{ {
BYTE * Jump2 = NULL; BYTE * Jump2 = NULL;
if (TargetPC >= 0x80000000 && TargetPC < 0x90000000) { if (TargetPC >= 0x80000000 && TargetPC < 0x90000000) {
@ -3370,7 +3365,7 @@ void SyncRegState (CBlockSection * Section, CRegInfo * SyncTo) {
} }
} }
void GenerateSectionLinkage (CBlockSection * Section) { void CRecompiler::GenerateSectionLinkage (CBlockSection * Section) {
CBlockSection ** TargetSection[2]; CBlockSection ** TargetSection[2];
CJumpInfo * JumpInfo[2]; CJumpInfo * JumpInfo[2];
BYTE * Jump; BYTE * Jump;
@ -3440,10 +3435,10 @@ void GenerateSectionLinkage (CBlockSection * Section) {
CPU_Message("PermLoop *** a"); CPU_Message("PermLoop *** a");
MoveConstToVariable(Section->CompilePC,g_PROGRAM_COUNTER,"PROGRAM_COUNTER"); MoveConstToVariable(Section->CompilePC,g_PROGRAM_COUNTER,"PROGRAM_COUNTER");
WriteBackRegisters(Section); WriteBackRegisters(Section);
Section->RegWorking.BlockCycleCount() -= CountPerOp; Section->RegWorking.BlockCycleCount() -= CountPerOp();
g_N64System->GetRecompiler()->UpdateCounters(&Section->RegWorking.BlockCycleCount(),&Section->RegWorking.BlockRandomModifier(), false); g_N64System->GetRecompiler()->UpdateCounters(&Section->RegWorking.BlockCycleCount(),&Section->RegWorking.BlockRandomModifier(), false);
Call_Direct(InPermLoop,"InPermLoop"); Call_Direct(InPermLoop,"InPermLoop");
Section->RegWorking.BlockCycleCount() += CountPerOp; Section->RegWorking.BlockCycleCount() += CountPerOp();
g_N64System->GetRecompiler()->UpdateCounters(&Section->RegWorking.BlockCycleCount(),&Section->RegWorking.BlockRandomModifier(), true); g_N64System->GetRecompiler()->UpdateCounters(&Section->RegWorking.BlockCycleCount(),&Section->RegWorking.BlockRandomModifier(), true);
g_N64System->GetRecompiler()->CompileSystemCheck(-1,Section->RegWorking); g_N64System->GetRecompiler()->CompileSystemCheck(-1,Section->RegWorking);
@ -3514,10 +3509,10 @@ CPU_Message("PermLoop *** a");
if (JumpInfo[count]->PermLoop) { if (JumpInfo[count]->PermLoop) {
CPU_Message("PermLoop *** 1"); CPU_Message("PermLoop *** 1");
MoveConstToVariable(JumpInfo[count]->TargetPC,g_PROGRAM_COUNTER,"PROGRAM_COUNTER"); MoveConstToVariable(JumpInfo[count]->TargetPC,g_PROGRAM_COUNTER,"PROGRAM_COUNTER");
JumpInfo[count]->RegSet.BlockCycleCount() -= CountPerOp; JumpInfo[count]->RegSet.BlockCycleCount() -= CountPerOp();
g_N64System->GetRecompiler()->UpdateCounters(&JumpInfo[count]->RegSet.BlockCycleCount(),&JumpInfo[count]->RegSet.BlockRandomModifier(), false); g_N64System->GetRecompiler()->UpdateCounters(&JumpInfo[count]->RegSet.BlockCycleCount(),&JumpInfo[count]->RegSet.BlockRandomModifier(), false);
Call_Direct(InPermLoop,"InPermLoop"); Call_Direct(InPermLoop,"InPermLoop");
JumpInfo[count]->RegSet.BlockCycleCount() += CountPerOp; JumpInfo[count]->RegSet.BlockCycleCount() += CountPerOp();
g_N64System->GetRecompiler()->UpdateCounters(&JumpInfo[count]->RegSet.BlockCycleCount(),&JumpInfo[count]->RegSet.BlockRandomModifier(), true); g_N64System->GetRecompiler()->UpdateCounters(&JumpInfo[count]->RegSet.BlockCycleCount(),&JumpInfo[count]->RegSet.BlockRandomModifier(), true);
g_N64System->GetRecompiler()->CompileSystemCheck(-1,JumpInfo[count]->RegSet); g_N64System->GetRecompiler()->CompileSystemCheck(-1,JumpInfo[count]->RegSet);
} else { } else {
@ -3550,10 +3545,10 @@ CPU_Message("PermLoop *** 1");
if (JumpInfo[count]->PermLoop) { if (JumpInfo[count]->PermLoop) {
CPU_Message("PermLoop *** 2"); CPU_Message("PermLoop *** 2");
MoveConstToVariable(JumpInfo[count]->TargetPC,g_PROGRAM_COUNTER,"PROGRAM_COUNTER"); MoveConstToVariable(JumpInfo[count]->TargetPC,g_PROGRAM_COUNTER,"PROGRAM_COUNTER");
JumpInfo[count]->RegSet.BlockCycleCount() -= CountPerOp; JumpInfo[count]->RegSet.BlockCycleCount() -= CountPerOp();
g_N64System->GetRecompiler()->UpdateCounters(&JumpInfo[count]->RegSet.BlockCycleCount(),&JumpInfo[count]->RegSet.BlockRandomModifier(), false); g_N64System->GetRecompiler()->UpdateCounters(&JumpInfo[count]->RegSet.BlockCycleCount(),&JumpInfo[count]->RegSet.BlockRandomModifier(), false);
Call_Direct(InPermLoop,"InPermLoop"); Call_Direct(InPermLoop,"InPermLoop");
JumpInfo[count]->RegSet.BlockCycleCount() += CountPerOp; JumpInfo[count]->RegSet.BlockCycleCount() += CountPerOp();
g_N64System->GetRecompiler()->UpdateCounters(&JumpInfo[count]->RegSet.BlockCycleCount(),&JumpInfo[count]->RegSet.BlockRandomModifier(), true); g_N64System->GetRecompiler()->UpdateCounters(&JumpInfo[count]->RegSet.BlockCycleCount(),&JumpInfo[count]->RegSet.BlockRandomModifier(), true);
g_N64System->GetRecompiler()->CompileSystemCheck(-1,JumpInfo[count]->RegSet); g_N64System->GetRecompiler()->CompileSystemCheck(-1,JumpInfo[count]->RegSet);
} }
@ -3692,7 +3687,7 @@ void CRecompiler::RemoveFunction (FUNCTION_INFO * FunInfo, bool DelaySlot, REMOV
} }
//if no more functions in this block then unprotect the memory //if no more functions in this block then unprotect the memory
if (bSMM_Protect) if (bSMM_Protect())
{ {
for (DWORD Addr = StartBlock; Addr <= EndBlock; Addr += 0x1000 ){ for (DWORD Addr = StartBlock; Addr <= EndBlock; Addr += 0x1000 ){
FUNCTION_INFO * info = m_Functions.FindFunction(Addr,0xFFF); FUNCTION_INFO * info = m_Functions.FindFunction(Addr,0xFFF);
@ -3721,7 +3716,7 @@ bool CRecompiler::ClearRecompCode_Phys(DWORD Address, int length, REMOVE_REASON
} }
} }
} }
if (LookUpMode == FuncFind_PhysicalLookup) if (LookUpMode() == FuncFind_PhysicalLookup)
{ {
WriteTraceF(TraceRecompiler,"Reseting Jump Table, Addr: %X len: %d",Address,((length + 3) & ~3)); WriteTraceF(TraceRecompiler,"Reseting Jump Table, Addr: %X len: %d",Address,((length + 3) & ~3));
memset((BYTE *)JumpTable + Address,0,((length + 3) & ~3)); memset((BYTE *)JumpTable + Address,0,((length + 3) & ~3));
@ -3750,7 +3745,7 @@ bool CRecompiler::ClearRecompCode_Virt(DWORD Address, int length,REMOVE_REASON R
} }
} while (info != NULL); } while (info != NULL);
if (bSMM_Protect) if (bSMM_Protect())
{ {
DWORD Start = Address & ~0xFFF; DWORD Start = Address & ~0xFFF;
info = m_Functions.FindFunction(Start,0xFFF); info = m_Functions.FindFunction(Start,0xFFF);

View File

@ -15,18 +15,13 @@ public:
private: private:
CMipsMemory * const _MMU; //Memory of the n64 CMipsMemory * const _MMU; //Memory of the n64
CRegisters * const _Reg; CRegisters * const _Reg;
bool const m_SyncSystem;
CProfiling & m_Profile; CProfiling & m_Profile;
bool & m_EndEmulation; bool & m_EndEmulation;
//Quick access to registers //Quick access to registers
DWORD & PROGRAM_COUNTER; DWORD & PROGRAM_COUNTER;
//Cached settings
bool const m_SyncSystem, m_LinkBlocks, m_DisableRegCaching,
m_ValidateFuncs;
DWORD const m_RdramSize, m_CountPerOp;
FUNC_LOOKUP_METHOD const m_LookUpMode;
//Functions //Functions
CDelaySlotFunctionMap m_FunctionsDelaySlot; CDelaySlotFunctionMap m_FunctionsDelaySlot;
CFunctionMap m_Functions; CFunctionMap m_Functions;
@ -68,6 +63,7 @@ public:
void UpdateCounters ( DWORD * Cycles, DWORD * RandomMod, BOOL CheckTimer); void UpdateCounters ( DWORD * Cycles, DWORD * RandomMod, BOOL CheckTimer);
void CompileExit ( CBlockSection * Section, DWORD JumpPC, DWORD TargetPC, CRegInfo ExitRegSet, CExitInfo::EXIT_REASON reason, int CompileNow, void (*x86Jmp)(char * Label, DWORD Value)); void CompileExit ( CBlockSection * Section, DWORD JumpPC, DWORD TargetPC, CRegInfo ExitRegSet, CExitInfo::EXIT_REASON reason, int CompileNow, void (*x86Jmp)(char * Label, DWORD Value));
bool GenerateX86Code (CBlockInfo & BlockInfo, CBlockSection * Section, DWORD Test ); bool GenerateX86Code (CBlockInfo & BlockInfo, CBlockSection * Section, DWORD Test );
void GenerateSectionLinkage (CBlockSection * Section);
//Self modifying code methods //Self modifying code methods
bool ClearRecompCode_Virt ( DWORD VirtualAddress, int length, REMOVE_REASON Reason ); bool ClearRecompCode_Virt ( DWORD VirtualAddress, int length, REMOVE_REASON Reason );

View File

@ -66,10 +66,10 @@ CAudioPlugin::CAudioPlugin ( const char * FileName) {
info.DefaultStartRange = FirstAudioDefaultSet; info.DefaultStartRange = FirstAudioDefaultSet;
info.SettingStartRange = FirstAudioSettings; info.SettingStartRange = FirstAudioSettings;
info.MaximumSettings = MaxPluginSetting; info.MaximumSettings = MaxPluginSetting;
info.NoDefault = No_Default; info.NoDefault = Default_None;
info.DefaultLocation = _Settings->LoadDword(UseSettingFromRegistry) ? SettingLocation_Registry : SettingLocation_CfgFile; info.DefaultLocation = _Settings->LoadDword(Setting_UseFromRegistry) ? SettingType_Registry : SettingType_CfgFile;
info.handle = _Settings; info.handle = _Settings;
info.RegisterSetting = (void (*)(void *,int,int,SettingDataType,SettingLocation,const char *,const char *, DWORD))CSettings::RegisterSetting; info.RegisterSetting = (void (*)(void *,int,int,SettingDataType,SettingType,const char *,const char *, DWORD))CSettings::RegisterSetting;
info.GetSetting = (unsigned int (*)( void * handle, int ID ))CSettings::GetSetting; info.GetSetting = (unsigned int (*)( void * handle, int ID ))CSettings::GetSetting;
info.GetSettingSz = (const char * (*)( void *, int, char *, int ))CSettings::GetSettingSz; info.GetSettingSz = (const char * (*)( void *, int, char *, int ))CSettings::GetSettingSz;
info.SetSetting = (void (*)(void *,int,unsigned int))CSettings::SetSetting; info.SetSetting = (void (*)(void *,int,unsigned int))CSettings::SetSetting;

View File

@ -67,10 +67,10 @@ CControl_Plugin::CControl_Plugin ( const char * FileName) {
info.DefaultStartRange = FirstCtrlDefaultSet; info.DefaultStartRange = FirstCtrlDefaultSet;
info.SettingStartRange = FirstCtrlSettings; info.SettingStartRange = FirstCtrlSettings;
info.MaximumSettings = MaxPluginSetting; info.MaximumSettings = MaxPluginSetting;
info.NoDefault = No_Default; info.NoDefault = Default_None;
info.DefaultLocation = _Settings->LoadDword(UseSettingFromRegistry) ? SettingLocation_Registry : SettingLocation_CfgFile; info.DefaultLocation = _Settings->LoadDword(Setting_UseFromRegistry) ? SettingType_Registry : SettingType_CfgFile;
info.handle = _Settings; info.handle = _Settings;
info.RegisterSetting = (void (*)(void *,int,int,SettingDataType,SettingLocation,const char *,const char *, DWORD))CSettings::RegisterSetting; info.RegisterSetting = (void (*)(void *,int,int,SettingDataType,SettingType,const char *,const char *, DWORD))CSettings::RegisterSetting;
info.GetSetting = (unsigned int (*)( void * handle, int ID ))CSettings::GetSetting; info.GetSetting = (unsigned int (*)( void * handle, int ID ))CSettings::GetSetting;
info.GetSettingSz = (const char * (*)( void *, int, char *, int ))CSettings::GetSettingSz; info.GetSettingSz = (const char * (*)( void *, int, char *, int ))CSettings::GetSettingSz;
info.SetSetting = (void (*)(void *,int,unsigned int))CSettings::SetSetting; info.SetSetting = (void (*)(void *,int,unsigned int))CSettings::SetSetting;

View File

@ -93,10 +93,10 @@ CGfxPlugin::CGfxPlugin ( const char * FileName) {
info.DefaultStartRange = FirstGfxDefaultSet; info.DefaultStartRange = FirstGfxDefaultSet;
info.SettingStartRange = FirstGfxSettings; info.SettingStartRange = FirstGfxSettings;
info.MaximumSettings = MaxPluginSetting; info.MaximumSettings = MaxPluginSetting;
info.NoDefault = No_Default; info.NoDefault = Default_None;
/* info.DefaultLocation = _Settings->LoadDword(UseSettingFromRegistry) ? InRegistry : LocalSettings; info.DefaultLocation = _Settings->LoadDword(Setting_UseFromRegistry) ? SettingType_Registry : SettingType_CfgFile;
info.handle = _Settings; info.handle = _Settings;
info.RegisterSetting = (void (*)(void *,int,int,SettingDataType,SettingLocation,const char *,const char *, DWORD))CSettings::RegisterSetting; info.RegisterSetting = (void (*)(void *,int,int,SettingDataType,SettingType,const char *,const char *, DWORD))CSettings::RegisterSetting;
info.GetSetting = (unsigned int (*)( void * handle, int ID ))CSettings::GetSetting; info.GetSetting = (unsigned int (*)( void * handle, int ID ))CSettings::GetSetting;
info.GetSettingSz = (const char * (*)( void *, int, char *, int ))CSettings::GetSettingSz; info.GetSettingSz = (const char * (*)( void *, int, char *, int ))CSettings::GetSettingSz;
info.SetSetting = (void (*)(void *,int,unsigned int))CSettings::SetSetting; info.SetSetting = (void (*)(void *,int,unsigned int))CSettings::SetSetting;
@ -104,8 +104,8 @@ CGfxPlugin::CGfxPlugin ( const char * FileName) {
info.UseUnregisteredSetting = NULL; info.UseUnregisteredSetting = NULL;
SetSettingInfo(&info); SetSettingInfo(&info);
_Settings->UnknownSetting_GFX = info.UseUnregisteredSetting; // _Settings->UnknownSetting_GFX = info.UseUnregisteredSetting;
*/
PluginOpened(); PluginOpened();
} }
// FrameBufferRead = (void (__cdecl *)(DWORD))GetProcAddress( (HMODULE)hDll, "FBRead" ); // FrameBufferRead = (void (__cdecl *)(DWORD))GetProcAddress( (HMODULE)hDll, "FBRead" );

View File

@ -18,7 +18,7 @@ void CPlugins::CreatePlugins( void ) {
Reset(PLUGIN_TYPE_RSP); Reset(PLUGIN_TYPE_RSP);
Reset(PLUGIN_TYPE_CONTROLLER); Reset(PLUGIN_TYPE_CONTROLLER);
if (_Settings->LoadDword(Debugger)) if (_Settings->LoadBool(Debugger_Enabled))
{ {
Notify().RefreshMenu(); Notify().RefreshMenu();
} }
@ -151,7 +151,8 @@ void CPlugins::Reset ( void ) {
CreatePlugins(); CreatePlugins();
} }
void CPlugins::Reset ( PLUGIN_TYPE Type ) { void CPlugins::Reset ( PLUGIN_TYPE Type )
{
switch (Type) switch (Type)
{ {
case PLUGIN_TYPE_RSP: case PLUGIN_TYPE_RSP:
@ -166,20 +167,20 @@ void CPlugins::Reset ( PLUGIN_TYPE Type ) {
m_RSP = NULL; m_RSP = NULL;
} }
{ {
stdstr_f RspPluginFile("%s%s",m_PluginDir.c_str(),_Settings->LoadString(CurrentRSP_Plugin).c_str()); stdstr_f RspPluginFile("%s%s",m_PluginDir.c_str(),_Settings->LoadString(Plugin_RSP_Current).c_str());
WriteTraceF(TraceRSP,"Loading (%s): Starting",RspPluginFile.c_str()); WriteTraceF(TraceRSP,"Loading (%s): Starting",RspPluginFile.c_str());
m_RSP = new CRSP_Plugin(RspPluginFile.c_str()); m_RSP = new CRSP_Plugin(RspPluginFile.c_str());
WriteTrace(TraceRSP,"Loading Done"); WriteTrace(TraceRSP,"Loading Done");
} }
WriteTraceF(TraceRSP,"Current Ver: %s",m_RSP->PluginName().c_str()); WriteTraceF(TraceRSP,"Current Ver: %s",m_RSP->PluginName().c_str());
_Settings->SaveString(CurVerRSP_Plugin,m_RSP->PluginName().c_str()); _Settings->SaveString(Plugin_RSP_CurVer,m_RSP->PluginName().c_str());
//Enable debugger //Enable debugger
if (m_RSP->EnableDebugging) if (m_RSP->EnableDebugging)
{ {
WriteTrace(TraceRSP,"EnableDebugging: starting"); WriteTrace(TraceRSP,"EnableDebugging: starting");
m_RSP->EnableDebugging(_Settings->LoadDword(Debugger)); m_RSP->EnableDebugging(_Settings->LoadDword(Debugger_Enabled));
WriteTrace(TraceRSP,"EnableDebugging: done"); WriteTrace(TraceRSP,"EnableDebugging: done");
} }
break; break;
@ -195,13 +196,13 @@ void CPlugins::Reset ( PLUGIN_TYPE Type ) {
m_Gfx = NULL; m_Gfx = NULL;
} }
{ {
stdstr_f GfxPluginFile("%s%s",m_PluginDir.c_str(),_Settings->LoadString(CurrentGFX_Plugin).c_str()); stdstr_f GfxPluginFile("%s%s",m_PluginDir.c_str(),_Settings->LoadString(Game_Plugin_Gfx).c_str());
WriteTraceF(TraceGfxPlugin,"Loading (%s): Starting",GfxPluginFile.c_str()); WriteTraceF(TraceGfxPlugin,"Loading (%s): Starting",GfxPluginFile.c_str());
m_Gfx = new CGfxPlugin(GfxPluginFile.c_str()); m_Gfx = new CGfxPlugin(GfxPluginFile.c_str());
WriteTrace(TraceGfxPlugin,"Loading Done"); WriteTrace(TraceGfxPlugin,"Loading Done");
} }
WriteTraceF(TraceGfxPlugin,"Current Ver: %s",m_Gfx->PluginName().c_str()); WriteTraceF(TraceGfxPlugin,"Current Ver: %s",m_Gfx->PluginName().c_str());
_Settings->SaveString(CurVerGFX_Plugin,m_Gfx->PluginName().c_str()); _Settings->SaveString(Plugin_GFX_CurVer,m_Gfx->PluginName().c_str());
break; break;
case PLUGIN_TYPE_AUDIO: case PLUGIN_TYPE_AUDIO:
WriteTrace(TraceDebug,"CPlugins::Reset 17"); WriteTrace(TraceDebug,"CPlugins::Reset 17");
@ -215,9 +216,9 @@ void CPlugins::Reset ( PLUGIN_TYPE Type ) {
WriteTrace(TraceDebug,"CPlugins::Reset 21"); WriteTrace(TraceDebug,"CPlugins::Reset 21");
} }
WriteTrace(TraceDebug,"CPlugins::Reset 22"); WriteTrace(TraceDebug,"CPlugins::Reset 22");
m_Audio = new CAudioPlugin(stdstr_f("%s%s",m_PluginDir.c_str(),_Settings->LoadString(CurrentAUDIO_Plugin).c_str()).c_str()); m_Audio = new CAudioPlugin(stdstr_f("%s%s",m_PluginDir.c_str(),_Settings->LoadString(Game_Plugin_Audio).c_str()).c_str());
WriteTrace(TraceDebug,"CPlugins::Reset 23"); WriteTrace(TraceDebug,"CPlugins::Reset 23");
_Settings->SaveString(CurVerAUDIO_Plugin,m_Audio->PluginName().c_str()); _Settings->SaveString(Plugin_AUDIO_CurVer,m_Audio->PluginName().c_str());
WriteTrace(TraceDebug,"CPlugins::Reset 24"); WriteTrace(TraceDebug,"CPlugins::Reset 24");
break; break;
case PLUGIN_TYPE_CONTROLLER: case PLUGIN_TYPE_CONTROLLER:
@ -232,12 +233,11 @@ void CPlugins::Reset ( PLUGIN_TYPE Type ) {
WriteTrace(TraceDebug,"CPlugins::Reset 29"); WriteTrace(TraceDebug,"CPlugins::Reset 29");
} }
WriteTrace(TraceDebug,"CPlugins::Reset 30"); WriteTrace(TraceDebug,"CPlugins::Reset 30");
m_Control = new CControl_Plugin(stdstr_f("%s%s",m_PluginDir.c_str(),_Settings->LoadString(CurrentCONT_Plugin).c_str()).c_str()); m_Control = new CControl_Plugin(stdstr_f("%s%s",m_PluginDir.c_str(),_Settings->LoadString(Game_Plugin_Controller).c_str()).c_str());
WriteTrace(TraceDebug,"CPlugins::Reset 31"); WriteTrace(TraceDebug,"CPlugins::Reset 31");
_Settings->SaveString(CurVerCONT_Plugin,m_Control->PluginName().c_str()); _Settings->SaveString(Plugin_CONT_CurVer,m_Control->PluginName().c_str());
WriteTrace(TraceDebug,"CPlugins::Reset 32"); WriteTrace(TraceDebug,"CPlugins::Reset 32");
break; break;
} }
} }
@ -305,8 +305,10 @@ void CPlugins::CreatePluginDir ( const stdstr & DstDir ) const {
} }
void CPlugins::CopyPlugins ( const stdstr & DstDir ) const { void CPlugins::CopyPlugins ( const stdstr & DstDir ) const {
Notify().BreakPoint(__FILE__,__LINE__);
//Copy GFX Plugin //Copy GFX Plugin
stdstr_f srcGfxPlugin("%s%s",m_PluginDir.c_str(),_Settings->LoadString(CurrentGFX_Plugin).c_str()); /*stdstr_f srcGfxPlugin("%s%s",m_PluginDir.c_str(),_Settings->LoadString(CurrentGFX_Plugin).c_str());
stdstr_f dstGfxPlugin("%s%s",DstDir.c_str(),_Settings->LoadString(CurrentGFX_Plugin).c_str()); stdstr_f dstGfxPlugin("%s%s",DstDir.c_str(),_Settings->LoadString(CurrentGFX_Plugin).c_str());
if (CopyFile(srcGfxPlugin.c_str(),dstGfxPlugin.c_str(),false) == 0) if (CopyFile(srcGfxPlugin.c_str(),dstGfxPlugin.c_str(),false) == 0)
@ -337,5 +339,5 @@ void CPlugins::CopyPlugins ( const stdstr & DstDir ) const {
if (CopyFile(srcContPlugin.c_str(),dstContPlugin.c_str(),false) == 0) { if (CopyFile(srcContPlugin.c_str(),dstContPlugin.c_str(),false) == 0) {
if (GetLastError() == ERROR_PATH_NOT_FOUND) { CreatePluginDir(dstContPlugin); } if (GetLastError() == ERROR_PATH_NOT_FOUND) { CreatePluginDir(dstContPlugin); }
CopyFile(srcContPlugin.c_str(),dstContPlugin.c_str(),false); CopyFile(srcContPlugin.c_str(),dstContPlugin.c_str(),false);
} }*/
} }

View File

@ -50,11 +50,12 @@ typedef struct {
void (*SetSetting) ( void * handle, int ID, unsigned int Value ); void (*SetSetting) ( void * handle, int ID, unsigned int Value );
void (*SetSettingSz) ( void * handle, int ID, const char * Value ); void (*SetSettingSz) ( void * handle, int ID, const char * Value );
void (*RegisterSetting) ( void * handle, int ID, int DefaultID, SettingDataType Type, void (*RegisterSetting) ( void * handle, int ID, int DefaultID, SettingDataType Type,
SettingLocation Location, const char * Category, const char * DefaultStr, DWORD Value ); SettingType Location, const char * Category, const char * DefaultStr, DWORD Value );
void (*UseUnregisteredSetting) (int ID); void (*UseUnregisteredSetting) (int ID);
} PLUGIN_SETTINGS; } PLUGIN_SETTINGS;
enum PLUGIN_TYPE { enum PLUGIN_TYPE {
PLUGIN_TYPE_NONE = 0,
PLUGIN_TYPE_RSP = 1, PLUGIN_TYPE_RSP = 1,
PLUGIN_TYPE_GFX = 2, PLUGIN_TYPE_GFX = 2,
PLUGIN_TYPE_AUDIO = 3, PLUGIN_TYPE_AUDIO = 3,

View File

@ -1,5 +1,138 @@
#include "..\Plugin.h" #include "..\Plugin.h"
CPluginList::CPluginList(bool bAutoFill /* = true */) :
m_PluginDir(_Settings->LoadString(Directory_Plugin),"")
{
if (bAutoFill)
{
LoadList();
}
}
CPluginList::~CPluginList()
{
}
int CPluginList::GetPluginCount() const
{
return m_PluginList.size();
}
const CPluginList::PLUGIN * CPluginList::GetPluginInfo ( int indx ) const
{
if (indx < 0 || indx >= m_PluginList.size())
{
return NULL;
}
return &m_PluginList[indx];
}
bool CPluginList::LoadList()
{
m_PluginList.clear();
AddPluginFromDir(m_PluginDir);
return true;
}
void CPluginList::AddPluginFromDir ( CPath Dir)
{
Dir.SetNameExtension("*.*");
if (Dir.FindFirst(_A_SUBDIR))
{
do {
AddPluginFromDir(Dir);
} while (Dir.FindNext());
Dir.UpDirectory();
}
Dir.SetNameExtension("*.dll");
if (Dir.FindFirst())
{
HMODULE hLib = NULL;
do {
if (hLib)
{
FreeLibrary(hLib);
hLib = NULL;
}
UINT LastErrorMode = SetErrorMode( SEM_FAILCRITICALERRORS );
hLib = LoadLibrary(Dir);
SetErrorMode(LastErrorMode);
if (hLib == NULL)
{
continue;
}
void (__cdecl *GetDllInfo) ( PLUGIN_INFO * PluginInfo );
GetDllInfo = (void (__cdecl *)(PLUGIN_INFO *))GetProcAddress( hLib, "GetDllInfo" );
if (GetDllInfo == NULL)
{
continue;
}
PLUGIN Plugin;
GetDllInfo(&Plugin.Info);
if (!ValidPluginVersion(Plugin.Info))
{
continue;
}
Plugin.FullPath = Dir;
Plugin.FileName = ((stdstr &)Dir).substr(((stdstr &)m_PluginDir).length());
if (GetProcAddress(hLib,"DllAbout") != NULL)
{
Plugin.AboutFunction = true;
}
m_PluginList.push_back(Plugin);
} while (Dir.FindNext());
if (hLib)
{
FreeLibrary(hLib);
hLib = NULL;
}
}
}
bool CPluginList::ValidPluginVersion ( PLUGIN_INFO & PluginInfo ) {
if (!PluginInfo.MemoryBswaped)
{
return false;
}
switch (PluginInfo.Type)
{
case PLUGIN_TYPE_RSP:
if (PluginInfo.Version == 0x0001) { return true; }
if (PluginInfo.Version == 0x0100) { return true; }
if (PluginInfo.Version == 0x0101) { return true; }
if (PluginInfo.Version == 0x0102) { return true; }
break;
case PLUGIN_TYPE_GFX:
if (PluginInfo.Version == 0x0102) { return true; }
if (PluginInfo.Version == 0x0103) { return true; }
if (PluginInfo.Version == 0x0104) { return true; }
break;
case PLUGIN_TYPE_AUDIO:
if (PluginInfo.Version == 0x0101) { return true; }
if (PluginInfo.Version == 0x0102) { return true; }
break;
case PLUGIN_TYPE_CONTROLLER:
if (PluginInfo.Version == 0x0100) { return true; }
if (PluginInfo.Version == 0x0101) { return true; }
if (PluginInfo.Version == 0x0102) { return true; }
break;
}
return FALSE;
}
#ifdef tofix
CPluginList::CPluginList (CSettings * Settings) { CPluginList::CPluginList (CSettings * Settings) {
_Settings = Settings; _Settings = Settings;
} }
@ -98,12 +231,13 @@ PluginList CPluginList::GetPluginList (void) {
PluginList Plugins; PluginList Plugins;
//Create search path for plugins //Create search path for plugins
char SearchDir[300] = ""; Notify().BreakPoint(__FILE__,__LINE__);
/* char SearchDir[300] = "";
_Settings->LoadString(PluginDirectory,SearchDir,sizeof(SearchDir)); _Settings->LoadString(PluginDirectory,SearchDir,sizeof(SearchDir));
//recursively scan search dir, and add files in that dir //recursively scan search dir, and add files in that dir
AddPluginFromDir(SearchDir,SearchDir,&Plugins); AddPluginFromDir(SearchDir,SearchDir,&Plugins);
*/
return Plugins; return Plugins;
} }
@ -132,3 +266,5 @@ bool CPluginList::ValidPluginVersion ( PLUGIN_INFO * PluginInfo ) {
} }
return FALSE; return FALSE;
} }
#endif

View File

@ -1,6 +1,6 @@
#include "..\\Settings.h" #include "..\\Settings.h"
typedef struct { /*typedef struct {
PLUGIN_INFO info; PLUGIN_INFO info;
stdstr FullPath; stdstr FullPath;
stdstr FileName; stdstr FileName;
@ -10,14 +10,41 @@ typedef struct {
typedef std::list<PLUGIN> PluginList; typedef std::list<PLUGIN> PluginList;
class CPluginList { class CPluginList {
CSettings * _Settings;
void AddPluginFromDir ( const char * PluginDir, const char * Dir, PluginList * Plugins ); void AddPluginFromDir ( const char * PluginDir, const char * Dir, PluginList * Plugins );
bool ValidPluginVersion ( PLUGIN_INFO * PluginInfo ); bool ValidPluginVersion ( PLUGIN_INFO * PluginInfo );
public: public:
CPluginList ( CSettings * Settings); CPluginList ();
PluginList GetPluginList ( void ); PluginList GetPluginList ( void );
void DllAbout ( void * hParent, const char * PluginFile ); void DllAbout ( void * hParent, const char * PluginFile );
}; };
*/
class CPluginList
{
public:
typedef struct {
PLUGIN_INFO Info;
bool AboutFunction;
CPath FullPath;
stdstr FileName;
} PLUGIN;
private:
typedef std::vector<PLUGIN> PluginList;
PluginList m_PluginList;
CPath m_PluginDir;
void AddPluginFromDir ( CPath Dir);
bool ValidPluginVersion ( PLUGIN_INFO & PluginInfo );
public:
CPluginList(bool bAutoFill = true);
~CPluginList();
bool LoadList ( void );
int GetPluginCount ( void ) const;
const PLUGIN * GetPluginInfo ( int indx ) const;
};

View File

@ -63,10 +63,10 @@ CRSP_Plugin::CRSP_Plugin ( const char * FileName) {
info.DefaultStartRange = FirstRSPDefaultSet; info.DefaultStartRange = FirstRSPDefaultSet;
info.SettingStartRange = FirstRSPSettings; info.SettingStartRange = FirstRSPSettings;
info.MaximumSettings = MaxPluginSetting; info.MaximumSettings = MaxPluginSetting;
info.NoDefault = No_Default; info.NoDefault = Default_None;
info.DefaultLocation = _Settings->LoadDword(UseSettingFromRegistry) ? SettingLocation_Registry : SettingLocation_CfgFile; info.DefaultLocation = _Settings->LoadDword(Setting_UseFromRegistry) ? SettingType_Registry : SettingType_CfgFile;
info.handle = _Settings; info.handle = _Settings;
info.RegisterSetting = (void (*)(void *,int,int,SettingDataType,SettingLocation,const char *,const char *, DWORD))CSettings::RegisterSetting; info.RegisterSetting = (void (*)(void *,int,int,SettingDataType,SettingType,const char *,const char *, DWORD))CSettings::RegisterSetting;
info.GetSetting = (unsigned int (*)( void * handle, int ID ))CSettings::GetSetting; info.GetSetting = (unsigned int (*)( void * handle, int ID ))CSettings::GetSetting;
info.GetSettingSz = (const char * (*)( void *, int, char *, int ))CSettings::GetSettingSz; info.GetSettingSz = (const char * (*)( void *, int, char *, int ))CSettings::GetSettingSz;
info.SetSetting = (void (*)(void *,int,unsigned int))CSettings::SetSetting; info.SetSetting = (void (*)(void *,int,unsigned int))CSettings::SetSetting;

Binary file not shown.

View File

@ -44,7 +44,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../" /I "./" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# SUBTRACT CPP /Fr # SUBTRACT CPP /Fr
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@ -55,8 +55,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
# SUBTRACT LINK32 /debug
!ELSEIF "$(CFG)" == "Project64 - Win32 Debug" !ELSEIF "$(CFG)" == "Project64 - Win32 Debug"
@ -72,7 +71,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../" /I "./" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# SUBTRACT CPP /Fr # SUBTRACT CPP /Fr
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
@ -101,7 +100,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "EXTERNAL_RELEASE" /YX /FD /EHa /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../" /I "./" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "EXTERNAL_RELEASE" /YX /FD /EHa /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD BASE RSC /l 0xc09 /d "NDEBUG"
@ -139,10 +138,38 @@ SOURCE=".\Settings\SettingType\SettingsType-ApplicationIndex.cpp"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-Cheats.cpp"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-GameSetting.cpp" SOURCE=".\Settings\SettingType\SettingsType-GameSetting.cpp"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-GameSettingIndex.cpp"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RDBCpuType.cpp"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RDBOnOff.cpp"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RDBRamSize.cpp"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RDBSaveChip.cpp"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RDBYesNo.cpp"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RelativePath.cpp" SOURCE=".\Settings\SettingType\SettingsType-RelativePath.cpp"
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -151,6 +178,14 @@ SOURCE=".\Settings\SettingType\SettingsType-RomDatabase.cpp"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RomDatabaseIndex.cpp"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-SelectedDirectory.cpp"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-TempBool.cpp" SOURCE=".\Settings\SettingType\SettingsType-TempBool.cpp"
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -191,6 +226,14 @@ SOURCE="Settings\Settings Class.cpp"
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Advanced Options.cpp"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Directories.cpp"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Game - General.cpp" SOURCE=".\User Interface\Settings\Settings Page - Game - General.cpp"
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -207,9 +250,37 @@ SOURCE=".\User Interface\Settings\Settings Page - Game - Status.cpp"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Game Browser.cpp"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Keyboard Shortcuts.cpp"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Options.cpp"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Plugin.cpp"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page.cpp" SOURCE=".\User Interface\Settings\Settings Page.cpp"
# End Source File # End Source File
# End Group # End Group
# Begin Group "WTL Controls Source"
# PROP Default_Filter ""
# Begin Source File
SOURCE=".\User Interface\WTL Controls\ModifiedEditBox.cpp"
# End Source File
# Begin Source File
SOURCE=".\User Interface\WTL Controls\PartialGroupBox.cpp"
# End Source File
# End Group
# Begin Source File # Begin Source File
SOURCE="User Interface\Cheats.cpp" SOURCE="User Interface\Cheats.cpp"
@ -232,6 +303,10 @@ SOURCE="User Interface\Menu Class.cpp"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=".\User Interface\MenuShortCuts.cpp"
# End Source File
# Begin Source File
SOURCE="User Interface\Notification Class.cpp" SOURCE="User Interface\Notification Class.cpp"
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -639,10 +714,38 @@ SOURCE=".\Settings\SettingType\SettingsType-Base.h"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-Cheats.h"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-GameSetting.h" SOURCE=".\Settings\SettingType\SettingsType-GameSetting.h"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-GameSettingIndex.h"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RDBCpuType.h"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RDBOnOff.h"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RDBRamSize.h"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RDBSaveChip.h"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RDBYesNo.h"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RelativePath.h" SOURCE=".\Settings\SettingType\SettingsType-RelativePath.h"
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -651,6 +754,14 @@ SOURCE=".\Settings\SettingType\SettingsType-RomDatabase.h"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-RomDatabaseIndex.h"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-SelectedDirectory.h"
# End Source File
# Begin Source File
SOURCE=".\Settings\SettingType\SettingsType-TempBool.h" SOURCE=".\Settings\SettingType\SettingsType-TempBool.h"
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -691,6 +802,14 @@ SOURCE="Settings\Settings Class.h"
# PROP Default_Filter "" # PROP Default_Filter ""
# Begin Source File # Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Advanced Options.h"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Directories.h"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Game - General.h" SOURCE=".\User Interface\Settings\Settings Page - Game - General.h"
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -707,9 +826,49 @@ SOURCE=".\User Interface\Settings\Settings Page - Game - Status.h"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Game Browser.h"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Keyboard Shortcuts.h"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Options.h"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page - Plugin.h"
# End Source File
# Begin Source File
SOURCE=".\User Interface\Settings\Settings Page.h" SOURCE=".\User Interface\Settings\Settings Page.h"
# End Source File # End Source File
# End Group # End Group
# Begin Group "WTL Controls Headers"
# PROP Default_Filter ""
# Begin Source File
SOURCE=".\User Interface\WTL Controls\ModifiedCheckBox.h"
# End Source File
# Begin Source File
SOURCE=".\User Interface\WTL Controls\ModifiedComboBox.h"
# End Source File
# Begin Source File
SOURCE=".\User Interface\WTL Controls\ModifiedEditBox.h"
# End Source File
# Begin Source File
SOURCE=".\User Interface\WTL Controls\numberctrl.h"
# End Source File
# Begin Source File
SOURCE=".\User Interface\WTL Controls\PartialGroupBox.h"
# End Source File
# End Group
# Begin Source File # Begin Source File
SOURCE="User Interface\Cheats.h" SOURCE="User Interface\Cheats.h"
@ -736,6 +895,10 @@ SOURCE="User Interface\Menu Class.h"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=".\User Interface\MenuShortCuts.h"
# End Source File
# Begin Source File
SOURCE="User Interface\Notification Class.h" SOURCE="User Interface\Notification Class.h"
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -1154,7 +1317,7 @@ SOURCE="..\Bin\Release\Sync Errors.txt"
# End Group # End Group
# Begin Source File # Begin Source File
SOURCE="User Interface\about.htm" SOURCE=".\User Interface\about.htm"
# End Source File # End Source File
# End Target # End Target
# End Project # End Project

View File

@ -3,120 +3,329 @@
<pre> <pre>
<h1>Build Log</h1> <h1>Build Log</h1>
<h3> <h3>
--------------------Configuration: Project64 - Win32 Debug-------------------- --------------------Configuration: Project64 - Win32 External Release--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating command line "rc.exe /l 0xc09 /fo"../../Build/Project64/Debug/UI Resources.res" /i "User Interface" /d "_DEBUG" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\UI Resources.rc"" Creating command line "rc.exe /l 0xc09 /fo"../../Build/Project64/External/UI Resources.res" /i "User Interface" /d "NDEBUG" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\UI Resources.rc""
Creating temporary file "C:\DOCUME~1\NICHOL~1\LOCALS~1\Temp\RSP508.tmp" with contents Creating temporary file "C:\DOCUME~1\NICHOL~1\LOCALS~1\Temp\RSPA1.tmp" with contents
[ [
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:yes /pdb:"../../Bin/Debug/Project64.pdb" /debug /machine:I386 /out:"../../Bin/Debug/Project64.exe" /pdbtype:sept /nologo /MD /W3 /GX /O2 /I "../" /I "./" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "EXTERNAL_RELEASE" /Fp"../../Build/Project64/External/Project64.pch" /YX /Fo"../../Build/Project64/External/" /Fd"../../Build/Project64/External/" /FD /EHa /c
"\My Programs\Emulation\Project64\Build\Project64\Debug\SettingsType-Application.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-Application.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\SettingsType-ApplicationIndex.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-ApplicationIndex.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\SettingsType-GameSetting.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-Cheats.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\SettingsType-RelativePath.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-GameSetting.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\SettingsType-RomDatabase.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-GameSettingIndex.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\SettingsType-TempBool.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-RDBCpuType.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\SettingsType-TempNumber.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-RDBOnOff.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\SettingsType-TempString.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-RDBRamSize.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\N64System Settings.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-RDBSaveChip.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Notification Settings.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-RDBYesNo.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Recompiler Settings.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-RelativePath.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Setting Config.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-RomDatabase.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Settings Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-RomDatabaseIndex.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Cheats.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-SelectedDirectory.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Frame Per Second Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-TempBool.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Gui Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-TempNumber.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Main Menu Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\SettingType\SettingsType-TempString.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Menu Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\N64System Settings.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Notification Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\Notification Settings.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Rom Browser Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\Recompiler Settings.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Language Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\Settings Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Audio.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings\Settings Page - Advanced Options.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Memory Labels Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings\Settings Page - Directories.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Memory.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings\Settings Page - Game - General.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\OpCode Analysis Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings\Settings Page - Game - Plugin.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\OpCode Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings\Settings Page - Game - Recompiler.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Register Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings\Settings Page - Game - Status.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\System Timing.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings\Settings Page - Game Browser.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\TLB class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings\Settings Page - Keyboard Shortcuts.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\BreakPoints.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings\Settings Page - Options.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\C Core Interface.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings\Settings Page - Plugin.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\C main.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings\Settings Page.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\C Memory.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\WTL Controls\ModifiedEditBox.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\CPU Log.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\WTL Controls\PartialGroupBox.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\CPU.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Cheats.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Dma.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Frame Per Second Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Eeprom.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Gui Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Exception.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Main Menu Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\FlashRam.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Menu Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Interpreter CPU.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\MenuShortCuts.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Interpreter Ops.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Notification Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Logging.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Rom Browser Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Mempak.obj" "D:\My Programs\Emulation\Project64\Source\Project64\User Interface\Settings Config.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Pif.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Multilanguage\Language Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\r4300i Commands.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Mips\Audio.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\r4300i Memory.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Mips\Memory Labels Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\r4300i Registers.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Mips\Memory.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Recompiler CPU.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Mips\OpCode Analysis Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Recompiler Fpu Ops.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Mips\OpCode Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Recompiler Ops.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Mips\Register Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Registers.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Mips\System Timing.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Sram.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Mips\TLB class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Sync CPU.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\BreakPoints.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\TLB Display.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\C Core Interface.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Tlb.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\C Memory.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Win32Timer.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\CPU.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\x86 fpu.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\Dma.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\X86.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\Eeprom.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Debugger - Memory Dump.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\FlashRam.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Debugger - Memory Search.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\Interpreter CPU.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Debugger - TLB.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\Mempak.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Debugger - View Memory.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\Pif.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Debugger.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\Recompiler CPU.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Delay Slot Map Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\Recompiler Fpu Ops.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Function Info.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\Recompiler Ops.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Function Map Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\C Core\Registers.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Recompiler Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Debugger\Debugger - Memory Dump.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Section Info.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Debugger\Debugger - Memory Search.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Cheat Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Debugger\Debugger - TLB.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\N64 Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Debugger\Debugger - View Memory.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\N64 Rom Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Debugger\Debugger.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Profiling Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Recompiler\Delay Slot Map Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Rom Information Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Recompiler\Function Info.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Speed Limitor Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Recompiler\Function Map Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Audio Plugin.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Recompiler\Recompiler Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Controller Plugin.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Recompiler\Section Info.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\GFX plugin.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Cheat Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Plugin Class.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\N64 Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Plugin List.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\N64 Rom Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\RSP Plugin.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Profiling Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\UNZIP.OBJ" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Rom Information Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\zip.obj" "D:\My Programs\Emulation\Project64\Source\Project64\N64 System\Speed Limitor Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\7zip.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Plugins\Audio Plugin.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Processor Info.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Plugins\Controller Plugin.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Gui Settings.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Plugins\GFX plugin.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\main.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Plugins\Plugin Class.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\ValidateBinary.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Plugins\Plugin List.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\UI Resources.res" "D:\My Programs\Emulation\Project64\Source\Project64\Plugins\RSP Plugin.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Settings Config.obj" "D:\My Programs\Emulation\Project64\Source\Project64\Settings\Gui Settings.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Settings Page.obj" "D:\My Programs\Emulation\Project64\Source\Project64\main.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Settings Page - Game - Recompiler.obj" "D:\My Programs\Emulation\Project64\Source\Project64\ValidateBinary.cpp"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Settings Page - Game - Status.obj"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Settings Page - Game - General.obj"
"\My Programs\Emulation\Project64\Build\Project64\Debug\Settings Page - Game - Plugin.obj"
"\My Programs\Emulation\Project64\Bin\Debug\Common.lib"
"\My Programs\Emulation\Project64\Bin\Debug\7zip.lib"
] ]
Creating command line "link.exe @C:\DOCUME~1\NICHOL~1\LOCALS~1\Temp\RSP508.tmp" Creating command line "cl.exe @C:\DOCUME~1\NICHOL~1\LOCALS~1\Temp\RSPA1.tmp"
Creating temporary file "C:\DOCUME~1\NICHOL~1\LOCALS~1\Temp\RSPA2.tmp" with contents
[
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:no /pdb:"../../Bin/External/Project64.pdb" /machine:I386 /out:"../../Bin/External/Project64.exe"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-Application.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-ApplicationIndex.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-Cheats.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-GameSetting.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-GameSettingIndex.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-RDBCpuType.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-RDBOnOff.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-RDBRamSize.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-RDBSaveChip.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-RDBYesNo.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-RelativePath.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-RomDatabase.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-RomDatabaseIndex.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-SelectedDirectory.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-TempBool.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-TempNumber.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\SettingsType-TempString.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\N64System Settings.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Notification Settings.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Recompiler Settings.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Setting Config.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Page - Advanced Options.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Page - Directories.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Page - Game - General.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Page - Game - Plugin.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Page - Game - Recompiler.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Page - Game - Status.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Page - Game Browser.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Page - Keyboard Shortcuts.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Page - Options.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Page - Plugin.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Page.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\ModifiedEditBox.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\PartialGroupBox.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Cheats.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Frame Per Second Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Gui Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Main Menu Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Menu Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\MenuShortCuts.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Notification Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Rom Browser Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Settings Config.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Language Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Audio.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Memory Labels Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Memory.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\OpCode Analysis Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\OpCode Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Register Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\System Timing.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\TLB class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\BreakPoints.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\C Core Interface.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\C main.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\C Memory.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\CPU Log.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\CPU.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Dma.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Eeprom.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Exception.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\FlashRam.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Interpreter CPU.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Interpreter Ops.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Logging.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Mempak.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Pif.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\r4300i Commands.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\r4300i Memory.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\r4300i Registers.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Recompiler CPU.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Recompiler Fpu Ops.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Recompiler Ops.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Registers.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Sram.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Sync CPU.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\TLB Display.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Tlb.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Win32Timer.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\x86 fpu.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\X86.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Debugger - Memory Dump.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Debugger - Memory Search.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Debugger - TLB.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Debugger - View Memory.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Debugger.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Delay Slot Map Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Function Info.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Function Map Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Recompiler Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Section Info.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Cheat Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\N64 Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\N64 Rom Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Profiling Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Rom Information Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Speed Limitor Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Audio Plugin.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Controller Plugin.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\GFX plugin.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Plugin Class.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Plugin List.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\RSP Plugin.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\UNZIP.OBJ"
"\My Programs\Emulation\Project64\Build\Project64\External\zip.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\7zip.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Processor Info.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\Gui Settings.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\main.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\ValidateBinary.obj"
"\My Programs\Emulation\Project64\Build\Project64\External\UI Resources.res"
"\My Programs\Emulation\Project64\Bin\External\Common.lib"
"\My Programs\Emulation\Project64\Bin\External\7zip.lib"
]
Creating command line "link.exe @C:\DOCUME~1\NICHOL~1\LOCALS~1\Temp\RSPA2.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling resources... Compiling resources...
Compiling...
SettingsType-Application.cpp
SettingsType-ApplicationIndex.cpp
SettingsType-Cheats.cpp
SettingsType-GameSetting.cpp
SettingsType-GameSettingIndex.cpp
SettingsType-RDBCpuType.cpp
SettingsType-RDBOnOff.cpp
SettingsType-RDBRamSize.cpp
SettingsType-RDBSaveChip.cpp
SettingsType-RDBYesNo.cpp
SettingsType-RelativePath.cpp
SettingsType-RomDatabase.cpp
SettingsType-RomDatabaseIndex.cpp
SettingsType-SelectedDirectory.cpp
SettingsType-TempBool.cpp
SettingsType-TempNumber.cpp
SettingsType-TempString.cpp
N64System Settings.cpp
Notification Settings.cpp
Recompiler Settings.cpp
Settings Class.cpp
Settings Page - Advanced Options.cpp
Settings Page - Directories.cpp
Settings Page - Game - General.cpp
Settings Page - Game - Plugin.cpp
Settings Page - Game - Recompiler.cpp
Settings Page - Game - Status.cpp
Settings Page - Game Browser.cpp
Settings Page - Keyboard Shortcuts.cpp
Settings Page - Options.cpp
C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE\atlwin.h(2353) : warning C4247: 'StartDialogProc' not accessible because 'CSettingsPageImpl<class CGeneralOptionsPage>' uses 'public' to inherit from 'CDialogImpl<class CGeneralOptionsPage,class ATL::CWindow>'
C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE\atlwin.h(2231) : see declaration of 'StartDialogProc'
C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE\atlwin.h(2346) : while compiling class-template member function 'struct HWND__ *__thiscall ATL::CDialogImpl<class CGeneralOptionsPage,class ATL::CWindow>::Create(struct HWND__ *,long)'
Settings Page - Plugin.cpp
Settings Page.cpp
ModifiedEditBox.cpp
PartialGroupBox.cpp
Cheats.cpp
Frame Per Second Class.cpp
Gui Class.cpp
Main Menu Class.cpp
Menu Class.cpp
MenuShortCuts.cpp
Notification Class.cpp
Rom Browser Class.cpp
Settings Config.cpp
Language Class.cpp
Audio.cpp
Memory Labels Class.cpp
Memory.cpp
OpCode Analysis Class.cpp
OpCode Class.cpp
Register Class.cpp
System Timing.cpp
TLB class.cpp
BreakPoints.cpp
C Core Interface.cpp
C Memory.cpp
CPU.cpp
Dma.cpp
Eeprom.cpp
FlashRam.cpp
Interpreter CPU.cpp
Mempak.cpp
Pif.cpp
Recompiler CPU.cpp
Recompiler Fpu Ops.cpp
Recompiler Ops.cpp
Registers.cpp
Debugger - Memory Dump.cpp
Debugger - Memory Search.cpp
Debugger - TLB.cpp
Debugger - View Memory.cpp
Debugger.cpp
Delay Slot Map Class.cpp
Function Info.cpp
Function Map Class.cpp
Recompiler Class.cpp
Section Info.cpp
Cheat Class.cpp
N64 Class.cpp
N64 Rom Class.cpp
Profiling Class.cpp
Rom Information Class.cpp
Speed Limitor Class.cpp
Audio Plugin.cpp
Controller Plugin.cpp
GFX plugin.cpp
Plugin Class.cpp
Plugin List.cpp
RSP Plugin.cpp
Gui Settings.cpp
main.cpp
ValidateBinary.cpp
Linking... Linking...
LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs; use /NODEFAULTLIB:library LINK : warning LNK4089: all references to "OLEAUT32.dll" discarded by /OPT:REF
<h3>Results</h3> <h3>Results</h3>
Project64.exe - 0 error(s), 1 warning(s) Project64.exe - 0 error(s), 2 warning(s)
</pre> </pre>
</body> </body>
</html> </html>

View File

@ -1,14 +1,221 @@
#ifndef __SETTINGS__H__ #ifndef __SETTINGS__H__
#define __SETTINGS__H__ #define __SETTINGS__H__
#define MaxRomBrowserFields 100
#define MaxMD5_Per_Rom 10
#define MaxCheats 500
#define MaxPluginSetting 65535 #define MaxPluginSetting 65535
enum SettingID { enum SettingID {
//Default values //Default values
No_Default, Default_False, Default_True, Default_Language, Default_RdramSize, Default_None,
Default_Constant,
//information - temp keys
Info_RomLoading,
Info_ShortCutsChanged,
//Support Files
SupportFile_Settings,
SupportFile_RomDatabase,
SupportFile_Cheats,
SupportFile_Notes,
SupportFile_ExtInfo,
SupportFile_ShortCuts,
SupportFile_RomListCache,
SupportFile_7zipCache,
//Settings
Setting_ApplicationName,
Setting_UseFromRegistry,
Setting_RdbEditor,
Setting_DisableScrSaver,
Setting_AutoSleep,
Setting_AutoStart,
Setting_AutoFullscreen,
Setting_AutoZipInstantSave,
Setting_RememberCheats,
Setting_CurrentLanguage,
//RDB TLB Settings
Rdb_SaveChip,
Rdb_CpuType,
Rdb_RDRamSize,
Rdb_CounterFactor,
Rdb_UseTlb,
Rdb_DelaySi,
Rdb_SPHack,
Rdb_Status,
Rdb_FixedAudio,
Rdb_SyncViaAudio,
Rdb_RspAudioSignal,
Rdb_TLB_VAddrStart,
Rdb_TLB_VAddrLen,
Rdb_TLB_PAddrStart,
Rdb_UseHleGfx,
Rdb_UseHleAudio,
Rdb_LoadRomToMemory,
Rdb_ScreenHertz,
Rdb_FuncLookupMode,
Rdb_RegCache,
Rdb_BlockLinking,
Rdb_SMM_Cache,
Rdb_SMM_PIDMA,
Rdb_SMM_TLB,
Rdb_SMM_Protect,
Rdb_SMM_ValidFunc,
Rdb_GameCheatFix,
//Individual Game Settings
Game_IniKey,
Game_GameName,
Game_GoodName,
Game_Plugin_Gfx,
Game_Plugin_Audio,
Game_Plugin_Controller,
Game_Plugin_RSP,
Game_SaveChip,
Game_CpuType,
Game_LastSaveSlot,
Game_FixedAudio,
Game_SyncViaAudio,
Game_SMM_Cache,
Game_SMM_Protect,
Game_SMM_ValidFunc,
Game_SMM_PIDMA,
Game_SMM_TLB,
Game_CurrentSaveState,
Game_RDRamSize,
Game_CounterFactor,
Game_UseTlb,
Game_DelaySI,
Game_SPHack,
Game_FuncLookupMode,
Game_RegCache,
Game_BlockLinking,
Game_ScreenHertz,
Game_RspAudioSignal,
Game_UseHleGfx,
Game_UseHleAudio,
Game_LoadRomToMemory,
// General Game running info
GameRunning_LoadingInProgress,
GameRunning_CPU_Running,
GameRunning_CPU_Paused,
GameRunning_CPU_PausedType,
GameRunning_InstantSaveFile,
GameRunning_LimitFPS,
GameRunning_ScreenHertz,
//User Interface
UserInterface_BasicMode,
UserInterface_ShowCPUPer,
UserInterface_DisplayFrameRate,
UserInterface_InFullScreen,
UserInterface_FrameDisplayType,
UserInterface_MainWindowTop,
UserInterface_MainWindowLeft,
UserInterface_AlwaysOnTop,
RomBrowser_Enabled,
RomBrowser_ColoumnsChanged,
RomBrowser_Top,
RomBrowser_Left,
RomBrowser_Width,
RomBrowser_Height,
RomBrowser_PosIndex,
RomBrowser_WidthIndex,
RomBrowser_SortFieldIndex,
RomBrowser_SortAscendingIndex,
RomBrowser_Recursive,
RomBrowser_Maximized,
//Directory Info
Directory_LastSave,
Directory_RecentGameDirCount,
Directory_RecentGameDirIndex,
Directory_Game,
Directory_GameInitial,
Directory_GameSelected,
Directory_GameUseSelected,
Directory_Plugin,
Directory_PluginInitial,
Directory_PluginSelected,
Directory_PluginUseSelected,
Directory_SnapShot,
Directory_SnapShotInitial,
Directory_SnapShotSelected,
Directory_SnapShotUseSelected,
Directory_NativeSave,
Directory_NativeSaveInitial,
Directory_NativeSaveSelected,
Directory_NativeSaveUseSelected,
Directory_InstantSave,
Directory_InstantSaveInitial,
Directory_InstantSaveSelected,
Directory_InstantSaveUseSelected,
Directory_Texture,
Directory_TextureInitial,
Directory_TextureSelected,
Directory_TextureUseSelected,
//File Info
File_RecentGameFileCount,
File_RecentGameFileIndex,
//Debugger
Debugger_Enabled,
Debugger_ShowUnhandledMemory,
Debugger_ShowPifErrors,
Debugger_ShowCheckOpUsageErrors,
Debugger_GenerateLogFiles,
Debugger_ProfileCode,
Debugger_DisableGameFixes,
Debugger_AppLogLevel,
Debugger_AppLogFlush,
Debugger_GenerateDebugLog,
Debugger_ShowDListAListCount,
Debugger_ShowRecompMemSize,
//Beta Information
Beta_IsBetaVersion,
Beta_UserName,
Beta_UserNameMD5,
Beta_EmailAddress,
Beta_EmailAddressMD5,
Beta_IsValidExe,
//Plugins
Plugin_RSP_Current,
Plugin_RSP_CurVer,
Plugin_GFX_Current,
Plugin_GFX_CurVer,
Plugin_AUDIO_Current,
Plugin_AUDIO_CurVer,
Plugin_CONT_Current,
Plugin_CONT_CurVer,
Plugin_UseHleGfx,
Plugin_UseHleAudio,
//Cheats
Cheat_Entry,
Cheat_Active,
Cheat_Extension,
Cheat_Notes,
Cheat_Options,
Cheat_Range,
Cheat_RangeNotes,
FirstRSPDefaultSet, LastRSPDefaultSet = FirstRSPDefaultSet + MaxPluginSetting,
FirstRSPSettings, LastRSPSettings = FirstRSPSettings + MaxPluginSetting,
FirstGfxDefaultSet, LastGfxDefaultSet = FirstGfxDefaultSet + MaxPluginSetting,
FirstGfxSettings, LastGfxSettings = FirstGfxSettings + MaxPluginSetting,
FirstAudioDefaultSet, LastAudioDefaultSet = FirstAudioDefaultSet + MaxPluginSetting,
FirstAudioSettings, LastAudioSettings = FirstAudioSettings + MaxPluginSetting,
FirstCtrlDefaultSet, LastCtrlDefaultSet = FirstCtrlDefaultSet + MaxPluginSetting,
FirstCtrlSettings, LastCtrlSettings = FirstCtrlSettings + MaxPluginSetting,
/* No_Default, Default_False, Default_True, Default_Language, Default_RdramSize,
Default_RomStatus,Default_RomBrowserWidth,Default_RomBrowserHeight, Default_RomStatus,Default_RomBrowserWidth,Default_RomBrowserHeight,
Default_RememberedRomFiles, Default_RememberedRomDirs, Default_CheatExt, Default_RememberedRomFiles, Default_RememberedRomDirs, Default_CheatExt,
Default_SelfModCheck, Default_BlockLinking, Default_SaveSlot, Default_FunctionLookup, Default_SelfModCheck, Default_BlockLinking, Default_SaveSlot, Default_FunctionLookup,
@ -36,6 +243,7 @@ enum SettingID {
LimitFPS, AlwaysOnTop, GenerateDebugLog, UseHighLevelGfx, UseHighLevelAudio, LimitFPS, AlwaysOnTop, GenerateDebugLog, UseHighLevelGfx, UseHighLevelAudio,
DisableGameFixes, AppLogLevel, AppLogFlush, DisplayFrameRate, FrameDisplayType, DisableGameFixes, AppLogLevel, AppLogFlush, DisplayFrameRate, FrameDisplayType,
//Debugger //Debugger
Debugger, ShowUnhandledMemory, ShowPifErrors, ShowDListAListCount, ShowCheckOpUsageErrors, Debugger, ShowUnhandledMemory, ShowPifErrors, ShowDListAListCount, ShowCheckOpUsageErrors,
ShowRecompMemSize, ShowPifRamErrors, ShowRecompMemSize, ShowPifRamErrors,
@ -79,12 +287,18 @@ enum SettingID {
CheatActive, LastCheatActive = CheatActive + MaxCheats, CheatActive, LastCheatActive = CheatActive + MaxCheats,
CheatExtension, LastCheatExtension = CheatExtension + MaxCheats, CheatExtension, LastCheatExtension = CheatExtension + MaxCheats,
//Idvidual Game Settings //Individual Game Settings
Game_SaveChip,
Game_LastSaveSlot, Game_LastSaveSlot,
//RDB Settings
Rdb_SaveChip,
//Default Values
System_SaveChip,
//Rom Settings //Rom Settings
Default_CPUType, Default_CPUType,
Default_SaveChip,
Default_CFactor, Default_CFactor,
ROM_IniKey, ROM_IniKey,
ROM_NAME, ROM_NAME,
@ -99,7 +313,6 @@ enum SettingID {
ROM_Status, ROM_Status,
ROM_CoreNotes, ROM_CoreNotes,
ROM_PluginNotes, ROM_PluginNotes,
ROM_SaveChip,
ROM_CounterFactor, ROM_CounterFactor,
ROM_CustomSMM, ROM_CustomSMM,
ROM_SMM_Cache, ROM_SMM_Cache,
@ -141,7 +354,6 @@ enum SettingID {
CPUType, //DWORD - Current CPU CPUType, //DWORD - Current CPU
CPU_Paused, //bool - Is CPU Paused CPU_Paused, //bool - Is CPU Paused
CPU_Paused_type, //DWORD - What type of pause is it CPU_Paused_type, //DWORD - What type of pause is it
SaveChipType, //DWORD - Current Save Type
SMM_ChangeMemory, SMM_ChangeMemory,
SMM_CheckMemory2, SMM_CheckMemory2,
SMM_CheckMemoryCache, SMM_CheckMemoryCache,
@ -170,6 +382,7 @@ enum SettingID {
SMM_ValidFunc, //bool - Self mod method (Compare memory contents of function on finding) SMM_ValidFunc, //bool - Self mod method (Compare memory contents of function on finding)
SMM_Protect, //bool - Self mod method (Protect Memory from any write to the code pages) SMM_Protect, //bool - Self mod method (Protect Memory from any write to the code pages)
SMM_TLB, //bool - Self mod method (clear code on TLB unmapping) SMM_TLB, //bool - Self mod method (clear code on TLB unmapping)
*/
}; };
#include "Support.h" #include "Support.h"

View File

@ -1,34 +1,25 @@
#include "..\support.h" #include "..\support.h"
#include "..\Settings.h" #include "..\Settings.h"
bool CGuiSettings::bCPURunning; bool CGuiSettings::m_bCPURunning;
bool CGuiSettings::bAutoSleep; bool CGuiSettings::m_bAutoSleep;
CGuiSettings::CGuiSettings() CGuiSettings::CGuiSettings()
{ {
RefreshSettings(); RefreshSettings();
_Settings->RegisterChangeCB(CPU_Running,this,(CSettings::SettingChangedFunc)CPURunningChanged); _Settings->RegisterChangeCB(GameRunning_CPU_Running,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(AutoSleep,this,(CSettings::SettingChangedFunc)AutoSleepChanged); _Settings->RegisterChangeCB(Setting_AutoSleep,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
} }
CGuiSettings::~CGuiSettings() CGuiSettings::~CGuiSettings()
{ {
_Settings->UnregisterChangeCB(CPU_Running,this,(CSettings::SettingChangedFunc)CPURunningChanged); _Settings->UnregisterChangeCB(GameRunning_CPU_Running,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(AutoSleep,this,(CSettings::SettingChangedFunc)AutoSleepChanged); _Settings->UnregisterChangeCB(Setting_AutoSleep,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
} }
void CGuiSettings::RefreshSettings() void CGuiSettings::RefreshSettings()
{ {
bCPURunning = _Settings->LoadBool(CPU_Running); m_bCPURunning = _Settings->LoadBool(GameRunning_CPU_Running);
bAutoSleep = _Settings->LoadBool(AutoSleep); m_bAutoSleep = _Settings->LoadBool(Setting_AutoSleep);
} }
void CGuiSettings::CPURunningChanged (CGuiSettings * _this)
{
_this->bCPURunning = _Settings->LoadBool(CPU_Running);
}
void CGuiSettings::AutoSleepChanged (CGuiSettings * _this)
{
_this->bAutoSleep = _Settings->LoadBool(AutoSleep);
}

View File

@ -2,15 +2,21 @@
class CGuiSettings class CGuiSettings
{ {
static void CPURunningChanged (CGuiSettings * _this); static void StaticRefreshSettings (CGuiSettings * _this)
static void AutoSleepChanged (CGuiSettings * _this); {
_this->RefreshSettings();
}
void RefreshSettings ( void );
static bool m_bCPURunning;
static bool m_bAutoSleep;
protected: protected:
CGuiSettings(); CGuiSettings();
virtual ~CGuiSettings(); virtual ~CGuiSettings();
void RefreshSettings ( void ); static inline bool bCPURunning ( void) { return m_bCPURunning; }
static inline bool bAutoSleep ( void) { return m_bAutoSleep; }
static bool bCPURunning;
static bool bAutoSleep;
}; };

View File

@ -1,75 +1,61 @@
#include "..\support.h" #include "..\support.h"
#include "..\Settings.h" #include "..\Settings.h"
bool CN64SystemSettings::bShowCPUPer; //= _Settings->LoadDword(ShowCPUPer) != 0; bool CN64SystemSettings::m_bShowCPUPer;
bool CN64SystemSettings::bProfiling; //= _Settings->LoadDword(ProfileCode) != 0; bool CN64SystemSettings::m_bProfiling;
bool CN64SystemSettings::bBasicMode; //= _Settings->LoadDword(BasicMode) != 0; bool CN64SystemSettings::m_bBasicMode;
bool CN64SystemSettings::bLimitFPS; //= _Settings->LoadDword(LimitFPS) != 0; bool CN64SystemSettings::m_bLimitFPS;
bool CN64SystemSettings::bShowDListAListCount; //= _Settings->LoadDword(ShowDListAListCount) != 0; bool CN64SystemSettings::m_bShowDListAListCount;
bool CN64SystemSettings::bFixedAudio; //= _Settings->LoadDword(ROM_FixedAudio) != 0; bool CN64SystemSettings::m_bFixedAudio;
bool CN64SystemSettings::bSyncToAudio; //7= _Settings->LoadDword(SyncViaAudio) != 0; bool CN64SystemSettings::m_bSyncToAudio;
bool CN64SystemSettings::bDisplayFrameRate; //7= _Settings->LoadDword(SyncViaAudio) != 0; bool CN64SystemSettings::m_bDisplayFrameRate;
bool CN64SystemSettings::bCleanFrameBox = false; //7= _Settings->LoadDword(SyncViaAudio) != 0; bool CN64SystemSettings::m_SPHack;
CN64SystemSettings::CN64SystemSettings() CN64SystemSettings::CN64SystemSettings()
{ {
_Settings->RegisterChangeCB(ShowCPUPer,this,(CSettings::SettingChangedFunc)ShowCPUPerChanged); _Settings->RegisterChangeCB(UserInterface_BasicMode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(ProfileCode,this,(CSettings::SettingChangedFunc)ProfilingChanged); _Settings->RegisterChangeCB(UserInterface_ShowCPUPer,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(BasicMode,this,(CSettings::SettingChangedFunc)BasicModeChanged); _Settings->RegisterChangeCB(UserInterface_DisplayFrameRate,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(LimitFPS,this,(CSettings::SettingChangedFunc)LimitFPSChanged);
_Settings->RegisterChangeCB(ShowDListAListCount,this,(CSettings::SettingChangedFunc)ShowDListAListCountChanged); _Settings->RegisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(DisplayFrameRate,this,(CSettings::SettingChangedFunc)DisplayFrameRateChanged); _Settings->RegisterChangeCB(Debugger_ShowDListAListCount,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(GameRunning_LimitFPS,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(Game_FixedAudio,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(Game_SyncViaAudio,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(Game_SPHack,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
RefreshSettings(); RefreshSettings();
} }
CN64SystemSettings::~CN64SystemSettings() CN64SystemSettings::~CN64SystemSettings()
{ {
_Settings->UnregisterChangeCB(ShowCPUPer,this,(CSettings::SettingChangedFunc)ShowCPUPerChanged); _Settings->UnregisterChangeCB(UserInterface_BasicMode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(ProfileCode,this,(CSettings::SettingChangedFunc)ProfilingChanged); _Settings->UnregisterChangeCB(UserInterface_DisplayFrameRate,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(BasicMode,this,(CSettings::SettingChangedFunc)BasicModeChanged); _Settings->UnregisterChangeCB(UserInterface_ShowCPUPer,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(LimitFPS,this,(CSettings::SettingChangedFunc)LimitFPSChanged);
_Settings->UnregisterChangeCB(ShowDListAListCount,this,(CSettings::SettingChangedFunc)ShowDListAListCountChanged); _Settings->UnregisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(DisplayFrameRate,this,(CSettings::SettingChangedFunc)DisplayFrameRateChanged); _Settings->UnregisterChangeCB(Debugger_ShowDListAListCount,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(GameRunning_LimitFPS,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Game_FixedAudio,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Game_SyncViaAudio,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Game_SPHack,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
} }
void CN64SystemSettings::RefreshSettings() void CN64SystemSettings::RefreshSettings()
{ {
bShowCPUPer = _Settings->LoadDword(ShowCPUPer) != 0; m_bBasicMode = _Settings->LoadBool(UserInterface_BasicMode);
bProfiling = _Settings->LoadDword(ProfileCode) != 0; m_bDisplayFrameRate = _Settings->LoadBool(UserInterface_DisplayFrameRate);
bBasicMode = _Settings->LoadDword(BasicMode) != 0;
bLimitFPS = _Settings->LoadDword(LimitFPS) != 0;
bShowDListAListCount = _Settings->LoadDword(ShowDListAListCount) != 0;
bFixedAudio = _Settings->LoadDword(ROM_FixedAudio) != 0;
bSyncToAudio = bFixedAudio ? _Settings->LoadDword(SyncViaAudio) != 0 : false;
bDisplayFrameRate = _Settings->LoadDword(DisplayFrameRate) != 0;
}
void CN64SystemSettings::ShowCPUPerChanged (CN64SystemSettings * _this) m_bShowCPUPer = _Settings->LoadBool(UserInterface_ShowCPUPer);
{ m_bProfiling = _Settings->LoadBool(Debugger_ProfileCode);
_this->bShowCPUPer = _Settings->LoadDword(ShowCPUPer) != 0; m_bShowDListAListCount = _Settings->LoadBool(Debugger_ShowDListAListCount);
} m_bLimitFPS = _Settings->LoadBool(GameRunning_LimitFPS);
void CN64SystemSettings::ProfilingChanged (CN64SystemSettings * _this) m_bFixedAudio = _Settings->LoadBool(Game_FixedAudio);
{ m_bSyncToAudio = m_bFixedAudio ? _Settings->LoadBool(Game_SyncViaAudio) : false;
_this->bProfiling = _Settings->LoadDword(ProfileCode) != 0; m_SPHack = _Settings->LoadBool(Game_SPHack);
}
void CN64SystemSettings::BasicModeChanged (CN64SystemSettings * _this)
{
_this->bBasicMode = _Settings->LoadDword(BasicMode) != 0;
}
void CN64SystemSettings::LimitFPSChanged (CN64SystemSettings * _this)
{
_this->bLimitFPS = _Settings->LoadDword(LimitFPS) != 0;
}
void CN64SystemSettings::ShowDListAListCountChanged (CN64SystemSettings * _this)
{
_this->bShowDListAListCount = _Settings->LoadDword(ShowDListAListCount) != 0;
}
void CN64SystemSettings::DisplayFrameRateChanged (CN64SystemSettings * _this)
{
_this->bDisplayFrameRate = _Settings->LoadDword(DisplayFrameRate) != 0;
} }

View File

@ -2,27 +2,34 @@
class CN64SystemSettings class CN64SystemSettings
{ {
static void ShowCPUPerChanged (CN64SystemSettings * _this); static void StaticRefreshSettings (CN64SystemSettings * _this)
static void ProfilingChanged (CN64SystemSettings * _this); {
static void BasicModeChanged (CN64SystemSettings * _this); _this->RefreshSettings();
static void LimitFPSChanged (CN64SystemSettings * _this); }
static void ShowDListAListCountChanged (CN64SystemSettings * _this);
static void DisplayFrameRateChanged (CN64SystemSettings * _this); void RefreshSettings ( void );
static void FrameRateTypeChanged (CN64SystemSettings * _this);
static bool m_bShowCPUPer;
static bool m_bProfiling;
static bool m_bBasicMode;
static bool m_bLimitFPS;
static bool m_bShowDListAListCount;
static bool m_bFixedAudio;
static bool m_bSyncToAudio;
static bool m_bDisplayFrameRate;
static bool m_SPHack;
protected: protected:
CN64SystemSettings(); CN64SystemSettings();
virtual ~CN64SystemSettings(); virtual ~CN64SystemSettings();
void RefreshSettings ( void ); inline bool bBasicMode ( void ) const { return m_bBasicMode; }
inline bool bDisplayFrameRate ( void ) const { return m_bDisplayFrameRate; }
static bool bShowCPUPer; inline bool bShowCPUPer ( void ) const { return m_bShowCPUPer; }
static bool bProfiling; inline bool bProfiling ( void ) const { return m_bProfiling; }
static bool bBasicMode; inline bool bShowDListAListCount ( void ) const { return m_bShowDListAListCount; }
static bool bLimitFPS; inline bool bLimitFPS ( void ) const { return m_bLimitFPS; }
static bool bShowDListAListCount; inline bool bFixedAudio ( void ) const { return m_bFixedAudio; }
static bool bFixedAudio; inline bool bSyncToAudio ( void ) const { return m_bSyncToAudio; }
static bool bSyncToAudio; inline bool bSPHack ( void ) const { return m_SPHack; }
static bool bDisplayFrameRate;
static bool bCleanFrameBox;
}; };

View File

@ -1,23 +1,23 @@
#include "..\Settings.h" #include "..\Settings.h"
#include "Notification Settings.h" #include "Notification Settings.h"
bool CNotificationSettings::bInFullScreen; //= _Settings->Load(InFullScreen) != 0; bool CNotificationSettings::m_bInFullScreen = false;
CNotificationSettings::CNotificationSettings() CNotificationSettings::CNotificationSettings()
{ {
bInFullScreen = _Settings->LoadBool(InFullScreen); _Settings->RegisterChangeCB(UserInterface_InFullScreen,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(InFullScreen,this,(CSettings::SettingChangedFunc)InFullScreenChanged); RefreshSettings();
} }
CNotificationSettings::~CNotificationSettings() CNotificationSettings::~CNotificationSettings()
{ {
if (_Settings) if (_Settings)
{ {
_Settings->UnregisterChangeCB(InFullScreen,this,(CSettings::SettingChangedFunc)InFullScreenChanged); _Settings->UnregisterChangeCB(UserInterface_InFullScreen,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
} }
} }
void CNotificationSettings::InFullScreenChanged (CNotificationSettings * _this) void CNotificationSettings::RefreshSettings()
{ {
bInFullScreen = _Settings->LoadBool(InFullScreen); m_bInFullScreen = _Settings->LoadBool(UserInterface_InFullScreen);
} }

View File

@ -1,11 +1,17 @@
class CNotificationSettings class CNotificationSettings
{ {
static void InFullScreenChanged (CNotificationSettings * _this); static void StaticRefreshSettings (CNotificationSettings * _this)
{
_this->RefreshSettings();
}
void RefreshSettings ( void );
static bool m_bInFullScreen;
protected: protected:
CNotificationSettings(); CNotificationSettings();
virtual ~CNotificationSettings(); virtual ~CNotificationSettings();
//Settings that can be changed on the fly inline bool InFullScreen ( void ) const { return m_bInFullScreen; }
static bool bInFullScreen;
}; };

View File

@ -1,47 +1,66 @@
#pragma once #pragma once
#include "..\Settings.h" #include "..\Settings.h"
bool CRecompilerSettings::bShowRecompMemSize; //= _Settings->LoadDword(ShowRecompMemSize) != 0; bool CRecompilerSettings::m_bShowRecompMemSize;
bool CRecompilerSettings::bSMM_Protect; //= _Settings->LoadDword(SMM_Protect) != 0; bool CRecompilerSettings::m_bSMM_Protect;
bool CRecompilerSettings::bSMM_ValidFunc; //= _Settings->LoadDword(SMM_ValidFunc) != 0; bool CRecompilerSettings::m_bSMM_ValidFunc;
bool CRecompilerSettings::bSMM_PIDMA; //= _Settings->LoadDword(SMM_PIDMA) != 0; bool CRecompilerSettings::m_bSMM_PIDMA;
bool CRecompilerSettings::bSMM_TLB; //= _Settings->LoadDword(SMM_TLB) != 0; bool CRecompilerSettings::m_bSMM_TLB;
bool CRecompilerSettings::bProfiling; //= _Settings->LoadDword(ProfileCode) != 0; bool CRecompilerSettings::m_bProfiling;
bool CRecompilerSettings::bRomInMemory; //= _Settings->LoadDword(ProfileCode) != 0; bool CRecompilerSettings::m_bRomInMemory;
bool CRecompilerSettings::m_RegCaching;
bool CRecompilerSettings::m_bLinkBlocks;
DWORD CRecompilerSettings::m_RdramSize;
DWORD CRecompilerSettings::m_CountPerOp;
DWORD CRecompilerSettings::m_LookUpMode; //FUNC_LOOKUP_METHOD
CRecompilerSettings::CRecompilerSettings() CRecompilerSettings::CRecompilerSettings()
{ {
bShowRecompMemSize = _Settings->LoadDword(ShowRecompMemSize) != 0; _Settings->RegisterChangeCB(Game_SMM_Protect,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
bSMM_Protect = _Settings->LoadDword(SMM_Protect) != 0; _Settings->RegisterChangeCB(Game_SMM_ValidFunc,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
bSMM_ValidFunc = _Settings->LoadDword(SMM_ValidFunc) != 0; _Settings->RegisterChangeCB(Game_SMM_PIDMA,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
bSMM_PIDMA = _Settings->LoadDword(SMM_PIDMA) != 0; _Settings->RegisterChangeCB(Game_SMM_TLB,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
bSMM_TLB = _Settings->LoadDword(SMM_TLB) != 0; _Settings->RegisterChangeCB(Game_RegCache,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
bProfiling = _Settings->LoadDword(ProfileCode) != 0; _Settings->RegisterChangeCB(Game_BlockLinking,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
bRomInMemory = _Settings->LoadDword(RomInMemory) != 0; _Settings->RegisterChangeCB(Game_RDRamSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(ShowRecompMemSize,this,(CSettings::SettingChangedFunc)ShowRecompMemSizeChanged); _Settings->RegisterChangeCB(Game_CounterFactor,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(ProfileCode,this,(CSettings::SettingChangedFunc)ProfilingChanged); _Settings->RegisterChangeCB(Game_FuncLookupMode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(RomInMemory,this,(CSettings::SettingChangedFunc)RomInMemoryChanged); _Settings->RegisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->RegisterChangeCB(Game_LoadRomToMemory,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
RefreshSettings();
} }
CRecompilerSettings::~CRecompilerSettings() CRecompilerSettings::~CRecompilerSettings()
{ {
_Settings->UnregisterChangeCB(ShowRecompMemSize,this,(CSettings::SettingChangedFunc)ShowRecompMemSizeChanged); _Settings->UnregisterChangeCB(Game_SMM_Protect,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(ProfileCode,this,(CSettings::SettingChangedFunc)ProfilingChanged); _Settings->UnregisterChangeCB(Game_SMM_ValidFunc,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(RomInMemory,this,(CSettings::SettingChangedFunc)RomInMemoryChanged); _Settings->UnregisterChangeCB(Game_SMM_PIDMA,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Game_SMM_TLB,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Game_RegCache,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Game_BlockLinking,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Game_RDRamSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Game_CounterFactor,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Game_FuncLookupMode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
_Settings->UnregisterChangeCB(Game_LoadRomToMemory,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
} }
void CRecompilerSettings::ShowRecompMemSizeChanged (CRecompilerSettings * _this) void CRecompilerSettings::RefreshSettings()
{ {
_this->bShowRecompMemSize = _Settings->LoadDword(ShowRecompMemSize) != 0; m_bSMM_Protect = _Settings->LoadBool(Game_SMM_Protect);
} m_bSMM_ValidFunc = _Settings->LoadBool(Game_SMM_ValidFunc);
m_bSMM_PIDMA = _Settings->LoadBool(Game_SMM_PIDMA);
m_bSMM_TLB = _Settings->LoadBool(Game_SMM_TLB);
m_bShowRecompMemSize = _Settings->LoadBool(Debugger_ShowRecompMemSize);
m_bProfiling = _Settings->LoadBool(Debugger_ProfileCode);
m_bRomInMemory = _Settings->LoadBool(Game_LoadRomToMemory);
m_RegCaching = _Settings->LoadBool(Game_RegCache);
void CRecompilerSettings::ProfilingChanged (CRecompilerSettings * _this) m_bLinkBlocks = _Settings->LoadBool(Game_BlockLinking);
{ m_RdramSize = _Settings->LoadDword(Game_RDRamSize);
_this->bProfiling = _Settings->LoadDword(ProfileCode) != 0; m_CountPerOp = _Settings->LoadDword(Game_CounterFactor);
} m_LookUpMode = _Settings->LoadDword(Game_FuncLookupMode);
void CRecompilerSettings::RomInMemoryChanged (CRecompilerSettings * _this)
{
_this->bRomInMemory = _Settings->LoadDword(RomInMemory) != 0;
} }

View File

@ -1,19 +1,44 @@
#include <N64 System/N64 Types.h>
class CRecompilerSettings class CRecompilerSettings
{ {
static void ShowRecompMemSizeChanged (CRecompilerSettings * _this); static void StaticRefreshSettings (CRecompilerSettings * _this)
static void RomInMemoryChanged (CRecompilerSettings * _this); {
static void ProfilingChanged (CRecompilerSettings * _this); _this->RefreshSettings();
}
void RefreshSettings ( void );
//Settings that can be changed on the fly
static bool m_bShowRecompMemSize;
static bool m_bSMM_Protect;
static bool m_bSMM_ValidFunc;
static bool m_bSMM_PIDMA;
static bool m_bSMM_TLB;
static bool m_bProfiling;
static bool m_bRomInMemory;
static bool m_RegCaching;
static bool m_bLinkBlocks;
static DWORD m_RdramSize;
static DWORD m_CountPerOp;
static DWORD m_LookUpMode; //FUNC_LOOKUP_METHOD
public: public:
CRecompilerSettings(); CRecompilerSettings();
virtual ~CRecompilerSettings(); virtual ~CRecompilerSettings();
//Settings that can be changed on the fly inline bool bShowRecompMemSize ( void ) const { return m_bShowRecompMemSize; }
static bool bShowRecompMemSize; inline bool bSMM_Protect ( void ) const { return m_bSMM_Protect; }
static bool bSMM_Protect; inline bool bSMM_ValidFunc ( void ) const { return m_bSMM_ValidFunc; }
static bool bSMM_ValidFunc; inline bool bSMM_PIDMA ( void ) const { return m_bSMM_PIDMA; }
static bool bSMM_PIDMA; inline bool bSMM_TLB ( void ) const { return m_bSMM_TLB; }
static bool bSMM_TLB; inline bool bProfiling ( void ) const { return m_bProfiling; }
static bool bProfiling; inline bool bRomInMemory ( void ) const { return m_bRomInMemory; }
static bool bRomInMemory; inline bool bRegCaching ( void ) const { return m_RegCaching; }
inline bool bLinkBlocks ( void ) const { return m_bLinkBlocks; }
inline DWORD RdramSize ( void ) const { return m_RdramSize; }
inline DWORD CountPerOp ( void ) const { return m_CountPerOp; }
inline FUNC_LOOKUP_METHOD LookUpMode ( void ) const { return (FUNC_LOOKUP_METHOD)m_LookUpMode; }
}; };

View File

@ -10,7 +10,7 @@ CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, DW
m_KeyName(Name), m_KeyName(Name),
m_DefaultStr(""), m_DefaultStr(""),
m_DefaultValue(DefaultValue), m_DefaultValue(DefaultValue),
m_DefaultSetting(No_Default), m_DefaultSetting(Default_Constant),
m_KeyNameIdex(m_KeyName) m_KeyNameIdex(m_KeyName)
{ {
} }
@ -20,7 +20,7 @@ CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, bo
m_KeyName(Name), m_KeyName(Name),
m_DefaultStr(""), m_DefaultStr(""),
m_DefaultValue(DefaultValue), m_DefaultValue(DefaultValue),
m_DefaultSetting(No_Default), m_DefaultSetting(Default_Constant),
m_KeyNameIdex(m_KeyName) m_KeyNameIdex(m_KeyName)
{ {
} }
@ -30,7 +30,7 @@ CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, LP
m_KeyName(Name), m_KeyName(Name),
m_DefaultStr(DefaultValue), m_DefaultStr(DefaultValue),
m_DefaultValue(0), m_DefaultValue(0),
m_DefaultSetting(No_Default), m_DefaultSetting(Default_Constant),
m_KeyNameIdex(m_KeyName) m_KeyNameIdex(m_KeyName)
{ {
} }
@ -52,8 +52,9 @@ CSettingTypeApplication::~CSettingTypeApplication()
void CSettingTypeApplication::Initilize( const char * AppName ) void CSettingTypeApplication::Initilize( const char * AppName )
{ {
m_SettingsIniFile = new CIniFile(_Settings->LoadString(SettingsIniName).c_str()); m_SettingsIniFile = new CIniFile(_Settings->LoadString(SupportFile_Settings).c_str());
m_UseRegistry = _Settings->LoadBool(UseSettingFromRegistry); m_SettingsIniFile->SetAutoFlush(false);
m_UseRegistry = _Settings->LoadBool(Setting_UseFromRegistry);
} }
@ -61,6 +62,7 @@ void CSettingTypeApplication::CleanUp()
{ {
if (m_SettingsIniFile) if (m_SettingsIniFile)
{ {
m_SettingsIniFile->SetAutoFlush(true);
delete m_SettingsIniFile; delete m_SettingsIniFile;
m_SettingsIniFile = NULL; m_SettingsIniFile = NULL;
} }
@ -68,15 +70,30 @@ void CSettingTypeApplication::CleanUp()
bool CSettingTypeApplication::Load ( int Index, bool & Value ) const bool CSettingTypeApplication::Load ( int Index, bool & Value ) const
{ {
bool bRes = false;
if (!m_UseRegistry) if (!m_UseRegistry)
{ {
DWORD dwValue; DWORD dwValue;
bool bRes = m_SettingsIniFile->GetNumber(m_Section.c_str(),m_KeyNameIdex.c_str(),m_DefaultValue,dwValue); bRes = m_SettingsIniFile->GetNumber(SectionName(),m_KeyNameIdex.c_str(),Value,dwValue);
if (bRes)
{
Value = dwValue != 0; Value = dwValue != 0;
return bRes;
} }
} else {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
return false; }
if (!bRes && m_DefaultSetting != Default_None)
{
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue != 0;
} else {
_Settings->LoadBool(m_DefaultSetting,Value);
}
}
return bRes;
} }
bool CSettingTypeApplication::Load ( int Index, ULONG & Value ) const bool CSettingTypeApplication::Load ( int Index, ULONG & Value ) const
@ -84,45 +101,99 @@ bool CSettingTypeApplication::Load ( int Index, ULONG & Value ) const
bool bRes; bool bRes;
if (!m_UseRegistry) if (!m_UseRegistry)
{ {
bRes = m_SettingsIniFile->GetNumber(m_Section.c_str(),m_KeyNameIdex.c_str(),m_DefaultValue,Value); bRes = m_SettingsIniFile->GetNumber(SectionName(),m_KeyNameIdex.c_str(),Value,Value);
} else { } else {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
} }
if (!bRes && m_DefaultSetting != No_Default) if (!bRes && m_DefaultSetting != Default_None)
{ {
bRes = _Settings->LoadDword(m_DefaultSetting,Value); if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue;
} else {
_Settings->LoadDword(m_DefaultSetting,Value);
}
} }
return bRes; return bRes;
} }
LPCSTR CSettingTypeApplication::SectionName ( void ) const
{
return m_Section.c_str();
}
bool CSettingTypeApplication::Load ( int Index, stdstr & Value ) const bool CSettingTypeApplication::Load ( int Index, stdstr & Value ) const
{ {
bool bRes; bool bRes;
if (!m_UseRegistry) if (!m_UseRegistry)
{ {
bRes = m_SettingsIniFile->GetString(m_Section.c_str(),m_KeyNameIdex.c_str(),m_DefaultStr,Value); bRes = m_SettingsIniFile->GetString(SectionName(),m_KeyNameIdex.c_str(),m_DefaultStr,Value);
} else { } else {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
} }
if (!bRes && m_DefaultSetting != No_Default) if (!bRes)
{ {
bRes = _Settings->LoadString(m_DefaultSetting,Value); CSettingTypeApplication::LoadDefault(Index,Value);
} }
return bRes; return bRes;
} }
//return the default values
void CSettingTypeApplication::LoadDefault ( int Index, bool & Value ) const
{
if (m_DefaultSetting != Default_None)
{
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue != 0;
} else {
_Settings->LoadBool(m_DefaultSetting,Value);
}
}
}
void CSettingTypeApplication::LoadDefault ( int Index, ULONG & Value ) const
{
if (m_DefaultSetting != Default_None)
{
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue;
} else {
_Settings->LoadDword(m_DefaultSetting,Value);
}
}
}
void CSettingTypeApplication::LoadDefault ( int Index, stdstr & Value ) const
{
if (m_DefaultSetting != Default_None)
{
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultStr;
} else {
_Settings->LoadString(m_DefaultSetting,Value);
}
}
}
//Update the settings //Update the settings
void CSettingTypeApplication::Save ( int Index, bool Value ) void CSettingTypeApplication::Save ( int Index, bool Value )
{ {
if (!m_UseRegistry)
{
m_SettingsIniFile->SaveNumber(SectionName(),m_KeyNameIdex.c_str(),Value);
} else {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
} }
}
void CSettingTypeApplication::Save ( int Index, ULONG Value ) void CSettingTypeApplication::Save ( int Index, ULONG Value )
{ {
if (!m_UseRegistry) if (!m_UseRegistry)
{ {
m_SettingsIniFile->SaveNumber(m_Section.c_str(),m_KeyNameIdex.c_str(),Value); m_SettingsIniFile->SaveNumber(SectionName(),m_KeyNameIdex.c_str(),Value);
} else { } else {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
} }
@ -132,7 +203,7 @@ void CSettingTypeApplication::Save ( int Index, const stdstr & Value )
{ {
if (!m_UseRegistry) if (!m_UseRegistry)
{ {
m_SettingsIniFile->SaveString(m_Section.c_str(),m_KeyNameIdex.c_str(),Value.c_str()); m_SettingsIniFile->SaveString(SectionName(),m_KeyNameIdex.c_str(),Value.c_str());
} else { } else {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
} }
@ -142,7 +213,7 @@ void CSettingTypeApplication::Save ( int Index, const char * Value )
{ {
if (!m_UseRegistry) if (!m_UseRegistry)
{ {
m_SettingsIniFile->SaveString(m_Section.c_str(),m_KeyNameIdex.c_str(),Value); m_SettingsIniFile->SaveString(SectionName(),m_KeyNameIdex.c_str(),Value);
} else { } else {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
} }
@ -162,3 +233,13 @@ stdstr CSettingTypeApplication::FixSectionName(LPCSTR Section)
} }
return SectionName; return SectionName;
} }
void CSettingTypeApplication::Delete( int Index )
{
if (!m_UseRegistry)
{
m_SettingsIniFile->SaveString(SectionName(),m_KeyNameIdex.c_str(),NULL);
} else {
Notify().BreakPoint(__FILE__,__LINE__);
}
}

View File

@ -4,19 +4,21 @@ class CSettingTypeApplication :
public CSettingType public CSettingType
{ {
protected:
const LPCSTR m_DefaultStr; const LPCSTR m_DefaultStr;
const DWORD m_DefaultValue; const DWORD m_DefaultValue;
const SettingID m_DefaultSetting; const SettingID m_DefaultSetting;
stdstr FixSectionName (LPCSTR Section); stdstr FixSectionName (LPCSTR Section);
protected:
static CIniFile * m_SettingsIniFile; static CIniFile * m_SettingsIniFile;
static bool m_UseRegistry; static bool m_UseRegistry;
const stdstr m_Section; const stdstr m_Section;
const LPCSTR m_KeyName; const stdstr m_KeyName;
mutable stdstr m_KeyNameIdex; mutable stdstr m_KeyNameIdex;
virtual LPCSTR SectionName ( void ) const;
public: public:
CSettingTypeApplication(LPCSTR Section, LPCSTR Name, LPCSTR DefaultValue ); CSettingTypeApplication(LPCSTR Section, LPCSTR Name, LPCSTR DefaultValue );
CSettingTypeApplication(LPCSTR Section, LPCSTR Name, bool DefaultValue ); CSettingTypeApplication(LPCSTR Section, LPCSTR Name, bool DefaultValue );
@ -25,19 +27,27 @@ public:
~CSettingTypeApplication(); ~CSettingTypeApplication();
virtual bool IndexBasedSetting ( void ) const { return false; } virtual bool IndexBasedSetting ( void ) const { return false; }
virtual SettingLocation GetSettingsLocation ( void ) const { return m_UseRegistry ? SettingLocation_Registry : SettingLocation_CfgFile; } virtual SettingType GetSettingType ( void ) const { return m_UseRegistry ? SettingType_Registry : SettingType_CfgFile; }
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting
virtual void Delete ( int Index );
// Initilize this class to use ini or registry // Initilize this class to use ini or registry
static void Initilize ( const char * AppName ); static void Initilize ( const char * AppName );
static void CleanUp ( void ); static void CleanUp ( void );

View File

@ -27,41 +27,68 @@ CSettingTypeApplicationIndex::CSettingTypeApplicationIndex(LPCSTR Section, LPCST
bool CSettingTypeApplicationIndex::Load ( int Index, bool & Value ) const bool CSettingTypeApplicationIndex::Load ( int Index, bool & Value ) const
{ {
Notify().BreakPoint(__FILE__,__LINE__); m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
return false; return CSettingTypeApplication::Load(0,Value);
} }
bool CSettingTypeApplicationIndex::Load ( int Index, ULONG & Value ) const bool CSettingTypeApplicationIndex::Load ( int Index, ULONG & Value ) const
{ {
m_KeyNameIdex.Format("%s %d",m_KeyName,Index); m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
return CSettingTypeApplication::Load(0,Value); return CSettingTypeApplication::Load(0,Value);
} }
bool CSettingTypeApplicationIndex::Load ( int Index, stdstr & Value ) const bool CSettingTypeApplicationIndex::Load ( int Index, stdstr & Value ) const
{ {
m_KeyNameIdex.Format("%s %d",m_KeyName,Index); m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
return CSettingTypeApplication::Load(0,Value); return CSettingTypeApplication::Load(0,Value);
} }
//return the default values
void CSettingTypeApplicationIndex::LoadDefault ( int Index, bool & Value ) const
{
m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
CSettingTypeApplication::LoadDefault(0,Value);
}
void CSettingTypeApplicationIndex::LoadDefault ( int Index, ULONG & Value ) const
{
m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
CSettingTypeApplication::LoadDefault(0,Value);
}
void CSettingTypeApplicationIndex::LoadDefault ( int Index, stdstr & Value ) const
{
m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
CSettingTypeApplication::LoadDefault(0,Value);
}
//Update the settings //Update the settings
void CSettingTypeApplicationIndex::Save ( int Index, bool Value ) void CSettingTypeApplicationIndex::Save ( int Index, bool Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
CSettingTypeApplication::Save(0,Value);
} }
void CSettingTypeApplicationIndex::Save ( int Index, ULONG Value ) void CSettingTypeApplicationIndex::Save ( int Index, ULONG Value )
{ {
m_KeyNameIdex.Format("%s %d",m_KeyName,Index); m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
CSettingTypeApplication::Save(0,Value); CSettingTypeApplication::Save(0,Value);
} }
void CSettingTypeApplicationIndex::Save ( int Index, const stdstr & Value ) void CSettingTypeApplicationIndex::Save ( int Index, const stdstr & Value )
{ {
m_KeyNameIdex.Format("%s %d",m_KeyName,Index); m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
CSettingTypeApplication::Save(0,Value); CSettingTypeApplication::Save(0,Value);
} }
void CSettingTypeApplicationIndex::Save ( int Index, const char * Value ) void CSettingTypeApplicationIndex::Save ( int Index, const char * Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
CSettingTypeApplication::Save(0,Value);
}
void CSettingTypeApplicationIndex::Delete ( int Index )
{
m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
CSettingTypeApplication::Save(0,(const char *)NULL);
} }

View File

@ -18,10 +18,18 @@ public:
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting
virtual void Delete ( int Index );
}; };

View File

@ -1,24 +1,26 @@
#pragma once #pragma once
enum SettingLocation { enum SettingType {
SettingLocation_ConstString = 0, SettingType_Unknown = -1,
SettingLocation_ConstValue = 1, SettingType_ConstString = 0,
SettingLocation_CfgFile = 2, SettingType_ConstValue = 1,
SettingLocation_Registry = 3, SettingType_CfgFile = 2,
SettingLocation_RelativePath = 4, SettingType_Registry = 3,
SettingType_RelativePath = 4,
TemporarySetting = 5, TemporarySetting = 5,
SettingLocation_RomDatabase = 6, SettingType_RomDatabase = 6,
CheatSetting = 7, SettingType_CheatSetting = 7,
SettingLocation_GameSetting = 8, SettingType_GameSetting = 8,
SettingLocation_BoolVariable = 9, SettingType_BoolVariable = 9,
SettingLocation_NumberVariable = 10, SettingType_NumberVariable = 10,
SettingLocation_StringVariable = 11, SettingType_StringVariable = 11,
SettingType_SelectedDirectory = 12,
}; };
class CSettingType class CSettingType
{ {
public: public:
virtual SettingLocation GetSettingsLocation ( void ) const = 0; virtual SettingType GetSettingType ( void ) const = 0;
virtual bool IndexBasedSetting ( void ) const = 0; virtual bool IndexBasedSetting ( void ) const = 0;
//return the values //return the values
@ -26,11 +28,19 @@ public:
virtual bool Load ( int Index, ULONG & Value ) const = 0; virtual bool Load ( int Index, ULONG & Value ) const = 0;
virtual bool Load ( int Index, stdstr & Value ) const = 0; virtual bool Load ( int Index, stdstr & Value ) const = 0;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const = 0;
virtual void LoadDefault ( int Index, ULONG & Value ) const = 0;
virtual void LoadDefault ( int Index, stdstr & Value ) const = 0;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ) = 0; virtual void Save ( int Index, bool Value ) = 0;
virtual void Save ( int Index, ULONG Value ) = 0; virtual void Save ( int Index, ULONG Value ) = 0;
virtual void Save ( int Index, const stdstr & Value ) = 0; virtual void Save ( int Index, const stdstr & Value ) = 0;
virtual void Save ( int Index, const char * Value ) = 0; virtual void Save ( int Index, const char * Value ) = 0;
// Delete the setting
virtual void Delete ( int Index ) = 0;
}; };

View File

@ -0,0 +1,114 @@
#include "..\..\Settings.h"
#include "..\..\User Interface.h"
#include "SettingsType-Cheats.h"
CIniFile * CSettingTypeCheats::m_CheatIniFile = NULL;
stdstr CSettingTypeCheats::m_SectionIdent;
CSettingTypeCheats::CSettingTypeCheats(LPCSTR PostFix ) :
m_PostFix(PostFix)
{
}
void CSettingTypeCheats::Initilize ( void )
{
m_CheatIniFile = new CIniFile(_Settings->LoadString(SupportFile_Cheats).c_str());
m_CheatIniFile->SetAutoFlush(false);
_Settings->RegisterChangeCB(Game_IniKey,NULL,GameChanged);
m_SectionIdent = _Settings->LoadString(Game_IniKey);
GameChanged(NULL);
}
void CSettingTypeCheats::CleanUp ( void )
{
if (m_CheatIniFile)
{
m_CheatIniFile->SetAutoFlush(true);
delete m_CheatIniFile;
m_CheatIniFile = NULL;
}
}
void CSettingTypeCheats::GameChanged ( void * /*Data */ )
{
m_SectionIdent = _Settings->LoadString(Game_IniKey);
}
/*stdstr CSettingTypeCheats::FixName ( LPCSTR Section, LPCSTR Name )
{
}
LPCSTR CSettingTypeCheats::SectionName ( void ) const
{
return "";
}
void CSettingTypeCheats::UpdateSettings ( void * )
{
Notify().BreakPoint(__FILE__,__LINE__);
}*/
bool CSettingTypeCheats::Load ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeCheats::Load ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeCheats::Load ( int Index, stdstr & Value ) const
{
if (m_CheatIniFile == NULL)
{
return false;
}
stdstr_f Key("Cheat%d%s",Index,m_PostFix);
return m_CheatIniFile->GetString(m_SectionIdent.c_str(),Key.c_str(),"",Value);
}
//return the default values
void CSettingTypeCheats::LoadDefault ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeCheats::LoadDefault ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeCheats::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
//Update the settings
void CSettingTypeCheats::Save ( int Index, bool Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeCheats::Save ( int Index, ULONG Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeCheats::Save ( int Index, const stdstr & Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeCheats::Save ( int Index, const char * Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeCheats::Delete ( int Index )
{
Notify().BreakPoint(__FILE__,__LINE__);
}

View File

@ -0,0 +1,55 @@
#pragma once
class CSettingTypeCheats :
public CSettingType
{
protected:
static CIniFile * m_CheatIniFile;
static stdstr m_SectionIdent;
const LPCSTR m_PostFix;
/* const LPCSTR m_DefaultStr;
const DWORD m_DefaultValue;
const SettingID m_DefaultSetting;
stdstr FixSectionName (LPCSTR Section);
static CIniFile * m_SettingsIniFile;
static bool m_UseRegistry;
const stdstr m_Section;
const stdstr m_KeyName;
virtual LPCSTR SectionName ( void ) const;*/
static void GameChanged ( void * /*Data */ );
public:
CSettingTypeCheats(LPCSTR PostFix );
~CSettingTypeCheats();
virtual bool IndexBasedSetting ( void ) const { return true; }
virtual SettingType GetSettingType ( void ) const { return SettingType_CheatSetting; }
//return the values
virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings
virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value );
// Delete the setting
virtual void Delete ( int Index );
// Initilize this class to use ini or registry
static void Initilize ( void );
static void CleanUp ( void );
};

View File

@ -3,57 +3,220 @@
#include "SettingsType-Application.h" #include "SettingsType-Application.h"
#include "SettingsType-GameSetting.h" #include "SettingsType-GameSetting.h"
bool CSettingTypeGame::m_RdbEditor = false;
stdstr CSettingTypeGame::m_SectionIdent;
CSettingTypeGame::CSettingTypeGame(LPCSTR Section, LPCSTR Name, LPCSTR DefaultValue ) : CSettingTypeGame::CSettingTypeGame(LPCSTR Section, LPCSTR Name, LPCSTR DefaultValue ) :
CSettingTypeApplication(Section,Name,DefaultValue) CSettingTypeApplication("",FixName(Section,Name).c_str(),DefaultValue)
{ {
} }
CSettingTypeGame::CSettingTypeGame(LPCSTR Section, LPCSTR Name, DWORD DefaultValue ) : CSettingTypeGame::CSettingTypeGame(LPCSTR Section, LPCSTR Name, DWORD DefaultValue ) :
CSettingTypeApplication(Section,Name,DefaultValue) CSettingTypeApplication("",FixName(Section,Name).c_str(),DefaultValue)
{ {
} }
CSettingTypeGame::CSettingTypeGame(LPCSTR Section, LPCSTR Name, SettingID DefaultSetting ) : CSettingTypeGame::CSettingTypeGame(LPCSTR Section, LPCSTR Name, SettingID DefaultSetting ) :
CSettingTypeApplication(Section,Name,DefaultSetting) CSettingTypeApplication("",FixName(Section,Name).c_str(),DefaultSetting)
{ {
} }
bool CSettingTypeGame::Load ( bool & Value ) const CSettingTypeGame::~CSettingTypeGame()
{ {
Notify().BreakPoint(__FILE__,__LINE__);
return false;
} }
bool CSettingTypeGame::Load ( ULONG & Value ) const void CSettingTypeGame::Initilize ( void )
{ {
Notify().BreakPoint(__FILE__,__LINE__); UpdateSettings(NULL);
return false; _Settings->RegisterChangeCB(Game_IniKey,NULL,UpdateSettings);
} }
bool CSettingTypeGame::Load ( stdstr & Value ) const void CSettingTypeGame::CleanUp ( void )
{ {
Notify().BreakPoint(__FILE__,__LINE__); _Settings->UnregisterChangeCB(Game_IniKey,NULL,UpdateSettings);
return false;
} }
stdstr CSettingTypeGame::FixName ( LPCSTR Section, LPCSTR Name )
{
stdstr FixedName;
if (Section !=- NULL && strlen(Section) > 0)
{
FixedName.Format("%s-%s",Section,Name);
} else {
FixedName.Format("%s",Name);
}
return FixedName;
}
LPCSTR CSettingTypeGame::SectionName ( void ) const
{
return m_SectionIdent.c_str();
}
void CSettingTypeGame::UpdateSettings ( void * /*Data */ )
{
m_RdbEditor = _Settings->LoadBool(Setting_RdbEditor);
stdstr SectionIdent = _Settings->LoadString(Game_IniKey);
if (SectionIdent != m_SectionIdent)
{
m_SectionIdent = SectionIdent;
_Settings->SettingTypeChanged(SettingType_GameSetting);
_Settings->SettingTypeChanged(SettingType_RomDatabase);
}
}
bool CSettingTypeGame::Load ( int Index, bool & Value ) const
{
if (m_RdbEditor && _Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{
if (_Settings->IndexBasedSetting(m_DefaultSetting))
{
return _Settings->LoadBoolIndex(m_DefaultSetting,Index,Value);
} else {
return _Settings->LoadBool(m_DefaultSetting,Value);
}
}
return CSettingTypeApplication::Load(Index,Value);
}
bool CSettingTypeGame::Load ( int Index, ULONG & Value ) const
{
if (m_RdbEditor && _Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{
if (_Settings->IndexBasedSetting(m_DefaultSetting))
{
return _Settings->LoadDwordIndex(m_DefaultSetting,Index,Value);
} else {
return _Settings->LoadDword(m_DefaultSetting,Value);
}
}
return CSettingTypeApplication::Load(Index,Value);
}
bool CSettingTypeGame::Load ( int Index, stdstr & Value ) const
{
if (m_RdbEditor && _Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{
if (_Settings->IndexBasedSetting(m_DefaultSetting))
{
return _Settings->LoadStringIndex(m_DefaultSetting,Index,Value);
} else {
return _Settings->LoadString(m_DefaultSetting,Value);
}
}
return CSettingTypeApplication::Load(Index,Value);
}
//return the default values
void CSettingTypeGame::LoadDefault ( int Index, bool & Value ) const
{
if (m_RdbEditor && _Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{
if (_Settings->IndexBasedSetting(m_DefaultSetting))
{
_Settings->LoadDefaultBoolIndex(m_DefaultSetting,Index,Value);
} else {
_Settings->LoadDefaultBool(m_DefaultSetting,Value);
}
} else {
CSettingTypeApplication::LoadDefault(Index,Value);
}
}
void CSettingTypeGame::LoadDefault ( int Index, ULONG & Value ) const
{
if (m_RdbEditor && _Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{
if (_Settings->IndexBasedSetting(m_DefaultSetting))
{
_Settings->LoadDefaultDwordIndex(m_DefaultSetting,Index,Value);
} else {
_Settings->LoadDefaultDword(m_DefaultSetting,Value);
}
} else {
CSettingTypeApplication::LoadDefault(Index,Value);
}
}
void CSettingTypeGame::LoadDefault ( int Index, stdstr & Value ) const
{
if (m_RdbEditor && _Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{
if (_Settings->IndexBasedSetting(m_DefaultSetting))
{
_Settings->LoadDefaultStringIndex(m_DefaultSetting,Index,Value);
} else {
_Settings->LoadDefaultString(m_DefaultSetting,Value);
}
} else {
CSettingTypeApplication::Load(Index,Value);
}
}
//Update the settings //Update the settings
void CSettingTypeGame::Save ( bool Value ) void CSettingTypeGame::Save ( int Index, bool Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); if (m_RdbEditor && _Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{
if (_Settings->IndexBasedSetting(m_DefaultSetting))
{
_Settings->SaveBoolIndex(m_DefaultSetting,Index,Value);
} else {
_Settings->SaveBool(m_DefaultSetting,Value);
}
} else {
CSettingTypeApplication::Save(Index,Value);
}
} }
void CSettingTypeGame::Save ( ULONG Value ) void CSettingTypeGame::Save ( int Index, ULONG Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); if (m_RdbEditor && _Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{
if (_Settings->IndexBasedSetting(m_DefaultSetting))
{
_Settings->SaveDwordIndex(m_DefaultSetting,Index,Value);
} else {
_Settings->SaveDword(m_DefaultSetting,Value);
}
} else {
CSettingTypeApplication::Save(Index,Value);
}
} }
void CSettingTypeGame::Save ( const stdstr & Value ) void CSettingTypeGame::Save ( int Index, const stdstr & Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); Save(Index,Value.c_str());
} }
void CSettingTypeGame::Save ( const char * Value ) void CSettingTypeGame::Save ( int Index, const char * Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); if (m_RdbEditor && _Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{
if (_Settings->IndexBasedSetting(m_DefaultSetting))
{
_Settings->SaveStringIndex(m_DefaultSetting,Index,Value);
} else {
_Settings->SaveString(m_DefaultSetting,Value);
}
} else {
CSettingTypeApplication::Save(Index,Value);
}
}
void CSettingTypeGame::Delete ( int Index )
{
if (m_RdbEditor && _Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{
if (_Settings->IndexBasedSetting(m_DefaultSetting))
{
_Settings->DeleteSettingIndex(m_DefaultSetting,Index);
} else {
_Settings->DeleteSetting(m_DefaultSetting);
}
} else {
CSettingTypeApplication::Delete(Index);
}
} }

View File

@ -3,24 +3,44 @@
class CSettingTypeGame : class CSettingTypeGame :
public CSettingTypeApplication public CSettingTypeApplication
{ {
protected:
static bool m_RdbEditor;
static stdstr m_SectionIdent;
static void UpdateSettings ( void * /*Data */ );
static stdstr FixName ( LPCSTR Section, LPCSTR Name );
virtual LPCSTR SectionName ( void ) const;
public: public:
CSettingTypeGame(LPCSTR Section, LPCSTR Name, LPCSTR DefaultValue ); CSettingTypeGame(LPCSTR Section, LPCSTR Name, LPCSTR DefaultValue );
CSettingTypeGame(LPCSTR Section, LPCSTR Name, DWORD DefaultValue ); CSettingTypeGame(LPCSTR Section, LPCSTR Name, DWORD DefaultValue );
CSettingTypeGame(LPCSTR Section, LPCSTR Name, SettingID DefaultSetting ); CSettingTypeGame(LPCSTR Section, LPCSTR Name, SettingID DefaultSetting );
~CSettingTypeGame(); virtual ~CSettingTypeGame();
SettingLocation GetSettingsLocation ( void ) const { return SettingLocation_GameSetting; } virtual bool IndexBasedSetting ( void ) const { return false; }
virtual SettingType GetSettingType ( void ) const { return SettingType_GameSetting; }
static void Initilize ( void );
static void CleanUp ( void );
//return the values //return the values
bool Load ( bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
bool Load ( ULONG & Value ) const; virtual bool Load ( int Index, ULONG & Value ) const;
bool Load ( stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( bool Value ); virtual void Save ( int Index, bool Value );
void Save ( ULONG Value ); virtual void Save ( int Index, ULONG Value );
void Save ( const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
void Save ( const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting
virtual void Delete ( int Index );
}; };

View File

@ -0,0 +1,93 @@
#include "..\..\Settings.h"
#include "..\..\User Interface.h"
#include "SettingsType-Application.h"
#include "SettingsType-GameSetting.h"
#include "SettingsType-GameSettingIndex.h"
CSettingTypeGameIndex::CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, SettingID DefaultSetting ) :
CSettingTypeGame("","", DefaultSetting),
m_PreIndex(PreIndex),
m_PostIndex(PostIndex)
{
}
CSettingTypeGameIndex::CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, DWORD DefaultValue ) :
CSettingTypeGame("","", DefaultValue),
m_PreIndex(PreIndex),
m_PostIndex(PostIndex)
{
}
CSettingTypeGameIndex::CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, LPCSTR DefaultValue ) :
CSettingTypeGame("","", DefaultValue),
m_PreIndex(PreIndex),
m_PostIndex(PostIndex)
{
}
CSettingTypeGameIndex::~CSettingTypeGameIndex()
{
}
bool CSettingTypeGameIndex::Load ( int Index, bool & Value ) const
{
m_KeyNameIdex.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str());
return CSettingTypeGame::Load(Index,Value);
}
bool CSettingTypeGameIndex::Load ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeGameIndex::Load ( int Index, stdstr & Value ) const
{
m_KeyNameIdex.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str());
return CSettingTypeGame::Load(0,Value);
}
//return the default values
void CSettingTypeGameIndex::LoadDefault ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeGameIndex::LoadDefault ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeGameIndex::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
//Update the settings
void CSettingTypeGameIndex::Save ( int Index, bool Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeGameIndex::Save ( int Index, ULONG Value )
{
m_KeyNameIdex.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str());
CSettingTypeGame::Save(0,Value);
}
void CSettingTypeGameIndex::Save ( int Index, const stdstr & Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeGameIndex::Save ( int Index, const char * Value )
{
m_KeyNameIdex.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str());
CSettingTypeGame::Save(0,Value);
}
void CSettingTypeGameIndex::Delete ( int Index )
{
Notify().BreakPoint(__FILE__,__LINE__);
}

View File

@ -0,0 +1,36 @@
#pragma once
class CSettingTypeGameIndex :
public CSettingTypeGame
{
stdstr m_PreIndex, m_PostIndex;
public:
CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, LPCSTR DefaultValue );
CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, DWORD DefaultValue );
CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, SettingID DefaultSetting );
~CSettingTypeGameIndex();
virtual bool IndexBasedSetting ( void ) const { return true; }
virtual SettingType GetSettingType ( void ) const { return SettingType_GameSetting; }
//return the values
virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings
virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value );
// Delete the setting
virtual void Delete ( int Index );
};

View File

@ -0,0 +1,109 @@
#include "..\..\Settings.h"
#include "..\..\User Interface.h"
#include "SettingsType-RomDatabase.h"
#include "SettingsType-RDBCpuType.h"
CSettingTypeRDBCpuType::CSettingTypeRDBCpuType(LPCSTR Name, SettingID DefaultSetting ) :
CSettingTypeRomDatabase(Name,DefaultSetting)
{
}
CSettingTypeRDBCpuType::CSettingTypeRDBCpuType(LPCSTR Name, int DefaultValue ) :
CSettingTypeRomDatabase(Name,DefaultValue)
{
}
CSettingTypeRDBCpuType::~CSettingTypeRDBCpuType()
{
}
bool CSettingTypeRDBCpuType::Load ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeRDBCpuType::Load ( int Index, ULONG & Value ) const
{
stdstr strValue;
bool bRes = m_SettingsIniFile->GetString(m_SectionIdent.c_str(),m_KeyName.c_str(),m_DefaultStr,strValue);
if (!bRes)
{
LoadDefault(Index,Value);
return false;
}
LPCSTR String = strValue.c_str();
if (strcmp(String,"Interpreter") == 0) { Value = CPU_Interpreter; }
else if (strcmp(String,"Recompiler") == 0) { Value = CPU_Recompiler; }
else if (strcmp(String,"SyncCores") == 0) { Value = CPU_SyncCores; }
else { Notify().BreakPoint(__FILE__,__LINE__); }
return true;
}
bool CSettingTypeRDBCpuType::Load ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
//return the default values
void CSettingTypeRDBCpuType::LoadDefault ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBCpuType::LoadDefault ( int Index, ULONG & Value ) const
{
if (m_DefaultSetting != Default_None)
{
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue;
} else {
_Settings->LoadDword(m_DefaultSetting,Value);
}
}
}
void CSettingTypeRDBCpuType::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
//Update the settings
void CSettingTypeRDBCpuType::Save ( int Index, bool Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBCpuType::Save ( int Index, ULONG Value )
{
stdstr strValue;
switch (Value)
{
case CPU_Interpreter: strValue = "Interpreter"; break;
case CPU_Recompiler: strValue = "Recompiler"; break;
case CPU_SyncCores: strValue = "SyncCores"; break;
default:
Notify().BreakPoint(__FILE__,__LINE__);
}
m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),strValue.c_str());
}
void CSettingTypeRDBCpuType::Save ( int Index, const stdstr & Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBCpuType::Save ( int Index, const char * Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBCpuType::Delete( int Index )
{
m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),NULL);
}

View File

@ -0,0 +1,31 @@
#pragma once
class CSettingTypeRDBCpuType :
public CSettingTypeRomDatabase
{
public:
CSettingTypeRDBCpuType(LPCSTR Name, SettingID DefaultSetting );
CSettingTypeRDBCpuType(LPCSTR Name, int DefaultValue );
~CSettingTypeRDBCpuType();
//return the values
virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings
virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value );
// Delete the setting
virtual void Delete ( int Index );
};

View File

@ -0,0 +1,99 @@
#include "..\..\Settings.h"
#include "..\..\User Interface.h"
#include "SettingsType-RomDatabase.h"
#include "SettingsType-RDBOnOff.h"
CSettingTypeRDBOnOff::CSettingTypeRDBOnOff(LPCSTR Name, SettingID DefaultSetting ) :
CSettingTypeRomDatabase(Name,DefaultSetting)
{
}
CSettingTypeRDBOnOff::CSettingTypeRDBOnOff(LPCSTR Name, int DefaultValue ) :
CSettingTypeRomDatabase(Name,DefaultValue)
{
}
CSettingTypeRDBOnOff::~CSettingTypeRDBOnOff()
{
}
bool CSettingTypeRDBOnOff::Load ( int Index, bool & Value ) const
{
stdstr strValue;
bool bRes = m_SettingsIniFile->GetString(m_SectionIdent.c_str(),m_KeyName.c_str(),m_DefaultStr,strValue);
if (!bRes)
{
LoadDefault(Index,Value);
return false;
}
LPCSTR String = strValue.c_str();
if (strcmp(String,"On") == 0) { Value = true; }
else if (strcmp(String,"Off") == 0) { Value = false; }
else if (strcmp(String,"Global") == 0)
{
LoadDefault(Index,Value);
return false;
}
else { Notify().BreakPoint(__FILE__,__LINE__); }
return true;
}
bool CSettingTypeRDBOnOff::Load ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeRDBOnOff::Load ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
//return the default values
void CSettingTypeRDBOnOff::LoadDefault ( int Index, bool & Value ) const
{
if (m_DefaultSetting != Default_None)
{
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue != 0;
} else {
_Settings->LoadBool(m_DefaultSetting,Value);
}
}
}
void CSettingTypeRDBOnOff::LoadDefault ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBOnOff::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
//Update the settings
void CSettingTypeRDBOnOff::Save ( int Index, bool Value )
{
m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),Value? "On" : "Off");
}
void CSettingTypeRDBOnOff::Save ( int Index, ULONG Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBOnOff::Save ( int Index, const stdstr & Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBOnOff::Save ( int Index, const char * Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}

View File

@ -0,0 +1,28 @@
#pragma once
class CSettingTypeRDBOnOff :
public CSettingTypeRomDatabase
{
public:
CSettingTypeRDBOnOff(LPCSTR Name, SettingID DefaultSetting );
CSettingTypeRDBOnOff(LPCSTR Name, int DefaultValue );
~CSettingTypeRDBOnOff();
//return the values
virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings
virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value );
};

View File

@ -0,0 +1,91 @@
#include "..\..\Settings.h"
#include "..\..\User Interface.h"
#include "SettingsType-RomDatabase.h"
#include "SettingsType-RDBRamSize.h"
// == 8 ? 0x800000 : 0x400000
CSettingTypeRDBRDRamSize::CSettingTypeRDBRDRamSize(LPCSTR Name, SettingID DefaultSetting ) :
CSettingTypeRomDatabase(Name,DefaultSetting)
{
}
CSettingTypeRDBRDRamSize::CSettingTypeRDBRDRamSize(LPCSTR Name, int DefaultValue ) :
CSettingTypeRomDatabase(Name,DefaultValue)
{
}
CSettingTypeRDBRDRamSize::~CSettingTypeRDBRDRamSize()
{
}
bool CSettingTypeRDBRDRamSize::Load ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeRDBRDRamSize::Load ( int Index, ULONG & Value ) const
{
ULONG ulValue;
bool bRes = m_SettingsIniFile->GetNumber(m_SectionIdent.c_str(),m_KeyName.c_str(),m_DefaultValue,ulValue);
if (!bRes)
{
LoadDefault(Index,ulValue);
}
Value = 0x400000;
if (ulValue == 8)
{
Value = 0x800000;
}
return bRes;
}
bool CSettingTypeRDBRDRamSize::Load ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
//return the default values
void CSettingTypeRDBRDRamSize::LoadDefault ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBRDRamSize::LoadDefault ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBRDRamSize::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
//Update the settings
void CSettingTypeRDBRDRamSize::Save ( int Index, bool Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBRDRamSize::Save ( int Index, ULONG Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBRDRamSize::Save ( int Index, const stdstr & Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBRDRamSize::Save ( int Index, const char * Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBRDRamSize::Delete( int Index )
{
Notify().BreakPoint(__FILE__,__LINE__);
}

View File

@ -0,0 +1,31 @@
#pragma once
class CSettingTypeRDBRDRamSize :
public CSettingTypeRomDatabase
{
public:
CSettingTypeRDBRDRamSize(LPCSTR Name, SettingID DefaultSetting );
CSettingTypeRDBRDRamSize(LPCSTR Name, int DefaultValue );
~CSettingTypeRDBRDRamSize();
//return the values
virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings
virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value );
// Delete the setting
virtual void Delete ( int Index );
};

View File

@ -0,0 +1,110 @@
#include "..\..\Settings.h"
#include "..\..\User Interface.h"
#include "SettingsType-RomDatabase.h"
#include "SettingsType-RDBSaveChip.h"
CSettingTypeRDBSaveChip::CSettingTypeRDBSaveChip(LPCSTR Name, SettingID DefaultSetting ) :
CSettingTypeRomDatabase(Name,DefaultSetting)
{
}
CSettingTypeRDBSaveChip::CSettingTypeRDBSaveChip(LPCSTR Name, int DefaultValue ) :
CSettingTypeRomDatabase(Name,DefaultValue)
{
}
CSettingTypeRDBSaveChip::~CSettingTypeRDBSaveChip()
{
}
bool CSettingTypeRDBSaveChip::Load ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeRDBSaveChip::Load ( int Index, ULONG & Value ) const
{
stdstr strValue;
bool bRes = m_SettingsIniFile->GetString(m_SectionIdent.c_str(),m_KeyName.c_str(),m_DefaultStr,strValue);
if (!bRes)
{
LoadDefault(Index,Value);
return false;
}
LPCSTR String = strValue.c_str();
if (strcmp(String,"First Save Type") == 0) { Value = SaveChip_Auto; }
else if (strcmp(String,"4kbit Eeprom") == 0) { Value = SaveChip_Eeprom_4K; }
else if (strcmp(String,"16kbit Eeprom") == 0) { Value = SaveChip_Eeprom_16K; }
else if (strcmp(String,"Sram") == 0) { Value = SaveChip_Sram; }
else if (strcmp(String,"FlashRam") == 0) { Value = SaveChip_FlashRam; }
else { Notify().BreakPoint(__FILE__,__LINE__); }
return true;
}
bool CSettingTypeRDBSaveChip::Load ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
//return the default values
void CSettingTypeRDBSaveChip::LoadDefault ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBSaveChip::LoadDefault ( int Index, ULONG & Value ) const
{
if (m_DefaultSetting != Default_None)
{
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue;
} else {
_Settings->LoadDword(m_DefaultSetting,Value);
}
}
}
void CSettingTypeRDBSaveChip::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
//Update the settings
void CSettingTypeRDBSaveChip::Save ( int Index, bool Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBSaveChip::Save ( int Index, ULONG Value )
{
switch (Value)
{
case SaveChip_Auto: m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),"First Save Type"); break;
case SaveChip_Eeprom_4K: m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),"4kbit Eeprom"); break;
case SaveChip_Eeprom_16K: m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),"16kbit Eeprom"); break;
case SaveChip_Sram: m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),"Sram"); break;
case SaveChip_FlashRam: m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),"FlashRam"); break;
default:
Notify().BreakPoint(__FILE__,__LINE__);
}
}
void CSettingTypeRDBSaveChip::Save ( int Index, const stdstr & Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBSaveChip::Save ( int Index, const char * Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBSaveChip::Delete( int Index )
{
m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),NULL);
}

View File

@ -0,0 +1,31 @@
#pragma once
class CSettingTypeRDBSaveChip :
public CSettingTypeRomDatabase
{
public:
CSettingTypeRDBSaveChip(LPCSTR Name, SettingID DefaultSetting );
CSettingTypeRDBSaveChip(LPCSTR Name, int DefaultValue );
~CSettingTypeRDBSaveChip();
//return the values
virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings
virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value );
// Delete the setting
virtual void Delete ( int Index );
};

View File

@ -0,0 +1,94 @@
#include "..\..\Settings.h"
#include "..\..\User Interface.h"
#include "SettingsType-RomDatabase.h"
#include "SettingsType-RDBYesNo.h"
CSettingTypeRDBYesNo::CSettingTypeRDBYesNo(LPCSTR Name, SettingID DefaultSetting ) :
CSettingTypeRomDatabase(Name,DefaultSetting)
{
}
CSettingTypeRDBYesNo::CSettingTypeRDBYesNo(LPCSTR Name, int DefaultValue ) :
CSettingTypeRomDatabase(Name,DefaultValue)
{
}
CSettingTypeRDBYesNo::~CSettingTypeRDBYesNo()
{
}
bool CSettingTypeRDBYesNo::Load ( int Index, bool & Value ) const
{
stdstr strValue;
bool bRes = m_SettingsIniFile->GetString(m_SectionIdent.c_str(),m_KeyName.c_str(),m_DefaultStr,strValue);
if (!bRes)
{
LoadDefault(Index,Value);
return false;
}
LPCSTR String = strValue.c_str();
if (strcmp(String,"Yes") == 0) { Value = true; }
else if (strcmp(String,"No") == 0) { Value = false; }
else { Notify().BreakPoint(__FILE__,__LINE__); }
return true;
}
bool CSettingTypeRDBYesNo::Load ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeRDBYesNo::Load ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
//return the default values
void CSettingTypeRDBYesNo::LoadDefault ( int Index, bool & Value ) const
{
if (m_DefaultSetting != Default_None)
{
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue != 0;
} else {
_Settings->LoadBool(m_DefaultSetting,Value);
}
}
}
void CSettingTypeRDBYesNo::LoadDefault ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBYesNo::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
//Update the settings
void CSettingTypeRDBYesNo::Save ( int Index, bool Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBYesNo::Save ( int Index, ULONG Value )
{
m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),Value? "Yes" : "No");
}
void CSettingTypeRDBYesNo::Save ( int Index, const stdstr & Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRDBYesNo::Save ( int Index, const char * Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}

View File

@ -0,0 +1,28 @@
#pragma once
class CSettingTypeRDBYesNo :
public CSettingTypeRomDatabase
{
public:
CSettingTypeRDBYesNo(LPCSTR Name, SettingID DefaultSetting );
CSettingTypeRDBYesNo(LPCSTR Name, int DefaultValue );
~CSettingTypeRDBYesNo();
//return the values
virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings
virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value );
};

View File

@ -1,4 +1,5 @@
#include "..\..\Settings.h" #include "..\..\Settings.h"
#include "..\..\User Interface.h"
#include "SettingsType-RelativePath.h" #include "SettingsType-RelativePath.h"
CSettingTypeRelativePath::CSettingTypeRelativePath(LPCSTR Path, LPCSTR FileName) CSettingTypeRelativePath::CSettingTypeRelativePath(LPCSTR Path, LPCSTR FileName)
@ -13,6 +14,32 @@ bool CSettingTypeRelativePath::Load ( int Index, stdstr & value ) const
return true; return true;
} }
//return the default values
void CSettingTypeRelativePath::LoadDefault ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRelativePath::LoadDefault ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRelativePath::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRelativePath::Save ( int Index, bool Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRelativePath::Save ( int Index, ULONG Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRelativePath::Save ( int Index, const stdstr & Value ) void CSettingTypeRelativePath::Save ( int Index, const stdstr & Value )
{ {
m_FileName = CPath(CPath::MODULE_DIRECTORY,Value); m_FileName = CPath(CPath::MODULE_DIRECTORY,Value);
@ -23,4 +50,7 @@ void CSettingTypeRelativePath::Save ( int Index, const char * Value )
m_FileName = CPath(CPath::MODULE_DIRECTORY,Value); m_FileName = CPath(CPath::MODULE_DIRECTORY,Value);
} }
void CSettingTypeRelativePath::Delete ( int Index )
{
Notify().BreakPoint(__FILE__,__LINE__);
}

View File

@ -10,18 +10,25 @@ public:
~CSettingTypeRelativePath(); ~CSettingTypeRelativePath();
bool IndexBasedSetting ( void ) const { return false; } bool IndexBasedSetting ( void ) const { return false; }
SettingLocation GetSettingsLocation ( void ) const { return SettingLocation_RelativePath; } SettingType GetSettingType ( void ) const { return SettingType_RelativePath; }
//return the values //return the values
bool Load ( int Index, bool & Value ) const { return false; }; bool Load ( int Index, bool & Value ) const { return false; };
bool Load ( int Index, ULONG & Value ) const { return false; }; bool Load ( int Index, ULONG & Value ) const { return false; };
bool Load ( int Index, stdstr & Value ) const; bool Load ( int Index, stdstr & Value ) const;
//return the default values
void LoadDefault ( int Index, bool & Value ) const;
void LoadDefault ( int Index, ULONG & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ) {}; void Save ( int Index, bool Value );
void Save ( int Index, ULONG Value ) {}; void Save ( int Index, ULONG Value );
void Save ( int Index, const stdstr & Value ); void Save ( int Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int Index, const char * Value );
// Delete the setting
void Delete ( int Index );
}; };

View File

@ -9,7 +9,7 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(LPCSTR Name, int DefaultValue )
m_KeyName(Name), m_KeyName(Name),
m_DefaultStr(""), m_DefaultStr(""),
m_DefaultValue(DefaultValue), m_DefaultValue(DefaultValue),
m_DefaultSetting(No_Default) m_DefaultSetting(Default_Constant)
{ {
} }
@ -17,7 +17,7 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(LPCSTR Name, bool DefaultValue
m_KeyName(Name), m_KeyName(Name),
m_DefaultStr(""), m_DefaultStr(""),
m_DefaultValue(DefaultValue), m_DefaultValue(DefaultValue),
m_DefaultSetting(No_Default) m_DefaultSetting(Default_Constant)
{ {
} }
@ -25,7 +25,7 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(LPCSTR Name, LPCSTR DefaultValu
m_KeyName(Name), m_KeyName(Name),
m_DefaultStr(DefaultValue), m_DefaultStr(DefaultValue),
m_DefaultValue(0), m_DefaultValue(0),
m_DefaultSetting(No_Default) m_DefaultSetting(Default_Constant)
{ {
} }
@ -37,18 +37,22 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(LPCSTR Name, SettingID DefaultS
{ {
} }
CSettingTypeRomDatabase::~CSettingTypeRomDatabase()
{
}
void CSettingTypeRomDatabase::Initilize( void ) void CSettingTypeRomDatabase::Initilize( void )
{ {
m_SettingsIniFile = new CIniFile(_Settings->LoadString(RomDatabaseFile).c_str()); m_SettingsIniFile = new CIniFile(_Settings->LoadString(SupportFile_RomDatabase).c_str());
_Settings->RegisterChangeCB(ROM_IniKey,NULL,GameChanged); _Settings->RegisterChangeCB(Game_IniKey,NULL,GameChanged);
m_SectionIdent = _Settings->LoadString(ROM_IniKey); m_SectionIdent = _Settings->LoadString(Game_IniKey);
} }
void CSettingTypeRomDatabase::CleanUp( void ) void CSettingTypeRomDatabase::CleanUp( void )
{ {
_Settings->UnregisterChangeCB(Game_IniKey,NULL,GameChanged);
if (m_SettingsIniFile) if (m_SettingsIniFile)
{ {
delete m_SettingsIniFile; delete m_SettingsIniFile;
@ -58,45 +62,93 @@ void CSettingTypeRomDatabase::CleanUp( void )
void CSettingTypeRomDatabase::GameChanged ( void * /*Data */ ) void CSettingTypeRomDatabase::GameChanged ( void * /*Data */ )
{ {
m_SectionIdent = _Settings->LoadString(ROM_IniKey); m_SectionIdent = _Settings->LoadString(Game_IniKey);
} }
bool CSettingTypeRomDatabase::Load ( int Index, bool & Value ) const bool CSettingTypeRomDatabase::Load ( int Index, bool & Value ) const
{ {
Notify().BreakPoint(__FILE__,__LINE__); DWORD temp_value = Value;
return false; bool bRes = Load(Index,temp_value);
Value = temp_value != 0;
return bRes;
} }
bool CSettingTypeRomDatabase::Load ( int Index, ULONG & Value ) const bool CSettingTypeRomDatabase::Load ( int Index, ULONG & Value ) const
{ {
if (m_SectionIdent.empty()) bool bRes = m_SettingsIniFile->GetNumber(m_SectionIdent.c_str(),m_KeyName.c_str(),Value,Value);
if (!bRes)
{ {
return false; LoadDefault(Index,Value);
} }
Notify().BreakPoint(__FILE__,__LINE__); return bRes;
return false;
} }
bool CSettingTypeRomDatabase::Load ( int Index, stdstr & Value ) const bool CSettingTypeRomDatabase::Load ( int Index, stdstr & Value ) const
{ {
bool bRes = m_SettingsIniFile->GetString(m_SectionIdent.c_str(),m_KeyName,m_DefaultStr,Value); stdstr temp_value;
if (!bRes && m_DefaultSetting != No_Default) bool bRes = m_SettingsIniFile->GetString(m_SectionIdent.c_str(),m_KeyName.c_str(),m_DefaultStr,temp_value);
if (bRes)
{ {
_Settings->LoadString(m_DefaultSetting,Value); Value = temp_value;
}
else
{
LoadDefault(Index,Value);
} }
return bRes; return bRes;
} }
//return the default values
void CSettingTypeRomDatabase::LoadDefault ( int Index, bool & Value ) const
{
if (m_DefaultSetting != Default_None)
{
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue != 0;
} else {
_Settings->LoadBool(m_DefaultSetting,Value);
}
}
}
void CSettingTypeRomDatabase::LoadDefault ( int Index, ULONG & Value ) const
{
if (m_DefaultSetting != Default_None)
{
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultValue;
} else {
_Settings->LoadDword(m_DefaultSetting,Value);
}
}
}
void CSettingTypeRomDatabase::LoadDefault ( int Index, stdstr & Value ) const
{
if (m_DefaultSetting != Default_None)
{
if (m_DefaultSetting == Default_Constant)
{
Value = m_DefaultStr;
} else {
_Settings->LoadString(m_DefaultSetting,Value);
}
}
}
//Update the settings //Update the settings
void CSettingTypeRomDatabase::Save ( int Index, bool Value ) void CSettingTypeRomDatabase::Save ( int Index, bool Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); m_SettingsIniFile->SaveNumber(m_SectionIdent.c_str(),m_KeyName.c_str(),Value);
} }
void CSettingTypeRomDatabase::Save ( int Index, ULONG Value ) void CSettingTypeRomDatabase::Save ( int Index, ULONG Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); m_SettingsIniFile->SaveNumber(m_SectionIdent.c_str(),m_KeyName.c_str(),Value);
} }
void CSettingTypeRomDatabase::Save ( int Index, const stdstr & Value ) void CSettingTypeRomDatabase::Save ( int Index, const stdstr & Value )
@ -108,3 +160,8 @@ void CSettingTypeRomDatabase::Save ( int Index, const char * Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
} }
void CSettingTypeRomDatabase::Delete ( int Index )
{
m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),NULL);
}

View File

@ -3,16 +3,12 @@
class CSettingTypeRomDatabase : class CSettingTypeRomDatabase :
public CSettingType public CSettingType
{ {
protected:
const LPCSTR m_KeyName; mutable stdstr m_KeyName;
const LPCSTR m_DefaultStr; const LPCSTR m_DefaultStr;
const int m_DefaultValue; const int m_DefaultValue;
const SettingID m_DefaultSetting; const SettingID m_DefaultSetting;
/*
static bool m_UseRegistry;
stdstr m_SectionIdent;*/
static stdstr m_SectionIdent; static stdstr m_SectionIdent;
static CIniFile * m_SettingsIniFile; static CIniFile * m_SettingsIniFile;
@ -23,22 +19,31 @@ public:
CSettingTypeRomDatabase(LPCSTR Name, bool DefaultValue ); CSettingTypeRomDatabase(LPCSTR Name, bool DefaultValue );
CSettingTypeRomDatabase(LPCSTR Name, int DefaultValue ); CSettingTypeRomDatabase(LPCSTR Name, int DefaultValue );
CSettingTypeRomDatabase(LPCSTR Name, SettingID DefaultSetting ); CSettingTypeRomDatabase(LPCSTR Name, SettingID DefaultSetting );
~CSettingTypeRomDatabase();
virtual ~CSettingTypeRomDatabase();
virtual bool IndexBasedSetting ( void ) const { return false; } virtual bool IndexBasedSetting ( void ) const { return false; }
virtual SettingLocation GetSettingsLocation ( void ) const { return SettingLocation_RomDatabase; } virtual SettingType GetSettingType ( void ) const { return SettingType_RomDatabase; }
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting
virtual void Delete ( int Index );
static void Initilize ( void ); static void Initilize ( void );
static void CleanUp ( void ); static void CleanUp ( void );
}; };

View File

@ -0,0 +1,97 @@
#include "..\..\Settings.h"
#include "..\..\User Interface.h"
#include "SettingsType-RomDatabase.h"
#include "SettingsType-RomDatabaseIndex.h"
CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, LPCSTR DefaultValue ) :
CSettingTypeRomDatabase("",DefaultValue),
m_PreIndex(PreIndex),
m_PostIndex(PostIndex)
{
}
CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, bool DefaultValue ) :
CSettingTypeRomDatabase("",DefaultValue),
m_PreIndex(PreIndex),
m_PostIndex(PostIndex)
{
}
CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, int DefaultValue ) :
CSettingTypeRomDatabase("",DefaultValue),
m_PreIndex(PreIndex),
m_PostIndex(PostIndex)
{
}
CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, SettingID DefaultSetting ) :
CSettingTypeRomDatabase("",DefaultSetting),
m_PreIndex(PreIndex),
m_PostIndex(PostIndex)
{
}
CSettingTypeRomDatabaseIndex::~CSettingTypeRomDatabaseIndex()
{
}
bool CSettingTypeRomDatabaseIndex::Load ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeRomDatabaseIndex::Load ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeRomDatabaseIndex::Load ( int Index, stdstr & Value ) const
{
m_KeyName.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str());
return CSettingTypeRomDatabase::Load(0,Value);
}
void CSettingTypeRomDatabaseIndex::LoadDefault ( int Index, bool & Value ) const
{
m_KeyName.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str());
CSettingTypeRomDatabase::LoadDefault(0,Value);
}
void CSettingTypeRomDatabaseIndex::LoadDefault ( int Index, ULONG & Value ) const
{
m_KeyName.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str());
CSettingTypeRomDatabase::LoadDefault(0,Value);
}
void CSettingTypeRomDatabaseIndex::LoadDefault ( int Index, stdstr & Value ) const
{
m_KeyName.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str());
CSettingTypeRomDatabase::LoadDefault(0,Value);
}
void CSettingTypeRomDatabaseIndex::Save ( int Index, bool Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRomDatabaseIndex::Save ( int Index, ULONG Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRomDatabaseIndex::Save ( int Index, const stdstr & Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRomDatabaseIndex::Save ( int Index, const char * Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeRomDatabaseIndex::Delete ( int Index )
{
m_SettingsIniFile->SaveString(m_SectionIdent.c_str(),m_KeyName.c_str(),NULL);
}

View File

@ -0,0 +1,37 @@
#pragma once
class CSettingTypeRomDatabaseIndex :
public CSettingTypeRomDatabase
{
stdstr m_PreIndex, m_PostIndex;
public:
CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, LPCSTR DefaultValue );
CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, bool DefaultValue );
CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, int DefaultValue );
CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, SettingID DefaultSetting );
virtual ~CSettingTypeRomDatabaseIndex();
virtual bool IndexBasedSetting ( void ) const { return true; }
//return the values
virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings
virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value );
// Delete the setting
virtual void Delete ( int Index );
};

View File

@ -0,0 +1,77 @@
#include "..\..\Settings.h"
#include "..\..\User Interface.h"
#include "SettingsType-SelectedDirectory.h"
CSettingTypeSelectedDirectory::CSettingTypeSelectedDirectory(SettingID InitialDir, SettingID SelectedDir, SettingID UseSelected ) :
m_InitialDir(InitialDir),
m_SelectedDir(SelectedDir),
m_UseSelected(UseSelected)
{
}
CSettingTypeSelectedDirectory::~CSettingTypeSelectedDirectory()
{
}
bool CSettingTypeSelectedDirectory::Load ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeSelectedDirectory::Load ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
return false;
}
bool CSettingTypeSelectedDirectory::Load ( int Index, stdstr & Value ) const
{
SettingID DirSettingId = _Settings->LoadBool(m_UseSelected) ? m_SelectedDir : m_InitialDir;
return _Settings->LoadString(DirSettingId, Value);
}
//return the default values
void CSettingTypeSelectedDirectory::LoadDefault ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeSelectedDirectory::LoadDefault ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeSelectedDirectory::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
//Update the settings
void CSettingTypeSelectedDirectory::Save ( int Index, bool Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeSelectedDirectory::Save ( int Index, ULONG Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeSelectedDirectory::Save ( int Index, const stdstr & Value )
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeSelectedDirectory::Save ( int Index, const char * Value )
{
_Settings->SaveBool(m_UseSelected,true);
_Settings->SaveString(m_SelectedDir,Value);
}
void CSettingTypeSelectedDirectory::Delete( int Index )
{
Notify().BreakPoint(__FILE__,__LINE__);
}

View File

@ -0,0 +1,36 @@
#pragma once
class CSettingTypeSelectedDirectory :
public CSettingType
{
SettingID m_InitialDir;
SettingID m_SelectedDir;
SettingID m_UseSelected;
public:
CSettingTypeSelectedDirectory(SettingID InitialDir, SettingID SelectedDir, SettingID UseSelected );
~CSettingTypeSelectedDirectory();
virtual bool IndexBasedSetting ( void ) const { return false; }
virtual SettingType GetSettingType ( void ) const { return SettingType_SelectedDirectory; }
//return the values
virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values
virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings
virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value );
virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value );
// Delete the setting
virtual void Delete ( int Index );
};

View File

@ -25,11 +25,27 @@ bool CSettingTypeTempBool::Load ( int Index, stdstr & Value ) const
return false; return false;
} }
void CSettingTypeTempBool::Save ( int Index, bool Value ) //return the default values
void CSettingTypeTempBool::LoadDefault ( int Index, bool & Value ) const
{ {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
} }
void CSettingTypeTempBool::LoadDefault ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeTempBool::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeTempBool::Save ( int Index, bool Value )
{
m_value = Value;
}
void CSettingTypeTempBool::Save ( int Index, ULONG Value ) void CSettingTypeTempBool::Save ( int Index, ULONG Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
@ -44,3 +60,8 @@ void CSettingTypeTempBool::Save ( int Index, const char * Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
} }
void CSettingTypeTempBool::Delete( int Index )
{
Notify().BreakPoint(__FILE__,__LINE__);
}

View File

@ -10,17 +10,25 @@ public:
~CSettingTypeTempBool(); ~CSettingTypeTempBool();
bool IndexBasedSetting ( void ) const { return false; } bool IndexBasedSetting ( void ) const { return false; }
SettingLocation GetSettingsLocation ( void ) const { return SettingLocation_BoolVariable; } SettingType GetSettingType ( void ) const { return SettingType_BoolVariable; }
//return the values //return the values
bool Load ( int Index, bool & Value ) const; bool Load ( int Index, bool & Value ) const;
bool Load ( int Index, ULONG & Value ) const; bool Load ( int Index, ULONG & Value ) const;
bool Load ( int Index, stdstr & Value ) const; bool Load ( int Index, stdstr & Value ) const;
//return the default values
void LoadDefault ( int Index, bool & Value ) const;
void LoadDefault ( int Index, ULONG & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ); void Save ( int Index, bool Value );
void Save ( int Index, ULONG Value ); void Save ( int Index, ULONG Value );
void Save ( int Index, const stdstr & Value ); void Save ( int Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int Index, const char * Value );
// Delete the setting
void Delete ( int Index );
}; };

View File

@ -25,6 +25,22 @@ bool CSettingTypeTempNumber::Load ( int Index, stdstr & Value ) const
return false; return false;
} }
//return the default values
void CSettingTypeTempNumber::LoadDefault ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeTempNumber::LoadDefault ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeTempNumber::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeTempNumber::Save ( int Index, bool Value ) void CSettingTypeTempNumber::Save ( int Index, bool Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
@ -32,7 +48,7 @@ void CSettingTypeTempNumber::Save ( int Index, bool Value )
void CSettingTypeTempNumber::Save ( int Index, ULONG Value ) void CSettingTypeTempNumber::Save ( int Index, ULONG Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); m_value = Value;
} }
void CSettingTypeTempNumber::Save ( int Index, const stdstr & Value ) void CSettingTypeTempNumber::Save ( int Index, const stdstr & Value )
@ -44,3 +60,8 @@ void CSettingTypeTempNumber::Save ( int Index, const char * Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
} }
void CSettingTypeTempNumber::Delete( int Index )
{
Notify().BreakPoint(__FILE__,__LINE__);
}

View File

@ -11,18 +11,25 @@ public:
~CSettingTypeTempNumber(); ~CSettingTypeTempNumber();
bool IndexBasedSetting ( void ) const { return false; } bool IndexBasedSetting ( void ) const { return false; }
SettingLocation GetSettingsLocation ( void ) const { return SettingLocation_NumberVariable; } SettingType GetSettingType ( void ) const { return SettingType_NumberVariable; }
//return the values //return the values
bool Load ( int Index, bool & Value ) const; bool Load ( int Index, bool & Value ) const;
bool Load ( int Index, ULONG & Value ) const; bool Load ( int Index, ULONG & Value ) const;
bool Load ( int Index, stdstr & Value ) const; bool Load ( int Index, stdstr & Value ) const;
//return the default values
void LoadDefault ( int Index, bool & Value ) const;
void LoadDefault ( int Index, ULONG & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ); void Save ( int Index, bool Value );
void Save ( int Index, ULONG Value ); void Save ( int Index, ULONG Value );
void Save ( int Index, const stdstr & Value ); void Save ( int Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int Index, const char * Value );
// Delete the setting
void Delete ( int Index );
}; };

View File

@ -25,6 +25,22 @@ bool CSettingTypeTempString::Load ( int Index, stdstr & Value ) const
return true; return true;
} }
//return the default values
void CSettingTypeTempString::LoadDefault ( int Index, bool & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeTempString::LoadDefault ( int Index, ULONG & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeTempString::LoadDefault ( int Index, stdstr & Value ) const
{
Notify().BreakPoint(__FILE__,__LINE__);
}
void CSettingTypeTempString::Save ( int Index, bool Value ) void CSettingTypeTempString::Save ( int Index, bool Value )
{ {
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
@ -44,3 +60,8 @@ void CSettingTypeTempString::Save ( int Index, const char * Value )
{ {
m_value = Value; m_value = Value;
} }
void CSettingTypeTempString::Delete( int Index )
{
Notify().BreakPoint(__FILE__,__LINE__);
}

View File

@ -11,18 +11,25 @@ public:
~CSettingTypeTempString(); ~CSettingTypeTempString();
bool IndexBasedSetting ( void ) const { return false; } bool IndexBasedSetting ( void ) const { return false; }
SettingLocation GetSettingsLocation ( void ) const { return SettingLocation_StringVariable; } SettingType GetSettingType ( void ) const { return SettingType_StringVariable; }
//return the values //return the values
bool Load ( int Index, bool & Value ) const; bool Load ( int Index, bool & Value ) const;
bool Load ( int Index, ULONG & Value ) const; bool Load ( int Index, ULONG & Value ) const;
bool Load ( int Index, stdstr & Value ) const; bool Load ( int Index, stdstr & Value ) const;
//return the default values
void LoadDefault ( int Index, bool & Value ) const;
void LoadDefault ( int Index, ULONG & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ); void Save ( int Index, bool Value );
void Save ( int Index, ULONG Value ); void Save ( int Index, ULONG Value );
void Save ( int Index, const stdstr & Value ); void Save ( int Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int Index, const char * Value );
// Delete the setting
void Delete ( int Index );
}; };

File diff suppressed because it is too large Load Diff

View File

@ -217,9 +217,6 @@ public:
bool Initilize ( const char * AppName ); bool Initilize ( const char * AppName );
// void Config (void * ParentWindow, CN64System * System, CMainGui * Gui);
// void ConfigRom (void * ParentWindow, CMainGui * Gui);
//return the values //return the values
bool LoadBool ( SettingID Type ); bool LoadBool ( SettingID Type );
bool LoadBool ( SettingID Type, bool & Value ); bool LoadBool ( SettingID Type, bool & Value );
@ -236,6 +233,22 @@ public:
bool LoadStringIndex ( SettingID Type, int index, stdstr & Value ); bool LoadStringIndex ( SettingID Type, int index, stdstr & Value );
bool LoadStringIndex ( SettingID Type, int index, char * Buffer, int BufferSize ); bool LoadStringIndex ( SettingID Type, int index, char * Buffer, int BufferSize );
//Load the default value for the setting
bool LoadDefaultBool ( SettingID Type );
void LoadDefaultBool ( SettingID Type, bool & Value );
bool LoadDefaultBoolIndex ( SettingID Type, int index );
void LoadDefaultBoolIndex ( SettingID Type, int index , bool & Value );
DWORD LoadDefaultDword ( SettingID Type );
void LoadDefaultDword ( SettingID Type, DWORD & Value);
DWORD LoadDefaultDwordIndex ( SettingID Type, int index );
void LoadDefaultDwordIndex ( SettingID Type, int index, DWORD & Value);
stdstr LoadDefaultString ( SettingID Type );
void LoadDefaultString ( SettingID Type, stdstr & Value );
void LoadDefaultString ( SettingID Type, char * Buffer, int BufferSize );
stdstr LoadDefaultStringIndex ( SettingID Type, int index );
void LoadDefaultStringIndex ( SettingID Type, int index, stdstr & Value );
void LoadDefaultStringIndex ( SettingID Type, int index, char * Buffer, int BufferSize );
//Update the settings //Update the settings
void SaveBool ( SettingID Type, bool Value ); void SaveBool ( SettingID Type, bool Value );
void SaveBoolIndex ( SettingID Type, int index, bool Value ); void SaveBoolIndex ( SettingID Type, int index, bool Value );
@ -246,17 +259,26 @@ public:
void SaveString ( SettingID Type, const char * Buffer ); void SaveString ( SettingID Type, const char * Buffer );
void SaveStringIndex ( SettingID Type, int index, const char * Buffer ); void SaveStringIndex ( SettingID Type, int index, const char * Buffer );
// Delete a setting
void DeleteSetting ( SettingID Type );
void DeleteSettingIndex ( SettingID Type, int index );
//Register Notification of change //Register Notification of change
void RegisterChangeCB ( SettingID Type, void * Data, SettingChangedFunc Func); void RegisterChangeCB ( SettingID Type, void * Data, SettingChangedFunc Func);
void UnregisterChangeCB ( SettingID Type, void * Data, SettingChangedFunc Func); void UnregisterChangeCB ( SettingID Type, void * Data, SettingChangedFunc Func);
// information about setting
SettingType GetSettingType ( SettingID Type );
bool IndexBasedSetting ( SettingID Type );
void SettingTypeChanged ( SettingType Type );
// static functions for plugins // static functions for plugins
static DWORD GetSetting ( CSettings * _this, SettingID Type ); static DWORD GetSetting ( CSettings * _this, SettingID Type );
static LPCSTR GetSettingSz ( CSettings * _this, SettingID Type, char * Buffer, int BufferSize ); static LPCSTR GetSettingSz ( CSettings * _this, SettingID Type, char * Buffer, int BufferSize );
static void SetSetting ( CSettings * _this, SettingID ID, unsigned int Value ); static void SetSetting ( CSettings * _this, SettingID ID, unsigned int Value );
static void SetSettingSz ( CSettings * _this, SettingID ID, const char * Value ); static void SetSettingSz ( CSettings * _this, SettingID ID, const char * Value );
static void RegisterSetting ( CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType Type, static void RegisterSetting ( CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType,
SettingLocation Location, const char * Category, const char * DefaultStr, SettingType Type, const char * Category, const char * DefaultStr,
DWORD Value ); DWORD Value );
private: private:
void NotifyCallBacks ( SettingID Type ); void NotifyCallBacks ( SettingID Type );

Binary file not shown.

View File

@ -41,10 +41,12 @@ typedef struct {
class CN64System; class CN64System;
#include "./WTL App.h" #include <WTL App.h>
#include <User Interface/MenuShortCuts.h>
#include ".\\User Interface\\Rom Browser.h" #include ".\\User Interface\\Rom Browser.h"
#include ".\\User Interface\\Gui Class.h" #include ".\\User Interface\\Gui Class.h"
#include ".\\User Interface\\Menu Class.h" #include ".\\User Interface\\Menu Class.h"
#include ".\\User Interface\\Menu Class.h"
#include ".\\User Interface\\Main Menu Class.h" #include ".\\User Interface\\Main Menu Class.h"
#include ".\\User Interface\\Notification Class.h" #include ".\\User Interface\\Notification Class.h"
#include ".\\User Interface\\Frame Per Second Class.h" #include ".\\User Interface\\Frame Per Second Class.h"

View File

@ -6,10 +6,10 @@
CFramePerSecond::CFramePerSecond (CNotification * Notification): CFramePerSecond::CFramePerSecond (CNotification * Notification):
_Notify(Notification) _Notify(Notification)
{ {
m_iFrameRateType = _Settings->LoadDword(FrameDisplayType); m_iFrameRateType = _Settings->LoadDword(UserInterface_FrameDisplayType);
m_ScreenHertz = _Settings->LoadDword(ScreenHertz); m_ScreenHertz = _Settings->LoadDword(GameRunning_ScreenHertz);
_Settings->RegisterChangeCB(FrameDisplayType,this,(CSettings::SettingChangedFunc)FrameRateTypeChanged); _Settings->RegisterChangeCB(UserInterface_FrameDisplayType,this,(CSettings::SettingChangedFunc)FrameRateTypeChanged);
_Settings->RegisterChangeCB(ScreenHertz,this,(CSettings::SettingChangedFunc)ScreenHertzChanged); _Settings->RegisterChangeCB(GameRunning_ScreenHertz,this,(CSettings::SettingChangedFunc)ScreenHertzChanged);
if (m_ScreenHertz == 0) if (m_ScreenHertz == 0)
{ {
@ -24,8 +24,8 @@ CFramePerSecond::CFramePerSecond (CNotification * Notification):
CFramePerSecond::~CFramePerSecond() CFramePerSecond::~CFramePerSecond()
{ {
_Settings->UnregisterChangeCB(FrameDisplayType,this,(CSettings::SettingChangedFunc)FrameRateTypeChanged); _Settings->UnregisterChangeCB(UserInterface_FrameDisplayType,this,(CSettings::SettingChangedFunc)FrameRateTypeChanged);
_Settings->UnregisterChangeCB(ScreenHertz,this,(CSettings::SettingChangedFunc)ScreenHertzChanged); _Settings->UnregisterChangeCB(GameRunning_ScreenHertz,this,(CSettings::SettingChangedFunc)ScreenHertzChanged);
} }
void CFramePerSecond::Reset (bool ClearDisplay) { void CFramePerSecond::Reset (bool ClearDisplay) {
@ -107,13 +107,13 @@ void CFramePerSecond::DisplayViCounter(DWORD FrameRate) {
void CFramePerSecond::FrameRateTypeChanged (CFramePerSecond * _this) void CFramePerSecond::FrameRateTypeChanged (CFramePerSecond * _this)
{ {
_this->m_iFrameRateType = _Settings->LoadDword(FrameDisplayType); _this->m_iFrameRateType = _Settings->LoadDword(UserInterface_FrameDisplayType);
_this->Reset(true); _this->Reset(true);
} }
void CFramePerSecond::ScreenHertzChanged (CFramePerSecond * _this) void CFramePerSecond::ScreenHertzChanged (CFramePerSecond * _this)
{ {
_this->m_ScreenHertz = _Settings->LoadDword(ScreenHertz); _this->m_ScreenHertz = _Settings->LoadDword(GameRunning_ScreenHertz);
_this->Reset(true); _this->Reset(true);
} }

View File

@ -44,8 +44,8 @@ CMainGui::CMainGui (const char * WindowTitle, CNotification * Notify, CN64System
m_hacked = false; m_hacked = false;
if (_Settings) if (_Settings)
{ {
if (MD5(_Settings->LoadString(BetaUserName)).hex_digest() != _Settings->LoadString(BetaUserNameMD5) || if (MD5(_Settings->LoadString(Beta_UserName)).hex_digest() != _Settings->LoadString(Beta_UserNameMD5) ||
MD5(_Settings->LoadString(BetaEmailAddress)).hex_digest() != _Settings->LoadString(BetaEmailAddressMD5)) MD5(_Settings->LoadString(Beta_EmailAddress)).hex_digest() != _Settings->LoadString(Beta_EmailAddressMD5))
{ {
m_hacked = true; m_hacked = true;
} }
@ -66,6 +66,13 @@ CMainGui::CMainGui (const char * WindowTitle, CNotification * Notify, CN64System
m_InvalidExeMsg = RegisterWindowMessage("Invalid"); m_InvalidExeMsg = RegisterWindowMessage("Invalid");
if (m_System)
{
_Settings->RegisterChangeCB(RomBrowser_Enabled,this,(CSettings::SettingChangedFunc)RomBowserEnabledChanged);
_Settings->RegisterChangeCB(RomBrowser_ColoumnsChanged,this,(CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
_Settings->RegisterChangeCB(RomBrowser_Recursive,this,(CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
}
//if this fails then it has already been created //if this fails then it has already been created
RegisterWinClass(); RegisterWinClass();
Create(WindowTitle); Create(WindowTitle);
@ -75,6 +82,12 @@ CMainGui::CMainGui (const char * WindowTitle, CNotification * Notify, CN64System
CMainGui::~CMainGui (void) CMainGui::~CMainGui (void)
{ {
WriteTrace(TraceDebug,"CMainGui::~CMainGui - start"); WriteTrace(TraceDebug,"CMainGui::~CMainGui - start");
if (m_System)
{
_Settings->UnregisterChangeCB(RomBrowser_Enabled,this,(CSettings::SettingChangedFunc)RomBowserEnabledChanged);
_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged,this,(CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
_Settings->UnregisterChangeCB(RomBrowser_Recursive,this,(CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
}
if (m_hMainWindow) if (m_hMainWindow)
{ {
DestroyWindow((HWND)m_hMainWindow); DestroyWindow((HWND)m_hMainWindow);
@ -82,6 +95,33 @@ CMainGui::~CMainGui (void)
WriteTrace(TraceDebug,"CMainGui::~CMainGui - Done"); WriteTrace(TraceDebug,"CMainGui::~CMainGui - Done");
} }
void RomBowserEnabledChanged (CMainGui * Gui)
{
if (Gui && _Settings->LoadBool(RomBrowser_Enabled))
{
if (!Gui->RomBrowserVisible())
{
Gui->ShowRomList();
}
} else {
if (Gui->RomBrowserVisible())
{
Gui->HideRomList();
}
}
}
void RomBowserColoumnsChanged (CMainGui * Gui)
{
Gui->ResetRomBrowserColomuns();
}
void RomBrowserRecursiveChanged (CMainGui * Gui)
{
Gui->RefreshRomBrowser();
Gui->HighLightLastRom();
}
void CMainGui::ChangeWinSize (long width, long height) { void CMainGui::ChangeWinSize (long width, long height) {
CGuard Guard(m_CS); CGuard Guard(m_CS);
WINDOWPLACEMENT wndpl; WINDOWPLACEMENT wndpl;
@ -141,7 +181,7 @@ DWORD CALLBACK AboutIniBoxProc (WND_HANDLE WndHandle, DWORD uMsg, DWORD wParam,
//RDB //RDB
Notify().BreakPoint(__FILE__,__LINE__); Notify().BreakPoint(__FILE__,__LINE__);
stdstr IniFile = _Settings->LoadString(RomDatabaseFile).c_str(); stdstr IniFile = _Settings->LoadString(SupportFile_RomDatabase).c_str();
SetDlgItemText(hDlg,IDC_RDB,GS(INI_CURRENT_RDB)); SetDlgItemText(hDlg,IDC_RDB,GS(INI_CURRENT_RDB));
GetPrivateProfileString("Meta","Author","",String,sizeof(String),IniFile.c_str()); GetPrivateProfileString("Meta","Author","",String,sizeof(String),IniFile.c_str());
if (strlen(String) == 0) { if (strlen(String) == 0) {
@ -167,7 +207,7 @@ DWORD CALLBACK AboutIniBoxProc (WND_HANDLE WndHandle, DWORD uMsg, DWORD wParam,
//Cheat //Cheat
SetDlgItemText(hDlg,IDC_CHT,GS(INI_CURRENT_CHT)); SetDlgItemText(hDlg,IDC_CHT,GS(INI_CURRENT_CHT));
IniFile = _Settings->LoadString(CheatIniName).c_str(); IniFile = _Settings->LoadString(SupportFile_Cheats).c_str();
GetPrivateProfileString("Meta","Author","",String,sizeof(String),IniFile.c_str()); GetPrivateProfileString("Meta","Author","",String,sizeof(String),IniFile.c_str());
if (strlen(String) == 0) { if (strlen(String) == 0) {
EnableWindow(GetDlgItem(hDlg,IDC_CHT),FALSE); EnableWindow(GetDlgItem(hDlg,IDC_CHT),FALSE);
@ -192,7 +232,7 @@ DWORD CALLBACK AboutIniBoxProc (WND_HANDLE WndHandle, DWORD uMsg, DWORD wParam,
//Extended Info //Extended Info
SetDlgItemText(hDlg,IDC_RDX,GS(INI_CURRENT_RDX)); SetDlgItemText(hDlg,IDC_RDX,GS(INI_CURRENT_RDX));
IniFile = _Settings->LoadString(ExtIniName).c_str();; IniFile = _Settings->LoadString(SupportFile_ExtInfo).c_str();;
GetPrivateProfileString("Meta","Author","",String,sizeof(String),IniFile.c_str()); GetPrivateProfileString("Meta","Author","",String,sizeof(String),IniFile.c_str());
if (strlen(String) == 0) { if (strlen(String) == 0) {
EnableWindow(GetDlgItem(hDlg,IDC_RDX),FALSE); EnableWindow(GetDlgItem(hDlg,IDC_RDX),FALSE);
@ -388,15 +428,15 @@ void CMainGui::SaveWindowLoc ( void )
if (m_SaveMainWindowPos) if (m_SaveMainWindowPos)
{ {
m_SaveMainWindowPos = false; m_SaveMainWindowPos = false;
_Settings->SaveDword(MainWindowTop,m_SaveMainWindowTop); _Settings->SaveDword(UserInterface_MainWindowTop,m_SaveMainWindowTop);
_Settings->SaveDword(MainWindowLeft,m_SaveMainWindowLeft); _Settings->SaveDword(UserInterface_MainWindowLeft,m_SaveMainWindowLeft);
} }
if (m_SaveRomBrowserPos) if (m_SaveRomBrowserPos)
{ {
m_SaveRomBrowserPos = false; m_SaveRomBrowserPos = false;
_Settings->SaveDword(RomBrowserTop,m_SaveRomBrowserTop); _Settings->SaveDword(RomBrowser_Top,m_SaveRomBrowserTop);
_Settings->SaveDword(RomBrowserLeft,m_SaveRomBrowserLeft); _Settings->SaveDword(RomBrowser_Left,m_SaveRomBrowserLeft);
} }
} }
@ -420,8 +460,8 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
//Move the Main window to the location last executed from or center the window //Move the Main window to the location last executed from or center the window
int X = (GetSystemMetrics( SM_CXSCREEN ) - _this->Width()) / 2; int X = (GetSystemMetrics( SM_CXSCREEN ) - _this->Width()) / 2;
int Y = (GetSystemMetrics( SM_CYSCREEN ) - _this->Height()) / 2; int Y = (GetSystemMetrics( SM_CYSCREEN ) - _this->Height()) / 2;
_Settings->LoadDword(MainWindowTop,(DWORD &)Y); _Settings->LoadDword(UserInterface_MainWindowTop,(DWORD &)Y);
_Settings->LoadDword(MainWindowLeft,(DWORD &)X); _Settings->LoadDword(UserInterface_MainWindowLeft,(DWORD &)X);
_this->SetPos(X,Y); _this->SetPos(X,Y);
_this->ChangeWinSize(640,480); _this->ChangeWinSize(640,480);
@ -439,9 +479,9 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
{ {
CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class");
if (_this && if (_this &&
_this->bCPURunning && _this->bCPURunning() &&
!_Settings->LoadDword(CPU_Paused) && !_Settings->LoadBool(GameRunning_CPU_Paused) &&
_Settings->LoadDword(DisableScrSaver)) _Settings->LoadDword(Setting_DisableScrSaver))
{ {
return 0; return 0;
} }
@ -487,7 +527,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
} }
} }
} }
if (CGuiSettings::bCPURunning && System) { if (CGuiSettings::bCPURunning() && System) {
CPlugins * Plugins = System->Plugins(); CPlugins * Plugins = System->Plugins();
if (Plugins->Gfx() && Plugins->Gfx()->MoveScreen) { if (Plugins->Gfx() && Plugins->Gfx()->MoveScreen) {
WriteTrace(TraceGfxPlugin,"MoveScreen: Starting"); WriteTrace(TraceGfxPlugin,"MoveScreen: Starting");
@ -501,7 +541,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
{ {
CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class");
static DWORD CallCount = 0; static DWORD CallCount = 0;
if (!_Settings->LoadDword(IsValidExe)) if (!_Settings->LoadBool(Beta_IsValidExe))
{ {
if (CallCount == 0) if (CallCount == 0)
{ {
@ -565,7 +605,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class");
CN64System * System = _this->m_System; CN64System * System = _this->m_System;
// if (bCPURunning && Settings->Load(CPU_Paused)) { // if (bCPURunning() && Settings->Load(CPU_Paused)) {
// CPlugins * Plugins = System->Plugins(); // CPlugins * Plugins = System->Plugins();
// if (Plugins->Gfx()->DrawScreen) { // if (Plugins->Gfx()->DrawScreen) {
// Plugins->Gfx()->DrawScreen(); // Plugins->Gfx()->DrawScreen();
@ -578,7 +618,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
{ {
CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class");
if (bCPURunning) { if (bCPURunning()) {
CN64System * System = _this->m_System; CN64System * System = _this->m_System;
CPlugins * Plugins = System->Plugins(); CPlugins * Plugins = System->Plugins();
if (Plugins && Plugins->Control()->WM_KeyUp) { if (Plugins && Plugins->Control()->WM_KeyUp) {
@ -591,7 +631,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
{ {
CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class");
if (bCPURunning) { if (bCPURunning()) {
CN64System * System = _this->m_System; CN64System * System = _this->m_System;
CPlugins * Plugins = System->Plugins(); CPlugins * Plugins = System->Plugins();
if (Plugins && Plugins->Control()->WM_KeyDown) { if (Plugins && Plugins->Control()->WM_KeyDown) {
@ -609,8 +649,8 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
break; break;
} }
if (!bCPURunning) { break; } if (!bCPURunning()) { break; }
if (!bAutoSleep) { break; } if (!bAutoSleep()) { break; }
CN64System * System = _this->m_System; CN64System * System = _this->m_System;
if (System) if (System)
{ {
@ -626,8 +666,8 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
break; break;
} }
if (!bCPURunning) { break; } if (!bCPURunning()) { break; }
if (!bAutoSleep) { break; } if (!bAutoSleep()) { break; }
CN64System * System = _this->m_System; CN64System * System = _this->m_System;
if (System) if (System)
{ {
@ -643,9 +683,19 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
if (fActive && _this->RomBrowserVisible()) { if (fActive && _this->RomBrowserVisible()) {
PostMessage((HWND)hWnd,WM_BORWSER_TOP,0,0); PostMessage((HWND)hWnd,WM_BORWSER_TOP,0,0);
} }
if (!bCPURunning) { break; } if (!bCPURunning()) { break; }
if (!bAutoSleep) { break; }
CN64System * System = _this->m_System; CN64System * System = _this->m_System;
if (!fActive && _Settings->LoadBool(UserInterface_InFullScreen))
{
_this->m_Notify->WindowMode();
if (bAutoSleep() && System)
{
//System->ExternalEvent(PauseCPU_AppLostActiveDelayed );
}
break;
}
if (!bAutoSleep()) { break; }
if (System) if (System)
{ {
System->ExternalEvent(fActive ? ResumeCPU_AppGainedActive : PauseCPU_AppLostActive ); System->ExternalEvent(fActive ? ResumeCPU_AppGainedActive : PauseCPU_AppLostActive );
@ -716,7 +766,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
if (CurrentRom) { if (CurrentRom) {
CurrentRom->SaveRomSettingID(); CurrentRom->SaveRomSettingID();
} else { } else {
_Settings->SaveString(ROM_NAME,""); Rom.ClearRomSettingID();
} }
} }
break; break;
@ -756,7 +806,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
if (CurrentRom) { if (CurrentRom) {
CurrentRom->SaveRomSettingID(); CurrentRom->SaveRomSettingID();
} else { } else {
_Settings->SaveString(ROM_NAME,""); _Settings->SaveString(Game_IniKey,"");
} }
} }
} else if (_this->m_Menu->ProcessMessage(hWnd,HIWORD(wParam), LOWORD(wParam))) { } else if (_this->m_Menu->ProcessMessage(hWnd,HIWORD(wParam), LOWORD(wParam))) {
@ -770,12 +820,20 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam
WriteTrace(TraceDebug,"WM_DESTROY - start"); WriteTrace(TraceDebug,"WM_DESTROY - start");
{ {
CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class");
if (_this->m_Notify)
{
_this->m_Notify->WindowMode();
}
CN64System * System = _this->m_System;
_this->m_hMainWindow = NULL; _this->m_hMainWindow = NULL;
WriteTrace(TraceDebug,"WM_DESTROY - 1"); WriteTrace(TraceDebug,"WM_DESTROY - 1");
if (System)
{
_this->SaveRomListColoumnInfo(); _this->SaveRomListColoumnInfo();
WriteTrace(TraceDebug,"WM_DESTROY - 2"); WriteTrace(TraceDebug,"WM_DESTROY - 2");
_this->SaveWindowLoc(); _this->SaveWindowLoc();
} }
}
WriteTrace(TraceDebug,"WM_DESTROY - 3"); WriteTrace(TraceDebug,"WM_DESTROY - 3");
RemoveProp((HWND)hWnd,"Class"); RemoveProp((HWND)hWnd,"Class");
WriteTrace(TraceDebug,"WM_DESTROY - 4"); WriteTrace(TraceDebug,"WM_DESTROY - 4");

View File

@ -50,6 +50,10 @@ class CMainGui :
friend DWORD CALLBACK AboutIniBoxProc ( WND_HANDLE, DWORD, DWORD, DWORD ); friend DWORD CALLBACK AboutIniBoxProc ( WND_HANDLE, DWORD, DWORD, DWORD );
static DWORD CALLBACK MainGui_Proc ( WND_HANDLE, DWORD, DWORD, DWORD ); static DWORD CALLBACK MainGui_Proc ( WND_HANDLE, DWORD, DWORD, DWORD );
friend void RomBowserEnabledChanged (CMainGui * Gui);
friend void RomBowserColoumnsChanged (CMainGui * Gui);
friend void RomBrowserRecursiveChanged (CMainGui * Gui);
public: public:
CMainGui ( const char * WindowTitle = "", CNotification * Notify = 0, CN64System * System = 0 ); CMainGui ( const char * WindowTitle = "", CNotification * Notify = 0, CN64System * System = 0 );
~CMainGui ( void ); ~CMainGui ( void );

File diff suppressed because it is too large Load Diff

View File

@ -49,20 +49,26 @@ enum MainMenuID {
ID_HELP_CONTENTS, ID_HELP_GAMEFAQ, ID_HELP_SUPPORTFORUM, ID_HELP_HOMEPAGE, ID_HELP_ABOUTSETTINGFILES, ID_HELP_ABOUT, ID_HELP_CONTENTS, ID_HELP_GAMEFAQ, ID_HELP_SUPPORTFORUM, ID_HELP_HOMEPAGE, ID_HELP_ABOUTSETTINGFILES, ID_HELP_ABOUT,
}; };
class CMainMenu:public CBaseMenu { class CMainMenu:public CBaseMenu
{
typedef std::list<SettingID> SettingList;
CMainGui * _Gui; CMainGui * _Gui;
CN64System * _System; CN64System * _System;
//MSC_MAP m_ShortCuts; //MSC_MAP m_ShortCuts;
void * m_AccelTable; void * m_AccelTable;
bool m_ResetAccelerators; bool m_ResetAccelerators;
CShortCuts m_ShortCuts;
SettingList m_ChangeSettingList;
void FillOutMenu ( MENU_HANDLE hMenu ); void FillOutMenu ( MENU_HANDLE hMenu );
stdstr ShortCutString(MSC_MAP & ShortCuts, int MenuID, MENU_SHORT_CUT_KEY::ACCESS_MODE AccessLevel); //stdstr ShortCutString(MSC_MAP & ShortCuts, int MenuID, CMenuShortCutKey::ACCESS_MODE AccessLevel);
stdstr GetSaveSlotString ( int Slot ); stdstr GetSaveSlotString ( int Slot );
stdstr GetFileLastMod ( stdstr FileName ); stdstr GetFileLastMod ( stdstr FileName );
void RebuildAccelerators ( void ); void RebuildAccelerators ( void );
static void SettingsChanged (CMainMenu * _this );
public: public:
CMainMenu ( CMainGui * Window, CN64System * N64System ); CMainMenu ( CMainGui * Window, CN64System * N64System );
~CMainMenu(); ~CMainMenu();
@ -71,7 +77,6 @@ public:
bool ProcessMessage ( WND_HANDLE hWnd, DWORD wNotifyCode, DWORD wID); bool ProcessMessage ( WND_HANDLE hWnd, DWORD wNotifyCode, DWORD wID);
void ResetMenu ( void ); void ResetMenu ( void );
void ResetAccelerators ( void ) { m_ResetAccelerators = true; } void ResetAccelerators ( void ) { m_ResetAccelerators = true; }
MSC_MAP GetShortCutInfo ( bool InitialSettings ); // void SaveShortCuts ( MSC_MAP * ShortCuts );
void SaveShortCuts ( MSC_MAP * ShortCuts ); // LanguageStringID GetShortCutMenuItemName (MSC_MAP * ShortCuts, WORD key, bool bCtrl, bool bAlt, bool bShift, CMenuShortCutKey::ACCESS_MODE Access);
LanguageStringID GetShortCutMenuItemName (MSC_MAP * ShortCuts, WORD key, bool bCtrl, bool bAlt, bool bShift, MENU_SHORT_CUT_KEY::ACCESS_MODE Access);
}; };

View File

@ -64,217 +64,8 @@ bool CBaseMenu::AddMenu(MENU_HANDLE hMenu, MenuItemList Items ) {
return true; return true;
} }
VIRTUAL_KEY MENU_SHORT_CUT_KEY::m_VirtualKeyList[] = {
{ "VK_LBUTTON", 0x01, "VK_LBUTTON" },
{ "VK_RBUTTON", 0x02, "VK_RBUTTON" },
{ "VK_CANCEL", 0x03, "VK_CANCEL" },
{ "VK_MBUTTON", 0x04, "VK_MBUTTON" },
{ "VK_XBUTTON1", 0x05, "VK_XBUTTON1" },
{ "VK_XBUTTON2", 0x06, "VK_XBUTTON2" },
{ "VK_BACK", 0x08, "VK_BACK" },
{ "VK_TAB", 0x09, "VK_TAB" },
{ "VK_CLEAR", 0x0C, "VK_CLEAR" },
{ "VK_RETURN", 0x0D, "Return" },
{ "VK_SHIFT", 0x10, "VK_SHIFT" },
{ "VK_CONTROL", 0x11, "VK_CONTROL" },
{ "VK_MENU", 0x12, "VK_MENU" },
{ "VK_PAUSE", 0x13, "Pause" },
{ "VK_CAPITAL", 0x14, "VK_CAPITAL" },
{ "VK_KANA", 0x15, "VK_KANA" },
{ "VK_HANGUL", 0x15, "VK_HANGUL" },
{ "VK_JUNJA", 0x17, "VK_JUNJA" },
{ "VK_FINAL", 0x18, "VK_FINAL" },
{ "VK_HANJA", 0x19, "VK_HANJA" },
{ "VK_KANJI", 0x19, "VK_KANJI" },
{ "VK_ESCAPE", 0x1B, "Esc" },
{ "VK_CONVERT", 0x1C, "VK_CONVERT" },
{ "VK_NONCONVERT", 0x1D, "VK_NONCONVERT" },
{ "VK_ACCEPT", 0x1E, "VK_ACCEPT" },
{ "VK_MODECHANGE", 0x1F, "VK_MODECHANGE" },
{ "VK_SPACE", 0x20, "Space" },
{ "VK_PRIOR", 0x21, "Page Up" },
{ "VK_NEXT", 0x22, "Page Down" },
{ "VK_END", 0x23, "End" },
{ "VK_HOME", 0x24, "Home" },
{ "VK_LEFT", 0x25, "Left" },
{ "VK_UP", 0x26, "Up" },
{ "VK_RIGHT", 0x27, "Right" },
{ "VK_DOWN", 0x28, "Down" },
{ "VK_SELECT", 0x29, "VK_SELECT" },
{ "VK_PRINT", 0x2A, "VK_PRINT" },
{ "VK_EXECUTE", 0x2B, "VK_EXECUTE" },
{ "VK_SNAPSHOT", 0x2C, "VK_SNAPSHOT" },
{ "VK_INSERT", 0x2D, "Insert" },
{ "VK_DELETE", 0x2E, "Delete" },
{ "VK_HELP", 0x2F, "Help" },
{ "VK_0", 0x30, "0" },
{ "VK_1", 0x31, "1" },
{ "VK_2", 0x32, "2" },
{ "VK_3", 0x33, "3" },
{ "VK_4", 0x34, "4" },
{ "VK_5", 0x35, "5" },
{ "VK_6", 0x36, "6" },
{ "VK_7", 0x37, "7" },
{ "VK_8", 0x38, "8" },
{ "VK_9", 0x39, "9" },
{ "VK_A", 0x41, "A" },
{ "VK_B", 0x42, "B" },
{ "VK_C", 0x43, "C" },
{ "VK_D", 0x44, "D" },
{ "VK_E", 0x45, "E" },
{ "VK_F", 0x46, "F" },
{ "VK_G", 0x47, "G" },
{ "VK_H", 0x48, "H" },
{ "VK_I", 0x49, "I" },
{ "VK_J", 0x4A, "J" },
{ "VK_K", 0x4B, "K" },
{ "VK_L", 0x4C, "L" },
{ "VK_M", 0x4D, "M" },
{ "VK_N", 0x4E, "N" },
{ "VK_O", 0x4F, "O" },
{ "VK_P", 0x50, "P" },
{ "VK_Q", 0x51, "Q" },
{ "VK_R", 0x52, "R" },
{ "VK_S", 0x53, "S" },
{ "VK_T", 0x54, "T" },
{ "VK_U", 0x55, "U" },
{ "VK_V", 0x56, "V" },
{ "VK_W", 0x57, "W" },
{ "VK_X", 0x58, "X" },
{ "VK_Y", 0x59, "Y" },
{ "VK_Z", 0x5A, "Z" },
{ "VK_LWIN", 0x5B, "VK_LWIN" },
{ "VK_RWIN", 0x5C, "VK_RWIN" },
{ "VK_APPS", 0x5D, "VK_APPS" },
{ "VK_SLEEP", 0x5D, "VK_SLEEP" },
{ "VK_NUMPAD0", 0x60, "Numpad0" },
{ "VK_NUMPAD1", 0x61, "Numpad1" },
{ "VK_NUMPAD2", 0x62, "Numpad2" },
{ "VK_NUMPAD3", 0x63, "Numpad3" },
{ "VK_NUMPAD4", 0x64, "Numpad4" },
{ "VK_NUMPAD5", 0x65, "Numpad5" },
{ "VK_NUMPAD6", 0x66, "Numpad6" },
{ "VK_NUMPAD7", 0x67, "Numpad7" },
{ "VK_NUMPAD8", 0x68, "Numpad8" },
{ "VK_NUMPAD9", 0x69, "Numpad9" },
{ "VK_MULTIPLY", 0x6A, "*" },
{ "VK_ADD", 0x6B, "+" },
{ "VK_SEPARATOR", 0x6C, "" },
{ "VK_SUBTRACT", 0x6D, "-" },
{ "VK_DECIMAL", 0x6E, "." },
{ "VK_DIVIDE", 0x6F, "/" },
{ "VK_F1", 0x70, "F1" },
{ "VK_F2", 0x71, "F2" },
{ "VK_F3", 0x72, "F3" },
{ "VK_F4", 0x73, "F4" },
{ "VK_F5", 0x74, "F5" },
{ "VK_F6", 0x75, "F6" },
{ "VK_F7", 0x76, "F7" },
{ "VK_F8", 0x77, "F8" },
{ "VK_F9", 0x78, "F9" },
{ "VK_F10", 0x79, "F10" },
{ "VK_F11", 0x7A, "F11" },
{ "VK_F12", 0x7B, "F12" },
{ "VK_F13", 0x7C, "F13" },
{ "VK_F14", 0x7D, "F14" },
{ "VK_F15", 0x7E, "F15" },
{ "VK_F16", 0x7F, "F16" },
{ "VK_F17", 0x80, "F17" },
{ "VK_F18", 0x81, "F18" },
{ "VK_F19", 0x82, "F19" },
{ "VK_F20", 0x83, "F20" },
{ "VK_F21", 0x84, "F21" },
{ "VK_F22", 0x85, "F22" },
{ "VK_F23", 0x86, "F23" },
{ "VK_F24", 0x87, "F24" },
{ "VK_NUMLOCK", 0x90, "Numlock" },
{ "VK_SCROLL", 0x91, "VK_SCROLL" },
{ "VK_LSHIFT", 0xA0, "VK_LSHIFT" },
{ "VK_RSHIFT", 0xA1, "VK_RSHIFT" },
{ "VK_LCONTROL", 0xA2, "VK_LCONTROL" },
{ "VK_RCONTROL", 0xA3, "VK_RCONTROL" },
{ "VK_LMENU", 0xA4, "VK_LMENU" },
{ "VK_RMENU", 0xA5, "VK_RMENU" },
{ "VK_BROWSER_BACK", 0xA6, "" },
{ "VK_BROWSER_FORWARD",0xA7, "" },
{ "VK_BROWSER_REFRESH",0xA8, "" },
{ "VK_BROWSER_STOP", 0xA9, "" },
{ "VK_BROWSER_SEARCH", 0xAA, "" },
{ "VK_BROWSER_FAVORITES",0xAB, "" },
{ "VK_BROWSER_HOME", 0xAC, "" },
{ "VK_VOLUME_MUTE", 0xAD, "" },
{ "VK_VOLUME_DOWN", 0xAE, "" },
{ "VK_VOLUME_UP", 0xAF, "" },
{ "VK_MEDIA_NEXT_TRACK",0xB0, "" },
{ "VK_MEDIA_PREV_TRACK",0xB1, "" },
{ "VK_MEDIA_STOP", 0xB2, "" },
{ "VK_MEDIA_PLAY_PAUSE",0xB3, "" },
{ "VK_LAUNCH_MAIL", 0xB4, "" },
{ "VK_LAUNCH_MEDIA_SELECT",0xB5, "" },
{ "VK_LAUNCH_APP1", 0xB6, "" },
{ "VK_LAUNCH_APP2", 0xB7, "" },
{ "VK_OEM_1 (;:)", 0xBA, "" },
{ "VK_OEM_PLUS", 0xBB, "+" },
{ "VK_OEM_COMMA", 0xBC, "" },
{ "VK_OEM_MINUS", 0xBD, "-" },
{ "VK_OEM_PERIOD", 0xBE, "." },
{ "VK_OEM_2 (/?)", 0xBF, "" },
{ "VK_OEM_3 (`~)", 0xC0, "~" },
{ "VK_ATTN", 0xF6, "" },
{ "VK_CRSEL", 0xF7, "" },
{ "VK_EXSEL", 0xF8, "" },
{ "VK_EREOF", 0xF9, "" },
{ "VK_PLAY", 0xFA, "" },
{ "VK_ZOOM", 0xFB, "" },
{ "VK_NONAME", 0xFC, "" },
{ "VK_PA1", 0xFD, "" },
{ "VK_OEM_CLEAR", 0xFE }
};
MENU_SHORT_CUT_KEY::MENU_SHORT_CUT_KEY(void) : /*void MENU_SHORT_CUT::RemoveItem ( MENU_SHORT_CUT_KEY * ShortCut )
m_key(0),m_bCtrl(false),m_bAlt(false),m_bShift(false),m_AccessMode(NONE)
{
}
MENU_SHORT_CUT_KEY::MENU_SHORT_CUT_KEY(WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode ) {
m_key = key;
m_bCtrl = bCtrl;
m_bAlt = bAlt;
m_bShift = bShift;
m_AccessMode = AccessMode;
m_ShortCutName = "";
for (int count = 0; count < sizeof(m_VirtualKeyList)/sizeof(m_VirtualKeyList[0]);count++){
if (key == m_VirtualKeyList[count].Key) {
m_ShortCutName = m_VirtualKeyList[count].KeyName;
break;
}
}
if (m_bShift) { m_ShortCutName.Format("Shift+%s",m_ShortCutName.c_str()); }
if (m_bCtrl) { m_ShortCutName.Format("Ctrl+%s",m_ShortCutName.c_str()); }
if (m_bAlt) { m_ShortCutName.Format("Alt+%s",m_ShortCutName.c_str()); }
}
bool MENU_SHORT_CUT_KEY::Same(WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode) const
{
if (key != m_key) { return false; }
if (bShift != m_bShift) { return false; }
if (bCtrl != m_bCtrl) { return false; }
if (bAlt != m_bAlt) { return false; }
if ((m_AccessMode & AccessMode) != AccessMode ) { return false; }
return true;
}
VIRTUAL_KEY * MENU_SHORT_CUT_KEY::VirtualKeyList(int &Size) {
Size = sizeof(m_VirtualKeyList) / sizeof(m_VirtualKeyList[0]);
return (VIRTUAL_KEY *)m_VirtualKeyList;
}
void MENU_SHORT_CUT::AddShortCut(WORD key, bool bCtrl, bool bAlt, bool bShift, MENU_SHORT_CUT_KEY::ACCESS_MODE AccessMode) {
m_AccelList.push_back(MENU_SHORT_CUT_KEY(key,bCtrl,bAlt,bShift,AccessMode));
}
void MENU_SHORT_CUT::RemoveItem ( MENU_SHORT_CUT_KEY * ShortCut )
{ {
for (SHORTCUT_KEY_LIST::iterator item = m_AccelList.begin(); item != m_AccelList.end(); item++) { for (SHORTCUT_KEY_LIST::iterator item = m_AccelList.begin(); item != m_AccelList.end(); item++) {
if (ShortCut == &*item) { if (ShortCut == &*item) {
@ -283,5 +74,5 @@ void MENU_SHORT_CUT::RemoveItem ( MENU_SHORT_CUT_KEY * ShortCut )
} }
} }
} }*/

View File

@ -1,53 +1,9 @@
#ifndef __MENU_CLASS__H__ #ifndef __MENU_CLASS__H__
#define __MENU_CLASS__H__ #define __MENU_CLASS__H__
typedef struct {
LPCSTR Name;
int Key;
LPCSTR KeyName;
} VIRTUAL_KEY;
#include <list> #include <list>
class MENU_SHORT_CUT_KEY {
public:
enum ACCESS_MODE {
NONE = 0,
GAME_NOT_RUNNING = 1,
GAME_RUNNING_WINDOW = 2,
NOT_IN_FULLSCREEN = 3,
GAME_RUNNING_FULLSCREEN = 4,
GAME_RUNNING = 6,
ANYTIME = 7,
} ;
private: /*class MENU_SHORT_CUT {
static VIRTUAL_KEY m_VirtualKeyList[];
stdstr m_ShortCutName;
WORD m_key;
bool m_bCtrl;
bool m_bAlt;
bool m_bShift;
ACCESS_MODE m_AccessMode;
public:
MENU_SHORT_CUT_KEY(void);
MENU_SHORT_CUT_KEY(WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode );
bool Same (WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode ) const;
static VIRTUAL_KEY * VirtualKeyList(int &Size);
inline stdstr Name ( void ) const { return m_ShortCutName; }
inline WORD Key ( void ) const { return m_key; }
inline bool Ctrl ( void ) const { return m_bCtrl; }
inline bool Alt ( void ) const { return m_bAlt; }
inline bool Shift ( void ) const { return m_bShift; }
inline ACCESS_MODE AccessMode ( void ) const { return m_AccessMode; }
};
typedef std::list<MENU_SHORT_CUT_KEY> SHORTCUT_KEY_LIST;
class MENU_SHORT_CUT {
MENU_SHORT_CUT_KEY::ACCESS_MODE m_Access; MENU_SHORT_CUT_KEY::ACCESS_MODE m_Access;
LanguageStringID m_Section; LanguageStringID m_Section;
LanguageStringID m_Title; LanguageStringID m_Title;
@ -74,7 +30,7 @@ public:
}; };
typedef std::map<int,MENU_SHORT_CUT> MENU_SHORT_CUT_MAP; typedef std::map<int,MENU_SHORT_CUT> MENU_SHORT_CUT_MAP;
typedef MENU_SHORT_CUT_MAP MSC_MAP; typedef MENU_SHORT_CUT_MAP MSC_MAP;*/
enum Menu_ID { enum Menu_ID {
//ControlID //ControlID
@ -129,9 +85,9 @@ public:
virtual bool ProcessMessage(WND_HANDLE hWnd, DWORD wNotifyCode, DWORD wID) = 0; // pure virtual draw() function virtual bool ProcessMessage(WND_HANDLE hWnd, DWORD wNotifyCode, DWORD wID) = 0; // pure virtual draw() function
virtual void ResetMenu(void) = 0; // pure virtual draw() function virtual void ResetMenu(void) = 0; // pure virtual draw() function
MENU_HANDLE GetHandle (void) { return m_MenuHandle; } MENU_HANDLE GetHandle (void) { return m_MenuHandle; }
virtual MSC_MAP GetShortCutInfo(bool InitialSettings) = 0; // pure virtual draw() function //virtual MSC_MAP GetShortCutInfo(bool InitialSettings) = 0; // pure virtual draw() function
virtual void SaveShortCuts ( MSC_MAP * ShortCuts ) = 0; //virtual void SaveShortCuts ( MSC_MAP * ShortCuts ) = 0;
virtual LanguageStringID GetShortCutMenuItemName(MSC_MAP * ShortCuts, WORD key, bool bCtrl, bool bAlt, bool bShift, MENU_SHORT_CUT_KEY::ACCESS_MODE Access ) = 0; // pure virtual draw() function //virtual LanguageStringID GetShortCutMenuItemName(MSC_MAP * ShortCuts, WORD key, bool bCtrl, bool bAlt, bool bShift, CMenuShortCutKey::ACCESS_MODE Access ) = 0; // pure virtual draw() function
}; };
#endif #endif

View File

@ -0,0 +1,486 @@
#include "..\\User Interface.h"
#include <windows.h>
VIRTUAL_KEY CMenuShortCutKey::m_VirtualKeyList[] = {
{ "VK_LBUTTON", 0x01, "VK_LBUTTON" },
{ "VK_RBUTTON", 0x02, "VK_RBUTTON" },
{ "VK_CANCEL", 0x03, "VK_CANCEL" },
{ "VK_MBUTTON", 0x04, "VK_MBUTTON" },
{ "VK_XBUTTON1", 0x05, "VK_XBUTTON1" },
{ "VK_XBUTTON2", 0x06, "VK_XBUTTON2" },
{ "VK_BACK", 0x08, "VK_BACK" },
{ "VK_TAB", 0x09, "VK_TAB" },
{ "VK_CLEAR", 0x0C, "VK_CLEAR" },
{ "VK_RETURN", 0x0D, "Return" },
{ "VK_SHIFT", 0x10, "VK_SHIFT" },
{ "VK_CONTROL", 0x11, "VK_CONTROL" },
{ "VK_MENU", 0x12, "VK_MENU" },
{ "VK_PAUSE", 0x13, "Pause" },
{ "VK_CAPITAL", 0x14, "VK_CAPITAL" },
{ "VK_KANA", 0x15, "VK_KANA" },
{ "VK_HANGUL", 0x15, "VK_HANGUL" },
{ "VK_JUNJA", 0x17, "VK_JUNJA" },
{ "VK_FINAL", 0x18, "VK_FINAL" },
{ "VK_HANJA", 0x19, "VK_HANJA" },
{ "VK_KANJI", 0x19, "VK_KANJI" },
{ "VK_ESCAPE", 0x1B, "Esc" },
{ "VK_CONVERT", 0x1C, "VK_CONVERT" },
{ "VK_NONCONVERT", 0x1D, "VK_NONCONVERT" },
{ "VK_ACCEPT", 0x1E, "VK_ACCEPT" },
{ "VK_MODECHANGE", 0x1F, "VK_MODECHANGE" },
{ "VK_SPACE", 0x20, "Space" },
{ "VK_PRIOR", 0x21, "Page Up" },
{ "VK_NEXT", 0x22, "Page Down" },
{ "VK_END", 0x23, "End" },
{ "VK_HOME", 0x24, "Home" },
{ "VK_LEFT", 0x25, "Left" },
{ "VK_UP", 0x26, "Up" },
{ "VK_RIGHT", 0x27, "Right" },
{ "VK_DOWN", 0x28, "Down" },
{ "VK_SELECT", 0x29, "VK_SELECT" },
{ "VK_PRINT", 0x2A, "VK_PRINT" },
{ "VK_EXECUTE", 0x2B, "VK_EXECUTE" },
{ "VK_SNAPSHOT", 0x2C, "VK_SNAPSHOT" },
{ "VK_INSERT", 0x2D, "Insert" },
{ "VK_DELETE", 0x2E, "Delete" },
{ "VK_HELP", 0x2F, "Help" },
{ "VK_0", 0x30, "0" },
{ "VK_1", 0x31, "1" },
{ "VK_2", 0x32, "2" },
{ "VK_3", 0x33, "3" },
{ "VK_4", 0x34, "4" },
{ "VK_5", 0x35, "5" },
{ "VK_6", 0x36, "6" },
{ "VK_7", 0x37, "7" },
{ "VK_8", 0x38, "8" },
{ "VK_9", 0x39, "9" },
{ "VK_A", 0x41, "A" },
{ "VK_B", 0x42, "B" },
{ "VK_C", 0x43, "C" },
{ "VK_D", 0x44, "D" },
{ "VK_E", 0x45, "E" },
{ "VK_F", 0x46, "F" },
{ "VK_G", 0x47, "G" },
{ "VK_H", 0x48, "H" },
{ "VK_I", 0x49, "I" },
{ "VK_J", 0x4A, "J" },
{ "VK_K", 0x4B, "K" },
{ "VK_L", 0x4C, "L" },
{ "VK_M", 0x4D, "M" },
{ "VK_N", 0x4E, "N" },
{ "VK_O", 0x4F, "O" },
{ "VK_P", 0x50, "P" },
{ "VK_Q", 0x51, "Q" },
{ "VK_R", 0x52, "R" },
{ "VK_S", 0x53, "S" },
{ "VK_T", 0x54, "T" },
{ "VK_U", 0x55, "U" },
{ "VK_V", 0x56, "V" },
{ "VK_W", 0x57, "W" },
{ "VK_X", 0x58, "X" },
{ "VK_Y", 0x59, "Y" },
{ "VK_Z", 0x5A, "Z" },
{ "VK_LWIN", 0x5B, "VK_LWIN" },
{ "VK_RWIN", 0x5C, "VK_RWIN" },
{ "VK_APPS", 0x5D, "VK_APPS" },
{ "VK_SLEEP", 0x5D, "VK_SLEEP" },
{ "VK_NUMPAD0", 0x60, "Numpad0" },
{ "VK_NUMPAD1", 0x61, "Numpad1" },
{ "VK_NUMPAD2", 0x62, "Numpad2" },
{ "VK_NUMPAD3", 0x63, "Numpad3" },
{ "VK_NUMPAD4", 0x64, "Numpad4" },
{ "VK_NUMPAD5", 0x65, "Numpad5" },
{ "VK_NUMPAD6", 0x66, "Numpad6" },
{ "VK_NUMPAD7", 0x67, "Numpad7" },
{ "VK_NUMPAD8", 0x68, "Numpad8" },
{ "VK_NUMPAD9", 0x69, "Numpad9" },
{ "VK_MULTIPLY", 0x6A, "*" },
{ "VK_ADD", 0x6B, "+" },
{ "VK_SEPARATOR", 0x6C, "" },
{ "VK_SUBTRACT", 0x6D, "-" },
{ "VK_DECIMAL", 0x6E, "." },
{ "VK_DIVIDE", 0x6F, "/" },
{ "VK_F1", 0x70, "F1" },
{ "VK_F2", 0x71, "F2" },
{ "VK_F3", 0x72, "F3" },
{ "VK_F4", 0x73, "F4" },
{ "VK_F5", 0x74, "F5" },
{ "VK_F6", 0x75, "F6" },
{ "VK_F7", 0x76, "F7" },
{ "VK_F8", 0x77, "F8" },
{ "VK_F9", 0x78, "F9" },
{ "VK_F10", 0x79, "F10" },
{ "VK_F11", 0x7A, "F11" },
{ "VK_F12", 0x7B, "F12" },
{ "VK_F13", 0x7C, "F13" },
{ "VK_F14", 0x7D, "F14" },
{ "VK_F15", 0x7E, "F15" },
{ "VK_F16", 0x7F, "F16" },
{ "VK_F17", 0x80, "F17" },
{ "VK_F18", 0x81, "F18" },
{ "VK_F19", 0x82, "F19" },
{ "VK_F20", 0x83, "F20" },
{ "VK_F21", 0x84, "F21" },
{ "VK_F22", 0x85, "F22" },
{ "VK_F23", 0x86, "F23" },
{ "VK_F24", 0x87, "F24" },
{ "VK_NUMLOCK", 0x90, "Numlock" },
{ "VK_SCROLL", 0x91, "VK_SCROLL" },
{ "VK_LSHIFT", 0xA0, "VK_LSHIFT" },
{ "VK_RSHIFT", 0xA1, "VK_RSHIFT" },
{ "VK_LCONTROL", 0xA2, "VK_LCONTROL" },
{ "VK_RCONTROL", 0xA3, "VK_RCONTROL" },
{ "VK_LMENU", 0xA4, "VK_LMENU" },
{ "VK_RMENU", 0xA5, "VK_RMENU" },
{ "VK_BROWSER_BACK", 0xA6, "" },
{ "VK_BROWSER_FORWARD",0xA7, "" },
{ "VK_BROWSER_REFRESH",0xA8, "" },
{ "VK_BROWSER_STOP", 0xA9, "" },
{ "VK_BROWSER_SEARCH", 0xAA, "" },
{ "VK_BROWSER_FAVORITES",0xAB, "" },
{ "VK_BROWSER_HOME", 0xAC, "" },
{ "VK_VOLUME_MUTE", 0xAD, "" },
{ "VK_VOLUME_DOWN", 0xAE, "" },
{ "VK_VOLUME_UP", 0xAF, "" },
{ "VK_MEDIA_NEXT_TRACK",0xB0, "" },
{ "VK_MEDIA_PREV_TRACK",0xB1, "" },
{ "VK_MEDIA_STOP", 0xB2, "" },
{ "VK_MEDIA_PLAY_PAUSE",0xB3, "" },
{ "VK_LAUNCH_MAIL", 0xB4, "" },
{ "VK_LAUNCH_MEDIA_SELECT",0xB5, "" },
{ "VK_LAUNCH_APP1", 0xB6, "" },
{ "VK_LAUNCH_APP2", 0xB7, "" },
{ "VK_OEM_1 (;:)", 0xBA, "" },
{ "VK_OEM_PLUS", 0xBB, "+" },
{ "VK_OEM_COMMA", 0xBC, "" },
{ "VK_OEM_MINUS", 0xBD, "-" },
{ "VK_OEM_PERIOD", 0xBE, "." },
{ "VK_OEM_2 (/?)", 0xBF, "" },
{ "VK_OEM_3 (`~)", 0xC0, "~" },
{ "VK_ATTN", 0xF6, "" },
{ "VK_CRSEL", 0xF7, "" },
{ "VK_EXSEL", 0xF8, "" },
{ "VK_EREOF", 0xF9, "" },
{ "VK_PLAY", 0xFA, "" },
{ "VK_ZOOM", 0xFB, "" },
{ "VK_NONAME", 0xFC, "" },
{ "VK_PA1", 0xFD, "" },
{ "VK_OEM_CLEAR", 0xFE }
};
CMenuShortCutKey::CMenuShortCutKey (WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode, bool bUserAdded, bool bInactive ) :
m_key(key),
m_bCtrl(bCtrl),
m_bAlt(bAlt),
m_bShift(bShift),
m_AccessMode(AccessMode),
m_bUserAdded(bUserAdded),
m_bInactive(bInactive)
{
m_ShortCutName = "";
for (int i = 0, n = sizeof(m_VirtualKeyList)/sizeof(m_VirtualKeyList[0]); i < n;i++)
{
if (key == m_VirtualKeyList[i].Key)
{
m_ShortCutName = m_VirtualKeyList[i].KeyName;
break;
}
}
if (m_bShift) { m_ShortCutName.Format("Shift+%s",m_ShortCutName.c_str()); }
if (m_bCtrl) { m_ShortCutName.Format("Ctrl+%s",m_ShortCutName.c_str()); }
if (m_bAlt) { m_ShortCutName.Format("Alt+%s",m_ShortCutName.c_str()); }
}
VIRTUAL_KEY * CMenuShortCutKey::VirtualKeyList(int &Size) {
Size = sizeof(m_VirtualKeyList) / sizeof(m_VirtualKeyList[0]);
return (VIRTUAL_KEY *)m_VirtualKeyList;
}
bool CMenuShortCutKey::Same(WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode) const
{
if (key != m_key) { return false; }
if (bShift != m_bShift) { return false; }
if (bCtrl != m_bCtrl) { return false; }
if (bAlt != m_bAlt) { return false; }
if ((m_AccessMode & AccessMode) != AccessMode ) { return false; }
return true;
}
CShortCutItem::CShortCutItem(LanguageStringID Section, LanguageStringID Title, ACCESS_MODE Access)
{
Reset(Section, Title,Access);
}
void CShortCutItem::Reset ( LanguageStringID Section, LanguageStringID Title, ACCESS_MODE Access)
{
this->m_Section = Section;
this->m_Title = Title;
this->m_Access = Access;
}
void CShortCutItem::AddShortCut (WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode, bool bUserAdded, bool bInactive)
{
m_AccelList.push_back(CMenuShortCutKey(key,bCtrl,bAlt,bShift,AccessMode,bUserAdded,bInactive));
}
void CShortCutItem::RemoveItem ( CMenuShortCutKey * ShortCut )
{
if (ShortCut->UserAdded())
{
for (SHORTCUT_KEY_LIST::iterator item = m_AccelList.begin(); item != m_AccelList.end(); item++)
{
if (ShortCut == &*item)
{
m_AccelList.erase(item);
break;
}
}
} else {
ShortCut->SetInactive(true);
}
}
CShortCuts::CShortCuts ()
{
Load();
}
CShortCuts::~CShortCuts()
{
}
stdstr CShortCuts::ShortCutString( int MenuID, CMenuShortCutKey::ACCESS_MODE AccessLevel )
{
MSC_MAP::iterator MenuItem = m_ShortCuts.find(MenuID);
if (MenuItem == m_ShortCuts.end()) { return ""; }
const SHORTCUT_KEY_LIST & ShortCutList = MenuItem->second.GetAccelItems();
for (SHORTCUT_KEY_LIST::const_iterator item = ShortCutList.begin(); item != ShortCutList.end(); item++)
{
ACCESS_MODE ItemMode = item->AccessMode();
if ((ItemMode & AccessLevel) != AccessLevel )
{
continue;
}
if (item->Inactive())
{
continue;
}
return item->Name();
}
return "";
}
LanguageStringID CShortCuts::GetMenuItemName( WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE Access )
{
for (MSC_MAP::iterator Item = m_ShortCuts.begin(); Item != m_ShortCuts.end(); Item++)
{
CShortCutItem & short_cut = Item->second;
for (SHORTCUT_KEY_LIST::const_iterator AccelItem = short_cut.GetAccelItems().begin(); AccelItem != short_cut.GetAccelItems().end(); AccelItem++)
{
if (!AccelItem->Same(key,bCtrl,bAlt,bShift,Access)) { continue; }
return short_cut.Title();
}
}
return EMPTY_STRING;
}
void CShortCuts::AddShortCut( WORD ID, LanguageStringID Section, LanguageStringID LangID, CMenuShortCutKey::ACCESS_MODE AccessMode)
{
m_ShortCuts.insert(MSC_MAP::value_type(ID,CShortCutItem(Section,LangID,AccessMode)));
}
void CShortCuts::Load (bool InitialValues )
{
m_ShortCuts.clear();
AddShortCut(ID_FILE_OPEN_ROM, STR_SHORTCUT_FILEMENU, MENU_OPEN, CMenuShortCutKey::NOT_IN_FULLSCREEN );
AddShortCut(ID_FILE_ROM_INFO, STR_SHORTCUT_FILEMENU, MENU_ROM_INFO, CMenuShortCutKey::NOT_IN_FULLSCREEN );
AddShortCut(ID_FILE_STARTEMULATION, STR_SHORTCUT_FILEMENU, MENU_START, CMenuShortCutKey::NOT_IN_FULLSCREEN );
AddShortCut(ID_FILE_ENDEMULATION, STR_SHORTCUT_FILEMENU, MENU_END, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_FILE_ROMDIRECTORY, STR_SHORTCUT_FILEMENU, MENU_CHOOSE_ROM, CMenuShortCutKey::GAME_NOT_RUNNING );
AddShortCut(ID_FILE_REFRESHROMLIST, STR_SHORTCUT_FILEMENU, MENU_REFRESH, CMenuShortCutKey::GAME_NOT_RUNNING );
AddShortCut(ID_FILE_EXIT, STR_SHORTCUT_FILEMENU, MENU_EXIT, CMenuShortCutKey::ANYTIME );
AddShortCut(ID_SYSTEM_RESET_SOFT, STR_SHORTCUT_SYSTEMMENU, MENU_RESET_SOFT, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_SYSTEM_RESET_HARD, STR_SHORTCUT_SYSTEMMENU, MENU_RESET_HARD, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_SYSTEM_PAUSE, STR_SHORTCUT_SYSTEMMENU, MENU_PAUSE, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_SYSTEM_BITMAP, STR_SHORTCUT_SYSTEMMENU, MENU_BITMAP, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_SYSTEM_LIMITFPS, STR_SHORTCUT_SYSTEMMENU, MENU_LIMIT_FPS, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_SYSTEM_SAVE, STR_SHORTCUT_SYSTEMMENU, MENU_SAVE, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_SYSTEM_SAVEAS, STR_SHORTCUT_SYSTEMMENU, MENU_SAVE_AS, CMenuShortCutKey::GAME_RUNNING_WINDOW );
AddShortCut(ID_SYSTEM_RESTORE, STR_SHORTCUT_SYSTEMMENU, MENU_RESTORE, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_SYSTEM_LOAD, STR_SHORTCUT_SYSTEMMENU, MENU_LOAD, CMenuShortCutKey::GAME_RUNNING_WINDOW );
AddShortCut(ID_SYSTEM_CHEAT, STR_SHORTCUT_SYSTEMMENU, MENU_CHEAT, CMenuShortCutKey::NOT_IN_FULLSCREEN );
AddShortCut(ID_SYSTEM_GSBUTTON, STR_SHORTCUT_SYSTEMMENU, MENU_GS_BUTTON, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_OPTIONS_DISPLAY_FR, STR_SHORTCUT_OPTIONS, OPTION_DISPLAY_FR,CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_OPTIONS_CHANGE_FR, STR_SHORTCUT_OPTIONS, OPTION_CHANGE_FR, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_OPTIONS_INCREASE_SPEED,STR_SHORTCUT_OPTIONS, STR_INSREASE_SPEED, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_OPTIONS_DECREASE_SPEED,STR_SHORTCUT_OPTIONS, STR_DECREASE_SPEED, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_CURRENT_SAVE_DEFAULT,STR_SHORTCUT_SAVESLOT, SAVE_SLOT_DEFAULT,CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_CURRENT_SAVE_1, STR_SHORTCUT_SAVESLOT, SAVE_SLOT_1, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_CURRENT_SAVE_2, STR_SHORTCUT_SAVESLOT, SAVE_SLOT_2, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_CURRENT_SAVE_3, STR_SHORTCUT_SAVESLOT, SAVE_SLOT_3, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_CURRENT_SAVE_4, STR_SHORTCUT_SAVESLOT, SAVE_SLOT_4, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_CURRENT_SAVE_5, STR_SHORTCUT_SAVESLOT, SAVE_SLOT_5, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_CURRENT_SAVE_6, STR_SHORTCUT_SAVESLOT, SAVE_SLOT_6, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_CURRENT_SAVE_7, STR_SHORTCUT_SAVESLOT, SAVE_SLOT_7, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_CURRENT_SAVE_8, STR_SHORTCUT_SAVESLOT, SAVE_SLOT_8, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_CURRENT_SAVE_9, STR_SHORTCUT_SAVESLOT, SAVE_SLOT_9, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_CURRENT_SAVE_10, STR_SHORTCUT_SAVESLOT, SAVE_SLOT_10, CMenuShortCutKey::GAME_RUNNING );
//Option Menu
AddShortCut(ID_OPTIONS_FULLSCREEN, STR_SHORTCUT_OPTIONS, MENU_FULL_SCREEN, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_OPTIONS_ALWAYSONTOP, STR_SHORTCUT_OPTIONS, MENU_ON_TOP, CMenuShortCutKey::NOT_IN_FULLSCREEN );
AddShortCut(ID_OPTIONS_CONFIG_GFX, STR_SHORTCUT_OPTIONS, MENU_CONFG_GFX, CMenuShortCutKey::NOT_IN_FULLSCREEN );
AddShortCut(ID_OPTIONS_CONFIG_AUDIO,STR_SHORTCUT_OPTIONS, MENU_CONFG_AUDIO, CMenuShortCutKey::NOT_IN_FULLSCREEN );
AddShortCut(ID_OPTIONS_CONFIG_CONT, STR_SHORTCUT_OPTIONS, MENU_CONFG_CTRL, CMenuShortCutKey::NOT_IN_FULLSCREEN );
AddShortCut(ID_OPTIONS_CONFIG_RSP, STR_SHORTCUT_OPTIONS, MENU_CONFG_RSP, CMenuShortCutKey::NOT_IN_FULLSCREEN );
AddShortCut(ID_OPTIONS_CPU_USAGE, STR_SHORTCUT_OPTIONS, MENU_SHOW_CPU, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_OPTIONS_SETTINGS, STR_SHORTCUT_OPTIONS, MENU_SETTINGS, CMenuShortCutKey::NOT_IN_FULLSCREEN );
stdstr FileName = _Settings->LoadString(SupportFile_ShortCuts);
FILE *file = fopen(FileName.c_str(),"r");
if (file == NULL || InitialValues)
{
m_ShortCuts.find(ID_FILE_OPEN_ROM)->second.AddShortCut('O',TRUE,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_FILE_OPEN_ROM)->second.AddShortCut('O',TRUE,false,false,CMenuShortCutKey::GAME_NOT_RUNNING);
m_ShortCuts.find(ID_FILE_STARTEMULATION)->second.AddShortCut(VK_F11,false,false,false,CMenuShortCutKey::GAME_NOT_RUNNING);
m_ShortCuts.find(ID_FILE_ENDEMULATION)->second.AddShortCut(VK_F12,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_FILE_REFRESHROMLIST)->second.AddShortCut(VK_F5,false,false,false,CMenuShortCutKey::GAME_NOT_RUNNING);
m_ShortCuts.find(ID_FILE_EXIT)->second.AddShortCut(VK_F4,false,true,false,CMenuShortCutKey::GAME_NOT_RUNNING);
m_ShortCuts.find(ID_FILE_EXIT)->second.AddShortCut(VK_F4,false,true,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_CURRENT_SAVE_DEFAULT)->second.AddShortCut(0xC0,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_CURRENT_SAVE_1)->second.AddShortCut('1',false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_CURRENT_SAVE_2)->second.AddShortCut('2',false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_CURRENT_SAVE_3)->second.AddShortCut('3',false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_CURRENT_SAVE_4)->second.AddShortCut('4',false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_CURRENT_SAVE_5)->second.AddShortCut('5',false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_CURRENT_SAVE_6)->second.AddShortCut('6',false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_CURRENT_SAVE_7)->second.AddShortCut('7',false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_CURRENT_SAVE_8)->second.AddShortCut('8',false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_CURRENT_SAVE_9)->second.AddShortCut('9',false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_CURRENT_SAVE_10)->second.AddShortCut('0',false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_OPTIONS_FULLSCREEN)->second.AddShortCut(VK_RETURN,false,true,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_OPTIONS_FULLSCREEN)->second.AddShortCut(VK_ESCAPE,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_OPTIONS_ALWAYSONTOP)->second.AddShortCut('A',true,false,false,CMenuShortCutKey::GAME_NOT_RUNNING);
m_ShortCuts.find(ID_OPTIONS_ALWAYSONTOP)->second.AddShortCut('A',true,false,false,CMenuShortCutKey::GAME_RUNNING_WINDOW);
m_ShortCuts.find(ID_OPTIONS_SETTINGS)->second.AddShortCut('T',true,false,false,CMenuShortCutKey::GAME_NOT_RUNNING);
m_ShortCuts.find(ID_OPTIONS_SETTINGS)->second.AddShortCut('T',true,false,false,CMenuShortCutKey::GAME_RUNNING_WINDOW);
m_ShortCuts.find(ID_SYSTEM_RESET_SOFT)->second.AddShortCut(VK_F1,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_SYSTEM_RESET_HARD)->second.AddShortCut(VK_F1,false,false,true,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_SYSTEM_PAUSE)->second.AddShortCut(VK_F2,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_SYSTEM_PAUSE)->second.AddShortCut(VK_PAUSE,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_SYSTEM_BITMAP)->second.AddShortCut(VK_F3,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_SYSTEM_LIMITFPS)->second.AddShortCut(VK_F4,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_SYSTEM_SAVE)->second.AddShortCut(VK_F5,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_SYSTEM_RESTORE)->second.AddShortCut(VK_F7,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_SYSTEM_LOAD)->second.AddShortCut('L',true,false,false,CMenuShortCutKey::GAME_RUNNING_WINDOW);
m_ShortCuts.find(ID_SYSTEM_SAVEAS)->second.AddShortCut('S',true,false,false,CMenuShortCutKey::GAME_RUNNING_WINDOW);
m_ShortCuts.find(ID_SYSTEM_CHEAT)->second.AddShortCut('C',true,false,false,CMenuShortCutKey::GAME_RUNNING_WINDOW);
m_ShortCuts.find(ID_SYSTEM_GSBUTTON)->second.AddShortCut(VK_F9,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_OPTIONS_INCREASE_SPEED)->second.AddShortCut(VK_OEM_PLUS,false,false,false,CMenuShortCutKey::GAME_RUNNING);
m_ShortCuts.find(ID_OPTIONS_DECREASE_SPEED)->second.AddShortCut(VK_OEM_MINUS,false,false,false,CMenuShortCutKey::GAME_RUNNING);
} else if (file) {
CMenuShortCutKey::ACCESS_MODE AccessMode;
int ID, key, bCtrl, bAlt, bShift, bUserAdded, bInactive;
do {
char Line[300];
if (fgets(Line,sizeof(Line),file) != NULL) {
sscanf(Line,"%d,%d,%d,%d,%d,%d,%d,%d", &ID,&key,&bCtrl,&bAlt,&bShift,&AccessMode,
&bUserAdded,&bInactive);
MSC_MAP::iterator item = m_ShortCuts.find(ID);
if (item == m_ShortCuts.end()) { continue; }
item->second.AddShortCut(key,bCtrl == 1,bAlt == 1,bShift == 1,AccessMode,bUserAdded == 1,bInactive == 1);
}
} while (feof(file) == 0);
}
}
void CShortCuts::Save( void )
{
stdstr FileName = _Settings->LoadString(SupportFile_ShortCuts);
FILE *file = fopen(FileName.c_str(),"w");
if (file == NULL)
{
return;
}
for (MSC_MAP::iterator Item = m_ShortCuts.begin(); Item != m_ShortCuts.end(); Item++)
{
for (SHORTCUT_KEY_LIST::const_iterator ShortCut = Item->second.GetAccelItems().begin(); ShortCut != Item->second.GetAccelItems().end(); ShortCut++)
{
fprintf(file,"%d,%d,%d,%d,%d,%d,%d,%d\n",
Item->first,
ShortCut->Key(),
ShortCut->Ctrl(),
ShortCut->Alt(),
ShortCut->Shift(),
ShortCut->AccessMode(),
ShortCut->UserAdded(),
ShortCut->Inactive());
}
}
fclose(file);
}
HACCEL CShortCuts::GetAcceleratorTable ( void )
{
//Generate a ACCEL list
CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING;
if (_Settings->LoadBool(GameRunning_CPU_Running))
{
AccessLevel = _Settings->LoadBool(UserInterface_InFullScreen) ?
CMenuShortCutKey::GAME_RUNNING_FULLSCREEN :
CMenuShortCutKey::GAME_RUNNING_WINDOW;
}
int size = 0, MaxSize = m_ShortCuts.size() * 5;
ACCEL * AccelList = new ACCEL[MaxSize];
for (MSC_MAP::iterator Item = m_ShortCuts.begin(); Item != m_ShortCuts.end(); Item++)
{
CShortCutItem & short_cut = Item->second;
CMenuShortCutKey::ACCESS_MODE ItemMode = short_cut.AccessMode();
if ((ItemMode & AccessLevel) != AccessLevel )
{
continue;
}
SHORTCUT_KEY_LIST ShortCutAccelList = short_cut.GetAccelItems();
for (SHORTCUT_KEY_LIST::iterator AccelIter = ShortCutAccelList.begin(); AccelIter != ShortCutAccelList.end(); AccelIter++)
{
CMenuShortCutKey & Key = *AccelIter;
if (Key.Inactive())
{
continue;
}
if ((Key.AccessMode() & AccessLevel) != AccessLevel )
{
continue;
}
if (size >= MaxSize) { break; }
AccelList[size].cmd = Item->first;
AccelList[size].key = Key.Key();
AccelList[size].fVirt = FVIRTKEY;
if (Key.Alt()) { AccelList[size].fVirt |= FALT; }
if (Key.Ctrl()) { AccelList[size].fVirt |= FCONTROL; }
if (Key.Shift()) { AccelList[size].fVirt |= FSHIFT; }
size += 1;
}
}
WriteTrace(TraceDebug,"CMainMenu::RebuildAccelerators - CreateAcceleratorTable");
HACCEL AccelTable = CreateAcceleratorTable(AccelList,size);
WriteTrace(TraceDebug,"CMainMenu::RebuildAccelerators - Delete accel list");
delete [] AccelList;
return AccelTable;
}

View File

@ -0,0 +1,100 @@
#pragma once
typedef struct {
LPCSTR Name;
int Key;
LPCSTR KeyName;
} VIRTUAL_KEY;
class CMenuShortCutKey {
public:
enum ACCESS_MODE {
NONE = 0,
GAME_NOT_RUNNING = 1,
GAME_RUNNING_WINDOW = 2,
NOT_IN_FULLSCREEN = 3,
GAME_RUNNING_FULLSCREEN = 4,
GAME_RUNNING = 6,
ANYTIME = 7,
} ;
private:
static VIRTUAL_KEY m_VirtualKeyList[];
stdstr m_ShortCutName;
WORD m_key;
bool m_bCtrl;
bool m_bAlt;
bool m_bShift;
ACCESS_MODE m_AccessMode;
bool m_bUserAdded;
bool m_bInactive;
public:
CMenuShortCutKey(void);
CMenuShortCutKey(WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode, bool bUserAdded, bool bInactive );
bool Same (WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode ) const;
static VIRTUAL_KEY * VirtualKeyList(int &Size);
inline stdstr Name ( void ) const { return m_ShortCutName; }
inline WORD Key ( void ) const { return m_key; }
inline bool Ctrl ( void ) const { return m_bCtrl; }
inline bool Alt ( void ) const { return m_bAlt; }
inline bool Shift ( void ) const { return m_bShift; }
inline bool UserAdded ( void ) const { return m_bUserAdded; }
inline bool Inactive ( void ) const { return m_bInactive; }
inline ACCESS_MODE AccessMode ( void ) const { return m_AccessMode; }
inline void SetInactive ( bool Inactive ) { m_bInactive = Inactive; }
};
class CShortCutItem
{
public:
typedef std::list<CMenuShortCutKey> SHORTCUT_KEY_LIST;
private:
typedef CMenuShortCutKey::ACCESS_MODE ACCESS_MODE;
ACCESS_MODE m_Access;
LanguageStringID m_Section;
LanguageStringID m_Title;
SHORTCUT_KEY_LIST m_AccelList;
public:
CShortCutItem(LanguageStringID Section, LanguageStringID Title, ACCESS_MODE Access);
void Reset ( LanguageStringID Section, LanguageStringID Title, ACCESS_MODE Access);
void AddShortCut ( WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode, bool bUserAdded = false, bool bInactive = false );
void RemoveItem ( CMenuShortCutKey * ShortCut );
inline const SHORTCUT_KEY_LIST & GetAccelItems ( void ) const { return m_AccelList; }
inline LanguageStringID Section ( void ) const { return m_Section; }
inline LanguageStringID Title ( void ) const { return m_Title; }
inline ACCESS_MODE AccessMode ( void ) const { return m_Access; }
};
typedef std::map<int,CShortCutItem> MSC_MAP;
class CShortCuts
{
typedef CShortCutItem::SHORTCUT_KEY_LIST SHORTCUT_KEY_LIST;
typedef CMenuShortCutKey::ACCESS_MODE ACCESS_MODE;
typedef LanguageStringID LangStr;
MSC_MAP m_ShortCuts;
void AddShortCut ( WORD ID, LangStr Section, LangStr LangID, CMenuShortCutKey::ACCESS_MODE AccessMode);
public:
CShortCuts ( void );
~CShortCuts ( void );
stdstr ShortCutString ( int MenuID, ACCESS_MODE AccessLevel );
LangStr GetMenuItemName ( WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE Access );
HACCEL GetAcceleratorTable ( void );
MSC_MAP &GetShortCuts ( void ) { return m_ShortCuts; }
void Load ( bool InitialValues = false );
void Save ( void );
};

View File

@ -22,6 +22,29 @@ void CNotification::SetMainWindow ( CMainGui * Gui ) {
_hWnd = Gui; _hWnd = Gui;
} }
void CNotification::WindowMode ( void ) const
{
static bool InsideFunc = false;
if (InsideFunc)
{
return;
}
InsideFunc = true;
if (InFullScreen())
{
ChangeFullScreen();
for (int i = 0; i < 5; i++)
{
Sleep(50);
if (ProcessGuiMessages())
{
break;
}
}
}
InsideFunc = false;
}
void CNotification::DisplayError ( const char * Message, ... ) const { void CNotification::DisplayError ( const char * Message, ... ) const {
va_list ap; va_list ap;
va_start( ap, Message ); va_start( ap, Message );
@ -32,6 +55,8 @@ void CNotification::DisplayError ( const char * Message, va_list ap ) const {
if (this == NULL) { return; } if (this == NULL) { return; }
char Msg[1000]; char Msg[1000];
WindowMode();
_vsnprintf( Msg,sizeof(Msg) - 1,Message, ap ); _vsnprintf( Msg,sizeof(Msg) - 1,Message, ap );
va_end( ap ); va_end( ap );
HWND Parent = NULL; HWND Parent = NULL;
@ -71,7 +96,7 @@ void CNotification::DisplayMessage ( int DisplayTime, const char * Message, va_
va_end( ap ); va_end( ap );
if (bInFullScreen) if (InFullScreen())
{ {
if (_gfxPlugin && _gfxPlugin->DrawStatus) if (_gfxPlugin && _gfxPlugin->DrawStatus)
{ {
@ -107,7 +132,7 @@ void CNotification::SetGfxPlugin( CGfxPlugin * Plugin )
void CNotification::SetWindowCaption (const char * Caption) { void CNotification::SetWindowCaption (const char * Caption) {
char WinTitle[256]; char WinTitle[256];
_snprintf( WinTitle, sizeof(WinTitle), "%s - %s", Caption, _Settings->LoadString(ApplicationName).c_str()); _snprintf( WinTitle, sizeof(WinTitle), "%s - %s", Caption, _Settings->LoadString(Setting_ApplicationName).c_str());
WinTitle[sizeof(WinTitle) - 1] = 0; WinTitle[sizeof(WinTitle) - 1] = 0;
_hWnd->Caption(WinTitle); _hWnd->Caption(WinTitle);
} }
@ -116,6 +141,8 @@ void CNotification::FatalError ( const char * Message, ... ) const {
char Msg[1000]; char Msg[1000];
va_list ap; va_list ap;
WindowMode();
va_start( ap, Message ); va_start( ap, Message );
_vsnprintf( Msg,sizeof(Msg) - 1,Message, ap ); _vsnprintf( Msg,sizeof(Msg) - 1,Message, ap );
va_end( ap ); va_end( ap );
@ -130,11 +157,12 @@ void CNotification::AddRecentDir ( const char * RomDir ) {
if (HIWORD(RomDir) == NULL) { return; } if (HIWORD(RomDir) == NULL) { return; }
//Get Information about the stored rom list //Get Information about the stored rom list
int MaxRememberedDirs = _Settings->LoadDword(Directory_RecentGameDirCount);
strlist RecentDirs; strlist RecentDirs;
int i; int i;
for (i = 0; i < MaxRememberedDirs; i ++ ) for (i = 0; i < MaxRememberedDirs; i ++ )
{ {
stdstr RecentDir = _Settings->LoadStringIndex(RecentRomDirIndex,i); stdstr RecentDir = _Settings->LoadStringIndex(Directory_RecentGameDirIndex,i);
if (RecentDir.empty()) if (RecentDir.empty())
{ {
break; break;
@ -161,7 +189,7 @@ void CNotification::AddRecentDir ( const char * RomDir ) {
for (i = 0, iter = RecentDirs.begin(); iter != RecentDirs.end(); iter++, i++) for (i = 0, iter = RecentDirs.begin(); iter != RecentDirs.end(); iter++, i++)
{ {
_Settings->SaveStringIndex(RecentRomDirIndex,i,*iter); _Settings->SaveStringIndex(Directory_RecentGameDirIndex,i,*iter);
} }
} }
@ -169,38 +197,40 @@ void CNotification::AddRecentRom ( const char * ImagePath ) {
if (HIWORD(ImagePath) == NULL) { return; } if (HIWORD(ImagePath) == NULL) { return; }
//Get Information about the stored rom list //Get Information about the stored rom list
/* int count; int MaxRememberedFiles = _Settings->LoadDword(File_RecentGameFileCount);
char RecentRoms[MaxRememberedFiles][_MAX_PATH]; strlist RecentGames;
Notify().BreakPoint(__FILE__,__LINE__); int i;
for (count = 0; count < RememberedRomFilesCount; count ++ ) { for (i = 0; i < MaxRememberedFiles; i ++ )
strcpy(RecentRoms[count],""); {
//_Settings->LoadString((SettingID)(FirstRecentRom + count), RecentRoms[count], sizeof(RecentRoms[count])); stdstr RecentGame = _Settings->LoadStringIndex(File_RecentGameFileIndex,i);
Notify().BreakPoint(__FILE__,__LINE__); if (RecentGame.empty())
{
break;
}
RecentGames.push_back(RecentGame);
} }
//See if the Image Path is already in the list if so then move it to the top of the list //See if the dir is already in the list if so then move it to the top of the list
bool bFound = false; strlist::iterator iter;
for (count = 0; count < MaxRememberedFiles && !bFound; count ++ ) { for (iter = RecentGames.begin(); iter != RecentGames.end(); iter++)
if (strcmp(ImagePath, RecentRoms[count]) == 0) { {
if (count != 0) { if (_stricmp(ImagePath,iter->c_str()) != 0)
memmove(&RecentRoms[1],&RecentRoms[0],sizeof(RecentRoms[0]) * count); {
continue;
} }
bFound = true; RecentGames.erase(iter);
break;
} }
} RecentGames.push_front(ImagePath);
if (bFound == false) { if (RecentGames.size() > MaxRememberedFiles)
memmove(&RecentRoms[1],&RecentRoms[0],sizeof(RecentRoms[0]) * (MaxRememberedFiles - 1)); {
RecentGames.pop_back();
} }
//Copy the image path to the list for (i = 0, iter = RecentGames.begin(); iter != RecentGames.end(); iter++, i++)
strncpy(RecentRoms[0],ImagePath,sizeof(RecentRoms[0])); {
RecentRoms[0][_MAX_PATH - 1] = 0; //Make sure it it is null terminated _Settings->SaveStringIndex(File_RecentGameFileIndex,i,*iter);
}
Notify().BreakPoint(__FILE__,__LINE__);
for (count = 0; count < MaxRememberedFiles; count ++ ) {
// _Settings->SaveString((SettingID)(FirstRecentRom + count), RecentRoms[count]);
}*/
Notify().BreakPoint(__FILE__,__LINE__);
} }
void CNotification::RefreshMenu ( void ) { void CNotification::RefreshMenu ( void ) {
@ -215,7 +245,7 @@ void CNotification::HideRomBrowser ( void ) {
void CNotification::ShowRomBrowser ( void ) { void CNotification::ShowRomBrowser ( void ) {
if (_hWnd == NULL) { return; } if (_hWnd == NULL) { return; }
if (_Settings->LoadDword(RomBrowser)) { if (_Settings->LoadDword(RomBrowser_Enabled)) {
//Display the rom browser //Display the rom browser
_hWnd->ShowRomList(); _hWnd->ShowRomList();
_hWnd->HighLightLastRom(); _hWnd->HighLightLastRom();
@ -232,13 +262,14 @@ void CNotification::MakeWindowOnTop ( bool OnTop ) {
_hWnd->MakeWindowOnTop(OnTop); _hWnd->MakeWindowOnTop(OnTop);
} }
void CNotification::ChangeFullScreen ( void ) void CNotification::ChangeFullScreen ( void ) const
{ {
if (_hWnd == NULL) { return; } if (_hWnd == NULL) { return; }
SendMessage((HWND)(_hWnd->GetHandle()),WM_COMMAND,MAKELPARAM(ID_OPTIONS_FULLSCREEN2,false),0); SendMessage((HWND)(_hWnd->GetHandle()),WM_COMMAND,MAKELPARAM(ID_OPTIONS_FULLSCREEN2,false),0);
} }
bool CNotification::ProcessGuiMessages ( void ) { bool CNotification::ProcessGuiMessages ( void ) const
{
if (_hWnd == NULL) { return false; } if (_hWnd == NULL) { return false; }
return _hWnd->ProcessGuiMessages(); return _hWnd->ProcessGuiMessages();
} }

Some files were not shown because too many files have changed in this diff Show More