reflection

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: GPL-3.0, GPL-3.0 Imports: 6 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 run every video cycle.

Index

Constants

This section is empty.

Variables

This section is empty.

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 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 ID added in v0.10.1

type ID int

ID identifies the reflection information that can be ascertained from the contents of a VideoStep. Other information can probably be gleaned but these are the ones that have been identified. For convenience only.

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

List of valid Info value.

type Reflector added in v0.10.1

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

Reflector should be run (with the Check() function) every video cycle. The (reflection) Renderer's Reflect() function is consequently also called every video cycle with a populated instance of LastResult.

func NewReflector added in v0.10.1

func NewReflector(vcs *hardware.VCS) *Reflector

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

func (*Reflector) AddRenderer added in v0.10.1

func (ref *Reflector) AddRenderer(renderer Renderer)

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

func (*Reflector) NewFrame added in v0.10.1

func (ref *Reflector) NewFrame(_ bool, _ bool) error

NewFrame implements the television.FrameTrigger interface.

func (*Reflector) Pause added in v0.10.1

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

Pause implements the television.PauseTrigger interface.

func (*Reflector) Step added in v0.10.1

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

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

type Renderer

type Renderer interface {
	// Mark the start and end of an update event from the television.
	// Reflect() should only be called between calls of UpdatingPixels(true)
	// and UpdatingPixels(false)
	UpdatingPixels(updating bool)

	// Reflect sends a VideoStep instance to the Renderer.
	Reflect(VideoStep) error
}

Renderer implementations display or otherwise process VideoStep values.

type VideoStep added in v0.8.0

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

VideoStep 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.

Jump to

Keyboard shortcuts

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