mirror of
https://github.com/holub/mame
synced 2025-04-26 10:13:37 +03:00
ui: Removed the creation of cache file 'info_', and also removed 'Screen Type', '(no)Samples' and 'Stereo' filters. (TODO: pending to restore them in a proper manner).
This commit is contained in:
parent
186febc3dc
commit
cd05adafe0
@ -106,29 +106,6 @@ void ui_menu_custom_filter::handle()
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, custfltr::other[pos]));
|
||||
}
|
||||
}
|
||||
else if ((FPTR)m_event->itemref >= SCREEN_FILTER && (FPTR)m_event->itemref < SCREEN_FILTER + MAX_CUST_FILTER)
|
||||
{
|
||||
int pos = (int)((FPTR)m_event->itemref - SCREEN_FILTER);
|
||||
if (m_event->iptkey == IPT_UI_LEFT && custfltr::screen[pos] > 0)
|
||||
{
|
||||
custfltr::screen[pos]--;
|
||||
changed = true;
|
||||
}
|
||||
else if (m_event->iptkey == IPT_UI_RIGHT && custfltr::screen[pos] < screen_filters::length - 1)
|
||||
{
|
||||
custfltr::screen[pos]++;
|
||||
changed = true;
|
||||
}
|
||||
else if (m_event->iptkey == IPT_UI_SELECT)
|
||||
{
|
||||
size_t total = screen_filters::length;
|
||||
std::vector<std::string> s_sel(total);
|
||||
for (size_t index = 0; index < total; ++index)
|
||||
s_sel[index] = screen_filters::text[index];
|
||||
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, custfltr::screen[pos]));
|
||||
}
|
||||
}
|
||||
else if ((FPTR)m_event->itemref >= YEAR_FILTER && (FPTR)m_event->itemref < YEAR_FILTER + MAX_CUST_FILTER)
|
||||
{
|
||||
int pos = (int)((FPTR)m_event->itemref - YEAR_FILTER);
|
||||
@ -207,16 +184,6 @@ void ui_menu_custom_filter::populate()
|
||||
convert_command_glyph(fbuff);
|
||||
item_append(fbuff.c_str(), c_year::ui[custfltr::year[x]].c_str(), arrow_flags, (void *)(FPTR)(YEAR_FILTER + x));
|
||||
}
|
||||
|
||||
// add screen subitem
|
||||
else if (custfltr::other[x] == FILTER_SCREEN)
|
||||
{
|
||||
arrow_flags = get_arrow_flags(0, screen_filters::length - 1, custfltr::screen[x]);
|
||||
std::string fbuff("^!Screen type");
|
||||
convert_command_glyph(fbuff);
|
||||
item_append(fbuff.c_str(), screen_filters::text[custfltr::screen[x]], arrow_flags, (void *)(FPTR)(SCREEN_FILTER + x));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
@ -228,7 +195,6 @@ void ui_menu_custom_filter::populate()
|
||||
item_append("Add filter", nullptr, 0, (void *)(FPTR)ADD_FILTER);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
|
||||
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
}
|
||||
|
||||
@ -287,8 +253,6 @@ void ui_menu_custom_filter::save_custom_filters()
|
||||
cinfo.append(" Manufacturer filter = ").append(c_mnfct::ui[custfltr::mnfct[x]]).append("\n");
|
||||
else if (custfltr::other[x] == FILTER_YEAR)
|
||||
cinfo.append(" Year filter = ").append(c_year::ui[custfltr::year[x]]).append("\n");
|
||||
else if (custfltr::other[x] == FILTER_SCREEN)
|
||||
cinfo.append(" Screen filter = ").append(screen_filters::text[custfltr::screen[x]]).append("\n");
|
||||
}
|
||||
file.puts(cinfo.c_str());
|
||||
file.close();
|
||||
|
@ -77,7 +77,6 @@ void ui_menu_game_options::handle()
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case FILE_CATEGORY_FILTER:
|
||||
{
|
||||
if (m_event->iptkey == IPT_UI_LEFT)
|
||||
@ -105,7 +104,6 @@ void ui_menu_game_options::handle()
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case CATEGORY_FILTER:
|
||||
{
|
||||
if (m_event->iptkey == IPT_UI_LEFT)
|
||||
@ -131,7 +129,6 @@ void ui_menu_game_options::handle()
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MANUFACT_CAT_FILTER:
|
||||
if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
|
||||
{
|
||||
@ -142,7 +139,6 @@ void ui_menu_game_options::handle()
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, c_mnfct::ui, c_mnfct::actual));
|
||||
|
||||
break;
|
||||
|
||||
case YEAR_CAT_FILTER:
|
||||
if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
|
||||
{
|
||||
@ -153,44 +149,22 @@ void ui_menu_game_options::handle()
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, c_year::ui, c_year::actual));
|
||||
|
||||
break;
|
||||
|
||||
case SCREEN_CAT_FILTER:
|
||||
if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
|
||||
{
|
||||
(m_event->iptkey == IPT_UI_RIGHT) ? screen_filters::actual++ : screen_filters::actual--;
|
||||
changed = true;
|
||||
}
|
||||
else if (m_event->iptkey == IPT_UI_SELECT)
|
||||
{
|
||||
std::vector<std::string> text(screen_filters::length);
|
||||
for (int x = 0; x < screen_filters::length; ++x)
|
||||
text[x] = screen_filters::text[x];
|
||||
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, text, screen_filters::actual));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MISC_MENU:
|
||||
if (m_event->iptkey == IPT_UI_SELECT)
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_misc_options>(machine(), container));
|
||||
break;
|
||||
|
||||
case SOUND_MENU:
|
||||
if (m_event->iptkey == IPT_UI_SELECT)
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_sound_options>(machine(), container));
|
||||
break;
|
||||
|
||||
case DISPLAY_MENU:
|
||||
if (m_event->iptkey == IPT_UI_SELECT)
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_display_options>(machine(), container));
|
||||
break;
|
||||
|
||||
case CUSTOM_MENU:
|
||||
if (m_event->iptkey == IPT_UI_SELECT)
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_custom_ui>(machine(), container));
|
||||
break;
|
||||
|
||||
case CONTROLLER_MENU:
|
||||
if (m_event->iptkey == IPT_UI_SELECT)
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_controller_mapping>(machine(), container));
|
||||
@ -258,14 +232,6 @@ void ui_menu_game_options::populate()
|
||||
convert_command_glyph(fbuff);
|
||||
item_append(fbuff.c_str(), c_year::ui[c_year::actual].c_str(), arrow_flags, (void *)(FPTR)YEAR_CAT_FILTER);
|
||||
}
|
||||
// add screen subitem
|
||||
else if (main_filters::actual == FILTER_SCREEN)
|
||||
{
|
||||
arrow_flags = get_arrow_flags(0, screen_filters::length - 1, screen_filters::actual);
|
||||
fbuff = "^!Screen type";
|
||||
convert_command_glyph(fbuff);
|
||||
item_append(fbuff.c_str(), screen_filters::text[screen_filters::actual], arrow_flags, (void *)(FPTR)SCREEN_CAT_FILTER);
|
||||
}
|
||||
// add custom subitem
|
||||
else if (main_filters::actual == FILTER_CUSTOM)
|
||||
{
|
||||
|
@ -29,7 +29,6 @@ private:
|
||||
FILE_CATEGORY_FILTER,
|
||||
MANUFACT_CAT_FILTER,
|
||||
YEAR_CAT_FILTER,
|
||||
SCREEN_CAT_FILTER,
|
||||
CATEGORY_FILTER,
|
||||
MISC_MENU,
|
||||
DISPLAY_MENU,
|
||||
|
@ -37,6 +37,9 @@ extern const char UI_VERSION_TAG[];
|
||||
static bool first_start = true;
|
||||
static const char *dats_info[] = { "General Info", "History", "Mameinfo", "Sysinfo", "Messinfo", "Command", "Mamescore" };
|
||||
|
||||
std::vector<const game_driver *> ui_menu_select_game::m_sortedlist;
|
||||
int ui_menu_select_game::m_isabios = 0;
|
||||
|
||||
//-------------------------------------------------
|
||||
// sort
|
||||
//-------------------------------------------------
|
||||
@ -162,7 +165,7 @@ ui_menu_select_game::ui_menu_select_game(running_machine &machine, render_contai
|
||||
ui_options &moptions = machine.ui().options();
|
||||
|
||||
// load drivers cache
|
||||
load_cache_info();
|
||||
init_sorted_list();
|
||||
|
||||
// build drivers list
|
||||
if (!load_available_machines())
|
||||
@ -184,6 +187,7 @@ ui_menu_select_game::ui_menu_select_game(running_machine &machine, render_contai
|
||||
sub_filter = tmp.substr(found + 1);
|
||||
}
|
||||
|
||||
main_filters::actual = FILTER_ALL;
|
||||
for (size_t ind = 0; ind < main_filters::length; ++ind)
|
||||
if (last_filter == main_filters::text[ind])
|
||||
{
|
||||
@ -205,12 +209,6 @@ ui_menu_select_game::ui_menu_select_game(running_machine &machine, render_contai
|
||||
if (sub_filter == c_year::ui[id])
|
||||
c_year::actual = id;
|
||||
}
|
||||
else if (main_filters::actual == FILTER_SCREEN)
|
||||
{
|
||||
for (size_t id = 0; id < screen_filters::length; ++id)
|
||||
if (sub_filter == screen_filters::text[id])
|
||||
screen_filters::actual = id;
|
||||
}
|
||||
first_start = false;
|
||||
}
|
||||
|
||||
@ -253,8 +251,6 @@ ui_menu_select_game::~ui_menu_select_game()
|
||||
filter.append(",").append(c_mnfct::ui[c_mnfct::actual]);
|
||||
else if (main_filters::actual == FILTER_YEAR)
|
||||
filter.append(",").append(c_year::ui[c_year::actual]);
|
||||
else if (main_filters::actual == FILTER_SCREEN)
|
||||
filter.append(",").append(screen_filters::text[screen_filters::actual]);
|
||||
|
||||
mopt.set_value(OPTION_LAST_USED_FILTER, filter.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
|
||||
mopt.set_value(OPTION_LAST_USED_MACHINE, last_driver.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
|
||||
@ -573,14 +569,6 @@ void ui_menu_select_game::handle()
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, c_mnfct::ui, c_mnfct::actual, SELECTOR_GAME, l_hover));
|
||||
else if (l_hover == FILTER_YEAR)
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, c_year::ui, c_year::actual, SELECTOR_GAME, l_hover));
|
||||
else if (l_hover == FILTER_SCREEN)
|
||||
{
|
||||
std::vector<std::string> text(screen_filters::length);
|
||||
for (int x = 0; x < screen_filters::length; ++x)
|
||||
text[x] = screen_filters::text[x];
|
||||
|
||||
ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, text, screen_filters::actual, SELECTOR_GAME, l_hover));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (l_hover >= FILTER_ALL)
|
||||
@ -618,28 +606,15 @@ void ui_menu_select_game::populate()
|
||||
case FILTER_CATEGORY:
|
||||
build_category();
|
||||
break;
|
||||
|
||||
case FILTER_MANUFACTURER:
|
||||
build_list(m_tmp, c_mnfct::ui[c_mnfct::actual].c_str());
|
||||
break;
|
||||
|
||||
case FILTER_YEAR:
|
||||
build_list(m_tmp, c_year::ui[c_year::actual].c_str());
|
||||
break;
|
||||
|
||||
case FILTER_SCREEN:
|
||||
case FILTER_STEREO:
|
||||
case FILTER_SAMPLES:
|
||||
case FILTER_NOSAMPLES:
|
||||
case FILTER_CHD:
|
||||
case FILTER_NOCHD:
|
||||
build_from_cache(m_tmp, screen_filters::actual);
|
||||
break;
|
||||
|
||||
case FILTER_CUSTOM:
|
||||
build_custom();
|
||||
break;
|
||||
|
||||
default:
|
||||
build_list(m_tmp);
|
||||
break;
|
||||
@ -805,7 +780,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott
|
||||
ui_manager &mui = machine().ui();
|
||||
float tbarspace = mui.get_line_height();
|
||||
|
||||
strprintf(tempbuf[0], "MAME %s ( %d / %d machines (%d BIOS) )", bare_build_version, visible_items, (driver_list::total() - 1), m_isabios + m_issbios);
|
||||
strprintf(tempbuf[0], "MAME %s ( %d / %d machines (%d BIOS) )", bare_build_version, visible_items, (driver_list::total() - 1), m_isabios);
|
||||
std::string filtered;
|
||||
|
||||
if (main_filters::actual == FILTER_CATEGORY && !machine().inifile().ini_index.empty())
|
||||
@ -821,9 +796,6 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott
|
||||
else if (main_filters::actual == FILTER_YEAR)
|
||||
filtered.assign(main_filters::text[main_filters::actual]).append(" (").append(c_year::ui[c_year::actual]).append(") -");
|
||||
|
||||
else if (main_filters::actual == FILTER_SCREEN)
|
||||
filtered.assign(main_filters::text[main_filters::actual]).append(" (").append(screen_filters::text[screen_filters::actual]).append(") -");
|
||||
|
||||
// display the current typeahead
|
||||
if (no_active_search())
|
||||
tempbuf[1].clear();
|
||||
@ -1362,6 +1334,27 @@ void ui_menu_select_game::build_list(std::vector<const game_driver *> &s_drivers
|
||||
m_displaylist.push_back(s_driver);
|
||||
break;
|
||||
}
|
||||
case FILTER_CHD:
|
||||
for (const rom_entry *rom = s_driver->rom; !ROMENTRY_ISEND(rom); ++rom)
|
||||
if (ROMENTRY_ISREGION(rom) && ROMREGION_ISDISKDATA(rom))
|
||||
{
|
||||
m_displaylist.push_back(s_driver);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case FILTER_NOCHD:
|
||||
{
|
||||
bool found = false;
|
||||
for (const rom_entry *rom = s_driver->rom; !ROMENTRY_ISEND(rom); ++rom)
|
||||
if (ROMENTRY_ISREGION(rom) && ROMREGION_ISDISKDATA(rom))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
if (!found)
|
||||
m_displaylist.push_back(s_driver);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1408,16 +1401,6 @@ void ui_menu_select_game::build_custom()
|
||||
case FILTER_MANUFACTURER:
|
||||
build_list(s_drivers, c_mnfct::ui[custfltr::mnfct[count]].c_str(), filter, bioscheck);
|
||||
break;
|
||||
case FILTER_SCREEN:
|
||||
build_from_cache(s_drivers, custfltr::screen[count], filter, bioscheck);
|
||||
break;
|
||||
case FILTER_CHD:
|
||||
case FILTER_NOCHD:
|
||||
case FILTER_SAMPLES:
|
||||
case FILTER_NOSAMPLES:
|
||||
case FILTER_STEREO:
|
||||
build_from_cache(s_drivers, 0, filter, bioscheck);
|
||||
break;
|
||||
default:
|
||||
build_list(s_drivers, nullptr, filter, bioscheck);
|
||||
break;
|
||||
@ -1441,59 +1424,6 @@ void ui_menu_select_game::build_category()
|
||||
m_displaylist = m_tmp;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// build list from cache
|
||||
//-------------------------------------------------
|
||||
|
||||
void ui_menu_select_game::build_from_cache(std::vector<const game_driver *> &s_drivers, int screens, int filter, bool bioscheck)
|
||||
{
|
||||
if (s_drivers.empty())
|
||||
{
|
||||
s_drivers = m_sortedlist;
|
||||
filter = main_filters::actual;
|
||||
}
|
||||
|
||||
for (auto & s_driver : s_drivers)
|
||||
{
|
||||
if (!bioscheck && filter != FILTER_BIOS && (s_driver->flags & MACHINE_IS_BIOS_ROOT) != 0)
|
||||
continue;
|
||||
int idx = driver_list::find(s_driver->name);
|
||||
|
||||
switch (filter)
|
||||
{
|
||||
case FILTER_SCREEN:
|
||||
if (driver_cache[idx].b_screen == screens)
|
||||
m_displaylist.push_back(s_driver);
|
||||
break;
|
||||
|
||||
case FILTER_SAMPLES:
|
||||
if (driver_cache[idx].b_samples)
|
||||
m_displaylist.push_back(s_driver);
|
||||
break;
|
||||
|
||||
case FILTER_NOSAMPLES:
|
||||
if (!driver_cache[idx].b_samples)
|
||||
m_displaylist.push_back(s_driver);
|
||||
break;
|
||||
|
||||
case FILTER_STEREO:
|
||||
if (driver_cache[idx].b_stereo)
|
||||
m_displaylist.push_back(s_driver);
|
||||
break;
|
||||
|
||||
case FILTER_CHD:
|
||||
if (driver_cache[idx].b_chd)
|
||||
m_displaylist.push_back(s_driver);
|
||||
break;
|
||||
|
||||
case FILTER_NOCHD:
|
||||
if (!driver_cache[idx].b_chd)
|
||||
m_displaylist.push_back(s_driver);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// populate search list
|
||||
//-------------------------------------------------
|
||||
@ -1591,13 +1521,15 @@ void ui_menu_select_game::general_info(const game_driver *driver, std::string &b
|
||||
strcatprintf(buffer, "Support Cocktail: %s\n", ((driver->flags & MACHINE_NO_COCKTAIL) ? "Yes" : "No"));
|
||||
strcatprintf(buffer, "Driver is Bios: %s\n", ((driver->flags & MACHINE_IS_BIOS_ROOT) ? "Yes" : "No"));
|
||||
strcatprintf(buffer, "Support Save: %s\n", ((driver->flags & MACHINE_SUPPORTS_SAVE) ? "Yes" : "No"));
|
||||
|
||||
int idx = driver_list::find(driver->name);
|
||||
strcatprintf(buffer, "Screen Type: %s\n", screen_filters::text[driver_cache[idx].b_screen]);
|
||||
strcatprintf(buffer, "Screen Orentation: %s\n", ((driver->flags & ORIENTATION_SWAP_XY) ? "Vertical" : "Horizontal"));
|
||||
strcatprintf(buffer, "Requires Samples: %s\n", (driver_cache[idx].b_samples ? "Yes" : "No"));
|
||||
strcatprintf(buffer, "Sound Channel: %s\n", (driver_cache[idx].b_stereo ? "Stereo" : "Mono"));
|
||||
strcatprintf(buffer, "Requires CHD: %s\n", (driver_cache[idx].b_chd ? "Yes" : "No"));
|
||||
bool found = false;
|
||||
for (const rom_entry *rom = driver->rom; !ROMENTRY_ISEND(rom); ++rom)
|
||||
if (ROMENTRY_ISREGION(rom) && ROMREGION_ISDISKDATA(rom))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
strcatprintf(buffer, "Requires CHD: %s\n", (found ? "Yes" : "No"));
|
||||
|
||||
// audit the game first to see if we're going to work
|
||||
if (machine().ui().options().info_audit())
|
||||
@ -1681,17 +1613,10 @@ void ui_menu_select_game::inkey_export()
|
||||
// save drivers infos to file
|
||||
//-------------------------------------------------
|
||||
|
||||
void ui_menu_select_game::save_cache_info()
|
||||
void ui_menu_select_game::init_sorted_list()
|
||||
{
|
||||
// attempt to open the output file
|
||||
emu_file file(machine().ui().options().ui_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
|
||||
|
||||
if (file.open("info_", emulator_info::get_configname(), ".ini") == FILERR_NONE)
|
||||
{
|
||||
m_sortedlist.clear();
|
||||
|
||||
// generate header
|
||||
std::string buffer = std::string("#\n").append(UI_VERSION_TAG).append(bare_build_version).append("\n#\n\n");
|
||||
if (!m_sortedlist.empty())
|
||||
return;
|
||||
|
||||
// generate full list
|
||||
for (int x = 0; x < driver_list::total(); ++x)
|
||||
@ -1699,6 +1624,8 @@ void ui_menu_select_game::save_cache_info()
|
||||
const game_driver *driver = &driver_list::driver(x);
|
||||
if (driver == &GAME_NAME(___empty))
|
||||
continue;
|
||||
if (driver->flags & MACHINE_IS_BIOS_ROOT)
|
||||
m_isabios++;
|
||||
|
||||
m_sortedlist.push_back(driver);
|
||||
c_mnfct::set(driver->manufacturer);
|
||||
@ -1709,135 +1636,6 @@ void ui_menu_select_game::save_cache_info()
|
||||
std::stable_sort(c_mnfct::ui.begin(), c_mnfct::ui.end());
|
||||
std::stable_sort(c_year::ui.begin(), c_year::ui.end());
|
||||
std::stable_sort(m_sortedlist.begin(), m_sortedlist.end(), sort_game_list);
|
||||
|
||||
int index = 0;
|
||||
m_isabios = 0;
|
||||
m_issbios = 0;
|
||||
m_isarcades = 0;
|
||||
m_issystems = 0;
|
||||
for (int x = 0; x < driver_list::total(); ++x)
|
||||
{
|
||||
const game_driver *driver = &driver_list::driver(x);
|
||||
if (driver == &GAME_NAME(___empty))
|
||||
continue;
|
||||
|
||||
if (driver->flags & MACHINE_TYPE_ARCADE)
|
||||
{
|
||||
if (driver->flags & MACHINE_IS_BIOS_ROOT)
|
||||
m_isabios++;
|
||||
m_isarcades++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (driver->flags & MACHINE_IS_BIOS_ROOT)
|
||||
m_issbios++;
|
||||
m_issystems++;
|
||||
}
|
||||
cache_info infos;
|
||||
machine_config config(*driver, machine().options());
|
||||
|
||||
samples_device_iterator iter(config.root_device());
|
||||
infos.b_samples = (iter.first() != nullptr) ? 1 : 0;
|
||||
|
||||
const screen_device *screen = config.first_screen();
|
||||
infos.b_screen = (screen != nullptr) ? screen->screen_type() : 0;
|
||||
|
||||
speaker_device_iterator siter(config.root_device());
|
||||
sound_interface_iterator snditer(config.root_device());
|
||||
infos.b_stereo = (snditer.first() != nullptr && siter.count() > 1) ? 1 : 0;
|
||||
infos.b_chd = 0;
|
||||
for (const rom_entry *rom = driver->rom; !ROMENTRY_ISEND(rom); ++rom)
|
||||
if (ROMENTRY_ISREGION(rom) && ROMREGION_ISDISKDATA(rom))
|
||||
{
|
||||
infos.b_chd = 1;
|
||||
break;
|
||||
}
|
||||
driver_cache[x].b_screen = infos.b_screen;
|
||||
driver_cache[x].b_samples = infos.b_samples;
|
||||
driver_cache[x].b_stereo = infos.b_stereo;
|
||||
driver_cache[x].b_chd = infos.b_chd;
|
||||
int find = driver_list::find(m_sortedlist[index++]->name);
|
||||
strcatprintf(buffer, "%d,%d,%d,%d,%d\n", infos.b_screen, infos.b_samples, infos.b_stereo, infos.b_chd, find);
|
||||
}
|
||||
|
||||
strcatprintf(buffer, "%d,%d,%d,%d\n", m_isabios, m_issbios, m_isarcades, m_issystems);
|
||||
file.puts(buffer.c_str());
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// load drivers infos from file
|
||||
//-------------------------------------------------
|
||||
|
||||
void ui_menu_select_game::load_cache_info()
|
||||
{
|
||||
driver_cache.resize(driver_list::total() + 1);
|
||||
|
||||
// try to load driver cache
|
||||
emu_file file(machine().ui().options().ui_path(), OPEN_FLAG_READ);
|
||||
if (file.open("info_", emulator_info::get_configname(), ".ini") != FILERR_NONE)
|
||||
{
|
||||
save_cache_info();
|
||||
return;
|
||||
}
|
||||
|
||||
std::string readbuf;
|
||||
char rbuf[MAX_CHAR_INFO];
|
||||
file.gets(rbuf, MAX_CHAR_INFO);
|
||||
file.gets(rbuf, MAX_CHAR_INFO);
|
||||
readbuf = chartrimcarriage(rbuf);
|
||||
std::string a_rev = std::string(UI_VERSION_TAG).append(bare_build_version);
|
||||
|
||||
// version not matching ? save and exit
|
||||
if (a_rev != readbuf)
|
||||
{
|
||||
file.close();
|
||||
save_cache_info();
|
||||
return;
|
||||
}
|
||||
|
||||
size_t pos = 0, end = 0;
|
||||
file.gets(rbuf, MAX_CHAR_INFO);
|
||||
file.gets(rbuf, MAX_CHAR_INFO);
|
||||
for (int x = 0; x < driver_list::total(); ++x)
|
||||
{
|
||||
const game_driver *driver = &driver_list::driver(x);
|
||||
if (driver == &GAME_NAME(___empty))
|
||||
continue;
|
||||
|
||||
c_mnfct::set(driver->manufacturer);
|
||||
c_year::set(driver->year);
|
||||
file.gets(rbuf, MAX_CHAR_INFO);
|
||||
readbuf = chartrimcarriage(rbuf);
|
||||
pos = readbuf.find_first_of(',');
|
||||
driver_cache[x].b_screen = std::stoi(readbuf.substr(0, pos));
|
||||
end = readbuf.find_first_of(',', ++pos);
|
||||
driver_cache[x].b_samples = std::stoi(readbuf.substr(pos, end));
|
||||
pos = end;
|
||||
end = readbuf.find_first_of(',', ++pos);
|
||||
driver_cache[x].b_stereo = std::stoi(readbuf.substr(pos, end));
|
||||
pos = end;
|
||||
end = readbuf.find_first_of(',', ++pos);
|
||||
driver_cache[x].b_chd = std::stoi(readbuf.substr(pos, end));
|
||||
pos = end;
|
||||
int find = std::stoi(readbuf.substr(++pos));
|
||||
m_sortedlist.push_back(&driver_list::driver(find));
|
||||
}
|
||||
file.gets(rbuf, MAX_CHAR_INFO);
|
||||
readbuf = chartrimcarriage(rbuf);
|
||||
pos = readbuf.find_first_of(',');
|
||||
m_isabios = std::stoi(readbuf.substr(0, pos));
|
||||
end = readbuf.find_first_of(',', ++pos);
|
||||
m_issbios = std::stoi(readbuf.substr(pos, end));
|
||||
pos = end;
|
||||
end = readbuf.find_first_of(',', ++pos);
|
||||
m_isarcades = std::stoi(readbuf.substr(pos, end));
|
||||
pos = end;
|
||||
m_issystems = std::stoi(readbuf.substr(++pos));
|
||||
file.close();
|
||||
std::stable_sort(c_mnfct::ui.begin(), c_mnfct::ui.end());
|
||||
std::stable_sort(c_year::ui.begin(), c_year::ui.end());
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -1944,14 +1742,6 @@ void ui_menu_select_game::load_custom_filters()
|
||||
if (!strncmp(db, c_year::ui[z].c_str(), c_year::ui[z].length()))
|
||||
custfltr::year[x] = z;
|
||||
}
|
||||
else if (y == FILTER_SCREEN)
|
||||
{
|
||||
file.gets(buffer, MAX_CHAR_INFO);
|
||||
char *db = strchr(buffer, '=') + 2;
|
||||
for (size_t z = 0; z < screen_filters::length; ++z)
|
||||
if (!strncmp(db, screen_filters::text[z], strlen(screen_filters::text[z])))
|
||||
custfltr::screen[x] = z;
|
||||
}
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
@ -2004,7 +1794,6 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y
|
||||
}
|
||||
|
||||
x2 = x1 + left_width + 2.0f * UI_BOX_LR_BORDER;
|
||||
//machine().ui().draw_outlined_box(container, x1, y1, x2, y2, rgb_t(0xEF, 0x12, 0x47, 0x7B));
|
||||
mui.draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
|
||||
|
||||
// take off the borders
|
||||
@ -2077,7 +1866,6 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y
|
||||
float ar_x1 = ar_x0 + lr_arrow_width;
|
||||
float ar_y1 = 0.5f * (y2 + y1) + 0.9f * line_height;
|
||||
|
||||
//machine().ui().draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
|
||||
mui.draw_outlined_box(container, x1, y1, x2, y2, rgb_t(0xEF, 0x12, 0x47, 0x7B));
|
||||
|
||||
if (mouse_hit && x1 <= mouse_x && x2 > mouse_x && y1 <= mouse_y && y2 > mouse_y)
|
||||
@ -2100,7 +1888,6 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y
|
||||
float ar_x1 = ar_x0 + lr_arrow_width;
|
||||
float ar_y1 = 0.5f * (y2 + y1) + 0.9f * line_height;
|
||||
|
||||
//machine().ui().draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
|
||||
mui.draw_outlined_box(container, x1, y1, x2, y2, rgb_t(0xEF, 0x12, 0x47, 0x7B));
|
||||
|
||||
if (mouse_hit && x1 <= mouse_x && x2 > mouse_x && y1 <= mouse_y && y2 > mouse_y)
|
||||
@ -2396,6 +2183,10 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// draw right panel
|
||||
//-------------------------------------------------
|
||||
|
||||
void ui_menu_select_game::draw_right_panel(void *selectedref, float origx1, float origy1, float origx2, float origy2)
|
||||
{
|
||||
ui_manager &mui = machine().ui();
|
||||
|
@ -37,19 +37,12 @@ public:
|
||||
virtual void draw_right_panel(void *selectedref, float origx1, float origy1, float origx2, float origy2) override;
|
||||
|
||||
private:
|
||||
struct cache_info
|
||||
{
|
||||
UINT8 b_screen, b_stereo, b_samples, b_chd;
|
||||
};
|
||||
|
||||
std::vector<cache_info> driver_cache;
|
||||
|
||||
enum { VISIBLE_GAMES_IN_SEARCH = 200 };
|
||||
char m_search[40];
|
||||
int m_prev_selected;
|
||||
int m_isabios, m_issbios, m_isarcades, m_issystems;
|
||||
static int m_isabios;
|
||||
|
||||
std::vector<const game_driver *> m_sortedlist;
|
||||
static std::vector<const game_driver *> m_sortedlist;
|
||||
std::vector<const game_driver *> m_availsortedlist;
|
||||
std::vector<const game_driver *> m_unavailsortedlist;
|
||||
std::vector<const game_driver *> m_displaylist;
|
||||
@ -62,12 +55,10 @@ private:
|
||||
void build_category();
|
||||
void build_available_list();
|
||||
void build_list(std::vector<const game_driver *> &vec, const char *filter_text = nullptr, int filter = 0, bool bioscheck = false);
|
||||
void build_from_cache(std::vector<const game_driver *> &vec, int screens = 0, int filter = 0, bool bioscheck = false);
|
||||
|
||||
bool no_active_search();
|
||||
void populate_search();
|
||||
void load_cache_info();
|
||||
void save_cache_info();
|
||||
void init_sorted_list();
|
||||
bool load_available_machines();
|
||||
void load_custom_filters();
|
||||
|
||||
|
@ -27,8 +27,7 @@ std::vector<std::string> c_mnfct::ui;
|
||||
UINT16 main_filters::actual = 0;
|
||||
const char *main_filters::text[] = { "All", "Available", "Unavailable", "Working", "Not Mechanical", "Category", "Favorites", "BIOS",
|
||||
"Originals", "Clones", "Not Working", "Mechanical", "Manufacturers", "Years", "Support Save",
|
||||
"Not Support Save", "CHD", "No CHD", "Use Samples", "Not Use Samples", "Stereo", "Vertical",
|
||||
"Horizontal", "Screen Type", "Custom" };
|
||||
"Not Support Save", "CHD", "No CHD", "Vertical", "Horizontal", "Custom" };
|
||||
size_t main_filters::length = ARRAY_LENGTH(main_filters::text);
|
||||
|
||||
// Software filters
|
||||
@ -37,11 +36,6 @@ const char *sw_filters::text[] = { "All", "Available", "Unavailable", "Originals
|
||||
"Partial Supported", "Unsupported", "Region", "Device Type", "Software List", "Custom" };
|
||||
size_t sw_filters::length = ARRAY_LENGTH(sw_filters::text);
|
||||
|
||||
// Screens
|
||||
UINT16 screen_filters::actual = 0;
|
||||
const char *screen_filters::text[] = { "<none>", "Raster", "Vector", "LCD" };
|
||||
size_t screen_filters::length = ARRAY_LENGTH(screen_filters::text);
|
||||
|
||||
// Globals
|
||||
UINT8 ui_globals::rpanel = 0;
|
||||
UINT8 ui_globals::curimage_view = 0;
|
||||
|
@ -42,12 +42,8 @@ enum
|
||||
FILTER_NOSAVE,
|
||||
FILTER_CHD,
|
||||
FILTER_NOCHD,
|
||||
FILTER_SAMPLES,
|
||||
FILTER_NOSAMPLES,
|
||||
FILTER_STEREO,
|
||||
FILTER_VERTICAL,
|
||||
FILTER_HORIZONTAL,
|
||||
FILTER_SCREEN,
|
||||
FILTER_CUSTOM,
|
||||
FILTER_LAST = FILTER_CUSTOM
|
||||
};
|
||||
@ -226,8 +222,6 @@ struct name##_filters \
|
||||
|
||||
main_struct(main);
|
||||
main_struct(sw);
|
||||
main_struct(ume);
|
||||
main_struct(screen);
|
||||
|
||||
// Custom filter
|
||||
struct custfltr
|
||||
|
Loading…
Reference in New Issue
Block a user