[Scummvm-git-logs] scummvm master -> 0354d57a4bd2f1d4e25a94db7e419b2b82a46276

dwatteau noreply at scummvm.org
Mon Mar 30 19:13:08 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:
0354d57a4b AUDIO: Use tag2str() in Adlib sysEx_customInstrument()


Commit: 0354d57a4bd2f1d4e25a94db7e419b2b82a46276
    https://github.com/scummvm/scummvm/commit/0354d57a4bd2f1d4e25a94db7e419b2b82a46276
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-03-30T21:06:13+02:00

Commit Message:
AUDIO: Use tag2str() in Adlib sysEx_customInstrument()

Same sysEx_customInstrument() stuff as in previous commit for SCUMM;
and so, same changes.

Changed paths:
    audio/adlib.cpp


diff --git a/audio/adlib.cpp b/audio/adlib.cpp
index dddf1b1bd30..3b5f7bfd161 100644
--- a/audio/adlib.cpp
+++ b/audio/adlib.cpp
@@ -19,9 +19,10 @@
  *
  */
 
+#include "common/scummsys.h"
 #include "common/debug.h"
+#include "common/endian.h"
 #include "common/error.h"
-#include "common/scummsys.h"
 #include "common/system.h"
 #include "common/textconsole.h"
 #include "common/types.h"
@@ -1271,10 +1272,10 @@ void AdLibPart::sysEx_customInstrument(uint32 type, const byte *instr, uint32 da
 	}
 #endif
 
-	if (type == 'ADL ' && instr && dataSize == sizeof(AdLibInstrument))
+	if (type == MKTAG('A','D','L',' ') && instr && dataSize == sizeof(AdLibInstrument))
 		memcpy(&_partInstr, instr, sizeof(AdLibInstrument));
-	else if (type != 'ADL '){
-		warning("AdLibPart: 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',' ')) {
+		warning("AdLibPart: Receiving '%s' instrument data. Probably loading a savegame with that sound setting", tag2str(type));
 	}
 }
 
@@ -1359,7 +1360,7 @@ void AdLibPercussionChannel::sysEx_customInstrument(uint32 type, const byte *ins
 	}
 #endif
 
-	if (type == 'ADLP' && instr && dataSize) {
+	if (type == MKTAG('A','D','L','P') && instr && dataSize) {
 		byte note = instr[0];
 		_notes[note] = instr[1];
 
@@ -1381,8 +1382,8 @@ void AdLibPercussionChannel::sysEx_customInstrument(uint32 type, const byte *ins
 		_customInstruments[note]->carSustainRelease     = instr[10];
 		_customInstruments[note]->carWaveformSelect     = instr[11];
 		_customInstruments[note]->feedback               = instr[12];
-	} else if (type != 'ADLP'){
-		warning("AdLibPercussionChannel: 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','P')) {
+		warning("AdLibPercussionChannel: Receiving '%s' instrument data. Probably loading a savegame with that sound setting", tag2str(type));
 	}
 }
 




More information about the Scummvm-git-logs mailing list