More work on CPU
This commit is contained in:
20
main.go
20
main.go
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user