ppu

package
v0.0.0-...-22a0535 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PPU_PATTERN_TABLE0   = 0x0000
	PPU_PATTERN_TABLE1   = 0x1000
	PPU_NAME_TABLE0      = 0x2000
	PPU_ATTR_TABLE0      = 0x23C0
	PPU_NAME_TABLE1      = 0x2400
	PPU_ATTR_TABLE1      = 0x27C0
	PPU_NAME_TABLE2      = 0x2800
	PPU_ATTR_TABLE2      = 0x2BC0
	PPU_NAME_TABLE3      = 0x2C00
	PPU_ATTR_TABLE3      = 0x2FC0
	PPU_MIRROR_NE_TABLES = 0x3000
	PPU_BG_PALLET        = 0x3F00
	PPU_SPRITE_PALLET    = 0x3F10
	PPU_MIRROR_PALLETS   = 0x3F20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackgroundContent

type BackgroundContent struct {
	Tile      [][]byte
	PaletteID int
}

type PPU

type PPU struct {
	Registers []byte // 0x2000~0x2007
	MemoryMap [0x3FFF + 1]byte
	Cycle     int
	Line      int

	Background []BackgroundContent

	PaletteRAM []byte
	IsVBlank   bool
	SpriteRAM  [0xff + 1]byte
	// contains filtered or unexported fields
}

func NewPPU

func NewPPU(charROM []byte) *PPU

func (*PPU) GetData

func (p *PPU) GetData() byte

func (*PPU) GetSpriteRAM

func (p *PPU) GetSpriteRAM() byte

func (*PPU) Run

func (p *PPU) Run(cycle int) bool

func (*PPU) SetAddress

func (p *PPU) SetAddress(addr byte)

func (*PPU) SetData

func (p *PPU) SetData(val byte)

func (*PPU) SetSpriteRAM

func (p *PPU) SetSpriteRAM(val byte)

func (*PPU) SetSpriteRAMAddress

func (p *PPU) SetSpriteRAMAddress(addr byte)

Jump to

Keyboard shortcuts

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