mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
(MESS) consolidation + cleanup, part1. nw.
This commit is contained in:
parent
108544f677
commit
ca3deae576
@ -42,6 +42,8 @@ const device_type A78_CART_SLOT = &device_creator<a78_cart_slot_device>;
|
||||
|
||||
device_a78_cart_interface::device_a78_cart_interface (const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig, device),
|
||||
m_rom(NULL),
|
||||
m_rom_size(0),
|
||||
m_base_rom(0x8000),
|
||||
m_bank_mask(0)
|
||||
{
|
||||
@ -60,20 +62,26 @@ device_a78_cart_interface::~device_a78_cart_interface ()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_a78_cart_interface::rom_alloc(UINT32 size)
|
||||
void device_a78_cart_interface::rom_alloc(UINT32 size, const char *tag)
|
||||
{
|
||||
m_rom.resize(size);
|
||||
|
||||
// setup other helpers
|
||||
if ((size / 0x4000) & 1) // compensate for SuperGame carts with 9 x 16K banks (to my knowledge no other cart has m_bank_mask != power of 2)
|
||||
m_bank_mask = (size / 0x4000) - 2;
|
||||
else
|
||||
m_bank_mask = (size / 0x4000) - 1;
|
||||
|
||||
// the rom is mapped to the top of the memory area
|
||||
// so we store the starting point of data to simplify
|
||||
// the access handling
|
||||
m_base_rom = 0x10000 - size;
|
||||
if (m_rom == NULL)
|
||||
{
|
||||
astring tempstring(tag);
|
||||
tempstring.cat(A78SLOT_ROM_REGION_TAG);
|
||||
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
|
||||
// setup other helpers
|
||||
if ((size / 0x4000) & 1) // compensate for SuperGame carts with 9 x 16K banks (to my knowledge no other cart has m_bank_mask != power of 2)
|
||||
m_bank_mask = (size / 0x4000) - 2;
|
||||
else
|
||||
m_bank_mask = (size / 0x4000) - 1;
|
||||
|
||||
// the rom is mapped to the top of the memory area
|
||||
// so we store the starting point of data to simplify
|
||||
// the access handling
|
||||
m_base_rom = 0x10000 - size;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -340,7 +348,6 @@ bool a78_cart_slot_device::call_load()
|
||||
{
|
||||
if (m_cart)
|
||||
{
|
||||
UINT8 *ROM;
|
||||
UINT32 len;
|
||||
|
||||
if (software_entry() != NULL)
|
||||
@ -350,9 +357,8 @@ bool a78_cart_slot_device::call_load()
|
||||
bool has_nvram = get_software_region("nvram") ? TRUE : FALSE;
|
||||
len = get_software_region_length("rom");
|
||||
|
||||
m_cart->rom_alloc(len);
|
||||
ROM = m_cart->get_rom_base();
|
||||
memcpy(ROM, get_software_region("rom"), len);
|
||||
m_cart->rom_alloc(len, tag());
|
||||
memcpy(m_cart->get_rom_base(), get_software_region("rom"), len);
|
||||
|
||||
if ((pcb_name = get_feature("slot")) != NULL)
|
||||
m_type = a78_get_pcb_id(pcb_name);
|
||||
@ -447,9 +453,8 @@ bool a78_cart_slot_device::call_load()
|
||||
|
||||
internal_header_logging((UINT8 *)head, length());
|
||||
|
||||
m_cart->rom_alloc(len);
|
||||
ROM = m_cart->get_rom_base();
|
||||
fread(ROM, len);
|
||||
m_cart->rom_alloc(len, tag());
|
||||
fread(m_cart->get_rom_base(), len);
|
||||
|
||||
if (m_type == A78_TYPE6)
|
||||
m_cart->ram_alloc(0x4000);
|
||||
|
@ -53,19 +53,20 @@ public:
|
||||
virtual DECLARE_WRITE8_MEMBER(write_30xx) {}
|
||||
virtual DECLARE_WRITE8_MEMBER(write_40xx) {}
|
||||
|
||||
void rom_alloc(UINT32 size);
|
||||
void rom_alloc(UINT32 size, const char *tag);
|
||||
void ram_alloc(UINT32 size);
|
||||
void nvram_alloc(UINT32 size);
|
||||
UINT8* get_rom_base() { return m_rom; }
|
||||
UINT8* get_ram_base() { return m_ram; }
|
||||
UINT8* get_nvram_base() { return m_nvram; }
|
||||
UINT32 get_rom_size() { return m_rom.bytes(); }
|
||||
UINT32 get_rom_size() { return m_rom_size; }
|
||||
UINT32 get_ram_size() { return m_ram.bytes(); }
|
||||
UINT32 get_nvram_size() { return m_nvram.bytes(); }
|
||||
|
||||
protected:
|
||||
// internal state
|
||||
dynamic_buffer m_rom;
|
||||
UINT8 *m_rom;
|
||||
UINT32 m_rom_size;
|
||||
dynamic_buffer m_ram;
|
||||
dynamic_buffer m_nvram; // HiScore cart can save scores!
|
||||
// helpers
|
||||
@ -144,6 +145,8 @@ extern const device_type A78_CART_SLOT;
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define A78SLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#define MCFG_A78_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, A78_CART_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||
|
@ -40,6 +40,8 @@ const device_type XEGS_CART_SLOT = &device_creator<xegs_cart_slot_device>;
|
||||
|
||||
device_a800_cart_interface::device_a800_cart_interface (const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig, device),
|
||||
m_rom(NULL),
|
||||
m_rom_size(0),
|
||||
m_bank_mask(0)
|
||||
{
|
||||
}
|
||||
@ -57,12 +59,18 @@ device_a800_cart_interface::~device_a800_cart_interface ()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_a800_cart_interface::rom_alloc(UINT32 size)
|
||||
void device_a800_cart_interface::rom_alloc(UINT32 size, const char *tag)
|
||||
{
|
||||
m_rom.resize(size);
|
||||
|
||||
// setup other helpers
|
||||
m_bank_mask = (size / 0x2000) - 1; // code for XEGS carts makes use of this to simplify banking
|
||||
if (m_rom == NULL)
|
||||
{
|
||||
astring tempstring(tag);
|
||||
tempstring.cat(A800SLOT_ROM_REGION_TAG);
|
||||
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
|
||||
// setup other helpers
|
||||
m_bank_mask = (size / 0x2000) - 1; // code for XEGS carts makes use of this to simplify banking
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -234,7 +242,6 @@ bool a800_cart_slot_device::call_load()
|
||||
{
|
||||
if (m_cart)
|
||||
{
|
||||
UINT8 *ROM;
|
||||
UINT32 len;
|
||||
|
||||
if (software_entry() != NULL)
|
||||
@ -242,9 +249,8 @@ bool a800_cart_slot_device::call_load()
|
||||
const char *pcb_name;
|
||||
len = get_software_region_length("rom");
|
||||
|
||||
m_cart->rom_alloc(len);
|
||||
ROM = m_cart->get_rom_base();
|
||||
memcpy(ROM, get_software_region("rom"), len);
|
||||
m_cart->rom_alloc(len, tag());
|
||||
memcpy(m_cart->get_rom_base(), get_software_region("rom"), len);
|
||||
|
||||
if ((pcb_name = get_feature("slot")) != NULL)
|
||||
m_type = a800_get_pcb_id(pcb_name);
|
||||
@ -275,9 +281,8 @@ bool a800_cart_slot_device::call_load()
|
||||
m_type = A5200_4K;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(len);
|
||||
ROM = m_cart->get_rom_base();
|
||||
fread(ROM, len);
|
||||
m_cart->rom_alloc(len, tag());
|
||||
fread(m_cart->get_rom_base(), len);
|
||||
}
|
||||
if (m_type == A800_TELELINK2)
|
||||
m_cart->nvram_alloc(0x100);
|
||||
|
@ -56,19 +56,20 @@ public:
|
||||
virtual DECLARE_WRITE8_MEMBER(write_80xx) {}
|
||||
virtual DECLARE_WRITE8_MEMBER(write_d5xx) {}
|
||||
|
||||
void rom_alloc(UINT32 size);
|
||||
void rom_alloc(UINT32 size, const char *tag);
|
||||
void ram_alloc(UINT32 size);
|
||||
void nvram_alloc(UINT32 size);
|
||||
UINT8* get_rom_base() { return m_rom; }
|
||||
UINT8* get_ram_base() { return m_ram; }
|
||||
UINT8* get_nvram_base() { return m_nvram; }
|
||||
UINT32 get_rom_size() { return m_rom.bytes(); }
|
||||
UINT32 get_rom_size() { return m_rom_size; }
|
||||
UINT32 get_ram_size() { return m_ram.bytes(); }
|
||||
UINT32 get_nvram_size() { return m_nvram.bytes(); }
|
||||
|
||||
protected:
|
||||
// internal state
|
||||
dynamic_buffer m_rom;
|
||||
UINT8 *m_rom;
|
||||
UINT32 m_rom_size;
|
||||
dynamic_buffer m_ram;
|
||||
dynamic_buffer m_nvram; // HiScore cart can save scores!
|
||||
// helpers
|
||||
@ -169,6 +170,8 @@ extern const device_type XEGS_CART_SLOT;
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define A800SLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#define MCFG_A800_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, A800_CART_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||
|
@ -204,7 +204,7 @@ void a5200_rom_bbsb_device::device_reset()
|
||||
|
||||
READ8_MEMBER(a800_rom_device::read_80xx)
|
||||
{
|
||||
return m_rom[offset & (m_rom.bytes() - 1)];
|
||||
return m_rom[offset & (m_rom_size - 1)];
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,6 +36,8 @@ const device_type MEGADUCK_CART_SLOT = &device_creator<megaduck_cart_slot_device
|
||||
|
||||
device_gb_cart_interface::device_gb_cart_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig, device),
|
||||
m_rom(NULL),
|
||||
m_rom_size(0),
|
||||
has_rumble(false),
|
||||
has_timer(false),
|
||||
has_battery(false)
|
||||
@ -55,9 +57,15 @@ device_gb_cart_interface::~device_gb_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_gb_cart_interface::rom_alloc(UINT32 size)
|
||||
void device_gb_cart_interface::rom_alloc(UINT32 size, const char *tag)
|
||||
{
|
||||
m_rom.resize(size);
|
||||
if (m_rom == NULL)
|
||||
{
|
||||
astring tempstring(tag);
|
||||
tempstring.cat(GBSLOT_ROM_REGION_TAG);
|
||||
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -274,7 +282,7 @@ bool base_gb_cart_slot_device::call_load()
|
||||
}
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(len);
|
||||
m_cart->rom_alloc(len, tag());
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
if (software_entry() == NULL)
|
||||
@ -397,15 +405,13 @@ bool megaduck_cart_slot_device::call_load()
|
||||
if (m_cart)
|
||||
{
|
||||
UINT32 len = (software_entry() == NULL) ? length() : get_software_region_length("rom");
|
||||
UINT8 *ROM;
|
||||
|
||||
m_cart->rom_alloc(len);
|
||||
ROM = m_cart->get_rom_base();
|
||||
m_cart->rom_alloc(len, tag());
|
||||
|
||||
if (software_entry() == NULL)
|
||||
fread(ROM, len);
|
||||
fread(m_cart->get_rom_base(), len);
|
||||
else
|
||||
memcpy(ROM, get_software_region("rom"), len);
|
||||
memcpy(m_cart->get_rom_base(), get_software_region("rom"), len);
|
||||
|
||||
// setup rom bank map based on real length, not header value
|
||||
m_cart->rom_map_setup(len);
|
||||
|
@ -56,11 +56,11 @@ public:
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) {}
|
||||
|
||||
void rom_alloc(UINT32 size);
|
||||
void rom_alloc(UINT32 size, const char *tag);
|
||||
void ram_alloc(UINT32 size);
|
||||
UINT8* get_rom_base() { return m_rom; }
|
||||
UINT8* get_ram_base() { return m_ram; }
|
||||
UINT32 get_rom_size() { return m_rom.count(); }
|
||||
UINT32 get_rom_size() { return m_rom_size; }
|
||||
UINT32 get_ram_size() { return m_ram.count(); }
|
||||
|
||||
void rom_map_setup(UINT32 size);
|
||||
@ -74,7 +74,8 @@ public:
|
||||
void save_ram() { device().save_item(NAME(m_ram)); }
|
||||
|
||||
// internal state
|
||||
dynamic_buffer m_rom;
|
||||
UINT8 *m_rom;
|
||||
UINT32 m_rom_size;
|
||||
dynamic_buffer m_ram;
|
||||
|
||||
// bankswitch variables
|
||||
@ -190,6 +191,8 @@ extern const device_type MEGADUCK_CART_SLOT;
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define GBSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#define MCFG_GB_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, GB_CART_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||
|
@ -677,7 +677,7 @@ WRITE8_MEMBER(gb_rom_mmm01_device::write_bank)
|
||||
}
|
||||
else if (offset < 0x4000)
|
||||
{
|
||||
m_reg = data & ((m_rom.count() / 0x4000) - 1);
|
||||
m_reg = data & ((m_rom_size / 0x4000) - 1);
|
||||
m_bank = m_reg & m_bank_mask;
|
||||
if (m_bank == 0)
|
||||
m_bank = 1;
|
||||
|
@ -40,6 +40,23 @@ device_gba_cart_interface::~device_gba_cart_interface()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_gba_cart_interface::rom_alloc(UINT32 size, const char *tag)
|
||||
{
|
||||
if (m_rom == NULL)
|
||||
{
|
||||
astring tempstring(tag);
|
||||
tempstring.cat(GBASLOT_ROM_REGION_TAG);
|
||||
// we always alloc 32MB of rom region!
|
||||
m_rom = (UINT32 *)device().machine().memory().region_alloc(tempstring, 0x2000000, 4, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// nvram_alloc - alloc the space for the ram
|
||||
//-------------------------------------------------
|
||||
@ -150,34 +167,27 @@ bool gba_cart_slot_device::call_load()
|
||||
{
|
||||
if (m_cart)
|
||||
{
|
||||
UINT8 *ROM = (UINT8 *)m_cart->get_rom_base();
|
||||
UINT32 cart_size;
|
||||
UINT8 *ROM;
|
||||
UINT32 size = (software_entry() != NULL) ? get_software_region_length("rom") : length();
|
||||
if (size > 0x2000000)
|
||||
{
|
||||
seterror(IMAGE_ERROR_UNSPECIFIED, "Attempted loading a cart larger than 32MB");
|
||||
return IMAGE_INIT_FAIL;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(size, tag());
|
||||
ROM = (UINT8 *)m_cart->get_rom_base();
|
||||
|
||||
if (software_entry() == NULL)
|
||||
{
|
||||
cart_size = length();
|
||||
if (cart_size > 0x2000000)
|
||||
{
|
||||
seterror(IMAGE_ERROR_UNSPECIFIED, "Attempted loading a cart larger than 32MB");
|
||||
return IMAGE_INIT_FAIL;
|
||||
}
|
||||
fread(ROM, cart_size);
|
||||
m_cart->set_rom_size(cart_size); // we store the actual game size...
|
||||
|
||||
m_type = get_cart_type(ROM, cart_size);
|
||||
fread(ROM, size);
|
||||
m_type = get_cart_type(ROM, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *pcb_name = get_feature("slot");
|
||||
|
||||
cart_size = get_software_region_length("rom");
|
||||
if (cart_size > 0x2000000)
|
||||
{
|
||||
seterror(IMAGE_ERROR_UNSPECIFIED, "Attempted loading a cart larger than 32MB");
|
||||
return IMAGE_INIT_FAIL;
|
||||
}
|
||||
memcpy(ROM, get_software_region("rom"), cart_size);
|
||||
m_cart->set_rom_size(cart_size); // we store the actual game size...
|
||||
memcpy(ROM, get_software_region("rom"), size);
|
||||
|
||||
if (pcb_name)
|
||||
m_type = gba_get_pcb_id(pcb_name);
|
||||
@ -191,7 +201,7 @@ bool gba_cart_slot_device::call_load()
|
||||
m_cart->nvram_alloc(0x10000);
|
||||
|
||||
// mirror the ROM
|
||||
switch (cart_size)
|
||||
switch (size)
|
||||
{
|
||||
case 2 * 1024 * 1024:
|
||||
memcpy(ROM + 0x200000, ROM, 0x200000);
|
||||
@ -452,25 +462,3 @@ WRITE32_MEMBER(gba_cart_slot_device::write_ram)
|
||||
void gba_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
Install ROM - directly point system address map
|
||||
to the cart ROM region so to avoid the memory
|
||||
system additional load
|
||||
-------------------------------------------------*/
|
||||
|
||||
void gba_cart_slot_device::install_rom()
|
||||
{
|
||||
if (m_cart)
|
||||
{
|
||||
astring tempstring;
|
||||
address_space &space = machine().device<cpu_device>("maincpu")->space(AS_PROGRAM);
|
||||
space.install_read_bank(0x08000000, 0x09ffffff, 0, 0, "rom1");
|
||||
space.install_read_bank(0x0a000000, 0x0bffffff, 0, 0, "rom2");
|
||||
space.install_read_bank(0x0c000000, 0x0cffffff, 0, 0, "rom3");
|
||||
machine().root_device().membank("rom1")->set_base(machine().root_device().memregion(m_cart->device().subtag(tempstring, "cartridge"))->base());
|
||||
machine().root_device().membank("rom2")->set_base(machine().root_device().memregion(m_cart->device().subtag(tempstring, "cartridge"))->base());
|
||||
machine().root_device().membank("rom3")->set_base(machine().root_device().memregion(m_cart->device().subtag(tempstring, "cartridge"))->base());
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
virtual DECLARE_READ32_MEMBER(read_ram) { return 0xffffffff; }
|
||||
virtual DECLARE_WRITE32_MEMBER(write_ram) {};
|
||||
|
||||
void rom_alloc(UINT32 size, const char *tag);
|
||||
void nvram_alloc(UINT32 size);
|
||||
UINT32* get_rom_base() { return m_rom; }
|
||||
UINT32* get_nvram_base() { return m_nvram; }
|
||||
@ -45,8 +46,8 @@ public:
|
||||
|
||||
// internal state
|
||||
UINT32 *m_rom; // this points to the cart rom region
|
||||
dynamic_array<UINT32> m_nvram;
|
||||
UINT32 m_rom_size; // this is the actual game size, not the rom region size!
|
||||
dynamic_array<UINT32> m_nvram;
|
||||
};
|
||||
|
||||
|
||||
@ -70,8 +71,6 @@ public:
|
||||
virtual void call_unload();
|
||||
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry);
|
||||
|
||||
void install_rom();
|
||||
|
||||
int get_type() { return m_type; }
|
||||
int get_cart_type(UINT8 *ROM, UINT32 len);
|
||||
|
||||
@ -115,6 +114,8 @@ extern const device_type GBA_CART_SLOT;
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define GBASLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#define MCFG_GBA_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, GBA_CART_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||
|
@ -67,28 +67,12 @@ gba_rom_flash1m_device::gba_rom_flash1m_device(const machine_config &mconfig, co
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ROM Region to allow faster access to cart data
|
||||
//-------------------------------------------------
|
||||
|
||||
ROM_START( gba_cart )
|
||||
// cartridge region - 32 MBytes (128 Mbit)
|
||||
ROM_REGION( 0x2000000, "cartridge", ROMREGION_ERASEFF )
|
||||
ROM_END
|
||||
|
||||
const rom_entry *gba_rom_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME( gba_cart );
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// mapper specific start/reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void gba_rom_device::device_start()
|
||||
{
|
||||
astring tempstring;
|
||||
m_rom = (UINT32 *)memregion(this->subtag(tempstring, "cartridge"))->base();
|
||||
}
|
||||
|
||||
void gba_rom_device::device_reset()
|
||||
@ -108,9 +92,6 @@ void gba_rom_flash1m_device::device_reset()
|
||||
|
||||
void gba_rom_eeprom_device::device_start()
|
||||
{
|
||||
astring tempstring;
|
||||
m_rom = (UINT32 *)memregion(this->subtag(tempstring, "cartridge"))->base();
|
||||
|
||||
// for the moment we use a custom eeprom implementation, so we alloc/save it as nvram
|
||||
nvram_alloc(0x200);
|
||||
m_eeprom.reset(global_alloc(gba_eeprom_device(machine(), (UINT8*)get_nvram_base(), get_nvram_size(), 6)));
|
||||
@ -118,9 +99,6 @@ void gba_rom_eeprom_device::device_start()
|
||||
|
||||
void gba_rom_eeprom64_device::device_start()
|
||||
{
|
||||
astring tempstring;
|
||||
m_rom = (UINT32 *)memregion(this->subtag(tempstring, "cartridge"))->base();
|
||||
|
||||
// for the moment we use a custom eeprom implementation, so we alloc/save it as nvram
|
||||
nvram_alloc(0x2000);
|
||||
m_eeprom.reset(global_alloc(gba_eeprom_device(machine(), (UINT8*)get_nvram_base(), get_nvram_size(), 14)));
|
||||
|
@ -17,7 +17,6 @@ public:
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual const rom_entry *device_rom_region() const;
|
||||
virtual void device_reset();
|
||||
|
||||
// reading and writing
|
||||
|
@ -86,6 +86,7 @@ void device_md_cart_interface::rom_alloc(size_t size, const char *tag)
|
||||
if (m_rom == NULL)
|
||||
{
|
||||
astring tempstring(tag);
|
||||
tempstring.cat(MDSLOT_ROM_REGION_TAG);
|
||||
m_rom = (UINT16 *)device().machine().memory().region_alloc(tempstring, size, 2, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
@ -369,9 +370,7 @@ int base_md_cart_slot_device::load_list()
|
||||
// if cart size is not (2^n * 64K), the system will see anyway that size so we need to alloc a bit more space
|
||||
length = m_cart->get_padded_size(length);
|
||||
|
||||
astring cart_string(tag());
|
||||
cart_string.cat(":cart:rom");
|
||||
m_cart->rom_alloc(length, cart_string.cstr());
|
||||
m_cart->rom_alloc(length, tag());
|
||||
ROM = m_cart->get_rom_base();
|
||||
memcpy((UINT8 *)ROM, get_software_region("rom"), get_software_region_length("rom"));
|
||||
|
||||
@ -482,11 +481,9 @@ int base_md_cart_slot_device::load_nonlist()
|
||||
// STEP 2: allocate space for the real copy of the game
|
||||
// if cart size is not (2^n * 64K), the system will see anyway that size so we need to alloc a bit more space
|
||||
len = m_cart->get_padded_size(tmplen - offset);
|
||||
// this contains an hack for SSF2: its current bankswitch code needs larger rom space to work
|
||||
astring cart_string(tag());
|
||||
cart_string.cat(":cart:rom");
|
||||
m_cart->rom_alloc((len == 0x500000) ? 0x900000 : len, cart_string.cstr());
|
||||
|
||||
// this contains an hack for SSF2: its current bankswitch code needs larger rom space to work
|
||||
m_cart->rom_alloc((len == 0x500000) ? 0x900000 : len, tag());
|
||||
|
||||
// STEP 3: copy the game data in the appropriate way
|
||||
ROM = (unsigned char *)m_cart->get_rom_base();
|
||||
|
@ -237,6 +237,8 @@ extern const device_type COPERA_CART_SLOT;
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define MDSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#define MCFG_MD_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, MD_CART_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||
|
@ -25,7 +25,9 @@ const device_type PCE_CART_SLOT = &device_creator<pce_cart_slot_device>;
|
||||
//-------------------------------------------------
|
||||
|
||||
device_pce_cart_interface::device_pce_cart_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig, device)
|
||||
: device_slot_card_interface(mconfig, device),
|
||||
m_rom(NULL),
|
||||
m_rom_size(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -42,9 +44,15 @@ device_pce_cart_interface::~device_pce_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_pce_cart_interface::rom_alloc(UINT32 size)
|
||||
void device_pce_cart_interface::rom_alloc(UINT32 size, const char *tag)
|
||||
{
|
||||
m_rom.resize(size);
|
||||
if (m_rom == NULL)
|
||||
{
|
||||
astring tempstring(tag);
|
||||
tempstring.cat(PCESLOT_ROM_REGION_TAG);
|
||||
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -216,7 +224,7 @@ bool pce_cart_slot_device::call_load()
|
||||
fseek(offset, SEEK_SET);
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(len);
|
||||
m_cart->rom_alloc(len, tag());
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
if (software_entry() == NULL)
|
||||
|
@ -30,15 +30,16 @@ public:
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) { return 0xff; }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) {};
|
||||
|
||||
void rom_alloc(UINT32 size);
|
||||
void rom_alloc(UINT32 size, const char *tag);
|
||||
void ram_alloc(UINT32 size);
|
||||
UINT8* get_rom_base() { return m_rom; }
|
||||
UINT8* get_ram_base() { return m_ram; }
|
||||
UINT32 get_rom_size() { return m_rom.count(); }
|
||||
UINT32 get_rom_size() { return m_rom_size; }
|
||||
UINT32 get_ram_size() { return m_ram.count(); }
|
||||
|
||||
// internal state
|
||||
dynamic_buffer m_rom;
|
||||
UINT8 *m_rom;
|
||||
UINT32 m_rom_size;
|
||||
dynamic_buffer m_ram;
|
||||
|
||||
void rom_map_setup(UINT32 size);
|
||||
@ -110,6 +111,8 @@ extern const device_type PCE_CART_SLOT;
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define PCESLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#define MCFG_PCE_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, PCE_CART_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
|
||||
|
@ -49,5 +49,5 @@ void saturn_rom_device::device_reset()
|
||||
|
||||
READ32_MEMBER(saturn_rom_device::read_rom)
|
||||
{
|
||||
return m_rom[offset & (m_rom.count() - 1)];
|
||||
return m_rom[offset & (m_rom_size/4 - 1)];
|
||||
}
|
||||
|
@ -35,7 +35,9 @@ const device_type SATURN_CART_SLOT = &device_creator<sat_cart_slot_device>;
|
||||
//-------------------------------------------------
|
||||
|
||||
device_sat_cart_interface::device_sat_cart_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig, device)
|
||||
: device_slot_card_interface(mconfig, device),
|
||||
m_rom(NULL),
|
||||
m_rom_size(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -52,9 +54,15 @@ device_sat_cart_interface::~device_sat_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_sat_cart_interface::rom_alloc(UINT32 size)
|
||||
void device_sat_cart_interface::rom_alloc(UINT32 size, const char *tag)
|
||||
{
|
||||
m_rom.resize(size/sizeof(UINT32));
|
||||
if (m_rom == NULL)
|
||||
{
|
||||
astring tempstring(tag);
|
||||
tempstring.cat(SATSLOT_ROM_REGION_TAG);
|
||||
m_rom = (UINT32 *)device().machine().memory().region_alloc(tempstring, size, 4, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -122,7 +130,7 @@ bool sat_cart_slot_device::call_load()
|
||||
else
|
||||
len = length();
|
||||
|
||||
m_cart->rom_alloc(len);
|
||||
m_cart->rom_alloc(len, tag());
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
if (software_entry() != NULL)
|
||||
|
@ -29,12 +29,12 @@ public:
|
||||
virtual int get_cart_type() { return m_cart_type; };
|
||||
|
||||
|
||||
void rom_alloc(UINT32 size);
|
||||
void rom_alloc(UINT32 size, const char *tag);
|
||||
UINT32* get_rom_base() { return m_rom; }
|
||||
UINT32* get_ext_dram0_base() { return m_ext_dram0; }
|
||||
UINT32* get_ext_dram1_base() { return m_ext_dram1; }
|
||||
UINT8* get_ext_bram_base() { return m_ext_bram; }
|
||||
UINT32 get_rom_size() { return m_rom.bytes(); }
|
||||
UINT32 get_rom_size() { return m_rom_size; }
|
||||
UINT32 get_ext_dram0_size() { return m_ext_dram0.bytes(); }
|
||||
UINT32 get_ext_dram1_size() { return m_ext_dram1.bytes(); }
|
||||
UINT32 get_ext_bram_size() { return m_ext_bram.bytes(); }
|
||||
@ -43,7 +43,8 @@ protected:
|
||||
int m_cart_type;
|
||||
|
||||
// internal state
|
||||
dynamic_array<UINT32> m_rom;
|
||||
UINT32 *m_rom;
|
||||
UINT32 m_rom_size;
|
||||
dynamic_array<UINT32> m_ext_dram0;
|
||||
dynamic_array<UINT32> m_ext_dram1;
|
||||
dynamic_buffer m_ext_bram;
|
||||
@ -107,6 +108,8 @@ extern const device_type SATURN_CART_SLOT;
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define SATSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#define MCFG_SATURN_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, SATURN_CART_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||
|
@ -422,7 +422,7 @@ READ8_MEMBER(sega8_othello_device::read_cart)
|
||||
if (offset >= 0x8000 && offset < 0xa000)
|
||||
return m_ram[offset & 0x7ff];
|
||||
|
||||
return m_rom[offset % m_rom.count()];
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_othello_device::write_cart)
|
||||
@ -446,7 +446,7 @@ READ8_MEMBER(sega8_castle_device::read_cart)
|
||||
if (offset >= 0x8000 && offset < 0xa000)
|
||||
return m_ram[offset & 0x1fff];
|
||||
|
||||
return m_rom[offset % m_rom.count()];
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_castle_device::write_cart)
|
||||
@ -470,7 +470,7 @@ READ8_MEMBER(sega8_basic_l3_device::read_cart)
|
||||
if (offset >= 0x8000)
|
||||
return m_ram[offset & 0x3fff];
|
||||
|
||||
return m_rom[offset % m_rom.count()];
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_basic_l3_device::write_cart)
|
||||
@ -504,7 +504,7 @@ READ8_MEMBER(sega8_music_editor_device::read_cart)
|
||||
if (offset >= 0x8000 && offset < 0xa000)
|
||||
return m_ram[offset & 0x1fff];
|
||||
|
||||
return m_rom[offset % m_rom.count()];
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_music_editor_device::write_cart)
|
||||
@ -623,7 +623,7 @@ READ8_MEMBER(sega8_dahjee_typea_device::read_cart)
|
||||
if (offset >= 0x2000 && offset < 0x4000)
|
||||
return m_ram[offset & 0x1fff];
|
||||
|
||||
return m_rom[offset % m_rom.count()];
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_dahjee_typea_device::write_cart)
|
||||
@ -651,7 +651,7 @@ WRITE8_MEMBER(sega8_dahjee_typea_device::write_ram)
|
||||
// TYPE B
|
||||
READ8_MEMBER(sega8_dahjee_typeb_device::read_cart)
|
||||
{
|
||||
return m_rom[offset % m_rom.count()];
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
READ8_MEMBER(sega8_dahjee_typeb_device::read_ram)
|
||||
|
@ -49,6 +49,8 @@ const device_type SEGA8_CARD_SLOT = &device_creator<sega8_card_slot_device>;
|
||||
|
||||
device_sega8_cart_interface::device_sega8_cart_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig, device),
|
||||
m_rom(NULL),
|
||||
m_rom_size(0),
|
||||
m_rom_page_count(0),
|
||||
has_battery(FALSE),
|
||||
m_late_battery_enable(FALSE),
|
||||
@ -70,13 +72,19 @@ device_sega8_cart_interface::~device_sega8_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_sega8_cart_interface::rom_alloc(UINT32 size)
|
||||
void device_sega8_cart_interface::rom_alloc(UINT32 size, const char *tag)
|
||||
{
|
||||
m_rom.resize(size);
|
||||
m_rom_page_count = size / 0x4000;
|
||||
if (!m_rom_page_count)
|
||||
m_rom_page_count = 1; // we compute rom pages through (XXX % m_rom_page_count)!
|
||||
late_bank_setup();
|
||||
if (m_rom == NULL)
|
||||
{
|
||||
astring tempstring(tag);
|
||||
tempstring.cat(S8SLOT_ROM_REGION_TAG);
|
||||
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
m_rom_page_count = size / 0x4000;
|
||||
if (!m_rom_page_count)
|
||||
m_rom_page_count = 1; // we compute rom pages through (XXX % m_rom_page_count)!
|
||||
late_bank_setup();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -353,7 +361,7 @@ bool sega8_cart_slot_device::call_load()
|
||||
if (len & 0x3fff)
|
||||
len = ((len >> 14) + 1) << 14;
|
||||
|
||||
m_cart->rom_alloc(len);
|
||||
m_cart->rom_alloc(len, tag());
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
if (software_entry() == NULL)
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) {}
|
||||
|
||||
void rom_alloc(UINT32 size);
|
||||
void rom_alloc(UINT32 size, const char *tag);
|
||||
void ram_alloc(UINT32 size);
|
||||
|
||||
virtual void late_bank_setup() {}
|
||||
@ -66,7 +66,7 @@ public:
|
||||
//protected:
|
||||
UINT8* get_rom_base() { return m_rom; }
|
||||
UINT8* get_ram_base() { return m_ram; }
|
||||
UINT32 get_rom_size() { return m_rom.count(); }
|
||||
UINT32 get_rom_size() { return m_rom_size; }
|
||||
UINT32 get_ram_size() { return m_ram.count(); }
|
||||
|
||||
void rom_map_setup(UINT32 size);
|
||||
@ -76,7 +76,8 @@ public:
|
||||
|
||||
//private:
|
||||
// internal state
|
||||
dynamic_buffer m_rom;
|
||||
UINT8 *m_rom;
|
||||
UINT32 m_rom_size;
|
||||
dynamic_buffer m_ram;
|
||||
int m_rom_page_count;
|
||||
|
||||
@ -171,6 +172,9 @@ public:
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define S8SLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
|
||||
#define MCFG_SG1000_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, SEGA8_CART_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
|
||||
|
@ -67,7 +67,9 @@ const device_type SNS_BSX_CART_SLOT = &device_creator<sns_bsx_cart_slot_device>;
|
||||
//-------------------------------------------------
|
||||
|
||||
device_sns_cart_interface::device_sns_cart_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig, device)
|
||||
: device_slot_card_interface(mconfig, device),
|
||||
m_rom(NULL),
|
||||
m_rom_size(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -84,9 +86,15 @@ device_sns_cart_interface::~device_sns_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_sns_cart_interface::rom_alloc(UINT32 size)
|
||||
void device_sns_cart_interface::rom_alloc(UINT32 size, const char *tag)
|
||||
{
|
||||
m_rom.resize(size);
|
||||
if (m_rom == NULL)
|
||||
{
|
||||
astring tempstring(tag);
|
||||
tempstring.cat(SNSSLOT_ROM_REGION_TAG);
|
||||
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -612,7 +620,7 @@ bool base_sns_cart_slot_device::call_load()
|
||||
|
||||
len = (software_entry() == NULL) ? (length() - offset) : get_software_region_length("rom");
|
||||
|
||||
m_cart->rom_alloc(len);
|
||||
m_cart->rom_alloc(len, tag());
|
||||
ROM = m_cart->get_rom_base();
|
||||
if (software_entry() == NULL)
|
||||
fread(ROM, len);
|
||||
@ -652,7 +660,6 @@ bool base_sns_cart_slot_device::call_load()
|
||||
// by installing read_bank in address space and mapping m_bios there
|
||||
m_cart->speedup_addon_bios_access();
|
||||
|
||||
|
||||
setup_nvram();
|
||||
|
||||
if (m_cart->get_nvram_size() || m_cart->get_rtc_ram_size())
|
||||
|
@ -111,7 +111,7 @@ public:
|
||||
virtual DECLARE_WRITE8_MEMBER(chip_write) {}
|
||||
virtual void speedup_addon_bios_access() {};
|
||||
|
||||
void rom_alloc(UINT32 size);
|
||||
void rom_alloc(UINT32 size, const char *tag);
|
||||
void nvram_alloc(UINT32 size);
|
||||
void rtc_ram_alloc(UINT32 size);
|
||||
void addon_bios_alloc(UINT32 size);
|
||||
@ -119,7 +119,7 @@ public:
|
||||
UINT8* get_nvram_base() { return m_nvram; };
|
||||
UINT8* get_addon_bios_base() { return m_bios; };
|
||||
UINT8* get_rtc_ram_base() { return m_rtc_ram; };
|
||||
UINT32 get_rom_size() { return m_rom.count(); };
|
||||
UINT32 get_rom_size() { return m_rom_size; };
|
||||
UINT32 get_nvram_size() { return m_nvram.count(); };
|
||||
UINT32 get_addon_bios_size() { return m_bios.count(); };
|
||||
UINT32 get_rtc_ram_size() { return m_rtc_ram.count(); };
|
||||
@ -129,7 +129,8 @@ public:
|
||||
void save_rtc_ram() { device().save_item(NAME(m_rtc_ram)); }
|
||||
|
||||
// internal state
|
||||
dynamic_buffer m_rom;
|
||||
UINT8 *m_rom;
|
||||
UINT32 m_rom_size;
|
||||
dynamic_buffer m_nvram;
|
||||
dynamic_buffer m_bios;
|
||||
dynamic_buffer m_rtc_ram; // temp pointer to save RTC ram to nvram (will disappear when RTCs become devices)
|
||||
@ -252,6 +253,9 @@ extern const device_type SNS_BSX_CART_SLOT;
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define SNSSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
|
||||
#define MCFG_SNS_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, SNS_CART_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||
|
@ -228,7 +228,7 @@ void a26_rom_3e_device::device_start()
|
||||
|
||||
void a26_rom_3e_device::device_reset()
|
||||
{
|
||||
m_num_bank = m_rom.count() / 0x800;
|
||||
m_num_bank = m_rom_size / 0x800;
|
||||
m_base_bank = m_num_bank - 1;
|
||||
m_ram_bank = 0;
|
||||
m_ram_enable = 0;
|
||||
@ -236,7 +236,7 @@ void a26_rom_3e_device::device_reset()
|
||||
|
||||
void a26_rom_3f_device::device_reset()
|
||||
{
|
||||
m_num_bank = m_rom.count() / 0x800;
|
||||
m_num_bank = m_rom_size / 0x800;
|
||||
m_base_bank = m_num_bank - 1;
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ READ8_MEMBER(a26_rom_2k_device::read_rom)
|
||||
return m_ram[offset & (m_ram.count() - 1)];
|
||||
}
|
||||
|
||||
return m_rom[offset & (m_rom.count() - 1)];
|
||||
return m_rom[offset & (m_rom_size - 1)];
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
@ -845,7 +845,7 @@ WRITE8_MEMBER(a26_rom_e7_device::write_bank)
|
||||
|
||||
READ8_MEMBER(a26_rom_ua_device::read_rom)
|
||||
{
|
||||
return m_rom[(offset + (m_base_bank * 0x1000)) & (m_rom.count() - 1)];
|
||||
return m_rom[(offset + (m_base_bank * 0x1000)) & (m_rom_size - 1)];
|
||||
}
|
||||
|
||||
READ8_MEMBER(a26_rom_ua_device::read_bank)
|
||||
|
@ -28,7 +28,9 @@ const device_type VCS_CART_SLOT = &device_creator<vcs_cart_slot_device>;
|
||||
//-------------------------------------------------
|
||||
|
||||
device_vcs_cart_interface::device_vcs_cart_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig, device)
|
||||
: device_slot_card_interface(mconfig, device),
|
||||
m_rom(NULL),
|
||||
m_rom_size(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -45,9 +47,15 @@ device_vcs_cart_interface::~device_vcs_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_vcs_cart_interface::rom_alloc(UINT32 size)
|
||||
void device_vcs_cart_interface::rom_alloc(UINT32 size, const char *tag)
|
||||
{
|
||||
m_rom.resize(size);
|
||||
if (m_rom == NULL)
|
||||
{
|
||||
astring tempstring(tag);
|
||||
tempstring.cat(A26SLOT_ROM_REGION_TAG);
|
||||
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -206,7 +214,7 @@ bool vcs_cart_slot_device::call_load()
|
||||
return IMAGE_INIT_FAIL;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(len);
|
||||
m_cart->rom_alloc(len, tag());
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
if (software_entry() != NULL)
|
||||
|
@ -59,16 +59,17 @@ public:
|
||||
|
||||
virtual void setup_addon_ptr(UINT8 *ptr) {}
|
||||
|
||||
void rom_alloc(UINT32 size);
|
||||
void rom_alloc(UINT32 size, const char *tag);
|
||||
void ram_alloc(UINT32 size);
|
||||
UINT8* get_rom_base() { return m_rom; }
|
||||
UINT8* get_ram_base() { return m_ram; }
|
||||
UINT32 get_rom_size() { return m_rom.bytes(); }
|
||||
UINT32 get_rom_size() { return m_rom_size; }
|
||||
UINT32 get_ram_size() { return m_ram.bytes(); }
|
||||
|
||||
protected:
|
||||
// internal state
|
||||
dynamic_buffer m_rom;
|
||||
UINT8 *m_rom;
|
||||
UINT32 m_rom_size;
|
||||
dynamic_buffer m_ram;
|
||||
};
|
||||
|
||||
@ -146,6 +147,9 @@ extern const device_type VCS_CART_SLOT;
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define A26SLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
|
||||
#define MCFG_VCS_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, VCS_CART_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
m_riot_ram(*this, "riot_ram"),
|
||||
m_joy1(*this, CONTROL1_TAG),
|
||||
m_joy2(*this, CONTROL2_TAG) ,
|
||||
m_cartslot(*this, "cartslot"),
|
||||
m_cart(*this, "cartslot"),
|
||||
m_tia(*this, "tia_video"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_screen(*this, "screen") { }
|
||||
@ -58,7 +58,7 @@ public:
|
||||
protected:
|
||||
required_device<vcs_control_port_device> m_joy1;
|
||||
required_device<vcs_control_port_device> m_joy2;
|
||||
required_device<vcs_cart_slot_device> m_cartslot;
|
||||
required_device<vcs_cart_slot_device> m_cart;
|
||||
required_device<tia_video_device> m_tia;
|
||||
|
||||
unsigned long detect_2600controllers();
|
||||
@ -236,15 +236,13 @@ WRITE16_MEMBER(a2600_state::a2600_tia_vsync_callback_pal)
|
||||
READ8_MEMBER(a2600_state::cart_over_riot_r)
|
||||
{
|
||||
if (!space.debugger_access())
|
||||
if (m_cartslot)
|
||||
m_cartslot->write_bank(space, offset, 0);
|
||||
m_cart->write_bank(space, offset, 0);
|
||||
return m_riot_ram[0x20 + offset];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(a2600_state::cart_over_riot_w)
|
||||
{
|
||||
if (m_cartslot)
|
||||
m_cartslot->write_bank(space, offset, 0);
|
||||
m_cart->write_bank(space, offset, 0);
|
||||
m_riot_ram[0x20 + offset] = data;
|
||||
|
||||
}
|
||||
@ -252,9 +250,7 @@ WRITE8_MEMBER(a2600_state::cart_over_riot_w)
|
||||
WRITE8_MEMBER(a2600_state::cart_over_tia_w)
|
||||
{
|
||||
// Both Cart & TIA see these addresses
|
||||
if (m_cartslot)
|
||||
m_cartslot->write_bank(space, offset, data);
|
||||
|
||||
m_cart->write_bank(space, offset, data);
|
||||
m_tia->write(space, offset, data);
|
||||
}
|
||||
|
||||
@ -263,7 +259,7 @@ MACHINE_START_MEMBER(a2600_state,a2600)
|
||||
m_current_screen_height = m_screen->height();
|
||||
memset(m_riot_ram, 0x00, 0x80);
|
||||
|
||||
switch (m_cartslot->get_cart_type())
|
||||
switch (m_cart->get_cart_type())
|
||||
{
|
||||
case A26_2K:
|
||||
case A26_4K:
|
||||
@ -277,44 +273,44 @@ MACHINE_START_MEMBER(a2600_state,a2600)
|
||||
case A26_DC:
|
||||
case A26_FV:
|
||||
case A26_8IN1:
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cartslot), write8_delegate(FUNC(vcs_cart_slot_device::write_bank),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cart), write8_delegate(FUNC(vcs_cart_slot_device::write_bank),(vcs_cart_slot_device*)m_cart));
|
||||
break;
|
||||
case A26_F6:
|
||||
case A26_DPC:
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cartslot), write8_delegate(FUNC(vcs_cart_slot_device::write_bank),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(vcs_cart_slot_device::cart_opbase),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cart), write8_delegate(FUNC(vcs_cart_slot_device::write_bank),(vcs_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(vcs_cart_slot_device::cart_opbase),(vcs_cart_slot_device*)m_cart));
|
||||
break;
|
||||
case A26_FE:
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cartslot), write8_delegate(FUNC(vcs_cart_slot_device::write_ram),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x01fe, 0x01ff, read8_delegate(FUNC(vcs_cart_slot_device::read_bank),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x01fe, 0x01fe, write8_delegate(FUNC(vcs_cart_slot_device::write_bank),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cart), write8_delegate(FUNC(vcs_cart_slot_device::write_ram),(vcs_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x01fe, 0x01ff, read8_delegate(FUNC(vcs_cart_slot_device::read_bank),(vcs_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x01fe, 0x01fe, write8_delegate(FUNC(vcs_cart_slot_device::write_bank),(vcs_cart_slot_device*)m_cart));
|
||||
break;
|
||||
case A26_3E:
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cartslot), write8_delegate(FUNC(vcs_cart_slot_device::write_ram),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cart), write8_delegate(FUNC(vcs_cart_slot_device::write_ram),(vcs_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x00, 0x3f, write8_delegate(FUNC(a2600_state::cart_over_tia_w), this));
|
||||
break;
|
||||
case A26_3F:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x00, 0x3f, write8_delegate(FUNC(a2600_state::cart_over_tia_w), this));
|
||||
break;
|
||||
case A26_UA:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x200, 0x27f, read8_delegate(FUNC(vcs_cart_slot_device::read_bank),(vcs_cart_slot_device*)m_cartslot), write8_delegate(FUNC(vcs_cart_slot_device::write_bank),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x200, 0x27f, read8_delegate(FUNC(vcs_cart_slot_device::read_bank),(vcs_cart_slot_device*)m_cart), write8_delegate(FUNC(vcs_cart_slot_device::write_bank),(vcs_cart_slot_device*)m_cart));
|
||||
break;
|
||||
case A26_JVP:
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cartslot), write8_delegate(FUNC(vcs_cart_slot_device::write_bank),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cart), write8_delegate(FUNC(vcs_cart_slot_device::write_bank),(vcs_cart_slot_device*)m_cart));
|
||||
// to verify the actual behavior...
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xfa0, 0xfc0, read8_delegate(FUNC(a2600_state::cart_over_riot_r), this), write8_delegate(FUNC(a2600_state::cart_over_riot_w), this));
|
||||
break;
|
||||
case A26_4IN1:
|
||||
case A26_32IN1:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cart));
|
||||
break;
|
||||
case A26_SS:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cart));
|
||||
break;
|
||||
case A26_CM:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(vcs_cart_slot_device::read_rom),(vcs_cart_slot_device*)m_cart));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ public:
|
||||
m_io_buttons(*this, "buttons"),
|
||||
m_io_vblank(*this, "vblank"),
|
||||
m_io_console_buttons(*this, "console_buttons"),
|
||||
m_cartslot(*this, "cartslot"),
|
||||
m_cart(*this, "cartslot"),
|
||||
m_screen(*this, "screen") { }
|
||||
|
||||
int m_lines;
|
||||
@ -160,7 +160,7 @@ protected:
|
||||
required_ioport m_io_buttons;
|
||||
required_ioport m_io_vblank;
|
||||
required_ioport m_io_console_buttons;
|
||||
required_device<a78_cart_slot_device> m_cartslot;
|
||||
required_device<a78_cart_slot_device> m_cart;
|
||||
required_device<screen_device> m_screen;
|
||||
};
|
||||
|
||||
@ -272,7 +272,7 @@ READ8_MEMBER(a7800_state::bios_or_cart_r)
|
||||
if (!(m_ctrl_reg & 0x04))
|
||||
return m_bios[offset];
|
||||
else
|
||||
return m_cartslot->read_40xx(space, offset + 0x8000);
|
||||
return m_cart->read_40xx(space, offset + 0x8000);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
@ -1315,30 +1315,32 @@ void a7800_state::machine_start()
|
||||
save_item(NAME(m_maria_flag));
|
||||
|
||||
// install additional handlers, if needed
|
||||
if (m_cartslot->exists())
|
||||
switch (m_cartslot->get_cart_type())
|
||||
if (m_cart->exists())
|
||||
{
|
||||
case A78_HSC:
|
||||
// ROM+NVRAM accesses for HiScore
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x17ff, read8_delegate(FUNC(a78_cart_slot_device::read_10xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_10xx),(a78_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x3000, 0x3fff, read8_delegate(FUNC(a78_cart_slot_device::read_30xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_30xx),(a78_cart_slot_device*)m_cartslot));
|
||||
break;
|
||||
case A78_XB_BOARD:
|
||||
case A78_TYPE0_POK450:
|
||||
case A78_TYPE1_POK450:
|
||||
case A78_TYPE6_POK450:
|
||||
case A78_TYPEA_POK450:
|
||||
case A78_VERSA_POK450:
|
||||
// POKEY and RAM regs at 0x400-0x47f
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0400, 0x047f, read8_delegate(FUNC(a78_cart_slot_device::read_04xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_04xx),(a78_cart_slot_device*)m_cartslot));
|
||||
break;
|
||||
case A78_XM_BOARD:
|
||||
// POKEY and RAM and YM regs at 0x400-0x47f
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0400, 0x047f, read8_delegate(FUNC(a78_cart_slot_device::read_04xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_04xx),(a78_cart_slot_device*)m_cartslot));
|
||||
// ROM+NVRAM accesses for HiScore
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x17ff, read8_delegate(FUNC(a78_cart_slot_device::read_10xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_10xx),(a78_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x3000, 0x3fff, read8_delegate(FUNC(a78_cart_slot_device::read_30xx),(a78_cart_slot_device*)m_cartslot), write8_delegate(FUNC(a78_cart_slot_device::write_30xx),(a78_cart_slot_device*)m_cartslot));
|
||||
break;
|
||||
switch (m_cart->get_cart_type())
|
||||
{
|
||||
case A78_HSC:
|
||||
// ROM+NVRAM accesses for HiScore
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x17ff, read8_delegate(FUNC(a78_cart_slot_device::read_10xx),(a78_cart_slot_device*)m_cart), write8_delegate(FUNC(a78_cart_slot_device::write_10xx),(a78_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x3000, 0x3fff, read8_delegate(FUNC(a78_cart_slot_device::read_30xx),(a78_cart_slot_device*)m_cart), write8_delegate(FUNC(a78_cart_slot_device::write_30xx),(a78_cart_slot_device*)m_cart));
|
||||
break;
|
||||
case A78_XB_BOARD:
|
||||
case A78_TYPE0_POK450:
|
||||
case A78_TYPE1_POK450:
|
||||
case A78_TYPE6_POK450:
|
||||
case A78_TYPEA_POK450:
|
||||
case A78_VERSA_POK450:
|
||||
// POKEY and RAM regs at 0x400-0x47f
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0400, 0x047f, read8_delegate(FUNC(a78_cart_slot_device::read_04xx),(a78_cart_slot_device*)m_cart), write8_delegate(FUNC(a78_cart_slot_device::write_04xx),(a78_cart_slot_device*)m_cart));
|
||||
break;
|
||||
case A78_XM_BOARD:
|
||||
// POKEY and RAM and YM regs at 0x400-0x47f
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0400, 0x047f, read8_delegate(FUNC(a78_cart_slot_device::read_04xx),(a78_cart_slot_device*)m_cart), write8_delegate(FUNC(a78_cart_slot_device::write_04xx),(a78_cart_slot_device*)m_cart));
|
||||
// ROM+NVRAM accesses for HiScore
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x17ff, read8_delegate(FUNC(a78_cart_slot_device::read_10xx),(a78_cart_slot_device*)m_cart), write8_delegate(FUNC(a78_cart_slot_device::write_10xx),(a78_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x3000, 0x3fff, read8_delegate(FUNC(a78_cart_slot_device::read_30xx),(a78_cart_slot_device*)m_cart), write8_delegate(FUNC(a78_cart_slot_device::write_30xx),(a78_cart_slot_device*)m_cart));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -251,8 +251,8 @@ public:
|
||||
m_0000(*this, "0000"),
|
||||
m_8000(*this, "8000"),
|
||||
m_a000(*this, "a000"),
|
||||
m_cartslot(*this, "cartleft"),
|
||||
m_cartslot2(*this, "cartright") { }
|
||||
m_cart(*this, "cartleft"),
|
||||
m_cart2(*this, "cartright") { }
|
||||
|
||||
DECLARE_MACHINE_START(a400);
|
||||
DECLARE_MACHINE_START(a800);
|
||||
@ -296,8 +296,8 @@ protected:
|
||||
optional_memory_bank m_0000;
|
||||
optional_memory_bank m_8000;
|
||||
optional_memory_bank m_a000;
|
||||
optional_device<a800_cart_slot_device> m_cartslot;
|
||||
optional_device<a800_cart_slot_device> m_cartslot2;
|
||||
optional_device<a800_cart_slot_device> m_cart;
|
||||
optional_device<a800_cart_slot_device> m_cart2;
|
||||
|
||||
int m_cart_disabled;
|
||||
int m_last_offs;
|
||||
@ -1735,99 +1735,101 @@ READ8_MEMBER(a400_state::read_d5xx)
|
||||
|
||||
WRITE8_MEMBER(a400_state::disable_cart)
|
||||
{
|
||||
if (m_cartslot->exists())
|
||||
switch (m_cartslot->get_cart_type())
|
||||
if (m_cart->exists())
|
||||
{
|
||||
case A800_PHOENIX:
|
||||
case A800_BLIZZARD:
|
||||
if (!m_cart_disabled)
|
||||
{
|
||||
m_cart_disabled = 1;
|
||||
setup_ram(2, m_ram->size());
|
||||
}
|
||||
break;
|
||||
case A800_OSS034M:
|
||||
case A800_OSS043M:
|
||||
case A800_EXPRESS:
|
||||
case A800_DIAMOND:
|
||||
case A800_WILLIAMS:
|
||||
// use m_cart_disabled & m_last_offs to avoid continuous remapping of
|
||||
// the memory space in some games (e.g. dropzone)
|
||||
if (offset & 0x8 && !m_cart_disabled)
|
||||
{
|
||||
m_cart_disabled = 1;
|
||||
setup_ram(2, m_ram->size());
|
||||
}
|
||||
else if (!(offset & 0x8))
|
||||
{
|
||||
if (m_cart_disabled)
|
||||
switch (m_cart->get_cart_type())
|
||||
{
|
||||
case A800_PHOENIX:
|
||||
case A800_BLIZZARD:
|
||||
if (!m_cart_disabled)
|
||||
{
|
||||
m_cart_disabled = 0;
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xa000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)m_cartslot));
|
||||
m_cart_disabled = 1;
|
||||
setup_ram(2, m_ram->size());
|
||||
}
|
||||
break;
|
||||
case A800_OSS034M:
|
||||
case A800_OSS043M:
|
||||
case A800_EXPRESS:
|
||||
case A800_DIAMOND:
|
||||
case A800_WILLIAMS:
|
||||
// use m_cart_disabled & m_last_offs to avoid continuous remapping of
|
||||
// the memory space in some games (e.g. dropzone)
|
||||
if (offset & 0x8 && !m_cart_disabled)
|
||||
{
|
||||
m_cart_disabled = 1;
|
||||
setup_ram(2, m_ram->size());
|
||||
}
|
||||
else if (!(offset & 0x8))
|
||||
{
|
||||
if (m_cart_disabled)
|
||||
{
|
||||
m_cart_disabled = 0;
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xa000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
|
||||
}
|
||||
|
||||
if ((offset & 0x7) != m_last_offs)
|
||||
{
|
||||
// we enter here only if we are writing to a different offset than last time
|
||||
m_last_offs = offset & 0x7;
|
||||
m_cart->write_d5xx(space, offset, data);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case A800_TURBO64:
|
||||
case A800_TURBO128:
|
||||
if (offset & 0x10 && !m_cart_disabled)
|
||||
{
|
||||
m_cart_disabled = 1;
|
||||
setup_ram(2, m_ram->size());
|
||||
}
|
||||
else if (!(offset & 0x10))
|
||||
{
|
||||
if (m_cart_disabled)
|
||||
{
|
||||
m_cart_disabled = 0;
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xa000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
|
||||
}
|
||||
|
||||
if ((offset & 0x0f) != m_last_offs)
|
||||
{
|
||||
// we enter here only if we are writing to a different offset than last time
|
||||
m_last_offs = offset & 0x0f;
|
||||
m_cart->write_d5xx(space, offset & 0x0f, data);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case A800_SPARTADOS:
|
||||
// writes with offset & 8 are also used to enable/disable the subcart, so they go through!
|
||||
m_cart->write_d5xx(space, offset, data);
|
||||
break;
|
||||
case A800_OSSM091:
|
||||
case A800_OSS8K:
|
||||
if ((offset & 0x9) == 0x08)
|
||||
setup_ram(2, m_ram->size());
|
||||
else
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xa000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
|
||||
m_cart->write_d5xx(space, offset, data);
|
||||
}
|
||||
|
||||
if ((offset & 0x7) != m_last_offs)
|
||||
break;
|
||||
case A800_MICROCALC:
|
||||
m_cart_disabled = (m_cart_disabled + 1) % 5;
|
||||
if (m_cart_disabled == 4)
|
||||
setup_ram(2, m_ram->size());
|
||||
else
|
||||
{
|
||||
// we enter here only if we are writing to a different offset than last time
|
||||
m_last_offs = offset & 0x7;
|
||||
m_cartslot->write_d5xx(space, offset, data);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case A800_TURBO64:
|
||||
case A800_TURBO128:
|
||||
if (offset & 0x10 && !m_cart_disabled)
|
||||
{
|
||||
m_cart_disabled = 1;
|
||||
setup_ram(2, m_ram->size());
|
||||
}
|
||||
else if (!(offset & 0x10))
|
||||
{
|
||||
if (m_cart_disabled)
|
||||
{
|
||||
m_cart_disabled = 0;
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xa000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xa000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
|
||||
m_cart->write_d5xx(space, offset, m_cart_disabled);
|
||||
}
|
||||
|
||||
if ((offset & 0x0f) != m_last_offs)
|
||||
{
|
||||
// we enter here only if we are writing to a different offset than last time
|
||||
m_last_offs = offset & 0x0f;
|
||||
m_cartslot->write_d5xx(space, offset & 0x0f, data);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case A800_SPARTADOS:
|
||||
// writes with offset & 8 are also used to enable/disable the subcart, so they go through!
|
||||
m_cartslot->write_d5xx(space, offset, data);
|
||||
break;
|
||||
case A800_OSSM091:
|
||||
case A800_OSS8K:
|
||||
if ((offset & 0x9) == 0x08)
|
||||
setup_ram(2, m_ram->size());
|
||||
else
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xa000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
|
||||
m_cartslot->write_d5xx(space, offset, data);
|
||||
}
|
||||
break;
|
||||
case A800_MICROCALC:
|
||||
m_cart_disabled = (m_cart_disabled + 1) % 5;
|
||||
if (m_cart_disabled == 4)
|
||||
setup_ram(2, m_ram->size());
|
||||
else
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xa000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
|
||||
m_cartslot->write_d5xx(space, offset, m_cart_disabled);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void a400_state::setup_cart(a800_cart_slot_device *slot)
|
||||
@ -1836,97 +1838,99 @@ void a400_state::setup_cart(a800_cart_slot_device *slot)
|
||||
m_last_offs = -1;
|
||||
|
||||
if (slot->exists())
|
||||
switch (slot->get_cart_type())
|
||||
{
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
break;
|
||||
case A800_8K_RIGHT:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0x9fff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x8000, 0x9fff);
|
||||
break;
|
||||
case A800_16K:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x8000, 0xbfff);
|
||||
break;
|
||||
case A800_PHOENIX:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd500, 0xd5ff, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_BBSB:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0x9fff, write8_delegate(FUNC(a800_cart_slot_device::write_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
|
||||
break;
|
||||
case A800_OSS034M:
|
||||
case A800_OSS043M:
|
||||
case A800_OSSM091:
|
||||
case A800_OSS8K:
|
||||
case A800_TURBO64:
|
||||
case A800_TURBO128:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd500, 0xd5ff, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_MICROCALC:
|
||||
// this can also disable ROM when reading in 0xd500-0xd5ff
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xd500, 0xd5ff, read8_delegate(FUNC(a400_state::read_d5xx), this), write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_EXPRESS:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd570, 0xd57f, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_DIAMOND:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd5d0, 0xd5df, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_WILLIAMS:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd500, 0xd50f, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_SPARTADOS:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd5e0, 0xd5ef, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_TELELINK2:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x9000, 0x90ff, write8_delegate(FUNC(a800_cart_slot_device::write_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xd501, 0xd501, read8_delegate(FUNC(a800_cart_slot_device::read_d5xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd502, 0xd502, write8_delegate(FUNC(a800_cart_slot_device::write_d5xx),(a800_cart_slot_device*)slot));
|
||||
break;
|
||||
case A800_BLIZZARD:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x8000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd500, 0xd5ff, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_XEGS:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x8000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd500, 0xd5ff, write8_delegate(FUNC(a800_cart_slot_device::write_d5xx),(a800_cart_slot_device*)slot));
|
||||
break;
|
||||
case A5200_4K:
|
||||
case A5200_8K:
|
||||
case A5200_16K:
|
||||
case A5200_32K:
|
||||
case A5200_16K_2CHIPS:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x4000, 0xbfff);
|
||||
break;
|
||||
case A5200_BBSB:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x4000, 0x5fff, write8_delegate(FUNC(a800_cart_slot_device::write_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x6000, 0xbfff);
|
||||
break;
|
||||
}
|
||||
switch (slot->get_cart_type())
|
||||
{
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
break;
|
||||
case A800_8K_RIGHT:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0x9fff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x8000, 0x9fff);
|
||||
break;
|
||||
case A800_16K:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x8000, 0xbfff);
|
||||
break;
|
||||
case A800_PHOENIX:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd500, 0xd5ff, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_BBSB:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0x9fff, write8_delegate(FUNC(a800_cart_slot_device::write_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
|
||||
break;
|
||||
case A800_OSS034M:
|
||||
case A800_OSS043M:
|
||||
case A800_OSSM091:
|
||||
case A800_OSS8K:
|
||||
case A800_TURBO64:
|
||||
case A800_TURBO128:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd500, 0xd5ff, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_MICROCALC:
|
||||
// this can also disable ROM when reading in 0xd500-0xd5ff
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xd500, 0xd5ff, read8_delegate(FUNC(a400_state::read_d5xx), this), write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_EXPRESS:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd570, 0xd57f, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_DIAMOND:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd5d0, 0xd5df, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_WILLIAMS:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd500, 0xd50f, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_SPARTADOS:
|
||||
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).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd5e0, 0xd5ef, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_TELELINK2:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x9000, 0x90ff, write8_delegate(FUNC(a800_cart_slot_device::write_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xd501, 0xd501, read8_delegate(FUNC(a800_cart_slot_device::read_d5xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd502, 0xd502, write8_delegate(FUNC(a800_cart_slot_device::write_d5xx),(a800_cart_slot_device*)slot));
|
||||
break;
|
||||
case A800_BLIZZARD:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x8000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd500, 0xd5ff, write8_delegate(FUNC(a400_state::disable_cart), this));
|
||||
break;
|
||||
case A800_XEGS:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x8000, 0xbfff);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd500, 0xd5ff, write8_delegate(FUNC(a800_cart_slot_device::write_d5xx),(a800_cart_slot_device*)slot));
|
||||
break;
|
||||
case A5200_4K:
|
||||
case A5200_8K:
|
||||
case A5200_16K:
|
||||
case A5200_32K:
|
||||
case A5200_16K_2CHIPS:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x4000, 0xbfff);
|
||||
break;
|
||||
case A5200_BBSB:
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0xbfff, read8_delegate(FUNC(a800_cart_slot_device::read_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x4000, 0x5fff, write8_delegate(FUNC(a800_cart_slot_device::write_80xx),(a800_cart_slot_device*)slot));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x6000, 0xbfff);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1957,7 +1961,7 @@ MACHINE_START_MEMBER( a400_state, a400 )
|
||||
setup_ram(0, m_ram->size());
|
||||
setup_ram(1, m_ram->size());
|
||||
setup_ram(2, m_ram->size());
|
||||
setup_cart(m_cartslot);
|
||||
setup_cart(m_cart);
|
||||
|
||||
save_item(NAME(m_cart_disabled));
|
||||
save_item(NAME(m_last_offs));
|
||||
@ -1969,8 +1973,8 @@ MACHINE_START_MEMBER( a400_state, a800 )
|
||||
setup_ram(0, m_ram->size());
|
||||
setup_ram(1, m_ram->size());
|
||||
setup_ram(2, m_ram->size());
|
||||
setup_cart(m_cartslot);
|
||||
setup_cart(m_cartslot2);
|
||||
setup_cart(m_cart);
|
||||
setup_cart(m_cart2);
|
||||
|
||||
save_item(NAME(m_cart_disabled));
|
||||
save_item(NAME(m_last_offs));
|
||||
@ -1980,7 +1984,7 @@ MACHINE_START_MEMBER( a400_state, a800xl )
|
||||
{
|
||||
m_mmu = 0xfd;
|
||||
m_ext_bank = 0x03; // only used by a130xe
|
||||
setup_cart(m_cartslot);
|
||||
setup_cart(m_cart);
|
||||
|
||||
save_item(NAME(m_cart_disabled));
|
||||
save_item(NAME(m_last_offs));
|
||||
@ -1991,7 +1995,7 @@ MACHINE_START_MEMBER( a400_state, a800xl )
|
||||
|
||||
MACHINE_START_MEMBER( a400_state, a5200 )
|
||||
{
|
||||
setup_cart(m_cartslot);
|
||||
setup_cart(m_cart);
|
||||
|
||||
save_item(NAME(m_cart_disabled));
|
||||
save_item(NAME(m_last_offs));
|
||||
|
@ -2118,34 +2118,48 @@ void gba_state::machine_start()
|
||||
m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::handle_irq),this));
|
||||
m_irq_timer->adjust(attotime::never);
|
||||
|
||||
// install the cart ROM into the address map, if present
|
||||
m_cartslot->install_rom();
|
||||
// install the cart ROM & SRAM into the address map, if present
|
||||
if (m_cart->exists())
|
||||
{
|
||||
address_space &space = machine().device<cpu_device>("maincpu")->space(AS_PROGRAM);
|
||||
space.install_read_bank(0x08000000, 0x09ffffff, 0, 0, "rom1");
|
||||
space.install_read_bank(0x0a000000, 0x0bffffff, 0, 0, "rom2");
|
||||
space.install_read_bank(0x0c000000, 0x0cffffff, 0, 0, "rom3");
|
||||
|
||||
// add nvram to save state
|
||||
m_cartslot->save_nvram();
|
||||
astring region_tag;
|
||||
memory_region *cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GBASLOT_ROM_REGION_TAG));
|
||||
|
||||
// install the cart NVRAM handlers if necessary
|
||||
if (m_cartslot->get_type() == GBA_SRAM)
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe000000, 0xe00ffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000000, 0xe00ffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cartslot));
|
||||
}
|
||||
if (m_cartslot->get_type() == GBA_EEPROM || m_cartslot->get_type() == GBA_EEPROM4 || m_cartslot->get_type() == GBA_EEPROM64)
|
||||
{
|
||||
// for games larger than 16MB the actual range is smaller but read_ram/write_ram handles that!
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xd000000, 0xdffffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd000000, 0xdffffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cartslot));
|
||||
}
|
||||
// merge the two flash and mask accesses in read_ram?!?
|
||||
if (m_cartslot->get_type() == GBA_FLASH || m_cartslot->get_type() == GBA_FLASH512)
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe000000, 0xe00ffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000000, 0xe00ffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cartslot));
|
||||
}
|
||||
if (m_cartslot->get_type() == GBA_FLASH1M)
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe000000, 0xe01ffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000000, 0xe01ffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cartslot));
|
||||
// install ROM accesses
|
||||
membank("rom1")->set_base(cart_rom->base());
|
||||
membank("rom2")->set_base(cart_rom->base());
|
||||
membank("rom3")->set_base(cart_rom->base());
|
||||
|
||||
// add nvram to save state
|
||||
m_cart->save_nvram();
|
||||
|
||||
// install the cart NVRAM handlers if necessary
|
||||
if (m_cart->get_type() == GBA_SRAM)
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe000000, 0xe00ffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000000, 0xe00ffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cart));
|
||||
}
|
||||
if (m_cart->get_type() == GBA_EEPROM || m_cart->get_type() == GBA_EEPROM4 || m_cart->get_type() == GBA_EEPROM64)
|
||||
{
|
||||
// for games larger than 16MB the actual range is smaller but read_ram/write_ram handles that!
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xd000000, 0xdffffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd000000, 0xdffffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cart));
|
||||
}
|
||||
// merge the two flash and mask accesses in read_ram?!?
|
||||
if (m_cart->get_type() == GBA_FLASH || m_cart->get_type() == GBA_FLASH512)
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe000000, 0xe00ffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000000, 0xe00ffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cart));
|
||||
}
|
||||
if (m_cart->get_type() == GBA_FLASH1M)
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe000000, 0xe01ffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000000, 0xe01ffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cart));
|
||||
}
|
||||
}
|
||||
|
||||
save_item(NAME(m_DISPSTAT));
|
||||
|
@ -91,8 +91,8 @@ READ8_MEMBER(md_cons_state::mess_md_io_read_data_port)
|
||||
else
|
||||
{
|
||||
UINT8 svp_test = 0;
|
||||
if (m_slotcart)
|
||||
svp_test = m_slotcart->read_test();
|
||||
if (m_cart)
|
||||
svp_test = m_cart->read_test();
|
||||
|
||||
// handle test input for SVP test
|
||||
if (portnum == 0 && svp_test)
|
||||
@ -266,8 +266,8 @@ MACHINE_START_MEMBER(md_cons_state, md_common)
|
||||
|
||||
m_vdp->stop_timers();
|
||||
|
||||
if (m_slotcart)
|
||||
m_slotcart->save_nvram();
|
||||
if (m_cart)
|
||||
m_cart->save_nvram();
|
||||
}
|
||||
|
||||
MACHINE_START_MEMBER(md_cons_state, ms_megadriv)
|
||||
@ -275,14 +275,14 @@ MACHINE_START_MEMBER(md_cons_state, ms_megadriv)
|
||||
MACHINE_START_CALL_MEMBER( md_common );
|
||||
|
||||
// the SVP introduces some kind of DMA 'lag', which we have to compensate for, this is obvious even on gfx DMAd from ROM (the Speedometer)
|
||||
if (m_slotcart->get_type() == SEGA_SVP)
|
||||
if (m_cart->get_type() == SEGA_SVP)
|
||||
m_vdp->set_dma_delay(2);
|
||||
|
||||
// for now m_cartslot is only in MD and not 32x and SegaCD
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7fffff, read16_delegate(FUNC(base_md_cart_slot_device::read),(base_md_cart_slot_device*)m_slotcart), write16_delegate(FUNC(base_md_cart_slot_device::write),(base_md_cart_slot_device*)m_slotcart));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa13000, 0xa130ff, read16_delegate(FUNC(base_md_cart_slot_device::read_a13),(base_md_cart_slot_device*)m_slotcart), write16_delegate(FUNC(base_md_cart_slot_device::write_a13),(base_md_cart_slot_device*)m_slotcart));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa15000, 0xa150ff, read16_delegate(FUNC(base_md_cart_slot_device::read_a15),(base_md_cart_slot_device*)m_slotcart), write16_delegate(FUNC(base_md_cart_slot_device::write_a15),(base_md_cart_slot_device*)m_slotcart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xa14000, 0xa14003, write16_delegate(FUNC(base_md_cart_slot_device::write_tmss_bank),(base_md_cart_slot_device*)m_slotcart));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7fffff, read16_delegate(FUNC(base_md_cart_slot_device::read),(base_md_cart_slot_device*)m_cart), write16_delegate(FUNC(base_md_cart_slot_device::write),(base_md_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa13000, 0xa130ff, read16_delegate(FUNC(base_md_cart_slot_device::read_a13),(base_md_cart_slot_device*)m_cart), write16_delegate(FUNC(base_md_cart_slot_device::write_a13),(base_md_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa15000, 0xa150ff, read16_delegate(FUNC(base_md_cart_slot_device::read_a15),(base_md_cart_slot_device*)m_cart), write16_delegate(FUNC(base_md_cart_slot_device::write_a15),(base_md_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xa14000, 0xa14003, write16_delegate(FUNC(base_md_cart_slot_device::write_tmss_bank),(base_md_cart_slot_device*)m_cart));
|
||||
}
|
||||
|
||||
MACHINE_START_MEMBER(md_cons_state, ms_megacd)
|
||||
|
@ -156,7 +156,7 @@ public:
|
||||
: pico_base_state(mconfig, type, tag),
|
||||
m_picocart(*this, "picoslot") { }
|
||||
|
||||
optional_device<pico_cart_slot_device> m_picocart;
|
||||
required_device<pico_cart_slot_device> m_picocart;
|
||||
DECLARE_MACHINE_START(pico);
|
||||
};
|
||||
|
||||
@ -519,7 +519,7 @@ public:
|
||||
: pico_base_state(mconfig, type, tag),
|
||||
m_picocart(*this, "coperaslot") { }
|
||||
|
||||
optional_device<copera_cart_slot_device> m_picocart;
|
||||
required_device<copera_cart_slot_device> m_picocart;
|
||||
DECLARE_MACHINE_START(copera);
|
||||
};
|
||||
|
||||
|
@ -79,16 +79,16 @@ Notes:
|
||||
// for the moment let assume the latter!
|
||||
READ8_MEMBER( sg1000_state::omv_r )
|
||||
{
|
||||
if (m_cartslot && m_cartslot->m_cart)
|
||||
return m_cartslot->m_cart->read_cart(space, offset);
|
||||
if (m_cart && m_cart->exists())
|
||||
return m_cart->read_cart(space, offset);
|
||||
else
|
||||
return m_rom->base()[offset];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( sg1000_state::omv_w )
|
||||
{
|
||||
if (m_cartslot && m_cartslot->m_cart)
|
||||
m_cartslot->m_cart->write_cart(space, offset, data);
|
||||
if (m_cart && m_cart->exists())
|
||||
m_cart->write_cart(space, offset, data);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
@ -633,14 +633,14 @@ SLOT_INTERFACE_END
|
||||
|
||||
void sg1000_state::machine_start()
|
||||
{
|
||||
if (m_cartslot->get_type() == SEGA8_DAHJEE_TYPEA || m_cartslot->get_type() == SEGA8_DAHJEE_TYPEB)
|
||||
if (m_cart->get_type() == SEGA8_DAHJEE_TYPEA || m_cart->get_type() == SEGA8_DAHJEE_TYPEB)
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(sega8_cart_slot_device::read_ram),(sega8_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc000, 0xffff, 0, 0, write8_delegate(FUNC(sega8_cart_slot_device::write_ram),(sega8_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(sega8_cart_slot_device::read_ram),(sega8_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc000, 0xffff, 0, 0, write8_delegate(FUNC(sega8_cart_slot_device::write_ram),(sega8_cart_slot_device*)m_cart));
|
||||
}
|
||||
|
||||
if (m_cartslot)
|
||||
m_cartslot->save_ram();
|
||||
if (m_cart)
|
||||
m_cart->save_ram();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
@ -673,15 +673,15 @@ void sc3000_state::machine_start()
|
||||
/* register for state saving */
|
||||
save_item(NAME(m_keylatch));
|
||||
|
||||
if (m_cartslot && (m_cartslot->get_type() == SEGA8_BASIC_L3 || m_cartslot->get_type() == SEGA8_MUSIC_EDITOR
|
||||
|| m_cartslot->get_type() == SEGA8_DAHJEE_TYPEA || m_cartslot->get_type() == SEGA8_DAHJEE_TYPEB))
|
||||
if (m_cart && m_cart->exists() && (m_cart->get_type() == SEGA8_BASIC_L3 || m_cart->get_type() == SEGA8_MUSIC_EDITOR
|
||||
|| m_cart->get_type() == SEGA8_DAHJEE_TYPEA || m_cart->get_type() == SEGA8_DAHJEE_TYPEB))
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(sega8_cart_slot_device::read_ram),(sega8_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc000, 0xffff, 0, 0, write8_delegate(FUNC(sega8_cart_slot_device::write_ram),(sega8_cart_slot_device*)m_cartslot));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(sega8_cart_slot_device::read_ram),(sega8_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc000, 0xffff, 0, 0, write8_delegate(FUNC(sega8_cart_slot_device::write_ram),(sega8_cart_slot_device*)m_cart));
|
||||
}
|
||||
|
||||
if (m_cartslot)
|
||||
m_cartslot->save_ram();
|
||||
if (m_cart)
|
||||
m_cart->save_ram();
|
||||
}
|
||||
|
||||
|
||||
|
@ -138,7 +138,7 @@ public:
|
||||
m_lbdac(*this, "direct_b_left"),
|
||||
m_rbdac(*this, "direct_b_right"),
|
||||
m_gbsound(*this, "custom"),
|
||||
m_cartslot(*this, "cartslot"),
|
||||
m_cart(*this, "cartslot"),
|
||||
m_region_maincpu(*this, "maincpu"),
|
||||
m_io_in0(*this, "IN0")
|
||||
{ }
|
||||
@ -152,7 +152,7 @@ public:
|
||||
required_device<dac_device> m_lbdac;
|
||||
required_device<dac_device> m_rbdac;
|
||||
required_device<gameboy_sound_device> m_gbsound;
|
||||
required_device<gba_cart_slot_device> m_cartslot;
|
||||
required_device<gba_cart_slot_device> m_cart;
|
||||
|
||||
void request_irq(UINT32 int_type);
|
||||
void dma_exec(FPTR ch);
|
||||
|
@ -13,7 +13,7 @@ public:
|
||||
: md_base_state(mconfig, type, tag),
|
||||
m_32x(*this,"sega32x"),
|
||||
m_segacd(*this,"segacd"),
|
||||
m_slotcart(*this, "mdslot")
|
||||
m_cart(*this, "mdslot")
|
||||
{ }
|
||||
|
||||
ioport_port *m_io_ctrlr;
|
||||
@ -22,7 +22,7 @@ public:
|
||||
|
||||
optional_device<sega_32x_device> m_32x;
|
||||
optional_device<sega_segacd_device> m_segacd;
|
||||
optional_device<md_cart_slot_device> m_slotcart;
|
||||
optional_device<md_cart_slot_device> m_cart;
|
||||
|
||||
DECLARE_DRIVER_INIT(mess_md_common);
|
||||
DECLARE_DRIVER_INIT(genesis);
|
||||
|
@ -49,13 +49,13 @@ public:
|
||||
m_maincpu(*this, Z80_TAG),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_rom(*this, Z80_TAG),
|
||||
m_cartslot(*this, CARTSLOT_TAG)
|
||||
m_cart(*this, CARTSLOT_TAG)
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<ram_device> m_ram;
|
||||
required_memory_region m_rom;
|
||||
optional_device<sega8_cart_slot_device> m_cartslot;
|
||||
optional_device<sega8_cart_slot_device> m_cart;
|
||||
|
||||
virtual void machine_start();
|
||||
|
||||
|
@ -206,7 +206,7 @@ READ8_MEMBER(sms_state::sms_count_r)
|
||||
*/
|
||||
WRITE_LINE_MEMBER(sms_state::sms_pause_callback)
|
||||
{
|
||||
if (m_is_gamegear && m_cartslot->m_cart && !m_cartslot->m_cart->get_sms_mode())
|
||||
if (m_is_gamegear && m_cartslot->exists() && !m_cartslot->m_cart->get_sms_mode())
|
||||
return;
|
||||
|
||||
if ((m_is_gamegear && !(m_port_start->read() & 0x80)) || (!m_is_gamegear && !(m_port_pause->read() & 0x80)))
|
||||
@ -642,12 +642,12 @@ void sms_state::setup_enabled_slots()
|
||||
// (/CART pin) that prioritizes the cartridge slot if it has media
|
||||
// inserted. Japanese 3-D cartridges do not connect the /CART pin,
|
||||
// to not disable the card adaptor used by the 3-D glasses.
|
||||
if (m_cartslot && m_cartslot->m_cart)
|
||||
if (m_cartslot && m_cartslot->exists())
|
||||
{
|
||||
m_mem_device_enabled |= ENABLE_CART;
|
||||
logerror("Cartridge ROM/RAM enabled.\n");
|
||||
}
|
||||
else if (m_cardslot && m_cardslot->m_cart)
|
||||
else if (m_cardslot && m_cardslot->exists())
|
||||
{
|
||||
m_mem_device_enabled |= ENABLE_CARD;
|
||||
logerror("Card ROM port enabled.\n");
|
||||
@ -661,13 +661,13 @@ void sms_state::setup_enabled_slots()
|
||||
logerror("Expansion port enabled.\n");
|
||||
}
|
||||
|
||||
if (!(m_mem_ctrl_reg & IO_CARD) && m_cardslot && m_cardslot->m_cart)
|
||||
if (!(m_mem_ctrl_reg & IO_CARD) && m_cardslot && m_cardslot->exists())
|
||||
{
|
||||
m_mem_device_enabled |= ENABLE_CARD;
|
||||
logerror("Card ROM port enabled.\n");
|
||||
}
|
||||
|
||||
if (!(m_mem_ctrl_reg & IO_CARTRIDGE) && m_cartslot && m_cartslot->m_cart)
|
||||
if (!(m_mem_ctrl_reg & IO_CARTRIDGE) && m_cartslot && m_cartslot->exists())
|
||||
{
|
||||
m_mem_device_enabled |= ENABLE_CART;
|
||||
logerror("Cartridge ROM/RAM enabled.\n");
|
||||
@ -852,7 +852,7 @@ MACHINE_RESET_MEMBER(sms_state,sms)
|
||||
|
||||
if (m_is_gamegear)
|
||||
{
|
||||
if (m_cartslot->m_cart && m_cartslot->m_cart->get_sms_mode())
|
||||
if (m_cartslot->exists() && m_cartslot->m_cart->get_sms_mode())
|
||||
m_vdp->set_sega315_5124_compatibility_mode(true);
|
||||
|
||||
/* Initialize SIO stuff for GG */
|
||||
|
Loading…
Reference in New Issue
Block a user