[Scummvm-git-logs] scummvm master -> 2fe3ccf1ff4b978b32c0147bd4834a73042cd13b
dreammaster
noreply at scummvm.org
Thu May 7 12:30:50 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:
918f3a4d2a MADS: DRAGONSPHERE: Remove section 6 room skeletons that don't exist
9bd09ee461 MADS: DRAGONSPHERE: Added room 102
aba373fa61 MADS: PHANTOM: Animview anim loading
2fe3ccf1ff MADS: DRAGONSPHERE: Added room 103
Commit: 918f3a4d2acfc661ca79b395038989460afc1d69
https://github.com/scummvm/scummvm/commit/918f3a4d2acfc661ca79b395038989460afc1d69
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-07T19:17:44+10:00
Commit Message:
MADS: DRAGONSPHERE: Remove section 6 room skeletons that don't exist
Changed paths:
R engines/mads/madsv2/dragonsphere/rooms/room602.cpp
R engines/mads/madsv2/dragonsphere/rooms/room602.h
R engines/mads/madsv2/dragonsphere/rooms/room608.cpp
R engines/mads/madsv2/dragonsphere/rooms/room608.h
R engines/mads/madsv2/dragonsphere/rooms/room610.cpp
R engines/mads/madsv2/dragonsphere/rooms/room610.h
R engines/mads/madsv2/dragonsphere/rooms/room611.cpp
R engines/mads/madsv2/dragonsphere/rooms/room611.h
engines/mads/madsv2/dragonsphere/rooms/section6.cpp
engines/mads/module.mk
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room602.cpp b/engines/mads/madsv2/dragonsphere/rooms/room602.cpp
deleted file mode 100644
index f4937912aa3..00000000000
--- a/engines/mads/madsv2/dragonsphere/rooms/room602.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "mads/madsv2/core/conv.h"
-#include "mads/madsv2/core/game.h"
-#include "mads/madsv2/core/imath.h"
-#include "mads/madsv2/core/kernel.h"
-#include "mads/madsv2/core/sound.h"
-#include "mads/madsv2/core/text.h"
-#include "mads/madsv2/dragonsphere/global.h"
-#include "mads/madsv2/dragonsphere/rooms/section6.h"
-#include "mads/madsv2/dragonsphere/rooms/room602.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Dragonsphere {
-namespace Rooms {
-
-//static Scratch scratch;
-
-void room_602_init() {
-
-}
-
-void room_602_daemon() {
-
-}
-
-void room_602_pre_parser() {
-
-}
-
-void room_602_parser() {
-
-}
-
-void room_602_synchronize(Common::Serializer &s) {
-
-}
-
-void room_602_preload() {
- room_init_code_pointer = room_602_init;
- room_pre_parser_code_pointer = room_602_pre_parser;
- room_parser_code_pointer = room_602_parser;
- room_daemon_code_pointer = room_602_daemon;
-
- section_6_walker();
- section_6_interface();
-}
-
-} // namespace Rooms
-} // namespace Dragonsphere
-} // namespace MADSV2
-} // namespace MADS
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room602.h b/engines/mads/madsv2/dragonsphere/rooms/room602.h
deleted file mode 100644
index 810bfa2c0eb..00000000000
--- a/engines/mads/madsv2/dragonsphere/rooms/room602.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef MADS_DRAGONSPHERE_ROOMS_602_H
-#define MADS_DRAGONSPHERE_ROOMS_602_H
-
-#include "common/serializer.h"
-#include "mads/madsv2/core/general.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Dragonsphere {
-namespace Rooms {
-
-#define local (&scratch)
-#define ss local->sprite
-#define seq local->sequence
-#define aa local->animation
-
-/**
- * Room local variables
- */
-struct Scratch {
-
-};
-
-} // namespace Rooms
-} // namespace Dragonsphere
-} // namespace MADSV2
-} // namespace MADS
-
-#endif
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room608.cpp b/engines/mads/madsv2/dragonsphere/rooms/room608.cpp
deleted file mode 100644
index 711c8e914e6..00000000000
--- a/engines/mads/madsv2/dragonsphere/rooms/room608.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "mads/madsv2/core/conv.h"
-#include "mads/madsv2/core/game.h"
-#include "mads/madsv2/core/imath.h"
-#include "mads/madsv2/core/kernel.h"
-#include "mads/madsv2/core/sound.h"
-#include "mads/madsv2/core/text.h"
-#include "mads/madsv2/dragonsphere/global.h"
-#include "mads/madsv2/dragonsphere/rooms/section6.h"
-#include "mads/madsv2/dragonsphere/rooms/room608.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Dragonsphere {
-namespace Rooms {
-
-//static Scratch scratch;
-
-void room_608_init() {
-
-}
-
-void room_608_daemon() {
-
-}
-
-void room_608_pre_parser() {
-
-}
-
-void room_608_parser() {
-
-}
-
-void room_608_synchronize(Common::Serializer &s) {
-
-}
-
-void room_608_preload() {
- room_init_code_pointer = room_608_init;
- room_pre_parser_code_pointer = room_608_pre_parser;
- room_parser_code_pointer = room_608_parser;
- room_daemon_code_pointer = room_608_daemon;
-
- section_6_walker();
- section_6_interface();
-}
-
-} // namespace Rooms
-} // namespace Dragonsphere
-} // namespace MADSV2
-} // namespace MADS
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room608.h b/engines/mads/madsv2/dragonsphere/rooms/room608.h
deleted file mode 100644
index 926917e8f39..00000000000
--- a/engines/mads/madsv2/dragonsphere/rooms/room608.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef MADS_DRAGONSPHERE_ROOMS_608_H
-#define MADS_DRAGONSPHERE_ROOMS_608_H
-
-#include "common/serializer.h"
-#include "mads/madsv2/core/general.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Dragonsphere {
-namespace Rooms {
-
-#define local (&scratch)
-#define ss local->sprite
-#define seq local->sequence
-#define aa local->animation
-
-/**
- * Room local variables
- */
-struct Scratch {
-
-};
-
-} // namespace Rooms
-} // namespace Dragonsphere
-} // namespace MADSV2
-} // namespace MADS
-
-#endif
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room610.cpp b/engines/mads/madsv2/dragonsphere/rooms/room610.cpp
deleted file mode 100644
index 9be3e746a46..00000000000
--- a/engines/mads/madsv2/dragonsphere/rooms/room610.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "mads/madsv2/core/conv.h"
-#include "mads/madsv2/core/game.h"
-#include "mads/madsv2/core/imath.h"
-#include "mads/madsv2/core/kernel.h"
-#include "mads/madsv2/core/sound.h"
-#include "mads/madsv2/core/text.h"
-#include "mads/madsv2/dragonsphere/global.h"
-#include "mads/madsv2/dragonsphere/rooms/section6.h"
-#include "mads/madsv2/dragonsphere/rooms/room610.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Dragonsphere {
-namespace Rooms {
-
-//static Scratch scratch;
-
-void room_610_init() {
-
-}
-
-void room_610_daemon() {
-
-}
-
-void room_610_pre_parser() {
-
-}
-
-void room_610_parser() {
-
-}
-
-void room_610_synchronize(Common::Serializer &s) {
-
-}
-
-void room_610_preload() {
- room_init_code_pointer = room_610_init;
- room_pre_parser_code_pointer = room_610_pre_parser;
- room_parser_code_pointer = room_610_parser;
- room_daemon_code_pointer = room_610_daemon;
-
- section_6_walker();
- section_6_interface();
-}
-
-} // namespace Rooms
-} // namespace Dragonsphere
-} // namespace MADSV2
-} // namespace MADS
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room610.h b/engines/mads/madsv2/dragonsphere/rooms/room610.h
deleted file mode 100644
index d51d7771a23..00000000000
--- a/engines/mads/madsv2/dragonsphere/rooms/room610.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef MADS_DRAGONSPHERE_ROOMS_610_H
-#define MADS_DRAGONSPHERE_ROOMS_610_H
-
-#include "common/serializer.h"
-#include "mads/madsv2/core/general.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Dragonsphere {
-namespace Rooms {
-
-#define local (&scratch)
-#define ss local->sprite
-#define seq local->sequence
-#define aa local->animation
-
-/**
- * Room local variables
- */
-struct Scratch {
-
-};
-
-} // namespace Rooms
-} // namespace Dragonsphere
-} // namespace MADSV2
-} // namespace MADS
-
-#endif
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room611.cpp b/engines/mads/madsv2/dragonsphere/rooms/room611.cpp
deleted file mode 100644
index 4c9dfc6c402..00000000000
--- a/engines/mads/madsv2/dragonsphere/rooms/room611.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "mads/madsv2/core/conv.h"
-#include "mads/madsv2/core/game.h"
-#include "mads/madsv2/core/imath.h"
-#include "mads/madsv2/core/kernel.h"
-#include "mads/madsv2/core/sound.h"
-#include "mads/madsv2/core/text.h"
-#include "mads/madsv2/dragonsphere/global.h"
-#include "mads/madsv2/dragonsphere/rooms/section6.h"
-#include "mads/madsv2/dragonsphere/rooms/room611.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Dragonsphere {
-namespace Rooms {
-
-//static Scratch scratch;
-
-void room_611_init() {
-
-}
-
-void room_611_daemon() {
-
-}
-
-void room_611_pre_parser() {
-
-}
-
-void room_611_parser() {
-
-}
-
-void room_611_synchronize(Common::Serializer &s) {
-
-}
-
-void room_611_preload() {
- room_init_code_pointer = room_611_init;
- room_pre_parser_code_pointer = room_611_pre_parser;
- room_parser_code_pointer = room_611_parser;
- room_daemon_code_pointer = room_611_daemon;
-
- section_6_walker();
- section_6_interface();
-}
-
-} // namespace Rooms
-} // namespace Dragonsphere
-} // namespace MADSV2
-} // namespace MADS
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room611.h b/engines/mads/madsv2/dragonsphere/rooms/room611.h
deleted file mode 100644
index 02315140702..00000000000
--- a/engines/mads/madsv2/dragonsphere/rooms/room611.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef MADS_DRAGONSPHERE_ROOMS_611_H
-#define MADS_DRAGONSPHERE_ROOMS_611_H
-
-#include "common/serializer.h"
-#include "mads/madsv2/core/general.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Dragonsphere {
-namespace Rooms {
-
-#define local (&scratch)
-#define ss local->sprite
-#define seq local->sequence
-#define aa local->animation
-
-/**
- * Room local variables
- */
-struct Scratch {
-
-};
-
-} // namespace Rooms
-} // namespace Dragonsphere
-} // namespace MADSV2
-} // namespace MADS
-
-#endif
diff --git a/engines/mads/madsv2/dragonsphere/rooms/section6.cpp b/engines/mads/madsv2/dragonsphere/rooms/section6.cpp
index 74e019b3279..98f2e952810 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/section6.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/section6.cpp
@@ -32,16 +32,12 @@ namespace Dragonsphere {
namespace Rooms {
extern void room_601_preload();
-extern void room_602_preload();
extern void room_603_preload();
extern void room_604_preload();
extern void room_605_preload();
extern void room_606_preload();
extern void room_607_preload();
-extern void room_608_preload();
extern void room_609_preload();
-extern void room_610_preload();
-extern void room_611_preload();
extern void room_612_preload();
extern void room_613_preload();
extern void room_614_preload();
@@ -72,9 +68,6 @@ void section_6_constructor() {
case 601:
room_preload_code_pointer = room_601_preload;
break;
- case 602:
- room_preload_code_pointer = room_602_preload;
- break;
case 603:
room_preload_code_pointer = room_603_preload;
break;
@@ -90,18 +83,9 @@ void section_6_constructor() {
case 607:
room_preload_code_pointer = room_607_preload;
break;
- case 608:
- room_preload_code_pointer = room_608_preload;
- break;
case 609:
room_preload_code_pointer = room_609_preload;
break;
- case 610:
- room_preload_code_pointer = room_610_preload;
- break;
- case 611:
- room_preload_code_pointer = room_611_preload;
- break;
case 612:
room_preload_code_pointer = room_612_preload;
break;
diff --git a/engines/mads/module.mk b/engines/mads/module.mk
index 91611e6af6a..74cb2350743 100644
--- a/engines/mads/module.mk
+++ b/engines/mads/module.mk
@@ -241,16 +241,12 @@ MODULE_OBJS += \
madsv2/dragonsphere/rooms/room512.o \
madsv2/dragonsphere/rooms/room557.o \
madsv2/dragonsphere/rooms/room601.o \
- madsv2/dragonsphere/rooms/room602.o \
madsv2/dragonsphere/rooms/room603.o \
madsv2/dragonsphere/rooms/room604.o \
madsv2/dragonsphere/rooms/room605.o \
madsv2/dragonsphere/rooms/room606.o \
madsv2/dragonsphere/rooms/room607.o \
- madsv2/dragonsphere/rooms/room608.o \
madsv2/dragonsphere/rooms/room609.o \
- madsv2/dragonsphere/rooms/room610.o \
- madsv2/dragonsphere/rooms/room611.o \
madsv2/dragonsphere/rooms/room612.o \
madsv2/dragonsphere/rooms/room613.o \
madsv2/dragonsphere/rooms/room614.o \
Commit: 9bd09ee46103e556765a72eb0fae4ca3111f97f6
https://github.com/scummvm/scummvm/commit/9bd09ee46103e556765a72eb0fae4ca3111f97f6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-07T19:17:44+10:00
Commit Message:
MADS: DRAGONSPHERE: Added room 102
Changed paths:
engines/mads/madsv2/dragonsphere/rooms/room102.cpp
engines/mads/madsv2/dragonsphere/rooms/room102.h
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room102.cpp b/engines/mads/madsv2/dragonsphere/rooms/room102.cpp
index 8296012b218..21444be7f25 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room102.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room102.cpp
@@ -19,12 +19,13 @@
*
*/
-#include "mads/madsv2/core/conv.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/text.h"
+#include "mads/madsv2/dragonsphere/dragonsphere.h"
#include "mads/madsv2/dragonsphere/global.h"
#include "mads/madsv2/dragonsphere/rooms/section1.h"
#include "mads/madsv2/dragonsphere/rooms/room102.h"
@@ -34,26 +35,509 @@ namespace MADSV2 {
namespace Dragonsphere {
namespace Rooms {
-//static Scratch scratch;
+#define local (&scratch)
+#define ss local->sprite
+#define seq local->sequence
+#define aa local->animation
+
+struct Scratch {
+ int16 x02;
+ int16 x04;
+ int16 x08;
+ int16 x0a;
+ int16 x0c;
+ int16 x0e;
+ int16 x10;
+ int16 x20;
+ int16 x22;
+ int16 x26;
+ int16 x28;
+ int16 x2a;
+ int16 x2c;
+ int16 x2e;
+ int16 x3c;
+ int16 x3e;
+ int16 x44;
+ int16 x46;
+ int16 x48;
+ int16 x4a;
+ int16 x4c;
+};
+
+static Scratch scratch;
void room_102_init() {
+ // Load all required series
+ scratch.x02 = kernel_load_series(kernel_name('p', 0), 0);
+ scratch.x04 = kernel_load_series(kernel_name('p', 1), 0);
+ scratch.x08 = kernel_load_series(kernel_name('y', 0), 0);
+ scratch.x0a = kernel_load_series(kernel_name('y', 1), 0);
+ scratch.x0c = kernel_load_series(kernel_name('x', -1), 0);
+ scratch.x0e = kernel_load_series("pd", 0);
+ scratch.x10 = kernel_load_series(kernel_name('y', 2), 0);
-}
+ // Start looping background animations
+ scratch.x26 = kernel_seq_forward(scratch.x08, false, 7, 0, 0, 0);
+ scratch.x28 = kernel_seq_forward(scratch.x0a, false, 7, 0, 0, 0);
+ scratch.x2e = kernel_seq_forward(scratch.x10, false, 7, 0, 0, 0);
-void room_102_daemon() {
+ // Stamp NPC sprites and attach them as dynamic walkers
+ scratch.x20 = kernel_seq_stamp(-1, scratch.x02, 0);
+ kernel_seq_depth(scratch.x20, 12);
+ scratch.x44 = kernel_add_dynamic(264, 13, 1, scratch.x20, 0, 0, 0, 0);
+ kernel_dynamic_walk(scratch.x44, 47, 123, 7);
+ scratch.x22 = kernel_seq_stamp(-1, scratch.x04, 0);
+ kernel_seq_depth(scratch.x22, 12);
+ scratch.x46 = kernel_add_dynamic(264, 13, 1, scratch.x22, 0, 0, 0, 0);
+ kernel_dynamic_walk(scratch.x46, 47, 123, 7);
+
+ // Position the player depending on which room they came from
+ if (previous_room == 103) {
+ // Returning from room 103: place player at a fixed position
+ player.x = 170;
+ player.y = 152;
+ player.facing = 7;
+ }
+
+ if (previous_room == 103 || previous_room == -2) {
+ // previous_room == 103 or 0xFFFE: stamp idle pose at frame -1
+ scratch.x2a = kernel_seq_stamp(-1, scratch.x0c, 0);
+ kernel_seq_stamp(-1, scratch.x2a, 5);
+ } else {
+ // Normal entry: stamp the walk-entry pose at frame -2, then walk
+ // the player in from off-screen (x=-10) to (130, y) facing 6.
+ scratch.x2a = kernel_seq_stamp(-2, scratch.x0c, 0);
+ kernel_seq_depth(scratch.x2a, 5);
+ player_first_walk(-10, 130, 6, 35, 144, 6, 0);
+ player_walk_trigger(70);
+ goto music;
+ }
+
+music:
+ section_1_music();
}
void room_102_pre_parser() {
-
+ // No implementation
}
void room_102_parser() {
+ // -----------------------------------------------------------------------
+ // Special case: look-around command -> show a dedicated text page and exit
+ // -----------------------------------------------------------------------
+ if (player.look_around) {
+ text_show(10201);
+ goto done;
+ }
+
+ // -----------------------------------------------------------------------
+ // Verb-group 1: verb 0xF5 with objects 0x25, 6, or 0xA
+ // -----------------------------------------------------------------------
+ if (player_parse(0xF5, 0x25, 0)
+ || player_parse(0xF5, 6, 0)
+ || player_parse(0xF5, 0x0A, 0)) {
+
+ switch (kernel.trigger) {
+ case 0:
+ {
+ // Trigger 0 (initial activation): disable UI, start ping-pong anim
+ // for the "pd" series, register two trigger callbacks (2 and 3),
+ // then fall through to done.
+ player.commands_allowed = 0;
+ player.walker_visible = 0;
+
+ scratch.x2c = kernel_seq_pingpong(scratch.x0e, -1, 8, 0, 0, 2);
+ kernel_seq_player(scratch.x2c, -1);
+
+ kernel_seq_trigger(scratch.x2c, 2, 1, 1);
+ kernel_seq_trigger(scratch.x2c, 0, 0, 3);
+ goto done;
+ }
+
+ case 1:
+ {
+ // Trigger 1: delete the walk-entry pose, play a sound, then
+ // start a forward anim on the 'x' series at speed 9, depth 5,
+ // and arm trigger 2 on it (falls through to the shared synch).
+ kernel_seq_delete(scratch.x2a);
+ sound_play(24);
+
+ scratch.x2a = kernel_seq_forward(scratch.x0c, false, 9, 1, 0, 0);
+ kernel_seq_depth(scratch.x2a, 5);
+
+ // Arm trigger 2 then fall into the shared kernel_synch below.
+ kernel_seq_trigger(scratch.x2a, 2, 0, 2);
+ goto done;
+ }
+
+ case 2:
+ {
+ // Trigger 2: save old walk-entry handle, stamp a new pose at
+ // frame 5, then synch the running animation (scratch.x3c) with
+ // the new pose as slave - shares the kernel_synch call path.
+ scratch.x4c = scratch.x2a;
+
+ scratch.x2a = kernel_seq_stamp(5, scratch.x0c, 0);
+ kernel_seq_depth(scratch.x2a, 5);
+
+ // kernel_synch(ax=1, dx=scratch.x2a, bx=1, push scratch.x4c, push 3)
+ // i.e. synch type 1: new pose (x2a) as master, x3c as slave (trigger 3)
+ kernel_synch(1, 1, scratch.x2a, scratch.x4c);
+ goto done;
+ }
+
+ case 3:
+ {
+ // Trigger 3: re-show the player walker and walk off to room 0x65.
+ player.walker_visible = -1;
+
+ kernel_synch(1, 2, 0, scratch.x2c);
+ player_walk(0, 0x82, 4);
+ player.walk_off_edge_to_room = 101;
+ goto done;
+ }
+
+ default:
+ goto done;
+ }
+ }
+
+ // -----------------------------------------------------------------------
+ // Verb-group 2: verb 0xC5 with objects 0x25, 6, or 0xA -> go to room 0x67
+ // -----------------------------------------------------------------------
+ if (player_parse(0xC5, 0x25, 0)
+ || player_parse(0xC5, 6, 0)
+ || player_parse(0xC5, 0x0A, 0)) {
+ new_room = 0x67;
+ goto done;
+ }
+
+ // -----------------------------------------------------------------------
+ // Verb-group 3: verb 0x108 with objects 4 or 6
+ // -----------------------------------------------------------------------
+ if (player_parse(0x108, 4, 0) || player_parse(0x108, 6, 0)) {
+
+ switch (kernel.trigger) {
+ case 0:
+ {
+ // Trigger 0: disable UI, set scratch.x4a=1, run the 'B' animation,
+ // then synch it (shared path with trigger 0 of the 'A' cutscene below).
+ player.commands_allowed = 0;
+ player.walker_visible = 0;
+ scratch.x4a = 1;
+
+ scratch.x3c = kernel_run_animation(kernel_name('B', -1), 1);
+
+ kernel_synch(3, scratch.x3c, 2, 0);
+ goto done;
+ }
+
+ case 1:
+ {
+ // Trigger 1: stamp NPC sprite A (x02) at frame -1, set depth 12,
+ // add it as a dynamic at sprite-id 0x108, walk it to (47,123)
+ // facing 7, re-show walker, synch x3c for trigger 2, then arm a
+ // timing trigger (6 ticks -> trigger 2).
+ scratch.x20 = kernel_seq_stamp(-1, scratch.x02, 0);
+ kernel_seq_depth(scratch.x20, 12);
+ scratch.x44 = kernel_add_dynamic(0x108, 13, 1, scratch.x20, 0, 0, 0, 0);
+ kernel_dynamic_walk(scratch.x44, 47, 123, 7);
+
+ player.walker_visible = -1;
+
+ kernel_synch(3, 2, 0, scratch.x3c);
+ kernel_timing_trigger(6, 2);
+ goto done;
+ }
+
+ case 2:
+ {
+ // Trigger 2: walk player to (0x33, 0x79) facing 7, arm trigger 3.
+ player_walk(0x33, 0x79, 7);
+ player_walk_trigger(3);
+ goto done;
+ }
+
+ case 3:
+ {
+ // Trigger 3: hide walker, set scratch.x4a=2, run the 'A' animation
+ // with flags=4, synch it - shares kernel_synch path.
+ player.walker_visible = 0;
+ scratch.x4a = 2;
+
+ scratch.x3c = kernel_run_animation(kernel_name('A', -1), 4);
+ kernel_synch(3, scratch.x3c, 2, 0);
+ goto done;
+ }
+
+ case 4:
+ {
+ // Trigger 4: stamp NPC sprite B (x04) at frame -1, set depth 12,
+ // add it as a dynamic, walk it, re-show walker and re-enable
+ // commands, synch x3c - shared kernel_synch path.
+ scratch.x22 = kernel_seq_stamp(-1, scratch.x04, 0);
+ kernel_seq_depth(scratch.x22, 12);
+ scratch.x46 = kernel_add_dynamic(0x108, 13, 1, scratch.x22, 0, 0, 0, 0);
+ kernel_dynamic_walk(scratch.x46, 47, 123, 7);
+
+ player.walker_visible = -1;
+ player.commands_allowed = -1;
+
+ kernel_synch(3, 2, 0, scratch.x3c);
+ goto done;
+ }
+
+ default:
+ goto done;
+ }
+ }
+
+ // -----------------------------------------------------------------------
+ // Look-at / examine chain: verb 3 or 0x1E (no-flag forms)
+ // -----------------------------------------------------------------------
+ if (player_parse(3, 0)
+ || player_parse(0x1E, 0)) {
+
+ // Each object check: if matched, show the corresponding text page.
+ if (player_parse(0x22, 0)) {
+ text_show(0x27DA); goto done;
+ }
+ if (player_parse(0x15, 0)) {
+ text_show(0x27DB); goto done;
+ }
+ if (player_parse(0xFC, 0)) {
+ text_show(0x27DC); goto done;
+ }
+ if (player_parse(0x12, 0)) {
+ text_show(0x27DE); goto done;
+ }
+ if (player_parse(0xFD, 0)) {
+ text_show(0x27E0); goto done;
+ }
+ if (player_parse(0x108, 0)) {
+ text_show(0x27E1); goto done;
+ }
+ if (player_parse(0xF5, 0)) {
+ text_show(0x27E7); goto done;
+ }
+ if (player_parse(0xFB, 0)) {
+ text_show(0x27E8); goto done;
+ }
+ if (player_parse(0x18, 0)) {
+ text_show(0x27E9); goto done;
+ }
+ if (player_parse(0xCC, 0)) {
+ text_show(0x27EB); goto done;
+ }
+ if (player_parse(0x23, 0)) {
+ text_show(0x27EC); goto done;
+ }
+ if (player_parse(0x19, 0)) {
+ text_show(0x27EE); goto done;
+ }
+ if (player_parse(0xC5, 0)) {
+ text_show(0x27EF); goto done;
+ }
+ if (player_parse(0x17, 0)) {
+ text_show(0x27F0); goto done;
+ }
+ if (player_parse(0x1A, 0)) {
+ text_show(0x27F2); goto done;
+ }
+ if (player_parse(0x149, 0)) {
+ text_show(0x27F3); goto done;
+ }
+ if (player_parse(0x10, 0)) {
+ text_show(0x27F4); goto done;
+ }
+ if (player_parse(0x14, 0)) {
+ text_show(0x27F5); goto done;
+ }
+ if (player_parse(0x29, 0)) {
+ text_show(0x27F6); goto done;
+ }
+ if (player_parse(0xC4, 0)) {
+ text_show(0x27F7); goto done;
+ }
+
+ // Verb 6 variants (use/take with direction flag)
+ if (player_parse(0x17, 6, 0)) {
+ text_show(0x27F0); goto done;
+ }
+ if (player_parse(0xFB, 4, 0)) {
+ text_show(0x27F1); goto done;
+ }
+ if (player_parse(0x18, 6, 0)) {
+ text_show(0x27EA); goto done;
+ }
+
+ // Generic use/touch objects
+ if (player_parse(5, 0) || player_parse(0x0A, 0)) {
+ if (player_parse(0x23, 0)) {
+ text_show(0x27ED); goto done;
+ }
+ }
+
+ if (player_parse(0xFC, 0x0B, 0)) {
+ text_show(0x27DD); goto done;
+ }
+ if (player_parse(0x12, 0x0A, 0)) {
+ text_show(0x27DF); goto done;
+ }
+
+ // No match in examine chain - fall through to done without clearing
+ // command_ready (the retf at locret_39BE0 skips the clear).
+ return;
+ }
+
+done:
+ player.command_ready = 0;
+}
+
+void room_102_daemon() {
+ int16 var_2;
+
+ // -----------------------------------------------------------------------
+ // Animation monitor - mode 1 ('B' cutscene): frames 6, 10, 26
+ // -----------------------------------------------------------------------
+ if (scratch.x4a == 1) {
+ // Skip if animation handle is inactive (both anim words zero)
+ if (kernel_anim[scratch.x3c].anim != 0) {
+
+ // Skip if frame hasn't changed since last tick
+ if (kernel_anim[scratch.x3c].frame != scratch.x48) {
+ var_2 = -1;
+ scratch.x48 = kernel_anim[scratch.x3c].frame;
+
+ if (scratch.x48 == 26) {
+ // Frame 26: show three sequential text pages (subtitles /
+ // dialogue lines for the 'B' cutscene), then check reset.
+ text_show(10210);
+ text_show(10211);
+ text_show(10212);
+ } else if (scratch.x48 < 26) {
+ int remaining = scratch.x48;
+
+ remaining -= 6; // frame 6
+ if (remaining == 0) {
+ // Frame 6: delete the NPC-A stamp, then synch
+ // (type 1, slave = x3c, trigger 3) so the cutscene
+ // waits for the stamp removal to complete.
+ kernel_seq_delete(scratch.x20);
+ kernel_synch(3, 1, scratch.x20, scratch.x3c);
+ } else {
+ remaining -= 4; // frame 10
+ if (remaining == 0) {
+ // Frame 10: play a sound effect.
+ sound_play(65);
+ }
+ // All other frames < 26: no action, var_2 stays -1
+ }
+ }
+ // frames > 26: no action
+
+ // If var_2 was set to a reset target (>= 0), loop the
+ // animation back to that frame unless it's already there.
+ if (var_2 >= 0) {
+ if (kernel_anim[scratch.x3c].frame != var_2) {
+ kernel_reset_animation(scratch.x3c, var_2);
+ scratch.x48 = var_2;
+ }
+ }
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------
+ // Animation monitor - mode 2 ('A' cutscene): frames 6, 26
+ // -----------------------------------------------------------------------
+ if (scratch.x4a == 2) {
+ // Skip if animation handle is inactive
+ if (kernel_anim[scratch.x3c].anim != 0) {
+
+ // Skip if frame hasn't changed since last tick
+ if (kernel_anim[scratch.x3c].frame != scratch.x48) {
+ var_2 = -1;
+ scratch.x48 = kernel_anim[scratch.x3c].frame;
+
+ int remaining = scratch.x48;
+
+ remaining -= 6; // frame 6
+ if (remaining == 0) {
+ // Frame 6: delete the NPC-B stamp, synch against x3c
+ // (type 1, slave = x3c, trigger 3) - mirrors mode 1.
+ kernel_seq_delete(scratch.x22);
+ kernel_synch(3, 1, scratch.x22, scratch.x3c);
+ } else {
+ remaining -= 20; // frame 26
+ if (remaining == 0) {
+ // Frame 26: show two text pages for the 'A' cutscene.
+ text_show(10213);
+ text_show(10214);
+ }
+ // All other frames: no action, var_2 stays -1
+ }
+
+ // Reset guard - same pattern as mode 1.
+ if (var_2 >= 0) {
+ if (kernel_anim[scratch.x3c].frame != var_2) {
+ kernel_reset_animation(scratch.x3c, var_2);
+ scratch.x48 = var_2;
+ }
+ }
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------
+ // Walk-entry trigger dispatch (fired by player_walk_trigger in init)
+ // -----------------------------------------------------------------------
+ if (kernel.trigger < 70)
+ return;
+
+ switch (kernel.trigger - 70) {
+ case 0:
+ // Trigger 70: walk-entry complete - delete the entry-pose stamp,
+ // play the arrival sound, then start a backward anim on the 'x'
+ // series (speed 9, range 1..4) and arm trigger 71 on it.
+ kernel_seq_delete(scratch.x2a);
+ sound_play(25);
+
+ scratch.x2a = kernel_seq_backward(scratch.x0c, false, 9, 1, 0, 0);
+ kernel_seq_depth(scratch.x2a, 5);
+ kernel_seq_range(scratch.x2a, 1, 4);
+ kernel_seq_trigger(scratch.x2a, 0, 0, 71);
+ return;
+
+ case 1:
+ // Trigger 71: backward anim finished - save old pose handle, stamp
+ // the idle pose at frame -1, set depth 0xFFFE (behind everything),
+ // synch type 1 (new pose as master, old pose as slave), then
+ // re-enable player commands.
+ scratch.x4c = scratch.x2a;
+
+ scratch.x2a = kernel_seq_stamp(-1, scratch.x0c, 0);
+ kernel_seq_depth(scratch.x2a, 0xFFFE);
+ kernel_synch(1, 1, scratch.x2a, scratch.x4c);
+
+ player.commands_allowed = -1;
+ return;
+ default:
+ return;
+ }
}
void room_102_synchronize(Common::Serializer &s) {
-
+ s.syncMultipleLE(
+ scratch.x02, scratch.x04, scratch.x08, scratch.x0a,
+ scratch.x0c, scratch.x0e, scratch.x10, scratch.x20,
+ scratch.x22, scratch.x26, scratch.x28, scratch.x2a,
+ scratch.x2c, scratch.x2e, scratch.x3c, scratch.x3e,
+ scratch.x44, scratch.x46, scratch.x48, scratch.x4a,
+ scratch.x4c
+ );
}
void room_102_preload() {
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room102.h b/engines/mads/madsv2/dragonsphere/rooms/room102.h
index f50ff4ca3f7..96e46e9005e 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room102.h
+++ b/engines/mads/madsv2/dragonsphere/rooms/room102.h
@@ -30,18 +30,6 @@ namespace MADSV2 {
namespace Dragonsphere {
namespace Rooms {
-#define local (&scratch)
-#define ss local->sprite
-#define seq local->sequence
-#define aa local->animation
-
-/**
- * Room local variables
- */
-struct Scratch {
-
-};
-
} // namespace Rooms
} // namespace Dragonsphere
} // namespace MADSV2
Commit: aba373fa6182e2b13ff2427c0b67de23197fa8b8
https://github.com/scummvm/scummvm/commit/aba373fa6182e2b13ff2427c0b67de23197fa8b8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-07T22:29:47+10:00
Commit Message:
MADS: PHANTOM: Animview anim loading
Changed paths:
engines/mads/madsv2/animview/animview.cpp
diff --git a/engines/mads/madsv2/animview/animview.cpp b/engines/mads/madsv2/animview/animview.cpp
index ba63ffdb9fe..e571110a62f 100644
--- a/engines/mads/madsv2/animview/animview.cpp
+++ b/engines/mads/madsv2/animview/animview.cpp
@@ -61,6 +61,14 @@ static bool exit_immediately_at_end;
static bool do_not_clear_screen;
static bool has_sound_file;
static char sound_file_name[80];
+static TileMapHeader picture_map, depth_map;
+static TileResource picture_res, depth_res;
+static CycleList cycle_list;
+static Buffer scr_work_orig;
+static Room *room;
+static Anim *current_anim, *current_anim2;
+static bool has_cycles;
+static int viewing_at_y2;
/**
* Initializes animview global variables
@@ -77,6 +85,16 @@ static void init_globals() {
do_not_clear_screen = false;
has_sound_file = false;
*sound_file_name = '\0';
+ memset(&picture_map, 0, sizeof(TileMapHeader));
+ memset(&depth_map, 0, sizeof(TileMapHeader));
+ memset(&picture_res, 0, sizeof(TileResource));
+ memset(&depth_res, 0, sizeof(TileResource));
+ memset(&cycle_list, 0, sizeof(CycleList));
+ memset(&scr_work_orig, 0, sizeof(Buffer));
+ room = nullptr;
+ current_anim = current_anim2 = nullptr;
+ has_cycles = false;
+ viewing_at_y2 = 0;
}
/**
@@ -281,10 +299,67 @@ static void animate() {
// TODO: Load proper driver number
g_engine->_soundManager->init(9);
- //Anim *current_anim = anim_load()
+ if (anim_list[count].bg_load_status) {
+ buffer_free(&scr_depth);
+ buffer_free(&scr_inter);
+ tile_map_free(&picture_map);
+ tile_map_free(&depth_map);
+
+ if (room) {
+ pal_deallocate(room->color_handle);
+ mem_free(room);
+ } else {
+ pal_init(1, 8);
+ mouse_hard_cursor_mode(2, &master_palette);
+ }
+ }
+
+ int loadFlags = anim_list[count].bg_load_status ? ANIM_LOAD_BACKGROUND : 0;
+ current_anim = anim_load(buf, &scr_inter, &scr_depth,
+ &picture_map, &depth_map, &picture_res, &depth_res, &room,
+ &cycle_list, loadFlags);
+ scr_inter_orig = scr_inter;
+
+ if (!current_anim)
+ error("Could not load anim for - %s", buf);
+
+ tile_pan(&picture_map, current_anim->frame->view_x, current_anim->frame->view_y);
+ tile_pan(&depth_map, current_anim->frame->view_x, current_anim->frame->view_y);
+
+ if (current_anim->misc[1]) {
+ warning("TODO: Unknown setting up anim_series, series_page_info, series_page_table");
+ }
+
+ has_cycles = cycle_list.num_cycles > 0;
+ current_anim2 = current_anim;
+
+ int height = (scr_inter.y == 200) ? 200 : 156;
+ buffer_init(&scr_work, 320, height);
+ scr_work_orig = scr_work;
+
+ viewing_at_y = (height == 200) ? 0 : 200 - (height / 2);
+ viewing_at_y2 = viewing_at_y;
+
+ buffer_fill(scr_work, 0);
+
+ // Speech handling
+ // TODO: Other stuff
}
done:
- ;
+ timer_activate_low_priority(nullptr);
+ buffer_free(&scr_work);
+ anim_unload(current_anim);
+ buffer_free(&scr_depth);
+ buffer_free(&scr_inter);
+ tile_map_free(&picture_map);
+ tile_map_free(&depth_map);
+
+ if (room)
+ mem_free(room);
+ timer_set_sound_flag(false);
+
+ timer_remove();
+ himem_shutdown();
}
void animview_main(const char *resName) {
Commit: 2fe3ccf1ff4b978b32c0147bd4834a73042cd13b
https://github.com/scummvm/scummvm/commit/2fe3ccf1ff4b978b32c0147bd4834a73042cd13b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-05-07T22:30:06+10:00
Commit Message:
MADS: DRAGONSPHERE: Added room 103
Changed paths:
engines/mads/madsv2/dragonsphere/rooms/room101.cpp
engines/mads/madsv2/dragonsphere/rooms/room101.h
engines/mads/madsv2/dragonsphere/rooms/room102.h
engines/mads/madsv2/dragonsphere/rooms/room103.cpp
engines/mads/madsv2/dragonsphere/rooms/room103.h
engines/mads/madsv2/dragonsphere/rooms/room909.cpp
engines/mads/madsv2/dragonsphere/rooms/room909.h
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room101.cpp b/engines/mads/madsv2/dragonsphere/rooms/room101.cpp
index c4477729ea3..28b8397b508 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room101.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room101.cpp
@@ -34,6 +34,121 @@ namespace MADSV2 {
namespace Dragonsphere {
namespace Rooms {
+#define local (&scratch)
+#define ss local->sprite
+#define seq local->sequence
+#define aa local->animation
+
+/**
+ * Room local variables
+ */
+struct Scratch {
+ int16 x02;
+ int16 x04;
+ int16 x06;
+ int16 x08;
+ int16 x0a;
+ int16 x0c;
+ int16 x20;
+ int16 x22;
+ int16 x24;
+ int16 x26;
+ int16 x28;
+ int16 x2a;
+ int16 x3c;
+ int16 x3e;
+ int16 x44;
+ int16 x46;
+ int16 x48;
+ int16 x4a;
+ int16 x4c;
+ int16 x4e;
+ int16 x50;
+ int16 x54;
+ int16 x56;
+ int32 x58;
+ int32 x5c;
+ int32 x60;
+ int16 x64;
+ int16 x66;
+ int16 x68;
+ int16 x6a;
+ int16 x6c;
+};
+
+
+/* ========================= Sprite Series =================== */
+
+#define fx_fire 1 /* rm101x0 */
+#define fx_fire_shadow 2 /* rm101x1 */
+#define fx_door 3 /* rm101x2 */
+#define fx_sconce_fire 4 /* rm101x3 */
+#define fx_draped_cape 5 /* rm101a5 */
+#define fx_open_door 6 /* kgrd_6 */
+
+
+/* ========================== Triggers ======================= */
+
+#define ROOM_101_I_AM_SO_REFRESHED 70
+#define ROOM_101_DOOR_CLOSES 80
+
+
+#define CONVERSATION_WITH_QUEEN 0
+
+/* Walk points */
+#define START_X_ROOM_102 330
+#define START_Y_ROOM_102 126
+#define START_X_ROOM_103 114
+#define START_Y_ROOM_103 152
+
+#define WALK_TO_X_FROM_102 297
+#define WALK_TO_Y_FROM_102 134
+
+#define WALK_TO_DOOR_X 319
+#define WALK_TO_DOOR_Y 129
+
+#define START_BEHIND_SCREEN_X 76
+#define START_BEHIND_SCREEN_Y 100
+
+#define WALK_FROM_SCREEN_X 102
+#define WALK_FROM_SCREEN_Y 100
+
+#define MIDDLE_ROOM_X 109
+#define MIDDLE_ROOM_Y 122
+
+/* Queen states (rm101b.aa) */
+#define CONV0_WALK_IN 1
+#define CONV0_STIR 2
+#define CONV0_STAND_1 3
+#define CONV0_STAND_2 4
+#define CONV0_SHAKE_FIST 5
+#define CONV0_TALK_LEAVE 6
+#define CONV0_LEAVE 7
+
+/* King states (rm101c.aa) */
+#define CONV0_KING_SLEEP 1
+#define CONV0_KING_TALK 2
+#define CONV0_KING_GET_UP 3
+
+/* Animation running flags */
+#define BOOK 1
+#define QUEEN 2
+#define KING 3
+
+/* Timer macros */
+#define TIME_TO_MOVE_1 200
+#define TIME_TO_MOVE_2 300
+#define TIME_TO_MOVE_3 400
+#define TIME_TO_MOVE_4 500
+#define TIME_TO_MOVE_5 600
+#define TIME_TO_MOVE_6 700
+#define TIME_TO_MOVE_7 300
+
+/* Random range */
+#define RANDOM_LOWEST_NUMBER 1
+#define RANDOM_HIGHEST_NUMBER 6
+
+
static Scratch scratch;
void room_101_init() {
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room101.h b/engines/mads/madsv2/dragonsphere/rooms/room101.h
index 26e585828ae..d657e6e2bf0 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room101.h
+++ b/engines/mads/madsv2/dragonsphere/rooms/room101.h
@@ -30,127 +30,7 @@ namespace MADSV2 {
namespace Dragonsphere {
namespace Rooms {
-#define local (&scratch)
-#define ss local->sprite
-#define seq local->sequence
-#define aa local->animation
-
-/**
- * Room local variables
- */
-struct Scratch {
- int16 x02;
- int16 x04;
- int16 x06;
- int16 x08;
- int16 x0a;
- int16 x0c;
- int16 x20;
- int16 x22;
- int16 x24;
- int16 x26;
- int16 x28;
- int16 x2a;
- int16 x3c;
- int16 x3e;
- int16 x44;
- int16 x46;
- int16 x48;
- int16 x4a;
- int16 x4c;
- int16 x4e;
- int16 x50;
- int16 x54;
- int16 x56;
- int32 x58;
- int32 x5c;
- int32 x60;
- int16 x64;
- int16 x66;
- int16 x68;
- int16 x6a;
- int16 x6c;
-};
-
-
-/* ========================= Sprite Series =================== */
-
-#define fx_fire 1 /* rm101x0 */
-#define fx_fire_shadow 2 /* rm101x1 */
-#define fx_door 3 /* rm101x2 */
-#define fx_sconce_fire 4 /* rm101x3 */
-#define fx_draped_cape 5 /* rm101a5 */
-#define fx_open_door 6 /* kgrd_6 */
-
-
-/* ========================== Triggers ======================= */
-
-#define ROOM_101_I_AM_SO_REFRESHED 70
-#define ROOM_101_DOOR_CLOSES 80
-
-
-#define CONVERSATION_WITH_QUEEN 0
-
-/* Walk points */
-#define START_X_ROOM_102 330
-#define START_Y_ROOM_102 126
-#define START_X_ROOM_103 114
-#define START_Y_ROOM_103 152
-
-#define WALK_TO_X_FROM_102 297
-#define WALK_TO_Y_FROM_102 134
-
-#define WALK_TO_DOOR_X 319
-#define WALK_TO_DOOR_Y 129
-
-#define START_BEHIND_SCREEN_X 76
-#define START_BEHIND_SCREEN_Y 100
-
-#define WALK_FROM_SCREEN_X 102
-#define WALK_FROM_SCREEN_Y 100
-
-#define MIDDLE_ROOM_X 109
-#define MIDDLE_ROOM_Y 122
-
-/* Queen states (rm101b.aa) */
-#define CONV0_WALK_IN 1
-#define CONV0_STIR 2
-#define CONV0_STAND_1 3
-#define CONV0_STAND_2 4
-#define CONV0_SHAKE_FIST 5
-#define CONV0_TALK_LEAVE 6
-#define CONV0_LEAVE 7
-
-/* King states (rm101c.aa) */
-#define CONV0_KING_SLEEP 1
-#define CONV0_KING_TALK 2
-#define CONV0_KING_GET_UP 3
-
-/* Animation running flags */
-#define BOOK 1
-#define QUEEN 2
-#define KING 3
-
-/* Timer macros */
-#define TIME_TO_MOVE_1 200
-#define TIME_TO_MOVE_2 300
-#define TIME_TO_MOVE_3 400
-#define TIME_TO_MOVE_4 500
-#define TIME_TO_MOVE_5 600
-#define TIME_TO_MOVE_6 700
-#define TIME_TO_MOVE_7 300
-
-/* Random range */
-#define RANDOM_LOWEST_NUMBER 1
-#define RANDOM_HIGHEST_NUMBER 6
-
-
extern void room_101_preload();
-extern void room_101_init();
-extern void room_101_daemon();
-extern void room_101_pre_parser();
-extern void room_101_parser();
-extern void room_101_error();
extern void room_101_synchronize(Common::Serializer &s);
} // namespace Rooms
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room102.h b/engines/mads/madsv2/dragonsphere/rooms/room102.h
index 96e46e9005e..f1ab40b03ac 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room102.h
+++ b/engines/mads/madsv2/dragonsphere/rooms/room102.h
@@ -30,6 +30,9 @@ namespace MADSV2 {
namespace Dragonsphere {
namespace Rooms {
+extern void room_102_preload();
+extern void room_102_synchronize(Common::Serializer &s);
+
} // namespace Rooms
} // namespace Dragonsphere
} // namespace MADSV2
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room103.cpp b/engines/mads/madsv2/dragonsphere/rooms/room103.cpp
index 52747619258..c8edbc9e089 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room103.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room103.cpp
@@ -19,10 +19,11 @@
*
*/
-#include "mads/madsv2/core/conv.h"
+#include "mads/madsv2/core/camera.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/text.h"
#include "mads/madsv2/dragonsphere/global.h"
@@ -34,33 +35,379 @@ namespace MADSV2 {
namespace Dragonsphere {
namespace Rooms {
-//static Scratch scratch;
+struct Scratch {
+ int16 sprite[15]; // series handles; used indices 1..11
+ int16 sequence[15]; // sequence handles; used indices 1..11
+ int16 animation[4]; // animation handles; unused in room103
+};
+
+#define ss (scratch.sprite)
+#define seq (scratch.sequence)
+#define aa (scratch.animation)
+
+/* ========================= Sprite Series =================== */
+
+#define fx_candle_flame_1 1 /* rm103y0 */
+#define fx_fire_sconce_1 2 /* rm103y1 */
+#define fx_fire_sconce_2 3 /* rm103y2 */
+#define fx_candle_flame_2 4 /* rm103y3 */
+#define fx_candle_flame_3 5 /* rm103y4 */
+#define fx_candle_flame_4 6 /* rm103y5 */
+#define fx_candle_flame_5 7 /* rm103y6 */
+#define fx_fire_sconce_3 8 /* rm103y7 */
+#define fx_door_101 9 /* rm103x0 */
+#define fx_door_102 10 /* rm103x1 */
+#define fx_open_door 11 /* kgrd_9 */
+
+/* ========================== Triggers ======================= */
+
+#define ROOM_103_DOOR_CLOSES 70
+
+/* Walk points */
+#define START_X_ROOM_101 173
+#define START_Y_ROOM_101 108
+#define START_X_ROOM_102 471
+#define START_Y_ROOM_102 108
+#define START_X_ROOM_104 130
+#define START_Y_ROOM_104 152
+#define START_X_ROOM_105 517
+#define START_Y_ROOM_105 152
+
+#define WALK_TO_X_FROM_101 162
+#define WALK_TO_Y_FROM_101 127
+#define WALK_TO_X_FROM_102 482
+#define WALK_TO_Y_FROM_102 128
+
+/* Cursor points */
+#define END_HALL_TAPESTRY_X 75
+#define END_HALL_TAPESTRY_Y 130
+
+/* Camera defines */
+#define RIGHT_HALLWAY 320
+
+
+static Scratch scratch;
void room_103_init() {
+ kernel.disable_fastwalk = true;
+ ss[fx_fire_sconce_1] = kernel_load_series(kernel_name('y', 1), 0);
+ ss[fx_fire_sconce_2] = kernel_load_series(kernel_name('y', 2), 0);
+ ss[fx_fire_sconce_3] = kernel_load_series(kernel_name('y', 7), 0);
+ ss[fx_candle_flame_1] = kernel_load_series(kernel_name('y', 0), 0);
+ ss[fx_candle_flame_2] = kernel_load_series(kernel_name('y', 3), 0);
+ ss[fx_candle_flame_3] = kernel_load_series(kernel_name('y', 4), 0);
+ ss[fx_candle_flame_4] = kernel_load_series(kernel_name('y', 5), 0);
+ ss[fx_candle_flame_5] = kernel_load_series(kernel_name('y', 6), 0);
+ ss[fx_door_101] = kernel_load_series(kernel_name('x', 0), 0);
+ ss[fx_door_102] = kernel_load_series(kernel_name('x', 1), 0);
+ ss[fx_open_door] = kernel_load_series("kgrd_9", 0);
+
+ seq[fx_fire_sconce_1] = kernel_seq_forward(ss[fx_fire_sconce_1], false, 7, 0, 0, 0);
+ seq[fx_fire_sconce_2] = kernel_seq_forward(ss[fx_fire_sconce_2], false, 7, 4, 0, 0);
+ seq[fx_fire_sconce_3] = kernel_seq_forward(ss[fx_fire_sconce_3], false, 7, 0, 0, 0);
+ seq[fx_candle_flame_1] = kernel_seq_forward(ss[fx_candle_flame_1], false, 7, 0, 0, 0);
+ seq[fx_candle_flame_2] = kernel_seq_forward(ss[fx_candle_flame_2], false, 7, 3, 0, 0);
+ seq[fx_candle_flame_3] = kernel_seq_forward(ss[fx_candle_flame_3], false, 7, 2, 0, 0);
+ seq[fx_candle_flame_4] = kernel_seq_forward(ss[fx_candle_flame_4], false, 7, 0, 0, 0);
+ seq[fx_candle_flame_5] = kernel_seq_forward(ss[fx_candle_flame_5], false, 7, 5, 0, 0);
+
+ if (previous_room == 104 || previous_room == 105) {
+ seq[fx_door_101] = kernel_seq_stamp(ss[fx_door_101], false, KERNEL_FIRST);
+ kernel_seq_depth(seq[fx_door_101], 8);
+ seq[fx_door_102] = kernel_seq_stamp(ss[fx_door_102], false, KERNEL_FIRST);
+ kernel_seq_depth(seq[fx_door_102], 8);
+ }
+
+ if (previous_room == 102) {
+ seq[fx_door_101] = kernel_seq_stamp(ss[fx_door_101], false, KERNEL_FIRST);
+ kernel_seq_depth(seq[fx_door_101], 6);
+ seq[fx_door_102] = kernel_seq_stamp(ss[fx_door_102], false, KERNEL_LAST);
+ kernel_seq_depth(seq[fx_door_102], 14);
+ camera_jump_to(RIGHT_HALLWAY, 0);
+ player_walk(WALK_TO_X_FROM_102, WALK_TO_Y_FROM_102, FACING_SOUTH);
+ player_first_walk(START_X_ROOM_102, START_Y_ROOM_102, FACING_SOUTH,
+ WALK_TO_X_FROM_102, WALK_TO_Y_FROM_102, FACING_SOUTH, false);
+ player_walk_trigger(ROOM_103_DOOR_CLOSES + 2);
+ } else if (previous_room == 104) {
+ player.x = START_X_ROOM_104;
+ player.y = START_Y_ROOM_104;
+ player.facing = FACING_NORTHEAST;
+ } else if (previous_room == 105) {
+ player.x = START_X_ROOM_105;
+ player.y = START_Y_ROOM_105;
+ player.facing = FACING_NORTHWEST;
+ camera_jump_to(RIGHT_HALLWAY, 0);
+ } else if (previous_room == 101 || previous_room != KERNEL_RESTORING_GAME) {
+ seq[fx_door_102] = kernel_seq_stamp(ss[fx_door_102], false, KERNEL_FIRST);
+ kernel_seq_depth(seq[fx_door_102], 6);
+ seq[fx_door_101] = kernel_seq_stamp(ss[fx_door_101], false, KERNEL_LAST);
+ kernel_seq_depth(seq[fx_door_101], 14);
+ player_first_walk(START_X_ROOM_101, START_Y_ROOM_101, FACING_SOUTH,
+ WALK_TO_X_FROM_101, WALK_TO_Y_FROM_101, FACING_SOUTH, false);
+ player_walk_trigger(ROOM_103_DOOR_CLOSES);
+ } else {
+ seq[fx_door_102] = kernel_seq_stamp(ss[fx_door_102], false, KERNEL_FIRST);
+ kernel_seq_depth(seq[fx_door_102], 6);
+ seq[fx_door_101] = kernel_seq_stamp(ss[fx_door_101], false, KERNEL_FIRST);
+ kernel_seq_depth(seq[fx_door_101], 6);
+ }
+
+ section_1_music();
}
void room_103_daemon() {
+ int16 temp;
+
+ switch (kernel.trigger) {
+ case ROOM_103_DOOR_CLOSES:
+ kernel_seq_delete(seq[fx_door_101]);
+ sound_play(25);
+ seq[fx_door_101] = kernel_seq_backward(ss[fx_door_101], false, 6, 0, 0, 1);
+ kernel_seq_depth(seq[fx_door_101], 6);
+ kernel_seq_range(seq[fx_door_101], 1, 3);
+ kernel_seq_trigger(seq[fx_door_101], KERNEL_TRIGGER_EXPIRE, 0, ROOM_103_DOOR_CLOSES + 1);
+ break;
+
+ case ROOM_103_DOOR_CLOSES + 1:
+ temp = seq[fx_door_101];
+ seq[fx_door_101] = kernel_seq_stamp(ss[fx_door_101], false, KERNEL_FIRST);
+ kernel_seq_depth(seq[fx_door_101], 6);
+ kernel_synch(KERNEL_SERIES, seq[fx_door_101], KERNEL_SERIES, temp);
+ player.commands_allowed = true;
+ break;
+ case ROOM_103_DOOR_CLOSES + 2:
+ kernel_seq_delete(seq[fx_door_102]);
+ sound_play(25);
+ seq[fx_door_102] = kernel_seq_backward(ss[fx_door_102], false, 6, 0, 0, 1);
+ kernel_seq_depth(seq[fx_door_102], 6);
+ kernel_seq_range(seq[fx_door_102], 1, 3);
+ kernel_seq_trigger(seq[fx_door_102], KERNEL_TRIGGER_EXPIRE, 0, ROOM_103_DOOR_CLOSES + 3);
+ break;
+
+ case ROOM_103_DOOR_CLOSES + 3:
+ temp = seq[fx_door_102];
+ seq[fx_door_102] = kernel_seq_stamp(ss[fx_door_102], false, KERNEL_FIRST);
+ kernel_seq_depth(seq[fx_door_102], 6);
+ kernel_synch(KERNEL_SERIES, seq[fx_door_102], KERNEL_SERIES, temp);
+ player.commands_allowed = true;
+ break;
+ }
}
void room_103_pre_parser() {
-
}
void room_103_parser() {
+ int16 temp;
+
+ if (player.look_around) {
+ text_show(10301);
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(37, 245, 0) || player_parse(6, 245, 0) || player_parse(10, 245, 0)) {
+ switch (kernel.trigger) {
+ case 0:
+ player.commands_allowed = false;
+ player.walker_visible = false;
+ seq[fx_open_door] = kernel_seq_pingpong(ss[fx_open_door], false, 7, 0, 0, 2);
+ kernel_seq_player(seq[fx_open_door], true);
+ kernel_seq_trigger(seq[fx_open_door], KERNEL_TRIGGER_SPRITE, 2, 1);
+ kernel_seq_trigger(seq[fx_open_door], KERNEL_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 1:
+ kernel_seq_delete(seq[fx_door_101]);
+ sound_play(24);
+ seq[fx_door_101] = kernel_seq_forward(ss[fx_door_101], false, 7, 0, 0, 1);
+ kernel_seq_depth(seq[fx_door_101], 8);
+ kernel_seq_trigger(seq[fx_door_101], KERNEL_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2:
+ temp = seq[fx_door_101];
+ seq[fx_door_101] = kernel_seq_stamp(ss[fx_door_101], false, KERNEL_LAST);
+ kernel_seq_depth(seq[fx_door_101], 14);
+ kernel_synch(KERNEL_SERIES, seq[fx_door_101], KERNEL_SERIES, temp);
+ break;
+
+ case 3:
+ player.walker_visible = true;
+ kernel_synch(KERNEL_PLAYER, 0, KERNEL_SERIES, seq[fx_open_door]);
+ kernel_timing_trigger(1, 4);
+ break;
+
+ case 4:
+ player_walk(START_X_ROOM_101, START_Y_ROOM_101, FACING_NORTH);
+ player_walk_trigger(5);
+ break;
+
+ case 5:
+ kernel_seq_delete(seq[fx_door_101]);
+ sound_play(25);
+ seq[fx_door_101] = kernel_seq_backward(ss[fx_door_101], false, 7, 0, 0, 1);
+ kernel_seq_depth(seq[fx_door_101], 1);
+ kernel_seq_trigger(seq[fx_door_101], KERNEL_TRIGGER_EXPIRE, 0, 6);
+ break;
+
+ case 6:
+ temp = seq[fx_door_101];
+ seq[fx_door_101] = kernel_seq_stamp(ss[fx_door_101], false, KERNEL_FIRST);
+ kernel_seq_depth(seq[fx_door_101], 1);
+ kernel_synch(KERNEL_SERIES, seq[fx_door_101], KERNEL_SERIES, temp);
+ kernel_timing_trigger(6, 7);
+ break;
+
+ case 7:
+ new_room = 101;
+ break;
+ }
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(37, 36, 0) || player_parse(6, 36, 0) || player_parse(10, 36, 0)) {
+ switch (kernel.trigger) {
+ case 0:
+ player.commands_allowed = false;
+ player.walker_visible = false;
+ seq[fx_open_door] = kernel_seq_pingpong(ss[fx_open_door], true, 7, 0, 0, 2);
+ kernel_seq_player(seq[fx_open_door], true);
+ kernel_seq_trigger(seq[fx_open_door], KERNEL_TRIGGER_SPRITE, 2, 1);
+ kernel_seq_trigger(seq[fx_open_door], KERNEL_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 1:
+ kernel_seq_delete(seq[fx_door_102]);
+ sound_play(24);
+ seq[fx_door_102] = kernel_seq_forward(ss[fx_door_102], false, 7, 0, 0, 1);
+ kernel_seq_depth(seq[fx_door_102], 8);
+ kernel_seq_trigger(seq[fx_door_102], KERNEL_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2:
+ temp = seq[fx_door_102];
+ seq[fx_door_102] = kernel_seq_stamp(ss[fx_door_102], false, KERNEL_LAST);
+ kernel_seq_depth(seq[fx_door_102], 14);
+ kernel_synch(KERNEL_SERIES, seq[fx_door_102], KERNEL_SERIES, temp);
+ break;
+
+ case 3:
+ player.walker_visible = true;
+ kernel_synch(KERNEL_PLAYER, 0, KERNEL_SERIES, seq[fx_open_door]);
+ kernel_timing_trigger(1, 4);
+ break;
+
+ case 4:
+ player_walk(START_X_ROOM_102, START_Y_ROOM_102, FACING_NORTH);
+ player_walk_trigger(5);
+ break;
+
+ case 5:
+ kernel_seq_delete(seq[fx_door_102]);
+ sound_play(25);
+ seq[fx_door_102] = kernel_seq_backward(ss[fx_door_102], false, 7, 0, 0, 1);
+ kernel_seq_depth(seq[fx_door_102], 1);
+ kernel_seq_trigger(seq[fx_door_102], KERNEL_TRIGGER_EXPIRE, 0, 6);
+ break;
+
+ case 6:
+ temp = seq[fx_door_102];
+ seq[fx_door_102] = kernel_seq_stamp(ss[fx_door_102], false, KERNEL_FIRST);
+ kernel_seq_depth(seq[fx_door_102], 1);
+ kernel_synch(KERNEL_SERIES, seq[fx_door_102], KERNEL_SERIES, temp);
+ kernel_timing_trigger(6, 7);
+ break;
+
+ case 7:
+ new_room = 102;
+ break;
+ }
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(37, 249, 0) || player_parse(6, 249, 0) || player_parse(10, 249, 0)) {
+ new_room = 104;
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(37, 250, 0) || player_parse(6, 250, 0) || player_parse(10, 250, 0)) {
+ new_room = 105;
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(3, 0) || player_parse(30, 0)) {
+ if (player_parse(26, 0)) {
+ if (inter_point_x <= END_HALL_TAPESTRY_X && inter_point_y <= END_HALL_TAPESTRY_Y)
+ text_show(10302);
+ else
+ text_show(10303);
+ player.command_ready = false;
+ return;
+ }
+ if (player_parse(246, 0)) { text_show(10305); player.command_ready = false; return; }
+ if (player_parse(36, 0)) { text_show(10307); player.command_ready = false; return; }
+ if (player_parse(245, 0)) { text_show(10308); player.command_ready = false; return; }
+ if (player_parse(23, 0)) { text_show(10309); player.command_ready = false; return; }
+ if (player_parse(198, 0)) { text_show(10311); player.command_ready = false; return; }
+ if (player_parse(248, 0)) { text_show(10312); player.command_ready = false; return; }
+ if (player_parse(247, 0)) { text_show(10314); player.command_ready = false; return; }
+ if (player_parse(244, 0)) { text_show(10315); player.command_ready = false; return; }
+ if (player_parse(44, 0)) { text_show(10317); player.command_ready = false; return; }
+ if (player_parse(41, 0)) { text_show(10320); player.command_ready = false; return; }
+ if (player_parse(40, 0)) { text_show(10322); player.command_ready = false; return; }
+ if (player_parse(250, 0)) { text_show(10323); player.command_ready = false; return; }
+ if (player_parse(249, 0)) { text_show(10324); player.command_ready = false; return; }
+ }
+
+ if ((player_parse(4, 0) || player_parse(10, 0)) && player_parse(244, 0)) {
+ text_show(10316);
+ player.command_ready = false;
+ return;
+ }
+
+ if ((player_parse(5, 0) || player_parse(10, 0)) && player_parse(26, 0)) {
+ text_show(10304);
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(10, 246, 0)) {
+ text_show(10306);
+ player.command_ready = false;
+ return;
+ }
+
+ if (player_parse(6, 23, 0)) {
+ text_show(10310);
+ player.command_ready = false;
+ return;
+ }
+ if (player_parse(6, 248, 0) || player_parse(6, 247, 0)) {
+ text_show(10313);
+ player.command_ready = false;
+ return;
+ }
}
void room_103_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);
}
void room_103_preload() {
- room_init_code_pointer = room_103_init;
+ room_init_code_pointer = room_103_init;
room_pre_parser_code_pointer = room_103_pre_parser;
- room_parser_code_pointer = room_103_parser;
- room_daemon_code_pointer = room_103_daemon;
+ room_parser_code_pointer = room_103_parser;
+ room_daemon_code_pointer = room_103_daemon;
section_1_walker();
section_1_interface();
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room103.h b/engines/mads/madsv2/dragonsphere/rooms/room103.h
index 6356a568260..ba7b9d9d412 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room103.h
+++ b/engines/mads/madsv2/dragonsphere/rooms/room103.h
@@ -30,17 +30,8 @@ namespace MADSV2 {
namespace Dragonsphere {
namespace Rooms {
-#define local (&scratch)
-#define ss local->sprite
-#define seq local->sequence
-#define aa local->animation
-
-/**
- * Room local variables
- */
-struct Scratch {
-
-};
+extern void room_103_preload();
+extern void room_103_synchronize(Common::Serializer &s);
} // namespace Rooms
} // namespace Dragonsphere
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room909.cpp b/engines/mads/madsv2/dragonsphere/rooms/room909.cpp
index afe3bebacab..b0a3ba7a26e 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room909.cpp
+++ b/engines/mads/madsv2/dragonsphere/rooms/room909.cpp
@@ -36,6 +36,53 @@ namespace MADSV2 {
namespace Dragonsphere {
namespace Rooms {
+
+#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)
+};
+
+
+/* ========================= Triggers ======================== */
+
+#define TRIGGER_SHOW_SCORE 61 // fired by kernel_timing_trigger after frame 105; daemon shows score screen
+
+
+/* ======================== Anim frames ====================== */
+
+#define FRAME_HEARTBEAT_SOUND 52 // 0x34: play speech line 1 (or sound fallback)
+#define FRAME_MUSIC_SOUND 82 // 0x52: play music sound (60) if music enabled
+#define FRAME_TIMING_TRIGGER 105 // 0x69: arm 2-second delay for TRIGGER_SHOW_SCORE
+#define FRAME_LOOP_RESET 106 // 0x6A: reset animation to FRAME_TIMING_TRIGGER
+
+
static Scratch scratch;
void room_909_init() {
diff --git a/engines/mads/madsv2/dragonsphere/rooms/room909.h b/engines/mads/madsv2/dragonsphere/rooms/room909.h
index a1d644ed8e3..b386a50f3f0 100644
--- a/engines/mads/madsv2/dragonsphere/rooms/room909.h
+++ b/engines/mads/madsv2/dragonsphere/rooms/room909.h
@@ -30,57 +30,7 @@ namespace MADSV2 {
namespace Dragonsphere {
namespace Rooms {
-#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)
-};
-
-
-/* ========================= Triggers ======================== */
-
-#define TRIGGER_SHOW_SCORE 61 // fired by kernel_timing_trigger after frame 105; daemon shows score screen
-
-
-/* ======================== Anim frames ====================== */
-
-#define FRAME_HEARTBEAT_SOUND 52 // 0x34: play speech line 1 (or sound fallback)
-#define FRAME_MUSIC_SOUND 82 // 0x52: play music sound (60) if music enabled
-#define FRAME_TIMING_TRIGGER 105 // 0x69: arm 2-second delay for TRIGGER_SHOW_SCORE
-#define FRAME_LOOP_RESET 106 // 0x6A: reset animation to FRAME_TIMING_TRIGGER
-
-
extern void room_909_preload();
-extern void room_909_init();
-extern void room_909_daemon();
-extern void room_909_pre_parser();
-extern void room_909_parser();
extern void room_909_synchronize(Common::Serializer &s);
} // namespace Rooms
More information about the Scummvm-git-logs
mailing list