[Scummvm-git-logs] scummvm master -> e44a371ebd858f7fb84d427b2c478bafefd1fa4e

neuromancer noreply at scummvm.org
Mon Jun 1 07:44:05 UTC 2026


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

Summary:
892b4a95d5 SCUMM: RA1: clean-up of debug statements
bc9e07470d SCUMM: RA2: clean-up of debug statements
f046a35f78 SCUMM: RA2: removed expensive non-zero pixel counter used for debug
a36e9516b1 SCUMM: RA1: use DEBUG_INSANE for debug statements
912e8b3bf4 SCUMM: RA: improve debug statements with class/function names
e44a371ebd SCUMM: RA: removed some redundant/useless debug statement


Commit: 892b4a95d5e9735999dd87ded09d3f83a2a51a54
    https://github.com/scummvm/scummvm/commit/892b4a95d5e9735999dd87ded09d3f83a2a51a54
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-06-01T08:35:35+02:00

Commit Message:
SCUMM: RA1: clean-up of debug statements

Changed paths:
    engines/scumm/insane/rebel1/audio.cpp
    engines/scumm/insane/rebel1/iact.cpp
    engines/scumm/insane/rebel1/menu.cpp
    engines/scumm/insane/rebel1/render.cpp
    engines/scumm/smush/rebel/smush_player_ra1.cpp


diff --git a/engines/scumm/insane/rebel1/audio.cpp b/engines/scumm/insane/rebel1/audio.cpp
index bb807f9df2d..64cc5e095f2 100644
--- a/engines/scumm/insane/rebel1/audio.cpp
+++ b/engines/scumm/insane/rebel1/audio.cpp
@@ -75,14 +75,14 @@ void InsaneRebel1::loadSfx() {
 		ScummFile *file = _vm->instantiateScummFile();
 		_vm->openFile(*file, kRA1SfxFiles[i]);
 		if (!file->isOpen()) {
-			debug("InsaneRebel1::loadSfx: could not open %s", kRA1SfxFiles[i]);
+			debugC(DEBUG_INSANE, "InsaneRebel1::loadSfx: could not open %s", kRA1SfxFiles[i]);
 			delete file;
 			continue;
 		}
 
 		const uint32 fileSize = file->size();
 		if (fileSize < 16) {
-			debug("InsaneRebel1::loadSfx: %s too small (%u bytes)", kRA1SfxFiles[i], fileSize);
+			debugC(DEBUG_INSANE, "InsaneRebel1::loadSfx: %s too small (%u bytes)", kRA1SfxFiles[i], fileSize);
 			file->close();
 			delete file;
 			continue;
@@ -90,7 +90,7 @@ void InsaneRebel1::loadSfx() {
 
 		const uint32 tag = file->readUint32BE();
 		if (tag != MKTAG('S', 'A', 'U', 'D')) {
-			debug("InsaneRebel1::loadSfx: %s not a SAUD file (tag=0x%08x)", kRA1SfxFiles[i], tag);
+			debugC(DEBUG_INSANE, "InsaneRebel1::loadSfx: %s not a SAUD file (tag=0x%08x)", kRA1SfxFiles[i], tag);
 			file->close();
 			delete file;
 			continue;
@@ -108,7 +108,7 @@ void InsaneRebel1::loadSfx() {
 					file->read(pcm, pcmSize);
 					_sfxData[i] = pcm;
 					_sfxSize[i] = pcmSize;
-					debug("InsaneRebel1::loadSfx: loaded %s (%u bytes PCM)", kRA1SfxFiles[i], pcmSize);
+					debugC(DEBUG_INSANE, "InsaneRebel1::loadSfx: loaded %s (%u bytes PCM)", kRA1SfxFiles[i], pcmSize);
 				}
 				foundSdat = true;
 				break;
@@ -117,7 +117,7 @@ void InsaneRebel1::loadSfx() {
 		}
 
 		if (!foundSdat)
-			debug("InsaneRebel1::loadSfx: no SDAT chunk in %s", kRA1SfxFiles[i]);
+			debugC(DEBUG_INSANE, "InsaneRebel1::loadSfx: no SDAT chunk in %s", kRA1SfxFiles[i]);
 
 		file->close();
 		delete file;
diff --git a/engines/scumm/insane/rebel1/iact.cpp b/engines/scumm/insane/rebel1/iact.cpp
index c89961c50a4..a6f94915ecb 100644
--- a/engines/scumm/insane/rebel1/iact.cpp
+++ b/engines/scumm/insane/rebel1/iact.cpp
@@ -781,11 +781,9 @@ void InsaneRebel1::updateFlightVariantCursor() {
 	_flightAimY = CLIP<int32>(shipBaseY + ((liftTerm * kRA1Op09AimYScale[bucket]) >> 8),
 		kRA1MinY, kRA1MaxY);
 
-	if (_currentLevel == 4) {
-		debug(1, "RA1 op09 cursor: frame=%d shipBase=(%d,%d) shipPos=(%d,%d) aim=(%d,%d) roll=%d lift=%d bucket=%d dir=%d persp=(%d,%d)",
-			_gameCounter, shipBaseX, shipBaseY, _shipPosX, _shipPosY, _flightAimX, _flightAimY,
-			_rollAccum, _liftSmooth, bucket, _shipDirIndex, _perspectiveX, _perspectiveY);
-	}
+	debugC(DEBUG_INSANE, "RA1 op09 cursor: frame=%d shipBase=(%d,%d) shipPos=(%d,%d) aim=(%d,%d) roll=%d lift=%d bucket=%d dir=%d persp=(%d,%d)",
+		_gameCounter, shipBaseX, shipBaseY, _shipPosX, _shipPosY, _flightAimX, _flightAimY,
+		_rollAccum, _liftSmooth, bucket, _shipDirIndex, _perspectiveX, _perspectiveY);
 }
 
 // preprocessMouseAxes — FUN_231BE (0x231BE) centered-axis output law, adapted to
@@ -1132,7 +1130,7 @@ void InsaneRebel1::updateShipPhysics() {
 	if (_shipBank.numSprites > 0)
 		_shipDirIndex = CLIP<int16>((int16)(vComponent + hComponent), 0, _shipBank.numSprites - 1);
 
-	debug(1, "RA1 ship input: frame=%d source=%s controls=%s turbulence=%d usedJoystick=%d raw=(%d,%d) clipped=(%d,%d) storedAxis=(%d,%d) actionState(L,R,U,D)=(%d,%d,%d,%d) roll=%d lift=%d pos=(%d,%d) view=(%d,%d) dir=%d level=%d mode=%d opcode=0x%X",
+	debugC(DEBUG_INSANE, "RA1 ship input: frame=%d source=%s controls=%s turbulence=%d usedJoystick=%d raw=(%d,%d) clipped=(%d,%d) storedAxis=(%d,%d) actionState(L,R,U,D)=(%d,%d,%d,%d) roll=%d lift=%d pos=(%d,%d) view=(%d,%d) dir=%d level=%d mode=%d opcode=0x%X",
 		_gameCounter, inputSourceName,
 		_optEnhancedControls ? "enhanced" : "original", originalTurbulence, usedJoystick,
 		rawInputX, rawInputY, inputX, inputY,
@@ -1373,7 +1371,7 @@ void InsaneRebel1::updateTurretPhysics() {
 			inputY /= 2;
 		}
 
-		debug("RA1 turret input: source=%s controls=%s mouse=(%d,%d) actions(L,R,U,D)=(%d,%d,%d,%d) raw=(%d,%d) final=(%d,%d) level=%d mode=%d opcode=0x%X",
+		debugC(DEBUG_INSANE, "RA1 turret input: source=%s controls=%s mouse=(%d,%d) actions(L,R,U,D)=(%d,%d,%d,%d) raw=(%d,%d) final=(%d,%d) level=%d mode=%d opcode=0x%X",
 			usedJoystick ? "joystick-actions" : "mouse-path",
 			_optEnhancedControls ? "enhanced" : "original",
 			_vm->_mouse.x, _vm->_mouse.y,
@@ -1621,7 +1619,7 @@ void InsaneRebel1::updateGameOp0BPhysics() {
 	}
 	_inputAxisDeltaX = inputX;
 
-	debug("RA1 GAME 0x0B input: frame=%d source=%s controls=%s window=%d view=(%d,%d) health=%d prevFlags=0x%02x axis=(%d,%d) mouse=(%d,%d) actions(L,R,U,D)=(%d,%d,%d,%d) raw=(%d,%d) final=(%d,%d) level=%d opcode=0x%X",
+	debugC(DEBUG_INSANE, "RA1 GAME 0x0B input: frame=%d source=%s controls=%s window=%d view=(%d,%d) health=%d prevFlags=0x%02x axis=(%d,%d) mouse=(%d,%d) actions(L,R,U,D)=(%d,%d,%d,%d) raw=(%d,%d) final=(%d,%d) level=%d opcode=0x%X",
 		_gameCounter,
 		inputSourceName,
 		_optEnhancedControls ? "enhanced" : "original",
@@ -2260,8 +2258,8 @@ void InsaneRebel1::handleGameCounterOpcode(uint32 opcode, int32 subSize, Common:
 		uint32 param2 = b.readUint32BE();
 		uint32 param3 = b.readUint32BE();
 		uint32 param4 = b.readUint32BE();
-		if (opcode == 0x09 && _currentLevel == 4) {
-			debug(1, "RA1 GAME 0x09: counter=%d params=(%d,%d,%d) opcodeMask=0x%08x",
+		if (opcode == 0x09) {
+			debugC(DEBUG_INSANE, "RA1 GAME 0x09: counter=%d params=(%d,%d,%d) opcodeMask=0x%08x",
 				_gameCounter, param2, param3, param4, _frameGameOpcodeMask);
 		} else {
 			debug(5, "RA1 GAME 0x%02x: counter=%d params=(%d,%d,%d)",
@@ -2477,7 +2475,7 @@ void InsaneRebel1::checkTargetHit(int16 targetIdx, int16 left, int16 top, int16
 						_killCount++;
 						applyFrameObjectHitState(targetIdx);
 
-						if (_currentLevel == 7) {
+						if (debugChannelSet(-1, DEBUG_INSANE)) {
 							Common::String damagedState;
 							Common::String hiddenState;
 							for (int objectId = 20; objectId <= 43; objectId++) {
@@ -2498,7 +2496,7 @@ void InsaneRebel1::checkTargetHit(int16 targetIdx, int16 left, int16 top, int16
 									damagedState += Common::String::format("%d,", objectId);
 							}
 
-							debug(1, "RA1 L8 armor: hitObject=%d damaged=[%s] hidden=[%s]",
+							debugC(DEBUG_INSANE, "RA1 L8 armor: hitObject=%d damaged=[%s] hidden=[%s]",
 								targetIdx + 1, damagedState.c_str(), hiddenState.c_str());
 						}
 
diff --git a/engines/scumm/insane/rebel1/menu.cpp b/engines/scumm/insane/rebel1/menu.cpp
index 43f7c341a06..bcd73aff0de 100644
--- a/engines/scumm/insane/rebel1/menu.cpp
+++ b/engines/scumm/insane/rebel1/menu.cpp
@@ -509,7 +509,7 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 
 	if (event.type == Common::EVENT_JOYAXIS_MOTION) {
 		_lastJoystickAxisEventTime = _vm->_system->getMillis();
-		debug(1, "RA1 input raw-joy-axis: axis=%d pos=%d menu=%d gameplay=%d storedAxis=(%d,%d)",
+		debugC(DEBUG_INSANE, "RA1 input raw-joy-axis: axis=%d pos=%d menu=%d gameplay=%d storedAxis=(%d,%d)",
 			event.joystick.axis, event.joystick.position,
 			_menuActive, _interactiveVideoActive && !_menuActive,
 			_joystickAxisX, _joystickAxisY);
@@ -532,12 +532,12 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 		switch (event.customType) {
 		case kScummBackendActionRebel1AxisUp:
 			if (event.joystick.position == 0 && _joystickAxisY > 0) {
-				debug(1, "RA1 input mapped-axis ignored-reset: %s pos=0 current=(%d,%d)",
+				debugC(DEBUG_INSANE, "RA1 input mapped-axis ignored-reset: %s pos=0 current=(%d,%d)",
 					getRebel1BackendAxisName(event.customType), _joystickAxisX, _joystickAxisY);
 				return true;
 			}
 			_joystickAxisY = -axisPosition;
-			debug(1, "RA1 input mapped-axis: %s pos=%d rawPos=%d old=(%d,%d) new=(%d,%d) menu=%d gameplay=%d",
+			debugC(DEBUG_INSANE, "RA1 input mapped-axis: %s pos=%d rawPos=%d old=(%d,%d) new=(%d,%d) menu=%d gameplay=%d",
 				getRebel1BackendAxisName(event.customType), axisPosition, event.joystick.position,
 				oldAxisX, oldAxisY, _joystickAxisX, _joystickAxisY,
 				_menuActive, _interactiveVideoActive && !_menuActive);
@@ -546,12 +546,12 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 			return true;
 		case kScummBackendActionRebel1AxisDown:
 			if (event.joystick.position == 0 && _joystickAxisY < 0) {
-				debug(1, "RA1 input mapped-axis ignored-reset: %s pos=0 current=(%d,%d)",
+				debugC(DEBUG_INSANE, "RA1 input mapped-axis ignored-reset: %s pos=0 current=(%d,%d)",
 					getRebel1BackendAxisName(event.customType), _joystickAxisX, _joystickAxisY);
 				return true;
 			}
 			_joystickAxisY = axisPosition;
-			debug(1, "RA1 input mapped-axis: %s pos=%d rawPos=%d old=(%d,%d) new=(%d,%d) menu=%d gameplay=%d",
+			debugC(DEBUG_INSANE, "RA1 input mapped-axis: %s pos=%d rawPos=%d old=(%d,%d) new=(%d,%d) menu=%d gameplay=%d",
 				getRebel1BackendAxisName(event.customType), axisPosition, event.joystick.position,
 				oldAxisX, oldAxisY, _joystickAxisX, _joystickAxisY,
 				_menuActive, _interactiveVideoActive && !_menuActive);
@@ -560,12 +560,12 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 			return true;
 		case kScummBackendActionRebel1AxisLeft:
 			if (event.joystick.position == 0 && _joystickAxisX > 0) {
-				debug(1, "RA1 input mapped-axis ignored-reset: %s pos=0 current=(%d,%d)",
+				debugC(DEBUG_INSANE, "RA1 input mapped-axis ignored-reset: %s pos=0 current=(%d,%d)",
 					getRebel1BackendAxisName(event.customType), _joystickAxisX, _joystickAxisY);
 				return true;
 			}
 			_joystickAxisX = -axisPosition;
-			debug(1, "RA1 input mapped-axis: %s pos=%d rawPos=%d old=(%d,%d) new=(%d,%d) menu=%d gameplay=%d",
+			debugC(DEBUG_INSANE, "RA1 input mapped-axis: %s pos=%d rawPos=%d old=(%d,%d) new=(%d,%d) menu=%d gameplay=%d",
 				getRebel1BackendAxisName(event.customType), axisPosition, event.joystick.position,
 				oldAxisX, oldAxisY, _joystickAxisX, _joystickAxisY,
 				_menuActive, _interactiveVideoActive && !_menuActive);
@@ -574,12 +574,12 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 			return true;
 		case kScummBackendActionRebel1AxisRight:
 			if (event.joystick.position == 0 && _joystickAxisX < 0) {
-				debug(1, "RA1 input mapped-axis ignored-reset: %s pos=0 current=(%d,%d)",
+				debugC(DEBUG_INSANE, "RA1 input mapped-axis ignored-reset: %s pos=0 current=(%d,%d)",
 					getRebel1BackendAxisName(event.customType), _joystickAxisX, _joystickAxisY);
 				return true;
 			}
 			_joystickAxisX = axisPosition;
-			debug(1, "RA1 input mapped-axis: %s pos=%d rawPos=%d old=(%d,%d) new=(%d,%d) menu=%d gameplay=%d",
+			debugC(DEBUG_INSANE, "RA1 input mapped-axis: %s pos=%d rawPos=%d old=(%d,%d) new=(%d,%d) menu=%d gameplay=%d",
 				getRebel1BackendAxisName(event.customType), axisPosition, event.joystick.position,
 				oldAxisX, oldAxisY, _joystickAxisX, _joystickAxisY,
 				_menuActive, _interactiveVideoActive && !_menuActive);
@@ -676,7 +676,7 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 				return true;
 			}
 
-			debug("Rebel1: ESC pressed during gameplay - opening ScummVM menu");
+			debugC(DEBUG_INSANE, "Rebel1: ESC pressed during gameplay - opening ScummVM menu");
 			const bool wasPaused = _player->_paused;
 			if (!wasPaused)
 				_player->pause();
@@ -689,13 +689,13 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 		if (_interactiveVideoActive && !_menuActive &&
 			event.kbd.keycode == Common::KEYCODE_s &&
 			event.kbd.hasFlags(Common::KBD_SHIFT)) {
-			debug("Rebel1: Shift+S pressed - skipping gameplay section");
+			debugC(DEBUG_INSANE, "Rebel1: Shift+S pressed - skipping gameplay section");
 			_vm->_smushVideoShouldFinish = true;
 			return true;
 		}
 
 		if (!_interactiveVideoActive && event.kbd.keycode == Common::KEYCODE_ESCAPE) {
-			debug("Rebel1: ESC pressed - skipping cinematic");
+			debugC(DEBUG_INSANE, "Rebel1: ESC pressed - skipping cinematic");
 			_vm->_smushVideoShouldFinish = true;
 			return true;
 		}
diff --git a/engines/scumm/insane/rebel1/render.cpp b/engines/scumm/insane/rebel1/render.cpp
index c5397079d76..ae7f90294a6 100644
--- a/engines/scumm/insane/rebel1/render.cpp
+++ b/engines/scumm/insane/rebel1/render.cpp
@@ -1254,12 +1254,10 @@ void InsaneRebel1::renderLaserShots(byte *dst, int pitch, int width, int height)
 				const int start1Y = shipBaseY + emit.y1;
 				const int start2X = shipBaseX + emit.x2;
 				const int start2Y = shipBaseY + emit.y2;
-				if (_currentLevel == 4) {
-					debug(1, "RA1 op09 shotRender: frame=%d timer=%d shipBase=(%d,%d) target=(%d,%d) emit1=(%d,%d) emit2=(%d,%d) dir=%d variant=%d mode=%d",
-						_gameCounter, timer, shipBaseX, shipBaseY, targetX, targetY,
-						start1X, start1Y, start2X, start2Y, _shipDirIndex,
-						_shotSlots[i].variant, _flyControlMode);
-				}
+				debugC(DEBUG_INSANE, "RA1 op09 shotRender: frame=%d timer=%d shipBase=(%d,%d) target=(%d,%d) emit1=(%d,%d) emit2=(%d,%d) dir=%d variant=%d mode=%d",
+					_gameCounter, timer, shipBaseX, shipBaseY, targetX, targetY,
+					start1X, start1Y, start2X, start2Y, _shipDirIndex,
+					_shotSlots[i].variant, _flyControlMode);
 
 				renderAimedShotPair(dst, pitch, width, height, _laserBank,
 					start1X, start1Y, start2X, start2Y, targetX, targetY, lerp);
diff --git a/engines/scumm/smush/rebel/smush_player_ra1.cpp b/engines/scumm/smush/rebel/smush_player_ra1.cpp
index d04d673155f..de6aad330bf 100644
--- a/engines/scumm/smush/rebel/smush_player_ra1.cpp
+++ b/engines/scumm/smush/rebel/smush_player_ra1.cpp
@@ -260,13 +260,13 @@ bool SmushPlayerRebel1::handleGameFetch(int32 subSize, Common::SeekableReadStrea
 			}
 		}
 
-		debug("RA1 FTCH: frame=%d id=0x%08x pos=(%d,%d) using stored FOBJ codec=%d size=%dx%d",
+		debugC(DEBUG_SMUSH, "RA1 FTCH: frame=%d id=0x%08x pos=(%d,%d) using stored FOBJ codec=%d size=%dx%d",
 			_frame, fetchId, left, top, storedCodec, _storedFobjWidth, _storedFobjHeight);
 		decodeFrameObject(storedCodec, _storedFobjData, left, top,
 			_storedFobjWidth, _storedFobjHeight, _storedFobjDataSize,
 			storedParam, _storedFobjParm2);
 	} else {
-		debug("RA1 FTCH: frame=%d id=0x%08x with no stored FOBJ data", _frame, fetchId);
+		debugC(DEBUG_SMUSH, "RA1 FTCH: frame=%d id=0x%08x with no stored FOBJ data", _frame, fetchId);
 	}
 
 	return true;
@@ -283,7 +283,7 @@ void SmushPlayerRebel1::ra1HandleGost(int32 subSize, Common::SeekableReadStream
 	const int32 ghostY = b.readSint32BE();
 
 	if (!_hasFrameFobjForGost || _lastFobjData == nullptr || _lastFobjDataSize <= 0) {
-		debug("RA1 GOST: frame=%d ignored type=0x%08x pos=(%d,%d) (no current-frame FOBJ cached)",
+		debugC(DEBUG_SMUSH, "RA1 GOST: frame=%d ignored type=0x%08x pos=(%d,%d) (no current-frame FOBJ cached)",
 			_frame, ghostType, ghostX, ghostY);
 		return;
 	}
@@ -300,12 +300,12 @@ void SmushPlayerRebel1::ra1HandleGost(int32 subSize, Common::SeekableReadStream
 		priorityFlags = 0x6000;
 		break;
 	default:
-		debug("RA1 GOST: frame=%d ignored unknown type=0x%08x pos=(%d,%d)",
+		debugC(DEBUG_SMUSH, "RA1 GOST: frame=%d ignored unknown type=0x%08x pos=(%d,%d)",
 			_frame, ghostType, ghostX, ghostY);
 		return;
 	}
 
-	debug("RA1 GOST: frame=%d type=0x%08x flags=0x%04x pos=(%d,%d) size=%dx%d codec=%d",
+	debugC(DEBUG_SMUSH, "RA1 GOST: frame=%d type=0x%08x flags=0x%04x pos=(%d,%d) size=%dx%d codec=%d",
 		_frame, ghostType, priorityFlags, ghostX, ghostY,
 		_lastFobjWidth, _lastFobjHeight, _lastFobjCodec);
 
@@ -593,7 +593,7 @@ bool SmushPlayerRebel1::handleGameStoreFrame() {
 }
 
 void SmushPlayerRebel1::handleGameFrameObjectPre(int codec, int left, int top, int width, int height, int dataSize) {
-	debug("RA1 FOBJ: frame=%d codec=%d pos=(%d,%d) size=%dx%d dataSize=%d storeFrame=%d",
+	debugC(DEBUG_SMUSH, "RA1 FOBJ: frame=%d codec=%d pos=(%d,%d) size=%dx%d dataSize=%d storeFrame=%d",
 		_frame, codec, left, top, width, height, dataSize, _storeFrame);
 }
 


Commit: bc9e07470d7f2a02e390caf1530cde95cc700122
    https://github.com/scummvm/scummvm/commit/bc9e07470d7f2a02e390caf1530cde95cc700122
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-06-01T08:39:25+02:00

Commit Message:
SCUMM: RA2: clean-up of debug statements

Changed paths:
    engines/scumm/smush/rebel/smush_player_ra2.cpp


diff --git a/engines/scumm/smush/rebel/smush_player_ra2.cpp b/engines/scumm/smush/rebel/smush_player_ra2.cpp
index fe8165bde42..0d6a8b0e663 100644
--- a/engines/scumm/smush/rebel/smush_player_ra2.cpp
+++ b/engines/scumm/smush/rebel/smush_player_ra2.cpp
@@ -122,12 +122,14 @@ void SmushPlayerRebel2::initGameVideoState() {
 			memset(_dst, 0, vs->w * vs->h);
 		} else {
 			// Gameplay mode (flags 0x28) - do nothing, preserve existing screen content
-			int nonZero = 0;
-			for (int i = 0; i < vs->w * vs->h; i++) {
-				if (_dst[i] != 0) nonZero++;
+			if (debugChannelSet(-1, DEBUG_SMUSH)) {
+				int nonZero = 0;
+				for (int i = 0; i < vs->w * vs->h; i++) {
+					if (_dst[i] != 0) nonZero++;
+				}
+				debugC(DEBUG_SMUSH, "SmushPlayer::init: Preserving screen for gameplay video (%dx%d, %d%% non-zero)",
+					vs->w, vs->h, (nonZero * 100) / (vs->w * vs->h));
 			}
-			debug("SmushPlayer::init: Preserving screen for gameplay video (%dx%d, %d%% non-zero)",
-				vs->w, vs->h, (nonZero * 100) / (vs->w * vs->h));
 		}
 	}
 }
@@ -159,7 +161,7 @@ bool SmushPlayerRebel2::handleGameFetch(int32 subSize, Common::SeekableReadStrea
 	int16 ftchX = b.readSint16LE();
 	int16 ftchY = b.readSint16LE();
 
-	debug("SmushPlayer::handleFetch: frame=%d unknown=%d x=%d y=%d",
+	debugC(DEBUG_SMUSH, "SmushPlayer::handleFetch: frame=%d unknown=%d x=%d y=%d",
 		_frame, ftchUnknown, ftchX, ftchY);
 
 	// For Handler 25, skip FTCH because the frame buffer only contains the
@@ -169,14 +171,14 @@ bool SmushPlayerRebel2::handleGameFetch(int32 subSize, Common::SeekableReadStrea
 		InsaneRebel2 *rebel2 = static_cast<InsaneRebel2 *>(_insane);
 		int handler = rebel2->getHandler();
 		if (handler == 25) {
-			debug("SmushPlayer::handleFetch: Skipping FTCH for Handler 25 - preserving overlays");
+			debugC(DEBUG_SMUSH, "SmushPlayer::handleFetch: Skipping FTCH for Handler 25 - preserving overlays");
 			return true;
 		}
 	}
 
 	// Re-decode stored FOBJ data with current offsets (matching original FUN_004246d0).
 	if (_storedFobjData != nullptr) {
-		debug("SmushPlayer FTCH: Re-decoding stored FOBJ codec=%d pos=(%d,%d) size=%dx%d dataSize=%d",
+		debugC(DEBUG_SMUSH, "SmushPlayer FTCH: Re-decoding stored FOBJ codec=%d pos=(%d,%d) size=%dx%d dataSize=%d",
 			_storedFobjCodec, _storedFobjLeft, _storedFobjTop,
 			_storedFobjWidth, _storedFobjHeight, _storedFobjDataSize);
 		decodeFrameObject(_storedFobjCodec, _storedFobjData,
@@ -184,7 +186,7 @@ bool SmushPlayerRebel2::handleGameFetch(int32 subSize, Common::SeekableReadStrea
 			_storedFobjWidth, _storedFobjHeight,
 			_storedFobjDataSize);
 	} else {
-		debug("SmushPlayer FTCH: No stored FOBJ data! (frame=%d)", _frame);
+		debugC(DEBUG_SMUSH, "SmushPlayer FTCH: No stored FOBJ data! (frame=%d)", _frame);
 	}
 
 	return true;
@@ -399,7 +401,7 @@ bool SmushPlayerRebel2::handleGameAnimHeader(byte *headerContent) {
 	if (width == 0 && height == 0) {
 		_width = _vm->_screenWidth;
 		_height = _vm->_screenHeight;
-		debug("SmushPlayer::handleAnimHeader: RA2 AHDR has 0x0 dims - using screen size %dx%d", _width, _height);
+		debugC(DEBUG_SMUSH, "SmushPlayer::handleAnimHeader: RA2 AHDR has 0x0 dims - using screen size %dx%d", _width, _height);
 	} else {
 		_width = width;
 		_height = height;
@@ -497,7 +499,7 @@ void SmushPlayerRebel2::ra2HandleTextResource(const char *str, int fontId, int c
 	ensureMultiFont();
 	_multiFont->setDefaultFont(fontId);
 
-	debug("SmushPlayer::handleTextResource: RA2 TRES frame=%d fontId=%d color=%d flags=0x%x flg=%d pos=(%d,%d) clip=(%d,%d,%d,%d) str=\"%.40s\"",
+	debugC(DEBUG_SMUSH, "SmushPlayer::handleTextResource: RA2 TRES frame=%d fontId=%d color=%d flags=0x%x flg=%d pos=(%d,%d) clip=(%d,%d,%d,%d) str=\"%.40s\"",
 		  _frame, fontId, color, (int)flg, (int)flg, pos_x, pos_y, left, top, width, height, str);
 
 	if (flg & kStyleWordWrap) {
@@ -528,24 +530,24 @@ void SmushPlayerRebel2::ra2SelectFrameBuffer(int width, int height) {
 			_height = height;
 			// Zero-fill the new buffer to avoid garbage in areas not written by FOBJ codec
 			memset(_specialBuffer, 0, bufSize);
-			debug("SmushPlayer: Allocated new _specialBuffer %dx%d (%d bytes)", width, height, bufSize);
+			debugC(DEBUG_SMUSH, "SmushPlayer: Allocated new _specialBuffer %dx%d (%d bytes)", width, height, bufSize);
 		}
 	}
 
 	if (bufSize > _vm->_screenWidth * _vm->_screenHeight &&
 	    _specialBuffer != nullptr && _specialBufferSize >= bufSize) {
 		_dst = _specialBuffer;
-		debug("SmushPlayer: Using _specialBuffer for oversized FOBJ %dx%d", width, height);
+		debugC(DEBUG_SMUSH, "SmushPlayer: Using _specialBuffer for oversized FOBJ %dx%d", width, height);
 	} else {
 		if (_specialBuffer == nullptr) {
 			VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen];
 			_dst = vs->getPixels(0, 0);
-			debug("SmushPlayer: Reset _dst to virtual screen for FOBJ %dx%d at (%d,%d) _dst=%p",
+			debugC(DEBUG_SMUSH, "SmushPlayer: Reset _dst to virtual screen for FOBJ %dx%d at (%d,%d) _dst=%p",
 				width, height, 0, 0, (void*)_dst);
 		} else {
 			// Large frame was in this video, use _specialBuffer for compositing
 			_dst = _specialBuffer;
-			debug("SmushPlayer: Using _specialBuffer for small FOBJ %dx%d (compositing with large frame)",
+			debugC(DEBUG_SMUSH, "SmushPlayer: Using _specialBuffer for small FOBJ %dx%d (compositing with large frame)",
 				width, height);
 		}
 	}
@@ -612,7 +614,7 @@ void SmushPlayerRebel2::ra2HandleGost(int32 subSize, Common::SeekableReadStream
 	int16 ghostY = b.readSint16LE();
 
 	if (!_hasFrameFobjForGost || _lastFobjData == nullptr || _lastFobjDataSize <= 0) {
-		debug("SmushPlayer GOST: frame=%d ignored (no current-frame FOBJ cached)", _frame);
+		debugC(DEBUG_SMUSH, "SmushPlayer GOST: frame=%d ignored (no current-frame FOBJ cached)", _frame);
 		return;
 	}
 
@@ -630,7 +632,7 @@ void SmushPlayerRebel2::ra2HandleGost(int32 subSize, Common::SeekableReadStream
 	int left = _lastFobjLeft + ghostX;
 	int top = _lastFobjTop + ghostY;
 
-	debug("SmushPlayer GOST: frame=%d type=%d flags=0x%04x gostPos=(%d,%d) basePos=(%d,%d) finalPos=(%d,%d) size=%dx%d codec=%d",
+	debugC(DEBUG_SMUSH, "SmushPlayer GOST: frame=%d type=%d flags=0x%04x gostPos=(%d,%d) basePos=(%d,%d) finalPos=(%d,%d) size=%dx%d codec=%d",
 		_frame, ghostType, priorityFlags, ghostX, ghostY,
 		_lastFobjLeft, _lastFobjTop, left, top,
 		_lastFobjWidth, _lastFobjHeight, _lastFobjCodec);
@@ -698,7 +700,7 @@ bool SmushPlayerRebel2::handleGameStoreFrame() {
 }
 
 void SmushPlayerRebel2::handleGameFrameObjectPre(int codec, int left, int top, int width, int height, int dataSize) {
-	debug("SmushPlayer FOBJ: frame=%d codec=%d pos=(%d,%d) size=%dx%d dataSize=%d storeFrame=%d _width=%d _height=%d",
+	debugC(DEBUG_SMUSH, "SmushPlayer FOBJ: frame=%d codec=%d pos=(%d,%d) size=%dx%d dataSize=%d storeFrame=%d _width=%d _height=%d",
 		_frame, codec, left, top, width, height, dataSize, _storeFrame, _width, _height);
 }
 


Commit: f046a35f7809212b8b895e7b38e5af505f82bb96
    https://github.com/scummvm/scummvm/commit/f046a35f7809212b8b895e7b38e5af505f82bb96
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-06-01T08:41:48+02:00

Commit Message:
SCUMM: RA2: removed expensive non-zero pixel counter used for debug

Changed paths:
    engines/scumm/smush/rebel/smush_player_ra2.cpp


diff --git a/engines/scumm/smush/rebel/smush_player_ra2.cpp b/engines/scumm/smush/rebel/smush_player_ra2.cpp
index 0d6a8b0e663..53afda31784 100644
--- a/engines/scumm/smush/rebel/smush_player_ra2.cpp
+++ b/engines/scumm/smush/rebel/smush_player_ra2.cpp
@@ -120,17 +120,8 @@ void SmushPlayerRebel2::initGameVideoState() {
 		if ((_curVideoFlags & 0x08) == 0) {
 			// Cinematic mode (flags 0x20) - clear buffer for fresh video
 			memset(_dst, 0, vs->w * vs->h);
-		} else {
-			// Gameplay mode (flags 0x28) - do nothing, preserve existing screen content
-			if (debugChannelSet(-1, DEBUG_SMUSH)) {
-				int nonZero = 0;
-				for (int i = 0; i < vs->w * vs->h; i++) {
-					if (_dst[i] != 0) nonZero++;
-				}
-				debugC(DEBUG_SMUSH, "SmushPlayer::init: Preserving screen for gameplay video (%dx%d, %d%% non-zero)",
-					vs->w, vs->h, (nonZero * 100) / (vs->w * vs->h));
-			}
 		}
+		// Gameplay mode (flags 0x28): no-op, the existing screen content is preserved.
 	}
 }
 


Commit: a36e9516b199c7249c24697b2ba1e9871096f1f8
    https://github.com/scummvm/scummvm/commit/a36e9516b199c7249c24697b2ba1e9871096f1f8
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-06-01T09:02:32+02:00

Commit Message:
SCUMM: RA1: use DEBUG_INSANE for debug statements

Changed paths:
    engines/scumm/insane/rebel1/iact.cpp
    engines/scumm/insane/rebel1/levels.cpp
    engines/scumm/insane/rebel1/menu.cpp
    engines/scumm/insane/rebel1/rebel.cpp
    engines/scumm/insane/rebel1/render.cpp
    engines/scumm/insane/rebel1/runlevels.cpp
    engines/scumm/insane/rebel1/saveload.cpp


diff --git a/engines/scumm/insane/rebel1/iact.cpp b/engines/scumm/insane/rebel1/iact.cpp
index a6f94915ecb..68b0e2afac4 100644
--- a/engines/scumm/insane/rebel1/iact.cpp
+++ b/engines/scumm/insane/rebel1/iact.cpp
@@ -639,7 +639,7 @@ void InsaneRebel1::checkDynamicLevelBranch(int32 curFrame) {
 			_vm->_smushVideoShouldFinish = true;
 			const int32 resumeFrame = (_currentLevel == 6 && _pendingRouteStartFrame < 0) ?
 				0 : _pendingRouteStartFrame;
-			debug(1, "RA1 L%d cutover: route=%d -> %d at %s=%u (resumeFrame=%d)",
+			debugC(DEBUG_INSANE, "RA1 L%d cutover: route=%d -> %d at %s=%u (resumeFrame=%d)",
 				_currentLevel + 1, _levelRouteIndex, _pendingRouteIndex,
 				_currentLevel == 6 ? "localFrame" : "frame",
 				(unsigned)routeFrame, (int)resumeFrame);
@@ -681,7 +681,7 @@ void InsaneRebel1::checkDynamicLevelBranch(int32 curFrame) {
 				: (branchX < kLevel7BranchThreshold[nextRoute]);
 			if (!takeBranch) {
 				if (routeFrame == decisionFrame)
-					debug(1, "RA1 L7 branch miss: route=%d candidate=%d localFrame=%u gameFrame=%d shipX=%d dir=%d threshold=%d",
+					debugC(DEBUG_INSANE, "RA1 L7 branch miss: route=%d candidate=%d localFrame=%u gameFrame=%d shipX=%d dir=%d threshold=%d",
 						route, nextRoute, (unsigned)routeFrame, (int)_gameCounter, branchX,
 						kLevel7BranchDir[nextRoute], kLevel7BranchThreshold[nextRoute]);
 				continue;
@@ -692,7 +692,7 @@ void InsaneRebel1::checkDynamicLevelBranch(int32 curFrame) {
 			_pendingRouteStartFrame = (int32)routeFrame;
 			_pendingRouteVideoStartFrame = 1 + (_pendingRouteCutoverFrame - _pendingRouteStartFrame);
 			_level7WarningFrames = 0;
-			debug(1, "RA1 L7 branch: route=%d -> %d at localFrame=%u gameFrame=%d decisionFrame=%u shipX=%d resumeSourceFrame=%d cutoverFrame=%d destFrame=%d",
+			debugC(DEBUG_INSANE, "RA1 L7 branch: route=%d -> %d at localFrame=%u gameFrame=%d decisionFrame=%u shipX=%d resumeSourceFrame=%d cutoverFrame=%d destFrame=%d",
 				route, nextRoute, (unsigned)routeFrame, (int)_gameCounter, (unsigned)decisionFrame, branchX,
 				(int)_pendingRouteStartFrame, (int)_pendingRouteCutoverFrame,
 				(int)_pendingRouteVideoStartFrame);
@@ -1213,9 +1213,9 @@ void InsaneRebel1::updateShipPhysics() {
 		if (_shipPosX > kRA1CenterX) {
 			_rightPathSelected = true;
 			_vm->_smushVideoShouldFinish = true;
-			debug(1, "RA1: Right path selected (counter=%d, shipX=%d)", _gameCounter, _shipPosX);
+			debugC(DEBUG_INSANE, "RA1: Right path selected (counter=%d, shipX=%d)", _gameCounter, _shipPosX);
 		} else {
-			debug(1, "RA1: Left path retained (counter=%d, shipX=%d)", _gameCounter, _shipPosX);
+			debugC(DEBUG_INSANE, "RA1: Left path retained (counter=%d, shipX=%d)", _gameCounter, _shipPosX);
 		}
 		_pathBranchEnabled = false;
 	}
@@ -1552,13 +1552,13 @@ void InsaneRebel1::updateGameOp0BPhysics() {
 		// FUN_1CDA7 dispatches g_sfxDamageHit, initialized from SYS/BOOM.SAD.
 		playSfx(kSfxBoom, 127, 0);
 		if (_currentLevel == 1) {
-			debug(1, "RA1 L2 player hit: frame=%u view=(%d,%d) latch=%u asteroid=%d flags=0x%02x health=%d->%d",
+			debugC(DEBUG_INSANE, "RA1 L2 player hit: frame=%u view=(%d,%d) latch=%u asteroid=%d flags=0x%02x health=%d->%d",
 				(unsigned)(uint16)_gameCounter, _perspectiveX, _perspectiveY,
 				(unsigned)_gameLatch5D, level2AsteroidHit ? 1 : 0,
 				appliedDamageFlags, oldHealth, _health);
 		}
 		if (level8WalkerPlayerHit) {
-			debug(1, "RA1 L8 player hit by walker: route=%d frame=%u view=(%d,%d) flags=0x%02x health=%d->%d",
+			debugC(DEBUG_INSANE, "RA1 L8 player hit by walker: route=%d frame=%u view=(%d,%d) flags=0x%02x health=%d->%d",
 				CLIP<int>(_levelRouteIndex, 0, 2), (unsigned)(uint16)_gameCounter,
 				_perspectiveX, _perspectiveY, appliedDamageFlags, oldHealth, _health);
 		}
@@ -1691,7 +1691,7 @@ void InsaneRebel1::updateGameOp0BPhysics() {
 			const bool target215Destroyed = isFrameObjectPrimarySet(215);
 			if (!target211Destroyed || !target213Destroyed || !target215Destroyed) {
 				_levelGameplayPhase = 1;
-				debug(1, "RA1 L12 retry armed: frame=0x%04x targets=(%d,%d,%d)",
+				debugC(DEBUG_INSANE, "RA1 L12 retry armed: frame=0x%04x targets=(%d,%d,%d)",
 					_frameCounter,
 					target211Destroyed ? 1 : 0,
 					target213Destroyed ? 1 : 0,
@@ -2135,7 +2135,7 @@ void InsaneRebel1::handleGameOpcode0DCorridor(int32 subSize, Common::SeekableRea
 		}
 	}
 	if ((_damageFlags & 0x0F) != oldDirectionalFlags) {
-		debug(1, "RA1 0x0D hit: ship=(%d,%d) corridor=[%d,%d]-[%d,%d] flags=0x%02x zoneSuppressed=%d",
+		debugC(DEBUG_INSANE, "RA1 0x0D hit: ship=(%d,%d) corridor=[%d,%d]-[%d,%d] flags=0x%02x zoneSuppressed=%d",
 			collisionShipX, collisionShipY,
 			_corridorLeftX, _corridorTopY, _corridorRightX, _corridorBottomY,
 			_damageFlags, suppressDirectionalDamage ? 1 : 0);
@@ -2177,7 +2177,7 @@ void InsaneRebel1::handleGameOpcode0EZone(int32 subSize, Common::SeekableReadStr
 		collisionShipX > zoneLeft && collisionShipX < zoneRight &&
 		collisionShipY > zoneTop && collisionShipY < zoneBottom) {
 		_damageFlags |= 0x10;
-		debug(1, "RA1 0x0E hit: ship=(%d,%d) zone=[%d,%d]-[%d,%d] raw=[%d,%d]+(%d,%d) cam=(%d,%d) flags=0x%02x",
+		debugC(DEBUG_INSANE, "RA1 0x0E hit: ship=(%d,%d) zone=[%d,%d]-[%d,%d] raw=[%d,%d]+(%d,%d) cam=(%d,%d) flags=0x%02x",
 			collisionShipX, collisionShipY, zoneLeft, zoneTop, zoneRight, zoneBottom,
 			rawZoneLeft, rawZoneTop, zoneWidth, zoneHeight,
 			_perspectiveX, _perspectiveY, _damageFlags);
@@ -2203,7 +2203,7 @@ void InsaneRebel1::handleGameOpcode0BFirstPerson(int32 subSize, Common::Seekable
 		if (_interactiveVideoActive && maxFrames > 0 &&
 			_gameCounter >= (int32)maxFrames - 1) {
 			_vm->_smushVideoShouldFinish = true;
-			debug(1, "RA1: finishing 0x0B interactive video at counter=%d/%u", _gameCounter, maxFrames);
+			debugC(DEBUG_INSANE, "RA1: finishing 0x0B interactive video at counter=%d/%u", _gameCounter, maxFrames);
 		}
 	}
 	debug(7, "RA1 GAME 0x0B: counter=%d", _gameCounter);
@@ -2397,7 +2397,7 @@ void InsaneRebel1::processShot() {
 	playSfx(torpedoMode ? kSfxAlert : kSfxLaserShot, 127, 0);
 
 	if (effectiveOpcode == 0x09 || _currentLevel == 4) {
-		debug(1, "RA1 shot: opcode=0x%02x frame=%d slot=%d cursor=(%d,%d) origin=(%d,%d) dir=%d mode=%d",
+		debugC(DEBUG_INSANE, "RA1 shot: opcode=0x%02x frame=%d slot=%d cursor=(%d,%d) origin=(%d,%d) dir=%d mode=%d",
 			effectiveOpcode, _gameCounter, slot, cursorX, cursorY, originX, originY,
 			_shipDirIndex, _flyControlMode);
 	} else {
diff --git a/engines/scumm/insane/rebel1/levels.cpp b/engines/scumm/insane/rebel1/levels.cpp
index f32b598aee8..5e050f17d8c 100644
--- a/engines/scumm/insane/rebel1/levels.cpp
+++ b/engines/scumm/insane/rebel1/levels.cpp
@@ -156,7 +156,7 @@ bool InsaneRebel1::loadRA1Nut(const char *filename, RA1SpriteBank &bank) {
 	free(fobjOffsets);
 
 	free(data);
-	debug(1, "InsaneRebel1::loadRA1Nut('%s'): expected=%d found=%d decoded=%d bytes",
+	debugC(DEBUG_INSANE, "InsaneRebel1::loadRA1Nut('%s'): expected=%d found=%d decoded=%d bytes",
 		  filename, expectedSprites, foundSprites, decodedSize);
 	return true;
 }
@@ -169,14 +169,14 @@ void InsaneRebel1::loadLevelSprites(int level) {
 		if (!loadRA1Nut(legacyBankFile.c_str(), _shipBank)) {
 			Common::String pilotFile = Common::String::format("LVL%d/L%dPILOT.NUT", level, level);
 			if (!loadRA1Nut(pilotFile.c_str(), _shipBank))
-				debug(1, "InsaneRebel1: No BANK1/BANK/PILOT for level %d", level);
+				debugC(DEBUG_INSANE, "InsaneRebel1: No BANK1/BANK/PILOT for level %d", level);
 		}
 	}
 
 	// Secondary ship bank used by some level-specific handlers (e.g. LVL1 mode-2).
 	Common::String bankFileAlt = Common::String::format("LVL%d/L%dBANK2.NUT", level, level);
 	if (!loadRA1Nut(bankFileAlt.c_str(), _shipBankAlt)) {
-		debug(1, "InsaneRebel1: No BANK2 for level %d", level);
+		debugC(DEBUG_INSANE, "InsaneRebel1: No BANK2 for level %d", level);
 	}
 
 	loadRA1Nut("SYS/DISPLAY.NUT", _displayBank);
diff --git a/engines/scumm/insane/rebel1/menu.cpp b/engines/scumm/insane/rebel1/menu.cpp
index bcd73aff0de..42c09914d77 100644
--- a/engines/scumm/insane/rebel1/menu.cpp
+++ b/engines/scumm/insane/rebel1/menu.cpp
@@ -516,7 +516,7 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 	}
 
 	if (event.type == Common::EVENT_JOYBUTTON_DOWN || event.type == Common::EVENT_JOYBUTTON_UP) {
-		debug(1, "RA1 input raw-joy-button: button=%d pressed=%d menu=%d gameplay=%d storedAxis=(%d,%d)",
+		debugC(DEBUG_INSANE, "RA1 input raw-joy-button: button=%d pressed=%d menu=%d gameplay=%d storedAxis=(%d,%d)",
 			event.joystick.button, event.type == Common::EVENT_JOYBUTTON_DOWN,
 			_menuActive, _interactiveVideoActive && !_menuActive,
 			_joystickAxisX, _joystickAxisY);
@@ -595,7 +595,7 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 		event.type == Common::EVENT_CUSTOM_ENGINE_ACTION_END) {
 		const bool pressed = (event.type == Common::EVENT_CUSTOM_ENGINE_ACTION_START);
 
-		debug(1, "RA1 input mapped-action: action=%s custom=%u pressed=%d menu=%d gameplay=%d storedAxis=(%d,%d) actionState(L,R,U,D)=(%d,%d,%d,%d)",
+		debugC(DEBUG_INSANE, "RA1 input mapped-action: action=%s custom=%u pressed=%d menu=%d gameplay=%d storedAxis=(%d,%d) actionState(L,R,U,D)=(%d,%d,%d,%d)",
 			getRebel1ActionName(event.customType), event.customType, pressed,
 			_menuActive, _interactiveVideoActive && !_menuActive,
 			_joystickAxisX, _joystickAxisY,
@@ -655,10 +655,10 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 	if (event.type == Common::EVENT_MAINMENU && _interactiveVideoActive && !_menuActive) {
 		const uint32 now = _vm->_system->getMillis();
 		const uint32 elapsedSinceAxis = _lastJoystickAxisEventTime ? now - _lastJoystickAxisEventTime : 0xffffffffu;
-		debug(1, "RA1 input mainmenu-event: gameplay=1 elapsedSinceAxis=%u storedAxis=(%d,%d)",
+		debugC(DEBUG_INSANE, "RA1 input mainmenu-event: gameplay=1 elapsedSinceAxis=%u storedAxis=(%d,%d)",
 			elapsedSinceAxis, _joystickAxisX, _joystickAxisY);
 		if (elapsedSinceAxis <= kRA1JoystickAxisEscGuardMs) {
-			debug(1, "RA1 input ignored mainmenu event after recent joystick axis movement (%u ms)", elapsedSinceAxis);
+			debugC(DEBUG_INSANE, "RA1 input ignored mainmenu event after recent joystick axis movement (%u ms)", elapsedSinceAxis);
 			return true;
 		}
 	}
@@ -668,11 +668,11 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 			event.kbd.keycode == Common::KEYCODE_ESCAPE) {
 			const uint32 now = _vm->_system->getMillis();
 			const uint32 elapsedSinceAxis = _lastJoystickAxisEventTime ? now - _lastJoystickAxisEventTime : 0xffffffffu;
-			debug(1, "RA1 input keydown-escape: gameplay=1 ascii=%d flags=0x%x repeat=%d elapsedSinceAxis=%u storedAxis=(%d,%d)",
+			debugC(DEBUG_INSANE, "RA1 input keydown-escape: gameplay=1 ascii=%d flags=0x%x repeat=%d elapsedSinceAxis=%u storedAxis=(%d,%d)",
 				event.kbd.ascii, event.kbd.flags, event.kbdRepeat,
 				elapsedSinceAxis, _joystickAxisX, _joystickAxisY);
 			if (elapsedSinceAxis <= kRA1JoystickAxisEscGuardMs) {
-				debug(1, "RA1 input ignored ESC after recent joystick axis movement (%u ms)", elapsedSinceAxis);
+				debugC(DEBUG_INSANE, "RA1 input ignored ESC after recent joystick axis movement (%u ms)", elapsedSinceAxis);
 				return true;
 			}
 
@@ -929,7 +929,7 @@ bool InsaneRebel1::runTextEntryMenuLoop() {
 }
 
 int InsaneRebel1::runMainMenu() {
-	debug(1, "InsaneRebel1: Main menu");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Main menu");
 
 	_menuSelection = 0;
 	while (!shouldAbortGameFlow()) {
@@ -962,13 +962,13 @@ int InsaneRebel1::runPasscodeEntryDialog() {
 			_maxChapterUnlocked = MAX<int16>(_maxChapterUnlocked, i);
 			if (targetLevel <= kRA1NumLevels)
 				_startLevel = targetLevel;
-			debug(1, "RA1 passcode accepted: slot=%d password=%s difficulty=%d target=%d",
+			debugC(DEBUG_INSANE, "RA1 passcode accepted: slot=%d password=%s difficulty=%d target=%d",
 				i, password, _difficulty, targetLevel);
 			return targetLevel;
 		}
 	}
 
-	debug(1, "RA1 passcode rejected: '%s'", _textEntryBuffer);
+	debugC(DEBUG_INSANE, "RA1 passcode rejected: '%s'", _textEntryBuffer);
 	return 0;
 }
 
@@ -995,7 +995,7 @@ bool InsaneRebel1::runHighScoreNameEntry() {
 	Common::strlcpy(_highScores[slot].name, storedName.c_str(), sizeof(_highScores[slot].name));
 	_highScores[slot].difficulty = _difficulty;
 	_highScoreEntryIndex = -1;
-	debug(1, "RA1 high score inserted: slot=%d name=%s score=%ld difficulty=%d",
+	debugC(DEBUG_INSANE, "RA1 high score inserted: slot=%d name=%s score=%ld difficulty=%d",
 		slot, _highScores[slot].name, (long)_highScores[slot].score, _highScores[slot].difficulty);
 	return true;
 }
diff --git a/engines/scumm/insane/rebel1/rebel.cpp b/engines/scumm/insane/rebel1/rebel.cpp
index 875a305541e..6ebd1efd8e8 100644
--- a/engines/scumm/insane/rebel1/rebel.cpp
+++ b/engines/scumm/insane/rebel1/rebel.cpp
@@ -192,7 +192,7 @@ void InsaneRebel1::loadTuningForLevel(int level) {
 	_protectedTargetA = 0;
 	_protectedTargetB = 0;
 
-	debug(1, "RA1: Loaded tuning level=%d diff=%d: roll=%d lift=%d slide=%d drift=%d snap=%d "
+	debugC(DEBUG_INSANE, "RA1: Loaded tuning level=%d diff=%d: roll=%d lift=%d slide=%d drift=%d snap=%d "
 		"miss=%d wham=%d shot=%d kill=%d time=%d levelPts=%d bonus=%d flags=0x%x",
 		level, d, _tuning.roll, _tuning.lift, _tuning.slide, _tuning.drift, _tuning.snap,
 		_tuning.miss, _tuning.wham, _tuning.shot, _tuning.kill,
@@ -404,17 +404,17 @@ InsaneRebel1::InsaneRebel1(ScummEngine_v7 *scumm) : Insane(), _vm(scumm) {
 	resetFrameObjectState();
 
 	if (loadRA1Nut("SYS/TALKFONT.NUT", _hudFontBank)) {
-		debug(1, "InsaneRebel1: HUD/menu glyph font loaded from SYS/TALKFONT.NUT (%d chars)", _hudFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1: HUD/menu glyph font loaded from SYS/TALKFONT.NUT (%d chars)", _hudFontBank.numSprites);
 	} else if (loadRA1Nut("SYS/TECHFONT.NUT", _hudFontBank)) {
-		debug(1, "InsaneRebel1: HUD/menu glyph font loaded from SYS/TECHFONT.NUT (%d chars)", _hudFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1: HUD/menu glyph font loaded from SYS/TECHFONT.NUT (%d chars)", _hudFontBank.numSprites);
 	} else {
 		warning("InsaneRebel1: failed to load RA1 HUD font bank (TECHFONT/TALKFONT)");
 	}
 
 	if (loadRA1Nut("SYS/TITLFONT.NUT", _titleFontBank)) {
-		debug(1, "InsaneRebel1: title glyph font loaded from SYS/TITLFONT.NUT (%d chars)", _titleFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1: title glyph font loaded from SYS/TITLFONT.NUT (%d chars)", _titleFontBank.numSprites);
 	} else if (loadRA1Nut("SYS/TALKFONT.NUT", _titleFontBank)) {
-		debug(1, "InsaneRebel1: title glyph font fallback loaded from SYS/TALKFONT.NUT (%d chars)", _titleFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1: title glyph font fallback loaded from SYS/TALKFONT.NUT (%d chars)", _titleFontBank.numSprites);
 	} else {
 		warning("InsaneRebel1: failed to load title font bank (TITLFONT/TALKFONT)");
 	}
@@ -422,9 +422,9 @@ InsaneRebel1::InsaneRebel1(ScummEngine_v7 *scumm) : Insane(), _vm(scumm) {
 	// FUN_1CB22 uses "<<" layer markers that resolve to TECHFONT in the original.
 	// Keep a dedicated TECH font bank for targeting markers/lock indicators.
 	if (loadRA1Nut("SYS/TECHFONT.NUT", _techFontBank)) {
-		debug(1, "InsaneRebel1: targeting glyph font loaded from SYS/TECHFONT.NUT (%d chars)", _techFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1: targeting glyph font loaded from SYS/TECHFONT.NUT (%d chars)", _techFontBank.numSprites);
 	} else if (loadRA1Nut("SYS/TALKFONT.NUT", _techFontBank)) {
-		debug(1, "InsaneRebel1: targeting glyph font fallback loaded from SYS/TALKFONT.NUT (%d chars)", _techFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1: targeting glyph font fallback loaded from SYS/TALKFONT.NUT (%d chars)", _techFontBank.numSprites);
 	} else {
 		warning("InsaneRebel1: failed to load targeting font bank (TECHFONT/TALKFONT)");
 	}
diff --git a/engines/scumm/insane/rebel1/render.cpp b/engines/scumm/insane/rebel1/render.cpp
index ae7f90294a6..110c3911e43 100644
--- a/engines/scumm/insane/rebel1/render.cpp
+++ b/engines/scumm/insane/rebel1/render.cpp
@@ -1908,7 +1908,7 @@ void InsaneRebel1::updateLevel8WalkerState() {
 			_pendingRouteIndex = newRoute;
 			_pendingRouteCutoverFrame = _gameCounter + 7;
 			_pendingRouteStartFrame = _pendingRouteCutoverFrame;
-			debug(1, "RA1 L8 branch: route=%d -> %d at frame=%u shipX=%d resumeTimelineFrame=%d cutoverFrame=%d",
+			debugC(DEBUG_INSANE, "RA1 L8 branch: route=%d -> %d at frame=%u shipX=%d resumeTimelineFrame=%d cutoverFrame=%d",
 				route, newRoute, (unsigned)_gameCounter, _shipPosX,
 				(int)_pendingRouteStartFrame, (int)_pendingRouteCutoverFrame);
 		}
diff --git a/engines/scumm/insane/rebel1/runlevels.cpp b/engines/scumm/insane/rebel1/runlevels.cpp
index 8dffb1c5a27..62c35eaf205 100644
--- a/engines/scumm/insane/rebel1/runlevels.cpp
+++ b/engines/scumm/insane/rebel1/runlevels.cpp
@@ -147,7 +147,7 @@ static int calculateThresholdBonus(int kills, int perfectThreshold, int perKillT
 // Reuses RA2's pattern: reset handler, set cinematic flags, play video.
 // startFrame > 0: fast-forward (decode without display/audio) to that frame.
 void InsaneRebel1::playCinematic(const char *filename, int32 startFrame) {
-	debug(1, "InsaneRebel1::playCinematic('%s', startFrame=%d)", filename, startFrame);
+	debugC(DEBUG_INSANE, "InsaneRebel1::playCinematic('%s', startFrame=%d)", filename, startFrame);
 	if (shouldAbortGameFlow())
 		return;
 
@@ -315,7 +315,7 @@ void InsaneRebel1::clearVideoBuffer() {
 //   1. O1LOGO.ANM — LucasArts logo
 //   2. O1OPEN.ANM — Star Wars opening crawl
 void InsaneRebel1::playIntroSequence() {
-	debug(1, "InsaneRebel1: Playing intro sequence");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Playing intro sequence");
 
 	// LucasArts logo (original: PUSH 0x57cc, CALL FUN_1BA32 with flags 0x0420)
 	playCinematic("OPEN/O1LOGO.ANM");
@@ -347,7 +347,7 @@ void InsaneRebel1::playIntroSequence() {
 //     lives==0: L1DEATH → return to menu
 
 bool InsaneRebel1::runLevel1() {
-	debug(1, "InsaneRebel1: Running level 1");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 1");
 
 	_currentLevel = 0;
 	loadTuningForLevel(0);
@@ -448,7 +448,7 @@ bool InsaneRebel1::runLevel1() {
 }
 
 bool InsaneRebel1::runLevel2() {
-	debug(1, "InsaneRebel1: Running level 2");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 2");
 
 	_currentLevel = 1;
 	loadLevelSprites(2);
@@ -489,7 +489,7 @@ bool InsaneRebel1::runLevel2() {
 }
 
 bool InsaneRebel1::runLevel3() {
-	debug(1, "InsaneRebel1: Running level 3");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 3");
 
 	_currentLevel = 2;
 	loadLevelSprites(3);
@@ -530,7 +530,7 @@ bool InsaneRebel1::runLevel3() {
 }
 
 bool InsaneRebel1::runLevel4() {
-	debug(1, "InsaneRebel1: Running level 4");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 4");
 
 	_currentLevel = 3;
 	loadLevelSprites(4);
@@ -600,7 +600,7 @@ bool InsaneRebel1::runLevel4() {
 }
 
 bool InsaneRebel1::runLevel5() {
-	debug(1, "InsaneRebel1: Running level 5");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 5");
 
 	_currentLevel = 4;
 	loadLevelSprites(5);
@@ -682,7 +682,7 @@ bool InsaneRebel1::runLevel5() {
 }
 
 bool InsaneRebel1::runLevel6() {
-	debug(1, "InsaneRebel1: Running level 6");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 6");
 
 	_currentLevel = 5;
 	loadLevelSprites(6);
@@ -727,7 +727,7 @@ bool InsaneRebel1::runLevel6() {
 }
 
 bool InsaneRebel1::runLevel7() {
-	debug(1, "InsaneRebel1: Running level 7");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 7");
 
 	const char *const kLevel7Segments[] = {
 		"LVL7/L7PLAY1.ANM",
@@ -811,7 +811,7 @@ bool InsaneRebel1::runLevel7() {
 }
 
 bool InsaneRebel1::runLevel8() {
-	debug(1, "InsaneRebel1: Running level 8");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 8");
 
 	const char *const kLevel8Routes[] = {
 		"LVL8/L8PLAY.ANM",
@@ -887,7 +887,7 @@ bool InsaneRebel1::runLevel8() {
 }
 
 bool InsaneRebel1::runLevel9() {
-	debug(1, "InsaneRebel1: Running level 9");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 9");
 
 	// DOS RunLevel9Flow calls RandScaleByte(2) three times before the intro.
 	// That helper advances a byte seed with seed = seed * 9 + 0x35 and returns
@@ -921,7 +921,7 @@ bool InsaneRebel1::runLevel9() {
 			if (_killCount > 0)
 				return (_shipPosX < kRA1CenterX) ? 0 : 1;
 
-			debug(1, "RA1 L9 selector '%s' ended without target hit; replaying", filename);
+			debugC(DEBUG_INSANE, "RA1 L9 selector '%s' ended without target hit; replaying", filename);
 		}
 		return -1;
 	};
@@ -1077,7 +1077,7 @@ bool InsaneRebel1::runLevel9() {
 }
 
 bool InsaneRebel1::runLevel10() {
-	debug(1, "InsaneRebel1: Running level 10");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 10");
 
 	_currentLevel = 9;
 	loadLevelSprites(10);
@@ -1118,7 +1118,7 @@ bool InsaneRebel1::runLevel10() {
 // Turret-style level. Single interactive phase with kill-count retry.
 // Original: L11INTRO → L11PLAY (turret, killCount>4 to pass) → L11RETRY → retry/L11END
 bool InsaneRebel1::runLevel11() {
-	debug(1, "InsaneRebel1: Running level 11");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 11");
 
 	_currentLevel = 10;
 	loadLevelSprites(11);
@@ -1175,7 +1175,7 @@ bool InsaneRebel1::runLevel11() {
 // Single interactive phase with mid-level retry mechanism.
 // Original: L12INTRO → L12PLAY → (retry at specific frame) → L12END
 bool InsaneRebel1::runLevel12() {
-	debug(1, "InsaneRebel1: Running level 12");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 12");
 
 	_currentLevel = 11;
 	loadLevelSprites(12);
@@ -1238,7 +1238,7 @@ bool InsaneRebel1::runLevel12() {
 // Flight level with enemy projectile system (original has 5-slot projectile tracking).
 // Original: L13INTRO → L13PLAY → L13END/L13NEW/L13DEATH
 bool InsaneRebel1::runLevel13() {
-	debug(1, "InsaneRebel1: Running level 13");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 13");
 
 	_currentLevel = 12;
 	loadLevelSprites(13);
@@ -1281,7 +1281,7 @@ bool InsaneRebel1::runLevel13() {
 // Original: L14INTRO → L14PLAY → L14PLAY2 → optional L14PLY2B splice
 //   → L14END/L14NEW/L14DEATH
 bool InsaneRebel1::runLevel14() {
-	debug(1, "InsaneRebel1: Running level 14");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 14");
 
 	_currentLevel = 13;
 	loadLevelSprites(14);
@@ -1355,7 +1355,7 @@ bool InsaneRebel1::runLevel14() {
 // Original: L15INTRO → L15PLAY1 (trench run) → L15INTR2 (torpedo lock cutscene)
 //   → L15PLAY2 (final approach + torpedo) → L15END1/L15NEW/L15DEATH
 bool InsaneRebel1::runLevel15() {
-	debug(1, "InsaneRebel1: Running level 15");
+	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 15");
 
 	_currentLevel = 14;
 	loadLevelSprites(15);
@@ -1401,7 +1401,7 @@ bool InsaneRebel1::runLevel15() {
 		}
 
 		if (_health >= 0 && !_torpedoFired) {
-			debug(1, "InsaneRebel1: Level 15 torpedo run ended without exhaust-port hit");
+			debugC(DEBUG_INSANE, "InsaneRebel1: Level 15 torpedo run ended without exhaust-port hit");
 			return false;
 		}
 
@@ -1625,30 +1625,30 @@ void InsaneRebel1::resolveSeek(const char *filename, int32 startFrame, int32 &vi
 			_pendingRouteVideoStartFrame : 1;
 		videoOffset = findAnimFrameChunkOffset(_vm, filename, videoStartFrame);
 		if (videoOffset < 0) {
-			debug(1, "RA1 L7 route switch: route=%d destinationFrame=%d offset lookup failed",
+			debugC(DEBUG_INSANE, "RA1 L7 route switch: route=%d destinationFrame=%d offset lookup failed",
 				_levelRouteIndex, (int)videoStartFrame);
 			videoStartFrame = 0;
 			videoOffset = 0;
 		} else {
-			debug(1, "RA1 L7 route switch: route=%d decisionLocalFrame=%d opens destination at localFrame=%d offset=0x%x",
+			debugC(DEBUG_INSANE, "RA1 L7 route switch: route=%d decisionLocalFrame=%d opens destination at localFrame=%d offset=0x%x",
 				_levelRouteIndex, (int)_pendingRouteStartFrame,
 				(int)videoStartFrame, (unsigned)videoOffset);
 		}
 	} else if (_currentLevel == 7 && resumingRoute) {
 		videoOffset = findAnimFrameChunkOffsetByGameCounter(_vm, filename, startFrame, videoStartFrame);
 		if (videoOffset < 0) {
-			debug(1, "RA1 L8 resume: route=%d timelineFrame=%d GAME counter lookup failed",
+			debugC(DEBUG_INSANE, "RA1 L8 resume: route=%d timelineFrame=%d GAME counter lookup failed",
 				_levelRouteIndex, (int)startFrame);
 			videoStartFrame = startFrame;
 			videoOffset = findAnimFrameChunkOffset(_vm, filename, videoStartFrame);
 		}
 		if (videoOffset < 0) {
-			debug(1, "RA1 L8 resume: route=%d timelineFrame=%d localFrame=%d offset lookup failed",
+			debugC(DEBUG_INSANE, "RA1 L8 resume: route=%d timelineFrame=%d localFrame=%d offset lookup failed",
 				_levelRouteIndex, (int)startFrame, (int)videoStartFrame);
 			videoStartFrame = 0;
 			videoOffset = 0;
 		} else {
-			debug(1, "RA1 L8 resume: route=%d timelineFrame=%d -> localFrame=%d offset=0x%x",
+			debugC(DEBUG_INSANE, "RA1 L8 resume: route=%d timelineFrame=%d -> localFrame=%d offset=0x%x",
 				_levelRouteIndex, (int)startFrame, (int)videoStartFrame, (unsigned)videoOffset);
 		}
 	} else if (_currentLevel == 13 && resumingRoute) {
@@ -1656,7 +1656,7 @@ void InsaneRebel1::resolveSeek(const char *filename, int32 startFrame, int32 &vi
 		// oldMaxFrame-0x0F, 1, -1). That frame number belongs to L14PLAY2's
 		// timeline; L14PLY2B is already the continuation clip and starts at its
 		// matching lead-in frame. Preserve the current state, but do not seek.
-		debug(1, "RA1 L14 splice: L14PLAY2 timelineFrame=%d -> L14PLY2B frame 0",
+		debugC(DEBUG_INSANE, "RA1 L14 splice: L14PLAY2 timelineFrame=%d -> L14PLY2B frame 0",
 			(int)startFrame);
 	}
 }
@@ -1690,7 +1690,7 @@ void InsaneRebel1::playInteractiveVideoFile(const char *filename, int32 videoOff
 
 // Play interactive gameplay video (with ship physics + HUD).
 void InsaneRebel1::playInteractiveVideo(const char *filename, int32 startFrame) {
-	debug(1, "InsaneRebel1::playInteractiveVideo('%s', startFrame=%d)", filename, startFrame);
+	debugC(DEBUG_INSANE, "InsaneRebel1::playInteractiveVideo('%s', startFrame=%d)", filename, startFrame);
 	if (shouldAbortGameFlow())
 		return;
 
diff --git a/engines/scumm/insane/rebel1/saveload.cpp b/engines/scumm/insane/rebel1/saveload.cpp
index 06849925a7f..09335106b4d 100644
--- a/engines/scumm/insane/rebel1/saveload.cpp
+++ b/engines/scumm/insane/rebel1/saveload.cpp
@@ -115,7 +115,7 @@ Common::Error InsaneRebel1::writeSaveState(int slot, const Common::String &desc,
 		return Common::kWritingFailed;
 	}
 
-	debug(1, "RA1: saved slot=%d level=%d lives=%d score=%d desc='%s'",
+	debugC(DEBUG_INSANE, "RA1: saved slot=%d level=%d lives=%d score=%d desc='%s'",
 		slot, state.resumeLevel, state.lives, state.score, desc.c_str());
 	return Common::kNoError;
 }
@@ -219,7 +219,7 @@ Common::Error InsaneRebel1::loadGameState(int slot, bool startupLoad) {
 		_vm->_smushVideoShouldFinish = true;
 	}
 
-	debug(1, "RA1: loaded slot=%d level=%d lives=%d score=%d", slot, _resumeLevel, _lives, _score);
+	debugC(DEBUG_INSANE, "RA1: loaded slot=%d level=%d lives=%d score=%d", slot, _resumeLevel, _lives, _score);
 	return Common::kNoError;
 }
 
@@ -238,7 +238,7 @@ void InsaneRebel1::autosaveProgress() {
 	if (readSaveState(slot, oldState, &oldDesc)) {
 		if (oldState.resumeLevel > state.resumeLevel ||
 				(oldState.resumeLevel == state.resumeLevel && oldState.lives >= state.lives)) {
-			debug(1, "RA1: skipping autosave slot=%d level=%d lives=%d; existing level=%d lives=%d",
+			debugC(DEBUG_INSANE, "RA1: skipping autosave slot=%d level=%d lives=%d; existing level=%d lives=%d",
 				slot, state.resumeLevel, state.lives, oldState.resumeLevel, oldState.lives);
 			return;
 		}


Commit: 912e8b3bf4d05644c64d0a5df38a942d90bf29bb
    https://github.com/scummvm/scummvm/commit/912e8b3bf4d05644c64d0a5df38a942d90bf29bb
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-06-01T09:31:15+02:00

Commit Message:
SCUMM: RA: improve debug statements with class/function names

Changed paths:
    engines/scumm/insane/rebel1/levels.cpp
    engines/scumm/insane/rebel1/menu.cpp
    engines/scumm/insane/rebel1/rebel.cpp
    engines/scumm/insane/rebel1/runlevels.cpp
    engines/scumm/smush/rebel/codec_ra2.cpp
    engines/scumm/smush/rebel/smush_player_ra1.cpp
    engines/scumm/smush/rebel/smush_player_ra2.cpp


diff --git a/engines/scumm/insane/rebel1/levels.cpp b/engines/scumm/insane/rebel1/levels.cpp
index 5e050f17d8c..b24fb5b85d0 100644
--- a/engines/scumm/insane/rebel1/levels.cpp
+++ b/engines/scumm/insane/rebel1/levels.cpp
@@ -169,14 +169,14 @@ void InsaneRebel1::loadLevelSprites(int level) {
 		if (!loadRA1Nut(legacyBankFile.c_str(), _shipBank)) {
 			Common::String pilotFile = Common::String::format("LVL%d/L%dPILOT.NUT", level, level);
 			if (!loadRA1Nut(pilotFile.c_str(), _shipBank))
-				debugC(DEBUG_INSANE, "InsaneRebel1: No BANK1/BANK/PILOT for level %d", level);
+				debugC(DEBUG_INSANE, "InsaneRebel1::loadLevelSprites: No BANK1/BANK/PILOT for level %d", level);
 		}
 	}
 
 	// Secondary ship bank used by some level-specific handlers (e.g. LVL1 mode-2).
 	Common::String bankFileAlt = Common::String::format("LVL%d/L%dBANK2.NUT", level, level);
 	if (!loadRA1Nut(bankFileAlt.c_str(), _shipBankAlt)) {
-		debugC(DEBUG_INSANE, "InsaneRebel1: No BANK2 for level %d", level);
+		debugC(DEBUG_INSANE, "InsaneRebel1::loadLevelSprites: No BANK2 for level %d", level);
 	}
 
 	loadRA1Nut("SYS/DISPLAY.NUT", _displayBank);
diff --git a/engines/scumm/insane/rebel1/menu.cpp b/engines/scumm/insane/rebel1/menu.cpp
index 42c09914d77..3ded18a95d8 100644
--- a/engines/scumm/insane/rebel1/menu.cpp
+++ b/engines/scumm/insane/rebel1/menu.cpp
@@ -676,7 +676,7 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 				return true;
 			}
 
-			debugC(DEBUG_INSANE, "Rebel1: ESC pressed during gameplay - opening ScummVM menu");
+			debugC(DEBUG_INSANE, "InsaneRebel1::notifyEvent: ESC pressed during gameplay - opening ScummVM menu");
 			const bool wasPaused = _player->_paused;
 			if (!wasPaused)
 				_player->pause();
@@ -689,13 +689,13 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 		if (_interactiveVideoActive && !_menuActive &&
 			event.kbd.keycode == Common::KEYCODE_s &&
 			event.kbd.hasFlags(Common::KBD_SHIFT)) {
-			debugC(DEBUG_INSANE, "Rebel1: Shift+S pressed - skipping gameplay section");
+			debugC(DEBUG_INSANE, "InsaneRebel1::notifyEvent: Shift+S pressed - skipping gameplay section");
 			_vm->_smushVideoShouldFinish = true;
 			return true;
 		}
 
 		if (!_interactiveVideoActive && event.kbd.keycode == Common::KEYCODE_ESCAPE) {
-			debugC(DEBUG_INSANE, "Rebel1: ESC pressed - skipping cinematic");
+			debugC(DEBUG_INSANE, "InsaneRebel1::notifyEvent: ESC pressed - skipping cinematic");
 			_vm->_smushVideoShouldFinish = true;
 			return true;
 		}
@@ -929,7 +929,7 @@ bool InsaneRebel1::runTextEntryMenuLoop() {
 }
 
 int InsaneRebel1::runMainMenu() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Main menu");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runMainMenu: Main menu");
 
 	_menuSelection = 0;
 	while (!shouldAbortGameFlow()) {
diff --git a/engines/scumm/insane/rebel1/rebel.cpp b/engines/scumm/insane/rebel1/rebel.cpp
index 6ebd1efd8e8..af3ecab61c7 100644
--- a/engines/scumm/insane/rebel1/rebel.cpp
+++ b/engines/scumm/insane/rebel1/rebel.cpp
@@ -404,29 +404,29 @@ InsaneRebel1::InsaneRebel1(ScummEngine_v7 *scumm) : Insane(), _vm(scumm) {
 	resetFrameObjectState();
 
 	if (loadRA1Nut("SYS/TALKFONT.NUT", _hudFontBank)) {
-		debugC(DEBUG_INSANE, "InsaneRebel1: HUD/menu glyph font loaded from SYS/TALKFONT.NUT (%d chars)", _hudFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1::InsaneRebel1(): HUD/menu glyph font loaded from SYS/TALKFONT.NUT (%d chars)", _hudFontBank.numSprites);
 	} else if (loadRA1Nut("SYS/TECHFONT.NUT", _hudFontBank)) {
-		debugC(DEBUG_INSANE, "InsaneRebel1: HUD/menu glyph font loaded from SYS/TECHFONT.NUT (%d chars)", _hudFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1::InsaneRebel1(): HUD/menu glyph font loaded from SYS/TECHFONT.NUT (%d chars)", _hudFontBank.numSprites);
 	} else {
-		warning("InsaneRebel1: failed to load RA1 HUD font bank (TECHFONT/TALKFONT)");
+		warning("InsaneRebel1::InsaneRebel1(): failed to load RA1 HUD font bank (TECHFONT/TALKFONT)");
 	}
 
 	if (loadRA1Nut("SYS/TITLFONT.NUT", _titleFontBank)) {
-		debugC(DEBUG_INSANE, "InsaneRebel1: title glyph font loaded from SYS/TITLFONT.NUT (%d chars)", _titleFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1::InsaneRebel1(): title glyph font loaded from SYS/TITLFONT.NUT (%d chars)", _titleFontBank.numSprites);
 	} else if (loadRA1Nut("SYS/TALKFONT.NUT", _titleFontBank)) {
-		debugC(DEBUG_INSANE, "InsaneRebel1: title glyph font fallback loaded from SYS/TALKFONT.NUT (%d chars)", _titleFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1::InsaneRebel1(): title glyph font fallback loaded from SYS/TALKFONT.NUT (%d chars)", _titleFontBank.numSprites);
 	} else {
-		warning("InsaneRebel1: failed to load title font bank (TITLFONT/TALKFONT)");
+		warning("InsaneRebel1::InsaneRebel1(): failed to load title font bank (TITLFONT/TALKFONT)");
 	}
 
 	// FUN_1CB22 uses "<<" layer markers that resolve to TECHFONT in the original.
 	// Keep a dedicated TECH font bank for targeting markers/lock indicators.
 	if (loadRA1Nut("SYS/TECHFONT.NUT", _techFontBank)) {
-		debugC(DEBUG_INSANE, "InsaneRebel1: targeting glyph font loaded from SYS/TECHFONT.NUT (%d chars)", _techFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1::InsaneRebel1(): targeting glyph font loaded from SYS/TECHFONT.NUT (%d chars)", _techFontBank.numSprites);
 	} else if (loadRA1Nut("SYS/TALKFONT.NUT", _techFontBank)) {
-		debugC(DEBUG_INSANE, "InsaneRebel1: targeting glyph font fallback loaded from SYS/TALKFONT.NUT (%d chars)", _techFontBank.numSprites);
+		debugC(DEBUG_INSANE, "InsaneRebel1::InsaneRebel1(): targeting glyph font fallback loaded from SYS/TALKFONT.NUT (%d chars)", _techFontBank.numSprites);
 	} else {
-		warning("InsaneRebel1: failed to load targeting font bank (TECHFONT/TALKFONT)");
+		warning("InsaneRebel1::InsaneRebel1(): failed to load targeting font bank (TECHFONT/TALKFONT)");
 	}
 
 	// Audio
diff --git a/engines/scumm/insane/rebel1/runlevels.cpp b/engines/scumm/insane/rebel1/runlevels.cpp
index 62c35eaf205..0e9f86c23c0 100644
--- a/engines/scumm/insane/rebel1/runlevels.cpp
+++ b/engines/scumm/insane/rebel1/runlevels.cpp
@@ -315,7 +315,7 @@ void InsaneRebel1::clearVideoBuffer() {
 //   1. O1LOGO.ANM — LucasArts logo
 //   2. O1OPEN.ANM — Star Wars opening crawl
 void InsaneRebel1::playIntroSequence() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Playing intro sequence");
+	debugC(DEBUG_INSANE, "InsaneRebel1::playIntroSequence: Playing intro sequence");
 
 	// LucasArts logo (original: PUSH 0x57cc, CALL FUN_1BA32 with flags 0x0420)
 	playCinematic("OPEN/O1LOGO.ANM");
@@ -347,7 +347,7 @@ void InsaneRebel1::playIntroSequence() {
 //     lives==0: L1DEATH → return to menu
 
 bool InsaneRebel1::runLevel1() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 1");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel1: Running level 1");
 
 	_currentLevel = 0;
 	loadTuningForLevel(0);
@@ -448,7 +448,7 @@ bool InsaneRebel1::runLevel1() {
 }
 
 bool InsaneRebel1::runLevel2() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 2");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel2: Running level 2");
 
 	_currentLevel = 1;
 	loadLevelSprites(2);
@@ -489,7 +489,7 @@ bool InsaneRebel1::runLevel2() {
 }
 
 bool InsaneRebel1::runLevel3() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 3");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel3: Running level 3");
 
 	_currentLevel = 2;
 	loadLevelSprites(3);
@@ -530,7 +530,7 @@ bool InsaneRebel1::runLevel3() {
 }
 
 bool InsaneRebel1::runLevel4() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 4");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel4: Running level 4");
 
 	_currentLevel = 3;
 	loadLevelSprites(4);
@@ -600,7 +600,7 @@ bool InsaneRebel1::runLevel4() {
 }
 
 bool InsaneRebel1::runLevel5() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 5");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel5: Running level 5");
 
 	_currentLevel = 4;
 	loadLevelSprites(5);
@@ -682,7 +682,7 @@ bool InsaneRebel1::runLevel5() {
 }
 
 bool InsaneRebel1::runLevel6() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 6");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel6: Running level 6");
 
 	_currentLevel = 5;
 	loadLevelSprites(6);
@@ -727,7 +727,7 @@ bool InsaneRebel1::runLevel6() {
 }
 
 bool InsaneRebel1::runLevel7() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 7");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel7: Running level 7");
 
 	const char *const kLevel7Segments[] = {
 		"LVL7/L7PLAY1.ANM",
@@ -811,7 +811,7 @@ bool InsaneRebel1::runLevel7() {
 }
 
 bool InsaneRebel1::runLevel8() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 8");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel8: Running level 8");
 
 	const char *const kLevel8Routes[] = {
 		"LVL8/L8PLAY.ANM",
@@ -887,7 +887,7 @@ bool InsaneRebel1::runLevel8() {
 }
 
 bool InsaneRebel1::runLevel9() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 9");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel9: Running level 9");
 
 	// DOS RunLevel9Flow calls RandScaleByte(2) three times before the intro.
 	// That helper advances a byte seed with seed = seed * 9 + 0x35 and returns
@@ -1077,7 +1077,7 @@ bool InsaneRebel1::runLevel9() {
 }
 
 bool InsaneRebel1::runLevel10() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 10");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel10: Running level 10");
 
 	_currentLevel = 9;
 	loadLevelSprites(10);
@@ -1118,7 +1118,7 @@ bool InsaneRebel1::runLevel10() {
 // Turret-style level. Single interactive phase with kill-count retry.
 // Original: L11INTRO → L11PLAY (turret, killCount>4 to pass) → L11RETRY → retry/L11END
 bool InsaneRebel1::runLevel11() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 11");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel11: Running level 11");
 
 	_currentLevel = 10;
 	loadLevelSprites(11);
@@ -1175,7 +1175,7 @@ bool InsaneRebel1::runLevel11() {
 // Single interactive phase with mid-level retry mechanism.
 // Original: L12INTRO → L12PLAY → (retry at specific frame) → L12END
 bool InsaneRebel1::runLevel12() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 12");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel12: Running level 12");
 
 	_currentLevel = 11;
 	loadLevelSprites(12);
@@ -1238,7 +1238,7 @@ bool InsaneRebel1::runLevel12() {
 // Flight level with enemy projectile system (original has 5-slot projectile tracking).
 // Original: L13INTRO → L13PLAY → L13END/L13NEW/L13DEATH
 bool InsaneRebel1::runLevel13() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 13");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel13: Running level 13");
 
 	_currentLevel = 12;
 	loadLevelSprites(13);
@@ -1281,7 +1281,7 @@ bool InsaneRebel1::runLevel13() {
 // Original: L14INTRO → L14PLAY → L14PLAY2 → optional L14PLY2B splice
 //   → L14END/L14NEW/L14DEATH
 bool InsaneRebel1::runLevel14() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 14");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel14: Running level 14");
 
 	_currentLevel = 13;
 	loadLevelSprites(14);
@@ -1355,7 +1355,7 @@ bool InsaneRebel1::runLevel14() {
 // Original: L15INTRO → L15PLAY1 (trench run) → L15INTR2 (torpedo lock cutscene)
 //   → L15PLAY2 (final approach + torpedo) → L15END1/L15NEW/L15DEATH
 bool InsaneRebel1::runLevel15() {
-	debugC(DEBUG_INSANE, "InsaneRebel1: Running level 15");
+	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel15: Running level 15");
 
 	_currentLevel = 14;
 	loadLevelSprites(15);
@@ -1401,7 +1401,7 @@ bool InsaneRebel1::runLevel15() {
 		}
 
 		if (_health >= 0 && !_torpedoFired) {
-			debugC(DEBUG_INSANE, "InsaneRebel1: Level 15 torpedo run ended without exhaust-port hit");
+			debugC(DEBUG_INSANE, "InsaneRebel1::runLevel15: Level 15 torpedo run ended without exhaust-port hit");
 			return false;
 		}
 
diff --git a/engines/scumm/smush/rebel/codec_ra2.cpp b/engines/scumm/smush/rebel/codec_ra2.cpp
index 7ca7dd2e0d1..44f454f88b4 100644
--- a/engines/scumm/smush/rebel/codec_ra2.cpp
+++ b/engines/scumm/smush/rebel/codec_ra2.cpp
@@ -274,7 +274,7 @@ void smushDecodeRA2Bomp(byte *dst, const byte *src, int left, int top, int width
 	}
 
 	if (!foundValidOffset) {
-		warning("Rebel2: Codec 45 couldn't find valid RLE offset, using offset 0");
+		warning("smushDecodeRA2Bomp: Codec 45 couldn't find valid RLE offset, using offset 0");
 	}
 
 	src += headerSkip;
diff --git a/engines/scumm/smush/rebel/smush_player_ra1.cpp b/engines/scumm/smush/rebel/smush_player_ra1.cpp
index de6aad330bf..6c6712b787c 100644
--- a/engines/scumm/smush/rebel/smush_player_ra1.cpp
+++ b/engines/scumm/smush/rebel/smush_player_ra1.cpp
@@ -581,7 +581,7 @@ bool SmushPlayerRebel1::handleGameCodecDecode(int codec, const uint8 *src, int l
 		return true;
 	}
 	default:
-		debugC(DEBUG_SMUSH, "SmushPlayer::decodeFrameObject: Skipping unknown codec %d (left=%d, top=%d, %dx%d)",
+		debugC(DEBUG_SMUSH, "SmushPlayerRebel1::handleGameCodecDecode: Skipping unknown codec %d (left=%d, top=%d, %dx%d)",
 			codec, left, top, width, height);
 		return true;
 	}
diff --git a/engines/scumm/smush/rebel/smush_player_ra2.cpp b/engines/scumm/smush/rebel/smush_player_ra2.cpp
index 53afda31784..6b3da4f7524 100644
--- a/engines/scumm/smush/rebel/smush_player_ra2.cpp
+++ b/engines/scumm/smush/rebel/smush_player_ra2.cpp
@@ -152,7 +152,7 @@ bool SmushPlayerRebel2::handleGameFetch(int32 subSize, Common::SeekableReadStrea
 	int16 ftchX = b.readSint16LE();
 	int16 ftchY = b.readSint16LE();
 
-	debugC(DEBUG_SMUSH, "SmushPlayer::handleFetch: frame=%d unknown=%d x=%d y=%d",
+	debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleGameFetch: frame=%d unknown=%d x=%d y=%d",
 		_frame, ftchUnknown, ftchX, ftchY);
 
 	// For Handler 25, skip FTCH because the frame buffer only contains the
@@ -162,14 +162,14 @@ bool SmushPlayerRebel2::handleGameFetch(int32 subSize, Common::SeekableReadStrea
 		InsaneRebel2 *rebel2 = static_cast<InsaneRebel2 *>(_insane);
 		int handler = rebel2->getHandler();
 		if (handler == 25) {
-			debugC(DEBUG_SMUSH, "SmushPlayer::handleFetch: Skipping FTCH for Handler 25 - preserving overlays");
+			debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleGameFetch: Skipping FTCH for Handler 25 - preserving overlays");
 			return true;
 		}
 	}
 
 	// Re-decode stored FOBJ data with current offsets (matching original FUN_004246d0).
 	if (_storedFobjData != nullptr) {
-		debugC(DEBUG_SMUSH, "SmushPlayer FTCH: Re-decoding stored FOBJ codec=%d pos=(%d,%d) size=%dx%d dataSize=%d",
+		debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleGameFetch FTCH: Re-decoding stored FOBJ codec=%d pos=(%d,%d) size=%dx%d dataSize=%d",
 			_storedFobjCodec, _storedFobjLeft, _storedFobjTop,
 			_storedFobjWidth, _storedFobjHeight, _storedFobjDataSize);
 		decodeFrameObject(_storedFobjCodec, _storedFobjData,
@@ -177,7 +177,7 @@ bool SmushPlayerRebel2::handleGameFetch(int32 subSize, Common::SeekableReadStrea
 			_storedFobjWidth, _storedFobjHeight,
 			_storedFobjDataSize);
 	} else {
-		debugC(DEBUG_SMUSH, "SmushPlayer FTCH: No stored FOBJ data! (frame=%d)", _frame);
+		debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleGameFetch FTCH: No stored FOBJ data! (frame=%d)", _frame);
 	}
 
 	return true;
@@ -210,7 +210,7 @@ SmushFont *SmushPlayerRebel2::getGameFont(int font) {
 	if (font >= 0 && font < numFonts) {
 		_sf[font] = new SmushFont(_vm, ra2_fonts[font], true);
 	} else {
-		debugC(DEBUG_SMUSH, "SmushPlayer::getFont: RA2 unknown font %d, using TALKFONT", font);
+		debugC(DEBUG_SMUSH, "SmushPlayerRebel2::getGameFont: RA2 unknown font %d, using TALKFONT", font);
 		_sf[font] = new SmushFont(_vm, ra2_fonts[0], true);
 	}
 	return _sf[font];
@@ -392,7 +392,7 @@ bool SmushPlayerRebel2::handleGameAnimHeader(byte *headerContent) {
 	if (width == 0 && height == 0) {
 		_width = _vm->_screenWidth;
 		_height = _vm->_screenHeight;
-		debugC(DEBUG_SMUSH, "SmushPlayer::handleAnimHeader: RA2 AHDR has 0x0 dims - using screen size %dx%d", _width, _height);
+		debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleGameAnimHeader: RA2 AHDR has 0x0 dims - using screen size %dx%d", _width, _height);
 	} else {
 		_width = width;
 		_height = height;
@@ -415,10 +415,10 @@ void SmushPlayerRebel2::handleGameLoad(int32 subSize, Common::SeekableReadStream
  * The data is accumulated in a buffer and consumed by the audio system.
  */
 void SmushPlayerRebel2::handleLoad(int32 subSize, Common::SeekableReadStream &b) {
-	debugC(DEBUG_SMUSH, "SmushPlayer::handleLoad()");
+	debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleLoad()");
 
 	if (subSize < 10) {
-		warning("SmushPlayer::handleLoad: chunk too small (%d bytes)", subSize);
+		warning("SmushPlayerRebel2::handleLoad: chunk too small (%d bytes)", subSize);
 		return;
 	}
 
@@ -428,7 +428,7 @@ void SmushPlayerRebel2::handleLoad(int32 subSize, Common::SeekableReadStream &b)
 
 	int32 dataSize = subSize - 10;
 
-	debugC(DEBUG_SMUSH, "SmushPlayer::handleLoad: chunk %d/%d, dataSize=%d, bufferOffset=%d",
+	debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleLoad: chunk %d/%d, dataSize=%d, bufferOffset=%d",
 		chunkIndex, totalChunks, dataSize, _loadBufferOffset);
 
 	// First chunk in sequence - reset buffer state
@@ -444,26 +444,26 @@ void SmushPlayerRebel2::handleLoad(int32 subSize, Common::SeekableReadStream &b)
 			_loadBufferSize = estimatedSize;
 			_loadBuffer = (byte *)malloc(_loadBufferSize);
 			if (_loadBuffer == nullptr) {
-				warning("SmushPlayer::handleLoad: Failed to allocate %d bytes for LOAD buffer",
+				warning("SmushPlayerRebel2::handleLoad: Failed to allocate %d bytes for LOAD buffer",
 					_loadBufferSize);
 				_loadBufferSize = 0;
 				return;
 			}
-			debugC(DEBUG_SMUSH, "SmushPlayer::handleLoad: Allocated %d bytes for LOAD buffer",
+			debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleLoad: Allocated %d bytes for LOAD buffer",
 				_loadBufferSize);
 		}
 	}
 
 	// Check sequential order
 	if (_lastLoadChunkIdx + 1 != chunkIndex) {
-		debugC(DEBUG_SMUSH, "SmushPlayer::handleLoad: Non-sequential chunk %d (expected %d), skipping",
+		debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleLoad: Non-sequential chunk %d (expected %d), skipping",
 			chunkIndex, _lastLoadChunkIdx + 1);
 		return;
 	}
 
 	// Check buffer capacity
 	if (_loadBuffer == nullptr || _loadBufferOffset + dataSize >= _loadBufferSize) {
-		warning("SmushPlayer::handleLoad: Buffer overflow - offset=%d size=%d limit=%d",
+		warning("SmushPlayerRebel2::handleLoad: Buffer overflow - offset=%d size=%d limit=%d",
 			_loadBufferOffset, dataSize, _loadBufferSize);
 		return;
 	}
@@ -473,10 +473,10 @@ void SmushPlayerRebel2::handleLoad(int32 subSize, Common::SeekableReadStream &b)
 	_loadBufferOffset += dataSize;
 	_lastLoadChunkIdx = chunkIndex;
 
-	debugC(DEBUG_SMUSH, "SmushPlayer::handleLoad: Accumulated %d bytes total", _loadBufferOffset);
+	debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleLoad: Accumulated %d bytes total", _loadBufferOffset);
 
 	if (chunkIndex == totalChunks - 1) {
-		debugC(DEBUG_SMUSH, "SmushPlayer::handleLoad: Sequence complete - %d chunks, %d bytes total",
+		debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleLoad: Sequence complete - %d chunks, %d bytes total",
 			totalChunks, _loadBufferOffset);
 	}
 }
@@ -490,7 +490,7 @@ void SmushPlayerRebel2::ra2HandleTextResource(const char *str, int fontId, int c
 	ensureMultiFont();
 	_multiFont->setDefaultFont(fontId);
 
-	debugC(DEBUG_SMUSH, "SmushPlayer::handleTextResource: RA2 TRES frame=%d fontId=%d color=%d flags=0x%x flg=%d pos=(%d,%d) clip=(%d,%d,%d,%d) str=\"%.40s\"",
+	debugC(DEBUG_SMUSH, "SmushPlayerRebel2::ra2HandleTextResource: RA2 TRES frame=%d fontId=%d color=%d flags=0x%x flg=%d pos=(%d,%d) clip=(%d,%d,%d,%d) str=\"%.40s\"",
 		  _frame, fontId, color, (int)flg, (int)flg, pos_x, pos_y, left, top, width, height, str);
 
 	if (flg & kStyleWordWrap) {
@@ -521,24 +521,24 @@ void SmushPlayerRebel2::ra2SelectFrameBuffer(int width, int height) {
 			_height = height;
 			// Zero-fill the new buffer to avoid garbage in areas not written by FOBJ codec
 			memset(_specialBuffer, 0, bufSize);
-			debugC(DEBUG_SMUSH, "SmushPlayer: Allocated new _specialBuffer %dx%d (%d bytes)", width, height, bufSize);
+			debugC(DEBUG_SMUSH, "SmushPlayerRebel2::ra2SelectFrameBuffer: Allocated new _specialBuffer %dx%d (%d bytes)", width, height, bufSize);
 		}
 	}
 
 	if (bufSize > _vm->_screenWidth * _vm->_screenHeight &&
 	    _specialBuffer != nullptr && _specialBufferSize >= bufSize) {
 		_dst = _specialBuffer;
-		debugC(DEBUG_SMUSH, "SmushPlayer: Using _specialBuffer for oversized FOBJ %dx%d", width, height);
+		debugC(DEBUG_SMUSH, "SmushPlayerRebel2::ra2SelectFrameBuffer: Using _specialBuffer for oversized FOBJ %dx%d", width, height);
 	} else {
 		if (_specialBuffer == nullptr) {
 			VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen];
 			_dst = vs->getPixels(0, 0);
-			debugC(DEBUG_SMUSH, "SmushPlayer: Reset _dst to virtual screen for FOBJ %dx%d at (%d,%d) _dst=%p",
+			debugC(DEBUG_SMUSH, "SmushPlayerRebel2::ra2SelectFrameBuffer: Reset _dst to virtual screen for FOBJ %dx%d at (%d,%d) _dst=%p",
 				width, height, 0, 0, (void*)_dst);
 		} else {
 			// Large frame was in this video, use _specialBuffer for compositing
 			_dst = _specialBuffer;
-			debugC(DEBUG_SMUSH, "SmushPlayer: Using _specialBuffer for small FOBJ %dx%d (compositing with large frame)",
+			debugC(DEBUG_SMUSH, "SmushPlayerRebel2::ra2SelectFrameBuffer: Using _specialBuffer for small FOBJ %dx%d (compositing with large frame)",
 				width, height);
 		}
 	}
@@ -605,7 +605,7 @@ void SmushPlayerRebel2::ra2HandleGost(int32 subSize, Common::SeekableReadStream
 	int16 ghostY = b.readSint16LE();
 
 	if (!_hasFrameFobjForGost || _lastFobjData == nullptr || _lastFobjDataSize <= 0) {
-		debugC(DEBUG_SMUSH, "SmushPlayer GOST: frame=%d ignored (no current-frame FOBJ cached)", _frame);
+		debugC(DEBUG_SMUSH, "SmushPlayerRebel2::ra2HandleGost GOST: frame=%d ignored (no current-frame FOBJ cached)", _frame);
 		return;
 	}
 
@@ -623,7 +623,7 @@ void SmushPlayerRebel2::ra2HandleGost(int32 subSize, Common::SeekableReadStream
 	int left = _lastFobjLeft + ghostX;
 	int top = _lastFobjTop + ghostY;
 
-	debugC(DEBUG_SMUSH, "SmushPlayer GOST: frame=%d type=%d flags=0x%04x gostPos=(%d,%d) basePos=(%d,%d) finalPos=(%d,%d) size=%dx%d codec=%d",
+	debugC(DEBUG_SMUSH, "SmushPlayerRebel2::ra2HandleGost GOST: frame=%d type=%d flags=0x%04x gostPos=(%d,%d) basePos=(%d,%d) finalPos=(%d,%d) size=%dx%d codec=%d",
 		_frame, ghostType, priorityFlags, ghostX, ghostY,
 		_lastFobjLeft, _lastFobjTop, left, top,
 		_lastFobjWidth, _lastFobjHeight, _lastFobjCodec);
@@ -691,7 +691,7 @@ bool SmushPlayerRebel2::handleGameStoreFrame() {
 }
 
 void SmushPlayerRebel2::handleGameFrameObjectPre(int codec, int left, int top, int width, int height, int dataSize) {
-	debugC(DEBUG_SMUSH, "SmushPlayer FOBJ: frame=%d codec=%d pos=(%d,%d) size=%dx%d dataSize=%d storeFrame=%d _width=%d _height=%d",
+	debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleGameFrameObjectPre FOBJ: frame=%d codec=%d pos=(%d,%d) size=%dx%d dataSize=%d storeFrame=%d _width=%d _height=%d",
 		_frame, codec, left, top, width, height, dataSize, _storeFrame, _width, _height);
 }
 
@@ -710,7 +710,7 @@ void SmushPlayerRebel2::handleGameFrameStart() {
 bool SmushPlayerRebel2::handleGameSkipChunk(uint32 subType, int32 subSize, Common::SeekableReadStream &b) {
 	if (_skipNext) {
 		_skipNext = false;
-		debugC(DEBUG_SMUSH, "SmushPlayer::handleFrame: SKIP consumed chunk %s frame=%d", tag2str(subType), _frame);
+		debugC(DEBUG_SMUSH, "SmushPlayerRebel2::handleGameSkipChunk: SKIP consumed chunk %s frame=%d", tag2str(subType), _frame);
 		return true;
 	}
 	return false;


Commit: e44a371ebd858f7fb84d427b2c478bafefd1fa4e
    https://github.com/scummvm/scummvm/commit/e44a371ebd858f7fb84d427b2c478bafefd1fa4e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-06-01T09:43:41+02:00

Commit Message:
SCUMM: RA: removed some redundant/useless debug statement

Changed paths:
    engines/scumm/insane/rebel1/menu.cpp
    engines/scumm/insane/rebel1/render.cpp
    engines/scumm/insane/rebel1/runlevels.cpp
    engines/scumm/smush/rebel/smush_player_ra2.cpp


diff --git a/engines/scumm/insane/rebel1/menu.cpp b/engines/scumm/insane/rebel1/menu.cpp
index 3ded18a95d8..cf8a11e568a 100644
--- a/engines/scumm/insane/rebel1/menu.cpp
+++ b/engines/scumm/insane/rebel1/menu.cpp
@@ -676,7 +676,6 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 				return true;
 			}
 
-			debugC(DEBUG_INSANE, "InsaneRebel1::notifyEvent: ESC pressed during gameplay - opening ScummVM menu");
 			const bool wasPaused = _player->_paused;
 			if (!wasPaused)
 				_player->pause();
@@ -689,13 +688,11 @@ bool InsaneRebel1::notifyEvent(const Common::Event &event) {
 		if (_interactiveVideoActive && !_menuActive &&
 			event.kbd.keycode == Common::KEYCODE_s &&
 			event.kbd.hasFlags(Common::KBD_SHIFT)) {
-			debugC(DEBUG_INSANE, "InsaneRebel1::notifyEvent: Shift+S pressed - skipping gameplay section");
 			_vm->_smushVideoShouldFinish = true;
 			return true;
 		}
 
 		if (!_interactiveVideoActive && event.kbd.keycode == Common::KEYCODE_ESCAPE) {
-			debugC(DEBUG_INSANE, "InsaneRebel1::notifyEvent: ESC pressed - skipping cinematic");
 			_vm->_smushVideoShouldFinish = true;
 			return true;
 		}
@@ -929,8 +926,6 @@ bool InsaneRebel1::runTextEntryMenuLoop() {
 }
 
 int InsaneRebel1::runMainMenu() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runMainMenu: Main menu");
-
 	_menuSelection = 0;
 	while (!shouldAbortGameFlow()) {
 		playMenuBackground();
diff --git a/engines/scumm/insane/rebel1/render.cpp b/engines/scumm/insane/rebel1/render.cpp
index 110c3911e43..ac5c801a121 100644
--- a/engines/scumm/insane/rebel1/render.cpp
+++ b/engines/scumm/insane/rebel1/render.cpp
@@ -1731,9 +1731,6 @@ void InsaneRebel1::renderHUD(byte *dst, int pitch, int width, int height) {
 				memcpy(d, s, drawW);
 			}
 		}
-
-		debug(5, "RA1 HUD: drawn at (%d,%d) size=%dx%d",
-			hudPlateX, hudPlateY, bar.width, bar.height);
 	}
 
 	// Draw health bar from FUN_1BBCB (0x1BBCB) + FUN_21D66 (0x21D66):
diff --git a/engines/scumm/insane/rebel1/runlevels.cpp b/engines/scumm/insane/rebel1/runlevels.cpp
index 0e9f86c23c0..cb9c68b8058 100644
--- a/engines/scumm/insane/rebel1/runlevels.cpp
+++ b/engines/scumm/insane/rebel1/runlevels.cpp
@@ -315,8 +315,6 @@ void InsaneRebel1::clearVideoBuffer() {
 //   1. O1LOGO.ANM — LucasArts logo
 //   2. O1OPEN.ANM — Star Wars opening crawl
 void InsaneRebel1::playIntroSequence() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::playIntroSequence: Playing intro sequence");
-
 	// LucasArts logo (original: PUSH 0x57cc, CALL FUN_1BA32 with flags 0x0420)
 	playCinematic("OPEN/O1LOGO.ANM");
 	if (shouldAbortGameFlow())
@@ -347,8 +345,6 @@ void InsaneRebel1::playIntroSequence() {
 //     lives==0: L1DEATH → return to menu
 
 bool InsaneRebel1::runLevel1() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel1: Running level 1");
-
 	_currentLevel = 0;
 	loadTuningForLevel(0);
 	loadLevelSprites(1);
@@ -448,8 +444,6 @@ bool InsaneRebel1::runLevel1() {
 }
 
 bool InsaneRebel1::runLevel2() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel2: Running level 2");
-
 	_currentLevel = 1;
 	loadLevelSprites(2);
 	// DOS RunLevel2Flow launches L2PLAY.ANM with gameplay selector 2.
@@ -489,8 +483,6 @@ bool InsaneRebel1::runLevel2() {
 }
 
 bool InsaneRebel1::runLevel3() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel3: Running level 3");
-
 	_currentLevel = 2;
 	loadLevelSprites(3);
 	// DOS RunLevel3Flow launches L3PLAY.ANM with gameplay selector 3.
@@ -530,8 +522,6 @@ bool InsaneRebel1::runLevel3() {
 }
 
 bool InsaneRebel1::runLevel4() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel4: Running level 4");
-
 	_currentLevel = 3;
 	loadLevelSprites(4);
 	// DOS RunLevel4Flow launches L4PLAY1.ANM with selector 4 and L4PLAY2.ANM with selector 5.
@@ -600,8 +590,6 @@ bool InsaneRebel1::runLevel4() {
 }
 
 bool InsaneRebel1::runLevel5() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel5: Running level 5");
-
 	_currentLevel = 4;
 	loadLevelSprites(5);
 	// DOS RunLevel5Flow passes segment 6 for L5PLAY and segment 7 for L5PLAY2.
@@ -682,8 +670,6 @@ bool InsaneRebel1::runLevel5() {
 }
 
 bool InsaneRebel1::runLevel6() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel6: Running level 6");
-
 	_currentLevel = 5;
 	loadLevelSprites(6);
 	// DOS RunLevel6Flow starts L6PLAY with PlayAnmFile(..., 8), so chapter 6
@@ -727,8 +713,6 @@ bool InsaneRebel1::runLevel6() {
 }
 
 bool InsaneRebel1::runLevel7() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel7: Running level 7");
-
 	const char *const kLevel7Segments[] = {
 		"LVL7/L7PLAY1.ANM",
 		"LVL7/L7PLAY2.ANM",
@@ -811,8 +795,6 @@ bool InsaneRebel1::runLevel7() {
 }
 
 bool InsaneRebel1::runLevel8() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel8: Running level 8");
-
 	const char *const kLevel8Routes[] = {
 		"LVL8/L8PLAY.ANM",
 		"LVL8/L8PLAY2.ANM",
@@ -887,8 +869,6 @@ bool InsaneRebel1::runLevel8() {
 }
 
 bool InsaneRebel1::runLevel9() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel9: Running level 9");
-
 	// DOS RunLevel9Flow calls RandScaleByte(2) three times before the intro.
 	// That helper advances a byte seed with seed = seed * 9 + 0x35 and returns
 	// (2 * seed) >> 8. Do not use ScummVM's session RNG here: it can turn the
@@ -1077,8 +1057,6 @@ bool InsaneRebel1::runLevel9() {
 }
 
 bool InsaneRebel1::runLevel10() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel10: Running level 10");
-
 	_currentLevel = 9;
 	loadLevelSprites(10);
 	// DOS RunLevel10Flow starts L10PLAY.ANM with initLevelFlag=0x0D.
@@ -1118,8 +1096,6 @@ bool InsaneRebel1::runLevel10() {
 // Turret-style level. Single interactive phase with kill-count retry.
 // Original: L11INTRO → L11PLAY (turret, killCount>4 to pass) → L11RETRY → retry/L11END
 bool InsaneRebel1::runLevel11() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel11: Running level 11");
-
 	_currentLevel = 10;
 	loadLevelSprites(11);
 	// DOS RunLevel11Flow starts L11PLAY.ANM with initLevelFlag=0x0E.
@@ -1175,8 +1151,6 @@ bool InsaneRebel1::runLevel11() {
 // Single interactive phase with mid-level retry mechanism.
 // Original: L12INTRO → L12PLAY → (retry at specific frame) → L12END
 bool InsaneRebel1::runLevel12() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel12: Running level 12");
-
 	_currentLevel = 11;
 	loadLevelSprites(12);
 	// DOS RunLevel12Flow starts L12PLAY.ANM with initLevelFlag=0x0F.
@@ -1238,8 +1212,6 @@ bool InsaneRebel1::runLevel12() {
 // Flight level with enemy projectile system (original has 5-slot projectile tracking).
 // Original: L13INTRO → L13PLAY → L13END/L13NEW/L13DEATH
 bool InsaneRebel1::runLevel13() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel13: Running level 13");
-
 	_currentLevel = 12;
 	loadLevelSprites(13);
 	loadRA1Nut("LVL13/L13LASR2.NUT", _enemyLaserBank);
@@ -1281,8 +1253,6 @@ bool InsaneRebel1::runLevel13() {
 // Original: L14INTRO → L14PLAY → L14PLAY2 → optional L14PLY2B splice
 //   → L14END/L14NEW/L14DEATH
 bool InsaneRebel1::runLevel14() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel14: Running level 14");
-
 	_currentLevel = 13;
 	loadLevelSprites(14);
 	// DOS RunLevel14Flow uses selector 0x11 for L14PLAY and 0x12 for L14PLAY2.
@@ -1355,8 +1325,6 @@ bool InsaneRebel1::runLevel14() {
 // Original: L15INTRO → L15PLAY1 (trench run) → L15INTR2 (torpedo lock cutscene)
 //   → L15PLAY2 (final approach + torpedo) → L15END1/L15NEW/L15DEATH
 bool InsaneRebel1::runLevel15() {
-	debugC(DEBUG_INSANE, "InsaneRebel1::runLevel15: Running level 15");
-
 	_currentLevel = 14;
 	loadLevelSprites(15);
 	// DOS RunLevel1GameLoop uses selector 0x13 for L15PLAY1 and 0x14 for L15PLAY2.
diff --git a/engines/scumm/smush/rebel/smush_player_ra2.cpp b/engines/scumm/smush/rebel/smush_player_ra2.cpp
index 6b3da4f7524..dc0ffb3b21b 100644
--- a/engines/scumm/smush/rebel/smush_player_ra2.cpp
+++ b/engines/scumm/smush/rebel/smush_player_ra2.cpp
@@ -490,8 +490,8 @@ void SmushPlayerRebel2::ra2HandleTextResource(const char *str, int fontId, int c
 	ensureMultiFont();
 	_multiFont->setDefaultFont(fontId);
 
-	debugC(DEBUG_SMUSH, "SmushPlayerRebel2::ra2HandleTextResource: RA2 TRES frame=%d fontId=%d color=%d flags=0x%x flg=%d pos=(%d,%d) clip=(%d,%d,%d,%d) str=\"%.40s\"",
-		  _frame, fontId, color, (int)flg, (int)flg, pos_x, pos_y, left, top, width, height, str);
+	debugC(DEBUG_SMUSH, "SmushPlayerRebel2::ra2HandleTextResource: RA2 TRES frame=%d fontId=%d color=%d flags=0x%x pos=(%d,%d) clip=(%d,%d,%d,%d) str=\"%.40s\"",
+		  _frame, fontId, color, (int)flg, pos_x, pos_y, left, top, width, height, str);
 
 	if (flg & kStyleWordWrap) {
 		Common::Rect clipRect(MAX<int>(0, left), MAX<int>(0, top), MIN<int>(left + width, _width), MIN<int>(top + height, _height));
@@ -533,8 +533,8 @@ void SmushPlayerRebel2::ra2SelectFrameBuffer(int width, int height) {
 		if (_specialBuffer == nullptr) {
 			VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen];
 			_dst = vs->getPixels(0, 0);
-			debugC(DEBUG_SMUSH, "SmushPlayerRebel2::ra2SelectFrameBuffer: Reset _dst to virtual screen for FOBJ %dx%d at (%d,%d) _dst=%p",
-				width, height, 0, 0, (void*)_dst);
+			debugC(DEBUG_SMUSH, "SmushPlayerRebel2::ra2SelectFrameBuffer: Reset _dst to virtual screen for FOBJ %dx%d at (%d,%d)",
+				width, height, 0, 0);
 		} else {
 			// Large frame was in this video, use _specialBuffer for compositing
 			_dst = _specialBuffer;




More information about the Scummvm-git-logs mailing list