diff options
Diffstat (limited to 'engines/sci/sound/drivers')
-rw-r--r-- | engines/sci/sound/drivers/amigamac.cpp | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp index 158b4b08fb..2f159c23ee 100644 --- a/engines/sci/sound/drivers/amigamac.cpp +++ b/engines/sci/sound/drivers/amigamac.cpp @@ -33,8 +33,6 @@ namespace Sci { -//#define DEBUG - class MidiDriver_AmigaMac : public MidiDriver_Emulated { public: enum { @@ -287,12 +285,10 @@ void MidiDriver_AmigaMac::playInstrument(int16 *dest, Voice *channel, int count) } void MidiDriver_AmigaMac::changeInstrument(int channel, int instrument) { -#ifdef DEBUG - if (_bank.instruments[instrument][0]) - debugN("Amiga/Mac driver: Setting channel %i to \"%s\" (%i)\n", channel, _bank.instruments[instrument].name, instrument); + if (((uint)instrument < _bank.instruments.size()) && (_bank.instruments[instrument].size() > 0)) + debugC(1, kDebugLevelSound, "Amiga/Mac driver: Setting channel %i to \"%s\" (%i)", channel, _bank.instruments[instrument].name, instrument); else - warning("Amiga/Mac driver: instrument %i does not exist (channel %i)", instrument, channel); -#endif + debugC(kDebugLevelSound, "Amiga/Mac driver: instrument %i does not exist (channel %i)", instrument, channel); _channels[channel].instrument = instrument; } @@ -325,9 +321,7 @@ void MidiDriver_AmigaMac::stopNote(int ch, int note) { break; if (channel == kChannels) { -#ifdef DEBUG - warning("Amiga/Mac driver: cannot stop note %i on channel %i", note, ch); -#endif + debugC(1, kDebugLevelSound, "Amiga/Mac driver: cannot stop note %i on channel %i", note, ch); return; } @@ -488,15 +482,13 @@ MidiDriver_AmigaMac::InstrumentSample *MidiDriver_AmigaMac::readInstrumentSCI0(C strncpy(instrument->name, (char *) header + 2, 29); instrument->name[29] = 0; -#ifdef DEBUG - debugN("Amiga/Mac driver: Reading instrument %i: \"%s\" (%i bytes)\n", - *id, instrument->name, size); - debugN(" Mode: %02x\n", instrument->mode); - debugN(" Looping: %s\n", instrument->mode & kModeLoop ? "on" : "off"); - debugN(" Pitch changes: %s\n", instrument->mode & kModePitch ? "on" : "off"); - debugN(" Segment sizes: %i %i %i\n", seg_size[0], seg_size[1], seg_size[2]); - debugN(" Segment offsets: 0 %i %i\n", loop_offset, (int32)READ_BE_UINT32(header + 43)); -#endif + debugC(kDebugLevelSound, "Amiga/Mac driver: Reading instrument %i: \"%s\" (%i bytes)", + *id, instrument->name, size); + debugC(kDebugLevelSound, " Mode: %02x", instrument->mode); + debugC(kDebugLevelSound, " Looping: %s", instrument->mode & kModeLoop ? "on" : "off"); + debugC(kDebugLevelSound, " Pitch changes: %s", instrument->mode & kModePitch ? "on" : "off"); + debugC(kDebugLevelSound, " Segment sizes: %i %i %i", seg_size[0], seg_size[1], seg_size[2]); + debugC(kDebugLevelSound, " Segment offsets: 0 %i %i", loop_offset, (int32)READ_BE_UINT32(header + 43)); instrument->samples = (int8 *) malloc(size + 1); if (file.read(instrument->samples, size) < (unsigned int)size) { |