[Scummvm-cvs-logs] SF.net SVN: scummvm:[48617] scummvm/trunk

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Apr 11 17:05:26 CEST 2010


Revision: 48617
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48617&view=rev
Author:   lordhoto
Date:     2010-04-11 15:05:26 +0000 (Sun, 11 Apr 2010)

Log Message:
-----------
Fix bug #2985387 "KYRA1: Crash at the end of game".

Modified Paths:
--------------
    scummvm/trunk/NEWS
    scummvm/trunk/engines/kyra/sound_adlib.cpp

Modified: scummvm/trunk/NEWS
===================================================================
--- scummvm/trunk/NEWS	2010-04-11 06:06:45 UTC (rev 48616)
+++ scummvm/trunk/NEWS	2010-04-11 15:05:26 UTC (rev 48617)
@@ -7,6 +7,10 @@
  New Ports:
    - Added Nintendo 64 Port (Actually added in 1.1.0, but forgot to mention it. oops)
 
+ KYRA:
+   - Fixed a bug which caused the DOS versions to crash before the credits when AdLib
+     music is selected.
+
 1.1.0 (2010-04-04)
  New Games:
    - Added support for Blue's Art Time Activities.

Modified: scummvm/trunk/engines/kyra/sound_adlib.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_adlib.cpp	2010-04-11 06:06:45 UTC (rev 48616)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp	2010-04-11 15:05:26 UTC (rev 48617)
@@ -953,7 +953,8 @@
 void AdLibDriver::setupNote(uint8 rawNote, Channel &channel, bool flag) {
 	debugC(9, kDebugLevelSound, "setupNote(%d, %lu)", rawNote, (long)(&channel - _channels));
 
-	assert(_curChannel < 9);
+	if (_curChannel >= 9)
+		return;
 
 	channel.rawNote = rawNote;
 
@@ -1009,7 +1010,8 @@
 void AdLibDriver::setupInstrument(uint8 regOffset, uint8 *dataptr, Channel &channel) {
 	debugC(9, kDebugLevelSound, "setupInstrument(%d, %p, %lu)", regOffset, (const void *)dataptr, (long)(&channel - _channels));
 
-	assert(_curChannel < 9);
+	if (_curChannel >= 9)
+		return;
 
 	// Amplitude Modulation / Vibrato / Envelope Generator Type /
 	// Keyboard Scaling Rate / Modulator Frequency Multiple
@@ -1061,7 +1063,8 @@
 
 	// The "note on" bit is set, and the current note is played.
 
-	assert(_curChannel < 9);
+	if (_curChannel >= 9)
+		return;
 
 	channel.regBx |= 0x20;
 	writeOPL(0xB0 + _curChannel, channel.regBx);
@@ -1075,7 +1078,8 @@
 void AdLibDriver::adjustVolume(Channel &channel) {
 	debugC(9, kDebugLevelSound, "adjustVolume(%lu)", (long)(&channel - _channels));
 
-	assert(_curChannel < 9);
+	if (_curChannel >= 9)
+		return;
 
 	// Level Key Scaling / Total Level
 
@@ -1103,7 +1107,8 @@
 void AdLibDriver::primaryEffect1(Channel &channel) {
 	debugC(9, kDebugLevelSound, "Calling primaryEffect1 (channel: %d)", _curChannel);
 
-	assert(_curChannel < 9);
+	if (_curChannel >= 9)
+		return;
 
 	uint8 temp = channel.unk31;
 	channel.unk31 += channel.unk29;
@@ -1189,7 +1194,8 @@
 void AdLibDriver::primaryEffect2(Channel &channel) {
 	debugC(9, kDebugLevelSound, "Calling primaryEffect2 (channel: %d)", _curChannel);
 
-	assert(_curChannel < 9);
+	if (_curChannel >= 9)
+		return;
 
 	if (channel.unk38) {
 		--channel.unk38;
@@ -1247,7 +1253,8 @@
 void AdLibDriver::secondaryEffect1(Channel &channel) {
 	debugC(9, kDebugLevelSound, "Calling secondaryEffect1 (channel: %d)", _curChannel);
 
-	assert(_curChannel < 9);
+	if (_curChannel >= 9)
+		return;
 
 	uint8 temp = channel.unk18;
 	channel.unk18 += channel.unk19;
@@ -1612,7 +1619,8 @@
 }
 
 int AdLibDriver::updateCallback39(uint8 *&dataptr, Channel &channel, uint8 value) {
-	assert(_curChannel < 9);
+	if (_curChannel >= 9)
+		return 0;
 
 	uint16 unk = *dataptr++;
 	unk |= value << 8;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list