Documentation ¶
Index ¶
Constants ¶
View Source
const ( Vertical byte = iota Horizontal FourScreen OneScreenLow OneScreenHigh ProgramPageSize = 16 * 1024 CHRPageSize = 8 * 1024 HeaderSize = 16 )
Variables ¶
View Source
var ErrUnknownCartridgeFormat = errors.New("unknown cartridge format")
View Source
var ErrUnsupportedMapper = errors.New("unsupported mapper type")
View Source
var NES = [4]byte{0x4E, 0x45, 0x53, 0x1A}
Functions ¶
func MapperToString ¶
func MirroringToString ¶
Types ¶
type Cartridge ¶
type Cartridge interface { Read(addr uint16) byte Write(addr uint16, val byte) GetMirroring() byte // GetChrBank 获取bank编号对应的chr patternTable GetChrBank(bank byte) []byte WriteCHR(addr uint16, val byte) }
func MakeCartridge ¶
MakeCartridge 从iNES文件读取cartridge
type Info ¶
func ParseCartridgeInfo ¶
type Mapper0 ¶
type Mapper0 struct { Chr []byte // Chr 图形数据 PrgRAM []byte ChrRAM bool // contains filtered or unexported fields }
Mapper0 not switchable prg and chr rom
func (*Mapper0) GetChrBank ¶
func (*Mapper0) GetMirroring ¶
type Mapper002 ¶
type Mapper002 struct { PrgBanks [2][]byte ChrRAM bool Bank uint32 // contains filtered or unexported fields }
func NewMapper002 ¶
func (*Mapper002) GetChrBank ¶
func (*Mapper002) GetMirroring ¶
type Mapper003 ¶
type Mapper003 struct {
// contains filtered or unexported fields
}
func NewMapper003 ¶
func (*Mapper003) GetChrBank ¶
func (*Mapper003) GetMirroring ¶
type Mapper004 ¶
type Mapper004 struct {
// contains filtered or unexported fields
}
func NewMapper004 ¶
func (*Mapper004) GetChrBank ¶
func (*Mapper004) GetMirroring ¶
type Mapper0Shift ¶
type Mapper1 ¶
type Mapper1 struct { Raw []byte PrgStart uint32 ChrStart uint32 PrgRAM []byte ShiftReg Mapper0Shift CtrlReg byte PrgBankReg byte PrgBanks [2][]byte ChrBankRegs [2]byte ChrBanks [2][]byte ChrRAM bool }
Mapper1 支持切换chr和prg
func NewMapper1 ¶
func (*Mapper1) GetChrBank ¶
func (*Mapper1) GetMirroring ¶
Click to show internal directories.
Click to hide internal directories.