spectrum

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package spectrum implements de ZX Spectrum machine

Index

Constants

View Source
const (
	JoystickNone = iota
	JoystickKempston
)

Joystick models

View Source
const (
	ZxKey1 = iota
	ZxKey2
	ZxKey3
	ZxKey4
	ZxKey5
	ZxKey6
	ZxKey7
	ZxKey8
	ZxKey9
	ZxKey0

	ZxKeyQ
	ZxKeyW
	ZxKeyE
	ZxKeyR
	ZxKeyT
	ZxKeyY
	ZxKeyU
	ZxKeyI
	ZxKeyO
	ZxKeyP

	ZxKeyA
	ZxKeyS
	ZxKeyD
	ZxKeyF
	ZxKeyG
	ZxKeyH
	ZxKeyJ
	ZxKeyK
	ZxKeyL
	ZxKeyEnter

	ZxKeyCapsShift
	ZxKeyZ
	ZxKeyX
	ZxKeyC
	ZxKeyV
	ZxKeyB
	ZxKeyN
	ZxKeyM
	ZxKeySymbolShift
	ZxKeySpace
)

ZX Spectrum Keys

Variables

This section is empty.

Functions

func New

func New(model int) machine.Machine

New returns a new ZX Spectrum

Types

type Joystick

type Joystick struct {
	// contains filtered or unexported fields
}

Joystick emulation

func NewJoystick

func NewJoystick() *Joystick

NewJoystick creates the spectrum joystick

func (*Joystick) GetKempston

func (joy *Joystick) GetKempston() byte

GetKempston gets kempston status

func (*Joystick) Init

func (joy *Joystick) Init()

Init initializes the device

func (*Joystick) Reset

func (joy *Joystick) Reset()

Reset resets the device

func (*Joystick) SetAxis

func (joy *Joystick) SetAxis(axis byte, value byte)

SetAxis sets axis value

func (*Joystick) SetButton

func (joy *Joystick) SetButton(button byte, state byte)

SetButton sets button state

type Keyboard

type Keyboard struct {
	// contains filtered or unexported fields
}

Keyboard is the ZX Spectrum Keyboard

func NewKeyboard

func NewKeyboard() *Keyboard

NewKeyboard creates a new keyboard

func (*Keyboard) Init

func (keyboard *Keyboard) Init()

Init initializes the keyboard

func (*Keyboard) ProcessKeyEvent added in v0.20.0

func (keyboard *Keyboard) ProcessKeyEvent(event *keyboard.KeyEvent)

ProcessKeyEvent processes the keyboard events

func (*Keyboard) Reset

func (keyboard *Keyboard) Reset()

Reset resets the keyboard

type Spectrum

type Spectrum struct {
	// contains filtered or unexported fields
}

Spectrum the ZX Spectrum

func (*Spectrum) BeginFrame

func (spectrum *Spectrum) BeginFrame()

BeginFrame begin emulation frame tasks

func (*Spectrum) CPU

func (spectrum *Spectrum) CPU() cpu.CPU

CPU gets the machine CPU

func (*Spectrum) Clock

func (spectrum *Spectrum) Clock() device.Clock

Clock gets the machine clock

func (*Spectrum) Components

func (spectrum *Spectrum) Components() *device.Components

Components gets the machine components

func (*Spectrum) Config

func (spectrum *Spectrum) Config() *machine.Config

Config gets the machine info

func (*Spectrum) Emulate

func (spectrum *Spectrum) Emulate()

Emulate one machine step

func (*Spectrum) EndFrame

func (spectrum *Spectrum) EndFrame()

EndFrame end emulation frame tasks

func (*Spectrum) Init

func (spectrum *Spectrum) Init()

Init initializes machine

func (*Spectrum) LoadFile

func (spectrum *Spectrum) LoadFile(filename string)

LoadFile loads a file into machine

func (*Spectrum) LoadState

func (spectrum *Spectrum) LoadState(snap *format.Snapshot)

LoadState loads a ZX Spectrum snapshot

func (*Spectrum) Reset

func (spectrum *Spectrum) Reset()

Reset resets the machine

func (*Spectrum) SaveState

func (spectrum *Spectrum) SaveState() *format.Snapshot

SaveState save ZX Spectrum state

func (*Spectrum) SetController

func (spectrum *Spectrum) SetController(control controller.Controller)

SetController connect controllers & components

func (*Spectrum) TakeSnapshot

func (spectrum *Spectrum) TakeSnapshot()

TakeSnapshot takes and saves snapshop of the machine state

func (*Spectrum) VideoMemory

func (spectrum *Spectrum) VideoMemory() *memory.Bank

VideoMemory gets the video memory bank

type TVVideo added in v0.20.0

type TVVideo struct {
	// contains filtered or unexported fields
}

TVVideo is the spectrum RF video device

func NewTVVideo

func NewTVVideo(spectrum *Spectrum) *TVVideo

NewTVVideo creates the video device

func (*TVVideo) DoScanlines added in v0.20.0

func (tv *TVVideo) DoScanlines()

DoScanlines refresh TV scanlines

func (*TVVideo) EndFrame added in v0.20.0

func (tv *TVVideo) EndFrame()

EndFrame updates screen video frame

func (*TVVideo) Init added in v0.20.0

func (tv *TVVideo) Init()

Init initializes video device

func (*TVVideo) Reset added in v0.20.0

func (tv *TVVideo) Reset()

Reset resets video device

func (*TVVideo) Screen added in v0.20.0

func (tv *TVVideo) Screen() *video.Screen

Screen the video screen

func (*TVVideo) SetAccurate added in v0.20.0

func (tv *TVVideo) SetAccurate(accurate bool)

SetAccurate sets de video emulation algorithm

func (*TVVideo) SetBorder added in v0.20.0

func (tv *TVVideo) SetBorder(colour byte)

SetBorder sets de current border color

type ULA

type ULA struct {
	// contains filtered or unexported fields
}

ULA is the Unit Logic Array

func NewULA

func NewULA(spectrum *Spectrum) *ULA

NewULA creates

func (*ULA) Init

func (ula *ULA) Init()

Init initializes ULA

func (*ULA) Read

func (ula *ULA) Read(address uint16) byte

Read bus at address

func (*ULA) Reset

func (ula *ULA) Reset()

Reset resets ULA

func (*ULA) Write

func (ula *ULA) Write(address uint16, data byte)

Write bus at address

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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