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

mgerhardy noreply at scummvm.org
Wed Jul 15 20:02:33 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:
a19ec096d6 MACS2: fixed duplicated code for switch case, PVS-Studio V1037


Commit: a19ec096d6f9bf40ab3f451d38ce7fb4484a6b76
    https://github.com/scummvm/scummvm/commit/a19ec096d6f9bf40ab3f451d38ce7fb4484a6b76
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2026-07-15T22:02:14+02:00

Commit Message:
MACS2: fixed duplicated code for switch case, PVS-Studio V1037

Changed paths:
    engines/macs2/midiparser_macs2.cpp
    engines/macs2/scriptexecutor.cpp


diff --git a/engines/macs2/midiparser_macs2.cpp b/engines/macs2/midiparser_macs2.cpp
index 05be13acf22..0ec816c2dd8 100644
--- a/engines/macs2/midiparser_macs2.cpp
+++ b/engines/macs2/midiparser_macs2.cpp
@@ -102,23 +102,18 @@ void MidiParser_Macs2::parseNextEvent(EventInfo &info) {
 		break;
 
 	case 0x8: // Note Off
+	case 0xB: // Control Change
 		info.basic.param1 = *(playPos++);
 		info.basic.param2 = *(playPos++);
 		break;
 
 	case 0xA: // Aftertouch (polyphonic key pressure) - consumed but ignored
+	case 0xE: // Pitch Wheel - consumed but treated as noop
 		info.basic.param1 = *(playPos++);
 		info.basic.param2 = *(playPos++);
 		info.noop = true;
 		break;
 
-	case 0xB: // Control Change
-		info.basic.param1 = *(playPos++);
-		info.basic.param2 = *(playPos++);
-		// Custom CCs 0x66-0x69 are game-specific; pass them through
-		// and let the MidiDriver handle them (or ignore them).
-		break;
-
 	case 0xC: // Program Change
 		info.basic.param1 = *(playPos++);
 		info.basic.param2 = 0;
@@ -130,12 +125,6 @@ void MidiParser_Macs2::parseNextEvent(EventInfo &info) {
 		info.noop = true;
 		break;
 
-	case 0xE: // Pitch Wheel - consumed but treated as noop
-		info.basic.param1 = *(playPos++);
-		info.basic.param2 = *(playPos++);
-		info.noop = true;
-		break;
-
 	case 0xF: // System/Meta events - signal loop to start
 		// The macs2 format uses any 0xFx event to loop back to the beginning
 		info.event = 0xFF;
diff --git a/engines/macs2/scriptexecutor.cpp b/engines/macs2/scriptexecutor.cpp
index 852feb5ba51..6245eebb1d2 100644
--- a/engines/macs2/scriptexecutor.cpp
+++ b/engines/macs2/scriptexecutor.cpp
@@ -3318,6 +3318,8 @@ uint32 ScriptExecutor::getSpecialValue(uint16 value) {
 	case 0x05:
 		break;
 	case 0x06:
+	case 0x0A:
+	case 0x0C:
 		out1 = 1;
 		break;
 	case 0x07:
@@ -3325,15 +3327,9 @@ uint32 ScriptExecutor::getSpecialValue(uint16 value) {
 	case 0x09:
 		out1 = 0;
 		break;
-	case 0x0A:
-		out1 = 1;
-		break;
 	case 0x0B:
 		out1 = _repeatRunFlag ? 1 : 0;
 		break;
-	case 0x0C:
-		out1 = 1;
-		break;
 	case 0x0D:
 		out1 = _chosenDialogueOption;
 		break;




More information about the Scummvm-git-logs mailing list