Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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)
}

About

Decode a NES roms sprites as images

Topics

Resources

Releases

No releases published

Packages

No packages published

Languages