(MESS) simplified handling of must_be_loaded for md slots. nw.

This commit is contained in:
Fabio Priuli 2013-03-14 14:38:18 +00:00
parent d2d11bc7e5
commit d2536ab139
5 changed files with 21 additions and 38 deletions

View File

@ -77,7 +77,8 @@ static SLOT_INTERFACE_START(sk_sub_cart)
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( sk_slot )
MCFG_MDSUB_CARTRIDGE_ADD("subslot", sk_sub_cart, NULL, NULL)
MCFG_MD_CARTRIDGE_ADD("subslot", sk_sub_cart, NULL, NULL)
MCFG_MD_CARTRIDGE_NOT_MANDATORY
MACHINE_CONFIG_END

View File

@ -24,7 +24,7 @@ public:
virtual DECLARE_WRITE16_MEMBER(write);
private:
required_device<md_subcart_slot_device> m_exp;
required_device<md_cart_slot_device> m_exp;
};

View File

@ -51,7 +51,6 @@
const device_type MD_CART_SLOT = &device_creator<md_cart_slot_device>;
const device_type PICO_CART_SLOT = &device_creator<pico_cart_slot_device>;
const device_type MD_SUBCART_SLOT = &device_creator<md_subcart_slot_device>;
//**************************************************************************
@ -169,7 +168,8 @@ base_md_cart_slot_device::base_md_cart_slot_device(const machine_config &mconfig
device_t(mconfig, type, name, tag, owner, clock),
device_image_interface(mconfig, *this),
device_slot_interface(mconfig, *this),
m_type(SEGA_STD)
m_type(SEGA_STD),
m_must_be_loaded(1)
{
}
@ -178,11 +178,6 @@ md_cart_slot_device::md_cart_slot_device(const machine_config &mconfig, const ch
{
}
md_subcart_slot_device::md_subcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
base_md_cart_slot_device(mconfig, MD_SUBCART_SLOT, "MD Cartridge SubSlot", tag, owner, clock)
{
}
pico_cart_slot_device::pico_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
base_md_cart_slot_device(mconfig, PICO_CART_SLOT, "Pico Cartridge Slot", tag, owner, clock)
{

View File

@ -155,7 +155,7 @@ public:
virtual bool is_readable() const { return 1; }
virtual bool is_writeable() const { return 0; }
virtual bool is_creatable() const { return 0; }
virtual bool must_be_loaded() const { return 1; }
virtual bool must_be_loaded() const { return m_must_be_loaded; }
virtual bool is_reset_on_load() const { return 1; }
virtual const option_guide *create_option_guide() const { return NULL; }
@ -168,7 +168,8 @@ public:
void setup_custom_mappers();
void setup_nvram();
void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; }
// reading and writing
virtual DECLARE_READ16_MEMBER(read);
virtual DECLARE_WRITE16_MEMBER(write);
@ -183,6 +184,7 @@ public:
int m_type;
device_md_cart_interface* m_cart;
bool m_must_be_loaded;
};
// ======================> md_cart_slot_device
@ -196,20 +198,6 @@ public:
virtual const char *file_extensions() const { return "smd,bin,md,gen"; }
};
// ======================> md_subcart_slot_device
class md_subcart_slot_device : public base_md_cart_slot_device
{
public:
// construction/destruction
md_subcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual bool must_be_loaded() const { return 0; }
virtual const char *image_interface() const { return "megadriv_cart"; }
virtual const char *file_extensions() const { return "smd,bin,md,gen"; }
};
// ======================> pico_cart_slot_device
class pico_cart_slot_device : public base_md_cart_slot_device
@ -224,7 +212,6 @@ public:
// device type definition
extern const device_type MD_CART_SLOT;
extern const device_type MD_SUBCART_SLOT; // needed to allow S&K pass-through to have non-mandatory cart
extern const device_type PICO_CART_SLOT;
@ -236,13 +223,12 @@ extern const device_type PICO_CART_SLOT;
MCFG_DEVICE_ADD(_tag, MD_CART_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
#define MCFG_MDSUB_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot,_def_inp) \
MCFG_DEVICE_ADD(_tag, MD_SUBCART_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
#define MCFG_PICO_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot,_def_inp) \
MCFG_DEVICE_ADD(_tag, PICO_CART_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
#define MCFG_MD_CARTRIDGE_NOT_MANDATORY \
static_cast<md_cart_slot_device *>(device)->set_must_be_loaded(FALSE);
#endif

View File

@ -113,7 +113,6 @@ public:
virtual bool is_writeable() const { return 0; }
virtual bool is_creatable() const { return 0; }
virtual bool must_be_loaded() const { return m_must_be_loaded; }
void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; }
virtual bool is_reset_on_load() const { return 1; }
virtual const char *image_interface() const { return "nes_cart"; }
virtual const char *file_extensions() const { return "nes,unf,unif"; }
@ -142,13 +141,15 @@ public:
int m_vrc_ls_chr;
int m_crc_hack;
virtual int get_chr_open_bus() { return m_chr_open_bus; };
virtual int get_ce_mask() { return m_ce_mask; };
virtual int get_ce_state() { return m_ce_state; };
virtual int get_vrc_ls_prg_a() { return m_vrc_ls_prg_a; };
virtual int get_vrc_ls_prg_b() { return m_vrc_ls_prg_b; };
virtual int get_vrc_ls_chr() { return m_vrc_ls_chr; };
virtual int get_crc_hack() { return m_crc_hack; };
int get_chr_open_bus() { return m_chr_open_bus; };
int get_ce_mask() { return m_ce_mask; };
int get_ce_state() { return m_ce_state; };
int get_vrc_ls_prg_a() { return m_vrc_ls_prg_a; };
int get_vrc_ls_prg_b() { return m_vrc_ls_prg_b; };
int get_vrc_ls_chr() { return m_vrc_ls_chr; };
int get_crc_hack() { return m_crc_hack; };
void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; }
//private: