gpu

package
v0.0.0-...-5560990 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LCDC types.Word = 0x00
	STAT            = 0x01
	// Scroll Y (R/W)
	// 8 Bit value $00-$FF to scroll BG Y screen
	// position.
	SCROLLY = 0x02
	// Scroll X (R/W)
	// 8 Bit value $00-$FF to scroll BG X screen
	// position.
	SCROLLX = 0x03
	// LY Y-Coordinate (R)
	// The LY indicates the vertical line to which
	// the present data is transferred to the LCD
	// Driver. The LY can take on any value
	// between 0 through 153. The values between
	// 144 and 153 indicate the V-Blank period.
	// Writing will reset the counter.
	LY  = 0x04
	LYC = 0x05
	// BGP - BG & Window Palette Data (R/W)
	// Bit 7-6 - Data for Dot Data 11
	// (Normally darkest color)
	// Bit 5-4 - Data for Dot Data 10
	// Bit 3-2 - Data for Dot Data 01
	// Bit 1-0 - Data for Dot Data 00
	// (Normally lightest color)
	// This selects the shade of grays to use
	// for the background (BG) & window pixels.
	// Since each pixel uses 2 bits, the
	// corresponding shade will be selected from here.
	DMA  = 0x06
	BGP  = 0x07
	OBP0 = 0x08
	OBP1 = 0x09
	WX   = 0x0B
	WY   = 0x0A
)

GPU register addresses

View Source
const (
	TILEMAP0  types.Word = 0x9800
	TILEMAP1             = 0x9C00
	TILEDATA0            = 0x8800
	TILEDATA1            = 0x8000
	OAMSTART             = 0xFE00
)
View Source
const CyclePerLine uint = 456

CyclePerLine is gpu clock count per line

View Source
const LCDVBlankHeight uint = 10

LCDVBlankHeight means vblank height

Variables

This section is empty.

Functions

This section is empty.

Types

type GPU

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

GPU is

func NewGPU

func NewGPU() *GPU

NewGPU is GPU constructor

func (*GPU) DMAStarted

func (g *GPU) DMAStarted() bool

func (*GPU) GetImageData

func (g *GPU) GetImageData() []byte

GetImageData is image data getter

func (*GPU) Init

func (g *GPU) Init(bus bus.Accessor, irq interrupt.Interrupt)

Init initialize GPU

func (*GPU) Read

func (g *GPU) Read(addr types.Word) byte

func (*GPU) Step

func (g *GPU) Step(cycles uint)

Step is run GPU

func (*GPU) Transfer

func (g *GPU) Transfer()

func (*GPU) Write

func (g *GPU) Write(addr types.Word, data byte)

type GPUMode

type GPUMode = byte

GPUMode

const (
	// HBlankMode is period CPU can access the display RAM ($8000-$9FFF).
	HBlankMode GPUMode = iota
	// period and the CPU can access the display RAM ($8000-$9FFF).
	VBlankMode
	SearchingOAMMode
	TransferingData
)

Jump to

Keyboard shortcuts

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