| Previous | 199869 Revisions | Next |
| r20750 Tuesday 5th February, 2013 at 20:54:03 UTC by Wilbert Pol |
|---|
| Started moving DEVICE_IMAGE_ functions into driver_device classes. (nw) |
| [src/emu] | diimage.h |
| [src/emu/imagedev] | cartslot.c cartslot.h |
| [src/mame/drivers] | jaguar.c megatech.c neogeo.c saturn.c vectrex.c |
| [src/mame/includes] | jaguar.h megadriv.h neogeo.h snes.h stv.h vectrex.h |
| [src/mame/machine] | megadriv.c vectrex.c |
| [src/mess/drivers] | a2600.c a7800.c amstrad.c arcadia.c atari400.c atom.c bbc.c bbcbc.c beta.c channelf.c coleco.c crvision.c gamecom.c gamepock.c gb.c gba.c geniusiq.c intv.c mekd2.c microvsn.c msx.c n64.c nc.c nes.c ng_aes.c ngp.c pc.c pc6001.c pce.c pegasus.c pockstat.c pokemini.c portfoli.c pv1000.c pv2000.c rx78.c scv.c sg1000.c sms.c spectrum.c ssem.c studio2.c supracan.c svi318.c svision.c thomson.c timex.c tutor.c uzebox.c vboy.c vc4000.c vii.c vtech2.c wswan.c x07.c |
| [src/mess/formats] | studio2_st2.c studio2_st2.h timex_dck.c timex_dck.h |
| [src/mess/includes] | a7800.h amstrad.h arcadia.h atom.h bbc.h beta.h c64_legacy.h channelf.h coleco.h crvision.h gamecom.h gamepock.h gb.h gba.h intv.h lynx.h msx.h nascom1.h nc.h nes.h pc.h pce.h pokemini.h portfoli.h sg1000.h sms.h spectrum.h studio2.h svi318.h svision.h thomson.h vc4000.h vtech2.h wswan.h x07.h |
| [src/mess/machine] | 990_hd.c a7800.c amstrad.c ataricrt.c ataridev.h bbc.c c64_legacy.c gamecom.c gb.c intv.c lynx.c msx.c nascom1.c nc.c nes.c pc.c pce.c pokemini.c sms.c snescart.c svi318.c thomson.c vtech2.c wswan.c |
| r20749 | r20750 | |
|---|---|---|
| 24 | 24 | m_extensions("bin"), |
| 25 | 25 | m_interface(NULL), |
| 26 | 26 | m_must_be_loaded(0), |
| 27 | m_device_start(NULL), | |
| 28 | m_device_load(NULL), | |
| 29 | m_device_unload(NULL), | |
| 30 | m_device_partialhash(NULL), | |
| 31 | m_device_displayinfo(NULL) | |
| 27 | m_device_image_partialhash(NULL) | |
| 32 | 28 | { |
| 33 | 29 | } |
| 34 | 30 | |
| r20749 | r20750 | |
| 208 | 204 | void cartslot_image_device::device_start() |
| 209 | 205 | { |
| 210 | 206 | /* if this cartridge has a custom DEVICE_START, use it */ |
| 211 | if (m_device_start | |
| 207 | if (!m_device_image_start.isnull()) | |
| 212 | 208 | { |
| 213 | | |
| 209 | m_device_image_start(); | |
| 214 | 210 | } |
| 215 | 211 | } |
| 216 | 212 | |
| r20749 | r20750 | |
| 222 | 218 | bool cartslot_image_device::call_load() |
| 223 | 219 | { |
| 224 | 220 | /* if this cartridge has a custom DEVICE_IMAGE_LOAD, use it */ |
| 225 | if (m_device_load != NULL) | |
| 226 | return (*m_device_load)(*this); | |
| 221 | if (!m_device_image_load.isnull()) | |
| 222 | return m_device_image_load(*this); | |
| 227 | 223 | |
| 228 | 224 | /* otherwise try the normal route */ |
| 229 | 225 | return process_cartridge(true); |
| r20749 | r20750 | |
| 236 | 232 | void cartslot_image_device::call_unload() |
| 237 | 233 | { |
| 238 | 234 | /* if this cartridge has a custom DEVICE_IMAGE_UNLOAD, use it */ |
| 239 | if (m_device_unload | |
| 235 | if (!m_device_image_unload.isnull()) | |
| 240 | 236 | { |
| 241 | | |
| 237 | m_device_image_unload(*this); | |
| 242 | 238 | return; |
| 243 | 239 | } |
| 244 | 240 | process_cartridge(false); |
| r20749 | r20750 | |
|---|---|---|
| 39 | 39 | // image-level overrides |
| 40 | 40 | virtual bool call_load(); |
| 41 | 41 | virtual void call_unload(); |
| 42 | virtual void call_display_info() { if (m_device_displayinfo) m_device_displayinfo(*this); } | |
| 42 | virtual void call_display_info() { if (!m_device_image_displayinfo.isnull()) m_device_image_displayinfo(*this); } | |
| 43 | 43 | virtual bool call_softlist_load(char *swlist, char *swname, rom_entry *start_entry) { load_software_part_region( this, swlist, swname, start_entry ); return TRUE; } |
| 44 | virtual device_image_partialhash_func get_partial_hash() const { return m_device_partialhash; } | |
| 44 | virtual device_image_partialhash_func get_partial_hash() const { return m_device_image_partialhash; } | |
| 45 | 45 | |
| 46 | 46 | virtual iodevice_t image_type() const { return IO_CARTSLOT; } |
| 47 | 47 | |
| r20749 | r20750 | |
| 57 | 57 | void set_extensions(const char *_extensions) { m_extensions = _extensions; } |
| 58 | 58 | void set_interface(const char *_interface) { m_interface = _interface; } |
| 59 | 59 | void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; } |
| 60 | void set_device_start(device_start_func _start) { m_device_start = _start; } | |
| 61 | void set_device_load(device_image_load_func _load) { m_device_load = _load; } | |
| 62 | void set_device_unload(device_image_unload_func _unload) { m_device_unload = _unload; } | |
| 63 | void set_partialhash(device_image_partialhash_func _partialhash) { m_device_partialhash = _partialhash; } | |
| 64 | void set_displayinfo(device_image_display_info_func _displayinfo) { m_device_displayinfo = _displayinfo; } | |
| 60 | void set_device_start(device_image_start_delegate _start) { m_device_image_start = _start; } | |
| 61 | void set_device_load(device_image_load_delegate _load) { m_device_image_load = _load; } | |
| 62 | void set_device_unload(device_image_func_delegate _unload) { m_device_image_unload = _unload; } | |
| 63 | void set_partialhash(device_image_partialhash_func _partialhash) { m_device_image_partialhash = _partialhash; } | |
| 64 | void set_displayinfo(device_image_func_delegate _displayinfo) { m_device_image_displayinfo = _displayinfo; } | |
| 65 | 65 | |
| 66 | 66 | protected: |
| 67 | 67 | // device-level overrides |
| r20749 | r20750 | |
| 75 | 75 | const char * m_extensions; |
| 76 | 76 | const char * m_interface; |
| 77 | 77 | bool m_must_be_loaded; |
| 78 | device_start_func m_device_start; | |
| 79 | device_image_load_func m_device_load; | |
| 80 | device_image_unload_func m_device_unload; | |
| 81 | device_image_partialhash_func m_device_partialhash; | |
| 82 | device_image_display_info_func m_device_displayinfo; | |
| 78 | device_image_start_delegate m_device_image_start; | |
| 79 | device_image_load_delegate m_device_image_load; | |
| 80 | device_image_func_delegate m_device_image_unload; | |
| 81 | device_image_partialhash_func m_device_image_partialhash; | |
| 82 | device_image_func_delegate m_device_image_displayinfo; | |
| 83 | 83 | }; |
| 84 | 84 | |
| 85 | 85 | // device type definition |
| r20749 | r20750 | |
| 105 | 105 | #define MCFG_CARTSLOT_MANDATORY \ |
| 106 | 106 | static_cast<cartslot_image_device *>(device)->set_must_be_loaded(TRUE); |
| 107 | 107 | |
| 108 | #define MCFG_CARTSLOT_START(_start) \ | |
| 109 | static_cast<cartslot_image_device *>(device)->set_device_start(DEVICE_START_NAME(_start)); | |
| 108 | #define MCFG_CARTSLOT_START(_class,_start) \ | |
| 109 | static_cast<cartslot_image_device *>(device)->set_device_start( DEVICE_IMAGE_START_DELEGATE(_class,_start)); | |
| 110 | 110 | |
| 111 | #define MCFG_CARTSLOT_LOAD(_load) \ | |
| 112 | static_cast<cartslot_image_device *>(device)->set_device_load(DEVICE_IMAGE_LOAD_NAME(_load)); | |
| 111 | #define MCFG_CARTSLOT_LOAD(_class,_load) \ | |
| 112 | static_cast<cartslot_image_device *>(device)->set_device_load( DEVICE_IMAGE_LOAD_DELEGATE(_class,_load)); | |
| 113 | 113 | |
| 114 | #define MCFG_CARTSLOT_UNLOAD(_unload) \ | |
| 115 | static_cast<cartslot_image_device *>(device)->set_device_unload(DEVICE_IMAGE_UNLOAD_NAME(_unload)); | |
| 114 | #define MCFG_CARTSLOT_UNLOAD(_class,_unload) \ | |
| 115 | static_cast<cartslot_image_device *>(device)->set_device_unload( DEVICE_IMAGE_UNLOAD_DELEGATE(_class,_unload)); | |
| 116 | 116 | |
| 117 | #define MCFG_CARTSLOT_PARTIALHASH(_partialhash) | |
| 117 | #define MCFG_CARTSLOT_PARTIALHASH(_partialhash) \ | |
| 118 | 118 | static_cast<cartslot_image_device *>(device)->set_partialhash(_partialhash); |
| 119 | 119 | |
| 120 | #define MCFG_CARTSLOT_DISPLAY_INFO(_displayinfo) \ | |
| 121 | static_cast<cartslot_image_device *>(device)->set_displayinfo(DEVICE_IMAGE_DISPLAY_INFO_NAME(_displayinfo)); | |
| 120 | #define MCFG_CARTSLOT_DISPLAY_INFO(_class,_displayinfo) \ | |
| 121 | static_cast<cartslot_image_device *>(device)->set_displayinfo(&DEVICE_IMAGE_DISPLAY_INFO_NAME(_class,_displayinfo)); | |
| 122 | 122 | |
| 123 | 123 | #endif /* __CARTSLOT_H__ */ |
| r20749 | r20750 | |
|---|---|---|
| 104 | 104 | astring m_optspec; |
| 105 | 105 | }; |
| 106 | 106 | |
| 107 | ||
| 107 | 108 | class device_image_interface; |
| 108 | 109 | struct feature_list; |
| 109 | 110 | struct software_part; |
| 110 | 111 | struct software_info; |
| 111 | 112 | |
| 112 | 113 | // device image interface function types |
| 114 | typedef delegate<void ()> device_image_start_delegate; | |
| 115 | typedef delegate<int (device_image_interface &)> device_image_load_delegate; | |
| 116 | typedef delegate<void (device_image_interface &)> device_image_func_delegate; | |
| 117 | // legacy | |
| 113 | 118 | typedef int (*device_image_load_func)(device_image_interface &image); |
| 114 | 119 | typedef void (*device_image_unload_func)(device_image_interface &image); |
| 115 | 120 | typedef void (*device_image_partialhash_func)(hash_collection &, const unsigned char *, unsigned long, const char *); |
| r20749 | r20750 | |
| 124 | 129 | #define IMAGE_VERIFY_PASS FALSE |
| 125 | 130 | #define IMAGE_VERIFY_FAIL TRUE |
| 126 | 131 | |
| 127 | #define DEVICE_IMAGE_LOAD_NAME(name) device_load_##name | |
| 128 | #define DEVICE_IMAGE_LOAD(name) int DEVICE_IMAGE_LOAD_NAME(name)(device_image_interface &image) | |
| 132 | #define DEVICE_IMAGE_LOAD_NAME_LEGACY(name) device_load_##name | |
| 133 | #define DEVICE_IMAGE_LOAD_LEGACY(name) int DEVICE_IMAGE_LOAD_NAME_LEGACY(name)(device_image_interface &image) | |
| 134 | #define DEVICE_IMAGE_UNLOAD_NAME_LEGACY(name) device_unload_##name | |
| 135 | #define DEVICE_IMAGE_UNLOAD_LEGACY(name) void DEVICE_IMAGE_UNLOAD_NAME_LEGACY(name)(device_image_interface &image) | |
| 136 | #define DEVICE_IMAGE_DISPLAY_INFO_NAME(name) device_image_display_info_func##name | |
| 137 | #define DEVICE_IMAGE_DISPLAY_INFO(name) void DEVICE_IMAGE_DISPLAY_INFO_NAME(name)(device_image_interface &image) | |
| 129 | 138 | |
| 130 | #define DEVICE_IMAGE_UNLOAD_NAME(name) device_unload_##name | |
| 131 | #define DEVICE_IMAGE_UNLOAD(name) void DEVICE_IMAGE_UNLOAD_NAME(name)(device_image_interface &image) | |
| 132 | 139 | |
| 133 | #define DEVICE_IMAGE_DISPLAY_INFO_NAME(name) device_image_display_info_func##name | |
| 134 | #define DEVICE_IMAGE_DISPLAY_INFO(name) void DEVICE_IMAGE_DISPLAY_INFO_NAME(name)(device_image_interface &image) | |
| 140 | #define DEVICE_IMAGE_START_MEMBER_NAME(_name) device_image_start_##_name | |
| 141 | #define DEVICE_IMAGE_START_NAME(_class,_name) _class::DEVICE_IMAGE_START_MEMBER_NAME(_name) | |
| 142 | #define DECLARE_DEVICE_IMAGE_START_MEMBER(_name) void DEVICE_IMAGE_START_MEMBER_NAME(_name)() | |
| 143 | #define DEVICE_IMAGE_START_MEMBER(_class,_name) void DEVICE_IMAGE_START_NAME(_class,_name)() | |
| 144 | #define DEVICE_IMAGE_START_DELEGATE(_class,_name) device_image_start_delegate(&DEVICE_IMAGE_START_NAME(_class,_name),#_class "::device_image_start_" #_name,downcast<_class *>(device->owner())) | |
| 135 | 145 | |
| 146 | #define DEVICE_IMAGE_LOAD_MEMBER_NAME(_name) device_image_load_##_name | |
| 147 | #define DEVICE_IMAGE_LOAD_NAME(_class,_name) _class::DEVICE_IMAGE_LOAD_MEMBER_NAME(_name) | |
| 148 | #define DECLARE_DEVICE_IMAGE_LOAD_MEMBER(_name) int DEVICE_IMAGE_LOAD_MEMBER_NAME(_name)(device_image_interface &image) | |
| 149 | #define DEVICE_IMAGE_LOAD_MEMBER(_class,_name) int DEVICE_IMAGE_LOAD_NAME(_class,_name)(device_image_interface &image) | |
| 150 | #define DEVICE_IMAGE_LOAD_DELEGATE(_class,_name) device_image_load_delegate(&DEVICE_IMAGE_LOAD_NAME(_class,_name),#_class "::device_image_load_" #_name, downcast<_class *>(device->owner())) | |
| 151 | ||
| 152 | #define DEVICE_IMAGE_UNLOAD_MEMBER_NAME(_name) device_image_unload_##_name | |
| 153 | #define DEVICE_IMAGE_UNLOAD_NAME(_class,_name) _class::DEVICE_IMAGE_UNLOAD_MEMBER_NAME(_name) | |
| 154 | #define DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER(_name) void DEVICE_IMAGE_UNLOAD_MEMBER_NAME(_name)(device_image_interface &image) | |
| 155 | #define DEVICE_IMAGE_UNLOAD_MEMBER(_class,_name) void DEVICE_IMAGE_UNLOAD_NAME(_class,_name)(device_image_interface &image) | |
| 156 | #define DEVICE_IMAGE_UNLOAD_DELEGATE(_class,_name) device_image_func_delegate(&DEVICE_IMAGE_UNLOAD_NAME(_class,_name),#_class "::device_image_unload_" #_name, downcast<_class *>(device->owner())) | |
| 157 | ||
| 158 | ||
| 136 | 159 | // ======================> device_image_interface |
| 137 | 160 | |
| 138 | 161 | // class representing interface-specific live image |
| r20749 | r20750 | |
|---|---|---|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | |
| 194 | DEVICE_START( a7800_cart ) | |
| 194 | DEVICE_IMAGE_START_MEMBER( a7800_state, a7800_cart ) | |
| 195 | 195 | { |
| 196 | a7800_state *state = device->machine().driver_data<a7800_state>(); | |
| 197 | UINT8 *memory = state->memregion("maincpu")->base(); | |
| 196 | UINT8 *memory = memregion("maincpu")->base(); | |
| 198 | 197 | |
| 199 | state->m_bios_bkup = NULL; | |
| 200 | state->m_cart_bkup = NULL; | |
| 198 | m_bios_bkup = NULL; | |
| 199 | m_cart_bkup = NULL; | |
| 201 | 200 | |
| 202 | 201 | /* Allocate memory for BIOS bank switching */ |
| 203 | state->m_bios_bkup = auto_alloc_array_clear(device->machine(), UINT8, 0x4000); | |
| 204 | state->m_cart_bkup = auto_alloc_array(device->machine(), UINT8, 0x4000); | |
| 202 | m_bios_bkup = auto_alloc_array_clear(machine(), UINT8, 0x4000); | |
| 203 | m_cart_bkup = auto_alloc_array(machine(), UINT8, 0x4000); | |
| 205 | 204 | |
| 206 | 205 | /* save the BIOS so we can switch it in and out */ |
| 207 | memcpy( | |
| 206 | memcpy( m_bios_bkup, memory + 0xC000, 0x4000 ); | |
| 208 | 207 | |
| 209 | 208 | /* Initialize cart area to "no data" */ |
| 210 | memset( | |
| 209 | memset( m_cart_bkup, 0xFF, 0x4000 ); | |
| 211 | 210 | |
| 212 | 211 | /* defaults for PAL bios without cart */ |
| 213 | state->m_cart_type = 0; | |
| 214 | state->m_stick_type = 1; | |
| 212 | m_cart_type = 0; | |
| 213 | m_stick_type = 1; | |
| 215 | 214 | } |
| 216 | 215 | |
| 217 | 216 | struct a7800_pcb |
| r20749 | r20750 | |
| 249 | 248 | return 0; |
| 250 | 249 | } |
| 251 | 250 | |
| 252 | DEVICE_IMAGE_LOAD( a7800_cart ) | |
| 251 | DEVICE_IMAGE_LOAD_MEMBER( a7800_state, a7800_cart ) | |
| 253 | 252 | { |
| 254 | a7800_state *state = image.device().machine().driver_data<a7800_state>(); | |
| 255 | 253 | UINT32 len = 0, start = 0; |
| 256 | 254 | unsigned char header[128]; |
| 257 | 255 | UINT8 *memory = image.device().machine().root_device().memregion("maincpu")->base(); |
| r20749 | r20750 | |
| 268 | 266 | return IMAGE_INIT_FAIL; |
| 269 | 267 | |
| 270 | 268 | len =(header[49] << 24) |(header[50] << 16) |(header[51] << 8) | header[52]; |
| 271 | | |
| 269 | m_cart_size = len; | |
| 272 | 270 | |
| 273 | state->m_cart_type =(header[53] << 8) | header[54]; | |
| 274 | state->m_stick_type = header[55]; | |
| 275 | logerror("Cart type: %x\n", state->m_cart_type); | |
| 271 | m_cart_type =(header[53] << 8) | header[54]; | |
| 272 | m_stick_type = header[55]; | |
| 273 | logerror("Cart type: %x\n", m_cart_type); | |
| 276 | 274 | |
| 277 | 275 | /* For now, if game support stick and gun, set it to stick */ |
| 278 | if (state->m_stick_type == 3) | |
| 279 | state->m_stick_type = 1; | |
| 276 | if (m_stick_type == 3) | |
| 277 | m_stick_type = 1; | |
| 280 | 278 | } |
| 281 | 279 | else |
| 282 | 280 | { |
| 283 | 281 | len = image.get_software_region_length("rom"); |
| 284 | | |
| 282 | m_cart_size = len; | |
| 285 | 283 | // TODO: add stick/gun support to xml! |
| 286 | | |
| 284 | m_stick_type = 1; | |
| 287 | 285 | if ((pcb_name = image.get_feature("pcb_type")) == NULL) |
| 288 | | |
| 286 | m_cart_type = 0; | |
| 289 | 287 | else |
| 290 | | |
| 288 | m_cart_type = a7800_get_pcb_id(pcb_name); | |
| 291 | 289 | } |
| 292 | 290 | |
| 293 | if ( | |
| 291 | if (m_cart_type == 0 || m_cart_type == 1) | |
| 294 | 292 | { |
| 295 | 293 | /* Normal Cart */ |
| 296 | 294 | start = 0x10000 - len; |
| 297 | | |
| 295 | m_cartridge_rom = memory + start; | |
| 298 | 296 | if (image.software_entry() == NULL) |
| 299 | image.fread( | |
| 297 | image.fread(m_cartridge_rom, len); | |
| 300 | 298 | else |
| 301 | memcpy( | |
| 299 | memcpy(m_cartridge_rom, image.get_software_region("rom"), len); | |
| 302 | 300 | } |
| 303 | else if ( | |
| 301 | else if (m_cart_type & 0x02) | |
| 304 | 302 | { |
| 305 | 303 | /* Super Cart */ |
| 306 | 304 | /* Extra ROM at $4000 */ |
| 307 | if ( | |
| 305 | if (m_cart_type & 0x08) | |
| 308 | 306 | { |
| 309 | 307 | if (image.software_entry() == NULL) |
| 310 | 308 | image.fread(memory + 0x4000, 0x4000); |
| r20749 | r20750 | |
| 314 | 312 | start = 0x4000; |
| 315 | 313 | } |
| 316 | 314 | |
| 317 | | |
| 315 | m_cartridge_rom = memory + 0x10000; | |
| 318 | 316 | if (image.software_entry() == NULL) |
| 319 | image.fread( | |
| 317 | image.fread(m_cartridge_rom, len); | |
| 320 | 318 | else |
| 321 | memcpy( | |
| 319 | memcpy(m_cartridge_rom, image.get_software_region("rom") + start, len); | |
| 322 | 320 | |
| 323 | 321 | /* bank 0 */ |
| 324 | 322 | memcpy(memory + 0x8000, memory + 0x10000, 0x4000); |
| r20749 | r20750 | |
| 332 | 330 | */ |
| 333 | 331 | |
| 334 | 332 | /* bank n-2 */ |
| 335 | if (!( | |
| 333 | if (!(m_cart_type & 0x0d)) | |
| 336 | 334 | { |
| 337 | 335 | memcpy(memory + 0x4000, memory + 0x10000 + len - 0x8000, 0x4000); |
| 338 | 336 | } |
| 339 | 337 | } |
| 340 | else if ( | |
| 338 | else if (m_cart_type == MBANK_TYPE_ABSOLUTE) | |
| 341 | 339 | { |
| 342 | 340 | /* F18 Hornet */ |
| 343 | 341 | |
| 344 | logerror("Cart type: %x Absolute\n", | |
| 342 | logerror("Cart type: %x Absolute\n",m_cart_type); | |
| 345 | 343 | |
| 346 | | |
| 344 | m_cartridge_rom = memory + 0x10000; | |
| 347 | 345 | if (image.software_entry() == NULL) |
| 348 | image.fread( | |
| 346 | image.fread(m_cartridge_rom, len); | |
| 349 | 347 | else |
| 350 | memcpy( | |
| 348 | memcpy(m_cartridge_rom, image.get_software_region("rom") + start, len); | |
| 351 | 349 | |
| 352 | 350 | /* bank 0 */ |
| 353 | 351 | memcpy(memory + 0x4000, memory + 0x10000, 0x4000); |
| r20749 | r20750 | |
| 355 | 353 | /* last bank */ |
| 356 | 354 | memcpy(memory + 0x8000, memory + 0x18000, 0x8000); |
| 357 | 355 | } |
| 358 | else if ( | |
| 356 | else if (m_cart_type == MBANK_TYPE_ACTIVISION) | |
| 359 | 357 | { |
| 360 | 358 | /* Activision */ |
| 361 | 359 | |
| 362 | logerror("Cart type: %x Activision\n", | |
| 360 | logerror("Cart type: %x Activision\n",m_cart_type); | |
| 363 | 361 | |
| 364 | | |
| 362 | m_cartridge_rom = memory + 0x10000; | |
| 365 | 363 | if (image.software_entry() == NULL) |
| 366 | image.fread( | |
| 364 | image.fread(m_cartridge_rom, len); | |
| 367 | 365 | else |
| 368 | memcpy( | |
| 366 | memcpy(m_cartridge_rom, image.get_software_region("rom") + start, len); | |
| 369 | 367 | |
| 370 | 368 | /* bank 0 */ |
| 371 | 369 | memcpy(memory + 0xa000, memory + 0x10000, 0x4000); |
| r20749 | r20750 | |
| 384 | 382 | |
| 385 | 383 | } |
| 386 | 384 | |
| 387 | memcpy(state->m_cart_bkup, memory + 0xc000, 0x4000); | |
| 388 | memcpy(memory + 0xc000, state->m_bios_bkup, 0x4000); | |
| 385 | memcpy(m_cart_bkup, memory + 0xc000, 0x4000); | |
| 386 | memcpy(memory + 0xc000, m_bios_bkup, 0x4000); | |
| 389 | 387 | return IMAGE_INIT_PASS; |
| 390 | 388 | } |
| 391 | 389 |
| r20749 | r20750 | |
|---|---|---|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | |
| 181 | DEVICE_IMAGE_LOAD( nascom1_cassette ) | |
| 181 | DEVICE_IMAGE_LOAD_MEMBER( nascom1_state,nascom1_cassette ) | |
| 182 | 182 | { |
| 183 | nascom1_state *state = image.device().machine().driver_data<nascom1_state>(); | |
| 184 | state->m_tape_size = image.length(); | |
| 185 | state->m_tape_image = (UINT8*)image.ptr(); | |
| 186 | if (!state->m_tape_image) | |
| 183 | m_tape_size = image.length(); | |
| 184 | m_tape_image = (UINT8*)image.ptr(); | |
| 185 | if (!m_tape_image) | |
| 187 | 186 | return IMAGE_INIT_FAIL; |
| 188 | 187 | |
| 189 | | |
| 188 | m_tape_index = 0; | |
| 190 | 189 | return IMAGE_INIT_PASS; |
| 191 | 190 | } |
| 192 | 191 | |
| 193 | 192 | |
| 194 | DEVICE_IMAGE_UNLOAD( nascom1_cassette ) | |
| 193 | DEVICE_IMAGE_UNLOAD_MEMBER( nascom1_state,nascom1_cassette ) | |
| 195 | 194 | { |
| 196 | nascom1_state *state = image.device().machine().driver_data<nascom1_state>(); | |
| 197 | state->m_tape_image = NULL; | |
| 198 | state->m_tape_size = state->m_tape_index = 0; | |
| 195 | m_tape_image = NULL; | |
| 196 | m_tape_size = m_tape_index = 0; | |
| 199 | 197 | } |
| 200 | 198 | |
| 201 | 199 |
| r20749 | r20750 | |
|---|---|---|
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | DEVICE_IMAGE_LOAD( laser_cart ) | |
| 316 | DEVICE_IMAGE_LOAD_MEMBER( vtech2_state, laser_cart ) | |
| 317 | 317 | { |
| 318 | 318 | vtech2_state *state = image.device().machine().driver_data<vtech2_state>(); |
| 319 | 319 | int size = 0; |
| r20749 | r20750 | |
| 332 | 332 | return size > 0 ? IMAGE_INIT_PASS : IMAGE_INIT_FAIL; |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | DEVICE_IMAGE_UNLOAD( laser_cart ) | |
| 335 | DEVICE_IMAGE_UNLOAD_MEMBER( vtech2_state, laser_cart ) | |
| 336 | 336 | { |
| 337 | 337 | vtech2_state *state = image.device().machine().driver_data<vtech2_state>(); |
| 338 | 338 | state->m_laser_bank_mask &= ~0xf000; |
| r20749 | r20750 | |
|---|---|---|
| 1329 | 1329 | return wswan_romsize_str[ ROM_UNKNOWN ]; |
| 1330 | 1330 | } |
| 1331 | 1331 | |
| 1332 | DEVICE_START(wswan_cart) | |
| 1332 | DEVICE_IMAGE_START_MEMBER(wswan_state,wswan_cart) | |
| 1333 | 1333 | { |
| 1334 | wswan_state *state = device->machine().driver_data<wswan_state>(); | |
| 1335 | 1334 | /* Initialize EEPROM structure */ |
| 1336 | memset( &state->m_eeprom, 0, sizeof( state->m_eeprom ) ); | |
| 1337 | state->m_eeprom.data = NULL; | |
| 1338 | state->m_eeprom.page = NULL; | |
| 1335 | memset( &m_eeprom, 0, sizeof( m_eeprom ) ); | |
| 1336 | m_eeprom.data = NULL; | |
| 1337 | m_eeprom.page = NULL; | |
| 1339 | 1338 | |
| 1340 | 1339 | /* Initialize RTC structure */ |
| 1341 | state->m_rtc.present = 0; | |
| 1342 | state->m_rtc.index = 0; | |
| 1343 | state->m_rtc.year = 0; | |
| 1344 | state->m_rtc.month = 0; | |
| 1345 | state->m_rtc.day = 0; | |
| 1346 | state->m_rtc.day_of_week = 0; | |
| 1347 | state->m_rtc.hour = 0; | |
| 1348 | state->m_rtc.minute = 0; | |
| 1349 | state->m_rtc.second = 0; | |
| 1350 | state->m_rtc.setting = 0xFF; | |
| 1340 | m_rtc.present = 0; | |
| 1341 | m_rtc.index = 0; | |
| 1342 | m_rtc.year = 0; | |
| 1343 | m_rtc.month = 0; | |
| 1344 | m_rtc.day = 0; | |
| 1345 | m_rtc.day_of_week = 0; | |
| 1346 | m_rtc.hour = 0; | |
| 1347 | m_rtc.minute = 0; | |
| 1348 | m_rtc.second = 0; | |
| 1349 | m_rtc.setting = 0xFF; | |
| 1351 | 1350 | } |
| 1352 | 1351 | |
| 1353 | DEVICE_IMAGE_LOAD(wswan_cart) | |
| 1352 | DEVICE_IMAGE_LOAD_MEMBER(wswan_state,wswan_cart) | |
| 1354 | 1353 | { |
| 1355 | wswan_state *state = image.device().machine().driver_data<wswan_state>(); | |
| 1356 | 1354 | UINT32 ii, size; |
| 1357 | 1355 | const char *sram_str; |
| 1358 | 1356 | |
| r20749 | r20750 | |
| 1361 | 1359 | else |
| 1362 | 1360 | size = image.get_software_region_length("rom"); |
| 1363 | 1361 | |
| 1364 | state->m_ws_ram = (UINT8*) state->m_maincpu->space(AS_PROGRAM).get_read_ptr(0); | |
| 1365 | memset(state->m_ws_ram, 0, 0xffff); | |
| 1366 | state->m_ROMBanks = size / 65536; | |
| 1362 | m_ws_ram = (UINT8*) m_maincpu->space(AS_PROGRAM).get_read_ptr(0); | |
| 1363 | memset(m_ws_ram, 0, 0xffff); | |
| 1364 | m_ROMBanks = size / 65536; | |
| 1367 | 1365 | |
| 1368 | for (ii = 0; ii < | |
| 1366 | for (ii = 0; ii < m_ROMBanks; ii++) | |
| 1369 | 1367 | { |
| 1370 | if (( | |
| 1368 | if ((m_ROMMap[ii] = auto_alloc_array(image.device().machine(), UINT8, 0x10000))) | |
| 1371 | 1369 | { |
| 1372 | 1370 | if (image.software_entry() == NULL) |
| 1373 | 1371 | { |
| 1374 | if (image.fread( | |
| 1372 | if (image.fread( m_ROMMap[ii], 0x10000) != 0x10000) | |
| 1375 | 1373 | { |
| 1376 | 1374 | image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Wrongly sized ROM"); |
| 1377 | 1375 | image.message(" Wrongly sized ROM"); |
| r20749 | r20750 | |
| 1380 | 1378 | } |
| 1381 | 1379 | } |
| 1382 | 1380 | else |
| 1383 | memcpy( | |
| 1381 | memcpy(m_ROMMap[ii], image.get_software_region("rom") + ii * 0x10000, 0x10000); | |
| 1384 | 1382 | } |
| 1385 | 1383 | else |
| 1386 | 1384 | { |
| r20749 | r20750 | |
| 1391 | 1389 | } |
| 1392 | 1390 | } |
| 1393 | 1391 | |
| 1394 | sram_str = wswan_determine_sram( | |
| 1392 | sram_str = wswan_determine_sram(this, m_ROMMap[m_ROMBanks - 1][0xfffb]); | |
| 1395 | 1393 | |
| 1396 | state->m_rtc.present = state->m_ROMMap[state->m_ROMBanks - 1][0xfffd] ? 1 : 0; | |
| 1397 | state->m_rotate = state->m_ROMMap[state->m_ROMBanks-1][0xfffc] & 0x01; | |
| 1394 | m_rtc.present = m_ROMMap[m_ROMBanks - 1][0xfffd] ? 1 : 0; | |
| 1395 | m_rotate = m_ROMMap[m_ROMBanks-1][0xfffc] & 0x01; | |
| 1398 | 1396 | |
| 1399 | 1397 | { |
| 1400 | 1398 | int sum = 0; |
| 1401 | 1399 | /* Spit out some info */ |
| 1402 | 1400 | logerror("ROM DETAILS\n" ); |
| 1403 | logerror("\tDeveloper ID: %X\n", state->m_ROMMap[state->m_ROMBanks - 1][0xfff6]); | |
| 1404 | logerror("\tMinimum system: %s\n", state->m_ROMMap[state->m_ROMBanks - 1][0xfff7] ? "WonderSwan Color" : "WonderSwan"); | |
| 1405 | logerror("\tCart ID: %X\n", state->m_ROMMap[state->m_ROMBanks - 1][0xfff8]); | |
| 1406 | logerror("\tROM size: %s\n", wswan_determine_romsize(state->m_ROMMap[state->m_ROMBanks - 1][0xfffa])); | |
| 1401 | logerror("\tDeveloper ID: %X\n", m_ROMMap[m_ROMBanks - 1][0xfff6]); | |
| 1402 | logerror("\tMinimum system: %s\n", m_ROMMap[m_ROMBanks - 1][0xfff7] ? "WonderSwan Color" : "WonderSwan"); | |
| 1403 | logerror("\tCart ID: %X\n", m_ROMMap[m_ROMBanks - 1][0xfff8]); | |
| 1404 | logerror("\tROM size: %s\n", wswan_determine_romsize(m_ROMMap[m_ROMBanks - 1][0xfffa])); | |
| 1407 | 1405 | logerror("\tSRAM size: %s\n", sram_str); |
| 1408 | logerror("\tFeatures: %X\n", state->m_ROMMap[state->m_ROMBanks - 1][0xfffc]); | |
| 1409 | logerror("\tRTC: %s\n", state->m_ROMMap[state->m_ROMBanks - 1][0xfffd] ? "yes" : "no"); | |
| 1410 | for (ii = 0; ii < state->m_ROMBanks; ii++) | |
| 1406 | logerror("\tFeatures: %X\n", m_ROMMap[m_ROMBanks - 1][0xfffc]); | |
| 1407 | logerror("\tRTC: %s\n", m_ROMMap[m_ROMBanks - 1][0xfffd] ? "yes" : "no"); | |
| 1408 | for (ii = 0; ii < m_ROMBanks; ii++) | |
| 1411 | 1409 | { |
| 1412 | 1410 | int count; |
| 1413 | 1411 | for (count = 0; count < 0x10000; count++) |
| 1414 | 1412 | { |
| 1415 | sum += | |
| 1413 | sum += m_ROMMap[ii][count]; | |
| 1416 | 1414 | } |
| 1417 | 1415 | } |
| 1418 | sum -= state->m_ROMMap[state->m_ROMBanks - 1][0xffff]; | |
| 1419 | sum -= state->m_ROMMap[state->m_ROMBanks - 1][0xfffe]; | |
| 1416 | sum -= m_ROMMap[m_ROMBanks - 1][0xffff]; | |
| 1417 | sum -= m_ROMMap[m_ROMBanks - 1][0xfffe]; | |
| 1420 | 1418 | sum &= 0xffff; |
| 1421 | logerror("\tChecksum: %X%X (calculated: %04X)\n", | |
| 1419 | logerror("\tChecksum: %X%X (calculated: %04X)\n", m_ROMMap[m_ROMBanks - 1][0xffff], m_ROMMap[m_ROMBanks - 1][0xfffe], sum); | |
| 1422 | 1420 | } |
| 1423 | 1421 | |
| 1424 | if ( | |
| 1422 | if (m_eeprom.size != 0) | |
| 1425 | 1423 | { |
| 1426 | state->m_eeprom.data = auto_alloc_array(image.device().machine(), UINT8, state->m_eeprom.size); | |
| 1427 | image.battery_load(state->m_eeprom.data, state->m_eeprom.size, 0x00); | |
| 1428 | state->m_eeprom.page = state->m_eeprom.data; | |
| 1424 | m_eeprom.data = auto_alloc_array(image.device().machine(), UINT8, m_eeprom.size); | |
| 1425 | image.battery_load(m_eeprom.data, m_eeprom.size, 0x00); | |
| 1426 | m_eeprom.page = m_eeprom.data; | |
| 1429 | 1427 | } |
| 1430 | 1428 | |
| 1431 | 1429 | if (image.software_entry() == NULL) |
| r20749 | r20750 | |
|---|---|---|
| 716 | 716 | return nes_line->line; |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | DEVICE_IMAGE_LOAD( nes_cart ) | |
| 719 | DEVICE_IMAGE_LOAD_MEMBER( nes_state, nes_cart ) | |
| 720 | 720 | { |
| 721 | 721 | nes_state *state = image.device().machine().driver_data<nes_state>(); |
| 722 | 722 | state->m_pcb_id = NO_BOARD; // initialization |
| r20749 | r20750 | |
|---|---|---|
| 2026 | 2026 | return IMAGE_VERIFY_PASS; |
| 2027 | 2027 | } |
| 2028 | 2028 | |
| 2029 | ||
| 2029 | DEVICE_IMAGE_LOAD_MEMBER( lynx_state, lynx_cart ) | |
| 2030 | 2030 | { |
| 2031 | 2031 | /* Lynx carts have 19 address lines, the upper 8 used for bank select. The lower |
| 2032 | 2032 | 11 bits are used to address data within the selected bank. Valid bank sizes are 256, |
| 2033 | 2033 | 512, 1024 or 2048 bytes. Commercial roms use all 256 banks.*/ |
| 2034 | 2034 | |
| 2035 | lynx_state *state = image.device().machine().driver_data<lynx_state>(); | |
| 2036 | UINT8 *rom = state->memregion("user1")->base(); | |
| 2035 | UINT8 *rom = memregion("user1")->base(); | |
| 2037 | 2036 | UINT32 size; |
| 2038 | 2037 | UINT8 header[0x40]; |
| 2039 | 2038 | |
| r20749 | r20750 | |
| 2063 | 2062 | /* 2008-10 FP: According to Handy source these should be page_size_bank0. Are we using |
| 2064 | 2063 | it correctly in MESS? Moreover, the next two values should be page_size_bank1. We should |
| 2065 | 2064 | implement this as well */ |
| 2066 | | |
| 2065 | m_granularity = header[4] | (header[5] << 8); | |
| 2067 | 2066 | |
| 2068 | 2067 | logerror ("%s %dkb cartridge with %dbyte granularity from %s\n", |
| 2069 | header + 10, size / 1024, | |
| 2068 | header + 10, size / 1024, m_granularity, header + 42); | |
| 2070 | 2069 | |
| 2071 | 2070 | size -= 0x40; |
| 2072 | 2071 | } |
| r20749 | r20750 | |
| 2076 | 2075 | (see above). What if bank 0 has to be loaded elsewhere? And what about bank 1? |
| 2077 | 2076 | These should work with most .lyx files, but we need additional info on raw cart images */ |
| 2078 | 2077 | if (size == 0x20000) |
| 2079 | | |
| 2078 | m_granularity = 0x0200; | |
| 2080 | 2079 | else if (size == 0x80000) |
| 2081 | | |
| 2080 | m_granularity = 0x0800; | |
| 2082 | 2081 | else |
| 2083 | | |
| 2082 | m_granularity = 0x0400; | |
| 2084 | 2083 | } |
| 2085 | 2084 | |
| 2086 | 2085 | if (image.fread( rom, size) != size) |
| r20749 | r20750 | |
| 2090 | 2089 | { |
| 2091 | 2090 | size = image.get_software_region_length("rom"); |
| 2092 | 2091 | if (size > 0xffff) // 64,128,256,512k cartridges |
| 2093 | | |
| 2092 | m_granularity = size >> 8; | |
| 2094 | 2093 | else |
| 2095 | | |
| 2094 | m_granularity = 0x400; // Homebrew roms not using all 256 banks (T-Tris) (none currently in softlist) | |
| 2096 | 2095 | |
| 2097 | 2096 | memcpy(rom, image.get_software_region("rom"), size); |
| 2098 | 2097 | |
| 2099 | 2098 | const char *rotate = image.get_feature("rotation"); |
| 2100 | | |
| 2099 | m_rotate = 0; | |
| 2101 | 2100 | if (rotate) |
| 2102 | 2101 | { |
| 2103 | 2102 | if(strcmp(rotate, "RIGHT") == 0) { |
| 2104 | | |
| 2103 | m_rotate = 1; | |
| 2105 | 2104 | } |
| 2106 | 2105 | else if (strcmp(rotate, "LEFT") == 0) { |
| 2107 | | |
| 2106 | m_rotate = 2; | |
| 2108 | 2107 | } |
| 2109 | 2108 | } |
| 2110 | 2109 | |
| r20749 | r20750 | |
| 2118 | 2117 | MCFG_CARTSLOT_EXTENSION_LIST("lnx,lyx") |
| 2119 | 2118 | MCFG_CARTSLOT_MANDATORY |
| 2120 | 2119 | MCFG_CARTSLOT_INTERFACE("lynx_cart") |
| 2121 | MCFG_CARTSLOT_LOAD(lynx_cart) | |
| 2120 | MCFG_CARTSLOT_LOAD(lynx_state, lynx_cart) | |
| 2122 | 2121 | MCFG_CARTSLOT_PARTIALHASH(lynx_partialhash) |
| 2123 | 2122 | |
| 2124 | 2123 | /* Software lists */ |
| r20749 | r20750 | |
|---|---|---|
| 134 | 134 | m_cartridge_ram[offset] = data; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | DEVICE_IMAGE_LOAD(pce_cart) | |
| 137 | DEVICE_IMAGE_LOAD_MEMBER(pce_state,pce_cart) | |
| 138 | 138 | { |
| 139 | 139 | pce_state *state = image.device().machine().driver_data<pce_state>(); |
| 140 | 140 | UINT32 size; |
| r20749 | r20750 | |
|---|---|---|
| 1913 | 1913 | /************************************** |
| 1914 | 1914 | BBC B Rom loading functions |
| 1915 | 1915 | ***************************************/ |
| 1916 | DEVICE_IMAGE_LOAD( bbcb_cart ) | |
| 1916 | DEVICE_IMAGE_LOAD_MEMBER( bbc_state, bbcb_cart ) | |
| 1917 | 1917 | { |
| 1918 | UINT8 *mem = | |
| 1918 | UINT8 *mem = machine().root_device().memregion("user1")->base(); | |
| 1919 | 1919 | int size, read_; |
| 1920 | 1920 | int addr = 0; |
| 1921 | 1921 | int index = 0; |
| r20749 | r20750 | |
|---|---|---|
| 25 | 25 | SPARTADOS_X |
| 26 | 26 | }; |
| 27 | 27 | |
| 28 | static int a800_cart_loaded = 0; | |
| 29 | static int atari = 0; | |
| 30 | static int a800_cart_type = A800_UNKNOWN; | |
| 31 | 28 | |
| 32 | /************************************* | |
| 33 | * | |
| 34 | * Generic code | |
| 35 | * | |
| 36 | *************************************/ | |
| 37 | ||
| 38 | ||
| 39 | // Currently, the drivers have fixed 40k RAM, however the function here is ready for different sizes too | |
| 40 | static void a800_setbank(running_machine &machine, int cart_mounted) | |
| 41 | { | |
| 42 | offs_t ram_top; | |
| 43 | // take care of 0x0000-0x7fff: RAM or NOP | |
| 44 | ram_top = MIN(machine.device<ram_device>(RAM_TAG)->size(), 0x8000) - 1; | |
| 45 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x0000, ram_top, "0000"); | |
| 46 | machine.root_device().membank("0000")->set_base(machine.device<ram_device>(RAM_TAG)->pointer()); | |
| 47 | ||
| 48 | // take care of 0x8000-0x9fff: A800 -> either right slot or RAM or NOP, others -> RAM or NOP | |
| 49 | // is there anything in the right slot? | |
| 50 | if (cart_mounted & RIGHT_CARTSLOT_MOUNTED) | |
| 51 | { | |
| 52 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x9fff, "8000"); | |
| 53 | machine.root_device().membank("8000")->set_base(machine.root_device().memregion("rslot")->base()); | |
| 54 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0x9fff); | |
| 55 | } | |
| 56 | else if (a800_cart_type != BBSB) | |
| 57 | { | |
| 58 | ram_top = MIN(machine.device<ram_device>(RAM_TAG)->size(), 0xa000) - 1; | |
| 59 | if (ram_top > 0x8000) | |
| 60 | { | |
| 61 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x8000, ram_top, "8000"); | |
| 62 | machine.root_device().membank("8000")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0x8000); | |
| 63 | } | |
| 64 | } | |
| 65 | ||
| 66 | // take care of 0xa000-0xbfff: is there anything in the left slot? | |
| 67 | if (cart_mounted & LEFT_CARTSLOT_MOUNTED) | |
| 68 | { | |
| 69 | // FIXME: this is an hack to keep XL working until we clean up its memory map as well! | |
| 70 | if (atari == ATARI_800XL) | |
| 71 | { | |
| 72 | if (a800_cart_type == A800_16K) | |
| 73 | { | |
| 74 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x9fff, "8000"); | |
| 75 | machine.root_device().membank("8000")->set_base(machine.root_device().memregion("lslot")->base()); | |
| 76 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0x9fff); | |
| 77 | ||
| 78 | memcpy(machine.root_device().memregion("maincpu")->base() + 0x10000, machine.root_device().memregion("lslot")->base() + 0x2000, 0x2000); | |
| 79 | } | |
| 80 | else if (a800_cart_type == A800_8K) | |
| 81 | memcpy(machine.root_device().memregion("maincpu")->base() + 0x10000, machine.root_device().memregion("lslot")->base(), 0x2000); | |
| 82 | else | |
| 83 | fatalerror("This type of cart is not supported yet in this driver. Please use a400 or a800.\n"); | |
| 84 | } | |
| 85 | else if (a800_cart_type == A800_16K) | |
| 86 | { | |
| 87 | machine.root_device().membank("8000")->set_base(machine.root_device().memregion("lslot")->base()); | |
| 88 | machine.root_device().membank("a000")->set_base(machine.root_device().memregion("lslot")->base() + 0x2000); | |
| 89 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0xbfff); | |
| 90 | } | |
| 91 | else if (a800_cart_type == BBSB) | |
| 92 | { | |
| 93 | // this requires separate banking in 0x8000 & 0x9000! | |
| 94 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x8fff, "8000"); | |
| 95 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x9000, 0x9fff, "9000"); | |
| 96 | machine.root_device().membank("8000")->set_base(machine.root_device().memregion("lslot")->base() + 0x0000); | |
| 97 | machine.root_device().membank("9000")->set_base(machine.root_device().memregion("lslot")->base() + 0x4000); | |
| 98 | machine.root_device().membank("a000")->set_base(machine.root_device().memregion("lslot")->base() + 0x8000); | |
| 99 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
| 100 | } | |
| 101 | else if (a800_cart_type == OSS_034M) | |
| 102 | { | |
| 103 | // this requires separate banking in 0xa000 & 0xb000! | |
| 104 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xa000, 0xafff, "a000"); | |
| 105 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xb000, 0xbfff, "b000"); | |
| 106 | machine.root_device().membank("b000")->set_base(machine.root_device().memregion("lslot")->base() + 0x3000); | |
| 107 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
| 108 | } | |
| 109 | else if (a800_cart_type == OSS_M091) | |
| 110 | { | |
| 111 | // this requires separate banking in 0xa000 & 0xb000! | |
| 112 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xa000, 0xafff, "a000"); | |
| 113 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xb000, 0xbfff, "b000"); | |
| 114 | machine.root_device().membank("b000")->set_base(machine.root_device().memregion("lslot")->base()); | |
| 115 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
| 116 | } | |
| 117 | else if (a800_cart_type == XEGS_32K) | |
| 118 | { | |
| 119 | machine.root_device().membank("8000")->set_base(machine.root_device().memregion("lslot")->base()); | |
| 120 | machine.root_device().membank("a000")->set_base(machine.root_device().memregion("lslot")->base() + 0x6000); | |
| 121 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0xbfff); | |
| 122 | } | |
| 123 | else | |
| 124 | { | |
| 125 | machine.root_device().membank("a000")->set_base(machine.root_device().memregion("lslot")->base()); | |
| 126 | machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
| 127 | } | |
| 128 | } | |
| 129 | } | |
| 130 | ||
| 131 | /* MESS specific parts that have to be started */ | |
| 132 | static void ms_atari_machine_start(running_machine &machine, int type, int has_cart) | |
| 133 | { | |
| 134 | /* set atari type (temporarily not used) */ | |
| 135 | atari = type; | |
| 136 | a800_setbank(machine, a800_cart_loaded); | |
| 137 | } | |
| 138 | ||
| 139 | static void ms_atari800xl_machine_start(running_machine &machine, int type, int has_cart) | |
| 140 | { | |
| 141 | /* set atari type (temporarily not used) */ | |
| 142 | atari = type; | |
| 143 | a800_setbank(machine, a800_cart_loaded); | |
| 144 | } | |
| 145 | ||
| 146 | /************************************* | |
| 147 | * | |
| 148 | * Atari 400 | |
| 149 | * | |
| 150 | *************************************/ | |
| 151 | ||
| 152 | MACHINE_START( a400 ) | |
| 153 | { | |
| 154 | atari_machine_start(machine); | |
| 155 | ms_atari_machine_start(machine, ATARI_400, TRUE); | |
| 156 | } | |
| 157 | ||
| 158 | ||
| 159 | /************************************* | |
| 160 | * | |
| 161 | * Atari 800 | |
| 162 | * | |
| 163 | *************************************/ | |
| 164 | ||
| 165 | MACHINE_START( a800 ) | |
| 166 | { | |
| 167 | atari_machine_start(machine); | |
| 168 | ms_atari_machine_start(machine, ATARI_800, TRUE); | |
| 169 | } | |
| 170 | ||
| 171 | static WRITE8_HANDLER( x32_bank_w ) | |
| 172 | { | |
| 173 | // printf("written %x\n", data); | |
| 174 | int bank = data & 0x03; | |
| 175 | space.machine().root_device().membank("8000")->set_base(space.machine().root_device().memregion("lslot")->base() + bank * 0x2000); | |
| 176 | } | |
| 177 | ||
| 178 | static WRITE8_HANDLER( w64_bank_w ) | |
| 179 | { | |
| 180 | // printf("write to %x\n", offset); | |
| 181 | ||
| 182 | if (offset < 8) | |
| 183 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + offset * 0x2000); | |
| 184 | else | |
| 185 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base()); | |
| 186 | // FIXME: writes to 0x8-0xf should disable the cart | |
| 187 | } | |
| 188 | ||
| 189 | // this covers Express 64, Diamond 64 and SpartaDOS (same bankswitch, but at different addresses) | |
| 190 | static WRITE8_HANDLER( ex64_bank_w ) | |
| 191 | { | |
| 192 | // printf("write to %x\n", offset); | |
| 193 | ||
| 194 | if (offset < 8) | |
| 195 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + (7 - offset) * 0x2000); | |
| 196 | else | |
| 197 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base()); | |
| 198 | // FIXME: writes to 0x8-0xf should disable the cart | |
| 199 | } | |
| 200 | ||
| 201 | static WRITE8_HANDLER( bbsb_bankl_w ) | |
| 202 | { | |
| 203 | // printf("write to %x\n", 0x8000 + offset); | |
| 204 | if (offset >= 0xff6 && offset <= 0xff9) | |
| 205 | space.machine().root_device().membank("8000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x0000 + (offset - 0xff6) * 0x1000); | |
| 206 | } | |
| 207 | ||
| 208 | static WRITE8_HANDLER( bbsb_bankh_w ) | |
| 209 | { | |
| 210 | // printf("write to %x\n", 0x9000 + offset); | |
| 211 | if (offset >= 0xff6 && offset <= 0xff9) | |
| 212 | space.machine().root_device().membank("9000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x4000 + (offset - 0xff6) * 0x1000); | |
| 213 | } | |
| 214 | ||
| 215 | static WRITE8_HANDLER( oss_034m_w ) | |
| 216 | { | |
| 217 | switch (offset & 0x0f) | |
| 218 | { | |
| 219 | case 0: | |
| 220 | case 1: | |
| 221 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base()); | |
| 222 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000); | |
| 223 | break; | |
| 224 | case 2: | |
| 225 | case 6: | |
| 226 | // docs says this should put 0xff in the 0xa000 bank -> let's point to the end of the cart | |
| 227 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x4000); | |
| 228 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000); | |
| 229 | break; | |
| 230 | case 3: | |
| 231 | case 7: | |
| 232 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x1000); | |
| 233 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000); | |
| 234 | break; | |
| 235 | case 4: | |
| 236 | case 5: | |
| 237 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x2000); | |
| 238 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000); | |
| 239 | break; | |
| 240 | default: | |
| 241 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xa000); | |
| 242 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xb000); | |
| 243 | break; | |
| 244 | } | |
| 245 | } | |
| 246 | ||
| 247 | static WRITE8_HANDLER( oss_m091_w ) | |
| 248 | { | |
| 249 | switch (offset & 0x09) | |
| 250 | { | |
| 251 | case 0: | |
| 252 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x1000); | |
| 253 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base()); | |
| 254 | break; | |
| 255 | case 1: | |
| 256 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000); | |
| 257 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base()); | |
| 258 | break; | |
| 259 | case 8: | |
| 260 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xa000); | |
| 261 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xb000); | |
| 262 | break; | |
| 263 | case 9: | |
| 264 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x2000); | |
| 265 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base()); | |
| 266 | break; | |
| 267 | } | |
| 268 | } | |
| 269 | ||
| 270 | 29 | #if 0 |
| 271 | 30 | static int bbsb_bankl = 0; |
| 272 | 31 | static int bbsb_bankh = 0; |
| r20749 | r20750 | |
| 296 | 55 | } |
| 297 | 56 | #endif |
| 298 | 57 | |
| 299 | struct a800_pcb | |
| 300 | { | |
| 301 | const char *pcb_name; | |
| 302 | int pcb_id; | |
| 303 | }; | |
| 304 | 58 | |
| 305 | // Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it | |
| 306 | // WARNING: most of these are still unsupported by the driver | |
| 307 | static const a800_pcb pcb_list[] = | |
| 308 | { | |
| 309 | {"standard 4k", A800_8K}, | |
| 310 | {"standard 8k", A800_8K}, | |
| 311 | {"standard 12k", A800_16K}, | |
| 312 | {"standard 16k", A800_16K}, | |
| 313 | {"right slot 4k", A800_RIGHT_4K}, | |
| 314 | {"right slot 8k", A800_RIGHT_8K}, | |
| 315 | ||
| 316 | {"oss 034m", OSS_034M}, | |
| 317 | {"oss m091", OSS_M091}, | |
| 318 | {"phoenix 8k", PHOENIX_8K}, | |
| 319 | {"xegs 32k", XEGS_32K}, | |
| 320 | {"bbsb", BBSB}, | |
| 321 | {"diamond 64k", DIAMOND_64K}, | |
| 322 | {"williams 64k", WILLIAMS_64K}, | |
| 323 | {"express 64", EXPRESS_64}, | |
| 324 | {"spartados x", SPARTADOS_X}, | |
| 325 | {"N/A", A800_UNKNOWN} | |
| 326 | }; | |
| 327 | ||
| 328 | static int a800_get_pcb_id(const char *pcb) | |
| 329 | { | |
| 330 | int i; | |
| 331 | ||
| 332 | for (i = 0; i < ARRAY_LENGTH(pcb_list); i++) | |
| 333 | { | |
| 334 | if (!mame_stricmp(pcb_list[i].pcb_name, pcb)) | |
| 335 | return pcb_list[i].pcb_id; | |
| 336 | } | |
| 337 | ||
| 338 | return A800_UNKNOWN; | |
| 339 | } | |
| 340 | ||
| 341 | // currently this does nothing, but it will eventually install the memory handlers required by the mappers | |
| 342 | static void a800_setup_mappers(running_machine &machine, int type) | |
| 343 | { | |
| 344 | switch (type) | |
| 345 | { | |
| 346 | case A800_4K: | |
| 347 | case A800_RIGHT_4K: | |
| 348 | case A800_12K: | |
| 349 | case A800_8K: | |
| 350 | case A800_16K: | |
| 351 | case A800_RIGHT_8K: | |
| 352 | case PHOENIX_8K: // as normal 8k cart, but it can be disabled by writing to 0xd500-0xdfff | |
| 353 | break; | |
| 354 | case XEGS_32K: | |
| 355 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(x32_bank_w)); | |
| 356 | break; | |
| 357 | case OSS_034M: | |
| 358 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(oss_034m_w)); | |
| 359 | break; | |
| 360 | case OSS_M091: | |
| 361 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(oss_m091_w)); | |
| 362 | break; | |
| 363 | case BBSB: | |
| 364 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x8000, 0x8fff, FUNC(bbsb_bankl_w)); | |
| 365 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x9000, 0x9fff, FUNC(bbsb_bankh_w)); | |
| 366 | break; | |
| 367 | case WILLIAMS_64K: | |
| 368 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd50f, FUNC(w64_bank_w)); | |
| 369 | break; | |
| 370 | case DIAMOND_64K: | |
| 371 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd5d0, 0xd5df, FUNC(ex64_bank_w)); | |
| 372 | break; | |
| 373 | case EXPRESS_64: | |
| 374 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd570, 0xd57f, FUNC(ex64_bank_w)); | |
| 375 | break; | |
| 376 | case SPARTADOS_X: | |
| 377 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd5e0, 0xd5ef, FUNC(ex64_bank_w)); | |
| 378 | break; | |
| 379 | default: | |
| 380 | break; | |
| 381 | } | |
| 382 | } | |
| 383 | ||
| 384 | static int a800_get_type(device_image_interface &image) | |
| 385 | { | |
| 386 | UINT8 header[16]; | |
| 387 | image.fread(header, 0x10); | |
| 388 | int hdr_type, cart_type = A800_UNKNOWN; | |
| 389 | ||
| 390 | // add check of CART format | |
| 391 | if (strncmp((const char *)header, "CART", 4)) | |
| 392 | fatalerror("Invalid header detected!\n"); | |
| 393 | ||
| 394 | hdr_type = (header[4] << 24) + (header[5] << 16) + (header[6] << 8) + (header[7] << 0); | |
| 395 | switch (hdr_type) | |
| 396 | { | |
| 397 | case 1: | |
| 398 | cart_type = A800_8K; | |
| 399 | break; | |
| 400 | case 2: | |
| 401 | cart_type = A800_16K; | |
| 402 | break; | |
| 403 | case 3: | |
| 404 | cart_type = OSS_034M; | |
| 405 | break; | |
| 406 | case 8: | |
| 407 | cart_type = WILLIAMS_64K; | |
| 408 | break; | |
| 409 | case 9: | |
| 410 | cart_type = DIAMOND_64K; | |
| 411 | break; | |
| 412 | case 10: | |
| 413 | cart_type = EXPRESS_64; | |
| 414 | break; | |
| 415 | case 11: | |
| 416 | cart_type = SPARTADOS_X; | |
| 417 | break; | |
| 418 | case 12: | |
| 419 | cart_type = XEGS_32K; | |
| 420 | break; | |
| 421 | case 15: | |
| 422 | cart_type = OSS_M091; | |
| 423 | break; | |
| 424 | case 18: | |
| 425 | cart_type = BBSB; | |
| 426 | break; | |
| 427 | case 21: | |
| 428 | cart_type = A800_RIGHT_8K; | |
| 429 | break; | |
| 430 | case 39: | |
| 431 | cart_type = PHOENIX_8K; | |
| 432 | break; | |
| 433 | case 4: | |
| 434 | case 6: | |
| 435 | case 7: | |
| 436 | case 16: | |
| 437 | case 19: | |
| 438 | case 20: | |
| 439 | fatalerror("Cart type \"%d\" means this is an Atari 5200 cart.\n", hdr_type); | |
| 440 | break; | |
| 441 | default: | |
| 442 | mame_printf_info("Cart type \"%d\" is currently unsupported.\n", hdr_type); | |
| 443 | break; | |
| 444 | } | |
| 445 | return cart_type; | |
| 446 | } | |
| 447 | ||
| 448 | static int a800_check_cart_type(device_image_interface &image) | |
| 449 | { | |
| 450 | const char *pcb_name; | |
| 451 | int type = A800_UNKNOWN; | |
| 452 | ||
| 453 | if (image.software_entry() == NULL) | |
| 454 | { | |
| 455 | UINT32 size = image.length(); | |
| 456 | ||
| 457 | // check if there is an header, if so extract cart_type from it, otherwise | |
| 458 | // try to guess the cart_type from the file size (notice that after the | |
| 459 | // a800_get_type call, we point at the start of the data) | |
| 460 | if ((size % 0x1000) == 0x10) | |
| 461 | type = a800_get_type(image); | |
| 462 | else if (size == 0x4000) | |
| 463 | type = A800_16K; | |
| 464 | else if (size == 0x2000) | |
| 465 | { | |
| 466 | if (strcmp(image.device().tag(),":cart2") == 0) | |
| 467 | type = A800_RIGHT_8K; | |
| 468 | else | |
| 469 | type = A800_8K; | |
| 470 | } | |
| 471 | } | |
| 472 | else | |
| 473 | { | |
| 474 | if ((pcb_name = image.get_feature("cart_type")) != NULL) | |
| 475 | type = a800_get_pcb_id(pcb_name); | |
| 476 | ||
| 477 | switch (type) | |
| 478 | { | |
| 479 | case A800_UNKNOWN: | |
| 480 | case A800_4K: | |
| 481 | case A800_RIGHT_4K: | |
| 482 | case A800_12K: | |
| 483 | case A800_8K: | |
| 484 | case A800_16K: | |
| 485 | case A800_RIGHT_8K: | |
| 486 | break; | |
| 487 | default: | |
| 488 | mame_printf_info("Cart type \"%s\" currently unsupported.\n", pcb_name); | |
| 489 | break; | |
| 490 | } | |
| 491 | } | |
| 492 | ||
| 493 | if ((strcmp(image.device().tag(),":cart2") == 0) && (type != A800_RIGHT_8K)) | |
| 494 | fatalerror("You cannot load this image '%s' in the right slot\n", image.filename()); | |
| 495 | ||
| 496 | return type; | |
| 497 | } | |
| 498 | ||
| 499 | DEVICE_IMAGE_LOAD( a800_cart ) | |
| 500 | { | |
| 501 | UINT32 size, start = 0; | |
| 502 | ||
| 503 | a800_cart_loaded = a800_cart_loaded & ~LEFT_CARTSLOT_MOUNTED; | |
| 504 | a800_cart_type = a800_check_cart_type(image); | |
| 505 | ||
| 506 | a800_setup_mappers(image.device().machine(), a800_cart_type); | |
| 507 | ||
| 508 | if (image.software_entry() == NULL) | |
| 509 | { | |
| 510 | size = image.length(); | |
| 511 | // if there is an header, skip it | |
| 512 | if ((size % 0x1000) == 0x10) | |
| 513 | { | |
| 514 | size -= 0x10; | |
| 515 | start = 0x10; | |
| 516 | } | |
| 517 | image.fread(image.device().machine().root_device().memregion("lslot")->base(), size - start); | |
| 518 | } | |
| 519 | else | |
| 520 | { | |
| 521 | size = image.get_software_region_length("rom"); | |
| 522 | memcpy(image.device().machine().root_device().memregion("lslot")->base(), image.get_software_region("rom"), size); | |
| 523 | } | |
| 524 | ||
| 525 | a800_cart_loaded |= (size > 0x0000) ? 1 : 0; | |
| 526 | ||
| 527 | logerror("%s loaded left cartridge '%s' size %dK\n", image.device().machine().system().name, image.filename(), size/1024); | |
| 528 | return IMAGE_INIT_PASS; | |
| 529 | } | |
| 530 | ||
| 531 | DEVICE_IMAGE_LOAD( a800_cart_right ) | |
| 532 | { | |
| 533 | UINT32 size, start = 0; | |
| 534 | ||
| 535 | a800_cart_loaded = a800_cart_loaded & ~RIGHT_CARTSLOT_MOUNTED; | |
| 536 | a800_cart_type = a800_check_cart_type(image); | |
| 537 | ||
| 538 | a800_setup_mappers(image.device().machine(), a800_cart_type); | |
| 539 | ||
| 540 | if (image.software_entry() == NULL) | |
| 541 | { | |
| 542 | size = image.length(); | |
| 543 | // if there is an header, skip it | |
| 544 | if ((size % 0x1000) == 0x10) | |
| 545 | { | |
| 546 | size -= 0x10; | |
| 547 | start = 0x10; | |
| 548 | } | |
| 549 | image.fread(image.device().machine().root_device().memregion("rslot")->base(), size - start); | |
| 550 | } | |
| 551 | else | |
| 552 | { | |
| 553 | size = image.get_software_region_length("rom"); | |
| 554 | memcpy(image.device().machine().root_device().memregion("rslot")->base(), image.get_software_region("rom"), size); | |
| 555 | } | |
| 556 | ||
| 557 | a800_cart_loaded |= (size > 0x0000) ? 2 : 0; | |
| 558 | ||
| 559 | logerror("%s loaded right cartridge '%s' size 8K\n", image.device().machine().system().name, image.filename()); | |
| 560 | return IMAGE_INIT_PASS; | |
| 561 | } | |
| 562 | ||
| 563 | DEVICE_IMAGE_UNLOAD( a800_cart ) | |
| 564 | { | |
| 565 | a800_cart_loaded = a800_cart_loaded & ~LEFT_CARTSLOT_MOUNTED; | |
| 566 | a800_cart_type = A800_UNKNOWN; | |
| 567 | a800_setbank(image.device().machine(), a800_cart_loaded); | |
| 568 | } | |
| 569 | ||
| 570 | DEVICE_IMAGE_UNLOAD( a800_cart_right ) | |
| 571 | { | |
| 572 | a800_cart_loaded = a800_cart_loaded & ~RIGHT_CARTSLOT_MOUNTED; | |
| 573 | a800_cart_type = A800_UNKNOWN; | |
| 574 | a800_setbank(image.device().machine(), a800_cart_loaded); | |
| 575 | } | |
| 576 | ||
| 577 | ||
| 578 | /************************************* | |
| 579 | * | |
| 580 | * Atari 800XL | |
| 581 | * | |
| 582 | *************************************/ | |
| 583 | ||
| 584 | MACHINE_START( a800xl ) | |
| 585 | { | |
| 586 | atari_machine_start(machine); | |
| 587 | ms_atari800xl_machine_start(machine, ATARI_800XL, TRUE); | |
| 588 | } | |
| 589 | ||
| 590 | /************************************* | |
| 591 | * | |
| 592 | * Atari 5200 console | |
| 593 | * | |
| 594 | *************************************/ | |
| 595 | ||
| 596 | MACHINE_START( a5200 ) | |
| 597 | { | |
| 598 | atari_machine_start(machine); | |
| 599 | ms_atari_machine_start(machine, ATARI_800XL, TRUE); | |
| 600 | } | |
| 601 | ||
| 602 | ||
| 603 | DEVICE_IMAGE_LOAD( a5200_cart ) | |
| 604 | { | |
| 605 | UINT8 *mem = image.device().machine().root_device().memregion("maincpu")->base(); | |
| 606 | UINT32 size; | |
| 607 | bool A13_mirr = FALSE; | |
| 608 | ||
| 609 | if (image.software_entry() == NULL) | |
| 610 | { | |
| 611 | /* load an optional (dual) cartidge */ | |
| 612 | size = image.fread(&mem[0x4000], 0x8000); | |
| 613 | const char *info = hashfile_extrainfo(image); | |
| 614 | if (info && !strcmp(info, "A13MIRRORING")) | |
| 615 | A13_mirr = TRUE; | |
| 616 | } | |
| 617 | else | |
| 618 | { | |
| 619 | size = image.get_software_region_length("rom"); | |
| 620 | memcpy(mem + 0x4000, image.get_software_region("rom"), size); | |
| 621 | const char *pcb_name = image.get_feature("cart_type"); | |
| 622 | if (pcb_name && !strcmp(pcb_name, "A13MIRRORING")) | |
| 623 | A13_mirr = TRUE; | |
| 624 | } | |
| 625 | ||
| 626 | if (size<0x8000) memmove(mem+0x4000+0x8000-size, mem+0x4000, size); | |
| 627 | // mirroring of smaller cartridges | |
| 628 | if (size <= 0x1000) memcpy(mem+0xa000, mem+0xb000, 0x1000); | |
| 629 | if (size <= 0x2000) memcpy(mem+0x8000, mem+0xa000, 0x2000); | |
| 630 | if (size <= 0x4000) | |
| 631 | { | |
| 632 | memcpy(&mem[0x4000], &mem[0x8000], 0x4000); | |
| 633 | if (A13_mirr) | |
| 634 | { | |
| 635 | memcpy(&mem[0x8000], &mem[0xa000], 0x2000); | |
| 636 | memcpy(&mem[0x6000], &mem[0x4000], 0x2000); | |
| 637 | } | |
| 638 | } | |
| 639 | logerror("A5200 loaded cartridge '%s' size %dK\n", image.filename() , size/1024); | |
| 640 | return IMAGE_INIT_PASS; | |
| 641 | } | |
| 642 | ||
| 643 | DEVICE_IMAGE_UNLOAD( a5200_cart ) | |
| 644 | { | |
| 645 | UINT8 *mem = image.device().machine().root_device().memregion("maincpu")->base(); | |
| 646 | /* zap the cartridge memory (again) */ | |
| 647 | memset(&mem[0x4000], 0x00, 0x8000); | |
| 648 | } | |
| 649 | ||
| 650 | /************************************* | |
| 651 | * | |
| 652 | * Atari XEGS | |
| 653 | * | |
| 654 | *************************************/ | |
| 655 | ||
| 656 | static UINT8 xegs_banks = 0; | |
| 657 | static UINT8 xegs_cart = 0; | |
| 658 | ||
| 659 | static WRITE8_HANDLER( xegs_bankswitch ) | |
| 660 | { | |
| 661 | UINT8 *cart = space.machine().root_device().memregion("user1")->base(); | |
| 662 | data &= xegs_banks - 1; | |
| 663 | space.machine().root_device().membank("bank0")->set_base(cart + data * 0x2000); | |
| 664 | } | |
| 665 | ||
| 666 | MACHINE_START( xegs ) | |
| 667 | { | |
| 668 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
| 669 | UINT8 *cart = space.machine().root_device().memregion("user1")->base(); | |
| 670 | UINT8 *cpu = space.machine().root_device().memregion("maincpu")->base(); | |
| 671 | ||
| 672 | atari_machine_start(machine); | |
| 673 | space.install_legacy_write_handler(0xd500, 0xd5ff, FUNC(xegs_bankswitch)); | |
| 674 | ||
| 675 | if (xegs_cart) | |
| 676 | { | |
| 677 | machine.root_device().membank("bank0")->set_base(cart); | |
| 678 | machine.root_device().membank("bank1")->set_base(cart + (xegs_banks - 1) * 0x2000); | |
| 679 | } | |
| 680 | else | |
| 681 | { | |
| 682 | // point to built-in Missile Command (this does not work well, though... FIXME!!) | |
| 683 | machine.root_device().membank("bank0")->set_base(cpu + 0x10000); | |
| 684 | machine.root_device().membank("bank1")->set_base(cpu + 0x10000); | |
| 685 | } | |
| 686 | } | |
| 687 | ||
| 688 | DEVICE_IMAGE_LOAD( xegs_cart ) | |
| 689 | { | |
| 690 | UINT32 size; | |
| 691 | UINT8 *ptr = image.device().machine().root_device().memregion("user1")->base(); | |
| 692 | ||
| 693 | if (image.software_entry() == NULL) | |
| 694 | { | |
| 695 | // skip the header | |
| 696 | image.fseek(0x10, SEEK_SET); | |
| 697 | size = image.length() - 0x10; | |
| 698 | if (image.fread(ptr, size) != size) | |
| 699 | return IMAGE_INIT_FAIL; | |
| 700 | } | |
| 701 | else | |
| 702 | { | |
| 703 | size = image.get_software_region_length("rom"); | |
| 704 | memcpy(ptr, image.get_software_region("rom"), size); | |
| 705 | } | |
| 706 | ||
| 707 | xegs_banks = size / 0x2000; | |
| 708 | xegs_cart = 1; | |
| 709 | ||
| 710 | return IMAGE_INIT_PASS; | |
| 711 | } | |
| 712 | ||
| 713 | DEVICE_IMAGE_UNLOAD( xegs_cart ) | |
| 714 | { | |
| 715 | xegs_cart = 0; | |
| 716 | xegs_banks = 0; | |
| 717 | } |
| r20749 | r20750 | |
|---|---|---|
| 20 | 20 | MACHINE_START( a5200 ); |
| 21 | 21 | MACHINE_START( xegs ); |
| 22 | 22 | |
| 23 | DEVICE_IMAGE_LOAD( a800_cart ); | |
| 24 | DEVICE_IMAGE_UNLOAD( a800_cart ); | |
| 25 | 23 | |
| 26 | DEVICE_IMAGE_LOAD( a800_cart_right ); | |
| 27 | DEVICE_IMAGE_UNLOAD( a800_cart_right ); | |
| 28 | ||
| 29 | DEVICE_IMAGE_LOAD( a5200_cart ); | |
| 30 | DEVICE_IMAGE_UNLOAD( a5200_cart ); | |
| 31 | ||
| 32 | DEVICE_IMAGE_LOAD( xegs_cart ); | |
| 33 | DEVICE_IMAGE_UNLOAD( xegs_cart ); | |
| 34 | ||
| 35 | ||
| 36 | 24 | /*----------- defined in machine/atarifdc.c -----------*/ |
| 37 | 25 | /*************************************************************************** |
| 38 | 26 | MACROS |
| r20749 | r20750 | |
|---|---|---|
| 1359 | 1359 | return data; |
| 1360 | 1360 | } |
| 1361 | 1361 | |
| 1362 | DEVICE_IMAGE_LOAD( pokemini_cart ) | |
| 1362 | DEVICE_IMAGE_LOAD_MEMBER( pokemini_state, pokemini_cart ) | |
| 1363 | 1363 | { |
| 1364 | 1364 | if (image.software_entry() == NULL) |
| 1365 | 1365 | { |
| r20749 | r20750 | |
|---|---|---|
| 399 | 399 | static UINT8 thom_cart_bank; /* current bank */ |
| 400 | 400 | |
| 401 | 401 | |
| 402 | DEVICE_IMAGE_LOAD( to7_cartridge ) | |
| 402 | DEVICE_IMAGE_LOAD_MEMBER( thomson_state, to7_cartridge ) | |
| 403 | 403 | { |
| 404 | 404 | int i,j; |
| 405 | 405 | UINT8* pos = image.device().machine().root_device().memregion("maincpu" )->base() + 0x10000; |
| r20749 | r20750 | |
| 1942 | 1942 | |
| 1943 | 1943 | |
| 1944 | 1944 | |
| 1945 | DEVICE_IMAGE_LOAD( mo5_cartridge ) | |
| 1945 | DEVICE_IMAGE_LOAD_MEMBER( thomson_state, mo5_cartridge ) | |
| 1946 | 1946 | { |
| 1947 | 1947 | UINT8* pos = image.device().machine().root_device().memregion("maincpu")->base() + 0x10000; |
| 1948 | 1948 | UINT64 size = image.length(); |
| r20749 | r20750 | |
|---|---|---|
| 3135 | 3135 | } |
| 3136 | 3136 | |
| 3137 | 3137 | |
| 3138 | DEVICE_IMAGE_LOAD(amstrad_plus_cartridge) | |
| 3138 | DEVICE_IMAGE_LOAD_MEMBER(amstrad_state, amstrad_plus_cartridge) | |
| 3139 | 3139 | { |
| 3140 | 3140 | // load CPC Plus / GX4000 cartridge image |
| 3141 | 3141 | // Format is RIFF: RIFF header chunk contains "AMS!" |
| r20749 | r20750 | |
|---|---|---|
| 1554 | 1554 | } |
| 1555 | 1555 | |
| 1556 | 1556 | |
| 1557 | DEVICE_START( sms_cart ) | |
| 1557 | DEVICE_IMAGE_START_MEMBER( sms_state, sms_cart ) | |
| 1558 | 1558 | { |
| 1559 | sms_state *state = device->machine().driver_data<sms_state>(); | |
| 1560 | 1559 | int i; |
| 1561 | 1560 | |
| 1562 | 1561 | for (i = 0; i < MAX_CARTRIDGES; i++) |
| 1563 | 1562 | { |
| 1564 | state->m_cartridge[i].ROM = NULL; | |
| 1565 | state->m_cartridge[i].size = 0; | |
| 1566 | state->m_cartridge[i].features = 0; | |
| 1567 | state->m_cartridge[i].cartSRAM = NULL; | |
| 1568 | state->m_cartridge[i].sram_save = 0; | |
| 1569 | state->m_cartridge[i].cartRAM = NULL; | |
| 1570 | state->m_cartridge[i].ram_size = 0; | |
| 1571 | state->m_cartridge[i].ram_page = 0; | |
| 1563 | m_cartridge[i].ROM = NULL; | |
| 1564 | m_cartridge[i].size = 0; | |
| 1565 | m_cartridge[i].features = 0; | |
| 1566 | m_cartridge[i].cartSRAM = NULL; | |
| 1567 | m_cartridge[i].sram_save = 0; | |
| 1568 | m_cartridge[i].cartRAM = NULL; | |
| 1569 | m_cartridge[i].ram_size = 0; | |
| 1570 | m_cartridge[i].ram_page = 0; | |
| 1572 | 1571 | } |
| 1573 | | |
| 1572 | m_current_cartridge = 0; | |
| 1574 | 1573 | |
| 1575 | state->m_bios_port = (IO_EXPANSION | IO_CARTRIDGE | IO_CARD); | |
| 1576 | if (!state->m_is_gamegear && !state->m_has_bios) | |
| 1574 | m_bios_port = (IO_EXPANSION | IO_CARTRIDGE | IO_CARD); | |
| 1575 | if (!m_is_gamegear && !m_has_bios) | |
| 1577 | 1576 | { |
| 1578 | state->m_bios_port &= ~(IO_CARTRIDGE); | |
| 1579 | state->m_bios_port |= IO_BIOS_ROM; | |
| 1577 | m_bios_port &= ~(IO_CARTRIDGE); | |
| 1578 | m_bios_port |= IO_BIOS_ROM; | |
| 1580 | 1579 | } |
| 1581 | 1580 | } |
| 1582 | 1581 | |
| 1583 | 1582 | |
| 1584 | DEVICE_IMAGE_LOAD( sms_cart ) | |
| 1583 | DEVICE_IMAGE_LOAD_MEMBER( sms_state, sms_cart ) | |
| 1585 | 1584 | { |
| 1586 | 1585 | running_machine &machine = image.device().machine(); |
| 1587 | 1586 | sms_state *state = machine.driver_data<sms_state>(); |
| r20749 | r20750 | |
|---|---|---|
| 71 | 71 | return IMAGE_VERIFY_FAIL; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | DEVICE_START( svi318_cart ) | |
| 74 | DEVICE_IMAGE_START_MEMBER( svi318_state, svi318_cart ) | |
| 75 | 75 | { |
| 76 | svi318_state *state = device->machine().driver_data<svi318_state>(); | |
| 77 | state->m_pcart = NULL; | |
| 78 | state->m_pcart_rom_size = 0; | |
| 76 | m_pcart = NULL; | |
| 77 | m_pcart_rom_size = 0; | |
| 79 | 78 | } |
| 80 | 79 | |
| 81 | DEVICE_IMAGE_LOAD( svi318_cart ) | |
| 80 | DEVICE_IMAGE_LOAD_MEMBER( svi318_state, svi318_cart ) | |
| 82 | 81 | { |
| 83 | 82 | svi318_state *state = image.device().machine().driver_data<svi318_state>(); |
| 84 | 83 | UINT8 *p = state->memregion("user1")->base(); |
| r20749 | r20750 | |
| 112 | 111 | return IMAGE_INIT_PASS; |
| 113 | 112 | } |
| 114 | 113 | |
| 115 | DEVICE_IMAGE_UNLOAD( svi318_cart ) | |
| 114 | DEVICE_IMAGE_UNLOAD_MEMBER( svi318_state, svi318_cart ) | |
| 116 | 115 | { |
| 117 | 116 | svi318_state *state = image.device().machine().driver_data<svi318_state>(); |
| 118 | 117 | state->m_pcart = NULL; |
| r20749 | r20750 | |
|---|---|---|
| 89 | 89 | return 0; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | DEVICE_START( nc_pcmcia_card ) | |
| 92 | ||
| 93 | DEVICE_IMAGE_START_MEMBER( nc_state, nc_pcmcia_card ) | |
| 93 | 94 | { |
| 94 | nc_state *state = device->machine().driver_data<nc_state>(); | |
| 95 | 95 | /* card not present */ |
| 96 | nc_set_card_present_state( | |
| 96 | nc_set_card_present_state(machine(), 0); | |
| 97 | 97 | /* card ram NULL */ |
| 98 | state->m_card_ram = NULL; | |
| 99 | state->m_card_size = 0; | |
| 98 | m_card_ram = NULL; | |
| 99 | m_card_size = 0; | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | ||
| 102 | 103 | /* load pcmcia card */ |
| 103 | DEVICE_IMAGE_LOAD( nc_pcmcia_card ) | |
| 104 | DEVICE_IMAGE_LOAD_MEMBER( nc_state, nc_pcmcia_card ) | |
| 104 | 105 | { |
| 105 | nc_state *state = image.device().machine().driver_data<nc_state>(); | |
| 106 | 106 | /* filename specified */ |
| 107 | 107 | |
| 108 | 108 | /* attempt to load file */ |
| 109 | if (nc_card_load(image, & | |
| 109 | if (nc_card_load(image, &m_card_ram)) | |
| 110 | 110 | { |
| 111 | if ( | |
| 111 | if (m_card_ram!=NULL) | |
| 112 | 112 | { |
| 113 | 113 | /* card present! */ |
| 114 | if ( | |
| 114 | if (m_membank_card_ram_mask!=0) | |
| 115 | 115 | { |
| 116 | nc_set_card_present_state( | |
| 116 | nc_set_card_present_state(machine(), 1); | |
| 117 | 117 | } |
| 118 | 118 | return IMAGE_INIT_PASS; |
| 119 | 119 | } |
| r20749 | r20750 | |
| 123 | 123 | return IMAGE_INIT_FAIL; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | DEVICE_IMAGE_UNLOAD( nc_pcmcia_card ) | |
| 126 | ||
| 127 | DEVICE_IMAGE_UNLOAD_MEMBER( nc_state, nc_pcmcia_card ) | |
| 127 | 128 | { |
| 128 | nc_state *state = image.device().machine().driver_data<nc_state>(); | |
| 129 | 129 | /* save card data if there is any */ |
| 130 | 130 | nc_card_save(image); |
| 131 | 131 | |
| 132 | 132 | /* free ram allocated to card */ |
| 133 | if ( | |
| 133 | if (m_card_ram!=NULL) | |
| 134 | 134 | { |
| 135 | free(state->m_card_ram); | |
| 136 | state->m_card_ram = NULL; | |
| 135 | free(m_card_ram); | |
| 136 | m_card_ram = NULL; | |
| 137 | 137 | } |
| 138 | | |
| 138 | m_card_size = 0; | |
| 139 | 139 | |
| 140 | 140 | /* set card not present state */ |
| 141 | nc_set_card_present_state( | |
| 141 | nc_set_card_present_state(machine(), 0); | |
| 142 | 142 | } |
| r20749 | r20750 | |
|---|---|---|
| 69 | 69 | return (asc8 > asc16) ? 4 : 5; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | DEVICE_IMAGE_LOAD | |
| 72 | DEVICE_IMAGE_LOAD_MEMBER(msx_state,msx_cart) | |
| 73 | 73 | { |
| 74 | msx_state *state = image.device().machine().driver_data<msx_state>(); | |
| 75 | 74 | int size; |
| 76 | 75 | int size_aligned; |
| 77 | 76 | UINT8 *mem; |
| r20749 | r20750 | |
| 333 | 332 | if (msx_slot_list[type].loadsram) |
| 334 | 333 | msx_slot_list[type].loadsram (image.device().machine(), st); |
| 335 | 334 | |
| 336 | | |
| 335 | m_cart_state[id] = st; | |
| 337 | 336 | msx_memory_set_carts (image.device().machine()); |
| 338 | 337 | |
| 339 | 338 | return IMAGE_INIT_PASS; |
| 340 | 339 | } |
| 341 | 340 | |
| 342 | DEVICE_IMAGE_UNLOAD | |
| 341 | DEVICE_IMAGE_UNLOAD_MEMBER(msx_state, msx_cart) | |
| 343 | 342 | { |
| 344 | msx_state *state = image.device().machine().driver_data<msx_state>(); | |
| 345 | 343 | int id = -1; |
| 346 | 344 | |
| 347 | 345 | if (strcmp(image.device().tag(),":cart1")==0) |
| r20749 | r20750 | |
| 356 | 354 | return; |
| 357 | 355 | } |
| 358 | 356 | |
| 359 | if (msx_slot_list[state->m_cart_state[id]->m_type].savesram) | |
| 360 | msx_slot_list[state->m_cart_state[id]->m_type].savesram (image.device().machine(), state->m_cart_state[id]); | |
| 357 | if (msx_slot_list[m_cart_state[id]->m_type].savesram) | |
| 358 | msx_slot_list[m_cart_state[id]->m_type].savesram (machine(), m_cart_state[id]); | |
| 361 | 359 | } |
| 362 | 360 | |
| 363 | 361 | void msx_vdp_interrupt(device_t *, v99x8_device &device, int i) |
| r20749 | r20750 | |
|---|---|---|
| 505 | 505 | *****************************************/ |
| 506 | 506 | }; |
| 507 | 507 | |
| 508 | ||
| 508 | DEVICE_IMAGE_UNLOAD_MEMBER( legacy_c64_state, c64_cart ) | |
| 509 | 509 | { |
| 510 | legacy_c64_state *state = image.device().machine().driver_data<legacy_c64_state>(); | |
| 511 | 510 | int i; |
| 512 | 511 | |
| 513 | 512 | for (i = 0; i < C64_MAX_ROMBANK; i++) |
| 514 | 513 | { |
| 515 | state->m_cart.bank[i].size = 0; | |
| 516 | state->m_cart.bank[i].addr = 0; | |
| 517 | state->m_cart.bank[i].index = 0; | |
| 518 | state->m_cart.bank[i].start = 0; | |
| 514 | m_cart.bank[i].size = 0; | |
| 515 | m_cart.bank[i].addr = 0; | |
| 516 | m_cart.bank[i].index = 0; | |
| 517 | m_cart.bank[i].start = 0; | |
| 519 | 518 | } |
| 520 | 519 | } |
| 521 | 520 | |
| 522 | 521 | |
| 523 | ||
| 522 | DEVICE_IMAGE_START_MEMBER( legacy_c64_state, c64_cart ) | |
| 524 | 523 | { |
| 525 | legacy_c64_state *state = device->machine().driver_data<legacy_c64_state>(); | |
| 526 | 524 | /* In the first slot we can load a .crt file. In this case we want |
| 527 | 525 | to use game & exrom values from the header, not the default ones. */ |
| 528 | state->m_cart.game = -1; | |
| 529 | state->m_cart.exrom = -1; | |
| 530 | state->m_cart.mapper = GENERIC_CRT; | |
| 531 | state->m_cart.n_banks = 0; | |
| 526 | m_cart.game = -1; | |
| 527 | m_cart.exrom = -1; | |
| 528 | m_cart.mapper = GENERIC_CRT; | |
| 529 | m_cart.n_banks = 0; | |
| 532 | 530 | } |
| 533 | 531 | |
| 534 | 532 | static int c64_crt_load( device_image_interface &image ) |
| r20749 | r20750 | |
| 1166 | 1164 | } |
| 1167 | 1165 | } |
| 1168 | 1166 | |
| 1169 | ||
| 1167 | DEVICE_IMAGE_LOAD_MEMBER( legacy_c64_state, c64_cart ) | |
| 1170 | 1168 | { |
| 1171 | 1169 | int result = IMAGE_INIT_PASS; |
| 1172 | 1170 | |
| r20749 | r20750 | |
| 1184 | 1182 | MCFG_CARTSLOT_EXTENSION_LIST("crt,80") |
| 1185 | 1183 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1186 | 1184 | MCFG_CARTSLOT_INTERFACE("c64_cart") |
| 1187 | MCFG_CARTSLOT_START(c64_cart) | |
| 1188 | MCFG_CARTSLOT_LOAD(c64_cart) | |
| 1189 | MCFG_CARTSLOT_UNLOAD(c64_cart) | |
| 1185 | MCFG_CARTSLOT_START(legacy_c64_state,c64_cart) | |
| 1186 | MCFG_CARTSLOT_LOAD(legacy_c64_state,c64_cart) | |
| 1187 | MCFG_CARTSLOT_UNLOAD(legacy_c64_state,c64_cart) | |
| 1190 | 1188 | |
| 1191 | 1189 | MCFG_CARTSLOT_ADD("cart2") |
| 1192 | 1190 | MCFG_CARTSLOT_EXTENSION_LIST("crt,80") |
| 1193 | 1191 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1194 | MCFG_CARTSLOT_START(c64_cart) | |
| 1195 | MCFG_CARTSLOT_LOAD(c64_cart) | |
| 1196 | MCFG_CARTSLOT_UNLOAD(c64_cart) | |
| 1192 | MCFG_CARTSLOT_START(legacy_c64_state,c64_cart) | |
| 1193 | MCFG_CARTSLOT_LOAD(legacy_c64_state,c64_cart) | |
| 1194 | MCFG_CARTSLOT_UNLOAD(legacy_c64_state,c64_cart) | |
| 1197 | 1195 | |
| 1198 | 1196 | MCFG_SOFTWARE_LIST_ADD("cart_list_c64", "c64_cart") |
| 1199 | 1197 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
|---|---|---|
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | DEVICE_IMAGE_LOAD( intv_cart ) | |
| 548 | DEVICE_IMAGE_LOAD_MEMBER( intv_state,intv_cart ) | |
| 549 | 549 | { |
| 550 | 550 | if (image.software_entry() == NULL) |
| 551 | 551 | return intv_load_rom_file(image); |
| r20749 | r20750 | |
| 820 | 820 | |
| 821 | 821 | /* Intellivision console + keyboard component */ |
| 822 | 822 | |
| 823 | DEVICE_IMAGE_LOAD( intvkbd_cart ) | |
| 823 | DEVICE_IMAGE_LOAD_MEMBER( intv_state,intvkbd_cart ) | |
| 824 | 824 | { |
| 825 | 825 | if (strcmp(image.device().tag(),":cart1") == 0) /* Legacy cartridge slot */ |
| 826 | 826 | { |
| r20749 | r20750 | |
|---|---|---|
| 758 | 758 | logerror("WARNING: This cart type \"%s\" is not supported yet!\n", types[state->m_has_addon_chip]); |
| 759 | 759 | } |
| 760 | 760 | |
| 761 | ||
| 761 | DEVICE_IMAGE_LOAD_MEMBER( snes_state,snes_cart ) | |
| 762 | 762 | { |
| 763 | 763 | int supported_type = 1; |
| 764 | 764 | running_machine &machine = image.device().machine(); |
| r20749 | r20750 | |
| 1144 | 1144 | return IMAGE_INIT_PASS; |
| 1145 | 1145 | } |
| 1146 | 1146 | |
| 1147 | ||
| 1147 | DEVICE_IMAGE_LOAD_MEMBER( snes_state,sufami_cart ) | |
| 1148 | 1148 | { |
| 1149 | 1149 | running_machine &machine = image.device().machine(); |
| 1150 | 1150 | snes_state *state = machine.driver_data<snes_state>(); |
| r20749 | r20750 | |
| 1249 | 1249 | return IMAGE_INIT_PASS; |
| 1250 | 1250 | } |
| 1251 | 1251 | |
| 1252 | ||
| 1252 | DEVICE_IMAGE_LOAD_MEMBER( snes_state,bsx_cart ) | |
| 1253 | 1253 | { |
| 1254 | 1254 | running_machine &machine = image.device().machine(); |
| 1255 | 1255 | snes_state *state = machine.driver_data<snes_state>(); |
| r20749 | r20750 | |
| 1351 | 1351 | return IMAGE_INIT_PASS; |
| 1352 | 1352 | } |
| 1353 | 1353 | |
| 1354 | ||
| 1354 | DEVICE_IMAGE_LOAD_MEMBER( snes_state,bsx2slot_cart ) | |
| 1355 | 1355 | { |
| 1356 | 1356 | running_machine &machine = image.device().machine(); |
| 1357 | 1357 | snes_state *state = machine.driver_data<snes_state>(); |
| r20749 | r20750 | |
| 1410 | 1410 | MCFG_CARTSLOT_EXTENSION_LIST("sfc,smc,fig,swc,bin") |
| 1411 | 1411 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1412 | 1412 | MCFG_CARTSLOT_INTERFACE("snes_cart") |
| 1413 | MCFG_CARTSLOT_LOAD(snes_cart) | |
| 1413 | MCFG_CARTSLOT_LOAD(snes_state,snes_cart) | |
| 1414 | 1414 | |
| 1415 | 1415 | MCFG_SOFTWARE_LIST_ADD("cart_list","snes") |
| 1416 | 1416 | MCFG_SOFTWARE_LIST_FILTER("cart_list","NTSC") |
| r20749 | r20750 | |
| 1421 | 1421 | MCFG_CARTSLOT_EXTENSION_LIST("sfc,smc,fig,swc,bin") |
| 1422 | 1422 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1423 | 1423 | MCFG_CARTSLOT_INTERFACE("snes_cart") |
| 1424 | MCFG_CARTSLOT_LOAD(snes_cart) | |
| 1424 | MCFG_CARTSLOT_LOAD(snes_state,snes_cart) | |
| 1425 | 1425 | |
| 1426 | 1426 | MCFG_SOFTWARE_LIST_ADD("cart_list","snes") |
| 1427 | 1427 | MCFG_SOFTWARE_LIST_FILTER("cart_list","PAL") |
| r20749 | r20750 | |
| 1434 | 1434 | MCFG_CARTSLOT_EXTENSION_LIST("st,sfc") |
| 1435 | 1435 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1436 | 1436 | MCFG_CARTSLOT_INTERFACE("sufami_cart") |
| 1437 | MCFG_CARTSLOT_LOAD(sufami_cart) | |
| 1437 | MCFG_CARTSLOT_LOAD(snes_state,sufami_cart) | |
| 1438 | 1438 | |
| 1439 | 1439 | MCFG_CARTSLOT_ADD("slot_b") |
| 1440 | 1440 | MCFG_CARTSLOT_EXTENSION_LIST("st,sfc") |
| 1441 | 1441 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1442 | 1442 | MCFG_CARTSLOT_INTERFACE("sufami_cart") |
| 1443 | MCFG_CARTSLOT_LOAD(sufami_cart) | |
| 1443 | MCFG_CARTSLOT_LOAD(snes_state,sufami_cart) | |
| 1444 | 1444 | |
| 1445 | 1445 | // MCFG_SOFTWARE_LIST_ADD("cart_list","snes") |
| 1446 | 1446 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
| 1454 | 1454 | MCFG_CARTSLOT_EXTENSION_LIST("sfc,smc,fig,swc,bin") |
| 1455 | 1455 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1456 | 1456 | MCFG_CARTSLOT_INTERFACE("snes_cart") |
| 1457 | MCFG_CARTSLOT_LOAD(bsx_cart) | |
| 1457 | MCFG_CARTSLOT_LOAD(snes_state,bsx_cart) | |
| 1458 | 1458 | |
| 1459 | 1459 | MCFG_CARTSLOT_ADD("slot2") |
| 1460 | 1460 | MCFG_CARTSLOT_EXTENSION_LIST("bs,sfc") |
| 1461 | 1461 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1462 | 1462 | MCFG_CARTSLOT_INTERFACE("bsx_cart") |
| 1463 | MCFG_CARTSLOT_LOAD(bsx2slot_cart) | |
| 1463 | MCFG_CARTSLOT_LOAD(snes_state,bsx2slot_cart) | |
| 1464 | 1464 | |
| 1465 | 1465 | // MCFG_SOFTWARE_LIST_ADD("cart_list","snes") |
| 1466 | 1466 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
|---|---|---|
| 1578 | 1578 | } |
| 1579 | 1579 | |
| 1580 | 1580 | |
| 1581 | DEVICE_IMAGE_LOAD( pcjr_cartridge ) | |
| 1581 | DEVICE_IMAGE_LOAD_MEMBER( pc_state, pcjr_cartridge ) | |
| 1582 | 1582 | { |
| 1583 | 1583 | UINT32 address; |
| 1584 | 1584 | UINT32 size; |
| r20749 | r20750 | |
|---|---|---|
| 1496 | 1496 | } |
| 1497 | 1497 | } |
| 1498 | 1498 | |
| 1499 | DEVICE_START(gb_cart) | |
| 1499 | DEVICE_IMAGE_START_MEMBER(gb_state,gb_cart) | |
| 1500 | 1500 | { |
| 1501 | gb_state *state = device->machine().driver_data<gb_state>(); | |
| 1502 | 1501 | int I; |
| 1503 | 1502 | |
| 1504 | state->m_gb_dummy_rom_bank = auto_alloc_array(device->machine(), UINT8, 0x4000); | |
| 1505 | memset(state->m_gb_dummy_rom_bank, 0xff, 0x4000); | |
| 1503 | m_gb_dummy_rom_bank = auto_alloc_array(machine(), UINT8, 0x4000); | |
| 1504 | memset(m_gb_dummy_rom_bank, 0xff, 0x4000); | |
| 1506 | 1505 | |
| 1507 | state->m_gb_dummy_ram_bank = auto_alloc_array(device->machine(), UINT8, 0x2000); | |
| 1508 | memset(state->m_gb_dummy_ram_bank, 0xff, 0x2000 ); | |
| 1506 | m_gb_dummy_ram_bank = auto_alloc_array(machine(), UINT8, 0x2000); | |
| 1507 | memset(m_gb_dummy_ram_bank, 0xff, 0x2000 ); | |
| 1509 | 1508 | |
| 1510 | 1509 | for(I = 0; I < MAX_ROMBANK; I++) |
| 1511 | 1510 | { |
| 1512 | | |
| 1511 | m_ROMMap[I] = m_gb_dummy_rom_bank; | |
| 1513 | 1512 | } |
| 1514 | 1513 | for(I = 0; I < MAX_RAMBANK; I++) |
| 1515 | 1514 | { |
| 1516 | | |
| 1515 | m_RAMMap[I] = m_gb_dummy_ram_bank; | |
| 1517 | 1516 | } |
| 1518 | state->m_ROMBank00 = 0; | |
| 1519 | state->m_ROMBanks = 0; | |
| 1520 | state->m_RAMBanks = 0; | |
| 1521 | state->m_MBCType = MBC_NONE; | |
| 1522 | state->m_CartType = 0; | |
| 1523 | state->m_ROMMask = 0; | |
| 1524 | state->m_RAMMask = 0; | |
| 1517 | m_ROMBank00 = 0; | |
| 1518 | m_ROMBanks = 0; | |
| 1519 | m_RAMBanks = 0; | |
| 1520 | m_MBCType = MBC_NONE; | |
| 1521 | m_CartType = 0; | |
| 1522 | m_ROMMask = 0; | |
| 1523 | m_RAMMask = 0; | |
| 1525 | 1524 | } |
| 1526 | 1525 | |
| 1527 | DEVICE_IMAGE_LOAD(gb_cart) | |
| 1526 | DEVICE_IMAGE_LOAD_MEMBER(gb_state,gb_cart) | |
| 1528 | 1527 | { |
| 1529 | 1528 | gb_state *state = image.device().machine().driver_data<gb_state>(); |
| 1530 | 1529 | static const char *const CartTypes[] = |
| r20749 | r20750 | |
| 2285 | 2284 | } |
| 2286 | 2285 | } |
| 2287 | 2286 | |
| 2288 | DEVICE_IMAGE_LOAD(megaduck_cart) | |
| 2287 | DEVICE_IMAGE_LOAD_MEMBER(gb_state,megaduck_cart) | |
| 2289 | 2288 | { |
| 2290 | 2289 | gb_state *state = image.device().machine().driver_data<gb_state>(); |
| 2291 | 2290 | int I; |
| r20749 | r20750 | |
|---|---|---|
| 203 | 203 | /* |
| 204 | 204 | Initialize hard disk unit and open a hard disk image |
| 205 | 205 | */ |
| 206 | static DEVICE_IMAGE_LOAD( ti990_hd ) | |
| 206 | static DEVICE_IMAGE_LOAD_LEGACY( ti990_hd ) | |
| 207 | 207 | { |
| 208 | 208 | int id = get_id_from_device( &image.device() ); |
| 209 | 209 | hd_unit_t *d; |
| r20749 | r20750 | |
| 280 | 280 | /* |
| 281 | 281 | close a hard disk image |
| 282 | 282 | */ |
| 283 | static DEVICE_IMAGE_UNLOAD( ti990_hd ) | |
| 283 | static DEVICE_IMAGE_UNLOAD_LEGACY( ti990_hd ) | |
| 284 | 284 | { |
| 285 | 285 | int id = get_id_from_device( image ); |
| 286 | 286 | hd_unit_t *d; |
| r20749 | r20750 | |
| 1038 | 1038 | |
| 1039 | 1039 | static const struct harddisk_interface ti990_harddisk_config = |
| 1040 | 1040 | { |
| 1041 | DEVICE_IMAGE_LOAD_NAME( ti990_hd ), | |
| 1042 | DEVICE_IMAGE_UNLOAD_NAME( ti990_hd ), | |
| 1041 | DEVICE_IMAGE_LOAD_NAME_LEGACY( ti990_hd ), | |
| 1042 | DEVICE_IMAGE_UNLOAD_NAME_LEGACY( ti990_hd ), | |
| 1043 | 1043 | NULL, |
| 1044 | 1044 | NULL |
| 1045 | 1045 | }; |
| r20749 | r20750 | |
|---|---|---|
| 560 | 560 | m_p_ram = m_region_maincpu->base(); // required here because pio_w gets called before machine_reset |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | DEVICE_IMAGE_LOAD( gamecom_cart1 ) | |
| 563 | DEVICE_IMAGE_LOAD_MEMBER( gamecom_state, gamecom_cart1 ) | |
| 564 | 564 | { |
| 565 | 565 | gamecom_state *state = image.device().machine().driver_data<gamecom_state>(); |
| 566 | 566 | UINT32 filesize; |
| r20749 | r20750 | |
| 607 | 607 | return IMAGE_INIT_PASS; |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | DEVICE_IMAGE_LOAD( gamecom_cart2 ) | |
| 610 | DEVICE_IMAGE_LOAD_MEMBER( gamecom_state, gamecom_cart2 ) | |
| 611 | 611 | { |
| 612 | 612 | gamecom_state *state = image.device().machine().driver_data<gamecom_state>(); |
| 613 | 613 | UINT32 filesize; |
| r20749 | r20750 | |
|---|---|---|
| 51 | 51 | virtual void video_start(); |
| 52 | 52 | virtual void palette_init(); |
| 53 | 53 | UINT32 screen_update_channelf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 54 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( channelf_cart ); | |
| 54 | 55 | }; |
| 55 | 56 | |
| 56 | 57 |
| r20749 | r20750 | |
|---|---|---|
| 89 | 89 | UINT8 *m_io_ram_r_ptr; |
| 90 | 90 | c64_cart_t m_cart; |
| 91 | 91 | int m_nmilevel; |
| 92 | DECLARE_DEVICE_IMAGE_START_MEMBER( c64_cart ); | |
| 93 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( c64_cart ); | |
| 94 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( c64_cart ); | |
| 92 | 95 | }; |
| 93 | 96 | |
| 94 | 97 |
| r20749 | r20750 | |
|---|---|---|
| 53 | 53 | DECLARE_READ8_MEMBER( pia_pa_r ); |
| 54 | 54 | DECLARE_READ8_MEMBER( pia_pb_r ); |
| 55 | 55 | DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi ); |
| 56 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( crvision_cart ); | |
| 56 | 57 | |
| 57 | 58 | UINT8 read_keyboard(int pa); |
| 58 | 59 |
| r20749 | r20750 | |
|---|---|---|
| 140 | 140 | TIMER_CALLBACK_MEMBER(intv_interrupt2_complete); |
| 141 | 141 | TIMER_CALLBACK_MEMBER(intv_interrupt_complete); |
| 142 | 142 | TIMER_CALLBACK_MEMBER(intv_btb_fill); |
| 143 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( intv_cart ); | |
| 144 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( intvkbd_cart ); | |
| 143 | 145 | }; |
| 144 | 146 | |
| 145 | 147 | /*----------- defined in video/intv.c -----------*/ |
| 146 | 148 | void intv_stic_screenrefresh(running_machine &machine); |
| 147 | 149 | |
| 148 | /*----------- defined in machine/intv.c -----------*/ | |
| 149 | 150 | |
| 150 | /* for the console alone... */ | |
| 151 | ||
| 152 | DEVICE_START( intv_cart ); | |
| 153 | DEVICE_IMAGE_LOAD( intv_cart ); | |
| 154 | ||
| 155 | /* for the console + keyboard component... */ | |
| 156 | ||
| 157 | DEVICE_IMAGE_LOAD( intvkbd_cart ); | |
| 158 | ||
| 159 | 151 | #endif /* INTV_H_ */ |
| r20749 | r20750 | |
|---|---|---|
| 126 | 126 | DECLARE_WRITE8_MEMBER(psg_4015_w); |
| 127 | 127 | DECLARE_WRITE8_MEMBER(psg_4017_w); |
| 128 | 128 | void nes_banks_restore(); |
| 129 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(nes_cart); | |
| 130 | DECLARE_DEVICE_IMAGE_START_MEMBER(nes_disk); | |
| 131 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(nes_disk); | |
| 132 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER(nes_disk); | |
| 129 | 133 | |
| 130 | 134 | ioport_port *m_io_ctrlsel; |
| 131 | 135 | ioport_port *m_io_fckey[9]; |
| r20749 | r20750 | |
| 156 | 160 | |
| 157 | 161 | /* protos */ |
| 158 | 162 | |
| 159 | DEVICE_IMAGE_LOAD(nes_cart); | |
| 160 | DEVICE_START(nes_disk); | |
| 161 | DEVICE_IMAGE_LOAD(nes_disk); | |
| 162 | DEVICE_IMAGE_UNLOAD(nes_disk); | |
| 163 | ||
| 164 | 163 | int nes_ppu_vidaccess( device_t *device, int address, int data ); |
| 165 | 164 | |
| 166 | 165 | void nes_partialhash(hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions); |
| r20749 | r20750 | |
|---|---|---|
| 130 | 130 | DECLARE_WRITE8_MEMBER(msx_printer_strobe_w); |
| 131 | 131 | DECLARE_WRITE8_MEMBER(msx_printer_data_w); |
| 132 | 132 | DECLARE_READ8_MEMBER(msx_printer_status_r); |
| 133 | ||
| 134 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( msx_cart ); | |
| 135 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( msx_cart ); | |
| 133 | 136 | }; |
| 134 | 137 | |
| 135 | 138 | |
| r20749 | r20750 | |
| 139 | 142 | extern const wd17xx_interface msx_wd17xx_interface; |
| 140 | 143 | /* start/stop functions */ |
| 141 | 144 | |
| 142 | DEVICE_IMAGE_LOAD( msx_cart ); | |
| 143 | DEVICE_IMAGE_UNLOAD( msx_cart ); | |
| 144 | ||
| 145 | 145 | void msx_vdp_interrupt(device_t *, v99x8_device &device, int i); |
| 146 | 146 | |
| 147 | 147 | /* I/O functions */ |
| r20749 | r20750 | |
|---|---|---|
| 260 | 260 | TIMER_CALLBACK_MEMBER(gamecom_scanline); |
| 261 | 261 | DECLARE_WRITE8_MEMBER( gamecom_handle_dma ); |
| 262 | 262 | DECLARE_WRITE8_MEMBER( gamecom_update_timers ); |
| 263 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( gamecom_cart1 ); | |
| 264 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( gamecom_cart2 ); | |
| 263 | 265 | |
| 264 | 266 | protected: |
| 265 | 267 | required_memory_bank m_bank1; |
| r20749 | r20750 | |
| 275 | 277 | required_ioport m_io_styy; |
| 276 | 278 | }; |
| 277 | 279 | |
| 278 | ||
| 279 | /*----------- defined in machine/gamecom.c -----------*/ | |
| 280 | ||
| 281 | extern DEVICE_IMAGE_LOAD( gamecom_cart1 ); | |
| 282 | extern DEVICE_IMAGE_LOAD( gamecom_cart2 ); | |
| 283 | ||
| 284 | 280 | #endif /* GAMECOM_H_ */ |
| r20749 | r20750 | |
|---|---|---|
| 93 | 93 | virtual void palette_init(); |
| 94 | 94 | UINT32 screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 95 | 95 | INTERRUPT_GEN_MEMBER(arcadia_video_line); |
| 96 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( arcadia_cart ); | |
| 96 | 97 | |
| 97 | 98 | protected: |
| 98 | 99 | required_device<arcadia_sound_device> m_custom; |
| r20749 | r20750 | |
|---|---|---|
| 28 | 28 | #include "machine/thomflop.h" |
| 29 | 29 | |
| 30 | 30 | |
| 31 | class thomson_state : public driver_device | |
| 32 | { | |
| 33 | public: | |
| 34 | thomson_state(const machine_config &mconfig, device_type type, const char *tag) | |
| 35 | : driver_device(mconfig, type, tag) | |
| 36 | { } | |
| 37 | ||
| 38 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( to7_cartridge ); | |
| 39 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( mo5_cartridge ); | |
| 40 | }; | |
| 41 | ||
| 31 | 42 | /*----------- defined in machine/thomson.c -----------*/ |
| 32 | 43 | |
| 33 | 44 | /*************************** common ********************************/ |
| r20749 | r20750 | |
| 66 | 77 | /***************************** TO7 / T9000 *************************/ |
| 67 | 78 | |
| 68 | 79 | /* cartridge bank-switching */ |
| 69 | extern DEVICE_IMAGE_LOAD( to7_cartridge ); | |
| 70 | 80 | extern DECLARE_WRITE8_HANDLER ( to7_cartridge_w ); |
| 71 | 81 | extern DECLARE_READ8_HANDLER ( to7_cartridge_r ); |
| 72 | 82 | |
| r20749 | r20750 | |
| 113 | 123 | extern DECLARE_WRITE8_HANDLER ( mo5_gatearray_w ); |
| 114 | 124 | |
| 115 | 125 | /* cartridge / extended RAM bank-switching */ |
| 116 | extern DEVICE_IMAGE_LOAD( mo5_cartridge ); | |
| 117 | 126 | extern DECLARE_WRITE8_HANDLER ( mo5_ext_w ); |
| 118 | 127 | extern DECLARE_WRITE8_HANDLER ( mo5_cartridge_w ); |
| 119 | 128 | extern DECLARE_READ8_HANDLER ( mo5_cartridge_r ); |
| r20749 | r20750 | |
|---|---|---|
| 109 | 109 | DECLARE_WRITE8_MEMBER(svi318_ppi_port_c_w); |
| 110 | 110 | DECLARE_WRITE_LINE_MEMBER(svi_fdc_intrq_w); |
| 111 | 111 | DECLARE_WRITE_LINE_MEMBER(svi_fdc_drq_w); |
| 112 | DECLARE_DEVICE_IMAGE_START_MEMBER(svi318_cart); | |
| 113 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(svi318_cart); | |
| 114 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER(svi318_cart); | |
| 112 | 115 | |
| 113 | 116 | protected: |
| 114 | 117 | required_device<cpu_device> m_maincpu; |
| r20749 | r20750 | |
| 143 | 146 | extern const ins8250_interface svi318_ins8250_interface[2]; |
| 144 | 147 | extern const wd17xx_interface svi_wd17xx_interface; |
| 145 | 148 | |
| 146 | DEVICE_START( svi318_cart ); | |
| 147 | DEVICE_IMAGE_LOAD( svi318_cart ); | |
| 148 | DEVICE_IMAGE_UNLOAD( svi318_cart ); | |
| 149 | ||
| 150 | ||
| 151 | 149 | int svi318_cassette_present(running_machine &machine, int id); |
| 152 | 150 | |
| 153 | 151 | MC6845_UPDATE_ROW( svi806_crtc6845_update_row ); |
| r20749 | r20750 | |
|---|---|---|
| 148 | 148 | void mc1502_fdc_irq_drq(bool state); |
| 149 | 149 | DECLARE_FLOPPY_FORMATS( floppy_formats ); |
| 150 | 150 | IRQ_CALLBACK_MEMBER(pc_irq_callback); |
| 151 | ||
| 152 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( pcjr_cartridge ); | |
| 151 | 153 | }; |
| 152 | 154 | |
| 153 | 155 | /*----------- defined in machine/pc.c -----------*/ |
| r20749 | r20750 | |
| 173 | 175 | |
| 174 | 176 | void mess_init_pc_common( running_machine &machine, UINT32 flags, void (*set_keyb_int_func)(running_machine &, int), void (*set_hdc_int_func)(running_machine &,int,int)); |
| 175 | 177 | |
| 176 | ||
| 177 | DEVICE_IMAGE_LOAD( pcjr_cartridge ); | |
| 178 | ||
| 179 | 178 | void pc_rtc_init(running_machine &machine); |
| 180 | 179 | |
| 181 | 180 |
| r20749 | r20750 | |
|---|---|---|
| 115 | 115 | virtual void palette_init(); |
| 116 | 116 | UINT32 screen_update_vc4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 117 | 117 | INTERRUPT_GEN_MEMBER(vc4000_video_line); |
| 118 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(vc4000_cart); | |
| 118 | 119 | |
| 119 | 120 | protected: |
| 120 | 121 | required_device<cpu_device> m_maincpu; |
| r20749 | r20750 | |
|---|---|---|
| 30 | 30 | DECLARE_WRITE8_MEMBER( port_b_w ); |
| 31 | 31 | DECLARE_READ8_MEMBER( port_c_r ); |
| 32 | 32 | UINT32 screen_update_gamepock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 33 | DECLARE_DEVICE_IMAGE_START_MEMBER(gamepock_cart); | |
| 34 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(gamepock_cart); | |
| 33 | 35 | }; |
| 34 | 36 | |
| 35 | 37 |
| r20749 | r20750 | |
|---|---|---|
| 51 | 51 | DECLARE_READ_LINE_MEMBER( ef4_r ); |
| 52 | 52 | DECLARE_WRITE_LINE_MEMBER( q_w ); |
| 53 | 53 | DECLARE_INPUT_CHANGED_MEMBER( reset_w ); |
| 54 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( studio2_cart_load ); | |
| 54 | 55 | |
| 55 | 56 | /* keyboard state */ |
| 56 | 57 | UINT8 m_keylatch; |
| r20749 | r20750 | |
|---|---|---|
| 68 | 68 | DECLARE_READ8_MEMBER(mra_bank2); |
| 69 | 69 | DECLARE_READ8_MEMBER(mra_bank3); |
| 70 | 70 | DECLARE_READ8_MEMBER(mra_bank4); |
| 71 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( laser_cart ); | |
| 72 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( laser_cart ); | |
| 71 | 73 | }; |
| 72 | 74 | |
| 73 | 75 | |
| 74 | /*----------- defined in machine/vtech2.c -----------*/ | |
| 75 | DEVICE_IMAGE_LOAD( laser_cart ); | |
| 76 | DEVICE_IMAGE_UNLOAD( laser_cart ); | |
| 77 | ||
| 78 | 76 | #endif /* VTECH2_H_ */ |
| r20749 | r20750 | |
|---|---|---|
| 70 | 70 | DECLARE_READ8_MEMBER(riot_joystick_r); |
| 71 | 71 | DECLARE_READ8_MEMBER(riot_console_button_r); |
| 72 | 72 | DECLARE_WRITE8_MEMBER(riot_button_pullup_w); |
| 73 | ||
| 74 | DECLARE_DEVICE_IMAGE_START_MEMBER( a7800_cart ); | |
| 75 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a7800_cart ); | |
| 73 | 76 | }; |
| 74 | 77 | |
| 75 | 78 | /*----------- defined in machine/a7800.c -----------*/ |
| r20749 | r20750 | |
| 78 | 81 | |
| 79 | 82 | void a7800_partialhash(hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions); |
| 80 | 83 | |
| 81 | DEVICE_START( a7800_cart ); | |
| 82 | DEVICE_IMAGE_LOAD( a7800_cart ); | |
| 83 | ||
| 84 | 84 | #endif /* A7800_H_ */ |
| r20749 | r20750 | |
|---|---|---|
| 94 | 94 | DECLARE_WRITE_LINE_MEMBER(nc200_fdc_interrupt); |
| 95 | 95 | |
| 96 | 96 | void nc200_fdc_interrupt(bool state); |
| 97 | ||
| 98 | DECLARE_DEVICE_IMAGE_START_MEMBER( nc_pcmcia_card ); | |
| 99 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( nc_pcmcia_card ); | |
| 100 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( nc_pcmcia_card ); | |
| 101 | ||
| 97 | 102 | void nc100_machine_stop(); |
| 98 | 103 | void nc200_machine_stop(); |
| 99 | 104 | }; |
| r20749 | r20750 | |
| 112 | 117 | |
| 113 | 118 | void nc_set_card_present_state(running_machine &machine, int state); |
| 114 | 119 | |
| 115 | ||
| 116 | /*----------- defined in machine/nc.c -----------*/ | |
| 117 | ||
| 118 | DEVICE_START( nc_pcmcia_card ); | |
| 119 | DEVICE_IMAGE_LOAD( nc_pcmcia_card ); | |
| 120 | DEVICE_IMAGE_UNLOAD( nc_pcmcia_card ); | |
| 121 | ||
| 122 | 120 | #endif /* NC_H_ */ |
| r20749 | r20750 | |
|---|---|---|
| 54 | 54 | DECLARE_WRITE_LINE_MEMBER(nascom2_fdc_drq_w); |
| 55 | 55 | DECLARE_READ8_MEMBER(nascom1_hd6402_si); |
| 56 | 56 | DECLARE_WRITE8_MEMBER(nascom1_hd6402_so); |
| 57 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( nascom1_cassette ); | |
| 58 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( nascom1_cassette ); | |
| 57 | 59 | }; |
| 58 | 60 | |
| 59 | 61 | |
| r20749 | r20750 | |
| 61 | 63 | |
| 62 | 64 | extern const wd17xx_interface nascom2_wd17xx_interface; |
| 63 | 65 | |
| 64 | DEVICE_IMAGE_LOAD( nascom1_cassette ); | |
| 65 | DEVICE_IMAGE_UNLOAD( nascom1_cassette ); | |
| 66 | 66 | SNAPSHOT_LOAD( nascom1 ); |
| 67 | 67 | #endif /* NASCOM1_H_ */ |
| r20749 | r20750 | |
|---|---|---|
| 78 | 78 | TIMER_CALLBACK_MEMBER(pokemini_prc_counter_callback); |
| 79 | 79 | DECLARE_WRITE8_MEMBER(pokemini_hwreg_w); |
| 80 | 80 | DECLARE_READ8_MEMBER(pokemini_hwreg_r); |
| 81 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pokemini_cart); | |
| 81 | 82 | |
| 82 | 83 | protected: |
| 83 | 84 | required_device<speaker_sound_device> m_speaker; |
| r20749 | r20750 | |
| 88 | 89 | void pokemini_update_sound(); |
| 89 | 90 | }; |
| 90 | 91 | |
| 91 | ||
| 92 | /*----------- defined in machine/pokemini.c -----------*/ | |
| 93 | DEVICE_IMAGE_LOAD( pokemini_cart ); | |
| 94 | ||
| 95 | 92 | #endif /* POKEMINI_H */ |
| r20749 | r20750 | |
|---|---|---|
| 267 | 267 | TIMER_CALLBACK_MEMBER(gb_lcd_timer_proc); |
| 268 | 268 | TIMER_CALLBACK_MEMBER(gbc_lcd_timer_proc); |
| 269 | 269 | DECLARE_WRITE8_MEMBER(gb_timer_callback); |
| 270 | DECLARE_DEVICE_IMAGE_START_MEMBER(gb_cart); | |
| 271 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(gb_cart); | |
| 272 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(megaduck_cart); | |
| 270 | 273 | |
| 271 | 274 | protected: |
| 272 | 275 | required_device<lr35902_cpu_device> m_maincpu; |
| r20749 | r20750 | |
| 308 | 311 | |
| 309 | 312 | /*----------- defined in machine/gb.c -----------*/ |
| 310 | 313 | |
| 311 | DEVICE_START(gb_cart); | |
| 312 | DEVICE_IMAGE_LOAD(gb_cart); | |
| 313 | ||
| 314 | ||
| 315 | 314 | /* -- Super Game Boy specific -- */ |
| 316 | 315 | #define SGB_BORDER_PAL_OFFSET 64 /* Border colours stored from pal 4-7 */ |
| 317 | 316 | #define SGB_XOFFSET 48 /* GB screen starts at column 48 */ |
| 318 | 317 | #define SGB_YOFFSET 40 /* GB screen starts at row 40 */ |
| 319 | 318 | |
| 320 | 319 | |
| 321 | /* -- Megaduck specific -- */ | |
| 322 | extern DEVICE_IMAGE_LOAD(megaduck_cart); | |
| 323 | ||
| 324 | ||
| 325 | ||
| 326 | 320 | /*----------- defined in video/gb.c -----------*/ |
| 327 | 321 | |
| 328 | 322 | enum |
| r20749 | r20750 | |
|---|---|---|
| 191 | 191 | DECLARE_FLOPPY_FORMATS( floppy_formats ); |
| 192 | 192 | |
| 193 | 193 | IRQ_CALLBACK_MEMBER(amstrad_cpu_acknowledge_int); |
| 194 | ||
| 195 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( amstrad_plus_cartridge ); | |
| 194 | 196 | }; |
| 195 | 197 | |
| 196 | 198 | |
| r20749 | r20750 | |
| 204 | 206 | |
| 205 | 207 | SNAPSHOT_LOAD( amstrad ); |
| 206 | 208 | |
| 207 | DEVICE_IMAGE_LOAD(amstrad_plus_cartridge); | |
| 208 | ||
| 209 | 209 | extern const mc6845_interface amstrad_mc6845_intf; |
| 210 | 210 | extern const mc6845_interface amstrad_plus_mc6845_intf; |
| 211 | 211 |
| r20749 | r20750 | |
|---|---|---|
| 209 | 209 | DECLARE_WRITE_LINE_MEMBER(sms_pause_callback); |
| 210 | 210 | DECLARE_WRITE_LINE_MEMBER(sms_store_int_callback); |
| 211 | 211 | void sms_machine_stop(); |
| 212 | DECLARE_DEVICE_IMAGE_START_MEMBER(sms_cart); | |
| 213 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(sms_cart); | |
| 212 | 214 | protected: |
| 213 | 215 | required_shared_ptr<UINT8> m_mainram; |
| 214 | 216 | |
| r20749 | r20750 | |
| 229 | 231 | |
| 230 | 232 | /*----------- defined in machine/sms.c -----------*/ |
| 231 | 233 | |
| 232 | DEVICE_START( sms_cart ); | |
| 233 | DEVICE_IMAGE_LOAD( sms_cart ); | |
| 234 | ||
| 235 | ||
| 236 | 234 | #define IO_EXPANSION (0x80) /* Expansion slot enable (1= disabled, 0= enabled) */ |
| 237 | 235 | #define IO_CARTRIDGE (0x40) /* Cartridge slot enable (1= disabled, 0= enabled) */ |
| 238 | 236 | #define IO_CARD (0x20) /* Card slot disabled (1= disabled, 0= enabled) */ |
| r20749 | r20750 | |
|---|---|---|
| 145 | 145 | TIMER_CALLBACK_MEMBER(lynx_uart_loopback_timer); |
| 146 | 146 | TIMER_CALLBACK_MEMBER(lynx_uart_timer); |
| 147 | 147 | void lynx_postload(); |
| 148 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( lynx_cart ); | |
| 148 | 149 | }; |
| 149 | 150 | |
| 150 | 151 |
| r20749 | r20750 | |
|---|---|---|
| 64 | 64 | TIMER_CALLBACK_MEMBER(svision_timer); |
| 65 | 65 | TIMER_DEVICE_CALLBACK_MEMBER(svision_pet_timer_dev); |
| 66 | 66 | void svision_irq(); |
| 67 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(svision_cart); | |
| 67 | 68 | |
| 68 | 69 | protected: |
| 69 | 70 | required_device<cpu_device> m_maincpu; |
| r20749 | r20750 | |
|---|---|---|
| 123 | 123 | UINT32 screen_update_ts2068(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 124 | 124 | void screen_eof_spectrum(screen_device &screen, bool state); |
| 125 | 125 | INTERRUPT_GEN_MEMBER(spec_interrupt); |
| 126 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( spectrum_cart ); | |
| 127 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( timex_cart ); | |
| 128 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( timex_cart ); | |
| 126 | 129 | |
| 127 | 130 | unsigned int m_previous_border_x, m_previous_border_y; |
| 128 | 131 | bitmap_ind16 m_border_bitmap; |
| r20749 | r20750 | |
|---|---|---|
| 153 | 153 | TIMER_CALLBACK_MEMBER(pce_cd_clear_ack); |
| 154 | 154 | TIMER_CALLBACK_MEMBER(pce_cd_adpcm_dma_timer_callback); |
| 155 | 155 | DECLARE_WRITE_LINE_MEMBER(pce_irq_changed); |
| 156 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pce_cart); | |
| 156 | 157 | }; |
| 157 | 158 | |
| 158 | 159 | |
| 159 | 160 | /*----------- defined in machine/pce.c -----------*/ |
| 160 | DEVICE_IMAGE_LOAD(pce_cart); | |
| 161 | 161 | extern const msm5205_interface pce_cd_msm5205_interface; |
| 162 | 162 | |
| 163 | 163 | #endif /* PCE_H_ */ |
| r20749 | r20750 | |
|---|---|---|
| 67 | 67 | DECLARE_READ8_MEMBER( tvdraw_data_r ); |
| 68 | 68 | DECLARE_READ8_MEMBER( joysel_r ); |
| 69 | 69 | DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi ); |
| 70 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( sg1000_cart ); | |
| 71 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( omv_cart ); | |
| 70 | 72 | |
| 71 | 73 | /* keyboard state */ |
| 72 | 74 | UINT8 m_keylatch; |
| r20749 | r20750 | |
| 126 | 128 | DECLARE_READ8_MEMBER( ppi_pa_r ); |
| 127 | 129 | DECLARE_READ8_MEMBER( ppi_pb_r ); |
| 128 | 130 | DECLARE_WRITE8_MEMBER( ppi_pc_w ); |
| 131 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( sc3000_cart ); | |
| 129 | 132 | |
| 130 | 133 | ioport_port* m_key_row[16]; |
| 131 | 134 | }; |
| r20749 | r20750 | |
|---|---|---|
| 47 | 47 | DECLARE_WRITE8_MEMBER( riot_pb_w ); |
| 48 | 48 | DECLARE_INPUT_CHANGED_MEMBER( trigger_reset ); |
| 49 | 49 | |
| 50 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( beta_eprom ); | |
| 51 | ||
| 50 | 52 | /* EPROM state */ |
| 51 | 53 | int m_eprom_oe; |
| 52 | 54 | int m_eprom_ce; |
| r20749 | r20750 | |
|---|---|---|
| 199 | 199 | inline void draw_point(UINT8 x, UINT8 y, UINT8 color); |
| 200 | 200 | inline void draw_udk(); |
| 201 | 201 | |
| 202 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( x07_card ); | |
| 203 | ||
| 202 | 204 | /* general */ |
| 203 | 205 | UINT8 m_sleep; |
| 204 | 206 | UINT8 m_warm_start; |
| r20749 | r20750 | |
|---|---|---|
| 304 | 304 | DECLARE_WRITE_LINE_MEMBER(bbc_wd177x_intrq_w); |
| 305 | 305 | DECLARE_WRITE_LINE_MEMBER(bbc_wd177x_drq_w); |
| 306 | 306 | DECLARE_WRITE_LINE_MEMBER(bbc_vsync); |
| 307 | ||
| 308 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( bbcb_cart ); | |
| 307 | 309 | }; |
| 308 | 310 | |
| 309 | 311 | |
| r20749 | r20750 | |
| 317 | 319 | extern const via6522_interface bbcb_user_via; |
| 318 | 320 | extern const wd17xx_interface bbc_wd17xx_interface; |
| 319 | 321 | |
| 320 | /* disc support */ | |
| 321 | ||
| 322 | DEVICE_IMAGE_LOAD ( bbcb_cart ); | |
| 323 | ||
| 324 | 322 | /* tape support */ |
| 325 | 323 | |
| 326 | 324 |
| r20749 | r20750 | |
|---|---|---|
| 278 | 278 | TIMER_CALLBACK_MEMBER(perform_hbl); |
| 279 | 279 | TIMER_CALLBACK_MEMBER(perform_scan); |
| 280 | 280 | void gba_machine_stop(); |
| 281 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(gba_cart); | |
| 281 | 282 | }; |
| 282 | 283 | |
| 283 | 284 | /*----------- defined in video/gba.c -----------*/ |
| r20749 | r20750 | |
|---|---|---|
| 112 | 112 | TIMER_DEVICE_CALLBACK_MEMBER(counter_tick); |
| 113 | 113 | DECLARE_READ8_MEMBER(hd61830_rd_r); |
| 114 | 114 | IRQ_CALLBACK_MEMBER(portfolio_int_ack); |
| 115 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( portfolio_cart ); | |
| 115 | 116 | }; |
| 116 | 117 | |
| 117 | 118 | #endif |
| r20749 | r20750 | |
|---|---|---|
| 144 | 144 | TIMER_CALLBACK_MEMBER(wswan_rtc_callback); |
| 145 | 145 | TIMER_CALLBACK_MEMBER(wswan_scanline_interrupt); |
| 146 | 146 | void wswan_machine_stop(); |
| 147 | DECLARE_DEVICE_IMAGE_START_MEMBER( wswan_cart ); | |
| 148 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( wswan_cart ); | |
| 147 | 149 | |
| 148 | 150 | protected: |
| 149 | 151 | /* Interrupt flags */ |
| r20749 | r20750 | |
| 176 | 178 | }; |
| 177 | 179 | |
| 178 | 180 | |
| 179 | /*----------- defined in machine/wswan.c -----------*/ | |
| 180 | ||
| 181 | ||
| 182 | ||
| 183 | ||
| 184 | DEVICE_START(wswan_cart); | |
| 185 | DEVICE_IMAGE_LOAD(wswan_cart); | |
| 186 | ||
| 187 | ||
| 188 | 181 | /*----------- defined in video/wswan.c -----------*/ |
| 189 | 182 | |
| 190 | 183 | void wswan_refresh_scanline( running_machine &machine ); |
| r20749 | r20750 | |
|---|---|---|
| 116 | 116 | /* devices */ |
| 117 | 117 | int m_previous_i8271_int_state; |
| 118 | 118 | TIMER_DEVICE_CALLBACK_MEMBER(cassette_output_tick); |
| 119 | ||
| 120 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( atom_cart ); | |
| 119 | 121 | }; |
| 120 | 122 | |
| 121 | 123 | class atomeb_state : public atom_state |
| r20749 | r20750 | |
|---|---|---|
| 48 | 48 | TIMER_CALLBACK_MEMBER(paddle_pulse_callback); |
| 49 | 49 | TIMER_DEVICE_CALLBACK_MEMBER(paddle_update_callback); |
| 50 | 50 | DECLARE_WRITE_LINE_MEMBER(coleco_vdp_interrupt); |
| 51 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(czz50_cart); | |
| 51 | 52 | }; |
| 52 | 53 | |
| 53 | 54 | #endif |
| r20749 | r20750 | |
|---|---|---|
| 31 | 31 | static timex_cart_t timex_cart; |
| 32 | 32 | |
| 33 | 33 | |
| 34 | DEVICE_IMAGE_LOAD( timex_cart ) | |
| 34 | DEVICE_IMAGE_LOAD_LEGACY( timex_cart ) | |
| 35 | 35 | { |
| 36 | 36 | int file_size; |
| 37 | 37 | UINT8 * file_data; |
| r20749 | r20750 | |
| 111 | 111 | return IMAGE_INIT_PASS; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | DEVICE_IMAGE_UNLOAD( timex_cart ) | |
| 114 | DEVICE_IMAGE_UNLOAD_LEGACY( timex_cart ) | |
| 115 | 115 | { |
| 116 | 116 | if (timex_cart.data) |
| 117 | 117 | { |
| r20749 | r20750 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | const timex_cart_t *timex_cart_data(void); |
| 29 | 29 | |
| 30 | DEVICE_IMAGE_LOAD( timex_cart ); | |
| 31 | DEVICE_IMAGE_UNLOAD( timex_cart ); | |
| 30 | DEVICE_IMAGE_LOAD_LEGACY( timex_cart ); | |
| 31 | DEVICE_IMAGE_UNLOAD_LEGACY( timex_cart ); | |
| 32 | 32 | |
| 33 | 33 | #endif /* __TIMEX_DCK_H__ */ |
| r20749 | r20750 | |
|---|---|---|
| 47 | 47 | DEVICE_IMAGE_LOAD( st2_cartslot_load ) |
| 48 | 48 | -------------------------------------------------*/ |
| 49 | 49 | |
| 50 | DEVICE_IMAGE_LOAD( st2_cartslot_load ) | |
| 50 | DEVICE_IMAGE_LOAD_LEGACY( st2_cartslot_load ) | |
| 51 | 51 | { |
| 52 | 52 | st2_header header; |
| 53 | 53 |
| r20749 | r20750 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | #include "emu.h" |
| 15 | 15 | |
| 16 | DEVICE_IMAGE_LOAD( st2_cartslot_load ); | |
| 16 | DEVICE_IMAGE_LOAD_LEGACY( st2_cartslot_load ); | |
| 17 | 17 | |
| 18 | 18 | #endif |
| r20749 | r20750 | |
|---|---|---|
| 451 | 451 | colortable_entry_set_value(machine().colortable, i, arcadia_palette[i]); |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | ||
| 454 | DEVICE_IMAGE_LOAD_MEMBER( arcadia_state, arcadia_cart ) | |
| 455 | 455 | { |
| 456 | 456 | UINT8 *rom = image.device().machine().root_device().memregion("maincpu")->base(); |
| 457 | 457 | int size; |
| r20749 | r20750 | |
| 555 | 555 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 556 | 556 | MCFG_CARTSLOT_NOT_MANDATORY |
| 557 | 557 | MCFG_CARTSLOT_INTERFACE("arcadia_cart") |
| 558 | MCFG_CARTSLOT_LOAD(arcadia_cart) | |
| 558 | MCFG_CARTSLOT_LOAD(arcadia_state,arcadia_cart) | |
| 559 | 559 | |
| 560 | 560 | /* Software lists */ |
| 561 | 561 | MCFG_SOFTWARE_LIST_ADD("cart_list","arcadia") |
| r20749 | r20750 | |
|---|---|---|
| 292 | 292 | |
| 293 | 293 | |
| 294 | 294 | **********************************************************************/ |
| 295 | class thomson_state : public driver_device | |
| 296 | { | |
| 297 | public: | |
| 298 | thomson_state(const machine_config &mconfig, device_type type, const char *tag) | |
| 299 | : driver_device(mconfig, type, tag) { } | |
| 300 | 295 | |
| 301 | }; | |
| 302 | ||
| 303 | ||
| 304 | 296 | /* ------------ address maps ------------ */ |
| 305 | 297 | |
| 306 | 298 | static ADDRESS_MAP_START ( to7, AS_PROGRAM, 8, thomson_state ) |
| r20749 | r20750 | |
| 692 | 684 | MCFG_CARTSLOT_ADD("cart") |
| 693 | 685 | MCFG_CARTSLOT_EXTENSION_LIST("m7,rom") |
| 694 | 686 | MCFG_CARTSLOT_NOT_MANDATORY |
| 695 | MCFG_CARTSLOT_LOAD(to7_cartridge) | |
| 687 | MCFG_CARTSLOT_LOAD(thomson_state,to7_cartridge) | |
| 696 | 688 | MCFG_CARTSLOT_INTERFACE("to7_cart") |
| 697 | 689 | MCFG_SOFTWARE_LIST_ADD("cart_list","to7_cart") |
| 698 | 690 | |
| r20749 | r20750 | |
| 1067 | 1059 | |
| 1068 | 1060 | MCFG_CARTSLOT_MODIFY("cart") |
| 1069 | 1061 | MCFG_CARTSLOT_EXTENSION_LIST("m5,rom") |
| 1070 | MCFG_CARTSLOT_LOAD(mo5_cartridge) | |
| 1062 | MCFG_CARTSLOT_LOAD(thomson_state,mo5_cartridge) | |
| 1071 | 1063 | MCFG_CARTSLOT_INTERFACE("mo5_cart") |
| 1072 | 1064 | |
| 1073 | 1065 | MCFG_DEVICE_REMOVE("cart_list") |
| r20749 | r20750 | |
| 2107 | 2099 | |
| 2108 | 2100 | MCFG_CARTSLOT_MODIFY("cart") |
| 2109 | 2101 | MCFG_CARTSLOT_EXTENSION_LIST("m5,rom") |
| 2110 | MCFG_CARTSLOT_LOAD(mo5_cartridge) | |
| 2102 | MCFG_CARTSLOT_LOAD(thomson_state, mo5_cartridge) | |
| 2111 | 2103 | |
| 2112 | 2104 | /* internal ram */ |
| 2113 | 2105 | MCFG_RAM_MODIFY(RAM_TAG) |
| r20749 | r20750 | |
| 2332 | 2324 | |
| 2333 | 2325 | MCFG_CARTSLOT_MODIFY("cart") |
| 2334 | 2326 | MCFG_CARTSLOT_EXTENSION_LIST("m5,rom") |
| 2335 | MCFG_CARTSLOT_LOAD(mo5_cartridge) | |
| 2327 | MCFG_CARTSLOT_LOAD(thomson_state, mo5_cartridge) | |
| 2336 | 2328 | |
| 2337 | 2329 | /* internal ram */ |
| 2338 | 2330 | MCFG_RAM_MODIFY(RAM_TAG) |
| r20749 | r20750 | |
|---|---|---|
| 741 | 741 | // DEVICE_IMAGE_LOAD( portfolio_cart ) |
| 742 | 742 | //------------------------------------------------- |
| 743 | 743 | |
| 744 | ||
| 744 | DEVICE_IMAGE_LOAD_MEMBER( portfolio_state, portfolio_cart ) | |
| 745 | 745 | { |
| 746 | 746 | return IMAGE_INIT_FAIL; |
| 747 | 747 | } |
| r20749 | r20750 | |
| 862 | 862 | MCFG_CARTSLOT_ADD("cart") |
| 863 | 863 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 864 | 864 | MCFG_CARTSLOT_INTERFACE("portfolio_cart") |
| 865 | MCFG_CARTSLOT_LOAD(portfolio_cart) | |
| 865 | MCFG_CARTSLOT_LOAD(portfolio_state,portfolio_cart) | |
| 866 | 866 | |
| 867 | 867 | /* memory card */ |
| 868 | 868 | /* MCFG_MEMCARD_ADD("memcard_a") |
| r20749 | r20750 | |
|---|---|---|
| 270 | 270 | MCFG_CARTSLOT_EXTENSION_LIST("pce,bin") |
| 271 | 271 | MCFG_CARTSLOT_MANDATORY |
| 272 | 272 | MCFG_CARTSLOT_INTERFACE("pce_cart") |
| 273 | MCFG_CARTSLOT_LOAD(pce_cart) | |
| 273 | MCFG_CARTSLOT_LOAD(pce_state,pce_cart) | |
| 274 | 274 | MCFG_CARTSLOT_PARTIALHASH(pce_partialhash) |
| 275 | 275 | MCFG_SOFTWARE_LIST_ADD("cart_list","pce") |
| 276 | 276 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
| 280 | 280 | MCFG_CARTSLOT_EXTENSION_LIST("pce,bin") |
| 281 | 281 | MCFG_CARTSLOT_MANDATORY |
| 282 | 282 | MCFG_CARTSLOT_INTERFACE("tg16_cart") |
| 283 | MCFG_CARTSLOT_LOAD(pce_cart) | |
| 283 | MCFG_CARTSLOT_LOAD(pce_state,pce_cart) | |
| 284 | 284 | MCFG_CARTSLOT_PARTIALHASH(pce_partialhash) |
| 285 | 285 | MCFG_SOFTWARE_LIST_ADD("cart_list","tg16") |
| 286 | 286 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
| 290 | 290 | MCFG_CARTSLOT_EXTENSION_LIST("pce,bin") |
| 291 | 291 | MCFG_CARTSLOT_MANDATORY |
| 292 | 292 | MCFG_CARTSLOT_INTERFACE("pce_cart") |
| 293 | MCFG_CARTSLOT_LOAD(pce_cart) | |
| 293 | MCFG_CARTSLOT_LOAD(pce_state,pce_cart) | |
| 294 | 294 | MCFG_CARTSLOT_PARTIALHASH(pce_partialhash) |
| 295 | 295 | MCFG_SOFTWARE_LIST_ADD("cart_list","sgx") |
| 296 | 296 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
|---|---|---|
| 820 | 820 | MCFG_CARTSLOT_ADD("cart1") |
| 821 | 821 | MCFG_CARTSLOT_EXTENSION_LIST("rom") |
| 822 | 822 | MCFG_CARTSLOT_NOT_MANDATORY |
| 823 | MCFG_CARTSLOT_LOAD(bbcb_cart) | |
| 823 | MCFG_CARTSLOT_LOAD(bbc_state, bbcb_cart) | |
| 824 | 824 | |
| 825 | 825 | MCFG_CARTSLOT_ADD("cart2") |
| 826 | 826 | MCFG_CARTSLOT_EXTENSION_LIST("rom") |
| 827 | 827 | MCFG_CARTSLOT_NOT_MANDATORY |
| 828 | MCFG_CARTSLOT_LOAD(bbcb_cart) | |
| 828 | MCFG_CARTSLOT_LOAD(bbc_state, bbcb_cart) | |
| 829 | 829 | |
| 830 | 830 | MCFG_CARTSLOT_ADD("cart3") |
| 831 | 831 | MCFG_CARTSLOT_EXTENSION_LIST("rom") |
| 832 | 832 | MCFG_CARTSLOT_NOT_MANDATORY |
| 833 | MCFG_CARTSLOT_LOAD(bbcb_cart) | |
| 833 | MCFG_CARTSLOT_LOAD(bbc_state, bbcb_cart) | |
| 834 | 834 | |
| 835 | 835 | MCFG_CARTSLOT_ADD("cart4") |
| 836 | 836 | MCFG_CARTSLOT_EXTENSION_LIST("rom") |
| 837 | 837 | MCFG_CARTSLOT_NOT_MANDATORY |
| 838 | MCFG_CARTSLOT_LOAD(bbcb_cart) | |
| 838 | MCFG_CARTSLOT_LOAD(bbc_state, bbcb_cart) | |
| 839 | 839 | MACHINE_CONFIG_END |
| 840 | 840 | |
| 841 | 841 | static MACHINE_CONFIG_START( bbca, bbc_state ) |
| r20749 | r20750 | |
|---|---|---|
| 433 | 433 | m_cti->reset(); |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | DEVICE_IMAGE_LOAD( studio2_cart_load ) | |
| 436 | DEVICE_IMAGE_LOAD_MEMBER( studio2_state, studio2_cart_load ) | |
| 437 | 437 | { |
| 438 | 438 | if (image.software_entry() == NULL) |
| 439 | 439 | return device_load_st2_cartslot_load(image); |
| r20749 | r20750 | |
| 454 | 454 | MCFG_CARTSLOT_ADD("cart") |
| 455 | 455 | MCFG_CARTSLOT_EXTENSION_LIST("st2,bin") |
| 456 | 456 | MCFG_CARTSLOT_NOT_MANDATORY |
| 457 | MCFG_CARTSLOT_LOAD(studio2_cart_load) | |
| 457 | MCFG_CARTSLOT_LOAD(studio2_state,studio2_cart_load) | |
| 458 | 458 | MCFG_CARTSLOT_INTERFACE("studio2_cart") |
| 459 | 459 | |
| 460 | 460 | /* software lists */ |
| r20749 | r20750 | |
|---|---|---|
| 286 | 286 | // return retval; |
| 287 | 287 | //} |
| 288 | 288 | |
| 289 | ||
| 289 | DEVICE_IMAGE_LOAD_MEMBER( coleco_state,czz50_cart ) | |
| 290 | 290 | { |
| 291 | 291 | UINT8 *ptr = image.device().machine().root_device().memregion(Z80_TAG)->base() + 0x8000; |
| 292 | 292 | UINT32 size; |
| r20749 | r20750 | |
| 357 | 357 | MCFG_CARTSLOT_ADD("cart") |
| 358 | 358 | MCFG_CARTSLOT_EXTENSION_LIST("rom,col,bin") |
| 359 | 359 | MCFG_CARTSLOT_NOT_MANDATORY |
| 360 | MCFG_CARTSLOT_LOAD(czz50_cart) | |
| 360 | MCFG_CARTSLOT_LOAD(coleco_state,czz50_cart) | |
| 361 | 361 | MCFG_CARTSLOT_INTERFACE("coleco_cart") |
| 362 | 362 | |
| 363 | 363 | /* software lists */ |
| r20749 | r20750 | |
|---|---|---|
| 239 | 239 | |
| 240 | 240 | DECLARE_READ16_MEMBER(unk0_r) { return 0; } |
| 241 | 241 | DECLARE_READ16_MEMBER(unk_r) { return machine().rand(); } |
| 242 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( iq128_cart ); | |
| 243 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( iq128_cart ); | |
| 242 | 244 | |
| 243 | 245 | private: |
| 244 | 246 | UINT16 m_gfx_y; |
| r20749 | r20750 | |
| 762 | 764 | m_cart_state = IQ128_NO_CART; |
| 763 | 765 | } |
| 764 | 766 | |
| 765 | ||
| 767 | DEVICE_IMAGE_LOAD_MEMBER(geniusiq_state,iq128_cart) | |
| 766 | 768 | { |
| 767 | return | |
| 769 | return cart_load(image); | |
| 768 | 770 | } |
| 769 | 771 | |
| 770 | ||
| 772 | DEVICE_IMAGE_UNLOAD_MEMBER(geniusiq_state,iq128_cart) | |
| 771 | 773 | { |
| 772 | | |
| 774 | cart_unload(image); | |
| 773 | 775 | } |
| 774 | 776 | |
| 775 | 777 | static MACHINE_CONFIG_START( iq128, geniusiq_state ) |
| r20749 | r20750 | |
| 794 | 796 | MCFG_CARTSLOT_ADD("cart") |
| 795 | 797 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 796 | 798 | MCFG_CARTSLOT_NOT_MANDATORY |
| 797 | MCFG_CARTSLOT_LOAD(iq128_cart) | |
| 798 | MCFG_CARTSLOT_UNLOAD(iq128_cart) | |
| 799 | MCFG_CARTSLOT_LOAD(geniusiq_state,iq128_cart) | |
| 800 | MCFG_CARTSLOT_UNLOAD(geniusiq_state,iq128_cart) | |
| 799 | 801 | MCFG_CARTSLOT_INTERFACE("iq128_cart") |
| 800 | 802 | |
| 801 | 803 | /* Software lists */ |
| r20749 | r20750 | |
|---|---|---|
| 128 | 128 | DECLARE_WRITE8_MEMBER(switch_B_w); |
| 129 | 129 | DECLARE_WRITE_LINE_MEMBER(irq_callback); |
| 130 | 130 | DECLARE_READ8_MEMBER(riot_input_port_8_r); |
| 131 | DECLARE_DEVICE_IMAGE_START_MEMBER( a2600_cart ); | |
| 132 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a2600_cart ); | |
| 131 | 133 | |
| 132 | 134 | protected: |
| 133 | 135 | required_device<vcs_control_port_device> m_joy1; |
| r20749 | r20750 | |
| 542 | 544 | } |
| 543 | 545 | |
| 544 | 546 | |
| 545 | ||
| 547 | DEVICE_IMAGE_START_MEMBER( a2600_state, a2600_cart ) | |
| 546 | 548 | { |
| 547 | a2600_state *state = device->machine().driver_data<a2600_state>(); | |
| 548 | state->m_banking_mode = 0xff; | |
| 549 | m_banking_mode = 0xff; | |
| 549 | 550 | } |
| 550 | 551 | |
| 551 | 552 | |
| 552 | ||
| 553 | DEVICE_IMAGE_LOAD_MEMBER( a2600_state, a2600_cart ) | |
| 553 | 554 | { |
| 554 | a2600_state *state = image.device().machine().driver_data<a2600_state>(); | |
| 555 | running_machine &machine = image.device().machine(); | |
| 556 | UINT8 *cart = CART; | |
| 555 | UINT8 *cart = memregion("user1")->base(); | |
| 557 | 556 | |
| 558 | 557 | if (image.software_entry() == NULL) |
| 559 | | |
| 558 | m_cart_size = image.length(); | |
| 560 | 559 | else |
| 561 | | |
| 560 | m_cart_size = image.get_software_region_length("rom"); | |
| 562 | 561 | |
| 563 | switch ( | |
| 562 | switch (m_cart_size) | |
| 564 | 563 | { |
| 565 | 564 | case 0x00800: |
| 566 | 565 | case 0x01000: |
| r20749 | r20750 | |
| 579 | 578 | return 1; /* unsupported image format */ |
| 580 | 579 | } |
| 581 | 580 | |
| 582 | | |
| 581 | m_current_bank = 0; | |
| 583 | 582 | |
| 584 | 583 | if (image.software_entry() == NULL) |
| 585 | 584 | { |
| 586 | image.fread(cart, | |
| 585 | image.fread(cart, m_cart_size); | |
| 587 | 586 | } |
| 588 | 587 | else |
| 589 | 588 | { |
| 590 | memcpy(cart, image.get_software_region("rom"), | |
| 589 | memcpy(cart, image.get_software_region("rom"), m_cart_size); | |
| 591 | 590 | |
| 592 | 591 | const char *mapper = software_part_get_feature((software_part*)image.part_entry(), "mapper"); |
| 593 | 592 | |
| r20749 | r20750 | |
| 616 | 615 | { "8in1", mode8in1 }, |
| 617 | 616 | }; |
| 618 | 617 | |
| 619 | for (int i = 0; i < ARRAY_LENGTH(mapper_types) && | |
| 618 | for (int i = 0; i < ARRAY_LENGTH(mapper_types) && m_banking_mode == 0xff; i++) | |
| 620 | 619 | { |
| 621 | 620 | if (!mame_stricmp(mapper, mapper_types[i].mapper_name)) |
| 622 | 621 | { |
| 623 | | |
| 622 | m_banking_mode = mapper_types[i].mapper_type; | |
| 624 | 623 | } |
| 625 | 624 | } |
| 626 | 625 | } |
| 627 | 626 | } |
| 628 | 627 | |
| 629 | if (!( | |
| 628 | if (!(m_cart_size == 0x4000 && detect_modef6(machine()))) | |
| 630 | 629 | { |
| 631 | while ( | |
| 630 | while (m_cart_size > 0x00800) | |
| 632 | 631 | { |
| 633 | if (!memcmp(cart, &cart[ | |
| 632 | if (!memcmp(cart, &cart[m_cart_size/2],m_cart_size/2)) m_cart_size /= 2; | |
| 634 | 633 | else break; |
| 635 | 634 | } |
| 636 | 635 | } |
| r20749 | r20750 | |
| 1922 | 1921 | MCFG_CARTSLOT_ADD("cart") |
| 1923 | 1922 | MCFG_CARTSLOT_EXTENSION_LIST("bin,a26") |
| 1924 | 1923 | MCFG_CARTSLOT_MANDATORY |
| 1925 | MCFG_CARTSLOT_START(a2600_cart) | |
| 1926 | MCFG_CARTSLOT_LOAD(a2600_cart) | |
| 1924 | MCFG_CARTSLOT_START(a2600_state,a2600_cart) | |
| 1925 | MCFG_CARTSLOT_LOAD(a2600_state,a2600_cart) | |
| 1927 | 1926 | MCFG_CARTSLOT_INTERFACE("a2600_cart") |
| 1928 | 1927 | |
| 1929 | 1928 | /* software lists */ |
| r20749 | r20750 | |
|---|---|---|
| 828 | 828 | MCFG_CARTSLOT_EXTENSION_LIST("cpr,bin") |
| 829 | 829 | MCFG_CARTSLOT_MANDATORY |
| 830 | 830 | MCFG_CARTSLOT_INTERFACE("gx4000_cart") |
| 831 | MCFG_CARTSLOT_LOAD(amstrad_plus_cartridge) | |
| 831 | MCFG_CARTSLOT_LOAD(amstrad_state,amstrad_plus_cartridge) | |
| 832 | 832 | MCFG_SOFTWARE_LIST_ADD("cart_list","gx4000") |
| 833 | 833 | MACHINE_CONFIG_END |
| 834 | 834 |
| r20749 | r20750 | |
|---|---|---|
| 1609 | 1609 | MCFG_CARTSLOT_ADD("cart") |
| 1610 | 1610 | MCFG_CARTSLOT_EXTENSION_LIST("crd,card") |
| 1611 | 1611 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1612 | MCFG_CARTSLOT_START(nc_pcmcia_card) | |
| 1613 | MCFG_CARTSLOT_LOAD(nc_pcmcia_card) | |
| 1614 | MCFG_CARTSLOT_UNLOAD(nc_pcmcia_card) | |
| 1612 | MCFG_CARTSLOT_START(nc_state,nc_pcmcia_card) | |
| 1613 | MCFG_CARTSLOT_LOAD(nc_state,nc_pcmcia_card) | |
| 1614 | MCFG_CARTSLOT_UNLOAD(nc_state,nc_pcmcia_card) | |
| 1615 | 1615 | |
| 1616 | 1616 | /* internal ram */ |
| 1617 | 1617 | MCFG_RAM_ADD(RAM_TAG) |
| r20749 | r20750 | |
|---|---|---|
| 66 | 66 | UINT8 m_digit; |
| 67 | 67 | UINT8 m_keydata; |
| 68 | 68 | TIMER_CALLBACK_MEMBER(mekd2_trace); |
| 69 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(mekd2_cart); | |
| 69 | 70 | }; |
| 70 | 71 | |
| 71 | 72 | |
| r20749 | r20750 | |
| 295 | 296 | DEVCB_NULL /* out irq func */ |
| 296 | 297 | }; |
| 297 | 298 | |
| 298 | ||
| 299 | DEVICE_IMAGE_LOAD_MEMBER( mekd2_state,mekd2_cart ) | |
| 299 | 300 | { |
| 300 | 301 | static const char magic[] = "MEK6800D2"; |
| 301 | 302 | char buff[9]; |
| r20749 | r20750 | |
| 344 | 345 | MCFG_CARTSLOT_ADD("cart") |
| 345 | 346 | MCFG_CARTSLOT_EXTENSION_LIST("d2") |
| 346 | 347 | MCFG_CARTSLOT_NOT_MANDATORY |
| 347 | MCFG_CARTSLOT_LOAD(mekd2_cart) | |
| 348 | MCFG_CARTSLOT_LOAD(mekd2_state,mekd2_cart) | |
| 348 | 349 | |
| 349 | 350 | /* Devices */ |
| 350 | 351 | MCFG_PIA6821_ADD("pia_s", mekd2_s_mc6821_intf) |
| r20749 | r20750 | |
|---|---|---|
| 224 | 224 | |
| 225 | 225 | /* Quickload */ |
| 226 | 226 | |
| 227 | ||
| 227 | DEVICE_IMAGE_UNLOAD_MEMBER( beta_state, beta_eprom ) | |
| 228 | 228 | { |
| 229 | | |
| 229 | UINT8 *ptr = m_eprom->base(); | |
| 230 | 230 | |
| 231 | UINT8 *ptr = state->m_eprom->base(); | |
| 232 | ||
| 233 | 231 | image.fwrite(ptr, 0x800); |
| 234 | 232 | } |
| 235 | 233 | |
| r20749 | r20750 | |
| 271 | 269 | MCFG_CARTSLOT_ADD(EPROM_TAG) |
| 272 | 270 | MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") |
| 273 | 271 | MCFG_CARTSLOT_NOT_MANDATORY |
| 274 | MCFG_CARTSLOT_UNLOAD(beta_eprom) | |
| 272 | MCFG_CARTSLOT_UNLOAD(beta_state,beta_eprom) | |
| 275 | 273 | |
| 276 | 274 | /* internal ram */ |
| 277 | 275 | MCFG_RAM_ADD(RAM_TAG) |
| r20749 | r20750 | |
|---|---|---|
| 302 | 302 | MCFG_CARTSLOT_ADD("cart") |
| 303 | 303 | MCFG_CARTSLOT_EXTENSION_LIST("bin,a78") |
| 304 | 304 | MCFG_CARTSLOT_NOT_MANDATORY |
| 305 | MCFG_CARTSLOT_START(a7800_cart) | |
| 306 | MCFG_CARTSLOT_LOAD(a7800_cart) | |
| 305 | MCFG_CARTSLOT_START(a7800_state,a7800_cart) | |
| 306 | MCFG_CARTSLOT_LOAD(a7800_state,a7800_cart) | |
| 307 | 307 | MCFG_CARTSLOT_PARTIALHASH(a7800_partialhash) |
| 308 | 308 | MCFG_CARTSLOT_INTERFACE("a7800_cart") |
| 309 | 309 |
| r20749 | r20750 | |
|---|---|---|
| 700 | 700 | { 0 } |
| 701 | 701 | }; |
| 702 | 702 | |
| 703 | ||
| 703 | DEVICE_IMAGE_LOAD_MEMBER( atom_state, atom_cart ) | |
| 704 | 704 | { |
| 705 | 705 | UINT32 size; |
| 706 | 706 | UINT8 *temp_copy; |
| r20749 | r20750 | |
| 772 | 772 | MCFG_CARTSLOT_ADD(_tag) \ |
| 773 | 773 | MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") \ |
| 774 | 774 | MCFG_CARTSLOT_INTERFACE("atom_cart") \ |
| 775 | MCFG_CARTSLOT_LOAD(atom_cart) | |
| 775 | MCFG_CARTSLOT_LOAD(atom_state, atom_cart) | |
| 776 | 776 | |
| 777 | 777 | |
| 778 | 778 | static MACHINE_CONFIG_START( atom, atom_state ) |
| r20749 | r20750 | |
|---|---|---|
| 95 | 95 | MCFG_CARTSLOT_EXTENSION_LIST("min,bin") |
| 96 | 96 | MCFG_CARTSLOT_NOT_MANDATORY |
| 97 | 97 | MCFG_CARTSLOT_INTERFACE("pokemini_cart") |
| 98 | MCFG_CARTSLOT_LOAD(pokemini_cart) | |
| 98 | MCFG_CARTSLOT_LOAD(pokemini_state,pokemini_cart) | |
| 99 | 99 | |
| 100 | 100 | /* Software lists */ |
| 101 | 101 | MCFG_SOFTWARE_LIST_ADD("cart_list","pokemini") |
| r20749 | r20750 | |
|---|---|---|
| 207 | 207 | virtual void machine_start(); |
| 208 | 208 | virtual void machine_reset(); |
| 209 | 209 | TIMER_CALLBACK_MEMBER(tape_interrupt_handler); |
| 210 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( tutor_cart ); | |
| 211 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( tutor_cart ); | |
| 210 | 212 | }; |
| 211 | 213 | |
| 212 | 214 | |
| r20749 | r20750 | |
| 296 | 298 | } |
| 297 | 299 | |
| 298 | 300 | |
| 299 | ||
| 301 | DEVICE_IMAGE_LOAD_MEMBER( tutor_state, tutor_cart ) | |
| 300 | 302 | { |
| 301 | 303 | UINT32 size; |
| 302 | 304 | UINT8 *ptr = image.device().machine().root_device().memregion("maincpu")->base(); |
| r20749 | r20750 | |
| 316 | 318 | return IMAGE_INIT_PASS; |
| 317 | 319 | } |
| 318 | 320 | |
| 319 | ||
| 321 | DEVICE_IMAGE_UNLOAD_MEMBER( tutor_state, tutor_cart ) | |
| 320 | 322 | { |
| 321 | 323 | memset(image.device().machine().root_device().memregion("maincpu")->base() + cartridge_base, 0, 0x6000); |
| 322 | 324 | } |
| r20749 | r20750 | |
| 781 | 783 | /* cartridge */ |
| 782 | 784 | MCFG_CARTSLOT_ADD("cart") |
| 783 | 785 | MCFG_CARTSLOT_NOT_MANDATORY |
| 784 | MCFG_CARTSLOT_LOAD(tutor_cart) | |
| 785 | MCFG_CARTSLOT_UNLOAD(tutor_cart) | |
| 786 | MCFG_CARTSLOT_LOAD(tutor_state, tutor_cart) | |
| 787 | MCFG_CARTSLOT_UNLOAD(tutor_state, tutor_cart) | |
| 786 | 788 | MCFG_CARTSLOT_INTERFACE("tutor_cart") |
| 787 | 789 | |
| 788 | 790 | /* software lists */ |
| r20749 | r20750 | |
|---|---|---|
| 155 | 155 | MCFG_CARTSLOT_EXTENSION_LIST("ws,wsc,bin") |
| 156 | 156 | MCFG_CARTSLOT_MANDATORY |
| 157 | 157 | MCFG_CARTSLOT_INTERFACE("wswan_cart") |
| 158 | MCFG_CARTSLOT_START(wswan_cart) | |
| 159 | MCFG_CARTSLOT_LOAD(wswan_cart) | |
| 158 | MCFG_CARTSLOT_START(wswan_state,wswan_cart) | |
| 159 | MCFG_CARTSLOT_LOAD(wswan_state,wswan_cart) | |
| 160 | 160 | |
| 161 | 161 | /* software lists */ |
| 162 | 162 | MCFG_SOFTWARE_LIST_ADD("cart_list","wswan") |
| r20749 | r20750 | |
|---|---|---|
| 402 | 402 | MCFG_CARTSLOT_EXTENSION_LIST("sms,bin") |
| 403 | 403 | MCFG_CARTSLOT_NOT_MANDATORY |
| 404 | 404 | MCFG_CARTSLOT_INTERFACE("sms_cart") |
| 405 | MCFG_CARTSLOT_START(sms_cart) | |
| 406 | MCFG_CARTSLOT_LOAD(sms_cart) | |
| 405 | MCFG_CARTSLOT_START(sms_state,sms_cart) | |
| 406 | MCFG_CARTSLOT_LOAD(sms_state,sms_cart) | |
| 407 | 407 | |
| 408 | 408 | MCFG_SOFTWARE_LIST_ADD("cart_list","sms") |
| 409 | 409 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
| 413 | 413 | MCFG_CARTSLOT_EXTENSION_LIST("gg,bin") |
| 414 | 414 | MCFG_CARTSLOT_MANDATORY |
| 415 | 415 | MCFG_CARTSLOT_INTERFACE("gamegear_cart") |
| 416 | MCFG_CARTSLOT_START(sms_cart) | |
| 417 | MCFG_CARTSLOT_LOAD(sms_cart) | |
| 416 | MCFG_CARTSLOT_START(sms_state,sms_cart) | |
| 417 | MCFG_CARTSLOT_LOAD(sms_state,sms_cart) | |
| 418 | 418 | |
| 419 | 419 | MCFG_SOFTWARE_LIST_ADD("cart_list","gamegear") |
| 420 | 420 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
| 495 | 495 | MCFG_CARTSLOT_EXTENSION_LIST("sms,bin") \ |
| 496 | 496 | MCFG_CARTSLOT_NOT_MANDATORY \ |
| 497 | 497 | MCFG_CARTSLOT_INTERFACE("sms_cart") \ |
| 498 | MCFG_CARTSLOT_START(sms_cart) \ | |
| 499 | MCFG_CARTSLOT_LOAD(sms_cart) | |
| 498 | MCFG_CARTSLOT_START(sms_state,sms_cart) \ | |
| 499 | MCFG_CARTSLOT_LOAD(sms_state,sms_cart) | |
| 500 | 500 | |
| 501 | 501 | static MACHINE_CONFIG_DERIVED( sms_sdisp, sms2_ntsc ) |
| 502 | 502 | |
| r20749 | r20750 | |
| 512 | 512 | MCFG_CARTSLOT_EXTENSION_LIST("sms,bin") |
| 513 | 513 | MCFG_CARTSLOT_MANDATORY |
| 514 | 514 | MCFG_CARTSLOT_INTERFACE("sms_cart") |
| 515 | MCFG_CARTSLOT_START(sms_cart) | |
| 516 | MCFG_CARTSLOT_LOAD(sms_cart) | |
| 515 | MCFG_CARTSLOT_START(sms_state,sms_cart) | |
| 516 | MCFG_CARTSLOT_LOAD(sms_state,sms_cart) | |
| 517 | 517 | |
| 518 | 518 | MCFG_SMSSDISP_CARTSLOT_ADD("cart2") |
| 519 | 519 | MCFG_SMSSDISP_CARTSLOT_ADD("cart3") |
| r20749 | r20750 | |
| 617 | 617 | MCFG_CARTSLOT_MODIFY("cart1") |
| 618 | 618 | MCFG_CARTSLOT_EXTENSION_LIST("sms,bin,sg") |
| 619 | 619 | MCFG_CARTSLOT_MANDATORY |
| 620 | MCFG_CARTSLOT_START(sms_cart) | |
| 621 | MCFG_CARTSLOT_LOAD(sms_cart) | |
| 620 | MCFG_CARTSLOT_START(sms_state,sms_cart) | |
| 621 | MCFG_CARTSLOT_LOAD(sms_state,sms_cart) | |
| 622 | 622 | MACHINE_CONFIG_END |
| 623 | 623 | |
| 624 | 624 | static MACHINE_CONFIG_DERIVED( sms2_fm, sms2_ntsc ) |
| r20749 | r20750 | |
|---|---|---|
| 41 | 41 | DECLARE_MACHINE_RESET(microvision); |
| 42 | 42 | |
| 43 | 43 | void screen_vblank(screen_device &screen, bool state); |
| 44 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( microvision_cart ); | |
| 44 | 45 | |
| 45 | 46 | // i8021 interface |
| 46 | 47 | DECLARE_WRITE8_MEMBER(i8021_p0_write); |
| r20749 | r20750 | |
| 453 | 454 | } |
| 454 | 455 | |
| 455 | 456 | |
| 456 | ||
| 457 | DEVICE_IMAGE_LOAD_MEMBER(microvision_state,microvision_cart) | |
| 457 | 458 | { |
| 458 | 459 | microvision_state *state = image.device().machine().driver_data<microvision_state>(); |
| 459 | 460 | UINT8 *rom1 = state->memregion("maincpu1")->base(); |
| r20749 | r20750 | |
| 640 | 641 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 641 | 642 | MCFG_CARTSLOT_MANDATORY |
| 642 | 643 | MCFG_CARTSLOT_INTERFACE("microvision_cart") |
| 643 | MCFG_CARTSLOT_LOAD(microvision_cart) | |
| 644 | MCFG_CARTSLOT_LOAD(microvision_state,microvision_cart) | |
| 644 | 645 | |
| 645 | 646 | /* Software lists */ |
| 646 | 647 | MCFG_SOFTWARE_LIST_ADD("cart_list","microvision") |
| r20749 | r20750 | |
|---|---|---|
| 1034 | 1034 | } |
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | ||
| 1037 | DEVICE_IMAGE_LOAD_MEMBER( x07_state, x07_card ) | |
| 1038 | 1038 | { |
| 1039 | running_machine &machine = image.device().machine(); | |
| 1040 | x07_state *state = machine.driver_data<x07_state>(); | |
| 1041 | address_space &space = state->m_maincpu->space( AS_PROGRAM ); | |
| 1042 | UINT16 ram_size = state->m_ram->size(); | |
| 1039 | address_space &space = m_maincpu->space( AS_PROGRAM ); | |
| 1040 | UINT16 ram_size = m_ram->size(); | |
| 1043 | 1041 | |
| 1044 | 1042 | if (image.software_entry() == NULL) |
| 1045 | 1043 | { |
| 1046 | UINT8 *rom = machine.memory().region_alloc( "card", image.length(), 1, ENDIANNESS_LITTLE )->base(); | |
| 1044 | UINT8 *rom = machine().memory().region_alloc( "card", image.length(), 1, ENDIANNESS_LITTLE )->base(); | |
| 1047 | 1045 | image.fread(rom, image.length()); |
| 1048 | 1046 | |
| 1049 | 1047 | space.install_ram(ram_size, ram_size + 0xfff); |
| r20749 | r20750 | |
| 1537 | 1535 | MCFG_CARTSLOT_ADD("card") |
| 1538 | 1536 | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 1539 | 1537 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1540 | MCFG_CARTSLOT_LOAD(x07_card) | |
| 1538 | MCFG_CARTSLOT_LOAD(x07_state,x07_card) | |
| 1541 | 1539 | MCFG_CARTSLOT_INTERFACE("x07_card") |
| 1542 | 1540 | |
| 1543 | 1541 | /* cassette */ |
| r20749 | r20750 | |
|---|---|---|
| 1313 | 1313 | MCFG_CARTSLOT_INTERFACE("ibmpcjr_cart") |
| 1314 | 1314 | MCFG_CARTSLOT_EXTENSION_LIST("jrc") |
| 1315 | 1315 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1316 | MCFG_CARTSLOT_LOAD(pcjr_cartridge) | |
| 1316 | MCFG_CARTSLOT_LOAD(pc_state,pcjr_cartridge) | |
| 1317 | 1317 | MCFG_CARTSLOT_ADD("cart2") |
| 1318 | 1318 | MCFG_CARTSLOT_INTERFACE("ibmpcjr_cart") |
| 1319 | 1319 | MCFG_CARTSLOT_EXTENSION_LIST("jrc") |
| 1320 | 1320 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1321 | MCFG_CARTSLOT_LOAD(pcjr_cartridge) | |
| 1321 | MCFG_CARTSLOT_LOAD(pc_state,pcjr_cartridge) | |
| 1322 | 1322 | |
| 1323 | 1323 | /* internal ram */ |
| 1324 | 1324 | MCFG_RAM_ADD(RAM_TAG) |
| r20749 | r20750 | |
|---|---|---|
| 674 | 674 | DEVICE_IMAGE_LOAD( sg1000_cart ) |
| 675 | 675 | -------------------------------------------------*/ |
| 676 | 676 | |
| 677 | ||
| 677 | DEVICE_IMAGE_LOAD_MEMBER( sg1000_state,sg1000_cart ) | |
| 678 | 678 | { |
| 679 | 679 | running_machine &machine = image.device().machine(); |
| 680 | 680 | sg1000_state *state = machine.driver_data<sg1000_state>(); |
| r20749 | r20750 | |
| 788 | 788 | DEVICE_IMAGE_LOAD( omv_cart ) |
| 789 | 789 | -------------------------------------------------*/ |
| 790 | 790 | |
| 791 | ||
| 791 | DEVICE_IMAGE_LOAD_MEMBER( sg1000_state,omv_cart ) | |
| 792 | 792 | { |
| 793 | 793 | running_machine &machine = image.device().machine(); |
| 794 | 794 | sg1000_state *state = machine.driver_data<sg1000_state>(); |
| r20749 | r20750 | |
| 845 | 845 | DEVICE_IMAGE_LOAD( sc3000_cart ) |
| 846 | 846 | -------------------------------------------------*/ |
| 847 | 847 | |
| 848 | ||
| 848 | DEVICE_IMAGE_LOAD_MEMBER( sc3000_state,sc3000_cart ) | |
| 849 | 849 | { |
| 850 | 850 | running_machine &machine = image.device().machine(); |
| 851 | 851 | sc3000_state *state = machine.driver_data<sc3000_state>(); |
| r20749 | r20750 | |
| 1097 | 1097 | MCFG_CARTSLOT_EXTENSION_LIST("sg,bin") |
| 1098 | 1098 | MCFG_CARTSLOT_MANDATORY |
| 1099 | 1099 | MCFG_CARTSLOT_INTERFACE("sg1000_cart") |
| 1100 | MCFG_CARTSLOT_LOAD(sg1000_cart) | |
| 1100 | MCFG_CARTSLOT_LOAD(sg1000_state,sg1000_cart) | |
| 1101 | 1101 | |
| 1102 | 1102 | /* software lists */ |
| 1103 | 1103 | MCFG_SOFTWARE_LIST_ADD("cart_list","sg1000") |
| r20749 | r20750 | |
| 1119 | 1119 | MCFG_CARTSLOT_MODIFY("cart") |
| 1120 | 1120 | MCFG_CARTSLOT_EXTENSION_LIST("sg,bin") |
| 1121 | 1121 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1122 | MCFG_CARTSLOT_LOAD(omv_cart) | |
| 1122 | MCFG_CARTSLOT_LOAD(sg1000_state,omv_cart) | |
| 1123 | 1123 | |
| 1124 | 1124 | MCFG_RAM_MODIFY(RAM_TAG) |
| 1125 | 1125 | MCFG_RAM_DEFAULT_SIZE("2K") |
| r20749 | r20750 | |
| 1156 | 1156 | MCFG_CARTSLOT_EXTENSION_LIST("sg,sc,bin") |
| 1157 | 1157 | MCFG_CARTSLOT_MANDATORY |
| 1158 | 1158 | MCFG_CARTSLOT_INTERFACE("sg1000_cart") |
| 1159 | MCFG_CARTSLOT_LOAD(sc3000_cart) | |
| 1159 | MCFG_CARTSLOT_LOAD(sc3000_state,sc3000_cart) | |
| 1160 | 1160 | |
| 1161 | 1161 | /* software lists */ |
| 1162 | 1162 | MCFG_SOFTWARE_LIST_ADD("cart_list","sg1000") |
| r20749 | r20750 | |
|---|---|---|
| 46 | 46 | void line_update(); |
| 47 | 47 | int cart_load(device_image_interface &image); |
| 48 | 48 | UINT32 screen_update_uzebox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 49 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(uzebox_cart); | |
| 49 | 50 | |
| 50 | 51 | private: |
| 51 | 52 | int m_vpos; |
| r20749 | r20750 | |
| 290 | 291 | return IMAGE_INIT_PASS; |
| 291 | 292 | } |
| 292 | 293 | |
| 293 | ||
| 294 | DEVICE_IMAGE_LOAD_MEMBER(uzebox_state,uzebox_cart) | |
| 294 | 295 | { |
| 295 | return | |
| 296 | return cart_load(image); | |
| 296 | 297 | } |
| 297 | 298 | |
| 298 | 299 | /****************************************************\ |
| r20749 | r20750 | |
| 329 | 330 | MCFG_CARTSLOT_ADD("cart1") |
| 330 | 331 | MCFG_CARTSLOT_EXTENSION_LIST("bin,uze") |
| 331 | 332 | MCFG_CARTSLOT_MANDATORY |
| 332 | MCFG_CARTSLOT_LOAD(uzebox_cart) | |
| 333 | MCFG_CARTSLOT_LOAD(uzebox_state,uzebox_cart) | |
| 333 | 334 | MCFG_CARTSLOT_INTERFACE("uzebox") |
| 334 | 335 | MCFG_SOFTWARE_LIST_ADD("eprom_list","uzebox") |
| 335 | 336 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
|---|---|---|
| 126 | 126 | DECLARE_INPUT_CHANGED_MEMBER(input_update); |
| 127 | 127 | TIMER_CALLBACK_MEMBER(timer_tick); |
| 128 | 128 | TIMER_CALLBACK_MEMBER(rtc_tick); |
| 129 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( pockstat_flash ); | |
| 129 | 130 | }; |
| 130 | 131 | |
| 131 | 132 | |
| r20749 | r20750 | |
| 956 | 957 | return 0; |
| 957 | 958 | } |
| 958 | 959 | |
| 959 | ||
| 960 | DEVICE_IMAGE_LOAD_MEMBER( pockstat_state, pockstat_flash ) | |
| 960 | 961 | { |
| 961 | 962 | int i, length; |
| 962 | 963 | UINT8 *cart = image.device().machine().root_device().memregion("flash")->base(); |
| r20749 | r20750 | |
| 1007 | 1008 | MCFG_CARTSLOT_ADD("cart") |
| 1008 | 1009 | MCFG_CARTSLOT_EXTENSION_LIST("gme") |
| 1009 | 1010 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1010 | MCFG_CARTSLOT_LOAD(pockstat_flash) | |
| 1011 | MCFG_CARTSLOT_LOAD(pockstat_state, pockstat_flash) | |
| 1011 | 1012 | MACHINE_CONFIG_END |
| 1012 | 1013 | |
| 1013 | 1014 | /* ROM definition */ |
| r20749 | r20750 | |
|---|---|---|
| 1053 | 1053 | MCFG_CARTSLOT_EXTENSION_LIST("mx1,rom") |
| 1054 | 1054 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1055 | 1055 | MCFG_CARTSLOT_INTERFACE("msx_cart") |
| 1056 | MCFG_CARTSLOT_LOAD(msx_cart) | |
| 1057 | MCFG_CARTSLOT_UNLOAD(msx_cart) | |
| 1056 | MCFG_CARTSLOT_LOAD(msx_state, msx_cart) | |
| 1057 | MCFG_CARTSLOT_UNLOAD(msx_state, msx_cart) | |
| 1058 | 1058 | |
| 1059 | 1059 | MCFG_CARTSLOT_ADD("cart2") |
| 1060 | 1060 | MCFG_CARTSLOT_EXTENSION_LIST("mx1,rom") |
| 1061 | 1061 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1062 | 1062 | MCFG_CARTSLOT_INTERFACE("msx_cart") |
| 1063 | MCFG_CARTSLOT_LOAD(msx_cart) | |
| 1064 | MCFG_CARTSLOT_UNLOAD(msx_cart) | |
| 1063 | MCFG_CARTSLOT_LOAD(msx_state, msx_cart) | |
| 1064 | MCFG_CARTSLOT_UNLOAD(msx_state, msx_cart) | |
| 1065 | 1065 | MACHINE_CONFIG_END |
| 1066 | 1066 | |
| 1067 | 1067 | static MACHINE_CONFIG_START( msx, msx_state ) |
| r20749 | r20750 | |
|---|---|---|
| 590 | 590 | MCFG_CARTSLOT_EXTENSION_LIST("gb,gmb,cgb,gbc,sgb,bin") |
| 591 | 591 | MCFG_CARTSLOT_NOT_MANDATORY |
| 592 | 592 | MCFG_CARTSLOT_INTERFACE("gameboy_cart") |
| 593 | MCFG_CARTSLOT_START(gb_cart) | |
| 594 | MCFG_CARTSLOT_LOAD(gb_cart) | |
| 593 | MCFG_CARTSLOT_START(gb_state,gb_cart) | |
| 594 | MCFG_CARTSLOT_LOAD(gb_state,gb_cart) | |
| 595 | 595 | MCFG_SOFTWARE_LIST_ADD("cart_list","gameboy") |
| 596 | 596 | MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("gbc_list","gbcolor") |
| 597 | 597 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
| 648 | 648 | MCFG_CARTSLOT_EXTENSION_LIST("gb,gmb,cgb,gbc,sgb,bin") |
| 649 | 649 | MCFG_CARTSLOT_NOT_MANDATORY |
| 650 | 650 | MCFG_CARTSLOT_INTERFACE("gameboy_cart") |
| 651 | MCFG_CARTSLOT_START(gb_cart) | |
| 652 | MCFG_CARTSLOT_LOAD(gb_cart) | |
| 651 | MCFG_CARTSLOT_START(gb_state,gb_cart) | |
| 652 | MCFG_CARTSLOT_LOAD(gb_state,gb_cart) | |
| 653 | 653 | MCFG_SOFTWARE_LIST_ADD("cart_list","gbcolor") |
| 654 | 654 | MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("gb_list","gameboy") |
| 655 | 655 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
| 689 | 689 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 690 | 690 | MCFG_CARTSLOT_MANDATORY |
| 691 | 691 | MCFG_CARTSLOT_INTERFACE("megaduck_cart") |
| 692 | MCFG_CARTSLOT_LOAD(megaduck_cart) | |
| 692 | MCFG_CARTSLOT_LOAD(gb_state,megaduck_cart) | |
| 693 | 693 | MCFG_SOFTWARE_LIST_ADD("cart_list","megaduck") |
| 694 | 694 | MACHINE_CONFIG_END |
| 695 | 695 |
| r20749 | r20750 | |
|---|---|---|
| 471 | 471 | m_pet.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(svision_state::svision_pet_timer),this)); |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | ||
| 474 | DEVICE_IMAGE_LOAD_MEMBER( svision_state, svision_cart ) | |
| 475 | 475 | { |
| 476 | 476 | UINT32 size; |
| 477 | 477 | UINT8 *temp_copy; |
| r20749 | r20750 | |
| 569 | 569 | MCFG_CARTSLOT_EXTENSION_LIST("bin,ws,sv") |
| 570 | 570 | MCFG_CARTSLOT_MANDATORY |
| 571 | 571 | MCFG_CARTSLOT_INTERFACE("svision_cart") |
| 572 | MCFG_CARTSLOT_LOAD(svision_cart) | |
| 572 | MCFG_CARTSLOT_LOAD(svision_state, svision_cart) | |
| 573 | 573 | |
| 574 | 574 | /* Software lists */ |
| 575 | 575 | MCFG_SOFTWARE_LIST_ADD("cart_list","svision") |
| r20749 | r20750 | |
|---|---|---|
| 24 | 24 | DECLARE_READ32_MEMBER(dd_null_r); |
| 25 | 25 | DECLARE_MACHINE_START(n64dd); |
| 26 | 26 | INTERRUPT_GEN_MEMBER(n64_reset_poll); |
| 27 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(n64_cart); | |
| 27 | 28 | }; |
| 28 | 29 | |
| 29 | 30 | READ32_MEMBER(n64_mess_state::dd_null_r) |
| r20749 | r20750 | |
| 171 | 172 | memcpy(pak, pak_header, 272); |
| 172 | 173 | } |
| 173 | 174 | |
| 174 | ||
| 175 | DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart) | |
| 175 | 176 | { |
| 176 | 177 | int i, length; |
| 177 | 178 | n64_periphs *periphs = image.device().machine().device<n64_periphs>("rcp"); |
| r20749 | r20750 | |
| 309 | 310 | MCFG_CARTSLOT_EXTENSION_LIST("v64,z64,rom,n64,bin") |
| 310 | 311 | MCFG_CARTSLOT_MANDATORY |
| 311 | 312 | MCFG_CARTSLOT_INTERFACE("n64_cart") |
| 312 | MCFG_CARTSLOT_LOAD(n64_cart) | |
| 313 | MCFG_CARTSLOT_LOAD(n64_mess_state,n64_cart) | |
| 313 | 314 | |
| 314 | 315 | /* software lists */ |
| 315 | 316 | MCFG_SOFTWARE_LIST_ADD("cart_list","n64") |
| r20749 | r20750 | |
|---|---|---|
| 459 | 459 | MCFG_CARTSLOT_ADD("cart") |
| 460 | 460 | MCFG_CARTSLOT_EXTENSION_LIST("rom") |
| 461 | 461 | MCFG_CARTSLOT_NOT_MANDATORY |
| 462 | MCFG_CARTSLOT_LOAD(laser_cart) | |
| 463 | MCFG_CARTSLOT_UNLOAD(laser_cart) | |
| 462 | MCFG_CARTSLOT_LOAD(vtech2_state,laser_cart) | |
| 463 | MCFG_CARTSLOT_UNLOAD(vtech2_state,laser_cart) | |
| 464 | 464 | |
| 465 | 465 | /* 5.25" Floppy drive */ |
| 466 | 466 | MCFG_LEGACY_FLOPPY_DRIVE_ADD( FLOPPY_0, vtech2_floppy_interface ) |
| r20749 | r20750 | |
|---|---|---|
| 106 | 106 | UINT32 screen_update_pv1000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 107 | 107 | TIMER_CALLBACK_MEMBER(d65010_irq_on_cb); |
| 108 | 108 | TIMER_CALLBACK_MEMBER(d65010_irq_off_cb); |
| 109 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( pv1000_cart ); | |
| 109 | 110 | }; |
| 110 | 111 | |
| 111 | 112 | |
| r20749 | r20750 | |
| 237 | 238 | } |
| 238 | 239 | |
| 239 | 240 | |
| 240 | ||
| 241 | DEVICE_IMAGE_LOAD_MEMBER( pv1000_state, pv1000_cart ) | |
| 241 | 242 | { |
| 242 | 243 | UINT8 *cart = image.device().machine().root_device().memregion("cart")->base(); |
| 243 | 244 | UINT32 size; |
| r20749 | r20750 | |
| 439 | 440 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 440 | 441 | MCFG_CARTSLOT_MANDATORY |
| 441 | 442 | MCFG_CARTSLOT_INTERFACE("pv1000_cart") |
| 442 | MCFG_CARTSLOT_LOAD(pv1000_cart) | |
| 443 | MCFG_CARTSLOT_LOAD(pv1000_state,pv1000_cart) | |
| 443 | 444 | |
| 444 | 445 | /* Software lists */ |
| 445 | 446 | MCFG_SOFTWARE_LIST_ADD("cart_list","pv1000") |
| r20749 | r20750 | |
|---|---|---|
| 57 | 57 | virtual void palette_init(); |
| 58 | 58 | UINT32 screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 59 | 59 | TIMER_CALLBACK_MEMBER(scv_vb_callback); |
| 60 | DECLARE_DEVICE_IMAGE_START_MEMBER( scv_cart ); | |
| 61 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( scv_cart ); | |
| 60 | 62 | |
| 61 | 63 | protected: |
| 62 | 64 | required_device<cpu_device> m_maincpu; |
| r20749 | r20750 | |
| 358 | 360 | } |
| 359 | 361 | |
| 360 | 362 | |
| 361 | ||
| 363 | DEVICE_IMAGE_START_MEMBER( scv_state, scv_cart ) | |
| 362 | 364 | { |
| 363 | scv_state *state = device->machine().driver_data<scv_state>(); | |
| 364 | ||
| 365 | state->m_cart_rom = state->memregion( "cart" )->base(); | |
| 366 | state->m_cart_rom_size = 0; | |
| 367 | state->m_cart_ram = NULL; | |
| 368 | state->m_cart_ram_size = 0; | |
| 365 | m_cart_rom = memregion( "cart" )->base(); | |
| 366 | m_cart_rom_size = 0; | |
| 367 | m_cart_ram = NULL; | |
| 368 | m_cart_ram_size = 0; | |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | |
| 372 | ||
| 372 | DEVICE_IMAGE_LOAD_MEMBER( scv_state, scv_cart ) | |
| 373 | 373 | { |
| 374 | scv_state *state = image.device().machine().driver_data<scv_state>(); | |
| 375 | ||
| 376 | 374 | if ( image.software_entry() == NULL ) |
| 377 | 375 | { |
| 378 | 376 | UINT8 *cart = image.device().machine().root_device().memregion( "cart" )->base(); |
| 379 | 377 | int size = image.length(); |
| 380 | 378 | |
| 381 | if ( size > | |
| 379 | if ( size > memregion( "cart" )->bytes() ) | |
| 382 | 380 | { |
| 383 | 381 | image.seterror( IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size" ); |
| 384 | 382 | return IMAGE_INIT_FAIL; |
| r20749 | r20750 | |
| 390 | 388 | return IMAGE_INIT_FAIL; |
| 391 | 389 | } |
| 392 | 390 | |
| 393 | state->m_cart_rom = cart; | |
| 394 | state->m_cart_rom_size = size; | |
| 395 | state->m_cart_ram = NULL; | |
| 396 | state->m_cart_ram_size = 0; | |
| 391 | m_cart_rom = cart; | |
| 392 | m_cart_rom_size = size; | |
| 393 | m_cart_ram = NULL; | |
| 394 | m_cart_ram_size = 0; | |
| 397 | 395 | } |
| 398 | 396 | else |
| 399 | 397 | { |
| 400 | state->m_cart_rom = image.get_software_region( "rom" ); | |
| 401 | state->m_cart_rom_size = image.get_software_region_length( "rom" ); | |
| 402 | state->m_cart_ram = image.get_software_region( "ram" ); | |
| 403 | state->m_cart_ram_size = image.get_software_region_length( "ram" ); | |
| 398 | m_cart_rom = image.get_software_region( "rom" ); | |
| 399 | m_cart_rom_size = image.get_software_region_length( "rom" ); | |
| 400 | m_cart_ram = image.get_software_region( "ram" ); | |
| 401 | m_cart_ram_size = image.get_software_region_length( "ram" ); | |
| 404 | 402 | } |
| 405 | 403 | |
| 406 | 404 | return IMAGE_INIT_PASS; |
| r20749 | r20750 | |
| 861 | 859 | MCFG_CARTSLOT_EXTENSION_LIST( "bin" ) |
| 862 | 860 | MCFG_CARTSLOT_NOT_MANDATORY |
| 863 | 861 | MCFG_CARTSLOT_INTERFACE("scv_cart") |
| 864 | MCFG_CARTSLOT_START( scv_cart ) | |
| 865 | MCFG_CARTSLOT_LOAD( scv_cart ) | |
| 862 | MCFG_CARTSLOT_START( scv_state, scv_cart ) | |
| 863 | MCFG_CARTSLOT_LOAD( scv_state, scv_cart ) | |
| 866 | 864 | |
| 867 | 865 | /* Software lists */ |
| 868 | 866 | MCFG_SOFTWARE_LIST_ADD("cart_list","scv") |
| r20749 | r20750 | |
|---|---|---|
| 29 | 29 | virtual void machine_start(); |
| 30 | 30 | virtual void machine_reset(); |
| 31 | 31 | DECLARE_WRITE_LINE_MEMBER(tms_interrupt); |
| 32 | ||
| 33 | DECLARE_DEVICE_IMAGE_START_MEMBER( bbcbc_cart ); | |
| 34 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( bbcbc_cart ); | |
| 32 | 35 | }; |
| 33 | 36 | |
| 34 | 37 | |
| r20749 | r20750 | |
| 130 | 133 | }; |
| 131 | 134 | |
| 132 | 135 | |
| 133 | ||
| 136 | DEVICE_IMAGE_START_MEMBER( bbcbc_state, bbcbc_cart ) | |
| 134 | 137 | { |
| 135 | UINT8 *cart = | |
| 138 | UINT8 *cart = machine().root_device().memregion("maincpu" )->base() + 0x4000; | |
| 136 | 139 | |
| 137 | 140 | memset( cart, 0xFF, 0x8000 ); |
| 138 | 141 | } |
| 139 | 142 | |
| 140 | 143 | |
| 141 | ||
| 144 | DEVICE_IMAGE_LOAD_MEMBER( bbcbc_state, bbcbc_cart ) | |
| 142 | 145 | { |
| 143 | UINT8 *cart = | |
| 146 | UINT8 *cart = machine().root_device().memregion("maincpu" )->base() + 0x4000; | |
| 144 | 147 | |
| 145 | 148 | if ( image.software_entry() == NULL ) |
| 146 | 149 | { |
| r20749 | r20750 | |
| 187 | 190 | MCFG_CARTSLOT_ADD("cart") |
| 188 | 191 | MCFG_CARTSLOT_NOT_MANDATORY |
| 189 | 192 | MCFG_CARTSLOT_INTERFACE("bbcbc_cart") |
| 190 | MCFG_CARTSLOT_START( bbcbc_cart ) | |
| 191 | MCFG_CARTSLOT_LOAD( bbcbc_cart ) | |
| 193 | MCFG_CARTSLOT_START( bbcbc_state, bbcbc_cart ) | |
| 194 | MCFG_CARTSLOT_LOAD( bbcbc_state, bbcbc_cart ) | |
| 192 | 195 | |
| 193 | 196 | /* Software lists */ |
| 194 | 197 | MCFG_SOFTWARE_LIST_ADD("cart_list","bbcbc") |
| r20749 | r20750 | |
|---|---|---|
| 127 | 127 | MCFG_CARTSLOT_ADD("cart1") |
| 128 | 128 | MCFG_CARTSLOT_EXTENSION_LIST("bin,tgc") |
| 129 | 129 | MCFG_CARTSLOT_INTERFACE("gamecom_cart") |
| 130 | MCFG_CARTSLOT_LOAD(gamecom_cart1) | |
| 130 | MCFG_CARTSLOT_LOAD(gamecom_state,gamecom_cart1) | |
| 131 | 131 | MCFG_SOFTWARE_LIST_ADD("cart_list","gamecom") |
| 132 | 132 | MCFG_CARTSLOT_ADD("cart2") |
| 133 | 133 | MCFG_CARTSLOT_EXTENSION_LIST("bin,tgc") |
| 134 | 134 | MCFG_CARTSLOT_INTERFACE("gamecom_cart") |
| 135 | MCFG_CARTSLOT_LOAD(gamecom_cart2) | |
| 135 | MCFG_CARTSLOT_LOAD(gamecom_state,gamecom_cart2) | |
| 136 | 136 | MACHINE_CONFIG_END |
| 137 | 137 | |
| 138 | 138 | ROM_START( gamecom ) |
| r20749 | r20750 | |
|---|---|---|
| 207 | 207 | TIMER_CALLBACK_MEMBER(supracan_line_on_callback); |
| 208 | 208 | TIMER_CALLBACK_MEMBER(supracan_line_off_callback); |
| 209 | 209 | TIMER_CALLBACK_MEMBER(supracan_video_callback); |
| 210 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(supracan_cart); | |
| 210 | 211 | }; |
| 211 | 212 | |
| 212 | 213 | |
| r20749 | r20750 | |
| 1726 | 1727 | } |
| 1727 | 1728 | |
| 1728 | 1729 | |
| 1729 | ||
| 1730 | DEVICE_IMAGE_LOAD_MEMBER( supracan_state, supracan_cart ) | |
| 1730 | 1731 | { |
| 1731 | 1732 | UINT8 *cart = image.device().machine().root_device().memregion("cart")->base(); |
| 1732 | 1733 | UINT32 size = 0; |
| r20749 | r20750 | |
| 1906 | 1907 | MCFG_CARTSLOT_ADD("cart") |
| 1907 | 1908 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 1908 | 1909 | MCFG_CARTSLOT_INTERFACE("supracan_cart") |
| 1909 | MCFG_CARTSLOT_LOAD(supracan_cart) | |
| 1910 | MCFG_CARTSLOT_LOAD(supracan_state,supracan_cart) | |
| 1910 | 1911 | |
| 1911 | 1912 | MCFG_SOFTWARE_LIST_ADD("cart_list","supracan") |
| 1912 | 1913 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
|---|---|---|
| 216 | 216 | |
| 217 | 217 | |
| 218 | 218 | |
| 219 | ||
| 219 | DEVICE_IMAGE_LOAD_MEMBER( channelf_state, channelf_cart ) | |
| 220 | 220 | { |
| 221 | 221 | UINT32 size; |
| 222 | 222 | |
| r20749 | r20750 | |
| 251 | 251 | MCFG_CARTSLOT_ADD("cart") |
| 252 | 252 | MCFG_CARTSLOT_EXTENSION_LIST("bin,chf") |
| 253 | 253 | MCFG_CARTSLOT_INTERFACE("channelf_cart") |
| 254 | MCFG_CARTSLOT_LOAD(channelf_cart) | |
| 254 | MCFG_CARTSLOT_LOAD(channelf_state,channelf_cart) | |
| 255 | 255 | |
| 256 | 256 | /* Software lists */ |
| 257 | 257 | MCFG_SOFTWARE_LIST_ADD("cart_list","channelf") |
| r20749 | r20750 | |
|---|---|---|
| 2955 | 2955 | return 0; |
| 2956 | 2956 | } |
| 2957 | 2957 | |
| 2958 | ||
| 2958 | DEVICE_IMAGE_LOAD_MEMBER( gba_state, gba_cart ) | |
| 2959 | 2959 | { |
| 2960 | 2960 | UINT8 *ROM = image.device().machine().root_device().memregion("cartridge")->base(); |
| 2961 | 2961 | UINT32 cart_size; |
| r20749 | r20750 | |
| 3129 | 3129 | MCFG_CARTSLOT_ADD("cart") |
| 3130 | 3130 | MCFG_CARTSLOT_EXTENSION_LIST("gba,bin") |
| 3131 | 3131 | MCFG_CARTSLOT_INTERFACE("gba_cart") |
| 3132 | MCFG_CARTSLOT_LOAD(gba_cart) | |
| 3132 | MCFG_CARTSLOT_LOAD(gba_state,gba_cart) | |
| 3133 | 3133 | MCFG_SOFTWARE_LIST_ADD("cart_list","gba") |
| 3134 | 3134 | MACHINE_CONFIG_END |
| 3135 | 3135 |
| r20749 | r20750 | |
|---|---|---|
| 143 | 143 | INTERRUPT_GEN_MEMBER(vii_vblank); |
| 144 | 144 | TIMER_CALLBACK_MEMBER(tmb1_tick); |
| 145 | 145 | TIMER_CALLBACK_MEMBER(tmb2_tick); |
| 146 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(vii_cart); | |
| 147 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(vsmile_cart); | |
| 146 | 148 | }; |
| 147 | 149 | |
| 148 | 150 | enum |
| r20749 | r20750 | |
| 924 | 926 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("B Button") |
| 925 | 927 | INPUT_PORTS_END |
| 926 | 928 | |
| 927 | ||
| 929 | DEVICE_IMAGE_LOAD_MEMBER( vii_state, vii_cart ) | |
| 928 | 930 | { |
| 929 | vii_state *state = image.device().machine().driver_data<vii_state>(); | |
| 930 | UINT8 *cart = state->memregion( "cart" )->base(); | |
| 931 | UINT8 *cart = memregion( "cart" )->base(); | |
| 931 | 932 | if (image.software_entry() == NULL) |
| 932 | 933 | { |
| 933 | 934 | int size = image.length(); |
| r20749 | r20750 | |
| 942 | 943 | memcpy(cart, image.get_software_region("rom"), filesize); |
| 943 | 944 | } |
| 944 | 945 | |
| 945 | memcpy( | |
| 946 | memcpy(m_p_cart, cart + 0x4000*2, (0x400000 - 0x4000) * 2); | |
| 946 | 947 | |
| 947 | 948 | if( cart[0x3cd808] == 0x99 && |
| 948 | 949 | cart[0x3cd809] == 0x99 && |
| r20749 | r20750 | |
| 953 | 954 | cart[0x3cd80e] == 0x78 && |
| 954 | 955 | cart[0x3cd80f] == 0x7f ) |
| 955 | 956 | { |
| 956 | | |
| 957 | m_centered_coordinates = 0; | |
| 957 | 958 | } |
| 958 | 959 | return IMAGE_INIT_PASS; |
| 959 | 960 | } |
| 960 | 961 | |
| 961 | ||
| 962 | DEVICE_IMAGE_LOAD_MEMBER( vii_state, vsmile_cart ) | |
| 962 | 963 | { |
| 963 | vii_state *state = image.device().machine().driver_data<vii_state>(); | |
| 964 | UINT8 *cart = state->memregion( "cart" )->base(); | |
| 964 | UINT8 *cart = memregion( "cart" )->base(); | |
| 965 | 965 | if (image.software_entry() == NULL) |
| 966 | 966 | { |
| 967 | 967 | int size = image.length(); |
| r20749 | r20750 | |
| 977 | 977 | int filesize = image.get_software_region_length("rom"); |
| 978 | 978 | memcpy(cart, image.get_software_region("rom"), filesize); |
| 979 | 979 | } |
| 980 | memcpy( | |
| 980 | memcpy(m_p_cart, cart + 0x4000*2, (0x400000 - 0x4000) * 2); | |
| 981 | 981 | return IMAGE_INIT_PASS; |
| 982 | 982 | } |
| 983 | 983 | |
| r20749 | r20750 | |
| 1105 | 1105 | |
| 1106 | 1106 | MCFG_CARTSLOT_ADD( "cart" ) |
| 1107 | 1107 | MCFG_CARTSLOT_EXTENSION_LIST( "bin" ) |
| 1108 | MCFG_CARTSLOT_LOAD( vii_cart ) | |
| 1108 | MCFG_CARTSLOT_LOAD( vii_state, vii_cart ) | |
| 1109 | 1109 | MCFG_CARTSLOT_INTERFACE("vii_cart") |
| 1110 | 1110 | |
| 1111 | 1111 | MCFG_SOFTWARE_LIST_ADD("vii_cart","vii") |
| r20749 | r20750 | |
| 1128 | 1128 | MCFG_CARTSLOT_ADD( "cart" ) |
| 1129 | 1129 | MCFG_CARTSLOT_EXTENSION_LIST( "bin" ) |
| 1130 | 1130 | MCFG_CARTSLOT_MANDATORY |
| 1131 | MCFG_CARTSLOT_LOAD( vsmile_cart ) | |
| 1131 | MCFG_CARTSLOT_LOAD( vii_state, vsmile_cart ) | |
| 1132 | 1132 | MACHINE_CONFIG_END |
| 1133 | 1133 | |
| 1134 | 1134 | static const i2cmem_interface i2cmem_interface = |
| r20749 | r20750 | |
|---|---|---|
| 62 | 62 | UINT8 m_cass_conf; |
| 63 | 63 | virtual void machine_start(); |
| 64 | 64 | virtual void machine_reset(); |
| 65 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( pv2000_cart ); | |
| 65 | 66 | }; |
| 66 | 67 | |
| 67 | 68 | |
| r20749 | r20750 | |
| 377 | 378 | memset(&memregion("maincpu")->base()[0x7000], 0xff, 0x1000); // initialize RAM |
| 378 | 379 | } |
| 379 | 380 | |
| 380 | ||
| 381 | DEVICE_IMAGE_LOAD_MEMBER( pv2000_state, pv2000_cart ) | |
| 381 | 382 | { |
| 382 | 383 | UINT8 *cart = image.device().machine().root_device().memregion("maincpu")->base() + 0xC000; |
| 383 | 384 | UINT32 size; |
| r20749 | r20750 | |
| 446 | 447 | MCFG_CARTSLOT_ADD("cart") |
| 447 | 448 | MCFG_CARTSLOT_EXTENSION_LIST("rom,col,bin") |
| 448 | 449 | MCFG_CARTSLOT_NOT_MANDATORY |
| 449 | MCFG_CARTSLOT_LOAD(pv2000_cart) | |
| 450 | MCFG_CARTSLOT_LOAD(pv2000_state,pv2000_cart) | |
| 450 | 451 | MCFG_CARTSLOT_INTERFACE("pv2000_cart") |
| 451 | 452 | |
| 452 | 453 | /* Software lists */ |
| r20749 | r20750 | |
|---|---|---|
| 78 | 78 | DECLARE_DRIVER_INIT(rx78); |
| 79 | 79 | required_device<cpu_device> m_maincpu; |
| 80 | 80 | required_device<cassette_image_device> m_cass; |
| 81 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( rx78_cart ); | |
| 81 | 82 | }; |
| 82 | 83 | |
| 83 | 84 | |
| r20749 | r20750 | |
| 401 | 402 | { |
| 402 | 403 | } |
| 403 | 404 | |
| 404 | ||
| 405 | DEVICE_IMAGE_LOAD_MEMBER( rx78_state, rx78_cart ) | |
| 405 | 406 | { |
| 406 | 407 | UINT8 *cart = image.device().machine().root_device().memregion("cart_img")->base(); |
| 407 | 408 | UINT32 size; |
| r20749 | r20750 | |
| 480 | 481 | MCFG_CARTSLOT_ADD("cart") |
| 481 | 482 | MCFG_CARTSLOT_EXTENSION_LIST("rom") |
| 482 | 483 | MCFG_CARTSLOT_NOT_MANDATORY |
| 483 | MCFG_CARTSLOT_LOAD(rx78_cart) | |
| 484 | MCFG_CARTSLOT_LOAD(rx78_state,rx78_cart) | |
| 484 | 485 | MCFG_CARTSLOT_INTERFACE("rx78_cart") |
| 485 | 486 | |
| 486 | 487 | MCFG_RAM_ADD(RAM_TAG) |
| r20749 | r20750 | |
|---|---|---|
| 39 | 39 | #include "video/gtia.h" |
| 40 | 40 | #include "sound/dac.h" |
| 41 | 41 | #include "machine/ram.h" |
| 42 | #include "hashfile.h" | |
| 42 | 43 | |
| 44 | ||
| 43 | 45 | /****************************************************************************** |
| 44 | 46 | Atari 800 memory map (preliminary) |
| 45 | 47 | |
| r20749 | r20750 | |
| 229 | 231 | E000-FFFF ROM BIOS ROM |
| 230 | 232 | ******************************************************************************/ |
| 231 | 233 | |
| 234 | #define LEFT_CARTSLOT_MOUNTED 1 | |
| 235 | #define RIGHT_CARTSLOT_MOUNTED 2 | |
| 236 | ||
| 237 | /* PCB */ | |
| 238 | enum | |
| 239 | { | |
| 240 | A800_UNKNOWN = 0, | |
| 241 | A800_4K, A800_8K, A800_12K, A800_16K, | |
| 242 | A800_RIGHT_4K, A800_RIGHT_8K, | |
| 243 | OSS_034M, OSS_M091, PHOENIX_8K, XEGS_32K, | |
| 244 | BBSB, DIAMOND_64K, WILLIAMS_64K, EXPRESS_64, | |
| 245 | SPARTADOS_X | |
| 246 | }; | |
| 247 | ||
| 248 | ||
| 232 | 249 | class a400_state : public driver_device |
| 233 | 250 | { |
| 234 | 251 | public: |
| 235 | 252 | a400_state(const machine_config &mconfig, device_type type, const char *tag) |
| 236 | : driver_device(mconfig, type, tag) { } | |
| 253 | : driver_device(mconfig, type, tag) | |
| 254 | , m_a800_cart_loaded(0) | |
| 255 | , m_atari(0) | |
| 256 | , m_a800_cart_type(A800_UNKNOWN) | |
| 257 | { } | |
| 237 | 258 | |
| 238 | 259 | DECLARE_DRIVER_INIT(xegs); |
| 239 | 260 | DECLARE_DRIVER_INIT(a800xl); |
| r20749 | r20750 | |
| 242 | 263 | DECLARE_WRITE8_MEMBER(a1200xl_pia_pb_w); |
| 243 | 264 | DECLARE_WRITE8_MEMBER(a800xl_pia_pb_w); |
| 244 | 265 | DECLARE_WRITE8_MEMBER(xegs_pia_pb_w); |
| 266 | ||
| 267 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a800_cart ); | |
| 268 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( a800_cart ); | |
| 269 | ||
| 270 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a800_cart_right ); | |
| 271 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( a800_cart_right ); | |
| 272 | ||
| 273 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a5200_cart ); | |
| 274 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( a5200_cart ); | |
| 275 | ||
| 276 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( xegs_cart ); | |
| 277 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( xegs_cart ); | |
| 278 | ||
| 279 | void ms_atari_machine_start(int type, int has_cart); | |
| 280 | void ms_atari800xl_machine_start(int type, int has_cart); | |
| 281 | ||
| 282 | protected: | |
| 283 | int m_a800_cart_loaded; | |
| 284 | int m_atari; | |
| 285 | int m_a800_cart_type; | |
| 286 | ||
| 287 | void a800_setbank(int cart_mounted); | |
| 288 | ||
| 245 | 289 | }; |
| 246 | 290 | |
| 247 | 291 | /************************************************************** |
| r20749 | r20750 | |
| 902 | 946 | machine.root_device().membank("bank2")->set_base(base2); |
| 903 | 947 | } |
| 904 | 948 | |
| 949 | ||
| 950 | // Currently, the drivers have fixed 40k RAM, however the function here is ready for different sizes too | |
| 951 | void a400_state::a800_setbank(int cart_mounted) | |
| 952 | { | |
| 953 | offs_t ram_top; | |
| 954 | // take care of 0x0000-0x7fff: RAM or NOP | |
| 955 | ram_top = MIN(machine().device<ram_device>(RAM_TAG)->size(), 0x8000) - 1; | |
| 956 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x0000, ram_top, "0000"); | |
| 957 | machine().root_device().membank("0000")->set_base(machine().device<ram_device>(RAM_TAG)->pointer()); | |
| 958 | ||
| 959 | // take care of 0x8000-0x9fff: A800 -> either right slot or RAM or NOP, others -> RAM or NOP | |
| 960 | // is there anything in the right slot? | |
| 961 | if (cart_mounted & RIGHT_CARTSLOT_MOUNTED) | |
| 962 | { | |
| 963 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x9fff, "8000"); | |
| 964 | machine().root_device().membank("8000")->set_base(machine().root_device().memregion("rslot")->base()); | |
| 965 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0x9fff); | |
| 966 | } | |
| 967 | else if (m_a800_cart_type != BBSB) | |
| 968 | { | |
| 969 | ram_top = MIN(machine().device<ram_device>(RAM_TAG)->size(), 0xa000) - 1; | |
| 970 | if (ram_top > 0x8000) | |
| 971 | { | |
| 972 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x8000, ram_top, "8000"); | |
| 973 | machine().root_device().membank("8000")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x8000); | |
| 974 | } | |
| 975 | } | |
| 976 | ||
| 977 | // take care of 0xa000-0xbfff: is there anything in the left slot? | |
| 978 | if (cart_mounted & LEFT_CARTSLOT_MOUNTED) | |
| 979 | { | |
| 980 | // FIXME: this is an hack to keep XL working until we clean up its memory map as well! | |
| 981 | if (m_atari == ATARI_800XL) | |
| 982 | { | |
| 983 | if (m_a800_cart_type == A800_16K) | |
| 984 | { | |
| 985 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x9fff, "8000"); | |
| 986 | machine().root_device().membank("8000")->set_base(machine().root_device().memregion("lslot")->base()); | |
| 987 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0x9fff); | |
| 988 | ||
| 989 | memcpy(machine().root_device().memregion("maincpu")->base() + 0x10000, machine().root_device().memregion("lslot")->base() + 0x2000, 0x2000); | |
| 990 | } | |
| 991 | else if (m_a800_cart_type == A800_8K) | |
| 992 | memcpy(machine().root_device().memregion("maincpu")->base() + 0x10000, machine().root_device().memregion("lslot")->base(), 0x2000); | |
| 993 | else | |
| 994 | fatalerror("This type of cart is not supported yet in this driver. Please use a400 or a800.\n"); | |
| 995 | } | |
| 996 | else if (m_a800_cart_type == A800_16K) | |
| 997 | { | |
| 998 | machine().root_device().membank("8000")->set_base(machine().root_device().memregion("lslot")->base()); | |
| 999 | machine().root_device().membank("a000")->set_base(machine().root_device().memregion("lslot")->base() + 0x2000); | |
| 1000 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0xbfff); | |
| 1001 | } | |
| 1002 | else if (m_a800_cart_type == BBSB) | |
| 1003 | { | |
| 1004 | // this requires separate banking in 0x8000 & 0x9000! | |
| 1005 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x8fff, "8000"); | |
| 1006 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x9000, 0x9fff, "9000"); | |
| 1007 | machine().root_device().membank("8000")->set_base(machine().root_device().memregion("lslot")->base() + 0x0000); | |
| 1008 | machine().root_device().membank("9000")->set_base(machine().root_device().memregion("lslot")->base() + 0x4000); | |
| 1009 | machine().root_device().membank("a000")->set_base(machine().root_device().memregion("lslot")->base() + 0x8000); | |
| 1010 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
| 1011 | } | |
| 1012 | else if (m_a800_cart_type == OSS_034M) | |
| 1013 | { | |
| 1014 | // this requires separate banking in 0xa000 & 0xb000! | |
| 1015 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xa000, 0xafff, "a000"); | |
| 1016 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xb000, 0xbfff, "b000"); | |
| 1017 | machine().root_device().membank("b000")->set_base(machine().root_device().memregion("lslot")->base() + 0x3000); | |
| 1018 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
| 1019 | } | |
| 1020 | else if (m_a800_cart_type == OSS_M091) | |
| 1021 | { | |
| 1022 | // this requires separate banking in 0xa000 & 0xb000! | |
| 1023 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xa000, 0xafff, "a000"); | |
| 1024 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xb000, 0xbfff, "b000"); | |
| 1025 | machine().root_device().membank("b000")->set_base(machine().root_device().memregion("lslot")->base()); | |
| 1026 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
| 1027 | } | |
| 1028 | else if (m_a800_cart_type == XEGS_32K) | |
| 1029 | { | |
| 1030 | machine().root_device().membank("8000")->set_base(machine().root_device().memregion("lslot")->base()); | |
| 1031 | machine().root_device().membank("a000")->set_base(machine().root_device().memregion("lslot")->base() + 0x6000); | |
| 1032 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0xbfff); | |
| 1033 | } | |
| 1034 | else | |
| 1035 | { | |
| 1036 | machine().root_device().membank("a000")->set_base(machine().root_device().memregion("lslot")->base()); | |
| 1037 | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff); | |
| 1038 | } | |
| 1039 | } | |
| 1040 | } | |
| 1041 | ||
| 1042 | ||
| 1043 | /* MESS specific parts that have to be started */ | |
| 1044 | void a400_state::ms_atari_machine_start(int type, int has_cart) | |
| 1045 | { | |
| 1046 | /* set atari type (temporarily not used) */ | |
| 1047 | m_atari = type; | |
| 1048 | a800_setbank(m_a800_cart_loaded); | |
| 1049 | } | |
| 1050 | ||
| 1051 | void a400_state::ms_atari800xl_machine_start(int type, int has_cart) | |
| 1052 | { | |
| 1053 | /* set atari type (temporarily not used) */ | |
| 1054 | m_atari = type; | |
| 1055 | a800_setbank(m_a800_cart_loaded); | |
| 1056 | } | |
| 1057 | ||
| 1058 | ||
| 1059 | struct a800_pcb | |
| 1060 | { | |
| 1061 | const char *pcb_name; | |
| 1062 | int pcb_id; | |
| 1063 | }; | |
| 1064 | ||
| 1065 | // Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it | |
| 1066 | // WARNING: most of these are still unsupported by the driver | |
| 1067 | static const a800_pcb pcb_list[] = | |
| 1068 | { | |
| 1069 | {"standard 4k", A800_8K}, | |
| 1070 | {"standard 8k", A800_8K}, | |
| 1071 | {"standard 12k", A800_16K}, | |
| 1072 | {"standard 16k", A800_16K}, | |
| 1073 | {"right slot 4k", A800_RIGHT_4K}, | |
| 1074 | {"right slot 8k", A800_RIGHT_8K}, | |
| 1075 | ||
| 1076 | {"oss 034m", OSS_034M}, | |
| 1077 | {"oss m091", OSS_M091}, | |
| 1078 | {"phoenix 8k", PHOENIX_8K}, | |
| 1079 | {"xegs 32k", XEGS_32K}, | |
| 1080 | {"bbsb", BBSB}, | |
| 1081 | {"diamond 64k", DIAMOND_64K}, | |
| 1082 | {"williams 64k", WILLIAMS_64K}, | |
| 1083 | {"express 64", EXPRESS_64}, | |
| 1084 | {"spartados x", SPARTADOS_X}, | |
| 1085 | {"N/A", A800_UNKNOWN} | |
| 1086 | }; | |
| 1087 | ||
| 1088 | static int a800_get_pcb_id(const char *pcb) | |
| 1089 | { | |
| 1090 | int i; | |
| 1091 | ||
| 1092 | for (i = 0; i < ARRAY_LENGTH(pcb_list); i++) | |
| 1093 | { | |
| 1094 | if (!mame_stricmp(pcb_list[i].pcb_name, pcb)) | |
| 1095 | return pcb_list[i].pcb_id; | |
| 1096 | } | |
| 1097 | ||
| 1098 | return A800_UNKNOWN; | |
| 1099 | } | |
| 1100 | ||
| 1101 | ||
| 1102 | static WRITE8_HANDLER( x32_bank_w ) | |
| 1103 | { | |
| 1104 | // printf("written %x\n", data); | |
| 1105 | int bank = data & 0x03; | |
| 1106 | space.machine().root_device().membank("8000")->set_base(space.machine().root_device().memregion("lslot")->base() + bank * 0x2000); | |
| 1107 | } | |
| 1108 | ||
| 1109 | ||
| 1110 | static WRITE8_HANDLER( w64_bank_w ) | |
| 1111 | { | |
| 1112 | // printf("write to %x\n", offset); | |
| 1113 | ||
| 1114 | if (offset < 8) | |
| 1115 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + offset * 0x2000); | |
| 1116 | else | |
| 1117 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base()); | |
| 1118 | // FIXME: writes to 0x8-0xf should disable the cart | |
| 1119 | } | |
| 1120 | ||
| 1121 | ||
| 1122 | // this covers Express 64, Diamond 64 and SpartaDOS (same bankswitch, but at different addresses) | |
| 1123 | static WRITE8_HANDLER( ex64_bank_w ) | |
| 1124 | { | |
| 1125 | // printf("write to %x\n", offset); | |
| 1126 | ||
| 1127 | if (offset < 8) | |
| 1128 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + (7 - offset) * 0x2000); | |
| 1129 | else | |
| 1130 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base()); | |
| 1131 | // FIXME: writes to 0x8-0xf should disable the cart | |
| 1132 | } | |
| 1133 | ||
| 1134 | ||
| 1135 | static WRITE8_HANDLER( bbsb_bankl_w ) | |
| 1136 | { | |
| 1137 | // printf("write to %x\n", 0x8000 + offset); | |
| 1138 | if (offset >= 0xff6 && offset <= 0xff9) | |
| 1139 | space.machine().root_device().membank("8000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x0000 + (offset - 0xff6) * 0x1000); | |
| 1140 | } | |
| 1141 | ||
| 1142 | ||
| 1143 | static WRITE8_HANDLER( bbsb_bankh_w ) | |
| 1144 | { | |
| 1145 | // printf("write to %x\n", 0x9000 + offset); | |
| 1146 | if (offset >= 0xff6 && offset <= 0xff9) | |
| 1147 | space.machine().root_device().membank("9000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x4000 + (offset - 0xff6) * 0x1000); | |
| 1148 | } | |
| 1149 | ||
| 1150 | ||
| 1151 | static WRITE8_HANDLER( oss_034m_w ) | |
| 1152 | { | |
| 1153 | switch (offset & 0x0f) | |
| 1154 | { | |
| 1155 | case 0: | |
| 1156 | case 1: | |
| 1157 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base()); | |
| 1158 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000); | |
| 1159 | break; | |
| 1160 | case 2: | |
| 1161 | case 6: | |
| 1162 | // docs says this should put 0xff in the 0xa000 bank -> let's point to the end of the cart | |
| 1163 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x4000); | |
| 1164 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000); | |
| 1165 | break; | |
| 1166 | case 3: | |
| 1167 | case 7: | |
| 1168 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x1000); | |
| 1169 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000); | |
| 1170 | break; | |
| 1171 | case 4: | |
| 1172 | case 5: | |
| 1173 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x2000); | |
| 1174 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000); | |
| 1175 | break; | |
| 1176 | default: | |
| 1177 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xa000); | |
| 1178 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xb000); | |
| 1179 | break; | |
| 1180 | } | |
| 1181 | } | |
| 1182 | ||
| 1183 | ||
| 1184 | static WRITE8_HANDLER( oss_m091_w ) | |
| 1185 | { | |
| 1186 | switch (offset & 0x09) | |
| 1187 | { | |
| 1188 | case 0: | |
| 1189 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x1000); | |
| 1190 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base()); | |
| 1191 | break; | |
| 1192 | case 1: | |
| 1193 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000); | |
| 1194 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base()); | |
| 1195 | break; | |
| 1196 | case 8: | |
| 1197 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xa000); | |
| 1198 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xb000); | |
| 1199 | break; | |
| 1200 | case 9: | |
| 1201 | space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x2000); | |
| 1202 | space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base()); | |
| 1203 | break; | |
| 1204 | } | |
| 1205 | } | |
| 1206 | ||
| 1207 | ||
| 1208 | static UINT8 xegs_banks = 0; | |
| 1209 | static UINT8 xegs_cart = 0; | |
| 1210 | ||
| 1211 | static WRITE8_HANDLER( xegs_bankswitch ) | |
| 1212 | { | |
| 1213 | UINT8 *cart = space.machine().root_device().memregion("user1")->base(); | |
| 1214 | data &= xegs_banks - 1; | |
| 1215 | space.machine().root_device().membank("bank0")->set_base(cart + data * 0x2000); | |
| 1216 | } | |
| 1217 | ||
| 1218 | MACHINE_START( xegs ) | |
| 1219 | { | |
| 1220 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
| 1221 | UINT8 *cart = space.machine().root_device().memregion("user1")->base(); | |
| 1222 | UINT8 *cpu = space.machine().root_device().memregion("maincpu")->base(); | |
| 1223 | ||
| 1224 | atari_machine_start(machine); | |
| 1225 | space.install_legacy_write_handler(0xd500, 0xd5ff, FUNC(xegs_bankswitch)); | |
| 1226 | ||
| 1227 | if (xegs_cart) | |
| 1228 | { | |
| 1229 | machine.root_device().membank("bank0")->set_base(cart); | |
| 1230 | machine.root_device().membank("bank1")->set_base(cart + (xegs_banks - 1) * 0x2000); | |
| 1231 | } | |
| 1232 | else | |
| 1233 | { | |
| 1234 | // point to built-in Missile Command (this does not work well, though... FIXME!!) | |
| 1235 | machine.root_device().membank("bank0")->set_base(cpu + 0x10000); | |
| 1236 | machine.root_device().membank("bank1")->set_base(cpu + 0x10000); | |
| 1237 | } | |
| 1238 | } | |
| 1239 | ||
| 1240 | ||
| 1241 | // currently this does nothing, but it will eventually install the memory handlers required by the mappers | |
| 1242 | static void a800_setup_mappers(running_machine &machine, int type) | |
| 1243 | { | |
| 1244 | switch (type) | |
| 1245 | { | |
| 1246 | case A800_4K: | |
| 1247 | case A800_RIGHT_4K: | |
| 1248 | case A800_12K: | |
| 1249 | case A800_8K: | |
| 1250 | case A800_16K: | |
| 1251 | case A800_RIGHT_8K: | |
| 1252 | case PHOENIX_8K: // as normal 8k cart, but it can be disabled by writing to 0xd500-0xdfff | |
| 1253 | break; | |
| 1254 | case XEGS_32K: | |
| 1255 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(x32_bank_w)); | |
| 1256 | break; | |
| 1257 | case OSS_034M: | |
| 1258 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(oss_034m_w)); | |
| 1259 | break; | |
| 1260 | case OSS_M091: | |
| 1261 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(oss_m091_w)); | |
| 1262 | break; | |
| 1263 | case BBSB: | |
| 1264 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x8000, 0x8fff, FUNC(bbsb_bankl_w)); | |
| 1265 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x9000, 0x9fff, FUNC(bbsb_bankh_w)); | |
| 1266 | break; | |
| 1267 | case WILLIAMS_64K: | |
| 1268 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd50f, FUNC(w64_bank_w)); | |
| 1269 | break; | |
| 1270 | case DIAMOND_64K: | |
| 1271 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd5d0, 0xd5df, FUNC(ex64_bank_w)); | |
| 1272 | break; | |
| 1273 | case EXPRESS_64: | |
| 1274 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd570, 0xd57f, FUNC(ex64_bank_w)); | |
| 1275 | break; | |
| 1276 | case SPARTADOS_X: | |
| 1277 | machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd5e0, 0xd5ef, FUNC(ex64_bank_w)); | |
| 1278 | break; | |
| 1279 | default: | |
| 1280 | break; | |
| 1281 | } | |
| 1282 | } | |
| 1283 | ||
| 1284 | ||
| 1285 | static int a800_get_type(device_image_interface &image) | |
| 1286 | { | |
| 1287 | UINT8 header[16]; | |
| 1288 | image.fread(header, 0x10); | |
| 1289 | int hdr_type, cart_type = A800_UNKNOWN; | |
| 1290 | ||
| 1291 | // add check of CART format | |
| 1292 | if (strncmp((const char *)header, "CART", 4)) | |
| 1293 | fatalerror("Invalid header detected!\n"); | |
| 1294 | ||
| 1295 | hdr_type = (header[4] << 24) + (header[5] << 16) + (header[6] << 8) + (header[7] << 0); | |
| 1296 | switch (hdr_type) | |
| 1297 | { | |
| 1298 | case 1: | |
| 1299 | cart_type = A800_8K; | |
| 1300 | break; | |
| 1301 | case 2: | |
| 1302 | cart_type = A800_16K; | |
| 1303 | break; | |
| 1304 | case 3: | |
| 1305 | cart_type = OSS_034M; | |
| 1306 | break; | |
| 1307 | case 8: | |
| 1308 | cart_type = WILLIAMS_64K; | |
| 1309 | break; | |
| 1310 | case 9: | |
| 1311 | cart_type = DIAMOND_64K; | |
| 1312 | break; | |
| 1313 | case 10: | |
| 1314 | cart_type = EXPRESS_64; | |
| 1315 | break; | |
| 1316 | case 11: | |
| 1317 | cart_type = SPARTADOS_X; | |
| 1318 | break; | |
| 1319 | case 12: | |
| 1320 | cart_type = XEGS_32K; | |
| 1321 | break; | |
| 1322 | case 15: | |
| 1323 | cart_type = OSS_M091; | |
| 1324 | break; | |
| 1325 | case 18: | |
| 1326 | cart_type = BBSB; | |
| 1327 | break; | |
| 1328 | case 21: | |
| 1329 | cart_type = A800_RIGHT_8K; | |
| 1330 | break; | |
| 1331 | case 39: | |
| 1332 | cart_type = PHOENIX_8K; | |
| 1333 | break; | |
| 1334 | case 4: | |
| 1335 | case 6: | |
| 1336 | case 7: | |
| 1337 | case 16: | |
| 1338 | case 19: | |
| 1339 | case 20: | |
| 1340 | fatalerror("Cart type \"%d\" means this is an Atari 5200 cart.\n", hdr_type); | |
| 1341 | break; | |
| 1342 | default: | |
| 1343 | mame_printf_info("Cart type \"%d\" is currently unsupported.\n", hdr_type); | |
| 1344 | break; | |
| 1345 | } | |
| 1346 | return cart_type; | |
| 1347 | } | |
| 1348 | ||
| 1349 | ||
| 1350 | static int a800_check_cart_type(device_image_interface &image) | |
| 1351 | { | |
| 1352 | const char *pcb_name; | |
| 1353 | int type = A800_UNKNOWN; | |
| 1354 | ||
| 1355 | if (image.software_entry() == NULL) | |
| 1356 | { | |
| 1357 | UINT32 size = image.length(); | |
| 1358 | ||
| 1359 | // check if there is an header, if so extract cart_type from it, otherwise | |
| 1360 | // try to guess the cart_type from the file size (notice that after the | |
| 1361 | // a800_get_type call, we point at the start of the data) | |
| 1362 | if ((size % 0x1000) == 0x10) | |
| 1363 | type = a800_get_type(image); | |
| 1364 | else if (size == 0x4000) | |
| 1365 | type = A800_16K; | |
| 1366 | else if (size == 0x2000) | |
| 1367 | { | |
| 1368 | if (strcmp(image.device().tag(),":cart2") == 0) | |
| 1369 | type = A800_RIGHT_8K; | |
| 1370 | else | |
| 1371 | type = A800_8K; | |
| 1372 | } | |
| 1373 | } | |
| 1374 | else | |
| 1375 | { | |
| 1376 | if ((pcb_name = image.get_feature("cart_type")) != NULL) | |
| 1377 | type = a800_get_pcb_id(pcb_name); | |
| 1378 | ||
| 1379 | switch (type) | |
| 1380 | { | |
| 1381 | case A800_UNKNOWN: | |
| 1382 | case A800_4K: | |
| 1383 | case A800_RIGHT_4K: | |
| 1384 | case A800_12K: | |
| 1385 | case A800_8K: | |
| 1386 | case A800_16K: | |
| 1387 | case A800_RIGHT_8K: | |
| 1388 | break; | |
| 1389 | default: | |
| 1390 | mame_printf_info("Cart type \"%s\" currently unsupported.\n", pcb_name); | |
| 1391 | break; | |
| 1392 | } | |
| 1393 | } | |
| 1394 | ||
| 1395 | if ((strcmp(image.device().tag(),":cart2") == 0) && (type != A800_RIGHT_8K)) | |
| 1396 | fatalerror("You cannot load this image '%s' in the right slot\n", image.filename()); | |
| 1397 | ||
| 1398 | return type; | |
| 1399 | } | |
| 1400 | ||
| 1401 | ||
| 1402 | DEVICE_IMAGE_LOAD_MEMBER( a400_state, a800_cart ) | |
| 1403 | { | |
| 1404 | UINT32 size, start = 0; | |
| 1405 | ||
| 1406 | m_a800_cart_loaded = m_a800_cart_loaded & ~LEFT_CARTSLOT_MOUNTED; | |
| 1407 | m_a800_cart_type = a800_check_cart_type(image); | |
| 1408 | ||
| 1409 | a800_setup_mappers(image.device().machine(), m_a800_cart_type); | |
| 1410 | ||
| 1411 | if (image.software_entry() == NULL) | |
| 1412 | { | |
| 1413 | size = image.length(); | |
| 1414 | // if there is an header, skip it | |
| 1415 | if ((size % 0x1000) == 0x10) | |
| 1416 | { | |
| 1417 | size -= 0x10; | |
| 1418 | start = 0x10; | |
| 1419 | } | |
| 1420 | image.fread(image.device().machine().root_device().memregion("lslot")->base(), size - start); | |
| 1421 | } | |
| 1422 | else | |
| 1423 | { | |
| 1424 | size = image.get_software_region_length("rom"); | |
| 1425 | memcpy(image.device().machine().root_device().memregion("lslot")->base(), image.get_software_region("rom"), size); | |
| 1426 | } | |
| 1427 | ||
| 1428 | m_a800_cart_loaded |= (size > 0x0000) ? 1 : 0; | |
| 1429 | ||
| 1430 | logerror("%s loaded left cartridge '%s' size %dK\n", image.device().machine().system().name, image.filename(), size/1024); | |
| 1431 | return IMAGE_INIT_PASS; | |
| 1432 | } | |
| 1433 | ||
| 1434 | ||
| 1435 | DEVICE_IMAGE_LOAD_MEMBER( a400_state, a800_cart_right ) | |
| 1436 | { | |
| 1437 | UINT32 size, start = 0; | |
| 1438 | ||
| 1439 | m_a800_cart_loaded = m_a800_cart_loaded & ~RIGHT_CARTSLOT_MOUNTED; | |
| 1440 | m_a800_cart_type = a800_check_cart_type(image); | |
| 1441 | ||
| 1442 | a800_setup_mappers(image.device().machine(), m_a800_cart_type); | |
| 1443 | ||
| 1444 | if (image.software_entry() == NULL) | |
| 1445 | { | |
| 1446 | size = image.length(); | |
| 1447 | // if there is an header, skip it | |
| 1448 | if ((size % 0x1000) == 0x10) | |
| 1449 | { | |
| 1450 | size -= 0x10; | |
| 1451 | start = 0x10; | |
| 1452 | } | |
| 1453 | image.fread(image.device().machine().root_device().memregion("rslot")->base(), size - start); | |
| 1454 | } | |
| 1455 | else | |
| 1456 | { | |
| 1457 | size = image.get_software_region_length("rom"); | |
| 1458 | memcpy(image.device().machine().root_device().memregion("rslot")->base(), image.get_software_region("rom"), size); | |
| 1459 | } | |
| 1460 | ||
| 1461 | m_a800_cart_loaded |= (size > 0x0000) ? 2 : 0; | |
| 1462 | ||
| 1463 | logerror("%s loaded right cartridge '%s' size 8K\n", image.device().machine().system().name, image.filename()); | |
| 1464 | return IMAGE_INIT_PASS; | |
| 1465 | } | |
| 1466 | ||
| 1467 | ||
| 1468 | DEVICE_IMAGE_UNLOAD_MEMBER( a400_state, a800_cart ) | |
| 1469 | { | |
| 1470 | m_a800_cart_loaded = m_a800_cart_loaded & ~LEFT_CARTSLOT_MOUNTED; | |
| 1471 | m_a800_cart_type = A800_UNKNOWN; | |
| 1472 | a800_setbank(m_a800_cart_loaded); | |
| 1473 | } | |
| 1474 | ||
| 1475 | ||
| 1476 | DEVICE_IMAGE_UNLOAD_MEMBER( a400_state, a800_cart_right ) | |
| 1477 | { | |
| 1478 | m_a800_cart_loaded = m_a800_cart_loaded & ~RIGHT_CARTSLOT_MOUNTED; | |
| 1479 | m_a800_cart_type = A800_UNKNOWN; | |
| 1480 | a800_setbank(m_a800_cart_loaded); | |
| 1481 | } | |
| 1482 | ||
| 1483 | ||
| 1484 | DEVICE_IMAGE_LOAD_MEMBER( a400_state, a5200_cart ) | |
| 1485 | { | |
| 1486 | UINT8 *mem = image.device().machine().root_device().memregion("maincpu")->base(); | |
| 1487 | UINT32 size; | |
| 1488 | bool A13_mirr = FALSE; | |
| 1489 | ||
| 1490 | if (image.software_entry() == NULL) | |
| 1491 | { | |
| 1492 | /* load an optional (dual) cartidge */ | |
| 1493 | size = image.fread(&mem[0x4000], 0x8000); | |
| 1494 | const char *info = hashfile_extrainfo(image); | |
| 1495 | if (info && !strcmp(info, "A13MIRRORING")) | |
| 1496 | A13_mirr = TRUE; | |
| 1497 | } | |
| 1498 | else | |
| 1499 | { | |
| 1500 | size = image.get_software_region_length("rom"); | |
| 1501 | memcpy(mem + 0x4000, image.get_software_region("rom"), size); | |
| 1502 | const char *pcb_name = image.get_feature("cart_type"); | |
| 1503 | if (pcb_name && !strcmp(pcb_name, "A13MIRRORING")) | |
| 1504 | A13_mirr = TRUE; | |
| 1505 | } | |
| 1506 | ||
| 1507 | if (size<0x8000) memmove(mem+0x4000+0x8000-size, mem+0x4000, size); | |
| 1508 | // mirroring of smaller cartridges | |
| 1509 | if (size <= 0x1000) memcpy(mem+0xa000, mem+0xb000, 0x1000); | |
| 1510 | if (size <= 0x2000) memcpy(mem+0x8000, mem+0xa000, 0x2000); | |
| 1511 | if (size <= 0x4000) | |
| 1512 | { | |
| 1513 | memcpy(&mem[0x4000], &mem[0x8000], 0x4000); | |
| 1514 | if (A13_mirr) | |
| 1515 | { | |
| 1516 | memcpy(&mem[0x8000], &mem[0xa000], 0x2000); | |
| 1517 | memcpy(&mem[0x6000], &mem[0x4000], 0x2000); | |
| 1518 | } | |
| 1519 | } | |
| 1520 | logerror("A5200 loaded cartridge '%s' size %dK\n", image.filename() , size/1024); | |
| 1521 | return IMAGE_INIT_PASS; | |
| 1522 | } | |
| 1523 | ||
| 1524 | ||
| 1525 | DEVICE_IMAGE_UNLOAD_MEMBER( a400_state, a5200_cart ) | |
| 1526 | { | |
| 1527 | UINT8 *mem = image.device().machine().root_device().memregion("maincpu")->base(); | |
| 1528 | /* zap the cartridge memory (again) */ | |
| 1529 | memset(&mem[0x4000], 0x00, 0x8000); | |
| 1530 | } | |
| 1531 | ||
| 1532 | ||
| 1533 | DEVICE_IMAGE_LOAD_MEMBER( a400_state, xegs_cart ) | |
| 1534 | { | |
| 1535 | UINT32 size; | |
| 1536 | UINT8 *ptr = image.device().machine().root_device().memregion("user1")->base(); | |
| 1537 | ||
| 1538 | if (image.software_entry() == NULL) | |
| 1539 | { | |
| 1540 | // skip the header | |
| 1541 | image.fseek(0x10, SEEK_SET); | |
| 1542 | size = image.length() - 0x10; | |
| 1543 | if (image.fread(ptr, size) != size) | |
| 1544 | return IMAGE_INIT_FAIL; | |
| 1545 | } | |
| 1546 | else | |
| 1547 | { | |
| 1548 | size = image.get_software_region_length("rom"); | |
| 1549 | memcpy(ptr, image.get_software_region("rom"), size); | |
| 1550 | } | |
| 1551 | ||
| 1552 | xegs_banks = size / 0x2000; | |
| 1553 | xegs_cart = 1; | |
| 1554 | ||
| 1555 | return IMAGE_INIT_PASS; | |
| 1556 | } | |
| 1557 | ||
| 1558 | ||
| 1559 | DEVICE_IMAGE_UNLOAD_MEMBER( a400_state, xegs_cart ) | |
| 1560 | { | |
| 1561 | xegs_cart = 0; | |
| 1562 | xegs_banks = 0; | |
| 1563 | } | |
| 1564 | ||
| 1565 | ||
| 1566 | MACHINE_START( a400 ) | |
| 1567 | { | |
| 1568 | a400_state *state = machine.driver_data<a400_state>(); | |
| 1569 | atari_machine_start(machine); | |
| 1570 | state->ms_atari_machine_start(ATARI_400, TRUE); | |
| 1571 | } | |
| 1572 | ||
| 1573 | ||
| 1574 | MACHINE_START( a800 ) | |
| 1575 | { | |
| 1576 | a400_state *state = machine.driver_data<a400_state>(); | |
| 1577 | atari_machine_start(machine); | |
| 1578 | state->ms_atari_machine_start(ATARI_800, TRUE); | |
| 1579 | } | |
| 1580 | ||
| 1581 | ||
| 1582 | MACHINE_START( a800xl ) | |
| 1583 | { | |
| 1584 | a400_state *state = machine.driver_data<a400_state>(); | |
| 1585 | atari_machine_start(machine); | |
| 1586 | state->ms_atari800xl_machine_start(ATARI_800XL, TRUE); | |
| 1587 | } | |
| 1588 | ||
| 1589 | ||
| 1590 | MACHINE_START( a5200 ) | |
| 1591 | { | |
| 1592 | a400_state *state = machine.driver_data<a400_state>(); | |
| 1593 | atari_machine_start(machine); | |
| 1594 | state->ms_atari_machine_start(ATARI_800XL, TRUE); | |
| 1595 | } | |
| 1596 | ||
| 1597 | ||
| 1598 | ||
| 905 | 1599 | /************************************************************** |
| 906 | 1600 | * |
| 907 | 1601 | * PIA interface |
| r20749 | r20750 | |
| 1066 | 1760 | MCFG_CARTSLOT_ADD("cart1") |
| 1067 | 1761 | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 1068 | 1762 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1069 | MCFG_CARTSLOT_LOAD(a800_cart) | |
| 1070 | MCFG_CARTSLOT_UNLOAD(a800_cart) | |
| 1763 | MCFG_CARTSLOT_LOAD(a400_state,a800_cart) | |
| 1764 | MCFG_CARTSLOT_UNLOAD(a400_state,a800_cart) | |
| 1071 | 1765 | MCFG_CARTSLOT_INTERFACE("a800_cart") |
| 1072 | 1766 | MACHINE_CONFIG_END |
| 1073 | 1767 | |
| r20749 | r20750 | |
| 1075 | 1769 | MCFG_CARTSLOT_ADD("cart1") |
| 1076 | 1770 | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 1077 | 1771 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1078 | MCFG_CARTSLOT_LOAD(a800_cart) | |
| 1079 | MCFG_CARTSLOT_UNLOAD(a800_cart) | |
| 1772 | MCFG_CARTSLOT_LOAD(a400_state,a800_cart) | |
| 1773 | MCFG_CARTSLOT_UNLOAD(a400_state,a800_cart) | |
| 1080 | 1774 | MCFG_CARTSLOT_INTERFACE("a800_cart") |
| 1081 | 1775 | |
| 1082 | 1776 | MCFG_CARTSLOT_ADD("cart2") |
| 1083 | 1777 | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 1084 | 1778 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1085 | MCFG_CARTSLOT_LOAD(a800_cart_right) | |
| 1086 | MCFG_CARTSLOT_UNLOAD(a800_cart_right) | |
| 1779 | MCFG_CARTSLOT_LOAD(a400_state,a800_cart_right) | |
| 1780 | MCFG_CARTSLOT_UNLOAD(a400_state,a800_cart_right) | |
| 1087 | 1781 | MCFG_CARTSLOT_INTERFACE("a800_cart") |
| 1088 | 1782 | MACHINE_CONFIG_END |
| 1089 | 1783 | |
| r20749 | r20750 | |
| 1279 | 1973 | MCFG_CARTSLOT_ADD("cart1") |
| 1280 | 1974 | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 1281 | 1975 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1282 | MCFG_CARTSLOT_LOAD(xegs_cart) | |
| 1283 | MCFG_CARTSLOT_UNLOAD(xegs_cart) | |
| 1976 | MCFG_CARTSLOT_LOAD(a400_state,xegs_cart) | |
| 1977 | MCFG_CARTSLOT_UNLOAD(a400_state,xegs_cart) | |
| 1284 | 1978 | MCFG_CARTSLOT_INTERFACE("xegs_cart") |
| 1285 | 1979 | |
| 1286 | 1980 | /* software lists */ |
| r20749 | r20750 | |
| 1313 | 2007 | MCFG_CARTSLOT_ADD("cart") |
| 1314 | 2008 | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,a52") |
| 1315 | 2009 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1316 | MCFG_CARTSLOT_LOAD(a5200_cart) | |
| 1317 | MCFG_CARTSLOT_UNLOAD(a5200_cart) | |
| 2010 | MCFG_CARTSLOT_LOAD(a400_state,a5200_cart) | |
| 2011 | MCFG_CARTSLOT_UNLOAD(a400_state,a5200_cart) | |
| 1318 | 2012 | MCFG_CARTSLOT_INTERFACE("a5200_cart") |
| 1319 | 2013 | |
| 1320 | 2014 | /* Software lists */ |
| r20749 | r20750 | |
|---|---|---|
| 335 | 335 | palette_set_colors(machine(), 0, vc4000_palette, ARRAY_LENGTH(vc4000_palette)); |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | ||
| 338 | DEVICE_IMAGE_LOAD_MEMBER( vc4000_state, vc4000_cart ) | |
| 339 | 339 | { |
| 340 | 340 | running_machine &machine = image.device().machine(); |
| 341 | vc4000_state *state = machine.driver_data<vc4000_state>(); | |
| 342 | 341 | address_space &memspace = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 343 | 342 | UINT32 size; |
| 344 | 343 | |
| r20749 | r20750 | |
| 353 | 352 | if (size > 0x1000) /* 6k rom + 1k ram - Chess2 only */ |
| 354 | 353 | { |
| 355 | 354 | memspace.install_read_bank(0x0800, 0x15ff, "bank1"); /* extra rom */ |
| 356 | | |
| 355 | membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1000); | |
| 357 | 356 | |
| 358 | 357 | memspace.install_readwrite_bank(0x1800, 0x1bff, "bank2"); /* ram */ |
| 359 | | |
| 358 | membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1800); | |
| 360 | 359 | } |
| 361 | 360 | else if (size > 0x0800) /* some 4k roms have 1k of mirrored ram */ |
| 362 | 361 | { |
| 363 | 362 | memspace.install_read_bank(0x0800, 0x0fff, "bank1"); /* extra rom */ |
| 364 | | |
| 363 | membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x0800); | |
| 365 | 364 | |
| 366 | 365 | memspace.install_readwrite_bank(0x1000, 0x15ff, 0, 0x800, "bank2"); /* ram */ |
| 367 | | |
| 366 | membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1000); | |
| 368 | 367 | } |
| 369 | 368 | else if (size == 0x0800) /* 2k roms + 2k ram - Hobby Module(Radofin) and elektor TVGC*/ |
| 370 | 369 | { |
| 371 | 370 | memspace.install_readwrite_bank(0x0800, 0x0fff, "bank1"); /* ram */ |
| 372 | | |
| 371 | membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x0800); | |
| 373 | 372 | } |
| 374 | 373 | |
| 375 | 374 | if (size > 0) |
| r20749 | r20750 | |
| 417 | 416 | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 418 | 417 | MCFG_CARTSLOT_NOT_MANDATORY |
| 419 | 418 | MCFG_CARTSLOT_INTERFACE("vc4000_cart") |
| 420 | MCFG_CARTSLOT_LOAD(vc4000_cart) | |
| 419 | MCFG_CARTSLOT_LOAD(vc4000_state,vc4000_cart) | |
| 421 | 420 | |
| 422 | 421 | /* software lists */ |
| 423 | 422 | MCFG_SOFTWARE_LIST_ADD("cart_list","vc4000") |
| r20749 | r20750 | |
|---|---|---|
| 841 | 841 | /* cartridge */ |
| 842 | 842 | MCFG_CARTSLOT_ADD("cart") |
| 843 | 843 | MCFG_CARTSLOT_EXTENSION_LIST("int,rom,bin,itv") |
| 844 | MCFG_CARTSLOT_LOAD(intv_cart) | |
| 844 | MCFG_CARTSLOT_LOAD(intv_state,intv_cart) | |
| 845 | 845 | MCFG_CARTSLOT_INTERFACE("intv_cart") |
| 846 | 846 | /* software lists */ |
| 847 | 847 | MCFG_SOFTWARE_LIST_ADD("cart_list","intv") |
| r20749 | r20750 | |
| 890 | 890 | MCFG_CARTSLOT_ADD("cart1") |
| 891 | 891 | MCFG_CARTSLOT_EXTENSION_LIST("int,rom,bin,itv") |
| 892 | 892 | MCFG_CARTSLOT_NOT_MANDATORY |
| 893 | MCFG_CARTSLOT_LOAD(intvkbd_cart) | |
| 893 | MCFG_CARTSLOT_LOAD(intv_state,intvkbd_cart) | |
| 894 | 894 | MCFG_CARTSLOT_INTERFACE("intv_cart") |
| 895 | 895 | |
| 896 | 896 | MCFG_CARTSLOT_ADD("cart2") |
| 897 | 897 | MCFG_CARTSLOT_EXTENSION_LIST("int,rom,bin,itv") |
| 898 | 898 | MCFG_CARTSLOT_NOT_MANDATORY |
| 899 | MCFG_CARTSLOT_LOAD(intvkbd_cart) | |
| 899 | MCFG_CARTSLOT_LOAD(intv_state,intvkbd_cart) | |
| 900 | 900 | MCFG_CARTSLOT_INTERFACE("intv_cart") |
| 901 | 901 | MACHINE_CONFIG_END |
| 902 | 902 |
| r20749 | r20750 | |
|---|---|---|
| 663 | 663 | NULL |
| 664 | 664 | }; |
| 665 | 665 | |
| 666 | ||
| 666 | DEVICE_IMAGE_LOAD_MEMBER( spectrum_state,spectrum_cart ) | |
| 667 | 667 | { |
| 668 | 668 | UINT32 filesize; |
| 669 | 669 | |
| r20749 | r20750 | |
| 732 | 732 | MCFG_CARTSLOT_ADD("cart") |
| 733 | 733 | MCFG_CARTSLOT_EXTENSION_LIST("rom") |
| 734 | 734 | MCFG_CARTSLOT_NOT_MANDATORY |
| 735 | MCFG_CARTSLOT_LOAD(spectrum_cart) | |
| 735 | MCFG_CARTSLOT_LOAD(spectrum_state,spectrum_cart) | |
| 736 | 736 | MCFG_CARTSLOT_INTERFACE("spectrum_cart") |
| 737 | 737 | MCFG_SOFTWARE_LIST_ADD("cart_list","spectrum") |
| 738 | 738 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
|---|---|---|
| 244 | 244 | DECLARE_WRITE8_MEMBER(pc6001_8255_portb_w); |
| 245 | 245 | DECLARE_WRITE8_MEMBER(pc6001_8255_portc_w); |
| 246 | 246 | DECLARE_READ8_MEMBER(pc6001_8255_portc_r); |
| 247 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pc6001_cass); | |
| 247 | 248 | }; |
| 248 | 249 | |
| 249 | 250 | |
| r20749 | r20750 | |
| 2261 | 2262 | NULL |
| 2262 | 2263 | }; |
| 2263 | 2264 | |
| 2264 | ||
| 2265 | DEVICE_IMAGE_LOAD_MEMBER( pc6001_state,pc6001_cass ) | |
| 2265 | 2266 | { |
| 2266 | 2267 | pc6001_state *state = image.device().machine().driver_data<pc6001_state>(); |
| 2267 | 2268 | UINT8 *cas = state->memregion("cas")->base(); |
| r20749 | r20750 | |
| 2347 | 2348 | MCFG_CARTSLOT_EXTENSION_LIST("cas,p6") |
| 2348 | 2349 | MCFG_CARTSLOT_NOT_MANDATORY |
| 2349 | 2350 | MCFG_CARTSLOT_INTERFACE("pc6001_cass") |
| 2350 | MCFG_CARTSLOT_LOAD(pc6001_cass) | |
| 2351 | MCFG_CARTSLOT_LOAD(pc6001_state,pc6001_cass) | |
| 2351 | 2352 | |
| 2352 | 2353 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 2353 | 2354 | MCFG_SOUND_ADD("ay8910", AY8910, PC6001_MAIN_CLOCK/4) |
| r20749 | r20750 | |
|---|---|---|
| 829 | 829 | CARTRIDGE |
| 830 | 830 | ***************************************************************************/ |
| 831 | 831 | |
| 832 | ||
| 832 | DEVICE_IMAGE_LOAD_MEMBER( crvision_state, crvision_cart ) | |
| 833 | 833 | { |
| 834 | 834 | UINT32 size; |
| 835 | 835 | UINT8 *temp_copy; |
| r20749 | r20750 | |
| 971 | 971 | MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") |
| 972 | 972 | MCFG_CARTSLOT_MANDATORY |
| 973 | 973 | MCFG_CARTSLOT_INTERFACE("crvision_cart") |
| 974 | MCFG_CARTSLOT_LOAD(crvision_cart) | |
| 974 | MCFG_CARTSLOT_LOAD(crvision_state, crvision_cart) | |
| 975 | 975 | |
| 976 | 976 | // internal ram |
| 977 | 977 | MCFG_RAM_ADD(RAM_TAG) |
| r20749 | r20750 | |
| 1036 | 1036 | MCFG_CARTSLOT_ADD("cart") |
| 1037 | 1037 | MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") |
| 1038 | 1038 | MCFG_CARTSLOT_INTERFACE("crvision_cart") |
| 1039 | MCFG_CARTSLOT_LOAD(crvision_cart) | |
| 1039 | MCFG_CARTSLOT_LOAD(crvision_state, crvision_cart) | |
| 1040 | 1040 | |
| 1041 | 1041 | // internal ram |
| 1042 | 1042 | MCFG_RAM_ADD(RAM_TAG) |
| r20749 | r20750 | |
|---|---|---|
| 82 | 82 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 83 | 83 | DECLARE_DRIVER_INIT(pegasus); |
| 84 | 84 | TIMER_DEVICE_CALLBACK_MEMBER(pegasus_firq); |
| 85 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_1); | |
| 86 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_2); | |
| 87 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_3); | |
| 88 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_4); | |
| 89 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_5); | |
| 85 | 90 | }; |
| 86 | 91 | |
| 87 | 92 | TIMER_DEVICE_CALLBACK_MEMBER(pegasus_state::pegasus_firq) |
| r20749 | r20750 | |
| 433 | 438 | } |
| 434 | 439 | } |
| 435 | 440 | |
| 436 | ||
| 441 | DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_1 ) | |
| 437 | 442 | { |
| 438 | 443 | image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0x0000, 0x1000); |
| 439 | 444 | pegasus_decrypt_rom( image.device().machine(), 0x0000 ); |
| r20749 | r20750 | |
| 441 | 446 | return IMAGE_INIT_PASS; |
| 442 | 447 | } |
| 443 | 448 | |
| 444 | ||
| 449 | DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_2 ) | |
| 445 | 450 | { |
| 446 | 451 | image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0x1000, 0x1000); |
| 447 | 452 | pegasus_decrypt_rom( image.device().machine(), 0x1000 ); |
| r20749 | r20750 | |
| 449 | 454 | return IMAGE_INIT_PASS; |
| 450 | 455 | } |
| 451 | 456 | |
| 452 | ||
| 457 | DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_3 ) | |
| 453 | 458 | { |
| 454 | 459 | image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0x2000, 0x1000); |
| 455 | 460 | pegasus_decrypt_rom( image.device().machine(), 0x2000 ); |
| r20749 | r20750 | |
| 457 | 462 | return IMAGE_INIT_PASS; |
| 458 | 463 | } |
| 459 | 464 | |
| 460 | ||
| 465 | DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_4 ) | |
| 461 | 466 | { |
| 462 | 467 | image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0xc000, 0x1000); |
| 463 | 468 | pegasus_decrypt_rom( image.device().machine(), 0xc000 ); |
| r20749 | r20750 | |
| 465 | 470 | return IMAGE_INIT_PASS; |
| 466 | 471 | } |
| 467 | 472 | |
| 468 | ||
| 473 | DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_5 ) | |
| 469 | 474 | { |
| 470 | 475 | image.fread( image.device().machine().root_device().memregion("maincpu")->base() + 0xd000, 0x1000); |
| 471 | 476 | pegasus_decrypt_rom( image.device().machine(), 0xd000 ); |
| r20749 | r20750 | |
| 518 | 523 | MCFG_PIA6821_ADD( "pia_u", pegasus_pia_u_intf ) |
| 519 | 524 | MCFG_CARTSLOT_ADD("cart1") |
| 520 | 525 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 521 | MCFG_CARTSLOT_LOAD(pegasus_cart_1) | |
| 526 | MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_1) | |
| 522 | 527 | MCFG_CARTSLOT_ADD("cart2") |
| 523 | 528 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 524 | MCFG_CARTSLOT_LOAD(pegasus_cart_2) | |
| 529 | MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_2) | |
| 525 | 530 | MCFG_CARTSLOT_ADD("cart3") |
| 526 | 531 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 527 | MCFG_CARTSLOT_LOAD(pegasus_cart_3) | |
| 532 | MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_3) | |
| 528 | 533 | MCFG_CARTSLOT_ADD("cart4") |
| 529 | 534 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 530 | MCFG_CARTSLOT_LOAD(pegasus_cart_4) | |
| 535 | MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_4) | |
| 531 | 536 | MCFG_CARTSLOT_ADD("cart5") |
| 532 | 537 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 533 | MCFG_CARTSLOT_LOAD(pegasus_cart_5) | |
| 538 | MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_5) | |
| 534 | 539 | MCFG_CASSETTE_ADD( CASSETTE_TAG, pegasus_cassette_interface ) |
| 535 | 540 | MACHINE_CONFIG_END |
| 536 | 541 |
| r20749 | r20750 | |
|---|---|---|
| 173 | 173 | UINT32 screen_update_ngp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 174 | 174 | DECLARE_INPUT_CHANGED_MEMBER(power_callback); |
| 175 | 175 | TIMER_CALLBACK_MEMBER(ngp_seconds_callback); |
| 176 | ||
| 177 | DECLARE_DEVICE_IMAGE_START_MEMBER( ngp_cart ); | |
| 178 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( ngp_cart); | |
| 179 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( ngp_cart ); | |
| 176 | 180 | }; |
| 177 | 181 | |
| 178 | 182 | |
| r20749 | r20750 | |
| 630 | 634 | } |
| 631 | 635 | |
| 632 | 636 | |
| 633 | ||
| 637 | DEVICE_IMAGE_START_MEMBER( ngp_state, ngp_cart ) | |
| 634 | 638 | { |
| 635 | ngp_state *state = device->machine().driver_data<ngp_state>(); | |
| 636 | UINT8 *cart = state->memregion("cart")->base(); | |
| 639 | UINT8 *cart = memregion("cart")->base(); | |
| 637 | 640 | |
| 638 | state->m_flash_chip[0].present = 0; | |
| 639 | state->m_flash_chip[0].state = F_READ; | |
| 640 | state->m_flash_chip[0].data = cart; | |
| 641 | m_flash_chip[0].present = 0; | |
| 642 | m_flash_chip[0].state = F_READ; | |
| 643 | m_flash_chip[0].data = cart; | |
| 641 | 644 | |
| 642 | state->m_flash_chip[1].present = 0; | |
| 643 | state->m_flash_chip[1].state = F_READ; | |
| 644 | state->m_flash_chip[1].data = cart + 0x200000; | |
| 645 | m_flash_chip[1].present = 0; | |
| 646 | m_flash_chip[1].state = F_READ; | |
| 647 | m_flash_chip[1].data = cart + 0x200000; | |
| 645 | 648 | } |
| 646 | 649 | |
| 647 | 650 | |
| 648 | ||
| 651 | DEVICE_IMAGE_LOAD_MEMBER( ngp_state, ngp_cart ) | |
| 649 | 652 | { |
| 650 | ngp_state *state = image.device().machine().driver_data<ngp_state>(); | |
| 651 | 653 | UINT32 filesize; |
| 652 | 654 | |
| 653 | 655 | if (image.software_entry() == NULL) |
| r20749 | r20750 | |
| 660 | 662 | return IMAGE_INIT_FAIL; |
| 661 | 663 | } |
| 662 | 664 | |
| 663 | if (image.fread( | |
| 665 | if (image.fread( machine().root_device().memregion("cart")->base(), filesize) != filesize) | |
| 664 | 666 | { |
| 665 | 667 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Error loading file"); |
| 666 | 668 | return IMAGE_INIT_FAIL; |
| r20749 | r20750 | |
| 669 | 671 | else |
| 670 | 672 | { |
| 671 | 673 | filesize = image.get_software_region_length("rom"); |
| 672 | memcpy( | |
| 674 | memcpy(machine().root_device().memregion("cart")->base(), image.get_software_region("rom"), filesize); | |
| 673 | 675 | } |
| 674 | 676 | |
| 675 | 677 | //printf("%2x%2x - %x - %x\n", (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x20), (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x21), |
| 676 | 678 | // (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x22), (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x23)); |
| 677 | | |
| 679 | m_flash_chip[0].manufacturer_id = 0x98; | |
| 678 | 680 | switch( filesize ) |
| 679 | 681 | { |
| 680 | 682 | case 0x8000: |
| 681 | 683 | case 0x80000: |
| 682 | | |
| 684 | m_flash_chip[0].device_id = 0xab; | |
| 683 | 685 | break; |
| 684 | 686 | case 0x100000: |
| 685 | | |
| 687 | m_flash_chip[0].device_id = 0x2c; | |
| 686 | 688 | break; |
| 687 | 689 | case 0x200000: |
| 688 | | |
| 690 | m_flash_chip[0].device_id = 0x2f; | |
| 689 | 691 | break; |
| 690 | 692 | case 0x400000: |
| 691 | state->m_flash_chip[0].device_id = 0x2f; | |
| 692 | state->m_flash_chip[1].manufacturer_id = 0x98; | |
| 693 | state->m_flash_chip[1].device_id = 0x2f; | |
| 694 | state->m_flash_chip[1].present = 0; | |
| 695 | state->m_flash_chip[1].state = F_READ; | |
| 693 | m_flash_chip[0].device_id = 0x2f; | |
| 694 | m_flash_chip[1].manufacturer_id = 0x98; | |
| 695 | m_flash_chip[1].device_id = 0x2f; | |
| 696 | m_flash_chip[1].present = 0; | |
| 697 | m_flash_chip[1].state = F_READ; | |
| 696 | 698 | break; |
| 697 | 699 | } |
| 698 | 700 | |
| 699 | state->m_flash_chip[0].org_data[0] = state->m_flash_chip[0].data[0]; | |
| 700 | state->m_flash_chip[0].org_data[1] = state->m_flash_chip[0].data[1]; | |
| 701 | state->m_flash_chip[0].org_data[2] = state->m_flash_chip[0].data[2]; | |
| 702 | state->m_flash_chip[0].org_data[3] = state->m_flash_chip[0].data[3]; | |
| 703 | state->m_flash_chip[0].org_data[4] = state->m_flash_chip[0].data[0x7c000]; | |
| 704 | state->m_flash_chip[0].org_data[5] = state->m_flash_chip[0].data[0x7c001]; | |
| 705 | state->m_flash_chip[0].org_data[6] = state->m_flash_chip[0].data[0x7c002]; | |
| 706 | state->m_flash_chip[0].org_data[7] = state->m_flash_chip[0].data[0x7c003]; | |
| 707 | state->m_flash_chip[0].org_data[8] = state->m_flash_chip[0].data[0xfc000]; | |
| 708 | state->m_flash_chip[0].org_data[9] = state->m_flash_chip[0].data[0xfc001]; | |
| 709 | state->m_flash_chip[0].org_data[10] = state->m_flash_chip[0].data[0xfc002]; | |
| 710 | state->m_flash_chip[0].org_data[11] = state->m_flash_chip[0].data[0xfc003]; | |
| 711 | state->m_flash_chip[0].org_data[12] = state->m_flash_chip[0].data[0x1fc000]; | |
| 712 | state->m_flash_chip[0].org_data[13] = state->m_flash_chip[0].data[0x1fc001]; | |
| 713 | state->m_flash_chip[0].org_data[14] = state->m_flash_chip[0].data[0x1fc002]; | |
| 714 | state->m_flash_chip[0].org_data[15] = state->m_flash_chip[0].data[0x1fc003]; | |
| 701 | m_flash_chip[0].org_data[0] = m_flash_chip[0].data[0]; | |
| 702 | m_flash_chip[0].org_data[1] = m_flash_chip[0].data[1]; | |
| 703 | m_flash_chip[0].org_data[2] = m_flash_chip[0].data[2]; | |
| 704 | m_flash_chip[0].org_data[3] = m_flash_chip[0].data[3]; | |
| 705 | m_flash_chip[0].org_data[4] = m_flash_chip[0].data[0x7c000]; | |
| 706 | m_flash_chip[0].org_data[5] = m_flash_chip[0].data[0x7c001]; | |
| 707 | m_flash_chip[0].org_data[6] = m_flash_chip[0].data[0x7c002]; | |
| 708 | m_flash_chip[0].org_data[7] = m_flash_chip[0].data[0x7c003]; | |
| 709 | m_flash_chip[0].org_data[8] = m_flash_chip[0].data[0xfc000]; | |
| 710 | m_flash_chip[0].org_data[9] = m_flash_chip[0].data[0xfc001]; | |
| 711 | m_flash_chip[0].org_data[10] = m_flash_chip[0].data[0xfc002]; | |
| 712 | m_flash_chip[0].org_data[11] = m_flash_chip[0].data[0xfc003]; | |
| 713 | m_flash_chip[0].org_data[12] = m_flash_chip[0].data[0x1fc000]; | |
| 714 | m_flash_chip[0].org_data[13] = m_flash_chip[0].data[0x1fc001]; | |
| 715 | m_flash_chip[0].org_data[14] = m_flash_chip[0].data[0x1fc002]; | |
| 716 | m_flash_chip[0].org_data[15] = m_flash_chip[0].data[0x1fc003]; | |
| 715 | 717 | |
| 716 | state->m_flash_chip[1].org_data[0] = state->m_flash_chip[1].data[0]; | |
| 717 | state->m_flash_chip[1].org_data[1] = state->m_flash_chip[1].data[1]; | |
| 718 | state->m_flash_chip[1].org_data[2] = state->m_flash_chip[1].data[2]; | |
| 719 | state->m_flash_chip[1].org_data[3] = state->m_flash_chip[1].data[3]; | |
| 720 | state->m_flash_chip[1].org_data[4] = state->m_flash_chip[1].data[0x7c000]; | |
| 721 | state->m_flash_chip[1].org_data[5] = state->m_flash_chip[1].data[0x7c001]; | |
| 722 | state->m_flash_chip[1].org_data[6] = state->m_flash_chip[1].data[0x7c002]; | |
| 723 | state->m_flash_chip[1].org_data[7] = state->m_flash_chip[1].data[0x7c003]; | |
| 724 | state->m_flash_chip[1].org_data[8] = state->m_flash_chip[1].data[0xfc000]; | |
| 725 | state->m_flash_chip[1].org_data[9] = state->m_flash_chip[1].data[0xfc001]; | |
| 726 | state->m_flash_chip[1].org_data[10] = state->m_flash_chip[1].data[0xfc002]; | |
| 727 | state->m_flash_chip[1].org_data[11] = state->m_flash_chip[1].data[0xfc003]; | |
| 728 | state->m_flash_chip[1].org_data[12] = state->m_flash_chip[1].data[0x1fc000]; | |
| 729 | state->m_flash_chip[1].org_data[13] = state->m_flash_chip[1].data[0x1fc001]; | |
| 730 | state->m_flash_chip[1].org_data[14] = state->m_flash_chip[1].data[0x1fc002]; | |
| 731 | state->m_flash_chip[1].org_data[15] = state->m_flash_chip[1].data[0x1fc003]; | |
| 718 | m_flash_chip[1].org_data[0] = m_flash_chip[1].data[0]; | |
| 719 | m_flash_chip[1].org_data[1] = m_flash_chip[1].data[1]; | |
| 720 | m_flash_chip[1].org_data[2] = m_flash_chip[1].data[2]; | |
| 721 | m_flash_chip[1].org_data[3] = m_flash_chip[1].data[3]; | |
| 722 | m_flash_chip[1].org_data[4] = m_flash_chip[1].data[0x7c000]; | |
| 723 | m_flash_chip[1].org_data[5] = m_flash_chip[1].data[0x7c001]; | |
| 724 | m_flash_chip[1].org_data[6] = m_flash_chip[1].data[0x7c002]; | |
| 725 | m_flash_chip[1].org_data[7] = m_flash_chip[1].data[0x7c003]; | |
| 726 | m_flash_chip[1].org_data[8] = m_flash_chip[1].data[0xfc000]; | |
| 727 | m_flash_chip[1].org_data[9] = m_flash_chip[1].data[0xfc001]; | |
| 728 | m_flash_chip[1].org_data[10] = m_flash_chip[1].data[0xfc002]; | |
| 729 | m_flash_chip[1].org_data[11] = m_flash_chip[1].data[0xfc003]; | |
| 730 | m_flash_chip[1].org_data[12] = m_flash_chip[1].data[0x1fc000]; | |
| 731 | m_flash_chip[1].org_data[13] = m_flash_chip[1].data[0x1fc001]; | |
| 732 | m_flash_chip[1].org_data[14] = m_flash_chip[1].data[0x1fc002]; | |
| 733 | m_flash_chip[1].org_data[15] = m_flash_chip[1].data[0x1fc003]; | |
| 732 | 734 | |
| 733 | state->m_flash_chip[0].present = 1; | |
| 734 | state->m_flash_chip[0].state = F_READ; | |
| 735 | m_flash_chip[0].present = 1; | |
| 736 | m_flash_chip[0].state = F_READ; | |
| 735 | 737 | |
| 736 | 738 | return IMAGE_INIT_PASS; |
| 737 | 739 | } |
| 738 | 740 | |
| 739 | 741 | |
| 740 | ||
| 742 | DEVICE_IMAGE_UNLOAD_MEMBER( ngp_state, ngp_cart ) | |
| 741 | 743 | { |
| 742 | ngp_state *state = image.device().machine().driver_data<ngp_state>(); | |
| 744 | m_flash_chip[0].present = 0; | |
| 745 | m_flash_chip[0].state = F_READ; | |
| 743 | 746 | |
| 744 | state->m_flash_chip[0].present = 0; | |
| 745 | state->m_flash_chip[0].state = F_READ; | |
| 746 | ||
| 747 | state->m_flash_chip[1].present = 0; | |
| 748 | state->m_flash_chip[1].state = F_READ; | |
| 747 | m_flash_chip[1].present = 0; | |
| 748 | m_flash_chip[1].state = F_READ; | |
| 749 | 749 | } |
| 750 | 750 | |
| 751 | 751 | |
| r20749 | r20750 | |
| 805 | 805 | MCFG_CARTSLOT_ADD("cart") |
| 806 | 806 | MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc") |
| 807 | 807 | MCFG_CARTSLOT_NOT_MANDATORY |
| 808 | MCFG_CARTSLOT_START(ngp_cart) | |
| 809 | MCFG_CARTSLOT_LOAD(ngp_cart) | |
| 808 | MCFG_CARTSLOT_START(ngp_state, ngp_cart) | |
| 809 | MCFG_CARTSLOT_LOAD(ngp_state, ngp_cart) | |
| 810 | 810 | MCFG_CARTSLOT_INTERFACE("ngp_cart") |
| 811 | MCFG_CARTSLOT_UNLOAD(ngp_cart) | |
| 811 | MCFG_CARTSLOT_UNLOAD(ngp_state, ngp_cart) | |
| 812 | 812 | |
| 813 | 813 | /* software lists */ |
| 814 | 814 | MCFG_SOFTWARE_LIST_ADD("cart_list","ngp") |
| r20749 | r20750 | |
| 826 | 826 | MCFG_CARTSLOT_ADD("cart") |
| 827 | 827 | MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc") |
| 828 | 828 | MCFG_CARTSLOT_NOT_MANDATORY |
| 829 | MCFG_CARTSLOT_START(ngp_cart) | |
| 830 | MCFG_CARTSLOT_LOAD(ngp_cart) | |
| 829 | MCFG_CARTSLOT_START(ngp_state,ngp_cart) | |
| 830 | MCFG_CARTSLOT_LOAD(ngp_state,ngp_cart) | |
| 831 | 831 | MCFG_CARTSLOT_INTERFACE("ngp_cart") |
| 832 | MCFG_CARTSLOT_UNLOAD(ngp_cart) | |
| 832 | MCFG_CARTSLOT_UNLOAD(ngp_state,ngp_cart) | |
| 833 | 833 | |
| 834 | 834 | /* software lists */ |
| 835 | 835 | MCFG_SOFTWARE_LIST_ADD("cart_list","ngpc") |
| r20749 | r20750 | |
|---|---|---|
| 474 | 474 | MCFG_CARTSLOT_EXTENSION_LIST("nes,unf") |
| 475 | 475 | MCFG_CARTSLOT_MANDATORY |
| 476 | 476 | MCFG_CARTSLOT_INTERFACE("nes_cart") |
| 477 | MCFG_CARTSLOT_LOAD(nes_cart) | |
| 477 | MCFG_CARTSLOT_LOAD(nes_state,nes_cart) | |
| 478 | 478 | MCFG_CARTSLOT_PARTIALHASH(nes_partialhash) |
| 479 | 479 | MCFG_SOFTWARE_LIST_ADD("cart_list","nes") |
| 480 | 480 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
| 526 | 526 | MCFG_CARTSLOT_MODIFY("cart") |
| 527 | 527 | MCFG_CARTSLOT_EXTENSION_LIST("nes,unf") |
| 528 | 528 | MCFG_CARTSLOT_NOT_MANDATORY |
| 529 | MCFG_CARTSLOT_LOAD(nes_cart) | |
| 529 | MCFG_CARTSLOT_LOAD(nes_state,nes_cart) | |
| 530 | 530 | MCFG_CARTSLOT_PARTIALHASH(nes_partialhash) |
| 531 | 531 | |
| 532 | 532 | MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, nes_floppy_interface) |
| r20749 | r20750 | |
|---|---|---|
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | |
| 611 | DEVICE_IMAGE_LOAD_MEMBER( spectrum_state, timex_cart ) | |
| 612 | { | |
| 613 | return device_load_timex_cart( image ); | |
| 614 | } | |
| 615 | ||
| 616 | ||
| 617 | DEVICE_IMAGE_UNLOAD_MEMBER( spectrum_state, timex_cart ) | |
| 618 | { | |
| 619 | device_unload_timex_cart( image ); | |
| 620 | } | |
| 621 | ||
| 622 | ||
| 611 | 623 | /* F4 Character Displayer - tc2048 code is inherited from the spectrum */ |
| 612 | 624 | static const gfx_layout ts2068_charlayout = |
| 613 | 625 | { |
| r20749 | r20750 | |
| 653 | 665 | MCFG_CARTSLOT_MODIFY("cart") |
| 654 | 666 | MCFG_CARTSLOT_EXTENSION_LIST("dck") |
| 655 | 667 | MCFG_CARTSLOT_NOT_MANDATORY |
| 656 | MCFG_CARTSLOT_LOAD(timex_cart) | |
| 657 | MCFG_CARTSLOT_UNLOAD(timex_cart) | |
| 668 | MCFG_CARTSLOT_LOAD(spectrum_state,timex_cart) | |
| 669 | MCFG_CARTSLOT_UNLOAD(spectrum_state,timex_cart) | |
| 658 | 670 | |
| 659 | 671 | /* internal ram */ |
| 660 | 672 | MCFG_RAM_MODIFY(RAM_TAG) |
| r20749 | r20750 | |
|---|---|---|
| 45 | 45 | static const UPD7810_CONFIG gamepock_cpu_config = { TYPE_78C06, gamepock_io_callback }; |
| 46 | 46 | |
| 47 | 47 | |
| 48 | ||
| 48 | DEVICE_IMAGE_START_MEMBER(gamepock_state,gamepock_cart) | |
| 49 | 49 | { |
| 50 | gamepock_state *state = device->machine().driver_data<gamepock_state>(); | |
| 51 | state->membank( "bank1" )->set_base( state->memregion("user1" )->base() ); | |
| 50 | membank( "bank1" )->set_base( memregion("user1" )->base() ); | |
| 52 | 51 | } |
| 53 | 52 | |
| 54 | 53 | |
| 55 | static DEVICE_IMAGE_LOAD(gamepock_cart) { | |
| 56 | gamepock_state *state = image.device().machine().driver_data<gamepock_state>(); | |
| 57 | UINT8 *cart = state->memregion("user1" )->base(); | |
| 54 | DEVICE_IMAGE_LOAD_MEMBER(gamepock_state,gamepock_cart) { | |
| 55 | UINT8 *cart = memregion("user1" )->base(); | |
| 58 | 56 | |
| 59 | 57 | if ( image.software_entry() == NULL ) |
| 60 | 58 | { |
| r20749 | r20750 | |
| 69 | 67 | cart = image.get_software_region( "rom" ); |
| 70 | 68 | } |
| 71 | 69 | |
| 72 | | |
| 70 | membank( "bank1" )->set_base( cart ); | |
| 73 | 71 | |
| 74 | 72 | return IMAGE_INIT_PASS; |
| 75 | 73 | } |
| r20749 | r20750 | |
| 102 | 100 | MCFG_CARTSLOT_INTERFACE("gamepock_cart") |
| 103 | 101 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 104 | 102 | MCFG_CARTSLOT_NOT_MANDATORY |
| 105 | MCFG_CARTSLOT_START(gamepock_cart) | |
| 106 | MCFG_CARTSLOT_LOAD(gamepock_cart) | |
| 103 | MCFG_CARTSLOT_START(gamepock_state,gamepock_cart) | |
| 104 | MCFG_CARTSLOT_LOAD(gamepock_state,gamepock_cart) | |
| 107 | 105 | |
| 108 | 106 | /* Software lists */ |
| 109 | 107 | MCFG_SOFTWARE_LIST_ADD("cart_list","gamepock") |
| r20749 | r20750 | |
|---|---|---|
| 1528 | 1528 | MCFG_MACHINE_RESET_OVERRIDE(ng_aes_state, neogeo) |
| 1529 | 1529 | |
| 1530 | 1530 | MCFG_CARTSLOT_ADD("cart") |
| 1531 | MCFG_CARTSLOT_LOAD(neo_cartridge) | |
| 1531 | MCFG_CARTSLOT_LOAD(ng_aes_state,neo_cartridge) | |
| 1532 | 1532 | MCFG_CARTSLOT_INTERFACE("neo_cart") |
| 1533 | 1533 | MCFG_CARTSLOT_MANDATORY |
| 1534 | 1534 |
| r20749 | r20750 | |
|---|---|---|
| 24 | 24 | virtual void machine_reset(); |
| 25 | 25 | UINT32 screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 26 | 26 | DECLARE_INPUT_CHANGED_MEMBER(panel_check); |
| 27 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(ssem_store); | |
| 27 | 28 | }; |
| 28 | 29 | |
| 29 | 30 | |
| r20749 | r20750 | |
| 514 | 515 | * Image loading * |
| 515 | 516 | \****************************************************/ |
| 516 | 517 | |
| 517 | ||
| 518 | DEVICE_IMAGE_LOAD_MEMBER(ssem_state,ssem_store) | |
| 518 | 519 | { |
| 519 | 520 | ssem_state *state = image.device().machine().driver_data<ssem_state>(); |
| 520 | 521 | const char* image_name = image.filename(); |
| r20749 | r20750 | |
| 650 | 651 | /* cartridge */ |
| 651 | 652 | MCFG_CARTSLOT_ADD("cart") |
| 652 | 653 | MCFG_CARTSLOT_EXTENSION_LIST("snp,asm") |
| 653 | MCFG_CARTSLOT_LOAD(ssem_store) | |
| 654 | MCFG_CARTSLOT_LOAD(ssem_state,ssem_store) | |
| 654 | 655 | MACHINE_CONFIG_END |
| 655 | 656 | |
| 656 | 657 | ROM_START( ssem ) |
| r20749 | r20750 | |
|---|---|---|
| 299 | 299 | MCFG_CARTSLOT_EXTENSION_LIST("rom") |
| 300 | 300 | MCFG_CARTSLOT_NOT_MANDATORY |
| 301 | 301 | MCFG_CARTSLOT_INTERFACE("svi318_cart") |
| 302 | MCFG_CARTSLOT_START(svi318_cart) | |
| 303 | MCFG_CARTSLOT_LOAD(svi318_cart) | |
| 304 | MCFG_CARTSLOT_UNLOAD(svi318_cart) | |
| 302 | MCFG_CARTSLOT_START(svi318_state,svi318_cart) | |
| 303 | MCFG_CARTSLOT_LOAD(svi318_state,svi318_cart) | |
| 304 | MCFG_CARTSLOT_UNLOAD(svi318_state,svi318_cart) | |
| 305 | 305 | |
| 306 | 306 | /* Software lists */ |
| 307 | 307 | MCFG_SOFTWARE_LIST_ADD("cart_list","svi318_cart") |
| r20749 | r20750 | |
|---|---|---|
| 218 | 218 | TIMER_DEVICE_CALLBACK_MEMBER(vboy_scanlineL); |
| 219 | 219 | TIMER_DEVICE_CALLBACK_MEMBER(vboy_scanlineR); |
| 220 | 220 | void vboy_machine_stop(); |
| 221 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(vboy_cart); | |
| 221 | 222 | }; |
| 222 | 223 | |
| 223 | 224 | |
| r20749 | r20750 | |
| 1346 | 1347 | } |
| 1347 | 1348 | |
| 1348 | 1349 | |
| 1349 | ||
| 1350 | DEVICE_IMAGE_LOAD_MEMBER( vboy_state, vboy_cart ) | |
| 1350 | 1351 | { |
| 1351 | 1352 | vboy_state *state = image.device().machine().driver_data<vboy_state>(); |
| 1352 | 1353 | UINT32 chip = 0; |
| r20749 | r20750 | |
| 1422 | 1423 | MCFG_CARTSLOT_EXTENSION_LIST("vb,bin") |
| 1423 | 1424 | MCFG_CARTSLOT_MANDATORY |
| 1424 | 1425 | MCFG_CARTSLOT_INTERFACE("vboy_cart") |
| 1425 | MCFG_CARTSLOT_LOAD(vboy_cart) | |
| 1426 | MCFG_CARTSLOT_LOAD(vboy_state, vboy_cart) | |
| 1426 | 1427 | |
| 1427 | 1428 | /* software lists */ |
| 1428 | 1429 | MCFG_SOFTWARE_LIST_ADD("cart_list","vboy") |
| r20749 | r20750 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | *********************************************************************/ |
| 66 | 66 | |
| 67 | DEVICE_IMAGE_LOAD(vectrex_cart) | |
| 67 | DEVICE_IMAGE_LOAD_MEMBER(vectrex_state,vectrex_cart) | |
| 68 | 68 | { |
| 69 | 69 | vectrex_state *state = image.device().machine().driver_data<vectrex_state>(); |
| 70 | 70 | UINT8 *mem = state->memregion("maincpu")->base(); |
| r20749 | r20750 | |
|---|---|---|
| 1271 | 1271 | |
| 1272 | 1272 | // FIXME: non-softlist loading should keep using ROM_CART_LOAD in the ROM definitions, |
| 1273 | 1273 | // once we better integrate softlist with the old loading procedures |
| 1274 | ||
| 1274 | DEVICE_IMAGE_LOAD_MEMBER( md_base_state, _32x_cart ) | |
| 1275 | 1275 | { |
| 1276 | 1276 | UINT32 length; |
| 1277 | 1277 | UINT8 *temp_copy; |
| r20749 | r20750 | |
| 1317 | 1317 | MCFG_CARTSLOT_EXTENSION_LIST("32x,bin") |
| 1318 | 1318 | MCFG_CARTSLOT_MANDATORY |
| 1319 | 1319 | MCFG_CARTSLOT_INTERFACE("_32x_cart") |
| 1320 | MCFG_CARTSLOT_LOAD(_32x_cart) | |
| 1320 | MCFG_CARTSLOT_LOAD(md_base_state, _32x_cart) | |
| 1321 | 1321 | MCFG_SOFTWARE_LIST_ADD("cart_list","32x") |
| 1322 | 1322 | MACHINE_CONFIG_END |
| 1323 | 1323 |
| r20749 | r20750 | |
|---|---|---|
| 231 | 231 | TIMER_CALLBACK_MEMBER(vblank_interrupt_callback); |
| 232 | 232 | TIMER_CALLBACK_MEMBER(auto_animation_timer_callback); |
| 233 | 233 | TIMER_CALLBACK_MEMBER(sprite_line_timer_callback); |
| 234 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(neo_cartridge); | |
| 234 | 235 | void neogeo_postload(); |
| 235 | 236 | void regenerate_pens(); |
| 236 | 237 | |
| r20749 | r20750 | |
| 254 | 255 | void neogeo_set_display_counter_lsb(address_space &space, UINT16 data); |
| 255 | 256 | void neogeo_acknowledge_interrupt(running_machine &machine, UINT16 data); |
| 256 | 257 | void neogeo_set_main_cpu_bank_address(address_space &space, UINT32 bank_address); |
| 257 | DEVICE_IMAGE_LOAD( neo_cartridge ); | |
| 258 | 258 | void neogeo_audio_cpu_banking_init( running_machine &machine ); |
| 259 | 259 | void neogeo_main_cpu_banking_init( running_machine &machine ); |
| 260 | 260 | void neogeo_set_main_cpu_vector_table_source( running_machine &machine, UINT8 data ); |
| r20749 | r20750 | |
|---|---|---|
| 247 | 247 | DECLARE_READ8_MEMBER( saturn_SMPC_r ); |
| 248 | 248 | DECLARE_WRITE8_MEMBER( saturn_SMPC_w ); |
| 249 | 249 | |
| 250 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( sat_cart ); | |
| 251 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( stv_cart ); | |
| 250 | 252 | }; |
| 251 | 253 | |
| 252 | 254 | #define MASTER_CLOCK_352 57272720 |
| r20749 | r20750 | |
|---|---|---|
| 111 | 111 | DECLARE_WRITE8_MEMBER(megadriv_68k_YM2612_write); |
| 112 | 112 | IRQ_CALLBACK_MEMBER(genesis_int_callback); |
| 113 | 113 | void megadriv_init_common(); |
| 114 | ||
| 115 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( _32x_cart ); | |
| 114 | 116 | }; |
| 115 | 117 | |
| 116 | 118 | class md_boot_state : public md_base_state |
| r20749 | r20750 | |
| 335 | 337 | |
| 336 | 338 | int m_cart_is_genesis[8]; |
| 337 | 339 | |
| 340 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( megatech_cart ); | |
| 341 | ||
| 338 | 342 | /* Megatech BIOS specific */ |
| 339 | 343 | UINT8* m_megatech_banked_ram; |
| 340 | 344 | DECLARE_DRIVER_INIT(mt_crt); |
| r20749 | r20750 | |
|---|---|---|
| 552 | 552 | TIMER_CALLBACK_MEMBER(snes_scanline_tick); |
| 553 | 553 | TIMER_CALLBACK_MEMBER(snes_hblank_tick); |
| 554 | 554 | DECLARE_WRITE_LINE_MEMBER(snes_extern_irq_w); |
| 555 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(snes_cart); | |
| 556 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(sufami_cart); | |
| 557 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(bsx_cart); | |
| 558 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER(bsx2slot_cart); | |
| 555 | 559 | }; |
| 556 | 560 | |
| 557 | 561 | /* Special chips, checked at init and used in memory handlers */ |
| r20749 | r20750 | |
|---|---|---|
| 84 | 84 | DECLARE_WRITE8_MEMBER(v_via_pa_w); |
| 85 | 85 | DECLARE_WRITE8_MEMBER(v_via_ca2_w); |
| 86 | 86 | DECLARE_WRITE8_MEMBER(v_via_cb2_w); |
| 87 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( vectrex_cart ); | |
| 87 | 88 | }; |
| 88 | 89 | |
| 89 | 90 | |
| 90 | 91 | /*----------- defined in machine/vectrex.c -----------*/ |
| 91 | 92 | |
| 92 | DEVICE_IMAGE_LOAD( vectrex_cart ); | |
| 93 | 93 | void vectrex_configuration(running_machine &machine); |
| 94 | 94 | void vectrex_via_irq (device_t *device, int level); |
| 95 | 95 |
| r20749 | r20750 | |
|---|---|---|
| 215 | 215 | void cart_start(); |
| 216 | 216 | int cart_load(device_image_interface &image); |
| 217 | 217 | IRQ_CALLBACK_MEMBER(jaguar_irq_callback); |
| 218 | DECLARE_DEVICE_IMAGE_START_MEMBER( jaguar_cart ); | |
| 219 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( jaguar_cart ); | |
| 218 | 220 | protected: |
| 219 | 221 | // timer IDs |
| 220 | 222 | enum |
| r20749 | r20750 | |
|---|---|---|
| 566 | 566 | { 0 } |
| 567 | 567 | }; |
| 568 | 568 | |
| 569 | ||
| 569 | DEVICE_IMAGE_LOAD_MEMBER( mtech_state, megatech_cart ) | |
| 570 | 570 | { |
| 571 | 571 | mtech_state *state = image.device().machine().driver_data<mtech_state>(); |
| 572 | 572 | const struct megatech_cart_region *mt_cart = &megatech_cart_table[0], *this_cart; |
| r20749 | r20750 | |
| 620 | 620 | #define MCFG_MEGATECH_CARTSLOT_ADD(_tag) \ |
| 621 | 621 | MCFG_CARTSLOT_ADD(_tag) \ |
| 622 | 622 | MCFG_CARTSLOT_INTERFACE("megatech_cart") \ |
| 623 | MCFG_CARTSLOT_LOAD(megatech_cart) | |
| 623 | MCFG_CARTSLOT_LOAD(mtech_state, megatech_cart) | |
| 624 | 624 | |
| 625 | 625 | MACHINE_CONFIG_FRAGMENT( megatech_cartslot ) |
| 626 | 626 | MCFG_MEGATECH_CARTSLOT_ADD("cart1") |
| r20749 | r20750 | |
|---|---|---|
| 2161 | 2161 | |
| 2162 | 2162 | |
| 2163 | 2163 | |
| 2164 | ||
| 2164 | DEVICE_IMAGE_LOAD_MEMBER( saturn_state, sat_cart ) | |
| 2165 | 2165 | { |
| 2166 | 2166 | UINT8 *ROM = image.device().machine().root_device().memregion("maincpu")->base()+0x080000; |
| 2167 | 2167 | UINT32 length; |
| r20749 | r20750 | |
| 2245 | 2245 | |
| 2246 | 2246 | MCFG_CARTSLOT_ADD("cart") |
| 2247 | 2247 | MCFG_CARTSLOT_INTERFACE("sat_cart") |
| 2248 | MCFG_CARTSLOT_LOAD(sat_cart) | |
| 2248 | MCFG_CARTSLOT_LOAD(saturn_state, sat_cart) | |
| 2249 | 2249 | MCFG_SOFTWARE_LIST_ADD("cart_list","sat_cart") |
| 2250 | 2250 | |
| 2251 | 2251 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
| 2257 | 2257 | |
| 2258 | 2258 | MCFG_CARTSLOT_ADD("cart") |
| 2259 | 2259 | MCFG_CARTSLOT_INTERFACE("sat_cart") |
| 2260 | MCFG_CARTSLOT_LOAD(sat_cart) | |
| 2260 | MCFG_CARTSLOT_LOAD(saturn_state, sat_cart) | |
| 2261 | 2261 | MCFG_SOFTWARE_LIST_ADD("cart_list","sat_cart") |
| 2262 | 2262 | |
| 2263 | 2263 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
| 2269 | 2269 | |
| 2270 | 2270 | MCFG_CARTSLOT_ADD("cart") |
| 2271 | 2271 | MCFG_CARTSLOT_INTERFACE("sat_cart") |
| 2272 | MCFG_CARTSLOT_LOAD(sat_cart) | |
| 2272 | MCFG_CARTSLOT_LOAD(saturn_state, sat_cart) | |
| 2273 | 2273 | MCFG_SOFTWARE_LIST_ADD("cart_list","sat_cart") |
| 2274 | 2274 | |
| 2275 | 2275 | MACHINE_CONFIG_END |
| r20749 | r20750 | |
| 2338 | 2338 | { 0 } |
| 2339 | 2339 | }; |
| 2340 | 2340 | |
| 2341 | ||
| 2341 | DEVICE_IMAGE_LOAD_MEMBER( saturn_state, stv_cart ) | |
| 2342 | 2342 | { |
| 2343 | 2343 | // saturn_state *state = image.device().machine().driver_data<saturn_state>(); |
| 2344 | 2344 | const struct stv_cart_region *stv_cart = &stv_cart_table[0], *this_cart; |
| r20749 | r20750 | |
| 2391 | 2391 | #define MCFG_STV_CARTSLOT_ADD(_tag) \ |
| 2392 | 2392 | MCFG_CARTSLOT_ADD(_tag) \ |
| 2393 | 2393 | MCFG_CARTSLOT_INTERFACE("stv_cart") \ |
| 2394 | MCFG_CARTSLOT_LOAD(stv_cart) | |
| 2394 | MCFG_CARTSLOT_LOAD(saturn_state,stv_cart) | |
| 2395 | 2395 | |
| 2396 | 2396 | MACHINE_CONFIG_FRAGMENT( stv_cartslot ) |
| 2397 | 2397 | MCFG_STV_CARTSLOT_ADD("cart1") |
| r20749 | r20750 | |
|---|---|---|
| 124 | 124 | MCFG_CARTSLOT_ADD("cart") |
| 125 | 125 | MCFG_CARTSLOT_EXTENSION_LIST("bin,gam,vec") |
| 126 | 126 | MCFG_CARTSLOT_NOT_MANDATORY |
| 127 | MCFG_CARTSLOT_LOAD(vectrex_cart) | |
| 127 | MCFG_CARTSLOT_LOAD(vectrex_state,vectrex_cart) | |
| 128 | 128 | MCFG_CARTSLOT_INTERFACE("vectrex_cart") |
| 129 | 129 | |
| 130 | 130 | /* software lists */ |
| r20749 | r20750 | |
|---|---|---|
| 348 | 348 | #define M68K_CLOCK XTAL_50MHz |
| 349 | 349 | |
| 350 | 350 | static QUICKLOAD_LOAD( jaguar ); |
| 351 | static DEVICE_START( jaguar_cart ); | |
| 352 | static DEVICE_IMAGE_LOAD( jaguar ); | |
| 353 | 351 | |
| 354 | 352 | |
| 355 | ||
| 356 | 353 | /************************************* |
| 357 | 354 | * |
| 358 | 355 | * Local variables |
| r20749 | r20750 | |
| 1644 | 1641 | MCFG_CARTSLOT_ADD("cart") |
| 1645 | 1642 | MCFG_CARTSLOT_EXTENSION_LIST("j64,rom") |
| 1646 | 1643 | MCFG_CARTSLOT_INTERFACE("jaguar_cart") |
| 1647 | MCFG_CARTSLOT_START(jaguar_cart) | |
| 1648 | MCFG_CARTSLOT_LOAD(jaguar) | |
| 1644 | MCFG_CARTSLOT_START(jaguar_state,jaguar_cart) | |
| 1645 | MCFG_CARTSLOT_LOAD(jaguar_state,jaguar_cart) | |
| 1649 | 1646 | |
| 1650 | 1647 | /* software lists */ |
| 1651 | 1648 | MCFG_SOFTWARE_LIST_ADD("cart_list","jaguar") |
| r20749 | r20750 | |
| 1770 | 1767 | return IMAGE_INIT_PASS; |
| 1771 | 1768 | } |
| 1772 | 1769 | |
| 1773 | ||
| 1770 | DEVICE_IMAGE_START_MEMBER( jaguar_state, jaguar_cart ) | |
| 1774 | 1771 | { |
| 1775 | | |
| 1772 | cart_start(); | |
| 1776 | 1773 | } |
| 1777 | 1774 | |
| 1778 | 1775 | void jaguar_state::cart_start() |
| r20749 | r20750 | |
| 1782 | 1779 | memset( m_cart_base, 0, memshare("cart")->bytes() ); |
| 1783 | 1780 | } |
| 1784 | 1781 | |
| 1785 | ||
| 1782 | DEVICE_IMAGE_LOAD_MEMBER( jaguar_state, jaguar_cart ) | |
| 1786 | 1783 | { |
| 1787 | return | |
| 1784 | return cart_load(image); | |
| 1788 | 1785 | } |
| 1789 | 1786 | |
| 1790 | 1787 | int jaguar_state::cart_load(device_image_interface &image) |
| r20749 | r20750 | |
|---|---|---|
| 1316 | 1316 | |
| 1317 | 1317 | |
| 1318 | 1318 | |
| 1319 | DEVICE_IMAGE_LOAD( neo_cartridge ) | |
| 1319 | DEVICE_IMAGE_LOAD_MEMBER( neogeo_state, neo_cartridge ) | |
| 1320 | 1320 | { |
| 1321 | 1321 | UINT32 size; |
| 1322 | 1322 | device_t* ym = image.device().machine().device("ymsnd"); |
| r20749 | r20750 | |
| 1440 | 1440 | |
| 1441 | 1441 | static MACHINE_CONFIG_DERIVED( mvs, neogeo ) |
| 1442 | 1442 | MCFG_CARTSLOT_ADD("cart") |
| 1443 | MCFG_CARTSLOT_LOAD(neo_cartridge) | |
| 1443 | MCFG_CARTSLOT_LOAD(neogeo_state,neo_cartridge) | |
| 1444 | 1444 | MCFG_CARTSLOT_INTERFACE("neo_cart") |
| 1445 | 1445 | |
| 1446 | 1446 | MCFG_SOFTWARE_LIST_ADD("cart_list","neogeo") |
| Previous | 199869 Revisions | Next |