First post, by BenMcLean
I am developing an open source VR re-creation of Wolfenstein 3-D for the Oculus Quest and PC VR in C# using the Godot engine. Unlike previous efforts to bring Wolfenstein 3-D to VR, mine aims to be very close to an exact, pixel-perfect reproduction with identical assets lifted from the original DOS files at runtime. Also plan to support Spear of Destiny and Super 3-D Noah's Ark.
This isn't a source port: I'm aiming to do a high level imitation of the game's rules but take every possible advantage of modern hardware and programming techniques behind the scenes, which is why it uses the Godot engine instead of the Wolfenstein 3-D engine.
Here's where I need help from you all:
Because authenticity to the original 1992 title is super important, I want to include real time OPL emulation. I found this C# port of the DOSBOX OPL emulation to get me started, but it has a major problem: missing notes.
Back in the day, Wolfenstein 3-D used interrupts to allow feeding note data into the Adlib/Soundblaster card at 700 Hz. But modern systems don't have interrupts. I can't send note data in at exactly 700 Hz, so the result is that the "start" signal and the "stop" signal for some notes end up arriving at the emulated synthesizer chip at the same time, so the note gets skipped. This is especially noticeable on the track for level 2 of the shareware (where Robert Prince composed some faster arpeggios) and on the Adlib sound effects. The DigiSounds are perfect but the Adlib sound effects sound like they got run over by a truck.
I hate this, but I haven't been able to figure out what to do about it. Microsoft offers a high precision timer in C# for music programming, but only for Windows. The Oculus Quest is an Android device so this needs to run on both Android and PC. I tried to use multi-threading to solve this but the multi-threaded version got the same crappy results.
I know DOSBOX manages to have good sound, including on programs that use DOSBOX's OPL emulation to play back IMF sequences on Android, so what I'm trying to do must be possible. How is this accomplished? And how can I get whatever they did to work on my new program?
I could really use some help with this! If nobody with insider knowledge on OPL emulation gets involved to help me out, then I'll just have to release a Wolfenstein 3-D VR program with crappy sound.
And don't tell me to pre-convert all the songs. I'm not doing that.
(later edit) Oh, and by the way, if you happen to know anyone who really likes 3D modelling, I need somebody to make 3D models of the Wolfenstein 3-D weapons to use for the player's hands in this game for me. I don't do 3D modelling so if I don't get help with this part, then the game's going to come out with generic VR controllers for guns. All contributors will of course be thanked by name (or anonymous if requested) in the credits.