vm

package
v0.0.0-...-654b2c4 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chip8

type Chip8 struct {
	Debug bool

	// CopyRegistersOnShift affects `8XY6` and `8XYE`. If true, the value of VY will be copied into VX before a shift
	// occurs.
	CopyRegistersOnShift bool
	// VariableOffsetRegister affects `BNNN`. If true, `BNNN` will act as `BXNN` and will jump to NNN + VX. Else, `BNNN`
	// will jump to NNN + V0.
	VariableOffsetRegister bool
	// DisableSetFlagOnIrOverflow affects `FX1E`. If true, `FX1E` will not set VF. Else, it will set VF accordingly if
	// the index register "overflows" above 0x0FFF.
	DisableSetFlagOnIrOverflow bool
	// IncrementIndexRegisterOnLoadSave affects `FX55` and `FX65`. If true, the index register will be incremented when
	// loading or saving registers to/from memory. Else, a temporary value will be indexed instead, and the index
	// register will not be changed.
	IncrementIndexRegisterOnLoadSave bool
	// contains filtered or unexported fields
}

func NewChip8

func NewChip8(rom []byte, ui uiDriver, clockSpeedHertz int) *Chip8

func (*Chip8) Run

func (c *Chip8) Run()

type Stack

type Stack []uint16

Stack is a unlimited size, 16-bit, FIFO stack

func (*Stack) Pop

func (s *Stack) Pop() uint16

func (*Stack) Push

func (s *Stack) Push(cont uint16)

Jump to

Keyboard shortcuts

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