CathodeRetro::SourceSettings

A description of the properties of the hypothetical source "machine" that is generating the composite or S-Video signal. Specifically, it gives scanline timings and color-cycle-to-pixel ratios and phase offsets, as well as a display pixel ratio.

Index

Members

inputPixelAspectRatio
                float inputPixelAspectRatio = 1.0f
              
Type
float
Description

The display aspect ratio of an input pixel when displayed.

Use 1/1 for square input pixels, but some systems had non-square pixels (for instance, the NES which had slightly wider 8:7 pixels, for which you would use 8/7).

sidePaddingColorCycleCount
                uint32_t sidePaddingColorCycleCount = 2
              
Type
uint32_t
Description
The number of color cycles to pad on either side of the signal texture (so that filtering won't have visible artifacts on the left and right sides). Defaults to 2, but can be set to 0 if you don't need padding (like for a real signal, or a generated signal that already has expected overscan on the sides).
denominator
                uint32_t denominator = 1
              
Type
uint32_t
Description

This is the common denominator of all phase generation values (kept as a fraction to maintain numerical precision, because in practice they're all rational values). So if the denominator is 3, a (for example) colorCyclesPerInputPixel value of 1 would be 1/3rd of a color cycle, 2 would be 2/3rds, etc.

Basically, all subsequent values are fractions with this as the denominator.

colorCyclesPerInputPixel
                uint32_t colorCyclesPerInputPixel = 1
              
Type
uint32_t
Description

This value (when divided by denominator) represents the number of cycles of the color carrier wave there are per input pixel.

If the value of colorCyclesPerInputPixel is 1 and denominator is 3, that means that there is 1/3 color cycles per input pixel (or three input pixels per color cycle).

initialFramePhase
                uint32_t initialFramePhase = 0
              
Type
uint32_t
Description

When divided by denominator, this is the color cycle phase (as a fraction of the color carrier frequency) for the first scanline of the first frame.

Some systems have a constant phase offset per scanline (such as the Apple II, which outputs 1/4 off from the reference phase), and this value can be used to store that, keeping phaseIncrementPerLine, phaseIncrementPerEvenFrame, and phaseIncrementPerOddFrame at 0.

phaseIncrementPerLine
                uint32_t phaseIncrementPerLine = 0
              
Type
uint32_t
Description

When divided by denominator, this is the amount of phase change per scanline (as a fraction of the color carrier frequency).

Some systems, like the NES, have an consistent 1/3 phase offset from scanline to scanline, and this is the value that represents that.

phaseIncrementPerEvenFrame
                uint32_t phaseIncrementPerEvenFrame = 0
              
Type
uint32_t
Description
Some systems have a different initial scanline phase (the phase at the top scanline) per frame, and this represents the per-increment for even frames (when divided by denominator).
phaseIncrementPerOddFrame
                uint32_t phaseIncrementPerOddFrame = 0
              
Type
uint32_t
Description
Some systems have a different initial scanline phase (the phase at the top scanline) per frame, and this represents the per-increment for odd frames (when divided by denominator).