Ossuary Development Retrospective: the Coding
Saturday, 6th February 2021
The ZX Spectrum original was written in Z80 assembly language. That's the only way to fit a decent game into the memory of the 16Kb model. I'm not fluent in 8088 assembly language, but I am confident in C, so it made sense to use C as the development language. The 8088 is quick enough to write a turn-based game without resorting to assembly language.
I started out using OpenWatcom C's own graphics library to draw the graphics. But it turned out to be way too slow, and also somewhat buggy. So I made some changes early in development to use my own CGALIB graphics library, which I'd developed before I started work on Ossuary.
For simplicity, CGALIB supports only 4x8 pixel fonts. This allows plenty of text on the screen for an RPG or strategy game. But Ossuary on the Spectrum uses an 8x8 font, and I didn't want to redesign the screen around smaller text. So I developed a custom version of CGALIB that uses 8x8 fonts.
Then I returned to the game itself, and conversion was straightforward. The C modules of the PC port correspond to the assembly language source files of the Spectrum version. The conversion was done line by line, a process made easier by the copious comments of the assembly code. While this made the process simple, it resulted in some badly organised C code.
Luckily I don't intend to build on Ossuary in the future, so code quality isn't that big an issue here. If I create future roguelike RPGs I'll be designing them and building them from scratch. In the next post I'll discuss testing and release.
Comments