https://gitlab.synchro.net/main/sbbs/-/commit/2afea7b8e82ff40b303757a5
Modified Files:
src/doors/syncretro/syncretro_quant.c syncretro_quant.h test_quant.c Log Message:
syncretro: draw with a neighbour rather than recolour the screen
Taking the least recently used sixel register is the best a frame can do
while it insists on being reproduced exactly, and on a palette-cycling
console that still is not good enough. A full-screen fade needs the
colours of the frame the terminal is displaying AND the colours of the
frame replacing it -- Street Fighter II's transitions want a little over
300 between them, for 256 registers -- so some register on screen has to
be redefined, and every pixel drawn with it turns the wrong colour until
the repaint reaches it.
That repaint is not quick. A transition frame is ~75KB of sixel at 80x25,
and the bottom third of the picture sits ~40KB into it, so the lower part
of the screen is the last to be made right and flashes visibly. (Emitting
only the changed registers would not help: the palette is 3.6KB of those
75KB.)
So stop insisting. A colour that cannot have a register without
recolouring the screen is drawn with the nearest register already
defined. The frame is then not pixel-exact, which is the trade: on the
same transitions ~1% of a frame's pixels land a mean of 12 off a 441
maximum, against a picture that was going wrong wholesale.
Bound it. Borrowing has to mark the register as drawn-with, or the next
frame redefines it under those very pixels -- and that also takes the
register out of circulation, so a fade left to borrow without limit walks
its colours further from the registers they are stuck on with every step, ending in a worse artefact than the recolour it was avoiding. Past SR_BORROW_MAX_D2 a colour takes a register and accepts the recolour
instead. Measured across the threshold, RGB distance 32 is the knee: 5
frames recolouring rather than 16 at distance 16, a worst frame of 3
registers rather than 11, and the error flat across a fade instead of
climbing.
Over the whole attract loop that is 5 frames touching a displayed
register rather than 24, and a worst frame of 3 rather than 37. Games
that never fill the register map are unaffected, and none of their pixels
are approximated.
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)