machine

package
v0.0.0-...-3745006 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cpu

type Cpu struct {
	PC uint16
	I  uint16
	V  [16]byte

	Stack      [16]uint16
	SP         byte
	DelayTimer byte
	SoundTimer byte
}

type Display

type Display struct {
	Pixels [screenWidth][screenHeight]byte
}

func (*Display) Clear

func (d *Display) Clear()

func (*Display) DrawSprite

func (d *Display) DrawSprite(x byte, y byte, row byte) bool

From: https://github.com/szTheory/chip8go

func (*Display) ScreenHeight

func (d *Display) ScreenHeight() int

func (*Display) ScreenWidth

func (d *Display) ScreenWidth() int

type Input

type Input [16]bool

type Machine

type Machine struct {
	Memory  [memSize]byte
	Cpu     Cpu
	Display Display
	Input   Input
	Debug   bool

	// Use the original machine implementation or not
	Original bool
}

func NewMachine

func NewMachine() *Machine

func (*Machine) Draw

func (m *Machine) Draw(screen *ebiten.Image)

From: https://github.com/szTheory/chip8go

func (*Machine) Layout

func (m *Machine) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)

func (*Machine) StartMachine

func (m *Machine) StartMachine(program string, debugOn bool)

func (*Machine) Update

func (m *Machine) Update() error

Methods required by ebiten

Jump to

Keyboard shortcuts

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