[Scummvm-git-logs] scummvm master -> 021e2a5ba01a32a231c5908b58ae6ff0700d86b5

dreammaster noreply at scummvm.org
Sat Jun 27 11:08:03 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:
0d80713c56 MADS: FOREST: Fix picking up vine weed
0236dd03ae MADS: FOREST: Implement missing room 221
fe153d1efe MADS: FOREST: Adding inventory items, room 301 janitorial
021e2a5ba0 MADS: FOREST: Fix first arrival at meadow room 301


Commit: 0d80713c564fe8e7c23dd1bd848da1f5600f208e
    https://github.com/scummvm/scummvm/commit/0d80713c564fe8e7c23dd1bd848da1f5600f208e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-27T21:07:47+10:00

Commit Message:
MADS: FOREST: Fix picking up vine weed

Changed paths:
    engines/mads/madsv2/forest/mads/inventory.h
    engines/mads/madsv2/forest/rooms/room204.cpp


diff --git a/engines/mads/madsv2/forest/mads/inventory.h b/engines/mads/madsv2/forest/mads/inventory.h
index cb8c23255d6..90578ac13fa 100644
--- a/engines/mads/madsv2/forest/mads/inventory.h
+++ b/engines/mads/madsv2/forest/mads/inventory.h
@@ -33,6 +33,7 @@ enum {
 	pebbles        =  5,
 	sticks         =  7,
 	twine          =  8,
+	vine_weed      =  9,
 	planks         = 11,
 	elm_leaves     = 12
 };
diff --git a/engines/mads/madsv2/forest/rooms/room204.cpp b/engines/mads/madsv2/forest/rooms/room204.cpp
index 4656a5715ea..bc0a92e2a9a 100644
--- a/engines/mads/madsv2/forest/rooms/room204.cpp
+++ b/engines/mads/madsv2/forest/rooms/room204.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "mads/madsv2/forest/rooms/section2.h"
+#include "mads/madsv2/forest/mads/inventory.h"
 #include "mads/madsv2/forest/mads/words.h"
 #include "mads/madsv2/forest/digi.h"
 #include "mads/madsv2/forest/extra.h"
@@ -65,16 +66,16 @@ static Scratch scratch;
 #define ss     local->sprite
 #define seq    local->sequence
 #define aa     local->animation
-#define aainfo scratch.animation_info
+#define aainfo local->animation_info
 
 
 static void room_204_init1() {
 	global[g131] = 0;
 	global[g141] = 0;
-	scratch._9c = kernel_run_animation_disp('r', 2, 0);
-	kernel_position_anim(scratch._9c, 171, 116, 73, 8);
-	scratch._9a = kernel_run_animation_disp('e', 3, 0);
-	kernel_position_anim(scratch._9a, 148, 120, 76, 7);
+	local->_9c = kernel_run_animation_disp('r', 2, 0);
+	kernel_position_anim(local->_9c, 171, 116, 73, 8);
+	local->_9a = kernel_run_animation_disp('e', 3, 0);
+	kernel_position_anim(local->_9a, 148, 120, 76, 7);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 194;
@@ -85,39 +86,39 @@ static void room_204_init1() {
 	if (previous_room == KERNEL_RESTORING_GAME) {
 		global[g131] = -1;
 		global[g141] = -1;
-		kernel_reset_animation(scratch._9a, 2);
-		kernel_reset_animation(scratch._9c, 2);
+		kernel_reset_animation(local->_9a, 2);
+		kernel_reset_animation(local->_9c, 2);
 		global[g133] = 0;
 		global[g143] = 0;
 		return;
 	} else if (previous_room == 203) {
 		aa[0] = kernel_run_animation(kernel_name('y', 1), 100);
 		aainfo[0]._active = -1;
-		scratch._92 = 74;
+		local->_92 = 74;
 		return;
 	} else if (previous_room == 205) {
 		aa[0] = kernel_run_animation(kernel_name('y', 2), 100);
 		aainfo[0]._active = -1;
-		scratch._92 = 78;
+		local->_92 = 78;
 		return;
 	} else if (previous_room == 220) {
 		aa[0] = kernel_run_animation(kernel_name('y', 3), 100);
 		aainfo[0]._active = -1;
-		scratch._92 = 66;
+		local->_92 = 66;
 		return;
 	} else if (previous_room == 199) {
 		global[g131] = -1;
 		global[g141] = -1;
-		kernel_reset_animation(scratch._9a, 2);
-		kernel_reset_animation(scratch._9c, 2);
+		kernel_reset_animation(local->_9a, 2);
+		kernel_reset_animation(local->_9c, 2);
 		global[g133] = 0;
 		global[g143] = 0;
 		restore_player();
 	} else {
 		global[g131] = -1;
 		global[g141] = -1;
-		kernel_reset_animation(scratch._9a, 2);
-		kernel_reset_animation(scratch._9c, 2);
+		kernel_reset_animation(local->_9a, 2);
+		kernel_reset_animation(local->_9c, 2);
 		global[g133] = 0;
 		global[g143] = 0;
 	}
@@ -129,8 +130,8 @@ static void room_204_init1() {
 static void room_204_init() {
 	global[player_score] = -1;
 	midi_stop();
-	scratch._a8 = 0;
-	scratch._a6 = -1;
+	local->_a8 = 0;
+	local->_a6 = -1;
 
 	if (object_is_here(9)) {
 		ss[0] = kernel_load_series(kernel_name('p', 1), 0);
@@ -169,7 +170,7 @@ static void room_204_anim1() {
 		aainfo[0]._frame = kernel_anim[aa[0]].frame;
 
 	if (global[player_hyperwalked] == -1) {
-		aainfo[0]._frame = scratch._92 - 1;
+		aainfo[0]._frame = local->_92 - 1;
 		kernel_reset_animation(aa[0], aainfo[0]._frame);
 	}
 }
@@ -178,27 +179,27 @@ static void room_204_anim2() {
 	if (kernel_anim[aa[1]].frame != aainfo[1]._frame)
 		aainfo[1]._frame = kernel_anim[aa[1]].frame;
 
-	if (scratch._a4 == 0)
+	if (local->_a4 == 0)
 		return;
 
-	kernel_random_frame(scratch._a2, &global[g153], global[g156]);
-	kernel_random_frame(scratch._a0, &global[g152], global[g155]);
+	kernel_random_frame(local->_a2, &global[g153], global[g156]);
+	kernel_random_frame(local->_a0, &global[g152], global[g155]);
 
 	if (kernel.trigger != 7 && kernel.trigger != 28)
 		return;
 
-	if (scratch._a4 == 1) {
+	if (local->_a4 == 1) {
 		global[g155] = 0;
 		kernel_timing_trigger(10, 28);
-		scratch._a4 = 2;
-	} else if (scratch._a4 == 2) {
+		local->_a4 = 2;
+	} else if (local->_a4 == 2) {
 		global[g156] = 2;
-		scratch._a4 = 3;
+		local->_a4 = 3;
 		digi_play_build(204, 'e', 1, 1);
-	} else if (scratch._a4 == 3) {
-		scratch._a4 = 4;
-		kernel_abort_animation(scratch._a2);
-		kernel_abort_animation(scratch._a0);
+	} else if (local->_a4 == 3) {
+		local->_a4 = 4;
+		kernel_abort_animation(local->_a2);
+		kernel_abort_animation(local->_a0);
 		player.commands_allowed = true;
 		player.walker_visible = true;
 		global[g017] = -1;
@@ -206,10 +207,10 @@ static void room_204_anim2() {
 		kernel_synch(2, 0, 4, 0);
 		global[g131] = -1;
 		global[g141] = -1;
-		kernel_reset_animation(scratch._9a, 1);
-		kernel_reset_animation(scratch._9c, 1);
-		kernel_synch(3, scratch._9a, 4, 0);
-		kernel_synch(3, scratch._9c, 4, 0);
+		kernel_reset_animation(local->_9a, 1);
+		kernel_reset_animation(local->_9c, 1);
+		kernel_synch(3, local->_9a, 4, 0);
+		kernel_synch(3, local->_9c, 4, 0);
 		global[g133] = 0;
 		global[g143] = 0;
 	}
@@ -230,7 +231,7 @@ static void room_204_anim5() {
 		aainfo[4]._frame = kernel_anim[aa[4]].frame;
 		int16 ax = aainfo[4]._frame;
 
-		if (scratch._a6 == 1) {
+		if (local->_a6 == 1) {
 			if (ax == 51) {
 				if (aainfo[4]._val3 == 13) {
 					aainfo[4]._frame = 49;
@@ -240,7 +241,7 @@ static void room_204_anim5() {
 				if (ax == 43) {
 					aainfo[4]._val3 = 11;
 					digi_play_build_ii('e', 4, 1);
-					scratch._a4 = 43;
+					local->_a4 = 43;
 				} else if (ax == 48) {
 					if (aainfo[4]._val3 == 11) {
 						aainfo[4]._frame = 43;
@@ -248,7 +249,7 @@ static void room_204_anim5() {
 					}
 				}
 			}
-		} else if (scratch._a6 == 2) {
+		} else if (local->_a6 == 2) {
 			if (ax == 13) {
 				if (aainfo[4]._val3 == 13) {
 					aainfo[4]._frame = 11;
@@ -258,7 +259,7 @@ static void room_204_anim5() {
 				if (ax == 5) {
 					aainfo[4]._val3 = 11;
 					digi_play_build_ii('e', 9, 1);
-					scratch._a4 = 500;
+					local->_a4 = 500;
 				} else if (ax == 10) {
 					if (aainfo[4]._val3 == 11) {
 						aainfo[4]._frame = 5;
@@ -272,36 +273,36 @@ static void room_204_anim5() {
 	if (kernel.trigger != 7 && kernel.trigger != 28)
 		return;
 
-	if (scratch._a4 == 43) {
+	if (local->_a4 == 43) {
 		kernel_timing_trigger(30, 28);
 		aainfo[4]._val3 = 13;
-		scratch._a4 = 44;
-	} else if (scratch._a4 == 44) {
+		local->_a4 = 44;
+	} else if (local->_a4 == 44) {
 		aainfo[4]._val3 = 11;
 		aainfo[4]._frame = 43;
 		kernel_reset_animation(aa[4], 43);
 		digi_play_build_ii('e', 10, 1);
-		scratch._a4 = 45;
-	} else if (scratch._a4 == 45) {
+		local->_a4 = 45;
+	} else if (local->_a4 == 45) {
 		aainfo[4]._val3 = 14;
 		aainfo[4]._frame = 50;
 		kernel_reset_animation(aa[4], 50);
-		scratch._a4 = -1;
-	} else if (scratch._a4 == 500) {
+		local->_a4 = -1;
+	} else if (local->_a4 == 500) {
 		kernel_timing_trigger(30, 28);
 		aainfo[4]._val3 = 13;
-		scratch._a4 = 501;
-	} else if (scratch._a4 == 501) {
+		local->_a4 = 501;
+	} else if (local->_a4 == 501) {
 		aainfo[4]._val3 = 11;
 		aainfo[4]._frame = 5;
 		kernel_reset_animation(aa[4], 5);
 		digi_play_build_ii('e', 10, 1);
-		scratch._a4 = 502;
-	} else if (scratch._a4 == 502) {
+		local->_a4 = 502;
+	} else if (local->_a4 == 502) {
 		aainfo[4]._val3 = 14;
 		aainfo[4]._frame = 11;
 		kernel_reset_animation(aa[4], 11);
-		scratch._a4 = -1;
+		local->_a4 = -1;
 	}
 }
 
@@ -310,17 +311,17 @@ static void room_204_anim6() {
 		aainfo[5]._frame = kernel_anim[aa[5]].frame;
 		int16 ax = aainfo[5]._frame;
 
-		if (scratch._a6 == 3) {
+		if (local->_a6 == 3) {
 			if (ax == 64) {
 				if (aainfo[5]._val3 == 13) {
 					digi_play_build(101, '_', 1, 2);
-					scratch._a4 = 64;
+					local->_a4 = 64;
 				}
 			} else if (ax < 64) {
 				if (ax == 5) {
 					aainfo[5]._val3 = 11;
 					digi_play_build(204, 'e', 2, 1);
-					scratch._a4 = 5;
+					local->_a4 = 5;
 				} else if (ax == 10) {
 					if (aainfo[5]._val3 == 11) {
 						aainfo[5]._frame = 5;
@@ -332,18 +333,18 @@ static void room_204_anim6() {
 	}
 
 	if (kernel.trigger == 7 || kernel.trigger == 28) {
-		if (scratch._a4 == 5) {
+		if (local->_a4 == 5) {
 			aainfo[5]._val3 = 13;
 			aainfo[5]._frame = 11;
 			kernel_reset_animation(aa[5], 11);
-			scratch._a4 = -1;
+			local->_a4 = -1;
 			kernel_seq_delete(seq[0]);
 		}
 	}
 
 	if (kernel.trigger == 8 || kernel.trigger == 28) {
-		if (scratch._a4 == 64)
-			scratch._a4 = -1;
+		if (local->_a4 == 64)
+			local->_a4 = -1;
 	}
 }
 
@@ -364,19 +365,19 @@ static void room_204_daemon() {
 			goto trigger_100;
 		} else if (trigger == 101) {
 			// abort _94 slot anim, re-enable
-			kernel_abort_animation(aa[scratch._94]);
-			aainfo[scratch._94]._active = 0;
-			kernel_reset_animation(scratch._9c, 1);
-			kernel_synch(3, scratch._9c, 4, 0);
+			kernel_abort_animation(aa[local->_94]);
+			aainfo[local->_94]._active = 0;
+			kernel_reset_animation(local->_9c, 1);
+			kernel_synch(3, local->_9c, 4, 0);
 			global[g143] = 0;
 			player.commands_allowed = true;
 			goto bottom;
 		} else if (trigger == 102) {
 			// abort _96 slot anim, re-enable
-			kernel_abort_animation(aa[scratch._96]);
-			aainfo[scratch._96]._active = 0;
-			kernel_reset_animation(scratch._9a, 1);
-			kernel_synch(3, scratch._9a, 4, 0);
+			kernel_abort_animation(aa[local->_96]);
+			aainfo[local->_96]._active = 0;
+			kernel_reset_animation(local->_9a, 1);
+			kernel_synch(3, local->_9a, 4, 0);
 			global[g133] = 0;
 			player.commands_allowed = true;
 			goto bottom;
@@ -400,67 +401,67 @@ trigger_7:
 		player.commands_allowed = true;
 		goto bottom;
 	}
-	if (scratch._a4 != 400)
+	if (local->_a4 != 400)
 		goto bottom;
-	kernel_abort_animation(scratch._9e);
-	scratch._a4 = -1;
-	scratch._a8 = 0;
+	kernel_abort_animation(local->_9e);
+	local->_a4 = -1;
+	local->_a8 = 0;
 	kernel_synch(2, 0, 4, 0);
-	scratch._a6 = 3;
+	local->_a6 = 3;
 	player.walker_visible = true;
 	global[g150] = -1;
-	scratch._90 = 6;
+	local->_90 = 6;
 	goto bottom;
 
 trigger_24:
-	if (scratch._8c == 3) {
+	if (local->_8c == 3) {
 		aa[2] = kernel_run_animation(kernel_name('E', 1), 102);
 		aainfo[2]._active = -1;
-		scratch._96 = 2;
-		kernel_reset_animation(scratch._9a, 0);
-		kernel_synch(3, aa[2], 3, scratch._9a);
+		local->_96 = 2;
+		kernel_reset_animation(local->_9a, 0);
+		kernel_synch(3, aa[2], 3, local->_9a);
 		global[g133] = 1;
-	} else if (scratch._8c == 5) {
-		if (scratch._a6 == 1) {
+	} else if (local->_8c == 5) {
+		if (local->_a6 == 1) {
 			aa[4] = kernel_run_animation(kernel_name('F', 1), 102);
-		} else if (scratch._a6 == 2) {
+		} else if (local->_a6 == 2) {
 			aa[4] = kernel_run_animation(kernel_name('F', 2), 102);
 		} else {
 			goto bottom;
 		}
 		aainfo[4]._active = -1;
-		scratch._96 = 4;
-		kernel_reset_animation(scratch._9a, 0);
-		kernel_synch(3, aa[4], 3, scratch._9a);
+		local->_96 = 4;
+		kernel_reset_animation(local->_9a, 0);
+		kernel_synch(3, aa[4], 3, local->_9a);
 		global[g133] = 1;
 	}
 	goto bottom;
 
 trigger_25:
-	if (scratch._8e == 2) {
+	if (local->_8e == 2) {
 		aa[3] = kernel_run_animation(kernel_name('R', 1), 101);
 		aainfo[3]._active = -1;
-		scratch._94 = 3;
-		kernel_reset_animation(scratch._9c, 0);
-		kernel_synch(3, aa[3], 3, scratch._9c);
+		local->_94 = 3;
+		kernel_reset_animation(local->_9c, 0);
+		kernel_synch(3, aa[3], 3, local->_9c);
 		global[g143] = 1;
 	}
 	goto bottom;
 
 trigger_26:
-	if (scratch._90 == 1) {
-		kernel_reset_animation(scratch._9a, 0);
-		kernel_reset_animation(scratch._9c, 0);
+	if (local->_90 == 1) {
+		kernel_reset_animation(local->_9a, 0);
+		kernel_reset_animation(local->_9c, 0);
 		global[g133] = 1;
 		global[g143] = 1;
-	} else if (scratch._90 == 6) {
-		if (scratch._a6 != 3)
+	} else if (local->_90 == 6) {
+		if (local->_a6 != 3)
 			goto bottom;
 		aa[5] = kernel_run_animation(kernel_name('P', 1), 103);
 		aainfo[5]._active = -1;
-		scratch._98 = 5;
-		kernel_reset_animation(scratch._9a, 0);
-		kernel_reset_animation(scratch._9c, 0);
+		local->_98 = 5;
+		kernel_reset_animation(local->_9a, 0);
+		kernel_reset_animation(local->_9c, 0);
 		kernel_synch(3, aa[5], 4, 0);
 		global[g133] = 1;
 		global[g143] = 1;
@@ -474,34 +475,34 @@ trigger_100:
 		kernel_synch(2, 0, 4, 0);
 		global[g017] = 0;
 		global[g154] = 0;
-		kernel_synch(3, scratch._9a, 4, 0);
+		kernel_synch(3, local->_9a, 4, 0);
 		global[g131] = -1;
 		global[g133] = 1;
 		global[g156] = 0;
-		kernel_synch(3, scratch._9c, 4, 0);
+		kernel_synch(3, local->_9c, 4, 0);
 		global[g143] = 1;
-		scratch._a4 = 1;
+		local->_a4 = 1;
 		global[g141] = -1;
 		player.walker_visible = true;
 		aainfo[1]._active = -1;
 		global[g155] = 2;
-		scratch._a0 = kernel_run_animation_talk('r', 2, 0);
-		kernel_position_anim(scratch._a0, 171, 116, 73, 8);
-		scratch._a2 = kernel_run_animation_talk('e', 3, 0);
-		kernel_position_anim(scratch._a2, 148, 120, 76, 7);
-		kernel_synch(3, scratch._a2, 3, scratch._9a);
-		kernel_synch(3, scratch._a0, 3, scratch._9c);
-		kernel_synch(3, scratch._9e, 2, 0);
+		local->_a0 = kernel_run_animation_talk('r', 2, 0);
+		kernel_position_anim(local->_a0, 171, 116, 73, 8);
+		local->_a2 = kernel_run_animation_talk('e', 3, 0);
+		kernel_position_anim(local->_a2, 148, 120, 76, 7);
+		kernel_synch(3, local->_a2, 3, local->_9a);
+		kernel_synch(3, local->_a0, 3, local->_9c);
+		kernel_synch(3, local->_9e, 2, 0);
 		digi_play_build(204, 114, 1, 1);
 	} else {
 		global[g131] = -1;
 		global[g141] = -1;
-		kernel_reset_animation(scratch._9a, 1);
-		kernel_reset_animation(scratch._9c, 1);
+		kernel_reset_animation(local->_9a, 1);
+		kernel_reset_animation(local->_9c, 1);
 		global[g133] = 0;
 		global[g143] = 0;
-		kernel_synch(3, scratch._9a, 4, 0);
-		kernel_synch(3, scratch._9c, 4, 0);
+		kernel_synch(3, local->_9a, 4, 0);
+		kernel_synch(3, local->_9c, 4, 0);
 		player.walker_visible = true;
 		kernel_synch(2, 0, 4, 0);
 		player.commands_allowed = true;
@@ -509,27 +510,27 @@ trigger_100:
 	goto bottom;
 
 trigger_103:
-	if (scratch._a6 != 3)
+	if (local->_a6 != 3)
 		goto bottom;
 	kernel_abort_animation(aa[5]);
 	aainfo[5]._active = 0;
-	kernel_reset_animation(scratch._9c, 1);
-	kernel_synch(3, scratch._9c, 4, 0);
+	kernel_reset_animation(local->_9c, 1);
+	kernel_synch(3, local->_9c, 4, 0);
 	global[g143] = 0;
-	kernel_reset_animation(scratch._9a, 1);
-	kernel_synch(3, scratch._9a, 4, 0);
+	kernel_reset_animation(local->_9a, 1);
+	kernel_synch(3, local->_9a, 4, 0);
 	global[g133] = 0;
 	kernel_flip_hotspot(words_vine_weed, true);
-	inter_move_object(9, PLAYER);
+	inter_move_object(vine_weed, PLAYER);
 	global[player_score] = -1;
 	player.commands_allowed = true;
 
 bottom:
-	global_anim1(3, scratch._9a, global[g131], &global[g132]);
-	global_anim2(2, scratch._9c, global[g141], &global[g142]);
+	global_anim1(3, local->_9a, global[g131], &global[g132]);
+	global_anim2(2, local->_9c, global[g141], &global[g142]);
 
-	if (scratch._a8 != 0)
-		kernel_random_frame(scratch._9e, &global[g151], global[g154]);
+	if (local->_a8 != 0)
+		kernel_random_frame(local->_9e, &global[g151], global[g154]);
 
 	if (aainfo[0]._active != 0) room_204_anim1();
 	if (aainfo[1]._active != 0) room_204_anim2();
@@ -576,9 +577,14 @@ static void room_204_parser() {
 
 	if (player_parse(words_pick_up, words_vine_weed, 0)) {
 		global[g154] = 2;
-		player.commands_allowed = false;
-		kernel_run_animation_talk('b', 9, 0);
+		player.commands_allowed = 0;
+		player.walker_visible = 0;
+		local->_9e = kernel_run_animation_talk('b', 9, 0);
 		kernel_position_anim(local->_9e, player.x, player.y, player.scale, player.depth);
+		kernel_synch(3, local->_9e, 2, 0);
+		digi_play_build_ii('b', 1, 1);
+		local->_a4 = 400;
+		local->_a8 = -1;
 		goto handled;
 	}
 
@@ -597,25 +603,25 @@ done:
 }
 
 void room_204_synchronize(Common::Serializer &s) {
-	for (int16 &v : scratch.sprite)    s.syncAsSint16LE(v);
-	for (int16 &v : scratch.sequence)  s.syncAsSint16LE(v);
-	for (int16 &v : scratch.animation) s.syncAsSint16LE(v);
-	for (AnimationInfo &ai : scratch.animation_info) ai.synchronize(s);
-	s.syncAsSint16LE(scratch._8c);
-	s.syncAsSint16LE(scratch._8e);
-	s.syncAsSint16LE(scratch._90);
-	s.syncAsSint16LE(scratch._92);
-	s.syncAsSint16LE(scratch._94);
-	s.syncAsSint16LE(scratch._96);
-	s.syncAsSint16LE(scratch._98);
-	s.syncAsSint16LE(scratch._9a);
-	s.syncAsSint16LE(scratch._9c);
-	s.syncAsSint16LE(scratch._9e);
-	s.syncAsSint16LE(scratch._a0);
-	s.syncAsSint16LE(scratch._a2);
-	s.syncAsSint16LE(scratch._a4);
-	s.syncAsSint16LE(scratch._a6);
-	s.syncAsSint16LE(scratch._a8);
+	for (int16 &v : local->sprite)    s.syncAsSint16LE(v);
+	for (int16 &v : local->sequence)  s.syncAsSint16LE(v);
+	for (int16 &v : local->animation) s.syncAsSint16LE(v);
+	for (AnimationInfo &ai : local->animation_info) ai.synchronize(s);
+	s.syncAsSint16LE(local->_8c);
+	s.syncAsSint16LE(local->_8e);
+	s.syncAsSint16LE(local->_90);
+	s.syncAsSint16LE(local->_92);
+	s.syncAsSint16LE(local->_94);
+	s.syncAsSint16LE(local->_96);
+	s.syncAsSint16LE(local->_98);
+	s.syncAsSint16LE(local->_9a);
+	s.syncAsSint16LE(local->_9c);
+	s.syncAsSint16LE(local->_9e);
+	s.syncAsSint16LE(local->_a0);
+	s.syncAsSint16LE(local->_a2);
+	s.syncAsSint16LE(local->_a4);
+	s.syncAsSint16LE(local->_a6);
+	s.syncAsSint16LE(local->_a8);
 }
 
 void room_204_preload() {


Commit: 0236dd03aecca24248cad2b4a76a4412378753a2
    https://github.com/scummvm/scummvm/commit/0236dd03aecca24248cad2b4a76a4412378753a2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-27T21:07:47+10:00

Commit Message:
MADS: FOREST: Implement missing room 221

Changed paths:
    engines/mads/madsv2/forest/mads/inventory.h
    engines/mads/madsv2/forest/rooms/room220.cpp
    engines/mads/madsv2/forest/rooms/room221.cpp


diff --git a/engines/mads/madsv2/forest/mads/inventory.h b/engines/mads/madsv2/forest/mads/inventory.h
index 90578ac13fa..b8a22793ea5 100644
--- a/engines/mads/madsv2/forest/mads/inventory.h
+++ b/engines/mads/madsv2/forest/mads/inventory.h
@@ -30,6 +30,7 @@ namespace Forest {
 
 enum {
 	cogs           =  0,
+	feather        =  2,
 	pebbles        =  5,
 	sticks         =  7,
 	twine          =  8,
diff --git a/engines/mads/madsv2/forest/rooms/room220.cpp b/engines/mads/madsv2/forest/rooms/room220.cpp
index 021582a20b0..28db41b86c6 100644
--- a/engines/mads/madsv2/forest/rooms/room220.cpp
+++ b/engines/mads/madsv2/forest/rooms/room220.cpp
@@ -146,27 +146,32 @@ static void room_220_anim2() {
 	aainfo[1]._frame = kernel_anim[aa[1]].frame;
 	int16 f = aainfo[1]._frame;
 
-	if (f == 55) {
+	switch (f) {
+	case 4:
+		digi_play_build(220, '_', 2, 2);
+		break;
+	case 9:
+		digi_play_build(103, '_', 3, 2);
+		break;
+	case 15:
+		digi_play_build(220, '_', 3, 2);
+		break;
+	case 28:
+		digi_play_build(220, '_', 1, 2);
+		break;
+	case 30:
+		digi_play_build(220, 'R', 2, 1);
+		scratch._9e = 2;
+		break;
+	case 46:
+	case 54:
+		digi_play_build(220, '_', 1, 2);
+		break;
+	case 55:
 		new_room = 221;
-	} else if (f < 55) {
-		if (f == 28) {
-			digi_play_build(220, '_', 1, 2);
-		} else if (f > 28) {
-			if (f == 30) {
-				digi_play_build(220, 'R', 1, 2);
-				scratch._9e = 2;
-			} else if (f == 46 || f == 54) {
-				digi_play_build(220, '_', 1, 2);
-			}
-		} else {
-			if (f == 4) {
-				digi_play_build(220, '_', 2, 2);
-			} else if (f == 9) {
-				digi_play_build(103, '_', 3, 2);
-			} else if (f == 15) {
-				digi_play_build(220, '_', 3, 2);
-			}
-		}
+		break;
+	default:
+		break;
 	}
 
 	if (result >= 0) {
diff --git a/engines/mads/madsv2/forest/rooms/room221.cpp b/engines/mads/madsv2/forest/rooms/room221.cpp
index 5fc64e79ff8..15c6ef4e92c 100644
--- a/engines/mads/madsv2/forest/rooms/room221.cpp
+++ b/engines/mads/madsv2/forest/rooms/room221.cpp
@@ -23,12 +23,17 @@
 #include "mads/madsv2/forest/mads/inventory.h"
 #include "mads/madsv2/forest/mads/sounds.h"
 #include "mads/madsv2/forest/mads/words.h"
+#include "mads/madsv2/forest/digi.h"
+#include "mads/madsv2/forest/extra.h"
 #include "mads/madsv2/forest/global.h"
+#include "mads/madsv2/forest/midi.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
 #include "mads/madsv2/core/inter.h"
 #include "mads/madsv2/core/kernel.h"
+#include "mads/madsv2/core/player.h"
 #include "mads/madsv2/core/sound.h"
+#include "mads/madsv2/core/sprite.h"
 #include "mads/madsv2/core/text.h"
 
 namespace MADS {
@@ -37,10 +42,21 @@ namespace Forest {
 namespace Rooms {
 
 struct Scratch {
-	int16 sprite[10];       /* Sprite series handles */
-	int16 sequence[10];     /* Sequence handles      */
-	int16 animation[10];     /* Animation handles     */
+	int16 sprite[10];
+	int16 sequence[10];
+	int16 animation[10];
 	AnimationInfo animation_info[10];
+	int16 _8c;
+	int16 _8e;
+	int16 _90;
+	int16 _92;
+	int16 _94;
+	int16 _96;
+	int16 _98;
+	int16 _9a;
+	int16 _9c;
+	int16 _9e;
+	int16 _a0;
 };
 
 static Scratch scratch;
@@ -51,28 +67,604 @@ static Scratch scratch;
 #define aa    local->animation
 #define aainfo scratch.animation_info
 
+static void room_221_init1();
 
 static void room_221_init() {
+	scratch._a0 = 0;
+	midi_stop();
+	global[player_score] = -1;
+
+	if (previous_room != KERNEL_RESTORING_GAME) {
+		if (previous_room != 199) {
+			player.walker_visible = 0;
+			player.commands_allowed = 0;
+		}
+
+		for (int16 count = 0; count < 10; count++) {
+			scratch.animation_info[count]._active = 0;
+			scratch.animation_info[count]._frame = -1;
+			scratch.animation_info[count]._val3 = 0;
+			scratch.animation_info[count]._val4 = 0;
+		}
+
+		if (previous_room != 199 && flags[14] != 3)
+			flags[14]++;
+	}
+
+	room_221_init1();
 }
 
-static void room_221_daemon() {
+static void room_221_init1() {
+	if (flags[14] == 1)
+		player.walker_visible = 0;
+
+	global[g131] = 0;
+	global[g141] = 0;
+
+	scratch._9c = kernel_run_animation_disp('r', 6, 0);
+	kernel_position_anim(scratch._9c, 122, 137, 100, 3);
+	scratch._9a = kernel_run_animation_disp('e', 4, 0);
+	kernel_position_anim(scratch._9a, 183, 135, 100, 3);
+
+	if (previous_room != KERNEL_RESTORING_GAME) {
+		player.x = 150;
+		player.y = 100;
+		player.facing = 2;
+	}
+
+	switch (previous_room) {
+	case KERNEL_RESTORING_GAME:
+		global[g131] = -1;
+		global[g141] = -1;
+		kernel_reset_animation(scratch._9a, 2);
+		kernel_reset_animation(scratch._9c, 2);
+		global[g133] = 0;
+		global[g143] = 0;
+		return;
+	case 199:
+		global[g131] = -1;
+		global[g141] = -1;
+		kernel_reset_animation(scratch._9a, 2);
+		kernel_reset_animation(scratch._9c, 2);
+		global[g133] = 0;
+		global[g143] = 0;
+		restore_player();
+		player.commands_allowed = -1;
+		return;
+	case 211:
+		aa[1] = kernel_run_animation(kernel_name('b', 1), 101);
+		aainfo[1]._active = -1;
+		aainfo[1]._val3 = 4;
+		scratch._92 = 3;
+		return;
+	case 220:
+		aa[0] = kernel_run_animation(kernel_name('y', 1), 100);
+		aainfo[0]._active = -1;
+		scratch._92 = 69;
+		return;
+	default:
+		global[g131] = -1;
+		global[g141] = -1;
+		kernel_reset_animation(scratch._9a, 2);
+		kernel_reset_animation(scratch._9c, 2);
+		global[g133] = 0;
+		global[g143] = 0;
+		player.commands_allowed = -1;
+		return;
+	}
 }
 
-static void room_221_pre_parser() {
+static void room_221_anim1() {
+	int16 result = -1;
+
+	if (global[player_hyperwalked] == -1 && aainfo[0]._frame < 43) {
+		aainfo[0]._frame = 43;
+		kernel_reset_animation(aa[0], 43);
+	}
+
+	if (kernel_anim[aa[0]].frame == aainfo[0]._frame)
+		return;
+
+	aainfo[0]._frame = kernel_anim[aa[0]].frame;
+
+	switch (aainfo[0]._frame) {
+	case 56:
+		digi_play_build(221, 'R', 1, 1);
+		scratch._9e = 1;
+		break;
+	case 60:
+		result = 56;
+		break;
+	case 62:
+		result = 61;
+		break;
+	case 63:
+		digi_play_build(221, 'E', 1, 1);
+		scratch._9e = 2;
+		break;
+	case 67:
+		result = 63;
+		break;
+	case 69:
+		result = 68;
+		break;
+	case 70:
+		digi_play_build(221, 'r', 2, 1);
+		scratch._9e = 5;
+		break;
+	case 74:
+		result = 70;
+		break;
+	default:
+		break;
+	}
+
+	if (result >= 0) {
+		aainfo[0]._frame = result;
+		kernel_reset_animation(aa[0], result);
+	}
+}
+
+static void room_221_anim2() {
+	int16 result = -1;
+
+	if (kernel_anim[aa[1]].frame == aainfo[1]._frame)
+		return;
+
+	aainfo[1]._frame = kernel_anim[aa[1]].frame;
+
+	if (aainfo[1]._val3 == 4) {
+		switch (aainfo[1]._frame) {
+		case 8:
+			digi_play_build(221, 'B', 2, 1);
+			scratch._9e = 12;
+			break;
+		case 24:
+			digi_play_build(103, '_', 3, 2);
+			break;
+		case 27:
+			result = 26;
+			break;
+		case 28:
+			digi_play_build(221, 'B', 10, 1);
+			inter_move_object(feather, PLAYER);
+			scratch._9e = 13;
+			break;
+		case 34:
+			result = 28;
+			break;
+		case 40:
+			digi_play_build(101, '_', 1, 2);
+			break;
+		default:
+			break;
+		}
+	} else if (aainfo[1]._val3 == 5) {
+		switch (aainfo[1]._frame) {
+		case 2:
+			digi_play_build(221, 'R', 3, 1);
+			scratch._9e = 14;
+			break;
+		case 6:
+			result = 2;
+			break;
+		case 8:
+			result = 7;
+			break;
+		case 9:
+			digi_play_build(221, 'B', 3, 1);
+			scratch._9e = 15;
+			global[g009] = 0;
+			global_midi_play(13);
+			break;
+		case 13:
+			result = 9;
+			break;
+		case 18:
+			result = 14;
+			break;
+		case 28:
+			digi_play_build(221, 'E', 7, 1);
+			scratch._9e = 16;
+			break;
+		case 32:
+			result = 28;
+			break;
+		case 34:
+			result = 33;
+			break;
+		case 35:
+			digi_play_build(221, 'R', 4, 1);
+			scratch._9e = 17;
+			break;
+		case 39:
+			result = 35;
+			break;
+		case 46:
+			digi_play_build(221, 'B', 4, 1);
+			scratch._9e = 18;
+			break;
+		case 50:
+			result = 46;
+			break;
+		case 52:
+			result = 51;
+			break;
+		case 53:
+			digi_play_build(221, 'E', 8, 1);
+			scratch._9e = 19;
+			break;
+		case 57:
+			result = 53;
+			break;
+		default:
+			break;
+		}
+	}
+
+	if (result >= 0) {
+		aainfo[1]._frame = result;
+		kernel_reset_animation(aa[1], result);
+	}
+}
+
+static void room_221_anim3() {
+	int16 result = -1;
+
+	if (kernel_anim[aa[2]].frame == aainfo[2]._frame)
+		return;
+
+	aainfo[2]._frame = kernel_anim[aa[2]].frame;
+
+	if (aainfo[2]._val3 == 2) {
+		switch (aainfo[2]._frame) {
+		case 1:
+			if (scratch._a0 == 1) {
+				aainfo[2]._frame = 10;
+				kernel_reset_animation(aa[2], 10);
+			}
+			break;
+		case 3:
+			digi_play_build(221, 'E', 2, 1);
+			scratch._9e = 6;
+			scratch._a0 = 1;
+			break;
+		case 7:
+			result = 3;
+			break;
+		case 9:
+			result = 8;
+			break;
+		case 11:
+			digi_play_build(221, 'E', 3, 1);
+			scratch._9e = 7;
+			break;
+		case 14:
+			result = 12;
+			break;
+		case 16:
+			result = 15;
+			break;
+		case 19:
+			digi_play_build(221, 'E', 4, 1);
+			scratch._9e = 9;
+			break;
+		case 23:
+			result = 19;
+			break;
+		default:
+			break;
+		}
+	} else if (aainfo[2]._val3 == 3) {
+		switch (aainfo[2]._frame) {
+		case 6:
+			digi_play_build(221, '_', 2, 2);
+			break;
+		case 13:
+			digi_play_build(221, 'E', 6, 1);
+			scratch._9e = 11;
+			break;
+		case 15:
+			result = 13;
+			break;
+		default:
+			break;
+		}
+	}
+
+	if (result >= 0) {
+		aainfo[2]._frame = result;
+		kernel_reset_animation(aa[2], result);
+	}
+}
+
+static void room_221_daemon() {
+	switch (kernel.trigger) {
+	case 7:
+		switch (scratch._9e) {
+		case 1:
+			kernel_timing_trigger(50, 104);
+			aainfo[0]._frame = 60;
+			kernel_reset_animation(aa[0], 60);
+			break;
+		case 2:
+			kernel_timing_trigger(50, 104);
+			aainfo[0]._frame = 68;
+			kernel_reset_animation(aa[0], 68);
+			break;
+		case 3:
+		case 4:
+		case 8:
+			kernel_timing_trigger(50, 104);
+			break;
+		case 5:
+			aainfo[0]._frame = 75;
+			kernel_reset_animation(aa[0], 75);
+			break;
+		case 6:
+			kernel_timing_trigger(50, 104);
+			aainfo[2]._frame = 8;
+			kernel_reset_animation(aa[2], 8);
+			break;
+		case 7:
+			kernel_timing_trigger(50, 104);
+			aainfo[2]._frame = 14;
+			kernel_reset_animation(aa[2], 14);
+			break;
+		case 9:
+			aainfo[2]._frame = 24;
+			kernel_reset_animation(aa[2], 24);
+			break;
+		case 11:
+			if (global[walker_converse_state] != 0) {
+				global[walker_converse_state] = 0;
+				close_interface(CANDLE_FLY);
+			}
+			new_room = 211;
+			break;
+		case 12:
+			aainfo[1]._frame = 27;
+			kernel_reset_animation(aa[1], 27);
+			break;
+		case 13:
+			aainfo[1]._frame = 35;
+			kernel_reset_animation(aa[1], 35);
+			break;
+		case 14:
+			kernel_timing_trigger(50, 104);
+			aainfo[1]._frame = 6;
+			kernel_reset_animation(aa[1], 6);
+			break;
+		case 15:
+			kernel_timing_trigger(50, 104);
+			aainfo[1]._frame = 13;
+			kernel_reset_animation(aa[1], 13);
+			break;
+		case 16:
+			kernel_timing_trigger(50, 104);
+			aainfo[1]._frame = 32;
+			kernel_reset_animation(aa[1], 32);
+			break;
+		case 17:
+			aainfo[1]._frame = 39;
+			kernel_reset_animation(aa[1], 39);
+			break;
+		case 18:
+			kernel_timing_trigger(50, 104);
+			aainfo[1]._frame = 50;
+			kernel_reset_animation(aa[1], 50);
+			break;
+		case 19:
+			aainfo[1]._frame = 57;
+			kernel_reset_animation(aa[1], 57);
+			break;
+		default:
+			break;
+		}
+		break;
+
+	case 26:
+		if (scratch._8c == 2) {
+			aa[2] = kernel_run_animation(kernel_name('E', 1), 105);
+			aainfo[2]._active = -1;
+			aainfo[2]._val3 = 2;
+			kernel_reset_animation(scratch._9a, 0);
+			kernel_reset_animation(scratch._9c, 0);
+			kernel_synch(KERNEL_ANIM, aa[2], KERNEL_NOW, 0);
+			global[g133] = 1;
+			global[g143] = 1;
+		} else if (scratch._8c == 3) {
+			aa[2] = kernel_run_animation(kernel_name('E', 2), 105);
+			aainfo[2]._active = -1;
+			aainfo[2]._val3 = 3;
+			kernel_reset_animation(scratch._9a, 0);
+			kernel_reset_animation(scratch._9c, 0);
+			kernel_synch(KERNEL_ANIM, aa[2], KERNEL_NOW, 0);
+			global[g133] = 1;
+			global[g143] = 1;
+		}
+		break;
+
+	case 100:
+		dont_frag_the_palette();
+		kernel_abort_animation(aa[0]);
+		aainfo[0]._active = 0;
+		if (previous_room == 211) {
+			aa[1] = kernel_run_animation(kernel_name('b', 2), 5);
+		} else {
+			global[g131] = -1;
+			global[g141] = -1;
+			kernel_reset_animation(scratch._9a, 1);
+			kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
+			kernel_reset_animation(scratch._9c, 1);
+			kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
+			global[g133] = 0;
+			global[g143] = 0;
+			player.commands_allowed = -1;
+		}
+		break;
+
+	case 101:
+		dont_frag_the_palette();
+		kernel_abort_animation(aa[1]);
+		aainfo[1]._active = 0;
+		aainfo[1]._frame = 0;
+		aa[1] = kernel_run_animation(kernel_name('b', 2), 102);
+		aainfo[1]._active = -1;
+		aainfo[1]._val3 = 5;
+		kernel_synch(KERNEL_ANIM, aa[1], KERNEL_NOW, 0);
+		break;
+
+	case 102:
+		dont_frag_the_palette();
+		kernel_abort_animation(aa[1]);
+		aainfo[1]._active = 0;
+		aainfo[1]._frame = 0;
+		aa[1] = kernel_run_animation(kernel_name('b', 3), 103);
+		aainfo[1]._active = -1;
+		aainfo[1]._val3 = 6;
+		kernel_synch(KERNEL_ANIM, aa[1], KERNEL_NOW, 0);
+		break;
+
+	case 103:
+		aainfo[1]._active = 0;
+		new_room = 301;
+		break;
+
+	case 104:
+		switch (scratch._9e) {
+		case 1:
+			aainfo[0]._frame = 62;
+			kernel_reset_animation(aa[0], 62);
+			break;
+		case 2:
+			digi_play_build(221, 'B', 1, 1);
+			scratch._9e = 3;
+			break;
+		case 3:
+			digi_play_build(221, 'O', 1, 1);
+			scratch._9e = 4;
+			break;
+		case 4:
+			aainfo[0]._frame = 69;
+			kernel_reset_animation(aa[0], 69);
+			break;
+		case 6:
+			aainfo[2]._frame = 10;
+			kernel_reset_animation(aa[2], 10);
+			break;
+		case 7:
+			digi_play_build(221, 'O', 2, 1);
+			scratch._9e = 8;
+			break;
+		case 8:
+			aainfo[2]._frame = 17;
+			kernel_reset_animation(aa[2], 17);
+			break;
+		case 14:
+			aainfo[1]._frame = 8;
+			kernel_reset_animation(aa[1], 8);
+			break;
+		case 15:
+			aainfo[1]._frame = 18;
+			kernel_reset_animation(aa[1], 18);
+			break;
+		case 16:
+			aainfo[1]._frame = 34;
+			kernel_reset_animation(aa[1], 34);
+			break;
+		case 17:
+			aainfo[1]._frame = 41;
+			kernel_reset_animation(aa[1], 41);
+			break;
+		case 18:
+			aainfo[1]._frame = 52;
+			kernel_reset_animation(aa[1], 52);
+			break;
+		default:
+			break;
+		}
+		break;
+
+	case 105:
+		dont_frag_the_palette();
+		kernel_abort_animation(aa[2]);
+		aainfo[2]._active = 0;
+		aainfo[2]._val3 = 0;
+		kernel_reset_animation(scratch._9a, 1);
+		kernel_reset_animation(scratch._9c, 1);
+		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
+		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
+		global[g133] = 0;
+		global[g143] = 0;
+		player.commands_allowed = -1;
+		break;
+
+	default:
+		break;
+	}
+
+	global_anim1(4, scratch._9a, global[g131], &global[g132]);
+	global_anim2(6, scratch._9c, global[g141], &global[g142]);
+	if (aainfo[0]._active != 0)
+		room_221_anim1();
+	if (aainfo[1]._active != 0)
+		room_221_anim2();
+	if (aainfo[2]._active != 0)
+		room_221_anim3();
 }
 
 static void room_221_parser() {
+	if (global[walker_converse_state] != 0) {
+		player.commands_allowed = 0;
+		global[g150] = -1;
+		scratch._8c = 3;
+		player.command_ready = false;
+		return;
+	}
+
+	if (global[player_selected_object] >= 0) {
+		player.command_ready = false;
+		return;
+	}
+
+	if (player_parse(78, words_hole, 0)) {
+		player.commands_allowed = 0;
+		global[g150] = -1;
+		scratch._8c = 2;
+		player.command_ready = false;
+		return;
+	}
+
+	if (player_parse(78, words_ivy_leaf, 0)) {
+		player.commands_allowed = 0;
+		global[g150] = -1;
+		scratch._8c = 3;
+		player.command_ready = false;
+		return;
+	}
 }
 
 void room_221_synchronize(Common::Serializer &s) {
-	for (int16 &v : scratch.sprite)    s.syncAsSint16LE(v);
-	for (int16 &v : scratch.sequence)  s.syncAsSint16LE(v);
-	for (int16 &v : scratch.animation) s.syncAsSint16LE(v);
+	for (int16 &v : scratch.sprite)                 s.syncAsSint16LE(v);
+	for (int16 &v : scratch.sequence)               s.syncAsSint16LE(v);
+	for (int16 &v : scratch.animation)              s.syncAsSint16LE(v);
+	for (AnimationInfo &v : scratch.animation_info) v.synchronize(s);
+	s.syncAsSint16LE(scratch._8c);
+	s.syncAsSint16LE(scratch._8e);
+	s.syncAsSint16LE(scratch._90);
+	s.syncAsSint16LE(scratch._92);
+	s.syncAsSint16LE(scratch._94);
+	s.syncAsSint16LE(scratch._96);
+	s.syncAsSint16LE(scratch._98);
+	s.syncAsSint16LE(scratch._9a);
+	s.syncAsSint16LE(scratch._9c);
+	s.syncAsSint16LE(scratch._9e);
+	s.syncAsSint16LE(scratch._a0);
 }
 
 void room_221_preload() {
 	room_init_code_pointer = room_221_init;
-	room_pre_parser_code_pointer = room_221_pre_parser;
 	room_parser_code_pointer = room_221_parser;
 	room_daemon_code_pointer = room_221_daemon;
 


Commit: fe153d1efea174b1fa108a9f89cd0d6f0fc12ab3
    https://github.com/scummvm/scummvm/commit/fe153d1efea174b1fa108a9f89cd0d6f0fc12ab3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-27T21:07:48+10:00

Commit Message:
MADS: FOREST: Adding inventory items, room 301 janitorial

Changed paths:
    engines/mads/madsv2/forest/mads/inventory.h
    engines/mads/madsv2/forest/rooms/room106.cpp
    engines/mads/madsv2/forest/rooms/room210.cpp
    engines/mads/madsv2/forest/rooms/room301.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


diff --git a/engines/mads/madsv2/forest/mads/inventory.h b/engines/mads/madsv2/forest/mads/inventory.h
index b8a22793ea5..3459881a929 100644
--- a/engines/mads/madsv2/forest/mads/inventory.h
+++ b/engines/mads/madsv2/forest/mads/inventory.h
@@ -35,8 +35,10 @@ enum {
 	sticks         =  7,
 	twine          =  8,
 	vine_weed      =  9,
+	web            = 10,
 	planks         = 11,
-	elm_leaves     = 12
+	elm_leaves     = 12,
+	forked_stick   = 15
 };
 
 } // namespace Forest
diff --git a/engines/mads/madsv2/forest/rooms/room106.cpp b/engines/mads/madsv2/forest/rooms/room106.cpp
index 75ef4605129..0045cf39c46 100644
--- a/engines/mads/madsv2/forest/rooms/room106.cpp
+++ b/engines/mads/madsv2/forest/rooms/room106.cpp
@@ -164,14 +164,14 @@ static void room_106_init2() {
 	scratch._9a = kernel_run_animation_disp('e', 2, 0);
 	kernel_position_anim(scratch._9a, 277, 92, 55, 9);
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 259;
 		player.y = 98;
 		player.facing = 3;
 	}
 
 	switch (previous_room) {
-	case KERNEL_LAST:
+	case KERNEL_RESTORING_GAME:
 		global[g131] = -1;
 		global[g141] = -1;
 		kernel_reset_animation(scratch._9a, 2);
diff --git a/engines/mads/madsv2/forest/rooms/room210.cpp b/engines/mads/madsv2/forest/rooms/room210.cpp
index 6621f167225..6426f14a352 100644
--- a/engines/mads/madsv2/forest/rooms/room210.cpp
+++ b/engines/mads/madsv2/forest/rooms/room210.cpp
@@ -81,7 +81,7 @@ static void room_210_init1() {
 	scratch._a2 = kernel_run_animation_disp('e', 7, 0);
 	kernel_position_anim(scratch._a2, 95, 155, 80, 1);
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 120;
 		player.y = 144;
 		player.facing = 2;
diff --git a/engines/mads/madsv2/forest/rooms/room301.cpp b/engines/mads/madsv2/forest/rooms/room301.cpp
index 96e98f98590..27867de4bcc 100644
--- a/engines/mads/madsv2/forest/rooms/room301.cpp
+++ b/engines/mads/madsv2/forest/rooms/room301.cpp
@@ -23,6 +23,7 @@
 #include "mads/madsv2/forest/extra.h"
 #include "mads/madsv2/forest/global.h"
 #include "mads/madsv2/forest/midi.h"
+#include "mads/madsv2/forest/mads/inventory.h"
 #include "mads/madsv2/forest/mads/words.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/inter.h"
@@ -75,7 +76,7 @@ static void room_301_init1() {
 	scratch._9a = kernel_run_animation_disp('e', 1, 0);
 	kernel_position_anim(scratch._9a, 100, 127, 63, 6);
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 164;
 		player.y = 132;
 		player.facing = 3;
@@ -109,7 +110,7 @@ static void room_301_init1() {
 		player.walker_visible = true;
 		return;
 
-	case KERNEL_LAST:
+	case KERNEL_RESTORING_GAME:
 		global[g131] = -1;
 		global[g141] = -1;
 		kernel_reset_animation(scratch._9a, 2);
@@ -139,7 +140,7 @@ static void room_301_init2() {
 	scratch._9a = kernel_run_animation_disp('e', 1, 0);
 	kernel_position_anim(scratch._9a, 100, 127, 63, 6);
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 164;
 		player.y = 132;
 		player.facing = 3;
@@ -183,7 +184,7 @@ static void room_301_init2() {
 		player.walker_visible = true;
 		return;
 
-	case KERNEL_LAST:
+	case KERNEL_RESTORING_GAME:
 		global[g131] = -1;
 		global[g141] = -1;
 		kernel_reset_animation(scratch._9a, 2);
@@ -212,7 +213,7 @@ static void room_301_init() {
 	global[g009] = 0;
 	midi_stop();
 
-	if (object_is_here(15)) {
+	if (object_is_here(forked_stick)) {
 		ss[0] = kernel_load_series(kernel_name('p', 2), 0);
 		seq[0] = kernel_seq_stamp(ss[0], false, -1);
 		kernel_seq_depth(seq[0], 10);
@@ -222,7 +223,7 @@ static void room_301_init() {
 		kernel_flip_hotspot(words_forked_stick, false);
 	}
 
-	if (object_is_here(10)) {
+	if (object_is_here(web)) {
 		ss[1] = kernel_load_series(kernel_name('p', 1), 0);
 		seq[1] = kernel_seq_stamp(ss[1], false, -1);
 		kernel_seq_depth(seq[1], 1);
@@ -232,7 +233,7 @@ static void room_301_init() {
 		kernel_flip_hotspot(words_web, false);
 	}
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		if (previous_room != 199) {
 			player.walker_visible = false;
 			player.commands_allowed = false;
@@ -507,14 +508,29 @@ static void room_301_anim5() {
 
 static void room_301_daemon() {
 	switch (kernel.trigger) {
-	case 25:
-		if (scratch._8e == 2) {
-			aa[3] = kernel_run_animation(kernel_name('R', 1), 101);
-			aainfo[3]._active = -1;
-			scratch._94 = 3;
-			kernel_reset_animation(scratch._9c, 0);
-			kernel_synch(KERNEL_ANIM, aa[3], KERNEL_ANIM, scratch._9c);
-			global[g143] = 1;
+	case 7:
+		if (global[walker_converse_state] != 0) {
+			global[walker_converse_state] = 0;
+			close_interface(CANDLE_FLY);
+			player.commands_allowed = true;
+		} else if (scratch._a4 == 300) {
+			kernel_abort_animation(scratch._9e);
+			scratch._a4 = -1;
+			scratch._aa = 0;
+			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
+			scratch._a8 = 1;
+			player.walker_visible = true;
+			global[g150] = -1;
+			scratch._90 = 6;
+		} else if (scratch._a4 == 400) {
+			kernel_abort_animation(scratch._9e);
+			scratch._a4 = -1;
+			scratch._aa = 0;
+			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
+			scratch._a8 = 2;
+			player.walker_visible = true;
+			global[g150] = -1;
+			scratch._90 = 6;
 		}
 		break;
 
@@ -545,29 +561,14 @@ static void room_301_daemon() {
 		}
 		break;
 
-	case 7:
-		if (global[walker_converse_state] != 0) {
-			global[walker_converse_state] = 0;
-			close_interface(CANDLE_FLY);
-			player.commands_allowed = true;
-		} else if (scratch._a4 == 300) {
-			kernel_abort_animation(scratch._9e);
-			scratch._a4 = -1;
-			scratch._aa = 0;
-			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
-			scratch._a8 = 1;
-			player.walker_visible = true;
-			global[g150] = -1;
-			scratch._90 = 6;
-		} else if (scratch._a4 == 400) {
-			kernel_abort_animation(scratch._9e);
-			scratch._a4 = -1;
-			scratch._aa = 0;
-			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
-			scratch._a8 = 2;
-			player.walker_visible = true;
-			global[g150] = -1;
-			scratch._90 = 6;
+	case 25:
+		if (scratch._8e == 2) {
+			aa[3] = kernel_run_animation(kernel_name('R', 1), 101);
+			aainfo[3]._active = -1;
+			scratch._94 = 3;
+			kernel_reset_animation(scratch._9c, 0);
+			kernel_synch(KERNEL_ANIM, aa[3], KERNEL_ANIM, scratch._9c);
+			global[g143] = 1;
 		}
 		break;
 
@@ -609,60 +610,6 @@ static void room_301_daemon() {
 		scratch._a4 = 0;
 		break;
 
-	case 103:
-		if (scratch._a8 == 1) {
-			kernel_abort_animation(aa[5]);
-			aainfo[5]._active = 0;
-			kernel_reset_animation(scratch._9c, 1);
-			kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
-			global[g143] = 0;
-			kernel_reset_animation(scratch._9a, 1);
-			kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
-			global[g133] = 0;
-			kernel_flip_hotspot(words_forked_stick, false);
-			inter_move_object(15, PLAYER);
-			global[player_score] = -1;
-			player.commands_allowed = true;
-		} else if (scratch._a8 == 2) {
-			kernel_abort_animation(aa[5]);
-			aa[5] = kernel_run_animation(kernel_name('P', 3), 103);
-			scratch._a8 = 3;
-			kernel_synch(KERNEL_ANIM, aa[5], KERNEL_NOW, 0);
-		} else if (scratch._a8 == 3) {
-			kernel_abort_animation(aa[5]);
-			aainfo[5]._active = 0;
-			kernel_reset_animation(scratch._9c, 1);
-			kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
-			global[g143] = 0;
-			kernel_reset_animation(scratch._9a, 1);
-			kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
-			global[g133] = 0;
-			kernel_flip_hotspot(words_web, false);
-			inter_move_object(10, PLAYER);
-			global[player_score] = -1;
-			player.commands_allowed = true;
-		}
-		break;
-
-	case 102:
-		kernel_abort_animation(aa[4]);
-		aainfo[4]._active = 0;
-		kernel_reset_animation(scratch._9a, 1);
-		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
-		global[g133] = 0;
-		global[player_score] = -1;
-		player.commands_allowed = true;
-		break;
-
-	case 101:
-		kernel_abort_animation(aa[scratch._94]);
-		aainfo[scratch._94]._active = 0;
-		kernel_reset_animation(scratch._9c, 1);
-		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
-		global[g143] = 0;
-		player.commands_allowed = true;
-		break;
-
 	case 100:
 		kernel_abort_animation(aa[0]);
 		aainfo[0]._active = 0;
@@ -706,6 +653,60 @@ static void room_301_daemon() {
 		}
 		break;
 
+	case 101:
+		kernel_abort_animation(aa[scratch._94]);
+		aainfo[scratch._94]._active = 0;
+		kernel_reset_animation(scratch._9c, 1);
+		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
+		global[g143] = 0;
+		player.commands_allowed = true;
+		break;
+
+	case 102:
+		kernel_abort_animation(aa[4]);
+		aainfo[4]._active = 0;
+		kernel_reset_animation(scratch._9a, 1);
+		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
+		global[g133] = 0;
+		global[player_score] = -1;
+		player.commands_allowed = true;
+		break;
+
+	case 103:
+		if (scratch._a8 == 1) {
+			kernel_abort_animation(aa[5]);
+			aainfo[5]._active = 0;
+			kernel_reset_animation(scratch._9c, 1);
+			kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
+			global[g143] = 0;
+			kernel_reset_animation(scratch._9a, 1);
+			kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
+			global[g133] = 0;
+			kernel_flip_hotspot(words_forked_stick, false);
+			inter_move_object(forked_stick, PLAYER);
+			global[player_score] = -1;
+			player.commands_allowed = true;
+		} else if (scratch._a8 == 2) {
+			kernel_abort_animation(aa[5]);
+			aa[5] = kernel_run_animation(kernel_name('P', 3), 103);
+			scratch._a8 = 3;
+			kernel_synch(KERNEL_ANIM, aa[5], KERNEL_NOW, 0);
+		} else if (scratch._a8 == 3) {
+			kernel_abort_animation(aa[5]);
+			aainfo[5]._active = 0;
+			kernel_reset_animation(scratch._9c, 1);
+			kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
+			global[g143] = 0;
+			kernel_reset_animation(scratch._9a, 1);
+			kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
+			global[g133] = 0;
+			kernel_flip_hotspot(words_web, false);
+			inter_move_object(web, PLAYER);
+			global[player_score] = -1;
+			player.commands_allowed = true;
+		}
+		break;
+
 	case 104:
 		kernel_abort_animation(aa[1]);
 		player.x = 164;
diff --git a/engines/mads/madsv2/forest/rooms/room302.cpp b/engines/mads/madsv2/forest/rooms/room302.cpp
index 0638a47ecd3..1b461c46dc2 100644
--- a/engines/mads/madsv2/forest/rooms/room302.cpp
+++ b/engines/mads/madsv2/forest/rooms/room302.cpp
@@ -84,7 +84,7 @@ static void room_302_init1() {
 	scratch._9c = kernel_run_animation_disp('r', 3, 0);
 	kernel_position_anim(scratch._9c, 137, 117, 73, 8);
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 178;
 		player.y = 124;
 		player.facing = 1;
@@ -126,7 +126,7 @@ static void room_302_init1() {
 		player.walker_visible = true;
 		return;
 	}
-	if (previous_room == KERNEL_LAST) {
+	if (previous_room == KERNEL_RESTORING_GAME) {
 		global[g131] = -1;
 		global[g141] = -1;
 		kernel_reset_animation(scratch._9a, 2);
@@ -207,7 +207,7 @@ static void room_302_init() {
 		kernel_flip_hotspot(words_room_304, false);
 	}
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		if (previous_room != 199) {
 			player.walker_visible = false;
 			player.commands_allowed = false;
diff --git a/engines/mads/madsv2/forest/rooms/room303.cpp b/engines/mads/madsv2/forest/rooms/room303.cpp
index c4d3ea98428..c70222f6567 100644
--- a/engines/mads/madsv2/forest/rooms/room303.cpp
+++ b/engines/mads/madsv2/forest/rooms/room303.cpp
@@ -433,7 +433,7 @@ static void room_303_init() {
 		kernel_flip_hotspot(words_pebbles, false);
 	}
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		if (previous_room != 199) {
 			player.walker_visible = false;
 			player.commands_allowed = false;
@@ -470,13 +470,13 @@ static void room_303_init1() {
 	scratch._9a = kernel_run_animation_disp('e', 6, 0);
 	kernel_position_anim(scratch._9a, 109, 139, 94, 5);
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 138;
 		player.y = 130;
 		player.facing = 6;
 	}
 
-	if (previous_room == KERNEL_LAST) {
+	if (previous_room == KERNEL_RESTORING_GAME) {
 		global[g131] = -1;
 		global[g141] = -1;
 		kernel_reset_animation(scratch._9a, 2);
@@ -526,13 +526,13 @@ static void room_303_init2() {
 	scratch._9a = kernel_run_animation_disp('e', 6, 0);
 	kernel_position_anim(scratch._9a, 109, 139, 94, 5);
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 138;
 		player.y = 130;
 		player.facing = 6;
 	}
 
-	if (previous_room == KERNEL_LAST) {
+	if (previous_room == KERNEL_RESTORING_GAME) {
 		global[g131] = -1;
 		global[g141] = -1;
 		kernel_reset_animation(scratch._9a, 2);
diff --git a/engines/mads/madsv2/forest/rooms/room304.cpp b/engines/mads/madsv2/forest/rooms/room304.cpp
index ecf3ad7241e..179cb101fb6 100644
--- a/engines/mads/madsv2/forest/rooms/room304.cpp
+++ b/engines/mads/madsv2/forest/rooms/room304.cpp
@@ -80,7 +80,7 @@ static void room_304_init1() {
 		scratch.animation_info[5]._active = -1;
 	}
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 154;
 		player.y = 154;
 		player.facing = 9;
@@ -111,7 +111,7 @@ static void room_304_init() {
 	digi_stop(2);
 	global[g070] = 0;
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		if (previous_room != 199) {
 			player.walker_visible = false;
 			player.commands_allowed = false;
diff --git a/engines/mads/madsv2/forest/rooms/room305.cpp b/engines/mads/madsv2/forest/rooms/room305.cpp
index b8acbd7bbcf..b49b03de1e5 100644
--- a/engines/mads/madsv2/forest/rooms/room305.cpp
+++ b/engines/mads/madsv2/forest/rooms/room305.cpp
@@ -79,7 +79,7 @@ static void room_305_init1() {
 	scratch._9a = kernel_run_animation_disp('e', 2, 0);
 	kernel_position_anim(scratch._9a, 118, 142, 100, 6);
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 183;
 		player.y = 109;
 		player.facing = 2;
@@ -126,13 +126,13 @@ static void room_305_init2() {
 	scratch._9a = kernel_run_animation_disp('e', 2, 0);
 	kernel_position_anim(scratch._9a, 118, 142, 100, 6);
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 183;
 		player.y = 109;
 		player.facing = 2;
 	}
 
-	if (previous_room == KERNEL_LAST) {
+	if (previous_room == KERNEL_RESTORING_GAME) {
 		global[g131] = -1;
 		global[g141] = -1;
 		kernel_reset_animation(scratch._9a, 2);
@@ -210,7 +210,7 @@ static void room_305_init() {
 		kernel_flip_hotspot(words_sticks, false);
 	}
 
-	if (previous_room != KERNEL_LAST) {
+	if (previous_room != KERNEL_RESTORING_GAME) {
 		if (previous_room != 199) {
 			player.walker_visible = false;
 			player.commands_allowed = false;


Commit: 021e2a5ba01a32a231c5908b58ae6ff0700d86b5
    https://github.com/scummvm/scummvm/commit/021e2a5ba01a32a231c5908b58ae6ff0700d86b5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-27T21:07:48+10:00

Commit Message:
MADS: FOREST: Fix first arrival at meadow room 301

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


diff --git a/engines/mads/madsv2/forest/rooms/room301.cpp b/engines/mads/madsv2/forest/rooms/room301.cpp
index 27867de4bcc..6347b63a8f2 100644
--- a/engines/mads/madsv2/forest/rooms/room301.cpp
+++ b/engines/mads/madsv2/forest/rooms/room301.cpp
@@ -83,6 +83,15 @@ static void room_301_init1() {
 	}
 
 	switch (previous_room) {
+	case KERNEL_RESTORING_GAME:
+		global[g131] = -1;
+		global[g141] = -1;
+		kernel_reset_animation(scratch._9a, 2);
+		kernel_reset_animation(scratch._9c, 2);
+		global[g133] = 0;
+		global[g143] = 0;
+		break;
+
 	case 221:
 	case 101:
 	case 205:
@@ -91,12 +100,12 @@ static void room_301_init1() {
 	case 307:
 	case 322:
 		aa[0] = kernel_run_animation(kernel_name('t', 1), 100);
-		aainfo[0]._active = -1;
+		aainfo[0]._active = true;
 		scratch._92 = 53;
 		player.x = 61;
 		player.y = 155;
 		player.facing = 2;
-		return;
+		break;
 
 	case 199:
 		global[g131] = -1;
@@ -108,16 +117,7 @@ static void room_301_init1() {
 		restore_player();
 		player.commands_allowed = true;
 		player.walker_visible = true;
-		return;
-
-	case KERNEL_RESTORING_GAME:
-		global[g131] = -1;
-		global[g141] = -1;
-		kernel_reset_animation(scratch._9a, 2);
-		kernel_reset_animation(scratch._9c, 2);
-		global[g133] = 0;
-		global[g143] = 0;
-		return;
+		break;
 
 	default:
 		global[g131] = -1;
@@ -128,7 +128,7 @@ static void room_301_init1() {
 		global[g143] = 0;
 		player.commands_allowed = true;
 		player.walker_visible = true;
-		return;
+		break;
 	}
 }
 
@@ -257,17 +257,17 @@ static void room_301_init() {
 }
 
 static void room_301_anim1() {
-	if (kernel_anim[aa[0]].frame == aainfo[0]._frame)
-		return;
-	aainfo[0]._frame = kernel_anim[aa[0]].frame;
-	int16 f = aainfo[0]._frame;
-
-	if (flags[30] == 1) {
-		if (f == 2) {
-			digi_play_build(301, '_', 2, 1);
-		} else if (f == 11) {
-			aainfo[0]._frame = 8;
-			kernel_reset_animation(aa[0], 8);
+	if (kernel_anim[aa[0]].frame != aainfo[0]._frame) {
+		aainfo[0]._frame = kernel_anim[aa[0]].frame;
+		int16 f = aainfo[0]._frame;
+
+		if (flags[30] == 1) {
+			if (f == 2) {
+				digi_play_build(301, '_', 2, 1);
+			} else if (f == 11) {
+				aainfo[0]._frame = 8;
+				kernel_reset_animation(aa[0], 8);
+			}
 		}
 	}
 
@@ -738,17 +738,17 @@ static void room_301_daemon() {
 	global_anim2(2, scratch._9c, global[g141], &global[g142]);
 	if (scratch._aa != 0)
 		kernel_random_frame(scratch._9e, &global[g151], global[g154]);
-	if (aainfo[0]._active != 0)
+	if (aainfo[0]._active)
 		room_301_anim1();
-	if (aainfo[2]._active != 0)
+	if (aainfo[2]._active)
 		room_301_anim3();
-	if (aainfo[4]._active != 0)
+	if (aainfo[4]._active)
 		room_301_anim4();
-	if (aainfo[1]._active != 0)
+	if (aainfo[1]._active)
 		room_301_anim2();
-	if (aainfo[5]._active != 0)
+	if (aainfo[5]._active)
 		room_301_anim5();
-	if (global[walker_converse_now] != 0)
+	if (global[walker_converse_now])
 		global_anim3(scratch._a6, &global[g008]);
 }
 




More information about the Scummvm-git-logs mailing list