cpu

package
v0.0.0-...-77df42f Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InstructionSet = [256]Instruction{}/* 256 elements not displayed */

InstructionSet holds the first 256 instructions.

View Source
var InstructionSetCB = [256]Instruction{}/* 256 elements not displayed */

InstructionSetCB is the set of instructions for the CB prefix.

Functions

This section is empty.

Types

type CPU

type CPU struct {
	PC, SP uint16 // (P)rogram (C)ounter, (S)tack (P)ointer
	Registers

	Debug, DebugBreakpoint bool
	// contains filtered or unexported fields
}

CPU represents the Game Boy's 8-bit CPU (sm83).

func NewCPU

func NewCPU(b *io.Bus, sched *scheduler.Scheduler, ppu *ppu.PPU) *CPU

func (*CPU) Boot

func (c *CPU) Boot(m types.Model)

Boot emulates the boot process by setting the Registers to the starting value provided by the types.Model.

func (*CPU) Frame

func (c *CPU) Frame()

Frame steps the CPU until the next frame is ready.

type Instruction

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

type Register

type Register = uint8

Register represents a Register used to hold an 8-bit value.

type RegisterPair

type RegisterPair [2]*Register

RegisterPair is a pair of Registers used to address them as a 16-bit value.

func (RegisterPair) SetUint16

func (r RegisterPair) SetUint16(value uint16)

func (RegisterPair) Uint16

func (r RegisterPair) Uint16() uint16

type Registers

Registers represents the GB CPU registers.

Jump to

Keyboard shortcuts

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