Documentation
¶
Index ¶
- type APU
- type Button
- type CPU
- type Cartridge
- func (p *Cartridge) CPURead(address uint16, data *uint8) bool
- func (p *Cartridge) CPUWrite(address uint16, data uint8) bool
- func (p *Cartridge) MirroringType() mappers.MirroringType
- func (p *Cartridge) PPURead(address uint16, data *uint8) bool
- func (p *Cartridge) PPUWrite(address uint16, data uint8) bool
- func (p *Cartridge) Reset()
- type Console
- func (b *Console) AudioSource() *APU
- func (b *Console) Controller1() InputController
- func (b *Console) Controller2() InputController
- func (b *Console) Disassemble()
- func (b *Console) InsertCartridge(c *Cartridge)
- func (b *Console) Reset()
- func (b *Console) Step()
- func (b *Console) StepFrame()
- func (b *Console) TextureProvider() gui.TextureProvider
- type InputController
- type PPU
- func (ppu *PPU) CPURead(address uint16, readOnly bool) uint8
- func (ppu *PPU) CPUWrite(address uint16, data uint8)
- func (ppu *PPU) IncrementScrollX()
- func (ppu *PPU) IncrementScrollY()
- func (ppu *PPU) InsertCartridge(c *Cartridge)
- func (ppu *PPU) LoadBackgroundShifters()
- func (ppu *PPU) PPURead(address uint16, readOnly bool) uint8
- func (ppu *PPU) PPUWrite(address uint16, data uint8)
- func (ppu *PPU) Step()
- func (ppu *PPU) Texture(idx ...int) *image.RGBA
- func (ppu *PPU) TransferAddressX()
- func (ppu *PPU) TransferAddressY()
- func (ppu *PPU) UpdateShifters()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APU ¶
type APU struct {
// contains filtered or unexported fields
}
APU represents the NES Audio Processing Unit
func (*APU) AudioChannel ¶
AudioChannel returns an audio channel to output the emulated audio
type Button ¶
type Button int
Button represents a controller button
const ( // ButtonA is the NES A button ButtonA Button = iota // ButtonB is the NES B button ButtonB // ButtonStart is the NES Start button ButtonStart // ButtonSelect is the NES Select button ButtonSelect // ButtonUP is the NES Up button ButtonUP // ButtonDOWN is the NES Down button ButtonDOWN // ButtonLEFT is the NES Left button ButtonLEFT // ButtonRIGHT is the NES Right button ButtonRIGHT )
type CPU ¶
type CPU struct { Lookup instructionSet // contains filtered or unexported fields }
CPU represents the 6502 nes cpu
func (*CPU) ConnectBus ¶
ConnectBus attaches the console bus to the cpu
func (*CPU) DissasembleCurrentPC ¶
DissasembleCurrentPC writes to the writer the dissasembed currently executed code
type Cartridge ¶
type Cartridge struct {
// contains filtered or unexported fields
}
Cartridge represents a NES cartridge
func NewCartridge ¶
NewCartridge creates a new cartridge from the specified file
func (*Cartridge) MirroringType ¶
func (p *Cartridge) MirroringType() mappers.MirroringType
MirroringType returns the current mirroring type
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console represents the NES
func (*Console) AudioSource ¶
AudioSource provides the audio source to the outside
func (*Console) Controller1 ¶
func (b *Console) Controller1() InputController
Controller1 returns a handle to the first NES controller
func (*Console) Controller2 ¶
func (b *Console) Controller2() InputController
Controller2 returns a handle to the second NES controller
func (*Console) Disassemble ¶
func (b *Console) Disassemble()
Disassemble shows the currently executed code
func (*Console) InsertCartridge ¶
InsertCartridge connects the cartridge to the console
func (*Console) StepFrame ¶
func (b *Console) StepFrame()
StepFrame steps the console enough to generate one frame
func (*Console) TextureProvider ¶
func (b *Console) TextureProvider() gui.TextureProvider
TextureProvider returns the texture provider, in this case the PPU
type InputController ¶
type InputController interface { Press(button Button) // Reset prepares the controller for another read Reset() }
InputController represents an input controller that acts as an interface to the internal nes controller, the 'Presses' should be scanned from the input device as they will be buffered and scanned by the CPU and flushed when instructed
type PPU ¶
type PPU struct {
// contains filtered or unexported fields
}
PPU represents the Picture Processing Unit of the NES
func (*PPU) IncrementScrollX ¶
func (ppu *PPU) IncrementScrollX()
IncrementScrollX updates variables for X-scrolling
func (*PPU) IncrementScrollY ¶
func (ppu *PPU) IncrementScrollY()
IncrementScrollY update variables for Y-scrolling
func (*PPU) InsertCartridge ¶
InsertCartridge sets the current cartridge
func (*PPU) LoadBackgroundShifters ¶
func (ppu *PPU) LoadBackgroundShifters()
LoadBackgroundShifters prepares the shifters to render the next background tile
func (*PPU) Texture ¶
Texture returns the current texture rendered by the PPU This implements gui.TextureProvider
func (*PPU) TransferAddressX ¶
func (ppu *PPU) TransferAddressX()
TransferAddressX copies from the tempVRAM the nametable and coarseX variables
func (*PPU) TransferAddressY ¶
func (ppu *PPU) TransferAddressY()
TransferAddressY copies from the tempVRAM the nametable and coarseY variables and fineY
func (*PPU) UpdateShifters ¶
func (ppu *PPU) UpdateShifters()
UpdateShifters shifts one position the background shifters and updates the sprite shifters also