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
This commit is contained in:
npwoods 2017-04-17 05:44:46 -04:00 committed by Olivier Galibert
parent 8b28b3e70b
commit 69d9706616
15 changed files with 22 additions and 22 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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)
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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);

View File

@ -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())
{

View File

@ -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;

View File

@ -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);
}
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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();