trunk/src/mess/machine/md_slot.c
| r21854 | r21855 | |
| 51 | 51 | |
| 52 | 52 | const device_type MD_CART_SLOT = &device_creator<md_cart_slot_device>; |
| 53 | 53 | const device_type PICO_CART_SLOT = &device_creator<pico_cart_slot_device>; |
| 54 | | const device_type MD_SUBCART_SLOT = &device_creator<md_subcart_slot_device>; |
| 55 | 54 | |
| 56 | 55 | |
| 57 | 56 | //************************************************************************** |
| r21854 | r21855 | |
| 169 | 168 | device_t(mconfig, type, name, tag, owner, clock), |
| 170 | 169 | device_image_interface(mconfig, *this), |
| 171 | 170 | device_slot_interface(mconfig, *this), |
| 172 | | m_type(SEGA_STD) |
| 171 | m_type(SEGA_STD), |
| 172 | m_must_be_loaded(1) |
| 173 | 173 | { |
| 174 | 174 | } |
| 175 | 175 | |
| r21854 | r21855 | |
| 178 | 178 | { |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | | md_subcart_slot_device::md_subcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 182 | | base_md_cart_slot_device(mconfig, MD_SUBCART_SLOT, "MD Cartridge SubSlot", tag, owner, clock) |
| 183 | | { |
| 184 | | } |
| 185 | | |
| 186 | 181 | pico_cart_slot_device::pico_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 187 | 182 | base_md_cart_slot_device(mconfig, PICO_CART_SLOT, "Pico Cartridge Slot", tag, owner, clock) |
| 188 | 183 | { |
trunk/src/mess/machine/md_slot.h
| r21854 | r21855 | |
| 155 | 155 | virtual bool is_readable() const { return 1; } |
| 156 | 156 | virtual bool is_writeable() const { return 0; } |
| 157 | 157 | virtual bool is_creatable() const { return 0; } |
| 158 | | virtual bool must_be_loaded() const { return 1; } |
| 158 | virtual bool must_be_loaded() const { return m_must_be_loaded; } |
| 159 | 159 | virtual bool is_reset_on_load() const { return 1; } |
| 160 | 160 | virtual const option_guide *create_option_guide() const { return NULL; } |
| 161 | 161 | |
| r21854 | r21855 | |
| 168 | 168 | |
| 169 | 169 | void setup_custom_mappers(); |
| 170 | 170 | void setup_nvram(); |
| 171 | | |
| 171 | void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; } |
| 172 | |
| 172 | 173 | // reading and writing |
| 173 | 174 | virtual DECLARE_READ16_MEMBER(read); |
| 174 | 175 | virtual DECLARE_WRITE16_MEMBER(write); |
| r21854 | r21855 | |
| 183 | 184 | |
| 184 | 185 | int m_type; |
| 185 | 186 | device_md_cart_interface* m_cart; |
| 187 | bool m_must_be_loaded; |
| 186 | 188 | }; |
| 187 | 189 | |
| 188 | 190 | // ======================> md_cart_slot_device |
| r21854 | r21855 | |
| 196 | 198 | virtual const char *file_extensions() const { return "smd,bin,md,gen"; } |
| 197 | 199 | }; |
| 198 | 200 | |
| 199 | | |
| 200 | | // ======================> md_subcart_slot_device |
| 201 | | |
| 202 | | class md_subcart_slot_device : public base_md_cart_slot_device |
| 203 | | { |
| 204 | | public: |
| 205 | | // construction/destruction |
| 206 | | md_subcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 207 | | virtual bool must_be_loaded() const { return 0; } |
| 208 | | virtual const char *image_interface() const { return "megadriv_cart"; } |
| 209 | | virtual const char *file_extensions() const { return "smd,bin,md,gen"; } |
| 210 | | }; |
| 211 | | |
| 212 | | |
| 213 | 201 | // ======================> pico_cart_slot_device |
| 214 | 202 | |
| 215 | 203 | class pico_cart_slot_device : public base_md_cart_slot_device |
| r21854 | r21855 | |
| 224 | 212 | |
| 225 | 213 | // device type definition |
| 226 | 214 | extern const device_type MD_CART_SLOT; |
| 227 | | extern const device_type MD_SUBCART_SLOT; // needed to allow S&K pass-through to have non-mandatory cart |
| 228 | 215 | extern const device_type PICO_CART_SLOT; |
| 229 | 216 | |
| 230 | 217 | |
| r21854 | r21855 | |
| 236 | 223 | MCFG_DEVICE_ADD(_tag, MD_CART_SLOT, 0) \ |
| 237 | 224 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) |
| 238 | 225 | |
| 239 | | #define MCFG_MDSUB_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot,_def_inp) \ |
| 240 | | MCFG_DEVICE_ADD(_tag, MD_SUBCART_SLOT, 0) \ |
| 241 | | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) |
| 242 | | |
| 243 | 226 | #define MCFG_PICO_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot,_def_inp) \ |
| 244 | 227 | MCFG_DEVICE_ADD(_tag, PICO_CART_SLOT, 0) \ |
| 245 | 228 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) |
| 246 | 229 | |
| 230 | #define MCFG_MD_CARTRIDGE_NOT_MANDATORY \ |
| 231 | static_cast<md_cart_slot_device *>(device)->set_must_be_loaded(FALSE); |
| 247 | 232 | |
| 233 | |
| 248 | 234 | #endif |
trunk/src/mess/machine/nes_slot.h
| r21854 | r21855 | |
| 113 | 113 | virtual bool is_writeable() const { return 0; } |
| 114 | 114 | virtual bool is_creatable() const { return 0; } |
| 115 | 115 | virtual bool must_be_loaded() const { return m_must_be_loaded; } |
| 116 | | void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; } |
| 117 | 116 | virtual bool is_reset_on_load() const { return 1; } |
| 118 | 117 | virtual const char *image_interface() const { return "nes_cart"; } |
| 119 | 118 | virtual const char *file_extensions() const { return "nes,unf,unif"; } |
| r21854 | r21855 | |
| 142 | 141 | int m_vrc_ls_chr; |
| 143 | 142 | int m_crc_hack; |
| 144 | 143 | |
| 145 | | virtual int get_chr_open_bus() { return m_chr_open_bus; }; |
| 146 | | virtual int get_ce_mask() { return m_ce_mask; }; |
| 147 | | virtual int get_ce_state() { return m_ce_state; }; |
| 148 | | virtual int get_vrc_ls_prg_a() { return m_vrc_ls_prg_a; }; |
| 149 | | virtual int get_vrc_ls_prg_b() { return m_vrc_ls_prg_b; }; |
| 150 | | virtual int get_vrc_ls_chr() { return m_vrc_ls_chr; }; |
| 151 | | virtual int get_crc_hack() { return m_crc_hack; }; |
| 144 | int get_chr_open_bus() { return m_chr_open_bus; }; |
| 145 | int get_ce_mask() { return m_ce_mask; }; |
| 146 | int get_ce_state() { return m_ce_state; }; |
| 147 | int get_vrc_ls_prg_a() { return m_vrc_ls_prg_a; }; |
| 148 | int get_vrc_ls_prg_b() { return m_vrc_ls_prg_b; }; |
| 149 | int get_vrc_ls_chr() { return m_vrc_ls_chr; }; |
| 150 | int get_crc_hack() { return m_crc_hack; }; |
| 152 | 151 | |
| 152 | void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; } |
| 153 | |
| 153 | 154 | //private: |
| 154 | 155 | |
| 155 | 156 | device_nes_cart_interface* m_cart; |