reflection

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 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

View Source
var OverlayList = []string{"WSYNC", "Collisions", "HMOVE", "Unchanged"}

OverlayList is the list of overlays that should be supported by a reflection.Renderer.

View Source
var PaletteElements = []color.RGBA{
	color.RGBA{R: 17, G: 17, B: 17, A: 255},
	color.RGBA{R: 132, G: 200, B: 252, A: 255},
	color.RGBA{R: 146, G: 70, B: 192, A: 255},
	color.RGBA{R: 144, G: 28, B: 0, A: 255},
	color.RGBA{R: 232, G: 232, B: 74, A: 255},
	color.RGBA{R: 213, G: 130, B: 74, A: 255},
	color.RGBA{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.

View Source
var PaletteEvents = map[string]color.RGBA{
	"WSYNC":         color.RGBA{R: 50, G: 50, B: 255, A: 100},
	"Collisions":    color.RGBA{R: 255, G: 25, B: 25, A: 200},
	"HMOVE delay":   color.RGBA{R: 150, G: 50, B: 50, A: 150},
	"HMOVE":         color.RGBA{R: 50, G: 150, B: 50, A: 150},
	"HMOVE latched": color.RGBA{R: 50, G: 50, B: 150, A: 150},
	"Unchanged":     color.RGBA{R: 255, G: 100, B: 25, A: 150},
}

PaletteEvents

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 {
	Delay    bool
	DelayCt  int
	Latch    bool
	RippleCt uint8
}

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

type LastResult added in v0.2.1

type LastResult struct {
	CPU          execution.Result
	WSYNC        bool
	Bank         banks.Details
	IsRam        bool
	VideoElement video.Element
	TV           television.SignalAttributes
	Hblank       bool
	Collision    string
	Hmove        Hmove
	Unchanged    bool
}

LastResult packages together the details of the the last video step. It includes the CPU execution result, the bank from which the instruction originate, the video element that produced the last video pixel on screen; and the raw television signal most recently sent (a PixelRenderer only recieves distilled information from the television implementation so this is not redundant information).

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

func NewMonitor(vcs *hardware.VCS, renderer Renderer) *Monitor

NewMonitor is the preferred method of initialisation for the Monitor type

func (*Monitor) Check

func (mon *Monitor) Check(bank banks.Details) error

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

Note that getting banks.Details is relatively expensive so it is supplied as an argument to the function. It has probably been figured out and used elsewhere already.

type Renderer

type Renderer interface {
	Reflect(LastResult) error
}

Renderer implementations accepts ReflectPixel values and associates it in some way with the moste recent television signal

Jump to

Keyboard shortcuts

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