aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamieson Christian2003-05-17 19:03:25 +0000
committerJamieson Christian2003-05-17 19:03:25 +0000
commitfcc11d19fa22a8c559d53c3d1e5b9b63b7be975c (patch)
tree62cf4157667f8f23f25cef0f8a294dd30d2f219f
parent3576b8e16882f0e8f033679bf293bc3b3a3ab618 (diff)
downloadscummvm-rg350-fcc11d19fa22a8c559d53c3d1e5b9b63b7be975c.tar.gz
scummvm-rg350-fcc11d19fa22a8c559d53c3d1e5b9b63b7be975c.tar.bz2
scummvm-rg350-fcc11d19fa22a8c559d53c3d1e5b9b63b7be975c.zip
Added imuse_multimidi to debugger
svn-id: r7614
-rw-r--r--scumm/debugger.cpp13
-rw-r--r--scumm/debugger.h2
-rw-r--r--scumm/imuse.cpp10
3 files changed, 25 insertions, 0 deletions
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp
index d506f25e0d..8b15e800c6 100644
--- a/scumm/debugger.cpp
+++ b/scumm/debugger.cpp
@@ -22,6 +22,7 @@
#include "scumm.h"
#include "sound.h"
#include "actor.h"
+#include "imuse.h"
#include "debugger.h"
#include "common/util.h"
#include "common/file.h"
@@ -98,6 +99,8 @@ void ScummDebugger::attach(Scumm *s, char *entry) {
DCmd_Register("show", &ScummDebugger::Cmd_Show);
DCmd_Register("hide", &ScummDebugger::Cmd_Hide);
+
+ DCmd_Register("imuse_multimidi", &ScummDebugger::Cmd_ImuseMultiMidi);
}
}
@@ -354,6 +357,16 @@ bool ScummDebugger::Cmd_Restart(int argc, const char **argv) {
return false;
}
+bool ScummDebugger::Cmd_ImuseMultiMidi (int argc, const char **argv) {
+ if (argc > 1) {
+ _s->_imuse->property (IMuse::PROP_MULTI_MIDI, !strcmp (argv[1], "1") || !strcmp (argv[1], "on") || !strcmp (argv[1], "true"));
+ return false;
+ } else {
+ Debug_Printf("Use 'imuse_multimidi <on/true/1 | off/false/0>' to switch\n");
+ return true;
+ }
+}
+
bool ScummDebugger::Cmd_Room(int argc, const char **argv) {
if (argc > 1) {
int room = atoi(argv[1]);
diff --git a/scumm/debugger.h b/scumm/debugger.h
index d6aa6bc525..1dc6054e2e 100644
--- a/scumm/debugger.h
+++ b/scumm/debugger.h
@@ -92,6 +92,8 @@ protected:
bool Cmd_Show(int argc, const char **argv);
bool Cmd_Hide(int argc, const char **argv);
+
+ bool Cmd_ImuseMultiMidi (int argc, const char **argv);
void printBox(int box);
void drawBox(int box);
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index 2d60d04f22..d27ec891fd 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -1654,6 +1654,16 @@ uint32 IMuseInternal::property(int prop, uint32 value) {
case IMuse::PROP_MULTI_MIDI:
_enable_multi_midi = (value > 0);
+ if (!_enable_multi_midi && _midi_native && _midi_adlib) {
+ MidiDriver *driver = _midi_adlib;
+ _midi_adlib = NULL;
+ int i;
+ for (i = 0; i < ARRAYSIZE(_players); ++i) {
+ if (_players[i]._active && _players[i]._midi == driver)
+ _players[i].clear();
+ }
+ driver->close();
+ }
break;
case IMuse::PROP_OLD_ADLIB_INSTRUMENTS: