From ef2d8e9945e8f1d0f3a1ab46056fcab151464b8f Mon Sep 17 00:00:00 2001 From: Fred Sauer Date: Tue, 10 Mar 2026 22:08:22 -0700 Subject: [PATCH 1/2] Fix #212 stale gutter, anyTargetChanged->true Comment out implementation and have anyTargetChanged always return true. Holding off on deleting the function entirely, in case it needs to be brought back in the immediate future. --- src/worker/builder.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/worker/builder.ts b/src/worker/builder.ts index 99787948e..8f75487af 100644 --- a/src/worker/builder.ts +++ b/src/worker/builder.ts @@ -361,15 +361,16 @@ export function staleFiles(step: BuildStep, targets: string[]) { } export function anyTargetChanged(step: BuildStep, targets: string[]) { - if (!step.maxts) throw Error("call populateFiles() first"); - // see if any target files are more recent than inputs - for (var i = 0; i < targets.length; i++) { - var entry = store.workfs[targets[i]]; - if (!entry || entry.ts > step.maxts) - return true; - } - console.log("unchanged", step.maxts, targets); - return false; + // if (!step.maxts) throw Error("call populateFiles() first"); + // // see if any target files are more recent than inputs + // for (var i = 0; i < targets.length; i++) { + // var entry = store.workfs[targets[i]]; + // if (!entry || entry.ts > step.maxts) + // return true; + // } + // console.log("unchanged", step.maxts, targets); + // return false; + return true; // always rebuild to keep gutter in sync with source lines } export function fixParamsWithDefines(path: string, params) { From f1fa850e5a0a5c70bbc2db9c8f6e0ad06dac49c7 Mon Sep 17 00:00:00 2001 From: Fred Sauer Date: Wed, 25 Mar 2026 17:51:13 -0700 Subject: [PATCH 2/2] skip loadROM when binary output unchanged --- src/ide/ui.ts | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/ide/ui.ts b/src/ide/ui.ts index 3e016724e..672dc1a07 100644 --- a/src/ide/ui.ts +++ b/src/ide/ui.ts @@ -6,7 +6,7 @@ import { DebugEvalCondition, DebugSymbols, EmuState, isDebuggable, Platform, Pre import { EmuHalt, PLATFORMS } from "../common/emu"; import { StateRecorderImpl } from "../common/recorder"; import { - byteArrayToUTF8, decodeQueryString, getBasePlatform, getCookie, getFilenameForPath, getFilenamePrefix, + arrayCompare, byteArrayToUTF8, decodeQueryString, getBasePlatform, getCookie, getFilenameForPath, getFilenamePrefix, getRootBasePlatform, getWithBinary, hex, highlightDifferences, isProbablyBinary, loadScript, parseBool, stringToByteArray } from "../common/util"; import { FileData, WorkerError, WorkerResult } from "../common/workertypes"; @@ -932,20 +932,24 @@ async function setCompileOutput(data: WorkerResult) { // load ROM var rom = data.output; if (rom != null) { - try { - clearBreakpoint(); // so we can replace memory (TODO: change toolbar btn) - _resetRecording(); - await platform.loadROM(getCurrentPresetTitle(), rom, data.origin); - current_output = rom; - if (!userPaused) _resume(); - writeOutputROMFile(); - } catch (e) { - console.log(e); - toolbar.addClass("has-errors"); - showExceptionAsError(e, e + ""); - current_output = null; - refreshWindowList(); - return; + if (current_output && arrayCompare(rom, current_output)) { + console.log("unchanged, skipping loadROM"); + } else { + try { + clearBreakpoint(); // so we can replace memory (TODO: change toolbar btn) + _resetRecording(); + await platform.loadROM(getCurrentPresetTitle(), rom, data.origin); + current_output = rom; + if (!userPaused) _resume(); + writeOutputROMFile(); + } catch (e) { + console.log(e); + toolbar.addClass("has-errors"); + showExceptionAsError(e, e + ""); + current_output = null; + refreshWindowList(); + return; + } } } // update all windows (listings)