[Scummvm-git-logs] scummvm master -> 01710eca414ee4bda228140da22ca1242bb8cf1d

dwatteau noreply at scummvm.org
Mon Mar 30 16:26:20 UTC 2026


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

Summary:
01710eca41 SCUMM: Use tag2str() in the few places it wasn't used


Commit: 01710eca414ee4bda228140da22ca1242bb8cf1d
    https://github.com/scummvm/scummvm/commit/01710eca414ee4bda228140da22ca1242bb8cf1d
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-03-30T18:25:09+02:00

Commit Message:
SCUMM: Use tag2str() in the few places it wasn't used

It's shorter, and deals with non-printable characters.

Also plug some MKTAG() while there.

Changed paths:
    engines/scumm/imuse/drivers/fmtowns.cpp
    engines/scumm/imuse/drivers/midi.cpp
    engines/scumm/imuse/drivers/pcspk.cpp
    engines/scumm/sound.cpp


diff --git a/engines/scumm/imuse/drivers/fmtowns.cpp b/engines/scumm/imuse/drivers/fmtowns.cpp
index c3255a700b0..926ba16a271 100644
--- a/engines/scumm/imuse/drivers/fmtowns.cpp
+++ b/engines/scumm/imuse/drivers/fmtowns.cpp
@@ -792,8 +792,8 @@ void TownsMidiInputChannel::sysEx_customInstrument(uint32 type, const byte *inst
 	const uint8 instrSize = 30;
 	if (instr && dataSize == instrSize)
 		memcpy(_instrument, instr, instrSize);
-	else if (type != 'ADL ') // FM-Towns is actually supposed to get ADL type data.
-		warning("TownsMidiInputChannel: Receiving '%c%c%c%c' instrument data. Probably loading a savegame with that sound setting", (type >> 24) & 0xFF, (type >> 16) & 0xFF, (type >> 8) & 0xFF, type & 0xFF);
+	else if (type != MKTAG('A','D','L',' ')) // FM-Towns is actually supposed to get ADL type data.
+		warning("TownsMidiInputChannel: Receiving '%s' instrument data. Probably loading a savegame with that sound setting", tag2str(type));
 }
 
 void TownsMidiInputChannel::controlModulationWheel(byte value) {
diff --git a/engines/scumm/imuse/drivers/midi.cpp b/engines/scumm/imuse/drivers/midi.cpp
index fb2821378f3..04cebceaaee 100644
--- a/engines/scumm/imuse/drivers/midi.cpp
+++ b/engines/scumm/imuse/drivers/midi.cpp
@@ -836,8 +836,8 @@ void IMuseChannel_MT32::effectLevel(byte value) {
 }
 
 void IMuseChannel_MT32::sysEx_customInstrument(uint32 type, const byte *instr, uint32 dataSize)  {
-	if (type != 'ROL ') {
-		warning("IMuseChannel_MT32: Receiving '%c%c%c%c' instrument data. Probably loading a savegame with that sound setting", (type >> 24) & 0xFF, (type >> 16) & 0xFF, (type >> 8) & 0xFF, type & 0xFF);
+	if (type != MKTAG('R','O','L',' ')) {
+		warning("IMuseChannel_MT32: Receiving '%s' instrument data. Probably loading a savegame with that sound setting", tag2str(type));
 		return;
 	}
 
diff --git a/engines/scumm/imuse/drivers/pcspk.cpp b/engines/scumm/imuse/drivers/pcspk.cpp
index eed4eeffcda..69bb28e78b6 100644
--- a/engines/scumm/imuse/drivers/pcspk.cpp
+++ b/engines/scumm/imuse/drivers/pcspk.cpp
@@ -350,10 +350,10 @@ void IMuseDriver_PCSpk::MidiChannel_PcSpk::priority(byte value) {
 }
 
 void IMuseDriver_PCSpk::MidiChannel_PcSpk::sysEx_customInstrument(uint32 type, const byte *instr, uint32 dataSize) {
-	if (type == 'SPK ' && instr && dataSize == sizeof(_instrument))
+	if (type == MKTAG('S','P','K',' ') && instr && dataSize == sizeof(_instrument))
 		memcpy(_instrument, instr, sizeof(_instrument));
-	else if (type != 'SPK ')
-		warning("MidiChannel_PcSpk: Receiving '%c%c%c%c' instrument data. Probably loading a savegame with that sound setting", (type >> 24) & 0xFF, (type >> 16) & 0xFF, (type >> 8) & 0xFF, type & 0xFF);
+	else if (type != MKTAG('S','P','K',' '))
+		warning("MidiChannel_PcSpk: Receiving '%s' instrument data. Probably loading a savegame with that sound setting", tag2str(type));
 }
 
 uint8 IMuseDriver_PCSpk::getEffectModifier(uint16 level) {
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 5b5cbdd4283..bfb33823f53 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -1501,7 +1501,7 @@ int ScummEngine::readSoundResource(ResId idx) {
 	}
 
 	if (total_size)
-		warning("Unrecognized base tag '%c%c%c%c' in sound %d", (basetag >> 24) & 0xFF, (basetag >> 16) & 0xFF, (basetag >> 8) & 0xFF, basetag & 0xFF, idx);
+		warning("Unrecognized base tag '%s' in sound %d", tag2str(basetag), idx);
 	_res->_types[rtSound][idx]._roomoffs = RES_INVALID_OFFSET;
 	return 0;
 }




More information about the Scummvm-git-logs mailing list