Documentation ¶
Overview ¶
Decoding and encoding of ZX Spectrum emulator file formats
Index ¶
Constants ¶
View Source
const ( TAP_FILE_PROGRAM = 0 TAP_FILE_NUMBER_ARRAY = 1 TAP_FILE_CHARACTER_ARRAY = 2 TAP_FILE_CODE = 3 TAP_BLOCK_HEADER = 0x00 TAP_BLOCK_DATA = 0xff )
View Source
const ( TStatesPerFrame = 69888 InterruptLength = 32 )
View Source
const ( FORMAT_SNA = iota FORMAT_Z80 FORMAT_TAP )
View Source
const ( ENCAPSULATION_NONE = iota ENCAPSULATION_ZIP )
Variables ¶
This section is empty.
Functions ¶
func ReadProgram ¶
Read a program from the specified file. Return the program and errors if any. The file can be compressed.
Types ¶
type FormatInfo ¶
func DetectFormat ¶
func DetectFormat(filePath string) (*FormatInfo, error)
Determines the format of the specified file based on its name, or based on the names of embedded files in case the file is an archive. Returns an error if the format could not be detected.
type FullSnapshot ¶
func (*FullSnapshot) CpuState ¶
func (s *FullSnapshot) CpuState() CpuState
func (*FullSnapshot) EncodeSNA ¶
func (s *FullSnapshot) EncodeSNA() ([]byte, error)
Turn snapshot into binary data (SNA format)
func (*FullSnapshot) Memory ¶
func (s *FullSnapshot) Memory() *[48 * 1024]byte
func (*FullSnapshot) UlaState ¶
func (s *FullSnapshot) UlaState() UlaState
type SnapshotData ¶
type SnapshotData []byte
func (SnapshotData) Decode ¶
func (data SnapshotData) Decode(format int) (Snapshot, error)
Decode a snapshot from binary data. The filename is a hint used to determine the snapshot format.
func (SnapshotData) DecodeSNA ¶
func (data SnapshotData) DecodeSNA() (*SNA, error)
Decode SNA from binary data
func (SnapshotData) DecodeZ80 ¶
func (data SnapshotData) DecodeZ80() (*Z80, error)
Decode [Z80 snapshot] from binary data
type ZipArchive ¶
type ZipArchive struct {
// contains filtered or unexported fields
}
func ReadZipFile ¶
func ReadZipFile(filePath string) (*ZipArchive, error)
func (*ZipArchive) Filenames ¶
func (a *ZipArchive) Filenames() []string
Click to show internal directories.
Click to hide internal directories.