Improve checks

This commit is contained in:
Henrik Rydgård 2023-12-18 09:12:44 +01:00
parent b2729507a1
commit 02eb10649d
4 changed files with 11 additions and 9 deletions

View file

@ -248,7 +248,9 @@ void GPU_GLES::BeginHostFrame() {
textureCache_->StartFrame();
// Save the cache from time to time. TODO: How often? We save on exit, so shouldn't need to do this all that often.
if (shaderCachePath_.Valid() && (gpuStats.numFlips & 32767) == 0 && coreState == CORE_RUNNING) {
const int saveShaderCacheFrameInterval = 32767; // power of 2 - 1. About every 10 minutes at 60fps.
if (shaderCachePath_.Valid() && !(gpuStats.numFlips & saveShaderCacheFrameInterval) && coreState == CORE_RUNNING) {
shaderManagerGL_->SaveCache(shaderCachePath_, &drawEngine_);
}
shaderManagerGL_->DirtyLastShader();

View file

@ -279,7 +279,7 @@ void CtrlDisplayListView::PromptBreakpointCond() {
void CtrlDisplayListView::onMouseDown(WPARAM wParam, LPARAM lParam, int button)
{
if (!validDisplayList) {
if (!validDisplayList || !gpuDebug) {
return;
}
@ -310,7 +310,7 @@ void CtrlDisplayListView::onMouseDown(WPARAM wParam, LPARAM lParam, int button)
void CtrlDisplayListView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
{
if (!validDisplayList) {
if (!validDisplayList || !gpuDebug) {
return;
}
@ -319,12 +319,6 @@ void CtrlDisplayListView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
HMENU menu = GetContextMenu(ContextMenuID::DISPLAYLISTVIEW);
EnableMenuItem(menu, ID_GEDBG_SETCOND, GPUBreakpoints::IsAddressBreakpoint(curAddress) ? MF_ENABLED : MF_GRAYED);
// We don't want to let the users play with deallocated or uninitialized debugging objects
GlobalUIState state = GetUIState();
if (state != UISTATE_INGAME && state != UISTATE_PAUSEMENU) {
return;
}
switch (TriggerContextMenu(ContextMenuID::DISPLAYLISTVIEW, wnd, ContextPoint::FromEvent(lParam)))
{
case ID_DISASM_GOTOINMEMORYVIEW:

View file

@ -56,6 +56,10 @@ public:
list = displayList;
gotoAddr(list.pc);
}
void clearDisplayList()
{
validDisplayList = false;
}
void scrollWindow(int lines)
{

View file

@ -87,6 +87,8 @@ static void UpdateDisplayListTab(GEDebuggerTab *tab, TabControl *tabs, GETabPosi
DisplayList list;
if (gpuDebug != nullptr && gpuDebug->GetCurrentDisplayList(list)) {
view->setDisplayList(list);
} else {
view->clearDisplayList();
}
}