= 32 bits after 32 years =

We're incredibly proud to announce that Second Reality has now been finally ported to a modern operating system, and you can watch it tear up your system: no video, no emulation, just code - as it should be.

https://conspiracy.hu/files/w32nd_real.zip
https://github.com/ConspiracyHu/SecondRealityW32

@conspiracyhu The moment I grabbed the code I started trying to port it to Linux with a surprisingly recent version of GCC and... oh boy, this demo does love to do out-of-bounds memory reads. Amazing what today's compilers pick up.

With that said, congratulations! Only complaints for the binary release are that the text mode config menu is a bit awkward in Wine, and that the demo uses 100% of a CPU core. But either way, it works fine. Also, the program icon is a nice touch.

Ironically,
some effects might be faster once ported to C, considering all the SIMD stuff we have these days. But even without that, modern CPU pipelines tend to be somewhat different from the 386 and 486... where "modern" is basically anything from the Pentium Pro onwards.
@GreaseMonkey The 100% core is because it has to emulate 70hz vsync, so any Sleep() or so would throw off the timing :( And yeah, the POSIX-compatible version will be interesting ;)
@conspiracyhu Good point.
What's the granularity and accuracy of SetTimer+WM_TIMER these days? Then again, that might require reworking the general flow of things... and might make timing even wonkier.

As for POSIX... I wonder if clock_gettime+nanosleep would be accurate enough. There's also setitimer+SIGALRM but I've never really messed with that in anger.
@GreaseMonkey The problem with the original is that the timing is done with both frame counting on the "main thread" and in interrupts, as well as music timers, so it's super fragile. :(
@conspiracyhu Wow! That's awesome. This demo was the reason to get a Gravis Ultrasound back then 😍. Will check it out later. I used to watch the demo at least once a year since 1993.
@conspiracyhu huh, didn't realise you lot were here as well.
@conspiracyhu Requires a 33 MHz 486? Woah man, we’re not all made of money you know :P
@conspiracyhu BTW was this designed for VLB? Surely the bus and wait-states must have been the worst bottleneck on the PC platform? You had a more powerful CPU than the PSX, but no hardware acceleration!
@Kroc Hard to tell if it was _designed_ for it, really - it's mostly clever use of modes, VGA features (scrolls, stride adjustment), and a lot of linear writes.
@conspiracyhu Nice job!! It is more fluid on my Ryzen than on my 486 😉
They are not synchronised because I imagine that there is some decrunching at the very beginning.
By the way it is funny how the modern EXE is much smaller.
@conspiracyhu I loved watching this demo on a Pokemon Mini, and now it's on the big screen.