From 8bdfb7889572b680add712d461ebd868329e42b9 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sun, 12 Mar 2017 16:03:06 -0500 Subject: SCI32: Add debugger command to list digital audio samples --- engines/sci/sound/audio32.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'engines/sci/sound/audio32.cpp') diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp index df21a5fdcb..b61bbd9a4e 100644 --- a/engines/sci/sound/audio32.cpp +++ b/engines/sci/sound/audio32.cpp @@ -35,6 +35,7 @@ #include "common/textconsole.h" // for warning #include "common/types.h" // for Flag::NO #include "engine.h" // for Engine, g_engine +#include "sci/console.h" // for Console #include "sci/engine/features.h" // for GameFeatures #include "sci/engine/guest_additions.h" // for GuestAdditions #include "sci/engine/state.h" // for EngineState @@ -1185,4 +1186,34 @@ void Audio32::kernelLoop(const int argc, const reg_t *const argv) { setLoop(channelIndex, loop); } +#pragma mark - +#pragma mark Debugging + +void Audio32::printAudioList(Console *con) const { + Common::StackLock lock(_mutex); + for (int i = 0; i < _numActiveChannels; ++i) { + const AudioChannel &channel = _channels[i]; + con->debugPrintf(" %d[%04x:%04x]: %s, started at %d, pos %d/%d, vol %d, pan %d%s%s\n", + i, + PRINT_REG(channel.soundNode), + channel.robot ? "robot" : channel.resource->name().c_str(), + channel.startedAtTick, + (g_sci->getTickCount() - channel.startedAtTick) % channel.duration, + channel.duration, + channel.volume, + channel.pan, + channel.loop ? ", looping" : "", + channel.pausedAtTick ? ", paused" : ""); + if (channel.fadeStartTick) { + con->debugPrintf(" fade: vol %d -> %d, started at %d, pos %d/%d%s\n", + channel.fadeStartVolume, + channel.fadeTargetVolume, + channel.fadeStartTick, + (g_sci->getTickCount() - channel.fadeStartTick) % channel.duration, + channel.fadeDuration, + channel.stopChannelOnFade ? ", stopping" : ""); + } + } +} + } // End of namespace Sci -- cgit v1.2.3