WIP
This commit is contained in:
25
main.go
25
main.go
@@ -1,9 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"gb-player/ui"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
// "gb-player/ui"
|
||||
"gb-player/gb"
|
||||
)
|
||||
|
||||
var running = true
|
||||
|
||||
func main() {
|
||||
// FIXME(m): Allow specifying rom file on command line
|
||||
// if len(os.Args) != 2 {
|
||||
@@ -12,5 +18,20 @@ func main() {
|
||||
// romPath := os.Args[1]
|
||||
romPath := "./roms/dmg-acid2.gb"
|
||||
|
||||
ui.Run(romPath)
|
||||
// ui.Run(romPath)
|
||||
|
||||
console, err := gb.NewConsole(romPath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
running := true
|
||||
for running {
|
||||
if !console.CPU.Step() {
|
||||
fmt.Println("CPU stopped")
|
||||
running = false
|
||||
} else {
|
||||
fmt.Println("CPU step")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user