From ae5dab64d7ad7c0a6facfb5e749ff028647bc2e3 Mon Sep 17 00:00:00 2001 From: Nathan Woods Date: Thu, 21 Jul 2016 21:10:18 -0400 Subject: device_image_interface::call_softlist_load() was a virtual function where every implementation was one of two copy-and-paste jobs. This change consolidates all of these implementations, replacing that virtual function with a mere hook that chooses which technique to perform --- src/devices/bus/nes/aladdin.cpp | 6 ------ src/devices/bus/nes/aladdin.h | 2 +- src/devices/bus/nes/datach.cpp | 6 ------ src/devices/bus/nes/datach.h | 2 +- src/devices/bus/nes/karastudio.cpp | 6 ------ src/devices/bus/nes/karastudio.h | 2 +- src/devices/bus/nes/nes_slot.cpp | 10 ---------- src/devices/bus/nes/nes_slot.h | 2 +- src/devices/bus/nes/sunsoft_dcs.cpp | 6 ------ src/devices/bus/nes/sunsoft_dcs.h | 2 +- 10 files changed, 5 insertions(+), 39 deletions(-) (limited to 'src/devices/bus/nes') diff --git a/src/devices/bus/nes/aladdin.cpp b/src/devices/bus/nes/aladdin.cpp index bded198c5a7..0e30eaeb8ec 100644 --- a/src/devices/bus/nes/aladdin.cpp +++ b/src/devices/bus/nes/aladdin.cpp @@ -136,12 +136,6 @@ 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) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - std::string nes_aladdin_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) diff --git a/src/devices/bus/nes/aladdin.h b/src/devices/bus/nes/aladdin.h index 1f7800242ea..be1302edb78 100644 --- a/src/devices/bus/nes/aladdin.h +++ b/src/devices/bus/nes/aladdin.h @@ -52,7 +52,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual softlist_type get_softlist_type() const override { return softlist_type::ROM; } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/bus/nes/datach.cpp b/src/devices/bus/nes/datach.cpp index cdb41e16830..0ea144782d3 100644 --- a/src/devices/bus/nes/datach.cpp +++ b/src/devices/bus/nes/datach.cpp @@ -137,12 +137,6 @@ 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) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - std::string nes_datach_slot_device::get_default_card_software() { // any way to detect the game with X24C01? diff --git a/src/devices/bus/nes/datach.h b/src/devices/bus/nes/datach.h index e5d137357c2..cea5c098dc6 100644 --- a/src/devices/bus/nes/datach.h +++ b/src/devices/bus/nes/datach.h @@ -54,7 +54,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual softlist_type get_softlist_type() const override { return softlist_type::ROM; } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/bus/nes/karastudio.cpp b/src/devices/bus/nes/karastudio.cpp index d9d0e26a2cf..e321033d700 100644 --- a/src/devices/bus/nes/karastudio.cpp +++ b/src/devices/bus/nes/karastudio.cpp @@ -126,12 +126,6 @@ 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) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - std::string nes_kstudio_slot_device::get_default_card_software() { return software_get_default_slot("ks_exp"); diff --git a/src/devices/bus/nes/karastudio.h b/src/devices/bus/nes/karastudio.h index 3aeb96c118a..48541ac8dc2 100644 --- a/src/devices/bus/nes/karastudio.h +++ b/src/devices/bus/nes/karastudio.h @@ -51,7 +51,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual softlist_type get_softlist_type() const override { return softlist_type::ROM; } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/bus/nes/nes_slot.cpp b/src/devices/bus/nes/nes_slot.cpp index 1bcf8d6de6e..b163c9d43a2 100644 --- a/src/devices/bus/nes/nes_slot.cpp +++ b/src/devices/bus/nes/nes_slot.cpp @@ -898,16 +898,6 @@ void nes_cart_slot_device::call_unload() } -/*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool nes_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - /*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index 3d843381d85..f26aea85d78 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -346,7 +346,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; + virtual softlist_type get_softlist_type() const override { return softlist_type::ROM; } void call_load_ines(); void call_load_unif(); diff --git a/src/devices/bus/nes/sunsoft_dcs.cpp b/src/devices/bus/nes/sunsoft_dcs.cpp index 25d1a1db623..356483a2c8b 100644 --- a/src/devices/bus/nes/sunsoft_dcs.cpp +++ b/src/devices/bus/nes/sunsoft_dcs.cpp @@ -105,12 +105,6 @@ 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) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - std::string nes_ntb_slot_device::get_default_card_software() { return software_get_default_slot("ntbrom"); diff --git a/src/devices/bus/nes/sunsoft_dcs.h b/src/devices/bus/nes/sunsoft_dcs.h index 94d89736cac..6e9a0cb5422 100644 --- a/src/devices/bus/nes/sunsoft_dcs.h +++ b/src/devices/bus/nes/sunsoft_dcs.h @@ -48,7 +48,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual softlist_type get_softlist_type() const override { return softlist_type::ROM; } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } -- cgit v1.2.3-70-g09d2