aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2008-05-17 19:01:00 +0000
committerSven Hesse2008-05-17 19:01:00 +0000
commit6e13bde2130fb12f7d307c4fcdedd8e36e3038bb (patch)
treee47f3ec74503f4b0c8f7a3a0b06c9b7fbdf013d7 /engines
parent2e14d05caa043848f7d74f53117bce284c325b12 (diff)
downloadscummvm-rg350-6e13bde2130fb12f7d307c4fcdedd8e36e3038bb.tar.gz
scummvm-rg350-6e13bde2130fb12f7d307c4fcdedd8e36e3038bb.tar.bz2
scummvm-rg350-6e13bde2130fb12f7d307c4fcdedd8e36e3038bb.zip
Changing debug channels a bit
svn-id: r32157
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/gob.cpp3
-rw-r--r--engines/gob/gob.h5
-rw-r--r--engines/gob/inter_v2.cpp4
-rw-r--r--engines/gob/inter_v4.cpp12
-rw-r--r--engines/gob/sound/adlib.cpp2
-rw-r--r--engines/gob/sound/cdrom.cpp6
-rw-r--r--engines/gob/sound/sound.cpp58
7 files changed, 73 insertions, 17 deletions
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index 5871151d6e..7926f6220e 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -85,12 +85,13 @@ GobEngine::GobEngine(OSystem *syst) : Engine(syst) {
Common::addSpecialDebugLevel(kDebugFuncOp, "FuncOpcodes", "Script FuncOpcodes debug level");
Common::addSpecialDebugLevel(kDebugDrawOp, "DrawOpcodes", "Script DrawOpcodes debug level");
Common::addSpecialDebugLevel(kDebugGobOp, "GoblinOpcodes", "Script GoblinOpcodes debug level");
- Common::addSpecialDebugLevel(kDebugMusic, "Music", "CD, Adlib and Infogrames music debug level");
+ Common::addSpecialDebugLevel(kDebugSound, "Sound", "Sound output debug level");
Common::addSpecialDebugLevel(kDebugParser, "Parser", "Parser debug level");
Common::addSpecialDebugLevel(kDebugGameFlow, "Gameflow", "Gameflow debug level");
Common::addSpecialDebugLevel(kDebugFileIO, "FileIO", "File Input/Output debug level");
Common::addSpecialDebugLevel(kDebugSaveLoad, "SaveLoad", "Saving/Loading debug level");
Common::addSpecialDebugLevel(kDebugGraphics, "Graphics", "Graphics debug level");
+ Common::addSpecialDebugLevel(kDebugVideo, "Video", "IMD/VMD video debug level");
Common::addSpecialDebugLevel(kDebugCollisions, "Collisions", "Collisions debug level");
syst->getEventManager()->registerRandomSource(_rnd, "gob");
diff --git a/engines/gob/gob.h b/engines/gob/gob.h
index 0a82bceed5..812ae1edb9 100644
--- a/engines/gob/gob.h
+++ b/engines/gob/gob.h
@@ -100,13 +100,14 @@ enum {
kDebugFuncOp = 1 << 0,
kDebugDrawOp = 1 << 1,
kDebugGobOp = 1 << 2,
- kDebugMusic = 1 << 3, // CD, Adlib and Infogrames music
+ kDebugSound = 1 << 3,
kDebugParser = 1 << 4,
kDebugGameFlow = 1 << 5,
kDebugFileIO = 1 << 6,
kDebugSaveLoad = 1 << 7,
kDebugGraphics = 1 << 8,
- kDebugCollisions = 1 << 9
+ kDebugVideo = 1 << 9,
+ kDebugCollisions = 1 << 10
};
inline char *strncpy0(char *dest, const char *src, size_t n) {
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 493efa8438..6278a6e22f 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -1087,6 +1087,8 @@ void Inter_v2::o2_playCDTrack() {
}
void Inter_v2::o2_waitCDTrackEnd() {
+ debugC(1, kDebugSound, "CDROM: Waiting for playback to end");
+
while (_vm->_sound->cdGetTrackPos() >= 0)
_vm->_util->longDelay(1);
}
@@ -2056,7 +2058,6 @@ void Inter_v2::o2_loadInfogramesIns(OpGobParams &params) {
strncpy0(fileName, GET_VAR_STR(varName), 15);
strcat(fileName, ".INS");
- debugC(1, kDebugMusic, "Loading Infogrames instrument file \"%s\"", fileName);
_vm->_sound->infogramesLoadInstruments(fileName);
}
@@ -2069,7 +2070,6 @@ void Inter_v2::o2_playInfogrames(OpGobParams &params) {
strncpy0(fileName, GET_VAR_STR(varName), 15);
strcat(fileName, ".DUM");
- debugC(1, kDebugMusic, "Playing Infogrames music file \"%s\"", fileName);
_vm->_sound->infogramesLoadSong(fileName);
_vm->_sound->infogramesPlay();
diff --git a/engines/gob/inter_v4.cpp b/engines/gob/inter_v4.cpp
index 76b11752e0..920ca59f43 100644
--- a/engines/gob/inter_v4.cpp
+++ b/engines/gob/inter_v4.cpp
@@ -687,6 +687,8 @@ void Inter_v4::executeGoblinOpcode(int i, OpGobParams &params) {
}
if (op == NULL) {
+ warning("unimplemented opcodeGoblin: %d", i);
+
int16 val;
_vm->_global->_inter_execPtr -= 2;
@@ -739,11 +741,14 @@ void Inter_v4::o4_playVmdOrMusic() {
palEnd = _vm->_parse->parseValExpr();
palCmd = 1 << (flags & 0x3F);
+ debugC(1, kDebugVideo, "Playing video \"%s\" @ %d+%d, frames %d - %d, "
+ "paletteCmd %d (%d - %d), flags %X", fileName, x, y, startFrame, lastFrame,
+ palCmd, palStart, palEnd, flags);
+
close = false;
if (lastFrame == -1) {
close = true;
} else if (lastFrame == -3) {
-// warning("Woodruff Stub: Video/Music command -3: Play background video %s, %d, %d, %d, %d", fileName, startFrame, x, y, VAR_OFFSET(7872));
_vm->_mult->_objects[startFrame].pAnimData->animation = -startFrame - 1;
@@ -767,17 +772,16 @@ void Inter_v4::o4_playVmdOrMusic() {
warning("Woodruff Stub: Video/Music command -4: Play background video %s", fileName);
return;
} else if (lastFrame == -5) {
-// warning("Woodruff Stub: Video/Music command -5: Stop background music");
_vm->_sound->bgStop();
return;
} else if (lastFrame == -6) {
-// warning("Woodruff Stub: Video/Music command -6: Load background video %s", fileName);
+ return;
+ } else if (lastFrame == -7) {
return;
} else if (lastFrame == -8) {
warning("Woodruff Stub: Video/Music command -8: Play background video %s", fileName);
return;
} else if (lastFrame == -9) {
-// warning("Woodruff Stub: Video/Music command -9: Play background music %s (%d-%d)", fileName, palEnd, palStart);
_vm->_sound->bgStop();
_vm->_sound->bgSetPlayMode(BackgroundAtmosphere::kPlayModeRandom);
_vm->_sound->bgPlay(fileName, palStart);
diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp
index fb0d9d58c1..b3d392ad1e 100644
--- a/engines/gob/sound/adlib.cpp
+++ b/engines/gob/sound/adlib.cpp
@@ -125,7 +125,7 @@ int AdLib::readBuffer(int16 *buffer, const int numSamples) {
}
void AdLib::writeOPL(byte reg, byte val) {
- debugC(6, kDebugMusic, "writeOPL(%02X, %02X)", reg, val);
+ debugC(6, kDebugSound, "writeOPL(%02X, %02X)", reg, val);
OPLWriteReg(_opl, reg, val);
}
diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp
index f3bc70807e..eef8025cc2 100644
--- a/engines/gob/sound/cdrom.cpp
+++ b/engines/gob/sound/cdrom.cpp
@@ -83,8 +83,6 @@ void CDROM::startTrack(const char *trackName) {
if (!_LICbuffer)
return;
- debugC(1, kDebugMusic, "CDROM::startTrack(%s)", trackName);
-
byte *matchPtr = getTrackBuffer(trackName);
if (!matchPtr) {
warning("Track \"%s\" not found", trackName);
@@ -114,8 +112,6 @@ void CDROM::play(uint32 from, uint32 to) {
// HSG encodes frame information into a double word:
// minute multiplied by 4500, plus second multiplied by 75,
// plus frame, minus 150
- debugC(1, kDebugMusic, "CDROM::play(%d, %d)", from, to);
-
AudioCD.play(1, 1, from, to - from + 1);
_cdPlaying = true;
}
@@ -159,8 +155,6 @@ void CDROM::stopPlaying() {
}
void CDROM::stop() {
- debugC(1, kDebugMusic, "CDROM::stop()");
-
_curTrackBuffer = 0;
AudioCD.stop();
_cdPlaying = false;
diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp
index 63b74ca36f..79fe5acb56 100644
--- a/engines/gob/sound/sound.cpp
+++ b/engines/gob/sound/sound.cpp
@@ -92,6 +92,8 @@ bool Sound::sampleLoad(SoundDesc *sndDesc, const char *fileName, bool tryExist)
if (!sndDesc)
return false;
+ debugC(2, kDebugSound, "Loading sample \"%s\"", fileName);
+
int16 handle = _vm->_dataIO->openData(fileName);
if (handle < 0) {
warning("Can't open sample file \"%s\"", fileName);
@@ -137,6 +139,8 @@ void Sound::speakerOn(int16 frequency, int32 length) {
if (!_pcspeaker)
return;
+ debugC(1, kDebugSound, "PCSpeaker: Playing tone (%d, %d)", frequency, length);
+
_pcspeaker->speakerOn(frequency, length);
}
@@ -144,6 +148,8 @@ void Sound::speakerOff() {
if (!_pcspeaker)
return;
+ debugC(1, kDebugSound, "PCSpeaker: Stopping tone");
+
_pcspeaker->speakerOff();
}
@@ -158,6 +164,8 @@ bool Sound::infogramesLoadInstruments(const char *fileName) {
if (!_infogrames)
return false;
+ debugC(1, kDebugSound, "Infogrames: Loading instruments \"%s\"", fileName);
+
return _infogrames->loadInstruments(fileName);
}
@@ -165,6 +173,8 @@ bool Sound::infogramesLoadSong(const char *fileName) {
if (!_infogrames)
return false;
+ debugC(1, kDebugSound, "Infogrames: Loading song \"%s\"", fileName);
+
return _infogrames->loadSong(fileName);
}
@@ -172,6 +182,8 @@ void Sound::infogramesPlay() {
if (!_infogrames)
return;
+ debugC(1, kDebugSound, "Infogrames: Starting playback");
+
_infogrames->play();
}
@@ -179,6 +191,8 @@ void Sound::infogramesStop() {
if (!_infogrames)
return;
+ debugC(1, kDebugSound, "Infogrames: Stopping playback");
+
_infogrames->stop();
}
@@ -186,6 +200,8 @@ bool Sound::adlibLoad(const char *fileName) {
if (!_adlib)
return false;
+ debugC(1, kDebugSound, "Adlib: Loading data (\"%s\")", fileName);
+
return _adlib->load(fileName);
}
@@ -193,6 +209,8 @@ bool Sound::adlibLoad(byte *data, uint32 size, int index) {
if (!_adlib)
return false;
+ debugC(1, kDebugSound, "Adlib: Loading data (%d)", index);
+
return _adlib->load(data, size, index);
}
@@ -200,6 +218,8 @@ void Sound::adlibUnload() {
if (!_adlib)
return;
+ debugC(1, kDebugSound, "Adlib: Unloading data");
+
_adlib->unload();
}
@@ -207,7 +227,7 @@ void Sound::adlibPlayTrack(const char *trackname) {
if (!_adlib || _adlib->isPlaying())
return;
- debugC(1, kDebugMusic, "Adlib::playTrack(%s)", trackname);
+ debugC(1, kDebugSound, "Adlib: Playing track \"%s\"", trackname);
_adlib->unload();
_adlib->load(trackname);
@@ -235,6 +255,8 @@ void Sound::adlibPlay() {
if (!_adlib)
return;
+ debugC(1, kDebugSound, "Adlib: Starting playback");
+
_adlib->startPlay();
}
@@ -242,6 +264,8 @@ void Sound::adlibStop() {
if (!_adlib)
return;
+ debugC(1, kDebugSound, "Adlib: Stopping playback");
+
_adlib->stopPlay();
}
@@ -278,6 +302,9 @@ void Sound::blasterPlay(SoundDesc *sndDesc, int16 repCount,
if (!_blaster || !sndDesc)
return;
+ debugC(1, kDebugSound, "SoundBlaster: Playing sample (%d, %d, %d)",
+ repCount, frequency, fadeLength);
+
_blaster->playSample(*sndDesc, repCount, frequency, fadeLength);
}
@@ -285,6 +312,8 @@ void Sound::blasterStop(int16 fadeLength, SoundDesc *sndDesc) {
if (!_blaster)
return;
+ debugC(1, kDebugSound, "SoundBlaster: Stopping playback");
+
_blaster->stopSound(fadeLength, sndDesc);
}
@@ -293,6 +322,9 @@ void Sound::blasterPlayComposition(int16 *composition, int16 freqVal,
if (!_blaster)
return;
+ debugC(1, kDebugSound, "SoundBlaster: Playing composition (%d, %d)",
+ freqVal, sndCount);
+
blasterWaitEndPlay();
_blaster->stopComposition();
@@ -306,6 +338,8 @@ void Sound::blasterStopComposition() {
if (!_blaster)
return;
+ debugC(1, kDebugSound, "SoundBlaster: Stopping composition");
+
_blaster->stopComposition();
}
@@ -327,6 +361,8 @@ void Sound::blasterWaitEndPlay(bool interruptible, bool stopComp) {
if (!_blaster)
return;
+ debugC(1, kDebugSound, "SoundBlaster: Waiting for playback to end");
+
if (stopComp)
_blaster->endComposition();
@@ -345,6 +381,8 @@ void Sound::cdLoadLIC(const char *fname) {
if (!_cdrom)
return;
+ debugC(1, kDebugSound, "CDROM: Loading LIC \"%s\"", fname);
+
int handle = _vm->_dataIO->openData(fname);
if (handle == -1)
@@ -366,6 +404,8 @@ void Sound::cdUnloadLIC() {
if (!_cdrom)
return;
+ debugC(1, kDebugSound, "CDROM: Unloading LIC");
+
_cdrom->freeLICBuffer();
}
@@ -400,6 +440,9 @@ void Sound::cdPlayBgMusic() {
for (int i = 0; i < ARRAYSIZE(tracks); i++)
if (!scumm_stricmp(_vm->_game->_curTotFile, tracks[i][0])) {
+ debugC(1, kDebugSound, "CDROM: Playing background music \"%s\" (\"%s\")",
+ tracks[i][1], _vm->_game->_curTotFile);
+
_cdrom->startTrack(tracks[i][1]);
break;
}
@@ -422,6 +465,9 @@ void Sound::cdPlayMultMusic() {
int language = _vm->_global->_language <= 4 ? _vm->_global->_language : 2;
for (int i = 0; i < ARRAYSIZE(tracks); i++)
if (!scumm_stricmp(_vm->_game->_curTotFile, tracks[i][0])) {
+ debugC(1, kDebugSound, "CDROM: Playing mult music \"%s\" (\"%s\")",
+ tracks[i][language + 1], _vm->_game->_curTotFile);
+
_cdrom->startTrack(tracks[i][language + 1]);
break;
}
@@ -431,6 +477,7 @@ void Sound::cdPlay(const char *trackName) {
if (!_cdrom)
return;
+ debugC(1, kDebugSound, "CDROM: Playing track \"%s\"", trackName);
_cdrom->startTrack(trackName);
}
@@ -438,6 +485,7 @@ void Sound::cdStop() {
if (!_cdrom)
return;
+ debugC(1, kDebugSound, "CDROM: Stopping playback");
_cdrom->stopPlaying();
}
@@ -473,6 +521,8 @@ void Sound::bgPlay(const char *base, int count) {
if (!_bgatmos)
return;
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Playing \"%s\" (%d)", base, count);
+
_bgatmos->stop();
_bgatmos->queueClear();
@@ -495,6 +545,8 @@ void Sound::bgStop() {
if (!_bgatmos)
return;
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Stopping playback");
+
_bgatmos->stop();
_bgatmos->queueClear();
}
@@ -510,6 +562,8 @@ void Sound::bgShade() {
if (!_bgatmos)
return;
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Shading playback");
+
_bgatmos->shade();
}
@@ -517,6 +571,8 @@ void Sound::bgUnshade() {
if (!_bgatmos)
return;
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Unshading playback");
+
_bgatmos->unshade();
}