Initial gui commit.

Very much WIP trying to find a good way to keep components self
contained and composable.
This commit is contained in:
2026-06-02 08:23:26 +02:00
parent 37da094469
commit cf572179ea
3 changed files with 137 additions and 6 deletions
+7 -6
View File
@@ -4,6 +4,7 @@ import "core:log"
import "core:mem"
import chip "machine"
import gui "gui"
DEV :: #config(DEV, false)
@@ -22,17 +23,17 @@ main :: proc() {
// Init the Chip 8 "cpu"
system := chip.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/2-ibm-logo.ch8")
// err := chip.load_rom(&system, "./test_roms/1-chip8-logo.ch8")
// err := chip.load_rom(&system, "./test_roms/4-flags.ch8")
err := chip.load_rom(&system, "./test_roms/6-keypad.ch8")
err := chip.load_rom(&system, "./test_roms/7-beep.ch8")
if err != nil {
panic("failed to load rom!")
}
// start the cycle
chip.run_system(&system)
// 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)
when DEV {
if len(track.allocation_map) > 0 {