Small cleanup formatting and new rom locations.
This commit is contained in:
@@ -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
@@ -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!")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user