Documentation ¶
Overview ¶
Package signal exposes the interface between the VCS and the television implementation.
Index ¶
Constants ¶
const ( AudioChannel0Shift = 5 AudioChannel1Shift = 13 ColorShift = 21 ScanlineShift = 29 ClockShift = 38 )
List of shift amounts to be used to access the corresponding bits in a SignalAttributes value.
const NoSignal = Scanline | Clock
NoSignal is the null value of the SignalAttributes type. It is assumed that a TV scanline/clock value of 511x255 is impossible and so can never be confused with a real signal
In an array of SignalAttributes a NoSignal indicates the end of the array - processing should stop.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColorSignal ¶
type ColorSignal uint8
ColorSignal represents the signal that is sent from the VCS to the television.
const VideoBlack ColorSignal = 0xff
VideoBlack is the ColorSignal value that indicates no pixel is being output.
type SignalAttributes ¶
type SignalAttributes uint64
SignalAttributes represents the data sent to the television.
const ( VSync SignalAttributes = 0b0000000000000000000000000000000000000000000001 VBlank SignalAttributes = 0b0000000000000000000000000000000000000000000010 CBurst SignalAttributes = 0b0000000000000000000000000000000000000000000100 HSync SignalAttributes = 0b0000000000000000000000000000000000000000001000 AudioUpdate SignalAttributes = 0b0000000000000000000000000000000000000000010000 AudioChannel0 SignalAttributes = 0b0000000000000000000000000000000001111111100000 // 8 bits AudioChannel1 SignalAttributes = 0b0000000000000000000000000111111110000000000000 // 8 bits Color SignalAttributes = 0b0000000000000000011111111000000000000000000000 // 8 bits Scanline SignalAttributes = 0b0000000011111111100000000000000000000000000000 // 9 bits Clock SignalAttributes = 0b1111111100000000000000000000000000000000000000 // 8 bits (signed) )
List of bit masks to be used to with the SignalAttribute type.
func (SignalAttributes) String ¶
func (a SignalAttributes) String() string
type StateAdj ¶ added in v0.10.1
type StateAdj int
StateAdj is used to specify adjustment scale for the ReqAdjust() function.
const ( AdjScanline AdjInstruction AdjCPUCycle AdjClock )
List of valid adjustment scales.
type StateReq ¶
type StateReq int
StateReq is used to identify which television attribute is being asked with the GetState() function.
const ( ReqScanline ReqClock )
List of valid state requests.
type TelevisionSprite ¶
TelevisionSprite exposes only the functions required by the video sprites.
type TelevisionTIA ¶
type TelevisionTIA interface { Signal(SignalAttributes) error GetState(StateReq) int }
TelevisionTIA exposes only the functions required by the TIA.