Classic PC demoscene productions running natively in the browser
treylorswift.github.io
[24 comments hidden]
> That recording is translated into C - the original instructions, one for one, with the exact cycle timing of the emulated machine.
What's the advantage of this approach vs cycle-accurate emulation? (I'd guess it can go faster, due to compiler optimization?)
> The result is checked against the emulator event for event: every interrupt, port access and frame at the same moment of emulated time.
It's funny how LLMs leak their test procedure docs into user-facing output.
[8 comments hidden]
[6 comments hidden]
It works, and has done for some time, surely. What more is there to add here above accurate playback?
> From 386SX-16 to Pentium 66 MHz, that's 10-20x difference in performance.
Yep, and some demos had specific requirements for not only minimal CPU but maximal because the assumptions inherent in small-code timing tricks would break beyond a certain speed or because of significant differences in relative instruction execution times (and sometimes the unpredictability of those execution times as the P5 architecture and some of its frankenstein-486-like competitors added branch prediction). Larger demos were more flexible as you didn't need the small-code tricks to squeeze into 4Kb or sometimes less, so 64K demos and larger could be more flexible wrt target CPU.
But cycle-accurate emulation has this sorted to: you just need the instruction cycle time accuracy to be matching a particular CPU running to the pace of a particular clock. And given the description of how this is being done (“The demo is run on an x86 emulator that records…”) I assume this is actually using cycle-accurate emulation!
I'm guessing the benefit here is that the overhead of playing back the demo on each client machine is lower when playing this recorded version, compared to each viewer's browser running the initial emulation live in the browser. That and doing something a new way was fun or otherwise intellectually stimulating for the dev(s) involved.
[5 comments hidden]
Even with a cycle accurate CPU you'd still have a lot of variation caused by the motherboard chipsets, DRAM speeds, cache chips and graphics cards.
Tseng ET4000 was on a completely different level than something like Cirrus Logic CL-GD510 or heaven forbid, Oak Technologies card.
If the era appropriate PCs had huge variations, what extra does cycle accuracy really bring at this point? The same PC demo could perform very differently on two 486DX2 66 MHz PCs.
[3 comments hidden]
Wrt GFX: Most demos, certainly when thinking about the 4K challenges, would be using nothing more than some variant of a basic VGA display mode (usually but not always Mode 13h or some variant like “Mode X”) without detecting and taking advantage of acceleration features - the difference between graphics cards at this point was not nearly as significant as what the demos were doing in the CPU, even the nastiest ISA card of the era is going to keep up at a reasonable framerate, IIRC from my doom playing days.
[2 comments hidden]
At this point you can be talking about 600 kB on a DOS machine. Sky is the limit on modern systems.
That said, typical inner loops of that era demos were pretty small, usually 20-200 byte range, IIRC.
Pre-cache era demos often had huge unrolled self-modifying speedcode inner loops, but that's another matter.
[hidden]
Speaking as a 4k demo coder in the 2000s era, I think you're over generalizing. Decompression sure, but after that all bets are off.
[hidden]
Absolutely
"How much of the sword emerged from the water" in Second Reality was a good measurement of CPU speed and video card performance, for example.
I remember seeing stuff in demos on my friend's Pentium Pro machine that I never saw on my 486SX-25 because routines ran faster and you could see more of the effect (since some demos were sync'd to the music and would move on irrespective of the progress of the effects). Heck-- just replacing my video card made a huge difference with some demos.
[9 comments hidden]
You have to constantly fight so hard to not get this. And for the past few months it seems most people do not even care to remove it and have proper user facing docs
[2 comments hidden]
[6 comments hidden]
By “fight so hard” you mean “do a bit of basic editing before publishing the text”?
You wouldn't have thrown a junior's text straight at end users without any review in the past (at least I hope not, though obviously some teams actually were and still are that lax), why do you expect to get away with skipping the review/edit step with your clockwork colleague?
[2 comments hidden]
[hidden]
Also: I've always avoided being anything like a lead or manager, but I do effectively have a couple of relative juniors ATM who I wish would have a better long-term learn/forget ratio when it comes to feedback from myself and elsewhere!
[2 comments hidden]
[hidden]
And while in 2025 I considered AI coding agent in the realm of junior devs, we have been way way past that since early 2026 honestly.
[4 comments hidden]
I don't think anyone is doing it this way because they chose to do it this way. All the AI decomp/recomp projects I've seen recently have done it this way. It just seems an easy way to have an AI brute force "port" something.
[3 comments hidden]
[2 comments hidden]
[hidden]
On the other hand, at least these folks build and create and I prefer wrapper demos instead of a perfect emulator that will never finish.
Nevertheless, on the feature side of these wrappers I really miss a fast-forward option. If you go pseudo-emulation, then at least come up with some convenience features.
Maybe this is the irony: the ff button is perfectly legit, I used mine many times with the 486DX3-100 and Pentium 133. Back then it was called turbo button.
[2 comments hidden]
In some ways this is similar to the concurrent-systems problems that memory barriers are a tool to address. Your emulator will come in two halves, a CPU side and a gfx/sfx side, as well as control inputs, and the "intermediate" approach is when you're just trying to preserve the sequence of load/stores between the two with an accuracy relative to frame timing. Maintaining ultra precise timing within a frame imposes more detailed coordination requirements on both sides of the emulation.
[hidden]
I guess the point is that a pre-compiled version could have HW checkpoints from a slow emulated run, so that it can then run at full speed and just advance the HW to the required timestate when a write is to occur (ie, instead of costly cycle-accurate emulationg, most HW operations can be batched inbetween time-sensitive checkpoints).
Then again, why not just record a video at that point? :P
[6 comments hidden]
Then I betrayed you all: I bought my first ugly machine because of Doom. I was so ashamed...
Now, only 4KB demos can at least impress me a bit.
Feeling old.
[2 comments hidden]
But watching Crystal Dreams II on my phone actually made me feel young again :)
[hidden]
The standard VGA resolution fit a full screen in a single 64KB segment nicely, you had many colors but not limitless, so I would argue that this was really the golden era of the demoscene. Partly because almost anyone could do some kind of a short demo that was still enjoyable to watch, and did not require the insane amount of cycle-counting and optimization and planning that the C64 does.
[2 comments hidden]
[hidden]
But the focus shifted in recent years to treating "OCS" (ie "standard" Amiga500 with original chipset and 1mb,etc) more like a fixed platform like the C64 instead and imho has seen a bit of a revival since is mostly in the interesting part of pushing the OCS HW.
[24 comments hidden]
The demoscene was all about human ingenuity getting the most out of the machine. It was about showing off how good your crew was at making things from nothing but their minds.
Now, it too, has been swallowed by the AI that is destroying this entire mode of being, the joy and creativity of writing code, of solving seemingly-impossible puzzles with ones mind.
My favorite creative and intellectual outlet is dying off and its killer is wearing its corpse as a costume.
[5 comments hidden]
[4 comments hidden]
[hidden]
We'll get unlimited frozen pizzas, but we'll kill off chefs in the process.
It's not a trade I'm feeling good about.
[6 comments hidden]
It's really cool to be able to rewatch these demo, but the spirit in which they were created is somewhat lost.
[hidden]
lol, that would be 160MB then, a fraction of what a Firefox Tab consumes and in todays hardware specs its a roundoff error :-D
(while back then you were the ultimate king if you had 8 MB of RAM available at all! :-)
[hidden]
But it did require a 386, which typically had 2 MB or more of RAM back then.
[hidden]
[4 comments hidden]
[hidden]
AI slop productions tend to be frowned upon, or even banned, writing code and using cool tricks to to what seems impossible is still a big part of the demoscene, in particular in the sizecoding, oldschool and wild categories. Clever use of AI is a debated topic, the demoscene is about pushing the limits of current technology, and AI is part of current technology. There is also the question of using AI for tooling (modelers, compressors, test harnesses, etc...), as in, will you stop using a particular IDE because it is written with the help of AI, even if it is good?
But still, most productions are hand made.
[2 comments hidden]
I write demos and games as a hobby predominantly for MS-DOS and machines ranging from the 386 up to the Pentium (soon to add 8088/286 to that list) as well as old consoles like the Sega Master System and other random platforms (like ARM-based kids toys like the Leapster Explorer).
Right now I'm working on an EGA production. I could just get an AI to generate a lot of the code for me or give me all the answers, but instead, I have my Programmer's Guide to the EGA/VGA/SVGA by Ferraro and another reference open on my desk trying to understand the CRTC so I can create a custom video mode. I live for this stuff and want to fully understand what's going on in the hardware. I like the creative aspects of making demos and games but I also like the technical aspects, and understanding the platform and the deep details.
When I spend too much time reading HN or X and see too much of the AI stuff, it really bums me out, so I have to detox by unfollowing/ignoring and getting back to my projects.
[hidden]
I think the biggest effect of AI here is that you can no longer make the inference from "that program looks impressive" to "the person who created it must be very skilful and/or invested a lot of effort in making it". So someone else seeing your work might not appreciate the level of effort and skill you put into it, or might even suspect you of lying if you say explicitly that you made it "by hand". I'm not going to say that we shouldn't care what others think; that's not realistic, most of us do want some recognition for things we've worked hard on. I think there will always be people interested in doing things the hard way, and among those people the "old" paths to recognition and respect still operate, it just gets harder because there has to be a lot of trust between them that no one's taken the easy way out (AI) and pretended otherwise.
[hidden]
/s if that wasn't obv.
[hidden]
[hidden]
I got my first PC (a 486 DX2-66) in 1994 and got a Creative Soundblaster graphics card + speakers later that year. Second reality was the first demo I had on that PC. I remember being blown away by the graphics and audio... I showed it off to everyone. Of course it looks quite quaint now, but at the time I had just upgraded from a Commodore 64!
[hidden]
[16 comments hidden]
[10 comments hidden]
[8 comments hidden]
[7 comments hidden]
[2 comments hidden]
[hidden]
A workaround for modern hardware is frame doubling then blanking every other frame (software black frame insertion). It halves the brightness, but modern monitors generally support higher brightness than CRTs so this just brings it back to the authentic level. It's possible with FFMPEG filters, although I don't remember how I accomplished it when I tried it years ago.
The importance of CRT flicker is one reason I greatly prefer DOS demos to C64 and Amiga demos. Those were mostly designed for 50Hz PAL CRTs, so the flicker is far more annoying than 70Hz VGA.
[4 comments hidden]
The effects in some of the demos simply kill any video encoder, only way to properly experience them is by running or emulating locally. Not that crystal sharp upscaled square pixels on modern display or poor quality CRT filters are very representative either, but it's likely better than blurry mess you get when video encoder tries to deal with high frequency details or random noise from procedural effects.
[3 comments hidden]
[2 comments hidden]
[hidden]
[11 comments hidden]
[5 comments hidden]
[hidden]
[5 comments hidden]
If the games had been for DOS, it would probably have made more sense to just run the original binaries in DOSBox-X or some other emulator. I think there is already some debug API that can be enabled. Or adding MCP or something similar to DOSBox(-X) would probably be a lot less work than to reimplement the games.
[4 comments hidden]
The entire point of the port was to add headless play for AI training. But porting the old interface and playing it in the browser was lots of fun. Can not upload that to GitHub, obviously.
[hidden]
Be free, run outside the browser
[hidden]
State of the Art was ported to the browser as well.
[hidden]
[hidden]
[2 comments hidden]
[hidden]
[hidden]
[hidden]
[hidden]
And I didn't do any coding to achieve that. Cool right?
Eh.. no. A completely boring negation of what demos are about.
[hidden]
[7 comments hidden]
Those demos from the '90s remind me of the incredible creativity and ingenuity of the human mind. Thanks for bringing them back to life and making them so effortlessly accessible.
[hidden]
[hidden]
You don't need any AI for that. Just visit https://pouet.net
The demo scene is still very much happening.
velo_aprx[13 comments hidden]
Please keep AI away from the demoscene.
Ive been active in the demoscene for almost 30 years, its a big part of my life, and i am truly worried people using AI to build tools and code demos will destroy it by removing the very reason why its interesting. I want to be impressed by real peoples knowledge, skill and creativity. Not your ability to prompt.
Mostly, i hate the AI remaster option. It was never intended to look or sound like that.
freecodeio[4 comments hidden]
doubled112[3 comments hidden]
ashleyn[hidden]
shermantanktop[hidden]
myth_drannon[3 comments hidden]
cowlevel[hidden]
velo_aprx[hidden]
dr_win[4 comments hidden]
velo_aprx[hidden]
CursedSilicon[hidden]
vor_[hidden]
jasomill[hidden]
It's equally essential, of course, to never misrepresent one as the other.
And "remasters", again just like video games, are very much a matter of taste (on the part of both creators and consumers).