Documentation ¶
Index ¶
- Constants
- type MemMap
- type Pixels
- type SheetPos
- type SpriteAddr
- func (s SpriteAddr) PaletteSet() int
- func (s SpriteAddr) SetPaletteSet(v int) SpriteAddr
- func (s SpriteAddr) SetSheetAddr(v int) SpriteAddr
- func (s SpriteAddr) SetTileSetAddr(v int) SpriteAddr
- func (s SpriteAddr) SetTransparent(v bool) SpriteAddr
- func (s SpriteAddr) SheetAddr() int
- func (s SpriteAddr) TileSetAddr() int
- func (s SpriteAddr) Transparent() bool
- type SpriteDims
- func (s SpriteDims) FlipX() bool
- func (s SpriteDims) FlipY() bool
- func (s SpriteDims) Height() int
- func (s SpriteDims) SetFlipX(v bool) SpriteDims
- func (s SpriteDims) SetFlipY(v bool) SpriteDims
- func (s SpriteDims) SetHeight(v int) SpriteDims
- func (s SpriteDims) SetWidth(v int) SpriteDims
- func (s SpriteDims) Width() int
- type Tile
- type VDP
- func (vdp *VDP) ClearSprites(start, len int)
- func (vdp *VDP) DrawFrame(framebuf []byte)
- func (vdp *VDP) HandleBus(bus data.Bus) data.Bus
- func (vdp *VDP) IncSpritePos(sid, x, y int)
- func (vdp *VDP) LoadFile(filename string, addrround int) (int, error)
- func (vdp *VDP) LoadPalette(filename string) error
- func (vdp *VDP) LoadSheetSets(sheets, tiles string) error
- func (vdp *VDP) ResetMemMap()
- func (vdp *VDP) SetSpriteDims(sid, w, h int)
- func (vdp *VDP) SetSpritePos(sid, x, y int)
- func (vdp *VDP) SetSpriteSheetPos(sid, x, y int)
- func (vdp *VDP) SetSpriteSheetSet(sid, sheet, tileset int)
Constants ¶
const ( NumColors = 1024 BlockRamSize = 256 NumSprites = BlockRamSize LineBufWidth = BlockRamSize ScreenWidth = 640 ScreenHeight = 360 )
const ( BlockX = iota BlockY BlockDims BlockAddr BlockSPos BlockRG BlockBA )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SpriteAddr ¶
type SpriteAddr uint16
func (SpriteAddr) PaletteSet ¶
func (s SpriteAddr) PaletteSet() int
func (SpriteAddr) SetPaletteSet ¶
func (s SpriteAddr) SetPaletteSet(v int) SpriteAddr
func (SpriteAddr) SetSheetAddr ¶
func (s SpriteAddr) SetSheetAddr(v int) SpriteAddr
func (SpriteAddr) SetTileSetAddr ¶
func (s SpriteAddr) SetTileSetAddr(v int) SpriteAddr
func (SpriteAddr) SetTransparent ¶
func (s SpriteAddr) SetTransparent(v bool) SpriteAddr
func (SpriteAddr) SheetAddr ¶
func (s SpriteAddr) SheetAddr() int
func (SpriteAddr) TileSetAddr ¶
func (s SpriteAddr) TileSetAddr() int
func (SpriteAddr) Transparent ¶
func (s SpriteAddr) Transparent() bool
type SpriteDims ¶
type SpriteDims uint16
func (SpriteDims) FlipX ¶
func (s SpriteDims) FlipX() bool
func (SpriteDims) FlipY ¶
func (s SpriteDims) FlipY() bool
func (SpriteDims) Height ¶
func (s SpriteDims) Height() int
func (SpriteDims) SetFlipX ¶
func (s SpriteDims) SetFlipX(v bool) SpriteDims
func (SpriteDims) SetFlipY ¶
func (s SpriteDims) SetFlipY(v bool) SpriteDims
func (SpriteDims) SetHeight ¶
func (s SpriteDims) SetHeight(v int) SpriteDims
func (SpriteDims) SetWidth ¶
func (s SpriteDims) SetWidth(v int) SpriteDims
func (SpriteDims) Width ¶
func (s SpriteDims) Width() int
type VDP ¶
type VDP struct { Mem *data.Memory MemMap MemMap // block rams Palette [NumColors]color.RGBA X [NumSprites]int16 Y [NumSprites]int16 Dims [NumSprites]SpriteDims Addr [NumSprites]SpriteAddr SPos [NumSprites]SheetPos LineBuf [LineBufWidth][4]uint16 // state NumRenderedSprites int }
VDP is an emulated Video Display Processor
func (*VDP) ClearSprites ¶
ClearSprites zeros out the specified sprites
func (*VDP) IncSpritePos ¶
IncSpritePos sets the x, y position of the sprite
func (*VDP) LoadFile ¶
LoadFile loads a file into memory at NextAddr with the given address granularity (will round NextAddr to the nearest even multiple of addrround)
func (*VDP) LoadPalette ¶
LoadPalette loads a palette from a file
func (*VDP) LoadSheetSets ¶
LoadSheetSets loads a set of sprite sheets and tile sets
func (*VDP) ResetMemMap ¶
func (vdp *VDP) ResetMemMap()
ResetMemMap resets the memory map so loading starts at zero
func (*VDP) SetSpriteDims ¶
SetSpriteDims sets the width and height of the sprite
func (*VDP) SetSpritePos ¶
SetSpritePos sets the x, y position of the sprite
func (*VDP) SetSpriteSheetPos ¶
SetSpriteSheetPos sets the x, y position of the sprite in the sprite sheet
func (*VDP) SetSpriteSheetSet ¶
SetSpriteSheet sets the sheet and tile set address for a sprite from the memory map