src/mess/devices/cassette.c
| r2022 | r2023 | |
| 237 | 237 | return INIT_FAIL; |
| 238 | 238 | |
| 239 | 239 | /* set to default state */ |
| 240 | | dev = device_find(Machine->devices, IO_CASSETTE); |
| 240 | dev = device_find_from_machine(Machine, IO_CASSETTE); |
| 241 | 241 | get_cassimg(image)->state = get_default_state(dev); |
| 242 | 242 | |
| 243 | 243 | return INIT_PASS; |
| r2022 | r2023 | |
| 259 | 259 | tag = get_cassimg(image); |
| 260 | 260 | |
| 261 | 261 | /* figure out the cassette format */ |
| 262 | | dev = device_find(Machine->devices, IO_CASSETTE); |
| 262 | dev = device_find_from_machine(Machine, IO_CASSETTE); |
| 263 | 263 | formats = mess_device_get_info_ptr(&dev->devclass, MESS_DEVINFO_PTR_CASSETTE_FORMATS); |
| 264 | 264 | |
| 265 | 265 | if (image_has_been_created(image)) |
src/mess/devices/appldriv.c
| r2022 | r2023 | |
| 150 | 150 | int i, count; |
| 151 | 151 | mess_image *image; |
| 152 | 152 | |
| 153 | | count = device_count_tag(Machine->devices, APPLE525TAG); |
| 153 | count = device_count_tag_from_machine(Machine, APPLE525TAG); |
| 154 | 154 | |
| 155 | 155 | for (i = 0; i < count; i++) |
| 156 | 156 | { |
| r2022 | r2023 | |
| 222 | 222 | { |
| 223 | 223 | int i, count; |
| 224 | 224 | |
| 225 | | count = device_count_tag(Machine->devices, APPLE525TAG); |
| 225 | count = device_count_tag_from_machine(Machine, APPLE525TAG); |
| 226 | 226 | |
| 227 | 227 | for (i = 0; i < count; i++) |
| 228 | 228 | { |
| r2022 | r2023 | |
| 258 | 258 | int i, count, result = 0; |
| 259 | 259 | mess_image *image; |
| 260 | 260 | |
| 261 | | count = device_count_tag(Machine->devices, APPLE525TAG); |
| 261 | count = device_count_tag_from_machine(Machine, APPLE525TAG); |
| 262 | 262 | |
| 263 | 263 | for (i = 0; i < count; i++) |
| 264 | 264 | { |
src/mess/device.c
| r2022 | r2023 | |
| 352 | 352 | |
| 353 | 353 | /************************************* |
| 354 | 354 | * |
| 355 | * Device enumeration |
| 356 | * |
| 357 | *************************************/ |
| 358 | |
| 359 | const struct IODevice *mess_device_first_from_machine(const running_machine *machine) |
| 360 | { |
| 361 | return machine->devices; |
| 362 | } |
| 363 | |
| 364 | |
| 365 | |
| 366 | const struct IODevice *mess_device_next(const struct IODevice *dev) |
| 367 | { |
| 368 | dev++; |
| 369 | return (dev->type < IO_COUNT) ? dev : NULL; |
| 370 | } |
| 371 | |
| 372 | |
| 373 | |
| 374 | /************************************* |
| 375 | * |
| 355 | 376 | * Device lookup |
| 356 | 377 | * |
| 357 | 378 | *************************************/ |
| r2022 | r2023 | |
| 378 | 399 | |
| 379 | 400 | |
| 380 | 401 | |
| 402 | int device_count_tag_from_machine(const running_machine *machine, const char *tag) |
| 403 | { |
| 404 | return device_count_tag(machine->devices, tag); |
| 405 | } |
| 406 | |
| 407 | |
| 408 | |
| 381 | 409 | /* this function is deprecated */ |
| 382 | 410 | const struct IODevice *device_find(const struct IODevice *devices, iodevice_t type) |
| 383 | 411 | { |
| r2022 | r2023 | |
| 393 | 421 | |
| 394 | 422 | |
| 395 | 423 | /* this function is deprecated */ |
| 424 | const struct IODevice *device_find_from_machine(const running_machine *machine, iodevice_t type) |
| 425 | { |
| 426 | return device_find(machine->devices, type); |
| 427 | } |
| 428 | |
| 429 | |
| 430 | |
| 431 | /* this function is deprecated */ |
| 396 | 432 | int device_count(iodevice_t type) |
| 397 | 433 | { |
| 398 | 434 | const struct IODevice *dev = NULL; |
src/mess/device.h
| r2022 | r2023 | |
| 279 | 279 | const struct IODevice *devices_allocate(const game_driver *gamedrv); |
| 280 | 280 | void devices_free(const struct IODevice *devices); |
| 281 | 281 | |
| 282 | /* device enumeration */ |
| 283 | const struct IODevice *mess_device_first_from_machine(const running_machine *machine); |
| 284 | const struct IODevice *mess_device_next(const struct IODevice *dev); |
| 285 | |
| 282 | 286 | /* device lookup */ |
| 283 | 287 | const struct IODevice *device_find_tag(const struct IODevice *devices, const char *tag); |
| 284 | 288 | int device_count_tag(const struct IODevice *devices, const char *tag); |
| 289 | int device_count_tag_from_machine(const running_machine *machine, const char *tag); |
| 285 | 290 | |
| 286 | 291 | /* deprecated: device lookup; both of these function assume only one of each type of device */ |
| 287 | 292 | const struct IODevice *device_find(const struct IODevice *devices, iodevice_t type); |
| 293 | const struct IODevice *device_find_from_machine(const running_machine *machine, iodevice_t type); |
| 288 | 294 | int device_count(iodevice_t type); |
| 289 | 295 | |
| 290 | 296 | /* diagnostics */ |