Renamed gui to simulator as a better structure.

This commit is contained in:
2026-06-09 08:16:53 +02:00
parent 2df6a14610
commit f8ef6f030f
12 changed files with 153 additions and 34 deletions
+7 -9
View File
@@ -3,8 +3,8 @@ package main
import "core:log"
import "core:mem"
import chip "machine"
import gui "gui"
import emu "machine"
import sim "simulator"
DEV :: #config(DEV, false)
@@ -20,20 +20,18 @@ main :: proc() {
context.allocator = mem.tracking_allocator(&track)
}
// Init the Chip 8 "cpu"
system := chip.init()
// Init the emu 8 "cpu"
system := emu.init()
// TODO: move this into a gui component
// load rom, hardcoded for now, will eventually be cli or gui
err := chip.load_rom(&system, "./test_roms/7-beep.ch8")
err := emu.load_rom(&system, "./test_roms/7-beep.ch8")
if err != nil {
panic("failed to load rom!")
}
// gui will init the layout etc, it will require reference to
// the system as it will use its display buffer etc
// NOTE: may just need a few fields rather than whole struct check later
gui.init_gui(&system)
// Initilize sim, gui etc
sim.run_simulator(&system)
when DEV {
if len(track.allocation_map) > 0 {