Updated main to be wasm friendly.

Updated code to use an init, update, shutdown and should_run proc.
To get it ready to use wasm for the web build requires this structure.
This commit is contained in:
2026-06-25 06:24:24 +02:00
parent 30a37f26c5
commit eded8b60b7
+17 -4
View File
@@ -3,8 +3,8 @@ package main
import "core:log"
import "core:mem"
import emu "machine"
import sim "simulator"
import emu "../machine"
import sim "../simulator"
DEV :: #config(DEV, false)
@@ -22,9 +22,22 @@ main :: proc() {
// Init the emu 8 "cpu"
system := emu.init()
s := sim.Simulator {
machine = &system,
rom_loaded = false,
paused = true,
step = false,
cpu_hz = 700,
disasm_follow = true,
}
// Initilize sim, gui etc
sim.run_simulator(&system)
sim.init(&s)
for sim.should_run() {
sim.update(&s)
}
sim.shutdown(&s)
when DEV {
if len(track.allocation_map) > 0 {