More work on CPU

This commit is contained in:
Michael Smith
2025-08-21 19:53:41 +02:00
parent b72667947f
commit 6e3149d093
8 changed files with 226 additions and 102 deletions

20
main.go
View File

@@ -3,6 +3,7 @@ package main
import (
"fmt"
"log"
"os"
// "gb-player/ui"
"gb-player/gb"
@@ -12,11 +13,10 @@ var running = true
func main() {
// FIXME(m): Allow specifying rom file on command line
// if len(os.Args) != 2 {
// log.Fatalln("No rom file specified")
// }
// romPath := os.Args[1]
romPath := "./roms/dmg-acid2.gb"
if len(os.Args) != 2 {
log.Fatalln("No rom file specified")
}
romPath := os.Args[1]
// ui.Run(romPath)
@@ -25,15 +25,9 @@ func main() {
log.Fatal(err)
}
fmt.Println("Executing instructions")
running := true
for running {
err := console.CPU.Step()
if err != nil {
fmt.Println(err)
running = false
fmt.Println("CPU stopped")
} else {
fmt.Println("CPU step")
}
console.CPU.Step()
}
}