VOGONS


First post, by vorvek

User metadata
Rank Newbie
Rank
Newbie

I don't know where to post about this, I hope this is the right forum. I recently released a virtual cdrom driver for DOS that emulates CD-audio, kind of. I followed the SBEmu route, and used port trapping to mix the uncompressed audio from a .bin file into the stream of audio from an application. I made it this to solve a personal problem, as I seem to find only failing cd-rom drives that die on me after a few months or are too weak to read games consistently, or simply work poorly with CD-R. Or I'm trying to play an original disc that's scratched.

Anyway, here it is working with Quake in an Athlon 600:
https://youtu.be/d03dErJ5VU8

It also has multi-disc support with an image list file (one image location per line) that can then be accessed with ctrl+alt+1 to ctrl+alt+0. Max 10 images, but more than enough for The 7th Guest or Phantasmagoria.

The driver in question is released under GPL3 and can be found here: https://github.com/vorvek/uCDD

The video is a slightly older version, but size is similar. The driver takes around 8KB of conventional memory, ~30KB of UMB and loads most stuff in XMS. It requires a driver that can do port trapping, I developed it with JEMMEX as a base, but extended it to use HIMEM/EMM386. I think 386MAX is also compatible, as it seems to use an extended EMM386 API, or something very similar. I can't vouch for other EMM drivers. Of course, JEMM itself works too if you don't want to use the whole JEMMEX package.

Anyway, I developed it under my own toy emulator and 86box. I've only been able to test it in the Irongate Athlon 600 I have with me, with a few games (Quake, Tomb Raider, Screamer...). I'm sure there may be some games that don't work, or some combination of hardware where it doesn't work either. I probably wouldn't use it in anything slower than a Pentium.

The driver was originally written for SB16 and WSS, I extended it to work with SBPro and SB1.0/1.5/2.0. It taps the port and DMA you set in the BLASTER variable, alongside 530 for WSS. It requires setting the output with UCDDSET. It does sample rate conversion (so, if you have a SBPro it outputs Redbook audio at 22.05khz in stereo instead of 44.1khz in mono, for example) and it also traps the keyboard interrupts, to allow changing discs.

I will mention, I did get help from ChatGPT on various parts of the driver, as some people may have issues with that.

Reply 1 of 7, by davidmorom

User metadata
Rank Newbie
Rank
Newbie

This is a very interesting project! I've been doing some testing and I found the following results.

I did the tests on both 86Box (several machine configurations) and a MVP3 Socket 7 with an AMD K6-2 at 400MHz, 128MB and a SB16 Vibra16 CT4180. For the software I used MS-DOS 6.22 and Windows 9x DOS mode, with MSCDEX and SHSUCDX, HIMEM.SYS and EMM386.EXE. I got basically the same results in all cases.

Real mode games seem to work pretty well. I tested the CD versions of Loom and Monkey Island 1 and they seem to be perfectly playable. Only for this, this is a great project.

For 32 bits protected mode games the history is totally different. I was only able to get Quake working (which uses CWSDPMI.EXE), and although the demo mode works pretty good, navigating trough the menus makes the computer reboot randomly. But the main problem is with DOS/4GW games, I tested Tomb Raider and Carmagedon, and after running the installer or the main executable, the DOS/4GW banner is displayed, the computer hangs for several minutes and finally shows an error about being unable to access the CD-ROM or loading the executable.

How did you manage to get Tomb Raider and Screamer working? Maybe I'm miss configuring something, but I tested everything that came to my mind. I also tried with JEMMEX, JEMM386 and 386MAX, but I always get the message "The memory manager rejected the port-trap request" when trying to load the driver.

Thanks for your work!

Reply 2 of 7, by vorvek

User metadata
Rank Newbie
Rank
Newbie

Thank you for giving it a try!

I had gone away from the driver for a couple of days and there were way more failures left than I expected!

When it comes to JEMMEX, it only works (worked) with 5.86; 5.87pre1 changes the callback interface, so it wasn't compatible. I've added support for that version too.

I tested with Tomb Raider again, and it didn't work for me either. I think I may have broken it when I was trying to get the driver's memory footprint smaller, should have re-checked.
I've fixed the issue (A20 corruption and stack failure caused by interrupt re-entry) and Tomb Raider worked again. Then I went through another bunch of games looking for different DPMI hosts and found a whole lot of problems.

- Carmageddon (DOS4GW) had Redbook audio but not sfx because it uses a 3840 byte audio ring and uCDD required a power of two size. I removed the requirement and that fixed it, but then DOS4GW complained about an invalid opcode in the sound driver.
- Archimedean Dynasty (Causeway 3.25) loaded but then crashed in the menu, then I got the music working but again no SFX. Here the problem was a byte read from the DSP reset port that the driver had no handler for. Now it behaves correctly.
- Quarantine (w/DOS32A), Rayman (PMODE/W) and Street Fighter II Turbo (Borland 32RTM) exposed other issues that I still need to fix.

The 0.9.1 beta release is available here: https://github.com/vorvek/uCDD/releases/tag/v0.9.1 Other games I have not tested that weren't working may now work, too.

Reply 3 of 7, by vorvek

User metadata
Rank Newbie
Rank
Newbie

I found another problem while testing Archimedean Dynasty under Microsoft EMM386. Its port-trapping API cannot trap ports below 100h, which includes the DMA controller registers. When the game and uCDD share the physical 16-bit DMA channel, the game can overwrite uCDD’s DMA settings. In my test, this caused clicks and then a crash. SBEMU faces a very similar issue, and I don't really think there's a good way of solving it in the driver itself. So, the two workarounds:
* The same shared-DMA setup works under JEMMEX.
* With EMM386, using physical DMA 7 for uCDD and virtual DMA 5 for the game avoided the menu audio failure. uCDD’s settings in UCDDSET must match the physical card’s actual configuration. The game should instead match the virtual settings in BLASTER, which must be set before installing uCDD. Both audio streams still play through the same card.

In any case, I've corrected the interrupt timer after STI which had a problem in the previous versions, and made a couple of changes to the entry stack allocation. Latest version is here: https://github.com/vorvek/uCDD/releases/tag/v0.9.1a

Reply 4 of 7, by davidmorom

User metadata
Rank Newbie
Rank
Newbie

Great work! Now Quake doesn't reboot, and Tomb Raider and Carmageddon seems to be working quite well. I found issues with the following games:

  • Screamer, Screamer 2 and Screamer Rally: the three games ask for the CD just before reaching the main menu. Screamer 1 has an attract mode that seems to work fine, but after that it asks for the CD.
  • Pro Pinball The Web and Timeshock: both games show the message "error initialising cdrom routines" just after launch.

Reply 5 of 7, by vorvek

User metadata
Rank Newbie
Rank
Newbie

Thanks for testing!

The Screamer games stopped working because I was sending a valid-in-practice 26-byte READ LONG packet through MSCDEX function 1510h; uCDD insisted on 27 bytes and returned 810Ch (“bad request length”). It was a small fix, but exposed a different issue that made loads take a long time (even though the game itself run fine). When loading for the first time, these games malloc/free bigger and bigger memory chunks to see how much RAM they have available. The DPMI host uCDD used run on 4KB pages that it asked the EMM handler each time, so it was painfully slow, and the more memory, the worse it got. I tested in my Athlon 600 with 512 megs of RAM and it took nearly three minutes to move from the DOS4GW prompt to the attract demo. It's now fixed too, with a reusable pool of VCPI pages. This also works with JEMM/JEMMEX.

Pro Pinball failed because uCDD's DPMI host was missing a particular behavior. The games use INT 31h, AX=0300h with two protected-mode stack words, and the uCDD rejected any nonzero stack copy.

So, those 5 games now also work under uCDD!
Updated version is here: https://github.com/vorvek/uCDD/releases/tag/v0.9.1b

Reply 6 of 7, by MarmotaArmy

User metadata
Rank Newbie
Rank
Newbie

HI , this project is super interesting, thanks!
I know it's in early stages , do you have a guess of system requirements for a smooth operation? you think a 486 o 386 could handle the load?

Reply 7 of 7, by vorvek

User metadata
Rank Newbie
Rank
Newbie

At the moment I only have my Athlon 600 for testing, so I can't be sure, but I imagine a Pentium or thereabouts probably make a good baseline, since simply streaming audio takes around 800KB/s.