https://gitlab.synchro.net/main/sbbs/-/commit/106ff50c3afadf30bccd8f65
Added Files:
src/doors/termgfx/termgfx_termio.h
Log Message:
termgfx: add termgfx_termio.h, the shared terminal-I/O API
First step of extracting syncscumm's terminal-session engine (syncscumm/door/sst_io.c) into a shared libtermgfx module so every
graphical Synchronet door can drive one renderer/input/socket engine
instead of maintaining a copy.
This commit adds only the API header. It mirrors syncscumm's current
public surface (the sst_io_* functions, the SST_KEY_*/SST_MOD_*/SST_EV_*
types and sst_input_event_t) renamed to termgfx_termio_* /
TERMGFX_KEY_* / termgfx_ev_type_t / termgfx_input_event_t -- a pure
rename of what exists, not a redesign. Behavior is unchanged; later
tasks move the .c body and wire syncscumm onto it, verifying
byte-identical output.
Notes on the surface:
- present() keeps syncscumm's current indexed-framebuffer contract
(320x200 indices + 256 RGB triples); the exact final pixel-format
contract is pinned in the later task that moves the body.
- The input-event modifier bits reuse keymode.h's TERMGFX_MOD_* rather
than re-defining a colliding set; producer and consumer both use the
symbols, so the bit values are opaque and behavior is preserved.
- Single-instance-per-process (file-static state) model, matching the
source engine -- no opaque-context / multi-instance API.
- A survey of the other doors (syncretro, syncduke, syncconquer,
syncdoom) recorded the operations they need that this API lacks --
variable frame geometry and pixel-aspect, direct-RGB present, 6-bit
palette scaling and palette-dirty signaling, edge-scroll mouse snap
and relative-motion steering, render-tier cycling, frame pacing, and
the stats/toast/node overlays. Only syncscumm (and the future
syncrpg) adopt this API now, so those stay door-side hooks for a
future superset rather than being designed in here.
Conforming trailing-underscore include guard; compiles clean in
isolation under gcc (C) and g++ (C++) with -Wall -Wextra.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net