Documentation ¶
Index ¶
- Constants
- type BGTileMapArea
- type BGWindowTileDataArea
- type Color
- type GPU
- func (g *GPU) Display() (*image.RGBA, *image.RGBA)
- func (g *GPU) ImageData() ([SCREEN_WIDTH][SCREEN_HEIGHT]color.RGBA, [3][128]Tile)
- func (g *GPU) Init(bus interfaces.Bus, requestIRQ func(byte))
- func (g *GPU) IsDmaStarted() bool
- func (g *GPU) Read(addr types.Addr) byte
- func (g *GPU) Step(cycles uint)
- func (g *GPU) TransferOAM()
- func (g *GPU) Write(addr types.Addr, value byte)
- type LCDC
- func (l *LCDC) BGTileMapArea() BGTileMapArea
- func (l *LCDC) BGWinEnable() bool
- func (l *LCDC) BGWinTileDataArea() BGWindowTileDataArea
- func (l *LCDC) LCDPPUEnable() bool
- func (l *LCDC) OBJEnable() bool
- func (l *LCDC) OBJSize() uint8
- func (l *LCDC) WinTileMapArea() WindowTileMapArea
- func (l *LCDC) WindowEnable() bool
- type LCDS
- type Mode
- type OAM
- type Obj
- type Palette
- type Scroll
- type Sprite
- type Tile
- type TileMap
- type WindowTileMapArea
Constants ¶
View Source
const ( SCREEN_WIDTH = 160 SCREEN_HEIGHT = 144 )
View Source
const ( LCDCAddr types.Addr = 0x40 LCDSAddr = 0x41 SCYAddr = 0x42 SCXAddr = 0x43 LYAddr = 0x44 LYCAddr = 0x45 DMAAddr = 0x46 BGPAddr = 0x47 OBP0Addr = 0x48 OBP1Addr = 0x49 WYAddr = 0x4A WXAddr = 0x4B BCPSAddr = 0x68 BCPDAddr = 0x69 OCPSAddr = 0x6A OCPDAddr = 0x6B )
Offset is FF00
View Source
const CyclePerLine = 456
View Source
const OAMSTARTAddr types.Addr = 0xFE00
View Source
const SPRITE_NUM = 40
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BGTileMapArea ¶
const ( BGTileMapArea0 BGTileMapArea = 0x9800 BGTileMapArea1 = 0x9C00 )
type BGWindowTileDataArea ¶
const ( BGWindowTileDataArea0 BGWindowTileDataArea = 0x8800 BGWindowTileDataArea1 = 0x8000 )
type GPU ¶
type GPU struct { LCDC *LCDC LCDS *LCDS Scroll *Scroll DMA byte // contains filtered or unexported fields }
func (*GPU) ImageData ¶
func (g *GPU) ImageData() ([SCREEN_WIDTH][SCREEN_HEIGHT]color.RGBA, [3][128]Tile)
func (*GPU) IsDmaStarted ¶
type LCDC ¶
type LCDC struct {
Data byte
}
Addresss is $FF40
LCDC is [Liquid Crystal Display Controll] Its bits toggle what elements are displayed on the screen, and how. @see https://gbdev.io/pandocs/LCDC.html#lcd-control
func (*LCDC) BGTileMapArea ¶
func (l *LCDC) BGTileMapArea() BGTileMapArea
BG tile map area
0=9800-9BFF, 1=9C00-9FFF
func (*LCDC) BGWinTileDataArea ¶
func (l *LCDC) BGWinTileDataArea() BGWindowTileDataArea
BG and Window tile data area
0=8800-97FF, 1=8000-8FFF
func (*LCDC) WinTileMapArea ¶
func (l *LCDC) WinTileMapArea() WindowTileMapArea
Window tile map area
0=9800-9BFF, 1=9C00-9FFF
type LCDS ¶
type LCDS struct {
Data byte
}
Addresss is $FF41
LCDC is [Liquid Crystal Display Status] @see https://gbdev.io/pandocs/STAT.html#lcd-status-register
type Palette ¶
type Palette struct { // FF47 BGP byte // FF48 OBP0 byte // FF49 OBP1 byte // FF68 BCPS byte // FF69 BCPD byte // FF6A OCPS byte // FF6B OCPD byte }
func NewPalette ¶
func NewPalette() *Palette
type Scroll ¶
type Scroll struct {
// FF42, FF43
SCY, SCX byte
/*
FF44
LY indicates the current horizontal line
LY can hold any value from 0 to 153,
with values from 144 to 153 indicating the VBlank period.
if LY >= 154 LY = 0
*/
LY byte
/*
FF45
The Game Boy permanently compares the value of the LYC and LY registers.
When both values are identical, the “LYC=LY” flag in the STAT register is
set, and (if enabled) a STAT interrupt is requested.
*/
LYC byte
// FF4A, FF4B
WX, WY byte
}
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
func (*Sprite) CGBPaletteNo ¶
type WindowTileMapArea ¶
const ( WindowTileMapArea0 WindowTileMapArea = 0x9800 WindowTileMapArea1 = 0x9C00 )
Click to show internal directories.
Click to hide internal directories.