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

dreammaster noreply at scummvm.org
Thu Jul 30 11:28:37 UTC 2026


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

Summary:
62162ddde2 MADS: NEBULAR: Fix showing advert when Exit selected from main menu
b2d4ce25ad MADS: NEBULAR: Fix dialog frame for original dialogs


Commit: 62162ddde233fe7b63ea477748d6988b468c54b9
    https://github.com/scummvm/scummvm/commit/62162ddde233fe7b63ea477748d6988b468c54b9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-30T21:28:29+10:00

Commit Message:
MADS: NEBULAR: Fix showing advert when Exit selected from main menu

Changed paths:
    engines/mads/nebular/main.cpp


diff --git a/engines/mads/nebular/main.cpp b/engines/mads/nebular/main.cpp
index f7e394c1d61..d5176f8e744 100644
--- a/engines/mads/nebular/main.cpp
+++ b/engines/mads/nebular/main.cpp
@@ -57,10 +57,89 @@ constexpr byte LINE_COLOR = 2;
 char *quotes;
 static Palette black_palette;
 
+static void show_exit_advert(Palette &palette) {
+	int screenId;
+	int soundId;
+	int soundSection;
+
+	buffer_free(&scr_depth);
+	buffer_free(&scr_orig);
+	buffer_free(&scr_work);
+
+	if (imath_random(1, 1000) > 500) {
+		screenId = 996;
+		soundSection = 7;
+		soundId = 9;
+	} else {
+		screenId = 995;
+		soundSection = 4;
+		soundId = 12;
+	}
+
+	pal_init(1, 8);
+
+	room = room_load(screenId, 0, nullptr, &scr_orig, &scr_depth, &scr_walk,
+		&scr_special, &picture_map, &depth_map, &picture_resource,
+		&depth_resource, -1, -1, 0);
+	assert(room);
+
+	mouse_hide();
+	video_update(&scr_orig, 0, 0, 0, 0, 320, 200);
+
+	g_engine->_soundManager->init(soundSection);
+	sound_queue(soundId);
+
+	magic_fade_from_grey(palette, master_palette, 0, 256, 0, 1, 1, 16);
+
+	mouse_init_cycle();
+	bool flag1 = true;
+	bool flag2 = false;
+	long time = timer_read();
+
+	while (!g_engine->shouldQuit() && flag1) {
+		mouse_begin_cycle(false);
+
+		if (keys_any()) {
+			keys_get();
+			flag1 = false;
+			flag2 = true;
+		}
+
+		long elapsed = timer_read() - time;
+		if (elapsed > 900)
+			flag1 = false;
+
+		if (mouse_stop_stroke) {
+			flag1 = false;
+			flag2 = true;
+		}
+
+		mouse_end_cycle(false, true);
+	}
+
+	sound_queue(1);
+
+	if (flag2) {
+		memset(&master_palette, 0, sizeof(master_palette));
+		mcga_setpal(&master_palette);
+	} else {
+		magic_fade_to_grey(master_palette, nullptr, 0, 256, 0, 1, 1, 16);
+	}
+
+	kernel_unload_sound_driver();
+
+	keys_remove();
+	timer_remove();
+	mouse_hide();
+
+	mouse_init(0, 3);
+	video_init(3, -1);
+	mcga_reset();
+}
+
 static void main_menu_main() {
 	auto &scr_screen = *g_engine->getScreen();
 	Palette palette;
-	int screenId, soundId;
 
 	mcga_compute_retrace_parameters();
 	memset(&black_palette, 0, sizeof(black_palette));
@@ -116,90 +195,17 @@ static void main_menu_main() {
 
 	kernel_unload_sound_driver();
 
-	if (selected_item == 5) {
-		buffer_free(&scr_depth);
-		buffer_free(&scr_orig);
-		buffer_free(&scr_work);
-
-		int sectionNum = 7;
-		if (imath_random(1, 1000) > 500) {
-			screenId = 996;
-			soundId = 9;
-		} else {
-			screenId = 995;
-			sectionNum = 4;
-			soundId = 12;
-		}
-
-		pal_init(1, 8);
-
-		room = room_load(screenId, 0, nullptr, &scr_orig, &scr_depth, &scr_walk,
-			&scr_special, &picture_map, &depth_map, &picture_resource,
-			&depth_resource, -1, -1, 0);
-
-		if (room) {
-			mouse_hide();
-			video_update(&scr_orig, 0, 0, 0, 0, 320, 200);
+	if (selected_item == 5)
+		show_exit_advert(palette);
 
-			g_engine->_soundManager->init(sectionNum);
-			sound_queue(soundId);
+	keys_remove();
+	timer_remove();
+	mouse_hide();
 
-			magic_fade_to_grey(master_palette, (byte *)&palette, 0, 256, 0, 1, 1, 16);
-
-			mouse_init_cycle();
-			bool flag1 = true;
-			bool flag2 = false;
-			long time = timer_read();
-
-			while (!g_engine->shouldQuit() && flag1) {
-				mouse_begin_cycle(false);
-
-				if (keys_any()) {
-					keys_get();
-					flag1 = false;
-					flag2 = true;
-				}
-
-				long elapsed = timer_read() - time;
-				if (elapsed > 900)
-					flag1 = false;
-
-				if (mouse_stop_stroke) {
-					flag1 = false;
-					flag2 = true;
-				}
-
-				mouse_end_cycle(false, true);
-			}
-
-			sound_queue(1);
-
-			if (flag2) {
-				memset(&master_palette, 0, sizeof(master_palette));
-				mcga_setpal(&master_palette);
-			} else {
-				magic_fade_to_grey(master_palette, nullptr, 0, 256, 0, 1, 1, 16);
-			}
-
-			kernel_unload_sound_driver();
-
-			keys_remove();
-			timer_remove();
-			mouse_hide();
-
-			mouse_init(0, 3);
-			video_init(3, -1);
-			mcga_reset();
-		}
-	} else {
-		keys_remove();
-		timer_remove();
-		mouse_hide();
-
-		mouse_init(0, 3);
-		video_init(3, -1);
-		mcga_reset();
-	}
+	mouse_init(0, 3);
+	video_init(3, -1);
+	mcga_reset();
+	mcga_setpal(&black_palette);
 
 	buffer_free(&scr_depth);
 	buffer_free(&scr_orig);


Commit: b2d4ce25ad618620e7c3082870197611cec28500
    https://github.com/scummvm/scummvm/commit/b2d4ce25ad618620e7c3082870197611cec28500
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-30T21:28:29+10:00

Commit Message:
MADS: NEBULAR: Fix dialog frame for original dialogs

Changed paths:
    engines/mads/nebular/menus.cpp


diff --git a/engines/mads/nebular/menus.cpp b/engines/mads/nebular/menus.cpp
index ba8f475a22d..88b27acfafd 100644
--- a/engines/mads/nebular/menus.cpp
+++ b/engines/mads/nebular/menus.cpp
@@ -830,7 +830,7 @@ static bool game_menu_keyboard(int going) {
 	return going;
 }
 
-static int game_menu_sprite(int sprite, int depth) {
+static void game_menu_sprite(int sprite, int depth) {
 	int id;
 
 	id = matte_allocate_image();
@@ -842,20 +842,17 @@ static int game_menu_sprite(int sprite, int depth) {
 	image_list[id].y = series_list[game_menu_series_id]->index[sprite - 1].y;
 	image_list[id].depth = (byte)depth;
 	image_list[id].scale = 100;
-
-	return id;
 }
 
 static void game_menu_main() {
 	int going = true;
 	int first_time = true;
-	//int frame_id;
 	long menu_clock = 0;
 	long now_clock;
 
 	game_menu_first_init();
 
-	//frame_id = game_menu_sprite(1, 2);
+	game_menu_sprite(1, 2);
 
 	while (kernel.activate_menu == GAME_MAIN_MENU) {
 
@@ -940,7 +937,6 @@ static void game_menu_main() {
 static void game_menu_options() {
 	int going = true;
 	int first_time = true;
-	//int frame_id;
 	long menu_clock = 0;
 	long now_clock;
 	ConfigFile save_config;
@@ -949,7 +945,7 @@ static void game_menu_options() {
 
 	game_menu_first_init();
 
-	//frame_id = game_menu_sprite(2, 2);
+	game_menu_sprite(2, 2);
 
 	while (kernel.activate_menu == GAME_OPTIONS_MENU) {
 		going = true;
@@ -1212,7 +1208,6 @@ static int game_menu_save_keyboard(int going) {
 static void game_menu_save() {
 	int going = true;
 	int first_time = true;
-	//int frame_id;
 	int id;
 	int special_sprite;
 	int let_scroll_continue;
@@ -1233,7 +1228,7 @@ static void game_menu_save() {
 
 	game_menu_first_init();
 
-	//frame_id = game_menu_sprite(3, 2);
+	game_menu_sprite(3, 2);
 
 	game_menu_save_dirty = false;
 
@@ -1303,10 +1298,10 @@ static void game_menu_save() {
 					game_menu_generate_messages();
 
 					special_sprite = (game_menu_current_item == 50) ? 2 : 0;
-					id = game_menu_sprite(4 + special_sprite, 1);
+					game_menu_sprite(4 + special_sprite, 1);
 
 					special_sprite = (game_menu_current_item == 51) ? 2 : 0;
-					id = game_menu_sprite(5 + special_sprite, 1);
+					game_menu_sprite(5 + special_sprite, 1);
 
 					/* Matte out the next graphics frame */
 
@@ -1410,7 +1405,6 @@ static int game_menu_restore_keyboard(int going) {
 static void game_menu_restore() {
 	int going = true;
 	int first_time = true;
-	//int frame_id;
 	int id;
 	int special_sprite;
 	int let_scroll_continue;
@@ -1429,7 +1423,7 @@ static void game_menu_restore() {
 
 	game_menu_first_init();
 
-	//frame_id = game_menu_sprite(3, 2);
+	game_menu_sprite(3, 2);
 
 	while (kernel.activate_menu == GAME_RESTORE_MENU) {
 
@@ -1457,7 +1451,7 @@ static void game_menu_restore() {
 
 		while (going && (game_menu_selected_item < 1)) {
 
-			going = game_menu_restore_keyboard(going);
+			going = game_menu_restore_keyboard(going) && !g_engine->shouldQuit();
 
 			now_clock = timer_read();
 
@@ -1497,10 +1491,10 @@ static void game_menu_restore() {
 					game_menu_generate_messages();
 
 					special_sprite = (game_menu_current_item == 50) ? 2 : 0;
-					id = game_menu_sprite(4 + special_sprite, 1);
+					game_menu_sprite(4 + special_sprite, 1);
 
 					special_sprite = (game_menu_current_item == 51) ? 2 : 0;
-					id = game_menu_sprite(5 + special_sprite, 1);
+					game_menu_sprite(5 + special_sprite, 1);
 
 					/* Matte out the next graphics frame */
 
@@ -1574,13 +1568,12 @@ static void game_menu_restore() {
 static void game_menu_difficulty() {
 	int going = true;
 	int first_time = true;
-	//int frame_id;
 	long menu_clock = 0;
 	long now_clock;
 
 	game_menu_first_init();
 
-	//frame_id = game_menu_sprite(8, 2);
+	game_menu_sprite(8, 2);
 
 	while (kernel.activate_menu == GAME_DIFFICULTY_MENU) {
 
@@ -1663,13 +1656,12 @@ static void game_menu_difficulty() {
 static void game_menu_alert() {
 	int going = true;
 	int first_time = true;
-	//int frame_id;
 	long menu_clock = 0;
 	long now_clock;
 
 	game_menu_first_init();
 
-	//frame_id = game_menu_sprite(9, 2);
+	game_menu_sprite(9, 2);
 
 	while (kernel.activate_menu == GAME_ALERT_MENU) {
 




More information about the Scummvm-git-logs mailing list