diff --git a/src/ide/ui.ts b/src/ide/ui.ts index 3e016724..672dc1a0 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) diff --git a/src/worker/builder.ts b/src/worker/builder.ts index 99787948..8f75487a 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) {