Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Opcodes [256]Instruction
)
Functions ¶
This section is empty.
Types ¶
type CPU ¶
type CPU struct {
X uint8 // X register
Y uint8 // Y register
A uint8 // Accumulator
P Flags // Status flags
SP uint8 // Stack pointer
PC uint16 // Program counter
Cycles uint64 // Number of cycles executed
Halt int // Number of cycles to wait
// contains filtered or unexported fields
}
func (*CPU) Reset ¶
Reset resets the CPU to its initial state. To match the behaviour of the real CPU, the next 6 cycles are skipped after a reset.
func (*CPU) Tick ¶
Tick executes a single CPU cycle, returning true if the CPU has finished executing the current instruction.
func (*CPU) TriggerIRQ ¶
func (cpu *CPU) TriggerIRQ()
TriggerIRQ triggers an interrupt on the next CPU cycle. If the interrupt flag is set, the interrupt is ignored.
func (*CPU) TriggerNMI ¶
func (cpu *CPU) TriggerNMI()
TriggerNMI triggers a non-maskable interrupt on the next CPU cycle.
type Instruction ¶
Click to show internal directories.
Click to hide internal directories.