[Scummvm-git-logs] scummvm master -> 0b5dd4d5820fc4ab298d0f60ac3b3e8fb32f6681
dreammaster
noreply at scummvm.org
Mon Jun 8 00:47:52 UTC 2026
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
02a6b031d4 MADS: FOREST: Section rooms done cleanup
ac089399f2 MADS: FOREST: Implemented room 210
0b5dd4d582 MADS: FOREST: Implemented rooms 211 and 220
Commit: 02a6b031d46b90b58221f5acc3f57f2fe40691a6
https://github.com/scummvm/scummvm/commit/02a6b031d46b90b58221f5acc3f57f2fe40691a6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-08T09:10:48+10:00
Commit Message:
MADS: FOREST: Section rooms done cleanup
Changed paths:
engines/mads/madsv2/forest/rooms/room201.cpp
engines/mads/madsv2/forest/rooms/room203.cpp
engines/mads/madsv2/forest/rooms/room204.cpp
engines/mads/madsv2/forest/rooms/room205.cpp
diff --git a/engines/mads/madsv2/forest/rooms/room201.cpp b/engines/mads/madsv2/forest/rooms/room201.cpp
index fd9efce246f..31ab0cd044c 100644
--- a/engines/mads/madsv2/forest/rooms/room201.cpp
+++ b/engines/mads/madsv2/forest/rooms/room201.cpp
@@ -36,29 +36,29 @@ namespace Forest {
namespace Rooms {
struct Scratch {
- int16 sprite[10]; /* 0x00 â sprite series handles */
- int16 sequence[10]; /* 0x14 â sequence handles */
- int16 animation[10]; /* 0x28 â animation handles */
- AnimationInfo animation_info[10];/* 0x3C */
- int16 _8c; /* 0x8C */
- int16 _8e; /* 0x8E */
- int16 _pad90; /* 0x90 */
- int16 _92; /* 0x92 */
- int16 _94; /* 0x94 â animation slot index for 'R' anim */
- int16 _96; /* 0x96 â animation slot index for 'F' anim */
- int16 _98; /* 0x98 */
- int16 _9a; /* 0x9A â animation handle */
- int16 _9c; /* 0x9C â animation handle */
- int16 _pad9e; /* 0x9E */
- int16 _a0; /* 0xA0 â talk animation handle */
- int16 _a2; /* 0xA2 â animation handle for random-frame walk */
- int16 _a4; /* 0xA4 */
- int16 _a6; /* 0xA6 */
- int16 _a8; /* 0xA8 */
- int16 _aa; /* 0xAA â cached frame for anim5 */
- int16 _ac; /* 0xAC */
- int16 _ae; /* 0xAE â cached frame for anim6 */
- int16 _b0; /* 0xB0 */
+ 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;
+ int16 _a2;
+ int16 _a4;
+ int16 _a6;
+ int16 _a8;
+ int16 _aa;
+ int16 _ac;
+ int16 _ae;
+ int16 _b0;
};
static Scratch scratch;
@@ -151,6 +151,32 @@ static void room_201_init1() {
}
}
+static void room_201_init() {
+ scratch._a6 = 0;
+ scratch._a4 = -1;
+
+ if (previous_room != KERNEL_RESTORING_GAME && previous_room != 199) {
+ player.walker_visible = 0;
+ player.commands_allowed = 0;
+ }
+
+ scratch._ac = 0;
+ scratch._b0 = 0;
+ for (int i = 0; i < 10; i++) {
+ aainfo[i]._active = 0;
+ aainfo[i]._frame = 1;
+ aainfo[i]._val3 = 0;
+ aainfo[i]._val4 = 0;
+ }
+
+ if (previous_room != 199 && flags[7] != 3)
+ flags[7]++;
+
+ if (flags[7] == -3)
+ flags[7] = 1;
+ room_201_init1();
+}
+
static void room_201_anim1() {
if (kernel_anim[aa[0]].frame != aainfo[0]._frame)
aainfo[0]._frame = kernel_anim[aa[0]].frame;
@@ -339,32 +365,6 @@ static void room_201_anim6() {
}
}
-static void room_201_init() {
- scratch._a6 = 0;
- scratch._a4 = -1;
-
- if (previous_room != KERNEL_RESTORING_GAME && previous_room != 199) {
- player.walker_visible = 0;
- player.commands_allowed = 0;
- }
-
- scratch._ac = 0;
- scratch._b0 = 0;
- for (int i = 0; i < 10; i++) {
- aainfo[i]._active = 0;
- aainfo[i]._frame = 1;
- aainfo[i]._val3 = 0;
- aainfo[i]._val4 = 0;
- }
-
- if (previous_room != 199 && flags[7] != 3)
- flags[7]++;
-
- if (flags[7] == -3)
- flags[7] = 1;
- room_201_init1();
-}
-
static void room_201_daemon() {
int16 trigger = kernel.trigger;
@@ -664,14 +664,14 @@ void room_201_synchronize(Common::Serializer &s) {
for (AnimationInfo &ai : scratch.animation_info) ai.synchronize(s);
s.syncAsSint16LE(scratch._8c);
s.syncAsSint16LE(scratch._8e);
- s.syncAsSint16LE(scratch._pad90);
+ 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._pad9e);
+ s.syncAsSint16LE(scratch._9e);
s.syncAsSint16LE(scratch._a0);
s.syncAsSint16LE(scratch._a2);
s.syncAsSint16LE(scratch._a4);
diff --git a/engines/mads/madsv2/forest/rooms/room203.cpp b/engines/mads/madsv2/forest/rooms/room203.cpp
index 5b5d2f67ddd..72638c88bd0 100644
--- a/engines/mads/madsv2/forest/rooms/room203.cpp
+++ b/engines/mads/madsv2/forest/rooms/room203.cpp
@@ -39,31 +39,31 @@ namespace Forest {
namespace Rooms {
struct Scratch {
- int16 sprite[10]; /* 0x00 â sprite series handles */
- int16 sequence[10]; /* 0x14 â sequence handles */
- int16 animation[10]; /* 0x28 â animation handles */
- AnimationInfo animation_info[10];/* 0x3C */
- int16 _8c; /* 0x8C */
- int16 _8e; /* 0x8E */
- int16 _90; /* 0x90 */
- int16 _92; /* 0x92 */
- int16 _94; /* 0x94 */
- int16 _96; /* 0x96 */
- int16 _98; /* 0x98 */
- int16 _9a; /* 0x9A */
- int16 _9c; /* 0x9C */
- int16 _9e; /* 0x9E â animation handle */
- int16 _a0; /* 0xA0 â animation handle */
- int16 _a2; /* 0xA2 â talk animation handle */
- int16 _a4; /* 0xA4 */
- int16 _a6; /* 0xA6 */
- int16 _a8; /* 0xA8 */
- int16 _aa; /* 0xAA */
- int16 _ac; /* 0xAC */
- int16 _ae; /* 0xAE */
- int16 _b0; /* 0xB0 */
- int16 _b2; /* 0xB2 */
- int16 _b4; /* 0xB4 */
+ 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;
+ int16 _a2;
+ int16 _a4;
+ int16 _a6;
+ int16 _a8;
+ int16 _aa;
+ int16 _ac;
+ int16 _ae;
+ int16 _b0;
+ int16 _b2;
+ int16 _b4;
};
static Scratch scratch;
diff --git a/engines/mads/madsv2/forest/rooms/room204.cpp b/engines/mads/madsv2/forest/rooms/room204.cpp
index 4567ab9eddb..11c9f3dc451 100644
--- a/engines/mads/madsv2/forest/rooms/room204.cpp
+++ b/engines/mads/madsv2/forest/rooms/room204.cpp
@@ -38,25 +38,25 @@ namespace Forest {
namespace Rooms {
struct Scratch {
- int16 sprite[10]; /* Sprite series handles 0x00 */
- int16 sequence[10]; /* Sequence handles 0x14 */
- int16 animation[10]; /* Animation handles 0x28 */
- AnimationInfo animation_info[10];/* Animation info 0x3C */
+ int16 sprite[10];
+ int16 sequence[10];
+ int16 animation[10];
+ AnimationInfo animation_info[10];
int16 _8c;
int16 _8e;
int16 _90;
- int16 _92; /* 0x92 */
- int16 _94; /* 0x94 */
- int16 _96; /* 0x96 */
- int16 _98; /* 0x98 */
- int16 _9a; /* 0x9A */
- int16 _9c; /* 0x9C */
+ int16 _92;
+ int16 _94;
+ int16 _96;
+ int16 _98;
+ int16 _9a;
+ int16 _9c;
int16 _9e;
int16 _a0;
int16 _a2;
int16 _a4;
- int16 _a6; /* 0xA6 */
- int16 _a8; /* 0xA8 */
+ int16 _a6;
+ int16 _a8;
};
static Scratch scratch;
@@ -67,51 +67,6 @@ static Scratch scratch;
#define aa local->animation
#define aainfo scratch.animation_info
-static void room_204_init1();
-static void room_204_anim1();
-static void room_204_anim2();
-static void room_204_anim3();
-static void room_204_anim4();
-static void room_204_anim5();
-static void room_204_anim6();
-
-static void room_204_init() {
- global[player_score] = -1;
- midi_stop();
- scratch._a8 = 0;
- scratch._a6 = -1;
-
- if (object_is_here(9)) {
- ss[0] = kernel_load_series(kernel_name('p', 1), 0);
- seq[0] = kernel_seq_stamp(ss[0], false, KERNEL_FIRST);
- kernel_seq_depth(seq[0], 7);
- kernel_seq_loc(seq[0], 293, 87);
- kernel_seq_scale(seq[0], 54);
- } else {
- kernel_flip_hotspot(158, -1);
- }
-
- if (previous_room != KERNEL_RESTORING_GAME) {
- if (previous_room != 199) {
- player.walker_visible = 0;
- player.commands_allowed = 0;
- }
-
- for (int count = 0; count < 10; count++) {
- aainfo[count]._active = 0;
- aainfo[count]._frame = 1;
- aainfo[count]._val3 = 0;
- aainfo[count]._val4 = 0;
- }
-
- if (previous_room != 199 && flags[18] != 3)
- flags[18]++;
- }
-
- room_204_init1();
- if (flags[18] == -3)
- flags[18] = 1;
-}
static void room_204_init1() {
global[g131] = 0;
@@ -171,196 +126,42 @@ static void room_204_init1() {
player.walker_visible = -1;
}
-static void room_204_daemon() {
- int trigger = kernel.trigger;
+static void room_204_init() {
+ global[player_score] = -1;
+ midi_stop();
+ scratch._a8 = 0;
+ scratch._a6 = -1;
- if (trigger == 103) {
- goto trigger_103;
- } else if (trigger > 103) {
- goto bottom;
- } else if (trigger == 25) {
- goto trigger_25;
- } else if (trigger > 25) {
- // triggers 26-102
- if (trigger == 26) {
- goto trigger_26;
- } else if (trigger == 100) {
- 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);
- global[g143] = 0;
- player.commands_allowed = -1;
- 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);
- global[g133] = 0;
- player.commands_allowed = -1;
- goto bottom;
- } else {
- goto bottom;
- }
- } else if (trigger == 0) {
- goto bottom;
- } else if (trigger == 7) {
- goto trigger_7;
- } else if (trigger == 24) {
- goto trigger_24;
+ if (object_is_here(9)) {
+ ss[0] = kernel_load_series(kernel_name('p', 1), 0);
+ seq[0] = kernel_seq_stamp(ss[0], false, KERNEL_FIRST);
+ kernel_seq_depth(seq[0], 7);
+ kernel_seq_loc(seq[0], 293, 87);
+ kernel_seq_scale(seq[0], 54);
} else {
- goto bottom;
+ kernel_flip_hotspot(158, -1);
}
-trigger_7:
- if (global[walker_converse_state] != 0) {
- global[walker_converse_state] = 0;
- close_journal(3);
- player.commands_allowed = -1;
- goto bottom;
- }
- if (scratch._a4 != 400)
- goto bottom;
- kernel_abort_animation(scratch._9e);
- scratch._a4 = -1;
- scratch._a8 = 0;
- kernel_synch(2, 0, 4, 0);
- scratch._a6 = 3;
- player.walker_visible = -1;
- global[g150] = -1;
- scratch._90 = 6;
- goto bottom;
-
-trigger_24:
- if (scratch._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);
- global[g133] = 1;
- } else if (scratch._8c == 5) {
- if (scratch._a6 == 1) {
- aa[4] = kernel_run_animation(kernel_name('F', 1), 102);
- } else if (scratch._a6 == 2) {
- aa[4] = kernel_run_animation(kernel_name('F', 2), 102);
- } else {
- goto bottom;
+ if (previous_room != KERNEL_RESTORING_GAME) {
+ if (previous_room != 199) {
+ player.walker_visible = 0;
+ player.commands_allowed = 0;
}
- aainfo[4]._active = -1;
- scratch._96 = 4;
- kernel_reset_animation(scratch._9a, 0);
- kernel_synch(3, aa[4], 3, scratch._9a);
- global[g133] = 1;
- }
- goto bottom;
-trigger_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(3, aa[3], 3, scratch._9c);
- global[g143] = 1;
- }
- goto bottom;
-
-trigger_26:
- if (scratch._90 == 1) {
- kernel_reset_animation(scratch._9a, 0);
- kernel_reset_animation(scratch._9c, 0);
- global[g133] = 1;
- global[g143] = 1;
- } else if (scratch._90 == 6) {
- if (scratch._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);
- kernel_synch(3, aa[5], 4, 0);
- global[g133] = 1;
- global[g143] = 1;
- }
- goto bottom;
+ for (int count = 0; count < 10; count++) {
+ aainfo[count]._active = 0;
+ aainfo[count]._frame = 1;
+ aainfo[count]._val3 = 0;
+ aainfo[count]._val4 = 0;
+ }
-trigger_100:
- kernel_abort_animation(aa[0]);
- aainfo[0]._active = 0;
- if (flags[18] == 1) {
- kernel_synch(2, 0, 4, 0);
- global[g017] = 0;
- global[g154] = 0;
- kernel_synch(3, scratch._9a, 4, 0);
- global[g131] = -1;
- global[g133] = 1;
- global[g156] = 0;
- kernel_synch(3, scratch._9c, 4, 0);
- global[g143] = 1;
- scratch._a4 = 1;
- global[g141] = -1;
- player.walker_visible = -1;
- 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);
- 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);
- global[g133] = 0;
- global[g143] = 0;
- kernel_synch(3, scratch._9a, 4, 0);
- kernel_synch(3, scratch._9c, 4, 0);
- player.walker_visible = -1;
- kernel_synch(2, 0, 4, 0);
- player.commands_allowed = -1;
+ if (previous_room != 199 && flags[18] != 3)
+ flags[18]++;
}
- goto bottom;
-
-trigger_103:
- if (scratch._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);
- global[g143] = 0;
- kernel_reset_animation(scratch._9a, 1);
- kernel_synch(3, scratch._9a, 4, 0);
- global[g133] = 0;
- kernel_flip_hotspot(158, -1);
- inter_move_object(9, 2);
- global[player_score] = -1;
- player.commands_allowed = -1;
-
-bottom:
- global_anim1(3, scratch._9a, global[g131], &global[g132]);
- global_anim2(2, scratch._9c, global[g141], &global[g142]);
-
- if (scratch._a8 != 0)
- kernel_random_frame(scratch._9e, &global[g151], global[g154]);
- if (aainfo[0]._active != 0) room_204_anim1();
- if (aainfo[1]._active != 0) room_204_anim2();
- if (aainfo[3]._active != 0) room_204_anim3();
- if (aainfo[2]._active != 0) room_204_anim4();
- if (aainfo[4]._active != 0) room_204_anim5();
- if (aainfo[5]._active != 0) room_204_anim6();
+ room_204_init1();
+ if (flags[18] == -3)
+ flags[18] = 1;
}
static void room_204_anim1() {
@@ -546,6 +347,198 @@ static void room_204_anim6() {
}
}
+static void room_204_daemon() {
+ int trigger = kernel.trigger;
+
+ if (trigger == 103) {
+ goto trigger_103;
+ } else if (trigger > 103) {
+ goto bottom;
+ } else if (trigger == 25) {
+ goto trigger_25;
+ } else if (trigger > 25) {
+ // triggers 26-102
+ if (trigger == 26) {
+ goto trigger_26;
+ } else if (trigger == 100) {
+ 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);
+ global[g143] = 0;
+ player.commands_allowed = -1;
+ 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);
+ global[g133] = 0;
+ player.commands_allowed = -1;
+ goto bottom;
+ } else {
+ goto bottom;
+ }
+ } else if (trigger == 0) {
+ goto bottom;
+ } else if (trigger == 7) {
+ goto trigger_7;
+ } else if (trigger == 24) {
+ goto trigger_24;
+ } else {
+ goto bottom;
+ }
+
+trigger_7:
+ if (global[walker_converse_state] != 0) {
+ global[walker_converse_state] = 0;
+ close_journal(3);
+ player.commands_allowed = -1;
+ goto bottom;
+ }
+ if (scratch._a4 != 400)
+ goto bottom;
+ kernel_abort_animation(scratch._9e);
+ scratch._a4 = -1;
+ scratch._a8 = 0;
+ kernel_synch(2, 0, 4, 0);
+ scratch._a6 = 3;
+ player.walker_visible = -1;
+ global[g150] = -1;
+ scratch._90 = 6;
+ goto bottom;
+
+trigger_24:
+ if (scratch._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);
+ global[g133] = 1;
+ } else if (scratch._8c == 5) {
+ if (scratch._a6 == 1) {
+ aa[4] = kernel_run_animation(kernel_name('F', 1), 102);
+ } else if (scratch._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);
+ global[g133] = 1;
+ }
+ goto bottom;
+
+trigger_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(3, aa[3], 3, scratch._9c);
+ global[g143] = 1;
+ }
+ goto bottom;
+
+trigger_26:
+ if (scratch._90 == 1) {
+ kernel_reset_animation(scratch._9a, 0);
+ kernel_reset_animation(scratch._9c, 0);
+ global[g133] = 1;
+ global[g143] = 1;
+ } else if (scratch._90 == 6) {
+ if (scratch._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);
+ kernel_synch(3, aa[5], 4, 0);
+ global[g133] = 1;
+ global[g143] = 1;
+ }
+ goto bottom;
+
+trigger_100:
+ kernel_abort_animation(aa[0]);
+ aainfo[0]._active = 0;
+ if (flags[18] == 1) {
+ kernel_synch(2, 0, 4, 0);
+ global[g017] = 0;
+ global[g154] = 0;
+ kernel_synch(3, scratch._9a, 4, 0);
+ global[g131] = -1;
+ global[g133] = 1;
+ global[g156] = 0;
+ kernel_synch(3, scratch._9c, 4, 0);
+ global[g143] = 1;
+ scratch._a4 = 1;
+ global[g141] = -1;
+ player.walker_visible = -1;
+ 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);
+ 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);
+ global[g133] = 0;
+ global[g143] = 0;
+ kernel_synch(3, scratch._9a, 4, 0);
+ kernel_synch(3, scratch._9c, 4, 0);
+ player.walker_visible = -1;
+ kernel_synch(2, 0, 4, 0);
+ player.commands_allowed = -1;
+ }
+ goto bottom;
+
+trigger_103:
+ if (scratch._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);
+ global[g143] = 0;
+ kernel_reset_animation(scratch._9a, 1);
+ kernel_synch(3, scratch._9a, 4, 0);
+ global[g133] = 0;
+ kernel_flip_hotspot(158, -1);
+ inter_move_object(9, 2);
+ global[player_score] = -1;
+ player.commands_allowed = -1;
+
+bottom:
+ global_anim1(3, scratch._9a, global[g131], &global[g132]);
+ global_anim2(2, scratch._9c, global[g141], &global[g142]);
+
+ if (scratch._a8 != 0)
+ kernel_random_frame(scratch._9e, &global[g151], global[g154]);
+
+ if (aainfo[0]._active != 0) room_204_anim1();
+ if (aainfo[1]._active != 0) room_204_anim2();
+ if (aainfo[3]._active != 0) room_204_anim3();
+ if (aainfo[2]._active != 0) room_204_anim4();
+ if (aainfo[4]._active != 0) room_204_anim5();
+ if (aainfo[5]._active != 0) room_204_anim6();
+}
+
static void room_204_pre_parser() {
if (player_parse(13, 23, 0))
player.walk_off_edge_to_room = 203;
diff --git a/engines/mads/madsv2/forest/rooms/room205.cpp b/engines/mads/madsv2/forest/rooms/room205.cpp
index 3bc219ec5e0..a6f427c53f2 100644
--- a/engines/mads/madsv2/forest/rooms/room205.cpp
+++ b/engines/mads/madsv2/forest/rooms/room205.cpp
@@ -40,23 +40,23 @@ namespace Forest {
namespace Rooms {
struct Scratch {
- int16 sprite[10]; /* Sprite series handles 0x00 */
- int16 sequence[10]; /* Sequence handles 0x14 */
- int16 animation[10]; /* Animation handles 0x28 */
- AnimationInfo animation_info[10];/* Animation info 0x3C */
- int16 _8c; /* 0x8C */
- int16 _8e; /* 0x8E */
- int16 _90; /* 0x90 */
- int16 _92; /* 0x92 */
+ 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; /* 0x9A */
- int16 _9c; /* 0x9C */
- int16 _9e; /* 0x9E */
- int16 _a0; /* 0xA0 */
- int16 _a2; /* 0xA2 */
- int16 _a4; /* 0xA4 */
+ int16 _9a;
+ int16 _9c;
+ int16 _9e;
+ int16 _a0;
+ int16 _a2;
+ int16 _a4;
};
static Scratch scratch;
Commit: ac089399f23c242a113f52729c2b029657c5d2fc
https://github.com/scummvm/scummvm/commit/ac089399f23c242a113f52729c2b029657c5d2fc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-08T10:28:56+10:00
Commit Message:
MADS: FOREST: Implemented room 210
Changed paths:
engines/mads/madsv2/core/digi.cpp
engines/mads/madsv2/core/digi.h
engines/mads/madsv2/forest/rooms/room101.cpp
engines/mads/madsv2/forest/rooms/room103.cpp
engines/mads/madsv2/forest/rooms/room106.cpp
engines/mads/madsv2/forest/rooms/room210.cpp
diff --git a/engines/mads/madsv2/core/digi.cpp b/engines/mads/madsv2/core/digi.cpp
index a5ede99202d..5d08cae44b4 100644
--- a/engines/mads/madsv2/core/digi.cpp
+++ b/engines/mads/madsv2/core/digi.cpp
@@ -25,11 +25,14 @@
namespace MADS {
namespace MADSV2 {
-bool digi_flag1;
int digi_val1;
+int digi_val2;
+int digi_timing_index;
void digi_install() {
- digi_flag1 = false;
+ digi_val1 = 0;
+ digi_val2 = 0;
+ digi_timing_index = 0;
}
void digi_uninstall() {
diff --git a/engines/mads/madsv2/core/digi.h b/engines/mads/madsv2/core/digi.h
index 8e11848d5ef..db4eee253ae 100644
--- a/engines/mads/madsv2/core/digi.h
+++ b/engines/mads/madsv2/core/digi.h
@@ -27,8 +27,9 @@
namespace MADS {
namespace MADSV2 {
-extern bool digi_flag1;
extern int digi_val1;
+extern int digi_val2;
+extern int digi_timing_index;
extern void digi_install();
extern void digi_play(const char *name, int slot);
diff --git a/engines/mads/madsv2/forest/rooms/room101.cpp b/engines/mads/madsv2/forest/rooms/room101.cpp
index 08ff07b5afc..b8d0b5abb75 100644
--- a/engines/mads/madsv2/forest/rooms/room101.cpp
+++ b/engines/mads/madsv2/forest/rooms/room101.cpp
@@ -984,7 +984,7 @@ static void room_101_daemon() {
case 113:
digi_initial_volume(90);
digi_play_build(101, '_', 5, 3);
- digi_flag1 = true;
+ digi_val2 = -1;
break;
}
diff --git a/engines/mads/madsv2/forest/rooms/room103.cpp b/engines/mads/madsv2/forest/rooms/room103.cpp
index 740ce94eb2a..999ad6a4f85 100644
--- a/engines/mads/madsv2/forest/rooms/room103.cpp
+++ b/engines/mads/madsv2/forest/rooms/room103.cpp
@@ -97,7 +97,7 @@ static void room_103_anim1() {
digi_initial_volume(20);
digi_play_build(101, '_', 5, 3);
scratch._92 = 1;
- digi_flag1 = true;
+ digi_val2 = -1;
} else if (frame == 273) {
kernel_abort_animation(aa[0]);
aainfo[0]._active = 0;
@@ -113,7 +113,7 @@ static void room_103_anim1() {
digi_initial_volume(20);
scratch._92 = 1;
digi_play_build(101, '_', 5, 3);
- digi_flag1 = true;
+ digi_val2 = -1;
}
}
}
@@ -124,7 +124,7 @@ static void room_103_anim2() {
aainfo[1]._frame = frame;
if (frame == 165) {
- digi_flag1 = false;
+ digi_val2 = 0;
} else if (frame > 165) {
if (frame == 186) {
aainfo[1]._val3 = 11;
@@ -150,12 +150,12 @@ static void room_103_anim2() {
digi_initial_volume(50);
digi_play_build(101, '_', 5, 3);
scratch._92 = 1;
- digi_flag1 = true;
+ digi_val2 = -1;
} else if (frame == 160) {
digi_initial_volume(60);
digi_play_build(103, '_', 1, 1);
scratch._90 = 160;
- digi_flag1 = true;
+ digi_val2 = -1;
}
}
}
@@ -176,7 +176,7 @@ static void room_103_anim2() {
digi_initial_volume(90);
scratch._92++;
digi_play_build(101, '_', 5, 3);
- digi_flag1 = true;
+ digi_val2 = -1;
}
}
}
diff --git a/engines/mads/madsv2/forest/rooms/room106.cpp b/engines/mads/madsv2/forest/rooms/room106.cpp
index ae2f2a7019e..9f6a92ade9e 100644
--- a/engines/mads/madsv2/forest/rooms/room106.cpp
+++ b/engines/mads/madsv2/forest/rooms/room106.cpp
@@ -668,7 +668,7 @@ static void room_106_daemon() {
case 109:
digi_initial_volume(50);
digi_play_build(101, '_', 5, 3);
- digi_flag1 = true;
+ digi_val2 = -1;
break;
}
diff --git a/engines/mads/madsv2/forest/rooms/room210.cpp b/engines/mads/madsv2/forest/rooms/room210.cpp
index 95bc2a25e6a..f1ec570a629 100644
--- a/engines/mads/madsv2/forest/rooms/room210.cpp
+++ b/engines/mads/madsv2/forest/rooms/room210.cpp
@@ -19,17 +19,18 @@
*
*/
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/digi.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/sound.h"
-#include "mads/madsv2/core/text.h"
+#include "mads/madsv2/core/midi.h"
+#include "mads/madsv2/core/player.h"
+#include "mads/madsv2/core/speech.h"
#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/global.h"
+#include "mads/madsv2/forest/journal.h"
#include "mads/madsv2/forest/rooms/section1.h"
#include "mads/madsv2/forest/rooms/room210.h"
@@ -39,10 +40,26 @@ namespace Forest {
namespace Rooms {
struct Scratch {
- int16 sprite[10]; /* Sprite series handles */
- int16 sequence[10]; /* Sequence handles */
- int16 animation[10]; /* Animation handles */
- AnimationInfo animation_info[10];
+ int16 sprite[10]; // 0x00â0x13
+ int16 sequence[10]; // 0x14â0x27
+ int16 animation[10]; // 0x28â0x3B
+ AnimationInfo animation_info[10]; // 0x3Câ0x8B
+ int16 _8c;
+ int16 _8e;
+ int16 _90;
+ int16 _92;
+ int16 _94;
+ int16 _96;
+ int16 _98;
+ int16 _9a;
+ int16 _9c;
+ int16 _9e;
+ int16 _a0;
+ int16 _a2;
+ int16 _a4;
+ int16 _a6;
+ int16 _a8; // 0xA8
+ int16 _aa;
};
static Scratch scratch;
@@ -54,27 +71,611 @@ static Scratch scratch;
#define aainfo scratch.animation_info
+static void room_210_init1() {
+ global[g131] = 0;
+ global[g141] = 0;
+
+ scratch._a4 = kernel_run_animation_disp('r', 9, 0);
+ kernel_position_anim(scratch._a4, 147, 155, 80, 1);
+
+ scratch._a2 = kernel_run_animation_disp('e', 7, 0);
+ kernel_position_anim(scratch._a2, 95, 155, 80, 1);
+
+ if (previous_room != KERNEL_LAST) {
+ player.x = 120;
+ player.y = 144;
+ player.facing = 2;
+ }
+
+ if (previous_room != 199) {
+ player.walker_visible = 0;
+ player.commands_allowed = 0;
+ }
+
+ if (previous_room == 321)
+ previous_room = 303;
+ if (previous_room == 322)
+ previous_room = 307;
+
+ if (previous_room == global[g041]) {
+ aa[0] = kernel_run_animation(kernel_name('y', 1), 100);
+ aainfo[0]._active = -1;
+ aainfo[0]._frame = 0;
+ scratch._92 = 79;
+ return;
+ }
+
+ if (previous_room == global[g042]) {
+ aa[0] = kernel_run_animation(kernel_name('y', 2), 100);
+ aainfo[0]._active = -1;
+ aainfo[0]._frame = 0;
+ scratch._92 = 72;
+ return;
+ }
+
+ if (previous_room == global[g043]) {
+ aa[0] = kernel_run_animation(kernel_name('y', 3), 100);
+ aainfo[0]._active = -1;
+ aainfo[0]._frame = 0;
+ scratch._92 = 66;
+ return;
+ }
+
+ if (previous_room == global[g044]) {
+ aa[0] = kernel_run_animation(kernel_name('y', 4), 100);
+ aainfo[0]._active = -1;
+ aainfo[0]._frame = 0;
+ scratch._92 = 77;
+ return;
+ }
+
+ if (previous_room == global[g045]) {
+ aa[0] = kernel_run_animation(kernel_name('y', 5), 100);
+ scratch._92 = 88;
+ aainfo[0]._active = -1;
+ aainfo[0]._frame = 0;
+ return;
+ }
+
+ global[g131] = -1;
+ global[g141] = -1;
+ kernel_reset_animation(scratch._a2, 2);
+ kernel_reset_animation(scratch._a4, 2);
+ global[g133] = 0;
+ global[g143] = 0;
+
+ if (previous_room == 199)
+ restore_player();
+
+ player.commands_allowed = -1;
+ player.walker_visible = -1;
+}
+
static void room_210_init() {
+ midi_stop();
+ scratch._a8 = -1;
+ global[player_score] = 0;
+ // TODO: identify word_7130E â used as an index to select which 16-bit half of
+ // global.walker_timing to zero: global[walker_timing + word_7130E] = 0
+ global[walker_timing] = 0;
+
+ for (int i = 0; i < 10; i++) {
+ aainfo[i]._active = 0;
+ aainfo[i]._frame = 0;
+ aainfo[i]._val3 = 0;
+ aainfo[i]._val4 = 0;
+ }
+
+ aa[2] = kernel_run_animation(kernel_name('t', 1), 102);
+ aa[3] = kernel_run_animation(kernel_name('t', 2), 102);
+ aa[4] = kernel_run_animation(kernel_name('t', 3), 102);
+ aa[5] = kernel_run_animation(kernel_name('t', 4), 102);
+ aa[6] = kernel_run_animation(kernel_name('t', 5), 102);
+
+ kernel_timing_trigger(imath_random(10, 300), 103);
+ kernel_timing_trigger(imath_random(10, 300), 104);
+ kernel_timing_trigger(imath_random(10, 300), 105);
+ kernel_timing_trigger(imath_random(10, 300), 106);
+ kernel_timing_trigger(imath_random(10, 300), 107);
+ kernel_timing_trigger(1, 109);
+
+ if (previous_room != 199 && flags[11] != 3)
+ flags[11]++;
+
+ room_210_init1();
}
-static void room_210_daemon() {
+static void room_210_anim1() {
+ if (kernel_anim[aa[0]].frame != aainfo[0]._frame)
+ aainfo[0]._frame = kernel_anim[aa[0]].frame;
+
+ if (global[player_hyperwalked] != -1)
+ return;
+ aainfo[0]._frame = scratch._92 - 1;
+ kernel_reset_animation(aa[0], aainfo[0]._frame);
}
-static void room_210_pre_parser() {
+static void room_210_anim2() {
+ if (kernel_anim[aa[1]].frame != aainfo[1]._frame)
+ aainfo[1]._frame = kernel_anim[aa[1]].frame;
+
+ if (global[player_hyperwalked] != -1)
+ return;
+ aainfo[1]._frame = scratch._94 - 1;
+ kernel_reset_animation(aa[1], aainfo[1]._frame);
+}
+
+static void room_210_anim3() {
+ if (kernel_anim[aa[7]].frame == aainfo[7]._frame)
+ return;
+ aainfo[7]._frame = kernel_anim[aa[7]].frame;
+
+ int16 f = aainfo[7]._frame;
+ if (f == 1) {
+ kernel_timing_trigger(10, 114);
+ } else if (f == 6) {
+ aainfo[7]._frame = 2;
+ kernel_reset_animation(aa[7], 2);
+ }
+}
+
+static void room_210_anim4() {
+ int16 result = -1;
+
+ if (kernel_anim[aa[8]].frame == aainfo[8]._frame)
+ return;
+ aainfo[8]._frame = kernel_anim[aa[8]].frame;
+ int16 f = aainfo[8]._frame;
+
+ if (f == 11) {
+ result = 9;
+ } else if (f < 11) {
+ if (f == 1) {
+ digi_play_build(210, 'R', 1, 1);
+ scratch._a6 = 2;
+ } else if (f == 3) {
+ result = 1;
+ } else if (f == 9) {
+ digi_play_build(210, 'E', 1, 1);
+ scratch._a6 = 3;
+ }
+ }
+
+ if (result >= 0) {
+ aainfo[8]._frame = result;
+ kernel_reset_animation(aa[8], result);
+ }
+}
+
+static void room_210_anim5() {
+ if (kernel_anim[aa[2]].frame != aainfo[2]._frame) {
+ aainfo[2]._frame = kernel_anim[aa[2]].frame;
+ int16 f = aainfo[2]._frame;
+ if (f == 1) {
+ aainfo[2]._frame = 0;
+ kernel_reset_animation(aa[2], 0);
+ } else if (f == 52 || f == 78) {
+ aainfo[2]._frame = 0;
+ kernel_reset_animation(aa[2], 0);
+ kernel_timing_trigger(imath_random(100, 300), 103);
+ }
+ }
+
+ if (kernel_anim[aa[3]].frame != aainfo[3]._frame) {
+ aainfo[3]._frame = kernel_anim[aa[3]].frame;
+ int16 f = aainfo[3]._frame;
+ if (f == 1) {
+ aainfo[3]._frame = 0;
+ kernel_reset_animation(aa[3], 0);
+ } else if (f == 19 || f == 63) {
+ aainfo[3]._frame = 0;
+ kernel_reset_animation(aa[3], 0);
+ kernel_timing_trigger(imath_random(100, 300), 104);
+ }
+ }
+
+ if (kernel_anim[aa[4]].frame != aainfo[4]._frame) {
+ aainfo[4]._frame = kernel_anim[aa[4]].frame;
+ int16 f = aainfo[4]._frame;
+ if (f == 1) {
+ aainfo[4]._frame = 0;
+ kernel_reset_animation(aa[4], 0);
+ } else if (f == 20 || f == 82) {
+ aainfo[4]._frame = 0;
+ kernel_reset_animation(aa[4], 0);
+ kernel_timing_trigger(imath_random(100, 300), 105);
+ }
+ }
+
+ if (kernel_anim[aa[5]].frame != aainfo[5]._frame) {
+ aainfo[5]._frame = kernel_anim[aa[5]].frame;
+ int16 f = aainfo[5]._frame;
+ if (f == 1) {
+ aainfo[5]._frame = 0;
+ kernel_reset_animation(aa[5], 0);
+ } else if (f == 34 || f == 57) {
+ aainfo[5]._frame = 0;
+ kernel_reset_animation(aa[5], 0);
+ kernel_timing_trigger(imath_random(100, 300), 106);
+ }
+ }
+
+ if (kernel_anim[aa[6]].frame == aainfo[6]._frame)
+ return;
+ aainfo[6]._frame = kernel_anim[aa[6]].frame;
+ int16 f = aainfo[6]._frame;
+ if (f == 1) {
+ aainfo[6]._frame = 0;
+ kernel_reset_animation(aa[6], 0);
+ } else if (f == 27 || f == 53) {
+ aainfo[6]._frame = 0;
+ kernel_reset_animation(aa[6], 0);
+ kernel_timing_trigger(imath_random(100, 300), 107);
+ }
+}
+
+static void room_210_anim6(int roomNum) {
+ if (roomNum == 106) {
+ if (global[g021] != 0) { new_room = 106; return; }
+ } else if (roomNum == 203) {
+ if (global[g040] != 0) { new_room = 203; return; }
+ } else if (roomNum == 302) {
+ if (global[g063] != 0) { new_room = 302; return; }
+ } else if (roomNum == 305) {
+ if (global[g060] != 0) { new_room = 305; return; }
+ } else if (roomNum == 307) {
+ if (global[g061] != 0) {
+ if (global[g064] != 0)
+ new_room = 322;
+ else
+ new_room = 307;
+ return;
+ }
+ } else {
+ return;
+ }
+ kernel_timing_trigger(imath_random(40, 80), 108);
+}
+
+static void room_210_anim7() {
+ switch (scratch._aa) {
+ case 1:
+ aa[0] = kernel_run_animation(kernel_name('a', 1), 110);
+ aainfo[0]._active = -1;
+ scratch._92 = 65;
+ break;
+ case 2:
+ aa[0] = kernel_run_animation(kernel_name('a', 2), 110);
+ aainfo[0]._active = -1;
+ scratch._92 = 60;
+ break;
+ case 3:
+ aa[0] = kernel_run_animation(kernel_name('a', 3), 110);
+ aainfo[0]._active = -1;
+ scratch._92 = 64;
+ break;
+ case 4:
+ aa[0] = kernel_run_animation(kernel_name('a', 4), 110);
+ aainfo[0]._active = -1;
+ scratch._92 = 70;
+ break;
+ case 5:
+ aa[0] = kernel_run_animation(kernel_name('a', 5), 110);
+ aainfo[0]._active = -1;
+ scratch._92 = 89;
+ break;
+ default:
+ break;
+ }
+ kernel_timing_trigger(1, 109);
+}
+
+static void room_210_daemon() {
+ switch (kernel.trigger) {
+ case 7:
+ switch (scratch._a6) {
+ case 1:
+ aainfo[7]._frame = 6;
+ kernel_reset_animation(aa[7], 6);
+ break;
+ case 2:
+ aainfo[8]._frame = 4;
+ kernel_reset_animation(aa[8], 4);
+ break;
+ case 3:
+ aainfo[8]._frame = 12;
+ kernel_reset_animation(aa[8], 12);
+ if (digi_val1 != 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);
+ break;
+ }
+ scratch._a6 = 0;
+ break;
+
+ case 26:
+ kernel_abort_animation(scratch._a2);
+ kernel_abort_animation(scratch._a4);
+ scratch._a2 = -1;
+ switch (scratch._90) {
+ case 1:
+ aa[1] = kernel_run_animation(kernel_name('z', 1), 101);
+ aainfo[1]._active = -1;
+ scratch._94 = 36;
+ break;
+ case 2:
+ aa[1] = kernel_run_animation(kernel_name('z', 2), 101);
+ aainfo[1]._active = -1;
+ scratch._94 = 35;
+ break;
+ case 3:
+ aa[1] = kernel_run_animation(kernel_name('z', 3), 101);
+ aainfo[1]._active = -1;
+ scratch._94 = 59;
+ break;
+ case 4:
+ aa[1] = kernel_run_animation(kernel_name('z', 4), 101);
+ aainfo[1]._active = -1;
+ scratch._94 = 71;
+ break;
+ case 5:
+ aa[1] = kernel_run_animation(kernel_name('z', 5), 101);
+ aainfo[1]._active = -1;
+ scratch._94 = 84;
+ break;
+ }
+ aainfo[1]._active = -1;
+ aainfo[1]._frame = 2;
+ kernel_reset_animation(aa[1], 2);
+ kernel_synch(KERNEL_ANIM, aa[1], KERNEL_NOW, 0);
+ kernel_timing_trigger(1, 109);
+ break;
+
+ case 100:
+ kernel_abort_animation(aa[0]);
+ aainfo[0]._active = 0;
+ if (flags[11] == 1) {
+ aa[8] = kernel_run_animation(kernel_name('x', 1), 112);
+ kernel_synch(KERNEL_ANIM, aa[8], KERNEL_NOW, 0);
+ aainfo[8]._active = -1;
+ scratch._a8 = 0;
+ kernel_timing_trigger(1, 109);
+ } else {
+ global[g131] = -1; global[g141] = -1;
+ kernel_reset_animation(scratch._a2, 1);
+ kernel_synch(KERNEL_ANIM, scratch._a2, KERNEL_NOW, 0);
+ kernel_reset_animation(scratch._a4, 1);
+ kernel_synch(KERNEL_ANIM, scratch._a4, KERNEL_NOW, 0);
+ player.walker_visible = -1;
+ global[g133] = 0; global[g143] = 0;
+ kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
+ player.commands_allowed = -1;
+ scratch._a8 = -1;
+ }
+ break;
+
+ case 101:
+ kernel_abort_animation(aa[1]);
+ aainfo[1]._active = 0;
+ switch (scratch._90) {
+ case 1:
+ room_210_anim6(global[g041]);
+ scratch._aa = 1;
+ break;
+ case 2:
+ room_210_anim6(global[g042]);
+ scratch._aa = 2;
+ break;
+ case 3:
+ room_210_anim6(global[g043]);
+ scratch._aa = 3;
+ break;
+ case 4:
+ room_210_anim6(global[g044]);
+ scratch._aa = 4;
+ break;
+ case 5:
+ room_210_anim6(global[g045]);
+ scratch._aa = 5;
+ break;
+ default:
+ speech_ems_play("d5", kernel.trigger, false);
+ break;
+ }
+ break;
+
+ case 102:
+ break;
+
+ case 103:
+ aainfo[2]._frame = imath_random(0, 1) ? 60 : 2;
+ kernel_reset_animation(aa[2], aainfo[2]._frame);
+ break;
+
+ case 104:
+ aainfo[3]._frame = imath_random(0, 1) ? 40 : 2;
+ kernel_reset_animation(aa[3], aainfo[3]._frame);
+ break;
+
+ case 105:
+ aainfo[4]._frame = imath_random(0, 1) ? 30 : 2;
+ kernel_reset_animation(aa[4], aainfo[4]._frame);
+ break;
+
+ case 106:
+ aainfo[5]._frame = imath_random(0, 1) ? 40 : 2;
+ kernel_reset_animation(aa[5], aainfo[5]._frame);
+ break;
+
+ case 107:
+ aainfo[6]._frame = imath_random(0, 1) ? 30 : 2;
+ kernel_reset_animation(aa[6], aainfo[6]._frame);
+ break;
+
+ case 108:
+ room_210_anim7();
+ break;
+
+ case 109:
+ digi_initial_volume(60);
+ digi_play_build(210, '_', 1, 3);
+ digi_val2 = 100;
+ break;
+
+ case 110:
+ kernel_abort_animation(aa[0]);
+ aainfo[0]._active = 0;
+ aa[7] = kernel_run_animation(kernel_name('a', 0), 111);
+ kernel_synch(KERNEL_ANIM, aa[7], KERNEL_NOW, 0);
+ aainfo[7]._active = -1;
+ scratch._a8 = 0;
+ kernel_timing_trigger(1, 109);
+ break;
+
+ case 111:
+ global[g131] = -1;
+ global[g141] = -1;
+ kernel_reset_animation(scratch._a2, 1);
+ kernel_synch(KERNEL_ANIM, scratch._a2, KERNEL_NOW, 0);
+ kernel_reset_animation(scratch._a4, 1);
+ kernel_synch(KERNEL_ANIM, scratch._a4, KERNEL_NOW, 0);
+ player.walker_visible = -1;
+ global[g133] = 0; global[g143] = 0;
+ kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
+ player.commands_allowed = -1;
+ scratch._a8 = -1;
+ kernel_timing_trigger(1, 109);
+ break;
+
+ case 112:
+ kernel_abort_animation(aa[8]);
+ aainfo[8]._active = 0;
+ global[g131] = -1;
+ global[g141] = -1;
+ kernel_reset_animation(scratch._a2, 1);
+ kernel_synch(KERNEL_ANIM, scratch._a2, KERNEL_NOW, 0);
+ kernel_reset_animation(scratch._a4, 1);
+ kernel_synch(KERNEL_ANIM, scratch._a4, KERNEL_NOW, 0);
+ player.walker_visible = -1;
+ global[g133] = 0;
+ global[g143] = 0;
+ kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
+ player.commands_allowed = -1;
+ scratch._a8 = -1;
+ break;
+
+ case 114:
+ digi_play_build(210, 'B', 1, 1);
+ scratch._a6 = 1;
+ break;
+
+ default:
+ if (kernel.trigger >= 100)
+ speech_ems_play("d4", kernel.trigger, false);
+ break;
+ }
+
+ if (scratch._a2 >= 0) {
+ global_anim1(7, scratch._a2, global[g131], &global[g132]);
+ global_anim2(9, scratch._a4, global[g141], &global[g142]);
+ }
+ if (aainfo[0]._active != 0) room_210_anim1();
+ if (aainfo[1]._active != 0) room_210_anim2();
+ if (aainfo[7]._active != 0) room_210_anim3();
+ if (aainfo[8]._active != 0) room_210_anim4();
+ room_210_anim5();
}
static void room_210_parser() {
+ if (global[walker_converse_state] != 0) {
+ player.commands_allowed = 0;
+ digi_play_build_ii('c', 1, 1);
+ scratch._a6 = 4;
+ player.command_ready = false;
+ return;
+ }
+
+ if (global[player_selected_object] >= 0) {
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(78, 85, 0)) {
+ player.commands_allowed = 0;
+ player.walker_visible = 0;
+ global[g150] = -1;
+ scratch._90 = 1;
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(78, 86, 0)) {
+ player.commands_allowed = 0;
+ player.walker_visible = 0;
+ global[g150] = -1;
+ scratch._90 = 2;
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(78, 87, 0)) {
+ player.commands_allowed = 0;
+ player.walker_visible = 0;
+ global[g150] = -1;
+ scratch._90 = 3;
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(78, 88, 0)) {
+ player.commands_allowed = 0;
+ player.walker_visible = 0;
+ global[g150] = -1;
+ scratch._90 = 4;
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(78, 89, 0)) {
+ player.commands_allowed = 0;
+ player.walker_visible = 0;
+ global[g150] = -1;
+ scratch._90 = 5;
+ player.command_ready = false;
+ return;
+ }
}
void room_210_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);
+ s.syncAsSint16LE(scratch._aa);
}
void room_210_preload() {
room_init_code_pointer = room_210_init;
- room_pre_parser_code_pointer = room_210_pre_parser;
+ room_pre_parser_code_pointer = NULL;
room_parser_code_pointer = room_210_parser;
room_daemon_code_pointer = room_210_daemon;
Commit: 0b5dd4d5820fc4ab298d0f60ac3b3e8fb32f6681
https://github.com/scummvm/scummvm/commit/0b5dd4d5820fc4ab298d0f60ac3b3e8fb32f6681
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-08T10:47:36+10:00
Commit Message:
MADS: FOREST: Implemented rooms 211 and 220
Changed paths:
engines/mads/madsv2/forest/rooms/room211.cpp
engines/mads/madsv2/forest/rooms/room220.cpp
diff --git a/engines/mads/madsv2/forest/rooms/room211.cpp b/engines/mads/madsv2/forest/rooms/room211.cpp
index cf22e3282b7..a572b5b546d 100644
--- a/engines/mads/madsv2/forest/rooms/room211.cpp
+++ b/engines/mads/madsv2/forest/rooms/room211.cpp
@@ -19,16 +19,12 @@
*
*/
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/digi.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/sound.h"
-#include "mads/madsv2/core/text.h"
-#include "mads/madsv2/forest/mads/inventory.h"
-#include "mads/madsv2/forest/mads/sounds.h"
-#include "mads/madsv2/forest/mads/words.h"
+#include "mads/madsv2/core/matte.h"
+#include "mads/madsv2/core/midi.h"
+#include "mads/madsv2/core/player.h"
#include "mads/madsv2/forest/global.h"
#include "mads/madsv2/forest/rooms/section1.h"
#include "mads/madsv2/forest/rooms/room211.h"
@@ -39,10 +35,11 @@ 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;
};
static Scratch scratch;
@@ -55,21 +52,75 @@ static Scratch scratch;
static void room_211_init() {
+ midi_stop();
+ global[player_score] = -1;
+ viewing_at_y = 22;
+ global[g009] = 0;
+ player.walker_visible = 0;
+ player.commands_allowed = 0;
+
+ for (int i = 0; i < 10; i++) {
+ aainfo[i]._active = 0;
+ aainfo[i]._frame = -1;
+ }
+
+ kernel_timing_trigger(5, 100);
+}
+
+static void room_211_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 (f == 75) {
+ new_room = 221;
+ return;
+ }
+ if (f > 75)
+ return;
+
+ if (f == 3) {
+ digi_play_build(211, '_', 500, 1);
+ } else if (f == 13 || f == 19 || f == 23 || f == 28) {
+ digi_play_build(220, '_', 1, 2);
+ } else if (f == 34) {
+ digi_play_build(211, '_', 700, 1);
+ }
}
static void room_211_daemon() {
+ switch (kernel.trigger) {
+ case 100:
+ aa[0] = kernel_run_animation(kernel_name('y', 1), 0);
+ aainfo[0]._active = -1;
+ scratch._8c = 75;
+ break;
+ case 101:
+ digi_play_build(221, 'e', 6, 1);
+ break;
+ default:
+ break;
+ }
+
+ if (aainfo[0]._active != 0)
+ room_211_anim1();
}
static void room_211_pre_parser() {
+ // No implementation
}
static void room_211_parser() {
+ // No implementation
}
void room_211_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);
}
void room_211_preload() {
diff --git a/engines/mads/madsv2/forest/rooms/room220.cpp b/engines/mads/madsv2/forest/rooms/room220.cpp
index 09982c1aa9a..4973007164b 100644
--- a/engines/mads/madsv2/forest/rooms/room220.cpp
+++ b/engines/mads/madsv2/forest/rooms/room220.cpp
@@ -1,4 +1,4 @@
-/* ScummVM - Graphic Adventure Engine
+/* 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
@@ -19,16 +19,12 @@
*
*/
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/digi.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/sound.h"
-#include "mads/madsv2/core/text.h"
-#include "mads/madsv2/forest/mads/inventory.h"
-#include "mads/madsv2/forest/mads/sounds.h"
-#include "mads/madsv2/forest/mads/words.h"
+#include "mads/madsv2/core/matte.h"
+#include "mads/madsv2/core/midi.h"
+#include "mads/madsv2/core/player.h"
#include "mads/madsv2/forest/global.h"
#include "mads/madsv2/forest/rooms/section1.h"
#include "mads/madsv2/forest/rooms/room220.h"
@@ -39,10 +35,20 @@ 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;
};
static Scratch scratch;
@@ -55,21 +61,192 @@ static Scratch scratch;
static void room_220_init() {
+ global[player_score] = -1;
+ global[g009] = -1;
+ global_digi_play(10);
+ viewing_at_y = 22;
+ player.walker_visible = 0;
+ player.commands_allowed = 0;
+
+ for (int i = 0; i < 10; i++) {
+ aainfo[i]._active = 0;
+ aainfo[i]._frame = -1;
+ }
+
+ aa[0] = kernel_run_animation("*RM220Y11", 0);
+ aainfo[0]._active = -1;
+ scratch._92 = 121;
+}
+
+static void room_220_anim1() {
+ int16 result = -1;
+
+ if (kernel_anim[aa[0]].frame == aainfo[0]._frame)
+ return;
+ aainfo[0]._frame = kernel_anim[aa[0]].frame;
+ int16 f = aainfo[0]._frame;
+
+ if (f == 121) {
+ kernel_abort_animation(aa[0]);
+ aainfo[0]._active = 0;
+ global[g009] = -1;
+ global_digi_play(15);
+ aa[1] = kernel_run_animation("*RM220Y12", 0);
+ aainfo[1]._active = -1;
+ scratch._92 = 55;
+ kernel_synch(KERNEL_ANIM, aa[0], KERNEL_ANIM, aa[1]);
+ } else if (f < 121) {
+ if (f == 52) {
+ result = 51;
+ } else if (f < 52) {
+ if (f == 43) {
+ result = 41;
+ } else if (f < 43) {
+ if (f == 41) {
+ digi_play_build(220, 'E', 1, 1);
+ scratch._9e = 3;
+ }
+ } else {
+ if (f == 45) {
+ result = 44;
+ } else if (f == 47) {
+ digi_play_build(220, 'R', 1, 1);
+ scratch._9e = 1;
+ } else if (f == 50) {
+ result = 47;
+ }
+ }
+ } else {
+ if (f == 53) {
+ digi_play_build(220, 'B', 1, 1);
+ scratch._9e = 4;
+ } else if (f == 57) {
+ result = 53;
+ } else if (f == 58) {
+ result = 57;
+ } else if (f == 85 || f == 92 || f == 98 || f == 103) {
+ digi_play_build(220, '_', 1, 2);
+ } else if (f == 115) {
+ midi_stop();
+ }
+ }
+ }
+
+ if (result >= 0) {
+ aainfo[0]._frame = result;
+ kernel_reset_animation(aa[0], result);
+ }
+}
+
+static void room_220_anim2() {
+ int16 result = -1;
+
+ if (kernel_anim[aa[1]].frame == aainfo[1]._frame)
+ return;
+ aainfo[1]._frame = kernel_anim[aa[1]].frame;
+ int16 f = aainfo[1]._frame;
+
+ if (f == 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);
+ }
+ }
+ }
+
+ if (result >= 0) {
+ aainfo[1]._frame = result;
+ kernel_reset_animation(aa[1], result);
+ }
}
static void room_220_daemon() {
+ switch (kernel.trigger) {
+ case 7:
+ kernel_timing_trigger(40, 102);
+ switch (scratch._9e) {
+ case 1:
+ aainfo[0]._frame = 51;
+ kernel_reset_animation(aa[0], 51);
+ break;
+ case 3:
+ aainfo[0]._frame = 44;
+ kernel_reset_animation(aa[0], 44);
+ break;
+ case 4:
+ aainfo[0]._frame = 57;
+ kernel_reset_animation(aa[0], 57);
+ break;
+ default:
+ break;
+ }
+ break;
+ case 102:
+ switch (scratch._9e) {
+ case 1:
+ aainfo[0]._frame = 52;
+ kernel_reset_animation(aa[0], 52);
+ break;
+ case 3:
+ aainfo[0]._frame = 46;
+ kernel_reset_animation(aa[0], 46);
+ break;
+ case 4:
+ aainfo[0]._frame = 58;
+ kernel_reset_animation(aa[0], 58);
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (aainfo[0]._active != 0)
+ room_220_anim1();
+ if (aainfo[1]._active != 0)
+ room_220_anim2();
}
static void room_220_pre_parser() {
+ // No implementation
}
static void room_220_parser() {
+ // No implementation
}
void room_220_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);
}
void room_220_preload() {
More information about the Scummvm-git-logs
mailing list