src/mess/devices/harddriv.c
| r2172 | r2173 | |
| 94 | 94 | * |
| 95 | 95 | *************************************/ |
| 96 | 96 | |
| 97 | | DEVICE_INIT( mess_hd ) |
| 97 | DEVICE_START( mess_hd ) |
| 98 | 98 | { |
| 99 | 99 | struct mess_hd *hd; |
| 100 | | |
| 101 | | hd = image_alloctag(image, MESSHDTAG, sizeof(struct mess_hd)); |
| 102 | | if (!hd) |
| 103 | | return INIT_FAIL; |
| 104 | | |
| 100 | hd = image_alloctag(device, MESSHDTAG, sizeof(struct mess_hd)); |
| 105 | 101 | hd->hard_disk_handle = NULL; |
| 106 | | |
| 107 | | return INIT_PASS; |
| 108 | 102 | } |
| 109 | 103 | |
| 110 | 104 | |
| r2172 | r2173 | |
| 283 | 277 | case MESS_DEVINFO_INT_CREATE_OPTCOUNT: info->i = 1; break; |
| 284 | 278 | |
| 285 | 279 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 286 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_mess_hd; break; |
| 280 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(mess_hd); break; |
| 287 | 281 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_mess_hd; break; |
| 288 | 282 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_mess_hd; break; |
| 289 | 283 | case MESS_DEVINFO_PTR_CREATE_OPTGUIDE: info->p = (void *) mess_hd_option_guide; break; |
src/mess/devices/cassette.c
| r2172 | r2173 | |
| 229 | 229 | cassette device init/load/unload/specify |
| 230 | 230 | *********************************************************************/ |
| 231 | 231 | |
| 232 | | static DEVICE_INIT( cassette ) |
| 232 | static DEVICE_START( cassette ) |
| 233 | 233 | { |
| 234 | 234 | const struct IODevice *dev; |
| 235 | 235 | |
| 236 | | if (!image_alloctag(image, CASSETTE_TAG, sizeof(struct mess_cassetteimg))) |
| 237 | | return INIT_FAIL; |
| 236 | image_alloctag(device, CASSETTE_TAG, sizeof(struct mess_cassetteimg)); |
| 238 | 237 | |
| 239 | 238 | /* set to default state */ |
| 240 | | dev = device_find_from_machine(image->machine, IO_CASSETTE); |
| 241 | | get_cassimg(image)->state = get_default_state(dev); |
| 242 | | |
| 243 | | return INIT_PASS; |
| 239 | dev = mess_device_from_core_device(device); |
| 240 | get_cassimg(device)->state = get_default_state(dev); |
| 244 | 241 | } |
| 245 | 242 | |
| 246 | 243 | |
| r2172 | r2173 | |
| 388 | 385 | case MESS_DEVINFO_INT_CASSETTE_DEFAULT_STATE: info->i = CASSETTE_PLAY; break; |
| 389 | 386 | |
| 390 | 387 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 391 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_cassette; break; |
| 388 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(cassette); break; |
| 392 | 389 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_cassette; break; |
| 393 | 390 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_cassette; break; |
| 394 | 391 | case MESS_DEVINFO_PTR_DISPLAY: info->display = device_display_cassette; break; |
src/mess/devices/flopdrv.c
| r2172 | r2173 | |
| 31 | 31 | static TIMER_CALLBACK(floppy_drive_index_callback); |
| 32 | 32 | |
| 33 | 33 | /* this is called on device init */ |
| 34 | | int floppy_drive_init(const device_config *img, const floppy_interface *iface) |
| 34 | void floppy_drive_init(const device_config *img, const floppy_interface *iface) |
| 35 | 35 | { |
| 36 | 36 | struct floppy_drive *pDrive; |
| 37 | 37 | |
| 38 | 38 | assert(image_slotexists(img)); |
| 39 | 39 | |
| 40 | 40 | pDrive = image_alloctag(img, FLOPDRVTAG, sizeof(struct floppy_drive)); |
| 41 | | if (!pDrive) |
| 42 | | return INIT_FAIL; |
| 43 | 41 | |
| 44 | 42 | /* initialise flags */ |
| 45 | 43 | pDrive->flags = 0; |
| r2172 | r2173 | |
| 60 | 58 | pDrive->rpm = 300; |
| 61 | 59 | |
| 62 | 60 | floppy_drive_set_disk_image_interface(img, iface); |
| 63 | | return INIT_PASS; |
| 64 | 61 | } |
| 65 | 62 | |
| 66 | 63 | |
src/mess/devices/flopdrv.h
| r2172 | r2173 | |
| 134 | 134 | void floppy_drive_set_geometry_absolute(const device_config *img, int tracks, int sides); |
| 135 | 135 | |
| 136 | 136 | /* called in device init/exit functions */ |
| 137 | | int floppy_drive_init(const device_config *img, const floppy_interface *iface); |
| 137 | void floppy_drive_init(const device_config *img, const floppy_interface *iface); |
| 138 | 138 | |
| 139 | 139 | /* get next id from track, 1 if got a id, 0 if no id was got */ |
| 140 | 140 | int floppy_drive_get_next_id(const device_config *img, int side, chrn_id *); |
src/mess/devices/idedrive.c
| r2172 | r2173 | |
| 16 | 16 | |
| 17 | 17 | static void ide_get_params(const device_config *image, int *which_bus, int *which_address, |
| 18 | 18 | struct ide_interface **intf, |
| 19 | | device_init_handler *parent_init, |
| 19 | device_start_func *parent_init, |
| 20 | 20 | device_load_handler *parent_load, |
| 21 | 21 | device_unload_handler *parent_unload) |
| 22 | 22 | { |
| r2172 | r2173 | |
| 31 | 31 | parent_devclass.get_info = harddisk_device_getinfo; |
| 32 | 32 | |
| 33 | 33 | if (parent_init) |
| 34 | | *parent_init = (device_init_handler) mess_device_get_info_fct(&parent_devclass, MESS_DEVINFO_PTR_INIT); |
| 34 | *parent_init = (device_start_func) mess_device_get_info_fct(&parent_devclass, MESS_DEVINFO_PTR_INIT); |
| 35 | 35 | if (parent_load) |
| 36 | 36 | *parent_load = (device_load_handler) mess_device_get_info_fct(&parent_devclass, MESS_DEVINFO_PTR_LOAD); |
| 37 | 37 | if (parent_unload) |
| r2172 | r2173 | |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | /*------------------------------------------------- |
| 47 | | ide_hd_init - Init an IDE hard disk device |
| 47 | DEVICE_START(ide_hd) - Init an IDE hard disk device |
| 48 | 48 | -------------------------------------------------*/ |
| 49 | 49 | |
| 50 | | static int ide_hd_init(const device_config *image) |
| 50 | static DEVICE_START(ide_hd) |
| 51 | 51 | { |
| 52 | | int result, which_bus, which_address; |
| 52 | int which_bus, which_address; |
| 53 | 53 | struct ide_interface *intf; |
| 54 | | device_init_handler parent_init; |
| 54 | device_start_func parent_init; |
| 55 | 55 | |
| 56 | 56 | /* get the basics */ |
| 57 | | ide_get_params(image, &which_bus, &which_address, &intf, &parent_init, NULL, NULL); |
| 57 | ide_get_params(device, &which_bus, &which_address, &intf, &parent_init, NULL, NULL); |
| 58 | 58 | |
| 59 | 59 | /* call the parent init function */ |
| 60 | | result = parent_init(image); |
| 61 | | if (result != INIT_PASS) |
| 62 | | return result; |
| 60 | parent_init(device); |
| 63 | 61 | |
| 64 | 62 | /* configure IDE */ |
| 65 | 63 | ide_controller_init_custom(which_bus, intf, NULL); |
| 66 | | return INIT_PASS; |
| 67 | 64 | } |
| 68 | 65 | |
| 69 | 66 | |
| r2172 | r2173 | |
| 164 | 161 | switch(state) |
| 165 | 162 | { |
| 166 | 163 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 167 | | case MESS_DEVINFO_PTR_INIT: info->init = ide_hd_init; break; |
| 164 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(ide_hd); break; |
| 168 | 165 | case MESS_DEVINFO_PTR_LOAD: info->load = ide_hd_load; break; |
| 169 | 166 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = ide_hd_unload; break; |
| 170 | 167 | case MESS_DEVINFO_PTR_VALIDITY_CHECK: info->validity_check = ide_hd_validity_check; break; |
src/mess/devices/cartslot.c
| r2172 | r2173 | |
| 141 | 141 | |
| 142 | 142 | |
| 143 | 143 | |
| 144 | | static DEVICE_INIT( cartslot_specified ) |
| 144 | static DEVICE_START( cartslot_specified ) |
| 145 | 145 | { |
| 146 | | process_cartridge(image, NULL); |
| 147 | | return 0; |
| 146 | process_cartridge(device, NULL); |
| 148 | 147 | } |
| 149 | 148 | |
| 150 | 149 | static DEVICE_LOAD( cartslot_specified ) |
| r2172 | r2173 | |
| 206 | 205 | case MESS_DEVINFO_INT_MUST_BE_LOADED: info->i = must_be_loaded; break; |
| 207 | 206 | |
| 208 | 207 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 209 | | case MESS_DEVINFO_PTR_INIT: info->init = (count > 0) ? device_init_cartslot_specified : NULL; break; |
| 208 | case MESS_DEVINFO_PTR_INIT: info->init = (count > 0) ? DEVICE_START_NAME(cartslot_specified) : NULL; break; |
| 210 | 209 | case MESS_DEVINFO_PTR_LOAD: info->load = (count > 0) ? device_load_cartslot_specified : NULL; break; |
| 211 | 210 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = (count > 0) ? device_unload_cartslot_specified : NULL; break; |
| 212 | 211 | |
src/mess/devices/chd_cd.c
| r2172 | r2173 | |
| 96 | 96 | * |
| 97 | 97 | *************************************/ |
| 98 | 98 | |
| 99 | | static DEVICE_INIT( mess_cd ) |
| 99 | static DEVICE_START( mess_cd ) |
| 100 | 100 | { |
| 101 | 101 | struct mess_cd *cd; |
| 102 | | |
| 103 | | cd = image_alloctag(image, MESSCDTAG, sizeof(struct mess_cd)); |
| 104 | | if (!cd) |
| 105 | | return INIT_FAIL; |
| 106 | | |
| 107 | | cd->cdrom_handle = NULL; |
| 108 | | |
| 109 | | return INIT_PASS; |
| 102 | cd = image_alloctag(device, MESSCDTAG, sizeof(struct mess_cd)); |
| 103 | cd->cdrom_handle = NULL; |
| 110 | 104 | } |
| 111 | 105 | |
| 112 | 106 | |
| r2172 | r2173 | |
| 223 | 217 | case MESS_DEVINFO_INT_CREATE_OPTCOUNT: info->i = 1; break; |
| 224 | 218 | |
| 225 | 219 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 226 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_mess_cd; break; |
| 220 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(mess_cd); break; |
| 227 | 221 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_mess_cd; break; |
| 228 | 222 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_mess_cd; break; |
| 229 | 223 | case MESS_DEVINFO_PTR_CREATE_OPTGUIDE: info->p = (void *) mess_cd_option_guide; break; |
src/mess/devices/mflopimg.c
| r2172 | r2173 | |
| 257 | 257 | /* ----------------------------------------------------------------------- */ |
| 258 | 258 | |
| 259 | 259 | |
| 260 | | static DEVICE_INIT( floppy ) |
| 260 | static DEVICE_START( floppy ) |
| 261 | 261 | { |
| 262 | | if (!image_alloctag(image, FLOPPY_TAG, sizeof(mess_flopimg))) |
| 263 | | return INIT_FAIL; |
| 264 | | return floppy_drive_init(image, &mess_floppy_interface); |
| 262 | image_alloctag(device, FLOPPY_TAG, sizeof(mess_flopimg)); |
| 263 | floppy_drive_init(device, &mess_floppy_interface); |
| 265 | 264 | } |
| 266 | 265 | |
| 267 | 266 | |
| r2172 | r2173 | |
| 434 | 433 | break; |
| 435 | 434 | |
| 436 | 435 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 437 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_floppy; break; |
| 436 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(floppy); break; |
| 438 | 437 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_floppy; break; |
| 439 | 438 | case MESS_DEVINFO_PTR_CREATE: info->create = device_create_floppy; break; |
| 440 | 439 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_floppy; break; |
src/mess/devices/dsk.c
| r2172 | r2173 | |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | |
| 74 | | static DEVICE_INIT( dsk_floppy ) |
| 74 | static DEVICE_START( dsk_floppy ) |
| 75 | 75 | { |
| 76 | | return floppy_drive_init(image, NULL); |
| 76 | floppy_drive_init(device, NULL); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| r2172 | r2173 | |
| 544 | 544 | case MESS_DEVINFO_INT_CREATABLE: info->i = 0; break; |
| 545 | 545 | |
| 546 | 546 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 547 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_dsk_floppy; break; |
| 547 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(dsk_floppy); break; |
| 548 | 548 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_dsk_floppy; break; |
| 549 | 549 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_dsk_floppy; break; |
| 550 | 550 | |
src/mess/devices/appldriv.c
| r2172 | r2173 | |
| 276 | 276 | |
| 277 | 277 | /* ----------------------------------------------------------------------- */ |
| 278 | 278 | |
| 279 | | static DEVICE_INIT( apple525_floppy ) |
| 279 | static DEVICE_START( apple525_floppy ) |
| 280 | 280 | { |
| 281 | | device_init_handler parent_init; |
| 281 | device_start_func parent_init; |
| 282 | 282 | |
| 283 | | if (!image_alloctag(image, APPLE525TAG, sizeof(struct apple525_disk))) |
| 284 | | return INIT_FAIL; |
| 283 | image_alloctag(device, APPLE525TAG, sizeof(struct apple525_disk)); |
| 285 | 284 | |
| 286 | | parent_init = (device_init_handler) mess_device_get_info_fct(&parent_devclass, MESS_DEVINFO_PTR_INIT); |
| 287 | | return parent_init(image); |
| 285 | parent_init = (device_start_func) mess_device_get_info_fct(&parent_devclass, MESS_DEVINFO_PTR_INIT); |
| 286 | parent_init(device); |
| 288 | 287 | } |
| 289 | 288 | |
| 290 | 289 | |
| r2172 | r2173 | |
| 327 | 326 | case MESS_DEVINFO_STR_DEV_TAG: strcpy(info->s = device_temp_str(), APPLE525TAG); break; |
| 328 | 327 | |
| 329 | 328 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 330 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_apple525_floppy; break; |
| 329 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(apple525_floppy); break; |
| 331 | 330 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_apple525_floppy; break; |
| 332 | 331 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_apple525_floppy; break; |
| 333 | 332 | case MESS_DEVINFO_PTR_FLOPPY_OPTIONS: info->p = (void *) floppyoptions_apple2; break; |
src/mess/devices/basicdsk.c
| r2172 | r2173 | |
| 84 | 84 | return &basicdsk_drives[drive]; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | | DEVICE_INIT( basicdsk_floppy ) |
| 87 | DEVICE_START( basicdsk_floppy ) |
| 88 | 88 | { |
| 89 | | return floppy_drive_init(image, &basicdsk_floppy_interface); |
| 89 | floppy_drive_init(device, &basicdsk_floppy_interface); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /* attempt to insert a disk into the drive specified with id */ |
| r2172 | r2173 | |
| 586 | 586 | case MESS_DEVINFO_INT_CREATABLE: info->i = 1; break; |
| 587 | 587 | |
| 588 | 588 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 589 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_basicdsk_floppy; break; |
| 589 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(basicdsk_floppy); break; |
| 590 | 590 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_basicdsk_floppy; break; |
| 591 | 591 | |
| 592 | 592 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
src/mess/devices/coco_vhd.c
| r2172 | r2173 | |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | |
| 70 | | static DEVICE_INIT( coco_vhd ) |
| 70 | static DEVICE_START( coco_vhd ) |
| 71 | 71 | { |
| 72 | 72 | vhd_status = VHDSTATUS_NO_VHD_ATTACHED; |
| 73 | | return INIT_PASS; |
| 74 | 73 | } |
| 75 | 74 | |
| 76 | 75 | |
| r2172 | r2173 | |
| 247 | 246 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 248 | 247 | |
| 249 | 248 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 250 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_coco_vhd; break; |
| 249 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(coco_vhd); break; |
| 251 | 250 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_coco_vhd; break; |
| 252 | 251 | |
| 253 | 252 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
src/mess/devices/bitbngr.c
| r2172 | r2173 | |
| 29 | 29 | |
| 30 | 30 | static struct bitbanger_info *bitbangers[MAX_PRINTER]; |
| 31 | 31 | |
| 32 | | static int bitbanger_init(const device_config *img) |
| 32 | static DEVICE_START(bitbanger) |
| 33 | 33 | { |
| 34 | | int id = image_index_in_device(img); |
| 34 | int id = image_index_in_device(device); |
| 35 | 35 | struct bitbanger_info *bi; |
| 36 | 36 | const struct bitbanger_config *config; |
| 37 | 37 | const struct IODevice *dev; |
| 38 | 38 | |
| 39 | | dev = image_device(img); |
| 39 | dev = mess_device_from_core_device(device); |
| 40 | 40 | config = (const struct bitbanger_config *) mess_device_get_info_ptr(&dev->devclass, MESS_DEVINFO_PTR_BITBANGER_CONFIG); |
| 41 | 41 | |
| 42 | 42 | bi = (struct bitbanger_info *) auto_malloc(sizeof(struct bitbanger_info)); |
| r2172 | r2173 | |
| 50 | 50 | bi->over_threshhold = 1; |
| 51 | 51 | |
| 52 | 52 | bitbangers[id] = bi; |
| 53 | | return INIT_PASS; |
| 54 | 53 | } |
| 55 | 54 | |
| 56 | 55 | |
| r2172 | r2173 | |
| 168 | 167 | case MESS_DEVINFO_INT_CREATABLE: info->i = 1; break; |
| 169 | 168 | |
| 170 | 169 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 171 | | case MESS_DEVINFO_PTR_INIT: info->init = bitbanger_init; break; |
| 170 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(bitbanger); break; |
| 172 | 171 | |
| 173 | 172 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 174 | 173 | case MESS_DEVINFO_STR_DEV_FILE: strcpy(info->s = device_temp_str(), __FILE__); break; |
src/mess/devices/basicdsk.h
| r2172 | r2173 | |
| 15 | 15 | extern const floppy_interface basicdsk_floppy_interface; |
| 16 | 16 | |
| 17 | 17 | /* init */ |
| 18 | | DEVICE_INIT(basicdsk_floppy); |
| 18 | DEVICE_START(basicdsk_floppy); |
| 19 | 19 | DEVICE_LOAD(basicdsk_floppy); |
| 20 | 20 | DEVICE_UNLOAD(basicdsk_floppy); |
| 21 | 21 | |
| r2172 | r2173 | |
| 55 | 55 | |
| 56 | 56 | void legacybasicdsk_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info); |
| 57 | 57 | |
| 58 | | #define CONFIG_DEVICE_FLOPPY_BASICDSK(count, file_extensions, load) \ |
| 59 | | CONFIG_DEVICE_BASE(IO_FLOPPY, (count), (file_extensions), DEVICE_LOAD_RESETS_NONE, \ |
| 60 | | OSD_FOPEN_RW_CREATE_OR_READ, device_init_basicdsk_floppy, NULL, (load), device_unload_basicdsk_floppy, NULL, NULL,\ |
| 61 | | NULL, NULL, floppy_status, NULL, NULL, NULL, NULL, NULL, NULL) \ |
| 62 | 58 | |
| 63 | | #define CONFIG_DEVICE_FLOPPY_BASICDSK_RO(count, file_extensions, load) \ |
| 64 | | CONFIG_DEVICE_BASE(IO_FLOPPY, (count), (file_extensions), DEVICE_LOAD_RESETS_NONE, \ |
| 65 | | OSD_FOPEN_READ, device_init_basicdsk_floppy, NULL, (load), device_unload_basicdsk_floppy, NULL, NULL,\ |
| 66 | | NULL, NULL, floppy_status, NULL, NULL, NULL, NULL, NULL, NULL) \ |
| 67 | | |
| 68 | | |
| 69 | 59 | #ifdef __cplusplus |
| 70 | 60 | } |
| 71 | 61 | #endif |
src/mess/image.c
| r2172 | r2173 | |
| 110 | 110 | |
| 111 | 111 | int image_init(running_machine *machine) |
| 112 | 112 | { |
| 113 | | int err; |
| 114 | 113 | int count, indx; |
| 115 | 114 | UINT32 mask, dev_mask = 0, multiple_dev_mask = 0; |
| 116 | 115 | const struct IODevice *dev; |
| r2172 | r2173 | |
| 161 | 160 | |
| 162 | 161 | if (dev->init != NULL) |
| 163 | 162 | { |
| 164 | | err = dev->init(machine->images_data->slots[indx].dev); |
| 165 | | if (err != INIT_PASS) |
| 166 | | return err; |
| 163 | dev->init(machine->images_data->slots[indx].dev); |
| 167 | 164 | } |
| 168 | 165 | indx++; |
| 169 | 166 | } |
| r2172 | r2173 | |
| 899 | 896 | void *image_alloctag(const device_config *image, const char *tag, size_t size) |
| 900 | 897 | { |
| 901 | 898 | image_slot_data *slot = find_image_slot(image); |
| 902 | | return tagpool_alloc(&slot->tagpool, tag, size); |
| 899 | void *ptr = tagpool_alloc(&slot->tagpool, tag, size); |
| 900 | if (ptr == NULL) |
| 901 | { |
| 902 | memory_error("Out of memory"); |
| 903 | } |
| 904 | return ptr; |
| 903 | 905 | } |
| 904 | 906 | |
| 905 | 907 | |
src/mess/includes/tx0.h
| r2172 | r2173 | |
| 19 | 19 | |
| 20 | 20 | void tx0_tape_get_open_mode(const struct IODevice *dev, int id, |
| 21 | 21 | unsigned int *readable, unsigned int *writeable, unsigned int *creatable); |
| 22 | | DEVICE_INIT( tx0_tape ); |
| 22 | DEVICE_START( tx0_tape ); |
| 23 | 23 | DEVICE_LOAD( tx0_tape ); |
| 24 | 24 | DEVICE_UNLOAD( tx0_tape ); |
| 25 | 25 | void tx0_io_r1l(void); |
| r2172 | r2173 | |
| 30 | 30 | DEVICE_UNLOAD(tx0_typewriter); |
| 31 | 31 | void tx0_io_prt(void); |
| 32 | 32 | void tx0_io_dis(void); |
| 33 | | DEVICE_INIT( tx0_magtape ); |
| 33 | DEVICE_START( tx0_magtape ); |
| 34 | 34 | DEVICE_LOAD( tx0_magtape ); |
| 35 | 35 | DEVICE_UNLOAD( tx0_magtape ); |
| 36 | 36 | void tx0_sel(void); |
src/mess/device.c
| r2172 | r2173 | |
| 361 | 361 | mess_device->io_device.must_be_loaded = mess_device_get_info_int(&mess_device->io_device.devclass, MESS_DEVINFO_INT_MUST_BE_LOADED) ? 1 : 0; |
| 362 | 362 | mess_device->io_device.load_at_init = mess_device_get_info_int(&mess_device->io_device.devclass, MESS_DEVINFO_INT_LOAD_AT_INIT) ? 1 : 0; |
| 363 | 363 | |
| 364 | | mess_device->io_device.init = (device_init_handler) mess_device_get_info_fct(&mess_device->io_device.devclass, MESS_DEVINFO_PTR_INIT); |
| 365 | | mess_device->io_device.exit = (device_exit_handler) mess_device_get_info_fct(&mess_device->io_device.devclass, MESS_DEVINFO_PTR_EXIT); |
| 364 | mess_device->io_device.init = (device_start_func) mess_device_get_info_fct(&mess_device->io_device.devclass, MESS_DEVINFO_PTR_INIT); |
| 365 | mess_device->io_device.exit = (device_stop_func) mess_device_get_info_fct(&mess_device->io_device.devclass, MESS_DEVINFO_PTR_EXIT); |
| 366 | 366 | mess_device->io_device.load = (device_load_handler) mess_device_get_info_fct(&mess_device->io_device.devclass, MESS_DEVINFO_PTR_LOAD); |
| 367 | 367 | mess_device->io_device.create = (device_create_handler) mess_device_get_info_fct(&mess_device->io_device.devclass, MESS_DEVINFO_PTR_CREATE); |
| 368 | 368 | mess_device->io_device.unload = (device_unload_handler) mess_device_get_info_fct(&mess_device->io_device.devclass, MESS_DEVINFO_PTR_UNLOAD); |
src/mess/device.h
| r2172 | r2173 | |
| 91 | 91 | |
| 92 | 92 | struct IODevice; |
| 93 | 93 | |
| 94 | | typedef int (*device_init_handler)(const device_config *image); |
| 95 | | typedef void (*device_exit_handler)(const device_config *image); |
| 96 | 94 | typedef int (*device_load_handler)(const device_config *image); |
| 97 | 95 | typedef int (*device_create_handler)(const device_config *image, int format_type, option_resolution *format_options); |
| 98 | 96 | typedef void (*device_unload_handler)(const device_config *image); |
| r2172 | r2173 | |
| 114 | 112 | char *s; /* generic strings */ |
| 115 | 113 | double d; /* generic floating points */ |
| 116 | 114 | |
| 117 | | device_init_handler init; |
| 118 | | device_exit_handler exit; |
| 115 | device_start_func init; |
| 116 | device_stop_func exit; |
| 119 | 117 | device_load_handler load; |
| 120 | 118 | device_create_handler create; |
| 121 | 119 | device_unload_handler unload; |
| r2172 | r2173 | |
| 259 | 257 | unsigned int multiple : 1; |
| 260 | 258 | |
| 261 | 259 | /* image handling callbacks */ |
| 262 | | device_init_handler init; |
| 263 | | device_exit_handler exit; |
| 260 | device_start_func init; |
| 261 | device_stop_func exit; |
| 264 | 262 | device_load_handler load; |
| 265 | 263 | device_create_handler create; |
| 266 | 264 | device_unload_handler unload; |
src/mess/machine/cbm.c
| r2172 | r2173 | |
| 174 | 174 | return device_find_from_machine(machine, IO_CARTSLOT); |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | | static DEVICE_INIT(cbm_rom) |
| 177 | static DEVICE_START(cbm_rom) |
| 178 | 178 | { |
| 179 | | int id = image_index_in_device(image); |
| 179 | int id = image_index_in_device(device); |
| 180 | 180 | if (id == 0) |
| 181 | 181 | { |
| 182 | 182 | cbm_c64_game = -1; |
| 183 | 183 | cbm_c64_exrom = -1; |
| 184 | 184 | } |
| 185 | | return INIT_PASS; |
| 186 | 185 | } |
| 187 | 186 | |
| 188 | 187 | static DEVICE_LOAD(cbm_rom) |
| r2172 | r2173 | |
| 334 | 333 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "crt"); break; |
| 335 | 334 | |
| 336 | 335 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 337 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_cbm_rom; break; |
| 336 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(cbm_rom); break; |
| 338 | 337 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_cbm_rom; break; |
| 339 | 338 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_cbm_rom; break; |
| 340 | 339 | |
src/mess/machine/990_tap.c
| r2172 | r2173 | |
| 106 | 106 | static tpc_t tpc; |
| 107 | 107 | |
| 108 | 108 | |
| 109 | | DEVICE_INIT( ti990_tape ) |
| 109 | DEVICE_START( ti990_tape ) |
| 110 | 110 | { |
| 111 | 111 | tape_unit_t *t; |
| 112 | | int id = image_index_in_device(image); |
| 112 | int id = image_index_in_device(device); |
| 113 | 113 | |
| 114 | assert ((id >= 0) && (id < MAX_TAPE_UNIT)); |
| 114 | 115 | |
| 115 | | if ((id < 0) || (id >= MAX_TAPE_UNIT)) |
| 116 | | return INIT_FAIL; |
| 117 | | |
| 118 | 116 | t = &tpc.t[id]; |
| 119 | 117 | memset(t, 0, sizeof(*t)); |
| 120 | 118 | |
| 121 | | t->img = image; |
| 119 | t->img = device; |
| 122 | 120 | t->wp = 1; |
| 123 | 121 | t->bot = 0; |
| 124 | 122 | t->eot = 0; |
| 125 | | |
| 126 | | return INIT_PASS; |
| 127 | 123 | } |
| 128 | 124 | |
| 129 | | /*DEVICE_EXIT( ti990_tape ) |
| 125 | /*DEVICE_STOP( ti990_tape ) |
| 130 | 126 | { |
| 131 | 127 | d->img = NULL; |
| 132 | 128 | }*/ |
src/mess/machine/990_hd.c
| r2172 | r2173 | |
| 162 | 162 | /* |
| 163 | 163 | Initialize hard disk unit |
| 164 | 164 | */ |
| 165 | | DEVICE_INIT( ti990_hd ) |
| 165 | DEVICE_START( ti990_hd ) |
| 166 | 166 | { |
| 167 | 167 | hd_unit_t *d; |
| 168 | | int id = image_index_in_device(image); |
| 168 | int id = image_index_in_device(device); |
| 169 | 169 | |
| 170 | assert ((id >= 0) && (id < MAX_DISK_UNIT)); |
| 170 | 171 | |
| 171 | | if ((id < 0) || (id >= MAX_DISK_UNIT)) |
| 172 | | return INIT_FAIL; |
| 173 | | |
| 174 | 172 | d = &hdc.d[id]; |
| 175 | 173 | memset(d, 0, sizeof(*d)); |
| 176 | 174 | |
| 177 | | d->img = image; |
| 175 | d->img = device; |
| 178 | 176 | d->format = format_mame; /* don't care */ |
| 179 | 177 | d->hd_handle = NULL; |
| 180 | 178 | d->wp = 1; |
| r2172 | r2173 | |
| 183 | 181 | /* clear attention line */ |
| 184 | 182 | /*hdc.w[0] &= ~ (0x80 >> id);*/ |
| 185 | 183 | |
| 186 | | return device_init_mess_hd(image); |
| 184 | DEVICE_START_CALL(mess_hd); |
| 187 | 185 | } |
| 188 | 186 | |
| 189 | | /*DEVICE_EXIT( ti990_hd ) |
| 187 | /*DEVICE_STOP( ti990_hd ) |
| 190 | 188 | { |
| 191 | 189 | d->img = NULL; |
| 192 | 190 | }*/ |
src/mess/machine/smartmed.c
| r2172 | r2173 | |
| 101 | 101 | /* |
| 102 | 102 | Init a SmartMedia image |
| 103 | 103 | */ |
| 104 | | DEVICE_INIT( smartmedia ) |
| 104 | DEVICE_START( smartmedia ) |
| 105 | 105 | { |
| 106 | | int id = image_index_in_device(image); |
| 106 | int id = image_index_in_device(device); |
| 107 | assert((id >= 0) && (id < MAX_SMARTMEDIA)); |
| 107 | 108 | |
| 108 | | if (id >= MAX_SMARTMEDIA) |
| 109 | | { |
| 110 | | logerror("smartmedia: invalid chip %d\n", id); |
| 111 | | return INIT_FAIL; |
| 112 | | } |
| 113 | | |
| 114 | 109 | smartmedia[id].page_data_size = 0; |
| 115 | 110 | smartmedia[id].page_total_size = 0; |
| 116 | 111 | smartmedia[id].num_pages = 0; |
| r2172 | r2173 | |
| 125 | 120 | smartmedia[id].pagereg = NULL; |
| 126 | 121 | smartmedia[id].id[0] = smartmedia[id].id[1] = 0; |
| 127 | 122 | smartmedia[id].mp_opcode = 0; |
| 128 | | |
| 129 | | return INIT_PASS; |
| 130 | 123 | } |
| 131 | 124 | |
| 132 | 125 | /* |
src/mess/machine/cbmserb.c
| r2172 | r2173 | |
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | |
| 106 | | static DEVICE_INIT( cbm_drive ) |
| 106 | static DEVICE_START( cbm_drive ) |
| 107 | 107 | { |
| 108 | | int id = image_index_in_device(image); |
| 108 | int id = image_index_in_device(device); |
| 109 | 109 | if (id == 0) |
| 110 | 110 | cbm_drive_open(); /* boy these C64 drivers are butt ugly */ |
| 111 | | return INIT_PASS; |
| 112 | 111 | } |
| 113 | 112 | |
| 114 | | static DEVICE_EXIT( cbm_drive ) |
| 113 | static DEVICE_STOP( cbm_drive ) |
| 115 | 114 | { |
| 116 | | int id = image_index_in_device(image); |
| 115 | int id = image_index_in_device(device); |
| 117 | 116 | if (id == 0) |
| 118 | 117 | cbm_drive_close(); /* boy these C64 drivers are butt ugly */ |
| 119 | 118 | } |
| r2172 | r2173 | |
| 414 | 413 | case MESS_DEVINFO_INT_COUNT: info->i = 2; break; |
| 415 | 414 | |
| 416 | 415 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 417 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_cbm_drive; break; |
| 418 | | case MESS_DEVINFO_PTR_EXIT: info->exit = device_exit_cbm_drive; break; |
| 416 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(cbm_drive); break; |
| 417 | case MESS_DEVINFO_PTR_EXIT: info->exit = DEVICE_STOP_NAME(cbm_drive); break; |
| 419 | 418 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_cbm_drive; break; |
| 420 | 419 | |
| 421 | 420 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
src/mess/machine/thomson.c
| r2172 | r2173 | |
| 177 | 177 | |
| 178 | 178 | |
| 179 | 179 | |
| 180 | | int thom_serial_init ( const device_config *image ) |
| 180 | DEVICE_START( thom_serial ) |
| 181 | 181 | { |
| 182 | | int idx = image_index_in_device(image); |
| 182 | int idx = image_index_in_device(device); |
| 183 | 183 | |
| 184 | | if ( serial_device_init( image ) != INIT_PASS ) |
| 185 | | return INIT_FAIL; |
| 184 | DEVICE_START_CALL(serial_device); |
| 186 | 185 | |
| 187 | 186 | switch ( idx ) { |
| 188 | 187 | |
| 189 | 188 | case THOM_SERIAL_CC90323: |
| 190 | 189 | LOG(( "thom_serial_init: init CD 90-320 RS232 device\n" )); |
| 191 | | serial_device_connect( image , &to7_io_line ); |
| 190 | serial_device_connect( device , &to7_io_line ); |
| 192 | 191 | break; |
| 193 | 192 | |
| 194 | 193 | case THOM_SERIAL_RF57232: |
| 195 | 194 | LOG(( "thom_serial_init: init RF 57-232 RS232 device\n" )); |
| 196 | | acia_6551_connect_to_serial_device( image ); |
| 195 | acia_6551_connect_to_serial_device( device ); |
| 197 | 196 | break; |
| 198 | 197 | |
| 199 | 198 | case THOM_SERIAL_MODEM: |
| r2172 | r2173 | |
| 201 | 200 | break; |
| 202 | 201 | |
| 203 | 202 | default: |
| 204 | | logerror( "thom_serial_init: unknown serial device index %i\n", idx ); |
| 205 | | return INIT_FAIL; |
| 203 | fatalerror( "thom_serial_init: unknown serial device index %i\n", idx ); |
| 204 | break; |
| 206 | 205 | } |
| 207 | 206 | |
| 208 | | serial_device_setup( image, 2400, 7, 2, SERIAL_PARITY_NONE ); /* default */ |
| 209 | | serial_device_set_protocol( image, SERIAL_PROTOCOL_NONE ); |
| 210 | | serial_device_set_transmit_state( image, 1 ); |
| 211 | | |
| 212 | | return INIT_PASS; |
| 207 | serial_device_setup( device, 2400, 7, 2, SERIAL_PARITY_NONE ); /* default */ |
| 208 | serial_device_set_protocol( device, SERIAL_PROTOCOL_NONE ); |
| 209 | serial_device_set_transmit_state( device, 1 ); |
| 213 | 210 | } |
| 214 | 211 | |
| 215 | 212 | |
src/mess/machine/amigafdc.c
| r2172 | r2173 | |
| 68 | 68 | static TIMER_CALLBACK(fdc_dma_proc); |
| 69 | 69 | static TIMER_CALLBACK(fdc_sync_proc); |
| 70 | 70 | |
| 71 | | static DEVICE_INIT(amiga_fdc) |
| 71 | static DEVICE_START(amiga_fdc) |
| 72 | 72 | { |
| 73 | | int id = image_index_in_device(image); |
| 73 | int id = image_index_in_device(device); |
| 74 | 74 | fdc_status[id].motor_on = 0; |
| 75 | 75 | fdc_status[id].side = 0; |
| 76 | 76 | fdc_status[id].dir = 0; |
| r2172 | r2173 | |
| 96 | 96 | fdc_side = 1; |
| 97 | 97 | fdc_step = 1; |
| 98 | 98 | fdc_rdy = 0; |
| 99 | | |
| 100 | | return INIT_PASS; |
| 101 | 99 | } |
| 102 | 100 | |
| 103 | 101 | static void check_extended_image( int id ) |
| r2172 | r2173 | |
| 760 | 758 | case MESS_DEVINFO_INT_CREATABLE: info->i = 0; break; |
| 761 | 759 | |
| 762 | 760 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 763 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_amiga_fdc; break; |
| 761 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(amiga_fdc); break; |
| 764 | 762 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_amiga_fdc; break; |
| 765 | 763 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_amiga_fdc; break; |
| 766 | 764 | |
src/mess/machine/a7800.c
| r2172 | r2173 | |
| 208 | 208 | return IMAGE_VERIFY_PASS; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | | DEVICE_INIT( a7800_cart ) |
| 211 | DEVICE_START( a7800_cart ) |
| 212 | 212 | { |
| 213 | 213 | UINT8 *memory; |
| 214 | 214 | |
| r2172 | r2173 | |
| 218 | 218 | |
| 219 | 219 | /* Allocate memory for BIOS bank switching */ |
| 220 | 220 | a7800_bios_bkup = (UINT8*) auto_malloc(0x4000); |
| 221 | | if (!a7800_bios_bkup) |
| 222 | | { |
| 223 | | logerror("Could not allocate ROM memory\n"); |
| 224 | | return INIT_FAIL; |
| 225 | | } |
| 226 | | |
| 227 | 221 | a7800_cart_bkup = (UINT8*) auto_malloc(0x4000); |
| 228 | | if (!a7800_cart_bkup) |
| 229 | | { |
| 230 | | logerror("Could not allocate ROM memory\n"); |
| 231 | | return INIT_FAIL; |
| 232 | | } |
| 233 | 222 | |
| 234 | 223 | /* save the BIOS so we can switch it in and out */ |
| 235 | 224 | memcpy( a7800_bios_bkup, memory + 0xC000, 0x4000 ); |
| r2172 | r2173 | |
| 237 | 226 | /* defaults for PAL bios without cart */ |
| 238 | 227 | a7800_cart_type = 0; |
| 239 | 228 | a7800_stick_type = 1; |
| 240 | | |
| 241 | | return INIT_PASS; |
| 242 | 229 | } |
| 243 | 230 | |
| 244 | 231 | DEVICE_LOAD( a7800_cart ) |
src/mess/formats/thom_dsk.c
| r2172 | r2173 | |
| 782 | 782 | |
| 783 | 783 | |
| 784 | 784 | |
| 785 | | int thom_floppy_init ( const device_config *image ) |
| 785 | DEVICE_START( thom_floppy ) |
| 786 | 786 | { |
| 787 | 787 | thom_qdd_compute_map(); |
| 788 | | thom_floppy_reset( thom_floppy_drive_of_image( image ) ); |
| 789 | | return floppy_drive_init( image, &thom_floppy_interface ); |
| 788 | thom_floppy_reset( thom_floppy_drive_of_image( device ) ); |
| 789 | floppy_drive_init( device, &thom_floppy_interface ); |
| 790 | 790 | } |
| 791 | 791 | |
| 792 | 792 | |
| r2172 | r2173 | |
| 928 | 928 | info->i = 1; |
| 929 | 929 | break; |
| 930 | 930 | case MESS_DEVINFO_PTR_INIT: |
| 931 | | info->init = thom_floppy_init; |
| 931 | info->init = DEVICE_START_NAME(thom_floppy); |
| 932 | 932 | break; |
| 933 | 933 | case MESS_DEVINFO_PTR_LOAD: |
| 934 | 934 | info->load = thom_floppy_load; |
src/mess/drivers/nc.c
| r2172 | r2173 | |
| 1747 | 1747 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 1748 | 1748 | |
| 1749 | 1749 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1750 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_nc_pcmcia_card; break; |
| 1750 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(nc_pcmcia_card); break; |
| 1751 | 1751 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_nc_pcmcia_card; break; |
| 1752 | 1752 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_nc_pcmcia_card; break; |
| 1753 | 1753 | |
| r2172 | r2173 | |
| 1771 | 1771 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 1772 | 1772 | |
| 1773 | 1773 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1774 | | case MESS_DEVINFO_PTR_INIT: info->init = serial_device_init; break; |
| 1774 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(serial_device); break; |
| 1775 | 1775 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_nc_serial; break; |
| 1776 | 1776 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = serial_device_unload; break; |
| 1777 | 1777 | |
src/mess/drivers/pokemini.c
| r2172 | r2173 | |
| 80 | 80 | switch( state ) { |
| 81 | 81 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 82 | 82 | case MESS_DEVINFO_INT_MUST_BE_LOADED: info->i = 0; break; |
| 83 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_pokemini_cart; break; |
| 83 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(pokemini_cart); break; |
| 84 | 84 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_pokemini_cart; break; |
| 85 | 85 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy( info->s = device_temp_str(), "min"); break; |
| 86 | 86 | default: cartslot_device_getinfo( devclass, state, info ); break; |
src/mess/drivers/ti99_8.c
| r2172 | r2173 | |
| 550 | 550 | case MESS_DEVINFO_INT_COUNT: info->i = 3; break; |
| 551 | 551 | |
| 552 | 552 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 553 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_mess_hd; break; |
| 553 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(mess_hd); break; |
| 554 | 554 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_ti99_hd; break; |
| 555 | 555 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_ti99_hd; break; |
| 556 | 556 | |
| r2172 | r2173 | |
| 639 | 639 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 640 | 640 | |
| 641 | 641 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 642 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_smartmedia; break; |
| 642 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(smartmedia); break; |
| 643 | 643 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_smartmedia; break; |
| 644 | 644 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_smartmedia; break; |
| 645 | 645 | |
src/mess/drivers/atarist.c
| r2172 | r2173 | |
| 2117 | 2117 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 2118 | 2118 | |
| 2119 | 2119 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2120 | | case MESS_DEVINFO_PTR_INIT: info->init = serial_device_init; break; |
| 2120 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(serial_device); break; |
| 2121 | 2121 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_atarist_serial; break; |
| 2122 | 2122 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = serial_device_unload; break; |
| 2123 | 2123 | |
| r2172 | r2173 | |
| 2136 | 2136 | case MESS_DEVINFO_INT_COUNT: info->i = 2; break; |
| 2137 | 2137 | |
| 2138 | 2138 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2139 | | case MESS_DEVINFO_PTR_INIT: info->init = serial_device_init; break; |
| 2139 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(serial_device); break; |
| 2140 | 2140 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_atarist_serial; break; |
| 2141 | 2141 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = serial_device_unload; break; |
| 2142 | 2142 | |
src/mess/drivers/geneve.c
| r2172 | r2173 | |
| 556 | 556 | case MESS_DEVINFO_INT_COUNT: info->i = 3; break; |
| 557 | 557 | |
| 558 | 558 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 559 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_mess_hd; break; |
| 559 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(mess_hd); break; |
| 560 | 560 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_ti99_hd; break; |
| 561 | 561 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_ti99_hd; break; |
| 562 | 562 | |
| r2172 | r2173 | |
| 621 | 621 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 622 | 622 | |
| 623 | 623 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 624 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_smartmedia; break; |
| 624 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(smartmedia); break; |
| 625 | 625 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_smartmedia; break; |
| 626 | 626 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_smartmedia; break; |
| 627 | 627 | |
src/mess/drivers/tx0.c
| r2172 | r2173 | |
| 406 | 406 | case MESS_DEVINFO_INT_COUNT: info->i = 2; break; |
| 407 | 407 | |
| 408 | 408 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 409 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_tx0_tape; break; |
| 409 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(tx0_tape); break; |
| 410 | 410 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_tx0_tape; break; |
| 411 | 411 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_tx0_tape; break; |
| 412 | 412 | case MESS_DEVINFO_PTR_GET_DISPOSITIONS: info->getdispositions = tx0_tape_get_open_mode; break; |
| r2172 | r2173 | |
| 450 | 450 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 451 | 451 | |
| 452 | 452 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 453 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_tx0_magtape; break; |
| 453 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(tx0_magtape); break; |
| 454 | 454 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_tx0_magtape; break; |
| 455 | 455 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_tx0_magtape; break; |
| 456 | 456 | |
src/mess/drivers/ti990_10.c
| r2172 | r2173 | |
| 297 | 297 | case MESS_DEVINFO_INT_COUNT: info->i = 4; break; |
| 298 | 298 | |
| 299 | 299 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 300 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_ti990_hd; break; |
| 300 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(ti990_hd); break; |
| 301 | 301 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_ti990_hd; break; |
| 302 | 302 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_ti990_hd; break; |
| 303 | 303 | |
| r2172 | r2173 | |
| 319 | 319 | case MESS_DEVINFO_INT_COUNT: info->i = 4; break; |
| 320 | 320 | |
| 321 | 321 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 322 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_ti990_tape; break; |
| 322 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(ti990_tape); break; |
| 323 | 323 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_ti990_tape; break; |
| 324 | 324 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_ti990_tape; break; |
| 325 | 325 | |
src/mess/drivers/ti85.c
| r2172 | r2173 | |
| 491 | 491 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 492 | 492 | |
| 493 | 493 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 494 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_ti85_serial; break; |
| 494 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(ti85_serial); break; |
| 495 | 495 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_ti85_serial; break; |
| 496 | 496 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_ti85_serial; break; |
| 497 | 497 | |
| r2172 | r2173 | |
| 533 | 533 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 534 | 534 | |
| 535 | 535 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 536 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_ti85_serial; break; |
| 536 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(ti85_serial); break; |
| 537 | 537 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_ti85_serial; break; |
| 538 | 538 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_ti85_serial; break; |
| 539 | 539 | |
src/mess/drivers/ti99_4p.c
| r2172 | r2173 | |
| 345 | 345 | case MESS_DEVINFO_INT_COUNT: info->i = 3; break; |
| 346 | 346 | |
| 347 | 347 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 348 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_mess_hd; break; |
| 348 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(mess_hd); break; |
| 349 | 349 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_ti99_hd; break; |
| 350 | 350 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_ti99_hd; break; |
| 351 | 351 | |
| r2172 | r2173 | |
| 424 | 424 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 425 | 425 | |
| 426 | 426 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 427 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_smartmedia; break; |
| 427 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(smartmedia); break; |
| 428 | 428 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_smartmedia; break; |
| 429 | 429 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_smartmedia; break; |
| 430 | 430 | } |
src/mess/drivers/ti99_4x.c
| r2172 | r2173 | |
| 781 | 781 | case MESS_DEVINFO_INT_COUNT: info->i = 3; break; |
| 782 | 782 | |
| 783 | 783 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 784 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_ti99_cart; break; |
| 784 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(ti99_cart); break; |
| 785 | 785 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_ti99_cart; break; |
| 786 | 786 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_ti99_cart; break; |
| 787 | 787 | |
| r2172 | r2173 | |
| 820 | 820 | case MESS_DEVINFO_INT_COUNT: info->i = 3; break; |
| 821 | 821 | |
| 822 | 822 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 823 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_mess_hd; break; |
| 823 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(mess_hd); break; |
| 824 | 824 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_ti99_hd; break; |
| 825 | 825 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_ti99_hd; break; |
| 826 | 826 | |
| r2172 | r2173 | |
| 906 | 906 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 907 | 907 | |
| 908 | 908 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 909 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_smartmedia; break; |
| 909 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(smartmedia); break; |
| 910 | 910 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_smartmedia; break; |
| 911 | 911 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = device_unload_smartmedia; break; |
| 912 | 912 | |
src/mess/drivers/gamepock.c
| r2172 | r2173 | |
| 62 | 62 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 63 | 63 | MACHINE_DRIVER_END |
| 64 | 64 | |
| 65 | | static DEVICE_INIT(gamepock_cart) { |
| 65 | static DEVICE_START(gamepock_cart) { |
| 66 | 66 | memory_set_bankptr( 1, memory_region( REGION_USER1 ) ); |
| 67 | | return INIT_PASS; |
| 68 | 67 | } |
| 69 | 68 | |
| 70 | 69 | static DEVICE_LOAD(gamepock_cart) { |
| r2172 | r2173 | |
| 85 | 84 | switch( state ) { |
| 86 | 85 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 87 | 86 | case MESS_DEVINFO_INT_MUST_BE_LOADED: info->i = 0; break; |
| 88 | | case MESS_DEVINFO_PTR_INIT: info->init = device_init_gamepock_cart; break; |
| 87 | case MESS_DEVINFO_PTR_INIT: info->init = DEVICE_START_NAME(gamepock_cart); break; |
| 89 | 88 | case MESS_DEVINFO_PTR_LOAD: info->load = device_load_gamepock_cart; break; |
| 90 | 89 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy( info->s = device_temp_str(), "bin" ); break; |
| 91 | 90 | default: cartslot_device_getinfo(devclass, state, info); break; |