modernize rom_load_manager (nw)

This commit is contained in:
Miodrag Milanovic 2016-01-11 17:15:09 +01:00
parent f0dc809ab8
commit f21c96ce8a
63 changed files with 376 additions and 424 deletions

View File

@ -500,7 +500,7 @@ void a78_cart_slot_device::call_unload()
bool a78_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -305,7 +305,7 @@ void a800_cart_slot_device::call_unload()
bool a800_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -114,7 +114,7 @@ bool adam_expansion_slot_device::call_load()
bool adam_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return true;
}

View File

@ -212,7 +212,7 @@ bool apf_cart_slot_device::call_load()
bool apf_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -220,7 +220,7 @@ bool arcadia_cart_slot_device::call_load()
bool arcadia_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -189,7 +189,7 @@ bool astrocade_cart_slot_device::call_load()
bool astrocade_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -207,7 +207,7 @@ bool c64_expansion_slot_device::call_load()
bool c64_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return true;
}

View File

@ -145,7 +145,7 @@ bool cbm2_expansion_slot_device::call_load()
bool cbm2_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return true;
}

View File

@ -207,7 +207,7 @@ bool channelf_cart_slot_device::call_load()
bool channelf_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -354,7 +354,7 @@ bool cococart_slot_device::call_load()
bool cococart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry );
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry );
return TRUE;
}

View File

@ -102,7 +102,7 @@ bool colecovision_cartridge_slot_device::call_load()
bool colecovision_cartridge_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return true;
}

View File

@ -220,7 +220,7 @@ bool crvision_cart_slot_device::call_load()
bool crvision_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -457,7 +457,7 @@ void base_gb_cart_slot_device::setup_ram(UINT8 banks)
bool base_gb_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return true;
}

View File

@ -245,7 +245,7 @@ void gba_cart_slot_device::call_unload()
bool gba_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -169,7 +169,7 @@ void generic_slot_device::call_unload()
bool generic_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -450,7 +450,7 @@ bool intv_cart_slot_device::call_load()
bool intv_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -196,7 +196,7 @@ bool iq151cart_slot_device::call_load()
bool iq151cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry );
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry );
return TRUE;
}

View File

@ -362,7 +362,7 @@ bool kccart_slot_device::call_load()
bool kccart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry );
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry );
return TRUE;
}

View File

@ -677,7 +677,7 @@ void base_md_cart_slot_device::setup_nvram()
bool base_md_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -200,7 +200,7 @@ void msx_slot_cartridge_device::call_unload()
bool msx_slot_cartridge_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return true;
}

View File

@ -195,7 +195,7 @@ void neogeo_cart_slot_device::call_unload()
bool neogeo_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry );
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry );
return TRUE;
}

View File

@ -138,7 +138,7 @@ bool nes_aladdin_slot_device::call_load()
bool nes_aladdin_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry );
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry );
return TRUE;
}

View File

@ -139,7 +139,7 @@ bool nes_datach_slot_device::call_load()
bool nes_datach_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry );
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry );
return TRUE;
}

View File

@ -128,7 +128,7 @@ bool nes_kstudio_slot_device::call_load()
bool nes_kstudio_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry );
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry );
return TRUE;
}

View File

@ -904,7 +904,7 @@ void nes_cart_slot_device::call_unload()
bool nes_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -107,7 +107,7 @@ bool nes_ntb_slot_device::call_load()
bool nes_ntb_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry );
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry );
return TRUE;
}

View File

@ -200,7 +200,7 @@ bool o2_cart_slot_device::call_load()
bool o2_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -300,7 +300,7 @@ void pce_cart_slot_device::call_unload()
bool pce_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -147,7 +147,7 @@ bool plus4_expansion_slot_device::call_load()
bool plus4_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return true;
}

View File

@ -104,7 +104,7 @@ bool ql_rom_cartridge_slot_t::call_load()
bool ql_rom_cartridge_slot_t::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return true;
}

View File

@ -210,7 +210,7 @@ void sat_cart_slot_device::call_unload()
bool sat_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -216,7 +216,7 @@ bool scv_cart_slot_device::call_load()
bool scv_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -421,7 +421,7 @@ void sega8_cart_slot_device::call_unload()
bool sega8_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -886,7 +886,7 @@ void base_sns_cart_slot_device::setup_nvram()
bool base_sns_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry );
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry );
return TRUE;
}

View File

@ -1393,7 +1393,7 @@ void ti99_cartridge_device::set_slot(int i)
bool ti99_cartridge_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
if (TRACE_CONFIG) logerror("%s: swlist = %s, swname = %s\n", tag(), swlist.list_name(), swname);
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
m_softlist = true;
m_rpk = nullptr;
return true;

View File

@ -223,7 +223,7 @@ void vboy_cart_slot_device::call_unload()
bool vboy_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -226,7 +226,7 @@ bool vc4000_cart_slot_device::call_load()
bool vc4000_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -333,7 +333,7 @@ void vcs_cart_slot_device::call_unload()
bool vcs_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry );
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry );
return TRUE;
}

View File

@ -208,7 +208,7 @@ bool vectrex_cart_slot_device::call_load()
bool vectrex_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -172,7 +172,7 @@ bool vic10_expansion_slot_device::call_load()
bool vic10_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return true;
}

View File

@ -157,7 +157,7 @@ bool vic20_expansion_slot_device::call_load()
bool vic20_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return true;
}

View File

@ -144,7 +144,7 @@ bool videobrain_expansion_slot_device::call_load()
bool videobrain_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return true;
}

View File

@ -243,7 +243,7 @@ void ws_cart_slot_device::call_unload()
bool ws_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry);
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry);
return TRUE;
}

View File

@ -174,7 +174,7 @@ void z88cart_slot_device::call_unload()
bool z88cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
load_software_part_region(*this, swlist, swname, start_entry );
machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry );
return TRUE;
}

View File

@ -79,7 +79,7 @@ const option_guide *cdrom_image_device::create_option_guide() const
void cdrom_image_device::device_start()
{
// try to locate the CHD from a DISK_REGION
chd_file *chd = get_disk_handle( machine(), owner()->tag() );
chd_file *chd = machine().rom_load().get_disk_handle(owner()->tag() );
if( chd != nullptr )
{
m_cdrom_handle = cdrom_open( chd );
@ -115,7 +115,7 @@ bool cdrom_image_device::call_load()
chd = &m_self_chd;
}
} else {
chd = get_disk_handle(device().machine(), device().subtag("cdrom").c_str());
chd = device().machine().rom_load().get_disk_handle(device().subtag("cdrom").c_str());
}
/* open the CHD file */

View File

@ -33,7 +33,7 @@ public:
// image-level overrides
virtual bool call_load() override;
virtual void call_unload() override;
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { load_software_part_region(*this, swlist, swname, start_entry ); return TRUE; }
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); return TRUE; }
virtual iodevice_t image_type() const override { return IO_CDROM; }

View File

@ -76,7 +76,7 @@ void diablo_image_device::device_start()
m_chd = nullptr;
// try to locate the CHD from a DISK_REGION
chd_file *handle = get_disk_handle(machine(), tag());
chd_file *handle = machine().rom_load().get_disk_handle(tag());
if (handle != nullptr)
{
m_hard_disk_handle = hard_disk_open(handle);
@ -217,7 +217,7 @@ int diablo_image_device::internal_load_dsk()
/* open the CHD file */
if (software_entry() != nullptr)
{
m_chd = get_disk_handle(device().machine(), device().subtag("harddriv").c_str());
m_chd = device().machine().rom_load().get_disk_handle(device().subtag("harddriv").c_str());
}
else
{

View File

@ -33,7 +33,7 @@ public:
virtual bool call_load() override;
virtual bool call_create(int create_format, option_resolution *create_args) override;
virtual void call_unload() override;
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { load_software_part_region(*this, swlist, swname, start_entry ); return TRUE; }
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { device().machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); return TRUE; }
virtual iodevice_t image_type() const override { return IO_HARDDISK; }

View File

@ -99,7 +99,7 @@ void harddisk_image_device::device_start()
m_chd = nullptr;
// try to locate the CHD from a DISK_REGION
chd_file *handle = get_disk_handle(machine(), tag());
chd_file *handle = machine().rom_load().get_disk_handle(tag());
if (handle != nullptr)
{
m_hard_disk_handle = hard_disk_open(handle);
@ -241,7 +241,7 @@ int harddisk_image_device::internal_load_hd()
/* open the CHD file */
if (software_entry() != nullptr)
{
m_chd = get_disk_handle(device().machine(), device().subtag("harddriv").c_str());
m_chd = machine().rom_load().get_disk_handle(device().subtag("harddriv").c_str());
}
else
{

View File

@ -35,7 +35,7 @@ public:
virtual bool call_load() override;
virtual bool call_create(int create_format, option_resolution *create_args) override;
virtual void call_unload() override;
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { load_software_part_region(*this, swlist, swname, start_entry ); return TRUE; }
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); return TRUE; }
virtual iodevice_t image_type() const override { return IO_HARDDISK; }

View File

@ -170,7 +170,7 @@ void akiko_device::device_reset()
else
{
// MAME case
m_cdrom = cdrom_open(get_disk_handle(machine(), ":cdrom"));
m_cdrom = cdrom_open(machine().rom_load().get_disk_handle(":cdrom"));
m_cdrom_is_device = 0;
}

View File

@ -737,7 +737,7 @@ void laserdisc_device::init_disc()
if (!m_getdisc_callback.isnull())
m_disc = m_getdisc_callback(*this);
else
m_disc = get_disk_handle(machine(), tag());
m_disc = machine().rom_load().get_disk_handle(tag());
// set default parameters
m_width = 720;

View File

@ -1483,7 +1483,7 @@ void saturn_state::stvcd_reset( void )
else
{
// MAME case
cdrom = cdrom_open(get_disk_handle(machine(), "cdrom"));
cdrom = cdrom_open(machine().rom_load().get_disk_handle("cdrom"));
}
machine().device<cdda_device>("cdda")->set_cdrom(cdrom);
@ -2678,7 +2678,7 @@ void saturn_state::stvcd_set_tray_close( void )
else
{
// MAME case
cdrom = cdrom_open(get_disk_handle(machine(), "cdrom"));
cdrom = cdrom_open(machine().rom_load().get_disk_handle("cdrom"));
}
machine().device<cdda_device>("cdda")->set_cdrom(cdrom);

View File

@ -118,7 +118,6 @@ running_machine::running_machine(const machine_config &_config, machine_manager
: firstcpu(nullptr),
primary_screen(nullptr),
debug_flags(0),
romload_data(nullptr),
debugcpu_data(nullptr),
m_config(_config),
m_system(_config.gamedrv()),
@ -249,7 +248,7 @@ void running_machine::start()
// first load ROMs, then populate memory, and finally initialize CPUs
// these operations must proceed in this order
rom_init(*this);
m_rom_load = make_unique_clear<rom_load_manager>(*this);
m_memory.initialize();
// initialize the watchdog

View File

@ -92,10 +92,10 @@ class output_manager;
class ui_input_manager;
class crosshair_manager;
class image_manager;
class rom_load_manager;
class osd_interface;
enum class config_type;
struct romload_private;
struct debugcpu_private;
@ -177,6 +177,7 @@ public:
ui_input_manager &ui_input() const { assert(m_ui_input != nullptr); return *m_ui_input; }
crosshair_manager &crosshair() const { assert(m_crosshair != nullptr); return *m_crosshair; }
image_manager &image() const { assert(m_image != nullptr); return *m_image; }
rom_load_manager &rom_load() const { assert(m_rom_load != nullptr); return *m_rom_load; }
tilemap_manager &tilemap() const { assert(m_tilemap != nullptr); return *m_tilemap; }
debug_view_manager &debug_view() const { assert(m_debug_view != nullptr); return *m_debug_view; }
driver_device *driver_data() const { return &downcast<driver_device &>(root_device()); }
@ -248,7 +249,6 @@ public:
UINT32 debug_flags; // the current debug flags
// internal core information
romload_private * romload_data; // internal data from romload.c
debugcpu_private * debugcpu_data; // internal data from debugcpu.c
private:
@ -281,21 +281,22 @@ private:
const game_driver & m_system; // reference to the definition of the game machine
machine_manager & m_manager; // reference to machine manager system
// managers
std::unique_ptr<cheat_manager> m_cheat; // internal data from cheat.c
std::unique_ptr<render_manager> m_render; // internal data from render.c
std::unique_ptr<input_manager> m_input; // internal data from input.c
std::unique_ptr<sound_manager> m_sound; // internal data from sound.c
std::unique_ptr<video_manager> m_video; // internal data from video.c
std::unique_ptr<ui_manager> m_ui; // internal data from ui.c
std::unique_ptr<ui_input_manager> m_ui_input; // internal data from uiinput.c
std::unique_ptr<tilemap_manager> m_tilemap; // internal data from tilemap.c
std::unique_ptr<debug_view_manager> m_debug_view; // internal data from debugvw.c
std::unique_ptr<network_manager> m_network; // internal data from network.c
std::unique_ptr<bookkeeping_manager> m_bookkeeping;// internal data from bookkeeping.c
std::unique_ptr<configuration_manager> m_configuration; // internal data from config.c
std::unique_ptr<output_manager> m_output; // internal data from output.c
std::unique_ptr<crosshair_manager> m_crosshair; // internal data from crsshair.c
std::unique_ptr<image_manager> m_image; // internal data from image.c
std::unique_ptr<cheat_manager> m_cheat; // internal data from cheat.cpp
std::unique_ptr<render_manager> m_render; // internal data from render.cpp
std::unique_ptr<input_manager> m_input; // internal data from input.cpp
std::unique_ptr<sound_manager> m_sound; // internal data from sound.cpp
std::unique_ptr<video_manager> m_video; // internal data from video.cpp
std::unique_ptr<ui_manager> m_ui; // internal data from ui.cpp
std::unique_ptr<ui_input_manager> m_ui_input; // internal data from uiinput.cpp
std::unique_ptr<tilemap_manager> m_tilemap; // internal data from tilemap.cpp
std::unique_ptr<debug_view_manager> m_debug_view; // internal data from debugvw.cpp
std::unique_ptr<network_manager> m_network; // internal data from network.cpp
std::unique_ptr<bookkeeping_manager> m_bookkeeping;// internal data from bookkeeping.cpp
std::unique_ptr<configuration_manager> m_configuration; // internal data from config.cpp
std::unique_ptr<output_manager> m_output; // internal data from output.cpp
std::unique_ptr<crosshair_manager> m_crosshair; // internal data from crsshair.cpp
std::unique_ptr<image_manager> m_image; // internal data from image.cpp
std::unique_ptr<rom_load_manager> m_rom_load; // internal data from romload.cpp
// system state
machine_phase m_current_phase; // current execution phase

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@
#ifndef __ROMLOAD_H__
#define __ROMLOAD_H__
#include "chd.h"
/***************************************************************************
CONSTANTS
@ -254,32 +254,110 @@ struct rom_entry
#define DISK_IMAGE_READONLY_OPTIONAL(name,idx,hash) ROMX_LOAD(name, idx, 0, hash, DISK_READONLY | ROM_OPTIONAL)
/***************************************************************************
FUNCTION PROTOTYPES
TYPE DEFINITIONS
***************************************************************************/
// ======================> rom_load_manager
/* ----- ROM processing ----- */
class rom_load_manager
{
class open_chd
{
friend class simple_list<open_chd>;
/* load the ROMs and open the disk images associated with the given machine */
void rom_init(running_machine &machine);
public:
open_chd(const char *region)
: m_next(nullptr),
m_region(region) { }
/* return the number of warnings we generated */
int rom_load_warnings(running_machine &machine);
std::string& software_load_warnings_message(running_machine &machine);
open_chd *next() const { return m_next; }
const char *region() const { return m_region.c_str(); }
chd_file &chd() { return m_diffchd.opened() ? m_diffchd : m_origchd; }
chd_file &orig_chd() { return m_origchd; }
chd_file &diff_chd() { return m_diffchd; }
private:
open_chd * m_next; /* pointer to next in the list */
std::string m_region; /* disk region we came from */
chd_file m_origchd; /* handle to the original CHD */
chd_file m_diffchd; /* handle to the diff CHD */
};
public:
// construction/destruction
rom_load_manager(running_machine &machine);
// getters
running_machine &machine() const { return m_machine; }
/* return the number of warnings we generated */
int warnings() const { return m_warnings; }
std::string& software_load_warnings_message() { return m_softwarningstring; }
/* return the number of BAD_DUMP/NO_DUMP warnings we generated */
int knownbad() const { return m_knownbad; }
/* ----- disk handling ----- */
/* return a pointer to the CHD file associated with the given region */
chd_file *get_disk_handle(const char *region);
/* set a pointer to the CHD file associated with the given region */
int set_disk_handle(const char *region, const char *fullpath);
void load_software_part_region(device_t &device, software_list_device &swlist, const char *swname, const rom_entry *start_region);
private:
void determine_bios_rom(device_t *device, const char *specbios);
void count_roms();
void fill_random(UINT8 *base, UINT32 length);
void handle_missing_file(const rom_entry *romp, std::string tried_file_names, chd_error chderr);
void dump_wrong_and_correct_checksums(const hash_collection &hashes, const hash_collection &acthashes);
void verify_length_and_hash(const char *name, UINT32 explength, const hash_collection &hashes);
void display_loading_rom_message(const char *name, bool from_list);
void display_rom_load_results(bool from_list);
void region_post_process(const char *rgntag, bool invert);
int open_rom_file(const char *regiontag, const rom_entry *romp, std::string &tried_file_names, bool from_list);
int rom_fread(UINT8 *buffer, int length, const rom_entry *parent_region);
int read_rom_data(const rom_entry *parent_region, const rom_entry *romp);
void fill_rom_data(const rom_entry *romp);
void copy_rom_data(const rom_entry *romp);
void process_rom_entries(const char *regiontag, const rom_entry *parent_region, const rom_entry *romp, device_t *device, bool from_list);
chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd_file &source, chd_file &diff_chd);
void process_disk_entries(const char *regiontag, const rom_entry *parent_region, const rom_entry *romp, const char *locationtag);
void normalize_flags_for_device(running_machine &machine, const char *rgntag, UINT8 &width, endianness_t &endian);
void process_region_list();
// internal state
running_machine & m_machine; // reference to our machine
int m_warnings; /* warning count during processing */
int m_knownbad; /* BAD_DUMP/NO_DUMP count during processing */
int m_errors; /* error count during processing */
int m_romsloaded; /* current ROMs loaded count */
int m_romstotal; /* total number of ROMs to read */
UINT32 m_romsloadedsize; /* total size of ROMs loaded so far */
UINT32 m_romstotalsize; /* total size of ROMs to read */
emu_file * m_file; /* current file */
simple_list<open_chd> m_chd_list; /* disks */
memory_region * m_region; /* info about current region */
std::string m_errorstring; /* error string */
std::string m_softwarningstring; /* software warning string */
};
/* return the number of BAD_DUMP/NO_DUMP warnings we generated */
int rom_load_knownbad(running_machine &machine);
/* ----- Helpers ----- */
file_error common_process_file(emu_options &options, const char *location, const char *ext, const rom_entry *romp, emu_file **image_file);
file_error common_process_file(emu_options &options, const char *location, bool has_crc, UINT32 crc, const rom_entry *romp, emu_file **image_file);
/* ----- ROM iteration ----- */
/* return pointer to the first ROM region within a source */
const rom_entry *rom_first_region(const device_t &device);
@ -311,17 +389,7 @@ std::string rom_parameter_name(const device_t &device, const rom_entry *romp);
std::string rom_parameter_value(const rom_entry *romp);
/* ----- disk handling ----- */
/* open a disk image, searching up the parent and loading by checksum */
int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_entry *romp, chd_file &image_chd, const char *locationtag);
/* return a pointer to the CHD file associated with the given region */
chd_file *get_disk_handle(running_machine &machine, const char *region);
/* set a pointer to the CHD file associated with the given region */
int set_disk_handle(running_machine &machine, const char *region, const char *fullpath);
void load_software_part_region(device_t &device, software_list_device &swlist, const char *swname, const rom_entry *start_region);
#endif /* __ROMLOAD_H__ */

View File

@ -1024,11 +1024,11 @@ std::string &ui_manager::warnings_string(std::string &str)
str.clear();
// if no warnings, nothing to return
if (rom_load_warnings(machine()) == 0 && rom_load_knownbad(machine()) == 0 && !(machine().system().flags & WARNING_FLAGS) && software_load_warnings_message(machine()).length() == 0)
if (machine().rom_load().warnings() == 0 && machine().rom_load().knownbad() == 0 && !(machine().system().flags & WARNING_FLAGS) && machine().rom_load().software_load_warnings_message().length() == 0)
return str;
// add a warning if any ROMs were loaded with warnings
if (rom_load_warnings(machine()) > 0)
if (machine().rom_load().warnings() > 0)
{
str.append("One or more ROMs/CHDs for this ");
str.append(emulator_info::get_gamenoun());
@ -1039,20 +1039,20 @@ std::string &ui_manager::warnings_string(std::string &str)
str.append("\n");
}
if (software_load_warnings_message(machine()).length()>0) {
str.append(software_load_warnings_message(machine()));
if (machine().rom_load().software_load_warnings_message().length()>0) {
str.append(machine().rom_load().software_load_warnings_message());
if (machine().system().flags & WARNING_FLAGS)
str.append("\n");
}
// if we have at least one warning flag, print the general header
if ((machine().system().flags & WARNING_FLAGS) || rom_load_knownbad(machine()) > 0)
if ((machine().system().flags & WARNING_FLAGS) || machine().rom_load().knownbad() > 0)
{
str.append("There are known problems with this ");
str.append(emulator_info::get_gamenoun());
str.append("\n\n");
// add a warning if any ROMs are flagged BAD_DUMP/NO_DUMP
if (rom_load_knownbad(machine()) > 0) {
if (machine().rom_load().knownbad() > 0) {
str.append("One or more ROMs/CHDs for this ");
str.append(emulator_info::get_gamenoun());
str.append(" have not been correctly dumped.\n");

View File

@ -499,7 +499,7 @@ WRITE64_MEMBER(konamim2_state::reset_w)
void konamim2_state::cde_init()
{
cdrom_file *cdfile = cdrom_open(get_disk_handle(machine(), ":cdrom"));
cdrom_file *cdfile = cdrom_open(machine().rom_load().get_disk_handle(":cdrom"));
const cdrom_toc *toc = cdrom_get_toc(cdfile);

View File

@ -725,8 +725,8 @@ void ksys573_state::driver_start()
m_atapi_timer = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( ksys573_state::atapi_xfer_end ),this ) );
m_atapi_timer->adjust( attotime::never );
m_available_cdroms[ 0 ] = cdrom_open( get_disk_handle( machine(), ":cdrom0" ) );
m_available_cdroms[ 1 ] = cdrom_open( get_disk_handle( machine(), ":cdrom1" ) );
m_available_cdroms[ 0 ] = cdrom_open(machine().rom_load().get_disk_handle(":cdrom0"));
m_available_cdroms[ 1 ] = cdrom_open(machine().rom_load().get_disk_handle(":cdrom1"));
m_n_security_control = 0;
m_control = 0;

View File

@ -1232,7 +1232,7 @@ void cdicdic_device::device_reset()
else
{
// MAME case
m_cd = cdrom_open(get_disk_handle(machine(), ":cdrom"));
m_cd = cdrom_open(machine().rom_load().get_disk_handle(":cdrom"));
state->m_cdda->set_cdrom(m_cd);
}
}

View File

@ -290,7 +290,7 @@ WRITE16_MEMBER(gaelco2_state::gaelco2_eeprom_data_w)
READ16_MEMBER(gaelco2_state::snowboar_protection_r)
{
chd_file * table = get_disk_handle(machine(), ":decrypt");
chd_file * table = machine().rom_load().get_disk_handle(":decrypt");
UINT8 temp[1024];
table->read_hunk(snowboard_latch>>9, &temp[0]);
UINT16 data = (temp[(snowboard_latch & 0x1ff)*2]<<8) | temp[((snowboard_latch & 0x1ff)*2)+1];

View File

@ -433,7 +433,7 @@ void naomi_gdrom_board::device_start()
logerror("key is %08x%08x\n", (UINT32)((key & 0xffffffff00000000ULL)>>32), (UINT32)(key & 0x00000000ffffffffULL));
UINT8 buffer[2048];
cdrom_file *gdromfile = cdrom_open(get_disk_handle(machine(), image_tag));
cdrom_file *gdromfile = cdrom_open(machine().rom_load().get_disk_handle(image_tag));
// primary volume descriptor
// read frame 0xb06e (frame=sector+150)
// dimm board firmware starts straight from this frame