Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertRomFormat(inpath string, outpath string) error
- func FileMD5(path string) (string, error)
- func FileSHA1(path string) (string, error)
- func FindProbableRomsInPath(path string) ([]string, error)
- func HasRomExtension(path string) bool
- type CodeDescription
- type FileInfo
- type Region
- type RomFile
Constants ¶
View Source
const ( CRC_CHECKSUM_START = 0x00001000 CRC_CHECKSUM_LENGTH = 0x00100000 CRC_CHECKSUM_END = CRC_CHECKSUM_START + CRC_CHECKSUM_LENGTH )
View Source
const ( FormatZ64 = "z64" FormatV64 = "v64" FormatN64 = "n64" )
View Source
const ( NTSC = "NTSC" PAL = "PAL" )
View Source
const ROM_HEADER_SIZE = 0x40
Variables ¶
View Source
var Extensions = []string{"bin", "rom", "d64", "n64", "u64", "v64", "z64"}
View Source
var FileFormats = map[string]string{ FormatZ64: "Big-endian", FormatV64: "Byte-swapped", FormatN64: "Little-endian", }
View Source
var MediaFormats = map[string]string{
"N": "Cartridge",
"D": "64DD Disk",
"C": "Cartridge for expandable game",
"E": "64DD Expansion",
"Z": "Aleck64 Cartridge",
}
View Source
var Regions = map[string]Region{ "7": {"7", "Beta", "Beta", NTSC}, "A": {"A", "JP/US", "Japan and USA", NTSC}, "B": {"B", "BRA", "Brazil", NTSC}, "C": {"C", "CHN", "China", PAL}, "D": {"D", "GER", "Germany", PAL}, "E": {"E", "USA", "USA", NTSC}, "F": {"F", "FRA", "France", PAL}, "G": {"G", "GW64-N", "Gateway 64 (NTSC)", NTSC}, "H": {"H", "NED", "Netherlands", PAL}, "I": {"I", "ITA", "Italy", PAL}, "J": {"J", "JPN", "Japan", NTSC}, "K": {"K", "KOR", "South Korea", NTSC}, "L": {"L", "GW64-P", "Gateway 64 (PAL)", PAL}, "N": {"N", "CAN", "Canada", NTSC}, "P": {"P", "EUR", "Europe", PAL}, "S": {"S", "ESP", "Spain", PAL}, "U": {"U", "AUS", "Australia", PAL}, "W": {"W", "NORD", "Scandinavia", PAL}, "X": {"X", "PAL/X", "PAL Regions", PAL}, "Y": {"Y", "PAL/Y", "PAL Regions", PAL}, }
Functions ¶
func ConvertRomFormat ¶
Converts a ROM to native Z64 format
func FindProbableRomsInPath ¶
Given a directory or file, filter down to paths that are probably ROM files based on their extensions.
func HasRomExtension ¶
Types ¶
type CodeDescription ¶
type FileInfo ¶
type FileInfo struct { Path string `json:"path" xml:"path"` Name string `json:"name" xml:"name"` Format CodeDescription `json:"format" xml:"format"` Size int `json:"size" xml:"size"` MD5 string `json:"md5" xml:"md5"` SHA1 string `json:"sha1" xml:"sha1"` CRC1 string `json:"crc1" xml:"crc1"` CRC2 string `json:"crc2" xml:"crc2"` }
type RomFile ¶
type RomFile struct { CRC1 string `json:"crc1" xml:"crc1"` CRC2 string `json:"crc2" xml:"crc2"` ImageName string `json:"image_name" xml:"image_name"` MediaFormat CodeDescription `json:"media_format" xml:"media_format"` CartridgeId string `json:"cartridge_id" xml:"cartridge_id"` Region Region `json:"region" xml:"region"` Version uint8 `json:"version" xml:"version"` CIC string `json:"cic" xml:"cic"` File FileInfo `json:"file" xml:"file"` }
func (*RomFile) CalcCRC ¶ added in v0.5.1
Calculate CRC1 (aka "CRC HI") and CRC2 (aka "CRC LO") for the given RomFile
This code is a direct port from the C implementation at http://n64dev.org/n64crc.html Since I don't understand the "why" behind this, I can't document it further.
Click to show internal directories.
Click to hide internal directories.