Opened 3 years ago
Closed 3 years ago
#13048 closed defect (fixed)
AGOS: Waxworks soundblaster sound doesn't work
Reported by: | Max833 | Owned by: | eriktorbjorn |
---|---|---|---|
Priority: | high | Component: | Engine: AGOS |
Version: | Keywords: | sound, bug, soundblaster | |
Cc: | Game: | Waxworks |
Description
Unfortunately, the soundblaster version doesn't work at all. Sometimes you can hear some sounds but it should be like that: https://youtu.be/skSAjb7RW3k
The last version that works correctly: ScummVM 2.0.0
Change History (4)
comment:2 by , 3 years ago
I think the problem is in how it calculates adjustedVelocity for noteOnSetVolume(). This value eventually becomes what's passed to the 40-55 registers ("Level Key Scaling / Total Level"). See http://www.shipbrook.net/jeff/sb.html for reference.
regValue40h = (63 - adjustedVelocity) & 0x3F;
So if adjustedVelocity is greater than 63, regValue40h will wrap around from a small value to a potentially very large one. The larger the value, the lower the volume. If I cap adjustedVelocity at 63, I think I hear all the notes. That's probably not the right way of doing it, but it provides a clue.
This value is calculated in noteOn(), and this is where things get weird. For one thing, it calculates a value for channelVolumeAdjust but I can't see that it's ever used. So it takes the unadjusted velocity in, and then increases it even further by adjusting it with the master volume. I have no idea what this is supposed to look like.
comment:3 by , 3 years ago
Attempted fix: https://github.com/scummvm/scummvm/pull/3472
I don't know if it's correct, but at least it's an improvement.
comment:4 by , 3 years ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
This has been fixed.
Bisecting points to this commit:
Which seems to fit the time frame. Unfortunately, it doesn't say anything further about what problem this fixed. From what I understand, the following games use the Accolade AdLib driver:
Edit: Handy link to the commit: https://github.com/scummvm/scummvm/commit/b1bd75a0838e1bf5ba87a70a4490b4b6265ef16b