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

dreammaster noreply at scummvm.org
Fri Jun 19 11:35:55 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:
050141580c MADS: FOREST: Implementing global game functions
a37ce1065b MADS: FOREST: Completely remove unused ForestSoundManager


Commit: 050141580caea2dad102da0e98a7dc2c94fa3312
    https://github.com/scummvm/scummvm/commit/050141580caea2dad102da0e98a7dc2c94fa3312
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-19T21:12:14+10:00

Commit Message:
MADS: FOREST: Implementing global game functions

Changed paths:
    engines/mads/madsv2/core/digi.cpp
    engines/mads/madsv2/core/digi.h
    engines/mads/madsv2/forest/forest.cpp
    engines/mads/madsv2/forest/forest.h
    engines/mads/madsv2/forest/global.cpp
    engines/mads/madsv2/forest/global.h


diff --git a/engines/mads/madsv2/core/digi.cpp b/engines/mads/madsv2/core/digi.cpp
index 5d08cae44b4..75a9d8c2208 100644
--- a/engines/mads/madsv2/core/digi.cpp
+++ b/engines/mads/madsv2/core/digi.cpp
@@ -28,6 +28,7 @@ namespace MADSV2 {
 int digi_val1;
 int digi_val2;
 int digi_timing_index;
+bool digi_flag1, digi_flag2;
 
 void digi_install() {
 	digi_val1 = 0;
diff --git a/engines/mads/madsv2/core/digi.h b/engines/mads/madsv2/core/digi.h
index db4eee253ae..ad0bb273ba8 100644
--- a/engines/mads/madsv2/core/digi.h
+++ b/engines/mads/madsv2/core/digi.h
@@ -30,6 +30,7 @@ namespace MADSV2 {
 extern int digi_val1;
 extern int digi_val2;
 extern int digi_timing_index;
+extern bool digi_flag1, digi_flag2;
 
 extern void digi_install();
 extern void digi_play(const char *name, int slot);
diff --git a/engines/mads/madsv2/forest/forest.cpp b/engines/mads/madsv2/forest/forest.cpp
index 922dc568c3b..c029be800a7 100644
--- a/engines/mads/madsv2/forest/forest.cpp
+++ b/engines/mads/madsv2/forest/forest.cpp
@@ -114,18 +114,21 @@ void ForestEngine::global_daemon_code() {
 }
 
 void ForestEngine::global_pre_parser_code() {
+	if (player_said_1(look) || player_said_1(throw)) {
+		player.need_to_walk = false;
+	}
 }
 
 void ForestEngine::global_parser_code() {
-}
-
-void ForestEngine::global_object_examine() {
+	// No implementation
 }
 
 void ForestEngine::global_error_code() {
+	Forest::global_error_code();
 }
 
 void ForestEngine::global_room_init() {
+	Forest::global_room_init();
 }
 
 void ForestEngine::global_sound_driver() {
diff --git a/engines/mads/madsv2/forest/forest.h b/engines/mads/madsv2/forest/forest.h
index e7f9d2f6662..6765d195a40 100644
--- a/engines/mads/madsv2/forest/forest.h
+++ b/engines/mads/madsv2/forest/forest.h
@@ -29,9 +29,6 @@ namespace MADSV2 {
 namespace Forest {
 
 class ForestEngine : public MADSV2Engine {
-private:
-	static void global_object_examine();
-
 public:
 	ForestEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
 		MADSV2Engine(syst, gameDesc) {}
diff --git a/engines/mads/madsv2/forest/global.cpp b/engines/mads/madsv2/forest/global.cpp
index 476693e6ac2..5b6de4b6fe6 100644
--- a/engines/mads/madsv2/forest/global.cpp
+++ b/engines/mads/madsv2/forest/global.cpp
@@ -21,6 +21,9 @@
 
 #include "common/textconsole.h"
 #include "mads/madsv2/core/digi.h"
+#include "mads/madsv2/core/object.h"
+#include "mads/madsv2/core/player.h"
+#include "mads/madsv2/core/text.h"
 #include "mads/madsv2/core/error.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
@@ -893,6 +896,95 @@ static void global_anim2_5(int arg_0, int arg_2, int16 *arg_4) {
 	}
 }
 
+void global_room_init() {
+	global[g133] = 1;
+	global[g143] = 1;
+	global[g132] = -1;
+	global[g137] = -1;
+	global[g142] = -1;
+	global[g147] = -1;
+	global[g151] = -1;
+	global[g152] = -1;
+	global[g153] = -1;
+	room_203_flag = true;
+	global[g131] = 0;
+	global[g130] = 0;
+	global[g135] = 0;
+	global[g136] = 0;
+	global[g134] = 0;
+	global[g141] = 0;
+	global[g140] = 0;
+	global[g145] = 0;
+	global[g146] = 0;
+	global[g144] = 0;
+	global[g148] = 0;
+	global[perform_displacements] = 0;
+	digi_flag1 = false;
+	digi_flag2 = false;
+	digi_val2 = 0;
+}
+
+void global_error_code() {
+	int16 randVal = imath_random(1, 1000);
+	int16 text_id = 0;
+
+	if (player_parse(4, 0)) {
+		if (player_has(object_named(player_main_noun)) && player.main_object_source != 4) {
+			text_id = 25;
+		} else {
+			if (randVal <= 333)      text_id = 1;
+			else if (randVal <= 666) text_id = 2;
+			else                     text_id = 3;
+		}
+	} else if (player_parse(5, 0)) {
+		text_id = (randVal < 750) ? 4 : 5;
+	} else if (player_parse(10, 0)) {
+		text_id = (randVal < 750) ? 6 : 7;
+	} else if (player_parse(6, 0)) {
+		if (randVal <= 500)      text_id = 8;
+		else if (randVal <= 750) text_id = 9;
+		else                     text_id = 10;
+	} else if (player_parse(11, 0)) {
+		if (randVal <= 500)      text_id = 11;
+		else if (randVal <= 750) text_id = 12;
+		else                     text_id = 13;
+	} else if (player_parse(7, 0)) {
+		if (player_has(object_named(player_main_noun))) {
+			text_id = 26;
+		} else if (player.main_object_source == 4 && player.second_object_source == 4) {
+			text_id = 28;
+		} else {
+			text_id = (randVal < 500) ? 14 : 15;
+		}
+	} else if (player_parse(8, 0)) {
+		text_id = (randVal <= 500) ? 16 : 17;
+	} else if (player_parse(9, 0)) {
+		if (player_has(object_named(player_main_noun))) {
+			text_id = 27;
+		} else if (player.main_object_source == 4 && player.second_object_source == 4) {
+			text_id = 28;
+		} else {
+			text_id = 18;
+		}
+	} else if (player_parse(12, 0)) {
+		if (player_has(object_named(player_main_noun))) {
+			text_id = 19;
+		} else {
+			text_id = 28;
+		}
+	} else if (player_parse(3, 0)) {
+		object_named(player_main_noun);
+		if (randVal <= 333)      text_id = 20;
+		else if (randVal <= 666) text_id = 21;
+		else                     text_id = 22;
+	} else if (!player_parse(13, 0) && !player_parse(160, 0)) {
+		text_id = (randVal < 500) ? 23 : 24;
+	}
+
+	if (text_id)
+		text_show(text_id);
+}
+
 void global_digi_play(int num) {
 	// TODO
 	warning("TODO: global_digi_play");
diff --git a/engines/mads/madsv2/forest/global.h b/engines/mads/madsv2/forest/global.h
index f5db0c4fecb..0c47ac2b5b2 100644
--- a/engines/mads/madsv2/forest/global.h
+++ b/engines/mads/madsv2/forest/global.h
@@ -263,6 +263,8 @@ extern void sync_room(Common::Serializer &s);
 extern void global_section_walker();
 extern void global_section_interface();
 
+extern void global_room_init();
+extern void global_error_code();
 extern void global_anim1(int arg_0, int arg_2, int arg_4, int16 *arg_6);
 extern void global_anim2(int arg_0, int arg_2, int arg_4, int16 *arg_6);
 extern void global_anim3(int handle, int16 *frame);


Commit: a37ce1065b023c540dfab393ae9f88dde6c6ccd0
    https://github.com/scummvm/scummvm/commit/a37ce1065b023c540dfab393ae9f88dde6c6ccd0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-19T21:35:37+10:00

Commit Message:
MADS: FOREST: Completely remove unused ForestSoundManager

Changed paths:
  R engines/mads/madsv2/forest/sound_forest.cpp
  R engines/mads/madsv2/forest/sound_forest.h
    engines/mads/madsv2/forest/forest.cpp
    engines/mads/module.mk


diff --git a/engines/mads/madsv2/forest/forest.cpp b/engines/mads/madsv2/forest/forest.cpp
index c029be800a7..751831779f0 100644
--- a/engines/mads/madsv2/forest/forest.cpp
+++ b/engines/mads/madsv2/forest/forest.cpp
@@ -38,7 +38,6 @@
 #include "mads/madsv2/forest/forest.h"
 #include "mads/madsv2/forest/global.h"
 #include "mads/madsv2/forest/main.h"
-#include "mads/madsv2/forest/sound_forest.h"
 #include "mads/madsv2/forest/rooms/section1.h"
 #include "mads/madsv2/forest/rooms/section2.h"
 #include "mads/madsv2/forest/rooms/section3.h"
@@ -69,10 +68,6 @@ Common::Error ForestEngine::run() {
 			SearchMan.add("mpslabs", arch);
 	}
 
-	// Set up sound manager
-	_soundManager = new ForestSoundManager(_mixer, _soundFlag);
-	_soundManager->validate();
-
 	// Run the game
 	Forest::forest_main();
 
diff --git a/engines/mads/madsv2/forest/sound_forest.cpp b/engines/mads/madsv2/forest/sound_forest.cpp
deleted file mode 100644
index abd67d0176f..00000000000
--- a/engines/mads/madsv2/forest/sound_forest.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "common/endian.h"
-#include "common/file.h"
-#include "common/md5.h"
-#include "common/textconsole.h"
-#include "mads/madsv2/forest/sound_forest.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Forest {
-
-void ForestSoundManager::validate() {
-	Common::File f;
-	static const char *const MD5[] = {
-		"cac84f53ccf18ca56f4c03352037790f",
-		"2dcdbe18ca5225384cdb97ceb7f5642a",
-		"c6001b0dfe32cb9399ab60742b631c2e",
-		"1596b657c6171e13714eaf114bf94641",
-		"ecbb8bdf1e2e36fcacedce79761e625b",
-		nullptr,
-		nullptr,
-		nullptr,
-		"379fcc9af2142f15a3e7166eee6dd49d"
-	};
-
-	for (int i = 1; i <= 9; ++i) {
-		if (i == 7 || i == 8)
-			continue;
-		Common::Path filename(Common::String::format("asound.dr%d", i));
-		if (!f.open(filename))
-			error("Could not process - %s", filename.toString().c_str());
-		Common::String md5str = Common::computeStreamMD5AsString(f, 8192);
-		f.close();
-
-		if (md5str != MD5[i - 1])
-			error("Invalid sound file - %s", filename.toString().c_str());
-	}
-}
-
-void ForestSoundManager::loadDriver(int sectionNumber) {
-	// TODO
-}
-
-} // namespace Forest
-} // namespace MADSV2
-} // namespace MADS
diff --git a/engines/mads/madsv2/forest/sound_forest.h b/engines/mads/madsv2/forest/sound_forest.h
deleted file mode 100644
index ba84cce9623..00000000000
--- a/engines/mads/madsv2/forest/sound_forest.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef MADS_FOREST_SOUND_H
-#define MADS_FOREST_SOUND_H
-
-#include "mads/madsv2/forest/asound.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Forest {
-
-class ForestSoundManager : public SoundManager {
-protected:
-	void loadDriver(int sectionNum) override;
-
-public:
-	ForestSoundManager(Audio::Mixer *mixer, bool &soundFlag) : SoundManager(mixer, soundFlag) {
-	}
-	~ForestSoundManager() override {
-	}
-
-	void validate() override;
-};
-
-} // namespace Forest
-} // namespace MADSV2
-} // namespace MADS
-
-#endif
diff --git a/engines/mads/module.mk b/engines/mads/module.mk
index 42123ec7955..707e17543b1 100644
--- a/engines/mads/module.mk
+++ b/engines/mads/module.mk
@@ -270,7 +270,6 @@ MODULE_OBJS += \
 	madsv2/forest/main.o \
 	madsv2/forest/main_menu.o \
 	madsv2/forest/menus.o \
-	madsv2/forest/sound_forest.o \
 	madsv2/forest/mads/mads.o \
 	madsv2/forest/rooms/room101.o \
 	madsv2/forest/rooms/room103.o \




More information about the Scummvm-git-logs mailing list