src/mess/device.c
| r3968 | r3969 | |
| 375 | 375 | MESS device |
| 376 | 376 | -------------------------------------------------*/ |
| 377 | 377 | |
| 378 | | static void create_mess_device(device_config **listheadptr, device_getinfo_handler handler, const game_driver *gamedrv, |
| 378 | static void create_mess_device(running_machine *machine, device_config **listheadptr, device_getinfo_handler handler, const game_driver *gamedrv, |
| 379 | 379 | int count_override, int *position) |
| 380 | 380 | { |
| 381 | 381 | mess_device_class mess_devclass; |
| r3968 | r3969 | |
| 418 | 418 | |
| 419 | 419 | /* create a bonafide MAME device */ |
| 420 | 420 | device = device_list_add(listheadptr, NULL, MESS_DEVICE, mame_tag, 0); |
| 421 | device->machine = machine; |
| 421 | 422 | mess_device = (mess_device_config *) device->inline_config; |
| 422 | 423 | |
| 423 | 424 | /* we need to copy the mess_tag into the structure */ |
| r3968 | r3969 | |
| 469 | 470 | mess_devices_setup - allocate devices |
| 470 | 471 | -------------------------------------------------*/ |
| 471 | 472 | |
| 472 | | void mess_devices_setup(machine_config *config, const game_driver *gamedrv) |
| 473 | void mess_devices_setup(running_machine *machine, machine_config *config, const game_driver *gamedrv) |
| 473 | 474 | { |
| 474 | 475 | device_getinfo_handler handlers[64]; |
| 475 | 476 | int count_overrides[sizeof(handlers) / sizeof(handlers[0])]; |
| r3968 | r3969 | |
| 493 | 494 | /* loop through all handlers */ |
| 494 | 495 | for (i = 0; handlers[i] != NULL; i++) |
| 495 | 496 | { |
| 496 | | create_mess_device(&config->devicelist, handlers[i], gamedrv, count_overrides[i], &position); |
| 497 | create_mess_device(machine, &config->devicelist, handlers[i], gamedrv, count_overrides[i], &position); |
| 497 | 498 | } |
| 498 | 499 | } |
| 499 | 500 | |
| r3968 | r3969 | |
| 507 | 508 | machine_config *machine_config_alloc_with_mess_devices(const game_driver *gamedrv) |
| 508 | 509 | { |
| 509 | 510 | machine_config *config = machine_config_alloc(gamedrv->machine_config); |
| 510 | | mess_devices_setup(config, gamedrv); |
| 511 | mess_devices_setup(NULL/*machine?*/, config, gamedrv); |
| 511 | 512 | return config; |
| 512 | 513 | } |
| 513 | 514 | |