[Scummvm-git-logs] scummvm master -> 54963c69e218c6c7d0a249cd13c6e02b5d0926b2

dreammaster noreply at scummvm.org
Sat Jun 20 11:19:10 UTC 2026


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
8f82acfe81 MADS: FOREST: Properly start in room 901 title/credits view
e74e6744ac MADS: FOREST: Implement main menu room
54963c69e2 MADS: FOREST: Remove placeholder main menu executable code


Commit: 8f82acfe8187cae011c963f4f341326aa501dda1
    https://github.com/scummvm/scummvm/commit/8f82acfe8187cae011c963f4f341326aa501dda1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-20T21:18:59+10:00

Commit Message:
MADS: FOREST: Properly start in room 901 title/credits view

Changed paths:
    engines/mads/madsv2/core/matte.cpp
    engines/mads/madsv2/forest/main.cpp
    engines/mads/madsv2/forest/rooms/room901.cpp


diff --git a/engines/mads/madsv2/core/matte.cpp b/engines/mads/madsv2/core/matte.cpp
index 800c50f545a..06dc11664e6 100644
--- a/engines/mads/madsv2/core/matte.cpp
+++ b/engines/mads/madsv2/core/matte.cpp
@@ -610,8 +610,6 @@ static void matte_special_effect(int special_effect, int full_screen) {
 		work_screen = &scr_work;
 	}
 
-	mouse_hide();
-
 	if (!timer_low_semaphore) {
 		if ((special_effect == MATTE_FX_FADE_FROM_BLACK) ||
 			(special_effect == MATTE_FX_FADE_THRU_BLACK)) {
@@ -708,8 +706,6 @@ static void matte_special_effect(int special_effect, int full_screen) {
 			work_screen->x, work_screen->y);
 		break;
 	}
-
-	mouse_show();
 }
 
 void matte_frame(int special_effect, int full_screen) {
diff --git a/engines/mads/madsv2/forest/main.cpp b/engines/mads/madsv2/forest/main.cpp
index 96601a09f6f..75727c6a7d5 100644
--- a/engines/mads/madsv2/forest/main.cpp
+++ b/engines/mads/madsv2/forest/main.cpp
@@ -127,17 +127,17 @@ static void main_cold_data_init() {
 	game_menu_exit = global_menu_system_shutdown;
 	game_emergency_save = global_emergency_save;
 
-	Common::strcpy_s(config_file_name, "config.dra");
-	Common::strcpy_s(save_game_key, "drag");
-	Common::strcpy_s(restart_game_key, "dragon");
+	Common::strcpy_s(config_file_name, "config.for");
+	Common::strcpy_s(save_game_key, "oauf");
+	Common::strcpy_s(restart_game_key, "oauf");
 
-	Common::strcpy_s(player.series_name, "RAL");
+	Common::strcpy_s(player.series_name, "B");
 	player.walker_must_reload = true;
 	player.walker_loads_first = false;
 	player.walker_visible = true;
 	player.scaling_velocity = true;
 
-	Common::strcpy_s(kernel_cheating_password, "WIDECHEW");
+	Common::strcpy_s(kernel_cheating_password, "LLAMA");
 	kernel_cheating_allowed = strlen(kernel_cheating_password);
 
 	kernel.cheating = gDebugLevel == 9 ? kernel_cheating_allowed : 0;
@@ -152,8 +152,8 @@ static void game_main(int argc, const char **argv) {
 
 	mads_mode = env_verify();
 
-	new_section = 1;
-	new_room = 101;
+	new_section = 9;
+	new_room = 901;
 	player.x = 160;
 	player.y = 78;
 
diff --git a/engines/mads/madsv2/forest/rooms/room901.cpp b/engines/mads/madsv2/forest/rooms/room901.cpp
index 9dc094624f7..ef465ebc4ca 100644
--- a/engines/mads/madsv2/forest/rooms/room901.cpp
+++ b/engines/mads/madsv2/forest/rooms/room901.cpp
@@ -67,10 +67,11 @@ static void room_901_pre_parser() {
 }
 
 static void room_901_parser() {
+	// No implementation
 }
 
 void room_901_synchronize(Common::Serializer &s) {
-	// Room has no scratch area
+	// No implementation
 }
 
 void room_901_preload() {


Commit: e74e6744ac5dc79fdc5eedf28df37e1f06dbc6d7
    https://github.com/scummvm/scummvm/commit/e74e6744ac5dc79fdc5eedf28df37e1f06dbc6d7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-20T21:18:59+10:00

Commit Message:
MADS: FOREST: Implement main menu room

Changed paths:
    engines/mads/madsv2/forest/rooms/room901.cpp
    engines/mads/madsv2/forest/rooms/room904.cpp


diff --git a/engines/mads/madsv2/forest/rooms/room901.cpp b/engines/mads/madsv2/forest/rooms/room901.cpp
index ef465ebc4ca..e61409d1287 100644
--- a/engines/mads/madsv2/forest/rooms/room901.cpp
+++ b/engines/mads/madsv2/forest/rooms/room901.cpp
@@ -47,9 +47,6 @@ static void room_901_init() {
 	if (ConfMan.getBool("seen_intro")) {
 		new_room = 904;
 	} else {
-		ConfMan.setBool("seen_intro", true);
-		ConfMan.flushToDisk();
-
 		kernel_timing_trigger(300, START_INTRO);
 	}
 }
diff --git a/engines/mads/madsv2/forest/rooms/room904.cpp b/engines/mads/madsv2/forest/rooms/room904.cpp
index 5414c294812..77ae7046368 100644
--- a/engines/mads/madsv2/forest/rooms/room904.cpp
+++ b/engines/mads/madsv2/forest/rooms/room904.cpp
@@ -1,4 +1,4 @@
-/* ScummVM - Graphic Adventure Engine
+/* ScummVM - Graphic Adventure Engine
  *
  * ScummVM is the legal property of its developers, whose names
  * are too numerous to list here. Please refer to the COPYRIGHT
@@ -19,59 +19,323 @@
  *
  */
 
+#include "common/config-manager.h"
 #include "mads/madsv2/core/game.h"
-#include "mads/madsv2/core/imath.h"
-#include "mads/madsv2/core/inter.h"
+#include "mads/madsv2/core/global.h"
 #include "mads/madsv2/core/kernel.h"
 #include "mads/madsv2/core/matte.h"
+#include "mads/madsv2/core/midi.h"
 #include "mads/madsv2/core/mouse.h"
-#include "mads/madsv2/core/sound.h"
-#include "mads/madsv2/core/text.h"
-#include "mads/madsv2/forest/mads/inventory.h"
-#include "mads/madsv2/forest/mads/sounds.h"
-#include "mads/madsv2/forest/mads/words.h"
+#include "mads/madsv2/core/object.h"
+#include "mads/madsv2/core/player.h"
 #include "mads/madsv2/forest/global.h"
 #include "mads/madsv2/forest/rooms/section9.h"
 #include "mads/madsv2/forest/rooms/room904.h"
+#include "mads/madsv2/engine.h"
 
 namespace MADS {
 namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
+struct Scratch {
+	int16 sprite[10];        /* ss[] — series handles for maint0-5 and main0-3 */
+	int16 sequence[10];      /* seq[] — sequence handles                        */
+	int16 animation[7];      /* aa[]  — pressed-state sequence handles          */
+	AnimationInfo animation_info[2];
+};
+
+static Scratch scratch;
+
+#define local (&scratch)
+#define ss    local->sprite
+#define seq   local->sequence
+#define aa    local->animation
+
 /* Triggers */
-#define TRIGGER0  100
-#define TRIGGER1  101
+#define TRIGGER1        101
+#define TRIGGER_ACTION  150
+
+static void room_904_setup_objects() {
+	object[0].location  = 101;
+	object[1].location  = 302;
+	object[2].location  = 221;
+	object[3].location  = 503;
+	object[4].location  = 307;
+	object[5].location  = 106;
+	object[6].location  = 303;
+	object[7].location  = 201;
+	object[8].location  = 101;
+	object[9].location  = 204;
+	object[10].location = 301;
+	object[11].location = 101;
+	object[12].location = 201;
+	object[13].location = 403;
+	object[14].location = 307;
+	object[15].location = 301;
 
+	for (int i = 0; i < 16; ++i)
+		object_set_quality(i, 0, 0);
+
+	player.num_rooms_been_in = 0;
+	global_init_code();
+}
+
+static void room_904_seen_intro() {
+	ConfMan.setBool("seen_intro", true);
+	ConfMan.flushToDisk();
+}
 
 static void room_904_init() {
-	mouse_hide();
-	global[g009] = false;
-	global[player_score] = false;
+	last_keypressed = -1;
+	global_digi_play(3);
+	scratch.animation_info[1]._active = 0;
+	scratch.animation_info[1]._frame = 0;
+	global[g009] = -1;
 	viewing_at_y = 22;
-	kernel_timing_trigger(20, TRIGGER1);
-	kernel_run_animation("*rm903i", TRIGGER0);
-	player.walker_visible = false;
+	scratch.animation_info[1]._val3 = 0;
+	global[player_score] = 0;
+
+	ss[6] = kernel_load_series("*main0", 0);
+	ss[8] = kernel_load_series("*main1", 0);
+	ss[9] = kernel_load_series("*main2", 0);
+	ss[7] = kernel_load_series("*main3", 0);
+	seq[1] = kernel_load_series("*main4", 0);
+
+	kernel_seq_depth(kernel_seq_stamp(ss[6], false, -1), 10);
+	kernel_seq_depth(kernel_seq_stamp(ss[7], false, -1), 10);
+	kernel_seq_depth(kernel_seq_stamp(ss[8], false, -1), 10);
+	kernel_seq_depth(kernel_seq_stamp(ss[9], false, -1), 10);
+	kernel_seq_depth(kernel_seq_stamp(seq[1], false, -1), 10);
+
+	ss[0] = kernel_load_series("*maint0", 0);
+	ss[2] = kernel_load_series("*maint1", 0);
+	ss[3] = kernel_load_series("*maint2", 0);
+	ss[1] = kernel_load_series("*maint3", 0);
+	ss[5] = kernel_load_series("*maint4", 0);
+	ss[4] = kernel_load_series("*maint5", 0);
+
+	kernel_timing_trigger(10, TRIGGER1);
+	player.walker_visible = 0;
 }
 
 static void room_904_daemon() {
-	// TODO: room_904_daemon
-}
+	int16 selection = 0;
 
-static void room_904_pre_parser() {
-}
+	if (kernel.trigger == TRIGGER1)
+		mouse_cursor_sprite(cursor, 1);
+
+	if (mouse_hidden)
+		mouse_show();
+
+	/* Hit-test the 6 menu button regions */
+	if (mouse_x >= 42 && mouse_x <= 71 && mouse_y >= 30 && mouse_y <= 52)
+		selection = 1;
+	if (mouse_x >= 41 && mouse_x <= 71 && mouse_y >= 146 && mouse_y <= 170)
+		selection = 2;
+	if (mouse_x >= 248 && mouse_x <= 278 && mouse_y >= 30 && mouse_y <= 52)
+		selection = 3;
+	if (mouse_x >= 125 && mouse_x <= 191 && mouse_y >= 146 && mouse_y <= 171)
+		selection = 4;
+	if (mouse_x >= 248 && mouse_x <= 277 && mouse_y >= 146 && mouse_y <= 170)
+		selection = 5;
+	if (mouse_x >= 72 && mouse_x <= 247 && mouse_y >= 55 && mouse_y <= 144)
+		selection = 6;
+
+	/* Hover: stamp highlight when first entering a button area */
+	if (scratch.animation_info[1]._active == 0) {
+		switch (selection) {
+		case 1:
+			seq[5] = kernel_seq_stamp(ss[0], false, 1);
+			kernel_seq_depth(seq[5], 1);
+			scratch.animation_info[1]._active = 1;
+			break;
+		case 2:
+			seq[7] = kernel_seq_stamp(ss[2], false, 1);
+			kernel_seq_depth(seq[7], 1);
+			scratch.animation_info[1]._active = 2;
+			break;
+		case 3:
+			seq[8] = kernel_seq_stamp(ss[3], false, 1);
+			kernel_seq_depth(seq[8], 1);
+			scratch.animation_info[1]._active = 3;
+			break;
+		case 4:
+			seq[6] = kernel_seq_stamp(ss[1], false, 1);
+			kernel_seq_depth(seq[6], 1);
+			scratch.animation_info[1]._active = 4;
+			break;
+		case 5:
+			aa[0] = kernel_seq_stamp(ss[5], false, 1);
+			kernel_seq_depth(aa[0], 1);
+			scratch.animation_info[1]._active = 5;
+			break;
+		case 6:
+			seq[9] = kernel_seq_stamp(ss[4], false, 1);
+			kernel_seq_depth(seq[9], 1);
+			scratch.animation_info[1]._active = 6;
+			break;
+		}
+	}
+
+	/* Hover: delete old highlight when leaving a button area or switching buttons */
+	if (selection == 0 || scratch.animation_info[1]._active != selection) {
+		switch (scratch.animation_info[1]._active) {
+		case 1: kernel_seq_delete(seq[5]); break;
+		case 2: kernel_seq_delete(seq[7]); break;
+		case 3: kernel_seq_delete(seq[8]); break;
+		case 4: kernel_seq_delete(seq[6]); break;
+		case 5: kernel_seq_delete(aa[0]);  break;
+		case 6: kernel_seq_delete(seq[9]); break;
+		}
+		scratch.animation_info[1]._active = 0;
+	}
+
+	/* Click: stamp pressed state when button first clicked */
+	if (mouse_stroke_going &&
+	    scratch.animation_info[1]._val3 == 0 &&
+	    scratch.animation_info[1]._frame == 0) {
+		switch (selection) {
+		case 1:
+			aa[1] = kernel_seq_stamp(ss[6], false, 2);
+			kernel_seq_depth(aa[1], 1);
+			scratch.animation_info[1]._frame = 1;
+			break;
+		case 2:
+			aa[3] = kernel_seq_stamp(ss[8], false, 2);
+			kernel_seq_depth(aa[3], 1);
+			scratch.animation_info[1]._frame = 2;
+			break;
+		case 3:
+			aa[4] = kernel_seq_stamp(ss[9], false, 2);
+			kernel_seq_depth(aa[4], 1);
+			scratch.animation_info[1]._frame = 3;
+			break;
+		case 4:
+			aa[2] = kernel_seq_stamp(ss[7], false, 2);
+			kernel_seq_depth(aa[2], 1);
+			scratch.animation_info[1]._frame = 4;
+			break;
+		case 5:
+			aa[6] = kernel_seq_stamp(seq[1], false, 2);
+			kernel_seq_depth(aa[6], 1);
+			scratch.animation_info[1]._frame = 5;
+			break;
+		case 6:
+			scratch.animation_info[1]._frame = 6;
+			break;
+		}
+	}
+
+	/* Cancel: delete pressed stamp when mouse moves off a button while held */
+	if (scratch.animation_info[1]._frame != 0 &&
+	    scratch.animation_info[1]._val3 == 0 &&
+	    selection == 0) {
+		switch (scratch.animation_info[1]._frame) {
+		case 1: kernel_seq_delete(aa[1]); break;
+		case 2: kernel_seq_delete(aa[3]); break;
+		case 3: kernel_seq_delete(aa[4]); break;
+		case 4: kernel_seq_delete(aa[2]); break;
+		case 5: kernel_seq_delete(aa[6]); break;
+		default: break;
+		}
+		scratch.animation_info[1]._frame = 0;
+	}
+
+	/* Release: delete pressed stamp on mouse release and schedule the action */
+	if (!mouse_stroke_going && scratch.animation_info[1]._val3 == 0) {
+		switch (scratch.animation_info[1]._frame) {
+		case 1: kernel_seq_delete(aa[1]); break;
+		case 2: kernel_seq_delete(aa[3]); break;
+		case 3: kernel_seq_delete(aa[4]); break;
+		case 4: kernel_seq_delete(aa[2]); break;
+		case 5: kernel_seq_delete(aa[6]); break;
+		default: break;
+		}
+		if (scratch.animation_info[1]._frame != 0) {
+			kernel_timing_trigger(1, TRIGGER_ACTION);
+			scratch.animation_info[1]._val3 = -1;
+		}
+	}
+
+	/* Action: execute the chosen menu option when the delay trigger fires */
+	if (kernel.trigger == TRIGGER_ACTION) {
+		switch (scratch.animation_info[1]._frame) {
+		case 1:
+			midi_stop();
+			global[player_score] = 0;
+			global[g016] = -1;
+			global[g102] = -1;
+			new_room = 510;
+			break;
+
+		case 2:
+			midi_stop();
+			if (g_engine->loadGameState(0).getCode() != Common::kNoError)
+				new_room = 101;
+			break;
+
+		case 3:
+			midi_stop();
+			kernel.activate_menu = 3;
+			break;
+
+		case 4:
+			room_904_setup_objects();
+			global[player_score] = 0;
+			midi_stop();
+			flags[0] = -4;
+			global[g016] = -1;
+			new_room = 101;
+			room_904_seen_intro();
+			break;
+
+		case 5:
+			game.going = 0;
+			break;
+
+		case 6:
+			new_room = 101;
+			midi_stop();
+			room_904_setup_objects();
+			global[g016] = 0;
+			flags[0] = flags[1] = flags[2] = flags[3] = 0;
+			break;
+
+		default:
+			break;
+		}
+
+		scratch.animation_info[1]._val3 = 0;
+		scratch.animation_info[1]._frame = 0;
+	}
+
+	/* Escape key: trigger quit */
+	if (last_keypressed == 27) {
+		kernel_timing_trigger(1, TRIGGER_ACTION);
+		scratch.animation_info[1]._val3 = -1;
+		scratch.animation_info[1]._frame = 5;
+		last_keypressed = -1;
+	}
 
-static void room_904_parser() {
+	/* Enter key: trigger play/continue */
+	if (last_keypressed == 13) {
+		kernel_timing_trigger(1, TRIGGER_ACTION);
+		scratch.animation_info[1]._val3 = -1;
+		scratch.animation_info[1]._frame = 6;
+		last_keypressed = -1;
+	}
 }
 
 void room_904_synchronize(Common::Serializer &s) {
-	// Room has no scratch area
+	for (int16 &v : scratch.sprite)    s.syncAsSint16LE(v);
+	for (int16 &v : scratch.sequence)  s.syncAsSint16LE(v);
+	for (int16 &v : scratch.animation) s.syncAsSint16LE(v);
+	for (auto &ai : scratch.animation_info) ai.synchronize(s);
 }
 
 void room_904_preload() {
 	room_init_code_pointer = room_904_init;
-	room_pre_parser_code_pointer = room_904_pre_parser;
-	room_parser_code_pointer = room_904_parser;
 	room_daemon_code_pointer = room_904_daemon;
 
 	global[g016] = true;


Commit: 54963c69e218c6c7d0a249cd13c6e02b5d0926b2
    https://github.com/scummvm/scummvm/commit/54963c69e218c6c7d0a249cd13c6e02b5d0926b2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-06-20T21:18:59+10:00

Commit Message:
MADS: FOREST: Remove placeholder main menu executable code

Unlike the earlier games, Forest doesn't have a separate
executable for the main menu, nor does it have animview/textivew
resources for the intro or credits display. All the startup code
is implemented directly as custom rooms in section 9.

Changed paths:
  R engines/mads/madsv2/forest/main_menu.cpp
  R engines/mads/madsv2/forest/main_menu.h
    engines/mads/madsv2/forest/main.cpp
    engines/mads/module.mk


diff --git a/engines/mads/madsv2/forest/main.cpp b/engines/mads/madsv2/forest/main.cpp
index 75727c6a7d5..c93e50de25d 100644
--- a/engines/mads/madsv2/forest/main.cpp
+++ b/engines/mads/madsv2/forest/main.cpp
@@ -38,7 +38,6 @@
 #include "mads/madsv2/core/player.h"
 #include "mads/madsv2/core/quote.h"
 #include "mads/madsv2/core/speech.h"
-#include "mads/madsv2/forest/main_menu.h"
 #include "mads/madsv2/forest/menus.h"
 #include "mads/madsv2/engine.h"
 
@@ -51,74 +50,6 @@ constexpr byte LINE_COLOR = 2;
 
 char *quotes;
 
-static void main_menu_main() {
-#ifdef TODO
-	auto &screen = *g_engine->getScreen();
-	Palette palette;
-
-	if (!kernel_game_startup(19, KERNEL_STARTUP_CURSOR | KERNEL_STARTUP_INTERRUPT | KERNEL_STARTUP_FONT,
-		nullptr, nullptr)) {
-		matte_init(0xFFFF);
-		bool valid = !kernel_room_startup(920, 0, nullptr, true, true);
-
-		// Setup scr_work to use the full surface of scr_main (i.e. 320x200).
-		// Because of this, viewing_at_y is actually == 0
-		scr_work.y = picture_map.viewport_y;
-		viewing_at_y = (200 - scr_work.y) >> 1;
-
-		mouse_cursor_sprite(cursor, 7);
-		mouse_show();
-		mouse_force(280, 126);
-		mouse_hide();
-
-		mouse_cursor_sprite(cursor, 1);
-		kernel_seq_init();
-		kernel_message_init();
-		kernel_animation_init();
-		kernel_init_dynamic();
-
-		picture_view_x = 0;
-		picture_view_y = 0;
-		new_background = true;
-
-		if (valid) {
-			memset(&palette, 0, sizeof(palette));
-			mcga_setpal(&palette);
-			mouse_cursor_sprite(cursor, 1);
-
-			if (SHOW_LINES && viewing_at_y != 0) {
-				screen.hLine(0, viewing_at_y - 2, 319, LINE_COLOR);
-				screen.hLine(0, scr_work.y + viewing_at_y + 1, 319, LINE_COLOR);
-			}
-
-			kernel_load_sound_driver("*#SOUND.DR9", 'N', 544, 0, 49);
-
-			menu_control();
-
-			if (selected_item >= 0) {
-				// Zero out the first 3 entries of both magic color arrays
-				for (int i = 0; i < 3; i++) {
-					magic_color_values[i] = 0;
-					magic_color_flags[i] = 0;
-				}
-
-				mcga_getpal(&palette);
-
-				magic_fade_to_grey(palette, 0, 0x10, 1, 1, 0, 0, 0);
-			}
-		}
-
-		free(quotes);
-		kernel_unload_sound_driver();
-		kernel_game_shutdown();
-	}
-
-	mcga_reset();
-#else
-	selected_item = 0;
-#endif
-}
-
 static void main_cold_data_init() {
 	debugger_reset = game_debugger_reset;
 	debugger_update = game_debugger;
@@ -222,59 +153,7 @@ void forest_main() {
 	if (!env_verify())
 		env_search_mode = ENV_SEARCH_CONCAT_FILES;
 
-	if (ConfMan.getBool("start_game") || ConfMan.hasKey("save_slot"))
-		selected_item = 0;
-	else if (ConfMan.getBool("start_intro"))
-		selected_item = 3;
-	else
-		selected_item = -1;
-
-	while (!g_engine->shouldQuit()) {
-		g_engine->getScreen()->clear();
-
-		switch (selected_item) {
-		case -1:
-			main_menu_main();
-			break;
-
-		case 0:
-			game_main(2, CMD_LINE);
-			return;
-
-		case 1: {
-			// Resume savegame
-			// Get a list of saves and choose the last one
-			auto saves = g_engine->listSaves();
-			if (!saves.empty())
-				savegame_slot = saves.back().getSaveSlot();
-
-			// Start the game, which will also load the selected savegame
-			game_main(2, CMD_LINE);
-			return;
-		}
-
-		case 2:
-			// Restore savegame
-			game_restore_flag = 2;
-			game_main(2, CMD_LINE);
-			return;
-
-		case 3:
-			AnimView::animview_main("@forest");
-			selected_item = -1;
-			break;
-
-		case 4:
-			// Exit
-			return;
-
-		default:
-			// Credits
-			TextView::textview_main("credits");
-			selected_item = -1;
-			break;
-		}
-	}
+	game_main(2, CMD_LINE);
 }
 
 } // namespace Foreste
diff --git a/engines/mads/madsv2/forest/main_menu.cpp b/engines/mads/madsv2/forest/main_menu.cpp
deleted file mode 100644
index 7dff7b0108e..00000000000
--- a/engines/mads/madsv2/forest/main_menu.cpp
+++ /dev/null
@@ -1,433 +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/engine.h"
-#include "mads/madsv2/core/general.h"
-#include "mads/madsv2/core/config.h"
-#include "mads/madsv2/core/font.h"
-#include "mads/madsv2/core/speech.h"
-#include "mads/madsv2/core/matte.h"
-#include "mads/madsv2/core/sprite.h"
-#include "mads/madsv2/core/error.h"
-#include "mads/madsv2/core/room.h"
-#include "mads/madsv2/core/fileio.h"
-#include "mads/madsv2/core/env.h"
-#include "mads/madsv2/core/buffer.h"
-#include "mads/madsv2/core/mem.h"
-#include "mads/madsv2/core/pal.h"
-#include "mads/madsv2/core/timer.h"
-#include "mads/madsv2/core/mcga.h"
-#include "mads/madsv2/core/cycle.h"
-#include "mads/madsv2/core/mouse.h"
-#include "mads/madsv2/core/screen.h"
-#include "mads/madsv2/core/video.h"
-#include "mads/madsv2/core/lib.h"
-#include "mads/madsv2/core/keys.h"
-#include "mads/madsv2/core/sound.h"
-#include "mads/madsv2/core/btype.h"
-#include "mads/madsv2/core/hspot.h"
-#include "mads/madsv2/core/magic.h"
-#include "mads/madsv2/core/ems.h"
-#include "mads/madsv2/core/xms.h"
-#include "mads/madsv2/core/imath.h"
-#include "mads/madsv2/core/kernel.h"
-#include "mads/madsv2/core/game.h"
-#include "mads/madsv2/core/pack.h"
-#include "mads/madsv2/core/quote.h"
-#include "mads/madsv2/forest/mads/sounds.h"
-#include "mads/madsv2/forest/main_menu.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Forest {
-
-#define CONFIG_FILE_NAME "CONFIG.PHA"
-
-#define EYE_QUOTES      16
-#define EYE_HOTSPOT     32
-#define EYE_MESSAGES    2
-
-#undef MESSAGE_COLOR
-#define MESSAGE_COLOR   1284
-
-
-ConfigFile config_file;
-
-int mads_mode = false;
-
-FontPtr font = NULL;
-int font_auto_spacing = -1;
-
-bool new_background   = false;
-int room_number       = 0;
-
-int win_status        = 0;
-
-bool force_opening    = false;
-bool dont_return      = false;
-bool white_bars       = true;
-byte white_border     = 2;
-
-char command_line[COMMAND_LINE_MAX][80];
-char *command_list[COMMAND_LINE_MAX+1];
-int  command_line_size = 0;
-
-int  use_mouse_cursor_fix = false;
-
-bool going;
-int  menu_mode;
-int  must_perform_matte;
-
-long frame_clock;
-long now_clock;
-long menu_clock;
-
-int menu_state;
-int menu_appear_state;
-
-int highest_y = -1;
-int next_x    = -1;
-
-char sound_file[80]    = "*#SOUND.PH9";
-char sound_letter      = 'N';
-
-int  sound_board_address = 0x220;              /* Default sound board address */
-int  sound_board_type    = sound_board_roland; /* Default sound board type    */
-
-int  swapping = false;                   /* Flag when swapping in new background */
-int  swap_line;                          /* Currently active swap line           */
-long swap_clock;                         /* Time for next swap */
-
-int  current_item;
-int  current_eye   = false;
-int  eye_latch     = false;
-int  selected_item = -1;
-
-#define LEFT_EYE   0
-#define RIGHT_EYE  1
-
-extern char *quotes;
-int  eye_message[2];
-int  eye_pokes   = 0;
-int  recent_eye  = 0;
-int  rebel_base  = 0;
-int  poke_count_message = -1;
-int  poke_count         = 0;
-int  poke_counting      = false;
-
-char poke_count_buf[2][20];
-
-char bonus_buf[80] = "";
-
-Palette special_pal;                     /* Palette for fadeout */
-
-
-MenuItem menu_item[NUM_MENU_ITEMS+1];    /* Menu item array */
-
-static void start_series() {
-	int error_flag = true;
-	int count;
-	int handle;
-	char temp_buf[80];
-
-	for (count = 0; count < NUM_MENU_ITEMS; count++) {
-		handle = -1;
-		Common::strcpy_s(temp_buf, "*MAIN0.SS");
-		temp_buf[5] = (char)('0' + count);
-
-		handle = matte_load_series(temp_buf, 0, 0);
-		if (handle < 0) goto done;
-
-		menu_item[count].handle = handle;
-		menu_item[count].active = count != 6;	// Quotes button was never implemented
-		menu_item[count].status = 0;
-	}
-
-	error_flag = false;
-
-done:
-	if (error_flag) {
-		Common::strcpy_s(error_string, temp_buf);
-		error_report(ERROR_SERIES_LOAD_FAILED, WARNING, MODULE_UNKNOWN, count, handle);
-	}
-}
-
-static void stop_series() {
-	int count;
-
-	for (count = NUM_MENU_ITEMS - 1; count >= 0; count--) {
-		matte_deallocate_series(menu_item[count].handle, true);
-	}
-}
-
-static void start_hotspots() {
-	int count;
-	int x1, x2, y1, y2;
-	int xs, ys;
-	SeriesPtr series;
-
-	numspots = 0;
-
-	for (count = 0; count < NUM_MENU_ITEMS; count++) {
-		series = series_list[menu_item[count].handle];
-		xs = series->index[0].xs;
-		ys = series->index[0].ys;
-		x1 = series->index[0].x - (xs >> 1);
-		y1 = series->index[0].y - (ys - 1);
-
-		x2 = x1 + xs - 1;
-		y2 = y1 + ys - 1;
-		hspot_add(x1, y1, x2, y2, 1, count, mcga_mode);
-	}
-}
-
-static void process_menu() {
-	int myspot;
-
-	myspot = hspot_which(mouse_x, mouse_y - viewing_at_y, mcga_mode);
-
-	current_eye = false;
-
-	if ((myspot > 0) && mouse_any_stroke && (menu_mode == MENU_ACCEPTING_COMMANDS)) {
-		current_item = spot[myspot].num;
-		if (current_item >= EYE_HOTSPOT) {
-			current_item = -1;
-			current_eye = true;
-		}
-	} else {
-		current_item = -1;
-	}
-
-	if (mouse_stop_stroke && (current_item >= 0) && (menu_mode == MENU_ACCEPTING_COMMANDS)) {
-		selected_item = current_item;
-		menu_mode = MENU_DISAPPEARING;
-		menu_state = 1;
-	}
-}
-
-static void process_sprites() {
-	int count;
-	int sprite;
-	int series;
-	int look, match;
-	Image image;
-
-	for (count = 0; count < (int)image_marker; count++) {
-		if ((image_list[count].segment_id < KERNEL_SEGMENT_ANIMATION) ||
-			(image_list[count].segment_id > KERNEL_SEGMENT_ANIMATION_HIGH)) {
-			if (image_list[count].flags >= IMAGE_STATIC) {
-				image_list[count].flags = IMAGE_ERASE;
-			}
-		}
-	}
-
-	if (menu_mode == MENU_APPEARING) goto done;
-
-	for (count = 0; count < NUM_MENU_ITEMS; count++) {
-		if (menu_item[count].active) {
-			image.flags = IMAGE_UPDATE;
-			image.segment_id = (byte)(count + 1);
-
-			series = count;
-			if (menu_mode == MENU_ACCEPTING_COMMANDS) {
-				if (count != current_item) {
-					sprite = 1;
-				} else {
-					sprite = 2;
-				}
-			} else {
-				sprite = 1;
-			}
-
-			image.series_id = (byte)menu_item[series].handle;
-			image.sprite_id = sprite;
-
-			image.x = series_list[series]->index[sprite - 1].x;
-			image.y = series_list[series]->index[sprite - 1].y;
-
-			image.depth = 0;
-			image.scale = 100;
-
-			match = !(sprite <= MENU_HIGH_SPRITE);
-
-			for (look = 0; !match && (look < (int)image_marker); look++) {
-				if (image_list[look].segment_id == image.segment_id) {
-					if (memcmp(&image_list[look].series_id,
-						&image.series_id, 9) == 0) {
-						image_list[look].flags = IMAGE_STATIC;
-						match = true;
-					}
-				}
-			}
-
-			if (!match) {
-				image_list[image_marker] = image;
-				image_marker++;
-			}
-		}
-	}
-
-done:
-	;
-}
-
-void menu_control() {
-	int fx;
-	int mykey;
-	int last_frame = -1;
-	int now_frame;
-	int reset_frame;
-	int anim;
-	int initial_reset = false;
-
-	menu_mode = MENU_APPEARING;
-	menu_state = MENU_HIGH_SPRITE;
-	menu_appear_state = 0;
-	menu_clock = 999999999;
-
-	going = true;
-	must_perform_matte = false;
-
-	frame_clock = 0;
-
-	start_series();
-	start_hotspots();
-
-	anim = kernel_run_animation("*RM902A.AA", 0);
-
-	mouse_init_cycle();
-
-	while (going && !g_engine->shouldQuit()) {
-		if (keys_any()) {
-			mykey = keys_get();
-			switch (toupper(mykey)) {
-			case esc_key:
-				selected_item = 4;
-				going = false;
-				break;
-
-			case alt_x_key:
-			case alt_q_key:
-			case ctrl_x_key:
-			case ctrl_q_key:
-				going = false;
-				break;
-
-			case 'S':
-				menu_mode = MENU_APPEARING;
-				menu_state = MENU_HIGH_SPRITE;
-				menu_appear_state = 0;
-				break;
-
-			default:
-				if (menu_mode == MENU_APPEARING) {
-					menu_mode = MENU_ACCEPTING_COMMANDS;
-					kernel_reset_animation(anim, 105);
-					kernel_anim[anim].next_clock = kernel.clock;
-				}
-				break;
-			}
-		}
-
-		mouse_begin_cycle(false);
-
-		if (mouse_stroke_going) {
-			if (menu_mode == MENU_APPEARING) {
-				menu_mode = MENU_ACCEPTING_COMMANDS;
-				kernel_reset_animation(anim, 105);
-				kernel_anim[anim].next_clock = kernel.clock;
-				mouse_init_cycle();
-			}
-		}
-
-		if (menu_mode != MENU_APPEARING) {
-			mouse_show();
-		}
-
-		now_clock = timer_read();
-		kernel.clock = now_clock;
-
-		if (now_clock >= menu_clock) {
-			if (menu_mode == MENU_DISAPPEARING)
-				going = false;
-
-			menu_clock = now_clock + MENU_FRAME_RATE;
-		}
-
-		process_menu();
-		kernel_message_update_all();
-		kernel_process_all_animations();
-
-		reset_frame = -1;
-		now_frame = kernel_anim[anim].frame;
-		if (now_frame != last_frame) {
-			last_frame = now_frame;
-
-			if (now_frame < 105) {
-				if (menu_mode != MENU_APPEARING) {
-					if (!initial_reset) {
-						reset_frame = 105;
-						initial_reset = true;
-					}
-				}
-			}
-
-			if (now_frame >= 109) {
-				if (menu_mode == MENU_APPEARING)
-					menu_mode = MENU_ACCEPTING_COMMANDS;
-
-				reset_frame = 105;
-			}
-
-			if (reset_frame >= 0) {
-				kernel_reset_animation(anim, reset_frame);
-				last_frame = reset_frame;
-			}
-		}
-
-		if (now_clock >= frame_clock) {
-			process_sprites();
-
-			fx = new_background ? 1 : 0;
-			matte_frame(fx, false);
-
-			if (fx) {
-				now_clock = timer_read();
-				menu_clock = now_clock + MENU_FRAME_RATE;
-			}
-
-			must_perform_matte = false;
-			new_background = false;
-
-			frame_clock = now_clock + FRAME_RATE;
-		}
-
-		mouse_end_cycle(false, going);
-	}
-
-	kernel_abort_animation(anim);
-
-	stop_series();
-}
-
-} // namespace Forest
-} // namespace MADSV2
-} // namespace MADS
diff --git a/engines/mads/madsv2/forest/main_menu.h b/engines/mads/madsv2/forest/main_menu.h
deleted file mode 100644
index ae655e0f4c3..00000000000
--- a/engines/mads/madsv2/forest/main_menu.h
+++ /dev/null
@@ -1,59 +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_FOREST_MAIN_MENU_H
-#define MADS_FOREST_MAIN_MENU_H
-
-#include "common/str.h"
-
-namespace MADS {
-namespace MADSV2 {
-namespace Forest {
-
-#define COMMAND_LINE_MAX        10
-
-#define FRAME_RATE              1
-#define MENU_FRAME_RATE         3
-
-#define NUM_MENU_ITEMS          6
-
-#define MENU_APPEARING          0
-#define MENU_ACCEPTING_COMMANDS 1
-#define MENU_DISAPPEARING       2
-
-#define MENU_HIGH_SPRITE        15
-
-typedef struct {
-	int handle;           /* Sprite series handle */
-	int active;           /* Menu item is active  */
-	int status;           /* Current status       */
-} MenuItem;
-
-extern bool new_background;
-extern int selected_item;
-
-extern void menu_control();
-
-} // namespace Forest
-} // namespace MADSV2
-} // namespace MADS
-
-#endif
diff --git a/engines/mads/module.mk b/engines/mads/module.mk
index 707e17543b1..b5e8aee7e80 100644
--- a/engines/mads/module.mk
+++ b/engines/mads/module.mk
@@ -268,7 +268,6 @@ MODULE_OBJS += \
 	madsv2/forest/global.o \
 	madsv2/forest/journal.o \
 	madsv2/forest/main.o \
-	madsv2/forest/main_menu.o \
 	madsv2/forest/menus.o \
 	madsv2/forest/mads/mads.o \
 	madsv2/forest/rooms/room101.o \




More information about the Scummvm-git-logs mailing list