From 400ee8c461e8060393b62be639c27dd3820dccd4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 2 Nov 2009 21:42:21 +0000 Subject: Enhance VOC debug output svn-id: r45615 --- sound/voc.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sound/voc.cpp b/sound/voc.cpp index a5bab0af29..9179f5e7e5 100644 --- a/sound/voc.cpp +++ b/sound/voc.cpp @@ -52,6 +52,8 @@ int getSampleRateFromVOCRate(int vocSR) { static byte *loadVOCFromStream(Common::ReadStream &stream, int &size, int &rate, int &loops, int &begin_loop, int &end_loop) { VocFileHeader fileHeader; + debug(2, "loadVOCFromStream"); + if (stream.read(&fileHeader, 8) != 8) goto invalid; @@ -92,6 +94,8 @@ static byte *loadVOCFromStream(Common::ReadStream &stream, int &size, int &rate, len |= stream.readByte() << 8; len |= stream.readByte() << 16; + debug(2, "Block code %d, len %d", code, len); + switch (code) { case 1: case 9: { @@ -153,7 +157,7 @@ static byte *loadVOCFromStream(Common::ReadStream &stream, int &size, int &rate, stream.readByte(); break; default: - warning("Unhandled code in VOC file : %d", code); + warning("Unhandled code %d in VOC file (len %d)", code, len); return ret_sound; } } @@ -174,6 +178,9 @@ int parseVOCFormat(Common::SeekableReadStream& stream, LinearDiskStreamAudioBloc int currentBlock = 0; int size = 0; + debug(2, "parseVOCFormat"); + + if (stream.read(&fileHeader, 8) != 8) goto invalid; @@ -213,6 +220,8 @@ int parseVOCFormat(Common::SeekableReadStream& stream, LinearDiskStreamAudioBloc len |= stream.readByte() << 8; len |= stream.readByte() << 16; + debug(2, "Block code %d, len %d", code, len); + switch (code) { case 1: case 9: { @@ -276,7 +285,7 @@ int parseVOCFormat(Common::SeekableReadStream& stream, LinearDiskStreamAudioBloc stream.readByte(); break; default: - warning("Unhandled code in VOC file : %d", code); + warning("Unhandled code %d in VOC file (len %d)", code, len); return 0; } } -- cgit v1.2.3