Something went wrong. Try again.
A device emulator for screen-and-buttons firmware: your own C compiled to WebAssembly, driven by a browser page the firmware itself describes. Freeze, annotate and replay; diff the emulator against real hardware.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233// A rolling buffer of the firmware's own log lines (env.js_log, emu_abi.h:// "This is the firmware's printf"), shown in an on-page console pane. Also// mirrored to the real devtools console, and readable back out for a freeze// bundle (see freeze.ts).
export interface LogLine { t: number; text: string;}
export class ConsoleLog { lines: LogLine[] = []; private max: number; private onLine?: (line: LogLine) => void;
constructor(max = 500, onLine?: (line: LogLine) => void) { this.max = max; this.onLine = onLine; }
push(text: string): void { const line: LogLine = { t: performance.now(), text }; this.lines.push(line); if (this.lines.length > this.max) this.lines.shift(); console.log("[fw]", text); this.onLine?.(line); }
recent(n: number): LogLine[] { return this.lines.slice(-n); }}