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:1 by eriktorbjorn, 3 years ago

Bisecting points to this commit:

b1bd75a0838e1bf5ba87a70a4490b4b6265ef16b is the first bad commit
commit b1bd75a0838e1bf5ba87a70a4490b4b6265ef16b
Author: Fedor Antokhin <fantohin@gmail.com>
Date:   Thu May 2 20:24:41 2019 +0300

    AGOS: Mute fix for ADLIB Accolade

 engines/agos/drivers/accolade/adlib.cpp | 29 ++++++++++++++++++++---------
 engines/agos/midi.cpp                   |  9 ++++++++-
 engines/agos/midi.h                     |  3 ++-
 3 files changed, 30 insertions(+), 11 deletions(-)

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:

  • Elvira - Mistress of the Dark (except PC-98 version)
  • Waxworks
  • Simon the Sorcerer 1 Demo

Edit: Handy link to the commit: https://github.com/scummvm/scummvm/commit/b1bd75a0838e1bf5ba87a70a4490b4b6265ef16b

Last edited 3 years ago by eriktorbjorn (previous) (diff)

comment:2 by eriktorbjorn, 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 eriktorbjorn, 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 sev-, 3 years ago

Owner: set to eriktorbjorn
Resolution: fixed
Status: newclosed

This has been fixed.

Note: See TracTickets for help on using tickets.