Documentation ¶
Overview ¶
Package machine contains 8bit machine and coponents implementation
Index ¶
Constants ¶
View Source
const ( UnknownMachine = iota ZXSpectrum AmstradCPC ZX8081 // NOT IMPLEMENTED Commodore64 // NOT IMPLEMENTED MSX // NOT IMPLEMENTED )
Machines
View Source
const ( UnknownModel = iota ZXSpectrum16k ZXSpectrum48k AmstradCPC464 ZX80 // NOT IMPLEMENTED ZX81 // NOT IMPLEMENTED CommodoreC64 // NOT IMPLEMENTED MSX1 // NOT IMPLEMENTED )
Machine models
View Source
const DefaultModel = ZXSpectrum48k
DefaultModel default machine model is ZX Spectrum 48k
Variables ¶
View Source
var MachineModels = map[int][]int{ ZXSpectrum: {ZXSpectrum16k, ZXSpectrum48k}, AmstradCPC: {AmstradCPC464}, ZX8081: {ZX80, ZX81}, Commodore64: {CommodoreC64}, MSX: {MSX1}, }
MachineModels machines and models mapping
View Source
var Machines = map[string]int{ "zxspectrum": ZXSpectrum, "amstradcpc": AmstradCPC, "zx80": ZX8081, "zx81": ZX8081, "commodore64": Commodore64, "msx": MSX, }
Machines machine name mapping
View Source
var Models = map[string]int{ "zxspectrum16k": ZXSpectrum16k, "zx16k": ZXSpectrum16k, "zxspectrum48k": ZXSpectrum48k, "zx48k": ZXSpectrum48k, "speccy": ZXSpectrum48k, "zx80": ZX80, "zx81": ZX81, "cpc464": AmstradCPC464, "c64": CommodoreC64, "msx1": MSX1, }
Models machine model name mapping
Functions ¶
func GetMachineFromModel ¶
GetMachineFromModel gets machine ID from model ID
Types ¶
type Config ¶
type Config struct { Model int // Machine model FPS float32 // Frames per second FrameTime time.Duration // Duration of a frame FrameTStates int // TStates per frame }
Config machine configuration
type Machine ¶
type Machine interface { device.Device // Is a device // Config gets the machine configuration Config() *Config // CPU the machine main CPU CPU() cpu.CPU // Components the machine components Components() *device.Components // SetController connects the machine to the controller SetController(controller.Controller) // BeginFrame begin emulation frame tasks BeginFrame() // Emulate one machine step Emulate() // EndFrame end emulation frame tasks EndFrame() // LoadFile loads a file into machine LoadFile(name string) // TakeSnap takes and saves snapshop of the machine state TakeSnapshot() }
Machine is a 8bit machine
func CreateFromModel ¶
CreateFromModel returns a machine from a model id
Click to show internal directories.
Click to hide internal directories.