z80io

package
v0.0.0-...-4374a33 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package z80io can write z80 binary images. Currently, ZX Spectrum .sna files are supported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveSNA

func SaveSNA(filename string, m *SNAMachine) error

SaveSNA writes the given machine to the named file. The documentation for WriteSNA contains more information.

func WriteSNA

func WriteSNA(f *bufio.Writer, m *SNAMachine) error

WriteSNA writes the given machine as a SNA file. The writer is flushed before returning. The SNA format involves pushing PC onto the stack. Thus the written SP, and the two bytes of RAM before the given SP will not be the same as in the machine image. The SNAMachine is modified during saving, but it restored before the function returns.

Types

type SNAMachine

type SNAMachine struct {
	AF, BC, DE, HL, IX, IY uint16
	AF2, BC2, DE2, HL2     uint16
	SP                     uint16
	PC                     uint16
	I                      uint8
	R                      uint8
	IntEnabled             bool
	IntMode                uint8 // 0, 1 or 2.
	BorderColor            uint8 // 0 to 7.
	RAM                    []uint8
}

A SNAMachine describes the machine state of a 48k ZX Spectrum. Except for the ROM.

func NewSNAMachine

func NewSNAMachine(RAM []uint8) (*SNAMachine, error)

NewSNAMachine returns a newly initialised SNAMachine.

Jump to

Keyboard shortcuts

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