Documentation ¶
Index ¶
- Constants
- type Bus
- func (b *Bus) BoostCPU(delta float64) float64
- func (b *Bus) CPUBoostRate() float64
- func (b *Bus) Cycles() uint64
- func (b *Bus) GetRAMRange(start, end uint16) []byte
- func (b *Bus) MakeSnapshot() Snapshot
- func (b *Bus) PollNMIInterrupt() bool
- func (b *Bus) ReadMemUint8(addr uint16) byte
- func (b *Bus) Reverse(s Snapshot)
- func (b *Bus) SetCPUBoostRate(rate float64) float64
- func (b *Bus) Tick(cycles uint64)
- func (b *Bus) WriteMemUint8(addr uint16, val byte)
- func (b *Bus) WriteRAM(addr uint16, data []byte)
- type JoyPad
- type JoyPadButton
- type RenderCallback
- type Snapshot
Constants ¶
View Source
const ( RAMSize = 2048 CpuRAMEnd = 0x1FFF CpuRAMMask uint16 = 0x7FF PPURegisterEnd = 0x3FFF CPUFrequency = 1790000 // Approximate CPUFrequency 1.79MHz see:https://www.nesdev.org/wiki/CPU CPUMaxBoost float64 = 2.0 CPUMinBoost float64 = 0.5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus 虚拟总线,CPU通过总线地址访问RAM, PPU, Registers
func NewBus ¶
func NewBus(cartridge cartridge.Cartridge, ppu *ppu.PPU, callback RenderCallback, joyPad1 *JoyPad, joyPad2 *JoyPad, apu *apu.BasicAPU) *Bus
NewBus 创建总线,并将PPU和ROM接入总线
func (*Bus) CPUBoostRate ¶
func (*Bus) GetRAMRange ¶
func (*Bus) MakeSnapshot ¶
func (*Bus) PollNMIInterrupt ¶
func (*Bus) ReadMemUint8 ¶
func (*Bus) SetCPUBoostRate ¶
func (*Bus) WriteMemUint8 ¶
type JoyPad ¶
type JoyPad struct {
// contains filtered or unexported fields
}
JoyPad joy pad
func (*JoyPad) SetButtonPressed ¶
func (j *JoyPad) SetButtonPressed(button JoyPadButton, pressed bool)
type JoyPadButton ¶
type JoyPadButton byte
const ( ButtonA JoyPadButton = 1 << iota ButtonB Select Start Up Down Left Right )
type RenderCallback ¶
Click to show internal directories.
Click to hide internal directories.