Documentation
¶
Index ¶
- Constants
- Variables
- func CharGen(renderer *sdl.Renderer, chargen MemoryChunk) (*sdl.Texture, error)
- type CPU
- type Chunk
- type Decoder
- type Device
- type Disassembler
- type Instruction
- type JiffyClock
- type Keyboard
- type Mach85
- type Memory
- func (m *Memory) Dump(start uint16, end uint16, decode Decoder) string
- func (m *Memory) Import(address uint16, data []uint8)
- func (m *Memory) Load(address uint16) uint8
- func (m *Memory) Load16(address uint16) uint16
- func (m *Memory) Load16Z(address uint8) uint16
- func (m *Memory) Store(address uint16, value uint8)
- func (m *Memory) Store16(address uint16, value uint16)
- func (m *Memory) StoreN(address uint16, values ...uint8)
- type Memory64
- type MemoryChunk
- type Mode
- type Monitor
- type NullMemory
- type Operation
- type RAM
- type ROM
- type SDLInput
- type Source
- type Status
- type Video
- type Watchdog
Constants ¶
View Source
const ( AddrProcessorPort = uint16(0x0001) AddrBasicVariableStorage = uint16(0x002d) AddrBasicArrayStorage = uint16(0x002f) AddrStopKey = uint16(0x0091) AddrKeyboardBufferLen = uint16(0x00c6) AddrStack = uint16(0x0100) AddrKeyboardBuffer = uint16(0x0277) AddrBorderColor = uint16(0xd020) AddrBackgroundColor = uint16(0xd021) AddrResetVector = uint16(0xfffc) AddrISR = uint16(0xff48) AddrNmiVector = uint16(0xfffa) AddrIrqVector = uint16(0xfffe) )
View Source
const ( KeyCursorDown = uint8(0x11) KeyCursorLeft = uint8(0x9d) KeyCursorRight = uint8(0x1d) KeyCursorUp = uint8(0x91) )
View Source
const ( CmdBreakpoint = "b" CmdDisassemble = "d" CmdGo = "g" CmdHalt = "h" CmdLoad = "l" CmdLoadProgram = "lp" CmdLoadBasic = "lb" CmdMemory = "m" CmdMemoryShifted = "M" CmdNext = "n" CmdScreenMemory = "sm" CmdScreenMemoryShifted = "SM" CmdPokePeek = "p" CmdPokePeekWord = "pw" CmdStep = "s" CmdQuit = "q" CmdQuitLong = "quit" CmdRegisters = "r" CmdTrace = "t" CmdZap = "z" )
Variables ¶
View Source
var ( Black = color.RGBA{0x00, 0x00, 0x00, 0xff} White = color.RGBA{0xff, 0xff, 0xff, 0xff} Red = color.RGBA{0x88, 0x00, 0x00, 0xff} Cyan = color.RGBA{0xaa, 0xff, 0xee, 0xff} Purple = color.RGBA{0xcc, 0x44, 0xcc, 0xff} Green = color.RGBA{0x00, 0xcc, 0x55, 0xff} Blue = color.RGBA{0x00, 0x00, 0xaa, 0xff} Yellow = color.RGBA{0xee, 0xee, 0x77, 0xff} Orange = color.RGBA{0xdd, 0x88, 0x55, 0xff} Brown = color.RGBA{0x66, 0x44, 0x00, 0xff} LightRed = color.RGBA{0xff, 0x77, 0x77, 0xff} DarkGray = color.RGBA{0x33, 0x33, 0x33, 0xff} Gray = color.RGBA{0x77, 0x77, 0x77, 0xff} LightGreen = color.RGBA{0xaa, 0xff, 0x66, 0xff} LightBlue = color.RGBA{0x00, 0x88, 0xff, 0xff} LightGray = color.RGBA{0xbb, 0xbb, 0xbb, 0xff} )
View Source
var PetsciiShiftedDecoder = func(code uint8) (rune, bool) {
ch := petsciiShifted[code]
return ch, isPrintable(code) && ch != replacementChar
}
View Source
var PetsciiUnshiftedDecoder = func(code uint8) (rune, bool) {
ch := petsciiUnshifted[code]
return ch, isPrintable(code) && ch != replacementChar
}
View Source
var ScreenShiftedDecoder = func(code uint8) (rune, bool) { return decoder(code, PetsciiShiftedDecoder) }
View Source
var ScreenUnshiftedDecoder = func(code uint8) (rune, bool) { return decoder(code, PetsciiUnshiftedDecoder) }
Functions ¶
Types ¶
type CPU ¶
type CPU struct { PC uint16 // Program counter A uint8 // Accumulator X uint8 // X register Y uint8 // Y register SP uint8 // Stack pointer C bool // Carry flag Z bool // Zero flag I bool // Interrupt disable flag D bool // Decimal mode flag B bool // Break flag V bool // Overflow flag N bool // Signed flag // contains filtered or unexported fields }
CPU is the MOS Technology 6502 series processor.
type Disassembler ¶
type Disassembler struct { PC uint16 // contains filtered or unexported fields }
func NewDisassembler ¶
func NewDisassembler(mem *Memory) *Disassembler
func (*Disassembler) LoadSource ¶
func (d *Disassembler) LoadSource(source *Source)
func (*Disassembler) Next ¶
func (d *Disassembler) Next() Operation
type Instruction ¶
type Instruction int
const ( Illegal Instruction = iota // illegal instruction Adc // add with carry And // bitwise And with accumulator Asl // arithmetic shift left Bit // test bits Bmi // branch on minus Bcc // branch on carry clear Bcs // branch on carry set Beq // branch on equal Bne // branch on not equal Bpl // branch on plus Brk // break Bvc // branch on overflow clear Bvs // branch on overflow set Clc // clear carry Cld // clear decimal mode Cli // clear interrupt Clv // clear overflow Cmp // compare accumulator Cpx // compare x register Cpy // compare y register Dec // decrement memory Dex // decrement x Dey // decrement y Eor // bitwise exclusive or Inc // increment memory Inx // increment x Iny // increment y Jmp // jump Jsr // jump to subroutine Lda // load accumulator Ldx // load x register Ldy // load y register Lsr // logical shift right Nop // no operation Ora // bitwise or with accumulator Pha // push accumulator Php // push processor status Pla // pull accumulator Plp // pull processor status Rol // rotate left Ror // rotate right Rti // return from interrupt Rts // return from subroutine Sbc // subrtact with carry Sec // set carry Sed // set decimal mode Sei // set interrupt Sta // store accumulator Stx // store x register Sty // store y register Tax // transfer a to x Tay // transfer a to y Tsx // transfer stack pointer to x Txs // transfer x to stack pointer Txa // transfer x to a Tya // transfer y to a )
Instructions
func (Instruction) String ¶
func (i Instruction) String() string
type JiffyClock ¶
type JiffyClock struct {
// contains filtered or unexported fields
}
func NewJiffyClock ¶
func NewJiffyClock(cpu *CPU) *JiffyClock
func (*JiffyClock) Service ¶
func (c *JiffyClock) Service() error
type Keyboard ¶
type Keyboard struct {
// contains filtered or unexported fields
}
func NewKeyboard ¶
type Mach85 ¶
type Memory ¶
type Memory struct {
Base MemoryChunk
}
func NewMemory ¶
func NewMemory(base MemoryChunk) *Memory
type Memory64 ¶
type Memory64 struct { Chunks [14]MemoryChunk Game bool // pin 8 ExROM bool // pin 9 }
func NewMemory64 ¶
func NewMemory64() *Memory64
type MemoryChunk ¶
type Monitor ¶
type Monitor struct { Disassembler *Disassembler Prompt string // contains filtered or unexported fields }
func NewMonitor ¶
type NullMemory ¶
type NullMemory struct {
Value uint8
}
func (NullMemory) Load ¶
func (m NullMemory) Load(address uint16) uint8
func (NullMemory) Store ¶
func (m NullMemory) Store(address uint16, value uint8)
type Operation ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.