Documentation ¶
Overview ¶
Package reflection monitors the emulated hardware for conditions that would otherwise not be visible through normal emulation. The reflection system must be stepped every video cycle if all information is to be gathered.
Note that with regards to the debugger package, Step() is called manually from the input loop as appropriate. However, NewFrame() is handled by the television - the Reflector having been added as a FrameTrigger.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 Hmove ¶ added in v0.2.1
Hmove groups the HMOVE reflection information. It's too complex a property to distil into a single variable.
Ordering of the structure is important in order to keep memory usage at a minimum.
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.
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 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.
func NewReflector ¶ added in v0.10.1
NewReflector is the preferred method of initialisation for the Monitor type.
func (*Reflector) AddRenderer ¶ added in v0.10.1
AddRenderer adds an implementation of the Renderer interface to the Reflector.
func (*Reflector) Clear ¶ added in v0.15.0
func (ref *Reflector) Clear()
Clear existing reflected information.
func (*Reflector) NewFrame ¶ added in v0.10.1
func (ref *Reflector) NewFrame(_ television.FrameInfo) error
NewFrame implements the television.FrameTrigger interface.
func (*Reflector) SetEmulationState ¶ added in v0.15.0
SetEmulationState is called by emulation whenever state changes. How we handle reflections depends on the current state.
type Renderer ¶
type Renderer interface { // Reflect is used to render a series of ReflectedVideoSteps. The number of // entries in the array will always be television.MaxSignalHistory. // // The layout of the ref array is roughly equivalent to the sig array sent // by PixelRenderer.SetPixels(). That is, the first entry always // corresponds to the top-left pixel. // // It's important that implementations forget about and do not reference // any previous arrays as otherwise this will cause race errors with the // reflection package (which is probably running in a different thread). Reflect(ref []ReflectedVideoStep) error }
Renderer implementations display or otherwise process VideoStep values.