ppu

package
v0.0.0-...-7b13208 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const CYCLES_PER_LINE = 341
View Source
const SPRITES_ARRAY_MAX = 64
View Source
const SPRITES_NUMBER = 0x100

Variables

This section is empty.

Functions

This section is empty.

Types

type Background

type Background struct {
	Tiles []Tile
}

func NewBackground

func NewBackground() Background

func (*Background) Clear

func (this *Background) Clear()

type PaletteRam

type PaletteRam struct {
	PaletteRam bus.Ram
}

func NewPaletteRam

func NewPaletteRam() PaletteRam

func (PaletteRam) Read

func (this PaletteRam) Read() []byte

func (*PaletteRam) Write

func (this *PaletteRam) Write(addr uint16, data byte)

type Ppu

type Ppu struct {
	Registers         []byte
	Cycle             int
	Line              int
	IsValidVramAddr   bool
	IsLowerVramAddr   bool
	SpriteRamAddr     uint16
	VramAddr          uint16
	Vram              bus.Ram
	VramReadBuf       byte
	SpriteRam         bus.Ram
	Bus               bus.PpuBus
	Background        Background
	Sprites           []SpriteWithAttribute
	RenderingData     RenderingData
	Palette           PaletteRam
	Interrupts        *cpu_interrupts.Interrupts
	IsHrizontalScroll bool
	ScrollX           byte
	ScrollY           byte
	IsHrizontalMirror bool
}

func NewPpu

func NewPpu(ppubus bus.PpuBus, interrupts *cpu_interrupts.Interrupts, isHrizontalMirror bool) Ppu

func (Ppu) Read

func (this Ppu) Read(addr uint16) byte

func (*Ppu) Run

func (this *Ppu) Run(cpuCycle int) bool

func (*Ppu) TransferSprite

func (this *Ppu) TransferSprite(index uint16, data byte)

func (*Ppu) Write

func (this *Ppu) Write(addr uint16, data byte)

type RenderingData

type RenderingData struct {
	Palette    []byte
	Background Background
	Sprites    []SpriteWithAttribute
}

func (RenderingData) IsSetBackground

func (this RenderingData) IsSetBackground() bool

func (RenderingData) IsSetSprites

func (this RenderingData) IsSetSprites() bool

type Sprite

type Sprite [8][8]byte

type SpriteWithAttribute

type SpriteWithAttribute struct {
	SpriteArry Sprite
	X          byte
	Y          byte
	Attribute  byte
	SpriteId   byte
	IsSet      bool //Spriteがセットされているか判定するgoNes独自パラメータ
}

func NewStripeWithAttribute

func NewStripeWithAttribute(sprite Sprite, x byte, y byte, attribute byte, spriteId byte) SpriteWithAttribute

type Tile

type Tile struct {
	Sprite    Sprite
	Scroll_x  byte
	Scroll_y  byte
	PaletteId int
}

Jump to

Keyboard shortcuts

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