demo3 补官方启动强制 FFC(帧 75),FFC 频率与官方完全对齐

- 官方 0x180009ee0 状态机:mode 0/3/5/6 在帧 75 无条件 FFC(0);
  mode 1/2/4 在帧 117 强制(最多 5 次)。demo3 此前只实现周期 1800 +
  快门漂移 250 两个条件
- trace 实测:官方启动升温阶段 FFC(0) 间隔 59~394 帧(4~26s 咔哒声密集),
  热稳定后 1800 帧(120s);demo3 已一致
- 验证:idx=75 强制 FFC 触发(demo3_ffc.txt forced75)
This commit is contained in:
ZXCLI
2026-08-14 16:23:37 +08:00
parent 03ed936a5f
commit 004f28910f
3 changed files with 19 additions and 5 deletions
+13 -2
View File
@@ -132,6 +132,7 @@ static int g_ref_cnt;
static int g_f20[NPIX];
static int g_fcount;
static int g_manual_ffc;
static int g_startup_ffc_done;
/* ---- render state ---- */
static unsigned short g_nuc[NPIX];
@@ -927,12 +928,21 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmd, int show) {
if (idx <= OFF_N0 + OFF_N2 + OFF_N1) {
continue;
}
/* normal frame: FFC condition */
/* normal frame: FFC condition (FUN_180009ee0) */
{
int drift = g_shutter - g_shutter_at_ffc;
if (drift < 0) drift = -drift;
int cool = OFF_N0 + OFF_N2 + OFF_N1;
int do_ffc = 0;
/* startup forced FFCs (official): mode 0/3/5/6 forces FFC(0)
* at frame 75 once; mode 1/2/4 forces at frame 117 up to 5
* times. We do not know the live 0x2d47 mode on Windows, so
* follow the mode-0 rule (matches the observed trace cadence:
* an extra FFC shortly after startup). */
if (!g_startup_ffc_done && idx == 75) {
g_startup_ffc_done = 1;
do_ffc = 1;
}
if (idx >= OFF_N0 + OFF_FFC_PERIOD)
do_ffc = 1;
else if (idx >= cool + 30 && drift > OFF_FFC_DRIFT)
@@ -941,7 +951,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmd, int show) {
sendcmd(0x6bb6b672, 0, 8);
g_ffc_idx = 0;
g_shutter_at_ffc = shutter;
if (ffcdbg) { fprintf(ffcdbg, "frame=%u AUTO FFC(0) idx=%d drift=%d\n", g_global_frames, idx, drift); fflush(ffcdbg); }
if (ffcdbg) { fprintf(ffcdbg, "frame=%u AUTO FFC(0) idx=%d drift=%d%s\n", g_global_frames, idx, drift,
g_startup_ffc_done && idx == 75 ? " (forced75)" : ""); fflush(ffcdbg); }
continue;
}
}