fixture

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fixture makes tiny files for tests that have the headers real games have and nothing else: no game's code or data, only the marks the checks in gameid look for. Everything here is written byte by byte, so no game is ever in this repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Boot

func Boot(mark string) []byte

Boot makes a disc whose first sector starts with a console's mark.

func CIA

func CIA(program []byte, flags uint16, titleHigh uint32) []byte

CIA wraps a program in an install package. flags go in the table of contents, and titleHigh is the high half of its title id.

func CSO

func CSO(plain []byte) []byte

CSO compresses a disc the way a .cso does: raw deflate, block by block.

func DOL

func DOL(wii bool) []byte

DOL is a GameCube program with one text section, or with wii one that loads into the Wii's second bank of memory.

func DolphinCISO

func DolphinCISO(disc []byte) []byte

DolphinCISO packs a disc the way Dolphin's .ciso does: every block stored.

func GB

func GB(title string) []byte

GB is a Game Boy cartridge.

func GBA

func GBA(title, code string) []byte

GBA is a Game Boy Advance cartridge.

func GCZ

func GCZ(disc []byte) []byte

GCZ compresses a disc the way Dolphin's .gcz does: one zlib stream per block.

func ISO

func ISO(system string, files ...DiscFile) []byte

ISO makes an ISO 9660 image with a system id and some files in its root folder.

func MasterSystem

func MasterSystem(gameGear bool) []byte

MasterSystem is a Master System or, with gameGear, Game Gear cartridge.

func MegaDrive

func MegaDrive(title, serial string) []byte

MegaDrive is a Mega Drive cartridge.

func N64

func N64(title, code string) []byte

N64 is a cartridge in big-endian order.

func N64Swapped

func N64Swapped(title, code string) []byte

N64Swapped is the same in the byte-swapped .v64 order.

func NCCH

func NCCH(plain, newOnly bool, size int) []byte

NCCH is a 3DS program: plain, or marked as encrypted. newOnly marks it for the New 3DS.

func NCCHUnflagged

func NCCHUnflagged(size int) []byte

NCCHUnflagged is a program decrypted by a tool that left its NoCrypto flag unset: its extended header is plain, so its jump id is the program id.

func NDS

func NDS(title, code string) []byte

NDS is a DS cartridge.

func NES

func NES() []byte

NES is an iNES file.

func NRO

func NRO(title string) []byte

NRO is a Switch homebrew program with its name in its assets.

func NSP

func NSP(names ...string) []byte

NSP is a Switch install package listing these files.

func NintendoDisc

func NintendoDisc(id, title string, wii bool) []byte

NintendoDisc is the start of a GameCube disc, or with wii a Wii one.

func PKG

func PKG(kind uint16, contentID string) []byte

PKG is the header of a PlayStation install package: kind 1 for a PS3's, 2 for a PSP's.

func PS1

func PS1(serial string) []byte

PS1 is a PlayStation disc.

func PS2

func PS2(serial string) []byte

PS2 is a PlayStation 2 disc.

func PS3

func PS3(title, id string) []byte

PS3 is a PlayStation 3 disc: PS3_DISC.SFB at the top, and PS3_GAME/PARAM.SFO.

func PSP

func PSP(title, id string) []byte

PSP is a PSP disc. The PSP_GAME folder holds a PARAM.SFO.

func RPX

func RPX() []byte

RPX is the header of a Wii U program.

func Raw

func Raw(plain []byte) []byte

Raw makes a raw image out of a plain one: each 2048-byte sector gets a 16-byte header (mode 1 style) and the rest of a 2352-byte frame.

func SFO

func SFO(values ...[2]string) []byte

SFO makes a PARAM.SFO of text values.

func SNES

func SNES(title string) []byte

SNES is a LoROM cartridge with a good checksum pair.

func Scrambled

func Scrambled(size int) []byte

Scrambled stands for a program under a package's own encryption: it has no mark.

func WAD

func WAD(titleType uint32, code string) []byte

WAD is a Wii install package whose title has this type (the high half of its id) and four-letter code.

func WBFS

func WBFS(header []byte) []byte

WBFS puts a Wii disc's header into a .wbfs with 512-byte sectors.

func WIA

func WIA(header []byte, discType uint32, rvz bool) []byte

WIA makes the headers of a .wia, or with rvz a .rvz, holding a disc whose first bytes are header. discType is 1 for a GameCube disc and 2 for a Wii one.

func WUA

func WUA() []byte

WUA is an empty Cemu archive: only its footer.

func WUD

func WUD(code string) []byte

WUD is the start of a Wii U disc image.

func WUX

func WUX(code string) []byte

WUX compresses that the way a .wux does, with the disc's first sector stored second.

func XBE

func XBE(title string, titleID uint32) []byte

XBE is an Xbox program with a certificate naming it.

func XCI

func XCI() []byte

XCI is the start of a Switch game card image.

func XISO

func XISO(base int, title string, titleID uint32) map[int][]byte

XISO is an Xbox disc whose top folder holds default.xbe. The game's file system starts at base: 0 for an .xiso, or where a full disc image has it.

Types

type DiscFile

type DiscFile struct {
	Name string
	Data []byte
}

DiscFile is one file on a fixture disc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL