More menu work, sleep a while on exit

This commit is contained in:
simon.kagstrom 2009-05-13 16:43:38 +00:00
parent fb5fd0f4b5
commit 3625f5ffb3

View File

@ -15,24 +15,59 @@
#include "menu.h" #include "menu.h"
static const char *main_menu_messages[] = { static const char *main_menu_messages[] = {
/*00*/ "Floppy", /*00*/ "Insert floppy",
/*01*/ "^|df0|df1|df2|df3", /*01*/ "^|df0|df1|df2|df3",
/*02*/ "States", /*02*/ "States",
/*03*/ "^|Load|Save|Delete", /*03*/ "^|Load|Save|Delete",
/*04*/ "Keyboard", /*05*/ "#1-------------------------------------",
/*05*/ "^|Type|Macro|Bind", /*06*/ "Reset UAE",
/*06*/ "#1-------------------------------------", /*07*/ "Memory options",
/*07*/ "Reset UAE", /*08*/ "CPU/Chipset options",
/*08*/ "Options", /*09*/ "Game port options",
/*09*/ "Advanced Options",
/*10*/ "Help", /*10*/ "Help",
/*11*/ "Quit", /*11*/ "Quit",
NULL NULL
}; };
static const char *memory_messages[] = {
/*00*/ "Chip mem",
/*01*/ "^|512K|1M|2M|4M|8M",
/*02*/ "Slow mem",
/*03*/ "^|512K|1M|1.8M",
/*04*/ "Fast mem",
/*05*/ "^|None|1M|2M|4M|8M",
/*06*/ "Change ROM file",
NULL
};
static const char *cpu_messages[] = {
/*00*/ "Model",
/*01*/ "^|68000|68010|68020|68030|68040",
/*02*/ "Accuracy",
/*03*/ "^|Normal|Compatible|Cycle exact",
/*04*/ "Speed",
/*05*/ "^|Approx 1-1|Maximum",
/*06*/ "Chipset",
/*07*/ "^|OCS|ECS Agnus|Full ECS|AGA",
/*08*/ "TV mode (emulation)",
/*09*/ "^|NTSC|PAL",
NULL
};
static const char *other_messages[] = {
NULL
};
static void exit_fn(void)
{
sleep(3);
}
void gui_init (int argc, char **argv) void gui_init (int argc, char **argv)
{ {
printf("Init gui\n");
atexit(exit_fn);
} }
int gui_open (void) int gui_open (void)
@ -107,6 +142,8 @@ void gui_handle_events (void)
{ {
} }
static int prefs_has_changed;
static void insert_floppy(int which) static void insert_floppy(int which)
{ {
const char *name = menu_select_file(prefs_get_attr("floppy_path")); const char *name = menu_select_file(prefs_get_attr("floppy_path"));
@ -115,6 +152,27 @@ static void insert_floppy(int which)
strcpy (changed_prefs.df[which], name); strcpy (changed_prefs.df[which], name);
} }
static void memory_options(void)
{
int submenus[3];
memset(submenus, 0, sizeof(submenus));
}
static void cpu_options(void)
{
int submenus[5];
memset(submenus, 0, sizeof(submenus));
submenus[0] = currprefs.cpu_level;
submenus[1] = currprefs.cpu_cycle_exact;
submenus[2] = currprefs.m68k_speed;
submenus[3] = currprefs.chipset_mask;
}
static void gameport_options(void)
{
}
void gui_display(int shortcut) void gui_display(int shortcut)
{ {
int submenus[3]; int submenus[3];
@ -122,6 +180,7 @@ void gui_display(int shortcut)
memset(submenus, 0, sizeof(submenus)); memset(submenus, 0, sizeof(submenus));
printf("gui_display: %d\n", shortcut); printf("gui_display: %d\n", shortcut);
prefs_has_changed = 0;
opt = menu_select_title("Main menu", main_menu_messages, submenus); opt = menu_select_title("Main menu", main_menu_messages, submenus);
switch(opt) switch(opt)
@ -150,9 +209,18 @@ void gui_display(int shortcut)
} }
msgYesNo("This is not implemented", 0, 320, 200); msgYesNo("This is not implemented", 0, 320, 200);
break; break;
case 7: case 6:
uae_reset(1); uae_reset(1);
break; break;
case 7:
memory_options();
break;
case 8:
cpu_options();
break;
case 9:
gameport_options();
break;
case 11: case 11:
uae_quit(); uae_quit();
break; break;
@ -171,7 +239,7 @@ void gui_message (const char *format,...)
va_start (parms,format); va_start (parms,format);
vsprintf ( msg, format, parms); vsprintf ( msg, format, parms);
va_end (parms); va_end (parms);
msgYesNo(msg, 0, 24, 24); // msgYesNo(msg, 0, 24, 24);
write_log (msg); write_log (msg);
} }