types

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeSJIS

func DecodeSJIS(sjis []byte) string

func EncodeSJIS

func EncodeSJIS(s string) []byte

Types

type MDColor

type MDColor struct {
	R uint8
	G uint8
	B uint8
	A uint8
}

func NewMDColor

func NewMDColor() *MDColor

func (*MDColor) FromValue

func (mdcolor *MDColor) FromValue(v uint16)

func (*MDColor) ToRGBA

func (mdcolor *MDColor) ToRGBA() color.RGBA

func (*MDColor) ToValue

func (mdcolor *MDColor) ToValue() uint16

type MDCompressor

type MDCompressor interface {
	Marshal() []byte
	Unmarshal() []byte
}

func NewMDCompressor

func NewMDCompressor(algorithm string, rom generic.ROM) MDCompressor

type MDCompressor_SEGARD

type MDCompressor_SEGARD struct {
	ROM generic.ROM
}

func (*MDCompressor_SEGARD) Marshal

func (segard *MDCompressor_SEGARD) Marshal() []byte

func (*MDCompressor_SEGARD) Unmarshal

func (segard *MDCompressor_SEGARD) Unmarshal() []byte

type MDHeader

type MDHeader struct {
	Type               string
	Copyright          string
	DomesticTitle      string
	InternationalTitle string
	SerialNumber       string
	Checksum           uint16
	Devices            string
	ROMStartAddress    uint32
	ROMEndAddress      uint32
	RAMStartAddress    uint32
	RAMEndAddress      uint32
	SRAMType           [4]byte
	SRAMStartAddress   uint32
	SRAMEndAddress     uint32
	Modem              string
	Reserved1          [40]byte
	Region             string
	Reserved2          [13]byte
}

func (*MDHeader) Marshal

func (header *MDHeader) Marshal() []byte

func (*MDHeader) Unmarshal

func (header *MDHeader) Unmarshal(data []byte)

type MDPCM

type MDPCM struct {
	Channels   int
	SampleRate int
}

func (*MDPCM) FromWAV

func (pcm *MDPCM) FromWAV(data []byte) ([]byte, error)

func (*MDPCM) ToWAV

func (pcm *MDPCM) ToWAV(data []byte) ([]byte, error)

type MDPalette

type MDPalette struct {
	Colors []MDColor
}

func NewMDPalette

func NewMDPalette(data []byte) (palette *MDPalette)

type MDROM

type MDROM struct {
	generic.ROM
	Header MDHeader
}

func NewMDROM

func NewMDROM(filename string) (mdrom *MDROM, err error)

func (*MDROM) Init

func (rom *MDROM) Init()

func (*MDROM) UpdateChecksum

func (rom *MDROM) UpdateChecksum()

func (*MDROM) UpdateHeader

func (rom *MDROM) UpdateHeader()

type MDRawHeader

type MDRawHeader struct {
	Type               [16]byte
	Copyright          [16]byte
	DomesticTitle      [48]byte
	InternationalTitle [48]byte
	SerialNumber       [14]byte
	Checksum           [2]byte
	Devices            [16]byte
	ROMStartAddress    [4]byte
	ROMEndAddress      [4]byte
	RAMStartAddress    [4]byte
	RAMEndAddress      [4]byte
	SRAMType           [4]byte
	SRAMStartAddress   [4]byte
	SRAMEndAddress     [4]byte
	Modem              [12]byte
	Reserved1          [40]byte
	Region             [3]byte
	Reserved2          [13]byte
}

type MDTiles

type MDTiles struct {
	Raw    []byte
	Width  int
	Height int
	Bpp    int
}

func NewMDTiles

func NewMDTiles(data []byte, width int, bpp int) *MDTiles

func (*MDTiles) FromData

func (tiles *MDTiles) FromData(data []byte)

func (*MDTiles) ReadPixel

func (tiles *MDTiles) ReadPixel(x, y int) (value byte)

func (*MDTiles) ToPNG

func (tiles *MDTiles) ToPNG(mdpalette MDPalette) (img *image.RGBA)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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