[Scummvm-cvs-logs] SF.net SVN: scummvm:[42204] scummvm/branches/gsoc2009-16bit

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Tue Jul 7 09:21:32 CEST 2009


Revision: 42204
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42204&view=rev
Author:   Kirben
Date:     2009-07-07 07:21:32 +0000 (Tue, 07 Jul 2009)

Log Message:
-----------
Merged revisions 42201-42202 via svnmerge from 
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk

........
  r42201 | thebluegr | 2009-07-07 16:53:53 +1000 (Tue, 07 Jul 2009) | 1 line
  
  Prevent a crash when the engine errors out before the game state is initialized
........
  r42202 | Kirben | 2009-07-07 17:02:04 +1000 (Tue, 07 Jul 2009) | 1 line
  
  Set the correct sound rate for Personal Nightmare.
........

Modified Paths:
--------------
    scummvm/branches/gsoc2009-16bit/engines/agos/res_snd.cpp
    scummvm/branches/gsoc2009-16bit/engines/sci/console.cpp
    scummvm/branches/gsoc2009-16bit/engines/sci/sci.cpp

Property Changed:
----------------
    scummvm/branches/gsoc2009-16bit/


Property changes on: scummvm/branches/gsoc2009-16bit
___________________________________________________________________
Modified: svnmerge-integrated
   - /scummvm/trunk:1-42200 /scummvm/branches/gsoc2008-tfmx:1-31765 /scummvm/branches/gsoc2008-gui:1-31703
   + /scummvm/trunk:1-42203 /scummvm/branches/gsoc2008-tfmx:1-31765 /scummvm/branches/gsoc2008-gui:1-31703

Modified: scummvm/branches/gsoc2009-16bit/engines/agos/res_snd.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/engines/agos/res_snd.cpp	2009-07-07 07:09:56 UTC (rev 42203)
+++ scummvm/branches/gsoc2009-16bit/engines/agos/res_snd.cpp	2009-07-07 07:21:32 UTC (rev 42204)
@@ -527,6 +527,7 @@
 void AGOSEngine::loadSound(uint16 sound, uint16 freq, uint16 flags) {
 	byte *dst;
 	uint32 offs, size = 0;
+	uint32 rate = 8000;
 
 	if (_curSfxFile == NULL)
 		return;
@@ -570,13 +571,23 @@
 		offs = READ_BE_UINT32(dst + 8);
 	}
 
-	// TODO: Handle other sound flags and frequency
+	if (getGameType() == GType_PN) {
+		if (freq == 0) {
+			rate = 4600;
+		} else if (freq == 1) {
+			rate = 7400;
+		} else {
+			rate = 9400;
+		}
+	}
+
+	// TODO: Handle other sound flags in Amiga/AtariST versions
 	if (flags == 2 && _sound->isSfxActive()) {
-		_sound->queueSound(dst + offs, sound, size, 8000);
+		_sound->queueSound(dst + offs, sound, size, rate);
 	} else {
 		if (flags == 0)
 			_sound->stopSfx();
-		_sound->playRawData(dst + offs, sound, size, 8000);
+		_sound->playRawData(dst + offs, sound, size, rate);
 	}
 }
 

Modified: scummvm/branches/gsoc2009-16bit/engines/sci/console.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/engines/sci/console.cpp	2009-07-07 07:09:56 UTC (rev 42203)
+++ scummvm/branches/gsoc2009-16bit/engines/sci/console.cpp	2009-07-07 07:21:32 UTC (rev 42204)
@@ -201,12 +201,14 @@
 }
 
 void Console::preEnter() {
-	_vm->_gamestate->_sound.sfx_suspend(true);
+	if (_vm->_gamestate)
+		_vm->_gamestate->_sound.sfx_suspend(true);
 	_vm->_mixer->pauseAll(true);
 }
 
 void Console::postEnter() {
-	_vm->_gamestate->_sound.sfx_suspend(false);
+	if (_vm->_gamestate)
+		_vm->_gamestate->_sound.sfx_suspend(false);
 	_vm->_mixer->pauseAll(false);
 }
 

Modified: scummvm/branches/gsoc2009-16bit/engines/sci/sci.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/engines/sci/sci.cpp	2009-07-07 07:09:56 UTC (rev 42203)
+++ scummvm/branches/gsoc2009-16bit/engines/sci/sci.cpp	2009-07-07 07:21:32 UTC (rev 42204)
@@ -89,6 +89,8 @@
 	Common::addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded");
 	Common::addDebugChannel(kDebugLevelGC, "GC", "Garbage Collector debugging");
 
+	_gamestate = 0;
+
 	printf("SciEngine::SciEngine\n");
 }
 
@@ -258,11 +260,14 @@
 
 // Invoked by error() when a severe error occurs
 GUI::Debugger *SciEngine::getDebugger() {
-	ExecStack *xs = &(_gamestate->_executionStack.back());
+	if (_gamestate) {
+		ExecStack *xs = &(_gamestate->_executionStack.back());
+		xs->addr.pc.offset = debugState.old_pc_offset;
+		xs->sp = debugState.old_sp;
+	}
+
 	debugState.runningStep = 0; // Stop multiple execution
 	debugState.seeking = kDebugSeekNothing; // Stop special seeks
-	xs->addr.pc.offset = debugState.old_pc_offset;
-	xs->sp = debugState.old_sp;
 
 	return _console;
 }


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