Enum cdg::Command
[−]
[src]
pub enum Command { MemoryPreset { color: u8, repeat: u8, }, BorderPreset { color: u8, }, TileNormal { tile: Tile, }, TileXOR { tile: Tile, }, Scroll { color: Option<u8>, cmd: (ScrollCommand, ScrollCommand), offset: (u8, u8), }, SetTransparent { color: u8, }, LoadPalette { offset: u8, clut: [RgbColor; 8], }, }
One drawing command
Variants
MemoryPreset
Clear the scren to color
. This command will usually appear
multiple times in a row with repeat
incrementing each time,
starting at 0. If you trust your CDG to be without errors, you
can therefore ignore MemoryPreset commands with a nonzero
repeat value
Fields of MemoryPreset
color: u8 | |
repeat: u8 |
BorderPreset
Clear the border region to color
. Documents vary as to
whether the border region is the outside tile or the outside
half-tile.
Fields of BorderPreset
color: u8 |
TileNormal
Draw a tile normally
Fields of TileNormal
tile: Tile |
TileXOR
Draw a tile by XORing the color indices in the tile with the colors indices already drawn. Note that this does not operate on RGB values.
Fields of TileXOR
tile: Tile |
Scroll
Scroll the screen by the given horizontal and vertical amount,
respectively. offset
is given as an absolute position within
the first tile to begin scanout.
If color
is none, the tiles scrolled off one side of the
framebuffer should be copied to the other side. Otherwise,
they should be filled in with color
Fields of Scroll
color: Option<u8> | |
cmd: (ScrollCommand, ScrollCommand) | |
offset: (u8, u8) |
SetTransparent
Set one element of the CLUT to transparent, to enable background video/images
Fields of SetTransparent
color: u8 |
LoadPalette
Load one half of the CLUT. offset
will be either 0 or 8,
depending on whether the bottom or top half of the CLUT is to
be loaded.
These changes take effect immediately, so this can be used to implement color cycling.
Fields of LoadPalette
offset: u8 | |
clut: [RgbColor; 8] |