Today’s Advent of Code puzzle was rather easy (luckily), so I spent the day doing two other things:
- Explore VGA a bit: How to draw pixels on DOS all by yourself without a library in graphics mode 12h?
- Explose XMS a bit: How can I use more than 640 kB / 1 MB on DOS?
Both are … quite awkward. 😬 For VGA, I’ll stick to using the Borland Graphics Interface for now. Mode 13h is great, all pixels are directly addressable – but it’s only 320x200. Mode 12h (640 x 480 with 16 colors) is pretty horrible to use with all the planes and what not.
As per this spec, I’ve written a small XMS example that uses 32 MB of memory:
https://movq.de/v/9ed329b401/xms.c
It works, but it appears the only way to make use of this memory is to copy data back and forth between conventional memory and extended memory. I don’t know how useful that is going to be. 🤔 But at least I know how it works now.