-Unnamed Mindlapse DOS demo for Pentium 133
-------------------------------------------
-The demo requires VESA Bios Extensions (VBE) 2.0. If your graphics card doesn't
-support VBE 2.0 or greater, then make sure to load the `univbe` TSR first.
+Unnamed Mindlapse DOS demo for Pentium-era PCs
+----------------------------------------------
+The demo uses VBE 320x240 16bpp. Some VBE implementations do not expose
+double-scan video modes (240 lines), but can be made to work with a third-party
+VBE TSR like `univbe` or `s3vbe`. Linear framebuffer (VBE 2.0) support is
+recommended, but not necessary. The demo will fallback to VBE 1.2 banked modes
+if LFB modes are not available.
Source structure
----------------
- src/ cross-platform demo framework and miscellaneous utility code
- src/scr/ demo screens (parts) and effects support code
- src/dos/ DOS platform code
+ - src/glut/ GLUT platform code (windows/UNIX version)
- src/sdl/ SDL 1.x platform code (windows/UNIX version)
- libs/cgmath/ math library, header-file only
- libs/imago/ image loading library (includes libpng, zlib, libjpeg)
Building on DOS with Watcom
---------------------------
-NOTE: Don't. Watcom produces significantly worse code than GCC, and at the
-moment watcom-compiled version of the demo crashes on 3D scenes for some reason
-which I need to investigate at some point. Suspect either inline assembly with
-missing "modify" part, or more likely some FPU optimization which fucks up the
-clipper.
-
Make sure you have Watcom or OpenWatcom installed, and the appropriate env-vars
set (the watcom installer automatically adds them to autoexec.bat by default).
- adc, sbb
- shr, sar, shl, sal with immediate
- ror, rol, rcr, rcl with immediate=1
+
+Notes about DJGPP & CWSDPMI
+---------------------------
+Can't use the `hlt` instruction for waiting for interrupts, because we're
+running in ring3 by default. I surrounded all the `hlt` instructions with a
+`USE_HLT` conditional, which is undefined when building with DJGPP.
+
+It's possible to arrange for our code to run on ring0 by changing the DPMI
+provider from `cwsdpmi.exe` to `cwsdpr0.exe` by running:
+`stubedit demo.exe dpmi=cwsdpr0.exe`, but I haven't tested under win9x to see if
+it still works if we do that.
+
+Our fucking segments don't start at 0 ... to access arbitrary parts of physical
+memory we need to call `__djgpp_nearptr_enable()` and use the following macros I
+defined in `cdpmi.h`:
+
+ #define virt_to_phys(v) ((v) + __djgpp_base_address)
+ #define phys_to_virt(p) ((p) - __djgpp_base_address)