mirror of
https://github.com/holub/mame
synced 2025-05-01 04:06:58 +03:00
fixed multisession crash when the new cart needed a dynamic buffer/array
larger than the original one. this got introduced when converting from auto_alloc_array to dynamic buffers, because such buffers are not made NULL at reset, but got unnoticed/unreported up to now. many thanks to Trebor for catching it! nw.
This commit is contained in:
parent
af251eb276
commit
69fdbd5872
@ -62,8 +62,6 @@ device_a78_cart_interface::~device_a78_cart_interface ()
|
|||||||
|
|
||||||
void device_a78_cart_interface::rom_alloc(UINT32 size)
|
void device_a78_cart_interface::rom_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_rom == NULL)
|
|
||||||
{
|
|
||||||
m_rom.resize(size);
|
m_rom.resize(size);
|
||||||
|
|
||||||
// setup other helpers
|
// setup other helpers
|
||||||
@ -76,7 +74,6 @@ void device_a78_cart_interface::rom_alloc(UINT32 size)
|
|||||||
// so we store the starting point of data to simplify
|
// so we store the starting point of data to simplify
|
||||||
// the access handling
|
// the access handling
|
||||||
m_base_rom = 0x10000 - size;
|
m_base_rom = 0x10000 - size;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -85,11 +82,8 @@ void device_a78_cart_interface::rom_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_a78_cart_interface::ram_alloc(UINT32 size)
|
void device_a78_cart_interface::ram_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_ram == NULL)
|
|
||||||
{
|
|
||||||
m_ram.resize(size);
|
m_ram.resize(size);
|
||||||
device().save_item(NAME(m_ram));
|
device().save_item(NAME(m_ram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -99,11 +93,8 @@ void device_a78_cart_interface::ram_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_a78_cart_interface::nvram_alloc(UINT32 size)
|
void device_a78_cart_interface::nvram_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_nvram == NULL)
|
|
||||||
{
|
|
||||||
m_nvram.resize(size);
|
m_nvram.resize(size);
|
||||||
device().save_item(NAME(m_nvram));
|
device().save_item(NAME(m_nvram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -120,7 +111,6 @@ a78_cart_slot_device::a78_cart_slot_device(const machine_config &mconfig, const
|
|||||||
device_image_interface(mconfig, *this),
|
device_image_interface(mconfig, *this),
|
||||||
device_slot_interface(mconfig, *this)
|
device_slot_interface(mconfig, *this)
|
||||||
{
|
{
|
||||||
m_type = A78_NOCART;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -321,8 +311,7 @@ static const a78_slot slot_list[] =
|
|||||||
{ A78_TYPE1_POK450, "a78_p450_t1" },
|
{ A78_TYPE1_POK450, "a78_p450_t1" },
|
||||||
{ A78_TYPE6_POK450, "a78_p450_t6" },
|
{ A78_TYPE6_POK450, "a78_p450_t6" },
|
||||||
{ A78_TYPEA_POK450, "a78_p450_ta" },
|
{ A78_TYPEA_POK450, "a78_p450_ta" },
|
||||||
{ A78_VERSA_POK450, "a78_p450_vb" },
|
{ A78_VERSA_POK450, "a78_p450_vb" }
|
||||||
{ A78_NOCART, "empty" }, // the code should never get here, of course...
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int a78_get_pcb_id(const char *slot)
|
static int a78_get_pcb_id(const char *slot)
|
||||||
@ -508,7 +497,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)
|
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 );
|
load_software_part_region(*this, swlist, swname, start_entry);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,7 @@ enum
|
|||||||
A78_TYPE1_POK450 = 0x21,
|
A78_TYPE1_POK450 = 0x21,
|
||||||
A78_TYPE6_POK450 = 0x24,
|
A78_TYPE6_POK450 = 0x24,
|
||||||
A78_TYPEA_POK450 = 0x25,
|
A78_TYPEA_POK450 = 0x25,
|
||||||
A78_VERSA_POK450 = 0x30,
|
A78_VERSA_POK450 = 0x30
|
||||||
A78_NOCART
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,13 +59,10 @@ device_a800_cart_interface::~device_a800_cart_interface ()
|
|||||||
|
|
||||||
void device_a800_cart_interface::rom_alloc(UINT32 size)
|
void device_a800_cart_interface::rom_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_rom == NULL)
|
|
||||||
{
|
|
||||||
m_rom.resize(size);
|
m_rom.resize(size);
|
||||||
|
|
||||||
// setup other helpers
|
// setup other helpers
|
||||||
m_bank_mask = (size / 0x2000) - 1; // code for XEGS carts makes use of this to simplify banking
|
m_bank_mask = (size / 0x2000) - 1; // code for XEGS carts makes use of this to simplify banking
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -74,11 +71,8 @@ void device_a800_cart_interface::rom_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_a800_cart_interface::ram_alloc(UINT32 size)
|
void device_a800_cart_interface::ram_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_ram == NULL)
|
|
||||||
{
|
|
||||||
m_ram.resize(size);
|
m_ram.resize(size);
|
||||||
device().save_item(NAME(m_ram));
|
device().save_item(NAME(m_ram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -88,11 +82,8 @@ void device_a800_cart_interface::ram_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_a800_cart_interface::nvram_alloc(UINT32 size)
|
void device_a800_cart_interface::nvram_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_nvram == NULL)
|
|
||||||
{
|
|
||||||
m_nvram.resize(size);
|
m_nvram.resize(size);
|
||||||
device().save_item(NAME(m_nvram));
|
device().save_item(NAME(m_nvram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -109,7 +100,6 @@ a800_cart_slot_device::a800_cart_slot_device(const machine_config &mconfig, devi
|
|||||||
device_image_interface(mconfig, *this),
|
device_image_interface(mconfig, *this),
|
||||||
device_slot_interface(mconfig, *this)
|
device_slot_interface(mconfig, *this)
|
||||||
{
|
{
|
||||||
m_type = A800_NOCART;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a800_cart_slot_device::a800_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
a800_cart_slot_device::a800_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||||
@ -117,7 +107,6 @@ a800_cart_slot_device::a800_cart_slot_device(const machine_config &mconfig, cons
|
|||||||
device_image_interface(mconfig, *this),
|
device_image_interface(mconfig, *this),
|
||||||
device_slot_interface(mconfig, *this)
|
device_slot_interface(mconfig, *this)
|
||||||
{
|
{
|
||||||
m_type = A800_NOCART;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -215,8 +204,7 @@ static const a800_slot slot_list[] =
|
|||||||
{ A5200_32K, "a5200" },
|
{ A5200_32K, "a5200" },
|
||||||
{ A5200_16K_2CHIPS, "a5200_2chips" },
|
{ A5200_16K_2CHIPS, "a5200_2chips" },
|
||||||
{ A5200_32K, "a5200" },
|
{ A5200_32K, "a5200" },
|
||||||
{ A5200_BBSB, "a5200_bbsb" },
|
{ A5200_BBSB, "a5200_bbsb" }
|
||||||
{ A800_NOCART, "empty" },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -314,7 +302,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)
|
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 );
|
load_software_part_region(*this, swlist, swname, start_entry);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,8 +37,7 @@ enum
|
|||||||
A5200_16K,
|
A5200_16K,
|
||||||
A5200_32K,
|
A5200_32K,
|
||||||
A5200_16K_2CHIPS,
|
A5200_16K_2CHIPS,
|
||||||
A5200_BBSB,
|
A5200_BBSB
|
||||||
A800_NOCART
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,7 +57,6 @@ device_gb_cart_interface::~device_gb_cart_interface()
|
|||||||
|
|
||||||
void device_gb_cart_interface::rom_alloc(UINT32 size)
|
void device_gb_cart_interface::rom_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_rom == NULL)
|
|
||||||
m_rom.resize(size);
|
m_rom.resize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,11 +67,8 @@ void device_gb_cart_interface::rom_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_gb_cart_interface::ram_alloc(UINT32 size)
|
void device_gb_cart_interface::ram_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_ram == NULL)
|
|
||||||
{
|
|
||||||
m_ram.resize(size);
|
m_ram.resize(size);
|
||||||
device().save_item(NAME(m_ram));
|
device().save_item(NAME(m_ram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -447,7 +443,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)
|
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 );
|
load_software_part_region(*this, swlist, swname, start_entry);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,11 +46,8 @@ device_gba_cart_interface::~device_gba_cart_interface()
|
|||||||
|
|
||||||
void device_gba_cart_interface::nvram_alloc(UINT32 size)
|
void device_gba_cart_interface::nvram_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_nvram == NULL)
|
|
||||||
{
|
|
||||||
m_nvram.resize(size/sizeof(UINT32));
|
m_nvram.resize(size/sizeof(UINT32));
|
||||||
device().save_item(NAME(m_nvram));
|
device().save_item(NAME(m_nvram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -239,7 +236,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)
|
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 );
|
load_software_part_region(*this, swlist, swname, start_entry);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,11 +98,8 @@ void device_md_cart_interface::rom_alloc(size_t size, const char *tag)
|
|||||||
|
|
||||||
void device_md_cart_interface::nvram_alloc(size_t size)
|
void device_md_cart_interface::nvram_alloc(size_t size)
|
||||||
{
|
{
|
||||||
if (m_nvram == NULL)
|
|
||||||
{
|
|
||||||
m_nvram.resize(size/sizeof(UINT16));
|
m_nvram.resize(size/sizeof(UINT16));
|
||||||
device().save_item(NAME(m_nvram));
|
device().save_item(NAME(m_nvram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -684,7 +681,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)
|
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 );
|
load_software_part_region(*this, swlist, swname, start_entry);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,13 +78,6 @@ enum
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// ======================> md_cart_interface
|
|
||||||
|
|
||||||
struct md_cart_interface
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// ======================> device_md_cart_interface
|
// ======================> device_md_cart_interface
|
||||||
|
|
||||||
class device_md_cart_interface : public device_slot_card_interface
|
class device_md_cart_interface : public device_slot_card_interface
|
||||||
@ -138,7 +131,6 @@ public:
|
|||||||
// ======================> base_md_cart_slot_device
|
// ======================> base_md_cart_slot_device
|
||||||
|
|
||||||
class base_md_cart_slot_device : public device_t,
|
class base_md_cart_slot_device : public device_t,
|
||||||
public md_cart_interface,
|
|
||||||
public device_image_interface,
|
public device_image_interface,
|
||||||
public device_slot_interface
|
public device_slot_interface
|
||||||
{
|
{
|
||||||
|
@ -142,8 +142,6 @@ device_nes_cart_interface::~device_nes_cart_interface()
|
|||||||
|
|
||||||
void device_nes_cart_interface::prg_alloc(size_t size)
|
void device_nes_cart_interface::prg_alloc(size_t size)
|
||||||
{
|
{
|
||||||
if (m_prg == NULL)
|
|
||||||
{
|
|
||||||
m_prg.resize(size);
|
m_prg.resize(size);
|
||||||
m_prg_chunks = size / 0x4000;
|
m_prg_chunks = size / 0x4000;
|
||||||
if (size % 0x2000)
|
if (size % 0x2000)
|
||||||
@ -195,7 +193,7 @@ void device_nes_cart_interface::prg_alloc(size_t size)
|
|||||||
j += repeat_banks;
|
j += repeat_banks;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check bank map!
|
// check bank map!
|
||||||
// for (int i = 0; i < mapsize; i++)
|
// for (int i = 0; i < mapsize; i++)
|
||||||
// {
|
// {
|
||||||
// printf("bank %3d = %3d\t", i, m_prg_bank_map[i]);
|
// printf("bank %3d = %3d\t", i, m_prg_bank_map[i]);
|
||||||
@ -203,36 +201,27 @@ void device_nes_cart_interface::prg_alloc(size_t size)
|
|||||||
// printf("\n");
|
// printf("\n");
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void device_nes_cart_interface::prgram_alloc(size_t size)
|
void device_nes_cart_interface::prgram_alloc(size_t size)
|
||||||
{
|
{
|
||||||
if (m_prgram == NULL)
|
|
||||||
m_prgram.resize(size);
|
m_prgram.resize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void device_nes_cart_interface::vrom_alloc(size_t size)
|
void device_nes_cart_interface::vrom_alloc(size_t size)
|
||||||
{
|
{
|
||||||
if (m_vrom == NULL)
|
|
||||||
{
|
|
||||||
m_vrom.resize(size);
|
m_vrom.resize(size);
|
||||||
m_vrom_chunks = size / 0x2000;
|
m_vrom_chunks = size / 0x2000;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void device_nes_cart_interface::vram_alloc(size_t size)
|
void device_nes_cart_interface::vram_alloc(size_t size)
|
||||||
{
|
{
|
||||||
if (m_vram == NULL)
|
|
||||||
{
|
|
||||||
m_vram.resize(size);
|
m_vram.resize(size);
|
||||||
m_vram_chunks = size / 0x2000;
|
m_vram_chunks = size / 0x2000;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void device_nes_cart_interface::battery_alloc(size_t size)
|
void device_nes_cart_interface::battery_alloc(size_t size)
|
||||||
{
|
{
|
||||||
if (m_battery == NULL)
|
|
||||||
m_battery.resize(size);
|
m_battery.resize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -905,7 +894,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)
|
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 );
|
load_software_part_region(*this, swlist, swname, start_entry);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ device_pce_cart_interface::~device_pce_cart_interface()
|
|||||||
|
|
||||||
void device_pce_cart_interface::rom_alloc(UINT32 size)
|
void device_pce_cart_interface::rom_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_rom == NULL)
|
|
||||||
m_rom.resize(size);
|
m_rom.resize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,11 +54,8 @@ void device_pce_cart_interface::rom_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_pce_cart_interface::ram_alloc(UINT32 size)
|
void device_pce_cart_interface::ram_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_ram == NULL)
|
|
||||||
{
|
|
||||||
m_ram.resize(size);
|
m_ram.resize(size);
|
||||||
device().save_item(NAME(m_ram));
|
device().save_item(NAME(m_ram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -69,8 +65,6 @@ void device_pce_cart_interface::ram_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_pce_cart_interface::rom_map_setup(UINT32 size)
|
void device_pce_cart_interface::rom_map_setup(UINT32 size)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
if (size == 0x60000)
|
if (size == 0x60000)
|
||||||
{
|
{
|
||||||
// HuCard 384K are mapped with mirrored pieces
|
// HuCard 384K are mapped with mirrored pieces
|
||||||
@ -85,6 +79,8 @@ void device_pce_cart_interface::rom_map_setup(UINT32 size)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
// setup the rom_bank_map array to faster ROM read
|
// setup the rom_bank_map array to faster ROM read
|
||||||
for (i = 0; i < size / 0x20000 && i < 8; i++)
|
for (i = 0; i < size / 0x20000 && i < 8; i++)
|
||||||
rom_bank_map[i] = i;
|
rom_bank_map[i] = i;
|
||||||
@ -281,7 +277,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)
|
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 );
|
load_software_part_region(*this, swlist, swname, start_entry);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,6 @@ device_sat_cart_interface::~device_sat_cart_interface()
|
|||||||
|
|
||||||
void device_sat_cart_interface::rom_alloc(UINT32 size)
|
void device_sat_cart_interface::rom_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_rom == NULL)
|
|
||||||
m_rom.resize(size/sizeof(UINT32));
|
m_rom.resize(size/sizeof(UINT32));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,7 +163,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)
|
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 );
|
load_software_part_region(*this, swlist, swname, start_entry);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,14 +72,11 @@ device_sega8_cart_interface::~device_sega8_cart_interface()
|
|||||||
|
|
||||||
void device_sega8_cart_interface::rom_alloc(UINT32 size)
|
void device_sega8_cart_interface::rom_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_rom == NULL)
|
|
||||||
{
|
|
||||||
m_rom.resize(size);
|
m_rom.resize(size);
|
||||||
m_rom_page_count = size / 0x4000;
|
m_rom_page_count = size / 0x4000;
|
||||||
if (!m_rom_page_count)
|
if (!m_rom_page_count)
|
||||||
m_rom_page_count = 1; // we compute rom pages through (XXX % m_rom_page_count)!
|
m_rom_page_count = 1; // we compute rom pages through (XXX % m_rom_page_count)!
|
||||||
late_bank_setup();
|
late_bank_setup();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -89,11 +86,8 @@ void device_sega8_cart_interface::rom_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_sega8_cart_interface::ram_alloc(UINT32 size)
|
void device_sega8_cart_interface::ram_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_ram == NULL)
|
|
||||||
{
|
|
||||||
m_ram.resize(size);
|
m_ram.resize(size);
|
||||||
device().save_item(NAME(m_ram));
|
device().save_item(NAME(m_ram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@ device_sns_cart_interface::~device_sns_cart_interface()
|
|||||||
|
|
||||||
void device_sns_cart_interface::rom_alloc(UINT32 size)
|
void device_sns_cart_interface::rom_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_rom == NULL)
|
|
||||||
m_rom.resize(size);
|
m_rom.resize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,11 +96,8 @@ void device_sns_cart_interface::rom_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_sns_cart_interface::nvram_alloc(UINT32 size)
|
void device_sns_cart_interface::nvram_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_nvram == NULL)
|
|
||||||
{
|
|
||||||
m_nvram.resize(size);
|
m_nvram.resize(size);
|
||||||
device().save_item(NAME(m_nvram));
|
device().save_item(NAME(m_nvram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -114,11 +110,8 @@ void device_sns_cart_interface::nvram_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_sns_cart_interface::rtc_ram_alloc(UINT32 size)
|
void device_sns_cart_interface::rtc_ram_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_rtc_ram == NULL)
|
|
||||||
{
|
|
||||||
m_rtc_ram.resize(size);
|
m_rtc_ram.resize(size);
|
||||||
device().save_item(NAME(m_rtc_ram));
|
device().save_item(NAME(m_rtc_ram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -129,7 +122,6 @@ void device_sns_cart_interface::rtc_ram_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_sns_cart_interface::addon_bios_alloc(UINT32 size)
|
void device_sns_cart_interface::addon_bios_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_bios == NULL)
|
|
||||||
m_bios.resize(size);
|
m_bios.resize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,6 @@ device_vcs_cart_interface::~device_vcs_cart_interface()
|
|||||||
|
|
||||||
void device_vcs_cart_interface::rom_alloc(UINT32 size)
|
void device_vcs_cart_interface::rom_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_rom == NULL)
|
|
||||||
m_rom.resize(size);
|
m_rom.resize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,11 +56,8 @@ void device_vcs_cart_interface::rom_alloc(UINT32 size)
|
|||||||
|
|
||||||
void device_vcs_cart_interface::ram_alloc(UINT32 size)
|
void device_vcs_cart_interface::ram_alloc(UINT32 size)
|
||||||
{
|
{
|
||||||
if (m_ram == NULL)
|
|
||||||
{
|
|
||||||
m_ram.resize(size);
|
m_ram.resize(size);
|
||||||
device().save_item(NAME(m_ram));
|
device().save_item(NAME(m_ram));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1315,7 +1315,7 @@ void a7800_state::machine_start()
|
|||||||
save_item(NAME(m_maria_flag));
|
save_item(NAME(m_maria_flag));
|
||||||
|
|
||||||
// install additional handlers, if needed
|
// install additional handlers, if needed
|
||||||
switch (m_cartslot->get_cart_type())
|
switch (m_cartslot->exists() && m_cartslot->get_cart_type())
|
||||||
{
|
{
|
||||||
case A78_HSC:
|
case A78_HSC:
|
||||||
// ROM+NVRAM accesses for HiScore
|
// ROM+NVRAM accesses for HiScore
|
||||||
|
@ -1735,7 +1735,7 @@ READ8_MEMBER(a400_state::read_d5xx)
|
|||||||
|
|
||||||
WRITE8_MEMBER(a400_state::disable_cart)
|
WRITE8_MEMBER(a400_state::disable_cart)
|
||||||
{
|
{
|
||||||
switch (m_cartslot->get_cart_type())
|
switch (m_cartslot->exists() && m_cartslot->get_cart_type())
|
||||||
{
|
{
|
||||||
case A800_PHOENIX:
|
case A800_PHOENIX:
|
||||||
case A800_BLIZZARD:
|
case A800_BLIZZARD:
|
||||||
@ -1834,7 +1834,7 @@ void a400_state::setup_cart(a800_cart_slot_device *slot)
|
|||||||
m_cart_disabled = 0;
|
m_cart_disabled = 0;
|
||||||
m_last_offs = -1;
|
m_last_offs = -1;
|
||||||
|
|
||||||
switch (slot->get_cart_type())
|
switch (slot->exists() && slot->get_cart_type())
|
||||||
{
|
{
|
||||||
case A800_8K:
|
case A800_8K:
|
||||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xa000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
m_maincpu->space(AS_PROGRAM).install_read_handler(0xa000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||||
|
Loading…
Reference in New Issue
Block a user