Documentation ¶
Overview ¶
Package specification contains the definitions, including colour, of the PAL and NTSC television protocols supported by the emulation.
Index ¶
Constants ¶
const ( HorizClksHBlank = 68 HorizClksVisible = 160 HorizClksScanline = 228 )
From the Stella Programmer's Guide:
"Each scan lines starts with 68 clock counts of horizontal blank (not seen on the TV screen) followed by 160 clock counts to fully scan one line of TV picture. When the electron beam reaches the end of a scan line, it returns to the left side of the screen, waits for the 68 horizontal blank clock counts, and proceeds to draw the next line below."
Horizontal clock counts are the same for both TV specifications. Vertical information should be accessed via SpecNTSC or SpecPAL.
Variables ¶
var PaletteNTSC = []color.RGBA{}
PaletteNTSC is the collection of NTSC colours.
var PalettePAL = []color.RGBA{}
PalettePAL is the collection of PAL colours.
var SpecList = []string{"NTSC", "PAL"}
SpecList is the list of specifications that the television may adopt.
Functions ¶
This section is empty.
Types ¶
type Spec ¶
type Spec struct { ID string Colors []color.RGBA // the number of scanlines the 2600 Programmer's guide recommends for the // top/bottom parts of the screen: // // "A typical frame will consists of 3 vertical sync (VSYNC) lines*, 37 vertical // blank (VBLANK) lines, 192 TV picture lines, and 30 overscan lines. Atari’s // research has shown that this pattern will work on all types of TV sets." // // the above figures are in reference to the NTSC protocol ScanlinesVSync int ScanlinesVisible int ScanlinesOverscan int // the total number of scanlines for the entire frame is the sum of the // four individual portions ScanlinesTotal int // the scanline at which the VBLANK should be turned off (Top) and // turned back on again (Bottom). the period between the top and bottom // scanline is the visible portion of the screen. // // in practice, the VCS can turn VBLANK on and off at any time; what the // two values below represent what "Atari's research" has shown to be safe. // by definition this means that: // // Top = VSync + Vblank // // Bottom = Top + Visible // // or // // Bottom = Total - Overscan AtariSafeTop int AtariSafeBottom int // resizing of the TV is problematic because we can't rely on the VBLANK to // tell us when the pixels are meant to be in view. The NewSafeTop // an NewSafeBottom are the min/max values that the resizer should // allow. NewSafeTop int NewSafeBottom int // AaspectBias transforms the scaling factor for the X axis. // values taken from Stella emualtor. useful for A/B testing AspectBias float32 // the number of frames per second required by the specification FramesPerSecond float32 // if the generated image is exactly ScanlinesTotal in height then how many // pixels would that be. used for frame rate measurement. IdealPixelsPerFrame int // contains filtered or unexported fields }
Spec is used to define the two television specifications.
var SpecNTSC Spec
SpecNTSC is the specification for NTSC television types.
var SpecPAL Spec
SpecPAL is the specification for PAL television types.