The MS-DOS Player for Windows can now run DJGPP / Go-32 programs!
You can find more details on the main web site:Â homepage3.nifty.com. Â Very cool stuff indeed!
The MS-DOS Player for Windows can now run DJGPP / Go-32 programs!
You can find more details on the main web site:Â homepage3.nifty.com. Â Very cool stuff indeed!
If you ever get this fun error while trying to exit or shell a program with DJGPP:
combinelo: memory fouled
free: memory fouled
You are mixing libraries built with a different version of the DJGPP runtime. Â In my case, I built the allegro library with GCC 220.127.116.11 to use the older binutils but I’m cross compiling with GCC 5, so it’s using the newer runtime.
In my case I just needed to replace the contents of the lib directory withÂ djcrx202.zip, and I was good to go. Â I guess I could re-compile allegro, but that takes the better part of forever on DOSBox, and once was good enough.
This is announcement of an update of DJGPP port of GCC-6.1.0
GCC used to stand for the GNU C Compiler, but since the
compiler supports several other languages aside from C,
it now stands for the GNU Compiler Collection.
for original announcement of gcc-6.1.0 release
Warning: DJGPP port of binutils-2.22 or newer is recommended.
Version 2.19 and 2.20 may work but are not tested
It is however recommended to use binutils-2.22
Use of DJGPP port of binutils-2.22 or newer is however required for
gcc610b.zip GNU GCC 6.1.0 for DJGPP V2
gcc610d.zip Documentation for GNU C compiler
gpp610b.zip GNU C++ Compiler 6.1.0 for DJGPP V2
gfor610b.zip GNU Fortan 95 compiler 6.1.0 for DJGPP V2
gcc610s.zip GNU GCC 6.1.0 sources for DJGPP
objc610b.zip GNU Objective C and Objective C++ compiler and
runtime libraries v6.1.0
gfor610d.zip Documentation for GNU Fortran compiler
ada610b.zip GNU Ada compiler
ada610d.zip Documentation for GNU Ada compiler
Binaries are built and tested mostly under Windows Vista Business (SP2)
Binary RPMs for both i686 and x86_64 are available. I built these binary RPMs
in CentOS 6.7 chroot under Fedora 23. Binaries are statically linked with GMP-6.1.0
MPFR-3.1.4 and MPC-1.0.3 to avoid unnecessary dependencies and increase
compatibility with other Linux distributions. For example they are expected
to work without problems in other reasonably recent Linux distributions
(like Fedora, RHEL-6 and newer, etc)
gcc610s2.zip is no more provided as patching GCC using DJGPP tools
has not been tested and even attempted by me for a long time.
DJGPP source file gcc610s.zip is a side product of building
gcc-6.1.0 Linux to DJGPP cross-compiler RPM packages. See source
RPM for patches applied to original FSF version of GCC-6.1.0.
You can find the same contents in the file
Cross-compiler binary RPMs (built under CentOS 5.11 i386, are expected to work on otherÂ recent enough RPM based Linux distributions, I myself have tried Fedora 19 x86_64):
GNU Objective C and Objective C++ compilers:
Tools for GCC 6.1.0 (currently only fixincl, most users do not need this):
Info files of GCC-6.1.0 (a separate RPM file as these files are expected to
conflict with system compiler info files, but You do not need to install them…):
Substitute i686 with x86_64 For x86_64 binary RPMs in the URLs above.
You need also cross binutils (choose required binary RPM file or build from SRPM)
You need also DJGPP development libraries, include files and some tools (eg. stubify)
Note that one can use
for more information about GCC-6.1.0 and about changes in comparison
with earlier versions
Also see file gnu/gcc-6.10/readme.DJGPP (from gcc610b.zip and
gcc610s.zip) for more information about this port.
There is also my web page about DJGPP port of GCC
I cannot promise however, that I’ll update it very often.
However new versions may appear there earlier (including ones not available
Andris Pavenis <andris DOT pavenis AT iki DOT fi>
A long long time ago, back when I got a Pentium 100 the wonderful world of emulation was really starting to be possible with such a high powered CPU. Â First was the simple Game Boy emulators, then a Commodore 64 emulator, the incredible Amiga Emulator, the beginnings of SIMH (back when it was only a PDP-11 emulator), and then I found the SEGA emulator,Â System 16.
It was really cool being able to play 16bit arcade games on the desktop, although rather slowly. Â From there everyone knows the rise of MAME. Â But while looking around for a small 68000 C compiler, I came across the source code to an older version of System 16, 0.53 on archive.org. Â Naturally it’s for MS-DOS, as was everything back in the day. Â Also slightly interesting is the 68000 emulation, written byÂ Bernd Schmitd of UAE fame. Â So for the heck of it, I set about gettingÂ Thierry Lescot’s System 16 building again. Â I’ve never used allegro before, so it was a bit of a fight to get a version of it to actually build. Â It turns out that I should have been building version 2.11 with tools of that era (why on earth was I using GCC 4, and binutils 2.18?) and instead stick with GCC 18.104.22.168 and some much older binutils. Â And in no time I had build the library, and it’s examples. Â With that done, I was able to re-build System 16 with GCC 4.1.2 and get a binary!
Back in the day, I actually did have an Altered Beast arcade board. Â Sadly it died in a move, someone near and dear just saw the PCB as “garbage” and tossed it. Â Sigh, but I did have ROM dumps, as I did a refresh of it forever ago. Â Anyways I still have the ROM files, so I guess that is nice.
Anyways I fired up the emulator and got what is known as the “jail bar” effect, which is from a bad ROM.
The System 16 splits it’s memory into a program space, a sprite memory bank, a tile memory bank, and RAM for stack and things like the palette. Â As you can see the program is certainly running, and the sprites are good. Â I did some poking around a bit later, and noticed that due to a logic bug, the texture ROMs are actually never loaded!
So a quick patch, and now we get Altered Beast up and running!
Well, now isn’t that great!
Not that I would imagine anyone would really care, I mean MAME is a thing, and even from the readme:
Altered Beast : No sound emulation
So it’s pretty quiet. Â Additionally the source is pretty restrictive:
These sources can’t be used for commercial purpose, any new version of the
emulator done with these sources must specify my name somewhere on the screen
et docs and I must be informed about any new release of the emulator.
For anyone interested you can find the source & binaries out on sourceforge.
The following is a guest post / wrap-up of the Q2DOS adventure byÂ [HCI]Mara’akate.
In the last update sezero and I([HCI]Mara’akate) tied up most loose ends with regards to Q2DOS.Â Specifically: adding in DXE support for mods and cleaning up some code from the early efforts.Â During this time, a forum user by the name of ggorts (strogg spelled backwards!) mentioned the possibility of using an old Mesa version with 3DFX support in DOS. I worked on separating the ref_soft from being statically linked into a DXE form and sezero cleaned up any potential problems there.
I mentioned the possibility of attempting the Mesa port to sezero and he thought it was probably a wasted effort and thought making a ref_glide depending only on glide3x.dxe would be a better way to go with less overhead.Â I started some initial work on it but quickly abandoned this side-project as I have no real glide (or even OpenGL) knowledge and didn’t have enough time on my hands to play around with it.
Around this time, we also separated the GameSpy browser code into a separate DXE for potential legal issues.Â The GameSpy code was publicly released, but never officially GPL’d.Â Using this method, other port authors could link against a gamespy.dll to add in the browser capabilities that connect to my GameSpy master server emulator (see QDOS branch for source code to that particular project).
Ggorts also came up with some code for us to be able to finally use the banked modes and Mode-X 320×240.Â Though 320×240 Mode-X seems to have some issues with certain emulator configurations, for the most part it works OK.Â This also helped us to get some ASM rendering code in from Q1 and help clean up the original mess that was the SVGA driver; a lot of unused code from Q1 was removed and sezero found a clever way to send the video modes list between the game binary and renderer DXE.
In any event, one night I figured I’d take a stab at trying to get Mesa working in Q2DOS.Â Checking out the Mesa3d FTP and researching the various changelogs it appears as if Mesa 5 series was the last true effort with Mesa 6.4.x series being the last maintained version with 3DFX specific code.Â I got everything to compile but ran into hard-lock issues no matter what I attempted.Â During this time, ggorts found out some various small, but now obvious issues. Including increasing the stack size to 1MB and he hard-coded the ref_gl to only work in 640×480.Â It took a lot of pleading but eventually he released his source with a static compile for Voodoo 1 cards only as he was testing this on emulators like DOSBox with glide support and PCem dev branch.
I worked on cleaning up the source and he produced some glide3x libraries for me for Voodoo 2 and Voodoo 5 as these were the only cards I personally owned.Â Imagine my surprise as I first loaded it up and it actually worked!Â And it was smooth with no rendering issues!
At this point, sezero became involved and worked very hard to clean up the Mesa compile issues, including various scary warnings and helped to update us to the final glide3x commit pushed to the development branch and Mesa v6.4.3 which was an unreleased maintenance update for Mesa v6.4.2.
It was a long journey to get the code all working together just right, and a big thanks goes out to the early Mesa crew including Brian Paul, Daniel Borca, and “KoolSmoky” and the mysterious ggorts fellow who pushed hard for this feature.
To recap, Q2DOS from the last time we talked now has:
We are about at the end of our Q2DOS journey.Â A few odds and ends with Mesa and Voodoo 5 SLI issues remain (though nothing too show stopping) and there’s a small wishlist of some unnecessary features but it’s come a long way from the initial null driver effort!
I have to say it is simply incredible to see how Q2DOS went from a very primitive ‘wow it works’ port to a full featured port. Â Simply amazing!
Since the last update we got some help in a few fields that have really fleshed out this ‘experimental’ port into a full fledged port. Â First RayerR helped us with the fun of getting us onto the latest deployment of DJGPP, 2.05 (rc1). Â It’s always nice to be in the latest available release. Â Next in a passing comment,Â Ruslan Starodubov had mentioned that he had gotten a much older build of our QDOSÂ to support the Intel HDA sound chipset via theÂ Â MPXPlay sound library. Â I wrote to the author of MPXPlay, PÃ¡dÃ¡r AttilaÂ asking for us to distribute his source in our project, and he granted permission.
So at this point things were looking good. Â The only ‘feature’ that modern OS’s really held over us was the ability to dynamically load and unload game modules on the fly. Â I had tried to use DLM, but it stripped the DPMI functionality out of the MS-DOS Extender making the port really useless. Â I tried to build the newer DXE3 support but had no luck. Â I suspect now my native tool chain was interfering with the build process. ButÂ Maraakate managed to get it to not only build, but to run!
Adding in DX3 support was relatively painless.Â I first looked at DJGPP’s FAQ and downloaded the example code.Â In the example code there was small helper functions to make unions and check the symbols.Â If they didn’t exist a printf was spit out to alert you about it.Â To resolve the issue you simply just add DXE_EXPORT to the other list of missing exports.
Compiling the game code was easy, again referring to the example I saw that basically they compiled it the same, but at link time you use DX3GEN and -U flag to ignore unresolved symbols.
The biggest head scratcher was the Sys_GetGameAPI failing to find GetGameAPI from the DX3.Â After some piddling around I noticed that it listed GetGameAPI as _GetGameAPI inside the DX3 itself.Â I added the underscore and it worked!
Other things that were relatively to easy to import was R1Q2’s HTTP downloading code.Â Compiling CURL was kind of tricky because of the linking order, but thankfully neozeed figured it out quickly.
All of Yamagi’s Quake 2 updated game DLLs were all diff’d by hand using BeyondCompare to make sure I didn’t clash using some newer functions that weren’t available in DJGPP.Â I also merged their Zaero code with their baseq2 code by comparing Zaeros code to the Quake 2 SDK, marking every thing that was changed.Â The result is a really stable Zaero game code.Â If you haven’t played Zaero check it out.Â I think it’s a lot better than Rogue, but Xatrix is probably my favourite (even over stock Q2).
Other cool things I’m glad to get into the code was the GameSpy Browser.Â It took me quite a bit of work to get it where it is, but it’s really nice to just be able to ping to a master server (a custom GameSpy emulator I wrote specifically for Q2DOS.Â Source is not finalized yet, but will be available soon for those curious), pick a server and go!Â All in DOS!
So here we are at the end of the journey. Â Or at least safe enough for a 1.0 release.
To recap, we have:
* VGA * SVGA (LFB modes only) * Mouse * Keyboard * SoundBlaster and Gravis UltraSound Family * CD-ROM music * OGG music * Networking (You need a packet driver) * Loading/unloading game DLLs in DX3 format. * Intel HDA support -hda * Mouse wheel support with -mwheel
And I should add, that it works GREAT on my MSI Z87 motherboard.
Don’t forget you can always make bootable USB stick with DOS, or CD-ROMs.
Continued in Part 5!
Well it mostly works now. Â But did we ever have the biggest fun with the sound and SVGA.
SoÂ [HCI]Maraâ€™akateÂ integrated all the Q1 sound code, got it to compile, but nothing not a peep from the sound card. Â While I was busy trashing the video code, he spent way too much time on the audio, and then for the heck of it I thought I’d look at the code, although I’m really stabbing in the dark when it comes to audio. Â Imagine my surprise when I compiled the code, and ran it and got the sound blasting at full volume! Â It turns out that I had my audio set to ‘high quality’ in the client, while he had his set to ‘low quality’. Â What it does is govern the frequency between 11Khz and 22Khz. Â And if you get this wrong you get *NO* audio. OOPS. Â At least it was one of those feeling vindicated moments that his efforts for sound really did work.
Now with audio, it was my time to hurry up and get the video going. Â I had basic VGA working so I figured I didn’t want to spend a lot of time on this, so I was going to go with the VESA 2.0 linear frame buffer. Â Well this once more again proved to be a bit more involved as the only way I really have to test is emulation via DOSBox and Qemu. Â And naturally both of them worked fine, but whenÂ [HCI]Maraâ€™akate ran it on his real DOS Box (with GUS of course) it crashed wonderfully.
Now I had taken the VESA init code from Quake 1 to build a table of what 8bit modes are supported, and used the VESA code to switch, along with drawing to the buffer with a simple memcpy. Â And we got nothing but crashes.
After looking more around, I found that you had to add 0x4000 to the VESA mode you want if you wanted to access it’s LFB. Â Did that work? No still crashed.
Later in the adventure we noticed to get proper access you had enable ‘near pointer acess’ with a call to :
So naturally I would disable it when I’m done, making the call look like this:
WRONG. Oh so WRONG. Â Well OK technically it did work, but if sound is enabled (and why wouldn’t it be?) it would immediately crash with an error in the DMA code. Â We ended up wasting over a day trying to figure this one out until I just said screw it, let’s never dsiable the nearpointer, leave it unprotected. Â Naturally that actually worked. Â The hint is in map_in_conventional_memory, whereÂ __djgpp_nearptr_enable(); is called, but of course there is no calls toÂ __djgpp_nearptr_disable(); Â I’ve thought about going back through the source to ‘clean’ it up to make it lock and unlock memory as needed, but this is 2015 not 1997 so good enough is well, good enough.
So now with VESA and Sound, I thought this would be a great time to tackle the dynamic loading of gamex86. Â We will have to re-compile whatever gamex86 DLLs are out there as of course DOS is DOS. Â The HX DOS guyÂ Japheth seems to have died, as his site and all the info on that extender seems to have mostly vanished. Â I have an old copy, but I never could make it call DOS stuff if you had WIN32 stuff going on. Â And if he’s really dead it’s too late to ask him.
Ages ago I remembered this DLL support for DJGPP called DLM, so I thought I’d give that a try. Â I was able to take our ‘null’ version of Quake II, and get it to where it can load and unload the gamex86.dlm at will. Â So I figured this was going to be an easy win, right?
Wrong again. Â Once I started to put in the MS-DOS specific code I got this fun crash:
DLM -> Exiting due to signal SIGSEGV at
0x0014f59d SYM: _dos_lockmem+0x9 DLM: q2.exe [0xf5000]
possibly because of undefined reference to symbol ‘___djgpp_base_address’
DLM call frame traceback :
0x0014dcaf SYM: _Sys_PageInProgram+0x37 DLM: q2.exe [0xf5000]
0x0014e1c4 SYM: _main+0x18 DLM: q2.exe [0xf5000]
So apparently it doesn’t export (or import) djgpp stuff like the base address calculations so we can’t do direct memory access, which means no video and no sound. Â Ouch. Â I’ll have to hit the lists to see about support. Â I don’t like the DXE’s because they cannot be unloaded, so that isn’t much good. Â And of course things like the JVM inside of gamex86.dll is right out as JAVA inside of MS-DOS? in 64MB of RAM? Dream on.
So for now, the gamex86.dll is statically linked into the executable. Â You are restricted to vanilla gameplay for now.
As an added bonus, I used Rufus 2.2, to setup a bootable MS-DOS USB stick, slapped everything onto there, and booted up on my Xeon, and it works!
Now as a super bonus,Â Â [HCI]Maraâ€™akate went above and beyond by adding in a bunch of fixes, and updates from 3.24 and varous stuff from Knightmare. Â And then the best part is integrating libogg, so it can now play the ogg sound track! Â Really, just place the ogg files in the baseq2\music directory and away you go!
For anyone who is interested, I’ve updated the binaries, to include the latest version with built in quakespy technology! Â Run an /slist2 and get a list of servers!
At this point the ‘alpha 2’ version contains:
I’ve also compiled a ‘server’ for Linux based on the code, and put it online @ 22.214.171.124:27910
Continuing in this series on porting Quake II to MS-DOS, we get to touch some of the fun stuff. Â The first big ‘fun’ thing is networking.
Now in my prior work with the MS-DOS version ofÂ Quake, I had used the WATTCP library to bring networking to the otherwise Windows/UNIX specific fun of network deathmatch back to MS-DOS. Â Quake by default had support for theÂ Beame & Whiteside’s TCP/IP stack which for all intents and purposes has vanished from the face of the Earth (does anyone have a copy?!). Â So at the time, I thought it’d be cool to try to interface WATTCP with Quake, and it worked on the first attempt as WATTCP is a very competent TCP/IP stack.
So I took the Linux networking file net_udp, and compiled it, and I got an executable!
When it comes to testing WATTCP though, I prefer to use Qemu instead of DOSBox as it can not only emulate various network cards to which I can find packet drivers (yes even the evil PCI NE2000!) but it has a built in SLiRP network stack that let’s me NAT on my desktop without any crazy network configs.
And for the sake of testing, I setup a ‘null’ text mode server, figured out some flags, and I was able to connect!
Very exciting stuff indeed!
Now for some interesting stuff. Â First I noticed that MS-DOS 5.00 with himem.sys is almost unplayable because it is so slow. Â MS-DOS 4.01 without himem.sys is actually faster. Â No, I’m not kidding.
Next is that some levels LOVE to gobble up RAM. Â Maps like city1 will need at least 192MB of ram. Â I haven’t even tried playing with the virtual memory of DJGPP, and I really don’t want to. Â And let’s face if, if you even try to load Quake II on a MS-DOS machine, it better be a ‘big’ one. Â This means you should be using the ‘dos’ from Windows 98, or perhaps FreeDOS, although I haven’t tested that at all.
So far from our limited testing the networking seems to be pretty good. Â And at least that is one function we didn’t have to really pour a lot of effort into. Â Although the payoff of being able to connect to servers on the LAN and even the internet is a good thing.
(In this series, I’m going to go over the process of porting Quake II to MS-DOS. Â Now of course the question will pop up why? And the answer is simple enough, afterÂ [HCI]Mara’akate added inÂ gamespy support, something was noticeably off, and that is fewer and fewer people are playing Quake 1 these days. Â So what to do?
Well apparently Quake II has an active following, so it’s time to move our creeky but favorite OS, MS-DOS into the Quake II Arena!
So the first thing to do is to grab a copy of the GPL source to Quake 2, along with a copy of the game, and get started on making a ‘null’ version of the game. Â Null versions of the game have no graphical output, no sound, and ‘function’ at a very basic level. Â It’s something to strive for as a first base in hitting that home run of a functional port. Â Thankfully iD wrote really portable and modular software. Â Unfortunately they tended to let their ports drift as they were writing the engine so the null code doesn’t actually work out of the box. Â And the project makfiles leave a little to be desired for me, as they have a bunch of i386/Dec Alpha magic which doesn’t leave much in the room for weird ports like MS-DOS.
Now I should mention that before I’d gotten started the first thing I decided that like QuakeWorld for MS-DOS (and OS/2) I would use GCC as it is a known working compiler out of the box. Â If you can, don’t fight so many battles of unknowns at once. Â Another thing is that I am going to cross compile from OS X and test with DOSBox. Â Of course you may want to use something else, and I know my tastes drift, but for now this is what I’m using. I’m using my old OSX to DJGPP cross compiler with GCC 2.95.3, which serves me well.
So the first thing was to compile and run the null version with native tools on OS X. Â After a bit of struggle I got here:
Added packfile ./baseq2/pak0.pak (3307 files)
Added packfile ./baseq2/pak1.pak (279 files)
Added packfile ./baseq2/pak2.pak (2 files)
Sys_Error: ref_soft::R_BeginFrame() – catastrophic mode change failure
Well that’s great, how to figure this one out?
One thing I did to make it easier to work with the flow of Quake is to make theÂ Sys_Error procedure contain a divide by zero. Â Now why would I purposely put a divide by zero in the code? Â Simple it lets me back trace the code when Quake catches it’s own faults so I can see what went wrong where, vs what would look like a clean exit. Â From my example:
* thread #1: tid = 0xf14f9, 0x000c0853 q2`Sys_Error(error=0x000c17d4) + 98 at sys_null.c:28, queue = ‘com.apple.main-thread’, stop reason = EXC_ARITHMETIC (code=EXC_I386_DIV, subcode=0x0)
* frame #0: 0x000c0853 q2`Sys_Error(error=0x000c17d4) + 98 at sys_null.c:28
frame #1: 0x0003a0cb q2`Com_Error(code=0, fmt=0x000c17d4) + 368 at common.c:215
frame #2: 0x000c0523 q2`VID_Error(err_level=0, fmt=0x000cc8a8) + 81 at vid_null.c:45
frame #3: 0x000a6d38 q2`R_BeginFrame(camera_separation=0) + 592 at r_main.c:1145
frame #4: 0x000a4cfc q2`R_Init(hInstance=0x00000000, wndProc=0x00000000) + 276 at r_main.c:333
frame #5: 0x000c0740 q2`VID_Init + 362 at vid_null.c:122
frame #6: 0x00007900 q2`CL_Init + 55 at cl_main.c:1795
frame #7: 0x0003c2cb q2`Qcommon_Init(argc=1, argv=0xbffffc40) + 754 at common.c:1469
frame #8: 0x000c09ac q2`main(argc=1, argv=0xbffffc40) + 24 at sys_null.c:128
frame #9: 0x000019ad q2`_start + 212
frame #10: 0x000018d8 q2`start + 40
Now I know that R_BeginFrame was where the error was occurring, and looking at the code:
if ( ( err = SWimp_SetMode( &vid.width, &vid.height, sw_mode->value, vid_fullscreen->value ) ) == rserr_ok )
ri.Sys_Error( ERR_FATAL, “ref_soft::R_BeginFrame() – catastrophic mode change failure\n” );
We can see that the vid.width/vid.height aren’t being setup correctly. Â Turns out there was a bunch more work to be done setting up vid_null!
After looking closer at the files, I notice as I’m stitching them together is that Quake II relies on DLL’s as part of it’s base functionality. Â I drifted out of Quake after Quake 1, so I never played II before. Â So I didn’t know this. Â Obviously DJGPP doesn’t support DLL’s that can be loaded and un-loaded at will (Yes I know about DXE’s, but as the FAQ states, they cannot be un-loaded. Â And I’m not going to fight DJGPP’s LIBC). Â So looking further in the source, I saw these fun defines:
So at one point there was support for ‘hard linking’ in the ‘REF’ video driver, and the ‘game’ logic driver. Â But it did kind of drift out of the code. Â But looking at the Win32 version I could see that putting this functionality back in should be easy. Â And to be honest if I learned any lesson from this, is that I should have been pulling the Win32 version apart by injecting null into it until it ran as a null platform, then use that as the basis. Â Lesson learned. Â Always start with a known good! Â Quake II was built with Visual C++ 6, but I only have Visual C++ 4.2 installed on Crossover. Â Yes I know again this is me being difficult. Â But it didn’t take much time to get a simple project that has two DLL’s and a Win32 exe running. Â Then I took on the ‘ref’ video driver and got that linking inside of the main EXE. Â Now with one DLL ‘eliminated’ it was time to work on the game dll.
The game DLL posed the biggest challenge because it passes a reference to internal functions to it, and exports various functions back to the game engine. Â So I ended up altering the engine to not call the game import/export directly but setting it up myself. Â The hardest thing was that I couldn’t pull in the game header file, but rather I had to copy the prototypes myself. Â Another interesting thing with the way Quake II works is that the game dll has to be able to be unloaded and loaded at will. Â It wasn’t hard to simulate this, but I wasn’t expecting it. Â Again this is probably because I never really played Quake II.
Now that I had Quake II building without DLL’s I could then take the next step of removing all the IO and re-replacing it with the null code, and now I had something that looked like it was doing something.
Added packfile ./baseq2/pak0.pak (3307 files)
Added packfile ./baseq2/pak1.pak (279 files)
Added packfile ./baseq2/pak2.pak (2 files)
768k surface cache
ref_soft version: SOFT 0.01
——- sound initialization ——-
Sys_FindFirst [./baseq2/autoexec.cfg]: UNIMPLEMENTED!
==== InitGame ====
——- Server Initialization ——-
0 entities inhibited
0 teams with 0 entities
====== Quake2 Initialized ======
==== ShutdownGame ====
Sys_Error: Draw_Pic: bad coordinates
This turns out because I didn’t allocateÂ the screen properly. Â Looking at the code:
if ((x < 0) || (x + w > vid.width) ||
(y + h > vid.height))
ri.Sys_Error (ERR_FATAL,”Draw_Pic: bad coordinates”);
We can see it pretty plainly.
Now since we were going somewhere I started to write some MS-DOS code, and switch out of the null set of mind!
First a simple VGA mode 13 setup which gives us 320×200 resolution with 256 available colours. Â And for good measure I did a simple VGA palette setup that I knew worked from a prior program. Â Next we just blit our buffer onto the screen, and we get this:
Which is exciting and disappointing at the same time. Â I then took the palette code from DOS Quake, and got something just as ugly. Â I tried the code from OS/2. Same thing. Â I tried all kinds of things and was going nowhere.
At this pointÂ Mara’akate added in the Linux clock code, and now we had this!
It wasn’t until much more digging around I saw some 320×240 screen setups that I realized there was something wrong there, and then I saw this gem in the linux port’s code:
** System specific palette setting routine. A NULL palette means
** to use the existing palette. The palette is expected to be in
** a padded 4-byte xRGB format.
In traditional VGA palette setups it’s 768 bytes that needs to be read/and pushed to the card. Â I even checked Quake 1 is 768 bytes, but now in Quake II, it’s 1024 bytes! Â OOPS! Â Sometimes (ok a lot of times) you really need to check other ports or a ‘known good’ to see how they did things.
So where to go from here? Obviously things like better keyboard input, the mouse, sound and networking need to be done.
Yes, you read that right, not only is DJGPP still alive, but after the much stalled 2.04 beta cycle that has been going on for more than a decade, they have decided to push forward with 2.05 to get a release out there!
It has numerous changes since previous DJGPP 2.04 beta 1 release in 2003.
Unfortunately DJGPP v2.04 was never released and old beta version slowly
became almost unusable together with other newer DJGPP packages.
More information about changes in DJGPP 2.05 beta 1 is available at
both in sections about changes in 2.04 and 2.05. The same information is also
available in file info/kb.inf in djdev205.zip
It needs a lot of testing. Please test it if you have time and/or are
interested in any of the above features. Any level of testing would be
The beta is not available via the Zip Picker interface. You can download it
Additionally RPM packages (source and binary packages for i686 and x86_64) are
Please see the README file for instructions on how to install the beta:
You can also download DJGPP 2.05 beta 1 packages from DJGPP mirror sites:
Thanks for all who have contributed to development of DJGPP
I haven’t used it yet, but I see the following files in the beta directory:
djdev205 DJGPP V2 Development Kit and Runtime djlsr205 DJGPP V2 Base Library Sources djtst205 DJGPP V2 Test Programs (for testing the C library) djcrx205 DJGPP V2 Cross-to-DOS Compiler Support Files (from djlsr/djdev) djtzn205 DJGPP V2 Timezone Files djtzs205 DJGPP V2 Timezone Sources
No doubt it’ll be a good excuse to rebuild and update some Quake related things to see how we fare in 21 century MS-DOS!