Documentation ¶
Index ¶
- func GDemuTrackName(track gdi.Track) string
- type DirectoryReader
- func (r DirectoryReader) Close() error
- func (r DirectoryReader) FileSize(filename string) (uint64, error)
- func (r DirectoryReader) FindCueFile() (io.ReadCloser, string, error)
- func (r DirectoryReader) FindGDIFile() (io.ReadCloser, string, error)
- func (r DirectoryReader) OpenFile(filename string) (io.ReadCloser, error)
- func (r DirectoryReader) Rx() uint64
- type DirectoryWriter
- type Game
- type IPBin
- type Peripheral
- type Reader
- type Region
- type Track
- type Writer
- type WriterConfig
- type ZipFileReader
- func (r ZipFileReader) Close() error
- func (r ZipFileReader) FileSize(filename string) (uint64, error)
- func (r ZipFileReader) FindCueFile() (io.ReadCloser, string, error)
- func (r ZipFileReader) FindGDIFile() (io.ReadCloser, string, error)
- func (r ZipFileReader) OpenFile(filename string) (io.ReadCloser, error)
- func (r ZipFileReader) Rx() uint64
- type ZipFileWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GDemuTrackName ¶
GDemuTrackName is a track renaming function that names each track how a GDemu device expects them
Types ¶
type DirectoryReader ¶
type DirectoryReader struct {
// contains filtered or unexported fields
}
DirectoryReader reads a Dreamcast game from a directory
func NewDirectoryReader ¶
func NewDirectoryReader(directory string) (r *DirectoryReader, err error)
NewDirectoryReader returns a DirectoryReader using the passed directory path
func (DirectoryReader) FileSize ¶
func (r DirectoryReader) FileSize(filename string) (uint64, error)
FileSize returns the size of the named file
func (DirectoryReader) FindCueFile ¶
func (r DirectoryReader) FindCueFile() (io.ReadCloser, string, error)
FindCueFile reads the directory and returns an io.ReadCloser for, and the filename of, the first cue file found
func (DirectoryReader) FindGDIFile ¶
func (r DirectoryReader) FindGDIFile() (io.ReadCloser, string, error)
FindGDIFile reads the directory and returns an io.ReadCloser for, and the filename of, the first GDI file found
func (DirectoryReader) OpenFile ¶
func (r DirectoryReader) OpenFile(filename string) (io.ReadCloser, error)
OpenFile returns an io.ReadCloser for the named file
func (DirectoryReader) Rx ¶
func (r DirectoryReader) Rx() uint64
Rx returns the number of bytes read
type DirectoryWriter ¶
type DirectoryWriter struct {
// contains filtered or unexported fields
}
DirectoryWriter writes a Dreamcast game to a directory
func NewDirectoryWriter ¶
func NewDirectoryWriter(directory string, config WriterConfig) (*DirectoryWriter, error)
NewDirectoryWriter returns a DirectoryWriter using the passed directory path and config
func (DirectoryWriter) Config ¶
func (w DirectoryWriter) Config() WriterConfig
Config returns the WriterConfig associated with this writer
func (*DirectoryWriter) CreateFile ¶
func (w *DirectoryWriter) CreateFile(filename string) (io.WriteCloser, error)
CreateFile creates the named file in the directory and returns an io.WriteCloser for it
func (DirectoryWriter) Tx ¶
func (w DirectoryWriter) Tx() uint64
Tx returns the number of bytes written
type Game ¶
type Game struct { // GDIFile is the name of the GDI file that was read GDIFile string // CueFile is the name of the cue file that was read CueFile string // IPBin represents the IP.BIN initial program found in the third track IPBin *IPBin // contains filtered or unexported fields }
Game represents a Sega Dreamcast game image
type IPBin ¶
type IPBin struct { HardwareID string MakerID string CRC uint16 Disc int TotalDiscs int Regions Region Peripherals uint32 ProductNumber string ProductVersion string ReleaseDate time.Time BootFilename string Producer string SoftwareName string TOC []Track // contains filtered or unexported fields }
IPBin represents the IP.BIN initial program. It implements the encoding.BinaryUnmarshaler interface.
func (*IPBin) UnmarshalBinary ¶
UnmarshalBinary decodes the IP.BIN from binary form
type Peripheral ¶
type Peripheral int
Peripheral maps to each peripheral option
const ( PeripheralWindowsCE Peripheral = 1 << iota PeripheralVGABox PeripheralOtherExpansions PeripheralVibrationPack PeripheralMicrophone PeripheralMemoryCard PeripheralStartABDirections PeripheralCButton PeripheralDButton PeripheralXButton PeripheralYButton PeripheralZButton PeripheralExpandedDirections PeripheralRTrigger PeripheralLTrigger PeripheralHorizontal PeripheralVertical PeripheralExpandedHorizontal PeripheralExpandedVertical PeripheralGun PeripheralKeyboard PeripheralMouse )
These are the individual peripherals
func (Peripheral) IsSet ¶
func (p Peripheral) IsSet(peripherals uint32) bool
IsSet returns true if the given peripheral is set
type Reader ¶
type Reader interface { // Close closes the source Close() error // FindGDIFile returns an io.ReadCloser opened on, and the filename // of, the first GDI file found FindGDIFile() (io.ReadCloser, string, error) // FindCueFile returns an io.ReadCloser opened on, and the filename // of, the first cue sheet found FindCueFile() (io.ReadCloser, string, error) // OpenFile returns an io.ReadCloser opened on the named file OpenFile(string) (io.ReadCloser, error) // FileSize returns the size of the named file FileSize(string) (uint64, error) // Rx returns the number of bytes read Rx() uint64 }
Reader is the interface implemented by an object that can be used as a source for reading a Dreamcast game image from disk
type Region ¶
type Region [offsetPeripherals - offsetAreaSymbols]byte
Region represents the permitted regions
func (Region) IsRegionEurope ¶
IsRegionEurope returns true if Europe region is permitted
func (Region) IsRegionJapan ¶
IsRegionJapan returns true if Japan region is permitted
func (Region) IsRegionUSA ¶
IsRegionUSA returns true if USA region is permitted
type Track ¶
type Track struct { // Start refers to the first sector of the track Start int // Length refers to the length of the track in sectors Length int // Type is the type of track, audio or data Type int }
Track represents a TOC entry found in the IP.BIN initial program
func (Track) IsAudioTrack ¶
IsAudioTrack returns true if the track is an audio track
func (Track) IsDataTrack ¶
IsDataTrack returns true if the track is a data track
type Writer ¶
type Writer interface { // Close closes the destination Close() error // CreateFile returns an io.WriteCloser opened on the named file CreateFile(string) (io.WriteCloser, error) // Config returns the WriterConfig associated with this writer Config() WriterConfig // Tx returns the number of bytes written Tx() uint64 }
Writer is the interface implemented by an object that can be used as a destination for writing a Dreamcast game image to disk
type WriterConfig ¶
type WriterConfig struct { // CueFile is the target filename for a cue file CueFile string // GDIFile is the target filename for a GDI file GDIFile string // TrackRename is a function to rename tracks. The function is passed // a gdi.Track object and returns a string representing the desired // filename TrackRename func(gdi.Track) string // TrimWhitespace controls whether extra passing whitespace is removed // from either the GDI or cue file where applicable TrimWhitespace bool }
WriterConfig contains the configuration of the Writer
type ZipFileReader ¶
type ZipFileReader struct {
// contains filtered or unexported fields
}
ZipFileReader reads a Dreamcast game from a zip archive
func NewZipFileReader ¶
func NewZipFileReader(zipFile string) (r *ZipFileReader, err error)
NewZipFileReader returns a ZipFileReader using the passed zip file path
func (ZipFileReader) FileSize ¶
func (r ZipFileReader) FileSize(filename string) (uint64, error)
FileSize returns the size of the named file
func (ZipFileReader) FindCueFile ¶
func (r ZipFileReader) FindCueFile() (io.ReadCloser, string, error)
FindCueFile reads the zip file and returns an io.ReadCloser for, and the filename of, the first cue file found
func (ZipFileReader) FindGDIFile ¶
func (r ZipFileReader) FindGDIFile() (io.ReadCloser, string, error)
FindGDIFile reads the zip file and returns an io.ReadCloser for, and the filename of, the first GDI file found
func (ZipFileReader) OpenFile ¶
func (r ZipFileReader) OpenFile(filename string) (io.ReadCloser, error)
OpenFile returns an io.ReadCloser for the named file
type ZipFileWriter ¶
type ZipFileWriter struct {
// contains filtered or unexported fields
}
ZipFileWriter writes a Dreamcast game to a zip archive
func NewZipFileWriter ¶
func NewZipFileWriter(filename string, config WriterConfig) (*ZipFileWriter, error)
NewZipFileWriter returns a ZipFileWriter using the passed zip file path and config
func (ZipFileWriter) Config ¶
func (w ZipFileWriter) Config() WriterConfig
Config returns the WriterConfig associated with this writer
func (ZipFileWriter) CreateFile ¶
func (w ZipFileWriter) CreateFile(filename string) (io.WriteCloser, error)
CreateFile create the named file in the zip file and returns an io.WriteCloser for it