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 ¶
var OverlayList = []string{"WSYNC", "Collisions", "HMOVE", "Unchanged"}
OverlayList is the list of overlays that should be supported by a reflection.Renderer.
var PaletteElements = []color.RGBA{
{R: 17, G: 17, B: 17, A: 255},
{R: 132, G: 200, B: 252, A: 255},
{R: 146, G: 70, B: 192, A: 255},
{R: 144, G: 28, B: 0, A: 255},
{R: 232, G: 232, B: 74, A: 255},
{R: 213, G: 130, B: 74, A: 255},
{R: 50, G: 132, B: 50, A: 255},
}
PaletteElements lists the colors to be used when displaying TIA video in a debugger's "debug colors" mode. The default colors are the same as the the debug colors found in the Stella emulator.
var PaletteEvents = map[string]color.RGBA{
"WSYNC": {R: 50, G: 50, B: 255, A: 100},
"Collisions": {R: 255, G: 25, B: 25, A: 200},
"HMOVE delay": {R: 150, G: 50, B: 50, A: 150},
"HMOVE": {R: 50, G: 150, B: 50, A: 150},
"HMOVE latched": {R: 50, G: 50, B: 150, A: 150},
"Unchanged": {R: 255, G: 100, B: 25, A: 150},
}
PaletteEvents lists the colors to be used for reflected events. For example, when WSYNC is active the PaletteEvent["WSYNC"] entry should be used.
Functions ¶
This section is empty.
Types ¶
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.
type IdentifyReflector ¶ added in v0.7.1
type IdentifyReflector interface {
GetReflectionRenderer() Renderer
}
IdentifyReflector implementations can identify a reflection.Renderer.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor 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 NewMonitor ¶
NewMonitor is the preferred method of initialisation for the Monitor type.
func (*Monitor) Check ¶
Check should be called every video cycle to record the current state of the emulation/system.
func (*Monitor) SyncFrame ¶ added in v0.7.1
func (mon *Monitor) SyncFrame()
SyncFrame implements the television.ReflectionSynchronising interface.
func (*Monitor) SyncReflectionPixel ¶ added in v0.7.1
SyncReflectionPixel implements the television.ReflectionSynchronising interface.
type Reflection ¶ added in v0.7.1
type Reflection struct { CPU execution.Result Bank mapper.BankInfo VideoElement video.Element TV signal.SignalAttributes Hmove Hmove WSYNC bool IsRAM bool Hblank bool Unchanged bool Collision string }
Reflection packages together the details of the the last video step. 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(Reflection) error
}
Renderer implementations accepts ReflectPixel values and associates it in some way with the most recent television signal.