VOGONS


SBEMU: Sound Blaster emulation on AC97

Topic actions

First post, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

Hi, I'm happy to announce that SBEMU is ready for more tests. 😁

Purpose: for PCs with AC97/Intel High Definition Audio sound cards that doesn't have Sound Blaster support (vintage PCs after 2000 era, or modern PCs with HDA).
Supported PCI soundcards:

  • Intel ICH
  • nForce (nForce2 tested working)
  • Intel High Definition Audio
  • VIA VT8233 & VT82C686
  • SB Live/Audigy (thanks to Baron von Riedesel for debugging)

Emulated cards: SB 1.0, 2.0, Pro, 16, 8 bit DMA & 16 bit DMA.
Notes: All on chip AC97 mother boards including Intel ICH and nForce both will reported as ICH. And it doesn't report the actual codec (e.g. realtek), but only the board (ICH). For HDA codec its the same.

Supported both real mode and protected mode games. Requirements:
HDPMI32i is needed for protected mode support, which is included in the zip file.
QEMM or JEMM is needed for real mode support. JEMMEX is included in the zip. It's optional, SBEMU can run without it and so without real mode support.

For more information, read the readme.txt in the zip and use /? in the command line.

Thanks to:

  • MPXPlay's: sound card drivers
  • DOSBox: DBOPL emulation
  • HDPMI & JEMM: Port traps
  • Folks in the forum that helped guiding & testing & improving the emulation

The original discussion can be found here: Possibility to write OPL3 sound driver for protected mode games, which initially intended for RetroWave OPL3 but then led to a pure soft emulation of SB & OPL.
The source code of SBEMU can be found here: https://github.com/crazii/SBEMU

Thanks to Brun128, here's a compatibility list of reported hardware:
SBEMU compatibility reports list | Navigation thread

Known issues: some games might not work properly, need more tests & improvement. 16 bit protected mode games are not supported - this remains a challenge so far.
Some games prefer VCPI over DPMI, need use "JEMMEX NOVCPI" AFTER loading HDPMI, or remove QEMM/JEMM and run the system without VCPI (also no real mode support).
Use /t6 to enable SB16 emulation.
Use /i5 to change the virtual IRQ if you get an IRQ conflict error, or adjust IRQ assignment in the BIOS.
Any suggestion and bug report are welcomed.

1.0 Beta3(latest):
Merge commit from HDPMI: add -x[n] option to limit memory further, -x1 limit mem to 128MB, -x2 limit mem to 64MB. this may help some games that do work with large memory. - thanks to @Baron von Riedesel.
Remove debug message for HDPMI.
Fix Epic Pinball sound spedup.
Add delay to DSP command 0Fh (IRQ request) to make Dynablaster work, and potentially other games.
Add DSP commands: 0E4h/0E8h (test read/write), 0E2h (DMA id), 045h (continue auto DMA).
Fix /Tn bug, /t2 as SBPro, instead of SB2.0. Thanks to @jtchip
Bugfix on VIA VT8233/8235/8237

Filename
SBEMU 1.0beta3.zip
File size
219.55 KiB
Downloads
1895 downloads
File license
CC-BY-4.0

1.0 Beta2c:
Add "/R" option to reset sound card driver, in case the soundcard is touched by other utilities.
Add SB direct mode handling (non-DMA, DSP command 10h) previously requested by @Bondi. tested game: Shanghai 2 - experimental, may have noises.
Bugfix on BLASTER env set. (seen on FreeDOS or MSDOS prior to 7.0)
Set power states for Intel HDA, fix compatibility issues for some PCs.
Bugfix on volume settings, disable mixer resetting on DSP resetting, make volume consistent among games and can be set properly by SB utilities.
Hack: double the "volume" of OPL so that it sounds near to the digital volume.
Other bugfixes that may fix functionality or improve stability.

Filename
SBEMU 1.0beta2c.zip
File size
202.12 KiB
Downloads
422 downloads
File license
CC-BY-4.0

1.0 Beta2b:
Fix SB Live/Audigy interrupt.
Add option "/SCL" to list sound cards, use "/SC[n]" to select sound card.
Experimental: adjust sound buffer to reduce latency. (1/8 to original).
This is a single binary of SBEMU. You need HDPMI32i and JEMMEX in the 1.0 Beta2 zip.

Filename
SBEMU1.0beta2b.zip
File size
201.33 KiB
Downloads
529 downloads
File license
CC-BY-4.0

1.0 Beta2:

Filename
SBEMU.zip
File size
252.79 KiB
Downloads
921 downloads
File license
CC-BY-4.0
Last edited by crazii on 2023-11-17, 09:57. Edited 10 times in total.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 3 of 1248, by zyzzle

User metadata
Rank Member
Rank
Member

Your latest revison of SBEMU works nearly perfectly now! All the problems I reported in the other thread have nearly magically disappeared. Real mode Apogee games work perfectly now with digital sound (ADPCM support was the ticket to success). No more stuttering audio in some games. I even got NFS to work reliably now. It's 95% playable (slight keyboard problems remain) with SB16 sound now, which is a kind of holy grail. The only game out of all those I listed before that still doesn't work with digital sound is Monster Bash. It only has clicks for the digital sound, which is an improvement over before, when no clicks were even heard.

Your SBEMU program is so important and epoch-changing that it makes DOS cool again. We may now play the old games baremetal and eschew emulators (DOSBOX) or virtual machines and get back to real, fast hardware without 3 and 4 abstraction layers slowing things down.

The sad part is: most very new systems have been intentionally castrated by Intel and Microsoft. All legacy DOS support has been brutally and viciously removed, with only UEFI 64-bit .EFI support and no 16-bit legacy support or video BIOS / legacy VGA mode support, since 2017-18.

I think about the fastest modern system we'll see able to run SBEMU natively is a 9th or 10th gen Core i9 system. Everything beyond that will sadly be impossible outside of an emulation / VM due to the terrible decision made by Intel and Microsoft to delete BIOS legacy code.

Reply 4 of 1248, by BitWrangler

User metadata
Rank l33t++
Rank
l33t++

Awesome, got some older newer laptops which will benefit from this. I'm "into" other projects/eras at the moment though, will have to revisit.

Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.

Reply 5 of 1248, by rasteri

User metadata
Rank Member
Rank
Member
zyzzle wrote on 2023-03-05, 15:56:

I think about the fastest modern system we'll see able to run SBEMU natively is a 9th or 10th gen Core i9 system. Everything beyond that will sadly be impossible outside of an emulation / VM due to the terrible decision made by Intel and Microsoft to delete BIOS legacy code.

Any idea what CPU/chipset is the last one with a normal BIOS?

Reply 7 of 1248, by cyclone3d

User metadata
Rank l33t++
Rank
l33t++
rasteri wrote on 2023-03-05, 17:23:
zyzzle wrote on 2023-03-05, 15:56:

I think about the fastest modern system we'll see able to run SBEMU natively is a 9th or 10th gen Core i9 system. Everything beyond that will sadly be impossible outside of an emulation / VM due to the terrible decision made by Intel and Microsoft to delete BIOS legacy code.

Any idea what CPU/chipset is the last one with a normal BIOS?

A lot of the newer Dell laptops have Legacy(BIOS) and UEFI boot modes.

As long as the BIOS has the legacy boot mode, you should be able to use DOS on it though you are going to be stuck using PCIe to PCI adapters in order to get stuff like 3dfx cards and VESA video modes working.

What would be cool is if FreeDOS was actually updated to support UEFI boot and also bug fixed to fix other issues that have apparently been around forever.

Yamaha modified setupds and drivers
Yamaha XG repository
YMF7x4 Guide
Aopen AW744L II SB-LINK

Reply 9 of 1248, by Jo22

User metadata
Rank l33t++
Rank
l33t++
cyclone3d wrote on 2023-03-05, 19:00:

What would be cool is if FreeDOS was actually updated to support UEFI boot and also bug fixed to fix other issues that have apparently been around forever.

All it needs is some sort of modified, self-bootable EMM386.. It could intercept/trap all DOS BIOS calls and hw bit-banging attempts and translate them to UEFI.
Speaking of, wasn't 386Max source code just recently released?

ArcaOS, that ecomstation successor, seems to support UEFI boot by now, too.
Unfortunately, there's no free demo version available to check that out.

Edit: A modified version of PC-MOS/386 would also be an alternative.
By design, it can already virtualize certain graphics modes and i/o..

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 10 of 1248, by Bondi

User metadata
Rank Oldbie
Rank
Oldbie

Congrats on the beta release! 👍
I can confirm MDK and Duke2 work perfectly now!
Amazing work, crazii!

Last edited by Bondi on 2023-03-05, 21:39. Edited 2 times in total.

PCMCIA Sound Cards chart
archive.org: PCMCIA software, manuals, drivers

Reply 13 of 1248, by jamesfmackenzie

User metadata
Rank Newbie
Rank
Newbie
crazii wrote on 2023-03-05, 06:13:
Hi, I'm happy to announce that SBEMU is ready for more tests. :D […]
Show full quote

Hi, I'm happy to announce that SBEMU is ready for more tests. 😁

Purpose: for PCs with AC97/Intel High Definition Audio sound cards that doesn't have Sound Blaster support (vintage PCs after 2000 era, or modern PCs with HDA).
Supported PCI soundcards:

  • Intel ICH
  • nForce (nForce boards not tested so far)
  • Intel High Definition Audio
  • VIA VT8233 & VT82C686
  • SB Live/Audigy (thanks to Baron von Riedesel for debugging)

Emulated cards: SB 1.0, 2.0, Pro, 16, 8 bit DMA & 16 bit DMA.

Supported both real mode and protected mode games. Requirements:
HDPMI32i is needed for protected mode support, which is included in the zip file.
QEMM or JEMM is needed for real mode support. JEMMEX is included in the zip. It's optional, SBEMU can run without it and so without real mode support.

For more information, read the readme.txt in the zip and use /? in the command line.

Thanks to:

  • MPXPlay's: sound card drivers
  • DOSBox: DBOPL emulation
  • HDPMI & JEMM: Port traps
  • Folks in the forum that helped guiding & testing & improving the emulation

The original discussion can be found here: Possibility to write OPL3 sound driver for protected mode games, which initially intended for RetroWave OPL3 but then led to a pure soft emulation of SB & OPL.
The source code of SBEMU can be found here: https://github.com/crazii/SBEMU

Known issues: some games might not work properly, need more tests & improvement. 16 bit protected mode games are not supported - this remains a challenge so far.
Some games prefer VCPI over DPMI, need use "JEMMEX NOVCPI" AFTER loading HDPMI, or remove QEMM/JEMM and run the system without VCPI (also no real mode support).
Any suggestion and bug report are welcomed.

1.0 Beta2:
SBEMU.zip

Amazing work! Thanks!

Reply 14 of 1248, by digger

User metadata
Rank Oldbie
Rank
Oldbie
zyzzle wrote on 2023-03-05, 15:56:

Your SBEMU program is so important and epoch-changing that it makes DOS cool again. We may now play the old games baremetal and eschew emulators (DOSBOX) or virtual machines and get back to real, fast hardware without 3 and 4 abstraction layers slowing things down.

Indeed. It's quite a breakthrough in DOS retro gaming land.

The sad part is: most very new systems have been intentionally castrated by Intel and Microsoft. All legacy DOS support has been brutally and viciously removed, with only UEFI 64-bit .EFI support and no 16-bit legacy support or video BIOS / legacy VGA mode support, since 2017-18.

I think about the fastest modern system we'll see able to run SBEMU natively is a 9th or 10th gen Core i9 system. Everything beyond that will sadly be impossible outside of an emulation / VM due to the terrible decision made by Intel and Microsoft to delete BIOS legacy code.

All is not lost, though. You might want to keep an eye on tkchia's biefircate project as a possible solution to keep native DOS compatibility alive, even on newer 64-bit UEFI-only systems that no longer come with a CSM. (Seriously, it's a fascinating project that deserves more attention and assistance from other retro coders!)

That is, until inevitably the day comes when native 32-bit compatibility is removed from newer x86-64 CPUs at the hardware level.

Before that, there will probably first be a transitionary period in which 32-bit mode is supported only in VM instances running under a hypervisor. Even on such CPUs, a "native" DOS experience could still be had by passing through a DOS-compatible graphics card to the VM. Perhaps in combination with a more modern EMM386 variant as Jo22 suggested, which can boot from UEFI and run as a hypervisor that sets up a dedicated hardware-assisted DOS VM. An "EMMX64", if you will. Perhaps something like SBEMU could even be integrated with such a tool, as an all-in-one DOS game compatibility solution for newer systems.

But yeah, native DOS compatibility is well and truly on its way out. And honestly, it's amazing that it was preserved this long, when you think about it.

But in the meantime, I'm also quite curious to see some records shattered with Quake and other games in DOS running on as modern as possible hardware in all their audiovisual glory. 🙂

Reply 16 of 1248, by L4MD4

User metadata
Rank Newbie
Rank
Newbie

I've gotten no sound.
This is on a AC97 - Intel i915.
SBEMU finds the chip "Found sound card: ICH AC97".
Provided Jemmex is used.
Wolf3d, is used for realmode test.
Dos Mplayer/Wolf4GW, used for protected mode test.
SETBLAST.EXE asks that settings be checked, when test is run.
On system power down/reboot, audio speaker crackles; as it only does after dos sound activation. So, something is working.
Edit:Each test after fresh reboot. Quake also tested.
Vendor 8086, Device 266e, Subsystem 834c10f7, revision 04
MS-Dos 7.10
MPXPLAY works.
MPXPLAY -SCT output: ICH : Intel ICH6 found on port : 18C0 irq:9 (type:ICH4, bits:16,20)

What more useful information can I provide?

Last edited by L4MD4 on 2023-03-07, 00:12. Edited 3 times in total.

Reply 17 of 1248, by BitWrangler

User metadata
Rank l33t++
Rank
l33t++

It is often the case with DOS sound, genuine hardware in period machine or not, that the first application to mess it up, leaves it messed up for everything tried after. Thus I suggest it's made clear whether everything was tried individually after a fresh boot or not.

Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.

Reply 18 of 1248, by L4MD4

User metadata
Rank Newbie
Rank
Newbie
BitWrangler wrote on 2023-03-06, 04:18:

It is often the case with DOS sound, genuine hardware in period machine or not, that the first application to mess it up, leaves it messed up for everything tried after. Thus I suggest it's made clear whether everything was tried individually after a fresh boot or not.

I'll edit the post.

Reply 19 of 1248, by zyzzle

User metadata
Rank Member
Rank
Member
rasteri wrote on 2023-03-05, 17:23:

Any idea what CPU/chipset is the last one with a normal BIOS?

I've been trying to figure this out myself. Information is very scant and often conflicting. I remember using a 10th Gen core i5 laptop (Costco price mistake about 3 years ago), and it actually booted into legacy mode (DOS), but its VGA drivers were entirely absent, which made it useless for DOS, and especially for DOS games (most of which are 320x200 - 640x400). That HP laptop only supported 640x480 and above VESA video modes / resolutions, which few legacy DOS games used or can use. And it only supported very, very slow bankswitching, and no linear frame buffer, so you could not "speed" up the VESA throughoutput by modifying the MTRRs through write-cache combining.

Currently, I've got an 8th gen Dell latop which has decent DOS support, supports VGA (though its castrated Intel UHD onboard graphics vBIOS does *not* support 320x240 or 640x400 which is super-annoying, also MTRRs can't be enabled on it for writeback cache speedup through MTRRs). It works wonderfully with SBEMU. I've also got two 5th gen core i5 Dell laptops and a 6th gen core i5 laptop, all three of which work fabulously with SBEMU -- with its Intel HDA / IHD PCI audio support. Life is good.

It may be possible to use up to an 11th gen core i7 system with some BIOSes through side-loading a special CSM module onto a dedicated video card, which would allow booting to DOS. Who knows how good that vBIOS would be in supporting lower VGA resolutions, though?

It's an awful crapshoot. As to AMD, all Ryzen systems, from the 2000 series on up have castrated onboard vBIOSes and don't support *any* VGA resolutions. So, again, although DOS will boot on them, it's useless because none of the under 640x480 non-VESA modes are even recognized -- not in the BIOS of the video card's ROM.