Documentation ¶
Index ¶
- type ByteRegister
- type CPU
- func (cpu *CPU) DebugDisable()
- func (cpu *CPU) DebugEnable()
- func (cpu *CPU) DisableInterrupts()
- func (cpu *CPU) EnableInterrupts()
- func (cpu *CPU) FlagC() bool
- func (cpu *CPU) FlagH() bool
- func (cpu *CPU) FlagN() bool
- func (cpu *CPU) FlagZ() bool
- func (cpu *CPU) InterruptsEnabled() bool
- func (cpu *CPU) SetFlagC(value bool)
- func (cpu *CPU) SetFlagH(value bool)
- func (cpu *CPU) SetFlagN(value bool)
- func (cpu *CPU) SetFlagZ(value bool)
- func (cpu *CPU) SetStatus(state State)
- func (cpu *CPU) Status() State
- func (cpu *CPU) Step() (int, error)
- type Memory
- type State
- type WordRegister
- func (r *WordRegister) Dec()
- func (r *WordRegister) DecBy(q uint16)
- func (r *WordRegister) Get() uint16
- func (r *WordRegister) GetMask() uint16
- func (r *WordRegister) H() *ByteRegister
- func (r *WordRegister) Inc()
- func (r *WordRegister) IncBy(q uint16)
- func (r *WordRegister) L() *ByteRegister
- func (r *WordRegister) Set(data uint16)
- func (r *WordRegister) SetMask(mask uint16)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteRegister ¶
type ByteRegister struct {
// contains filtered or unexported fields
}
ByteRegister is an 8 bit register
func (*ByteRegister) Dec ¶
func (r *ByteRegister) Dec()
Dec decreases the value of a 8 bit register by one TODO: Masked registers might have strange behaviours with inc/dec
func (*ByteRegister) DecBy ¶
func (r *ByteRegister) DecBy(q uint8)
DecBy decreases the value of a 8 bit register by q TODO: Masked registers might have strange behaviours with inc/dec
func (*ByteRegister) Get ¶
func (r *ByteRegister) Get() uint8
Get gets the value of a 8 bit register
func (*ByteRegister) GetMask ¶
func (r *ByteRegister) GetMask() uint8
GetMask returns the mask applied to this register
func (*ByteRegister) Inc ¶
func (r *ByteRegister) Inc()
Inc increases the value of a 8 bit register by one TODO: Masked registers might have strange behaviours with inc/dec
func (*ByteRegister) IncBy ¶
func (r *ByteRegister) IncBy(q uint8)
IncBy increases the value of a 8 bit register by q TODO: Masked registers might have strange behaviours with inc/dec
func (*ByteRegister) Set ¶
func (r *ByteRegister) Set(data uint8)
Set sets the value of a 8 bit register
func (*ByteRegister) SetMask ¶
func (r *ByteRegister) SetMask(mask uint8)
SetMask sets a mask to this register
type CPU ¶
type CPU struct {
AF, BC, DE, HL, SP, PC *WordRegister
A, F, B, C, D, E, H, L *ByteRegister
// contains filtered or unexported fields
}
CPU structure
func (*CPU) DisableInterrupts ¶
func (cpu *CPU) DisableInterrupts()
DisableInterrupts clears the interrupt master enable flag
func (*CPU) EnableInterrupts ¶
func (cpu *CPU) EnableInterrupts()
EnableInterrupts sets the interrupt master enable flag
func (*CPU) InterruptsEnabled ¶
InterruptsEnabled reads the status of the interrupt master enable flag
type WordRegister ¶
type WordRegister struct {
// contains filtered or unexported fields
}
WordRegister is an 16 bit register, composed of two 8 bit registers
func (*WordRegister) Dec ¶
func (r *WordRegister) Dec()
Dec decreases the value of a 16 bit register by one TODO: Masked registers might have strange behaviours with inc/dec
func (*WordRegister) DecBy ¶
func (r *WordRegister) DecBy(q uint16)
DecBy decreases the value of a 16 bit register by q TODO: Masked registers might have strange behaviours with inc/dec
func (*WordRegister) Get ¶
func (r *WordRegister) Get() uint16
Get gets the value of a 16 bit register
func (*WordRegister) GetMask ¶
func (r *WordRegister) GetMask() uint16
GetMask returns the mask applied to this register
func (*WordRegister) H ¶
func (r *WordRegister) H() *ByteRegister
H gets the high byte register of a 16 bit register
func (*WordRegister) Inc ¶
func (r *WordRegister) Inc()
Inc increases the value of a 16 bit register by one TODO: Masked registers might have strange behaviours with inc/dec
func (*WordRegister) IncBy ¶
func (r *WordRegister) IncBy(q uint16)
IncBy increases the value of a 16 bit register by q TODO: Masked registers might have strange behaviours with inc/dec
func (*WordRegister) L ¶
func (r *WordRegister) L() *ByteRegister
L gets the low byte register of a 16 bit register
func (*WordRegister) Set ¶
func (r *WordRegister) Set(data uint16)
Set sets the value of a 16 bit register
func (*WordRegister) SetMask ¶
func (r *WordRegister) SetMask(mask uint16)
SetMask sets a mask to this register