First post, by sdz
Latest release: https://github.com/sdz-mods/VOPL3/releases/tag/A09
Virtual OPL3 FM for Windows 98/ME — plus an optional MPU-401 MIDI bridge that routes DOS-game MIDI to any installed MIDI device, in UART or intelligent mode.
How it works:
VOPL3.VXD (ring-0 port trap -> ring buffers) -> VOPLSRV.EXE (drains the buffers; FM: OPL3 emulator -> waveOut -> KMIXER; MIDI: parser -> midiOut -> the MIDI device of your choice). It works alongside Microsoft's SBEMUL.SYS. The OPL3 emulator is your choice of Nuked OPL3, Nuked-OPL3-fast, DOSBox's DBOPL or ymfm — all four are installed and you can switch between them live.
There's also VOPLCFG.EXE, an optional control panel / system-tray app: change the FM volume, the OPL3 emulator, the FM output device and the MIDI output device live (no restart needed), and see VOPL3's status (renderer in use, sample rate, FM/MIDI state, which MPU-401 mode a game is using) and debug counters.
Installation:
run INSTALL.BAT. It does the following:
-asks who handles the FM ports (388-38B, plus the Sound Blaster FM ports 2x8/2x9): VOPL3, left free (SBEMUL is steered away from them and VOPL3 doesn't trap them either), or SBEMUL (left as stock)
-asks who handles the MPU-401 MIDI ports (330-331): VOPL3 (recommended) or SBEMUL (left as stock)
-stops any running VOPL3 programs first
-copies VOPL3.VXD to C:\WINDOWS\SYSTEM
-copies the renderer to C:\VOPL3. All four OPL3 emulator builds are installed and you pick the one to start with: Nuked OPL3 (reference, the most accurate), Nuked-OPL3-fast (same output, about half the CPU use, recommended), DOSBox DBOPL (a small fraction of the CPU use, but less accurate) or ymfm (MAME's emulator, about the CPU use of the fast build). You can change it any time in the control panel.
-copies VOPLCFG.EXE (the control panel) and UNINSTALL.BAT to C:\VOPL3, and asks whether the control panel should start with Windows, minimized to the system tray
-sets up SBEMUL so it leaves the chosen ports alone, so digital audio keeps working. For FM this uses SBEMUL's own SoftFM registry setting, which stops it binding the FM ports; for MIDI it patches SBEMUL.SYS to move the MPU-401 ports out of the way. The original SBEMUL.SYS is backed up first. This is needed because SBEMUL only grabs the FM ports to fake AdLib detection, without doing any sort of FM emulation, and if another driver claims them it breaks digital audio as well. Reinstalling with different choices gives ports back to SBEMUL as needed.
-registers VOPL3.VXD and VOPLSRV.EXE so they're loaded/started automatically at boot/login
-settings live in C:\VOPL3\VOPL3.INI (FM volume, MIDI output device, plus a few advanced ones such as the output sample rate and the MPU-401 interrupt) — the common ones are easiest changed from the control panel, applied live. On a reinstall your existing VOPL3.INI is kept.
Reboot after installing.
How to use:
After installation, set the game to use AdLib for music and Sound Blaster for sound effects. You will get OPL3 music via VOPL3 and digital sound effects via SBEMUL.
If VOPL3 handles MIDI, you can instead set music to General MIDI or MPU-401: the game's MIDI is routed to whatever device you picked - a software synth, a hardware wavetable, or an external module - instead of SBEMUL's fixed Microsoft GS synth. By default it goes to the MIDI Mapper, i.e. the same GS synth, so nothing changes until you pick another device. Pick the device in the control panel, or in Control Panel > Multimedia > MIDI. The MIDI device is opened when a DOS program starts playing MIDI and released when its DOS box closes, so it's available again for Windows applications right after.
Both MPU-401 modes are emulated. Most General MIDI games from about 1991 on switch the card to UART mode, but some older titles - eg. Sierra's SCI games, often with an MT-32 -never do, and need intelligent mode; it's on by default. By default it claims no interrupt and the card is polled. If a game needs a real interrupt you can set one with [midi] irq=, but pick a line nothing else uses.
For uninstalling, there's an UNINSTALL.BAT (also installed to C:\VOPL3). This will remove all VOPL3 installed files/registry keys and revert SBEMUL.SYS to the unpatched version.
Github:
https://github.com/sdz-mods/VOPL3
Credits:
-nukeykt's Nuked-OPL3 https://github.com/nukeykt/Nuked-OPL3 - the actual OPL3 emulator inside VOPLSRV.EXE
-agovtman's Nuked-OPL3-fast fork https://github.com/tgies/Nuked-OPL3-fast
-The DOSBox Team's DBOPL https://www.dosbox.com - the OPL3 emulator inside VOPLDB.EXE
-The DOSBox Team's mpu401.cpp and bjt42's SoftMPU https://github.com/bjt42/softmpu - the MPU-401 intelligent-mode engine in the VxD follows their structure
-JHRobotics's vdmdisp9x https://github.com/JHRobotics/vmdisp9x - VxD glue (vmm.h io32.h code32.h) and for figuring out how to build an actually working VxD
-onethirdxcubed's WDMHDA https://github.com/andrew-hoffman/WDMHDA/releases -without which this project wouldn’t have made sense to me
-Anthropic's Fable 5 - helped a lot
This is very much an alpha release, so any testing is appreciated.
Currently tested on:
Dell Precision M4800 with coreboot/SeaBIOS, running Windows 98 SE with WDMHDA
VirtualBox VM running Windows 98 SE with WDMHDA
So far, it has only been tested with HDA + WDMHDA, but it is not intended to be limited to that setup.