trunk/src/mame/drivers/warriorb.c
| r20636 | r20637 | |
| 195 | 195 | |
| 196 | 196 | WRITE8_MEMBER(warriorb_state::warriorb_pancontrol) |
| 197 | 197 | { |
| 198 | | device_t *flt = NULL; |
| 198 | filter_volume_device *flt = NULL; |
| 199 | 199 | offset &= 3; |
| 200 | 200 | |
| 201 | 201 | switch (offset) |
| r20636 | r20637 | |
| 208 | 208 | |
| 209 | 209 | m_pandata[offset] = (data << 1) + data; /* original volume*3 */ |
| 210 | 210 | //popmessage(" pan %02x %02x %02x %02x", m_pandata[0], m_pandata[1], m_pandata[2], m_pandata[3] ); |
| 211 | | flt_volume_set_volume(flt, m_pandata[offset] / 100.0); |
| 211 | flt->flt_volume_set_volume(m_pandata[offset] / 100.0); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | |
| r20636 | r20637 | |
| 517 | 517 | m_lscreen = machine().device("lscreen"); |
| 518 | 518 | m_rscreen = machine().device("rscreen"); |
| 519 | 519 | |
| 520 | | m_2610_1l = machine().device("2610.1.l"); |
| 521 | | m_2610_1r = machine().device("2610.1.r"); |
| 522 | | m_2610_2l = machine().device("2610.2.l"); |
| 523 | | m_2610_2r = machine().device("2610.2.r"); |
| 520 | m_2610_1l = machine().device<filter_volume_device>("2610.1.l"); |
| 521 | m_2610_1r = machine().device<filter_volume_device>("2610.1.r"); |
| 522 | m_2610_2l = machine().device<filter_volume_device>("2610.2.l"); |
| 523 | m_2610_2r = machine().device<filter_volume_device>("2610.2.r"); |
| 524 | 524 | |
| 525 | 525 | save_item(NAME(m_banknum)); |
| 526 | 526 | save_item(NAME(m_pandata)); |
| r20636 | r20637 | |
| 585 | 585 | MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0) |
| 586 | 586 | MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0) |
| 587 | 587 | |
| 588 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 588 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 589 | 589 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 590 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 590 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 591 | 591 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 592 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 592 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 593 | 593 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 594 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 594 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 595 | 595 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 596 | 596 | |
| 597 | 597 | MCFG_TC0140SYT_ADD("tc0140syt", warriorb_tc0140syt_intf) |
| r20636 | r20637 | |
| 648 | 648 | MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0) |
| 649 | 649 | MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0) |
| 650 | 650 | |
| 651 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 651 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 652 | 652 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 653 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 653 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 654 | 654 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 655 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 655 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 656 | 656 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 657 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 657 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 658 | 658 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 659 | 659 | |
| 660 | 660 | MCFG_TC0140SYT_ADD("tc0140syt", warriorb_tc0140syt_intf) |
trunk/src/mame/drivers/lockon.c
| r20636 | r20637 | |
| 405 | 405 | double lgain = gains[data & 0xf]; |
| 406 | 406 | double rgain = gains[data >> 4]; |
| 407 | 407 | |
| 408 | | flt_volume_set_volume(m_f2203_1l, lgain); |
| 409 | | flt_volume_set_volume(m_f2203_2l, lgain); |
| 410 | | flt_volume_set_volume(m_f2203_3l, lgain); |
| 408 | m_f2203_1l->flt_volume_set_volume(lgain); |
| 409 | m_f2203_2l->flt_volume_set_volume(lgain); |
| 410 | m_f2203_3l->flt_volume_set_volume(lgain); |
| 411 | 411 | |
| 412 | | flt_volume_set_volume(m_f2203_1r, rgain); |
| 413 | | flt_volume_set_volume(m_f2203_2r, rgain); |
| 414 | | flt_volume_set_volume(m_f2203_3r, rgain); |
| 412 | m_f2203_1r->flt_volume_set_volume(rgain); |
| 413 | m_f2203_2r->flt_volume_set_volume(rgain); |
| 414 | m_f2203_3r->flt_volume_set_volume(rgain); |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | static void ym2203_irq(device_t *device, int irq) |
| r20636 | r20637 | |
| 456 | 456 | m_audiocpu = machine().device<cpu_device>("audiocpu"); |
| 457 | 457 | m_ground = machine().device("ground"); |
| 458 | 458 | m_object = machine().device("object"); |
| 459 | | m_f2203_1l = machine().device("f2203.1l"); |
| 460 | | m_f2203_2l = machine().device("f2203.2l"); |
| 461 | | m_f2203_3l = machine().device("f2203.3l"); |
| 462 | | m_f2203_1r = machine().device("f2203.1r"); |
| 463 | | m_f2203_2r = machine().device("f2203.2r"); |
| 464 | | m_f2203_3r = machine().device("f2203.3r"); |
| 459 | m_f2203_1l = machine().device<filter_volume_device>("f2203.1l"); |
| 460 | m_f2203_2l = machine().device<filter_volume_device>("f2203.2l"); |
| 461 | m_f2203_3l = machine().device<filter_volume_device>("f2203.3l"); |
| 462 | m_f2203_1r = machine().device<filter_volume_device>("f2203.1r"); |
| 463 | m_f2203_2r = machine().device<filter_volume_device>("f2203.2r"); |
| 464 | m_f2203_3r = machine().device<filter_volume_device>("f2203.3r"); |
| 465 | 465 | |
| 466 | 466 | save_item(NAME(m_ground_ctrl)); |
| 467 | 467 | save_item(NAME(m_scroll_h)); |
| r20636 | r20637 | |
| 544 | 544 | MCFG_SOUND_ROUTE(3, "f2203.3l", 1.0) |
| 545 | 545 | MCFG_SOUND_ROUTE(3, "f2203.3r", 1.0) |
| 546 | 546 | |
| 547 | | MCFG_SOUND_ADD("f2203.1l", FILTER_VOLUME, 0) |
| 547 | MCFG_FILTER_VOLUME_ADD("f2203.1l", 0) |
| 548 | 548 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 549 | | MCFG_SOUND_ADD("f2203.1r", FILTER_VOLUME, 0) |
| 549 | MCFG_FILTER_VOLUME_ADD("f2203.1r", 0) |
| 550 | 550 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 551 | | MCFG_SOUND_ADD("f2203.2l", FILTER_VOLUME, 0) |
| 551 | MCFG_FILTER_VOLUME_ADD("f2203.2l", 0) |
| 552 | 552 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 553 | | MCFG_SOUND_ADD("f2203.2r", FILTER_VOLUME, 0) |
| 553 | MCFG_FILTER_VOLUME_ADD("f2203.2r", 0) |
| 554 | 554 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 555 | | MCFG_SOUND_ADD("f2203.3l", FILTER_VOLUME, 0) |
| 555 | MCFG_FILTER_VOLUME_ADD("f2203.3l", 0) |
| 556 | 556 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 557 | | MCFG_SOUND_ADD("f2203.3r", FILTER_VOLUME, 0) |
| 557 | MCFG_FILTER_VOLUME_ADD("f2203.3r", 0) |
| 558 | 558 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 559 | 559 | MACHINE_CONFIG_END |
| 560 | 560 | |
trunk/src/mame/drivers/othunder.c
| r20636 | r20637 | |
| 424 | 424 | because we are using the AY-3-8910 emulation. */ |
| 425 | 425 | volr = (m_pan[0] + m_pan[2]) * 100 / (2 * 0x1f); |
| 426 | 426 | voll = (m_pan[1] + m_pan[3]) * 100 / (2 * 0x1f); |
| 427 | | flt_volume_set_volume(m_2610_0l, voll / 100.0); |
| 428 | | flt_volume_set_volume(m_2610_0r, volr / 100.0); |
| 427 | m_2610_0l->flt_volume_set_volume(voll / 100.0); |
| 428 | m_2610_0r->flt_volume_set_volume(volr / 100.0); |
| 429 | 429 | |
| 430 | 430 | /* CH1 */ |
| 431 | 431 | volr = m_pan[0] * 100 / 0x1f; |
| 432 | 432 | voll = m_pan[1] * 100 / 0x1f; |
| 433 | | flt_volume_set_volume(m_2610_1l, voll / 100.0); |
| 434 | | flt_volume_set_volume(m_2610_1r, volr / 100.0); |
| 433 | m_2610_1l->flt_volume_set_volume(voll / 100.0); |
| 434 | m_2610_1r->flt_volume_set_volume(volr / 100.0); |
| 435 | 435 | |
| 436 | 436 | /* CH2 */ |
| 437 | 437 | volr = m_pan[2] * 100 / 0x1f; |
| 438 | 438 | voll = m_pan[3] * 100 / 0x1f; |
| 439 | | flt_volume_set_volume(m_2610_2l, voll / 100.0); |
| 440 | | flt_volume_set_volume(m_2610_2r, volr / 100.0); |
| 439 | m_2610_2l->flt_volume_set_volume(voll / 100.0); |
| 440 | m_2610_2r->flt_volume_set_volume(volr / 100.0); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | |
| r20636 | r20637 | |
| 674 | 674 | m_tc0100scn = machine().device("tc0100scn"); |
| 675 | 675 | m_tc0110pcr = machine().device("tc0110pcr"); |
| 676 | 676 | m_tc0140syt = machine().device("tc0140syt"); |
| 677 | | m_2610_0l = machine().device("2610.0l"); |
| 678 | | m_2610_0r = machine().device("2610.0r"); |
| 679 | | m_2610_1l = machine().device("2610.1l"); |
| 680 | | m_2610_1r = machine().device("2610.1r"); |
| 681 | | m_2610_2l = machine().device("2610.2l"); |
| 682 | | m_2610_2r = machine().device("2610.2r"); |
| 677 | m_2610_0l = machine().device<filter_volume_device>("2610.0l"); |
| 678 | m_2610_0r = machine().device<filter_volume_device>("2610.0r"); |
| 679 | m_2610_1l = machine().device<filter_volume_device>("2610.1l"); |
| 680 | m_2610_1r = machine().device<filter_volume_device>("2610.1r"); |
| 681 | m_2610_2l = machine().device<filter_volume_device>("2610.2l"); |
| 682 | m_2610_2r = machine().device<filter_volume_device>("2610.2r"); |
| 683 | 683 | |
| 684 | 684 | save_item(NAME(m_vblank_irq)); |
| 685 | 685 | save_item(NAME(m_ad_irq)); |
| r20636 | r20637 | |
| 738 | 738 | MCFG_SOUND_ROUTE(2, "2610.2l", 1.0) |
| 739 | 739 | MCFG_SOUND_ROUTE(2, "2610.2r", 1.0) |
| 740 | 740 | |
| 741 | | MCFG_SOUND_ADD("2610.0l", FILTER_VOLUME, 0) |
| 741 | MCFG_FILTER_VOLUME_ADD("2610.0l", 0) |
| 742 | 742 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 743 | | MCFG_SOUND_ADD("2610.0r", FILTER_VOLUME, 0) |
| 743 | MCFG_FILTER_VOLUME_ADD("2610.0r", 0) |
| 744 | 744 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 745 | | MCFG_SOUND_ADD("2610.1l", FILTER_VOLUME, 0) |
| 745 | MCFG_FILTER_VOLUME_ADD("2610.1l", 0) |
| 746 | 746 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 747 | | MCFG_SOUND_ADD("2610.1r", FILTER_VOLUME, 0) |
| 747 | MCFG_FILTER_VOLUME_ADD("2610.1r", 0) |
| 748 | 748 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 749 | | MCFG_SOUND_ADD("2610.2l", FILTER_VOLUME, 0) |
| 749 | MCFG_FILTER_VOLUME_ADD("2610.2l", 0) |
| 750 | 750 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 751 | | MCFG_SOUND_ADD("2610.2r", FILTER_VOLUME, 0) |
| 751 | MCFG_FILTER_VOLUME_ADD("2610.2r", 0) |
| 752 | 752 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 753 | 753 | |
| 754 | 754 | MCFG_TC0140SYT_ADD("tc0140syt", othunder_tc0140syt_intf) |
trunk/src/mame/drivers/taito_z.c
| r20636 | r20637 | |
| 1475 | 1475 | WRITE8_MEMBER(taitoz_state::taitoz_pancontrol) |
| 1476 | 1476 | { |
| 1477 | 1477 | static const char *const fltname[] = { "2610.1.r", "2610.1.l", "2610.2.r", "2610.2.l" }; |
| 1478 | | flt_volume_set_volume(machine().device(fltname[offset & 3]), data / 255.0f); |
| 1478 | dynamic_cast<filter_volume_device*>(machine().device(fltname[offset & 3]))->flt_volume_set_volume(data / 255.0f); |
| 1479 | 1479 | } |
| 1480 | 1480 | |
| 1481 | 1481 | WRITE16_MEMBER(taitoz_state::spacegun_pancontrol) |
| r20636 | r20637 | |
| 3122 | 3122 | MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0) |
| 3123 | 3123 | MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0) |
| 3124 | 3124 | |
| 3125 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 3125 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 3126 | 3126 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0) |
| 3127 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 3127 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 3128 | 3128 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0) |
| 3129 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 3129 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 3130 | 3130 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0) |
| 3131 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 3131 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 3132 | 3132 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0) |
| 3133 | 3133 | |
| 3134 | 3134 | MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf) |
| r20636 | r20637 | |
| 3184 | 3184 | MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0) |
| 3185 | 3185 | MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0) |
| 3186 | 3186 | |
| 3187 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 3187 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 3188 | 3188 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0) |
| 3189 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 3189 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 3190 | 3190 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0) |
| 3191 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 3191 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 3192 | 3192 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0) |
| 3193 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 3193 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 3194 | 3194 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0) |
| 3195 | 3195 | |
| 3196 | 3196 | MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf) |
| r20636 | r20637 | |
| 3247 | 3247 | MCFG_SOUND_ROUTE(2, "2610.2.l", 20.0) |
| 3248 | 3248 | MCFG_SOUND_ROUTE(2, "2610.2.r", 20.0) |
| 3249 | 3249 | |
| 3250 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 3250 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 3251 | 3251 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3252 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 3252 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 3253 | 3253 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3254 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 3254 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 3255 | 3255 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3256 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 3256 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 3257 | 3257 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3258 | 3258 | |
| 3259 | 3259 | MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf) |
| r20636 | r20637 | |
| 3306 | 3306 | MCFG_SOUND_ROUTE(2, "2610.2.l", 28.0) |
| 3307 | 3307 | MCFG_SOUND_ROUTE(2, "2610.2.r", 28.0) |
| 3308 | 3308 | |
| 3309 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 3309 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 3310 | 3310 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3311 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 3311 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 3312 | 3312 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3313 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 3313 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 3314 | 3314 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3315 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 3315 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 3316 | 3316 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3317 | 3317 | |
| 3318 | 3318 | MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf) |
| r20636 | r20637 | |
| 3377 | 3377 | MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0) |
| 3378 | 3378 | MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0) |
| 3379 | 3379 | |
| 3380 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 3380 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 3381 | 3381 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3382 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 3382 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 3383 | 3383 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3384 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 3384 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 3385 | 3385 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3386 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 3386 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 3387 | 3387 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3388 | 3388 | |
| 3389 | 3389 | MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf) |
| r20636 | r20637 | |
| 3441 | 3441 | MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0) |
| 3442 | 3442 | MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0) |
| 3443 | 3443 | |
| 3444 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 3444 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 3445 | 3445 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0) |
| 3446 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 3446 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 3447 | 3447 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0) |
| 3448 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 3448 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 3449 | 3449 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rear", 1.0) |
| 3450 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 3450 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 3451 | 3451 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0) |
| 3452 | 3452 | |
| 3453 | 3453 | MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf) |
| r20636 | r20637 | |
| 3504 | 3504 | MCFG_SOUND_ROUTE(2, "2610.2.l", 2.0) |
| 3505 | 3505 | MCFG_SOUND_ROUTE(2, "2610.2.r", 2.0) |
| 3506 | 3506 | |
| 3507 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 3507 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 3508 | 3508 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3509 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 3509 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 3510 | 3510 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3511 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 3511 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 3512 | 3512 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3513 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 3513 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 3514 | 3514 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3515 | 3515 | |
| 3516 | 3516 | MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf) |
| r20636 | r20637 | |
| 3563 | 3563 | MCFG_SOUND_ROUTE(2, "2610.2.l", 8.0) |
| 3564 | 3564 | MCFG_SOUND_ROUTE(2, "2610.2.r", 8.0) |
| 3565 | 3565 | |
| 3566 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 3566 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 3567 | 3567 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3568 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 3568 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 3569 | 3569 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3570 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 3570 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 3571 | 3571 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3572 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 3572 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 3573 | 3573 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3574 | 3574 | |
| 3575 | 3575 | MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf) |
| r20636 | r20637 | |
| 3625 | 3625 | MCFG_SOUND_ROUTE(2, "2610.2.l", 8.0) |
| 3626 | 3626 | MCFG_SOUND_ROUTE(2, "2610.2.r", 8.0) |
| 3627 | 3627 | |
| 3628 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 3628 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 3629 | 3629 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3630 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 3630 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 3631 | 3631 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3632 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 3632 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 3633 | 3633 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3634 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 3634 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 3635 | 3635 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3636 | 3636 | |
| 3637 | 3637 | MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf) |
| r20636 | r20637 | |
| 3687 | 3687 | MCFG_SOUND_ROUTE(2, "2610.2.l", 8.0) |
| 3688 | 3688 | MCFG_SOUND_ROUTE(2, "2610.2.r", 8.0) |
| 3689 | 3689 | |
| 3690 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 3690 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 3691 | 3691 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3692 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 3692 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 3693 | 3693 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3694 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 3694 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 3695 | 3695 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 3696 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 3696 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 3697 | 3697 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 3698 | 3698 | |
| 3699 | 3699 | MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf) |
trunk/src/mame/drivers/ninjaw.c
| r20636 | r20637 | |
| 389 | 389 | |
| 390 | 390 | WRITE8_MEMBER(ninjaw_state::ninjaw_pancontrol) |
| 391 | 391 | { |
| 392 | | device_t *flt = NULL; |
| 392 | filter_volume_device *flt = NULL; |
| 393 | 393 | offset &= 3; |
| 394 | 394 | |
| 395 | 395 | switch (offset) |
| r20636 | r20637 | |
| 402 | 402 | |
| 403 | 403 | m_pandata[offset] = (float)data * (100.f / 255.0f); |
| 404 | 404 | //popmessage(" pan %02x %02x %02x %02x", m_pandata[0], m_pandata[1], m_pandata[2], m_pandata[3] ); |
| 405 | | flt_volume_set_volume(flt, m_pandata[offset] / 100.0); |
| 405 | flt->flt_volume_set_volume(m_pandata[offset] / 100.0); |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | |
| r20636 | r20637 | |
| 811 | 811 | m_mscreen = machine().device("mscreen"); |
| 812 | 812 | m_rscreen = machine().device("rscreen"); |
| 813 | 813 | |
| 814 | | m_2610_1l = machine().device("2610.1.l"); |
| 815 | | m_2610_1r = machine().device("2610.1.r"); |
| 816 | | m_2610_2l = machine().device("2610.2.l"); |
| 817 | | m_2610_2r = machine().device("2610.2.r"); |
| 814 | m_2610_1l = machine().device<filter_volume_device>("2610.1.l"); |
| 815 | m_2610_1r = machine().device<filter_volume_device>("2610.1.r"); |
| 816 | m_2610_2l = machine().device<filter_volume_device>("2610.2.l"); |
| 817 | m_2610_2r = machine().device<filter_volume_device>("2610.2.r"); |
| 818 | 818 | |
| 819 | 819 | save_item(NAME(m_cpua_ctrl)); |
| 820 | 820 | save_item(NAME(m_banknum)); |
| r20636 | r20637 | |
| 897 | 897 | MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0) |
| 898 | 898 | MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0) |
| 899 | 899 | |
| 900 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 900 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 901 | 901 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 902 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 902 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 903 | 903 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 904 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 904 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 905 | 905 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 906 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 906 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 907 | 907 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 908 | 908 | |
| 909 | 909 | // MCFG_SOUND_ADD("subwoofer", SUBWOOFER, 0) |
| r20636 | r20637 | |
| 977 | 977 | MCFG_SOUND_ROUTE(2, "2610.2.l", 1.0) |
| 978 | 978 | MCFG_SOUND_ROUTE(2, "2610.2.r", 1.0) |
| 979 | 979 | |
| 980 | | MCFG_SOUND_ADD("2610.1.l", FILTER_VOLUME, 0) |
| 980 | MCFG_FILTER_VOLUME_ADD("2610.1.l", 0) |
| 981 | 981 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 982 | | MCFG_SOUND_ADD("2610.1.r", FILTER_VOLUME, 0) |
| 982 | MCFG_FILTER_VOLUME_ADD("2610.1.r", 0) |
| 983 | 983 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 984 | | MCFG_SOUND_ADD("2610.2.l", FILTER_VOLUME, 0) |
| 984 | MCFG_FILTER_VOLUME_ADD("2610.2.l", 0) |
| 985 | 985 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 986 | | MCFG_SOUND_ADD("2610.2.r", FILTER_VOLUME, 0) |
| 986 | MCFG_FILTER_VOLUME_ADD("2610.2.r", 0) |
| 987 | 987 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 988 | 988 | |
| 989 | 989 | // MCFG_SOUND_ADD("subwoofer", SUBWOOFER, 0) |
trunk/src/mame/drivers/darius.c
| r20636 | r20637 | |
| 307 | 307 | int right = ((0xff - state->m_pan[0]) * state->m_vol[6]) >> 8; |
| 308 | 308 | |
| 309 | 309 | if (state->m_filter0_3l != NULL) |
| 310 | | flt_volume_set_volume(state->m_filter0_3l, left / 100.0); |
| 310 | state->m_filter0_3l->flt_volume_set_volume(left / 100.0); |
| 311 | 311 | if (state->m_filter0_3r != NULL) |
| 312 | | flt_volume_set_volume(state->m_filter0_3r, right / 100.0); /* FM #0 */ |
| 312 | state->m_filter0_3r->flt_volume_set_volume(right / 100.0); /* FM #0 */ |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | static void update_fm1( running_machine &machine ) |
| r20636 | r20637 | |
| 319 | 319 | int right = ((0xff - state->m_pan[1]) * state->m_vol[7]) >> 8; |
| 320 | 320 | |
| 321 | 321 | if (state->m_filter1_3l != NULL) |
| 322 | | flt_volume_set_volume(state->m_filter1_3l, left / 100.0); |
| 322 | state->m_filter1_3l->flt_volume_set_volume(left / 100.0); |
| 323 | 323 | if (state->m_filter1_3r != NULL) |
| 324 | | flt_volume_set_volume(state->m_filter1_3r, right / 100.0); /* FM #1 */ |
| 324 | state->m_filter1_3r->flt_volume_set_volume(right / 100.0); /* FM #1 */ |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | static void update_psg0( running_machine &machine, int port ) |
| 328 | 328 | { |
| 329 | 329 | darius_state *state = machine.driver_data<darius_state>(); |
| 330 | | device_t *lvol = NULL, *rvol = NULL; |
| 330 | filter_volume_device *lvol = NULL, *rvol = NULL; |
| 331 | 331 | int left, right; |
| 332 | 332 | |
| 333 | 333 | switch (port) |
| r20636 | r20637 | |
| 342 | 342 | right = ((0xff - state->m_pan[2]) * state->m_vol[port]) >> 8; |
| 343 | 343 | |
| 344 | 344 | if (lvol != NULL) |
| 345 | | flt_volume_set_volume(lvol, left / 100.0); |
| 345 | lvol->flt_volume_set_volume(left / 100.0); |
| 346 | 346 | if (rvol != NULL) |
| 347 | | flt_volume_set_volume(rvol, right / 100.0); |
| 347 | rvol->flt_volume_set_volume(right / 100.0); |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | static void update_psg1( running_machine &machine, int port ) |
| 351 | 351 | { |
| 352 | 352 | darius_state *state = machine.driver_data<darius_state>(); |
| 353 | | device_t *lvol = NULL, *rvol = NULL; |
| 353 | filter_volume_device *lvol = NULL, *rvol = NULL; |
| 354 | 354 | int left, right; |
| 355 | 355 | |
| 356 | 356 | switch (port) |
| r20636 | r20637 | |
| 365 | 365 | right = ((0xff - state->m_pan[3]) * state->m_vol[port + 3]) >> 8; |
| 366 | 366 | |
| 367 | 367 | if (lvol != NULL) |
| 368 | | flt_volume_set_volume(lvol, left / 100.0); |
| 368 | lvol->flt_volume_set_volume(left / 100.0); |
| 369 | 369 | if (rvol != NULL) |
| 370 | | flt_volume_set_volume(rvol, right / 100.0); |
| 370 | rvol->flt_volume_set_volume(right / 100.0); |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | static void update_da( running_machine &machine ) |
| r20636 | r20637 | |
| 377 | 377 | int right = state->m_def_vol[(state->m_pan[4] >> 0) & 0x0f]; |
| 378 | 378 | |
| 379 | 379 | if (state->m_msm5205_l != NULL) |
| 380 | | flt_volume_set_volume(state->m_msm5205_l, left / 100.0); |
| 380 | state->m_msm5205_l->flt_volume_set_volume(left / 100.0); |
| 381 | 381 | if (state->m_msm5205_r != NULL) |
| 382 | | flt_volume_set_volume(state->m_msm5205_r, right / 100.0); |
| 382 | state->m_msm5205_r->flt_volume_set_volume(right / 100.0); |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | WRITE8_MEMBER(darius_state::darius_fm0_pan) |
| r20636 | r20637 | |
| 843 | 843 | m_mscreen = machine().device("mscreen"); |
| 844 | 844 | m_rscreen = machine().device("rscreen"); |
| 845 | 845 | |
| 846 | | m_filter0_0l = machine().device("filter0.0l"); |
| 847 | | m_filter0_0r = machine().device("filter0.0r"); |
| 848 | | m_filter0_1l = machine().device("filter0.1l"); |
| 849 | | m_filter0_1r = machine().device("filter0.1r"); |
| 850 | | m_filter0_2l = machine().device("filter0.2l"); |
| 851 | | m_filter0_2r = machine().device("filter0.2r"); |
| 852 | | m_filter0_3l = machine().device("filter0.3l"); |
| 853 | | m_filter0_3r = machine().device("filter0.3r"); |
| 846 | m_filter0_0l = machine().device<filter_volume_device>("filter0.0l"); |
| 847 | m_filter0_0r = machine().device<filter_volume_device>("filter0.0r"); |
| 848 | m_filter0_1l = machine().device<filter_volume_device>("filter0.1l"); |
| 849 | m_filter0_1r = machine().device<filter_volume_device>("filter0.1r"); |
| 850 | m_filter0_2l = machine().device<filter_volume_device>("filter0.2l"); |
| 851 | m_filter0_2r = machine().device<filter_volume_device>("filter0.2r"); |
| 852 | m_filter0_3l = machine().device<filter_volume_device>("filter0.3l"); |
| 853 | m_filter0_3r = machine().device<filter_volume_device>("filter0.3r"); |
| 854 | 854 | |
| 855 | | m_filter1_0l = machine().device("filter1.0l"); |
| 856 | | m_filter1_0r = machine().device("filter1.0r"); |
| 857 | | m_filter1_1l = machine().device("filter1.1l"); |
| 858 | | m_filter1_1r = machine().device("filter1.1r"); |
| 859 | | m_filter1_2l = machine().device("filter1.2l"); |
| 860 | | m_filter1_2r = machine().device("filter1.2r"); |
| 861 | | m_filter1_3l = machine().device("filter1.3l"); |
| 862 | | m_filter1_3r = machine().device("filter1.3r"); |
| 855 | m_filter1_0l = machine().device<filter_volume_device>("filter1.0l"); |
| 856 | m_filter1_0r = machine().device<filter_volume_device>("filter1.0r"); |
| 857 | m_filter1_1l = machine().device<filter_volume_device>("filter1.1l"); |
| 858 | m_filter1_1r = machine().device<filter_volume_device>("filter1.1r"); |
| 859 | m_filter1_2l = machine().device<filter_volume_device>("filter1.2l"); |
| 860 | m_filter1_2r = machine().device<filter_volume_device>("filter1.2r"); |
| 861 | m_filter1_3l = machine().device<filter_volume_device>("filter1.3l"); |
| 862 | m_filter1_3r = machine().device<filter_volume_device>("filter1.3r"); |
| 863 | 863 | |
| 864 | | m_msm5205_l = machine().device("msm5205.l"); |
| 865 | | m_msm5205_r = machine().device("msm5205.r"); |
| 864 | m_msm5205_l = machine().device<filter_volume_device>("msm5205.l"); |
| 865 | m_msm5205_r = machine().device<filter_volume_device>("msm5205.r"); |
| 866 | 866 | |
| 867 | 867 | save_item(NAME(m_cpua_ctrl)); |
| 868 | 868 | save_item(NAME(m_coin_word)); |
| r20636 | r20637 | |
| 982 | 982 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msm5205.l", 1.0) |
| 983 | 983 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msm5205.r", 1.0) |
| 984 | 984 | |
| 985 | | MCFG_SOUND_ADD("filter0.0l", FILTER_VOLUME, 0) |
| 985 | MCFG_FILTER_VOLUME_ADD("filter0.0l", 0) |
| 986 | 986 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 987 | | MCFG_SOUND_ADD("filter0.0r", FILTER_VOLUME, 0) |
| 987 | MCFG_FILTER_VOLUME_ADD("filter0.0r", 0) |
| 988 | 988 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 989 | | MCFG_SOUND_ADD("filter0.1l", FILTER_VOLUME, 0) |
| 989 | MCFG_FILTER_VOLUME_ADD("filter0.1l", 0) |
| 990 | 990 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 991 | | MCFG_SOUND_ADD("filter0.1r", FILTER_VOLUME, 0) |
| 991 | MCFG_FILTER_VOLUME_ADD("filter0.1r", 0) |
| 992 | 992 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 993 | | MCFG_SOUND_ADD("filter0.2l", FILTER_VOLUME, 0) |
| 993 | MCFG_FILTER_VOLUME_ADD("filter0.2l", 0) |
| 994 | 994 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 995 | | MCFG_SOUND_ADD("filter0.2r", FILTER_VOLUME, 0) |
| 995 | MCFG_FILTER_VOLUME_ADD("filter0.2r", 0) |
| 996 | 996 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 997 | | MCFG_SOUND_ADD("filter0.3l", FILTER_VOLUME, 0) |
| 997 | MCFG_FILTER_VOLUME_ADD("filter0.3l", 0) |
| 998 | 998 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 999 | | MCFG_SOUND_ADD("filter0.3r", FILTER_VOLUME, 0) |
| 999 | MCFG_FILTER_VOLUME_ADD("filter0.3r", 0) |
| 1000 | 1000 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1001 | 1001 | |
| 1002 | | MCFG_SOUND_ADD("filter1.0l", FILTER_VOLUME, 0) |
| 1002 | MCFG_FILTER_VOLUME_ADD("filter1.0l", 0) |
| 1003 | 1003 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 1004 | | MCFG_SOUND_ADD("filter1.0r", FILTER_VOLUME, 0) |
| 1004 | MCFG_FILTER_VOLUME_ADD("filter1.0r", 0) |
| 1005 | 1005 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1006 | | MCFG_SOUND_ADD("filter1.1l", FILTER_VOLUME, 0) |
| 1006 | MCFG_FILTER_VOLUME_ADD("filter1.1l", 0) |
| 1007 | 1007 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 1008 | | MCFG_SOUND_ADD("filter1.1r", FILTER_VOLUME, 0) |
| 1008 | MCFG_FILTER_VOLUME_ADD("filter1.1r", 0) |
| 1009 | 1009 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1010 | | MCFG_SOUND_ADD("filter1.2l", FILTER_VOLUME, 0) |
| 1010 | MCFG_FILTER_VOLUME_ADD("filter1.2l", 0) |
| 1011 | 1011 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 1012 | | MCFG_SOUND_ADD("filter1.2r", FILTER_VOLUME, 0) |
| 1012 | MCFG_FILTER_VOLUME_ADD("filter1.2r", 0) |
| 1013 | 1013 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1014 | | MCFG_SOUND_ADD("filter1.3l", FILTER_VOLUME, 0) |
| 1014 | MCFG_FILTER_VOLUME_ADD("filter1.3l", 0) |
| 1015 | 1015 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 1016 | | MCFG_SOUND_ADD("filter1.3r", FILTER_VOLUME, 0) |
| 1016 | MCFG_FILTER_VOLUME_ADD("filter1.3r", 0) |
| 1017 | 1017 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1018 | 1018 | |
| 1019 | | MCFG_SOUND_ADD("msm5205.l", FILTER_VOLUME, 0) |
| 1019 | MCFG_FILTER_VOLUME_ADD("msm5205.l", 0) |
| 1020 | 1020 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 1021 | | MCFG_SOUND_ADD("msm5205.r", FILTER_VOLUME, 0) |
| 1021 | MCFG_FILTER_VOLUME_ADD("msm5205.r", 0) |
| 1022 | 1022 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1023 | 1023 | |
| 1024 | 1024 | MCFG_TC0140SYT_ADD("tc0140syt", darius_tc0140syt_intf) |
trunk/src/emu/sound/flt_rc.c
| r20636 | r20637 | |
| 1 | 1 | #include "emu.h" |
| 2 | 2 | #include "flt_rc.h" |
| 3 | 3 | |
| 4 | | struct filter_rc_state |
| 4 | |
| 5 | const flt_rc_config flt_rc_ac_default = {FLT_RC_AC, 10000, 0, 0, CAP_U(1)}; |
| 6 | |
| 7 | |
| 8 | // device type definition |
| 9 | const device_type FILTER_RC = &device_creator<filter_rc_device>; |
| 10 | |
| 11 | |
| 12 | //************************************************************************** |
| 13 | // LIVE DEVICE |
| 14 | //************************************************************************** |
| 15 | |
| 16 | //------------------------------------------------- |
| 17 | // qsound_device - constructor |
| 18 | //------------------------------------------------- |
| 19 | |
| 20 | filter_rc_device::filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 21 | : device_t(mconfig, FILTER_RC, "RC Filter", tag, owner, clock), |
| 22 | device_sound_interface(mconfig, *this), |
| 23 | m_stream(NULL), |
| 24 | m_k(0), |
| 25 | m_memory(0), |
| 26 | m_type(0) |
| 5 | 27 | { |
| 6 | | device_t *device; |
| 7 | | sound_stream * stream; |
| 8 | | int k; |
| 9 | | int memory; |
| 10 | | int type; |
| 11 | | }; |
| 28 | } |
| 12 | 29 | |
| 13 | | INLINE filter_rc_state *get_safe_token(device_t *device) |
| 30 | |
| 31 | //------------------------------------------------- |
| 32 | // device_start - device-specific startup |
| 33 | //------------------------------------------------- |
| 34 | |
| 35 | void filter_rc_device::device_start() |
| 14 | 36 | { |
| 15 | | assert(device != NULL); |
| 16 | | assert(device->type() == FILTER_RC); |
| 17 | | return (filter_rc_state *)downcast<filter_rc_device *>(device)->token(); |
| 37 | const flt_rc_config *conf = (const flt_rc_config *)static_config(); |
| 38 | |
| 39 | m_stream = stream_alloc(1, 1, machine().sample_rate()); |
| 40 | if (conf) |
| 41 | set_RC_info(conf->type, conf->R1, conf->R2, conf->R3, conf->C); |
| 42 | else |
| 43 | set_RC_info(FLT_RC_LOWPASS, 1, 1, 1, 0); |
| 18 | 44 | } |
| 19 | 45 | |
| 20 | | const flt_rc_config flt_rc_ac_default = {FLT_RC_AC, 10000, 0, 0, CAP_U(1)}; |
| 21 | 46 | |
| 47 | //------------------------------------------------- |
| 48 | // sound_stream_update - handle a stream update |
| 49 | //------------------------------------------------- |
| 22 | 50 | |
| 23 | | static STREAM_UPDATE( filter_rc_update ) |
| 51 | void filter_rc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 24 | 52 | { |
| 25 | 53 | stream_sample_t *src = inputs[0]; |
| 26 | 54 | stream_sample_t *dst = outputs[0]; |
| 27 | | filter_rc_state *info = (filter_rc_state *)param; |
| 28 | | int memory = info->memory; |
| 55 | int memory = m_memory; |
| 29 | 56 | |
| 30 | | switch (info->type) |
| 57 | switch (m_type) |
| 31 | 58 | { |
| 32 | 59 | case FLT_RC_LOWPASS: |
| 33 | 60 | while (samples--) |
| 34 | 61 | { |
| 35 | | memory += ((*src++ - memory) * info->k) / 0x10000; |
| 62 | memory += ((*src++ - memory) * m_k) / 0x10000; |
| 36 | 63 | *dst++ = memory; |
| 37 | 64 | } |
| 38 | 65 | break; |
| r20636 | r20637 | |
| 41 | 68 | while (samples--) |
| 42 | 69 | { |
| 43 | 70 | *dst++ = *src - memory; |
| 44 | | memory += ((*src++ - memory) * info->k) / 0x10000; |
| 71 | memory += ((*src++ - memory) * m_k) / 0x10000; |
| 45 | 72 | } |
| 46 | 73 | break; |
| 47 | 74 | } |
| 48 | | info->memory = memory; |
| 75 | m_memory = memory; |
| 49 | 76 | } |
| 50 | 77 | |
| 51 | | static void set_RC_info(filter_rc_state *info, int type, double R1, double R2, double R3, double C) |
| 78 | |
| 79 | void filter_rc_device::set_RC_info(int type, double R1, double R2, double R3, double C) |
| 52 | 80 | { |
| 53 | 81 | double Req; |
| 54 | 82 | |
| 55 | | info->type = type; |
| 83 | m_type = type; |
| 56 | 84 | |
| 57 | | switch (info->type) |
| 85 | switch (m_type) |
| 58 | 86 | { |
| 59 | 87 | case FLT_RC_LOWPASS: |
| 60 | 88 | if (C == 0.0) |
| 61 | 89 | { |
| 62 | 90 | /* filter disabled */ |
| 63 | | info->k = 0x10000; |
| 91 | m_k = 0x10000; |
| 64 | 92 | return; |
| 65 | 93 | } |
| 66 | 94 | Req = (R1 * (R2 + R3)) / (R1 + R2 + R3); |
| r20636 | r20637 | |
| 70 | 98 | if (C == 0.0) |
| 71 | 99 | { |
| 72 | 100 | /* filter disabled */ |
| 73 | | info->k = 0x0; |
| 74 | | info->memory = 0x0; |
| 101 | m_k = 0x0; |
| 102 | m_memory = 0x0; |
| 75 | 103 | return; |
| 76 | 104 | } |
| 77 | 105 | Req = R1; |
| 78 | 106 | break; |
| 79 | 107 | default: |
| 80 | | fatalerror("filter_rc_setRC: Wrong filter type %d\n", info->type); |
| 108 | fatalerror("filter_rc_setRC: Wrong filter type %d\n", m_type); |
| 81 | 109 | } |
| 82 | 110 | |
| 83 | 111 | /* Cut Frequency = 1/(2*Pi*Req*C) */ |
| 84 | 112 | /* k = (1-(EXP(-TIMEDELTA/RC))) */ |
| 85 | | info->k = 0x10000 - 0x10000 * (exp(-1 / (Req * C) / info->device->machine().sample_rate())); |
| 113 | m_k = 0x10000 - 0x10000 * (exp(-1 / (Req * C) / machine().sample_rate())); |
| 86 | 114 | } |
| 87 | 115 | |
| 88 | 116 | |
| 89 | | static DEVICE_START( filter_rc ) |
| 117 | void filter_rc_device::filter_rc_set_RC(int type, double R1, double R2, double R3, double C) |
| 90 | 118 | { |
| 91 | | filter_rc_state *info = get_safe_token(device); |
| 92 | | const flt_rc_config *conf = (const flt_rc_config *)device->static_config(); |
| 93 | | |
| 94 | | info->device = device; |
| 95 | | info->stream = device->machine().sound().stream_alloc(*device, 1, 1, device->machine().sample_rate(), info, filter_rc_update); |
| 96 | | if (conf) |
| 97 | | set_RC_info(info, conf->type, conf->R1, conf->R2, conf->R3, conf->C); |
| 98 | | else |
| 99 | | set_RC_info(info, FLT_RC_LOWPASS, 1, 1, 1, 0); |
| 119 | m_stream->update(); |
| 120 | set_RC_info(type, R1, R2, R3, C); |
| 100 | 121 | } |
| 101 | 122 | |
| 102 | | |
| 103 | | void filter_rc_set_RC(device_t *device, int type, double R1, double R2, double R3, double C) |
| 104 | | { |
| 105 | | filter_rc_state *info = get_safe_token(device); |
| 106 | | |
| 107 | | info->stream->update(); |
| 108 | | |
| 109 | | set_RC_info(info, type, R1, R2, R3, C); |
| 110 | | |
| 111 | | } |
| 112 | | |
| 113 | | const device_type FILTER_RC = &device_creator<filter_rc_device>; |
| 114 | | |
| 115 | | filter_rc_device::filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 116 | | : device_t(mconfig, FILTER_RC, "RC Filter", tag, owner, clock), |
| 117 | | device_sound_interface(mconfig, *this) |
| 118 | | { |
| 119 | | m_token = global_alloc_clear(filter_rc_state); |
| 120 | | } |
| 121 | | |
| 122 | | //------------------------------------------------- |
| 123 | | // device_config_complete - perform any |
| 124 | | // operations now that the configuration is |
| 125 | | // complete |
| 126 | | //------------------------------------------------- |
| 127 | | |
| 128 | | void filter_rc_device::device_config_complete() |
| 129 | | { |
| 130 | | } |
| 131 | | |
| 132 | | //------------------------------------------------- |
| 133 | | // device_start - device-specific startup |
| 134 | | //------------------------------------------------- |
| 135 | | |
| 136 | | void filter_rc_device::device_start() |
| 137 | | { |
| 138 | | DEVICE_START_NAME( filter_rc )(this); |
| 139 | | } |
| 140 | | |
| 141 | | //------------------------------------------------- |
| 142 | | // sound_stream_update - handle a stream update |
| 143 | | //------------------------------------------------- |
| 144 | | |
| 145 | | void filter_rc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 146 | | { |
| 147 | | // should never get here |
| 148 | | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); |
| 149 | | } |
trunk/src/emu/sound/flt_vol.c
| r20636 | r20637 | |
| 2 | 2 | #include "flt_vol.h" |
| 3 | 3 | |
| 4 | 4 | |
| 5 | | struct filter_volume_state |
| 6 | | { |
| 7 | | sound_stream * stream; |
| 8 | | int gain; |
| 9 | | }; |
| 10 | | |
| 11 | | INLINE filter_volume_state *get_safe_token(device_t *device) |
| 12 | | { |
| 13 | | assert(device != NULL); |
| 14 | | assert(device->type() == FILTER_VOLUME); |
| 15 | | return (filter_volume_state *)downcast<filter_volume_device *>(device)->token(); |
| 16 | | } |
| 17 | | |
| 18 | | |
| 19 | | |
| 20 | | static STREAM_UPDATE( filter_volume_update ) |
| 21 | | { |
| 22 | | stream_sample_t *src = inputs[0]; |
| 23 | | stream_sample_t *dst = outputs[0]; |
| 24 | | filter_volume_state *info = (filter_volume_state *)param; |
| 25 | | |
| 26 | | while (samples--) |
| 27 | | *dst++ = (*src++ * info->gain) >> 8; |
| 28 | | } |
| 29 | | |
| 30 | | |
| 31 | | static DEVICE_START( filter_volume ) |
| 32 | | { |
| 33 | | filter_volume_state *info = get_safe_token(device); |
| 34 | | |
| 35 | | info->gain = 0x100; |
| 36 | | info->stream = device->machine().sound().stream_alloc(*device, 1, 1, device->machine().sample_rate(), info, filter_volume_update); |
| 37 | | } |
| 38 | | |
| 39 | | |
| 40 | | void flt_volume_set_volume(device_t *device, float volume) |
| 41 | | { |
| 42 | | filter_volume_state *info = get_safe_token(device); |
| 43 | | info->gain = (int)(volume * 256); |
| 44 | | } |
| 45 | | |
| 5 | // device type definition |
| 46 | 6 | const device_type FILTER_VOLUME = &device_creator<filter_volume_device>; |
| 47 | 7 | |
| 48 | | filter_volume_device::filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 49 | | : device_t(mconfig, FILTER_VOLUME, "Volume Filter", tag, owner, clock), |
| 50 | | device_sound_interface(mconfig, *this) |
| 51 | | { |
| 52 | | m_token = global_alloc_clear(filter_volume_state); |
| 53 | | } |
| 54 | | |
| 55 | 8 | //------------------------------------------------- |
| 56 | | // device_config_complete - perform any |
| 57 | | // operations now that the configuration is |
| 58 | | // complete |
| 9 | // qsound_device - constructor |
| 59 | 10 | //------------------------------------------------- |
| 60 | 11 | |
| 61 | | void filter_volume_device::device_config_complete() |
| 12 | filter_volume_device::filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 13 | : device_t(mconfig, FILTER_VOLUME, "Volume Filter", tag, owner, clock), |
| 14 | device_sound_interface(mconfig, *this), |
| 15 | m_stream(NULL), |
| 16 | m_gain(0) |
| 62 | 17 | { |
| 63 | 18 | } |
| 64 | 19 | |
| 20 | |
| 65 | 21 | //------------------------------------------------- |
| 66 | 22 | // device_start - device-specific startup |
| 67 | 23 | //------------------------------------------------- |
| 68 | 24 | |
| 69 | 25 | void filter_volume_device::device_start() |
| 70 | 26 | { |
| 71 | | DEVICE_START_NAME( filter_volume )(this); |
| 27 | m_gain = 0x100; |
| 28 | m_stream = stream_alloc(1, 1, machine().sample_rate()); |
| 72 | 29 | } |
| 73 | 30 | |
| 31 | |
| 74 | 32 | //------------------------------------------------- |
| 75 | 33 | // sound_stream_update - handle a stream update |
| 76 | 34 | //------------------------------------------------- |
| 77 | 35 | |
| 78 | 36 | void filter_volume_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 79 | 37 | { |
| 80 | | // should never get here |
| 81 | | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); |
| 38 | stream_sample_t *src = inputs[0]; |
| 39 | stream_sample_t *dst = outputs[0]; |
| 40 | |
| 41 | while (samples--) |
| 42 | *dst++ = (*src++ * m_gain) >> 8; |
| 82 | 43 | } |
| 44 | |
| 45 | |
| 46 | |
| 47 | void filter_volume_device::flt_volume_set_volume(float volume) |
| 48 | { |
| 49 | m_gain = (int)(volume * 256); |
| 50 | } |
| 51 | |