Developing that game sure was fun, though.
(For differing values of "fun")
Mini-rant ahead:
I'm delving into #cmake to try to make it build a compile_commands.json
file to work with #retrocomputing C header files, specifically the #Psion SIBO C SDK (from the early 90s).
I don't actually want cmake to do anything but tell clangd what to do, so that I've got a working language server in NeoVim.
I don't need it to build any Makefiles, I don't need it to tell a compiler what to do. I just want clangd to treat my old 16-bit real mode code correctly, and that the header files are in ~/dosbox/sibo-c/SIBOSDK/include/
.
Note that I can't point it at the compiler, because the compiler (TopSpeed) runs in DOSBox. There is no modern compiler that will work.
So... Do I have to fake it somehow? For example, do I have to tell cmake that it's actually using a different compiler (e.g. #Watcom) to make it behave correctly? And if I do, will that matter to clangd?
I liked the simplicity of #QRCode library https://github.com/ricmoo/QRCode and wanted to use it in my projects too.
But due to my "special" (old) compilers, some changes were required. With the back-port to C90, it builds for #DOS via #Watcom.
#CMake adds shared Win/Linux libraries, CTest unit tests and a small `qrgen` command line tool.
One task is still open: Check if the original #Arduino target is still working ...
However, results are now on #Codeberg
https://codeberg.org/gatelinker/QRCodeGenPort
Reading through the first manual in the SDK has reminded me what the "pure small memory model" is.
The ES register is never corrupted (DS=ES=SS).
#TopSpeed C implemented this, which was one of the main reasons why #Psion used it for the SDK.
I've heard that it's possible to implement this with #Borland C (and maybe #Watcom?), but I don't know how.
O-M-G! I love #DOSBox.
It helped me to find a stupid bug in my framebuffer code that slowed down clearing images.
Coding and compiling was done with #VSCode and #WATCOM,
and execution in DOSBox showed immediately what failed.
We don't see such bugs on Windows or Linux with our GHz CPUs anymore.
But with good old #DOS on an emulated 386 33 MHz host it made a jump from 2 to 18 FPS after fixing.
That's true optimization nobody cares about today. #gamedev before #Y2K must have been real fun.
And again: Grandpa knows why.
Compiling with #watcom for #freedos showed me some code-bloat in my hardcoded static C v-tables. The referenced v-table methods cannot be eliminated by the optimizer when those structures are not used.
But shifting the initialization of v-tables into separate functions
gives compilers the option to discard all unnecessary stuff.
This seems to be true for MSVC and GCC too.
However ... smaller executables are more important on DOS than on #windows or #linux.
When I prepared my #C sources for a #DOS port for some experiments with #watcom, #freedos and #dosbox last year, I did not know that I also prepared a port to the #webassembly APIs with #emscripten.
Making threads and other system-specific stuff optional in interfaces did help a lot.
So, lesson learned: Doing something old means doing something new
I made significant progress in porting Ranish Partition Manager from #Borland #C and #TASM to #Watcom C and #NASM.
All the C files and about half the assembler files are translated. The Watcom built executable is running and a few quick tests revealed no unexpected behaviour. Thoroughly testing has still to be done after the remaining files are translated.
Implementation defined behaviour in #C: Folgendes packt #Borland C einen char, #Watcom in einen int:
unsigned start_sect:6;
unsigned start_cylH:2;
Daher Struktur unter Borland 16 bytes und unter Watcom 18
Es muss leider ein char sein. Watcom erlaubt folgendes, um es gerade zu biegen:
unsigned char start_sect:6;
unsigned char start_cylH:2;
Nicht erlaubt laut Standard: "A bit-field shall have a type that is a qualified or unqualified version of one of int, unsigned int, or signed int."
@profoundlynerdy There is also a #Vi clone included with the #Watcom C/C++ compilers. I Like that most when working under #DOS / #Windows.