Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/app-android/app/views/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ export class MainController implements MainView {
showNotification: (key) => {
notificationService.showNotification({ title: _(NOTIFICATION_TITLES[key] || key), timeout: 2 });
},
updateDebugInfo: (simulator) => {
debuggerView.updateDebugInfo(simulator);
},
});

this.mainBridge = new MainEventBridge({
Expand Down
6 changes: 0 additions & 6 deletions packages/app-gnome/src/views/main.window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,12 +712,6 @@ export class MainWindow extends Adw.ApplicationWindow implements MainView {
timeout: 2,
});
},
updateDebugInfo: (simulator) => {
// If stepper is enabled, update full debugger; otherwise just debug info
if (this._gameConsole.simulator.stepperEnabled) {
this.updateDebugger();
}
},
});
this.gameConsoleBridge.connect();
}
Expand Down
3 changes: 0 additions & 3 deletions packages/app-web/src/app/main-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,6 @@ export class MainWindow implements MainView {
},
updateUiState: () => this.updateRunActions(this.simulator.state),
showNotification: (key) => this.showToast(NOTIFICATION_TITLES[key] ?? key),
updateDebugInfo: () => {
if (this.simulator.stepperEnabled) this.updateDebugger();
},
});
this.bridge.connect();

Expand Down
16 changes: 10 additions & 6 deletions packages/common-ui/src/controller/game-console-event-bridge.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SimulatorState, _ } from "@learn6502/core";
import type { Assembler, Simulator } from "@learn6502/core";
import type { Assembler } from "@learn6502/core";
import { gameConsoleController } from "./game-console-controller.ts";
import { debuggerController } from "./debugger-controller.ts";

Expand Down Expand Up @@ -27,9 +27,6 @@ export interface GameConsoleEventBridgeCallbacks {

/** Show a notification with a translatable key. */
showNotification(key: string): void;

/** Called when a step/multistep/goto occurs and debugger may need update. */
updateDebugInfo(simulator: Simulator): void;
}

type EventUnsubscriber = () => void;
Expand Down Expand Up @@ -125,8 +122,15 @@ export class GameConsoleEventBridge {
if (signal.message) {
this.callbacks.formatAndLog(signal.message, signal.params);
}
if (signal.simulator) {
this.callbacks.updateDebugInfo(signal.simulator);
// "step" is not the Step button: Simulator.execute() emits it for every
// executed instruction, and a free run runs execute() 97 times per
// multiExecute() tick. Refreshing the debugger here is therefore only
// affordable while the stepper is on — multiExecute() then returns
// early, so one event is one press of Step, and the memory monitor has
// to be redrawn or the step leaves stale bytes on screen. A free run is
// covered by the "multistep" handler below, whose update is throttled.
if (signal.simulator.stepperEnabled) {
this.callbacks.updateDebugger();
}
});

Expand Down
Loading