Documentation
¶
Index ¶
- Constants
- func NewState() *state
- type BreakpointData
- type CPU
- type Emulator
- func (e *Emulator) IsPaused() bool
- func (e *Emulator) Pause()
- func (e *Emulator) ReadROM(filename string)
- func (e *Emulator) Resume()
- func (e *Emulator) SetBreakpoint(addr uint32)
- func (e *Emulator) SetRegisterBreakpoint(registers string)
- func (e *Emulator) Start()
- func (e *Emulator) StepAndWait(n int)
- func (e *Emulator) Stop()
- type Memory
- func (mem *Memory) ExportRam() []byte
- func (memory *Memory) GetByte(index uint32) uint8
- func (memory *Memory) GetByteBank(K uint8, offset uint16) uint8
- func (memory *Memory) LoadROM(r rom.ROM)
- func (memory *Memory) SetByte(value uint8, index uint32)
- func (memory *Memory) SetByteBank(value uint8, K uint8, offset uint16)
- type PPU
Constants ¶
const ( // HMax represents max H counter value HMax = 339 // VBSNTSC represents VBlank start counter value in NTSC VBSNTSC = 224 // VBSPAL represents VBlank start counter value in PAL VBSPAL = 239 // VMaxNTSC represents max V counter value in NTSC VMaxNTSC = 261 // VMaxPAL represents max V counter value in PAL VMaxPAL = 311 )
const HBLANKEND = 3
const HBLANKSTART = 1096
const HEIGHT = 250
const TILE_SIZE = 8
const WIDTH = 250
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BreakpointData ¶
type CPU ¶
type CPU struct { C uint16 // Accumulator register DBR uint8 // Data bank register D uint16 // The direct register K uint8 // The program bank register PC uint16 // The program counter S uint16 // The stack pointer register X uint16 // The X index register Y uint16 // The Y index register // contains filtered or unexported fields }
CPU represents the cpu 65C816
type Emulator ¶
type Emulator struct { CPU *CPU Memory *Memory PPU *PPU BreakpointCh chan BreakpointData // contains filtered or unexported fields }
Emulator gathers the components required for emulation (PPU, CPU, Memory)
func (*Emulator) SetBreakpoint ¶
func (*Emulator) SetRegisterBreakpoint ¶
func (*Emulator) StepAndWait ¶
StepAndWait continues the execution for the given number of steps (if given 0 it will loop until a pause is triggered or the emulator is stopped) then it waits for the emulator to reach the pause status
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory struct containing SNES working RAM, cartridge static RAM, special hardware registers and default memory buffer for ROM
func (*Memory) GetByteBank ¶
GetByteBank gets a byte by memory bank and offset
type PPU ¶
type PPU struct { Registers [0x40]*io.Register // Registers represents the ppu registers as methods // contains filtered or unexported fields }
PPU represents the Picture Processing Unit of the SNES
func (*PPU) Backgrounds ¶
func (*PPU) ExportVRam ¶
func (*PPU) VDisplay ¶
VDisplay returns of the vertical size of the screen depending on the mode (NTSC/PAL)
func (*PPU) VDisplayEnd ¶
VDisplayEnd returns the extra VBLANK area of the screen depending on the mode (NTSC/PAL)