[Scummvm-git-logs] scummvm master -> e1fea212830e31902380f66f24c079643c3f01b3

dreammaster noreply at scummvm.org
Sat Jul 25 22:55:11 UTC 2026


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

Summary:
e1fea21283 MADS: NEBULAR: Hooking up endgame cutscenes & credits


Commit: e1fea212830e31902380f66f24c079643c3f01b3
    https://github.com/scummvm/scummvm/commit/e1fea212830e31902380f66f24c079643c3f01b3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-26T08:55:02+10:00

Commit Message:
MADS: NEBULAR: Hooking up endgame cutscenes & credits

Changed paths:
    engines/mads/core/game.cpp
    engines/mads/nebular/copy.cpp
    engines/mads/nebular/main.cpp
    engines/mads/nebular/rooms/room803.cpp
    engines/mads/nebular/rooms/room804.cpp


diff --git a/engines/mads/core/game.cpp b/engines/mads/core/game.cpp
index d4e00d91358..18b5a280436 100644
--- a/engines/mads/core/game.cpp
+++ b/engines/mads/core/game.cpp
@@ -1160,16 +1160,8 @@ void game_control() {
 
 	} else if (!game_restore_flag) {
 		result = main_copy_verify();
-		if (result == COPY_FAIL) {
-			game.going = false;
-			force_chain = true;
-			game_restore_flag = false;
+		if (!game.going)
 			return;
-			
-		} else if (result == COPY_ESCAPE) {
-			game.going = false;
-			force_chain = true;
-		}
 	}
 
 	kernel.clock = timer_read();
diff --git a/engines/mads/nebular/copy.cpp b/engines/mads/nebular/copy.cpp
index ef98fa42523..8a093d9f086 100644
--- a/engines/mads/nebular/copy.cpp
+++ b/engines/mads/nebular/copy.cpp
@@ -26,6 +26,7 @@
 #include "mads/core/global.h"
 #include "mads/core/imath.h"
 #include "mads/nebular/copy.h"
+#include "mads/nebular/global.h"
 #include "mads/nebular/popup.h"
 
 namespace MADS {
@@ -212,7 +213,20 @@ int global_copy_verify() {
 	// remained the same, and if so, bypass the copy protection check. And even if there wasn't
 	// an existing match, it would only sometimes prompt the user
 
-	return copy_pop_and_ask();
+	int result = copy_pop_and_ask();
+
+	if (result == COPY_FAIL) {
+		new_room = 804;
+		new_section = 8;
+		global_init_code();
+		global[kCopyProtectFailed] = true;
+		game_restore_flag = false;
+
+	} else if (result == COPY_ESCAPE) {
+		game.going = false;
+	}
+
+	return result;
 }
 
 } // namespace RexNebular
diff --git a/engines/mads/nebular/main.cpp b/engines/mads/nebular/main.cpp
index 31c3257e28c..ab82714a03b 100644
--- a/engines/mads/nebular/main.cpp
+++ b/engines/mads/nebular/main.cpp
@@ -219,7 +219,7 @@ static void main_cold_data_init() {
 	Common::strcpy_s(save_game_key, "rex");
 	Common::strcpy_s(restart_game_key, "rex");
 
-	Common::strcpy_s(player.series_name, "RAL");
+	*player.series_name = '\0';
 	player.walker_must_reload = true;
 	player.walker_loads_first = false;
 	player.walker_visible = true;
@@ -336,7 +336,13 @@ void nebular_main() {
 		case 0:
 			// Start Game
 			game_main(2, CMD_LINE);
-			return;
+
+			if (win_status != WIN_NOTHING) {
+				selected_item = win_status + 16;
+			} else {
+				return;
+			}
+			break;
 
 		case 1: {
 			// Resume savegame
@@ -368,21 +374,24 @@ void nebular_main() {
 			selected_item = -1;
 			break;
 
-		case 17:
-			// Endgame cutscene
+		case WIN_QUICK_DEATH + 16:
 			AnimView::animview_main("@rexend1");
-			AnimView::animview_main("@rexend2");
-			AnimView::animview_main("@rexend3");
-			TextView::textview_main("ending4");
-			selected_item = -1;
-			break;
-
-		case 33:
 			TextView::textview_main("ending1");
+			return;
+
+		case WIN_SLOW_DEATH + 16:
+			AnimView::animview_main("@rexend2");
 			TextView::textview_main("ending2");
+			return;
+
+		case WIN_ALL_THE_MONEY + 16:
+			AnimView::animview_main("@rexend3");
 			TextView::textview_main("credits");
-			selected_item = -1;
-			break;
+			return;
+
+		case WIN_A_HEAD_POW + 16:
+			TextView::textview_main("ending4");
+			return;
 
 		case 5:
 		default:
diff --git a/engines/mads/nebular/rooms/room803.cpp b/engines/mads/nebular/rooms/room803.cpp
index 806b81df6bf..6bf9c4c3f86 100644
--- a/engines/mads/nebular/rooms/room803.cpp
+++ b/engines/mads/nebular/rooms/room803.cpp
@@ -213,11 +213,11 @@ static void room_803_daemon() {
 			global[kInSpace] = true;
 		} else {
 			if (!global[kShieldModInstalled])
-				win_status = 1;
+				win_status = WIN_QUICK_DEATH;
 			else if (!global[kTargetModInstalled])
-				win_status = 2;
+				win_status = WIN_SLOW_DEATH;
 			else
-				win_status = 3;
+				win_status = WIN_ALL_THE_MONEY;
 
 			game.going = false;
 			return;
diff --git a/engines/mads/nebular/rooms/room804.cpp b/engines/mads/nebular/rooms/room804.cpp
index ff9692c67e6..da0881a0c0c 100644
--- a/engines/mads/nebular/rooms/room804.cpp
+++ b/engines/mads/nebular/rooms/room804.cpp
@@ -75,15 +75,18 @@ static void room_804_init() {
 
 	if (global[kInSpace]) {
 		if (global[kWindowFixed]) {
+			// You're okay
 			g_sequence_ids[5] = kernel_seq_stamp(g_sprite_ids[5], 0, 1);
 			kernel_timing_trigger(60, 100);
 		} else {
+			// You're screwed
 			g_sequence_ids[6] = kernel_seq_stamp(g_sprite_ids[6], false, 1);
 			g_sequence_ids[7] = kernel_seq_pingpong(g_sprite_ids[7], false, 4, 0, 0, 0);
 			kernel_timing_trigger(160, 70);
 			player.commands_allowed = false;
 		}
 	} else {
+		// Still on the ground
 		if (global[kBeamIsUp]) {
 			g_sequence_ids[8] = kernel_seq_stamp(g_sprite_ids[8], false, 1);
 			kernel_seq_depth(g_sequence_ids[8], 7);
@@ -137,9 +140,8 @@ static void room_804_daemon() {
 				global[kInSpace] = false;
 				global[kBeamIsUp] = true;
 
-				//assert(!global[kCopyProtectFailed]);
-				win_status = 4;
-				return;
+				win_status = WIN_A_HEAD_POW;
+				game.going = false;
 			}
 			break;
 
@@ -149,10 +151,10 @@ static void room_804_daemon() {
 				global[kInSpace] = false;
 				global[kBeamIsUp] = true;
 
-				assert(!global[kCopyProtectFailed]);
-				win_status = 4;
-				return;
+				win_status = WIN_A_HEAD_POW;
+				game.going = false;
 			}
+			break;
 		}
 
 		if (kernel_anim[0].frame == 34) {




More information about the Scummvm-git-logs mailing list