Documentation
¶
Index ¶
- Variables
- type Cartridge
- type Mapper0
- func (m *Mapper0) LoadState(r *binario.Reader) error
- func (m *Mapper0) MirrorMode() MirrorMode
- func (m *Mapper0) PendingIRQ() bool
- func (m *Mapper0) ReadCHR(addr uint16) byte
- func (m *Mapper0) ReadPRG(addr uint16) byte
- func (m *Mapper0) Reset()
- func (m *Mapper0) SaveState(w *binario.Writer) error
- func (m *Mapper0) ScanlineTick()
- func (m *Mapper0) WriteCHR(addr uint16, data byte)
- func (m *Mapper0) WritePRG(addr uint16, data byte)
- type Mapper007
- func (m *Mapper007) LoadState(r *binario.Reader) error
- func (m *Mapper007) MirrorMode() MirrorMode
- func (m *Mapper007) PendingIRQ() bool
- func (m *Mapper007) ReadCHR(addr uint16) byte
- func (m *Mapper007) ReadPRG(addr uint16) byte
- func (m *Mapper007) Reset()
- func (m *Mapper007) SaveState(w *binario.Writer) error
- func (m *Mapper007) ScanlineTick()
- func (m *Mapper007) WriteCHR(addr uint16, data byte)
- func (m *Mapper007) WritePRG(addr uint16, data byte)
- type Mapper1
- func (m *Mapper1) LoadState(r *binario.Reader) error
- func (m *Mapper1) MirrorMode() MirrorMode
- func (m *Mapper1) PendingIRQ() bool
- func (m *Mapper1) ReadCHR(addr uint16) byte
- func (m *Mapper1) ReadPRG(addr uint16) byte
- func (m *Mapper1) Reset()
- func (m *Mapper1) SaveState(w *binario.Writer) error
- func (m *Mapper1) ScanlineTick()
- func (m *Mapper1) WriteCHR(addr uint16, data byte)
- func (m *Mapper1) WritePRG(addr uint16, data byte)
- type Mapper2
- func (m *Mapper2) LoadState(w *binario.Reader) error
- func (m *Mapper2) MirrorMode() MirrorMode
- func (m *Mapper2) PendingIRQ() bool
- func (m *Mapper2) ReadCHR(addr uint16) byte
- func (m *Mapper2) ReadPRG(addr uint16) byte
- func (m *Mapper2) Reset()
- func (m *Mapper2) SaveState(w *binario.Writer) error
- func (m *Mapper2) ScanlineTick()
- func (m *Mapper2) WriteCHR(addr uint16, data byte)
- func (m *Mapper2) WritePRG(addr uint16, data byte)
- type Mapper3
- func (m *Mapper3) LoadState(r *binario.Reader) error
- func (m *Mapper3) MirrorMode() MirrorMode
- func (m *Mapper3) PendingIRQ() bool
- func (m *Mapper3) ReadCHR(addr uint16) byte
- func (m *Mapper3) ReadPRG(addr uint16) byte
- func (m *Mapper3) Reset()
- func (m *Mapper3) SaveState(w *binario.Writer) error
- func (m *Mapper3) ScanlineTick()
- func (m *Mapper3) WriteCHR(addr uint16, data byte)
- func (m *Mapper3) WritePRG(addr uint16, data byte)
- type Mapper4
- func (m *Mapper4) LoadState(r *binario.Reader) error
- func (m *Mapper4) MirrorMode() MirrorMode
- func (m *Mapper4) PendingIRQ() (v bool)
- func (m *Mapper4) ReadCHR(addr uint16) byte
- func (m *Mapper4) ReadPRG(addr uint16) byte
- func (m *Mapper4) Reset()
- func (m *Mapper4) SaveState(w *binario.Writer) error
- func (m *Mapper4) ScanlineTick()
- func (m *Mapper4) WriteCHR(addr uint16, data byte)
- func (m *Mapper4) WritePRG(addr uint16, data byte)
- type MirrorMode
- type ROM
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrSavedStateMismatch = errors.New("saved state mismatch (probably different roms)")
)
Functions ¶
This section is empty.
Types ¶
type Cartridge ¶
type Cartridge interface { // Reset resets the cartridge to its initial state. Reset() // ScanlineTick performs a scanline tick used by some mappers. ScanlineTick() // PendingIRQ returns true if the cartridge has an IRQ pending. PendingIRQ() bool // MirrorMode returns the cartridge's mirroring mode. MirrorMode() MirrorMode // ReadPRG handles CPU reads from PRG ROM (0x8000-0xFFFF). ReadPRG(addr uint16) byte // WritePRG handles CPU writes to PRG ROM (0x8000-0xFFFF). WritePRG(addr uint16, data byte) // ReadCHR handles PPU reads from CHR ROM (0x0000-0x1FFF). ReadCHR(addr uint16) byte // WriteCHR handles PPU writes to CHR ROM (0x0000-0x1FFF). WriteCHR(addr uint16, data byte) // SaveState saves the cartridge state to the given writer. SaveState(w *binario.Writer) error // LoadState restores the cartridge state from the given reader. LoadState(r *binario.Reader) error }
func NewCartridge ¶
type Mapper0 ¶
type Mapper0 struct {
// contains filtered or unexported fields
}
Mapper0 is the simplest mapper. It has no registers, and it only supports 16KB or 32KB PRG-ROM banks and 8KB CHR-ROM banks.
PRG-ROM is mapped to 0x8000-0xFFFF. CHR-ROM is mapped to 0x0000-0x1FFF.
func NewMapper0 ¶
func (*Mapper0) MirrorMode ¶
func (m *Mapper0) MirrorMode() MirrorMode
func (*Mapper0) PendingIRQ ¶
func (*Mapper0) ScanlineTick ¶
func (m *Mapper0) ScanlineTick()
type Mapper007 ¶
type Mapper007 struct {
// contains filtered or unexported fields
}
Mapper007 implements iNES mapper #7 aka AxROM. https://www.nesdev.org/wiki/AxROM
func NewMapper7 ¶
func (*Mapper007) MirrorMode ¶
func (m *Mapper007) MirrorMode() MirrorMode
func (*Mapper007) PendingIRQ ¶
func (*Mapper007) ScanlineTick ¶
func (m *Mapper007) ScanlineTick()
type Mapper1 ¶
type Mapper1 struct {
// contains filtered or unexported fields
}
Mapper1 implements the MMC1 mapper. https://www.nesdev.org/wiki/MMC1
func NewMapper1 ¶
func (*Mapper1) MirrorMode ¶
func (m *Mapper1) MirrorMode() MirrorMode
func (*Mapper1) PendingIRQ ¶
func (*Mapper1) ScanlineTick ¶
func (m *Mapper1) ScanlineTick()
type Mapper2 ¶
type Mapper2 struct {
// contains filtered or unexported fields
}
func NewMapper2 ¶
func (*Mapper2) MirrorMode ¶
func (m *Mapper2) MirrorMode() MirrorMode
func (*Mapper2) PendingIRQ ¶
func (*Mapper2) ScanlineTick ¶
func (m *Mapper2) ScanlineTick()
type Mapper3 ¶
type Mapper3 struct {
// contains filtered or unexported fields
}
func NewMapper3 ¶
func (*Mapper3) MirrorMode ¶
func (m *Mapper3) MirrorMode() MirrorMode
func (*Mapper3) PendingIRQ ¶
func (*Mapper3) ScanlineTick ¶
func (m *Mapper3) ScanlineTick()
type Mapper4 ¶
type Mapper4 struct {
// contains filtered or unexported fields
}
Mapper4 implements the MMC3 mapper. https://wiki.nesdev.com/w/index.php/MMC3
func NewMapper4 ¶
func (*Mapper4) MirrorMode ¶
func (m *Mapper4) MirrorMode() MirrorMode
func (*Mapper4) PendingIRQ ¶
func (*Mapper4) ScanlineTick ¶
func (m *Mapper4) ScanlineTick()
type MirrorMode ¶
type MirrorMode = uint8
const ( MirrorHorizontal MirrorMode = 0 MirrorVertical MirrorMode = 1 MirrorSingle0 MirrorMode = 2 MirrorSingle1 MirrorMode = 3 )
Click to show internal directories.
Click to hide internal directories.