Versions in this module Expand all Collapse all v0 v0.0.1 Sep 20, 2023 Changes in this version + const StackLocation + var IllegalInstructionMagicConstant uint8 = 0x00 + var StackDebug = false + func FormatInstruction(pc uint16, ins *instruction, b1 uint8, b2 uint8, ma uint16, mc uint8, ...) string + func GetVector(mem Memory, vector SystemVector) uint16 + func SetVector(mem Memory, vector SystemVector, addr uint16) + type AddressingMode int + const A + const ABS + const ABS_X + const ABS_Y + const IMMED + const IMPL + const IND + const IND_ABS_X + const IND_Y + const REL + const X_IND + const ZPG + const ZPG_IND + const ZPG_REL + const ZPG_X + const ZPG_Y + func (mode AddressingMode) String() string + type BreakpointHandler interface + HandleBreak func(proc *Processor) error + type BreakpointHandlerDisableTrace struct + func (b *BreakpointHandlerDisableTrace) HandleBreak(proc *Processor) + type BreakpointHandlerEnableTrace struct + func (b *BreakpointHandlerEnableTrace) HandleBreak(proc *Processor) + type MappableMemory struct + func (m *MappableMemory) Clear() + func (m *MappableMemory) DisableReadDebugging() + func (m *MappableMemory) DisableWriteDebugging() + func (m *MappableMemory) EnableReadDebugging(w io.Writer) + func (m *MappableMemory) EnableWriteDebugging(w io.Writer) + func (m *MappableMemory) Map(handler MappedMemoryHandler) + func (m *MappableMemory) Read(location uint16) uint8 + func (m *MappableMemory) Write(location uint16, value uint8) + type MappedMemoryAddressRange struct + End uint16 + Start uint16 + type MappedMemoryHandler interface + AddressRange func() []MappedMemoryAddressRange + type MappedMemoryReadHandler interface + Read func(addr uint16) uint8 + type MappedMemoryWriteHandler interface + Write func(addr uint16, val uint8) + type Memory interface + Clear func() + Read func(addr uint16) uint8 + Write func(addr uint16, value uint8) + type Processor struct + func NewProcessor(m Memory) *Processor + func (p *Processor) ClearBreakpoints() *Processor + func (p *Processor) DumpState(w io.Writer) + func (p *Processor) GetLastRunPerformance() ProcessorPerformance + func (p *Processor) IRQ(state bool) + func (p *Processor) Init() *Processor + func (p *Processor) IsIRQSet() bool + func (p *Processor) IsResetSet() bool + func (p *Processor) Load(r io.ByteReader, start uint16) *Processor + func (p *Processor) LoadHex(r io.Reader) *Processor + func (p *Processor) LoadIllegalInstructions() *Processor + func (p *Processor) Memory() Memory + func (p *Processor) NMI(state bool) error + func (p *Processor) Registers() *Registers + func (p *Processor) Reset(state bool) + func (p *Processor) RunFrom(addr uint16) (err error) + func (p *Processor) SetBreakpoint(breakAt uint16, handler BreakpointHandler) *Processor + func (p *Processor) SetClock(cyclesPerSecond int64) *Processor + func (p *Processor) SetDebugWriter(w io.Writer) *Processor + func (p *Processor) SetModel65C02() *Processor + func (p *Processor) SetOption(opt ProcessorOption, value bool) *Processor + func (p *Processor) SetVector(vector uint16, value uint16) *Processor + func (p *Processor) Step() (err error, stop bool) + func (p *Processor) Stop() + type ProcessorModel int + const ProcessorModel6502 + const ProcessorModel65C02 + type ProcessorOption int + const AutoResetIRQ + const AutoResetNMI + const ErrorOnJAM + const ErrorOnSelfJump + const Fix6052BrokenJMP + const Trace + const TraceInterrupts + const TraceStack + type ProcessorPerformance struct + EffectiveClock int64 + InstructionsExecuted uint64 + RanForCycles int64 + RanForNanoseconds int64 + type ProgramCounter struct + func (pc *ProgramCounter) Current() uint16 + func (pc *ProgramCounter) Init(p *Processor) + func (pc *ProgramCounter) Next() uint8 + func (pc *ProgramCounter) Set(val uint16) + type RawMemory struct + func (m *RawMemory) Clear() + func (m *RawMemory) DisableReadDebugging() + func (m *RawMemory) DisableWriteDebugging() + func (m *RawMemory) EnableReadDebugging(w io.Writer) + func (m *RawMemory) EnableWriteDebugging(w io.Writer) + func (m *RawMemory) Read(location uint16) uint8 + func (m *RawMemory) Write(location uint16, value uint8) + type Registers struct + A uint8 + PC ProgramCounter + SP StackPointer + SR StatusRegister + X uint8 + Y uint8 + type SEC struct + func (i *SEC) Exec(proc *Processor, mode AddressingMode, data uint8, data16 uint16) error + func (i *SEC) Mnemonic() string + type SED struct + func (i *SED) Exec(proc *Processor, mode AddressingMode, data uint8, data16 uint16) error + func (i *SED) Mnemonic() string + type SEI struct + func (i *SEI) Exec(proc *Processor, mode AddressingMode, data uint8, data16 uint16) error + func (i *SEI) Mnemonic() string + type SRFlag uint8 + const SRFlagB + const SRFlagC + const SRFlagD + const SRFlagI + const SRFlagN + const SRFlagU + const SRFlagV + const SRFlagZ + type STX struct + func (i *STX) Exec(proc *Processor, mode AddressingMode, data uint8, data16 uint16) error + func (i *STX) Mnemonic() string + type STY struct + func (i *STY) Exec(proc *Processor, mode AddressingMode, data uint8, data16 uint16) error + func (i *STY) Mnemonic() string + type StackPointer struct + func (sp *StackPointer) GetStackPointer() uint8 + func (sp *StackPointer) PeekStackHead() uint8 + func (sp *StackPointer) Pop() uint8 + func (sp *StackPointer) Push(value uint8) + func (sp *StackPointer) SetStackPointer(ptr uint8) + func (sp *StackPointer) String() string + type StatusRegister struct + func (s *StatusRegister) Clear(flag SRFlag) + func (s *StatusRegister) IsSet(flag SRFlag) bool + func (s *StatusRegister) Set(flag SRFlag) + func (s *StatusRegister) SetTo(flag SRFlag, state bool) + func (s *StatusRegister) String() string + func (s *StatusRegister) Value() uint8 + type SystemVector uint16 + const VectorIRQ + const VectorNMI + const VectorReset + type TAX struct + func (i *TAX) Exec(proc *Processor, mode AddressingMode, data uint8, data16 uint16) error + func (i *TAX) Mnemonic() string + type TAY struct + func (i *TAY) Exec(proc *Processor, mode AddressingMode, data uint8, data16 uint16) error + func (i *TAY) Mnemonic() string + type TSX struct + func (i *TSX) Exec(proc *Processor, mode AddressingMode, data uint8, data16 uint16) error + func (i *TSX) Mnemonic() string + type TXA struct + func (i *TXA) Exec(proc *Processor, mode AddressingMode, data uint8, data16 uint16) error + func (i *TXA) Mnemonic() string + type TXS struct + func (i *TXS) Exec(proc *Processor, mode AddressingMode, data uint8, data16 uint16) error + func (i *TXS) Mnemonic() string + type TYA struct + func (i *TYA) Exec(proc *Processor, mode AddressingMode, data uint8, data16 uint16) error + func (i *TYA) Mnemonic() string