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

dreammaster noreply at scummvm.org
Sat Jun 20 08:42:12 UTC 2026


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

Summary:
666c8bb3fe MADS: FOREST: Digi global is actually config_file field
ef625ccaf3 MADS: FOREST: Room loading fixes


Commit: 666c8bb3fe066a7f63273348de13207a3df8e096
    https://github.com/scummvm/scummvm/commit/666c8bb3fe066a7f63273348de13207a3df8e096
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-20T18:41:47+10:00

Commit Message:
MADS: FOREST: Digi global is actually config_file field

Changed paths:
    engines/mads/madsv2/core/config.h
    engines/mads/madsv2/core/digi.cpp
    engines/mads/madsv2/core/digi.h
    engines/mads/madsv2/forest/main.cpp
    engines/mads/madsv2/forest/rooms/room101.cpp
    engines/mads/madsv2/forest/rooms/room103.cpp
    engines/mads/madsv2/forest/rooms/room104.cpp
    engines/mads/madsv2/forest/rooms/room106.cpp
    engines/mads/madsv2/forest/rooms/room210.cpp
    engines/mads/madsv2/forest/rooms/room221.cpp
    engines/mads/madsv2/forest/rooms/room302.cpp
    engines/mads/madsv2/forest/rooms/room303.cpp
    engines/mads/madsv2/forest/rooms/room304.cpp
    engines/mads/madsv2/forest/rooms/room305.cpp
    engines/mads/madsv2/forest/rooms/room306.cpp
    engines/mads/madsv2/forest/rooms/room307.cpp
    engines/mads/madsv2/forest/rooms/room308.cpp
    engines/mads/madsv2/forest/rooms/room321.cpp
    engines/mads/madsv2/forest/rooms/room322.cpp
    engines/mads/madsv2/forest/rooms/room401.cpp
    engines/mads/madsv2/forest/rooms/room402.cpp
    engines/mads/madsv2/forest/rooms/room403.cpp
    engines/mads/madsv2/forest/rooms/room404.cpp
    engines/mads/madsv2/forest/rooms/room405.cpp
    engines/mads/madsv2/forest/rooms/room501.cpp
    engines/mads/madsv2/forest/rooms/room503.cpp
    engines/mads/madsv2/forest/rooms/room510.cpp
    engines/mads/madsv2/forest/rooms/room901.cpp
    engines/mads/madsv2/forest/rooms/room903.cpp
    engines/mads/madsv2/forest/rooms/room904.cpp


diff --git a/engines/mads/madsv2/core/config.h b/engines/mads/madsv2/core/config.h
index 5dada0d05fc..0492814a5c2 100644
--- a/engines/mads/madsv2/core/config.h
+++ b/engines/mads/madsv2/core/config.h
@@ -96,10 +96,12 @@ struct ConfigFile {
 	int show_speech_boxes;        /* Show text during speech       */
 
 	int sound_card_irq;
-	bool original_save_load;
 	int misc3;
 	int misc4;
 	int misc5;
+	int forest1;
+
+	bool original_save_load;
 };
 
 extern ConfigFile config_file;
diff --git a/engines/mads/madsv2/core/digi.cpp b/engines/mads/madsv2/core/digi.cpp
index 75a9d8c2208..c598d28ae94 100644
--- a/engines/mads/madsv2/core/digi.cpp
+++ b/engines/mads/madsv2/core/digi.cpp
@@ -20,18 +20,18 @@
  */
 
 #include "mads/madsv2/core/digi.h"
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/engine.h"
 
 namespace MADS {
 namespace MADSV2 {
 
-int digi_val1;
 int digi_val2;
 int digi_timing_index;
 bool digi_flag1, digi_flag2;
 
 void digi_install() {
-	digi_val1 = 0;
+	config_file.forest1 = 0;
 	digi_val2 = 0;
 	digi_timing_index = 0;
 }
diff --git a/engines/mads/madsv2/core/digi.h b/engines/mads/madsv2/core/digi.h
index ad0bb273ba8..f212c2f334c 100644
--- a/engines/mads/madsv2/core/digi.h
+++ b/engines/mads/madsv2/core/digi.h
@@ -27,7 +27,7 @@
 namespace MADS {
 namespace MADSV2 {
 
-extern int digi_val1;
+//extern int config_file.forest1;
 extern int digi_val2;
 extern int digi_timing_index;
 extern bool digi_flag1, digi_flag2;
diff --git a/engines/mads/madsv2/forest/main.cpp b/engines/mads/madsv2/forest/main.cpp
index eac24e274b3..96601a09f6f 100644
--- a/engines/mads/madsv2/forest/main.cpp
+++ b/engines/mads/madsv2/forest/main.cpp
@@ -52,6 +52,7 @@ constexpr byte LINE_COLOR = 2;
 char *quotes;
 
 static void main_menu_main() {
+#ifdef TODO
 	auto &screen = *g_engine->getScreen();
 	Palette palette;
 
@@ -113,6 +114,9 @@ static void main_menu_main() {
 	}
 
 	mcga_reset();
+#else
+	selected_item = 0;
+#endif
 }
 
 static void main_cold_data_init() {
diff --git a/engines/mads/madsv2/forest/rooms/room101.cpp b/engines/mads/madsv2/forest/rooms/room101.cpp
index b8d0b5abb75..45a43b03e8a 100644
--- a/engines/mads/madsv2/forest/rooms/room101.cpp
+++ b/engines/mads/madsv2/forest/rooms/room101.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
diff --git a/engines/mads/madsv2/forest/rooms/room103.cpp b/engines/mads/madsv2/forest/rooms/room103.cpp
index 999ad6a4f85..89426005151 100644
--- a/engines/mads/madsv2/forest/rooms/room103.cpp
+++ b/engines/mads/madsv2/forest/rooms/room103.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
diff --git a/engines/mads/madsv2/forest/rooms/room104.cpp b/engines/mads/madsv2/forest/rooms/room104.cpp
index 4fec105fb1f..7191b997870 100644
--- a/engines/mads/madsv2/forest/rooms/room104.cpp
+++ b/engines/mads/madsv2/forest/rooms/room104.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
diff --git a/engines/mads/madsv2/forest/rooms/room106.cpp b/engines/mads/madsv2/forest/rooms/room106.cpp
index 9f6a92ade9e..e54b918ce02 100644
--- a/engines/mads/madsv2/forest/rooms/room106.cpp
+++ b/engines/mads/madsv2/forest/rooms/room106.cpp
@@ -19,7 +19,7 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
@@ -255,7 +255,7 @@ static void room_106_anim1() {
 
 	if (kernel.trigger != 7 && kernel.trigger != 28)
 		return;
-	if (digi_val1 != 0)
+	if (config_file.forest1 != 0)
 		kernel_timing_trigger(1, 109);
 	if (scratch._ae == 114) { scratch._ae = -1; return; }
 	if (scratch._ae > 114)  return;
diff --git a/engines/mads/madsv2/forest/rooms/room210.cpp b/engines/mads/madsv2/forest/rooms/room210.cpp
index f1ec570a629..abea8109c55 100644
--- a/engines/mads/madsv2/forest/rooms/room210.cpp
+++ b/engines/mads/madsv2/forest/rooms/room210.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
@@ -385,13 +386,13 @@ static void room_210_daemon() {
 		case 3:
 			aainfo[8]._frame = 12;
 			kernel_reset_animation(aa[8], 12);
-			if (digi_val1 != 0) kernel_timing_trigger(1, 109);
+			if (config_file.forest1 != 0) kernel_timing_trigger(1, 109);
 			break;
 		case 4:
 			global[walker_converse_state] = 0;
 			close_journal(3);
 			player.commands_allowed = -1;
-			if (digi_val1 != 0) kernel_timing_trigger(1, 109);
+			if (config_file.forest1 != 0) kernel_timing_trigger(1, 109);
 			break;
 		}
 		scratch._a6 = 0;
diff --git a/engines/mads/madsv2/forest/rooms/room221.cpp b/engines/mads/madsv2/forest/rooms/room221.cpp
index 062d5ff6244..503d72a44d7 100644
--- a/engines/mads/madsv2/forest/rooms/room221.cpp
+++ b/engines/mads/madsv2/forest/rooms/room221.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
 #include "mads/madsv2/core/inter.h"
diff --git a/engines/mads/madsv2/forest/rooms/room302.cpp b/engines/mads/madsv2/forest/rooms/room302.cpp
index 2e86c40f7cc..ee3db098fd5 100644
--- a/engines/mads/madsv2/forest/rooms/room302.cpp
+++ b/engines/mads/madsv2/forest/rooms/room302.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
diff --git a/engines/mads/madsv2/forest/rooms/room303.cpp b/engines/mads/madsv2/forest/rooms/room303.cpp
index ba06a7eeb61..c6f8028e090 100644
--- a/engines/mads/madsv2/forest/rooms/room303.cpp
+++ b/engines/mads/madsv2/forest/rooms/room303.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
diff --git a/engines/mads/madsv2/forest/rooms/room304.cpp b/engines/mads/madsv2/forest/rooms/room304.cpp
index e024a8e17ba..70235ac4f5e 100644
--- a/engines/mads/madsv2/forest/rooms/room304.cpp
+++ b/engines/mads/madsv2/forest/rooms/room304.cpp
@@ -19,7 +19,7 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
@@ -133,7 +133,7 @@ static void room_304_init() {
 
 static void room_304_finish() {
 	player.commands_allowed = -1;
-	if (digi_val1)
+	if (config_file.forest1)
 		kernel_timing_trigger(1, 107);
 }
 
diff --git a/engines/mads/madsv2/forest/rooms/room305.cpp b/engines/mads/madsv2/forest/rooms/room305.cpp
index 32a89cc1c49..468ae49e6e6 100644
--- a/engines/mads/madsv2/forest/rooms/room305.cpp
+++ b/engines/mads/madsv2/forest/rooms/room305.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
@@ -747,7 +748,7 @@ static void room_305_anim10() {
 			kernel_abort_animation(aa[9]);
 			aainfo[9]._active = 0;
 			player.commands_allowed = -1;
-			if (digi_val1 != 0)
+			if (config_file.forest1 != 0)
 				kernel_timing_trigger(1, 109);
 			global[g131] = -1;
 			kernel_reset_animation(scratch._9a, 1);
@@ -780,7 +781,7 @@ static void room_305_daemon() {
 			global[walker_converse_state] = 0;
 			close_journal(3);
 			player.commands_allowed = -1;
-			if (digi_val1 != 0)
+			if (config_file.forest1 != 0)
 				kernel_timing_trigger(1, 109);
 		} else {
 			if (scratch._a4 == 300) {
@@ -876,7 +877,7 @@ static void room_305_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1 != 0)
+		if (config_file.forest1 != 0)
 			kernel_timing_trigger(1, 109);
 		break;
 
@@ -899,7 +900,7 @@ static void room_305_daemon() {
 			global[g143] = 0;
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			player.commands_allowed = -1;
-			if (digi_val1 != 0)
+			if (config_file.forest1 != 0)
 				kernel_timing_trigger(1, 109);
 		}
 		break;
@@ -912,7 +913,7 @@ static void room_305_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
 		global[g143] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1 != 0)
+		if (config_file.forest1 != 0)
 			kernel_timing_trigger(1, 109);
 		break;
 	}
@@ -938,7 +939,7 @@ static void room_305_daemon() {
 			global[g069] = -1;
 			global[player_score] = -1;
 			player.commands_allowed = -1;
-			if (digi_val1 != 0)
+			if (config_file.forest1 != 0)
 				kernel_timing_trigger(1, 109);
 		}
 		break;
@@ -988,7 +989,7 @@ static void room_305_daemon() {
 		global[g143] = 0;
 		kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 		player.commands_allowed = -1;
-		if (digi_val1 != 0)
+		if (config_file.forest1 != 0)
 			kernel_timing_trigger(1, 109);
 		break;
 
@@ -1000,7 +1001,7 @@ static void room_305_daemon() {
 		global[g133] = 0;
 		global[player_score] = -1;
 		player.commands_allowed = -1;
-		if (digi_val1 != 0)
+		if (config_file.forest1 != 0)
 			kernel_timing_trigger(1, 109);
 		break;
 
diff --git a/engines/mads/madsv2/forest/rooms/room306.cpp b/engines/mads/madsv2/forest/rooms/room306.cpp
index 8d44e900d4b..72858656bac 100644
--- a/engines/mads/madsv2/forest/rooms/room306.cpp
+++ b/engines/mads/madsv2/forest/rooms/room306.cpp
@@ -19,7 +19,7 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
 #include "mads/madsv2/core/inter.h"
@@ -687,7 +687,7 @@ static void room_306_daemon() {
 			global[walker_converse_state] = 0;
 			close_journal(3);
 			player.commands_allowed = -1;
-			if (digi_val1 != 0) {
+			if (config_file.forest1 != 0) {
 				if (global[g066] == 3) {
 					kernel_timing_trigger(1, 118);
 				} else {
@@ -710,7 +710,7 @@ static void room_306_daemon() {
 				kernel_synch(KERNEL_ANIM, scratch.x9a, KERNEL_NOW, 0);
 				global[g133] = 0;
 				player.commands_allowed = -1;
-				if (digi_val1 != 0) {
+				if (config_file.forest1 != 0) {
 					if (global[g066] == 3) {
 						kernel_timing_trigger(1, 118);
 					} else {
@@ -734,7 +734,7 @@ static void room_306_daemon() {
 				scratch.xa2 = 0;
 				scratch.x9e = -1;
 				player.commands_allowed = -1;
-				if (digi_val1 != 0) {
+				if (config_file.forest1 != 0) {
 					if (global[g066] == 3) {
 						kernel_timing_trigger(1, 118);
 					} else {
@@ -792,7 +792,7 @@ static void room_306_daemon() {
 	case 100:
 		kernel_abort_animation(aa[0]);
 		aainfo[0]._active = 0;
-		if (digi_val1 != 0) {
+		if (config_file.forest1 != 0) {
 			if (global[g066] == 3) {
 				kernel_timing_trigger(1, 118);
 			} else {
@@ -820,7 +820,7 @@ static void room_306_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch.x9c, KERNEL_NOW, 0);
 		global[g143] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1 != 0) {
+		if (config_file.forest1 != 0) {
 			if (global[g066] == 3) {
 				kernel_timing_trigger(1, 118);
 			} else {
@@ -975,7 +975,7 @@ static void room_306_parser() {
 		digi_play_build(306, 'b', 1, 1);
 		scratch.x9e = 2500;
 		scratch.xa2 = -1;
-		if (digi_val1 == 0) {
+		if (config_file.forest1 == 0) {
 			kernel.trigger_setup_mode = 1;
 			kernel_timing_trigger(1, 117);
 		}
diff --git a/engines/mads/madsv2/forest/rooms/room307.cpp b/engines/mads/madsv2/forest/rooms/room307.cpp
index fbac29ef51b..122ff122079 100644
--- a/engines/mads/madsv2/forest/rooms/room307.cpp
+++ b/engines/mads/madsv2/forest/rooms/room307.cpp
@@ -19,7 +19,7 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
@@ -321,7 +321,7 @@ static void room_307_anim5() {
 		scratch._aa++;
 		global[g156] = 2;
 		digi_play_build(307, 'E', 2, 1);
-		if (digi_val1 == 0)
+		if (config_file.forest1 == 0)
 			digi_play_build(307, '_', 1, 2);
 		break;
 	case 20:
diff --git a/engines/mads/madsv2/forest/rooms/room308.cpp b/engines/mads/madsv2/forest/rooms/room308.cpp
index b25277516da..ec247be676f 100644
--- a/engines/mads/madsv2/forest/rooms/room308.cpp
+++ b/engines/mads/madsv2/forest/rooms/room308.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/forest/extra.h"
 #include "mads/madsv2/forest/journal.h"
@@ -178,7 +179,7 @@ static void room_308_anim4() {
 
 	bool in_e72 = (cur == 1 || cur == 5) ||
 	              (cur >= 10 && cur <= 58 && cur % 4 == 2);
-	if (in_e72 && (digi_val1 == 0 || (cur != 10 && cur != 14))) {
+	if (in_e72 && (config_file.forest1 == 0 || (cur != 10 && cur != 14))) {
 		digi_initial_volume(60);
 		digi_play_build(308, '_', 1, 2);
 	}
diff --git a/engines/mads/madsv2/forest/rooms/room321.cpp b/engines/mads/madsv2/forest/rooms/room321.cpp
index 2ce5ff1a7b7..bbf9024206f 100644
--- a/engines/mads/madsv2/forest/rooms/room321.cpp
+++ b/engines/mads/madsv2/forest/rooms/room321.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
diff --git a/engines/mads/madsv2/forest/rooms/room322.cpp b/engines/mads/madsv2/forest/rooms/room322.cpp
index 863509384a3..6fbecfcff86 100644
--- a/engines/mads/madsv2/forest/rooms/room322.cpp
+++ b/engines/mads/madsv2/forest/rooms/room322.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
 #include "mads/madsv2/core/inter.h"
diff --git a/engines/mads/madsv2/forest/rooms/room401.cpp b/engines/mads/madsv2/forest/rooms/room401.cpp
index 433b39a8ff7..f2c9c3c9766 100644
--- a/engines/mads/madsv2/forest/rooms/room401.cpp
+++ b/engines/mads/madsv2/forest/rooms/room401.cpp
@@ -19,7 +19,7 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
 #include "mads/madsv2/core/inter.h"
@@ -107,7 +107,7 @@ static void room_401_anim_state(int16 state) {
 		kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 		player.commands_allowed = -1;
 		player.walker_visible = -1;
-		if (digi_val1) {
+		if (config_file.forest1) {
 			digi_stop(1);
 			kernel_timing_trigger(1, 106);
 		}
@@ -230,7 +230,7 @@ static void room_401_anim2() {
 					} else if (frame == 32) {
 						result = 29;
 					} else if (frame == 35) {
-						if (digi_val1)
+						if (config_file.forest1)
 							kernel_timing_trigger(1, 106);
 					}
 				}
@@ -472,7 +472,7 @@ static void room_401_daemon() {
 		global[walker_converse_state] = 0;
 		close_journal(3);
 		player.commands_allowed = -1;
-		if (digi_val1)
+		if (config_file.forest1)
 			kernel_timing_trigger(1, 106);
 		break;
 
diff --git a/engines/mads/madsv2/forest/rooms/room402.cpp b/engines/mads/madsv2/forest/rooms/room402.cpp
index f8fec0ca4fa..cbee1bfb2c0 100644
--- a/engines/mads/madsv2/forest/rooms/room402.cpp
+++ b/engines/mads/madsv2/forest/rooms/room402.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
diff --git a/engines/mads/madsv2/forest/rooms/room403.cpp b/engines/mads/madsv2/forest/rooms/room403.cpp
index c0699dca9c4..d777d24502b 100644
--- a/engines/mads/madsv2/forest/rooms/room403.cpp
+++ b/engines/mads/madsv2/forest/rooms/room403.cpp
@@ -19,7 +19,7 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
@@ -463,7 +463,7 @@ static void room_403_daemon() {
 			global[walker_converse_state] = 0;
 			close_journal(3);
 			player.commands_allowed = -1;
-			if (digi_val1 != 0)
+			if (config_file.forest1 != 0)
 				kernel_timing_trigger(1, 105);
 		} else if (scratch._a4 == 300) {
 			kernel_abort_animation(scratch._9e);
@@ -567,7 +567,7 @@ static void room_403_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1 != 0)
+		if (config_file.forest1 != 0)
 			kernel_timing_trigger(1, 105);
 		break;
 
@@ -585,7 +585,7 @@ static void room_403_daemon() {
 		global[g143] = 0;
 		kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 		player.commands_allowed = -1;
-		if (digi_val1 != 0)
+		if (config_file.forest1 != 0)
 			kernel_timing_trigger(1, 105);
 		break;
 
@@ -596,7 +596,7 @@ static void room_403_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
 		global[g143] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1 != 0)
+		if (config_file.forest1 != 0)
 			kernel_timing_trigger(1, 105);
 		break;
 
@@ -607,7 +607,7 @@ static void room_403_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1 != 0)
+		if (config_file.forest1 != 0)
 			kernel_timing_trigger(1, 105);
 		break;
 
@@ -625,7 +625,7 @@ static void room_403_daemon() {
 			inter_move_object(13, 2);
 			display_interface();
 			player.commands_allowed = -1;
-			if (digi_val1 != 0)
+			if (config_file.forest1 != 0)
 				kernel_timing_trigger(1, 105);
 		} else if (scratch._a2 == 2) {
 			kernel_abort_animation(aa[5]);
@@ -640,7 +640,7 @@ static void room_403_daemon() {
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			kernel_flip_hotspot(95, 0);
 			player.commands_allowed = -1;
-			if (digi_val1 != 0)
+			if (config_file.forest1 != 0)
 				kernel_timing_trigger(1, 105);
 		}
 		break;
diff --git a/engines/mads/madsv2/forest/rooms/room404.cpp b/engines/mads/madsv2/forest/rooms/room404.cpp
index 23747b6f220..b17a9c55636 100644
--- a/engines/mads/madsv2/forest/rooms/room404.cpp
+++ b/engines/mads/madsv2/forest/rooms/room404.cpp
@@ -19,7 +19,7 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
@@ -518,7 +518,7 @@ static void room_404_daemon() {
 			global[walker_converse_state] = 0;
 			close_journal(3);
 			player.commands_allowed = -1;
-			if (digi_val1)
+			if (config_file.forest1)
 				kernel_timing_trigger(1, 110);
 		} else if (scratch._a6 == 400) {
 			kernel_abort_animation(scratch._9e);
@@ -527,7 +527,7 @@ static void room_404_daemon() {
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			player.walker_visible = -1;
 			player.commands_allowed = -1;
-			if (digi_val1)
+			if (config_file.forest1)
 				kernel_timing_trigger(1, 110);
 		}
 		break;
@@ -595,7 +595,7 @@ static void room_404_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1)
+		if (config_file.forest1)
 			kernel_timing_trigger(1, 110);
 		break;
 
@@ -622,7 +622,7 @@ static void room_404_daemon() {
 				global[g143] = 0;
 				kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 				player.commands_allowed = -1;
-				if (digi_val1)
+				if (config_file.forest1)
 					kernel_timing_trigger(1, 110);
 			}
 		} else if (previous_room == 405) {
@@ -637,7 +637,7 @@ static void room_404_daemon() {
 			global[g143] = 0;
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			player.commands_allowed = -1;
-			if (digi_val1)
+			if (config_file.forest1)
 				kernel_timing_trigger(1, 110);
 		}
 		break;
@@ -649,7 +649,7 @@ static void room_404_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
 		global[g143] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1)
+		if (config_file.forest1)
 			kernel_timing_trigger(1, 110);
 		break;
 
@@ -660,7 +660,7 @@ static void room_404_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1)
+		if (config_file.forest1)
 			kernel_timing_trigger(1, 110);
 		break;
 
@@ -718,7 +718,7 @@ static void room_404_daemon() {
 				close_journal(3);
 			}
 			player.commands_allowed = -1;
-			if (digi_val1)
+			if (config_file.forest1)
 				kernel_timing_trigger(1, 110);
 		}
 		break;
@@ -760,7 +760,7 @@ static void room_404_daemon() {
 			global[g143] = 0;
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			player.commands_allowed = -1;
-			if (digi_val1)
+			if (config_file.forest1)
 				kernel_timing_trigger(1, 110);
 		}
 		break;
diff --git a/engines/mads/madsv2/forest/rooms/room405.cpp b/engines/mads/madsv2/forest/rooms/room405.cpp
index 35a122ffda8..31e712d124f 100644
--- a/engines/mads/madsv2/forest/rooms/room405.cpp
+++ b/engines/mads/madsv2/forest/rooms/room405.cpp
@@ -19,7 +19,7 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
@@ -281,7 +281,7 @@ static void room_405_daemon() {
 			global[walker_converse_state] = 0;
 			close_journal(3);
 			player.commands_allowed = -1;
-			if (digi_val1)
+			if (config_file.forest1)
 				kernel_timing_trigger(1, 106);
 		}
 		break;
@@ -341,7 +341,7 @@ static void room_405_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1)
+		if (config_file.forest1)
 			kernel_timing_trigger(1, 106);
 		break;
 
@@ -366,7 +366,7 @@ static void room_405_daemon() {
 			global[g143] = 0;
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			player.commands_allowed = -1;
-			if (digi_val1)
+			if (config_file.forest1)
 				kernel_timing_trigger(1, 106);
 		}
 		break;
@@ -378,7 +378,7 @@ static void room_405_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
 		global[g143] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1)
+		if (config_file.forest1)
 			kernel_timing_trigger(1, 106);
 		break;
 
@@ -389,7 +389,7 @@ static void room_405_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = -1;
-		if (digi_val1)
+		if (config_file.forest1)
 			kernel_timing_trigger(1, 106);
 		break;
 
@@ -407,7 +407,7 @@ static void room_405_daemon() {
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			global[g082] = 1;
 			player.commands_allowed = -1;
-			if (digi_val1)
+			if (config_file.forest1)
 				kernel_timing_trigger(1, 106);
 		}
 		break;
diff --git a/engines/mads/madsv2/forest/rooms/room501.cpp b/engines/mads/madsv2/forest/rooms/room501.cpp
index 8b8556d43f1..e8ed6ca0d89 100644
--- a/engines/mads/madsv2/forest/rooms/room501.cpp
+++ b/engines/mads/madsv2/forest/rooms/room501.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
 #include "mads/madsv2/core/inter.h"
diff --git a/engines/mads/madsv2/forest/rooms/room503.cpp b/engines/mads/madsv2/forest/rooms/room503.cpp
index e13cf1f3c89..26ed0aa44e7 100644
--- a/engines/mads/madsv2/forest/rooms/room503.cpp
+++ b/engines/mads/madsv2/forest/rooms/room503.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
diff --git a/engines/mads/madsv2/forest/rooms/room510.cpp b/engines/mads/madsv2/forest/rooms/room510.cpp
index 2fcaf671ffa..5627f2ef5cc 100644
--- a/engines/mads/madsv2/forest/rooms/room510.cpp
+++ b/engines/mads/madsv2/forest/rooms/room510.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/digi.h"
 #include "mads/madsv2/core/font.h"
 #include "mads/madsv2/core/game.h"
@@ -174,7 +175,7 @@ static void room_510_anim2() {
 			digi_play_build(510, 'e', 1, 1);
 			scratch._8e = 63;
 		} else if (aa_frame == 131) {
-			if (digi_val1)
+			if (config_file.forest1)
 				digi_stop(1);
 			scratch._90 = 133;
 			digi_play_build(510, '_', 3, 2);
diff --git a/engines/mads/madsv2/forest/rooms/room901.cpp b/engines/mads/madsv2/forest/rooms/room901.cpp
index 857d70d737a..9dc094624f7 100644
--- a/engines/mads/madsv2/forest/rooms/room901.cpp
+++ b/engines/mads/madsv2/forest/rooms/room901.cpp
@@ -20,7 +20,6 @@
  */
 
 #include "common/config-manager.h"
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/kernel.h"
 #include "mads/madsv2/core/matte.h"
diff --git a/engines/mads/madsv2/forest/rooms/room903.cpp b/engines/mads/madsv2/forest/rooms/room903.cpp
index affb572a887..6d17b2af68b 100644
--- a/engines/mads/madsv2/forest/rooms/room903.cpp
+++ b/engines/mads/madsv2/forest/rooms/room903.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
 #include "mads/madsv2/core/inter.h"
diff --git a/engines/mads/madsv2/forest/rooms/room904.cpp b/engines/mads/madsv2/forest/rooms/room904.cpp
index f926ac2abe5..5414c294812 100644
--- a/engines/mads/madsv2/forest/rooms/room904.cpp
+++ b/engines/mads/madsv2/forest/rooms/room904.cpp
@@ -19,7 +19,6 @@
  *
  */
 
-#include "mads/madsv2/core/conv.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
 #include "mads/madsv2/core/inter.h"


Commit: ef625ccaf347f428592b83a27c1f89fc917600fb
    https://github.com/scummvm/scummvm/commit/ef625ccaf347f428592b83a27c1f89fc917600fb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-20T18:41:47+10:00

Commit Message:
MADS: FOREST: Room loading fixes

Changed paths:
    engines/mads/madsv2/core/kernel.cpp
    engines/mads/madsv2/core/sound.cpp


diff --git a/engines/mads/madsv2/core/kernel.cpp b/engines/mads/madsv2/core/kernel.cpp
index 401776fde6e..94adbca3805 100644
--- a/engines/mads/madsv2/core/kernel.cpp
+++ b/engines/mads/madsv2/core/kernel.cpp
@@ -688,7 +688,7 @@ int kernel_room_startup(int newRoom, int initial_variant, const char *interface,
 
 	pal_activate_shadow(&kernel_shadow_inter);
 
-	if (g_engine->getGameID() == GType_Dragonsphere) {
+	if (g_engine->getGameID() == GType_Dragonsphere || g_engine->getGameID() == GType_Forest) {
 		inter_anim = nullptr;
 
 	} else {
@@ -2555,12 +2555,14 @@ void kernel_unload_sound_driver() {
 }
 
 int kernel_load_sound_driver(const char *name, char sound_card_, int sound_board_address_, int sound_board_type_, int sound_board_irq_) {
-	// Get the section number from the end of the driver filename, and use it to initialize
-	// the sound system; we provide our own implementation of the drivers
-	int sectionNum = *(name + strlen(name) - 1) - '0';
-	assert(sectionNum >= 1 && sectionNum <= 9);
+	if (g_engine->_soundManager != nullptr) {
+		// Get the section number from the end of the driver filename, and use it to initialize
+		// the sound system; we provide our own implementation of the drivers
+		int sectionNum = *(name + strlen(name) - 1) - '0';
+		assert(sectionNum >= 1 && sectionNum <= 9);
 
-	g_engine->_soundManager->init(sectionNum);
+		g_engine->_soundManager->init(sectionNum);
+	}
 
 	return 0;
 }
diff --git a/engines/mads/madsv2/core/sound.cpp b/engines/mads/madsv2/core/sound.cpp
index 2eb92631ba4..8d016049df0 100644
--- a/engines/mads/madsv2/core/sound.cpp
+++ b/engines/mads/madsv2/core/sound.cpp
@@ -31,15 +31,17 @@ int sound_play(int soundNum) {
 }
 
 int sound_queue(int soundNum, int /*distance*/) {
-	return g_engine->_soundManager->command(soundNum);
+	return (g_engine->_soundManager) ? g_engine->_soundManager->command(soundNum) : 0;
 }
 
 void sound_queue_hold() {
-	g_engine->_soundManager->pauseNewCommands();
+	if (g_engine->_soundManager)
+		g_engine->_soundManager->pauseNewCommands();
 }
 
 void sound_queue_flush() {
-	g_engine->_soundManager->startQueuedCommands();
+	if (g_engine->_soundManager)
+		g_engine->_soundManager->startQueuedCommands();
 }
 
 } // namespace MADSV2




More information about the Scummvm-git-logs mailing list