aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/agos/res_snd.cpp17
-rw-r--r--engines/sci/console.cpp6
-rw-r--r--engines/sci/sci.cpp11
3 files changed, 26 insertions, 8 deletions
diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp
index 60c79b2324..810f953bd7 100644
--- a/engines/agos/res_snd.cpp
+++ b/engines/agos/res_snd.cpp
@@ -527,6 +527,7 @@ void AGOSEngine::loadSound(uint16 sound, int16 pan, int16 vol, uint16 type) {
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 @@ void AGOSEngine::loadSound(uint16 sound, uint16 freq, uint16 flags) {
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);
}
}
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 4ab10d9eb9..8f977c04c2 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -201,12 +201,14 @@ Console::~Console() {
}
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);
}
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 1f2e2cf1cd..7e2940dbd1 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -89,6 +89,8 @@ SciEngine::SciEngine(OSystem *syst, const SciGameDescription *desc)
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 @@ Common::Error SciEngine::run() {
// 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;
}