summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author npwoods <npwoods@alumni.carnegiemellon.edu>2017-04-17 05:44:46 -0400
committer Olivier Galibert <galibert@pobox.com>2017-04-17 11:44:46 +0200
commit69d9706616807af96da3ef722620f886569b1c03 (patch)
treee66c2049fcd2ba1a2259068be36bc1caadfd6e41
parent8b28b3e70bf27bb4d5039c10544da6f1832387e2 (diff)
Made a number of device_image_interface members private (#2227)
* Made a number of device_image_interface members private This also fixes a number of get_default_card_software() implementations that were accessing m_file incorrectly * Remove duplicate prototype
-rw-r--r--src/devices/bus/a7800/a78_slot.cpp4
-rw-r--r--src/devices/bus/a800/a800_slot.cpp4
-rw-r--r--src/devices/bus/c64/exp.cpp4
-rw-r--r--src/devices/bus/gameboy/gb_slot.cpp4
-rw-r--r--src/devices/bus/gba/gba_slot.cpp2
-rw-r--r--src/devices/bus/m5/slot.cpp2
-rw-r--r--src/devices/bus/msx_slot/cartridge.cpp4
-rw-r--r--src/devices/bus/nes/aladdin.cpp2
-rw-r--r--src/devices/bus/snes/snes_slot.cpp4
-rw-r--r--src/devices/bus/ti99x/gromport.cpp2
-rw-r--r--src/devices/bus/vectrex/slot.cpp2
-rw-r--r--src/devices/bus/vic10/exp.cpp4
-rw-r--r--src/devices/bus/wswan/slot.cpp2
-rw-r--r--src/devices/imagedev/chd_cd.cpp2
-rw-r--r--src/emu/diimage.h2
15 files changed, 22 insertions, 22 deletions
diff --git a/src/devices/bus/a7800/a78_slot.cpp b/src/devices/bus/a7800/a78_slot.cpp
index ef7f2e174ae..878e5c94dd4 100644
--- a/src/devices/bus/a7800/a78_slot.cpp
+++ b/src/devices/bus/a7800/a78_slot.cpp
@@ -520,7 +520,7 @@ std::string a78_cart_slot_device::get_default_card_software(get_default_card_sof
int type = A78_TYPE0, mapper;
// Load and check the header
- m_file->read(&head[0], 128);
+ hook.image_file()->read(&head[0], 128);
// let's try to auto-fix some common errors in the header
mapper = validate_header((head[53] << 8) | head[54], false);
@@ -541,7 +541,7 @@ std::string a78_cart_slot_device::get_default_card_software(get_default_card_sof
break;
case 0x0022:
case 0x0026:
- if (m_file->size() > 0x40000)
+ if (hook.image_file()->size() > 0x40000)
type = A78_MEGACART;
else
type = A78_VERSABOARD;
diff --git a/src/devices/bus/a800/a800_slot.cpp b/src/devices/bus/a800/a800_slot.cpp
index 822b2530c3e..bfe53f72041 100644
--- a/src/devices/bus/a800/a800_slot.cpp
+++ b/src/devices/bus/a800/a800_slot.cpp
@@ -394,13 +394,13 @@ std::string a800_cart_slot_device::get_default_card_software(get_default_card_so
{
const char *slot_string;
std::vector<uint8_t> head(0x10);
- uint32_t len = m_file->size();
+ uint32_t len = hook.image_file()->size();
int type = A800_8K;
// check whether there is an header, to identify the cart type
if ((len % 0x1000) == 0x10)
{
- m_file->read(&head[0], 0x10);
+ hook.image_file()->read(&head[0], 0x10);
type = identify_cart_type(&head[0]);
}
else // otherwise try to guess based on size
diff --git a/src/devices/bus/c64/exp.cpp b/src/devices/bus/c64/exp.cpp
index 990dadde076..9b774ec5d7b 100644
--- a/src/devices/bus/c64/exp.cpp
+++ b/src/devices/bus/c64/exp.cpp
@@ -154,7 +154,7 @@ image_init_result c64_expansion_slot_device::call_load()
int exrom = 1;
int game = 1;
- if (cbm_crt_read_header(*m_file, &roml_size, &romh_size, &exrom, &game))
+ if (cbm_crt_read_header(image_core_file(), &roml_size, &romh_size, &exrom, &game))
{
uint8_t *roml = nullptr;
uint8_t *romh = nullptr;
@@ -165,7 +165,7 @@ image_init_result c64_expansion_slot_device::call_load()
if (roml_size) roml = m_card->m_roml;
if (romh_size) romh = m_card->m_roml;
- cbm_crt_read_data(*m_file, roml, romh);
+ cbm_crt_read_data(image_core_file(), roml, romh);
}
m_card->m_exrom = exrom;
diff --git a/src/devices/bus/gameboy/gb_slot.cpp b/src/devices/bus/gameboy/gb_slot.cpp
index a48b0ad0735..592ab91a507 100644
--- a/src/devices/bus/gameboy/gb_slot.cpp
+++ b/src/devices/bus/gameboy/gb_slot.cpp
@@ -584,11 +584,11 @@ std::string base_gb_cart_slot_device::get_default_card_software(get_default_card
if (hook.image_file())
{
const char *slot_string;
- uint32_t len = m_file->size(), offset = 0;
+ uint32_t len = hook.image_file()->size(), offset = 0;
std::vector<uint8_t> rom(len);
int type;
- m_file->read(&rom[0], len);
+ hook.image_file()->read(&rom[0], len);
if ((len % 0x4000) == 512)
offset = 512;
diff --git a/src/devices/bus/gba/gba_slot.cpp b/src/devices/bus/gba/gba_slot.cpp
index 0cf81e51da9..9df15197487 100644
--- a/src/devices/bus/gba/gba_slot.cpp
+++ b/src/devices/bus/gba/gba_slot.cpp
@@ -424,7 +424,7 @@ std::string gba_cart_slot_device::get_default_card_software(get_default_card_sof
std::vector<uint8_t> rom(len);
int type;
- m_file->read(&rom[0], len);
+ hook.image_file()->read(&rom[0], len);
type = get_cart_type(&rom[0], len);
slot_string = gba_get_slot(type);
diff --git a/src/devices/bus/m5/slot.cpp b/src/devices/bus/m5/slot.cpp
index d4c94591fae..71f9fd2c608 100644
--- a/src/devices/bus/m5/slot.cpp
+++ b/src/devices/bus/m5/slot.cpp
@@ -155,7 +155,7 @@ image_init_result m5_cart_slot_device::call_load()
{
const char *pcb_name = get_feature("slot");
if (pcb_name) //is it ram cart?
- m_type = m5_get_pcb_id(m_full_software_name.c_str());
+ m_type = m5_get_pcb_id(full_software_name().c_str());
else
m_type=M5_STD; //standard cart(no feature line in xml)
}
diff --git a/src/devices/bus/msx_slot/cartridge.cpp b/src/devices/bus/msx_slot/cartridge.cpp
index a0625c9fed9..0feefec646c 100644
--- a/src/devices/bus/msx_slot/cartridge.cpp
+++ b/src/devices/bus/msx_slot/cartridge.cpp
@@ -276,7 +276,7 @@ std::string msx_slot_cartridge_device::get_default_card_software(get_default_car
if (hook.image_file())
{
const char *slot_string = "nomapper";
- uint32_t length = m_file->size();
+ uint32_t length = hook.image_file()->size();
std::vector<uint8_t> rom(length);
int type = NOMAPPER;
@@ -321,7 +321,7 @@ std::string msx_slot_cartridge_device::get_default_card_software(get_default_car
if (type == NOMAPPER)
{
// Not identified through hashfile, try automatic detection
- m_file->read(&rom[0], length);
+ hook.image_file()->read(&rom[0], length);
type = get_cart_type(&rom[0], length);
}
diff --git a/src/devices/bus/nes/aladdin.cpp b/src/devices/bus/nes/aladdin.cpp
index 3213b3727bc..1e30880c03f 100644
--- a/src/devices/bus/nes/aladdin.cpp
+++ b/src/devices/bus/nes/aladdin.cpp
@@ -141,7 +141,7 @@ std::string nes_aladdin_slot_device::get_default_card_software(get_default_card_
if (hook.image_file())
{
const char *slot_string = "algn";
- uint32_t len = m_file->size();
+ uint32_t len = hook.image_file()->size();
std::vector<uint8_t> rom(len);
uint8_t mapper;
diff --git a/src/devices/bus/snes/snes_slot.cpp b/src/devices/bus/snes/snes_slot.cpp
index b3f76eb22b0..1c62a1f8909 100644
--- a/src/devices/bus/snes/snes_slot.cpp
+++ b/src/devices/bus/snes/snes_slot.cpp
@@ -983,11 +983,11 @@ std::string base_sns_cart_slot_device::get_default_card_software(get_default_car
{
const char *slot_string;
uint32_t offset;
- uint32_t len = m_file->size();
+ uint32_t len = hook.image_file()->size();
std::vector<uint8_t> rom(len);
int type = 0, addon = 0;
- m_file->read(&rom[0], len);
+ hook.image_file()->read(&rom[0], len);
offset = snes_skip_header(&rom[0], len);
diff --git a/src/devices/bus/ti99x/gromport.cpp b/src/devices/bus/ti99x/gromport.cpp
index 8c258d97df8..849a0fc498d 100644
--- a/src/devices/bus/ti99x/gromport.cpp
+++ b/src/devices/bus/ti99x/gromport.cpp
@@ -1354,7 +1354,7 @@ image_init_result ti99_cartridge_device::call_load()
{
// File name is in m_basename
// return true = error
- if (TRACE_CHANGE) logerror("Loading %s in slot %s\n", m_basename.c_str());
+ if (TRACE_CHANGE) logerror("Loading %s in slot %s\n", basename());
if (loaded_through_softlist())
{
diff --git a/src/devices/bus/vectrex/slot.cpp b/src/devices/bus/vectrex/slot.cpp
index cd0d1cc2b0e..60fadce1193 100644
--- a/src/devices/bus/vectrex/slot.cpp
+++ b/src/devices/bus/vectrex/slot.cpp
@@ -199,7 +199,7 @@ std::string vectrex_cart_slot_device::get_default_card_software(get_default_card
if (hook.image_file())
{
const char *slot_string;
- uint32_t size = m_file->size();
+ uint32_t size = hook.image_file()->size();
std::vector<uint8_t> rom(size);
int type = VECTREX_STD;
diff --git a/src/devices/bus/vic10/exp.cpp b/src/devices/bus/vic10/exp.cpp
index 9a256951e7f..75237c2e4b5 100644
--- a/src/devices/bus/vic10/exp.cpp
+++ b/src/devices/bus/vic10/exp.cpp
@@ -139,7 +139,7 @@ image_init_result vic10_expansion_slot_device::call_load()
int exrom = 1;
int game = 1;
- if (cbm_crt_read_header(*m_file, &roml_size, &romh_size, &exrom, &game))
+ if (cbm_crt_read_header(image_core_file(), &roml_size, &romh_size, &exrom, &game))
{
uint8_t *roml = nullptr;
uint8_t *romh = nullptr;
@@ -150,7 +150,7 @@ image_init_result vic10_expansion_slot_device::call_load()
if (roml_size) roml = m_card->m_lorom;
if (romh_size) romh = m_card->m_lorom;
- cbm_crt_read_data(*m_file, roml, romh);
+ cbm_crt_read_data(image_core_file(), roml, romh);
}
}
}
diff --git a/src/devices/bus/wswan/slot.cpp b/src/devices/bus/wswan/slot.cpp
index 497275965ee..fd92197ddbf 100644
--- a/src/devices/bus/wswan/slot.cpp
+++ b/src/devices/bus/wswan/slot.cpp
@@ -288,7 +288,7 @@ std::string ws_cart_slot_device::get_default_card_software(get_default_card_soft
if (hook.image_file())
{
const char *slot_string;
- uint32_t size = m_file->size();
+ uint32_t size = hook.image_file()->size();
std::vector<uint8_t> rom(size);
int type;
uint32_t nvram;
diff --git a/src/devices/imagedev/chd_cd.cpp b/src/devices/imagedev/chd_cd.cpp
index d512670226e..e3a036fd0a4 100644
--- a/src/devices/imagedev/chd_cd.cpp
+++ b/src/devices/imagedev/chd_cd.cpp
@@ -107,7 +107,7 @@ image_init_result cdrom_image_device::call_load()
if (chd) {
m_cdrom_handle = cdrom_open( chd );
} else {
- m_cdrom_handle = cdrom_open(m_image_name.c_str());
+ m_cdrom_handle = cdrom_open(filename());
}
if ( ! m_cdrom_handle )
goto error;
diff --git a/src/emu/diimage.h b/src/emu/diimage.h
index 23c22479217..a148dd43e9e 100644
--- a/src/emu/diimage.h
+++ b/src/emu/diimage.h
@@ -294,6 +294,7 @@ protected:
image_error_t m_err;
std::string m_err_message;
+private:
// variables that are only non-zero when an image is mounted
util::core_file::ptr m_file;
std::unique_ptr<emu_file> m_mame_file;
@@ -307,7 +308,6 @@ protected:
const software_part *m_software_part_ptr;
std::string m_software_list_name;
-private:
static image_error_t image_error_from_file_error(osd_file::error filerr);
std::vector<u32> determine_open_plan(bool is_create);
void update_names();