cpu

package
v0.0.0-...-9ddd1ca Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOpcodeName

func GetOpcodeName(c *CPU) string

GetOpcodeName returns a string with the opcode name and immediate values

Types

type CPU

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

CPU is the main struct holding Z80 state

func New

func New(memory *memory.MMU) *CPU

New returns an initialized CPU instance

func (*CPU) Tick

func (c *CPU) Tick() int

Tick emulates a single step during the main loop for the cpu. Returns the amount of cycles that execution has taken.

type Flag

type Flag uint8

Flag is one of the 4 possible flags used in the flag register (high part of AF)

type Opcode

type Opcode func(*CPU) int

Opcode represents a function that executes an opcode

func Decode

func Decode(c *CPU) Opcode

Decode retrieves the instruction identified by the value pointed at by the PC.

Jump to

Keyboard shortcuts

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