Debugger: PPU Viewer - Don't update CHR viewer palette when paused & not set to refresh on pause/break

This commit is contained in:
Sour 2018-07-16 20:39:18 -04:00
parent b3ef52fcd4
commit 69bc8a0087
2 changed files with 10 additions and 2 deletions

View file

@ -409,7 +409,11 @@ namespace Mesen.GUI.Debugger.Controls
InteropEmu.DebugGetState(ref state);
int tileIndexOffset = state.PPU.ControlFlags.BackgroundPatternAddr == 0x1000 ? 256 : 0;
_chrViewer.SelectedPaletteIndex = paletteIndex;
if(!InteropEmu.DebugIsExecutionStopped() || ConfigManager.Config.DebugInfo.PpuRefreshOnBreak) {
//Only change the palette if execution is not stopped (or if we're configured to refresh the viewer on break/pause)
//Otherwise, the CHR viewer will refresh its data (and it might not match the data we loaded at the specified scanline/cycle anymore)
_chrViewer.SelectedPaletteIndex = paletteIndex;
}
_chrViewer.SelectedTileIndex = tileIndex + tileIndexOffset;
OnSelectChrTile?.Invoke(null, EventArgs.Empty);
}

View file

@ -211,7 +211,11 @@ namespace Mesen.GUI.Debugger
private void ctrlSpriteViewer_OnSelectTilePalette(int tileIndex, int paletteIndex)
{
ctrlChrViewer.SelectedTileIndex = tileIndex;
ctrlChrViewer.SelectedPaletteIndex = paletteIndex;
if(!InteropEmu.DebugIsExecutionStopped() || ConfigManager.Config.DebugInfo.PpuRefreshOnBreak) {
//Only change the palette if execution is not stopped (or if we're configured to refresh the viewer on break/pause)
//Otherwise, the CHR viewer will refresh its data (and it might not match the data we loaded at the specified scanline/cycle anymore)
ctrlChrViewer.SelectedPaletteIndex = paletteIndex;
}
tabMain.SelectTab(tpgChrViewer);
}
}