Skip to content

Commit

Permalink
Update feedback clock presets, fixing various issues; use tap 5, redu…
Browse files Browse the repository at this point in the history
…ced gain for peaking
  • Loading branch information
ramapcsx2 committed Sep 4, 2019
1 parent b0467fb commit ef76250
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 143 deletions.
29 changes: 19 additions & 10 deletions gbs-control.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1993,9 +1993,10 @@ boolean runAutoBestHTotal() {
{

//Serial.println("running");
//unsigned long startTime = millis();

boolean stableNow = 1;
uint8_t initialVideoMode = getVideoMode();
unsigned long startTime = millis();

for (uint8_t i = 0; i < 64; i++) {
if (!getStatus16SpHsStable() || getVideoMode() == 0) {
Expand Down Expand Up @@ -2346,6 +2347,9 @@ void doPostPresetLoadSteps() {
rto->autoBestHtotalEnabled = true;
}

rto->phaseADC = GBS::PA_ADC_S::read(); // we can't know which is right, get from preset
rto->phaseSP = 8; // get phase into global variables early: before latching

// for worst case sog, leave it at it's current low level, to give sub coast a chance later
if (rto->thisSourceMaxLevelSOG != 31) { // same source but format changed
rto->currentLevelSOG = rto->thisSourceMaxLevelSOG;
Expand Down Expand Up @@ -2394,12 +2398,12 @@ void doPostPresetLoadSteps() {

GBS::VDS_PK_LB_CORE::write(0); // 3_44 0-3 // 1 for anti source jailbars
GBS::VDS_PK_LH_CORE::write(0); // 3_46 0-3 // 1 for anti source jailbars
GBS::VDS_PK_LB_GAIN::write(0x1c); // 3_45 // peaking HF
GBS::VDS_PK_LH_GAIN::write(0x1a); // 3_47
GBS::VDS_PK_VL_HL_SEL::write(1); // 3_43 0 if 1 then 3_45 HF almost no effect (coring 0xf9)
GBS::VDS_PK_LB_GAIN::write(0x16); // 3_45 // peaking HF
GBS::VDS_PK_LH_GAIN::write(0x18); // 3_47
GBS::VDS_PK_VL_HL_SEL::write(0); // 3_43 0 if 1 then 3_45 HF almost no effect (coring 0xf9)
GBS::VDS_PK_VL_HH_SEL::write(0); // 3_43 1

GBS::VDS_STEP_DLY_CNTRL::write(1);
//GBS::VDS_STEP_DLY_CNTRL::write(1); // leave up to preset
GBS::VDS_STEP_GAIN::write(1); // max 15
//GBS::VDS_UV_STEP_BYPS::write(0); // enable step response

Expand Down Expand Up @@ -2624,8 +2628,15 @@ void doPostPresetLoadSteps() {
if (uopt->wantTap6) { GBS::VDS_TAP6_BYPS::write(0); }
else { GBS::VDS_TAP6_BYPS::write(1); }

if (uopt->wantStepResponse) { GBS::VDS_UV_STEP_BYPS::write(0); }
else { GBS::VDS_UV_STEP_BYPS::write(1); }
if (uopt->wantStepResponse) {
// step response requested, but only apply if not feedback clock presets
if (rto->presetID != 0x04 && rto->presetID != 0x14) {
GBS::VDS_UV_STEP_BYPS::write(0);
}
}
else {
GBS::VDS_UV_STEP_BYPS::write(1);
}

resetDebugPort();
Menu::init();
Expand Down Expand Up @@ -2667,8 +2678,6 @@ void doPostPresetLoadSteps() {
GBS::PLL_S::write(2);
GBS::DEC_IDREG_EN::write(1); // 5_1f 7
GBS::DEC_WEN_MODE::write(1); // 5_1e 7 // 1 keeps ADC phase consistent. around 4 lock positions vs totally random
rto->phaseADC = 2; // fix value; we can't know which is right and 16 is usually the default
rto->phaseSP = 8;

// 4 segment
GBS::CAP_SAFE_GUARD_EN::write(0); // 4_21_5 // does more harm than good
Expand Down Expand Up @@ -3947,7 +3956,7 @@ void enableMotionAdaptDeinterlace() {
//GBS::RFF_WFF_STA_ADDR_B::write(1);
GBS::RFF_ADR_ADD_2::write(1);
GBS::RFF_REQ_SEL::write(3);
GBS::RFF_MASTER_FLAG::write(0x24);
//GBS::RFF_MASTER_FLAG::write(0x24); // use preset's value
//GBS::WFF_SAFE_GUARD::write(0); // 4_42 3
GBS::RFF_FETCH_NUM::write(0x80); // part of RFF disable fix, could leave 0x80 always otherwise
GBS::RFF_WFF_OFFSET::write(0x100); // scanline fix
Expand Down
2 changes: 1 addition & 1 deletion ntsc_1280x1024.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const uint8_t ntsc_1280x1024[] PROGMEM = {
0xCF, // s3_27
0x26, // s3_28
0x7, // s3_29
0x1, // s3_2A
0x11, // s3_2A
0x91, // s3_2B
0xE0, // s3_2C
0x2F, // s3_2D
Expand Down
2 changes: 1 addition & 1 deletion ntsc_1280x720.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const uint8_t ntsc_1280x720[] PROGMEM = {
0xCF, // s3_27
0x26, // s3_28
0x7, // s3_29
0x1, // s3_2A
0x11, // s3_2A
0x91, // s3_2B
0xE0, // s3_2C
0x2F, // s3_2D
Expand Down
2 changes: 1 addition & 1 deletion ntsc_1920x1080.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const uint8_t ntsc_1920x1080[] PROGMEM = {
0x3, // s3_40
0x3, // s3_41
0x40, // s3_42
0xD, // s3_43
0xC, // s3_43
0xF8, // s3_44
0x1C, // s3_45
0xF8, // s3_46
Expand Down
2 changes: 1 addition & 1 deletion ntsc_240p.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const uint8_t ntsc_240p[] PROGMEM = {
0xCF, // s3_27
0x26, // s3_28
0x7, // s3_29
0x1, // s3_2A
0x11, // s3_2A
0x91, // s3_2B
0xE0, // s3_2C
0x2F, // s3_2D
Expand Down
90 changes: 45 additions & 45 deletions ntsc_feedbackclock.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x17, // s0_47
0xEB, // s0_48
0xB, // s0_49
0x0, // s0_4A
0x1, // s0_4A
0x0, // s0_4B
0x0, // s0_4C
0x2A, // s0_4D
Expand Down Expand Up @@ -47,8 +47,8 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x0, // s0_9D
0x0, // s0_9E
0x0, // s0_9F
0x22, // s1_0
0xE0, // s1_1
0x2, // s1_0
0xE1, // s1_1
0x6A, // s1_2
0x0, // s1_3
0x0, // s1_4
Expand All @@ -60,32 +60,32 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x0, // s1_A
0x50, // s1_B
0x6, // s1_C
0x4A, // s1_D
0x68, // s1_E
0x0, // s1_D
0x74, // s1_E
0x3, // s1_F
0x2, // s1_10
0x0, // s1_11
0x8, // s1_12
0x14, // s1_12
0x0, // s1_13
0xD0, // s1_14
0xD4, // s1_14
0x2, // s1_15
0xB, // s1_16
0x0, // s1_17
0x1E, // s1_18
0x0, // s1_18
0x0, // s1_19
0x26, // s1_1A
0x2A, // s1_1A
0x0, // s1_1B
0x4, // s1_1C
0x2, // s1_1C
0x0, // s1_1D
0x6, // s1_1E
0x4, // s1_1E
0x0, // s1_1F
0x0, // s1_20
0x0, // s1_21
0x69, // s1_22
0x75, // s1_22
0x3, // s1_23
0x0, // s1_24
0x0, // s1_25
0x9A, // s1_26
0xA0, // s1_26
0x0, // s1_27
0x3E, // s1_28
0x0, // s1_29
Expand All @@ -99,23 +99,23 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x59, // s3_1
0xD3, // s3_2
0x20, // s3_3
0x4, // s3_4
0x10, // s3_4
0x83, // s3_5
0x3, // s3_6
0x4, // s3_7
0xC0, // s3_8
0x0, // s3_9
0x46, // s3_A
0x16, // s3_7
0x80, // s3_8
0x1, // s3_9
0x40, // s3_A
0x0, // s3_B
0x0, // s3_C
0x5, // s3_D
0x10, // s3_E
0x4, // s3_D
0x0, // s3_E
0x0, // s3_F
0x3E, // s3_10
0xE3, // s3_11
0x48, // s3_10
0x3, // s3_11
0x8, // s3_12
0x4, // s3_13
0xA, // s3_14
0x8, // s3_13
0xCA, // s3_14
0x1, // s3_15
0xFF, // s3_16
0xF3, // s3_17
Expand All @@ -137,7 +137,7 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0xCF, // s3_27
0x26, // s3_28
0x7, // s3_29
0x1, // s3_2A
0x11, // s3_2A
0x91, // s3_2B
0xE0, // s3_2C
0x2F, // s3_2D
Expand All @@ -164,9 +164,9 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x40, // s3_42
0xC, // s3_43
0xF8, // s3_44
0x16, // s3_45
0x1C, // s3_45
0xF8, // s3_46
0x10, // s3_47
0x1A, // s3_47
0xF9, // s3_48
0x10, // s3_49
0xF9, // s3_4A
Expand Down Expand Up @@ -280,7 +280,7 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0xC, // s4_36
0xE8, // s4_37
0x0, // s4_38
0xB4, // s4_39
0xB8, // s4_39
0x0, // s4_3A
0x0, // s4_3B
0x0, // s4_3C
Expand All @@ -289,7 +289,7 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x0, // s4_3F
0x0, // s4_40
0x0, // s4_41
0x69, // s4_42
0x6C, // s4_42
0x0, // s4_43
0x0, // s4_44
0xD0, // s4_45
Expand All @@ -300,8 +300,8 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x0, // s4_4A
0x14, // s4_4B
0x0, // s4_4C
0xF0, // s4_4D
0x24, // s4_4E
0x70, // s4_4D
0x38, // s4_4E
0x8, // s4_4F
0x0, // s4_50
0x0, // s4_51
Expand All @@ -312,25 +312,25 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x0, // s4_56
0x0, // s4_57
0x0, // s4_58
0x80, // s4_59
0x1, // s4_59
0x0, // s4_5A
0xCC, // s4_5B
0x0, // s4_5C
0x0, // s4_5D
0x0, // s4_5E
0x0, // s4_5F
0x18, // s5_0
0x10, // s5_0
0x0, // s5_1
0x51, // s5_2
0x31, // s5_3
0x0, // s5_4
0x2, // s5_5
0x3C, // s5_6
0x3E, // s5_7
0x3C, // s5_8
0x4F, // s5_9
0x4F, // s5_A
0x4F, // s5_B
0x3F, // s5_6
0x3F, // s5_7
0x3F, // s5_8
0x7F, // s5_9
0x7F, // s5_A
0x7F, // s5_B
0x10, // s5_C
0x0, // s5_D
0x0, // s5_E
Expand All @@ -341,7 +341,7 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x6, // s5_13
0x0, // s5_14
0x0, // s5_15
0x2F, // s5_16
0x6F, // s5_16
0x6, // s5_17
0xA1, // s5_18
0x91, // s5_19
Expand All @@ -350,7 +350,7 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x0, // s5_1C
0x0, // s5_1D
0x80, // s5_1E
0x98, // s5_1F
0x91, // s5_1F
0x0, // s5_20
0x18, // s5_21
0xF, // s5_22
Expand Down Expand Up @@ -384,9 +384,9 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x0, // s5_3E
0xC, // s5_3F
0xB, // s5_40
0xB, // s5_41
0x11, // s5_41
0x0, // s5_42
0x23, // s5_43
0x62, // s5_43
0x0, // s5_44
0x20, // s5_45
0x0, // s5_46
Expand All @@ -398,14 +398,14 @@ const uint8_t ntsc_feedbackclock[] PROGMEM = {
0x0, // s5_4C
0x17, // s5_4D
0x0, // s5_4E
0x88, // s5_4F
0x8A, // s5_4F
0x6, // s5_50
0x2, // s5_51
0x0, // s5_52
0x6, // s5_53
0x0, // s5_54
0x0, // s5_55
0x5, // s5_56
0xD, // s5_56
0xC0, // s5_57
0x5, // s5_58
0x0, // s5_59
Expand Down
2 changes: 1 addition & 1 deletion pal_1280x1024.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const uint8_t pal_1280x1024[] PROGMEM = {
0x3, // s3_40
0x3, // s3_41
0x40, // s3_42
0xD, // s3_43
0xC, // s3_43
0xF8, // s3_44
0x1C, // s3_45
0xF8, // s3_46
Expand Down
2 changes: 1 addition & 1 deletion pal_1280x720.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const uint8_t pal_1280x720[] PROGMEM = {
0xCF, // s3_27
0x26, // s3_28
0x7, // s3_29
0x1, // s3_2A
0x11, // s3_2A
0x91, // s3_2B
0xE0, // s3_2C
0x2F, // s3_2D
Expand Down
2 changes: 1 addition & 1 deletion pal_1920x1080.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const uint8_t pal_1920x1080[] PROGMEM = {
0x3, // s3_40
0x3, // s3_41
0x40, // s3_42
0xD, // s3_43
0xC, // s3_43
0xF8, // s3_44
0x1C, // s3_45
0xF8, // s3_46
Expand Down
2 changes: 1 addition & 1 deletion pal_240p.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const uint8_t pal_240p[] PROGMEM = {
0xCF, // s3_27
0x26, // s3_28
0x7, // s3_29
0x21, // s3_2A
0x11, // s3_2A
0x91, // s3_2B
0xE0, // s3_2C
0x2F, // s3_2D
Expand Down
Loading

0 comments on commit ef76250

Please sign in to comment.