varvara

package
v0.0.0-...-7404ff5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package varvara implements the Varvara computing stack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoByte

type AutoByte byte

func (AutoByte) Addr

func (b AutoByte) Addr() bool

func (AutoByte) Count

func (b AutoByte) Count() int8

func (AutoByte) X

func (b AutoByte) X() bool

func (AutoByte) Y

func (b AutoByte) Y() bool

type Console

type Console struct {
	Ready <-chan bool
	// contains filtered or unexported fields
}

func (*Console) In

func (c *Console) In(p byte) byte

func (*Console) Out

func (c *Console) Out(p, b byte)

func (*Console) Vector

func (c *Console) Vector() uint16

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func (*Controller) In

func (d *Controller) In(p byte) byte

func (*Controller) Out

func (d *Controller) Out(p, b byte)

func (*Controller) Set

func (c *Controller) Set(s *ControllerState)

func (*Controller) Vector

func (d *Controller) Vector() uint16

type ControllerState

type ControllerState struct {
	A, B, Select, Start   bool
	Up, Down, Left, Right bool

	Key byte
}

type Datetime

type Datetime struct{}

func (Datetime) In

func (Datetime) In(p byte) byte

func (Datetime) Out

func (Datetime) Out(p, b byte)

type Debugger

type Debugger interface {
	Debug(cmd string, addr uint16)
}

type File

type File struct {
	// contains filtered or unexported fields
}

func (*File) In

func (f *File) In(p byte) byte

func (*File) Out

func (f *File) Out(p, b byte)

type GUI

type GUI struct {
	Update     chan<- bool
	UpdateDone <-chan bool
	// contains filtered or unexported fields
}

func NewGUI

func NewGUI(v *Varvara, d Debugger) *GUI

func (*GUI) Run

func (g *GUI) Run(exit <-chan bool) (err error)

func (*GUI) Swap

func (g *GUI) Swap(v *Varvara)

Swap replaces the Varvara attached to GUI with the given one. This operation takes effect on the next update event. Swap may only be called when a GUI update is not in progress.

type Mouse

type Mouse struct {
	// contains filtered or unexported fields
}

func (*Mouse) In

func (d *Mouse) In(p byte) byte

func (*Mouse) Out

func (d *Mouse) Out(p, b byte)

func (*Mouse) Set

func (m *Mouse) Set(s *MouseState)

func (*Mouse) Vector

func (d *Mouse) Vector() uint16

type MouseState

type MouseState struct {
	X, Y             int16
	ScrollX, ScrollY int16
	Button           [3]bool
}

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(enableGUI, devMode bool, state StateFunc) *Runner

func (*Runner) Debug

func (r *Runner) Debug(cmd string, addr uint16)

func (*Runner) Run

func (r *Runner) Run(rom []byte) (exitCode int)

func (*Runner) SetOutput

func (r *Runner) SetOutput(w io.Writer)

func (*Runner) Swap

func (r *Runner) Swap(rom []byte)

type Screen

type Screen struct {
	// contains filtered or unexported fields
}

func (*Screen) Addr

func (s *Screen) Addr() uint16

func (*Screen) Auto

func (s *Screen) Auto() AutoByte

func (*Screen) Height

func (s *Screen) Height() uint16

func (*Screen) In

func (s *Screen) In(p byte) byte

func (*Screen) Out

func (s *Screen) Out(p, v byte)

func (*Screen) Vector

func (s *Screen) Vector() uint16

func (*Screen) Width

func (s *Screen) Width() uint16

func (*Screen) X

func (s *Screen) X() int16

func (*Screen) Y

func (s *Screen) Y() int16

type StateFunc

type StateFunc func(*uxn.Machine, StateKind)

type StateKind

type StateKind byte
const (
	ClearState StateKind = iota
	HaltState
	PauseState
	BreakState
	DebugState
	QuietState
)

type System

type System struct {
	// contains filtered or unexported fields
}

func (*System) Blue

func (s *System) Blue() uint16

func (*System) ExitCode

func (s *System) ExitCode() int

func (*System) Green

func (s *System) Green() uint16

func (*System) Halt

func (s *System) Halt() uint16

func (*System) In

func (s *System) In(p byte) byte

func (*System) Out

func (s *System) Out(p, b byte)

func (*System) Red

func (s *System) Red() uint16

type Varvara

type Varvara struct {
	// contains filtered or unexported fields
}

func New

func New(rom []byte, state StateFunc, stdout, stderr io.Writer) *Varvara

func (*Varvara) Continue

func (v *Varvara) Continue()

func (*Varvara) Exec

func (v *Varvara) Exec(g *GUI) error

func (*Varvara) Halt

func (v *Varvara) Halt()

func (*Varvara) In

func (v *Varvara) In(p byte) byte

func (*Varvara) InShort

func (v *Varvara) InShort(p byte) uint16

func (*Varvara) Out

func (v *Varvara) Out(p, b byte)

func (*Varvara) OutShort

func (v *Varvara) OutShort(p byte, b uint16)

func (*Varvara) RemoveBreak

func (v *Varvara) RemoveBreak(addr uint16)

func (*Varvara) SetBreak

func (v *Varvara) SetBreak(addr uint16)

func (*Varvara) Step

func (v *Varvara) Step()

Jump to

Keyboard shortcuts

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