govern

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: GPL-3.0 Imports: 0 Imported by: 2

Documentation

Overview

Package govern defines the types that define the current condition of the emulation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StateIntegrity added in v0.30.0

func StateIntegrity(state State, subState SubState) bool

StateIntegrity checks whether the combination of state, sub-state makes sense. The previous state is also required for a complete check.

Rules:

  1. NoSubState can coexist with any state

  2. PausedAtStart and PausedAtEnd can only be paired with the Paused State

  3. RewindingBackwards and RewindingForwards can only be paired with the Rewinding state

Types

type Mode

type Mode int

Mode inidicates the broad condition of the emulation. Currently defined to be debugger and play.

const (
	ModeNone Mode = iota
	ModeDebugger
	ModePlay
)

List of defined modes.

func (Mode) String

func (m Mode) String() string

type Quantum added in v0.25.0

type Quantum int

Quantum specifies the step granularity of the emulator.

const (
	QuantumInstruction Quantum = iota
	QuantumCycle
	QuantumClock
)

List of valid QuantumModes.

func (Quantum) String added in v0.25.0

func (q Quantum) String() string

type State

type State int

State indicates the emulation's state.

const (
	EmulatorStart State = iota
	Initialising
	Paused
	Stepping
	Rewinding
	Running
	Ending
)

List of possible emulation states.

EmulatorStart is the default state and should never be entered once the emulator has begun.

Initialising can be used when reinitialising the emulator. for example, when a new cartridge is being inserted.

Paused and Rewinding can have meaningful sub-states

func (State) String added in v0.21.0

func (s State) String() string

type SubState added in v0.30.0

type SubState int

SubState allows more detail for some states. NoSubState indicates that there is not more information to impart about the state

const (
	Normal SubState = iota
	RewindingBackwards
	RewindingForwards
	PausedAtStart
	PausedAtEnd
)

List of possible rewinding sub states

func (SubState) String added in v0.30.0

func (s SubState) String() string

Jump to

Keyboard shortcuts

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