nes

package
v0.0.0-...-e9d6438 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Carry    = 0x01
	Zero     = 0x02
	Irq      = 0x04
	Decimal  = 0x08
	Break    = 0x10
	Reserved = 0x20
	Overflow = 0x40
	Negative = 0x80
)
View Source
const HeaderSize = 0x0010

Variables

View Source
var (
	UpLeft    = image.Point{X: 0, Y: 0}
	DownRight = image.Point{X: 256, Y: 240}
)

Functions

This section is empty.

Types

type AddrMode

type AddrMode uint
const (
	Accumulator AddrMode = iota
	Immediate
	Zeropage
	ZeropageX
	ZeropageY
	Absolute
	AbsoluteX
	AbsoluteY
	Indirect
	IndirectX
	IndirectY
	Implied
	Relative
)

func (AddrMode) String

func (a AddrMode) String() string

type Bus

type Bus struct {
	// contains filtered or unexported fields
}

func NewBus

func NewBus(wram Mem, prgRom []byte) *Bus

func (*Bus) BugLoadw

func (b *Bus) BugLoadw(addr word) word

func (*Bus) Load

func (b *Bus) Load(addr word) byte

func (*Bus) Loadw

func (b *Bus) Loadw(addr word) word

func (*Bus) Store

func (b *Bus) Store(addr word, v byte)

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController() *Controller

func (*Controller) SetButton

func (c *Controller) SetButton(b [8]bool)

type Cpu

type Cpu struct {
	A  byte
	X  byte
	Y  byte
	S  byte
	P  byte
	PC word
	// contains filtered or unexported fields
}

func NewCpu

func NewCpu(bus *Bus) *Cpu

func (*Cpu) InterruptNmi

func (c *Cpu) InterruptNmi()

type Ines

type Ines interface {
	PrgRom() []byte
	ChrRom() []byte
	IsHorizontalMirror() bool
}

func NewCassette

func NewCassette(path string) (Ines, error)

type Instruction

type Instruction struct {
	// contains filtered or unexported fields
}

type Mapper0

type Mapper0 struct {
	// contains filtered or unexported fields
}

func (*Mapper0) ChrRom

func (m *Mapper0) ChrRom() []byte

func (*Mapper0) IsHorizontalMirror

func (m *Mapper0) IsHorizontalMirror() bool

func (*Mapper0) PrgRom

func (m *Mapper0) PrgRom() []byte

type Mem

type Mem interface {
	// contains filtered or unexported methods
}

func NewRam

func NewRam(size int) Mem

func NewVRamInit

func NewVRamInit(size int, init []byte, isHorizontalMirror bool) Mem

type Nes

type Nes struct {
	// contains filtered or unexported fields
}

func NewNes

func NewNes(cassette Ines) *Nes

func (*Nes) Buffer

func (n *Nes) Buffer() *image.RGBA

func (*Nes) Init

func (n *Nes) Init() error

func (*Nes) PushButton

func (n *Nes) PushButton(b [8]bool)

func (*Nes) Run

func (n *Nes) Run()

type Ppu

type Ppu struct {
	// Core
	PpuCtrl   byte // 0x2000
	PpuMask   byte // 0x2001
	PpuStatus byte // 0x2002
	OamAddr   byte // 0x2003
	OamData   byte // 0x2004

	PpuScrollX byte // 0x2005(1)
	PpuScrollY byte // 0x2005(2)
	PpuAddr    word // 0x2006

	PpuData byte // 0x2007
	// contains filtered or unexported fields
}

func NewPpu

func NewPpu(bus *Bus, chrRom []byte, r *Renderer, isHorizontalMirror bool) *Ppu

type Ram

type Ram struct {
	// contains filtered or unexported fields
}

RAM for cpu

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer() *Renderer

func (*Renderer) Buffer

func (r *Renderer) Buffer() *image.RGBA

type Sprite

type Sprite struct {
	// contains filtered or unexported fields
}

type Tile

type Tile struct {
	// contains filtered or unexported fields
}

type VRam

type VRam struct {
	// contains filtered or unexported fields
}

Ram for ppu

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL