Documentation
¶
Index ¶
- type Instruction
- func AddRegister(to, plus uint16) Instruction
- func AndRegister(to, and uint16) Instruction
- func Call(address uint16) Instruction
- func CallRcp(address uint16) Instruction
- func CopyRegister(to, from uint16) Instruction
- func CopyToMemory(upTo uint16) Instruction
- func DrawSprite(xRegister, yRegister, bytes uint16) Instruction
- func IncrementAddressRegister(by uint16) Instruction
- func IncrementRegisterBy(register, increment uint16) Instruction
- func JumpTo(address uint16) Instruction
- func JumpWithOffset(to uint16) Instruction
- func LoadDecimalsOf(register uint16) Instruction
- func LoadDelayTimerInto(register uint16) Instruction
- func LoadDigitSprite(digit uint16) Instruction
- func LoadFromMemory(upTo uint16) Instruction
- func OrRegister(to, or uint16) Instruction
- func RandomizeAnd(register, and uint16) Instruction
- func SetAddressRegisterTo(value uint16) Instruction
- func SetDelayTimer(to uint16) Instruction
- func SetRegisterTo(register, value uint16) Instruction
- func SetSoundTimer(to uint16) Instruction
- func ShiftLeft(which uint16) Instruction
- func ShiftRight(which uint16) Instruction
- func SkipIfEqual(register, equalTo uint16) Instruction
- func SkipIfKeyDown(which uint16) Instruction
- func SkipIfKeyUp(which uint16) Instruction
- func SkipIfNotEqual(register, unequalTo uint16) Instruction
- func SkipIfRegistersEqual(r1, r2 uint16) Instruction
- func SkipIfRegistersUnequal(r1, r2 uint16) Instruction
- func SubtractRegister(to, minus uint16) Instruction
- func SubtractReversed(to, left uint16) Instruction
- func WaitForKeyPress(which uint16) Instruction
- func XorRegister(to, xor uint16) Instruction
- type IntScreen
- type Interpreter
- func (i *Interpreter) AddressRegister() uint16
- func (i *Interpreter) DelayTimer() uint8
- func (i *Interpreter) Execute(command Instruction)
- func (i *Interpreter) ExecuteNext()
- func (i *Interpreter) IsWaitingForKey() bool
- func (chip8 *Interpreter) LoadProgram(prog []byte)
- func (chip8 *Interpreter) LoadProgramToAddress(prog []byte, address uint16)
- func (i *Interpreter) MemoryByte(index uint16) uint8
- func (chip8 *Interpreter) Paused() bool
- func (i *Interpreter) ProgramCounter() uint16
- func (i *Interpreter) Register(which int) uint8
- func (i *Interpreter) Screen() Screen
- func (i *Interpreter) SetKeyEvent(event KeyEvent)
- func (i *Interpreter) SetKeyboard(keyboard Keyboard)
- func (chip8 *Interpreter) SetPaused(paused bool)
- func (i *Interpreter) SetRandomizer(rand Randomizer)
- func (i *Interpreter) SetSpeakers(s Speakers)
- func (i *Interpreter) SoundTimer() uint8
- func (i *Interpreter) TimerTick()
- type KeyEvent
- type Keyboard
- type Randomizer
- type Screen
- type Speakers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instruction ¶
type Instruction uint16
const ( ClearScreen Instruction = 0x00E0 Return = 0x00EE )
func AddRegister ¶
func AddRegister(to, plus uint16) Instruction
func AndRegister ¶
func AndRegister(to, and uint16) Instruction
func Call ¶
func Call(address uint16) Instruction
func CallRcp ¶
func CallRcp(address uint16) Instruction
func CopyRegister ¶
func CopyRegister(to, from uint16) Instruction
func CopyToMemory ¶
func CopyToMemory(upTo uint16) Instruction
func DrawSprite ¶
func DrawSprite(xRegister, yRegister, bytes uint16) Instruction
func IncrementAddressRegister ¶
func IncrementAddressRegister(by uint16) Instruction
func IncrementRegisterBy ¶
func IncrementRegisterBy(register, increment uint16) Instruction
func JumpTo ¶
func JumpTo(address uint16) Instruction
func JumpWithOffset ¶
func JumpWithOffset(to uint16) Instruction
func LoadDecimalsOf ¶
func LoadDecimalsOf(register uint16) Instruction
func LoadDelayTimerInto ¶
func LoadDelayTimerInto(register uint16) Instruction
func LoadDigitSprite ¶
func LoadDigitSprite(digit uint16) Instruction
func LoadFromMemory ¶
func LoadFromMemory(upTo uint16) Instruction
func OrRegister ¶
func OrRegister(to, or uint16) Instruction
func RandomizeAnd ¶
func RandomizeAnd(register, and uint16) Instruction
func SetAddressRegisterTo ¶
func SetAddressRegisterTo(value uint16) Instruction
func SetDelayTimer ¶
func SetDelayTimer(to uint16) Instruction
func SetRegisterTo ¶
func SetRegisterTo(register, value uint16) Instruction
func SetSoundTimer ¶
func SetSoundTimer(to uint16) Instruction
func ShiftLeft ¶
func ShiftLeft(which uint16) Instruction
func ShiftRight ¶
func ShiftRight(which uint16) Instruction
func SkipIfEqual ¶
func SkipIfEqual(register, equalTo uint16) Instruction
func SkipIfKeyDown ¶
func SkipIfKeyDown(which uint16) Instruction
func SkipIfKeyUp ¶
func SkipIfKeyUp(which uint16) Instruction
func SkipIfNotEqual ¶
func SkipIfNotEqual(register, unequalTo uint16) Instruction
func SkipIfRegistersEqual ¶
func SkipIfRegistersEqual(r1, r2 uint16) Instruction
func SkipIfRegistersUnequal ¶
func SkipIfRegistersUnequal(r1, r2 uint16) Instruction
func SubtractRegister ¶
func SubtractRegister(to, minus uint16) Instruction
func SubtractReversed ¶
func SubtractReversed(to, left uint16) Instruction
func WaitForKeyPress ¶
func WaitForKeyPress(which uint16) Instruction
func XorRegister ¶
func XorRegister(to, xor uint16) Instruction
type Interpreter ¶
type Interpreter struct {
// contains filtered or unexported fields
}
func NewInterpreter ¶
func NewInterpreter() *Interpreter
func (*Interpreter) AddressRegister ¶
func (i *Interpreter) AddressRegister() uint16
func (*Interpreter) DelayTimer ¶
func (i *Interpreter) DelayTimer() uint8
func (*Interpreter) Execute ¶
func (i *Interpreter) Execute(command Instruction)
func (*Interpreter) ExecuteNext ¶
func (i *Interpreter) ExecuteNext()
func (*Interpreter) IsWaitingForKey ¶
func (i *Interpreter) IsWaitingForKey() bool
func (*Interpreter) LoadProgram ¶
func (chip8 *Interpreter) LoadProgram(prog []byte)
func (*Interpreter) LoadProgramToAddress ¶
func (chip8 *Interpreter) LoadProgramToAddress(prog []byte, address uint16)
func (*Interpreter) MemoryByte ¶
func (i *Interpreter) MemoryByte(index uint16) uint8
func (*Interpreter) Paused ¶
func (chip8 *Interpreter) Paused() bool
func (*Interpreter) ProgramCounter ¶
func (i *Interpreter) ProgramCounter() uint16
func (*Interpreter) Register ¶
func (i *Interpreter) Register(which int) uint8
func (*Interpreter) Screen ¶
func (i *Interpreter) Screen() Screen
func (*Interpreter) SetKeyEvent ¶
func (i *Interpreter) SetKeyEvent(event KeyEvent)
func (*Interpreter) SetKeyboard ¶
func (i *Interpreter) SetKeyboard(keyboard Keyboard)
func (*Interpreter) SetPaused ¶
func (chip8 *Interpreter) SetPaused(paused bool)
func (*Interpreter) SetRandomizer ¶
func (i *Interpreter) SetRandomizer(rand Randomizer)
func (*Interpreter) SetSpeakers ¶
func (i *Interpreter) SetSpeakers(s Speakers)
func (*Interpreter) SoundTimer ¶
func (i *Interpreter) SoundTimer() uint8
func (*Interpreter) TimerTick ¶
func (i *Interpreter) TimerTick()
type Randomizer ¶
type Randomizer interface {
Next() uint8
}
Click to show internal directories.
Click to hide internal directories.