Fixed issue with get_merge_name when using slot devices (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2011-11-28 10:32:11 +00:00
parent 551e2de4e3
commit 5adab03a1d
3 changed files with 9 additions and 6 deletions

View File

@ -209,7 +209,7 @@ driver_enumerator::~driver_enumerator()
// driver, allocating on demand if needed // driver, allocating on demand if needed
//------------------------------------------------- //-------------------------------------------------
machine_config &driver_enumerator::config(int index) const machine_config &driver_enumerator::config(int index, emu_options &options) const
{ {
assert(index >= 0 && index < s_driver_count); assert(index >= 0 && index < s_driver_count);
@ -225,7 +225,7 @@ machine_config &driver_enumerator::config(int index) const
} }
// allocate the config and add it to the end of the list // allocate the config and add it to the end of the list
machine_config *config = m_config[index] = global_alloc(machine_config(*s_drivers_sorted[index], m_options)); machine_config *config = m_config[index] = global_alloc(machine_config(*s_drivers_sorted[index], options));
m_config_cache.append(*global_alloc(config_entry(*config, index))); m_config_cache.append(*global_alloc(config_entry(*config, index)));
} }
return *m_config[index]; return *m_config[index];

View File

@ -170,7 +170,7 @@ public:
// current item // current item
const game_driver &driver() const { return driver_list::driver(m_current); } const game_driver &driver() const { return driver_list::driver(m_current); }
machine_config &config() const { return config(m_current); } machine_config &config() const { return config(m_current, m_options); }
int clone() { return driver_list::clone(m_current); } int clone() { return driver_list::clone(m_current); }
int non_bios_clone() { return driver_list::non_bios_clone(m_current); } int non_bios_clone() { return driver_list::non_bios_clone(m_current); }
int compatible_with() { return driver_list::compatible_with(m_current); } int compatible_with() { return driver_list::compatible_with(m_current); }
@ -180,7 +180,8 @@ public:
// any item by index // any item by index
bool included(int index) const { assert(index >= 0 && index < s_driver_count); return m_included[index]; } bool included(int index) const { assert(index >= 0 && index < s_driver_count); return m_included[index]; }
bool excluded(int index) const { assert(index >= 0 && index < s_driver_count); return !m_included[index]; } bool excluded(int index) const { assert(index >= 0 && index < s_driver_count); return !m_included[index]; }
machine_config &config(int index) const; machine_config &config(int index) const { return config(index,m_options); }
machine_config &config(int index, emu_options &options) const;
void include(int index) { assert(index >= 0 && index < s_driver_count); if (!m_included[index]) { m_included[index] = true; m_filtered_count++; } } void include(int index) { assert(index >= 0 && index < s_driver_count); if (!m_included[index]) { m_included[index] = true; m_filtered_count++; } }
void exclude(int index) { assert(index >= 0 && index < s_driver_count); if (m_included[index]) { m_included[index] = false; m_filtered_count--; } } void exclude(int index) { assert(index >= 0 && index < s_driver_count); if (m_included[index]) { m_included[index] = false; m_filtered_count--; } }
using driver_list::driver; using driver_list::driver;

View File

@ -38,6 +38,7 @@
***************************************************************************/ ***************************************************************************/
#include "emu.h" #include "emu.h"
#include "emuopts.h"
#include "machine/ram.h" #include "machine/ram.h"
#include "sound/samples.h" #include "sound/samples.h"
#include "info.h" #include "info.h"
@ -1275,12 +1276,13 @@ void info_xml_creator::output_ramoptions()
const char *info_xml_creator::get_merge_name(const hash_collection &romhashes) const char *info_xml_creator::get_merge_name(const hash_collection &romhashes)
{ {
const char *merge_name = NULL; const char *merge_name = NULL;
emu_options lookup_options(m_drivlist.options());
lookup_options.remove_device_options();
// walk the parent chain // walk the parent chain
for (int clone_of = m_drivlist.find(m_drivlist.driver().parent); clone_of != -1; clone_of = m_drivlist.find(m_drivlist.driver(clone_of).parent)) for (int clone_of = m_drivlist.find(m_drivlist.driver().parent); clone_of != -1; clone_of = m_drivlist.find(m_drivlist.driver(clone_of).parent))
// look in the parent's ROMs // look in the parent's ROMs
for (const rom_source *psource = rom_first_source(m_drivlist.config(clone_of)); psource != NULL; psource = rom_next_source(*psource)) for (const rom_source *psource = rom_first_source(m_drivlist.config(clone_of,lookup_options)); psource != NULL; psource = rom_next_source(*psource))
for (const rom_entry *pregion = rom_first_region(*psource); pregion != NULL; pregion = rom_next_region(pregion)) for (const rom_entry *pregion = rom_first_region(*psource); pregion != NULL; pregion = rom_next_region(pregion))
for (const rom_entry *prom = rom_first_file(pregion); prom != NULL; prom = rom_next_file(prom)) for (const rom_entry *prom = rom_first_file(pregion); prom != NULL; prom = rom_next_file(prom))
{ {