comparison

package
v0.35.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package comparison facilitates the running of a comparison emulator alongside the main emulation.

The package synchronises the two emulations and the main emulation (which we'll refer to as the "driver emulation") will always be one frame ahead of the comparison emulation. Either emulation will be stalled for the duration that the other emulation completes the next frame.

User input is synchronised by setting the driver emulation's RIOT Ports as a driver and the comparison emulation's as a passenger (see RIOT package).

Note that the driver emulation will be stalled and will not be able to service any of the normal communication channels for the duration that the comparison emulation is running.

The comparison emulation will produce two streams of pixels. The first is the frame-by-frame video output of the emulation; and the second stream shows the differences (as white pixels) between corresponding frames from the two emulations. Each video stream has a one frame buffer.

The comparison emulation does not handle the rewind state at all. This means that if the driver emulation is put into the rewinding state the constraints on how the emulations are synchronised will very likely be broken. For simplicity the comparison emulation should be abandoned whenever the driver emulation enters the rewinding state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparison

type Comparison struct {
	VCS *hardware.VCS

	Render     chan *image.RGBA
	DiffRender chan *image.RGBA
	AudioDiff  chan bool
	// contains filtered or unexported fields
}

Comparison type runs a parallel emulation with the intention of comparing the output with the driver emulation.

func NewComparison

func NewComparison(driverVCS *hardware.VCS) (*Comparison, error)

NewComparison is the preferred method of initialisation for the Comparison type.

func (*Comparison) CreateFromLoader

func (cmp *Comparison) CreateFromLoader(cartload cartridgeloader.Loader) error

CreateFromLoader will cause images to be generated from a running emulation initialised with the specified cartridge loader.

func (*Comparison) EndMixing added in v0.32.0

func (cmp *Comparison) EndMixing() error

EndMixing implements the television.AudioMixer interface.

func (*Comparison) EndRendering

func (cmp *Comparison) EndRendering() error

EndRendering implements the television.PixelRenderer interface.

func (*Comparison) IsEmulating

func (cmp *Comparison) IsEmulating() bool

IsEmulating returns true if the comparison emulator is working. Useful for testing whether the cartridgeloader was an emulatable file.

func (*Comparison) NewFrame

func (cmp *Comparison) NewFrame(frameInfo television.FrameInfo) error

NewFrame implements the television.PixelRenderer interface.

func (*Comparison) NewScanline

func (cmp *Comparison) NewScanline(scanline int) error

NewScanline implements the television.PixelRenderer interface.

func (*Comparison) Notify added in v0.30.0

func (cmp *Comparison) Notify(notice notifications.Notice) error

Notify implements the notifications.Notify interface

func (*Comparison) Quit

func (cmp *Comparison) Quit()

Quit ends the running comparison emulation.

func (*Comparison) Reset

func (cmp *Comparison) Reset()

Reset implements the television.PixelRenderer interface.

func (*Comparison) Resize

func (cmp *Comparison) Resize(frameInfo television.FrameInfo) error

Resize implements the television.PixelRenderer interface.

func (*Comparison) SetAudio added in v0.32.0

func (cmp *Comparison) SetAudio(sig []signal.SignalAttributes) error

SetAudio implements the television.AudioMixer interface.

func (*Comparison) SetPixels

func (cmp *Comparison) SetPixels(sig []signal.SignalAttributes, last int) error

SetPixels implements the television.PixelRenderer interface.

func (*Comparison) String

func (cmp *Comparison) String() string

Jump to

Keyboard shortcuts

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