-
Notifications
You must be signed in to change notification settings - Fork 112
/
options.h
106 lines (103 loc) · 2.99 KB
/
options.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#ifndef _USER_H_
using Ascii8 = uint8_t;
/// Output resolution requested by user, *given to* applyPresets().
enum PresetPreference : uint8_t {
Output960P = 0,
Output480P = 1,
OutputCustomized = 2,
Output720P = 3,
Output1024P = 4,
Output1080P = 5,
OutputDownscale = 6,
OutputBypass = 10,
};
// userOptions holds user preferences / customizations
struct userOptions
{
// 0 - normal, 1 - x480/x576, 2 - customized, 3 - 1280x720, 4 - 1280x1024, 5 - 1920x1080,
// 6 - downscale, 10 - bypass
PresetPreference presetPreference;
Ascii8 presetSlot;
uint8_t enableFrameTimeLock;
uint8_t frameTimeLockMethod;
uint8_t enableAutoGain;
uint8_t wantScanlines;
uint8_t wantOutputComponent;
uint8_t deintMode;
uint8_t wantVdsLineFilter;
uint8_t wantPeaking;
uint8_t wantTap6;
uint8_t preferScalingRgbhv;
uint8_t PalForce60;
uint8_t disableExternalClockGenerator;
uint8_t matchPresetSource;
uint8_t wantStepResponse;
uint8_t wantFullHeight;
uint8_t enableCalibrationADC;
uint8_t scanlineStrength;
};
// runTimeOptions holds system variables
struct runTimeOptions
{
uint32_t freqExtClockGen;
uint16_t noSyncCounter; // is always at least 1 when checking value in syncwatcher
uint8_t presetVlineShift;
uint8_t videoStandardInput; // 0 - unknown, 1 - NTSC like, 2 - PAL like, 3 480p NTSC, 4 576p PAL
uint8_t phaseSP;
uint8_t phaseADC;
uint8_t currentLevelSOG;
uint8_t thisSourceMaxLevelSOG;
uint8_t syncLockFailIgnore;
uint8_t applyPresetDoneStage;
uint8_t continousStableCounter;
uint8_t failRetryAttempts;
uint8_t presetID; // PresetID
bool isCustomPreset;
uint8_t HPLLState;
uint8_t medResLineCount;
uint8_t osr;
uint8_t notRecognizedCounter;
bool isInLowPowerMode;
bool clampPositionIsSet;
bool coastPositionIsSet;
bool phaseIsSet;
bool inputIsYpBpR;
bool syncWatcherEnabled;
bool outModeHdBypass;
bool printInfos;
bool sourceDisconnected;
bool webServerEnabled;
bool webServerStarted;
bool allowUpdatesOTA;
bool enableDebugPings;
bool autoBestHtotalEnabled;
bool videoIsFrozen;
bool forceRetime;
bool motionAdaptiveDeinterlaceActive;
bool deinterlaceAutoEnabled;
bool scanlinesEnabled;
bool boardHasPower;
bool presetIsPalForce60;
bool syncTypeCsync;
bool isValidForScalingRGBHV;
bool useHdmiSyncFix;
bool extClockGenDetected;
};
// remember adc options across presets
struct adcOptions
{
// If `uopt->enableAutoGain == 1` and we're not before/during
// doPostPresetLoadSteps(), `adco->r_gain` must match `GBS::ADC_RGCTRL`.
//
// When we either set `uopt->enableAutoGain = 1` or call
// `GBS::ADC_RGCTRL::write()`, we must either call
// `GBS::ADC_RGCTRL::write(adco->r_gain)`, or set `adco->r_gain =
// GBS::ADC_RGCTRL::read()`.
uint8_t r_gain;
uint8_t g_gain;
uint8_t b_gain;
uint8_t r_off;
uint8_t g_off;
uint8_t b_off;
};
#endif