Small cleanup formatting and new rom locations.

This commit is contained in:
2026-05-26 07:48:47 +02:00
parent bc9a282b52
commit e604880b4e
2 changed files with 26 additions and 26 deletions
+1 -2
View File
@@ -14,15 +14,14 @@ CYCLES_PER_FRAME :: 12
run_system :: proc(s: ^System) { run_system :: proc(s: ^System) {
rl.InitWindow(SCREEN_WITDH, SCREEN_HEIGHT, "chip8") rl.InitWindow(SCREEN_WITDH, SCREEN_HEIGHT, "chip8")
// Cap at 60hz/60fps
rl.SetTargetFPS(60) rl.SetTargetFPS(60)
for !rl.WindowShouldClose() { for !rl.WindowShouldClose() {
rl.BeginDrawing() rl.BeginDrawing()
rl.ClearBackground(rl.BLACK) rl.ClearBackground(rl.BLACK)
// Do a cpu cycle // Do a cpu cycle
// Cap at 60hz/60fps
for _ in 0..<CYCLES_PER_FRAME { for _ in 0..<CYCLES_PER_FRAME {
cycle(s) cycle(s)
} }
+3 -2
View File
@@ -23,8 +23,9 @@ main :: proc() {
system := chip.init() system := chip.init()
// load rom, hardcoded for now, will eventually be cli or gui // load rom, hardcoded for now, will eventually be cli or gui
// err := chip.load_rom(&system, "./2-ibm-logo.ch8") // err := chip.load_rom(&system, "./test_roms/2-ibm-logo.ch8")
err := chip.load_rom(&system, "./1-chip8-logo.ch8") // err := chip.load_rom(&system, "./test_roms/1-chip8-logo.ch8")
err := chip.load_rom(&system, "./test_roms/4-flags.ch8")
if err != nil { if err != nil {
panic("failed to load rom!") panic("failed to load rom!")
} }