Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e4d95da19c
Fetching contributors…

Cannot retrieve contributors at this time

file 33 lines (29 sloc) 0.517 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
package main

import (
"flag"
"io/ioutil"
"log"

"github.com/nictuku/chip-8/system"
)

func main() {
flag.Parse()
romPath := flag.Arg(0)
if romPath == "" {
log.Fatal("Missing ROM filename argument.")
}
log.Printf("Loading ROM from %v", romPath)
rom, err := ioutil.ReadFile(romPath)
if err != nil {
log.Fatal(err)
}

sys := system.New()
if err := sys.Init(); err != nil {
log.Println(err)
return
}
sys.LoadGame(rom)
if err := sys.Run(); err != nil {
log.Fatal(err)
}
log.Println("done")
}
Something went wrong with that request. Please try again.