--- np2/x11/gtk2/gtk_menu.c	2004/07/15 14:24:33	1.2
+++ np2/x11/gtk2/gtk_menu.c	2007/01/24 14:09:32	1.9
@@ -1,4 +1,4 @@
-/*	$Id: gtk_menu.c,v 1.2 2004/07/15 14:24:33 monaka Exp $	*/
+/*	$Id: gtk_menu.c,v 1.9 2007/01/24 14:09:32 monaka Exp $	*/
 
 /*
  * Copyright (c) 2004 NONAKA Kimihiro (aw9k-nnk@asahi-net.or.jp)
@@ -12,8 +12,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -46,6 +44,7 @@
 #include "pc9861k.h"
 #include "s98.h"
 #include "scrnbmp.h"
+#include "sxsi.h"
 
 #include "kdispwin.h"
 #include "toolwin.h"
@@ -67,11 +66,19 @@ static void cb_bmpsave(GtkAction *action
 static void cb_change_font(GtkAction *action, gpointer user_data);
 static void cb_diskeject(GtkAction *action, gpointer user_data);
 static void cb_diskopen(GtkAction *action, gpointer user_data);
+#if defined(SUPPORT_IDEIO)
+static void cb_ataopen(GtkAction *action, gpointer user_data);
+static void cb_ataremove(GtkAction *action, gpointer user_data);
+static void cb_atapiopen(GtkAction *action, gpointer user_data);
+static void cb_atapiremove(GtkAction *action, gpointer user_data);
+#endif
 static void cb_midipanic(GtkAction *action, gpointer user_data);
 static void cb_newdisk(GtkAction *action, gpointer user_data);
 static void cb_reset(GtkAction *action, gpointer user_data);
+#if !defined(SUPPORT_IDEIO)
 static void cb_sasiopen(GtkAction *action, gpointer user_data);
 static void cb_sasiremove(GtkAction *action, gpointer user_data);
+#endif
 
 static void cb_dialog(GtkAction *action, gpointer user_data);
 static void cb_radio(GtkRadioAction *action, GtkRadioAction *current, gpointer user_data);
@@ -90,10 +97,18 @@ static GtkActionEntry menu_entries[] = {
 { "Drive2Menu",   NULL, "Drive_2",   NULL, NULL, NULL },
 { "Drive3Menu",   NULL, "Drive_3",   NULL, NULL, NULL },
 { "Drive4Menu",   NULL, "Drive_4",   NULL, NULL, NULL },
+#if defined(SUPPORT_IDEIO)
+{ "ATA00Menu",    NULL, "IDE0-_0",   NULL, NULL, NULL },
+{ "ATA01Menu",    NULL, "IDE0-_1",   NULL, NULL, NULL },
+{ "ATAPIMenu",    NULL, "_CD-ROM",   NULL, NULL, NULL },
+#endif
 { "KeyboardMenu", NULL, "_Keyboard", NULL, NULL, NULL },
 { "MemoryMenu",   NULL, "M_emory",   NULL, NULL, NULL },
+#if !defined(SUPPORT_IDEIO)
 { "SASI1Menu",    NULL, "SASI-_1",   NULL, NULL, NULL },
 { "SASI2Menu",    NULL, "SASI-_2",   NULL, NULL, NULL },
+#endif
+{ "ScrnSizeMenu", NULL, "Size",      NULL, NULL, NULL },
 { "SoundMenu",    NULL, "_Sound",    NULL, NULL, NULL },
 
 /* MenuItem */
@@ -111,13 +126,23 @@ static GtkActionEntry menu_entries[] = {
 { "disk4open",   NULL, "_Open...",          NULL, NULL, G_CALLBACK(cb_diskopen), },
 { "exit",        NULL, "E_xit",             NULL, NULL, G_CALLBACK(gtk_main_quit) },
 { "font",        NULL, "_Font...",          NULL, NULL, G_CALLBACK(cb_change_font), },
+#if defined(SUPPORT_IDEIO)
+{ "ata00open",   NULL, "_Open...",          NULL, NULL, G_CALLBACK(cb_ataopen), },
+{ "ata00remove", NULL, "_Remove",           NULL, NULL, G_CALLBACK(cb_ataremove), },
+{ "ata01open",   NULL, "_Open...",          NULL, NULL, G_CALLBACK(cb_ataopen), },
+{ "ata01remove", NULL, "_Remove",           NULL, NULL, G_CALLBACK(cb_ataremove), },
+{ "atapiopen",   NULL, "_Open...",          NULL, NULL, G_CALLBACK(cb_atapiopen), },
+{ "atapiremove", NULL, "_Remove",           NULL, NULL, G_CALLBACK(cb_atapiremove), },
+#endif
 { "midiopt",     NULL, "MIDI _option...",   NULL, NULL, G_CALLBACK(cb_dialog) },
 { "midipanic",   NULL, "MIDI _panic",       NULL, NULL, G_CALLBACK(cb_midipanic) },
 { "newdisk",     NULL, "_New disk...",      NULL, NULL, G_CALLBACK(cb_newdisk), },
+#if !defined(SUPPORT_IDEIO)
 { "sasi1open",   NULL, "_Open...",          NULL, NULL, G_CALLBACK(cb_sasiopen), },
 { "sasi1remove", NULL, "_Remove",           NULL, NULL, G_CALLBACK(cb_sasiremove), },
 { "sasi2open",   NULL, "_Open...",          NULL, NULL, G_CALLBACK(cb_sasiopen), },
 { "sasi2remove", NULL, "_Remove",           NULL, NULL, G_CALLBACK(cb_sasiremove), },
+#endif
 { "screenopt",   NULL, "Screen _option...", NULL, NULL, G_CALLBACK(cb_dialog) },
 { "serialopt",   NULL, "Se_rial option...", NULL, NULL, G_CALLBACK(cb_dialog) },
 { "soundopt",    NULL, "So_und option...",  NULL, NULL, G_CALLBACK(cb_dialog) },
@@ -239,6 +264,16 @@ static GtkRadioActionEntry rotate_entrie
 };
 static const guint n_rotate_entries = G_N_ELEMENTS(rotate_entries);
 
+static GtkRadioActionEntry screensize_entries[] = {
+{ "320x200",  NULL, "320x200",  NULL, NULL, 4 },
+{ "480x300",  NULL, "480x300",  NULL, NULL, 6 },
+{ "640x400",  NULL, "640x400",  NULL, NULL, 8 },
+{ "800x500",  NULL, "800x500",  NULL, NULL, 10 },
+{ "960x600",  NULL, "960x600",  NULL, NULL, 12 },
+{ "1280x800", NULL, "1280x800", NULL, NULL, 16 },
+};
+static const guint n_screensize_entries = G_N_ELEMENTS(screensize_entries);
+
 static void cb_beepvol(gint idx);
 static void cb_f12key(gint idx);
 static void cb_framerate(gint idx);
@@ -246,6 +281,7 @@ static void cb_joykey(gint idx);
 static void cb_memory(gint idx);
 static void cb_rotate(gint idx);
 static void cb_screenmode(gint idx);
+static void cb_screensize(gint idx);
 static void cb_soundboard(gint idx);
 
 static const struct {
@@ -260,6 +296,7 @@ static const struct {
 	{ memory_entries, G_N_ELEMENTS(memory_entries), cb_memory },
 	{ rotate_entries, G_N_ELEMENTS(rotate_entries), cb_rotate },
 	{ screenmode_entries, G_N_ELEMENTS(screenmode_entries), cb_screenmode },
+	{ screensize_entries, G_N_ELEMENTS(screensize_entries), cb_screensize },
 	{ soundboard_entries, G_N_ELEMENTS(soundboard_entries), cb_soundboard },
 };
 static const guint n_radiomenu_entries = G_N_ELEMENTS(radiomenu_entries);
@@ -274,13 +311,26 @@ static const gchar *ui_info =
 "   \n"
 "   \n"
 "   \n"
-"   \n"
 "   \n"
 "   \n"
 "  \n"
 "  
\n"
 "  \n"
 "  \n"
 "   \n"
@@ -301,12 +352,21 @@ static const gchar *ui_info =
 "   \n"
 "   \n"
 "   \n"
-"   \n"
+"   \n"
 "   \n"
 "   \n"
 "   \n"
 "   \n"
 "   \n"
+"   \n"
+"    \n"
+"    \n"
+"    \n"
+"    \n"
+"    \n"
+"    \n"
+"   \n"
+"   \n"
 "   \n"
 "  \n"
 "  \n"
@@ -447,6 +507,8 @@ xmenu_select_item_by_index(MENU_HDL hdl,
 	xmenu_select_item_by_index(NULL, rotate_entries, n_rotate_entries, v);
 #define	xmenu_select_screenmode(v) \
 	xmenu_select_item_by_index(NULL, screenmode_entries, n_screenmode_entries, v);
+#define	xmenu_select_screensize(v) \
+	xmenu_select_item_by_index(NULL, screensize_entries, n_screensize_entries, v);
 #define	xmenu_select_soundboard(v) \
 	xmenu_select_item_by_index(NULL, soundboard_entries, n_soundboard_entries, v);
 
@@ -720,6 +782,193 @@ end:
 	install_idle_process();
 }
 
+#if defined(SUPPORT_IDEIO)
+static void
+cb_ataopen(GtkAction *action, gpointer user_data)
+{
+	GtkWidget *dialog = NULL;
+	GtkFileFilter *filter;
+	gchar *utf8, *path;
+	struct stat sb;
+	const gchar *name = gtk_action_get_name(action);
+	guint channel, drive;
+
+	UNUSED(user_data);
+
+	/* "ata??open" */
+	if ((strlen(name) < 5)
+	 || (!g_ascii_isdigit(name[3]))
+	 || (!g_ascii_isdigit(name[4]))) {
+		return;
+	}
+
+	channel = g_ascii_digit_value(name[3]);
+	drive = g_ascii_digit_value(name[4]);
+	if (channel != 0 || drive >= 2)
+		return;
+
+	uninstall_idle_process();
+
+	dialog = gtk_file_chooser_dialog_new("Open a IDE disk image",
+	    GTK_WINDOW(main_window), GTK_FILE_CHOOSER_ACTION_OPEN, 
+	    GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+	    GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+	    NULL);
+	if (dialog == NULL)
+		goto end;
+
+	g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);
+	gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+	utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL);
+	if (utf8) {
+		gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
+		g_free(utf8);
+	}
+
+	filter = gtk_file_filter_new();
+	if (filter) {
+		gtk_file_filter_set_name(filter, "All files");
+		gtk_file_filter_add_pattern(filter, "*");
+		gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
+	}
+	filter = gtk_file_filter_new();
+	if (filter) {
+		gtk_file_filter_set_name(filter, "IDE disk image files");
+		gtk_file_filter_add_pattern(filter, "*.[nN][hH][dD]");
+		gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
+	}
+	gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);
+
+	if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK)
+		goto end;
+
+	utf8 = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+	if (utf8) {
+		path = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL);
+		if (path) {
+			if ((stat(path, &sb) == 0) && S_ISREG(sb.st_mode) && (sb.st_mode & S_IRUSR)) {
+				file_cpyname(hddfolder, path, sizeof(hddfolder));
+				diskdrv_sethdd(2 * channel + drive, path);
+				sysmng_update(SYS_UPDATEOSCFG);
+			}
+			g_free(path);
+		}
+		g_free(utf8);
+	}
+
+end:
+	if (dialog)
+		gtk_widget_destroy(dialog);
+	install_idle_process();
+}
+
+static void
+cb_ataremove(GtkAction *action, gpointer user_data)
+{
+	const gchar *name = gtk_action_get_name(GTK_ACTION(action));
+	guint channel, drive;
+
+	UNUSED(user_data);
+
+	/* "ata??open" */
+	if ((strlen(name) < 5)
+	 || (!g_ascii_isdigit(name[3]))
+	 || (!g_ascii_isdigit(name[4]))) {
+		return;
+	}
+
+	channel = g_ascii_digit_value(name[3]);
+	drive = g_ascii_digit_value(name[4]);
+	if (channel == 0 && drive < 2) {
+		if (2 * channel + drive < 4) {
+			diskdrv_sethdd(2 * channel + drive, "");
+		}
+	}
+}
+
+static void
+cb_atapiopen(GtkAction *action, gpointer user_data)
+{
+	GtkWidget *dialog = NULL;
+	GtkFileFilter *filter;
+	gchar *utf8, *path;
+	struct stat sb;
+
+	UNUSED(action);
+	UNUSED(user_data);
+
+	uninstall_idle_process();
+
+	dialog = gtk_file_chooser_dialog_new("Open a ATAPI CD-ROM image",
+	    GTK_WINDOW(main_window), GTK_FILE_CHOOSER_ACTION_OPEN, 
+	    GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+	    GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+	    NULL);
+	if (dialog == NULL)
+		goto end;
+
+	g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);
+	gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+	utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL);
+	if (utf8) {
+		gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
+		g_free(utf8);
+	}
+
+	filter = gtk_file_filter_new();
+	if (filter) {
+		gtk_file_filter_set_name(filter, "All files");
+		gtk_file_filter_add_pattern(filter, "*");
+		gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
+	}
+	filter = gtk_file_filter_new();
+	if (filter) {
+		gtk_file_filter_set_name(filter, "ISO CD-ROM image files");
+		gtk_file_filter_add_pattern(filter, "*.[iI][sS][oO]");
+		gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
+	}
+	gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);
+	filter = gtk_file_filter_new();
+	if (filter) {
+		gtk_file_filter_set_name(filter, "CUE CD-ROM image files");
+		gtk_file_filter_add_pattern(filter, "*.[cC][uU][eE]");
+		gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
+	}
+
+	if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK)
+		goto end;
+
+	utf8 = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+	if (utf8) {
+		path = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL);
+		if (path) {
+			if ((stat(path, &sb) == 0) && S_ISREG(sb.st_mode) && (sb.st_mode & S_IRUSR)) {
+				file_cpyname(hddfolder, path, sizeof(hddfolder));
+				sxsi_devopen(0x02, path);
+				sysmng_update(SYS_UPDATEOSCFG);
+			}
+			g_free(path);
+		}
+		g_free(utf8);
+	}
+
+end:
+	if (dialog)
+		gtk_widget_destroy(dialog);
+	install_idle_process();
+}
+
+static void
+cb_atapiremove(GtkAction *action, gpointer user_data)
+{
+
+	UNUSED(action);
+	UNUSED(user_data);
+
+	sxsi_devclose(0x02);
+}
+#endif	/* SUPPORT_IDEIO */
+
 static void
 cb_midipanic(GtkAction *action, gpointer user_data)
 {
@@ -814,54 +1063,59 @@ cb_newdisk(GtkAction *action, gpointer u
 		goto end;
 
 	utf8 = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
-	if (utf8) {
-		path = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL);
-		if (path) {
-			kind = -1;
-			ext = file_getext(path);
-			for (i = 0; i < NELEMENTS(exttbl); i++) {
-				if (g_ascii_strcasecmp(ext, exttbl[i].name) == 0) {
-					kind = exttbl[i].kind;
-					break;
-				}
-			}
-			if (i == NELEMENTS(exttbl)) {
-				f = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(dialog));
-				for (i = 0; i < NELEMENTS(filter); i++) {
-					if (f == filter[i]) {
-						kind = i;
-						tmp = g_strjoin(".", path, extname[i]);
-						if (tmp) {
-							g_free(path);
-							path = tmp;
-						}
-						break;
-					}
-				}
-			}
-
-			uninstall_idle_process();
-			switch (kind) {
-			case 0: /* D88 */
-				create_newdisk_fd_dialog(path);
-				break;
+	if (utf8 == NULL)
+		goto end;
 
-			case 1: /* HDI */
-			case 2: /* THD */
-			case 3: /* NHD */
-				create_newdisk_hd_dialog(path, kind);
-				break;
+	path = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL);
+	g_free(utf8);
+	if (path == NULL)
+		goto end;
 
-			default:
+	kind = -1;
+	ext = file_getext(path);
+	for (i = 0; i < NELEMENTS(exttbl); i++) {
+		if (g_ascii_strcasecmp(ext, exttbl[i].name) == 0) {
+			kind = exttbl[i].kind;
+			break;
+		}
+	}
+	if (i == NELEMENTS(exttbl)) {
+		f = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(dialog));
+		for (i = 0; i < NELEMENTS(filter); i++) {
+			if (f == filter[i]) {
+				kind = i;
+				tmp = g_strjoin(".", path, extname[i], NULL);
+				if (tmp) {
+					g_free(path);
+					path = tmp;
+				}
 				break;
 			}
-			install_idle_process();
-
-			g_free(path);
 		}
-		g_free(utf8);
 	}
 
+	/* XXX system has only one modal dialog? */
+	gtk_widget_destroy(dialog);
+
+	switch (kind) {
+	case 0: /* D88 */
+		create_newdisk_fd_dialog(path);
+		break;
+
+	case 1: /* HDI */
+	case 2: /* THD */
+	case 3: /* NHD */
+		create_newdisk_hd_dialog(path, kind);
+		break;
+
+	default:
+		break;
+	}
+	g_free(path);
+
+	install_idle_process();
+	return;
+
 end:
 	if (dialog)
 		gtk_widget_destroy(dialog);
@@ -879,6 +1133,7 @@ cb_reset(GtkAction *action, gpointer use
 	pccore_reset();
 }
 
+#if !defined(SUPPORT_IDEIO)
 static void
 cb_sasiopen(GtkAction *action, gpointer user_data)
 {
@@ -968,6 +1223,7 @@ cb_sasiremove(GtkAction *action, gpointe
 		}
 	}
 }
+#endif	/* !SUPPORT_IDEIO */
 
 static void
 cb_dialog(GtkAction *action, gpointer user_data)
@@ -1413,6 +1669,19 @@ cb_screenmode(gint idx)
 }
 
 static void
+cb_screensize(gint idx)
+{
+	guint value;
+
+	if (idx >= 0) {
+		value = screensize_entries[idx].value;
+	} else {
+		value = 0;
+	}
+	scrnmng_setmultiple(value);
+}
+
+static void
 cb_soundboard(gint idx)
 {
 	guint value;
@@ -1455,6 +1724,73 @@ cb_radio(GtkRadioAction *action, GtkRadi
 /*
  * create menubar
  */
+static GtkWidget *menubar;
+static guint menubar_timerid;
+
+#define	EVENT_MASK	(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK)
+
+static gboolean
+menubar_timeout(gpointer p)
+{
+
+	UNUSED(p);
+
+	if (menubar_timerid) {
+		g_source_remove(menubar_timerid);
+		menubar_timerid = 0;
+	}
+
+	if (scrnmode & SCRNMODE_FULLSCREEN) {
+		xmenu_hide();
+	}
+
+	return TRUE;
+}
+
+/*
+ - Signal: gboolean GtkWidget::enter_notify_event (GtkWidget *widget,
+          GdkEventCrossing *event, gpointer user_data)
+*/
+static gboolean
+enter_notify_evhandler(GtkWidget *w, GdkEventCrossing *ev, gpointer p)
+{
+
+	UNUSED(w);
+	UNUSED(ev);
+	UNUSED(p);
+
+	if (menubar_timerid) {
+		g_source_remove(menubar_timerid);
+		menubar_timerid = 0;
+	}
+
+	return TRUE;
+}
+
+/*
+ - Signal: gboolean GtkWidget::leave_notify_event (GtkWidget *widget,
+          GdkEventCrossing *event, gpointer user_data)
+*/
+static gboolean
+leave_notify_evhandler(GtkWidget *w, GdkEventCrossing *ev, gpointer p)
+{
+
+	UNUSED(w);
+	UNUSED(ev);
+	UNUSED(p);
+
+	if (menubar_timerid) {
+		g_source_remove(menubar_timerid);
+		menubar_timerid = 0;
+	}
+
+	if (scrnmode & SCRNMODE_FULLSCREEN) {
+		menubar_timerid = g_timeout_add(1000, menubar_timeout, NULL);
+	}
+
+	return TRUE;
+}
+
 static void
 equip_fddrive(GtkUIManager *ui_manager, guint no)
 {
@@ -1488,7 +1824,6 @@ equip_fddrive(GtkUIManager *ui_manager, 
 GtkWidget *
 create_menu(void)
 {
-	GtkWidget *menubar;
 	GError *err = NULL;
 	gint rv;
 	guint i;
@@ -1545,6 +1880,7 @@ create_menu(void)
 	xmenu_select_memory(np2cfg.EXTMEM);
 	xmenu_select_rotate(scrnmode & SCRNMODE_ROTATEMASK);
 	xmenu_select_screenmode(scrnmode & SCRNMODE_FULLSCREEN);
+	xmenu_select_screensize(SCREEN_DEFMUL);
 	xmenu_select_soundboard(np2cfg.SOUND_SW);
 
 	if (np2cfg.fddequip) {
@@ -1556,5 +1892,44 @@ create_menu(void)
 	}
 
 	menubar = gtk_ui_manager_get_widget(menu_hdl.ui_manager, "/MainMenu");
+
+	gtk_widget_add_events(menubar, EVENT_MASK);
+	g_signal_connect(GTK_OBJECT(menubar), "enter_notify_event",
+	            GTK_SIGNAL_FUNC(enter_notify_evhandler), NULL);
+	g_signal_connect(GTK_OBJECT(menubar), "leave_notify_event",
+	            GTK_SIGNAL_FUNC(leave_notify_evhandler), NULL);
+
 	return menubar;
 }
+
+void
+xmenu_hide(void)
+{
+
+	gtk_widget_hide(menubar);
+}
+
+void
+xmenu_show(void)
+{
+
+	gtk_widget_show(menubar);
+}
+
+void
+xmenu_toggle_menu(void)
+{
+
+	if (GTK_WIDGET_VISIBLE(menubar))
+		xmenu_hide();
+	else
+		xmenu_show();
+}
+
+void
+xmenu_select_screen(UINT8 mode)
+{
+
+	xmenu_select_rotate(mode & SCRNMODE_ROTATEMASK);
+	xmenu_select_screenmode(mode & SCRNMODE_FULLSCREEN);
+}