summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui/mainmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/ui/mainmenu.cpp')
-rw-r--r--src/emu/ui/mainmenu.cpp112
1 files changed, 105 insertions, 7 deletions
diff --git a/src/emu/ui/mainmenu.cpp b/src/emu/ui/mainmenu.cpp
index 75f16b3d9ba..7287c68919c 100644
--- a/src/emu/ui/mainmenu.cpp
+++ b/src/emu/ui/mainmenu.cpp
@@ -29,6 +29,9 @@
#include "ui/videoopt.h"
#include "imagedev/cassette.h"
#include "machine/bcreader.h"
+#include "ui/datfile.h"
+#include "ui/inifile.h"
+#include "ui/datmenu.h"
/***************************************************************************
@@ -132,9 +135,62 @@ void ui_menu_main::populate()
if (machine().options().cheat() && machine().cheat().first() != nullptr)
item_append("Cheat", nullptr, 0, (void *)CHEAT);
+ /* add history menu */
+ if (machine().options().enabled_dats())
+ item_append("History Info", nullptr, 0, (void *)HISTORY);
+
+ // add software history menu
+ if ((machine().system().flags & MACHINE_TYPE_ARCADE) == 0 && machine().options().enabled_dats())
+ {
+ image_interface_iterator iter(machine().root_device());
+ for (device_image_interface *image = iter.first(); image != nullptr; image = iter.next())
+ {
+ const char *name = image->filename();
+ if (name != nullptr)
+ {
+ item_append("Software History Info", nullptr, 0, (void *)SW_HISTORY);
+ break;
+ }
+ }
+ }
+
+ /* add mameinfo / messinfo menu */
+ if (machine().options().enabled_dats())
+ {
+ if ((machine().system().flags & MACHINE_TYPE_ARCADE) != 0)
+ item_append("MameInfo", nullptr, 0, (void *)MAMEINFO);
+ else if ((machine().system().flags & MACHINE_TYPE_ARCADE) == 0)
+ item_append("MessInfo", nullptr, 0, (void *)MAMEINFO);
+ }
+
+ /* add sysinfo menu */
+ if ((machine().system().flags & MACHINE_TYPE_ARCADE) == 0 && machine().options().enabled_dats())
+ item_append("SysInfo", nullptr, 0, (void *)SYSINFO);
+
+ /* add command list menu */
+ if ((machine().system().flags & MACHINE_TYPE_ARCADE) != 0 && machine().options().enabled_dats())
+ item_append("Commands Info", nullptr, 0, (void *)COMMAND);
+
+ /* add story menu */
+ if ((machine().system().flags & MACHINE_TYPE_ARCADE) != 0 && machine().options().enabled_dats())
+ item_append("Mamescores", nullptr, 0, (void *)STORYINFO);
+
+ item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
+
+ /* add favorite menu */
+ if (!machine().favorite().isgame_favorite())
+ item_append("Add To Favorites", nullptr, 0, (void *)ADD_FAVORITE);
+ else
+ item_append("Remove From Favorites", nullptr, 0, (void *)REMOVE_FAVORITE);
+
+ item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
+
+ menu_text.assign("Quit from ").append(emulator_info::get_capstartgamenoun());
+ item_append(menu_text.c_str(), nullptr, 0, (void *)QUIT_GAME);
+
/* add reset and exit menus */
- strprintf(menu_text, "Select New %s", emulator_info::get_capstartgamenoun());
- item_append(menu_text.c_str(), nullptr, 0, (void *)SELECT_GAME);
+// strprintf(menu_text, "Select New %s", emulator_info::get_capstartgamenoun());
+// item_append(menu_text.c_str(), nullptr, 0, (void *)SELECT_GAME);
}
ui_menu_main::~ui_menu_main()
@@ -191,8 +247,8 @@ void ui_menu_main::handle()
ui_menu::stack_push(global_alloc_clear<ui_menu_tape_control>(machine(), container, nullptr));
break;
- case PTY_INFO:
- ui_menu::stack_push(global_alloc_clear<ui_menu_pty_info>(machine(), container));
+ case PTY_INFO:
+ ui_menu::stack_push(global_alloc_clear<ui_menu_pty_info>(machine(), container));
break;
case SLOT_DEVICES:
@@ -227,9 +283,9 @@ void ui_menu_main::handle()
ui_menu::stack_push(global_alloc_clear<ui_menu_cheat>(machine(), container));
break;
- case SELECT_GAME:
- ui_menu::stack_push(global_alloc_clear<ui_menu_select_game>(machine(), container, nullptr));
- break;
+// case SELECT_GAME:
+// ui_menu::stack_push(global_alloc_clear<ui_menu_select_game>(machine(), container, nullptr));
+// break;
case BIOS_SELECTION:
ui_menu::stack_push(global_alloc_clear<ui_menu_bios_selection>(machine(), container));
@@ -239,6 +295,48 @@ void ui_menu_main::handle()
ui_menu::stack_push(global_alloc_clear<ui_menu_barcode_reader>(machine(), container, nullptr));
break;
+ case HISTORY:
+ ui_menu::stack_push(global_alloc_clear<ui_menu_dats>(machine(), container, MEWUI_HISTORY_LOAD));
+ break;
+
+ case MAMEINFO:
+ if ((machine().system().flags & MACHINE_TYPE_ARCADE) != 0)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_dats>(machine(), container, MEWUI_MAMEINFO_LOAD));
+ else
+ ui_menu::stack_push(global_alloc_clear<ui_menu_dats>(machine(), container, MEWUI_MESSINFO_LOAD));
+ break;
+
+ case SYSINFO:
+ ui_menu::stack_push(global_alloc_clear<ui_menu_dats>(machine(), container, MEWUI_SYSINFO_LOAD));
+ break;
+
+ case COMMAND:
+ ui_menu::stack_push(global_alloc_clear<ui_menu_command>(machine(), container));
+ break;
+
+ case STORYINFO:
+ ui_menu::stack_push(global_alloc_clear<ui_menu_dats>(machine(), container, MEWUI_STORY_LOAD));
+ break;
+
+ case ADD_FAVORITE:
+ machine().favorite().add_favorite_game();
+ reset(UI_MENU_RESET_REMEMBER_POSITION);
+ break;
+
+ case REMOVE_FAVORITE:
+ machine().favorite().remove_favorite_game();
+ reset(UI_MENU_RESET_REMEMBER_POSITION);
+ break;
+
+ case SW_HISTORY:
+ ui_menu::stack_push(global_alloc_clear<ui_menu_history_sw>(machine(), container));
+ break;
+
+ case QUIT_GAME:
+ ui_menu::stack_pop(machine());
+ machine().ui().request_quit();
+ break;
+
default:
fatalerror("ui_menu_main::handle - unknown reference\n");
}