[Scummvm-git-logs] scummvm master -> b31901941fbafdf084e7f58a9e054541ffbe470b
dreammaster
noreply at scummvm.org
Mon May 25 23:32:38 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
3bf6dd4722 MADS: DRAGONSPHERE: Room scratch definitions cleanups
b31901941f MADS: DRAGONSPHERE: Shift MPSInstaller into core/ to share with Dragonsphere
Commit: 3bf6dd47226880dc32a941f0d2b5bc7f3d2de365
https://github.com/scummvm/scummvm/commit/3bf6dd47226880dc32a941f0d2b5bc7f3d2de365
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-26T09:16:48+10:00
Commit Message:
MADS: DRAGONSPHERE: Room scratch definitions cleanups
Changed paths:
engines/mads/madsv2/dragonsphere/rooms/room108.cpp
engines/mads/madsv2/dragonsphere/rooms/room109.cpp
engines/mads/madsv2/dragonsphere/rooms/room110.cpp
engines/mads/madsv2/dragonsphere/rooms/room112.cpp
engines/mads/madsv2/dragonsphere/rooms/room113.cpp
engines/mads/madsv2/dragonsphere/rooms/room114.cpp
engines/mads/madsv2/dragonsphere/rooms/room115.cpp
engines/mads/madsv2/dragonsphere/rooms/room116.cpp
engines/mads/madsv2/dragonsphere/rooms/room117.cpp
engines/mads/madsv2/dragonsphere/rooms/room118.cpp
engines/mads/madsv2/dragonsphere/rooms/room119.cpp
engines/mads/madsv2/dragonsphere/rooms/room201.cpp
engines/mads/madsv2/dragonsphere/rooms/room203.cpp
engines/mads/madsv2/dragonsphere/rooms/room401.cpp
engines/mads/madsv2/dragonsphere/rooms/room402.cpp
engines/mads/madsv2/dragonsphere/rooms/room403.cpp
engines/mads/madsv2/dragonsphere/rooms/room404.cpp
engines/mads/madsv2/dragonsphere/rooms/room405.cpp
engines/mads/madsv2/dragonsphere/rooms/room406.cpp
engines/mads/madsv2/dragonsphere/rooms/room407.cpp
engines/mads/madsv2/dragonsphere/rooms/room408.cpp
engines/mads/madsv2/dragonsphere/rooms/room409.cpp
engines/mads/madsv2/dragonsphere/rooms/room410.cpp
engines/mads/madsv2/dragonsphere/rooms/room411.cpp
engines/mads/madsv2/dragonsphere/rooms/room412.cpp
engines/mads/madsv2/dragonsphere/rooms/room454.cpp
engines/mads/madsv2/dragonsphere/rooms/room601.cpp
engines/mads/madsv2/dragonsphere/rooms/room603.cpp
engines/mads/madsv2/dragonsphere/rooms/room604.cpp
engines/mads/madsv2/dragonsphere/rooms/room605.cpp
engines/mads/madsv2/dragonsphere/rooms/room606.cpp
engines/mads/madsv2/dragonsphere/rooms/room607.cpp
engines/mads/madsv2/dragonsphere/rooms/room609.cpp
engines/mads/madsv2/dragonsphere/rooms/room612.cpp
engines/mads/madsv2/dragonsphere/rooms/room613.cpp
engines/mads/madsv2/dragonsphere/rooms/room614.cpp
engines/mads/madsv2/dragonsphere/rooms/room909.cpp
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room108.cpp b/engines/mads/madsv2/dragonsphere/rooms/room108.cpp
index e590bef94c5..c56d37b8963 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room108.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room108.cpp
@@ -38,11 +38,6 @@ namespace MADSV2 {
namespace Dragonsphere {
namespace Rooms {
-#define local (&scratch)
-#define ss local->sprite
-#define seq local->sequence
-#define aa local->animation
-
struct Scratch {
int16 sprite[15]; /* Sprite series handles */
int16 sequence[15]; /* Sequence handles */
@@ -52,6 +47,13 @@ struct Scratch {
int16 temp; /* used for synching purposes */
};
+static Scratch scratch;
+
+#define local (&scratch)
+#define ss local->sprite
+#define seq local->sequence
+#define aa local->animation
+
/* ========================= Sprites ========================= */
#define fx_door 1 /* rm108x2 */
@@ -87,8 +89,6 @@ struct Scratch {
#define BOTTOM_OF_STAIRS_X 154
#define BOTTOM_OF_STAIRS_Y 89
-static Scratch scratch;
-
static void room_108_init() {
/* Load sprite series */
ss[fx_door] = kernel_load_series(kernel_name('x', 2), false);
@@ -133,7 +133,6 @@ static void get_random_eyes(int16 *new_frame) {
random = imath_random(0, 15);
switch (random) {
-
case 0:
*new_frame = 0;
break;
@@ -277,7 +276,7 @@ static void room_108_daemon() {
}
}
-void room_108_pre_parser(void) {
+static void room_108_pre_parser(void) {
if (player_said_1(doorway_to_cell) && player.need_to_walk) {
if (!player_said_1(walk_through)) {
player.need_to_walk = false;
@@ -289,8 +288,7 @@ void room_108_pre_parser(void) {
}
}
-
-void room_108_parser(void) {
+static void room_108_parser(void) {
int temp;
if (player.look_around) {
@@ -442,7 +440,6 @@ done:
;
}
-
void room_108_synchronize(Common::Serializer &s) {
for (int16 &v : scratch.sprite) s.syncAsSint16LE(v);
for (int16 &v : scratch.sequence) s.syncAsSint16LE(v);
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room109.cpp b/engines/mads/madsv2/dragonsphere/rooms/room109.cpp
index 9d5f9967775..c4253a47164 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room109.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room109.cpp
@@ -55,13 +55,13 @@ struct Scratch {
int16 anim_1_running;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
/* ========================= Sprites ========================= */
#define fx_door 0 /* rm109x0 */
@@ -339,7 +339,6 @@ static void process_conversation_queen() {
local->queen_talk_count = 0;
}
-
static void room_109_pre_parser() {
if (player_said_1(door_to_guardroom)) {
if (!player_said_1(walk_through)) {
@@ -373,7 +372,7 @@ static void room_109_parser() {
goto handled;
}
- /* take out later */
+ // Hidden dev hack that was forgotten to be removed
if (player_said_2(talk_to, floor_grate)) {
new_room = 117;
goto handled;
@@ -420,28 +419,20 @@ static void room_109_parser() {
}
}
- if ((player_said_1(open) || player_said_1(pull) ||
- player_said_1(push) || player_said_1(take)) &&
- player_said_1(bedding)) {
- /* if (player_not_seal) */
+ if ((player_said_1(open) || player_said_1(pull) || player_said_1(push) ||
+ player_said_1(take)) && player_said_1(bedding)) {
text_show(10908);
goto handled;
}
if (player_said_2(pull, manacles)) {
- /* if (player_not_seal) */
text_show(10910);
goto handled;
}
- if ((player_said_1(open) || player_said_1(pull) ||
- player_said_1(push)) &&
- player_said_1(floor_grate)) {
- /* if (player_not_seal) */
+ if ((player_said_1(open) || player_said_1(pull) || player_said_1(push)) &&
+ player_said_1(floor_grate)) {
text_show(10905);
- /* } else {
- text_show(10914);
- }*/
goto handled;
}
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room110.cpp b/engines/mads/madsv2/dragonsphere/rooms/room110.cpp
index 7d0d482686c..fab538e75fe 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room110.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room110.cpp
@@ -95,14 +95,13 @@ struct Scratch {
int16 speech_playing;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
-
/* ========================= Sprites ========================= */
#define fx_king_in_well 1 /* rm110a */
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room112.cpp b/engines/mads/madsv2/dragonsphere/rooms/room112.cpp
index e9423b51560..e103a255f70 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room112.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room112.cpp
@@ -46,13 +46,13 @@ struct Scratch {
int16 animation[4]; /* Animation handles */
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
/* ======================== Triggers ========================= */
#define ROOM_112_DONE_HEALING 60
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room113.cpp b/engines/mads/madsv2/dragonsphere/rooms/room113.cpp
index 84e5e31813c..49f327c3c99 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room113.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room113.cpp
@@ -55,14 +55,13 @@ struct Scratch {
int16 clicked_on;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
-
/* ========================= Sprites ========================= */
#define fx_pid_descends 1 /* rm113b2 */
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room114.cpp b/engines/mads/madsv2/dragonsphere/rooms/room114.cpp
index 6089f375a14..5f8979e24d1 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room114.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room114.cpp
@@ -52,14 +52,13 @@ struct Scratch {
int16 anim_1_running;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
-
/* ========================= Sprites ========================= */
#define fx_sconce_fire 1 /* rm114y */
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room115.cpp b/engines/mads/madsv2/dragonsphere/rooms/room115.cpp
index 76a02ce0801..d3071fe0230 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room115.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room115.cpp
@@ -55,13 +55,13 @@ struct Scratch {
char message[20]; /* String to say to dog */
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
/* ========================= Sprites ========================= */
#define fx_fire 1 /* rm115x0 */
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room116.cpp b/engines/mads/madsv2/dragonsphere/rooms/room116.cpp
index d75a78bd5e5..32927ceac90 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room116.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room116.cpp
@@ -64,14 +64,13 @@ struct Scratch {
int16 invoked_ring;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
-
/* ========================= Sprites ========================= */
#define fx_door 1 /* rm116x */
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room117.cpp b/engines/mads/madsv2/dragonsphere/rooms/room117.cpp
index ecd3435202a..9d8872f1faa 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room117.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room117.cpp
@@ -46,13 +46,13 @@ struct Scratch {
int16 animation[4]; /* Animation handles */
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
/* ========================= Sprites ========================= */
#define fx_swim_to_left 1 /* rm117c0 */
@@ -134,11 +134,9 @@ static void room_117_daemon() {
}
static void room_117_pre_parser() {
- // No implementation
}
static void room_117_parser() {
- // No implementation
}
void room_117_synchronize(Common::Serializer &s) {
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room118.cpp b/engines/mads/madsv2/dragonsphere/rooms/room118.cpp
index 5b204deb6c3..7c2b94e6cfa 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room118.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room118.cpp
@@ -47,13 +47,13 @@ struct Scratch {
int16 guard_id; /* hotspot id for guard */
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
/* ========================= Sprites ========================= */
#define fx_guard 1 /* rm118e */
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room119.cpp b/engines/mads/madsv2/dragonsphere/rooms/room119.cpp
index 5ac9bc5d6fa..37843b0cdd7 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room119.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room119.cpp
@@ -57,14 +57,13 @@ struct Scratch {
int16 invoked_ring;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
-
/* ========================= Sprites ========================= */
#define fx_torch_fire 0 /* rm109x1 */
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room201.cpp b/engines/mads/madsv2/dragonsphere/rooms/room201.cpp
index b832f0f4255..19cb6c77ad3 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room201.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room201.cpp
@@ -124,14 +124,13 @@ struct Scratch {
byte cut_scene;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
-
/* ========================= Sprite Series =================== */
#define fx_lg_rock 0 /* rm201x0 */
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room203.cpp b/engines/mads/madsv2/dragonsphere/rooms/room203.cpp
index b4857f92be1..b0a24bab938 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room203.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room203.cpp
@@ -72,12 +72,14 @@ struct Scratch {
int16 prevent;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
+/* ========================= Sprite Series =================== */
#define fx_rock_l 0
#define fx_rock_r 1
@@ -87,6 +89,8 @@ static Scratch scratch;
#define fx_face_right 5
#define fx_take 6
+/* ======================== Others ========================== */
+
#define ROOM_203_EYE 60
#define ROOM_203_FACE_LEFT 64
#define ROOM_203_FACE_RIGHT 68
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room401.cpp b/engines/mads/madsv2/dragonsphere/rooms/room401.cpp
index c875453c11d..b0e28a5f590 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room401.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room401.cpp
@@ -54,13 +54,13 @@ struct Scratch {
int16 cut_scene;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
#define fx_red_blue_tent 0
#define fx_bones 1
#define fx_stone_marker 2
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room402.cpp b/engines/mads/madsv2/dragonsphere/rooms/room402.cpp
index d493ef96746..2e448da5c94 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room402.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room402.cpp
@@ -46,13 +46,13 @@ struct Scratch {
int16 moving;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-static Scratch scratch;
-
#define fx_red_rocks 1
#define fx_distant_dune 2
#define fx_medium_dune 3
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room403.cpp b/engines/mads/madsv2/dragonsphere/rooms/room403.cpp
index b0a781dcfb9..99ba19a2ecd 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room403.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room403.cpp
@@ -45,6 +45,8 @@ struct Scratch {
int16 moving;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -110,8 +112,6 @@ struct Scratch {
#define FROM_WEST_X_2 15
#define FROM_WEST_Y_2 143
-static Scratch scratch;
-
static void room_403_init() {
int count;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room404.cpp b/engines/mads/madsv2/dragonsphere/rooms/room404.cpp
index dfa45244a9d..35a5089786b 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room404.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room404.cpp
@@ -59,6 +59,8 @@ struct Scratch {
int16 num;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -82,8 +84,6 @@ struct Scratch {
#define WALK_4_X 1
#define WALK_4_Y 104
-static Scratch scratch;
-
static void set_dune_1_position() {
int center;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room405.cpp b/engines/mads/madsv2/dragonsphere/rooms/room405.cpp
index 0b7dea81c39..44608f20256 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room405.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room405.cpp
@@ -74,6 +74,8 @@ struct Scratch {
int16 anim_6_running;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -117,8 +119,6 @@ struct Scratch {
#define SHAMAN_X 96
#define SHAMAN_Y 137
-static Scratch scratch;
-
static void handle_animation_guard() {
int guard_reset_frame;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room406.cpp b/engines/mads/madsv2/dragonsphere/rooms/room406.cpp
index ca62d226928..67858287010 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room406.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room406.cpp
@@ -94,6 +94,8 @@ struct Scratch {
int16 panning;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -140,8 +142,6 @@ struct Scratch {
#define PANNING_TO_DANCE 1
#define PANNING_AWAY_FROM_DANCE 2
-static Scratch scratch;
-
static void set_406_mount_position() {
int difference;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room407.cpp b/engines/mads/madsv2/dragonsphere/rooms/room407.cpp
index b32e42b4e57..1f00b5e3af6 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room407.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room407.cpp
@@ -75,12 +75,13 @@ struct Scratch {
int16 will_give;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-
/* ========================= Sprite Series =================== */
#define fx_half_bottle 0 /* rm407p0 */
@@ -117,8 +118,6 @@ struct Scratch {
#define CAN_GIVE 1
#define HOSIED 2
-static Scratch scratch;
-
static void update_scores() {
Common::strcpy_s(local->his_score, "\0");
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room408.cpp b/engines/mads/madsv2/dragonsphere/rooms/room408.cpp
index 56cf4f2fe1d..ecd1debe570 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room408.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room408.cpp
@@ -62,13 +62,13 @@ struct Scratch {
int16 face_7_on;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-
-
/* ========================= Sprite Series =================== */
#define fx_pid 0 /* rm408b0 */
@@ -102,8 +102,6 @@ struct Scratch {
#define CONV_46_PID 46
-static Scratch scratch;
-
static void room_408_init() {
global[perform_displacements] = true;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room409.cpp b/engines/mads/madsv2/dragonsphere/rooms/room409.cpp
index c128a920863..5142802a7de 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room409.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room409.cpp
@@ -58,6 +58,8 @@ struct Scratch {
int16 fire;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -104,8 +106,6 @@ struct Scratch {
#define FIRE 60
-static Scratch scratch;
-
static void which_pillar_409(int *it, int *new_x, int *new_y, int *adjoining) {
int offset;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room410.cpp b/engines/mads/madsv2/dragonsphere/rooms/room410.cpp
index 09773800ec8..bd5c4170781 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room410.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room410.cpp
@@ -61,6 +61,8 @@ struct Scratch {
int16 face_4_on;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -103,8 +105,6 @@ struct Scratch {
#define PLAYER_X_FROM_409 137
#define PLAYER_Y_FROM_409 149
-static Scratch scratch;
-
static void room_410_init() {
local->snake_1_on = false;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room411.cpp b/engines/mads/madsv2/dragonsphere/rooms/room411.cpp
index c293064ed25..1787886ed7a 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room411.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room411.cpp
@@ -66,6 +66,8 @@ struct Scratch {
int16 prevent;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -96,8 +98,6 @@ struct Scratch {
#define BIRD_X 122
#define BIRD_Y 95
-static Scratch scratch;
-
static void handle_animation_bird_1() {
int bird_1_reset_frame;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room412.cpp b/engines/mads/madsv2/dragonsphere/rooms/room412.cpp
index d596cbcaf85..8b4885e159e 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room412.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room412.cpp
@@ -40,6 +40,8 @@ struct Scratch {
int16 animation[4];
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -48,8 +50,6 @@ struct Scratch {
#define fx_test 0
#define fx_test_2 1
-static Scratch scratch;
-
static void room_412_init() {
global[perform_displacements] = true;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room454.cpp b/engines/mads/madsv2/dragonsphere/rooms/room454.cpp
index bc021d9e50b..bae5903ef3f 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room454.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room454.cpp
@@ -51,6 +51,8 @@ struct Scratch {
int16 anim_0_running;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -76,8 +78,6 @@ struct Scratch {
#define WALK_4_X 1
#define WALK_4_Y 104
-static Scratch scratch;
-
static void set_dune_3_position() {
int center;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room601.cpp b/engines/mads/madsv2/dragonsphere/rooms/room601.cpp
index f81c5bde9ed..7249525e52e 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room601.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room601.cpp
@@ -108,7 +108,9 @@ struct Scratch {
int16 door_is_open;
};
-#define local ((Scratch *)(&game.scratch[0]))
+static Scratch scratch;
+
+#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room603.cpp b/engines/mads/madsv2/dragonsphere/rooms/room603.cpp
index dde78d4090e..88e412717e5 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room603.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room603.cpp
@@ -58,7 +58,9 @@ struct Scratch {
int16 distance_to_eye;
};
-#define local ((Scratch *)(&game.scratch[0]))
+static Scratch scratch;
+
+#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room604.cpp b/engines/mads/madsv2/dragonsphere/rooms/room604.cpp
index d90e0e9f115..9f49d851a2e 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room604.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room604.cpp
@@ -48,7 +48,9 @@ struct Scratch {
int16 prevent;
};
-#define local ((Scratch *)(&game.scratch[0]))
+static Scratch scratch;
+
+#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room605.cpp b/engines/mads/madsv2/dragonsphere/rooms/room605.cpp
index 0b687ff7b06..616cea3193f 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room605.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room605.cpp
@@ -69,7 +69,9 @@ struct Scratch {
int16 prevent_2;
};
-#define local ((Scratch *)(&game.scratch[0]))
+static Scratch scratch;
+
+#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room606.cpp b/engines/mads/madsv2/dragonsphere/rooms/room606.cpp
index a65cdb77ab7..66bb5e11a1e 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room606.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room606.cpp
@@ -67,7 +67,9 @@ struct Scratch {
int16 dyn_blue_stone;
};
-#define local ((Scratch *)(&game.scratch[0]))
+static Scratch scratch;
+
+#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room607.cpp b/engines/mads/madsv2/dragonsphere/rooms/room607.cpp
index e4574f2a461..125682cb51f 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room607.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room607.cpp
@@ -51,6 +51,8 @@ struct Scratch {
int16 prevent;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -97,8 +99,6 @@ struct Scratch {
#define TORCH_X 70
#define TORCH_Y 128
-static Scratch scratch;
-
static void room_607_init() {
int count;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room609.cpp b/engines/mads/madsv2/dragonsphere/rooms/room609.cpp
index 406cd83ade1..8b1a1658136 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room609.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room609.cpp
@@ -55,6 +55,8 @@ struct Scratch {
int16 prevent;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -87,8 +89,6 @@ struct Scratch {
#define DEATH_X 164
#define DEATH_Y 134
-static Scratch scratch;
-
static void room_609_init() {
kernel.disable_fastwalk = true;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room612.cpp b/engines/mads/madsv2/dragonsphere/rooms/room612.cpp
index 338f384c70d..b317715f894 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room612.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room612.cpp
@@ -51,6 +51,8 @@ struct Scratch {
int16 count;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -87,8 +89,6 @@ struct Scratch {
#define PLAYER_END_X 73
#define PLAYER_END_Y 153
-static Scratch scratch;
-
static void room_612_init() {
if (previous_room != KERNEL_RESTORING_GAME) {
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room613.cpp b/engines/mads/madsv2/dragonsphere/rooms/room613.cpp
index fdad563f436..2c9c4b6f77b 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room613.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room613.cpp
@@ -53,6 +53,8 @@ struct Scratch {
int16 old_y;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
@@ -71,25 +73,19 @@ struct Scratch {
#define fx_king_melt 8 /* rm613a1 */
#define fx_door 9 /* rm613x0 */
-/* ========================= Triggers ======================== */
-
-
-
/* ========================= Other Macros ==================== */
-#define PLAYER_X_FROM_606 25
+#define PLAYER_X_FROM_606 25
#define PLAYER_Y_FROM_606 132
-#define WALK_TO_X_FROM_606 61
-#define WALK_TO_Y_FROM_606 132
+#define WALK_TO_X_FROM_606 61
+#define WALK_TO_Y_FROM_606 132
#define PLAYER_X_FROM_614 613
#define PLAYER_Y_FROM_614 132
-#define WALK_TO_X_FROM_614 578
-#define WALK_TO_Y_FROM_614 132
-
-#define RIGHT_HALF 320
+#define WALK_TO_X_FROM_614 578
+#define WALK_TO_Y_FROM_614 132
-static Scratch scratch;
+#define RIGHT_HALF 320
static void room_613_init() {
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room614.cpp b/engines/mads/madsv2/dragonsphere/rooms/room614.cpp
index d746b60873e..7c3ff5dfd87 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room614.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room614.cpp
@@ -93,12 +93,13 @@ struct Scratch {
int16 did_not_throw;
};
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-
/* ========================= Sprite Series =================== */
#define fx_bundle 0 /* rm614p1 */
@@ -165,8 +166,6 @@ struct Scratch {
#define CIRCLE_X 256
#define CIRCLE_Y 61
-static Scratch scratch;
-
static void room_614_init() {
if (player_has(red_powerstone)) global[has_red] = true;
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room909.cpp b/engines/mads/madsv2/dragonsphere/rooms/room909.cpp
index b0a3ba7a26e..49f4563215c 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room909.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room909.cpp
@@ -37,38 +37,25 @@ namespace Dragonsphere {
namespace Rooms {
+struct Scratch {
+ int16 sprite[15]; // ss[] â series handles
+ int16 sequence[15]; // seq[] â sequence handles
+ int16 animation[4]; // aa[] â animation handles
+ int16 prev_anim_frame; // last observed animation frame (for frame-change detection)
+};
+
+static Scratch scratch;
+
#define local (&scratch)
#define ss local->sprite
#define seq local->sequence
#define aa local->animation
-/**
- * Room local variables (field names encode game.scratch byte offsets).
- *
- * Layout verified against disassembly of room_909_init / room_909_anim:
- * x00 = game.scratch+0x00 series handle: kernel_name('x', 0)
- * x02 = game.scratch+0x02 series handle: kernel_name('x', 1)
- * x04 = game.scratch+0x04 series handle: kernel_name('x', 2)
- * x1e = game.scratch+0x1E seq handle: forward sequence for series x0
- * x20 = game.scratch+0x20 seq handle: forward sequence for series x1
- * x22 = game.scratch+0x22 seq handle: forward sequence for series x2
- * x3c = game.scratch+0x3C animation handle: kernel_name('w', 1)
- * x44 = game.scratch+0x44 last observed animation frame (change detector)
- */
-struct Scratch {
- int16 x00; // sprite series: kernel_name('x', 0)
- int16 x02; // sprite series: kernel_name('x', 1)
- int16 x04; // sprite series: kernel_name('x', 2)
- int16 _pad06[12]; // offsets 0x06..0x1C (unused in this room)
- int16 x1e; // seq: forward play of series x0, depth 12, range [-1..-2]
- int16 x20; // seq: forward play of series x1, depth 12, range [-1..-2]
- int16 x22; // seq: forward play of series x2, depth 12, range [-1..-2]
- int16 _pad24[12]; // offsets 0x24..0x3B (unused in this room)
- int16 x3c; // animation handle: kernel_name('w', 1)
- int16 _pad3e[3]; // offsets 0x3E..0x43 (unused in this room)
- int16 x44; // last observed animation frame (for frame-change detection)
-};
+/* ========================= Sprite Series =================== */
+#define fx_bg0 0
+#define fx_bg1 1
+#define fx_bg2 2
/* ========================= Triggers ======================== */
@@ -83,32 +70,30 @@ struct Scratch {
#define FRAME_LOOP_RESET 106 // 0x6A: reset animation to FRAME_TIMING_TRIGGER
-static Scratch scratch;
-
-void room_909_init() {
+static void room_909_init() {
player.commands_allowed = 0;
player.walker_visible = 0;
viewing_at_y = 22;
kernel_init_dialog();
kernel_set_interface_mode(2);
- scratch.x00 = kernel_load_series(kernel_name('x', 0), 0);
- scratch.x02 = kernel_load_series(kernel_name('x', 1), 0);
- scratch.x04 = kernel_load_series(kernel_name('x', 2), 0);
+ ss[fx_bg0] = kernel_load_series(kernel_name('x', 0), 0);
+ ss[fx_bg1] = kernel_load_series(kernel_name('x', 1), 0);
+ ss[fx_bg2] = kernel_load_series(kernel_name('x', 2), 0);
- scratch.x1e = kernel_seq_forward(scratch.x00, false, 6, 0, 0, 0);
- kernel_seq_depth(scratch.x1e, 12);
- kernel_seq_range(scratch.x1e, -1, -2);
+ seq[fx_bg0] = kernel_seq_forward(ss[fx_bg0], false, 6, 0, 0, 0);
+ kernel_seq_depth(seq[fx_bg0], 12);
+ kernel_seq_range(seq[fx_bg0], -1, -2);
- scratch.x20 = kernel_seq_forward(scratch.x02, false, 6, 0, 0, 0);
- kernel_seq_depth(scratch.x20, 12);
- kernel_seq_range(scratch.x20, -1, -2);
+ seq[fx_bg1] = kernel_seq_forward(ss[fx_bg1], false, 6, 0, 0, 0);
+ kernel_seq_depth(seq[fx_bg1], 12);
+ kernel_seq_range(seq[fx_bg1], -1, -2);
- scratch.x22 = kernel_seq_forward(scratch.x04, false, 6, 0, 0, 0);
- kernel_seq_depth(scratch.x22, 12);
- kernel_seq_range(scratch.x22, -1, -2);
+ seq[fx_bg2] = kernel_seq_forward(ss[fx_bg2], false, 6, 0, 0, 0);
+ kernel_seq_depth(seq[fx_bg2], 12);
+ kernel_seq_range(seq[fx_bg2], -1, -2);
- scratch.x3c = kernel_run_animation(kernel_name('w', 1), 0);
+ aa[0] = kernel_run_animation(kernel_name('w', 1), 0);
section_9_music();
}
@@ -122,19 +107,19 @@ void room_909_init() {
* Called once per tick from room_909_daemon.
*/
static void room_909_anim() {
- int16 var_2;
- int cur_frame = kernel_anim[scratch.x3c].frame;
+ int16 frame;
+ int cur_frame = kernel_anim[aa[0]].frame;
- if (cur_frame == scratch.x44)
+ if (cur_frame == scratch.prev_anim_frame)
return;
- var_2 = -1;
- scratch.x44 = (int16)cur_frame;
+ frame = -1;
+ scratch.prev_anim_frame = (int16)cur_frame;
// Frame dispatch (ascending subtraction chain, mirroring original assembly)
if (cur_frame == FRAME_LOOP_RESET) {
// Frame 106: reset animation back to frame 105 so it loops continuously
- var_2 = FRAME_TIMING_TRIGGER;
+ frame = FRAME_TIMING_TRIGGER;
} else if (cur_frame < FRAME_LOOP_RESET) {
int remaining = cur_frame;
@@ -171,13 +156,13 @@ static void room_909_anim() {
// cur_frame > FRAME_LOOP_RESET: no action
apply:
- if (var_2 >= 0) {
- kernel_reset_animation(scratch.x3c, var_2);
- scratch.x44 = var_2;
+ if (frame >= 0) {
+ kernel_reset_animation(aa[0], frame);
+ scratch.prev_anim_frame = frame;
}
}
-void room_909_daemon() {
+static void room_909_daemon() {
room_909_anim();
if (kernel.trigger != TRIGGER_SHOW_SCORE)
@@ -190,9 +175,9 @@ void room_909_daemon() {
// Populate text_index[] before calling text_show(99) so the score-screen
// text can substitute the values via [INDEX N] commands.
- // text_index[0] = current score (word_86A44 in original DS data segment)
- // text_index[1] = maximum score (word_86A46)
- // text_index[2] = rank tier 1-9 (word_86A48)
+ // text_index[0] = current score
+ // text_index[1] = maximum score
+ // text_index[2] = rank tier 1-9
text_index[1] = 250;
text_index[0] = score;
@@ -213,21 +198,21 @@ void room_909_daemon() {
text_show(99);
}
-void room_909_pre_parser() {
+static void room_909_pre_parser() {
}
-void room_909_parser() {
+static void room_909_parser() {
}
void room_909_synchronize(Common::Serializer &s) {
- s.syncAsSint16LE(scratch.x00);
- s.syncAsSint16LE(scratch.x02);
- s.syncAsSint16LE(scratch.x04);
- s.syncAsSint16LE(scratch.x1e);
- s.syncAsSint16LE(scratch.x20);
- s.syncAsSint16LE(scratch.x22);
- s.syncAsSint16LE(scratch.x3c);
- s.syncAsSint16LE(scratch.x44);
+ s.syncAsSint16LE(ss[fx_bg0]);
+ s.syncAsSint16LE(ss[fx_bg1]);
+ s.syncAsSint16LE(ss[fx_bg2]);
+ s.syncAsSint16LE(seq[fx_bg0]);
+ s.syncAsSint16LE(seq[fx_bg1]);
+ s.syncAsSint16LE(seq[fx_bg2]);
+ s.syncAsSint16LE(aa[0]);
+ s.syncAsSint16LE(scratch.prev_anim_frame);
}
void room_909_preload() {
Commit: b31901941fbafdf084e7f58a9e054541ffbe470b
https://github.com/scummvm/scummvm/commit/b31901941fbafdf084e7f58a9e054541ffbe470b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-26T09:22:54+10:00
Commit Message:
MADS: DRAGONSPHERE: Shift MPSInstaller into core/ to share with Dragonsphere
It doesn't yet work, since there seems to be some changes between the
installers in Rex Nebular versus Dragonsphere
Changed paths:
A engines/mads/core/mps_installer.cpp
A engines/mads/core/mps_installer.h
R engines/mads/nebular/core/mps_installer.cpp
R engines/mads/nebular/core/mps_installer.h
engines/mads/detection_tables.h
engines/mads/madsv2/dragonsphere/dragonsphere.cpp
engines/mads/module.mk
engines/mads/nebular/nebular.cpp
diff --git a/engines/mads/nebular/core/mps_installer.cpp b/engines/mads/core/mps_installer.cpp
similarity index 98%
rename from engines/mads/nebular/core/mps_installer.cpp
rename to engines/mads/core/mps_installer.cpp
index 591674184cc..bab7434a7b2 100644
--- a/engines/mads/nebular/core/mps_installer.cpp
+++ b/engines/mads/core/mps_installer.cpp
@@ -26,10 +26,9 @@
#include "common/util.h"
#include "common/memstream.h"
#include "common/compression/dcl.h"
-#include "mads/nebular/core/mps_installer.h"
+#include "mads/core/mps_installer.h"
namespace MADS {
-namespace Nebular {
MpsInstaller *MpsInstaller::open(const Common::Path &baseName) {
Common::File indexFile;
@@ -156,5 +155,4 @@ Common::SharedArchiveContents MpsInstaller::readContentsForPath(const Common::Pa
return Common::SharedArchiveContents(uncompressedBuf, desc._uncompressedSize);
}
-} // namespace Nebular
} // namespace MADS
diff --git a/engines/mads/nebular/core/mps_installer.h b/engines/mads/core/mps_installer.h
similarity index 96%
rename from engines/mads/nebular/core/mps_installer.h
rename to engines/mads/core/mps_installer.h
index 3e78d55bbf7..7b603ac590a 100644
--- a/engines/mads/nebular/core/mps_installer.h
+++ b/engines/mads/core/mps_installer.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef MADS_MPS_INSTALLER_H
-#define MADS_MPS_INSTALLER_H
+#ifndef MADS_CORE_INSTALLER_H
+#define MADS_CORE_INSTALLER_H
#include "common/archive.h"
#include "common/ptr.h"
@@ -29,7 +29,6 @@
#include "common/hash-str.h"
namespace MADS {
-namespace Nebular {
class MpsInstaller : public Common::MemcachingCaseInsensitiveArchive {
public:
@@ -86,7 +85,6 @@ private:
Common::Path _baseName;
};
-} // namespace Nebular
} // namespace MADS
#endif
diff --git a/engines/mads/detection_tables.h b/engines/mads/detection_tables.h
index b22744dd7c8..357e2713cc3 100644
--- a/engines/mads/detection_tables.h
+++ b/engines/mads/detection_tables.h
@@ -207,6 +207,22 @@ static const MADSGameDescription gameDescriptions[] = {
0
},
+ {
+ // Dragonsphere Microprose DOS English
+ {
+ "dragonsphere",
+ 0,
+ AD_ENTRY2s("mpslabs.001", "0d2143364be8e12b9807e111ffbe4fb5", 771220,
+ "mpslabs.idx", "db604f6e665516c59bebe60b404abe44", 4636),
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ GF_INSTALLER | ADGF_UNSTABLE,
+ GUIO1(GAMEOPTION_EASY_MOUSE)
+ },
+ GType_Dragonsphere,
+ 0
+ },
+
{
// Dragonsphere DOS English demo
{
diff --git a/engines/mads/madsv2/dragonsphere/dragonsphere.cpp b/engines/mads/madsv2/dragonsphere/dragonsphere.cpp
index 0355372d3c8..2c0f343ff85 100644
--- a/engines/mads/madsv2/dragonsphere/dragonsphere.cpp
+++ b/engines/mads/madsv2/dragonsphere/dragonsphere.cpp
@@ -46,6 +46,7 @@
#include "mads/madsv2/dragonsphere/mads/inventory.h"
#include "mads/madsv2/dragonsphere/mads/sounds.h"
#include "mads/madsv2/dragonsphere/mads/words.h"
+#include "mads/core/mps_installer.h"
namespace MADS {
namespace MADSV2 {
@@ -59,6 +60,13 @@ Common::Error DragonsphereEngine::run() {
// Create a debugger console
setDebugger(new Console());
+ // Set up to read mpslabs installer archive if needed
+ if (_gameDescription->desc.flags & GF_INSTALLER) {
+ Common::Archive *arch = MpsInstaller::open("MPSLABS");
+ if (arch)
+ SearchMan.add("mpslabs", arch);
+ }
+
// Set up sound manager
_soundManager = new DragonSoundManager(_mixer, _soundFlag);
_soundManager->validate();
diff --git a/engines/mads/module.mk b/engines/mads/module.mk
index 91beb0be5f8..b81eab8257c 100644
--- a/engines/mads/module.mk
+++ b/engines/mads/module.mk
@@ -1,6 +1,7 @@
MODULE := engines/mads
MODULE_OBJS := \
+ core/mps_installer.o \
core/sound_manager.o \
nebular/nebular.o \
nebular/debugger.o \
@@ -38,7 +39,6 @@ MODULE_OBJS := \
nebular/core/menu_views.o \
nebular/core/messages.o \
nebular/core/msurface.o \
- nebular/core/mps_installer.o \
nebular/core/palette.o \
nebular/core/player.o \
nebular/core/rails.o \
diff --git a/engines/mads/nebular/nebular.cpp b/engines/mads/nebular/nebular.cpp
index 24681fc502c..9f72ca20ca5 100644
--- a/engines/mads/nebular/nebular.cpp
+++ b/engines/mads/nebular/nebular.cpp
@@ -32,7 +32,7 @@
#include "mads/nebular/core/msurface.h"
#include "mads/nebular/core/resources.h"
#include "mads/nebular/core/sprites.h"
-#include "mads/nebular/core/mps_installer.h"
+#include "mads/core/mps_installer.h"
namespace MADS {
namespace Nebular {
More information about the Scummvm-git-logs
mailing list