utils

package
v0.0.0-...-476d645 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Breakpoints []Breakpoint

Breakpoints is a global list of breakpoints

Functions

func AddBreakpoint

func AddBreakpoint(b Breakpoint)

AddBreakpoint adds a breakpoint to the list

func CreateTexture

func CreateTexture(msg string, c sdl.Color, font *ttf.Font, renderer *sdl.Renderer) (*sdl.Texture, error)

CreateTexture returns a texture for the given message

func GetCharacterMetrics

func GetCharacterMetrics(g *ttf.GlyphMetrics) (h, w int32)

GetCharacterMetrics returns the height/width for character of the given GlyphMetrics

func LoadFont

func LoadFont(filename string) (*ttf.Font, *ttf.GlyphMetrics, error)

LoadFont uses the bindata library to load a font resource embedded within the binary

func RemoveBreakpoint

func RemoveBreakpoint(b Breakpoint)

RemoveBreakpoint removes a breakpoint from the list

Types

type Breakpoint

type Breakpoint struct {
	Address uint16
	Number  int
	// contains filtered or unexported fields
}

Breakpoint is an address that we want to drop into single-step when the emulator gets to this point

func FindBreakpoint

func FindBreakpoint(addr uint16) (*Breakpoint, bool)

FindBreakpoint returns a breakpoint for the specified address, if one exists

func NewBreakpoint

func NewBreakpoint(address uint16, NumberTimes int) *Breakpoint

NewBreakpoint creates a new breakpoint object The NumberTimes parameters specifies how many times we should pass by this address before break; 0 indicates that it will stop everytime

func (*Breakpoint) BreakpointReady

func (b *Breakpoint) BreakpointReady() bool

BreakpointReady checks if the breakpoint meets the filter criteria to triggle Everytime this is called, it counts as another iteration of this breakpoint being reached, so the internal counter will be increased by one when the result is false When the result is true, the internal counter will be reset

type ComputerStatus

type ComputerStatus struct {
	Running     bool
	RomFilename string
	SingleStep  bool
}

ComputerStatus represents the status of the emulator. This matches the screen.ComputerStatus interface so that the main method can communicate the status of the emulator to be displayed by the screen's UI

func NewComputerStatus

func NewComputerStatus() *ComputerStatus

NewComputerStatus returns a new emulator status

func (ComputerStatus) Copy

func (e ComputerStatus) Copy() *ComputerStatus

Copy creates a new copy of the computer status

func (ComputerStatus) Equals

func (e ComputerStatus) Equals(e2 ComputerStatus) bool

Equals returns true if and only if all the members of the provided ComputerStatus all match this object

func (ComputerStatus) GetRomFileName

func (e ComputerStatus) GetRomFileName() string

GetRomFileName gets the rom file name

func (ComputerStatus) IsRunning

func (e ComputerStatus) IsRunning() bool

IsRunning returns whether or not the emulator is executing code

func (ComputerStatus) IsSingleStep

func (e ComputerStatus) IsSingleStep() bool

IsSingleStep returns whether or not the emulator is in single-step mode

Jump to

Keyboard shortcuts

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