reflection

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: GPL-3.0, GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package reflection monitors the emulated hardware for conditions that would otherwise not be visible through normal emulation. The reflection system is stepped every video cycle.

Index

Constants

This section is empty.

Variables

View Source
var OverlayLabels = []string{"No overlay", "WSYNC", "Collisions", "HMOVE", "RSYNC", "Coprocessor"}

OverlayLabels are names/labels for the the Policy type values.

Functions

This section is empty.

Types

type Broker added in v0.2.1

type Broker interface {
	GetReflectionRenderer() Renderer
}

Broker implementations can identify a reflection.Renderer.

type Gatherer added in v0.14.0

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

Gatherer should be run (with the Check() function) every video cycle.

func NewGatherer added in v0.14.0

func NewGatherer(vcs *hardware.VCS) *Gatherer

NewGatherer is the preferred method of initialisation for the Monitor type.

func (*Gatherer) AddRenderer added in v0.14.0

func (ref *Gatherer) AddRenderer(renderer Renderer)

AddRenderer adds an implementation of the Renderer interface to the Reflector.

func (*Gatherer) EnableReflection added in v0.14.0

func (ref *Gatherer) EnableReflection(enabled bool)

EnableReflection implements the Reflector interface.

func (*Gatherer) NewFrame added in v0.14.0

func (ref *Gatherer) NewFrame(_ television.FrameInfo) error

NewFrame implements the television.FrameTrigger interface.

func (*Gatherer) Pause added in v0.14.0

func (ref *Gatherer) Pause(pause bool) error

Pause implements the television.PauseTrigger interface.

func (*Gatherer) Step added in v0.14.0

func (ref *Gatherer) Step(bank mapper.BankInfo) error

Step should be called every video cycle to record the current state of the emulation/system.

type Hmove added in v0.2.1

type Hmove struct {
	DelayCt  int
	Delay    bool
	Latch    bool
	RippleCt uint8
}

Hmove groups the HMOVE reflection information. It's too complex a property to distil into a single variable.

Ordering of the structure is important.

type Overlay added in v0.14.0

type Overlay int

Overlay is used to define the list of possible overlays that can be used to illustrate/visualise information in a ReflectedVideoStep instance.

We don't use this inside the reflection package itself but the type and associated values are useful and it makes sense to define them in this package.

const (
	OverlayNone Overlay = iota
	OverlayWSYNC
	OverlayCollision
	OverlayHMOVE
	OverlayRSYNC
	OverlayCoproc
)

List of valid Overlay values.

type ReflectedInfo added in v0.14.0

type ReflectedInfo int

ReflectedInfo identifies specific information that has been reflected in a ReflectedVideoStep instance.

We don't use this inside the reflection package itself but the type and associated values are useful and it makes sense to define them in this package.

const (
	WSYNC ReflectedInfo = iota
	Collision
	CXCLR
	HMOVEdelay
	HMOVEripple
	HMOVElatched
	RSYNCalign
	RSYNCreset
	CoprocessorActive
)

List of valid ReflectedInfo values.

type ReflectedVideoStep added in v0.14.0

type ReflectedVideoStep struct {
	CPU               execution.Result
	Collision         video.Collisions
	Bank              mapper.BankInfo
	Signal            signal.SignalAttributes
	Hmove             Hmove
	VideoElement      video.Element
	WSYNC             bool
	IsRAM             bool
	CoprocessorActive bool
	IsHblank          bool
	RSYNCalign        bool
	RSYNCreset        bool
}

ReflectedVideoStep packages together the details of the the last video step that would otherwise be difficult for a debugger to access.

It includes the CPU execution result, the bank from which the instruction originates, the video element that produced the last video pixel on screen; among other information.

Note that ordering of the structure is important. There's a saving of about 2MB per frame compared to the unoptimal ordering.

type Renderer

type Renderer interface {
	// Reflect sends a VideoStep instance to the Renderer.
	Reflect([]ReflectedVideoStep) error
}

Renderer implementations display or otherwise process VideoStep values.

Jump to

Keyboard shortcuts

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