Doomgeneric: Make porting Doom easier
github.com
github.com
Edit: I just realised it uses the modifications that I made for my bot to support SDL audio :) Funny thing is, I took these from some other Doom project - ah, the joys of open-source!
My porting notes for anyone interested: https://github.com/floooh/doom-sokol#porting-notes
edit: maybe I should actually link the page in case people think you're trying to create a smaller pet-sized Emu through selective breeding: https://floooh.github.io/tiny8bit
Free as in freeDooM data.
https://github.com/ozkl/doomgeneric/blob/bec8ced5887df55b818...
Why not strip that out? And it leads me to wondering what sort of gotchas are throughout, and what basic system assumptions are being made.
Ie, it's a little surprising that math routines aren't stubbed out, as well.
What format is the frame buffer in? What kind of "key events" need to be passed?
> What format is the frame buffer in?
It's a pointer to a screen-sized number of u32s. I'd hazard a guess that it's either RGBA or ABGR, and if you render one and everything looks wrong, it's the other. (Where the A channel is unused, as it's a framebuffer.)
Certainly not fool-proof and vulnerable to endian swaps if you somehow ended up on a big endian device. But this is also a port-doom-to-my-toaster level thing?
It's pretty common at that level to "just read the source", or to at least look how others use the interface.
Obviously I can dig this out of the code if I wanted to. I've reverse engineered programs with nothing but a debugger and stubbornness[0], that's not the point.
Like, what if I'm not a C programmer and I'm just using a C binding?
[0] Most recently, that was a DOS updater for an old HP Elitebook with a battery that no longer functioned. The updater requires that the AC be plugged in, which it loudly complains about, but fails to mention that it also requires the battery to be charged. Fortunately this wasn't a 90s game or it probably would have been more complicated than finding the check and turning a conditional jump into an unconditional one.
150-line example impl https://github.com/ozkl/doomgeneric/blob/master/doomgeneric/...
As other commenters said, the code is good enough to read for that task.
The only weird thing is that you don't control main... That means this isn't a DOOM library, it's a DOOM framework :/
If curious, here's the online demo: https://www.barebox.org/jsbarebox/?graphic=1
(I guess providing a Doom HAL like this allows one to remove the real time interpreter...)
"Soso"?
EDIT: This[1] I guess?
Doom is the new 'Hello World!!'