VOGONS


SBEMU: Sound Blaster emulation on AC97

Topic actions

Reply 1800 of 1802, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

Hi,

I picked up the VDPMI code in the Lunar New Year, and it's been 2 years so I forgot much about the details, I have to add more comments on the code I written before. after some debug and tests, I found it is extremely difficult to achieve "virtualization" without a v86 monitor; for protected mode games it's OK, but for real mode games, the IVT hooks can be overridden by a real mode program easily. I so spend a couple of months to add a v86 monitor. the changes are so huge that I have to debug it again. now I tested again on my Thinkpad T540p and it works as before, probably with less bugs. But the UMB code is preliminary and may have problems.

The next of my plan will be add EMS for the v86 monitor, and then a VXD sound card driver for win9x to learn the VXD stuff. after that it will be add vmm api to support VXD for vpdmi.
VPCI won't be supported obviously there is DPMI.
VDS for now is not planned, as VDS is mainly for multitasking & page mapped env, and VPDMI provide only 1:1 identity page mapping, and no multi-tasks.
XMS could be considered, but now it's not the priority.

Here are the changes and attached zip.

changes on SBEMU:
adapted to VDPMI, use IOPL=3
fix random crash on Tyrian exit

VDPMI:
v86 monitor, loaded as driver from config.sys, enable virtual interrupts (VIF+VIP+PVI). it can be executed from command line, see /? for more details.
fix keyboard/mouse driver problem, but there still may be bugs when a usb-mouse is used.
xms2 interception to limit XMS size, HimemX may have its own option, but this can work for Himem.sys
xms move memory function: compatibility workaround for HimemX (SWDA / Xuanyuan Jian Waizhuan: Feng Zhi Wu / 軒轅劍外傳 楓之舞. Himem.sys/JEMMEX is fine with the game)
fix LH/DEVICEHIGH crash when booting from USB. (seen on my laptop, its a bug of the BIOS's USB legacy support/emulation, crash on EMM386 and JEMMEX)
fix Legend (Z.COM / Jinyong Qunxiazhuan / 金庸群俠傳) freeze on USB disk. (same reason above, it will freeze when the game folder is on usbdisk, won't freeze if boot from usb but game folder is on HDD, and, it freeze without any EMM/DPMI)
fix startup-time random crash (divide 0 error) for monkey island (its a bug of monkey island, only exposed on fast CPUs, and on a SB init path, probably produce-able on a P4 cpu with SB compatible PCI cards. hard fixed in v86 monitor)
fix SB detection for Space Quest V (tricky fix through v86 monitor)
fix incorrect SoundFX (noise), for PAL / The Legend of Sword and Fairy / 仙劍奇俠傳, and probably another game which I forgot its tittle.
add compatibility to FastDoom.
a new "VM timing" is added, to exclude the ring 0 time consumed, so that the debug logs won't cause a infinite irq0 deadloop. it is experimental only and may cause games to slowdown or speedup (it's fixed on my laptop, but I doubt its compatibility)

VDPMI will be open-sourced when it reaches a more stable phase.
I'm not sure to start anew a VXD (e.g. from ALSA) or to modify the existing code of SBEMU. it will be a breaking change so currently I'm considering a new port, and keeps the old as it is.

Last edited by crazii on 2026-04-22, 15:15. Edited 1 time 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 1801 of 1802, by Falcosoft

User metadata
Rank l33t
Rank
l33t
crazii wrote on Today, 13:54:
Hi, […]
Show full quote

Hi,

I picked up the VDPMI code in the Lunar New Year, and it's been 2 years so I forgot much about the details, I have to add more comments on the code I written before. after some debug and tests, I found it is extremely difficult to achieve "virtualization" without a v86 monitor; for protected mode games it's OK, but for real mode games, the IVT hooks can be overridden by a real mode program easily. I so spend a couple of months to add a v86 monitor. the changes are so huge that I have to debug it again. now I tested again on my Thinkpad T540p and it works as before, probably with less bugs. But the UMB code is preliminary and may have problems.

The next of my plan will be add EMS for the v86 monitor, and then a VXD sound card driver for win9x to learn the VXD stuff. after that it will be add vmm api to support VXD for vpdmi.
VPCI won't be supported obviously there is DPMI.
VDS for now is not planned, as VDS is mainly for multitasking & page mapped env, and VPDMI provide only 1:1 identity page mapping, and no multi-tasks.
XMS could be considered, but now it's not the priority.

Here are the changes and attached zip.

changes on SBEMU:
adapted to VDPMI, use IOPL=3
fix random crash on Tyrian exit

VDPMI:
v86 monitor, loaded as driver from config.sys, enable virtual interrupts (VIF+VIP+PVI). it can be executed from command line, see /? for more details.
fix keyboard/mouse driver problem, but there still may be bugs when a usb-mouse is used.
xms2 interception to limit XMS size, HimemX may have its own option, but this can work for Himem.sys
xms move memory function: compatibility workaround for HimemX (SWDA / Xuanyuan Jian Waizhuan: Feng Zhi Wu / 軒轅劍外傳 楓之舞. Himem.sys/JEMMEX is fine with the game)
fix LH/DEVICEHIGH crash when booting from USB. (seen on my laptop, its a bug of the BIOS's USB legacy support/emulation, crash on EMM386 and JEMMEX)
fix Legend (Z.COM / Jinyong Qunxiazhuan / 金庸群俠傳) freeze on USB disk. (same reason above, it will freeze when the game folder is on usbdisk, won't freeze if boot from usb but game folder is on HDD, and, it freeze without any EMM/DPMI)
fix startup-time random crash (divide 0 error) for monkey island (its a bug of monkey island, only exposed on fast CPUs, and on a SB init path, probably produce-able on a P4 cpu with SB compatible PCI cards. hard fixed in v86 monitor)
fix SB detection for Space Quest V (tricky fix through v86 monitor)
fix incorrect SoundFX (noise), for PAL / The Legend of Sword and Fairy / 仙劍奇俠傳, and probably another game which I forgot its tittle.
add compatibility to FastDoom.
a new "VM timing" is added, to exclude the ring 0 time consumed, so that the debug logs won't cause a infinite irq0 deadloop. it is experimental only and may cause games to slowdown or speedup (it's fixed on my laptop, but I doubt its compatibility)

VDPMI will be open-sourced when it reaches a more stable phase.
I'm not sure to start anew a VXD (e.g. from ALSA) or to modify the existing code of SBEMU. it will be a breaking change so currently I'm considering a new port, and keeps the old as it is.

Hi,
Intel Haswell system (Z97 chipset): vdpmid.exe freezes without any messages.
Intel Ivy Bridge system (Thinkpad T430) is the same: vdpmid.exe freezes without any messages.
Both systems work with older versions of SBEMU.

BTW, in your package the example CONFIG.SYS file references VDPMI.EXE (DEVICE=VDPMI.EXE) while the proper name is VDPMID.EXE.

Website, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper
x86 microarchitecture benchmark (MandelX)

Reply 1802 of 1802, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Falcosoft wrote on 51 minutes ago:
Hi, Intel Haswell system (Z97 chipset): vdpmid.exe freezes without any messages. Intel Ivy Bridge system (Thinkpad T430) is the […]
Show full quote

Hi,
Intel Haswell system (Z97 chipset): vdpmid.exe freezes without any messages.
Intel Ivy Bridge system (Thinkpad T430) is the same: vdpmid.exe freezes without any messages.
Both systems work with older versions of SBEMU.

BTW, in your package the example CONFIG.SYS file references VDPMI.EXE (DEVICE=VDPMI.EXE) while the proper name is VDPMID.EXE.

the "vpdmid.exe" was a debug exe 2 years ago, I updated the zip file, sorry for the inconvenience.

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