Versions in this module Expand all Collapse all v0 v0.10.1 Jun 24, 2024 Changes in this version + type Flag uint8 + const Flag3 + const Flag5 + const FlagC + const FlagH + const FlagN + const FlagPV + const FlagS + const FlagZ type GPR + func (gpr *GPR) ResetFlag(f Flag) + func (gpr *GPR) SetFlag(f Flag) + func (gpr GPR) GetFlag(f Flag) bool v0.10.0 Apr 22, 2024 Changes in this version type CPU + HALT bool + Interrupt *Interrupt + RETIHandler RETIHandler + RETNHandler RETNHandler + type Interrupt struct + Data []uint8 + Type InterruptType + func IM0Interrupt(d uint8, others ...uint8) *Interrupt + func IM1Interrupt() *Interrupt + func IM2Interrupt(n uint8) *Interrupt + func NMIInterrupt() *Interrupt + type InterruptType int + const IMType + const NMIType type NMI + ReturnNMI func() + type RETIHandler interface + RETIHandle func() + type RETNHandler interface + RETNHandle func() v0.9.3 Apr 19, 2024 v0.9.2 Apr 16, 2024 v0.9.1 Apr 11, 2023 Changes in this version type CPU + func Build(options ...Option) *CPU + type Option interface + func WithINT(v INT) Option + func WithIO(v IO) Option + func WithInterruptMonitor(v InterruptMonitor) Option + func WithMemory(v Memory) Option + func WithNMI(v NMI) Option v0.9.0 Jul 23, 2022 Changes in this version + var ErrBreakPoint = errors.New("break point reached") + type CPU struct + BreakPoints map[uint16]struct{} + Debug bool + IMon InterruptMonitor + INT INT + IO IO + Memory Memory + NMI NMI + func (cpu *CPU) Run(ctx context.Context) error + func (cpu *CPU) Step() + type DumbIO []uint8 + func (dio DumbIO) In(addr uint8) uint8 + func (dio DumbIO) Out(addr uint8, value uint8) + type DumbMemory []uint8 + func (dm DumbMemory) Get(addr uint16) uint8 + func (dm DumbMemory) Put(addr uint16, data ...uint8) DumbMemory + func (dm DumbMemory) Set(addr uint16, value uint8) + type GPR struct + AF Register + BC Register + DE Register + HL Register + type INT interface + CheckINT func() []uint8 + ReturnINT func() + type IO interface + In func(addr uint8) uint8 + Out func(addr uint8, value uint8) + type InterruptMonitor interface + OnInterrupt func(maskable bool, oldPC, newPC uint16) + type MapMemory map[uint16]uint8 + func (mm MapMemory) Clear() + func (mm MapMemory) Clone() MapMemory + func (mm MapMemory) Equal(a0 interface{}) bool + func (mm MapMemory) Get(addr uint16) uint8 + func (mm MapMemory) Put(addr uint16, data ...uint8) MapMemory + func (mm MapMemory) Set(addr uint16, v uint8) + type Memory interface + Get func(addr uint16) uint8 + Set func(addr uint16, value uint8) + type NMI interface + CheckNMI func() bool + type Register struct + Hi uint8 + Lo uint8 + func (r *Register) SetU16(v uint16) + func (r Register) U16() uint16 + type SPR struct + IR Register + IX uint16 + IY uint16 + PC uint16 + SP uint16 + type States struct + Alternate GPR + HALT bool + IFF1 bool + IFF2 bool + IM int + InNMI bool