Edit: this is the latency project I was thinking about https://danluu.com/input-lag/
If you put a bit of load on the modern hardware things get dramatically worse. As if there is some excuse for it.
I had this thought long ago that the picture on the monitor could be stitched together from many different sources. You would have a box some place on the screen with an application or widget rendered in it by physically isolated hardware. An input area needs a font and a color scheme. The text should still be send to the central processor and/or to the active process but it can be send to the display stitcher simultaneously.
You could even type a text and have it encrypted without the rest of the computer learning what the words say.
I look at and click around KolibriOS one time, everything is so responsive it made me slightly angry.
Even the small Apple II screen takes 7.5 kilobytes of RAM. Reading https://imapenguin.com/2022/06/how-fast-can-a-6502-transfer-..., just writing all of that to the screen takes a tenth of a second, for just over 50,000 pixels, and that’s ignoring the idiosyncratic video memory layout of the Apple II.
Going below ten seconds for decompressing that would mean you must produce 5 output pixels every millisecond, which means you have about 200 CPU cycles per pixel. On a 6502, that’s less than 100 instructions.
That makes me doubt it can get under 10 seconds.
⇒ if you want to get down to seconds, I think you’ll have to drop even more image data than this does, and do that fast.
(Decoding and dithering are done in two passes for memory reasons and space on floppy disk reasons but it brings auto-levelling)
It's about 450 cycles per pixel for decoding QT100 (1200 for QT150), and 230 cycles per pixel for dithering.
> I’ll be using the revised version as I think it’s a well-established example of doing a real-world block transfer. Sure there may be faster ways, but this is a realistic way, which is what we’re going for.
NEXT LDX #NUMBER
LDA BASE,X
STA DEST,X
DEX
BNE NEXT
Something unrolled like: $1000 LDA $2000
$1003 STA $3000
$1006 LDA $2001
$1009 STA $3001
etc...
Isn't even the fastest solution but 3 out of 5 instructions are gone and I think the two remaining are faster. The transfer in the book is of course really practical while this one is already almost unworkable. You can do worse tho: $1000 LDA #$12
$1002 STA $30
$1004 LDA #$34
$1006 STA $31
etc...
For the truly insane solution you would have to consider if you even have to read the data. Maybe you can present the image as-is and modify it... or worse... turn it into code...