diff options
-rw-r--r-- | engines/sci/engine/ksound.cpp | 4 | ||||
-rw-r--r-- | engines/sci/gfx/gfx_resmgr.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sfx/iterator.cpp | 23 |
3 files changed, 15 insertions, 14 deletions
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index ba70bf9f73..7614b2bc10 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -940,14 +940,14 @@ reg_t kDoSound_SCI1(EngineState *s, int funct_nr, int argc, reg_t *argv) { case SI_ABSOLUTE_CUE: signal = cue; - fprintf(stderr, "[CUE] %04x:%04x Absolute Cue: %d\n", + debugC(2, kDebugLevelSound, "[CUE] %04x:%04x Absolute Cue: %d\n", PRINT_REG(obj), signal); PUT_SEL32V(obj, signal, signal); break; case SI_RELATIVE_CUE: - fprintf(stderr, "[CUE] %04x:%04x Relative Cue: %d\n", + debugC(2, kDebugLevelSound, "[CUE] %04x:%04x Relative Cue: %d\n", PRINT_REG(obj), cue); PUT_SEL32V(obj, dataInc, cue); diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp index d6d5a9ec3c..98c5c12a70 100644 --- a/engines/sci/gfx/gfx_resmgr.cpp +++ b/engines/sci/gfx/gfx_resmgr.cpp @@ -619,7 +619,7 @@ gfx_bitmap_font_t *GfxResManager::getFont(int num, bool scaled) { // Workaround: LSL1VGA mixes its own internal fonts with the global // SCI ones, so we translate them here, by removing their extra bits if (!resMap.contains(num) && !_resManager->testResource(ResourceId(kResourceTypeFont, num))) - num = num & 0x7ff; + num = num & 0x7ff; res = resMap.contains(num) ? resMap[num] : NULL; diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp index 4e5b20a5d2..ebba4bceac 100644 --- a/engines/sci/sfx/iterator.cpp +++ b/engines/sci/sfx/iterator.cpp @@ -27,6 +27,7 @@ #include "common/util.h" +#include "sci/sci.h" #include "sci/sfx/iterator_internal.h" #include "sci/sfx/misc.h" // for sfx_player_tell_synth #include "sci/tools.h" @@ -233,7 +234,7 @@ int BaseSongIterator::parseMidiCommand(byte *buf, int *result, SongIteratorChann channel->state = SI_STATE_DELTA_TIME; channel->total_timepos = channel->loop_timepos; channel->last_cmd = 0xfe; - fprintf(stderr, "Looping song iterator %08lx.\n", ID); + debugC(2, kDebugLevelSound, "Looping song iterator %08lx.\n", ID); return SI_LOOP; } else { channel->state = SI_STATE_FINISHED; @@ -379,7 +380,7 @@ int BaseSongIterator::processMidi(byte *buf, int *result, channel->state = SI_STATE_FINISHED; delay = (size * 50 + format.rate - 1) / format.rate; /* number of ticks to completion*/ - fprintf(stderr, "delaying %d ticks\n", delay); + debugC(2, kDebugLevelSound, "delaying %d ticks\n", delay); return delay; } @@ -523,7 +524,7 @@ static int _sci0_get_pcm_data(Sci0SongIterator *self, } static Audio::AudioStream *makeStream(byte *data, int size, sfx_pcm_config_t conf) { - printf("Playing PCM data of size %d, rate %d\n", size, conf.rate); + debugC(2, kDebugLevelSound, "Playing PCM data of size %d, rate %d\n", size, conf.rate); // Duplicate the data byte *sound = (byte *)malloc(size); @@ -563,7 +564,7 @@ SongIterator *Sci0SongIterator::handleMessage(Message msg) { case _SIMSG_BASEMSG_PRINT: print_tabs_id(msg._arg.i, ID); - fprintf(stderr, "SCI0: dev=%d, active-chan=%d, size=%d, loops=%d\n", + debugC(2, kDebugLevelSound, "SCI0: dev=%d, active-chan=%d, size=%d, loops=%d\n", _deviceId, _numActiveChannels, _data.size(), _loops); break; @@ -980,7 +981,7 @@ SongIterator *Sci1SongIterator::handleMessage(Message msg) { playmask |= _channels[i].playmask; print_tabs_id(msg._arg.i, ID); - fprintf(stderr, "SCI1: chan-nr=%d, playmask=%04x\n", + debugC(2, kDebugLevelSound, "SCI1: chan-nr=%d, playmask=%04x\n", _numChannels, playmask); } break; @@ -1142,7 +1143,7 @@ public: SongIterator *CleanupSongIterator::handleMessage(Message msg) { if (msg._class == _SIMSG_BASEMSG_PRINT && msg._type == _SIMSG_BASEMSG_PRINT) { print_tabs_id(msg._arg.i, ID); - fprintf(stderr, "CLEANUP\n"); + debugC(2, kDebugLevelSound, "CLEANUP\n"); } return NULL; @@ -1208,7 +1209,7 @@ SongIterator *FastForwardSongIterator::handleMessage(Message msg) { if (msg._class == _SIMSG_BASE && msg._type == _SIMSG_BASEMSG_PRINT) { print_tabs_id(msg._arg.i, ID); - fprintf(stderr, "FASTFORWARD:\n"); + debugC(2, kDebugLevelSound, "FASTFORWARD:\n"); msg._arg.i++; } @@ -1532,7 +1533,7 @@ SongIterator *TeeSongIterator::handleMessage(Message msg) { if (msg._class == _SIMSG_BASE && msg._type == _SIMSG_BASEMSG_PRINT) { print_tabs_id(msg._arg.i, ID); - fprintf(stderr, "TEE:\n"); + debugC(2, kDebugLevelSound, "TEE:\n"); msg._arg.i++; } @@ -1576,15 +1577,15 @@ int songit_next(SongIterator **it, byte *buf, int *result, int mask) { do { retval = (*it)->nextCommand(buf, result); if (retval == SI_MORPH) { - fprintf(stderr, " Morphing %p (stored at %p)\n", (void *)*it, (void *)it); + debugC(2, kDebugLevelSound, " Morphing %p (stored at %p)\n", (void *)*it, (void *)it); if (!SIMSG_SEND((*it), SIMSG_ACK_MORPH)) { error("SI_MORPH failed. Breakpoint in %s, line %d", __FILE__, __LINE__); } else - fprintf(stderr, "SI_MORPH successful\n"); + debugC(2, kDebugLevelSound, "SI_MORPH successful\n"); } if (retval == SI_FINISHED) - fprintf(stderr, "[song-iterator] Song finished. mask = %04x, cm=%04x\n", + debugC(2, kDebugLevelSound, "[song-iterator] Song finished. mask = %04x, cm=%04x\n", mask, (*it)->channel_mask); if (retval == SI_FINISHED && (mask & IT_READER_MAY_CLEAN) |