src/emu/devintrf.c
| r5730 | r5731 | |
| 361 | 361 | |
| 362 | 362 | |
| 363 | 363 | /*------------------------------------------------- |
| 364 | device_find_child_by_tag - retrieve a child |
| 365 | device configuration based on a tag |
| 366 | -------------------------------------------------*/ |
| 367 | |
| 368 | const device_config *device_find_child_by_tag(const device_config *owner, const char *tag) |
| 369 | { |
| 370 | astring *tempstring; |
| 371 | const device_config *child; |
| 372 | |
| 373 | assert(owner != NULL); |
| 374 | assert(tag != NULL); |
| 375 | |
| 376 | tempstring = astring_alloc(); |
| 377 | child = device_list_find_by_tag(owner->machine->config->devicelist, device_build_tag(tempstring, owner, tag)); |
| 378 | astring_free(tempstring); |
| 379 | |
| 380 | return child; |
| 381 | } |
| 382 | |
| 383 | |
| 384 | /*------------------------------------------------- |
| 364 | 385 | device_list_index - return the index of a |
| 365 | 386 | device based on its type and tag; |
| 366 | 387 | DEVICE_TYPE_WILDCARD is allowed |
src/mess/audio/vp550.c
| r5730 | r5731 | |
| 136 | 136 | |
| 137 | 137 | static WRITE8_DEVICE_HANDLER( vp550_vlmn_w ) |
| 138 | 138 | { |
| 139 | | float gain = 0.625f * (data & 0x0f); |
| 139 | //float gain = 0.625f * (data & 0x0f); |
| 140 | 140 | |
| 141 | | sound_set_output_gain(device, 0, gain); |
| 141 | // sound_set_output_gain(device, 0, gain); |
| 142 | 142 | |
| 143 | 143 | if (LOG) logerror("VP550 '%s' Volume: %u\n", device->tag, data & 0x0f); |
| 144 | 144 | } |
| r5730 | r5731 | |
| 257 | 257 | vp550_t *vp550 = get_safe_token(device); |
| 258 | 258 | |
| 259 | 259 | /* look up devices */ |
| 260 | | vp550->cdp1863[CHANNEL_A] = devtag_get_device(device->machine, "vp551:u1"); |
| 261 | | vp550->cdp1863[CHANNEL_B] = devtag_get_device(device->machine, "vp551:u2"); |
| 262 | | vp550->cdp1863[CHANNEL_C] = devtag_get_device(device->machine, "vp551:cdp1863c"); |
| 263 | | vp550->cdp1863[CHANNEL_D] = devtag_get_device(device->machine, "vp551:cdp1863d"); |
| 264 | | vp550->sync_timer = devtag_get_device(device->machine, "vp551:sync"); |
| 260 | vp550->cdp1863[CHANNEL_A] = device_find_child_by_tag(device, CDP1863_A_TAG); |
| 261 | vp550->cdp1863[CHANNEL_B] = device_find_child_by_tag(device, CDP1863_B_TAG); |
| 262 | vp550->cdp1863[CHANNEL_C] = device_find_child_by_tag(device, CDP1863_C_TAG); |
| 263 | vp550->cdp1863[CHANNEL_D] = device_find_child_by_tag(device, CDP1863_D_TAG); |
| 264 | vp550->sync_timer = device_find_child_by_tag(device, "sync"); |
| 265 | 265 | |
| 266 | 266 | /* set initial values */ |
| 267 | 267 | vp550->channels = 4; |
src/mess/machine/conkort.c
| r5730 | r5731 | |
| 822 | 822 | static DEVICE_START( luxor_55_10828 ) |
| 823 | 823 | { |
| 824 | 824 | slow_t *conkort = device->token; |
| 825 | | astring *tempstring = astring_alloc(); |
| 826 | 825 | |
| 827 | | /* validate arguments */ |
| 828 | | assert(device->tag != NULL); |
| 829 | | |
| 830 | 826 | /* find our CPU */ |
| 831 | | astring_printf(tempstring, "%s:%s", device->tag, Z80_TAG); |
| 832 | | conkort->cpu = cputag_get_cpu(device->machine, astring_c(tempstring)); |
| 827 | conkort->cpu = device_find_child_by_tag(device, Z80_TAG); |
| 833 | 828 | |
| 834 | 829 | /* find devices */ |
| 835 | | astring_printf(tempstring, "%s:%s", device->tag, Z80PIO_TAG); |
| 836 | | conkort->z80pio = devtag_get_device(device->machine, astring_c(tempstring)); |
| 837 | | astring_printf(tempstring, "%s:%s", device->tag, WD1791_TAG); |
| 838 | | conkort->wd1791 = devtag_get_device(device->machine, astring_c(tempstring)); |
| 830 | conkort->z80pio = device_find_child_by_tag(device, Z80PIO_TAG); |
| 831 | conkort->wd1791 = device_find_child_by_tag(device, WD1791_TAG); |
| 839 | 832 | |
| 840 | 833 | /* register for state saving */ |
| 841 | 834 | state_save_register_device_item(device, 0, conkort->status); |
| 842 | 835 | state_save_register_device_item(device, 0, conkort->data); |
| 843 | 836 | state_save_register_device_item(device, 0, conkort->pio_ardy); |
| 844 | 837 | state_save_register_device_item(device, 0, conkort->fdc_irq); |
| 845 | | |
| 846 | | astring_free(tempstring); |
| 847 | 838 | } |
| 848 | 839 | |
| 849 | 840 | /*------------------------------------------------- |
| r5730 | r5731 | |
| 894 | 885 | static DEVICE_START( luxor_55_21046 ) |
| 895 | 886 | { |
| 896 | 887 | fast_t *conkort = device->token; |
| 897 | | astring *tempstring = astring_alloc(); |
| 898 | 888 | |
| 899 | | /* validate arguments */ |
| 900 | | assert(device->tag != NULL); |
| 901 | | |
| 902 | 889 | /* find our CPU */ |
| 903 | | astring_printf(tempstring, "%s:%s", device->tag, Z80_TAG); |
| 904 | | conkort->cpu = cputag_get_cpu(device->machine, astring_c(tempstring)); |
| 890 | conkort->cpu = device_find_child_by_tag(device, Z80_TAG); |
| 905 | 891 | |
| 906 | 892 | /* find devices */ |
| 907 | | astring_printf(tempstring, "%s:%s", device->tag, Z80DMA_TAG); |
| 908 | | conkort->z80dma = devtag_get_device(device->machine, astring_c(tempstring)); |
| 909 | | astring_printf(tempstring, "%s:%s", device->tag, SAB1793_TAG); |
| 910 | | conkort->wd1793 = devtag_get_device(device->machine, astring_c(tempstring)); |
| 893 | conkort->z80dma = device_find_child_by_tag(device, Z80DMA_TAG); |
| 894 | conkort->wd1793 = device_find_child_by_tag(device, SAB1793_TAG); |
| 911 | 895 | |
| 912 | 896 | /* register for state saving */ |
| 913 | 897 | state_save_register_device_item(device, 0, conkort->status); |
| 914 | 898 | state_save_register_device_item(device, 0, conkort->data); |
| 915 | 899 | state_save_register_device_item(device, 0, conkort->fdc_irq); |
| 916 | | |
| 917 | | astring_free(tempstring); |
| 918 | 900 | } |
| 919 | 901 | |
| 920 | 902 | /*------------------------------------------------- |