• src/doors/syncscumm/test/test_sst_io_present_pending.csrc/doors/syncsc

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Saturday, July 18, 2026 03:02:49
    https://gitlab.synchro.net/main/sbbs/-/commit/cc6f2373ec6861bc5d8289c8
    Added Files:
    src/doors/syncscumm/test/test_sst_io_present_pending.c
    Modified Files:
    src/doors/syncscumm/door/sst_io.c sst_io.h syncscumm.cpp src/doors/syncscumm/test/unit_sst_io.sh
    Log Message:
    syncscumm: retry a present() frame a static screen stranded

    sst_io_present() can defer a frame at the DSR-ack pacing gate or the backpressure gate without sending it and without updating g_last.
    present() is edge-driven off ScummVM's own dirty flag, so on a static
    screen (the F5 Sky control panel once fully drawn, or the frame right
    after a speech-toggle X finishes erasing) nothing calls present()
    again to retry it -- the frame just sits there until an unrelated
    redraw (a mouse move) happens to trigger one, which is why both
    defects only clear once the mouse moves.

    Retain the deferred frame's idx/pal in new g_pending_idx/g_pending_pal
    buffers at the two defer gates (not the startup grace/canvas-hold
    gates, which already self-retry every boot-loop frame), and add
    sst_io_tick(): a no-op unless a frame is pending, otherwise it retries
    via the exact same sst_io_present() call and therefore the exact same pacing/backpressure gates, so it can never overrun the link. Wire it
    into pollEvent() so it runs every poll, static screen or not.

    Adds test/test_sst_io_present_pending.c (new SST_TEST seams sst_io_test_set_inflight()/sst_io_test_present_pending()) to test/unit_sst_io.sh, reproducing the strand and proving the retry
    delivers the frame with no further engine-side present() call.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net