mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
bus: Get rid of some dubious tag manipulation.
The implementation details of how the cartridges allocate storage for memory really shouldn't be part of the interface. Having tags in the headers encourages people to depend on these implementation details. This gets rid of it in most of the headers. A few particularly leaky abstractions (bbc/rom, electron/cart, gba, generic, jakks_gamekey, m5) depend on this, so it can't be removed in those cases without further refactoring to encapsulate the slot devices better. This doesn't change behaviour, it just mechanically removes stuff from the headers and uses device_t::subtag rather than string manipulation on tags. Most of the cartridge devices shouldn't have rom_alloc member functions at all - the region created by the software list loader can be used directly when loading from the software list, and the slot can allocate a region with the same tag when loading loose software. This avoids creating an extra region and copying the data when loading from the software list. See vboy for an example that doesn't allocate a superfluous region.
This commit is contained in:
parent
782884c0e2
commit
27d1b900e2
@ -61,11 +61,11 @@ device_a78_cart_interface::~device_a78_cart_interface ()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_a78_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_a78_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(A78SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
|
||||
// setup other helpers
|
||||
@ -345,7 +345,7 @@ image_init_result 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, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
memcpy(m_cart->get_rom_base(), get_software_region("rom"), len);
|
||||
|
||||
if ((pcb_name = get_feature("slot")) != nullptr)
|
||||
@ -445,7 +445,7 @@ image_init_result a78_cart_slot_device::call_load()
|
||||
|
||||
internal_header_logging((uint8_t *)head, length());
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
fread(m_cart->get_rom_base(), len);
|
||||
|
||||
if (m_type == A78_TYPE6 || m_type == A78_TYPE8)
|
||||
@ -792,7 +792,7 @@ void a78_cart_slot_device::internal_header_logging(uint8_t *header, uint32_t len
|
||||
logerror( "==============\n\n" );
|
||||
logerror( "\tTitle: %.32s\n", head_title);
|
||||
logerror( "\tLength: 0x%X [real 0x%X]\n", head_length, len);
|
||||
logerror( "\tMapper: %s [0x%X]\n", cart_mapper.c_str(), head_mapper);
|
||||
logerror( "\tMapper: %s [0x%X]\n", cart_mapper, head_mapper);
|
||||
logerror( "\t\tPOKEY: %s\n", BIT(head_mapper, 0) ? "Yes" : "No");
|
||||
logerror( "\t\tSC Bankswitch: %s\n", BIT(head_mapper, 1) ? "Yes" : "No");
|
||||
logerror( "\t\tRAM at $4000: %s\n", BIT(head_mapper, 2) ? "Yes" : "No");
|
||||
@ -809,7 +809,7 @@ void a78_cart_slot_device::internal_header_logging(uint8_t *header, uint32_t len
|
||||
}
|
||||
else
|
||||
logerror( "\n");
|
||||
logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1.c_str());
|
||||
logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2.c_str());
|
||||
logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1);
|
||||
logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2);
|
||||
logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC");
|
||||
}
|
||||
|
@ -12,8 +12,6 @@
|
||||
TYPE DEFINITIONS
|
||||
***************************************************************************/
|
||||
|
||||
#define A78SLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
/* PCB */
|
||||
enum
|
||||
{
|
||||
@ -58,7 +56,7 @@ public:
|
||||
virtual void write_30xx(offs_t offset, uint8_t data) {}
|
||||
virtual void write_40xx(offs_t offset, uint8_t data) {}
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void ram_alloc(uint32_t size);
|
||||
void nvram_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
|
@ -60,11 +60,11 @@ device_a800_cart_interface::~device_a800_cart_interface ()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_a800_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_a800_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(A800SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
|
||||
// setup other helpers
|
||||
@ -235,7 +235,7 @@ image_init_result a800_cart_slot_device::call_load()
|
||||
const char *pcb_name;
|
||||
len = get_software_region_length("rom");
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
memcpy(m_cart->get_rom_base(), get_software_region("rom"), len);
|
||||
|
||||
if ((pcb_name = get_feature("slot")) != nullptr)
|
||||
@ -271,7 +271,7 @@ image_init_result a800_cart_slot_device::call_load()
|
||||
m_type = A5200_16K_2CHIPS;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
fread(m_cart->get_rom_base(), len);
|
||||
}
|
||||
if (m_type == A800_TELELINK2)
|
||||
|
@ -12,8 +12,6 @@
|
||||
TYPE DEFINITIONS
|
||||
***************************************************************************/
|
||||
|
||||
#define A800SLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
/* PCB */
|
||||
enum
|
||||
{
|
||||
@ -60,7 +58,7 @@ public:
|
||||
virtual void write_80xx(offs_t offset, uint8_t data) {}
|
||||
virtual void write_d5xx(offs_t offset, uint8_t data) {}
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void ram_alloc(uint32_t size);
|
||||
void nvram_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
|
@ -44,11 +44,11 @@ device_apf_cart_interface::~device_apf_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_apf_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_apf_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(APFSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -156,7 +156,7 @@ image_init_result apf_cart_slot_device::call_load()
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(size, tag());
|
||||
m_cart->rom_alloc(size);
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
fread(m_cart->get_rom_base(), size);
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
virtual uint8_t read_ram(offs_t offset) { return 0xff; }
|
||||
virtual void write_ram(offs_t offset, uint8_t data) {}
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void ram_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint8_t* get_ram_base() { return &m_ram[0]; }
|
||||
@ -102,15 +102,7 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(APF_CART_SLOT, apf_cart_slot_device)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define APFSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#endif // MAME_BUS_APF_SLOT_H
|
||||
|
@ -38,11 +38,11 @@ device_aquarius_cartridge_interface::device_aquarius_cartridge_interface(const m
|
||||
// rom_alloc - alloc the space for the ROM
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_aquarius_cartridge_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_aquarius_cartridge_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(AQUARIUS_CART_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -95,7 +95,7 @@ image_init_result aquarius_cartridge_slot_device::call_load()
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(size, tag());
|
||||
m_cart->rom_alloc(size);
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
fread(m_cart->get_rom_base(), size);
|
||||
|
@ -14,8 +14,6 @@
|
||||
#include "imagedev/cartrom.h"
|
||||
|
||||
|
||||
#define AQUARIUS_CART_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
@ -92,7 +90,7 @@ public:
|
||||
virtual uint8_t iorq_r(offs_t offset) { return 0xff; }
|
||||
virtual void iorq_w(offs_t offset, uint8_t data) { }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint32_t get_rom_size() { return m_rom_size; }
|
||||
|
||||
|
@ -44,11 +44,11 @@ device_arcadia_cart_interface::~device_arcadia_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_arcadia_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_arcadia_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(EA2001SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -139,7 +139,7 @@ image_init_result arcadia_cart_slot_device::call_load()
|
||||
{
|
||||
uint32_t len = !loaded_through_softlist() ? length() : get_software_region_length("rom");
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
fread(m_cart->get_rom_base(), len);
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
#include "imagedev/cartrom.h"
|
||||
|
||||
#define EA2001SLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
/***************************************************************************
|
||||
TYPE DEFINITIONS
|
||||
@ -31,7 +30,7 @@ public:
|
||||
virtual uint8_t read_rom(offs_t offset) { return 0xff; }
|
||||
virtual uint8_t extra_rom(offs_t offset) { return 0xff; }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint32_t get_rom_size() { return m_rom_size; }
|
||||
|
||||
|
@ -44,11 +44,11 @@ device_astrocade_cart_interface::~device_astrocade_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_astrocade_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_astrocade_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(ASTROCADESLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -139,7 +139,7 @@ image_init_result astrocade_cart_slot_device::call_load()
|
||||
if (m_cart)
|
||||
{
|
||||
uint32_t size = !loaded_through_softlist() ? length() : get_software_region_length("rom");
|
||||
m_cart->rom_alloc(size, tag());
|
||||
m_cart->rom_alloc(size);
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
fread(m_cart->get_rom_base(), size);
|
||||
|
@ -12,8 +12,6 @@
|
||||
TYPE DEFINITIONS
|
||||
***************************************************************************/
|
||||
|
||||
#define ASTROCADESLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
/* PCB */
|
||||
enum
|
||||
{
|
||||
@ -35,8 +33,8 @@ public:
|
||||
// reading and writing
|
||||
virtual uint8_t read_rom(offs_t offset) { return 0xff; }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
void rom_alloc(uint32_t size);
|
||||
uint8_t *get_rom_base() { return m_rom; }
|
||||
uint32_t get_rom_size() { return m_rom_size; }
|
||||
|
||||
protected:
|
||||
|
@ -50,7 +50,7 @@ void device_bbc_rom_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(BBC_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(BBC_ROM_REGION_TAG), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
@ -44,11 +44,11 @@ device_channelf_cart_interface::~device_channelf_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_channelf_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_channelf_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(CHANFSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -151,7 +151,7 @@ image_init_result channelf_cart_slot_device::call_load()
|
||||
if (m_cart)
|
||||
{
|
||||
uint32_t len = !loaded_through_softlist() ? length() : get_software_region_length("rom");
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
fread(m_cart->get_rom_base(), len);
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
virtual void write_ram(offs_t offset, uint8_t data) { }
|
||||
virtual void write_bank(uint8_t data) { }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void ram_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint8_t* get_ram_base() { return &m_ram[0]; }
|
||||
@ -111,11 +111,4 @@ protected:
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(CHANF_CART_SLOT, channelf_cart_slot_device)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define CHANFSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#endif // MAME_BUS_CHANF_SLOT_H
|
||||
|
@ -44,11 +44,11 @@ device_crvision_cart_interface::~device_crvision_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_crvision_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_crvision_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(CRVSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -149,7 +149,7 @@ image_init_result crvision_cart_slot_device::call_load()
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(size, tag());
|
||||
m_cart->rom_alloc(size);
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
fread(m_cart->get_rom_base(), size);
|
||||
|
@ -12,8 +12,6 @@
|
||||
TYPE DEFINITIONS
|
||||
***************************************************************************/
|
||||
|
||||
#define CRVSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
/* PCB */
|
||||
enum
|
||||
{
|
||||
@ -39,7 +37,7 @@ public:
|
||||
virtual uint8_t read_rom40(offs_t offset) { return 0xff; }
|
||||
virtual uint8_t read_rom80(offs_t offset) { return 0xff; }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint32_t get_rom_size() { return m_rom_size; }
|
||||
|
||||
|
@ -38,11 +38,11 @@ device_ekara_cart_interface::~device_ekara_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_ekara_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_ekara_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(EKARASLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_BIG)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_BIG)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -134,7 +134,7 @@ image_init_result ekara_cart_slot_device::call_load()
|
||||
uint8_t *ROM;
|
||||
uint32_t len = !loaded_through_softlist() ? length() : get_software_region_length("rom");
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
virtual bool is_read_access_not_rom(void) { return false; }
|
||||
virtual bool is_write_access_not_rom(void) { return false; }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint32_t get_rom_size() { return m_rom_size; }
|
||||
|
||||
@ -128,8 +128,6 @@ DECLARE_DEVICE_TYPE(EKARA_CART_SLOT, ekara_cart_slot_device)
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define EKARASLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
void ekara_cart(device_slot_interface &device);
|
||||
|
||||
#endif // MAME_BUS_EKARA_SLOT_H
|
||||
|
@ -52,12 +52,12 @@ void device_electron_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
{
|
||||
if (size <= 0x8000)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(ELECTRON_CART_ROM_REGION_TAG).c_str(), 0x8000, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(ELECTRON_CART_ROM_REGION_TAG), 0x8000, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = 0x8000;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(ELECTRON_CART_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(ELECTRON_CART_ROM_REGION_TAG), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
@ -38,11 +38,11 @@ device_gamate_cart_interface::~device_gamate_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_gamate_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_gamate_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(GAMATESLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_BIG)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_BIG)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -138,7 +138,7 @@ image_init_result gamate_cart_slot_device::call_load()
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
virtual uint8_t read_cart(offs_t offset) { return 0xff; }
|
||||
virtual void write_cart(offs_t offset, uint8_t data) { }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint32_t get_rom_size() { return m_rom_size; }
|
||||
|
||||
@ -97,8 +97,6 @@ DECLARE_DEVICE_TYPE(GAMATE_CART_SLOT, gamate_cart_slot_device)
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define GAMATESLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
void gamate_cart(device_slot_interface &device);
|
||||
|
||||
#endif // MAME_BUS_GAMATE_SLOT_H
|
||||
|
@ -58,11 +58,11 @@ device_gb_cart_interface::~device_gb_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_gb_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_gb_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(GBSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -272,7 +272,7 @@ image_init_result gb_cart_slot_device_base::call_load()
|
||||
}
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
@ -396,7 +396,7 @@ image_init_result megaduck_cart_slot_device::call_load()
|
||||
{
|
||||
uint32_t len = !loaded_through_softlist() ? length() : get_software_region_length("rom");
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
fread(m_cart->get_rom_base(), len);
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
virtual uint8_t read_ram(offs_t offset) { return 0xff; }
|
||||
virtual void write_ram(offs_t offset, uint8_t data) {}
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void ram_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint8_t* get_ram_base() { return &m_ram[0]; }
|
||||
@ -204,6 +204,4 @@ public:
|
||||
DECLARE_DEVICE_TYPE(GB_CART_SLOT, gb_cart_slot_device)
|
||||
DECLARE_DEVICE_TYPE(MEGADUCK_CART_SLOT, megaduck_cart_slot_device)
|
||||
|
||||
#define GBSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#endif // MAME_BUS_GAMEBOY_GB_SLOT_H
|
||||
|
@ -504,11 +504,11 @@ void device_gba_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
{
|
||||
if (size < 0x4000000)
|
||||
// we always alloc 32MB of rom region!
|
||||
m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG), 0x2000000, 4, ENDIANNESS_LITTLE)->base();
|
||||
else
|
||||
{
|
||||
m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x4000000, 4, ENDIANNESS_LITTLE)->base();
|
||||
m_romhlp = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBAHELP_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG), 0x4000000, 4, ENDIANNESS_LITTLE)->base();
|
||||
m_romhlp = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBAHELP_ROM_REGION_TAG), 0x2000000, 4, ENDIANNESS_LITTLE)->base();
|
||||
}
|
||||
m_rom_size = size;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ void device_generic_cart_interface::rom_alloc(u32 size, int width, endianness_t
|
||||
std::string fulltag(tag);
|
||||
fulltag.append(GENERIC_ROM_REGION_TAG);
|
||||
device().logerror("Allocating %u byte ROM region with tag '%s' (width %d)\n", size, fulltag, width);
|
||||
m_rom = device().machine().memory().region_alloc(fulltag.c_str(), size, width, endian)->base();
|
||||
m_rom = device().machine().memory().region_alloc(fulltag, size, width, endian)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
|
||||
|
@ -116,11 +116,11 @@ device_intv_cart_interface::~device_intv_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_intv_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_intv_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(INTVSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
memset(m_rom, 0xff, size);
|
||||
m_rom_size = size;
|
||||
}
|
||||
@ -251,7 +251,7 @@ image_init_result intv_cart_slot_device::load_fullpath()
|
||||
if (temp != (num_segments ^ 0xff))
|
||||
return image_init_result::FAIL;
|
||||
|
||||
m_cart->rom_alloc(0x20000, tag());
|
||||
m_cart->rom_alloc(0x20000);
|
||||
ROM = (uint8_t *)m_cart->get_rom_base();
|
||||
|
||||
for (int i = 0; i < num_segments; i++)
|
||||
@ -300,7 +300,7 @@ image_init_result intv_cart_slot_device::load_fullpath()
|
||||
int mapper, rom[5], ram, extra;
|
||||
std::string extrainfo;
|
||||
|
||||
m_cart->rom_alloc(0x20000, tag());
|
||||
m_cart->rom_alloc(0x20000);
|
||||
ROM = (uint8_t *)m_cart->get_rom_base();
|
||||
|
||||
if (!hashfile_extrainfo(*this, extrainfo))
|
||||
@ -401,7 +401,7 @@ image_init_result intv_cart_slot_device::call_load()
|
||||
uint16_t address;
|
||||
uint8_t *ROM, *region;
|
||||
|
||||
m_cart->rom_alloc(extra_bank ? 0x22000 : 0x20000, tag());
|
||||
m_cart->rom_alloc(extra_bank ? 0x22000 : 0x20000);
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
virtual void write_rome0(offs_t offset, uint16_t data) {}
|
||||
virtual void write_romf0(offs_t offset, uint16_t data) {}
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void ram_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint8_t* get_ram_base() { return &m_ram[0]; }
|
||||
@ -181,8 +181,6 @@ DECLARE_DEVICE_TYPE(INTV_CART_SLOT, intv_cart_slot_device)
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define INTVSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
void intv_cart(device_slot_interface &device);
|
||||
|
||||
#endif // MAME_BUS_INTV_SLOT_H
|
||||
|
@ -42,7 +42,7 @@ void device_jakks_gamekey_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(JAKKSSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_BIG)->base();
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(JAKKSSLOT_ROM_REGION_TAG), size, 1, ENDIANNESS_BIG)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ void device_m5_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(M5SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(M5SLOT_ROM_REGION_TAG), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ image_init_result mc10cart_slot_device::call_load()
|
||||
if (!loaded_through_softlist())
|
||||
{
|
||||
LOG("Allocating %u byte cartridge ROM region\n", len);
|
||||
romregion = machine().memory().region_alloc(subtag("rom").c_str(), len, 1, ENDIANNESS_BIG);
|
||||
romregion = machine().memory().region_alloc(subtag("rom"), len, 1, ENDIANNESS_BIG);
|
||||
u32 const cnt(fread(romregion->base(), len));
|
||||
if (cnt != len)
|
||||
{
|
||||
|
@ -82,11 +82,11 @@ device_md_cart_interface::~device_md_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_md_cart_interface::rom_alloc(size_t size, const char *tag)
|
||||
void device_md_cart_interface::rom_alloc(size_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = (uint16_t *)device().machine().memory().region_alloc(std::string(tag).append(MDSLOT_ROM_REGION_TAG).c_str(), size, 2, ENDIANNESS_BIG)->base();
|
||||
m_rom = (uint16_t *)device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 2, ENDIANNESS_BIG)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -360,7 +360,7 @@ image_init_result 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);
|
||||
|
||||
m_cart->rom_alloc(length, tag());
|
||||
m_cart->rom_alloc(length);
|
||||
ROM = m_cart->get_rom_base();
|
||||
memcpy((uint8_t *)ROM, get_software_region("rom"), get_software_region_length("rom"));
|
||||
|
||||
@ -472,8 +472,8 @@ image_init_result base_md_cart_slot_device::load_nonlist()
|
||||
// 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
|
||||
m_cart->rom_alloc((len == 0x500000) ? 0x900000 : len, tag());
|
||||
// this contains an hack for SSF2: its current bankswitch code needs larger ROM space to work
|
||||
m_cart->rom_alloc((len == 0x500000) ? 0x900000 : len);
|
||||
|
||||
// STEP 3: copy the game data in the appropriate way
|
||||
ROM = (unsigned char *)m_cart->get_rom_base();
|
||||
@ -1080,10 +1080,10 @@ void base_md_cart_slot_device::file_logging(uint8_t *ROM8, uint32_t rom_len, uin
|
||||
}
|
||||
logerror("Checksum: %X\n", checksum);
|
||||
logerror(" - Calculated Checksum: %X\n", csum);
|
||||
logerror("Supported I/O Devices: %.16s\n%s", io, ctrl.c_str());
|
||||
logerror("Supported I/O Devices: %.16s\n%s", io, ctrl);
|
||||
logerror("Modem: %.12s\n", modem);
|
||||
logerror("Memo: %.40s\n", memo);
|
||||
logerror("Country: %.16s\n%s", country, reg.c_str());
|
||||
logerror("Country: %.16s\n%s", country, reg);
|
||||
logerror("ROM Start: 0x%.8X\n", rom_start);
|
||||
logerror("ROM End: 0x%.8X\n", rom_end);
|
||||
logerror("RAM Start: 0x%.8X\n", ram_start);
|
||||
|
@ -111,7 +111,7 @@ public:
|
||||
// this probably should do more, like make Genesis V2 'die' if the SEGA string is not written promptly
|
||||
virtual void write_tmss_bank(offs_t offset, uint16_t data) { device().logerror("Write to TMSS bank: offset %x data %x\n", 0xa14000 + (offset << 1), data); }
|
||||
|
||||
virtual void rom_alloc(size_t size, const char *tag);
|
||||
virtual void rom_alloc(size_t size);
|
||||
virtual void nvram_alloc(size_t size);
|
||||
virtual uint16_t* get_rom_base() { return m_rom; }
|
||||
virtual uint16_t* get_nvram_base() { return &m_nvram[0]; }
|
||||
@ -268,11 +268,4 @@ DECLARE_DEVICE_TYPE(MD_CART_SLOT, md_cart_slot_device)
|
||||
DECLARE_DEVICE_TYPE(PICO_CART_SLOT, pico_cart_slot_device)
|
||||
DECLARE_DEVICE_TYPE(COPERA_CART_SLOT, copera_cart_slot_device)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define MDSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#endif // MAME_BUS_MEGADRIVE_MD_SLOT_H
|
||||
|
@ -42,7 +42,7 @@ void device_mtx_exp_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(":cart:rom").c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(":cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
@ -1104,9 +1104,9 @@ void nes_cart_slot_device::call_load_ines()
|
||||
|
||||
// SETUP step 5: allocate pointers for PRG/VROM
|
||||
if (prg_size)
|
||||
m_cart->prg_alloc(prg_size, tag());
|
||||
m_cart->prg_alloc(prg_size);
|
||||
if (vrom_size)
|
||||
m_cart->vrom_alloc(vrom_size, tag());
|
||||
m_cart->vrom_alloc(vrom_size);
|
||||
|
||||
// if there is a trainer, skip it for the moment
|
||||
if (m_cart->get_trainer())
|
||||
|
@ -752,11 +752,11 @@ void nes_cart_slot_device::call_load_pcb()
|
||||
logerror("-- PRG WRAM: %d\n", prgram_size);
|
||||
|
||||
// SETUP steps 5/6: allocate pointers for PRG/VROM and load the data!
|
||||
m_cart->prg_alloc(prg_size, tag());
|
||||
m_cart->prg_alloc(prg_size);
|
||||
memcpy(m_cart->get_prg_base(), get_software_region("prg"), prg_size);
|
||||
if (vrom_size)
|
||||
{
|
||||
m_cart->vrom_alloc(vrom_size, tag());
|
||||
m_cart->vrom_alloc(vrom_size);
|
||||
memcpy(m_cart->get_vrom_base(), get_software_region("chr"), vrom_size);
|
||||
}
|
||||
|
||||
@ -766,7 +766,7 @@ void nes_cart_slot_device::call_load_pcb()
|
||||
uint32_t dpcm_size = get_software_region_length("dpcm");
|
||||
if (dpcm_size)
|
||||
{
|
||||
m_cart->misc_rom_alloc(dpcm_size, tag());
|
||||
m_cart->misc_rom_alloc(dpcm_size);
|
||||
memcpy(m_cart->get_misc_rom_base(), get_software_region("dpcm"), dpcm_size);
|
||||
}
|
||||
}
|
||||
|
@ -158,11 +158,11 @@ device_nes_cart_interface::~device_nes_cart_interface()
|
||||
// pointer allocators
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_nes_cart_interface::prg_alloc(size_t size, const char *tag)
|
||||
void device_nes_cart_interface::prg_alloc(size_t size)
|
||||
{
|
||||
if (m_prg == nullptr)
|
||||
{
|
||||
m_prg = device().machine().memory().region_alloc(std::string(tag).append(NESSLOT_PRGROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_prg = device().machine().memory().region_alloc(device().subtag("^cart:prg_rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_prg_size = size;
|
||||
m_prg_chunks = size / 0x4000;
|
||||
if (size % 0x2000)
|
||||
@ -223,25 +223,21 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag)
|
||||
}
|
||||
}
|
||||
|
||||
void device_nes_cart_interface::vrom_alloc(size_t size, const char *tag)
|
||||
void device_nes_cart_interface::vrom_alloc(size_t size)
|
||||
{
|
||||
if (m_vrom == nullptr)
|
||||
{
|
||||
std::string tempstring(tag);
|
||||
tempstring.append(NESSLOT_CHRROM_REGION_TAG);
|
||||
m_vrom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_vrom = device().machine().memory().region_alloc(device().subtag("^cart:chr_rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_vrom_size = size;
|
||||
m_vrom_chunks = size / 0x2000;
|
||||
}
|
||||
}
|
||||
|
||||
void device_nes_cart_interface::misc_rom_alloc(size_t size, const char *tag)
|
||||
void device_nes_cart_interface::misc_rom_alloc(size_t size)
|
||||
{
|
||||
if (m_misc_rom == nullptr)
|
||||
{
|
||||
std::string tempstring(tag);
|
||||
tempstring.append(NESSLOT_MISC_ROM_REGION_TAG);
|
||||
m_misc_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_misc_rom = device().machine().memory().region_alloc(device().subtag("^cart:misc_rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_misc_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
@ -205,9 +205,9 @@ public:
|
||||
// hack until disk system is made modern!
|
||||
virtual void disk_flip_side() { }
|
||||
|
||||
void prg_alloc(size_t size, const char *tag);
|
||||
void vrom_alloc(size_t size, const char *tag);
|
||||
void misc_rom_alloc(size_t size, const char *tag);
|
||||
void prg_alloc(size_t size);
|
||||
void vrom_alloc(size_t size);
|
||||
void misc_rom_alloc(size_t size);
|
||||
void prgram_alloc(size_t size);
|
||||
void vram_alloc(size_t size);
|
||||
void battery_alloc(size_t size);
|
||||
@ -454,13 +454,4 @@ protected:
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(NES_CART_SLOT, nes_cart_slot_device)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define NESSLOT_PRGROM_REGION_TAG ":cart:prg_rom"
|
||||
#define NESSLOT_CHRROM_REGION_TAG ":cart:chr_rom"
|
||||
#define NESSLOT_MISC_ROM_REGION_TAG ":cart:misc_rom"
|
||||
|
||||
#endif // MAME_BUS_NES_NES_SLOT_H
|
||||
|
@ -479,13 +479,13 @@ void nes_cart_slot_device::call_load_unif()
|
||||
// SETUP steps 5/6: allocate pointers for PRG/VROM and load the data!
|
||||
if (prg_size == 0x4000)
|
||||
{
|
||||
m_cart->prg_alloc(0x8000, tag());
|
||||
m_cart->prg_alloc(0x8000);
|
||||
memcpy(m_cart->get_prg_base(), &temp_prg[0], 0x4000);
|
||||
memcpy(m_cart->get_prg_base() + 0x4000, m_cart->get_prg_base(), 0x4000);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_cart->prg_alloc(prg_size, tag());
|
||||
m_cart->prg_alloc(prg_size);
|
||||
memcpy(m_cart->get_prg_base(), &temp_prg[0], prg_size);
|
||||
}
|
||||
|
||||
@ -494,7 +494,7 @@ void nes_cart_slot_device::call_load_unif()
|
||||
|
||||
if (vrom_size)
|
||||
{
|
||||
m_cart->vrom_alloc(vrom_size, tag());
|
||||
m_cart->vrom_alloc(vrom_size);
|
||||
memcpy(m_cart->get_vrom_base(), &temp_chr[0], vrom_size);
|
||||
}
|
||||
|
||||
|
@ -48,11 +48,11 @@ device_pce_cart_interface::~device_pce_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_pce_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_pce_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(PCESLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -227,7 +227,7 @@ image_init_result pce_cart_slot_device::call_load()
|
||||
fseek(offset, SEEK_SET);
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
virtual uint8_t read_cart(offs_t offset) { return 0xff; }
|
||||
virtual void write_cart(offs_t offset, uint8_t data) {}
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void ram_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint8_t* get_ram_base() { return &m_ram[0]; }
|
||||
@ -114,11 +114,4 @@ protected:
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(PCE_CART_SLOT, pce_cart_slot_device)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define PCESLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#endif // MAME_BUS_PCE_PCE_SLOT_H
|
||||
|
@ -57,11 +57,11 @@ device_sat_cart_interface::~device_sat_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_sat_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_sat_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(SATSLOT_ROM_REGION_TAG).c_str(), size, 4, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = (uint32_t *)device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 4, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -147,7 +147,7 @@ image_init_result sat_cart_slot_device::call_load()
|
||||
uint32_t len = loaded_through_softlist() ? get_software_region_length("rom") : length();
|
||||
uint32_t *ROM;
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
if (loaded_through_softlist())
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
|
||||
int get_cart_type() const { return m_cart_type; }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void bram_alloc(uint32_t size);
|
||||
void dram0_alloc(uint32_t size);
|
||||
void dram1_alloc(uint32_t size);
|
||||
@ -113,11 +113,4 @@ private:
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(SATURN_CART_SLOT, sat_cart_slot_device)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define SATSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#endif // MAME_BUS_SATURN_SAT_SLOT_H
|
||||
|
@ -44,11 +44,11 @@ device_scv_cart_interface::~device_scv_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_scv_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_scv_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(SCVSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -161,7 +161,7 @@ image_init_result scv_cart_slot_device::call_load()
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
if (has_ram)
|
||||
m_cart->ram_alloc(get_software_region_length("ram"));
|
||||
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
virtual void write_cart(offs_t offset, uint8_t data) { }
|
||||
virtual void write_bank(uint8_t data) { }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void ram_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint8_t* get_ram_base() { return &m_ram[0]; }
|
||||
@ -113,11 +113,4 @@ protected:
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(SCV_CART_SLOT, scv_cart_slot_device)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define SCVSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#endif // MAME_BUS_SCV_SLOT_H
|
||||
|
@ -83,11 +83,11 @@ device_sega8_cart_interface::~device_sega8_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_sega8_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_sega8_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(S8SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
m_rom_page_count = size / 0x4000;
|
||||
if (!m_rom_page_count)
|
||||
@ -413,7 +413,7 @@ image_init_result sega8_cart_slot_device::call_load()
|
||||
if (len & 0x3fff)
|
||||
len = ((len >> 14) + 1) << 14;
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
virtual uint8_t read_io(offs_t offset) { return 0xff; }
|
||||
virtual void write_io(offs_t offset, uint8_t data) { }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void ram_alloc(uint32_t size);
|
||||
|
||||
virtual void late_bank_setup() { }
|
||||
@ -346,12 +346,6 @@ DECLARE_DEVICE_TYPE(GAMEGEAR_CART_SLOT, gamegear_cart_slot_device)
|
||||
DECLARE_DEVICE_TYPE(SMS_CARD_SLOT, sms_card_slot_device)
|
||||
DECLARE_DEVICE_TYPE(SG1000_CARD_SLOT, sg1000_card_slot_device)
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define S8SLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
|
||||
// slot interfaces
|
||||
void sg1000_cart(device_slot_interface &device);
|
||||
|
@ -88,11 +88,11 @@ device_sns_cart_interface::~device_sns_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_sns_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_sns_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(SNSSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -669,7 +669,7 @@ image_init_result base_sns_cart_slot_device::call_load()
|
||||
|
||||
len = !loaded_through_softlist() ? (length() - offset) : get_software_region_length("rom");
|
||||
|
||||
m_cart->rom_alloc(len, tag());
|
||||
m_cart->rom_alloc(len);
|
||||
ROM = m_cart->get_rom_base();
|
||||
if (!loaded_through_softlist())
|
||||
fread(ROM, len);
|
||||
@ -851,37 +851,37 @@ void base_sns_cart_slot_device::setup_addon_from_fullpath()
|
||||
switch (m_addon)
|
||||
{
|
||||
case ADDON_DSP1:
|
||||
ROM = machine().root_device().memregion(region.c_str())->base();
|
||||
ROM = machine().root_device().memregion(region)->base();
|
||||
m_cart->addon_bios_alloc(0x2800);
|
||||
memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800);
|
||||
break;
|
||||
case ADDON_DSP1B:
|
||||
ROM = machine().root_device().memregion(region.c_str())->base();
|
||||
ROM = machine().root_device().memregion(region)->base();
|
||||
m_cart->addon_bios_alloc(0x2800);
|
||||
memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800);
|
||||
break;
|
||||
case ADDON_DSP2:
|
||||
ROM = machine().root_device().memregion(region.c_str())->base();
|
||||
ROM = machine().root_device().memregion(region)->base();
|
||||
m_cart->addon_bios_alloc(0x2800);
|
||||
memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800);
|
||||
break;
|
||||
case ADDON_DSP3:
|
||||
ROM = machine().root_device().memregion(region.c_str())->base();
|
||||
ROM = machine().root_device().memregion(region)->base();
|
||||
m_cart->addon_bios_alloc(0x2800);
|
||||
memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800);
|
||||
break;
|
||||
case ADDON_DSP4:
|
||||
ROM = machine().root_device().memregion(region.c_str())->base();
|
||||
ROM = machine().root_device().memregion(region)->base();
|
||||
m_cart->addon_bios_alloc(0x2800);
|
||||
memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800);
|
||||
break;
|
||||
case ADDON_ST010:
|
||||
ROM = machine().root_device().memregion(region.c_str())->base();
|
||||
ROM = machine().root_device().memregion(region)->base();
|
||||
m_cart->addon_bios_alloc(0x11000);
|
||||
memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000);
|
||||
break;
|
||||
case ADDON_ST011:
|
||||
ROM = machine().root_device().memregion(region.c_str())->base();
|
||||
ROM = machine().root_device().memregion(region)->base();
|
||||
m_cart->addon_bios_alloc(0x11000);
|
||||
memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000);
|
||||
break;
|
||||
|
@ -123,7 +123,7 @@ public:
|
||||
virtual void chip_write(offs_t offset, uint8_t data) { }
|
||||
virtual void speedup_addon_bios_access() {}
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void nvram_alloc(uint32_t size);
|
||||
void rtc_ram_alloc(uint32_t size);
|
||||
void addon_bios_alloc(uint32_t size);
|
||||
@ -312,12 +312,4 @@ DECLARE_DEVICE_TYPE(SNS_CART_SLOT, sns_cart_slot_device)
|
||||
DECLARE_DEVICE_TYPE(SNS_SUFAMI_CART_SLOT, sns_sufami_cart_slot_device)
|
||||
DECLARE_DEVICE_TYPE(SNS_BSX_CART_SLOT, sns_bsx_cart_slot_device)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define SNSSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
|
||||
#endif // MAME_BUS_SNES_SNES_SLOT_H
|
||||
|
@ -69,7 +69,7 @@ image_init_result vboy_cart_slot_device::call_load()
|
||||
if (!loaded_through_softlist())
|
||||
{
|
||||
LOG("Allocating %u byte cartridge ROM region\n", len);
|
||||
romregion = machine().memory().region_alloc(subtag("rom").c_str(), len, 4, ENDIANNESS_LITTLE);
|
||||
romregion = machine().memory().region_alloc(subtag("rom"), len, 4, ENDIANNESS_LITTLE);
|
||||
u32 const cnt(fread(romregion->base(), len));
|
||||
if (cnt != len)
|
||||
{
|
||||
|
@ -45,11 +45,11 @@ device_vc4000_cart_interface::~device_vc4000_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_vc4000_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_vc4000_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(VC4000SLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -180,7 +180,7 @@ image_init_result vc4000_cart_slot_device::call_load()
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(size, tag());
|
||||
m_cart->rom_alloc(size);
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
fread(m_cart->get_rom_base(), size);
|
||||
|
@ -6,8 +6,6 @@
|
||||
#include "imagedev/cartrom.h"
|
||||
|
||||
|
||||
#define VC4000SLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
/* PCB */
|
||||
enum
|
||||
{
|
||||
@ -32,7 +30,7 @@ public:
|
||||
virtual uint8_t read_ram(offs_t offset) { return 0xff; }
|
||||
virtual void write_ram(offs_t offset, uint8_t data) { }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void ram_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint8_t* get_ram_base() { return &m_ram[0]; }
|
||||
|
@ -80,7 +80,7 @@ void device_vcs_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(":cart:rom").c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(":cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
|
@ -44,11 +44,11 @@ device_vectrex_cart_interface::~device_vectrex_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_vectrex_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_vectrex_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = device().machine().memory().region_alloc(std::string(tag).append(VECSLOT_ROM_REGION_TAG).c_str(), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 1, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -149,7 +149,7 @@ image_init_result vectrex_cart_slot_device::call_load()
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc((size < 0x1000) ? 0x1000 : size, tag());
|
||||
m_cart->rom_alloc((size < 0x1000) ? 0x1000 : size);
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
virtual void write_ram(offs_t offset, uint8_t data) { }
|
||||
virtual void write_bank(uint8_t data) { }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
uint8_t* get_rom_base() { return m_rom; }
|
||||
uint32_t get_rom_size() { return m_rom_size; }
|
||||
|
||||
@ -99,11 +99,4 @@ protected:
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(VECTREX_CART_SLOT, vectrex_cart_slot_device)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define VECSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#endif // MAME_BUS_VECTREX_SLOT_H
|
||||
|
@ -44,12 +44,12 @@ device_vsmile_cart_interface::~device_vsmile_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_vsmile_cart_interface::rom_alloc(uint32_t size, const char *tag)
|
||||
void device_vsmile_cart_interface::rom_alloc(uint32_t size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
// We always alloc 8MB of ROM region
|
||||
m_rom = (uint16_t *)device().machine().memory().region_alloc(std::string(tag).append(VSMILE_SLOT_ROM_REGION_TAG).c_str(), size, 2, ENDIANNESS_BIG)->base();
|
||||
m_rom = (uint16_t *)device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 2, ENDIANNESS_BIG)->base();
|
||||
m_rom_size = size;
|
||||
}
|
||||
}
|
||||
@ -143,7 +143,7 @@ image_init_result vsmile_cart_slot_device::call_load()
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
m_cart->rom_alloc(size, tag());
|
||||
m_cart->rom_alloc(size);
|
||||
uint8_t *rom = (uint8_t *)m_cart->get_rom_base();
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
|
@ -12,8 +12,6 @@
|
||||
TYPE DEFINITIONS
|
||||
***************************************************************************/
|
||||
|
||||
#define VSMILE_SLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
enum
|
||||
{
|
||||
VSMILE_STD = 0,
|
||||
@ -41,7 +39,7 @@ public:
|
||||
// banking
|
||||
virtual void set_cs2(bool cs2) = 0;
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void rom_alloc(uint32_t size);
|
||||
void nvram_alloc(uint32_t size);
|
||||
uint16_t* get_rom_base() { return m_rom; }
|
||||
uint16_t* get_nvram_base() { return &m_nvram[0]; }
|
||||
|
@ -47,11 +47,11 @@ device_ws_cart_interface::~device_ws_cart_interface()
|
||||
// rom_alloc - alloc the space for the cart
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_ws_cart_interface::rom_alloc(u32 size, const char *tag)
|
||||
void device_ws_cart_interface::rom_alloc(u32 size)
|
||||
{
|
||||
if (m_rom == nullptr)
|
||||
{
|
||||
m_rom = (u16 *)device().machine().memory().region_alloc(std::string(tag).append(WSSLOT_ROM_REGION_TAG).c_str(), size, 2, ENDIANNESS_LITTLE)->base();
|
||||
m_rom = (u16 *)device().machine().memory().region_alloc(device().subtag("^cart:rom"), size, 2, ENDIANNESS_LITTLE)->base();
|
||||
m_rom_size = size;
|
||||
m_bank_mask = ((m_rom_size >> 16) - 1);
|
||||
}
|
||||
@ -158,7 +158,7 @@ image_init_result ws_cart_slot_device::call_load()
|
||||
u32 size = !loaded_through_softlist() ? length() : get_software_region_length("rom");
|
||||
u32 nvram_size = 0;
|
||||
|
||||
m_cart->rom_alloc(size, tag());
|
||||
m_cart->rom_alloc(size);
|
||||
ROM = m_cart->get_rom_base();
|
||||
|
||||
if (!loaded_through_softlist())
|
||||
|
@ -101,7 +101,7 @@ public:
|
||||
virtual u16 read_io(offs_t offset, u16 mem_mask) { return 0xffff; }
|
||||
virtual void write_io(offs_t offset, u16 data, u16 mem_mask) { }
|
||||
|
||||
void rom_alloc(u32 size, const char *tag);
|
||||
void rom_alloc(u32 size);
|
||||
void nvram_alloc(u32 size);
|
||||
u16* get_rom_base() { return m_rom; }
|
||||
uint8_t* get_nvram_base() { return &m_nvram[0]; }
|
||||
@ -184,11 +184,4 @@ protected:
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(WS_CART_SLOT, ws_cart_slot_device)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define WSSLOT_ROM_REGION_TAG ":cart:rom"
|
||||
|
||||
#endif // MAME_BUS_WSWAN_SLOT_H
|
||||
|
Loading…
Reference in New Issue
Block a user