Documentation ¶
Index ¶
- func ConvertColorToUint32(c color.RGBA) uint32
- func ConvertToHex(n uint16, d uint8) string
- func ConvertUint8ToString(n uint8) string
- func IsPathExists(path string) bool
- func ReplaceStringAtIndex(str string, replacement byte, index int) string
- type Bus
- type CPU
- type Cartridge
- type Mapper
- type Mapper0
- type PPU
- func (ppu *PPU) CPURead(addr uint16, readOnly ...bool) uint8
- func (ppu *PPU) CPUWrite(addr uint16, data uint8)
- func (ppu *PPU) Clock()
- func (ppu *PPU) ConnectCartridge(cart *Cartridge)
- func (ppu *PPU) GetColorFromPaletteRAM(palette uint8, pixel uint8) color.RGBA
- func (ppu *PPU) GetNameTable(i uint8) *sdl.Surface
- func (ppu *PPU) GetPatternTable(i uint8, palette uint8) *sdl.Surface
- func (ppu *PPU) GetScreen() *sdl.Surface
- func (ppu *PPU) PPURead(addr uint16, readOnly ...bool) uint8
- func (ppu *PPU) PPUWrite(addr uint16, data uint8)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertColorToUint32 ¶
ConvertColorToUint32 Convert a color.RGBA struct to an uint32.
func ConvertToHex ¶
ConvertToHex Converts a heximal number to a human-readable string.
func ConvertUint8ToString ¶
ConvertUint8ToString Converts a uint8 to a human-readable decimal string.
func IsPathExists ¶
IsPathExists Check if a path exists, returns true when exists.
Types ¶
type Bus ¶
type Bus struct { CPU *CPU CPURAM []uint8 PPU *PPU Controller []uint8 // contains filtered or unexported fields }
Bus The main bus of a NES.
func (*Bus) InsertCartridge ¶
InsertCartridge Connects game cartridge to bus.
type CPU ¶
type CPU struct { // Public Bus *Bus A uint8 // Accumulator register X uint8 // X register Y uint8 // Y register SP uint8 // Stack pointer PC uint16 // Program pointer Status uint8 // Status register // contains filtered or unexported fields }
CPU MOS 6502 CPU struct
func ConnectCPU ¶
ConnectCPU Initialize a CPU and connect it to the bus.
func (*CPU) Disassemble ¶
Disassemble Converts 6502 binary to human readable 6502 assembly.
type Cartridge ¶
type Cartridge struct {
// contains filtered or unexported fields
}
Cartridge NES game cartridge.
func NewCartridge ¶
NewCartridge Load a .nes file and return a Cartridge struct.
type Mapper ¶
type Mapper interface { CPUMapRead(addr uint16, mappedAddr *uint32) bool CPUMapWrite(addr uint16, mappedAddr *uint32) bool PPUMapRead(addr uint16, mappedAddr *uint32) bool PPUMapWrite(addr uint16, mappedAddr *uint32) bool }
Mapper Generic mapper interface.
func NewMapper0 ¶
NewMapper0 Creates a new mapper of mapper0.
type Mapper0 ¶
type Mapper0 struct {
// contains filtered or unexported fields
}
Mapper0 Mapper0 struct
func (*Mapper0) CPUMapRead ¶
CPUMapRead Mapper0's CPUMapRead implementation.
func (*Mapper0) CPUMapWrite ¶
CPUMapWrite Mapper0's CPUMapWrite implementation.
func (*Mapper0) PPUMapRead ¶
PPUMapRead Mapper0's PPUMapRead implementation.
type PPU ¶
type PPU struct { // PPU RAM TableName [2][1024]uint8 OAM [256]uint8 NMI bool FrameComplete bool // contains filtered or unexported fields }
PPU Nintendo 2C02 PPU struct
func ConnectPPU ¶
ConnectPPU Initialize a PPU and connect it to the bus.
func (*PPU) ConnectCartridge ¶
ConnectCartridge Connect cartridge to PPU.
func (*PPU) GetColorFromPaletteRAM ¶
GetColorFromPaletteRAM Get a color from PPU internal palette RAM.
func (*PPU) GetNameTable ¶
GetNameTable Return PPU internal name table.
func (*PPU) GetPatternTable ¶
GetPatternTable Get PPU internal pattern table.