[Project64] Create gui callback on paused

This commit is contained in:
zilmar 2015-11-12 22:45:24 +11:00
parent e4bd5eae74
commit 3b74fef76c
3 changed files with 12 additions and 6 deletions

View File

@ -452,12 +452,10 @@ void CN64System::Pause()
}
m_hPauseEvent.Reset();
g_Settings->SaveBool(GameRunning_CPU_Paused, true);
Notify().RefreshMenu();
g_Notify->DisplayMessage(5, MSG_CPU_PAUSED);
m_hPauseEvent.IsTriggered(SyncEvent::INFINITE_TIMEOUT);
m_hPauseEvent.Reset();
g_Settings->SaveBool(GameRunning_CPU_Paused, (DWORD)false);
Notify().RefreshMenu();
g_Settings->SaveBool(GameRunning_CPU_Paused, false);
Notify().DisplayMessage(5, MSG_CPU_RESUMED);
}
@ -1107,7 +1105,7 @@ void CN64System::SyncCPU(CN64System * const SecondCPU)
// if (PROGRAM_COUNTER == 0x8009BBD8) {
// g_Notify->BreakPoint(__FILEW__,__LINE__);
// }
}
}
void CN64System::SyncSystem()
{
@ -1800,7 +1798,7 @@ bool CN64System::LoadState(LPCSTR FileName)
SetActiveSystem(true);
SyncCPU(m_SyncCPU);
}
}
}
WriteTrace(TraceDebug, __FUNCTION__ ": 13");
std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE);
g_Notify->DisplayMessage(5, stdstr_f("%s %s", LoadMsg.c_str(), CPath(FileNameStr).GetNameExtension()).ToUTF16().c_str());
@ -2038,7 +2036,7 @@ bool CN64System::WriteToProtectedMemory(uint32_t Address, int length)
#endif
}
return false;
}
}
void CN64System::TLB_Mapped(uint32_t VAddr, uint32_t Len, uint32_t PAddr, bool bReadOnly)
{

View File

@ -50,6 +50,7 @@ m_ResetInfo(NULL)
g_Settings->RegisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
g_Settings->RegisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
g_Settings->RegisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
g_Settings->RegisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused);
g_Settings->RegisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded);
}
@ -67,6 +68,7 @@ CMainGui::~CMainGui(void)
g_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
g_Settings->UnregisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
g_Settings->UnregisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged);
g_Settings->UnregisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused);
g_Settings->UnregisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded);
}
if (m_hMainWindow)
@ -184,6 +186,11 @@ void CMainGui::GameLoaded(CMainGui * Gui)
}
}
void CMainGui::GamePaused(CMainGui * Gui)
{
Gui->RefreshMenu();
}
void RomBowserColoumnsChanged(CMainGui * Gui)
{
Gui->ResetRomBrowserColomuns();

View File

@ -115,6 +115,7 @@ private:
friend void RomBrowserRecursiveChanged(CMainGui * Gui);
static void LoadingInProgressChanged(CMainGui * Gui);
static void GameLoaded(CMainGui * Gui);
static void GamePaused(CMainGui * Gui);
CBaseMenu * m_Menu;