[Scummvm-git-logs] scummvm master -> 94a3a523f4eafafbe4d1d6ab56349ed84adc6ea4

dreammaster noreply at scummvm.org
Sat Aug 8 10:34:30 UTC 2026


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

Summary:
1e41d1f205 MADS: Fix Coverity warnings
16c20be662 MADS: Game specific logic in inter_select_word
b1200640ca MADS: DRAGONSPHERE: Fix Coverity warnings
94a3a523f4 MADS: PHANTOM: Fix Coverity warnings


Commit: 1e41d1f2059b717c7f0227c06251127143e8b657
    https://github.com/scummvm/scummvm/commit/1e41d1f2059b717c7f0227c06251127143e8b657
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-08-08T18:36:36+10:00

Commit Message:
MADS: Fix Coverity warnings

Changed paths:
    engines/mads/core/inter.cpp
    engines/mads/nebular/sound/asound_nebular.cpp
    engines/mads/phantom/menus.cpp


diff --git a/engines/mads/core/inter.cpp b/engines/mads/core/inter.cpp
index 1a6d9b23a26..71a247238f4 100644
--- a/engines/mads/core/inter.cpp
+++ b/engines/mads/core/inter.cpp
@@ -1161,11 +1161,6 @@ static void inter_select_word() {
 	for (count = 0; (count < quantity) && (new_ < 0); count++) {
 		if (stroke_type == STROKE_INTERFACE) {
 			this_spot = base_spot + (quantity - (count + 1));
-			// if (count >= difference) {
-			// this_spot = base_spot + (room_num_spots - ((count - difference) + 1));
-			// } else {
-			// this_spot = base_spot + room_num_spots + count;
-			// }
 		} else {
 			this_spot = base_spot + count;
 		}
diff --git a/engines/mads/nebular/sound/asound_nebular.cpp b/engines/mads/nebular/sound/asound_nebular.cpp
index c2378aeab4d..663008f8fb5 100644
--- a/engines/mads/nebular/sound/asound_nebular.cpp
+++ b/engines/mads/nebular/sound/asound_nebular.cpp
@@ -367,7 +367,7 @@ int ASoundDemo1::command9() {
 
 int ASoundDemo1::command10() {
 	byte *pData1 = loadData(0x1C8C);
-	isSoundActive(pData1); // result unused, matches disassembly quirk
+	(void)isSoundActive(pData1); // result unused, matches disassembly quirk
 	command1();
 	_channels[4].load(pData1);
 	_channels[5].load(loadData(0x1CBC));
@@ -404,7 +404,7 @@ int ASoundDemo1::command14() {
 
 int ASoundDemo1::command15() {
 	byte *pData1 = loadData(0x1E9C);
-	isSoundActive(pData1); // result unused, matches disassembly quirk
+	(void)isSoundActive(pData1); // result unused, matches disassembly quirk
 	command1();
 	_channels[4].load(pData1);
 	_channels[5].load(loadData(0x1F3A));
@@ -494,7 +494,7 @@ int ASoundDemo1::command29() {
 	byte *pData = loadData(0x2236);
 	byte v = (byte)((command2627293032() >> 1) + 76);
 	pData[7] = pData[13] = pData[21] = pData[27] = v;
-	isSoundActive(pData); // result unused, matches disassembly quirk
+	(void)isSoundActive(pData); // result unused, matches disassembly quirk
 	playSoundAny(0x2236);
 	return 0;
 }
@@ -502,7 +502,7 @@ int ASoundDemo1::command29() {
 int ASoundDemo1::command30() {
 	byte *pData = loadData(0x2456);
 	pData[7] = (byte)((command2627293032() >> 1) + 72);
-	isSoundActive(pData); // result unused, matches disassembly quirk
+	(void)isSoundActive(pData); // result unused, matches disassembly quirk
 	playSoundAny(0x2456);
 	return 0;
 }
@@ -520,7 +520,7 @@ int ASoundDemo1::command32() {
 	byte v2 = base + 40;
 	pData[9] = pData[17] = pData[25] = pData[33] = v1;
 	pData[11] = pData[19] = pData[27] = pData[35] = v2;
-	isSoundActive(pData); // result unused, matches disassembly quirk
+	(void)isSoundActive(pData); // result unused, matches disassembly quirk
 	playSoundAny(0x2466);
 	return 0;
 }
@@ -562,7 +562,7 @@ int ASoundDemo1::command38() {
 
 int ASoundDemo1::command39() {
 	byte *pData1 = loadData(0x203E);
-	isSoundActive(pData1); // result unused, matches disassembly quirk
+	(void)isSoundActive(pData1); // result unused, matches disassembly quirk
 	_channels[5].load(pData1);
 	_channels[6].load(loadData(0x20C0));
 	_channels[7].load(loadData(0x20DE));
@@ -577,7 +577,7 @@ int ASoundDemo1::command40() {
 
 void ASoundDemo1::command111213() {
 	byte *pData1 = loadData(0x18E8);
-	isSoundActive(pData1); // result unused, matches disassembly quirk
+	(void)isSoundActive(pData1); // result unused, matches disassembly quirk
 	command1();
 	_channels[0].load(pData1);
 	_channels[1].load(loadData(0x1A80));
@@ -1145,7 +1145,7 @@ int ASound3::command23() {
 }
 
 int ASound3::command24() {
-	// WORKAROUND: Original calls isSoundActive without loading data pointer
+	// WORKAROUND: Original calls (void)isSoundActive without loading data pointer
 	byte *pData = loadData(0x4EFC);
 	if (!isSoundActive(pData)) {
 		int v;
@@ -2585,7 +2585,7 @@ int ASoundDemo9::command31() {
 
 int ASoundDemo9::command34() {
 	byte *pData1 = loadData(0x18FE);
-	isSoundActive(pData1); // result unused, matches disassembly quirk
+	(void)isSoundActive(pData1); // result unused, matches disassembly quirk
 	command1();
 	_channels[0].load(pData1);
 	_channels[1].load(loadData(0x1B10));
@@ -2609,7 +2609,7 @@ int ASoundDemo9::command36() {
 
 int ASoundDemo9::command38() {
 	byte *pData1 = loadData(0x307A);
-	isSoundActive(pData1); // result unused, matches disassembly quirk
+	(void)isSoundActive(pData1); // result unused, matches disassembly quirk
 	command1();
 	_channels[0].load(pData1);
 	_channels[1].load(loadData(0x3090));
diff --git a/engines/mads/phantom/menus.cpp b/engines/mads/phantom/menus.cpp
index cccd96b8d6f..f86783d0c53 100644
--- a/engines/mads/phantom/menus.cpp
+++ b/engines/mads/phantom/menus.cpp
@@ -221,8 +221,6 @@ static void global_menu_score() {
 		text_index[2] = 7;          /* Star Player */
 	} else if (score <= 250) {
 		text_index[2] = 8;          /* Director */
-	} else {
-		text_index[2] = 9;          /* Bug Finder! */
 	}
 
 	text_show(99);


Commit: 16c20be6620e37863cb73b61a34948f743113b3b
    https://github.com/scummvm/scummvm/commit/16c20be6620e37863cb73b61a34948f743113b3b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-08-08T19:02:15+10:00

Commit Message:
MADS: Game specific logic in inter_select_word

Note that tight_boxes is effectively a bool, but in Rex
at least it has three distinct values of 1, 0, and -1.
Because of this I've chosen to keep the logic as is
to preserve the behaviour of the original code.

Changed paths:
    engines/mads/core/inter.cpp


diff --git a/engines/mads/core/inter.cpp b/engines/mads/core/inter.cpp
index 71a247238f4..7297c8cda81 100644
--- a/engines/mads/core/inter.cpp
+++ b/engines/mads/core/inter.cpp
@@ -1060,7 +1060,7 @@ static void inter_select_word() {
 	int mode;
 	int limit = 0;
 	int strict, delta;
-	int tight_boxes = false;
+	int tight_boxes = 0;
 	int difference = 0;
 	int *selection;
 	int base_spot, this_spot;
@@ -1076,8 +1076,8 @@ static void inter_select_word() {
 		if (mouse_button && (right_action >= 0)) {
 			inter_set_active_word(STROKE_ACTION, &right_action, -1);
 		}
-		// tight_boxes = (end_of_selection && !mouse_button);
-		tight_boxes = true;
+
+		tight_boxes = (g_engine->getGameID() != GType_RexNebular) ? 1 : (end_of_selection && !mouse_button) ? 1 : 0;
 		break;
 
 	case STROKE_INVEN:
@@ -1087,8 +1087,9 @@ static void inter_select_word() {
 		strict = 0;
 		delta = first_inven;
 		selection = &left_inven;
-		// tight_boxes = (end_of_selection && ((!mouse_any_stroke) || !(inter_awaiting == AWAITING_COMMAND)));
-		tight_boxes = true;
+
+		tight_boxes = (g_engine->getGameID() != GType_RexNebular) ? 1 :
+			(end_of_selection && ((!mouse_any_stroke) || !(inter_awaiting == AWAITING_COMMAND))) ? 1 : 0;
 		break;
 
 	case STROKE_ACTION:
@@ -1096,7 +1097,8 @@ static void inter_select_word() {
 			paul_id = object[inven[active_inven]].vocab_id;
 			paul_id = object_named(paul_id);
 
-			if (paul_id == 8 && !global[86]) {  // pid doll / global [heal_verbs_visible]
+			if (g_engine->getGameID() == GType_Dragonsphere && paul_id == Dragonsphere::pid_doll &&
+					!global[Dragonsphere::heal_verbs_visible]) {
 				quantity = 1;
 			} else {
 				quantity = object[inven[active_inven]].num_verbs;
@@ -1107,14 +1109,15 @@ static void inter_select_word() {
 		} else {
 			quantity = 0;
 		}
+
 		strict = 0;
 		delta = 0;
 		selection = mouse_button ? &right_action : &left_action;
 		if (mouse_button && (right_command >= 0)) {
 			inter_set_active_word(STROKE_COMMAND, &right_command, -1);
 		}
-		// tight_boxes = end_of_selection && !mouse_button;
-		tight_boxes = true;
+
+		tight_boxes = (g_engine->getGameID() != GType_RexNebular) ? 1 : end_of_selection && !mouse_button ? 1 : 0;
 		break;
 
 	case STROKE_SPECIAL_INVEN:
@@ -1123,7 +1126,7 @@ static void inter_select_word() {
 		strict = 0;
 		delta = active_inven;
 		selection = &junk;
-		tight_boxes = true;
+		tight_boxes = -1;
 		break;
 
 	case STROKE_DIALOG:
@@ -1137,7 +1140,7 @@ static void inter_select_word() {
 		strict = 0;
 		delta = 0;
 		selection = &left_command;
-		tight_boxes = true;
+		tight_boxes = -1;
 		break;
 
 	case STROKE_INTERFACE:
@@ -1148,7 +1151,7 @@ static void inter_select_word() {
 		strict = 0;
 		delta = 0;
 		selection = &junk;
-		tight_boxes = true;
+		tight_boxes = -1;
 		break;
 	}
 


Commit: b1200640ca0ba3f65b2fb284446cf2ca42a595a8
    https://github.com/scummvm/scummvm/commit/b1200640ca0ba3f65b2fb284446cf2ca42a595a8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-08-08T19:13:10+10:00

Commit Message:
MADS: DRAGONSPHERE: Fix Coverity warnings

Changed paths:
    engines/mads/dragonsphere/menus.cpp
    engines/mads/dragonsphere/rooms/room201.cpp
    engines/mads/dragonsphere/rooms/room454.cpp
    engines/mads/dragonsphere/rooms/room506.cpp
    engines/mads/dragonsphere/rooms/room510.cpp


diff --git a/engines/mads/dragonsphere/menus.cpp b/engines/mads/dragonsphere/menus.cpp
index 28432afd969..290855ed469 100644
--- a/engines/mads/dragonsphere/menus.cpp
+++ b/engines/mads/dragonsphere/menus.cpp
@@ -150,8 +150,6 @@ static void global_menu_score() {
 		text_index[2] = 7;          /* Noble */
 	} else if (score <= 250) {
 		text_index[2] = 8;          /* King */
-	} else {
-		text_index[2] = 9;          /* King+ */
 	}
 
 	text_show(99);
diff --git a/engines/mads/dragonsphere/rooms/room201.cpp b/engines/mads/dragonsphere/rooms/room201.cpp
index 286f164a019..a5bd10576a4 100644
--- a/engines/mads/dragonsphere/rooms/room201.cpp
+++ b/engines/mads/dragonsphere/rooms/room201.cpp
@@ -1205,11 +1205,8 @@ static void handle_anim_guard_right_pid() {
 }
 
 static void handle_anim_death() {
-	int death_reset_frame;
-
 	if (kernel_anim[aa[6]].frame != local->death_frame) {
 		local->death_frame = kernel_anim[aa[6]].frame;
-		death_reset_frame = -1;
 
 		switch (local->death_frame) {
 		case 38:
@@ -1229,11 +1226,6 @@ static void handle_anim_death() {
 			}
 			break;
 		}
-
-		if (death_reset_frame >= 0) {
-			kernel_reset_animation(aa[6], death_reset_frame);
-			local->death_frame = death_reset_frame;
-		}
 	}
 }
 
diff --git a/engines/mads/dragonsphere/rooms/room454.cpp b/engines/mads/dragonsphere/rooms/room454.cpp
index 7bb119dd866..86f69abb8e6 100644
--- a/engines/mads/dragonsphere/rooms/room454.cpp
+++ b/engines/mads/dragonsphere/rooms/room454.cpp
@@ -205,11 +205,8 @@ static void set_454_cloud_right_position() {
 }
 
 static void handle_animation_king() {
-	int king_reset_frame;
-
 	if (kernel_anim[aa[0]].frame != local->king_frame) {
 		local->king_frame = kernel_anim[aa[0]].frame;
-		king_reset_frame = -1;
 
 		switch (local->king_frame) {
 		case 210:
@@ -223,11 +220,6 @@ static void handle_animation_king() {
 			new_room               = 405;
 			break;
 		}
-
-		if (king_reset_frame >= 0) {
-			kernel_reset_animation(aa[0], king_reset_frame);
-			local->king_frame = king_reset_frame;
-		}
 	}
 }
 
diff --git a/engines/mads/dragonsphere/rooms/room506.cpp b/engines/mads/dragonsphere/rooms/room506.cpp
index ec27182d32d..83631836304 100644
--- a/engines/mads/dragonsphere/rooms/room506.cpp
+++ b/engines/mads/dragonsphere/rooms/room506.cpp
@@ -176,14 +176,7 @@ static void handle_animation_pid() {
 				++local->pid_freeze_count;
 				if (local->pid_freeze_count > imath_random(30, 45)) {
 					local->pid_freeze_count = 0;
-					random = imath_random(1, 2) == 1;
-					if (random == 1) {
-						pid_reset_frame = 221;
-					} else if (random == 2) {
-						pid_reset_frame = 222;
-					} else {
-						pid_reset_frame = 224;
-					}
+					pid_reset_frame = imath_random(1, 2) == 1 ? 221 : 222;
 				} else {
 					pid_reset_frame = local->pid_frame - 1;
 				}
diff --git a/engines/mads/dragonsphere/rooms/room510.cpp b/engines/mads/dragonsphere/rooms/room510.cpp
index e66f08b1f9c..0b85d3fd3da 100644
--- a/engines/mads/dragonsphere/rooms/room510.cpp
+++ b/engines/mads/dragonsphere/rooms/room510.cpp
@@ -236,11 +236,7 @@ static void room_510_init() {
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		local->anim_0_running = false;
 		local->standing_on    = 0;
-		if (global[move_direction_510]) {
-			local->move_counter   = 0;
-		} else {
-			local->move_counter   = 0;
-		}
+		local->move_counter   = 0;
 	}
 
 	ss[fx_n]     = kernel_load_series(kernel_name('b', 0), false);


Commit: 94a3a523f4eafafbe4d1d6ab56349ed84adc6ea4
    https://github.com/scummvm/scummvm/commit/94a3a523f4eafafbe4d1d6ab56349ed84adc6ea4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-08-08T20:34:10+10:00

Commit Message:
MADS: PHANTOM: Fix Coverity warnings

Changed paths:
    engines/mads/phantom/sound/asound.cpp


diff --git a/engines/mads/phantom/sound/asound.cpp b/engines/mads/phantom/sound/asound.cpp
index 0135db37c40..d3dfd21d4dd 100644
--- a/engines/mads/phantom/sound/asound.cpp
+++ b/engines/mads/phantom/sound/asound.cpp
@@ -996,7 +996,6 @@ dispatch:
 			int16 ax = (int16)(int8)b;   /* sign-extend */
 			var_8 = 0;
 			ax = (int16)(ax - (-66));
-			if ((uint16)ax > 65) goto dispatch;  /* unknown - skip */
 
 			switch (ax) {
 				/* ---- opcode -1  (0xFF): inner loop ---- */
@@ -1223,7 +1222,7 @@ vol_advance:
 				pSrc++;
 				ch->_patchAttenuation = *pSrc;
 				ch->_pSrc += 2;
-				var_8 = 1;
+				//var_8 = 1;
 				goto dispatch;
 			}
 
@@ -1270,7 +1269,7 @@ vol_advance:
 				(void)getRandomNumber();
 				uint16 rnd = _randomSeed & 0x7FFF;
 				uint16 idx = (uint16)((int16)rnd % (int16)var_C);
-				var_6 = idx;
+				//var_6 = idx;
 
 				uint8 chosen = *(base + idx);
 				uint8 target = *(base + var_C);




More information about the Scummvm-git-logs mailing list