Skip to content
Decode a NES roms sprites as images
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
testdata
README.md
nes.go
nes_test.go

README.md

nes

GoDoc Go Report Card

Package nes registers a custom image format for reading NES ROMs. After importing it with _ you can use image.Decode to decode a roms sprites into an image.Image.

Super Mario Bros 1 Sprites

Examples

Decode

Decode reads a NES ROM and returns it as an image.Image.

package main

import (
	"fmt"
	"image"
	"log"
	"os"

	_ "github.com/bake/nes"
)

func main() {
	// This rom file does not contain any game logic.
	r, err := os.Open("testdata/super_mario_bros_sprites.nes")
	if err != nil {
		log.Fatal(err)
	}
	defer r.Close()
	_, format, err := image.Decode(r)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(format)
}
You can’t perform that action at this time.