[Scummvm-git-logs] scummvm master -> 94403bd3a95cee5a4ada239833b6211930147fde

bluegr noreply at scummvm.org
Sat Nov 16 16:45:14 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
94403bd3a9 DGDS: Raise debuglevel of all debug statements to at least 1


Commit: 94403bd3a95cee5a4ada239833b6211930147fde
    https://github.com/scummvm/scummvm/commit/94403bd3a95cee5a4ada239833b6211930147fde
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-16T18:44:46+02:00

Commit Message:
DGDS: Raise debuglevel of all debug statements to at least 1

This reduces the chatty debug output, which isn't of any use to
regular users

Changed paths:
    engines/dgds/ads.cpp
    engines/dgds/dgds.cpp
    engines/dgds/dialog.cpp
    engines/dgds/dragon_native.cpp
    engines/dgds/font.cpp
    engines/dgds/globals.cpp
    engines/dgds/image.cpp
    engines/dgds/menu.cpp
    engines/dgds/minigames/dragon_arcade.cpp
    engines/dgds/minigames/dragon_arcade_ttm.cpp
    engines/dgds/parser.cpp
    engines/dgds/request.cpp
    engines/dgds/resource.cpp
    engines/dgds/scene.cpp
    engines/dgds/sound.cpp
    engines/dgds/sound/drivers/adlib.cpp
    engines/dgds/sound/drivers/midipatch.cpp
    engines/dgds/sound/midiparser_sci.cpp
    engines/dgds/sound/music.cpp
    engines/dgds/ttm.cpp


diff --git a/engines/dgds/ads.cpp b/engines/dgds/ads.cpp
index 2700c6b3995..6c27d8e9e77 100644
--- a/engines/dgds/ads.cpp
+++ b/engines/dgds/ads.cpp
@@ -78,7 +78,7 @@ bool ADSInterpreter::load(const Common::String &filename) {
 	if (!_vm->getResourceManager()->hasResource(detailfile))
 		detailfile = filename;
 
-	debug("ADSInterpreter: load %s", detailfile.c_str());
+	debug(1, "ADSInterpreter: load %s", detailfile.c_str());
 
 	// Reset the state
 	_adsTexts.setVal(detailfile, ADSData());
@@ -91,7 +91,7 @@ bool ADSInterpreter::load(const Common::String &filename) {
 		if (file.empty())
 			continue;
 		_adsData->_scriptEnvs.resize(_adsData->_scriptEnvs.size() + 1);
-		debug("   load TTM %s to env %d", file.c_str(), _adsData->_scriptEnvs.size());
+		debug(1, "   load TTM %s to env %d", file.c_str(), _adsData->_scriptEnvs.size());
 		TTMEnviro &data = _adsData->_scriptEnvs.back();
 		data._enviro = _adsData->_scriptEnvs.size();
 		_ttmInterpreter->load(file, data);
diff --git a/engines/dgds/dgds.cpp b/engines/dgds/dgds.cpp
index f483cdc1e55..8e83eba1c27 100644
--- a/engines/dgds/dgds.cpp
+++ b/engines/dgds/dgds.cpp
@@ -168,7 +168,7 @@ void DgdsEngine::loadIcons() {
 bool DgdsEngine::changeScene(int sceneNum) {
 	assert(_scene && _adsInterp);
 
-	debug("CHANGE SCENE %d -> %d (clock %s)", _scene->getNum(), sceneNum, _clock.dump().c_str());
+	debug(1, "CHANGE SCENE %d -> %d (clock %s)", _scene->getNum(), sceneNum, _clock.dump().c_str());
 
 	if (sceneNum == _scene->getNum()) {
 		warning("Tried to change from scene %d to itself, doing nothing.", sceneNum);
@@ -235,7 +235,7 @@ bool DgdsEngine::changeScene(int sceneNum) {
 	else
 		_adsInterp->unload();
 
-	debug("%s", _scene->dump("").c_str());
+	debug(1, "%s", _scene->dump("").c_str());
 	_scene->runEnterSceneOps();
 
 	_justChangedScene1 = true;
@@ -379,7 +379,7 @@ void DgdsEngine::loadGameFiles() {
 		_gdsScene->load("DRAGON.GDS", _resource, _decompressor);
 		_rstFileName = "DRAGON.RST";
 
-		debug("%s", _gdsScene->dump("").c_str());
+		debug(1, "%s", _gdsScene->dump("").c_str());
 
 		loadCorners("DCORNERS.BMP");
 		reqParser.parse(&invRequestData, "DINV.REQ");
@@ -392,7 +392,7 @@ void DgdsEngine::loadGameFiles() {
 		_gdsScene->load("HOC.GDS", _resource, _decompressor);
 		_rstFileName = "HOC.RST";
 
-		debug("%s", _gdsScene->dump("").c_str());
+		debug(1, "%s", _gdsScene->dump("").c_str());
 
 		loadCorners("HCORNERS.BMP");
 		reqParser.parse(&invRequestData, "HINV.REQ");
@@ -415,7 +415,7 @@ void DgdsEngine::loadGameFiles() {
 			loadCorners("SOWCORNERS.BMP");
 		}
 
-		debug("%s", _gdsScene->dump("").c_str());
+		debug(1, "%s", _gdsScene->dump("").c_str());
 
 		reqParser.parse(&invRequestData, "WINV.REQ");
 		reqParser.parse(&vcrRequestData, "WVCR.REQ");
@@ -426,7 +426,7 @@ void DgdsEngine::loadGameFiles() {
 		_gamePals->loadPalette("MRALLY.PAL");
 		_gdsScene->load("MRALLY.GDS", _resource, _decompressor);
 
-		debug("%s", _gdsScene->dump("").c_str());
+		debug(1, "%s", _gdsScene->dump("").c_str());
 
 		loadCorners("MCORNERS.BMP");
 		reqParser.parse(&invRequestData, "TOOLINFO.REQ");
@@ -462,8 +462,8 @@ void DgdsEngine::loadGameFiles() {
 	_inventory->setRequestData(invRequestData);
 	_menu->setRequestData(vcrRequestData);
 
-	debug("Parsed Inv Request:\n%s", invRequestData.dump().c_str());
-	debug("Parsed VCR Request:\n%s", vcrRequestData.dump().c_str());
+	debug(1, "Parsed Inv Request:\n%s", invRequestData.dump().c_str());
+	debug(1, "Parsed VCR Request:\n%s", vcrRequestData.dump().c_str());
 }
 
 void DgdsEngine::loadRestartFile() {
@@ -892,7 +892,7 @@ Common::Error DgdsEngine::syncGame(Common::Serializer &s) {
 		_storedAreaBuffer.fillRect(Common::Rect(SCREEN_WIDTH, SCREEN_HEIGHT), 0);
 	}
 
-	debug("%s", _scene->dump("").c_str());
+	debug(1, "%s", _scene->dump("").c_str());
 	_scene->runEnterSceneOps();
 
 	return Common::kNoError;
diff --git a/engines/dgds/dialog.cpp b/engines/dgds/dialog.cpp
index ff6a38f8e25..72951913a93 100644
--- a/engines/dgds/dialog.cpp
+++ b/engines/dgds/dialog.cpp
@@ -641,7 +641,7 @@ void Dialog::updateSelectedAction(int delta) {
 	}
 
 	if (_action.size() > 1 || !delta) {
-		debug("Dialog %d: update mouse to %d, %d (mouseloc %d, selnum %d)", _num, mouseX, mouseY, _state->_strMouseLoc, _lastSelectedDialogItemNum);
+		debug(1, "Dialog %d: update mouse to %d, %d (mouseloc %d, selnum %d)", _num, mouseX, mouseY, _state->_strMouseLoc, _lastSelectedDialogItemNum);
 		g_system->warpMouse(mouseX, mouseY);
 	}
 }
diff --git a/engines/dgds/dragon_native.cpp b/engines/dgds/dragon_native.cpp
index 126a89aebaa..ff294fd5949 100644
--- a/engines/dgds/dragon_native.cpp
+++ b/engines/dgds/dragon_native.cpp
@@ -64,7 +64,7 @@ static uint16 passcodeVal4 = 0;
 	if (globalval >= 30) {
 		// One of the keypad buttons
 		if (DRAGON_PASSCODE[passcodeVal4 + passcodeBlockNum * 15] == globalval - 30) {
-			debug("sceneOpUpdatePasscodeGlobal CORRECT: variables %d %d %d %d block %d, curval %d",
+			debug(1, "sceneOpUpdatePasscodeGlobal CORRECT: variables %d %d %d %d block %d, curval %d",
 				passcodeVal1, passcodeVal2, passcodeVal3, passcodeVal4, passcodeBlockNum, globalval);
 
 			// Correct entry! Increment the expected button
@@ -79,7 +79,7 @@ static uint16 passcodeVal4 = 0;
 			}
 		} else {
 			// Mistake
-			debug("sceneOpUpdatePasscodeGlobal WRONG: variables %d %d %d %d block %d, curval %d",
+			debug(1, "sceneOpUpdatePasscodeGlobal WRONG: variables %d %d %d %d block %d, curval %d",
 				passcodeVal1, passcodeVal2, passcodeVal3, passcodeVal4, passcodeBlockNum, globalval);
 			passcodeVal1 = 0;
 			passcodeVal2 = 5;
@@ -89,7 +89,7 @@ static uint16 passcodeVal4 = 0;
 		if (globalval > 4 || globalval == 0)
 			return;
 
-		debug("sceneOpUpdatePasscodeGlobal OTHER: variables %d %d %d %d block %d, curval %d",
+		debug(1, "sceneOpUpdatePasscodeGlobal OTHER: variables %d %d %d %d block %d, curval %d",
 				passcodeVal1, passcodeVal2, passcodeVal3, passcodeVal4, passcodeBlockNum, globalval);
 
 		if (globalval < 4) {
diff --git a/engines/dgds/font.cpp b/engines/dgds/font.cpp
index 88eb4f493f9..bb20f03093e 100644
--- a/engines/dgds/font.cpp
+++ b/engines/dgds/font.cpp
@@ -52,7 +52,7 @@ DgdsFont *DgdsFont::load(const Common::String &filename, ResourceManager *resour
 		if (chunk.isSection(ID_FNT)) {
 			byte magic = stream->readByte();
 			stream->seek(-1, SEEK_CUR);
-			debug("    magic: %u", magic);
+			debug(1, "    magic: %u", magic);
 
 			if (magic != 0xFF)
 				font = FFont::load(*stream);
@@ -133,7 +133,7 @@ FFont *FFont::load(Common::SeekableReadStream &input) {
 
 	assert((4 + size) == input.size());
 
-	debug("FFont w: %u, h: %u, start: 0x%x, count: %u", w, h, start, count);
+	debug(1, "FFont w: %u, h: %u, start: 0x%x, count: %u", w, h, start, count);
 
 	byte *data = new byte[size];
 	input.read(data, size);
@@ -178,7 +178,7 @@ PFont *PFont::load(Common::SeekableReadStream &input, Decompressor *decompressor
 	byte count = input.readByte();
 	int size = input.readUint16LE();
 
-	debug("PFont magic: 0x%x, w: %u, h: %u, unk: %u, start: 0x%x, count: %u, size: %u",
+	debug(1, "PFont magic: 0x%x, w: %u, h: %u, unk: %u, start: 0x%x, count: %u, size: %u",
 			magic, w, h, unknown, start, count, size);
 
 	assert(magic == 0xFF);
diff --git a/engines/dgds/globals.cpp b/engines/dgds/globals.cpp
index 34d2e7d6d71..a8fe03a5b96 100644
--- a/engines/dgds/globals.cpp
+++ b/engines/dgds/globals.cpp
@@ -109,7 +109,7 @@ int16 Globals::getGlobal(uint16 num) {
 }
 
 int16 Globals::setGlobal(uint16 num, int16 val) {
-	//debug("setGlobal %d -> %d", num, val);
+	//debug(1, "setGlobal %d -> %d", num, val);
 	for (auto &global : _globals) {
 		if (global->getNum() == num)
 			return global->set(val);
diff --git a/engines/dgds/image.cpp b/engines/dgds/image.cpp
index 535224dea59..c942ad7a47b 100644
--- a/engines/dgds/image.cpp
+++ b/engines/dgds/image.cpp
@@ -95,7 +95,7 @@ void Image::drawScreen(const Common::String &filename, Graphics::ManagedSurface
 				error("Trying to load SCR size %d x %d which is larger than screen %d x %d",
 					xsize, ysize, surface.w, surface.h);
 			}
-			debug("screen file %s dims %d x %d into surface %d x %d",
+			debug(1, "screen file %s dims %d x %d into surface %d x %d",
 				filename.c_str(), xsize, ysize, surface.w, surface.h);
 		} else if (chunk.isSection(ID_VGA)) {
 			loadBitmap4(&surface, 0, stream, true, xsize, ysize);
@@ -187,7 +187,7 @@ void Image::loadBitmap(const Common::String &filename) {
 			_matrixY = stream->readUint16LE();
 			uint32 mcount = (uint32)_matrixX * _matrixY;
 			_tileMatrix.resize(mcount);
-			debug("		%u x %u: mtx vals", _matrixX, _matrixY);
+			debug(1, "		%u x %u: mtx vals", _matrixX, _matrixY);
 
 			for (uint32 k = 0; k < mcount; k++) {
 				uint16 tile;
diff --git a/engines/dgds/menu.cpp b/engines/dgds/menu.cpp
index 2c01ebe0e1d..dcbe8a9703d 100644
--- a/engines/dgds/menu.cpp
+++ b/engines/dgds/menu.cpp
@@ -564,7 +564,7 @@ void Menu::handleClick(const Common::Point &mouse) {
 		drawMenu(_curMenu);
 		break;
 	default:
-		debug("Clicked ID %d", clickedMenuItem);
+		debug(1, "Clicked ID %d", clickedMenuItem);
 		break;
 	}
 }
diff --git a/engines/dgds/minigames/dragon_arcade.cpp b/engines/dgds/minigames/dragon_arcade.cpp
index 7d1a5f7abd2..e30c8eccb41 100644
--- a/engines/dgds/minigames/dragon_arcade.cpp
+++ b/engines/dgds/minigames/dragon_arcade.cpp
@@ -361,7 +361,7 @@ void DragonArcade::checkEnemyFireStage0124() {
 		for (int j = 0; j < 4; j++) {
 			if (_npcState[i].x < 340 && -20 < _npcState[i].x &&
 				ENEMY_FIRE_ALLOWABLE_PAGES[j] == _npcState[i].ttmPage) {
-				debug("enemy %d @ %d firing type %d on page %d", i, _npcState[i].x, j, _npcState[i].ttmPage);
+				debug(1, "enemy %d @ %d firing type %d on page %d", i, _npcState[i].x, j, _npcState[i].ttmPage);
 				ImageFlipMode flipMode = (_npcState[i].ttmPage < 29) ? kImageFlipNone : kImageFlipH;
 				createBullet(ENEMY_FIRE_X_OFFSETS[j] + _npcState[i].xx - _scrollXOffset * 8 - 0xa0,
 							 ENEMY_FIRE_Y_OFFSETS[j] + _npcState[i].yy + 3, flipMode, 1);
@@ -1977,7 +1977,7 @@ void DragonArcade::handleMouseStates() {
 			// Not jumping left or right
 			_bladeState1 = 1;
 			_npcState[0].ttmPage = _bladePageOffset + 15;
-			debug("Move: blade jump up -> ttm %d", _npcState[0].ttmPage);
+			debug(1, "Move: blade jump up -> ttm %d", _npcState[0].ttmPage);
 		} else {
 			// Jump to left or right
 			if ((_bladeMoveFlag & kBladeMoveLeft) == kBladeMoveNone) {
@@ -1988,7 +1988,7 @@ void DragonArcade::handleMouseStates() {
 			_isMovingStage = false;
 			_bladeState1 = 2;
 			_npcState[0].ttmPage = _bladePageOffset + 45;
-			debug("Move: blade jump up -> ttm %d velocity %d", _npcState[0].ttmPage, _scrollVelocityX);
+			debug(1, "Move: blade jump up -> ttm %d velocity %d", _npcState[0].ttmPage, _scrollVelocityX);
 		}
 
 		if ((_bladeMoveFlagBeforeRButton & kBladeMoveDown) != kBladeMoveNone) {
@@ -1999,7 +1999,7 @@ void DragonArcade::handleMouseStates() {
 				} else {
 					_npcState[0].ttmPage = _bladePageOffset + 22;
 				}
-				debug("Move: blade jump down -> ttm %d", _npcState[0].ttmPage);
+				debug(1, "Move: blade jump down -> ttm %d", _npcState[0].ttmPage);
 				_arcadeTTM._startYOffset++;
 				_uint0a17++;
 				_currentYOffset = _arcadeTTM._startYOffset;
diff --git a/engines/dgds/minigames/dragon_arcade_ttm.cpp b/engines/dgds/minigames/dragon_arcade_ttm.cpp
index 8147d5bd045..e4b7aea861b 100644
--- a/engines/dgds/minigames/dragon_arcade_ttm.cpp
+++ b/engines/dgds/minigames/dragon_arcade_ttm.cpp
@@ -55,7 +55,7 @@ int16 DragonArcadeTTM::load(const char *filename) {
 	for (envNum = 0; envNum < ARRAYSIZE(_ttmEnvs); envNum++) {
 		if (_ttmEnvs[envNum].scr == nullptr) {
 			env = &_ttmEnvs[envNum];
-			debug("Arcade TTM load %s into env %d", filename, envNum);
+			debug(1, "Arcade TTM load %s into env %d", filename, envNum);
 			break;
 		}
 	}
@@ -134,7 +134,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
 		engine->adsInterpreter()->setScriptDelay((int)(ivals[0] * MS_PER_FRAME));
 		break;
 	case 0x1031: // SET BRUSH
-		//debug("Set brush %d for slot %d", ivals[0], _currentTTMNum);
+		//debug(1, "Set brush %d for slot %d", ivals[0], _currentTTMNum);
 		if (!_shapes2[_currentTTMNum]) {
 			_brushes[_currentTTMNum].reset();
 		} else {
@@ -143,7 +143,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
 		break;
 	case 0x1051: // SET SHAPE
 		_shapes3[_currentTTMNum] = ivals[0];
-		//debug("Set img %d into slot %d", ivals[0], _currentTTMNum);
+		//debug(1, "Set img %d into slot %d", ivals[0], _currentTTMNum);
 		_shapes[_currentTTMNum] = _allShapes[ivals[0] * 5 + _currentTTMNum];
 		_shapes2[_currentTTMNum] = _allShapes[ivals[0] * 5 + _currentTTMNum];
 		break;
@@ -203,7 +203,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
 			data.width = ivals[2];
 			data.yval = (byte)ivals[1];
 			data.flag = false;
-			debug("Floor: %s", data.dump().c_str());
+			debug(1, "Floor: %s", data.dump().c_str());
 			_floorData.push_back(data);
 		} else {
 			const Common::Rect rect(Common::Point(ivals[0], ivals[1]), ivals[2], ivals[3]);
@@ -217,7 +217,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
 			data.width = ivals[2];
 			data.yval = (byte)ivals[1];
 			data.flag = true;
-			debug("Floor: %s", data.dump().c_str());
+			debug(1, "Floor: %s", data.dump().c_str());
 			_floorData.push_back(data);
 		} else {
 			const Common::Rect r(Common::Point(ivals[0], ivals[1]), ivals[2] - 1, ivals[3] - 1);
@@ -273,7 +273,7 @@ int16 DragonArcadeTTM::handleOperation(TTMEnviro &env, int16 page, uint16 op, by
 	case 0xF02F: {
 		_shapes[_currentTTMNum].reset(new Image(engine->getResourceManager(), engine->getDecompressor()));
 		_shapes[_currentTTMNum]->loadBitmap(sval);
-		debug("Load img %s into slot %d", sval.c_str(), _currentTTMNum);
+		debug(1, "Load img %s into slot %d", sval.c_str(), _currentTTMNum);
 		_shapes2[_currentTTMNum] = _shapes[_currentTTMNum];
 		_allShapes[_shapes3[_currentTTMNum] * 5 + _currentTTMNum] = _shapes[_currentTTMNum];
 		break;
diff --git a/engines/dgds/parser.cpp b/engines/dgds/parser.cpp
index e2c0f362cdf..cf29c344276 100644
--- a/engines/dgds/parser.cpp
+++ b/engines/dgds/parser.cpp
@@ -77,12 +77,12 @@ bool DgdsParser::parse(ParserData *data, const Common::String &filename) {
 Common::HashMap<uint16, Common::String> DgdsParser::readTags(Common::SeekableReadStream *stream) {
 	Common::HashMap<uint16, Common::String> tags;
 	uint16 count = stream->readUint16LE();
-	debug("        %u tags:", count);
+	debug(1, "        %u tags:", count);
 
 	for (uint16 i = 0; i < count; i++) {
 		uint16 idx = stream->readUint16LE();
 		const Common::String tagVal = stream->readString();
-		debug("        %2u: %2u, \"%s\"", i, idx, tagVal.c_str());
+		debug(1, "        %2u: %2u, \"%s\"", i, idx, tagVal.c_str());
 		// TODO: How to handle when these IDs overlap? (eg, see
 		// BBEDROOM.TTM in RotD)
 		if (!tags.contains(idx))
diff --git a/engines/dgds/request.cpp b/engines/dgds/request.cpp
index 682d1d8a576..a345669b0cb 100644
--- a/engines/dgds/request.cpp
+++ b/engines/dgds/request.cpp
@@ -638,7 +638,7 @@ int16 SliderGadget::onClick(const Common::Point &mousePt) {
 	else
 		newVal--;
 
-	debug("clicked on slider %d, move val from %d -> %d", _gadgetNo, val, newVal);
+	debug(1, "clicked on slider %d, move val from %d -> %d", _gadgetNo, val, newVal);
 
 	newVal = CLIP((int)newVal, 0, _steps - 1);
 	setValue(newVal);
diff --git a/engines/dgds/resource.cpp b/engines/dgds/resource.cpp
index 4d660b8be20..890dd8ceafe 100644
--- a/engines/dgds/resource.cpp
+++ b/engines/dgds/resource.cpp
@@ -332,7 +332,7 @@ Common::SeekableReadStream *DgdsChunkReader::readStream() {
 		output = new Common::SeekableSubReadStream(_sourceStream, _startPos, _startPos + _size, DisposeAfterUse::NO);
 	}
 
-	//debug("    %s %u%c", _idStr, _size, (_container ? '+' : ' '));
+	//debug(1, "    %s %u%c", _idStr, _size, (_container ? '+' : ' '));
 	return output;
 }
 
diff --git a/engines/dgds/scene.cpp b/engines/dgds/scene.cpp
index 77f2a75fcab..a1f36f9ba47 100644
--- a/engines/dgds/scene.cpp
+++ b/engines/dgds/scene.cpp
@@ -1581,7 +1581,7 @@ bool SDSScene::checkDialogActive() {
 				if (action) {
 					// Take a copy of the dialog because the actions might change the scene
 					Dialog dlgCopy = dlg;
-					debug("Dialog %d closing: run action (%d ops)", dlg._num, action->sceneOpList.size());
+					debug(1, "Dialog %d closing: run action (%d ops)", dlg._num, action->sceneOpList.size());
 					if (!runOps(action->sceneOpList)) {
 						// HACK: the scene changed, but we haven't yet drawn the foreground for the
 						// dialog, this is our last chance so do it now.  The game does it in a
@@ -1798,10 +1798,10 @@ void SDSScene::mouseLUp(const Common::Point &pt) {
 	GDSScene *gds = engine->getGDSScene();
 
 	if (area->_num == 0) {
-		debug("Mouseup on inventory.");
+		debug(1, "Mouseup on inventory.");
 		engine->getInventory()->open();
 	} else if (area->_num == 0xffff) {
-		debug("Mouseup on swap characters.");
+		debug(1, "Mouseup on swap characters.");
 		bool haveInvBtn = _hotAreaList.size() && _hotAreaList.front()._num == 0;
 		if (haveInvBtn)
 			removeInvButtonFromHotAreaList();
@@ -1812,7 +1812,7 @@ void SDSScene::mouseLUp(const Common::Point &pt) {
 			addInvButtonToHotAreaList();
 	} else {
 		if (_rbuttonDown) {
-			debug(" --> exec both-button click ops for area %d", area->_num);
+			debug(1, " --> exec both-button click ops for area %d", area->_num);
 			// A both-button-click event, find the interaction list.
 			const GameItem *activeItem = engine->getGDSScene()->getActiveItem();
 			if (activeItem) {
@@ -1827,13 +1827,13 @@ void SDSScene::mouseLUp(const Common::Point &pt) {
 					i = _findInteraction(_objInteractions2, activeItem->_num, area->_num);
 				}
 				if (i) {
-					debug(" --> exec %d both-click ops for item combo %d", i->opList.size(), activeItem->_num);
+					debug(1, " --> exec %d both-click ops for item combo %d", i->opList.size(), activeItem->_num);
 					if (!runOps(i->opList, engine->getGameGlobals()->getGameMinsToAddOnObjInteraction()))
 						return;
 				}
 			}
 		} else {
-			debug(" --> exec %d click ops for area %d", area->onLClickOps.size(), area->_num);
+			debug(1, " --> exec %d click ops for area %d", area->onLClickOps.size(), area->_num);
 			int16 addmins = engine->getGameGlobals()->getGameMinsToAddOnLClick();
 			runOps(area->onLClickOps, addmins);
 		}
@@ -1859,10 +1859,10 @@ void SDSScene::onDragFinish(const Common::Point &pt) {
 
 	for (const auto &item : gdsScene->getGameItems()) {
 		if (item._inSceneNum == _num && _isInRect(pt, item._rect)) {
-			debug("Dragged item %d onto item %d @ (%d, %d)", dragItem->_num, item._num, pt.x, pt.y);
+			debug(1, "Dragged item %d onto item %d @ (%d, %d)", dragItem->_num, item._num, pt.x, pt.y);
 			const ObjectInteraction *i = _findInteraction(gdsScene->getObjInteractions1(), dragItem->_num, item._num);
 			if (i) {
-				debug(" --> exec %d drag ops for item %d", i->opList.size(), item._num);
+				debug(1, " --> exec %d drag ops for item %d", i->opList.size(), item._num);
 				if (!runOps(i->opList, globals->getGameMinsToAddOnObjInteraction()))
 					return;
 			}
@@ -1875,34 +1875,34 @@ void SDSScene::onDragFinish(const Common::Point &pt) {
 			continue;
 
 		if (area._num == 0) {
-			debug("Item %d dropped on inventory.", dragItem->_num);
+			debug(1, "Item %d dropped on inventory.", dragItem->_num);
 			dragItem->_inSceneNum = 2;
 			if (engine->getGameId() == GID_HOC)
 				dragItem->_quality = Inventory::HOC_CHARACTER_QUALS[gdsScene->getGlobal(0x33)];
 
 			const ObjectInteraction *i = _findInteraction(gdsScene->getObjInteractions1(), dragItem->_num, 0xffff);
 			if (i) {
-				debug(" --> exec %d drag ops for area %d", i->opList.size(), 0xffff);
+				debug(1, " --> exec %d drag ops for area %d", i->opList.size(), 0xffff);
 				if (!runOps(i->opList, globals->getGameMinsToAddOnObjInteraction()))
 					return;
 			}
 		} else if (area._num == 0xffff) {
-			debug("Item %d dropped on other character button.", dragItem->_num);
+			debug(1, "Item %d dropped on other character button.", dragItem->_num);
 			dragItem->_inSceneNum = 2;
 			if (engine->getGameId() == GID_HOC)
 				dragItem->_quality = Inventory::HOC_CHARACTER_QUALS[gdsScene->getGlobal(0x34)];
 
 			const ObjectInteraction *i = _findInteraction(gdsScene->getObjInteractions1(), dragItem->_num, 0xffff);
 			if (i) {
-				debug(" --> exec %d drag ops for area %d", i->opList.size(), 0xffff);
+				debug(1, " --> exec %d drag ops for area %d", i->opList.size(), 0xffff);
 				if (!runOps(i->opList, globals->getGameMinsToAddOnObjInteraction()))
 					return;
 			}
 		} else {
-			debug("Dragged item %d onto area %d @ (%d, %d)", dragItem->_num, area._num, pt.x, pt.y);
+			debug(1, "Dragged item %d onto area %d @ (%d, %d)", dragItem->_num, area._num, pt.x, pt.y);
 			const ObjectInteraction *i = _findInteraction(scene->getObjInteractions1(), dragItem->_num, area._num);
 			if (i) {
-				debug(" --> exec %d drag ops for area %d", i->opList.size(), area._num);
+				debug(1, " --> exec %d drag ops for area %d", i->opList.size(), area._num);
 				if (!runOps(i->opList, globals->getGameMinsToAddOnObjInteraction()))
 					return;
 			}
@@ -1937,18 +1937,18 @@ void SDSScene::mouseRUp(const Common::Point &pt) {
 	DgdsEngine *engine = DgdsEngine::getInstance();
 
 	if (area->_num == 0) {
-		debug("Mouse RUp on inventory.");
+		debug(1, "Mouse RUp on inventory.");
 		engine->getInventory()->setShowZoomBox(true);
 		engine->getInventory()->open();
 	} else if (area->_num == 0xffff) {
-		debug("Mouse RUp on character swap.");
+		debug(1, "Mouse RUp on character swap.");
 		int16 swapDlgFile = engine->getGDSScene()->getGlobal(0x36);
 		int16 swapDlgNum = engine->getGDSScene()->getGlobal(0x35);
 		if (swapDlgFile && swapDlgNum)
 			showDialog(swapDlgFile, swapDlgNum);
 	} else {
 		int16 addmins = engine->getGameGlobals()->getGameMinsToAddOnLClick();
-		debug("Mouse RUp on area %d, run %d ops (+%d mins)", area->_num, area->onRClickOps.size(), addmins);
+		debug(1, "Mouse RUp on area %d, run %d ops (+%d mins)", area->_num, area->onRClickOps.size(), addmins);
 		runOps(area->onRClickOps, addmins);
 	}
 }
@@ -2466,7 +2466,7 @@ Common::Error GDSScene::syncState(Common::Serializer &s) {
 		if (s.getVersion() > 1)
 			s.syncAsUint16LE(item._flags);
 		s.syncAsUint16LE(item._quality);
-		//debug("loaded item: %d %d %d %d", item._num, item._inSceneNum, item._flags, item._quality);
+		//debug(1, "loaded item: %d %d %d %d", item._num, item._inSceneNum, item._flags, item._quality);
 	}
 
 	uint16 nglobals = _perSceneGlobals.size();
diff --git a/engines/dgds/sound.cpp b/engines/dgds/sound.cpp
index 283c1e5db5b..baa9f9cecc2 100644
--- a/engines/dgds/sound.cpp
+++ b/engines/dgds/sound.cpp
@@ -55,7 +55,7 @@ static void _readHeader(const byte* &pos, uint32 &sci_header) {
 
 	pos += sci_header;
 	if (pos[0] == 0xF0) {
-		debug("SysEx transfer = %d bytes", pos[1]);
+		debug(1, "SysEx transfer = %d bytes", pos[1]);
 		pos += 2;
 		pos += 6;
 	}
@@ -83,19 +83,19 @@ static uint32 _availableSndTracks(const byte *data, uint32 size) {
 	while (pos[0] != 0xFF) {
 		byte drv = *pos++;
 
-		//debug("(%d)", drv);
+		//debug(1, "(%d)", drv);
 
 		while (pos[0] != 0xFF) {
 			uint16 off, siz;
 			_readPartHeader(pos, off, siz);
 			off += sci_header;
 
-			//debug("%06d:%d ", off, siz);
+			//debug(1, "%06d:%d ", off, siz);
 
-			//debug("Header bytes");
-			//debug("[%06X]  ", data[off]);
-			//debug("[%02X]  ", data[off+0]);
-			//debug("[%02X]  ", data[off+1]);
+			//debug(1, "Header bytes");
+			//debug(1, "[%06X]  ", data[off]);
+			//debug(1, "[%02X]  ", data[off+0]);
+			//debug(1, "[%02X]  ", data[off+1]);
 
 			bool digital_pcm = false;
 			if (READ_LE_UINT16(&data[off]) == 0x00FE) {
@@ -104,35 +104,35 @@ static uint32 _availableSndTracks(const byte *data, uint32 size) {
 
 			switch (drv) {
 			case 0:	if (digital_pcm) {
-					//debug("- Soundblaster");
+					//debug(1, "- Soundblaster");
 					tracks |= DIGITAL_PCM;
 				} else {
-					//debug("- Adlib");
+					//debug(1, "- Adlib");
 					tracks |= TRACK_ADLIB;
 				}
 				break;
 			case 7:
-				//debug("- General MIDI");
+				//debug(1, "- General MIDI");
 				tracks |= TRACK_GM;
 				break;
 			case 9:
-				//debug("- CMS");
+				//debug(1, "- CMS");
 				tracks |= TRACK_CMS;
 				break;
 			case 12:
-				//debug("- MT-32");
+				//debug(1, "- MT-32");
 				tracks |= TRACK_MT32;
 				break;
 			case 18:
-				//debug("- PC Speaker");
+				//debug(1, "- PC Speaker");
 				tracks |= TRACK_PCSPK;
 				break;
 			case 19:
-				//debug("- Tandy 1000");
+				//debug(1, "- Tandy 1000");
 				tracks |= TRACK_TANDY;
 				break;
 			default:
-				//debug("- Unknown %d", drv);
+				//debug(1, "- Unknown %d", drv);
 				warning("Unknown music type %d", drv);
 				break;
 			}
@@ -181,7 +181,7 @@ static byte _loadSndTrack(uint32 track, const byte** trackPtr, uint16* trackSiz,
 				trackSiz[part] = siz;
 				part++;
 			}
-			debug("- (%d) Play parts = %d", drv, part);
+			debug(1, "- (%d) Play parts = %d", drv, part);
 			return part;
 		} else {
 			pos = ptr;
@@ -276,7 +276,7 @@ bool Sound::playPCM(const byte *data, uint32 size) {
 		ptr += 8;
 
 		ptr += first;
-		debug(" - Digital PCM: %u Hz, [%u]=%u:%u",
+		debug(1, " - Digital PCM: %u Hz, [%u]=%u:%u",
 			  rate, length, first, last);
 		trackPtr[part] = ptr;
 		trackSiz[part] = length;
@@ -292,13 +292,13 @@ bool Sound::playPCM(const byte *data, uint32 size) {
 
 static void _readStrings(Common::SeekableReadStream *stream) {
 	uint16 count = stream->readUint16LE();
-	debug("        %u strs:", count);
+	debug(1, "        %u strs:", count);
 
 	for (uint16 k = 0; k < count; k++) {
 		uint16 idx = stream->readUint16LE();
 		Common::String str = stream->readString();
 
-		debug("        %2u: %2u, \"%s\"", k, idx, str.c_str());
+		debug(1, "        %2u: %2u, \"%s\"", k, idx, str.c_str());
 	}
 }
 
@@ -327,10 +327,10 @@ bool Sound::loadSXSoundData(const Common::String &filename, Common::Array<SoundD
 			uint16 type = stream->readUint16LE();
 			uint16 count = stream->readUint16LE();
 
-			debug("  SX INF %u [%u entries]:  (%s)", type, count, filename.c_str());
+			debug(1, "  SX INF %u [%u entries]:  (%s)", type, count, filename.c_str());
 			for (uint16 k = 0; k < count; k++) {
 				uint16 idx = stream->readUint16LE();
-				debug("        %2u: %u", k, idx);
+				debug(1, "        %2u: %u", k, idx);
 				idMap[idx] = k;
 			}
 		} else if (chunk.isSection(ID_TAG) || chunk.isSection(ID_FNM)) {
@@ -364,7 +364,7 @@ bool Sound::loadMusic(const Common::String &filename) {
 	}
 
 	_currentMusic = filename;
-	debug("Sound: Loaded music %s with %d entries", filename.c_str(), _musicData.size());
+	debug(1, "Sound: Loaded music %s with %d entries", filename.c_str(), _musicData.size());
 	return true;
 }
 
@@ -379,7 +379,7 @@ void Sound::loadSFX(const Common::String &filename) {
 		error("Unhandled SFX file type: %s", filename.c_str());
 	}
 
-	debug("Sound: Loaded sfx %s with %d entries", filename.c_str(), _sfxData.size());
+	debug(1, "Sound: Loaded sfx %s with %d entries", filename.c_str(), _sfxData.size());
 }
 
 void Sound::loadSNGSoundData(const Common::String &filename, Common::Array<SoundData> &dataArray) {
@@ -411,10 +411,10 @@ void Sound::loadSNGSoundData(const Common::String &filename, Common::Array<Sound
 			uint32 count = stream->size() / 2;
 			if (count > dataArray.size())
 				error("Sound: %s has more flags in INF than SNG entries.", filename.c_str());
-			debug("  SNG INF [%u entries]", count);
+			debug(1, "  SNG INF [%u entries]", count);
 			for (uint32 k = 0; k < count; k++) {
 				uint16 flags = stream->readUint16LE();
-				debug("        %2u: 0x%04x", k, flags);
+				debug(1, "        %2u: 0x%04x", k, flags);
 				dataArray[k]._flags = flags;
 			}
 		} else {
@@ -442,17 +442,17 @@ int Sound::mapMusicNum(int num) const {
 
 void Sound::playSFX(int num) {
 	int mappedNum = mapSfxNum(num);
-	debug("Sound: Play SFX %d (-> %d), have %d entries", num, mappedNum, _sfxData.size());
+	debug(1, "Sound: Play SFX %d (-> %d), have %d entries", num, mappedNum, _sfxData.size());
 	playPCSound(mappedNum, _sfxData, Audio::Mixer::kSFXSoundType);
 }
 
 void Sound::stopSfxByNum(int num) {
 	int mappedNum = mapSfxNum(num);
-	debug("Sound: Stop SFX %d (-> %d)", num, mappedNum);
+	debug(1, "Sound: Stop SFX %d (-> %d)", num, mappedNum);
 
 	MusicEntry *musicSlot = _music->getSlot(mappedNum + SND_RESOURCE_OFFSET);
 	if (!musicSlot) {
-		debug("stopSfxByNum: Slot for sfx num %d not found.", mappedNum);
+		debug(1, "stopSfxByNum: Slot for sfx num %d not found.", mappedNum);
 		return;
 	}
 
@@ -463,7 +463,7 @@ void Sound::stopSfxByNum(int num) {
 
 void Sound::playMusic(int num) {
 	int mappedNum = mapMusicNum(num);
-	debug("Sound: Play music %d (-> %d, %s), have %d entries", num, mappedNum, _currentMusic.c_str(), _musicData.size());
+	debug(1, "Sound: Play music %d (-> %d, %s), have %d entries", num, mappedNum, _currentMusic.c_str(), _musicData.size());
 	playPCSound(mappedNum, _musicData, Audio::Mixer::kMusicSoundType);
 }
 
@@ -625,7 +625,7 @@ void Sound::playPCSound(int num, const Common::Array<SoundData> &dataArray, Audi
 }
 
 void Sound::stopMusic() {
-	debug("Sound: Stop music.");
+	debug(1, "Sound: Stop music.");
 	_music->stopMusic();
 }
 
diff --git a/engines/dgds/sound/drivers/adlib.cpp b/engines/dgds/sound/drivers/adlib.cpp
index d29b6913817..9f109101946 100644
--- a/engines/dgds/sound/drivers/adlib.cpp
+++ b/engines/dgds/sound/drivers/adlib.cpp
@@ -280,7 +280,7 @@ void MidiDriver_AdLib::send(uint32 b) {
 	byte op1 = (b >> 8) & 0xff;
 	byte op2 = (b >> 16) & 0xff;
 
-	//debug("midi send %02x %x %02x %02x", command, channel, op1, op2);
+	//debug(1, "midi send %02x %x %02x %02x", command, channel, op1, op2);
 
 	switch (command) {
 	case 0x80:
diff --git a/engines/dgds/sound/drivers/midipatch.cpp b/engines/dgds/sound/drivers/midipatch.cpp
index 8c8d89838bb..1c090def8f8 100644
--- a/engines/dgds/sound/drivers/midipatch.cpp
+++ b/engines/dgds/sound/drivers/midipatch.cpp
@@ -85,7 +85,7 @@ SciResource *getMidiPatchData(int num) {
 
 			int dataLen = stream->size() - (strLen + 2);
 			byte *data = new byte[dataLen];
-			debug("midi patch %s loading magic %d str '%s'", targetSection.c_str(), magic, buf);
+			debug(1, "midi patch %s loading magic %d str '%s'", targetSection.c_str(), magic, buf);
 			delete [] buf;
 			stream->read(data, dataLen);
 			return new SciResource(data, dataLen, num);
diff --git a/engines/dgds/sound/midiparser_sci.cpp b/engines/dgds/sound/midiparser_sci.cpp
index b0ea074a596..1ecf4eac30d 100644
--- a/engines/dgds/sound/midiparser_sci.cpp
+++ b/engines/dgds/sound/midiparser_sci.cpp
@@ -785,7 +785,7 @@ void MidiParser_SCI::remapChannel(int channel, int devChannel) {
 	if (devChannel == -1)
 		return;
 
-//	debug("  restoring state: channel %d on devChannel %d", channel, devChannel);
+//	debug(1, "  restoring state: channel %d on devChannel %d", channel, devChannel);
 
 	// restore state
 	ChannelState &s = _channelState[channel];
diff --git a/engines/dgds/sound/music.cpp b/engines/dgds/sound/music.cpp
index 927aa65cbe9..420046343be 100644
--- a/engines/dgds/sound/music.cpp
+++ b/engines/dgds/sound/music.cpp
@@ -821,7 +821,7 @@ void SciMusic::printPlayList(Console *con) {
 
 	for (uint32 i = 0; i < _playList.size(); i++) {
 		MusicEntry *song = _playList[i];
-		debug("%d: %08x (%s), resource id: %d, status: %s, %s type\n",
+		debug(1, "%d: %08x (%s), resource id: %d, status: %s, %s type\n",
 						i, song->soundObj,
 						"",//g_sci->getEngineState()->_segMan->getObjectName(song->soundObj),
 						song->resourceId, musicStatus[song->status],
@@ -838,28 +838,28 @@ void SciMusic::printSongInfo(uint32 obj, Console *con) {
 	for (MusicList::iterator i = _playList.begin(); i != end; ++i) {
 		MusicEntry *song = *i;
 		if (song->soundObj == obj) {
-			debug("Resource id: %d, status: %s\n", song->resourceId, musicStatus[song->status]);
-			debug("dataInc: %d, hold: %d, loop: %d\n", song->dataInc, song->hold, song->loop);
-			debug("signal: %d, priority: %d\n", song->signal, song->priority);
-			debug("ticker: %d, volume: %d\n", song->ticker, song->volume);
+			debug(1, "Resource id: %d, status: %s\n", song->resourceId, musicStatus[song->status]);
+			debug(1, "dataInc: %d, hold: %d, loop: %d\n", song->dataInc, song->hold, song->loop);
+			debug(1, "signal: %d, priority: %d\n", song->signal, song->priority);
+			debug(1, "ticker: %d, volume: %d\n", song->ticker, song->volume);
 
 			if (song->pMidiParser) {
-				debug("Type: MIDI\n");
+				debug(1, "Type: MIDI\n");
 				if (song->soundRes) {
 					SoundResource::Track *track = song->soundRes->getTrackByType(_pMidiDrv->getPlayId());
 					if (track) {
-						debug("Channels: %d\n", track->channelCount);
+						debug(1, "Channels: %d\n", track->channelCount);
 					}
 				}
 			} else if (song->pStreamAud || song->pLoopStream) {
-				debug("Type: digital audio (%s), sound active: %s\n",
+				debug(1, "Type: digital audio (%s), sound active: %s\n",
 					song->pStreamAud ? "non looping" : "looping",
 					_pMixer->isSoundHandleActive(song->hCurrentAud) ? "yes" : "no");
 				if (song->soundRes) {
-					debug("Sound resource information:\n");
+					debug(1, "Sound resource information:\n");
 					SoundResource::Track *track = song->soundRes->getTrackByType(_pMidiDrv->getPlayId());
 					if (track && track->digitalChannelNr != -1) {
-						debug("Sample size: %d, sample rate: %d, channels: %d, digital channel number: %d\n",
+						debug(1, "Sample size: %d, sample rate: %d, channels: %d, digital channel number: %d\n",
 							track->digitalSampleSize, track->digitalSampleRate, track->channelCount, track->digitalChannelNr);
 					}
 				}
@@ -869,7 +869,7 @@ void SciMusic::printSongInfo(uint32 obj, Console *con) {
 		}
 	}
 
-	debug("Song object not found in playlist");
+	debug(1, "Song object not found in playlist");
 }
 
 MusicEntry::MusicEntry() {
@@ -1041,7 +1041,7 @@ void SciMusic::remapChannels(bool mainThread) {
 	DeviceChannelUsage currentMap[16];
 
 #ifdef DEBUG_REMAP
-	debug("Remap results:");
+	debug(1, "Remap results:");
 #endif
 
 	// Save current map, and then start from an empty map
@@ -1091,7 +1091,7 @@ void SciMusic::remapChannels(bool mainThread) {
 				if (mainThread) song->pMidiParser->mainThreadEnd();
 #ifdef DEBUG_REMAP
 				if (channelUsed[j])
-					debug(" Unmapping song %d, channel %d", songIndex, j);
+					debug(1, " Unmapping song %d, channel %d", songIndex, j);
 #endif
 				(void)songIndex;
 			}
@@ -1119,7 +1119,7 @@ void SciMusic::remapChannels(bool mainThread) {
 		// If this channel was not yet mapped to the device, reset it
 		if (currentMap[i] != _channelMap[i]) {
 #ifdef DEBUG_REMAP
-			debug(" Mapping (dontRemap) song %d, channel %d to device channel %d", songIndex, _channelMap[i]._channel, i);
+			debug(1, " Mapping (dontRemap) song %d, channel %d to device channel %d", songIndex, _channelMap[i]._channel, i);
 #endif
 			resetDeviceChannel(i, mainThread);
 			if (mainThread) _channelMap[i]._song->pMidiParser->mainThreadBegin();
@@ -1150,7 +1150,7 @@ void SciMusic::remapChannels(bool mainThread) {
 				_channelMap[j] = map->_map[i];
 				map->_map[i]._song = nullptr; // mark as done
 #ifdef DEBUG_REMAP
-				debug(" Keeping song %d, channel %d on device channel %d", songIndex, _channelMap[j]._channel, j);
+				debug(1, " Keeping song %d, channel %d on device channel %d", songIndex, _channelMap[j]._channel, j);
 #endif
 				break;
 			}
@@ -1175,7 +1175,7 @@ void SciMusic::remapChannels(bool mainThread) {
 				_channelMap[j] = map->_map[i];
 				map->_map[i]._song = nullptr;
 #ifdef DEBUG_REMAP
-				debug(" Mapping song %d, channel %d to device channel %d", songIndex, _channelMap[j]._channel, j);
+				debug(1, " Mapping song %d, channel %d to device channel %d", songIndex, _channelMap[j]._channel, j);
 #endif
 				if (mainThread) _channelMap[j]._song->pMidiParser->mainThreadBegin();
 				_channelMap[j]._song->pMidiParser->remapChannel(_channelMap[j]._channel, j);
@@ -1198,7 +1198,7 @@ void SciMusic::remapChannels(bool mainThread) {
 
 ChannelRemapping *SciMusic::determineChannelMap() {
 #ifdef DEBUG_REMAP
-	debug("Remap: avail chans: %d-%d", _driverFirstChannel, _driverLastChannel);
+	debug(1, "Remap: avail chans: %d-%d", _driverFirstChannel, _driverLastChannel);
 #endif
 
 	ChannelRemapping *map = new ChannelRemapping;
@@ -1226,7 +1226,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 		// CHECKME: Is this condition correct?
 		if (!song->pMidiParser) {
 #ifdef DEBUG_REMAP
-			debug(" Song %d (%p), digital?", songIndex, (void*)song);
+			debug(1, " Song %d (%p), digital?", songIndex, (void*)song);
 #endif
 			continue;
 		}
@@ -1234,7 +1234,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 
 #ifdef DEBUG_REMAP
 		const char* name = g_sci->getEngineState()->_segMan->getObjectName(song->soundObj);
-		debug(" Song %d (%p) [%s], prio %d%s", songIndex, (void*)song, name, song->priority, song->playBed ? ", bed" : "");
+		debug(1, " Song %d (%p) [%s], prio %d%s", songIndex, (void*)song, name, song->priority, song->playBed ? ", bed" : "");
 #endif
 
 		// Store backup. If we fail to map this song, we will revert to this.
@@ -1249,13 +1249,13 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 			const MusicEntryChannel &channel = song->_chan[c];
 			if (channel._dontMap) {
 #ifdef DEBUG_REMAP
-				debug("  Channel %d dontMap, skipping", c);
+				debug(1, "  Channel %d dontMap, skipping", c);
 #endif
 				continue;
 			}
 			if (channel._mute) {
 #ifdef DEBUG_REMAP
-				debug("  Channel %d muted, skipping", c);
+				debug(1, "  Channel %d muted, skipping", c);
 #endif
 				continue;
 			}
@@ -1263,7 +1263,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 			bool dontRemap = channel._dontRemap || song->playBed;
 
 #ifdef DEBUG_REMAP
-			debug("  Channel %d: prio %d, %d voice%s%s", c, channel._prio, channel._voices, channel._voices == 1 ? "" : "s", dontRemap ? ", dontRemap" : "" );
+			debug(1, "  Channel %d: prio %d, %d voice%s%s", c, channel._prio, channel._voices, channel._voices == 1 ? "" : "s", dontRemap ? ", dontRemap" : "" );
 #endif
 
 			DeviceChannelUsage dc = { song, c };
@@ -1302,7 +1302,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 				// no empty channel, but this isn't an essential channel,
 				// so we just skip it.
 #ifdef DEBUG_REMAP
-				debug("   skipping non-essential");
+				debug(1, "   skipping non-essential");
 #endif
 				continue;
 			}
@@ -1317,7 +1317,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 			if (devChannel == -1) {
 				// failed to map this song.
 #ifdef DEBUG_REMAP
-				debug("   no free (or lower priority) channel found");
+				debug(1, "   no free (or lower priority) channel found");
 #endif
 				songMapped = false;
 				break;
@@ -1338,7 +1338,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 				// non-essential here for playBed songs.
 				if (prio > 0 || (song->playBed && DgdsEngine::getInstance()->getGameId() == GID_DRAGON)) {
 #ifdef DEBUG_REMAP
-					debug("   not enough voices; need %d, have %d. Skipping this channel.", neededVoices, map->_freeVoices);
+					debug(1, "   not enough voices; need %d, have %d. Skipping this channel.", neededVoices, map->_freeVoices);
 #endif
 					continue;
 				}
@@ -1346,14 +1346,14 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 					int j = map->lowestPrio();
 					if (j == -1) {
 #ifdef DEBUG_REMAP
-						debug("   not enough voices; need %d, have %d", neededVoices, map->_freeVoices);
+						debug(1, "   not enough voices; need %d, have %d", neededVoices, map->_freeVoices);
 #endif
 						// failed to free enough voices.
 						songMapped = false;
 						break;
 					}
 #ifdef DEBUG_REMAP
-					debug("   creating room for voices; evict %d", j);
+					debug(1, "   creating room for voices; evict %d", j);
 #endif
 					map->evict(j);
 				} while (map->_freeVoices < neededVoices);
@@ -1366,7 +1366,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 
 			// We have a channel and enough free voices now.
 #ifdef DEBUG_REMAP
-			debug("   trying to map to %d", devChannel);
+			debug(1, "   trying to map to %d", devChannel);
 #endif
 
 			map->_map[devChannel] = dc;
@@ -1378,7 +1378,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 			if (!dontRemap || devChannel == c) {
 				// If this channel fits here, we're done.
 #ifdef DEBUG_REMAP
-				debug("    OK");
+				debug(1, "    OK");
 #endif
 				continue;
 			}
@@ -1391,7 +1391,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 				continue;
 			}
 #ifdef DEBUG_REMAP
-			debug("    but %d is already dontRemap", c);
+			debug(1, "    but %d is already dontRemap", c);
 #endif
 
 			if (prio > 0) {
@@ -1419,7 +1419,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
 		if (!songMapped) {
 			// We failed to map this song, so unmap all its channels.
 #ifdef DEBUG_REMAP
-			debug(" Failed song");
+			debug(1, " Failed song");
 #endif
 			*map = backupMap;
 		}
diff --git a/engines/dgds/ttm.cpp b/engines/dgds/ttm.cpp
index 9c11632b643..774b1580a3f 100644
--- a/engines/dgds/ttm.cpp
+++ b/engines/dgds/ttm.cpp
@@ -599,7 +599,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
 		// (although it may not make any difference)
 		if (seq._executed && DgdsEngine::getInstance()->getGameId() == GID_WILLY)
 			break;
-		//debug("0x0080: Free from slot %d for seq %d env %d", seq._currentBmpId, seq._seqNum, env._enviro);
+		//debug(1, "0x0080: Free from slot %d for seq %d env %d", seq._currentBmpId, seq._seqNum, env._enviro);
 		env._scriptShapes[seq._currentBmpId].reset();
 		break;
 	case 0x0090: // FREE FONT
@@ -650,7 +650,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
 		seq._brushNum = ivals[0];
 		break;
 	case 0x1050: // SELECT BMP:	    id:int [0:n]
-		//debug("0x1051: Select bmp %d for seq %d from env %d", ivals[0], seq._seqNum, env._enviro);
+		//debug(1, "0x1051: Select bmp %d for seq %d from env %d", ivals[0], seq._seqNum, env._enviro);
 		seq._currentBmpId = ivals[0];
 		break;
 	case 0x1060: // SELECT PAL:  id:int [0]
@@ -842,7 +842,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
 	}
 	case 0x5000:
 		// This opcode does nothing in SQ5 demo
-		debug("TTM: 0x5000: Implement opcode? (%d %d %d %d %d)",
+		debug(1, "TTM: 0x5000: Implement opcode? (%d %d %d %d %d)",
 				ivals[0], ivals[1], ivals[2], ivals[3], ivals[4]);
 		break;
 	case 0xa000: // DRAW PIXEL x,y:int
@@ -1099,7 +1099,7 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
 	case 0xf020: // LOAD BMP:	filename:str
 		if (seq._executed) // this is a one-shot op
 			break;
-		//debug("0xf020: Load bitmap %s to slot %d for env %d", sval.c_str(), env._enviro, seq._currentBmpId);
+		//debug(1, "0xf020: Load bitmap %s to slot %d for env %d", sval.c_str(), env._enviro, seq._currentBmpId);
 		env._scriptShapes[seq._currentBmpId].reset(new Image(_vm->getResourceManager(), _vm->getDecompressor()));
 		env._scriptShapes[seq._currentBmpId]->loadBitmap(sval);
 		break;
@@ -1262,10 +1262,10 @@ void TTMInterpreter::findAndAddSequences(TTMEnviro &env, Common::Array<Common::S
 	uint16 op = 0;
 	for (uint frame = 0; frame < env._totalFrames; frame++) {
 		env._frameOffsets[frame] = env.scr->pos();
-		//debug("findAndAddSequences: frame %d at offset %d", frame, (int)env.scr->pos());
+		//debug(1, "findAndAddSequences: frame %d at offset %d", frame, (int)env.scr->pos());
 		op = env.scr->readUint16LE();
 		while (op != 0x0ff0 && env.scr->pos() < env.scr->size()) {
-			//debug("findAndAddSequences: check ttm op %04x", op);
+			//debug(1, "findAndAddSequences: check ttm op %04x", op);
 			switch (op & 0xf) {
 			case 0:
 				break;
@@ -1277,7 +1277,7 @@ void TTMInterpreter::findAndAddSequences(TTMEnviro &env, Common::Array<Common::S
 					newseq->_startFrame = frame;
 					newseq->_currentFrame = frame;
 					newseq->_lastFrame = -1;
-					//debug("findAndAddSequences: found env %d seq %d at %d", newseq._enviro, newseq._seqNum, (int)env.scr->pos());
+					//debug(1, "findAndAddSequences: found env %d seq %d at %d", newseq._enviro, newseq._seqNum, (int)env.scr->pos());
 					seqArray.push_back(newseq);
 				} else {
 					env.scr->skip(2);




More information about the Scummvm-git-logs mailing list