Crate tato_video

Crate tato_video 

Source

Modules§

color
data
prelude

Structs§

BGMap
A hardcoded “Tilemap”. Its dimensions are larger than the screen dimensions, allowing scrolling in both axis. For endless scrolling simply update the off-screen tiles before you reach them, or turn on Videochip.wrap_bg to repeat the current contents beyond its edges.
BgBundle
A simple packet of required data to fully set the attributes on a BG tile.
Cluster
A Cluster always stores 8 pixels, and simply gets larger the more colors you store in it. At 2 bits per pixel (4 colors) it is 2 bytes. Since we always have 8 bits per pixel, BITS_PER_PIXEL is also the number of bytes!
DrawBundle
A convenient packet of data used to draw a tile as a sprite.
PixelIter
Renders every pixel as it iterates the entire screen.
ScreenCoords
TileEntry
Keeps track of a texture tile’s dimensions and location in the tile pixel buffer.
TileFlags
A single byte struct that stores a tile’s render state such as horizontal flip, vertical flip, rotation and local palette.
TileID
Unique identifier for a tile. Starts at zero when chip is reset.
VideoChip
Main drawing context that manages the screen, tiles, and palette.

Constants§

BG_COLUMNS
Number of columns in BG Map
BG_HEIGHT
Number of rows in BG Map times tile size, in pixels.
BG_ROWS
Number of rows in BG Map
BG_WIDTH
Number of columns in BG Map times tile size, in pixels.
COLORS_PER_PALETTE
Number of colors per palette (applies to FG and BG palette, 32 colors total)
COLORS_PER_TILE
Number of colors per tile (2 bits per pixel)
LINE_COUNT
FG Draw buffer height.
LOCAL_PALETTE_COUNT
How many “local” palettes (palettes of 4 colors that map each index to the main FG and BG palettes)
PIXELS_PER_CLUSTER
A cluster always contains 8 pixels, regardless of color depth.
SUBPIXELS_FRAMEBUFFER
2 pixels per byte (16 colors per pixel)
SUBPIXELS_TILE
4 pixels per byte (4 colors per pixel)
TILE_SIZE
All tile dimensions must be a multiple of TILE_SIZE.