As requested, PCem v11 with networking

via SLiRP

via SLiRP

injecting networking was no more difficult than it was in version 10.  It’s only a few changes to pc.c, if you look at the USENETWORKING define you’ll see them.  The best notes are on the forum.

I haven’t changed or improved anything it still requires manual configuration.

Downloads are available on my site as pcem_v11_networking.7z.  You’ll have to defeat the password protection, as always.  I included the source, it ought to be trivial to rebuild.

*For anyone using an old version the ‘nvr’ directory is missing, so PC-em is unable to create new non volatile ram save files, meaning you always loose your BIOS settings.  Sorry I missed that one.

PCem v11 released

I haven’t had time to follow it, but great news!

PCem v11 released. Changes from v10.1 :

  • New machines added – Tandy 1000HX, Tandy 1000SL/2, Award 286 clone, IBM PS/1 model 2121
  • New graphics card – Hercules InColor
  • 3DFX recompiler – 2-4x speedup over previous emulation
  • Added Cyrix 6×86 emulation
  • Some optimisations to dynamic recompiler – typically around 10-15% improvement over v10, more when MMX used
  • Fixed broken 8088/8086 timing
  • Fixes to Mach64 and ViRGE 2D blitters
  • XT machines can now have less than 640kb RAM
  • Added IBM PS/1 audio card emulation
  • Added Adlib Gold surround module emulation
  • Fixes to PCjr/Tandy PSG emulation
  • GUS now in stereo
  • Numerous FDC changes – more drive types, FIFO emulation, better support of XDF images, better FDI support
  • CD-ROM changes – CD-ROM IDE channel now configurable, improved disc change handling, better volume control support
  • Now directly supports .ISO format for CD-ROM emulation
  • Fixed crash when using Direct3D output on Intel HD graphics
  • Various other fixes

Thanks to Battler, SA1988, leilei, Greatpsycho, John Elliott, RichardG867, ecksemmess and cooprocks123e for contributions towards this release.

Downloads are available for Windows & Linux.

Porting Quake II to MS-DOS pt4

Bringing it all home for release day.

Bringing it all home for release day.

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:

* 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.

You can download Quake II for MS-DOS on bitbucket.  And as always the source is available here.

Don’t forget you can always make bootable USB stick with DOS, or CD-ROMs.

Continued in Part 5!


PCem v9

PCem v9

From the main page:

PCem v9 released. Changes from v8.1 :

  • New machines – IBM PCjr
  • New graphics cards – Diamond Stealth 3D 2000 (S3 ViRGE/325), S3 ViRGE/DX
  • New sound cards – Innovation SSI-2001 (using ReSID-FP)
  • CPU fixes – Windows NT now works, OS/2 2.0+ works better
  • Fixed issue with port 3DA when in blanking, DOS 6.2/V now works
  • Re-written PIT emulation
  • IRQs 8-15 now handled correctly, Civilization no longer hangs
  • Fixed vertical axis on Amstrad mouse
  • Serial fixes – fixes mouse issues on Win 3.x and OS/2
  • New Windows keyboard code – should work better with international keyboards
  • Changes to keyboard emulation – should fix stuck keys
  • Some CD-ROM fixes
  • Joystick emulation
  • Preliminary Linux port

Thanks to HalfMinute, SA1988 and Battler for contributions towards this release.

Very excellent!

8086tiny de-obfuscated!

I came across this site, which is from the author of the winning IOCCC entry, 8086tiny!

It’s ballooned from just under 4kb to 28kb, but still incredibly tiny!

For anyone interested it’s features:

  • Highly accurate, complete 8086 CPU emulation (including undocumented features and behavior)
  • Support for all standard PC peripherals: keyboard, 3.5″ floppy drive, hard drive, video (Hercules/CGA graphics and text mode, including direct video memory access), real-time clock, timers, PC speaker
  • Disk images are compatible with standard Windows/Mac/UNIX mount tools for simple interoperability
  • Complete source code provided (including custom BIOS)

It’s worth checking out for some old time PC/XT nostalgia!

Qemu 1.7.0 released!

The main qemu page hasn’t been updated yet, but the download page has the source to the new version of Qemu.

I’ve gone ahead and built binaries for OS X, both a full version, and  a i386 minimal version.

As always testing is very minimal, all I’ve done is installed MS-DOS 6.22 & Doom 1.1, and tested the SoundBlaster 16 emulation.  And as with the pre-release versions, the adlib code is still broken.  And Ive done the ‘better’ fix in this code regarding that.

I haven’t run anything else, including fun things like the PowerPC & OS X emulation, MIPS with Windows NT, or even trying anything x64 based as I’m sure it is still broken from back in the Qemu 0.90 days.

Found an old ad for 86-DOS

Seattle 86 Ad

8 Mhz. 2-card CPU Set
With our 2-card 8086 CPU set you can upgrade your Z80 8-
bit S-100 system to run three times as fast by swapping the
CPUs. lf you use our 16-bit memory, it will run five times as
fast. Up to 64K of your static 8-bit memory may be used in the
8086’s 1-megabyte addressing range. A switch allows either 4
or 8 Mhz. operation. Memory access requirements at 4 Mhz.
exceed 500 nsec.
The EPROM monitor allows you to display, alter, and
search memory, do inputs and outputs, and boot your disk.
Debugging aids include register display and change, single
stepping, and execute with breakpoints.
The set includes a serial port with programmable baud rate,
four independent programmable 16-bit timers (two may be
combined for a time-of-day clock), a parallel in and parallel out
port, and an interrupt controller with 15 inputs. External power
may be applied to the timers to maintain the clock during
system power-off time. Total power: 2 amps at + 8V, less than
100 mao at + 16V and at -16V.
86-DOS@>, our $195 8086 single user disk operating
system, is provided without additional charge. It allows
functions such as console 1/0 of characters and strings, and
random or sequencial reading and writing to named disk files .
While it has a different format from CPIM, it performs similar
calls plus some extensions (CP/M is a registered trademark of
Digital Research Corporation). Its construction allows relatively
easy configuration of 1/0 to different hardware. Directly
supported are the Tarbell and Cromemco disk controllers.
The 86-D08@> package includes an 8086 resident assembler,
a Z80 to 8086 source code translator, a utility to read
files written in CPIM and convert them to the 86-DOS format, a
line editor, and disk maintenance utilities. Of significance to
Z80 users is the ability of the translator to accept Z80 source
code written for CPIM, translate this to 8086 source code,
assemble the source code, and then run the program on the
8086 processor under 86-D08. This allows the conversion of
any Z80 program, for which source code is available, to run on
the much higher performance 8086.
BASIC-86 by Microsoft is available for the 8086 at $350.
Several firms are working on application programs. Call for
current software status.
All software licensed for use on a single computer only.
Non-disclosure agreements required. Shipping from stock to
one week. Bank cards, personal checks, CODs okay. There is
a 10-day return privilege. All boards are guaranteed one year
– both parts and labor. Shipped prepaid by air in US and
Canada. Foreign purchases must be prepaid in US funds.
Also add $10 per board for overseas air shipment.
8/16 16-BIT MEMORY
This board was designed for the 1980s. It is configured as
16K by 8 bits when accessed by an 8-bit processor and
configured 8K by 16 bits when used with a 16-bit processor.
The configuration switching is automatic and is done by the
card sampling the “sixteen request” signal sent out by all S-
100 IEEE 16-bit CPU boards. The card has all the high noise
immunity features of our well known PLUS RAM cards as well
as “extended addressing”. Extended addressing is a replacement
for bank select. It makes use of a total of 24 address lines
to give a directly addressable range of over 16 megabytes.
(For older systems, a switch will cause the card to ignore the
top 8 address lines.) This card ensures that your memory
board purchase will not soon be obsolete. It is guaranteed to
run without wait states with our 8086 CPU set using an 8 Mhz.
clock. Shipped from stock. Prices: 1-4, $280; 5-9, $260; 10-up,

~Seattle (amputer Products, Inc. ~ 1114 Industry Drive, Seattle, WA. 98188
(206) 575-1830


The ad is from December of 1980, and of course the PC was released in August of 1981… Its interesting to see even back then there was some clear partnering with Microsoft!

Final Fantasy VII re-released for the PC

Not to shill too hard for it, but it is for sale for 10 euros, or 8 pounds sterling..  I should hope that this 1997 classic should work on modern PCs.. Which has been a pain for anyone whos owned this when it originally came out for the PC.  Although as far as I can tell this doesn’t add anything from the original version … Other than some click to cheat thing but.. There you go.

Windows 3.0 …

Bill Gates with Windows 3.0 / credit:Carol Halebian

There is no denying it, when it comes to revolutionary products you simply cannot ignore the powerhouse that was, Windows 3.0 .  Simply put this is what made the Microsoft empire, broke the alliance with IBM, and changed the future of OS/2 3.0.

Not only that, but Windows 3.0 changed the way businesses operate world wide, and finally delivered on the ‘dream’ of what could be done with the 286/386 microprocessor where OS/2 had failed.

To really appreciate Windows 3.0 you have to see the world as it was before it was under development.  Back in 1989 the pc market was in turmoil.  While OS/2 had the promise of breaking all the old barriers of the real-mode only OS MS-DOS, it simply cost too much, and hardware compatibility was just too poor.  The other striking thing was that the only 386 specific feature that OS/2 1.2 (current version in 1989) could exploit was that the 386 could quickly move in & out of 286 protected mode.  The LAN server product also had a 386 specific HPFS driver, but that was it.  OS/2 1.2 was still limited to a SINGLE MS-DOS box.

OS/2 1.2’s DOS session

And there wasn’t a heck of a lot you could do memory wise.  Not to mention there was no ability for the DOS session to use EMS/XMS memory.  It’s no wonder it became to be known as the ‘penalty box’.

Meanwhile, Windows/386 circa 1987 could run multiple MS-DOS VDM’s on the 386 processor.  You were only limited by how much extended memory was in your system.  Windows/386 exploited the v86 mode of the 386 processor which allowed for hardware virtualization.  However Windows itself was a ‘real mode’ program, meaning that it had to fit in 640kb of ram, just as the VDM’s it spawned had to.

Windows/386 2.11

So unless your goal was to run a bunch of MS-DOS sessions all your extra memory was for nothing.  That also included Windows programs since they all ran in real mode.  For people with enough disk space you *could* actually install one copy of Windows/386 in say VGA, then another with a lower video resolution (CGA or EGA), then actually run Windows in Windows… in a Window.  But it really wasn’t that useful, it ran better full screen.  And all this had the effect of doing was partitioning your windows programs from each other, if you dedicated a VM per application.  Needless to say with OS/2 2.0’s seamless windows this was far more easier to setup, and frankly far more practical.

In 1989 building large applications meant that you either forced people to use Unix (SCO Xenix!) or OS/2.  For those that could afford it, Xenix would have been the way to go, as they not only ran in 386 protected mode, offered a far larger address space, but it was also multiuser!  But Xenix was expensive, needed specialized knowledge.  And as mentioned the cost of OS/2 development was HIGH, and it required your end users to have OS/2 (naturally).  And the users would have to fight that a lot of PC/AT compatible PC’s on the market were not compatible enough to run OS/2.  Despite this a lot of banks latched onto OS/2, and some still use it today (look at why parallax came into existence!).  Then out of nowhere, PharLap had developed a piece of software that changed everything, the DOS Extender.

Originally for 386 computers, the first DOS extenders required people to use special 386 compilers, runtimes, and of course linkers & extenders.  The tools were expensive, the right to redistribute wasn’t free, but end users could run your multi-megabyte (lol) applications on regular MS-DOS.  Which is what 99% of PC’s were running, and it didn’t require users to change their OS, abandon their applications, it would simply just work.

Links 386 pro

One of the earliest and most popular DOS Extended game/application was Access Software’s Links 386 pro.  That’s right this game ran in protected mode! .. And it would *NOT* run under, or near Windows/386.

It was out of this wildly great but incompatible world that the first DOS Extender vendors, tried to standardize their products with the original and short lived VCPI specification, from Phar Lap.  However in 1989 Microsoft was busy working on Windows 3.0 as the next great thing.  Using a protected mode debugger, they were converting Windows/386 from a real mode ‘hypervisor’ into a protected mode application.  And if Windows couldn’t run these new extended applications, then people would naturally have to exit Windows to run them.  And that was the major problem with Windows is that people may have an application for windows but they spent most of their time in DOS. So Microsoft’s Ralph Lipe came up with the DPMI specification, managed to get all of the major vendors to support and take over it, in exchange for leaving Windows as a 0.9 level client/server.  After all why would you need their products if Windows were to incorporate the entire 1.0 spec?  At the time it was a big deal, but the success of Windows would eventually kill the extender market save for video games until Windows 95.  There is a great article about the rise of DPMI here.

So with a firm dos extended foundation Windows 3.0 could do something the 2.x products could never do, which was to actually utilize all the memory in peoples computers.  And because it hinged on a dos extender (ever wonder what dosx.exe was?) it meant that there was no special disk, mouse, network driver/software needed as it could jump out of protected mode, and call real mode software like the BIOS, or even mouse drivers if need be.  However older protected mode programs would only error like this:

No Lotus 1-2-3 r3 for you!

Another popular application for MS-DOS just happened to be Lotus 1-2-3, and it was *NOT* DPMI compliant.  Oh sure they had DOS & OS/2 support, but would you believe that the OS/2 version wouldn’t run in a Window?  Oh sure the install program may have, but some how someone didn’t think there would be any value in being able to SEE more then one application at a time.  Not to mention the dark horse, Excel was starting to sell in 1987 like crazy, in 1988 Excel actually started to out sell 1-2-3, and by 1989 it was already over.

Lotus 1-2-3 r3 for OS/2

Microsoft Excel 2.2 for OS/2

There is no doubt about it, GUI applications were taking over.  The old ‘DOS’ interface was dead.  And Lotus had basically killed their product line by providing an identical interface and experience to their customers by providing an OS/2 application that looked and felt just like the MS-DOS application.  While you may hear that Lotus got distracted with OS/2 and missed releasing a Windows version of 1-2-3 to counter the rise of Excel, the truth is that they straight up missed windowing UI’s. Their hubris is that the users simply didn’t like the 1-2-3 interface, they wanted a windowed application.

What they did want was graphical Windows, and of course more memory!  And there is nothing more annoying than having say 16MB of VERY expensive memory in a computer like a 286, but being restricted to 640kb or less is just … insane.

So let’s see Excel in action.  Excel 2.1c shipped with a ‘runtime’ version of Windows 2.1.  Mostly because nobody was buying Windows in 1987 Microsoft had to do something to get people running the thing.  So the best way was to allow you to run an application with it.  By late 1989 and early 1990 application vendors were making updates to their products so that they could run under Windows 3.0.  And here is the first version of Excel to do so.

Excel 2.1c and the Windows 2.1 runtime

So here we have Excel running under Windows 2.1 ala the runtime environment.  All you have here is excel.  Also worth noting is that the setup program is 100% DOS text based.

Moving forward we can now upgrade to Windows 3.0.

Excel 2.1c running on Windows 3.0’s real mode

So as you can see Windows 3.0 takes up 30kb more memory then Windows 2.1!  For someone with an XT this could mean bad news!  Now it’s time to see what all the babling was about, running the same application in protected mode to access more memory!

Excel 2.1c running in Windows 3.0’s standard mode (286 and above)

Now we are running in 286 ‘standard’ mode.  Notice that Excel thinks it’s conventional memory, but we now have 14MB of the computers installed 16MB accessible to the application!  Now this is pretty amazing stuff! Now it’s no secret that the 286’s memory management left a lot to be desired, and Microsoft really didn’t want to write for it, as the 386 was where they wanted to be.  So unlike OS/2 the 286 cannot swap.  You are only limited to what extended memory you have in your computer.  But this is different for the 386..

Excel 2.1c running under 386 enhanced mode

And here we are, 386 enhanced mode! So finally  our Windows applications are clearly running in protected mode, with demand paging!  With 36MB of available memory in a computer with 16MB of ram.  The colors are distorted on Virtual PC under 386 enhanced mode… But as you can see the environment runs!  And even graphical programs that for example used CGA could happily run on an EGA system in a window.  Even better you could copy the screen, and paste it into any Windows application you want.  Yes you could buy games and use them for clipart!

Another feature of Windows 3.0 that people didn’t realize is that it could pre-preemptively multitask DOS based VDM’s

As you can see, there it is, the timeslice, and scheduling options..  Great ways to confuse users for decades… 🙂

Who could resist?

As always, there is a great InfoWorld article here.

So why was Windows 3.0 successful? A lot of it is timing, as there was no other environment that could offer people access to their whole machine without upgrading their operating system.  And of course there was the whole thing with bundling Windows, Word & Excel with new computers.  I mean who would resist something like a graphical application like Excel when compared to the klunky and significantly more expensive 1-2-3?  Sure the bundling practices were found to be illegal, but looking back, Lotus & Word perfect basically GAVE Microsoft the market.  And of course, talk about aggressive upgrades!  I’m not sure they even do such things anymore.  Although I’ve heard of big companies, and governments pushing for discounts for running things like Linux.

And there is the other things that Windows 3.0 supported that OS/2 simply did not.  For starters backgrounds (wallpapers), and of course the desk accessories.  Sure they sucked but in a panic at lest you *could* do something… where OS/2 basically left you in the lurch.  Not to mention how much more expensive OS/2 was when compared to Windows.

So with all that out of the way, what fun is a write up without a demo?


And thankfully I’ve found all the bits in prior posts, and I can put them together right here.

Windows 3.0 working demo, click to launch!


Retro: a PC/XT emulator

A friend of mine just pointed me to Retro, a PC/XT emulator written in Java.

It’s got a few games ready to roll, which is cool. While not a full featured as dosbox, it does feel significantly smaller, compared to jdosbo’s 2mb image. And since it’s browser based, it’s not like it’s all that difficult to check out.