King's Quest 4 SCI MT-32 problem

Ask for help with ScummVM problems

Moderator: ScummVM Team

Sven
Posts: 25
Joined: Tue Nov 16, 2010 2:46 pm

Post by Sven »

@Raziel:

I can't reproduce that issue. All I'm doing is starting a new game and walking outside, and there is music.

I am getting a checksum error though; is ScummVM sending the sysex data too quickly?

EDIT: Found the cause of the checksum error, will submit a patch.

EDIT2: Patch submitted.

I still can't reproduce Raziel's missing music issue, though.
waltervn
ScummVM Developer
Posts: 19
Joined: Mon Apr 14, 2008 12:02 am

Post by waltervn »

Sven wrote:I still can't reproduce Raziel's missing music issue, though.
I commented on Hubert's bug report. The things he describes in his last comment all seem normal to me.

Thanks for finding the checksum bug, it should now be fixed.

Regarding the reverb issue. This is missing functionality and it cannot be resolved with one or two lines of code, so this will take some more time. We will keep you updated.
Sven
Posts: 25
Joined: Tue Nov 16, 2010 2:46 pm

Post by Sven »

No problem, I understand. Take your time, I'm just glad to have helped. :)
User avatar
envisaged0ne
Posts: 159
Joined: Mon Nov 01, 2010 9:17 am
Location: United States

Post by envisaged0ne »

There's a problem with the DOS CD version of KQ5 with the latest 54480 revision of ScummVM. When I launch the game, it initializes the MT-32, then I get the hourglass. Then the game crashes with a message stating the program has stopped working. This also happens when trying to use the MT-32 emulator. The game will play ok if I don't try to use any MIDI playback for the music.
Sven
Posts: 25
Joined: Tue Nov 16, 2010 2:46 pm

Post by Sven »

No repro on that in 54490.

By the way, reverb handling in 54490 is better, but not correct. For KQ5 it now works right, because it will send reverb config 0 once it encounters the reverb 127 in the first song (is this true for all SCI1 games?)

For SCI0, it will send the default reverb read from the patch, but it does so before reading the reverb configs from the patch, thus sending nonsense to the MT-32.
User avatar
md5
ScummVM Developer
Posts: 2250
Joined: Thu Nov 03, 2005 9:31 pm
Location: Athens, Greece

Post by md5 »

Sven wrote:No repro on that in 54490.

By the way, reverb handling in 54490 is better, but not correct. For KQ5 it now works right, because it will send reverb config 0 once it encounters the reverb 127 in the first song (is this true for all SCI1 games?)

For SCI0, it will send the default reverb read from the patch, but it does so before reading the reverb configs from the patch, thus sending nonsense to the MT-32.
That has been fixed now, thanks!
Sven
Posts: 25
Joined: Tue Nov 16, 2010 2:46 pm

Post by Sven »

I did some testing on the latest revision (54495):

Reverb appears to be correct in KQ1SCI, KQ4 and KQ5.

However, it is not correct in Police Quest 2. Running PQ2 in DOSBox, it seems the reverb is initialized to reverb config 0 (00 04 05), but is then immediately changed to reverb config 2 (01 01 07) by the intro song. ScummVM now initializes to reverb 0, but does not send the change to reverb 2.

The song in questin is sound resource sound.001. The byte sequence that triggers the reverb change is at offset 0x69, and it's B1 50 02 00. ScummVM only recognizes sequences starting with BF 50 as a revern change, but it appears that is not correct. ScummVM simply passes the B1 50 02 00 sequence on to the driver, which sends it to the MT-32, which does nothing with it because 0x50 is not a valid control change.

I don't know if this means that all control changes with value 0x50 should be treated as a reverb change, regardless of channel, or if there is some kind of difference between BF and B1.

It should be noted that I noticed that when I skip the introduction and then do something to cause the points fanfare to play, the reverb is first changed back to config 0, and then back to 2 (the points fanfare (sound.006) contains the same B1 50 02 00 sequence). When other music is played (I tried the airport music) the reverb was changed back to 0, even though that song resource doesn't contain any reverb change command (no B1 50 or BF 50 or any 50).

Based on that, I might surmise that B1 50 could mean "change the reverb for this song, but change it back afterwards". But that's just an educated guess, someone more familiar with the inner workings of SCI should look at this.

In any case, B1 50 does mean a reverb change and should not be forwarded to the device, which is what ScummVM does now.
waltervn
ScummVM Developer
Posts: 19
Joined: Mon Apr 14, 2008 12:02 am

Post by waltervn »

Sven wrote:Based on that, I might surmise that B1 50 could mean "change the reverb for this song, but change it back afterwards". But that's just an educated guess, someone more familiar with the inner workings of SCI should look at this.
In SCI0, reverb is always reset before every song.

I will look into the issue with the channel number. Maybe in SCI1 these are always on channel 15 and in SCI0 they may be anywhere.
Sven
Posts: 25
Joined: Tue Nov 16, 2010 2:46 pm

Post by Sven »

waltervn wrote:In SCI0, reverb is always reset before every song.
Okay, that's interesting. May I point out that ScummVM currently does not do that? I guess a call to setReverb should be inserted into some place like sendInitCommands after all?
waltervn
ScummVM Developer
Posts: 19
Joined: Mon Apr 14, 2008 12:02 am

Post by waltervn »

Sven wrote:
waltervn wrote:In SCI0, reverb is always reset before every song.
Okay, that's interesting. May I point out that ScummVM currently does not do that? I guess a call to setReverb should be inserted into some place like sendInitCommands after all?
We are aware of this. The code is still work-in-progress. I'll let you know when it's ready for testing.
Sven
Posts: 25
Joined: Tue Nov 16, 2010 2:46 pm

Post by Sven »

waltervn wrote:We are aware of this. The code is still work-in-progress. I'll let you know when it's ready for testing.
I know, but I'll continue testing your work in progress anyway, 'cause I like doing that. :P

I'm not criticizing, I'm just trying to help. :)
Sven
Posts: 25
Joined: Tue Nov 16, 2010 2:46 pm

Post by Sven »

Is this still being worked on? The svn log indicates nothing has happened in the MIDI code since the PQ2 reverb fix, and the reverb still isn't properly reset.
User avatar
md5
ScummVM Developer
Posts: 2250
Joined: Thu Nov 03, 2005 9:31 pm
Location: Athens, Greece

Post by md5 »

Sven wrote:Is this still being worked on? The svn log indicates nothing has happened in the MIDI code since the PQ2 reverb fix, and the reverb still isn't properly reset.
Yes, we all have real life issues which always have more priority. Just be patient, please :)
Post Reply