COOL!
Fast checking. You could probably erase this since powertiming regs already happens a bit below:
Test to erase this:
if (is_6D)
{
switch (crop_preset)
{
case CROP_PRESET_HD100_6D:
case CROP_PRESET_HD75_6D:
case CROP_PRESET_HD50_6D:
case CROP_PRESET_2K_6D:
case CROP_PRESET_ULTRA_HD_6D:
case CROP_PRESET_4K_6D:
case CROP_PRESET_5K_6D:
case CROP_PRESET_FullRes_6D:
case CROP_PRESET_HD2_6D:
case CROP_PRESET_1x3_6D:
case CROP_PRESET_1x3_24FPS_6D:
case CROP_PRESET_3x3_1X_6D:
/* all modes may want to override shutter speed */
/* ADTG[0x8061]: shutter blanking for 3x3 mode */
/* ADTG[0x805F]: shutter blanking for zoom mode */
adtg_new[0] = (struct adtg_new) {6, 0x8061, shutter_blanking};
adtg_new[1] = (struct adtg_new) {6, 0x805F, shutter_blanking};
/* adjust analog gain NOT WORKING PINK HIGHLIGHTS WHITE LEVEL NOT PROPER*/
/*adtg_new[13] = (struct adtg_new) {6, 0x8882, 108};*/
/*adtg_new[14] = (struct adtg_new) {6, 0x8884, 108};*/
/*adtg_new[15] = (struct adtg_new) {6, 0x8886, 108};*/
/*adtg_new[16] = (struct adtg_new) {6, 0x8888, 108};*/
/*adtg_new[17] = (struct adtg_new) {6, 0x8030, 400};*/
/* adjust vertical resolution */
/* assuming FPS timer B was overridden before this */
int fps_timer_b = (shamem_read(0xC0F06014) & 0xFFFF) + 1;
int readout_end = shamem_read(0xC0F06804) >> 16; /* fixme: D5 only */
/* PowerSaveTiming registers */
/* after readout is finished, we can turn off the sensor until the next frame */
/* we could also set these to 0; it will work, but the sensor will run a bit hotter */
/* to be tested to find out exactly how much */
adtg_new[2] = (struct adtg_new) {6, 0x8172, nrzi_encode(readout_end + 5) }; /* PowerSaveTiming ON (6D/700D) */
adtg_new[3] = (struct adtg_new) {6, 0x8178, nrzi_encode(readout_end + 5) }; /* PowerSaveTiming ON (5D3/6D/700D) */
adtg_new[4] = (struct adtg_new) {6, 0x8196, nrzi_encode(readout_end + 5) }; /* PowerSaveTiming ON (5D3) */
adtg_new[5] = (struct adtg_new) {6, 0x8173, nrzi_encode(fps_timer_b - 5) }; /* PowerSaveTiming OFF (6D/700D) */
adtg_new[6] = (struct adtg_new) {6, 0x8179, nrzi_encode(fps_timer_b - 5) }; /* PowerSaveTiming OFF (5D3/6D/700D) */
adtg_new[7] = (struct adtg_new) {6, 0x8197, nrzi_encode(fps_timer_b - 5) }; /* PowerSaveTiming OFF (5D3) */
adtg_new[8] = (struct adtg_new) {6, 0x82B6, nrzi_encode(readout_end - 5) }; /* PowerSaveTiming ON? (700D); 2 units below the "ON" timing from above */
/* ReadOutTiming registers */
/* these shouldn't be 0, as they affect the image */
adtg_new[9] = (struct adtg_new) {6, 0x82F8, nrzi_encode(readout_end + 5) }; /* ReadOutTiming */
adtg_new[10] = (struct adtg_new) {6, 0x82F9, nrzi_encode(fps_timer_b - 5) }; /* ReadOutTiming end? */
break;
}
Regarding not working presets. For 1x3 presets you use the adtg slots:
adtg_new[11] = (struct adtg_new) {6, 0x8000, 6};
adtg_new[12] = (struct adtg_new) {6, 0x800C, 0};
Now check in powertime regs:
adtg_new[11] = (struct adtg_new) {6, 0x82F8, nrzi_encode(readout_end + 1 + reg_timing4) }; /* ReadOutTiming */
adtg_new[12] = (struct adtg_new) {6, 0x82F9, nrzi_encode(fps_timer_b - 1 + reg_timing4) }; /* ReadOutTiming end? */
adtg_new[11] and adtg_new[12] are overwritten.
Expand this from:
/* expand this as required */
struct adtg_new adtg_new[22] = {{0}};
to maybe:
/* expand this as required */
struct adtg_new adtg_new[32] = {{0}};
To get free adtg slots. Wouldn´t hurt if you check your other presets for doubles.