gpu

package
v0.0.0-...-88ca599 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeHBlank = iota
	ModeVBlank
	ModeOAM
	ModeVRAM
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GPU

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

func NewGBGPU

func NewGBGPU(io *ioports.IOPorts, renderer coreio.FrameDrawer, cgb bool) *GPU

func (*GPU) FlushFrameBuffer

func (gpu *GPU) FlushFrameBuffer()

func (*GPU) Read

func (gpu *GPU) Read(addr uint16) uint8

Proxy for _vram access & OAM

func (*GPU) Tick

func (gpu *GPU) Tick(cycles uint8) uint8

func (*GPU) Write

func (gpu *GPU) Write(addr uint16, value uint8)

type Sprite

type Sprite struct {
	X      uint8
	Y      uint8
	TileID uint8

	// Bit7   OBJ-to-BG Priority 					(0=OBJ Above BG, 1=OBJ Behind BG color 1-3)
	// 												(Used for both BG and Window. BG color 0 is always behind OBJ)
	ObjToBgPriority bool
	// Bit6   Y flip          						(0=Normal, 1=Vertically mirrored)
	YFlip bool
	// Bit5   X flip          						(0=Normal, 1=Horizontally mirrored)
	XFlip bool
	// Bit4   Palette number  **Non CGB Mode Only** (0=OBP0, 1=OBP1)
	PaletteNumber uint8

	// *** CGB MODE ***
	// Bit3   Tile VRAM-Bank  **CGB Mode Only**     (0=Bank 0, 1=Bank 1)
	BankNumber uint8
	// Bit2-0 Palette number  **CGB Mode Only**     (OBP0-7)
	ColorPalette uint8
	// contains filtered or unexported fields
}

func (*Sprite) GetPixels

func (t *Sprite) GetPixels(vram *gbVRAM, line uint8, offset uint8, mode8x16 bool) []uint8

Jump to

Keyboard shortcuts

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