First post, by Malvineous
- Rank
- Oldbie
Hi everyone,
I recently discovered that when capturing OPL music with DOSBox, it doesn't always start the capture with the first note played (although it's supposed to.)
I found out that this is because it only monitors one of the "noteon" ports on the OPL chip, whereas there are actually six of these (one for normal notes and five for percussion.) If the song starts off with percussion, the capture won't begin until the first "real" note is played. (For example, the first ~10 seconds of the song is lost when capturing the level music in Episode 2 of Monster Bash.)
This small change fixes the problem, by allowing percussive sounds to also trigger the capture.
--- src/hardware/adlib.cpp.orig 2007-07-28 13:52:20.000000000 +1000
+++ src/hardware/adlib.cpp 2007-07-28 13:35:52.000000000 +1000
@@ -206,8 +206,9 @@
if (cmd == 4 && !index) return;
/* Check if we have yet to start */
if (!opl.raw.handle) {
- if (cmd<0xb0 || cmd>0xb8) return;
- if (!(val&0x20)) return;
+ if ((cmd<0xb0 || cmd>0xb8) // ports 0xb0-0xb8 contain the "noteon" bit
+ && !((cmd == 0xbd) && (val & 0x1f))) return; // bits 0-4 on port 0xbd are used for sounding percussion
+// if (!(val&0x20)) return;
Bitu i;
opl.raw.last=PIC_Ticks;
opl.raw.start=PIC_Ticks;
(I hope the patch applies properly, I don't do these very often!)