diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2017-02-27 00:38:50 -0500 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2017-02-27 00:38:50 -0500 |
commit | 2a89da877b3f50a40336cace86285a9971b6da25 (patch) | |
tree | ebbb5ae20ebbfb8e00329d3e14ad1cbcfaf25bcd /src/mame/drivers | |
parent | 73d399e9e5b22121c9f51eaf6b10b36aeb44491b (diff) |
device_image_interface cleanups (nw)
- Replace comparisons of software_entry() or part_entry() with nullptr with loaded_through_softlist() predicate.
- Eliminate the superfluous m_software_info_ptr member. The software_entry() accessor is still provided, but now rarely used.
- Eliminate two of the three arguments to load_software_part.
- Remove some unnecessary auto-typing in ui/inifile.cpp.
Diffstat (limited to 'src/mame/drivers')
-rw-r--r-- | src/mame/drivers/aim65.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/beta.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/geniusiq.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/ibmpcjr.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/jaguar.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/megadriv.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/megatech.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/microvsn.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/n64.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/nascom1.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/patinho_feio.cpp | 3 | ||||
-rw-r--r-- | src/mame/drivers/pegasus.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/studio2.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/stv.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/timex.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/uzebox.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/x07.cpp | 2 |
17 files changed, 19 insertions, 18 deletions
diff --git a/src/mame/drivers/aim65.cpp b/src/mame/drivers/aim65.cpp index 49acc045602..c454952b037 100644 --- a/src/mame/drivers/aim65.cpp +++ b/src/mame/drivers/aim65.cpp @@ -157,7 +157,7 @@ image_init_result aim65_state::load_cart(device_image_interface &image, generic_ return image_init_result::FAIL; } - if (image.software_entry() != nullptr && image.get_software_region(slot_tag) == nullptr) + if (image.loaded_through_softlist() && image.get_software_region(slot_tag) == nullptr) { std::string errmsg = string_format( "Attempted to load file with wrong extension\nSocket '%s' only accepts files with '.%s' extension", diff --git a/src/mame/drivers/beta.cpp b/src/mame/drivers/beta.cpp index 556d671c441..a762114cb7a 100644 --- a/src/mame/drivers/beta.cpp +++ b/src/mame/drivers/beta.cpp @@ -300,7 +300,7 @@ DEVICE_IMAGE_LOAD_MEMBER( beta_state, beta_eprom ) DEVICE_IMAGE_UNLOAD_MEMBER( beta_state, beta_eprom ) { - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) image.fwrite(&m_eprom_rom[0], 0x800); } diff --git a/src/mame/drivers/geniusiq.cpp b/src/mame/drivers/geniusiq.cpp index 2f4c0f1c44d..93a626db3d6 100644 --- a/src/mame/drivers/geniusiq.cpp +++ b/src/mame/drivers/geniusiq.cpp @@ -770,7 +770,7 @@ DEVICE_IMAGE_LOAD_MEMBER(geniusiq_state,iq128_cart) m_cart_state = IQ128_ROM_CART; - if (image.software_entry() != nullptr) + if (image.loaded_through_softlist()) { const char *pcb_type = image.get_feature("pcb_type"); if (pcb_type) diff --git a/src/mame/drivers/ibmpcjr.cpp b/src/mame/drivers/ibmpcjr.cpp index b050a5ed0e0..5facc666246 100644 --- a/src/mame/drivers/ibmpcjr.cpp +++ b/src/mame/drivers/ibmpcjr.cpp @@ -441,7 +441,7 @@ image_init_result pcjr_state::load_cart(device_image_interface &image, generic_s uint32_t size = slot->common_get_size("rom"); bool imagic_hack = false; - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) { int header_size = 0; diff --git a/src/mame/drivers/jaguar.cpp b/src/mame/drivers/jaguar.cpp index 0fedfa777be..e1317a70ce2 100644 --- a/src/mame/drivers/jaguar.cpp +++ b/src/mame/drivers/jaguar.cpp @@ -2057,7 +2057,7 @@ DEVICE_IMAGE_LOAD_MEMBER( jaguar_state, jaguar_cart ) { uint32_t size, load_offset = 0; - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) { size = image.length(); diff --git a/src/mame/drivers/megadriv.cpp b/src/mame/drivers/megadriv.cpp index a3734c3240a..5a56afe0e00 100644 --- a/src/mame/drivers/megadriv.cpp +++ b/src/mame/drivers/megadriv.cpp @@ -532,7 +532,7 @@ DEVICE_IMAGE_LOAD_MEMBER( md_cons_state, _32x_cart ) uint32_t *ROM32; int i; - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) { length = image.length(); temp_copy.resize(length); diff --git a/src/mame/drivers/megatech.cpp b/src/mame/drivers/megatech.cpp index d65f00b76c1..09091c55f16 100644 --- a/src/mame/drivers/megatech.cpp +++ b/src/mame/drivers/megatech.cpp @@ -724,7 +724,7 @@ image_init_result mtech_state::load_cart(device_image_interface &image, generic_ const char *pcb_name; uint32_t size = slot->common_get_size("rom"); - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) return image_init_result::FAIL; slot->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); diff --git a/src/mame/drivers/microvsn.cpp b/src/mame/drivers/microvsn.cpp index be32aecb1a1..392f5a235ad 100644 --- a/src/mame/drivers/microvsn.cpp +++ b/src/mame/drivers/microvsn.cpp @@ -516,7 +516,7 @@ DEVICE_IMAGE_LOAD_MEMBER(microvision_state, microvsn_cart) } /* Read cartridge */ - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) { if (image.fread(rom1, file_size) != file_size) { diff --git a/src/mame/drivers/n64.cpp b/src/mame/drivers/n64.cpp index 53b0bfcf0f0..09b736400c2 100644 --- a/src/mame/drivers/n64.cpp +++ b/src/mame/drivers/n64.cpp @@ -298,7 +298,7 @@ DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart) n64_periphs *periphs = machine().device<n64_periphs>("rcp"); uint8_t *cart = memregion("user2")->base(); - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) { length = image.fread(cart, 0x4000000); } diff --git a/src/mame/drivers/nascom1.cpp b/src/mame/drivers/nascom1.cpp index 3b679ce5466..29908fb149e 100644 --- a/src/mame/drivers/nascom1.cpp +++ b/src/mame/drivers/nascom1.cpp @@ -261,7 +261,7 @@ SNAPSHOT_LOAD_MEMBER( nascom_state, nascom1 ) image_init_result nascom2_state::load_cart(device_image_interface &image, generic_slot_device *slot, int slot_id) { // loading directly from file - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) { if (slot->length() > 0x1000) { diff --git a/src/mame/drivers/patinho_feio.cpp b/src/mame/drivers/patinho_feio.cpp index 52b0b67c17d..cd22a4a1853 100644 --- a/src/mame/drivers/patinho_feio.cpp +++ b/src/mame/drivers/patinho_feio.cpp @@ -185,7 +185,8 @@ void patinho_feio_state::load_raw_data(const char* name, unsigned int start_addr DEVICE_IMAGE_LOAD_MEMBER( patinho_feio_state, patinho_tape ) { - if (image.software_entry() != nullptr){ + if (image.loaded_through_softlist()) + { paper_tape_length = image.get_software_region_length("rom"); paper_tape_data = image.get_software_region("rom"); paper_tape_address = 0; diff --git a/src/mame/drivers/pegasus.cpp b/src/mame/drivers/pegasus.cpp index 0be3df3f145..f509c095e46 100644 --- a/src/mame/drivers/pegasus.cpp +++ b/src/mame/drivers/pegasus.cpp @@ -421,7 +421,7 @@ image_init_result pegasus_state::load_cart(device_image_interface &image, generi return image_init_result::FAIL; } - if (image.software_entry() != nullptr && size == 0) + if (image.loaded_through_softlist() && size == 0) { // we might be loading a cart compatible with all sockets! // so try to get region "rom" diff --git a/src/mame/drivers/studio2.cpp b/src/mame/drivers/studio2.cpp index 054ab581824..267a0679f12 100644 --- a/src/mame/drivers/studio2.cpp +++ b/src/mame/drivers/studio2.cpp @@ -533,7 +533,7 @@ DEVICE_IMAGE_LOAD_MEMBER( studio2_state, studio2_cart_load ) // always alloc 3K, even if range $400-$600 is not read by the system (RAM is present there) m_cart->rom_alloc(0xc00, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) { if (image.is_filetype("st2")) { diff --git a/src/mame/drivers/stv.cpp b/src/mame/drivers/stv.cpp index cf55a96bf4a..212e6cec3e8 100644 --- a/src/mame/drivers/stv.cpp +++ b/src/mame/drivers/stv.cpp @@ -1130,7 +1130,7 @@ image_init_result stv_state::load_cart(device_image_interface &image, generic_sl uint8_t *ROM; uint32_t size = slot->common_get_size("rom"); - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) return image_init_result::FAIL; slot->rom_alloc(size, GENERIC_ROM32_WIDTH, ENDIANNESS_BIG); diff --git a/src/mame/drivers/timex.cpp b/src/mame/drivers/timex.cpp index f1a0cac7890..84cec4ee21d 100644 --- a/src/mame/drivers/timex.cpp +++ b/src/mame/drivers/timex.cpp @@ -602,7 +602,7 @@ DEVICE_IMAGE_LOAD_MEMBER( spectrum_state, timex_cart ) { uint32_t size = m_dock->common_get_size("rom"); - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) { uint8_t *DOCK; int chunks_in_file = 0; @@ -614,7 +614,7 @@ DEVICE_IMAGE_LOAD_MEMBER( spectrum_state, timex_cart ) image.seterror(IMAGE_ERROR_UNSPECIFIED, "File corrupted"); return image_init_result::FAIL; } - if (image.software_entry() != nullptr) + if (!image.loaded_through_softlist()) { image.seterror(IMAGE_ERROR_UNSPECIFIED, "Loading from softlist is not supported yet"); return image_init_result::FAIL; diff --git a/src/mame/drivers/uzebox.cpp b/src/mame/drivers/uzebox.cpp index 61b63cadd27..f857d40c529 100644 --- a/src/mame/drivers/uzebox.cpp +++ b/src/mame/drivers/uzebox.cpp @@ -247,7 +247,7 @@ DEVICE_IMAGE_LOAD_MEMBER(uzebox_state, uzebox_cart) m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); - if (image.software_entry() == nullptr) + if (!image.loaded_through_softlist()) { std::vector<uint8_t> data(size); image.fread(&data[0], size); diff --git a/src/mame/drivers/x07.cpp b/src/mame/drivers/x07.cpp index d55c9e12625..084c5c49959 100644 --- a/src/mame/drivers/x07.cpp +++ b/src/mame/drivers/x07.cpp @@ -1053,7 +1053,7 @@ DEVICE_IMAGE_LOAD_MEMBER( x07_state, x07_card ) uint32_t size = m_card->common_get_size("rom"); // check card type - if (image.software_entry() != nullptr) + if (image.loaded_through_softlist()) { const char *card_type = image.get_feature("card_type"); |