Skip to content

Commit

Permalink
Assorted debugger-related fixes
Browse files Browse the repository at this point in the history
Also fixes issue where the rewind machinery would run even during pause.
  • Loading branch information
hrydgard committed Dec 17, 2023
1 parent 06e92e9 commit b272950
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Core/SaveState.cpp
Expand Up @@ -275,6 +275,9 @@ namespace SaveState
if (g_Config.iRewindSnapshotInterval <= 0) {
return;
}
if (coreState != CORE_RUNNING) {
return;
}

// For fast-forwarding, otherwise they may be useless and too close.
double now = time_now_d();
Expand Down
2 changes: 1 addition & 1 deletion GPU/GLES/GPU_GLES.cpp
Expand Up @@ -248,7 +248,7 @@ 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 & 4095) == 0) {
if (shaderCachePath_.Valid() && (gpuStats.numFlips & 32767) == 0 && coreState == CORE_RUNNING) {
shaderManagerGL_->SaveCache(shaderCachePath_, &drawEngine_);
}
shaderManagerGL_->DirtyLastShader();
Expand Down
8 changes: 8 additions & 0 deletions Windows/GEDebugger/CtrlDisplayListView.cpp
Expand Up @@ -279,6 +279,10 @@ void CtrlDisplayListView::PromptBreakpointCond() {

void CtrlDisplayListView::onMouseDown(WPARAM wParam, LPARAM lParam, int button)
{
if (!validDisplayList) {
return;
}

int y = HIWORD(lParam);

int line = y/rowHeight;
Expand Down Expand Up @@ -306,6 +310,10 @@ void CtrlDisplayListView::onMouseDown(WPARAM wParam, LPARAM lParam, int button)

void CtrlDisplayListView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
{
if (!validDisplayList) {
return;
}

if (button == 2)
{
HMENU menu = GetContextMenu(ContextMenuID::DISPLAYLISTVIEW);
Expand Down
18 changes: 12 additions & 6 deletions Windows/GEDebugger/GEDebugger.cpp
Expand Up @@ -291,13 +291,16 @@ void CGEDebugger::SetupPreviews() {
EnableMenuItem(subMenu, ID_GEDBG_TRACK_PIXEL_STOP, primaryTrackX_ == 0xFFFFFFFF ? MF_GRAYED : MF_ENABLED);
break;
case ID_GEDBG_EXPORT_IMAGE:
PreviewExport(primaryBuffer_);
if (primaryBuffer_)
PreviewExport(primaryBuffer_);
break;
case ID_GEDBG_COPY_IMAGE:
PreviewToClipboard(primaryBuffer_, false);
if (primaryBuffer_)
PreviewToClipboard(primaryBuffer_, false);
break;
case ID_GEDBG_COPY_IMAGE_ALPHA:
PreviewToClipboard(primaryBuffer_, true);
if (primaryBuffer_)
PreviewToClipboard(primaryBuffer_, true);
break;
case ID_GEDBG_TRACK_PIXEL:
primaryTrackX_ = x;
Expand Down Expand Up @@ -336,13 +339,16 @@ void CGEDebugger::SetupPreviews() {
EnableMenuItem(subMenu, ID_GEDBG_TRACK_PIXEL_STOP, secondTrackX_ == 0xFFFFFFFF ? MF_GRAYED : MF_ENABLED);
break;
case ID_GEDBG_EXPORT_IMAGE:
PreviewExport(secondBuffer_);
if (secondBuffer_)
PreviewExport(secondBuffer_);
break;
case ID_GEDBG_COPY_IMAGE:
PreviewToClipboard(secondBuffer_, false);
if (secondBuffer_)
PreviewToClipboard(secondBuffer_, false);
break;
case ID_GEDBG_COPY_IMAGE_ALPHA:
PreviewToClipboard(secondBuffer_, true);
if (secondBuffer_)
PreviewToClipboard(secondBuffer_, true);
break;
case ID_GEDBG_TRACK_PIXEL:
secondTrackX_ = x;
Expand Down

0 comments on commit b272950

Please sign in to comment.