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

dreammaster noreply at scummvm.org
Sat Jun 27 22:12:24 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:
59a2ee372f MADS: FOREST: Implement digi volume functions
fea5c0a41f MADS: FOREST: Fixes to meeting bird leader


Commit: 59a2ee372f005d98253d051bd2b1e89cce948b41
    https://github.com/scummvm/scummvm/commit/59a2ee372f005d98253d051bd2b1e89cce948b41
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-28T08:12:15+10:00

Commit Message:
MADS: FOREST: Implement digi volume functions

Changed paths:
    engines/mads/madsv2/forest/digi.cpp
    engines/mads/madsv2/forest/digi.h
    engines/mads/madsv2/forest/mads/inventory.h
    engines/mads/madsv2/forest/rooms/room302.cpp
    engines/mads/madsv2/forest/rooms/room303.cpp


diff --git a/engines/mads/madsv2/forest/digi.cpp b/engines/mads/madsv2/forest/digi.cpp
index 900a1632df1..7c170aa26a9 100644
--- a/engines/mads/madsv2/forest/digi.cpp
+++ b/engines/mads/madsv2/forest/digi.cpp
@@ -69,7 +69,10 @@ void DigiPlayer::play(const char *name, int slot) {
 		}
 	}
 
-	_mixer->playStream(Audio::Mixer::kSpeechSoundType, &c._soundHandle, audioStream);
+	int vol = (_initialVolume == MAX_DIGI_VOLUME) ? 255 : _initialVolume * 255 / 327 / 100;
+	_initialVolume = MAX_DIGI_VOLUME;
+
+	_mixer->playStream(Audio::Mixer::kSpeechSoundType, &c._soundHandle, audioStream, -1, vol);
 	c._isPlaying = true;
 }
 
@@ -99,6 +102,14 @@ void DigiPlayer::poll() {
 	}
 }
 
+void DigiPlayer::setInitialVolume(int vol) {
+	_initialVolume = (vol < 0 || vol > 100) ? MAX_DIGI_VOLUME : vol * 327;
+}
+
+void DigiPlayer::setVolume(int slot, int vol) {
+	_mixer->setChannelVolume(_channels[slot]._soundHandle, (vol == MAX_DIGI_VOLUME) ? 255 : vol * 255 / 327);
+}
+
 void digi_play_build_ii(char thing, int num, int slot) {
 	Common::String name = Common::String::format("%c0ii%c%03d",
 		(thing == '_') ? 's' : 'd', thing, num);
@@ -124,9 +135,11 @@ void digi_read_another_chunk() {
 }
 
 void digi_initial_volume(int vol) {
+	g_engine->_digiPlayer.setInitialVolume(vol);
 }
 
 void digi_set_volume(int vol, int slot) {
+	g_engine->_digiPlayer.setVolume(vol, slot);
 }
 
 } // namespace Forest
diff --git a/engines/mads/madsv2/forest/digi.h b/engines/mads/madsv2/forest/digi.h
index 1561a375399..214b8285d32 100644
--- a/engines/mads/madsv2/forest/digi.h
+++ b/engines/mads/madsv2/forest/digi.h
@@ -30,6 +30,7 @@ namespace MADSV2 {
 namespace Forest {
 
 #define MAX_DIGI_CHANNELS 3
+#define MAX_DIGI_VOLUME 0x7fff
 
 class DigiPlayer {
 	struct DigiChannel {
@@ -41,6 +42,7 @@ class DigiPlayer {
 private:
 	Audio::Mixer *_mixer;
 	DigiChannel _channels[MAX_DIGI_CHANNELS];
+	int _initialVolume = MAX_DIGI_VOLUME;
 
 public:
 	DigiPlayer(Audio::Mixer *mixer);
@@ -62,6 +64,16 @@ public:
 	 * Polls for any playing sounds that are finished
 	 */
 	void poll();
+
+	/**
+	 * Sets the initial volume for new digi sounds
+	 */
+	void setInitialVolume(int vol);
+
+	/**
+	 * Sets the volume for a specific digi channel
+	 */
+	void setVolume(int vol, int slot);
 };
 
 extern int digi_val2;
diff --git a/engines/mads/madsv2/forest/mads/inventory.h b/engines/mads/madsv2/forest/mads/inventory.h
index 3459881a929..d68b6e587b8 100644
--- a/engines/mads/madsv2/forest/mads/inventory.h
+++ b/engines/mads/madsv2/forest/mads/inventory.h
@@ -30,8 +30,10 @@ namespace Forest {
 
 enum {
 	cogs           =  0,
+	rubber_band    =  1,
 	feather        =  2,
 	pebbles        =  5,
+	reeds          =  6,
 	sticks         =  7,
 	twine          =  8,
 	vine_weed      =  9,
diff --git a/engines/mads/madsv2/forest/rooms/room302.cpp b/engines/mads/madsv2/forest/rooms/room302.cpp
index 1b461c46dc2..b7bfd164bdf 100644
--- a/engines/mads/madsv2/forest/rooms/room302.cpp
+++ b/engines/mads/madsv2/forest/rooms/room302.cpp
@@ -165,7 +165,7 @@ static void room_302_init() {
 	global[perform_displacements] = 240;
 	global[player_score] = -1;
 
-	if (object_is_here(1)) {
+	if (object_is_here(rubber_band)) {
 		ss[0] = kernel_load_series(kernel_name('P', 3), 0);
 		seq[0] = kernel_seq_stamp(ss[0], false, KERNEL_FIRST);
 		kernel_seq_depth(seq[0], 9);
@@ -753,7 +753,7 @@ static void room_302_daemon() {
 			kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 			global[g133] = 0;
 			kernel_flip_hotspot(words_rubber_band, false);
-			inter_move_object(1, PLAYER);
+			inter_move_object(rubber_band, PLAYER);
 			global[player_score] = -1;
 			player.commands_allowed = true;
 		}
diff --git a/engines/mads/madsv2/forest/rooms/room303.cpp b/engines/mads/madsv2/forest/rooms/room303.cpp
index c70222f6567..e47599c33eb 100644
--- a/engines/mads/madsv2/forest/rooms/room303.cpp
+++ b/engines/mads/madsv2/forest/rooms/room303.cpp
@@ -631,7 +631,7 @@ static void room_303_daemon() {
 			kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 			global[g133] = 0;
 			kernel_flip_hotspot(words_reeds, false);
-			inter_move_object(6, PLAYER);
+			inter_move_object(reeds, PLAYER);
 			player.commands_allowed = true;
 		} else if (scratch._a6 == 2) {
 			dont_frag_the_palette();


Commit: fea5c0a41fc9b92ee781336d5c4e67c5b93a7a1a
    https://github.com/scummvm/scummvm/commit/fea5c0a41fc9b92ee781336d5c4e67c5b93a7a1a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-28T08:12:15+10:00

Commit Message:
MADS: FOREST: Fixes to meeting bird leader

Changed paths:
    engines/mads/madsv2/forest/rooms/room305.cpp


diff --git a/engines/mads/madsv2/forest/rooms/room305.cpp b/engines/mads/madsv2/forest/rooms/room305.cpp
index b49b03de1e5..1ee6d8cb37a 100644
--- a/engines/mads/madsv2/forest/rooms/room305.cpp
+++ b/engines/mads/madsv2/forest/rooms/room305.cpp
@@ -272,14 +272,13 @@ static void room_305_anim2() {
 		}
 	}
 
-	if (kernel.trigger != 7 && kernel.trigger != 28)
-		return;
-
-	if (scratch._a4 == 1) {
-		global[g154] = 0;
-		aainfo[1]._frame = 67;
-		kernel_reset_animation(aa[1], 67);
-		scratch._a4 = 2;
+	if (kernel.trigger == 7 || kernel.trigger == 28) {
+		if (scratch._a4 == 1) {
+			global[g154] = 0;
+			aainfo[1]._frame = 67;
+			kernel_reset_animation(aa[1], 67);
+			scratch._a4 = 2;
+		}
 	}
 }
 
@@ -359,48 +358,47 @@ static void room_305_anim5() {
 		}
 	}
 
-	if (kernel.trigger != 7 && kernel.trigger != 28)
-		return;
-
-	switch (scratch._a4) {
-	case 29:
-		kernel_timing_trigger(30, 28);
-		aainfo[4]._val3 = 11;
-		scratch._a4 = 30;
-		break;
-	case 30:
-		aainfo[4]._val3 = 12;
-		aainfo[4]._frame = 29;
-		kernel_reset_animation(aa[4], 29);
-		digi_play_build_ii('e', 10, 1);
-		scratch._a4 = 31;
-		break;
-	case 31:
-		aainfo[4]._val3 = 13;
-		aainfo[4]._frame = 35;
-		kernel_reset_animation(aa[4], 35);
-		scratch._a4 = -1;
-		break;
-	case 500:
-		kernel_timing_trigger(30, 28);
-		aainfo[4]._val3 = 11;
-		scratch._a4 = 501;
-		break;
-	case 501:
-		aainfo[4]._val3 = 12;
-		aainfo[4]._frame = 5;
-		kernel_reset_animation(aa[4], 5);
-		digi_play_build_ii('e', 10, 1);
-		scratch._a4 = 502;
-		break;
-	case 502:
-		aainfo[4]._val3 = 13;
-		aainfo[4]._frame = 11;
-		kernel_reset_animation(aa[4], 11);
-		scratch._a4 = -1;
-		break;
-	default:
-		break;
+	if (kernel.trigger == 7 || kernel.trigger == 28) {
+		switch (scratch._a4) {
+		case 29:
+			kernel_timing_trigger(30, 28);
+			aainfo[4]._val3 = 11;
+			scratch._a4 = 30;
+			break;
+		case 30:
+			aainfo[4]._val3 = 12;
+			aainfo[4]._frame = 29;
+			kernel_reset_animation(aa[4], 29);
+			digi_play_build_ii('e', 10, 1);
+			scratch._a4 = 31;
+			break;
+		case 31:
+			aainfo[4]._val3 = 13;
+			aainfo[4]._frame = 35;
+			kernel_reset_animation(aa[4], 35);
+			scratch._a4 = -1;
+			break;
+		case 500:
+			kernel_timing_trigger(30, 28);
+			aainfo[4]._val3 = 11;
+			scratch._a4 = 501;
+			break;
+		case 501:
+			aainfo[4]._val3 = 12;
+			aainfo[4]._frame = 5;
+			kernel_reset_animation(aa[4], 5);
+			digi_play_build_ii('e', 10, 1);
+			scratch._a4 = 502;
+			break;
+		case 502:
+			aainfo[4]._val3 = 13;
+			aainfo[4]._frame = 11;
+			kernel_reset_animation(aa[4], 11);
+			scratch._a4 = -1;
+			break;
+		default:
+			break;
+		}
 	}
 }
 
@@ -461,64 +459,63 @@ static void room_305_anim6() {
 		}
 	}
 
-	if (kernel.trigger != 7 && kernel.trigger != 105)
-		return;
-
-	switch (scratch._a4) {
-	case 10:
-		aainfo[5]._val3 = 0;
-		break;
-	case 12:
-		aainfo[5]._val3 = 6;
-		kernel_timing_trigger(90, 105);
-		scratch._a4++;
-		break;
-	case 13:
-		aainfo[5]._val3 = 5;
-		digi_play_build(305, 'h', 2, 1);
-		scratch._a4++;
-		break;
-	case 14:
-		aainfo[5]._val3 = 0;
-		kernel_timing_trigger(45, 105);
-		scratch._a4++;
-		global[g009] = -1;
-		global_midi_play(6);
-		break;
-	case 15:
-		if (global[g065] != 0) {
-			aainfo[5]._val3 = 4;
-			digi_play_build(305, 'b', 3, 1);
-		} else {
-			aainfo[5]._val3 = 11;
-			digi_play_build(305, 'e', 3, 1);
-		}
-		scratch._a4++;
-		break;
-	case 16:
-		aainfo[5]._val3 = 0;
-		kernel_timing_trigger(45, 105);
-		scratch._a4++;
-		break;
-	case 17:
-		if (global[g065] != 0) {
-			aainfo[5]._val3 = 11;
-			digi_play_build(305, 'e', 4, 1);
-		} else {
-			aainfo[5]._val3 = 4;
-			digi_play_build(305, 'b', 4, 1);
+	if (kernel.trigger == 7 || kernel.trigger == 105) {
+		switch (scratch._a4) {
+		case 10:
+			aainfo[5]._val3 = 0;
+			break;
+		case 12:
+			aainfo[5]._val3 = 6;
+			kernel_timing_trigger(90, 105);
+			scratch._a4++;
+			break;
+		case 13:
+			aainfo[5]._val3 = 5;
+			digi_play_build(305, 'h', 2, 1);
+			scratch._a4++;
+			break;
+		case 14:
+			aainfo[5]._val3 = 0;
+			kernel_timing_trigger(45, 105);
+			scratch._a4++;
+			global[g009] = -1;
+			global_midi_play(6);
+			break;
+		case 15:
+			if (global[g065] != 0) {
+				aainfo[5]._val3 = 4;
+				digi_play_build(305, 'b', 3, 1);
+			} else {
+				aainfo[5]._val3 = 11;
+				digi_play_build(305, 'e', 3, 1);
+			}
+			scratch._a4++;
+			break;
+		case 16:
+			aainfo[5]._val3 = 0;
+			kernel_timing_trigger(45, 105);
+			scratch._a4++;
+			break;
+		case 17:
+			if (global[g065] != 0) {
+				aainfo[5]._val3 = 11;
+				digi_play_build(305, 'e', 4, 1);
+			} else {
+				aainfo[5]._val3 = 4;
+				digi_play_build(305, 'b', 4, 1);
+			}
+			scratch._a4++;
+			break;
+		case 18:
+			kernel_abort_animation(aa[5]);
+			aainfo[5]._active = 0;
+			aa[6] = kernel_run_animation(kernel_name('h', 3), 0);
+			aainfo[6]._active = -1;
+			kernel_timing_trigger(1, 109);
+			break;
+		default:
+			break;
 		}
-		scratch._a4++;
-		break;
-	case 18:
-		kernel_abort_animation(aa[5]);
-		aainfo[5]._active = 0;
-		aa[6] = kernel_run_animation(kernel_name('h', 3), 0);
-		aainfo[6]._active = -1;
-		kernel_timing_trigger(1, 109);
-		break;
-	default:
-		break;
 	}
 }
 
@@ -584,10 +581,7 @@ static void room_305_anim7() {
 }
 
 static void room_305_anim8() {
-	if (kernel_anim[aa[7]].frame == aainfo[7]._frame) {
-		if (kernel.trigger != 7 && kernel.trigger != 105)
-			return;
-	} else {
+	if (kernel_anim[aa[7]].frame != aainfo[7]._frame) {
 		int16 f = kernel_anim[aa[7]].frame;
 		aainfo[7]._frame = f;
 		int16 result = -1;
@@ -630,71 +624,69 @@ static void room_305_anim8() {
 		}
 	}
 
-	if (kernel.trigger != 7 && kernel.trigger != 105)
-		return;
-
-	switch (scratch._a4) {
-	case 40:
-	case 44:
-	case 48:
-	case 50:
-		aainfo[7]._val3 = 0;
-		kernel_timing_trigger(45, 105);
-		scratch._a4++;
-		break;
-	case 41:
-		if (global[g080] != 0) {
-			aainfo[7]._val3 = 5;
-			digi_play_build(305, 'h', 5, 1);
-		} else {
-			aainfo[7]._val3 = 13;
-		}
-		scratch._a4++;
-		break;
-	case 42:
-	case 46:
-		if (global[g080] != 0) {
+	if (kernel.trigger == 7 || kernel.trigger == 105) {
+		switch (scratch._a4) {
+		case 40:
+		case 44:
+		case 48:
+		case 50:
 			aainfo[7]._val3 = 0;
-			kernel_timing_trigger(90, 105);
-		} else {
-			aainfo[7]._val3 = 14;
-			kernel_timing_trigger(90, 105);
-		}
-		scratch._a4++;
-		break;
-	case 43:
-		if (global[g080] != 0) {
-			aainfo[7]._val3 = 12;
-			digi_play_build(305, 'r', 1, 1);
-		} else {
-			aainfo[7]._val3 = 11;
-			digi_play_build(305, 'e', 5, 1);
+			kernel_timing_trigger(45, 105);
+			scratch._a4++;
+			break;
+		case 41:
+			if (global[g080] != 0) {
+				aainfo[7]._val3 = 5;
+				digi_play_build(305, 'h', 5, 1);
+			} else {
+				aainfo[7]._val3 = 13;
+			}
+			scratch._a4++;
+			break;
+		case 42:
+		case 46:
+			if (global[g080] != 0) {
+				aainfo[7]._val3 = 0;
+				kernel_timing_trigger(90, 105);
+			} else {
+				aainfo[7]._val3 = 14;
+				kernel_timing_trigger(90, 105);
+			}
+			scratch._a4++;
+			break;
+		case 43:
+			if (global[g080] != 0) {
+				aainfo[7]._val3 = 12;
+				digi_play_build(305, 'r', 1, 1);
+			} else {
+				aainfo[7]._val3 = 11;
+				digi_play_build(305, 'e', 5, 1);
+			}
+			scratch._a4++;
+			break;
+		case 45:
+			aainfo[7]._val3 = 13;
+			scratch._a4++;
+			break;
+		case 47:
+			aainfo[7]._val3 = 4;
+			digi_play_build(305, 'b', 7, 1);
+			scratch._a4++;
+			break;
+		case 49:
+			aainfo[7]._val3 = 5;
+			digi_play_build(305, 'h', 8, 1);
+			scratch._a4++;
+			break;
+		case 51:
+			kernel_abort_animation(aa[7]);
+			aainfo[7]._active = 0;
+			aa[7] = kernel_run_animation(kernel_name('h', 6), 107);
+			kernel_timing_trigger(1, 109);
+			break;
+		default:
+			break;
 		}
-		scratch._a4++;
-		break;
-	case 45:
-		aainfo[7]._val3 = 13;
-		scratch._a4++;
-		break;
-	case 47:
-		aainfo[7]._val3 = 4;
-		digi_play_build(305, 'b', 7, 1);
-		scratch._a4++;
-		break;
-	case 49:
-		aainfo[7]._val3 = 5;
-		digi_play_build(305, 'h', 8, 1);
-		scratch._a4++;
-		break;
-	case 51:
-		kernel_abort_animation(aa[7]);
-		aainfo[7]._active = 0;
-		aa[7] = kernel_run_animation(kernel_name('h', 6), 107);
-		aainfo[7]._active = -1;
-		kernel_timing_trigger(1, 109);
-		break;
-	default:
-		break;
 	}
 }
 
@@ -933,11 +925,14 @@ static void room_305_daemon() {
 			kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 			global[g133] = 0;
 			kernel_flip_hotspot(words_sticks, false);
-			if (!player_has(7))
-				inter_move_object(7, PLAYER);
+
+			if (!player_has(sticks))
+				inter_move_object(sticks, PLAYER);
+
 			global[g069] = -1;
 			global[player_score] = -1;
 			player.commands_allowed = true;
+
 			if (config_file.forest1 != 0)
 				kernel_timing_trigger(1, 109);
 		}




More information about the Scummvm-git-logs mailing list