Quasar
Moderator

Posts: 4615
Registered: 08-00 |
myk said:
I'm wondering whether the "screen splitting" feature of Mode X described in the Wikipedia article was exploited for the status bar and HUD text in DOOM. Doesn't it explain how the engine can reduce the detail mode in the game action stuff but leave the interface at the usual detail?
No. The reduction made by low detail mode is just a right shift on the x coordinates for everything being rendered through R_RenderPlayerView, resulting in half the number of columns as usual. Then special versions of R_DrawColumn* are called which draw the same column twice to fill up the entire screen.
The graphics mode which vanilla DOOM uses isn't normal ModeX. It's a tweaked Mode 13h 320x200 in which planar addressing is turned on to enable page flipping (a virtual screen 320x400, with the second page at 0xA4000). This can be seen in the original EXE by viewing the code in a disassembler (this is from Strife, but it is the same as in vanilla):
code:
cseg01:0001044E mov edx, 13h
cseg01:00010453 mov eax, 10h
cseg01:00010458 mov ecx, 0A0000h
cseg01:0001045D mov word ptr regs, dx
cseg01:00010464 mov edx, offset regs
cseg01:00010469 mov grmode, ebx
cseg01:0001046F mov ebx, edx
cseg01:00010471 mov edi, 0A4000h
cseg01:00010476 call int386_
The int386 call is given argument 13h to interrupt 10h (set video mode). A long series of inline assembly instructions follow which manipulate the EGA/VGA registers to set planar mode and do some other voodoo such as clear the screen.
Oddly all of this was removed in Heretic and Hexen, which just use plain Mode 13h, and thus this would be deceptive to anybody looking to their code to find out how vanilla DOOM worked.
Lee Killough restored support for this particular video mode in MBF. BOOM also only used 13h directly.
|