src/mess/audio/vp550.c
| r5727 | r5728 | |
| 97 | 97 | { |
| 98 | 98 | if (state) |
| 99 | 99 | { |
| 100 | | cpu_set_input_line(device->machine->firstcpu, CDP1802_INPUT_LINE_INT, CLEAR_LINE); |
| 100 | cpu_set_input_line(device, CDP1802_INPUT_LINE_INT, CLEAR_LINE); |
| 101 | 101 | |
| 102 | 102 | if (LOG) logerror("VP550 Clear Interrupt\n"); |
| 103 | 103 | } |
| r5727 | r5728 | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /*------------------------------------------------- |
| 134 | | vp550_vlmna_w - amplitude A write |
| 134 | vp550_vlmn_w - amplitude write |
| 135 | 135 | -------------------------------------------------*/ |
| 136 | 136 | |
| 137 | | static WRITE8_DEVICE_HANDLER( vp550_vlmna_w ) |
| 137 | static WRITE8_DEVICE_HANDLER( vp550_vlmn_w ) |
| 138 | 138 | { |
| 139 | | vp550_t *vp550 = get_safe_token(device); |
| 140 | 139 | float gain = 0.625f * (data & 0x0f); |
| 141 | 140 | |
| 142 | | sound_set_output_gain(vp550->cdp1863[CHANNEL_A], 0, gain); |
| 141 | sound_set_output_gain(device, 0, gain); |
| 143 | 142 | |
| 144 | | if (LOG) logerror("VP550 Volume A: %u\n", data & 0x0f); |
| 143 | if (LOG) logerror("VP550 '%s' Volume: %u\n", device->tag, data & 0x0f); |
| 145 | 144 | } |
| 146 | 145 | |
| 147 | 146 | /*------------------------------------------------- |
| 148 | | vp550_vlmnb_w - amplitude B write |
| 149 | | -------------------------------------------------*/ |
| 150 | | |
| 151 | | static WRITE8_DEVICE_HANDLER( vp550_vlmnb_w ) |
| 152 | | { |
| 153 | | vp550_t *vp550 = get_safe_token(device); |
| 154 | | float gain = 0.625f * (data & 0x0f); |
| 155 | | |
| 156 | | sound_set_output_gain(vp550->cdp1863[CHANNEL_B], 0, gain); |
| 157 | | |
| 158 | | if (LOG) logerror("VP550 Volume B: %u\n", data & 0x0f); |
| 159 | | } |
| 160 | | |
| 161 | | /*------------------------------------------------- |
| 162 | 147 | vp550_sync_w - interrupt enable write |
| 163 | 148 | -------------------------------------------------*/ |
| 164 | 149 | |
| 165 | 150 | static WRITE8_DEVICE_HANDLER( vp550_sync_w ) |
| 166 | 151 | { |
| 167 | | vp550_t *vp550 = get_safe_token(device); |
| 168 | | |
| 169 | | timer_device_enable(vp550->sync_timer, BIT(data, 0)); |
| 152 | timer_device_enable(device, BIT(data, 0)); |
| 170 | 153 | |
| 171 | 154 | if (LOG) logerror("VP550 Interrupt Enable: %u\n", BIT(data, 0)); |
| 172 | 155 | } |
| r5727 | r5728 | |
| 185 | 168 | memory_install_write8_device_handler(program, vp550->cdp1863[CHANNEL_A], 0x8001, 0x8001, 0, 0, cdp1863_str_w); |
| 186 | 169 | memory_install_write8_device_handler(program, vp550->cdp1863[CHANNEL_B], 0x8002, 0x8002, 0, 0, cdp1863_str_w); |
| 187 | 170 | memory_install_write8_device_handler(program, device, 0x8003, 0x8003, 0, 0, vp550_octave_w); |
| 188 | | memory_install_write8_device_handler(program, device, 0x8010, 0x8010, 0, 0, vp550_vlmna_w); |
| 189 | | memory_install_write8_device_handler(program, device, 0x8020, 0x8020, 0, 0, vp550_vlmnb_w); |
| 190 | | memory_install_write8_device_handler(program, device, 0x8030, 0x8030, 0, 0, vp550_sync_w); |
| 171 | memory_install_write8_device_handler(program, vp550->cdp1863[CHANNEL_A], 0x8010, 0x8010, 0, 0, vp550_vlmn_w); |
| 172 | memory_install_write8_device_handler(program, vp550->cdp1863[CHANNEL_B], 0x8020, 0x8020, 0, 0, vp550_vlmn_w); |
| 173 | memory_install_write8_device_handler(program, vp550->sync_timer, 0x8030, 0x8030, 0, 0, vp550_sync_w); |
| 191 | 174 | } |
| 192 | 175 | else |
| 193 | 176 | { |
| r5727 | r5728 | |
| 201 | 184 | } |
| 202 | 185 | |
| 203 | 186 | /*------------------------------------------------- |
| 187 | vp551_install_readwrite_handler - install |
| 188 | or uninstall write handlers |
| 189 | -------------------------------------------------*/ |
| 190 | |
| 191 | void vp551_install_write_handlers(const device_config *device, const address_space *program, int enabled) |
| 192 | { |
| 193 | } |
| 194 | |
| 195 | /*------------------------------------------------- |
| 204 | 196 | TIMER_DEVICE_CALLBACK( sync_tick ) |
| 205 | 197 | -------------------------------------------------*/ |
| 206 | 198 | |
src/mess/drivers/vip.c
| r5727 | r5728 | |
| 540 | 540 | switch (input_port_read(device->machine, "SOUND")) |
| 541 | 541 | { |
| 542 | 542 | case VIP_SOUND_VP550: |
| 543 | | vp550_sc1_w(driver_state->vp550, sc1); |
| 544 | | break; |
| 545 | | |
| 546 | 543 | case VIP_SOUND_VP551: |
| 547 | | // vp551_sc1_w(driver_state->vp551, sc1); |
| 544 | vp550_sc1_w(device, sc1); |
| 548 | 545 | break; |
| 549 | 546 | } |
| 550 | 547 | } |
| r5727 | r5728 | |
| 656 | 653 | state->cdp1862 = devtag_get_device(machine, CDP1862_TAG); |
| 657 | 654 | state->cassette = devtag_get_device(machine, CASSETTE_TAG); |
| 658 | 655 | state->beeper = devtag_get_device(machine, DISCRETE_TAG); |
| 656 | state->vp595 = devtag_get_device(machine, VP595_TAG); |
| 659 | 657 | state->vp550 = devtag_get_device(machine, VP550_TAG); |
| 660 | | state->vp595 = devtag_get_device(machine, VP595_TAG); |
| 658 | state->vp551 = devtag_get_device(machine, VP551_TAG); |
| 661 | 659 | |
| 662 | 660 | /* reset sound */ |
| 663 | 661 | discrete_sound_w(state->beeper, NODE_01, 0); |
| 664 | 662 | vp595_q_w(state->vp595, 0); |
| 665 | 663 | vp550_q_w(state->vp550, 0); |
| 664 | vp550_q_w(state->vp551, 0); |
| 666 | 665 | |
| 667 | 666 | /* register for state saving */ |
| 668 | 667 | state_save_register_global(machine, state->reset); |
| r5727 | r5728 | |
| 684 | 683 | device_reset(state->cdp1862); |
| 685 | 684 | |
| 686 | 685 | /* reset devices */ |
| 686 | device_reset(state->vp595); |
| 687 | 687 | device_reset(state->vp550); |
| 688 | | device_reset(state->vp595); |
| 688 | device_reset(state->vp551); |
| 689 | 689 | |
| 690 | 690 | /* configure video */ |
| 691 | 691 | switch (input_port_read(machine, "VIDEO")) |
| r5727 | r5728 | |
| 707 | 707 | case VIP_SOUND_SPEAKER: |
| 708 | 708 | vp595_install_write_handlers(state->vp595, io, 0); |
| 709 | 709 | vp550_install_write_handlers(state->vp550, program, 0); |
| 710 | | // vp551_install_write_handlers(state->vp551, program, 0); |
| 710 | vp551_install_write_handlers(state->vp551, program, 0); |
| 711 | 711 | break; |
| 712 | 712 | |
| 713 | 713 | case VIP_SOUND_VP595: |
| 714 | 714 | vp595_install_write_handlers(state->vp595, io, 1); |
| 715 | 715 | vp550_install_write_handlers(state->vp550, program, 0); |
| 716 | | // vp551_install_write_handlers(state->vp551, program, 0); |
| 716 | vp551_install_write_handlers(state->vp551, program, 0); |
| 717 | 717 | break; |
| 718 | 718 | |
| 719 | 719 | case VIP_SOUND_VP550: |
| 720 | 720 | vp595_install_write_handlers(state->vp595, io, 0); |
| 721 | 721 | vp550_install_write_handlers(state->vp550, program, 1); |
| 722 | | // vp551_install_write_handlers(state->vp551, program, 0); |
| 722 | vp551_install_write_handlers(state->vp551, program, 0); |
| 723 | 723 | break; |
| 724 | 724 | |
| 725 | 725 | case VIP_SOUND_VP551: |
| 726 | 726 | vp595_install_write_handlers(state->vp595, io, 0); |
| 727 | 727 | vp550_install_write_handlers(state->vp550, program, 0); |
| 728 | | // vp551_install_write_handlers(state->vp551, program, 1); |
| 728 | vp551_install_write_handlers(state->vp551, program, 1); |
| 729 | 729 | break; |
| 730 | 730 | } |
| 731 | 731 | |
| r5727 | r5728 | |
| 776 | 776 | |
| 777 | 777 | MDRV_VP595_ADD |
| 778 | 778 | MDRV_VP550_ADD(XTAL_3_52128MHz/2) |
| 779 | MDRV_VP551_ADD(XTAL_3_52128MHz/2) |
| 779 | 780 | |
| 780 | 781 | /* devices */ |
| 781 | 782 | MDRV_QUICKLOAD_ADD("quickload", vip, "bin,c8,c8x", 0) |