<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>djgpp &#8211; Virtually Fun</title>
	<atom:link href="https://virtuallyfun.com/category/djgpp/feed/" rel="self" type="application/rss+xml" />
	<link>https://virtuallyfun.com</link>
	<description>Fun with Virtualization</description>
	<lastBuildDate>Sun, 24 Aug 2025 13:55:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>nonsensical benchmarks</title>
		<link>https://virtuallyfun.com/2021/12/01/nonsensical-benchmarks/</link>
					<comments>https://virtuallyfun.com/2021/12/01/nonsensical-benchmarks/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Wed, 01 Dec 2021 11:07:48 +0000</pubDate>
				<category><![CDATA[djgpp]]></category>
		<category><![CDATA[DOSBox]]></category>
		<category><![CDATA[gcc]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/wordpress/?p=11629</guid>

					<description><![CDATA[So I was messing with quake1 &#38; DJGPP/DOSBox. So yes that means this table is largely nonsense. My larger goal was to see if a strictly softfloat could run Quake1. The answer, is no. However I got some weird answers &#8230; <a href="https://virtuallyfun.com/2021/12/01/nonsensical-benchmarks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">So I was messing with quake1 &amp; DJGPP/DOSBox.  So yes that means this table is largely nonsense.  My larger goal was to see if a strictly softfloat could run Quake1.  The answer, is no.</p>



<p class="wp-block-paragraph">However I got some weird answers from messing around with the flags &amp; fps from a timedemo of demo1</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:90px">
<pre class="wp-block-preformatted">FPS
67.7
113.4
130.1

131.9
101.3

73.0
71.7
31.1

44.6
32.7</pre>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:500px">
<pre class="wp-block-preformatted">CFLAGS
-O0 -m386 -m80387
-O2 -m486 -m80387
-O2 -m486 -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387
-O2 -m386 -m80387
-O2 -m386 -m80387 -funroll-loops -fomit-frame-pointer -fexpensive-optimizations
-O2 -m486
-O2
-O2 -msoft-float -m386 -funroll-loops -fomit-frame-pointer -fexpensive-optimizations
-O2 -msoft-float -m386
-O2 -msoft-float -m486</pre>



<p class="wp-block-paragraph">This needs to be a table! it&#8217;s unreadable!</p>
</div>
</div>
</div>
</div>



<p class="wp-block-paragraph">So surprisingly -O2 -m386 -m80387 produced the fastest code using GCC 2.7.2.3.  On DOSBox so yeah that means literally nothing.  Rebuilding DOSBox with no floating support code gave a weird error about the pov being out of range.</p>



<p class="wp-block-paragraph">Obviously the next thing to do is run this stuff natively.. .which means GCC 2.7.2.3 for NT.  Oh this is going to be fun, but utterly pointless. Or maybe not.</p>



<figure class="wp-block-image size-large"><a href="https://virtuallyfun.com/wp-content/uploads/2021/12/qbench.jpg"><img fetchpriority="high" decoding="async" width="1024" height="455" src="https://virtuallyfun.com/wp-content/uploads/2021/12/qbench-1024x455.jpg" alt="" class="wp-image-11634" srcset="https://virtuallyfun.com/wp-content/uploads/2021/12/qbench-1024x455.jpg 1024w, https://virtuallyfun.com/wp-content/uploads/2021/12/qbench-300x133.jpg 300w, https://virtuallyfun.com/wp-content/uploads/2021/12/qbench-768x341.jpg 768w, https://virtuallyfun.com/wp-content/uploads/2021/12/qbench-500x222.jpg 500w, https://virtuallyfun.com/wp-content/uploads/2021/12/qbench.jpg 1133w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p class="wp-block-paragraph">I re-ran the tests using VMware.  There is no audio drivers involved just plain MS-DOS.  The red is DOS-Box while green is VMware for the graph with FPS being the measurement.  Interesting how the numbers aren&#8217;t as varied like DOSBox, however the -m386 -m80387 proved the be the worst for VMware, while the 386 soft float was so incredibly slow on DOSBox but performs great on VMware.  yay?</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2021/12/01/nonsensical-benchmarks/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Quake 1.01 / Shareware</title>
		<link>https://virtuallyfun.com/2018/06/08/quake-1-01-shareware/</link>
					<comments>https://virtuallyfun.com/2018/06/08/quake-1-01-shareware/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 08 Jun 2018 13:09:14 +0000</pubDate>
				<category><![CDATA[djgpp]]></category>
		<category><![CDATA[MS-DOS]]></category>
		<category><![CDATA[quake]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/wordpress/?p=8486</guid>

					<description><![CDATA[I saw this pop up while cruising archive.org, and I thought it&#8217;d be fun to play with.Â  The shareware version of Quake on this CD image is version 1.01, which corresponds with the crack dot com leak of the Quake &#8230; <a href="https://virtuallyfun.com/2018/06/08/quake-1-01-shareware/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><div id="attachment_8487" style="width: 658px" class="wp-caption aligncenter"><a href="https://archive.org/details/cdrom-quake-shareware"><img decoding="async" aria-describedby="caption-attachment-8487" class="wp-image-8487 size-full" src="https://virtuallyfun.com/wp-content/uploads/2018/06/1_Quake_Shareware-front.jpeg" alt="" width="648" height="567" srcset="https://virtuallyfun.com/wp-content/uploads/2018/06/1_Quake_Shareware-front.jpeg 648w, https://virtuallyfun.com/wp-content/uploads/2018/06/1_Quake_Shareware-front-300x263.jpeg 300w" sizes="(max-width: 648px) 100vw, 648px" /></a><p id="caption-attachment-8487" class="wp-caption-text">Quake Shareware CD</p></div></p>
<p>I saw this pop up while cruising archive.org, and I thought it&#8217;d be fun to play with.Â  The <a href="https://archive.org/details/cdrom-quake-shareware">shareware version of Quake on this CD image</a> is version 1.01, which corresponds with the <a href="https://www.google.com.hk/amp/s/www.wired.com/1997/01/hackers-hack-crack-steal-quake/amp">crack dot com leak of the Quake source code</a>.Â  Searching around revels that the leak was aptly named &#8220;Quake101leakedsource.zip&#8221;, which wasn&#8217;t so hard to track down.</p>
<p>The source code is, naturally, in the process of being ported to Linux, and the makefiles reflect this.Â  I used my <a href="https://virtuallyfun.com/wordpress/2018/03/04/building-mame-0-1-for-ms-dos-djgpp/">MinGW to DJGPP cross compiler toolchain</a> that is close to era specific.</p>
<p>I had a single issue with the code, d_copy.s the following line was giving me trouble:</p>
<pre>movl	$2,%al</pre>
<p>changing it to the following however, let my version of GAS happily assemble it.</p>
<pre>movb $2,%al</pre>
<p>After a while of messing with the Makefile, and adding in the DOS components, it was easy enough to get an executable.Â  And even better it&#8217;ll run with the data/music from the demo disc!</p>
<p>I used Daemon tools to mount the MDS/MDF image, and just pointed DOSBox to the CD drive letter with a simple:</p>
<pre>mount d: f:\ -t cdrom</pre>
<p>And now when I fired up Quake, it&#8217;ll play the music tracks from the CD.</p>
<p><div id="attachment_8488" style="width: 860px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2018/06/Quake-101-on-DOSBox.png"><img decoding="async" aria-describedby="caption-attachment-8488" class="size-full wp-image-8488" src="https://virtuallyfun.com/wp-content/uploads/2018/06/Quake-101-on-DOSBox.png" alt="" width="850" height="507" srcset="https://virtuallyfun.com/wp-content/uploads/2018/06/Quake-101-on-DOSBox.png 850w, https://virtuallyfun.com/wp-content/uploads/2018/06/Quake-101-on-DOSBox-300x179.png 300w, https://virtuallyfun.com/wp-content/uploads/2018/06/Quake-101-on-DOSBox-768x458.png 768w" sizes="(max-width: 850px) 100vw, 850px" /></a><p id="caption-attachment-8488" class="wp-caption-text">Quake 101 on DOSBox</p></div></p>
<p>One thing that caught my interest was that when you exit the game, I get the &#8220;couldn&#8217;t load endscreen.&#8221; message.</p>
<p>Well it turns out that someone was naughty and had modified common.c on January 20th 1997,Â  and made the following addition:</p>
<pre>if (h == -1)
{
Con_Printf ("Playing shareware version.\n");
// if (com_modified)
// Sys_Error ("You must have the registered version to use modified games");
// /*return;*/
}</pre>
<p>So yeah, since they had double commented out that return statement, it&#8217;ll fall out the logic, and set the game to registered, which is why the endscreen message is missing.Â  Uncommenting them all will restore the default execution behavior.Â  Speaking of registered, on the CD there is a fileÂ QUAKE.MJ3, which is 25MB, which looks like an encrypted version of the registered game.Â  I guess it&#8217;d be &#8216;neat&#8217; to have version 1.01, although the Steam version I have is 1.06 and I don&#8217;t know how much difference it&#8217;d really make.Â  Â Although I guess 22 years later it doesn&#8217;t matter much.</p>
<p>On the one hand I&#8217;m really impressed that it works.Â  For anyone who is slightly interested I guess, you can find my re-build of the source here:</p>
<p><a href="http://vpsland.superglobalmegacorp.com/install/MS-DOS/Quake1/Quake101-djgpp2.zip">Quake101-djgpp2.zip</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2018/06/08/quake-1-01-shareware/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Building MAME 0.1 for MS-DOS / DJGPP</title>
		<link>https://virtuallyfun.com/2018/03/04/building-mame-0-1-for-ms-dos-djgpp/</link>
					<comments>https://virtuallyfun.com/2018/03/04/building-mame-0-1-for-ms-dos-djgpp/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Sun, 04 Mar 2018 14:59:36 +0000</pubDate>
				<category><![CDATA[binutils]]></category>
		<category><![CDATA[cross compiler]]></category>
		<category><![CDATA[djgpp]]></category>
		<category><![CDATA[DOSBox]]></category>
		<category><![CDATA[DPMI]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[MS-DOS]]></category>
		<category><![CDATA[Win32]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=8218</guid>

					<description><![CDATA[So as promised, a while back I had built a GCC 2.7.2.3 / Binutils 2.8.1 cross compiler toolchain suitable for building old Allegro based programs, such as MAME.Â  Of course the #1 reason why I&#8217;d want such a thing is &#8230; <a href="https://virtuallyfun.com/2018/03/04/building-mame-0-1-for-ms-dos-djgpp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>So as promised, a while back I had built a GCC 2.7.2.3 / Binutils 2.8.1 cross compiler toolchain suitable for building old <a href="http://liballeg.org">Allegro</a> based programs, such as <a href="http://mamedev.org/">MAME</a>.Â  Of course the #1 reason why I&#8217;d want such a thing is that being able to do native builds on modern machines means that things compile in seconds, rather than an hour + compiling inside of DOSBox.</p>
<p>Why not use a more up to date version of both GCC/Binutils?Â  Well the problem is that the pre <a href="https://gcc.gnu.org/wiki/History#EGCS">EGCS</a> tools ended up with macro and inline assembly directives that were dumped along the way so that later versions simply will not assemble any of the later video code in Allegro, and a lot of the C needs updating too.Â  And it was easier to just get the older tool chain working.</p>
<p>It took a bit of messing around building certain portions inside of each step of the tools, but after a while I had a satisfactory chain capable of building what I had needed.</p>
<p>So for our fun, we will need my cross <a href="https://sourceforge.net/projects/crossdjgppv2/files/djgpp_v2_gcc2723_djgppv201.7z/download">DJGPP v2 tool chain for win32</a>, <a href="https://mirrors.xmission.com/mame/releases/mame01.zip">MAME 0.1</a>, <a href="https://download.tuxfamily.org/allegro/files/alleg312.zip">Allegro 3.12</a> and <a href="https://github.com/greg-kennedy/SEAL">Synthetic Audio Library (SEAL) Development Kit 1.0.7</a> .</p>
<div class="mb-3 repository-topics-container js-repository-topics-container js-details-container">
<div id="topics-list-container" data-url="/greg-kennedy/SEAL/settings/topics">
<p>Lib Allegro is already pre-built in my cross compiler tool chain, all that I needed to add was SEAL, with only one change, 1.0.7 is expecting an EGCS compiler, which this is not, so the -mpentium flag won&#8217;t work, however -m486 will work fine.</p>
</div>
<p>Otherwise, in MAME all I did was alter some include paths to pickup both Allegro and SEAL, and in no time I had an executable.Â  And the best part is checking via DOSBox, it runs, with sound!</p>
<p><div id="attachment_8219" style="width: 654px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2018/03/MAME-0.1-on-DOSBox-PACMAN-hiding.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8219" class="size-full wp-image-8219" src="https://virtuallyfun.com/wp-content/uploads/2018/03/MAME-0.1-on-DOSBox-PACMAN-hiding.png" alt="" width="644" height="541" /></a><p id="caption-attachment-8219" class="wp-caption-text">MAME 0.1 on DOSBox PACMAN hiding</p></div></p>
<p>Thankfully MAME has been really good about preserving prior releases, along with their source tree, and it&#8217;s pretty cool to be able to rebuild this using the era correct vintage tools, and I can&#8217;t stress how much more tolerable it is to build on faster equipment.</p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2018/03/04/building-mame-0-1-for-ms-dos-djgpp/feed/</wfw:commentRss>
			<slash:comments>33</slash:comments>
		
		
			</item>
		<item>
		<title>Updated my DooM port</title>
		<link>https://virtuallyfun.com/2018/01/23/updated-my-doom-port/</link>
					<comments>https://virtuallyfun.com/2018/01/23/updated-my-doom-port/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Tue, 23 Jan 2018 12:40:13 +0000</pubDate>
				<category><![CDATA[djgpp]]></category>
		<category><![CDATA[doom]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=8079</guid>

					<description><![CDATA[x68000 still won&#8217;t build on this, lots more to either separate out or just fork out.Â  No biggie. The big plus is for GCC 2.x and higher that use DJGPP v2 runtimes is that the allegro music and sound work.Â  &#8230; <a href="https://virtuallyfun.com/2018/01/23/updated-my-doom-port/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<hr />
<p>x68000 still won&#8217;t build on this, lots more to either separate out or just fork out.Â  No biggie.</p>
<p>The big plus is for GCC 2.x and higher that use DJGPP v2 runtimes is that the allegro music and sound work.Â  It tests faster than Watcom 10/11 or Open Watcom ..Â  probably DMX vs Allegro I suspect &#8230;</p>
<p>Things to do..</p>
<ul>
<li>Upload my GCC 2.7.2.1 cross toolchain</li>
<li>Upload the Freedoom build chain (again)</li>
<li>Test on real machines, the 486 and the P3</li>
</ul>
<p>So yeah.Â  Limited progress.</p>
<p>Also it&#8217;s nice being able to cross build Allegro 3.12 in 10-15 seconds vs the hour+++ in emulation.</p>
<p>Project is in the djgppv1 cross thing</p>
<p><a href="https://sourceforge.net/p/crossdjgppv1/DooM/ci/master/tree/">https://sourceforge.net/p/crossdjgppv1/DooM/ci/master/tree/</a></p>
<p>git access to clone</p>
<p>git clone git://git.code.sf.net/p/crossdjgppv1/DooM crossdjgppv1-DooM</p>
<p>make with:</p>
<p>make -f makefile.djgpp_v2</p>
<p>and you should be good to go</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2018/01/23/updated-my-doom-port/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>dosdoom 0.2 recovered</title>
		<link>https://virtuallyfun.com/2018/01/09/dosdoom-0-2-recovered/</link>
					<comments>https://virtuallyfun.com/2018/01/09/dosdoom-0-2-recovered/#respond</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Tue, 09 Jan 2018 05:58:12 +0000</pubDate>
				<category><![CDATA[djgpp]]></category>
		<category><![CDATA[doom]]></category>
		<category><![CDATA[MS-DOS]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=8058</guid>

					<description><![CDATA[While cruising around at doomworld.com looking for something else, I saw this thread:Â &#8216;Recovered&#8217; DOSDoom 0.2. So I quickly built it with my MinGW32-DJGPP using GCC 3.4.5. And this version needs the Allegro library as it has sound effects audio!  &#8230; <a href="https://virtuallyfun.com/2018/01/09/dosdoom-0-2-recovered/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><iframe loading="lazy" src="https://www.youtube.com/embed/8yCz87QO6hE" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p>While cruising around at doomworld.com looking for something else, I saw this thread:Â <a href="https://www.doomworld.com/forum/topic/74883-recovered-dosdoom-02/#comment-1835392">&#8216;Recovered&#8217; DOSDoom 0.2</a>.</p>
<p>So I quickly built it with my MinGW32-DJGPP using GCC 3.4.5. And this version needs the Allegro library as it has sound effects audio!  Although building Allegro needed GCC 2.7.2.1 and Binutils 2.8.1.  Using other versions just led to nothing but trouble.  I ended up just installing DJGPP on DOSBox to build Allegro which took &#8230; a whlie to build.  Although being able to cross compile dosdoom from Windows was far far far quicker.</p>
<p>So yeah, it runs.  With sound.  It&#8217;s great.  Allegro integration isn&#8217;t anywhere as near complete at this point it&#8217;s just the sound files. I took a much later version of dosdoom&#8217;s MIDI code, which required the Allegro timer, which interfered with my older timer IRQ hook.  Converting the whole thing to use the Allegro timer, and keyboard wasn&#8217;t too difficult, and that gives my <a href="https://sourceforge.net/p/crossdjgppv1/DooM/ci/master/tree/">DooM source fork</a> a really full feeling when using DJGPP v2.</p>
<p>Although I&#8217;m having issues uploading from China at the moment.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2018/01/09/dosdoom-0-2-recovered/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>GCC 1.27 &#038; MS-DOS</title>
		<link>https://virtuallyfun.com/2017/10/08/gcc-1-27-ms-dos/</link>
					<comments>https://virtuallyfun.com/2017/10/08/gcc-1-27-ms-dos/#respond</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Sun, 08 Oct 2017 06:38:33 +0000</pubDate>
				<category><![CDATA[cross compiler]]></category>
		<category><![CDATA[djgpp]]></category>
		<category><![CDATA[doom]]></category>
		<category><![CDATA[gcc]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=7557</guid>

					<description><![CDATA[Inspired by Building and using a 29-year-old compiler on a modern system, i thought I too could get this ancient version of GCC working.  At the time I never had bothered with the older version as I had always assumed &#8230; <a href="https://virtuallyfun.com/2017/10/08/gcc-1-27-ms-dos/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Inspired by <a href="https://miyuki.github.io/2017/10/04/gcc-archaeology-1.html">Building and using a 29-year-old compiler on a modern system</a>, i thought I too could get this ancient version of GCC working.  At the time I never had bothered with the older version as I had always assumed that there were many fixes and adaptations to GCC for it to run on MS-DOS via GO32/DJGPP.  However, after doing this, it&#8217;s obvious that GO32/DJGPP was rather built around GCC&#8217;s stock output, which would sure make a lot more sense.</p>
<p>And it turns out that the target machine being an i386 Sequent running BSD is the best match, both in turns of underscores, and debugging format.  At first, I had tried the AT&amp;T SYSV i386 target, however it couldn&#8217;t link anything from the standard libraries that DJGPP has as they all have a leading underscore.  After starting to mess with internal macros to turn things on and off, and re-define how various portions of assembly are emitted, I found the Sequent target and went with that and everything was fine and using the existing build infrastructure for GCC 1.39 I now could actually run hello world!</p>
<p style="padding-left: 30px;">gcc_v1 -v -E hello.c -o hello.i<br />
gcc version 1.39<br />
cpp_v1 -v -undef -D__GNUC__ -DGNUDOS -Dunix -Di386 -D__unix__ -D__i386__ hello.c -o hello.i<br />
GNU CPP version 1.39<br />
gcc_v1 -v -S hello.i -o hello.s<br />
gcc version 1.39<br />
cc1_v1 hello.i -quiet -version -o hello.s<br />
GNU C version 1.27 (80386, BSD syntax) compiled by GNU C version 5.1.0.<br />
gcc_v1 -v -c hello.s -o hello.o<br />
gcc version 1.39<br />
as -o hello.o hello.s<br />
gcc_v1 -v -o hello hello.o<br />
gcc version 1.39<br />
ld -o hello C:/dos/xdjgpp.v1/lib/crt0.o hello.o -lc</p>
<p style="padding-left: 30px;">go32 version 1.12.maint3 Copyright (C) 1994 DJ Delorie</p>
<p style="padding-left: 30px;">hello from DJGPP v1/GCC 1.39!</p>
<p>Wasn&#8217;t that great?  Then going through my &#8216;test&#8217; programs I went to try to build the infocom interpreter, and that is when things went off the rails.</p>
<p style="padding-left: 30px;">funcs.o: Undefined symbol __udivsi3 referenced from text segment<br />
options.o: Undefined symbol __divsi3 referenced from text segment<br />
options.o: Undefined symbol __divsi3 referenced from text segment<br />
print.o: Undefined symbol __divsi3 referenced from text segment<br />
print.o: Undefined symbol __udivsi3 referenced from text segment<br />
support.o: Undefined symbol __divsi3 referenced from text segment<br />
gcc_v1: Program ld got fatal signal 1.</p>
<p>I&#8217;ve had some issues with GCC and these &#8216;built in&#8217; functions before.  This was an early major stumbling block back in the x68000 GCC days, where after a lot of searching I was able to find 68000 versions of various math routines that were in the native Hudson Soft assembler to link in.  While GCC 1.x does have a libgnu/gnulib to include these functions it warns you over and over to not use GCC to build them, but rather the native CC.  But the problem is that I don&#8217;t have a native CC.</p>
<p>But I managed to save myself after googling around by finding <a href="http://unix.superglobalmegacorp.com/386BSD-0.1/newsrc/arch/i386/stand/srt0.c.html">srt0.c</a> from 386BSD.  Namely these two:</p>
<pre>.globl ___udivsi3
___udivsi3:
	movl 4(%esp),%eax
	xorl %edx,%edx
	divl 8(%esp)
	ret

.globl ___divsi3
___divsi3:
	movl 4(%esp),%eax
	xorl %edx,%edx
	cltd
	idivl 8(%esp)
	ret</pre>
<p>I ended up having to removing a single underscore, but now I could link infocom, and even better it runs!</p>
<p>Wanting to try something far more exciting, I went ahead and tried to build DooM.  However, GCC 1.27 has an issue with m_fixed.c  I fired up GDB to at least take a look, although I&#8217;m not sure where the fault lies.</p>
<pre>FixedMul
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Breakpoint 1, 0x752c5ad5 in msvcrt!_exit () from C:\WINDOWS\System32\msvcrt.dll
(gdb) bt
#0 0x752c5ad5 in msvcrt!_exit () from C:\WINDOWS\System32\msvcrt.dll
#1 0x752bb379 in msvcrt!abort () from C:\WINDOWS\System32\msvcrt.dll
#2 0x0045805c in final (first=0xe066a0, file=0x75312688 &lt;msvcrt!_iob+128&gt;, write_symbols=NO_DEBUG, optimize=0)
at final.c:653
#3 0x00403198 in rest_of_compilation (decl=0x722718) at toplev.c:1296
#4 0x0040fbce in finish_function () at c-decl.c:3272
#5 0x004040c0 in yyparse () at c-parse.y:224
#6 0x0040239d in compile_file (name=0xe00def "C:/dos/xdjgpp.v1/tmp/cca02992.cpp") at toplev.c:837
#7 0x00403a33 in main (argc=11, argv=0xe00f90, envp=0xe01598) at toplev.c:1556
</pre>
<p>With the code being:</p>
<pre>#ifdef REGISTER_CONSTRAINTS
	    if (! constrain_operands (insn_code_number))
	      abort ();
#endif
</pre>
<p>So I assume some error with constrain operands? Not that it makes it any better.  However, I know this one file compiles fine with 1.39, and since we are on the i386 another alternative is <a href="https://sourceforge.net/p/crossdjgppv1/DooM/ci/master/tree/m_fixed_i386.s">just to use the assembly version</a> that was hiding in the readme..</p>
<p><div id="attachment_7558" style="width: 652px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2017/10/DooM-mostly-built-by-GCC-1.27.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7558" class="size-full wp-image-7558" src="https://virtuallyfun.com/wp-content/uploads/2017/10/DooM-mostly-built-by-GCC-1.27.png" alt="" width="642" height="427" /></a><p id="caption-attachment-7558" class="wp-caption-text">DooM mostly built by GCC 1.27</p></div></p>
<p>And much to my amazement, it works!  Keeping in mind that this is using an a.out tool chain, along with the last DPMI enabled GO32 extender.</p>
<p>Considering the compiler dates back from <a href="http://unix.superglobalmegacorp.com/cgi-bin/cvsweb.cgi/gcc/ChangeLog?rev=1.1.1.3;cvsroot=gcc1.x;only_with_tag=gcc-127">September 5th, 1988</a> it&#8217;s really great to see it running.</p>
<p>I&#8217;ll have to upload source (<a href="https://sourceforge.net/p/crossdjgppv1/gcc-1.27/ci/master/tree/">GCC 1.27</a>/<a href="https://sourceforge.net/p/crossdjgppv1/DooM/ci/master/tree/">DooM</a>) &amp; binaries later.  But I imagine it should also run on EMX/RSX for a Win32 version.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2017/10/08/gcc-1-27-ms-dos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Started to re-build my MS-DOS machine</title>
		<link>https://virtuallyfun.com/2017/09/02/started-re-build-ms-dos-machine/</link>
					<comments>https://virtuallyfun.com/2017/09/02/started-re-build-ms-dos-machine/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 01 Sep 2017 18:19:00 +0000</pubDate>
				<category><![CDATA[80386]]></category>
		<category><![CDATA[djgpp]]></category>
		<category><![CDATA[doom]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[go32]]></category>
		<category><![CDATA[i386]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=7272</guid>

					<description><![CDATA[Good news, it actually works! Â I was using the version 1.1 WAD, so honestly weird crashes really aren&#8217;t unexpected. Â I haven&#8217;t looked much at what to do with audio, but I was really impressed compared to the Qauake II wars, &#8230; <a href="https://virtuallyfun.com/2017/09/02/started-re-build-ms-dos-machine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><div id="attachment_7273" style="width: 1341px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2017/09/GO32-DooM-on-real-hardware.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7273" class="size-full wp-image-7273" src="https://virtuallyfun.com/wp-content/uploads/2017/09/GO32-DooM-on-real-hardware.jpg" alt="" width="1331" height="998" /></a><p id="caption-attachment-7273" class="wp-caption-text">DooM!</p></div></p>
<p>Good news, it actually works! Â I was using the version 1.1 WAD, so honestly weird crashes really aren&#8217;t unexpected. Â I haven&#8217;t looked much at what to do with audio, but I was really impressed compared to the <a href="https://virtuallyfun.com/2015/06/07/porting-quake-ii-to-ms-dos-pt3/">Qauake II wars</a>, it was really surprising to not only see DooM run on the first shot in real metal, but the keyboard works as well. Â Well enough for me to pick a level, and get killed.</p>
<p>Naturally it doesn&#8217;t work under Windows, however it runs fine with MS-DOS mode.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2017/09/02/started-re-build-ms-dos-machine/feed/</wfw:commentRss>
			<slash:comments>15</slash:comments>
		
		
			</item>
		<item>
		<title>Porting Catacomb3D to MS-DOS (DJGPP v1/GO32).</title>
		<link>https://virtuallyfun.com/2017/08/31/porting-catacomb3d-ms-dos-djgpp-v1go32/</link>
					<comments>https://virtuallyfun.com/2017/08/31/porting-catacomb3d-ms-dos-djgpp-v1go32/#respond</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Thu, 31 Aug 2017 13:25:22 +0000</pubDate>
				<category><![CDATA[djgpp]]></category>
		<category><![CDATA[DOSBox]]></category>
		<category><![CDATA[DPMI]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[i386]]></category>
		<category><![CDATA[mingw]]></category>
		<category><![CDATA[MS-DOS]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=7269</guid>

					<description><![CDATA[No really, it&#8217;s Catacomb 3-D: The Descent. Â First ported to 32-bit SDL by NotStiller. Â Me being the person I am, I fixed a slight bug regarding binary files on Windows, and MS-DOS, then cleaned up some of the C++ syntax &#8230; <a href="https://virtuallyfun.com/2017/08/31/porting-catacomb3d-ms-dos-djgpp-v1go32/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><div id="attachment_7270" style="width: 972px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2017/08/Catacomb-3-D-for-GO32.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7270" class="size-full wp-image-7270" src="https://virtuallyfun.com/wp-content/uploads/2017/08/Catacomb-3-D-for-GO32.png" alt="" width="962" height="627" /></a><p id="caption-attachment-7270" class="wp-caption-text">Catacomb 3-D for GO32</p></div></p>
<p>No really, it&#8217;s <a href="https://www.gog.com/game/catacombs_pack">Catacomb 3-D: The Descent</a>. Â First ported to <a href="https://github.com/NotStiller/Catacomb3D">32-bit SDL by NotStiller</a>. Â Me being the person I am, I fixed a slight bug regarding binary files on Windows, and MS-DOS, then cleaned up some of the C++ syntax (yuck!) making it far more C89 friendly. Â And of course, hot off the heels of <a href="https://virtuallyfun.com/2017/07/29/null-doom-gcc-1-39-go32-dpmi/">DooM for GO32 DPMI</a>, I was able to get it to build and run using GCC 1.39 and GO32.</p>
<p>I know most people really won&#8217;t care, but I found it kind of interesting. Â I should try to see if it&#8217;ll run on actual hardware, just as a comparison of tightly optimized Borland C++ / Assembly vs 100% pure C on DJGPP. Â The best tech of 1991 for sure!</p>
<p>At current I just put the source up, <a href="https://sourceforge.net/p/crossdjgppv1/Catacomb3D/ci/master/tree/">you can git it here</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2017/08/31/porting-catacomb3d-ms-dos-djgpp-v1go32/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Uploaded my cross DJGPP v1 environment to sourceforge</title>
		<link>https://virtuallyfun.com/2017/08/17/uploaded-cross-djgpp-v1-environment-sourceforge/</link>
					<comments>https://virtuallyfun.com/2017/08/17/uploaded-cross-djgpp-v1-environment-sourceforge/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Thu, 17 Aug 2017 04:22:06 +0000</pubDate>
				<category><![CDATA[djgpp]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[MS-DOS]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=7246</guid>

					<description><![CDATA[project is here. I also put up the source for my &#8216;null doom&#8216;, for anyone who ever needs some massaged source to DooM that will compile with a C compiler, instead of needing something that can understand C++ style comments, &#8230; <a href="https://virtuallyfun.com/2017/08/17/uploaded-cross-djgpp-v1-environment-sourceforge/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><a href="https://sourceforge.net/projects/crossdjgppv1/">project is here</a>.</p>
<p>I also put up the source for my &#8216;<a href="https://sourceforge.net/p/crossdjgppv1/DooM/ci/master/tree/">null doom</a>&#8216;, for anyone who ever needs some massaged source to DooM that will compile with a C compiler, instead of needing something that can understand C++ style comments, although I know in cccp.c there is the ability to turn onÂ cplusplus style processing. Â However since I did want something that would compile without altering the compiler (too much) I thought it was best to just change all the comments.</p>
<p>And a quick download link to the zip file with the source &amp; binaries.<br />
<a href="https://sourceforge.net/projects/crossdjgppv1/files/latest/download" rel="nofollow"><img decoding="async" src="https://a.fsdn.com/con/app/sf-download-button" alt="Download crossdjgppv1" /></a><br />
<a href="https://sourceforge.net/projects/crossdjgppv1/files/latest/download" rel="nofollow"><img decoding="async" src="https://img.shields.io/sourceforge/dt/crossdjgppv1.svg" alt="Download crossdjgppv1" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2017/08/17/uploaded-cross-djgpp-v1-environment-sourceforge/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Null DooM, GCC 1.39, GO32 and DPMI</title>
		<link>https://virtuallyfun.com/2017/07/29/null-doom-gcc-1-39-go32-dpmi/</link>
					<comments>https://virtuallyfun.com/2017/07/29/null-doom-gcc-1-39-go32-dpmi/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Sat, 29 Jul 2017 13:36:58 +0000</pubDate>
				<category><![CDATA[80386]]></category>
		<category><![CDATA[binutils]]></category>
		<category><![CDATA[cross compiler]]></category>
		<category><![CDATA[djgpp]]></category>
		<category><![CDATA[doom]]></category>
		<category><![CDATA[dos extenders]]></category>
		<category><![CDATA[DOSBox]]></category>
		<category><![CDATA[DPMI]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[i386]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=7231</guid>

					<description><![CDATA[phew. Around the time of the x68000 port of DooM, I was cutting down the DooM source for a null/portable version.  I never could get it to actually run either using EMX or DJGPP 1.03, as I couldn&#8217;t get it &#8230; <a href="https://virtuallyfun.com/2017/07/29/null-doom-gcc-1-39-go32-dpmi/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<hr />
<p>phew.</p>
<p><div id="attachment_7232" style="width: 972px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2017/07/DooM-via-DJGPP-v1-GO32.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7232" class="size-full wp-image-7232" src="https://virtuallyfun.com/wp-content/uploads/2017/07/DooM-via-DJGPP-v1-GO32.png" alt="" width="962" height="627" /></a><p id="caption-attachment-7232" class="wp-caption-text">DooM via DJGPP v1 GO32</p></div></p>
<p>Around the time of the <a href="https://virtuallyfun.com/2016/09/11/porting-doom-to-the-x68000/">x68000 port of DooM</a>, I was cutting down the DooM source for a null/portable version.  I never could get it to actually run either using <a href="https://virtuallyfun.com/2016/05/06/gcc-1-40-on-windows/">EMX</a> or <a href="https://virtuallyfun.com/2012/06/30/djgpp-1-00-saved-thanks-to-shovelware-cd-textfiles-com/">DJGPP 1.03</a>, as I couldn&#8217;t get it to link to save my life with a constant never-ending battle of unresolved symbols. After a while I just used what I had towards the x68000 version and concentrated on getting it up and running and just shelved the null/portable effort.</p>
<p>Later on I wanted to get it running again as part of messing with another cross compiler, as DooM isn&#8217;t a trivial application to port and verify correct operation. And in the process of trying to get the null version to build and run on Windows using TDM GCC, I wanted to make sure it at least kept compiling with GCC v1.x.</p>
<p>Once more again I was able to compile individual files but unable to link.  But this time, I just looked at the <a href="http://unix.superglobalmegacorp.com/cgi-bin/cvsweb.cgi/DJGPPv1/diffs/binutils.dif?rev=1.1.1.2;content-type=text%2Fplain;cvsroot=DJGPP;only_with_tag=MAIN">diffs for binutils</a>, I thought it should be somewhat easy to get hosted on Windows.  Although versions may point to binutils 1.0, I had to use <a href="https://www.mirrorservice.org/sites/sourceware.org/pub/binutils/old-releases/binutils-1.9.tar.bz2">binutils-1.9.tar.gz</a> even though the diffs are against Mar 24 1991, and the source for 1.9 is dated April 17 1991.</p>
<p>My first effort gave me a linker that would happily link, but go32 would either refuse to run the executable, or just crash.  I was going to give up again, but I found mention in another file that DJGPP actually uses the linker from G++, the C++ compiler which was a separate thing in the late &#8217;80s and early&#8217;90&#8217;s.  This time it worked, and I could link a trivial hello world style application!</p>
<p>Now that I finally had a cross linker actually working, I didn&#8217;t want to compile under emulation, so looking at the other diffs, they didn&#8217;t look too extensive. I went ahead ,and took DJGPP v1.06 and patched up the compiler &amp; assembler to get a full cross toolchain.  And in no time, I had a null version of DooM running on MS-DOS well at least tested on <a href="https://www.dosbox.com/">DOSBox</a>.</p>
<p>This was fun, and all but I didn&#8217;t see any easy way to do fun things like hook interrupts so I could get the keyboard &amp; clock like any good MS-DOS program.  <a href="https://en.wikipedia.org/wiki/DOS_Protected_Mode_Interface">DPMI</a> greatly eased this kind of stuff, so looking at the <a href="http://www.delorie.com/djgpp/history.html">DJGPP history</a>, DJGPP v1 <a href="http://unix.superglobalmegacorp.com/cgi-bin/cvsweb.cgi/DJGPPv1/docs/djgpp/new110.doc?rev=1.1.1.1;content-type=text%2Fplain;cvsroot=DJGPP;only_with_tag=djgpp111">version 1.10 actually adds preliminary DPMI support!</a>  And in the next version, DPMI was much more better supported, however the binary format had changed from <a href="https://en.wikipedia.org/wiki/A.out">a.out</a> to <a href="https://en.wikipedia.org/wiki/COFF">COFF</a> as part of <a href="http://unix.superglobalmegacorp.com/cgi-bin/cvsweb.cgi/DJGPPv1/docs/djgpp/new111.doc?rev=1.1.1.1;content-type=text%2Fplain;cvsroot=DJGPP;only_with_tag=djgpp111">the move to v1.11.</a> I was able to take the memory, and DPMI portions from the final v1.12 libc, and manually build and run them against the v1.06 library / dev tools.</p>
<p>And much to my surprise, it actually worked!  At least having the wrong format didn&#8217;t have any effect on how GO32 worked for me.</p>
<p>So, feeling lazy, I snagged some of the support code from <a href="https://bitbucket.org/maraakate/doomnew-for-dos/src/a6dd7b2813a9a94a9cefadcdf7a405ecf1bf220c/?at=djgpp">Maraakate&#8217;s revamp of DooM</a>, just to make sure of the timer code, and the keyboard code, and again verified that I can build with the keyboard &amp; timer <a href="https://en.wikipedia.org/wiki/Interrupt_handler">ISR</a> and I&#8217;m able to play the v1.9 shareware &amp; commercial levels fine.  I haven&#8217;t done a thing to clean up or update the DooM source itself against all the dozens of bugs and issues with Ultimate DooM, or other games like <a href="https://virtuallyfun.com/2014/04/28/chex-quest/">Chex Quest</a> etc.</p>
<p>I&#8217;m sure 99% of people wouldn&#8217;t care but you can download it here:</p>
<p><a href="http://vpsland.superglobalmegacorp.com/install/Win32/Win32_DJGPPv1_DooM.7z">Win32_DJGPPv1_DooM.7z</a><br />
<a href="https://sourceforge.net/projects/crossdjgppv1/files/latest/download" rel="nofollow"><img decoding="async" src="https://a.fsdn.com/con/app/sf-download-button" alt="Download crossdjgppv1" /></a></p>
<p>Although I&#8217;m using DPMI to drive real-time events, if I looked further at the GO32 v1.06 environments I could either figure out how it operates it&#8217;s timer or modify the extender directly to drive the PIC timer and keyboard as I need.  But overlooking that, the vintage 1991 software is more than capable of running DooM.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2017/07/29/null-doom-gcc-1-39-go32-dpmi/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
