Documentation
¶
Index ¶
- Constants
- type ColorTable
- type File
- type MemoryPreset
- type Packet
- func (p Packet) InstructionCode() byte
- func (p Packet) IsCgdCommand() bool
- func (p Packet) LoadColorTable() *ColorTable
- func (p Packet) MemoryPreset() *MemoryPreset
- func (p Packet) Print()
- func (p Packet) ScrollCopy() *Scroll
- func (p Packet) ScrollPreset() *Scroll
- func (p Packet) TileBlock(xor bool) *TileBlock
- type Screen
- type Scroll
- type TileBlock
Constants ¶
const BorderPresetCode = 2
BorderPresetCode is the instruction code for a border preset
const CDGMask = 0x3F
CDGMask is a mask for each byte instruction in a package
const LoadColorTableHightCode = 31
LoadColorTableHightCode is the instruction code to load the last 8 colors
const LoadColorTableLowCode = 30
LoadColorTableLowCode is the instruction code to load the first 8 colors
const MemoryPresetCode = 1
MemoryPresetCode is the instruction code for a memeory preset
const PacketSize = 24
PacketSize is the size of each cdg packet
const ScrollCopyCode = 24
ScrollCopyCode is the instruction code for a scroll copy
const ScrollPresetCode = 20
ScrollPresetCode is the instruction code for a scroll preset
const TileBlockCode = 6
TileBlockCode is the instruction code for a tile block
const TileBlockXorCode = 38
TileBlockXorCode is the instruction code for a tile block
const TransparentColorCode = 28
TransparentColorCode is the instruction code for a transpaarent color
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColorTable ¶
ColorTable represents a memory preset packge information
type File ¶
File is a wrapper around byte array to help parsing a CDG file
func (File) NextPacket ¶
NextPacket will return the next cdg packet or return an error
type MemoryPreset ¶
MemoryPreset represents a memory preset package information
type Packet ¶
Packet is 24 bytes of the cdg file
func (Packet) InstructionCode ¶
InstructionCode returns the cdg instruction code
func (Packet) IsCgdCommand ¶
IsCgdCommand test if the packet is a cdg command
func (Packet) LoadColorTable ¶
func (p Packet) LoadColorTable() *ColorTable
LoadColorTable will load the colors and return the offset
func (Packet) MemoryPreset ¶
func (p Packet) MemoryPreset() *MemoryPreset
MemoryPreset returns the data as a memory preset
func (Packet) ScrollCopy ¶
ScrollCopy will return the scoll data from the packet
func (Packet) ScrollPreset ¶
ScrollPreset will return the scoll data from the packet
type Screen ¶
Screen is a map of pixels to colors for a cdg
func (*Screen) LoadColorTable ¶
LoadColorTable updates the color map with the given packet
func (*Screen) MemoryPreset ¶
MemoryPreset updates the screen with the memory preset package
func (*Screen) TileBlockXOR ¶
TileBlockXOR will update the screen with the given tile
func (*Screen) UpdateWithPacket ¶
UpdateWithPacket takes a packet the screen should be updated with