• src/doors/syncretro/main.c retro_core.c retro_core.h syncretro.h syncr

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Sun Aug 2 22:35:14 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/c44f43ada7c988ae93dda752
    Modified Files:
    src/doors/syncretro/main.c retro_core.c retro_core.h syncretro.h syncretro_door.c syncretro_state.c syncretro_state.h
    Log Message:
    syncretro: write and restore save states on session end/start

    Wires suspend/resume into the door: -state <key> permits snapshots and
    names the file, sr_state_save()/sr_state_load() (syncretro_state.c) are
    called at main.c's done: label and right after rc_core_load_game()
    succeeds, and sr_state_path() names the snapshot
    <home>/<rom-stem>.<key8>.state so the lobby can tell a live snapshot
    from a stale one by filename alone (Task 1, 2026-08-02).

    rc_core_t had no serialize_size/serialize/unserialize members and
    retro_core.c resolved no such symbols, so add all three and resolve
    them through a new RC_RESOLVE_OPT() -- unlike RC_RESOLVE(), a missing
    symbol is not fatal. Save states are not required by the libretro API,
    and refusing to load a core over a missing one would trade a working
    game for a feature it never offered.

    The done: label's snapshot is additionally gated on core.game_loaded:
    done: is also reached when rc_core_load_game() itself fails, and at
    that point retro_init() ran but retro_load_game() did not, which is
    not a state retro_serialize() is documented to support.

    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)