src/mame/audio/turbo.c
| r14521 | r14522 | |
| 19 | 19 | * |
| 20 | 20 | *************************************/ |
| 21 | 21 | |
| 22 | | static void turbo_update_samples(turbo_state *state, device_t *samples) |
| 22 | static void turbo_update_samples(turbo_state *state, samples_device *samples) |
| 23 | 23 | { |
| 24 | 24 | /* accelerator sounds */ |
| 25 | 25 | /* BSEL == 3 --> off */ |
| 26 | 26 | /* BSEL == 2 --> standard */ |
| 27 | 27 | /* BSEL == 1 --> tunnel */ |
| 28 | 28 | /* BSEL == 0 --> ??? */ |
| 29 | | if (state->m_turbo_bsel == 3 && sample_playing(samples, 5)) |
| 30 | | sample_stop(samples, 5); |
| 31 | | else if (state->m_turbo_bsel != 3 && !sample_playing(samples, 5)) |
| 32 | | sample_start(samples, 5, 7, TRUE); |
| 33 | | if (sample_playing(samples, 5)) |
| 34 | | sample_set_freq(samples, 5, sample_get_base_freq(samples, 5) * ((state->m_turbo_accel & 0x3f) / 5.25 + 1)); |
| 29 | if (state->m_turbo_bsel == 3 && samples->playing(5)) |
| 30 | samples->stop(5); |
| 31 | else if (state->m_turbo_bsel != 3 && !samples->playing(5)) |
| 32 | samples->start(5, 7, true); |
| 33 | if (samples->playing(5)) |
| 34 | samples->set_frequency(5, samples->base_frequency(5) * ((state->m_turbo_accel & 0x3f) / 5.25 + 1)); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| r14521 | r14522 | |
| 72 | 72 | WRITE8_DEVICE_HANDLER( turbo_sound_a_w ) |
| 73 | 73 | { |
| 74 | 74 | #if (!DISCRETE_TEST) |
| 75 | | device_t *samples = device->machine().device("samples"); |
| 75 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 76 | 76 | #endif |
| 77 | 77 | turbo_state *state = device->machine().driver_data<turbo_state>(); |
| 78 | 78 | UINT8 diff = data ^ state->m_sound_state[0]; |
| r14521 | r14522 | |
| 81 | 81 | #if (!DISCRETE_TEST) |
| 82 | 82 | |
| 83 | 83 | /* /CRASH.S: channel 0 */ |
| 84 | | if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 0, 5, FALSE); |
| 84 | if ((diff & 0x01) && !(data & 0x01)) samples->start(0, 5); |
| 85 | 85 | |
| 86 | 86 | /* /TRIG1: channel 1 */ |
| 87 | | if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 1, 0, FALSE); |
| 87 | if ((diff & 0x02) && !(data & 0x02)) samples->start(1, 0); |
| 88 | 88 | |
| 89 | 89 | /* /TRIG2: channel 1 */ |
| 90 | | if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 1, 1, FALSE); |
| 90 | if ((diff & 0x04) && !(data & 0x04)) samples->start(1, 1); |
| 91 | 91 | |
| 92 | 92 | /* /TRIG3: channel 1 */ |
| 93 | | if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 1, 2, FALSE); |
| 93 | if ((diff & 0x08) && !(data & 0x08)) samples->start(1, 2); |
| 94 | 94 | |
| 95 | 95 | /* /TRIG4: channel 1 */ |
| 96 | | if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 1, 3, FALSE); |
| 96 | if ((diff & 0x10) && !(data & 0x10)) samples->start(1, 3); |
| 97 | 97 | |
| 98 | 98 | /* OSEL0 */ |
| 99 | 99 | state->m_turbo_osel = (state->m_turbo_osel & 6) | ((data >> 5) & 1); |
| 100 | 100 | |
| 101 | 101 | /* /SLIP: channel 2 */ |
| 102 | | if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 2, 4, FALSE); |
| 102 | if ((diff & 0x40) && !(data & 0x40)) samples->start(2, 4); |
| 103 | 103 | |
| 104 | 104 | /* /CRASH.L: channel 3 */ |
| 105 | | if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 3, 5, FALSE); |
| 105 | if ((diff & 0x80) && !(data & 0x80)) samples->start(3, 5); |
| 106 | 106 | |
| 107 | 107 | /* update any samples */ |
| 108 | 108 | turbo_update_samples(state, samples); |
| r14521 | r14522 | |
| 122 | 122 | |
| 123 | 123 | WRITE8_DEVICE_HANDLER( turbo_sound_b_w ) |
| 124 | 124 | { |
| 125 | | device_t *samples = device->machine().device("samples"); |
| 125 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 126 | 126 | turbo_state *state = device->machine().driver_data<turbo_state>(); |
| 127 | 127 | UINT8 diff = data ^ state->m_sound_state[1]; |
| 128 | 128 | state->m_sound_state[1] = data; |
| r14521 | r14522 | |
| 132 | 132 | output_set_value("tachometer", state->m_turbo_accel); |
| 133 | 133 | |
| 134 | 134 | /* /AMBU: channel 4 */ |
| 135 | | if ((diff & 0x40) && !(data & 0x40) && !sample_playing(samples, 4)) sample_start(samples, 4, 8, TRUE); |
| 136 | | if ((diff & 0x40) && (data & 0x40)) sample_stop(samples, 4); |
| 135 | if ((diff & 0x40) && !(data & 0x40) && !samples->playing(4)) samples->start(4, 8, true); |
| 136 | if ((diff & 0x40) && (data & 0x40)) samples->stop(4); |
| 137 | 137 | |
| 138 | 138 | /* /SPIN: channel 2 */ |
| 139 | | if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 2, 6, FALSE); |
| 139 | if ((diff & 0x80) && !(data & 0x80)) samples->start(2, 6); |
| 140 | 140 | |
| 141 | 141 | /* update any samples */ |
| 142 | 142 | turbo_update_samples(state, samples); |
| r14521 | r14522 | |
| 145 | 145 | |
| 146 | 146 | WRITE8_DEVICE_HANDLER( turbo_sound_c_w ) |
| 147 | 147 | { |
| 148 | | device_t *samples = device->machine().device("samples"); |
| 148 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 149 | 149 | turbo_state *state = device->machine().driver_data<turbo_state>(); |
| 150 | 150 | |
| 151 | 151 | /* OSEL1-2 */ |
| r14521 | r14522 | |
| 200 | 200 | MCFG_SPEAKER_ADD("lspeaker", -0.2, 0.0, 1.0) /* left */ |
| 201 | 201 | MCFG_SPEAKER_ADD("rspeaker", 0.2, 0.0, 1.0) /* right */ |
| 202 | 202 | |
| 203 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 204 | | MCFG_SOUND_CONFIG(turbo_samples_interface) |
| 203 | MCFG_SAMPLES_ADD("samples", turbo_samples_interface) |
| 205 | 204 | |
| 206 | 205 | /* channel 0 = CRASH.S -> CRASH.S/SM */ |
| 207 | 206 | MCFG_SOUND_ROUTE(0, "fspeaker", 0.25) |
| r14521 | r14522 | |
| 304 | 303 | } |
| 305 | 304 | |
| 306 | 305 | |
| 307 | | INLINE void subroc3d_update_volume(device_t *samples, int leftchan, UINT8 dis, UINT8 dir) |
| 306 | INLINE void subroc3d_update_volume(samples_device *samples, int leftchan, UINT8 dis, UINT8 dir) |
| 308 | 307 | { |
| 309 | 308 | float volume = (float)(15 - dis) / 16.0f; |
| 310 | 309 | float lvol, rvol; |
| r14521 | r14522 | |
| 319 | 318 | lvol = rvol = 0; |
| 320 | 319 | |
| 321 | 320 | /* if the sample is playing, adjust it */ |
| 322 | | sample_set_volume(samples, leftchan + 0, lvol); |
| 323 | | sample_set_volume(samples, leftchan + 1, rvol); |
| 321 | samples->set_volume(leftchan + 0, lvol); |
| 322 | samples->set_volume(leftchan + 1, rvol); |
| 324 | 323 | } |
| 325 | 324 | |
| 326 | 325 | |
| 327 | 326 | WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w ) |
| 328 | 327 | { |
| 329 | | device_t *samples = device->machine().device("samples"); |
| 328 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 330 | 329 | turbo_state *state = device->machine().driver_data<turbo_state>(); |
| 331 | 330 | UINT8 diff = data ^ state->m_sound_state[1]; |
| 332 | 331 | state->m_sound_state[1] = data; |
| r14521 | r14522 | |
| 336 | 335 | { |
| 337 | 336 | state->m_subroc3d_mdis = state->m_sound_state[0] & 0x0f; |
| 338 | 337 | state->m_subroc3d_mdir = (state->m_sound_state[0] >> 4) & 0x07; |
| 339 | | if (!sample_playing(samples, 0)) |
| 338 | if (!samples->playing(0)) |
| 340 | 339 | { |
| 341 | | sample_start(samples, 0, 0, TRUE); |
| 342 | | sample_start(samples, 1, 0, TRUE); |
| 340 | samples->start(0, 0, true); |
| 341 | samples->start(1, 0, true); |
| 343 | 342 | } |
| 344 | 343 | subroc3d_update_volume(samples, 0, state->m_subroc3d_mdis, state->m_subroc3d_mdir); |
| 345 | 344 | } |
| r14521 | r14522 | |
| 349 | 348 | { |
| 350 | 349 | state->m_subroc3d_tdis = state->m_sound_state[0] & 0x0f; |
| 351 | 350 | state->m_subroc3d_tdir = (state->m_sound_state[0] >> 4) & 0x07; |
| 352 | | if (!sample_playing(samples, 2)) |
| 351 | if (!samples->playing(2)) |
| 353 | 352 | { |
| 354 | | sample_start(samples, 2, 1, TRUE); |
| 355 | | sample_start(samples, 3, 1, TRUE); |
| 353 | samples->start(2, 1, true); |
| 354 | samples->start(3, 1, true); |
| 356 | 355 | } |
| 357 | 356 | subroc3d_update_volume(samples, 2, state->m_subroc3d_tdis, state->m_subroc3d_tdir); |
| 358 | 357 | } |
| r14521 | r14522 | |
| 362 | 361 | { |
| 363 | 362 | state->m_subroc3d_fdis = state->m_sound_state[0] & 0x0f; |
| 364 | 363 | state->m_subroc3d_fdir = (state->m_sound_state[0] >> 4) & 0x07; |
| 365 | | if (!sample_playing(samples, 4)) |
| 364 | if (!samples->playing(4)) |
| 366 | 365 | { |
| 367 | | sample_start(samples, 4, 2, TRUE); |
| 368 | | sample_start(samples, 5, 2, TRUE); |
| 366 | samples->start(4, 2, true); |
| 367 | samples->start(5, 2, true); |
| 369 | 368 | } |
| 370 | 369 | subroc3d_update_volume(samples, 4, state->m_subroc3d_fdis, state->m_subroc3d_fdir); |
| 371 | 370 | } |
| r14521 | r14522 | |
| 382 | 381 | |
| 383 | 382 | WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w ) |
| 384 | 383 | { |
| 385 | | device_t *samples = device->machine().device("samples"); |
| 384 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 386 | 385 | turbo_state *state = device->machine().driver_data<turbo_state>(); |
| 387 | 386 | UINT8 diff = data ^ state->m_sound_state[2]; |
| 388 | 387 | state->m_sound_state[2] = data; |
| r14521 | r14522 | |
| 390 | 389 | /* /FIRE TRIG */ |
| 391 | 390 | /* FIRE SELECT */ |
| 392 | 391 | if ((diff & 0x01) && (data & 0x01)) |
| 393 | | sample_start(samples, 8, (data & 0x02) ? 6 : 5, FALSE); |
| 392 | samples->start(8, (data & 0x02) ? 6 : 5); |
| 394 | 393 | |
| 395 | 394 | /* /SHIP EXP TRIG -> MY SHIP EXP: channel 9 */ |
| 396 | 395 | if ((diff & 0x04) && (data & 0x04)) |
| 397 | | sample_start(samples, 9, 7, FALSE); |
| 396 | samples->start(9, 7); |
| 398 | 397 | |
| 399 | 398 | /* /HIT TRIG -> HIT.L/R: channels 6+7 */ |
| 400 | 399 | if ((diff & 0x08) && (data & 0x08)) |
| 401 | 400 | { |
| 402 | | sample_start(samples, 6, (state->m_sound_state[0] & 0x80) ? 4 : 3, FALSE); |
| 403 | | sample_start(samples, 7, (state->m_sound_state[0] & 0x80) ? 4 : 3, FALSE); |
| 401 | samples->start(6, (state->m_sound_state[0] & 0x80) ? 4 : 3); |
| 402 | samples->start(7, (state->m_sound_state[0] & 0x80) ? 4 : 3); |
| 404 | 403 | } |
| 405 | 404 | |
| 406 | 405 | /* /ALARM TRIG -> ALARM.M: channel 10 */ |
| 407 | 406 | /* ALARM SELECT */ |
| 408 | 407 | if ((diff & 0x10) && (data & 0x10)) |
| 409 | | sample_start(samples, 10, (data & 0x20) ? 10 : 9, FALSE); |
| 408 | samples->start(10, (data & 0x20) ? 10 : 9); |
| 410 | 409 | |
| 411 | 410 | /* /PROLOGUE */ |
| 412 | | if (!sample_playing(samples, 11)) |
| 413 | | sample_start(samples, 11, 8, TRUE); |
| 414 | | sample_set_volume(samples, 11, (data & 0x40) ? 0 : 1.0); |
| 411 | if (!samples->playing(11)) |
| 412 | samples->start(11, 8, true); |
| 413 | samples->set_volume(11, (data & 0x40) ? 0 : 1.0); |
| 415 | 414 | |
| 416 | 415 | /* /GAME START */ |
| 417 | 416 | device->machine().sound().system_mute(data & 0x80); |
| r14521 | r14522 | |
| 453 | 452 | MACHINE_CONFIG_FRAGMENT( subroc3d_samples ) |
| 454 | 453 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 455 | 454 | |
| 456 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 457 | | MCFG_SOUND_CONFIG(subroc3d_samples_interface) |
| 455 | MCFG_SAMPLES_ADD("samples", subroc3d_samples_interface) |
| 458 | 456 | |
| 459 | 457 | /* MISSILE in channels 0 and 1 */ |
| 460 | 458 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) |
| r14521 | r14522 | |
| 497 | 495 | * |
| 498 | 496 | *************************************/ |
| 499 | 497 | |
| 500 | | static void buckrog_update_samples(turbo_state *state, device_t *samples) |
| 498 | static void buckrog_update_samples(turbo_state *state, samples_device *samples) |
| 501 | 499 | { |
| 502 | 500 | /* accelerator sounds */ |
| 503 | | if (sample_playing(samples, 5)) |
| 504 | | sample_set_freq(samples, 5, sample_get_base_freq(samples, 5) * (state->m_buckrog_myship / 100.25 + 1)); |
| 501 | if (samples->playing(5)) |
| 502 | samples->set_frequency(5, samples->base_frequency(5) * (state->m_buckrog_myship / 100.25 + 1)); |
| 505 | 503 | } |
| 506 | 504 | |
| 507 | 505 | |
| 508 | 506 | WRITE8_DEVICE_HANDLER( buckrog_sound_a_w ) |
| 509 | 507 | { |
| 510 | | device_t *samples = device->machine().device("samples"); |
| 508 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 511 | 509 | turbo_state *state = device->machine().driver_data<turbo_state>(); |
| 512 | 510 | UINT8 diff = data ^ state->m_sound_state[0]; |
| 513 | 511 | state->m_sound_state[0] = data; |
| 514 | 512 | |
| 515 | 513 | /* clock HIT DIS from bits 0-2 */ |
| 516 | 514 | if ((diff & 0x10) && (data & 0x10)) |
| 517 | | sample_set_volume(samples, 3, (float)(/*7 - */(data & 7)) / 7.0f); |
| 515 | samples->set_volume(3, (float)(/*7 - */(data & 7)) / 7.0f); |
| 518 | 516 | |
| 519 | 517 | /* clock ACC from bits 0-3 */ |
| 520 | 518 | if ((diff & 0x20) && (data & 0x20)) |
| r14521 | r14522 | |
| 524 | 522 | } |
| 525 | 523 | |
| 526 | 524 | /* /ALARM0: channel 0 */ |
| 527 | | if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 0, 0, FALSE); |
| 525 | if ((diff & 0x40) && !(data & 0x40)) samples->start(0, 0); |
| 528 | 526 | |
| 529 | 527 | /* /ALARM1: channel 0 */ |
| 530 | | if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 0, 1, FALSE); |
| 528 | if ((diff & 0x80) && !(data & 0x80)) samples->start(0, 1); |
| 531 | 529 | } |
| 532 | 530 | |
| 533 | 531 | |
| 534 | 532 | WRITE8_DEVICE_HANDLER( buckrog_sound_b_w ) |
| 535 | 533 | { |
| 536 | | device_t *samples = device->machine().device("samples"); |
| 534 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 537 | 535 | turbo_state *state = device->machine().driver_data<turbo_state>(); |
| 538 | 536 | UINT8 diff = data ^ state->m_sound_state[1]; |
| 539 | 537 | state->m_sound_state[1] = data; |
| 540 | 538 | |
| 541 | 539 | /* /ALARM3: channel 0 */ |
| 542 | | if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 0, 2, FALSE); |
| 540 | if ((diff & 0x01) && !(data & 0x01)) samples->start(0, 2); |
| 543 | 541 | |
| 544 | 542 | /* /ALARM4: channel 0 */ |
| 545 | | if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 0, 3, FALSE); |
| 543 | if ((diff & 0x02) && !(data & 0x02)) samples->start(0, 3); |
| 546 | 544 | |
| 547 | 545 | /* /FIRE: channel 1 */ |
| 548 | | if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 1, 5, FALSE); |
| 546 | if ((diff & 0x04) && !(data & 0x04)) samples->start(1, 5); |
| 549 | 547 | |
| 550 | 548 | /* /EXP: channel 2 */ |
| 551 | | if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 2, 4, FALSE); |
| 549 | if ((diff & 0x08) && !(data & 0x08)) samples->start(2, 4); |
| 552 | 550 | |
| 553 | 551 | /* /HIT: channel 3 */ |
| 554 | 552 | if ((diff & 0x10) && !(data & 0x10)) |
| 555 | 553 | { |
| 556 | | sample_start(samples, 3, 7, FALSE); |
| 554 | samples->start(3, 7); |
| 557 | 555 | buckrog_update_samples(state, samples); |
| 558 | 556 | } |
| 559 | 557 | |
| 560 | 558 | /* /REBOUND: channel 4 */ |
| 561 | | if ((diff & 0x20) && !(data & 0x20)) sample_start(samples, 4, 6, FALSE); |
| 559 | if ((diff & 0x20) && !(data & 0x20)) samples->start(4, 6); |
| 562 | 560 | |
| 563 | 561 | /* SHIP: channel 5 */ |
| 564 | | if ((diff & 0x40) && (data & 0x40) && !sample_playing(samples, 5)) |
| 562 | if ((diff & 0x40) && (data & 0x40) && !samples->playing(5)) |
| 565 | 563 | { |
| 566 | | sample_start(samples, 5, 8, TRUE); |
| 564 | samples->start(5, 8, true); |
| 567 | 565 | buckrog_update_samples(state, samples); |
| 568 | 566 | } |
| 569 | | if ((diff & 0x40) && !(data & 0x40) && sample_playing(samples, 5)) sample_stop(samples, 5); |
| 567 | if ((diff & 0x40) && !(data & 0x40) && samples->playing(5)) samples->stop(5); |
| 570 | 568 | |
| 571 | 569 | /* GAME ON */ |
| 572 | 570 | device->machine().sound().system_enable(data & 0x80); |
| r14521 | r14522 | |
| 607 | 605 | |
| 608 | 606 | MACHINE_CONFIG_FRAGMENT( buckrog_samples ) |
| 609 | 607 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 610 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 611 | | MCFG_SOUND_CONFIG(buckrog_samples_interface) |
| 608 | MCFG_SAMPLES_ADD("samples", buckrog_samples_interface) |
| 612 | 609 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 613 | 610 | MACHINE_CONFIG_END |
| 614 | 611 | |
src/mame/audio/segag80r.c
| r14521 | r14522 | |
| 190 | 190 | MCFG_SOUND_START(astrob) |
| 191 | 191 | |
| 192 | 192 | /* sound hardware */ |
| 193 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 194 | | MCFG_SOUND_CONFIG(astrob_samples_interface) |
| 193 | MCFG_SAMPLES_ADD("samples", astrob_samples_interface) |
| 195 | 194 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 196 | 195 | MACHINE_CONFIG_END |
| 197 | 196 | |
| r14521 | r14522 | |
| 225 | 224 | { |
| 226 | 225 | 120.0f, 82.0f, 62.0f, 56.0f, 47.0f, 39.0f, 33.0f, 27.0f, 24.0f, 22.0f |
| 227 | 226 | }; |
| 228 | | device_t *samples = space->machine().device("samples"); |
| 227 | samples_device *samples = space->machine().device<samples_device>("samples"); |
| 229 | 228 | float freq_factor; |
| 230 | 229 | |
| 231 | 230 | UINT8 diff = data ^ state->m_sound_state[offset]; |
| r14521 | r14522 | |
| 235 | 234 | { |
| 236 | 235 | case 0: |
| 237 | 236 | /* INVADER-1: channel 0 */ |
| 238 | | if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 0, (data & 0x80) ? 0 : 1, TRUE); |
| 239 | | if ((data & 0x01) && sample_playing(samples, 0)) sample_stop(samples, 0); |
| 237 | if ((diff & 0x01) && !(data & 0x01)) samples->start(0, (data & 0x80) ? 0 : 1, true); |
| 238 | if ((data & 0x01) && samples->playing(0)) samples->stop(0); |
| 240 | 239 | |
| 241 | 240 | /* INVADER-2: channel 1 */ |
| 242 | | if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 1, (data & 0x80) ? 2 : 3, TRUE); |
| 243 | | if ((data & 0x02) && sample_playing(samples, 1)) sample_stop(samples, 1); |
| 241 | if ((diff & 0x02) && !(data & 0x02)) samples->start(1, (data & 0x80) ? 2 : 3, true); |
| 242 | if ((data & 0x02) && samples->playing(1)) samples->stop(1); |
| 244 | 243 | |
| 245 | 244 | /* INVADER-3: channel 2 */ |
| 246 | | if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 2, (data & 0x80) ? 4 : 5, TRUE); |
| 247 | | if ((data & 0x04) && sample_playing(samples, 2)) sample_stop(samples, 2); |
| 245 | if ((diff & 0x04) && !(data & 0x04)) samples->start(2, (data & 0x80) ? 4 : 5, true); |
| 246 | if ((data & 0x04) && samples->playing(2)) samples->stop(2); |
| 248 | 247 | |
| 249 | 248 | /* INVADER-4: channel 3 */ |
| 250 | | if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 3, (data & 0x80) ? 6 : 7, TRUE); |
| 251 | | if ((data & 0x08) && sample_playing(samples, 3)) sample_stop(samples, 3); |
| 249 | if ((diff & 0x08) && !(data & 0x08)) samples->start(3, (data & 0x80) ? 6 : 7, true); |
| 250 | if ((data & 0x08) && samples->playing(3)) samples->stop(3); |
| 252 | 251 | |
| 253 | 252 | /* ASTROIDS: channel 4 */ |
| 254 | | if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 4, 8, TRUE); |
| 255 | | if ((data & 0x10) && sample_playing(samples, 4)) sample_stop(samples, 4); |
| 253 | if ((diff & 0x10) && !(data & 0x10)) samples->start(4, 8, true); |
| 254 | if ((data & 0x10) && samples->playing(4)) samples->stop(4); |
| 256 | 255 | |
| 257 | 256 | /* MUTE */ |
| 258 | 257 | space->machine().sound().system_mute(data & 0x20); |
| 259 | 258 | |
| 260 | 259 | /* REFILL: channel 5 */ |
| 261 | | if (!(data & 0x40) && !sample_playing(samples, 5)) sample_start(samples, 5, 9, FALSE); |
| 262 | | if ( (data & 0x40) && sample_playing(samples, 5)) sample_stop(samples, 5); |
| 260 | if (!(data & 0x40) && !samples->playing(5)) samples->start(5, 9); |
| 261 | if ( (data & 0x40) && samples->playing(5)) samples->stop(5); |
| 263 | 262 | |
| 264 | 263 | /* WARP: changes which sample is played for the INVADER samples above */ |
| 265 | 264 | if (diff & 0x80) |
| 266 | 265 | { |
| 267 | | if (sample_playing(samples, 0)) sample_start(samples, 0, (data & 0x80) ? 0 : 1, TRUE); |
| 268 | | if (sample_playing(samples, 1)) sample_start(samples, 1, (data & 0x80) ? 2 : 3, TRUE); |
| 269 | | if (sample_playing(samples, 2)) sample_start(samples, 2, (data & 0x80) ? 4 : 5, TRUE); |
| 270 | | if (sample_playing(samples, 3)) sample_start(samples, 3, (data & 0x80) ? 6 : 7, TRUE); |
| 266 | if (samples->playing(0)) samples->start(0, (data & 0x80) ? 0 : 1, true); |
| 267 | if (samples->playing(1)) samples->start(1, (data & 0x80) ? 2 : 3, true); |
| 268 | if (samples->playing(2)) samples->start(2, (data & 0x80) ? 4 : 5, true); |
| 269 | if (samples->playing(3)) samples->start(3, (data & 0x80) ? 6 : 7, true); |
| 271 | 270 | } |
| 272 | 271 | break; |
| 273 | 272 | |
| 274 | 273 | case 1: |
| 275 | 274 | /* LASER #1: channel 6 */ |
| 276 | | if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 6, 10, FALSE); |
| 275 | if ((diff & 0x01) && !(data & 0x01)) samples->start(6, 10); |
| 277 | 276 | |
| 278 | 277 | /* LASER #2: channel 7 */ |
| 279 | | if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 7, 11, FALSE); |
| 278 | if ((diff & 0x02) && !(data & 0x02)) samples->start(7, 11); |
| 280 | 279 | |
| 281 | 280 | /* SHORT EXPL: channel 8 */ |
| 282 | | if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 8, 12, FALSE); |
| 281 | if ((diff & 0x04) && !(data & 0x04)) samples->start(8, 12); |
| 283 | 282 | |
| 284 | 283 | /* LONG EXPL: channel 8 */ |
| 285 | | if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 8, 13, FALSE); |
| 284 | if ((diff & 0x08) && !(data & 0x08)) samples->start(8, 13); |
| 286 | 285 | |
| 287 | 286 | /* ATTACK RATE */ |
| 288 | 287 | if ((diff & 0x10) && !(data & 0x10)) state->m_sound_rate = (state->m_sound_rate + 1) % 10; |
| r14521 | r14522 | |
| 291 | 290 | if (!(data & 0x20)) state->m_sound_rate = 0; |
| 292 | 291 | |
| 293 | 292 | /* BONUS: channel 9 */ |
| 294 | | if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 9, 14, FALSE); |
| 293 | if ((diff & 0x40) && !(data & 0x40)) samples->start(9, 14); |
| 295 | 294 | |
| 296 | 295 | /* SONAR: channel 10 */ |
| 297 | | if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 10, 15, FALSE); |
| 296 | if ((diff & 0x80) && !(data & 0x80)) samples->start(10, 15); |
| 298 | 297 | break; |
| 299 | 298 | } |
| 300 | 299 | |
| r14521 | r14522 | |
| 308 | 307 | |
| 309 | 308 | /* adjust the sample rate of invader sounds based the sound_rate */ |
| 310 | 309 | /* this is an approximation */ |
| 311 | | if (sample_playing(samples, 0)) sample_set_freq(samples, 0, sample_get_base_freq(samples, 0) * freq_factor); |
| 312 | | if (sample_playing(samples, 1)) sample_set_freq(samples, 1, sample_get_base_freq(samples, 1) * freq_factor); |
| 313 | | if (sample_playing(samples, 2)) sample_set_freq(samples, 2, sample_get_base_freq(samples, 2) * freq_factor); |
| 314 | | if (sample_playing(samples, 3)) sample_set_freq(samples, 3, sample_get_base_freq(samples, 3) * freq_factor); |
| 310 | if (samples->playing(0)) samples->set_frequency(0, samples->base_frequency(0) * freq_factor); |
| 311 | if (samples->playing(1)) samples->set_frequency(1, samples->base_frequency(1) * freq_factor); |
| 312 | if (samples->playing(2)) samples->set_frequency(2, samples->base_frequency(2) * freq_factor); |
| 313 | if (samples->playing(3)) samples->set_frequency(3, samples->base_frequency(3) * freq_factor); |
| 315 | 314 | } |
| 316 | 315 | |
| 317 | 316 | |
| r14521 | r14522 | |
| 422 | 421 | /* sound hardware */ |
| 423 | 422 | MCFG_SOUND_START(sega005) |
| 424 | 423 | |
| 425 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 426 | | MCFG_SOUND_CONFIG(sega005_samples_interface) |
| 424 | MCFG_SAMPLES_ADD("samples", sega005_samples_interface) |
| 427 | 425 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 428 | 426 | |
| 429 | 427 | MCFG_SOUND_ADD("005", SEGA005, 0) |
| r14521 | r14522 | |
| 459 | 457 | static WRITE8_DEVICE_HANDLER( sega005_sound_a_w ) |
| 460 | 458 | { |
| 461 | 459 | segag80r_state *state = device->machine().driver_data<segag80r_state>(); |
| 462 | | device_t *samples = device->machine().device("samples"); |
| 460 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 463 | 461 | UINT8 diff = data ^ state->m_sound_state[0]; |
| 464 | 462 | state->m_sound_state[0] = data; |
| 465 | 463 | |
| 466 | 464 | /* LARGE EXPL: channel 0 */ |
| 467 | | if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 0, 0, FALSE); |
| 465 | if ((diff & 0x01) && !(data & 0x01)) samples->start(0, 0); |
| 468 | 466 | |
| 469 | 467 | /* SMALL EXPL: channel 1 */ |
| 470 | | if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 1, 1, FALSE); |
| 468 | if ((diff & 0x02) && !(data & 0x02)) samples->start(1, 1); |
| 471 | 469 | |
| 472 | 470 | /* DROP BOMB: channel 2 */ |
| 473 | | if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 2, 2, FALSE); |
| 471 | if ((diff & 0x04) && !(data & 0x04)) samples->start(2, 2); |
| 474 | 472 | |
| 475 | 473 | /* SHOOT PISTOL: channel 3 */ |
| 476 | | if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 3, 3, FALSE); |
| 474 | if ((diff & 0x08) && !(data & 0x08)) samples->start(3, 3); |
| 477 | 475 | |
| 478 | 476 | /* MISSILE: channel 4 */ |
| 479 | | if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 4, 4, FALSE); |
| 477 | if ((diff & 0x10) && !(data & 0x10)) samples->start(4, 4); |
| 480 | 478 | |
| 481 | 479 | /* HELICOPTER: channel 5 */ |
| 482 | | if ((diff & 0x20) && !(data & 0x20) && !sample_playing(samples, 5)) sample_start(samples, 5, 5, TRUE); |
| 483 | | if ((diff & 0x20) && (data & 0x20)) sample_stop(samples, 5); |
| 480 | if ((diff & 0x20) && !(data & 0x20) && !samples->playing(5)) samples->start(5, 5, true); |
| 481 | if ((diff & 0x20) && (data & 0x20)) samples->stop(5); |
| 484 | 482 | |
| 485 | 483 | /* WHISTLE: channel 6 */ |
| 486 | | if ((diff & 0x40) && !(data & 0x40) && !sample_playing(samples, 6)) sample_start(samples, 6, 6, TRUE); |
| 487 | | if ((diff & 0x40) && (data & 0x40)) sample_stop(samples, 6); |
| 484 | if ((diff & 0x40) && !(data & 0x40) && !samples->playing(6)) samples->start(6, 6, true); |
| 485 | if ((diff & 0x40) && (data & 0x40)) samples->stop(6); |
| 488 | 486 | } |
| 489 | 487 | |
| 490 | 488 | |
| r14521 | r14522 | |
| 664 | 662 | /* sound hardware */ |
| 665 | 663 | MCFG_SOUND_START(spaceod) |
| 666 | 664 | |
| 667 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 668 | | MCFG_SOUND_CONFIG(spaceod_samples_interface) |
| 665 | MCFG_SAMPLES_ADD("samples", spaceod_samples_interface) |
| 669 | 666 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 670 | 667 | MACHINE_CONFIG_END |
| 671 | 668 | |
| r14521 | r14522 | |
| 694 | 691 | WRITE8_HANDLER( spaceod_sound_w ) |
| 695 | 692 | { |
| 696 | 693 | segag80r_state *state = space->machine().driver_data<segag80r_state>(); |
| 697 | | device_t *samples = space->machine().device("samples"); |
| 694 | samples_device *samples = space->machine().device<samples_device>("samples"); |
| 698 | 695 | UINT8 diff = data ^ state->m_sound_state[offset]; |
| 699 | 696 | state->m_sound_state[offset] = data; |
| 700 | 697 | |
| r14521 | r14522 | |
| 702 | 699 | { |
| 703 | 700 | case 0: |
| 704 | 701 | /* BACK G: channel 0 */ |
| 705 | | if ((diff & 0x01) && !(data & 0x01) && !sample_playing(samples, 0)) sample_start(samples, 0, 7, TRUE); |
| 706 | | if ((diff & 0x01) && (data & 0x01)) sample_stop(samples, 0); |
| 702 | if ((diff & 0x01) && !(data & 0x01) && !samples->playing(0)) samples->start(0, 7, true); |
| 703 | if ((diff & 0x01) && (data & 0x01)) samples->stop(0); |
| 707 | 704 | |
| 708 | 705 | /* SHORT EXP: channel 1 */ |
| 709 | | if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 1, 2, FALSE); |
| 706 | if ((diff & 0x04) && !(data & 0x04)) samples->start(1, 2); |
| 710 | 707 | |
| 711 | 708 | /* ACCELERATE: channel 2 */ |
| 712 | | if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 2, 8, FALSE); |
| 709 | if ((diff & 0x10) && !(data & 0x10)) samples->start(2, 8); |
| 713 | 710 | |
| 714 | 711 | /* BATTLE STAR: channel 3 */ |
| 715 | | if ((diff & 0x20) && !(data & 0x20)) sample_start(samples, 3, 10, FALSE); |
| 712 | if ((diff & 0x20) && !(data & 0x20)) samples->start(3, 10); |
| 716 | 713 | |
| 717 | 714 | /* D BOMB: channel 4 */ |
| 718 | | if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 4, 1, FALSE); |
| 715 | if ((diff & 0x40) && !(data & 0x40)) samples->start(4, 1); |
| 719 | 716 | |
| 720 | 717 | /* LONG EXP: channel 5 */ |
| 721 | | if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 5, 3, FALSE); |
| 718 | if ((diff & 0x80) && !(data & 0x80)) samples->start(5, 3); |
| 722 | 719 | break; |
| 723 | 720 | |
| 724 | 721 | case 1: |
| 725 | 722 | /* SHOT: channel 6 */ |
| 726 | | if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 6, 0, FALSE); |
| 723 | if ((diff & 0x01) && !(data & 0x01)) samples->start(6, 0); |
| 727 | 724 | |
| 728 | 725 | /* BONUS UP: channel 7 */ |
| 729 | | if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 7, 6, FALSE); |
| 726 | if ((diff & 0x02) && !(data & 0x02)) samples->start(7, 6); |
| 730 | 727 | |
| 731 | 728 | /* WARP: channel 8 */ |
| 732 | | if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 8, 4, FALSE); |
| 729 | if ((diff & 0x08) && !(data & 0x08)) samples->start(8, 4); |
| 733 | 730 | |
| 734 | 731 | /* APPEARANCE UFO: channel 9 */ |
| 735 | | if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 9, 5, FALSE); |
| 732 | if ((diff & 0x40) && !(data & 0x40)) samples->start(9, 5); |
| 736 | 733 | |
| 737 | 734 | /* BLACK HOLE: channel 10 */ |
| 738 | | if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 10, 9, FALSE); |
| 735 | if ((diff & 0x80) && !(data & 0x80)) samples->start(10, 9); |
| 739 | 736 | break; |
| 740 | 737 | } |
| 741 | 738 | } |
| r14521 | r14522 | |
| 841 | 838 | /* sound hardware */ |
| 842 | 839 | MCFG_SOUND_START(monsterb) |
| 843 | 840 | |
| 844 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 845 | | MCFG_SOUND_CONFIG(monsterb_samples_interface) |
| 841 | MCFG_SAMPLES_ADD("samples", monsterb_samples_interface) |
| 846 | 842 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 847 | 843 | |
| 848 | 844 | MCFG_SOUND_ADD("music", TMS36XX, 247) |
| r14521 | r14522 | |
| 902 | 898 | static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w ) |
| 903 | 899 | { |
| 904 | 900 | segag80r_state *state = device->machine().driver_data<segag80r_state>(); |
| 905 | | device_t *samples = device->machine().device("samples"); |
| 901 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 906 | 902 | UINT8 diff = data ^ state->m_sound_state[1]; |
| 907 | 903 | state->m_sound_state[1] = data; |
| 908 | 904 | |
| 909 | 905 | /* SHOT: channel 0 */ |
| 910 | | if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 0, 0, FALSE); |
| 906 | if ((diff & 0x01) && !(data & 0x01)) samples->start(0, 0); |
| 911 | 907 | |
| 912 | 908 | /* DIVE: channel 1 */ |
| 913 | | if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 1, 1, FALSE); |
| 909 | if ((diff & 0x02) && !(data & 0x02)) samples->start(1, 1); |
| 914 | 910 | |
| 915 | 911 | /* TODO: D7 on Port B might affect TMS3617 output (mute?) */ |
| 916 | 912 | } |
src/mame/audio/8080bw.c
| r14521 | r14522 | |
| 38 | 38 | |
| 39 | 39 | sn76477_enable_w(state->m_sn, !(data & 0x01)); /* SAUCER SOUND */ |
| 40 | 40 | |
| 41 | | if (rising_bits & 0x02) sample_start(state->m_samples, 0, 0, 0); /* MISSLE SOUND */ |
| 42 | | if (rising_bits & 0x04) sample_start(state->m_samples, 1, 1, 0); /* EXPLOSION */ |
| 43 | | if (rising_bits & 0x08) sample_start(state->m_samples, 2, 2, 0); /* INVADER HIT */ |
| 44 | | if (rising_bits & 0x10) sample_start(state->m_samples, 5, 8, 0); /* BONUS MISSILE BASE */ |
| 41 | if (rising_bits & 0x02) state->m_samples->start(0, 0); /* MISSLE SOUND */ |
| 42 | if (rising_bits & 0x04) state->m_samples->start(1, 1); /* EXPLOSION */ |
| 43 | if (rising_bits & 0x08) state->m_samples->start(2, 2); /* INVADER HIT */ |
| 44 | if (rising_bits & 0x10) state->m_samples->start(5, 8); /* BONUS MISSILE BASE */ |
| 45 | 45 | |
| 46 | 46 | state->m_screen_red = data & 0x04; |
| 47 | 47 | |
| r14521 | r14522 | |
| 63 | 63 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 64 | 64 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; |
| 65 | 65 | |
| 66 | | if (rising_bits & 0x01) sample_start(state->m_samples, 4, 3, 0); /* FLEET */ |
| 67 | | if (rising_bits & 0x02) sample_start(state->m_samples, 4, 4, 0); /* FLEET */ |
| 68 | | if (rising_bits & 0x04) sample_start(state->m_samples, 4, 5, 0); /* FLEET */ |
| 69 | | if (rising_bits & 0x08) sample_start(state->m_samples, 4, 6, 0); /* FLEET */ |
| 70 | | if (rising_bits & 0x10) sample_start(state->m_samples, 3, 7, 0); /* SAUCER HIT */ |
| 66 | if (rising_bits & 0x01) state->m_samples->start(4, 3); /* FLEET */ |
| 67 | if (rising_bits & 0x02) state->m_samples->start(4, 4); /* FLEET */ |
| 68 | if (rising_bits & 0x04) state->m_samples->start(4, 5); /* FLEET */ |
| 69 | if (rising_bits & 0x08) state->m_samples->start(4, 6); /* FLEET */ |
| 70 | if (rising_bits & 0x10) state->m_samples->start(3, 7); /* SAUCER HIT */ |
| 71 | 71 | |
| 72 | 72 | state->m_c8080bw_flip_screen = data & 0x20; |
| 73 | 73 | |
| r14521 | r14522 | |
| 88 | 88 | |
| 89 | 89 | sn76477_enable_w(state->m_sn, !(data & 0x01)); /* Saucer Sound */ |
| 90 | 90 | |
| 91 | | if (rising_bits & 0x02) sample_start(state->m_samples, 0, 0, 0); /* Shot Sound */ |
| 92 | | if (rising_bits & 0x04) sample_start(state->m_samples, 1, 1, 0); /* Base Hit */ |
| 93 | | if (rising_bits & 0x08) sample_start(state->m_samples, 2, 2, 0); /* Invader Hit */ |
| 91 | if (rising_bits & 0x02) state->m_samples->start(0, 0); /* Shot Sound */ |
| 92 | if (rising_bits & 0x04) state->m_samples->start(1, 1); /* Base Hit */ |
| 93 | if (rising_bits & 0x08) state->m_samples->start(2, 2); /* Invader Hit */ |
| 94 | 94 | |
| 95 | 95 | speaker_level_w(state->m_speaker, (data & 0x10) ? 1 : 0); /* Various bitstream tunes */ |
| 96 | 96 | |
| r14521 | r14522 | |
| 130 | 130 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 131 | 131 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; |
| 132 | 132 | |
| 133 | | if (rising_bits & 0x01) sample_start(state->m_samples, 0, 3, 0); /* Thrust */ |
| 134 | | if (rising_bits & 0x02) sample_start(state->m_samples, 1, 2, 0); /* Shot Sound */ |
| 135 | | if (rising_bits & 0x04) sample_start(state->m_samples, 0, 1, 0); /* Death */ |
| 136 | | if (rising_bits & 0x08) sample_start(state->m_samples, 1, 0, 0); /* Alien Hit */ |
| 137 | | if (rising_bits & 0x10) sample_start(state->m_samples, 2, 5, 0); /* Bonus Ship (not confirmed) */ |
| 133 | if (rising_bits & 0x01) state->m_samples->start(0, 3); /* Thrust */ |
| 134 | if (rising_bits & 0x02) state->m_samples->start(1, 2); /* Shot Sound */ |
| 135 | if (rising_bits & 0x04) state->m_samples->start(0, 1); /* Death */ |
| 136 | if (rising_bits & 0x08) state->m_samples->start(1, 0); /* Alien Hit */ |
| 137 | if (rising_bits & 0x10) state->m_samples->start(2, 5); /* Bonus Ship (not confirmed) */ |
| 138 | 138 | |
| 139 | 139 | space->machine().sound().system_enable(data & 0x20); |
| 140 | 140 | |
| r14521 | r14522 | |
| 148 | 148 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 149 | 149 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; |
| 150 | 150 | |
| 151 | | if (rising_bits & 0x01) sample_start(state->m_samples, 1, 8, 0); /* Footstep high tone */ |
| 152 | | if (rising_bits & 0x02) sample_start(state->m_samples, 1, 7, 0); /* Footstep low tone */ |
| 153 | | if (rising_bits & 0x04) sample_start(state->m_samples, 1, 4, 0); /* Bonus when counting men saved */ |
| 151 | if (rising_bits & 0x01) state->m_samples->start(1, 8); /* Footstep high tone */ |
| 152 | if (rising_bits & 0x02) state->m_samples->start(1, 7); /* Footstep low tone */ |
| 153 | if (rising_bits & 0x04) state->m_samples->start(1, 4); /* Bonus when counting men saved */ |
| 154 | 154 | |
| 155 | 155 | speaker_level_w(state->m_speaker, (data & 0x08) ? 1 : 0); /* Bitstream tunes - endlevel and bonus1 */ |
| 156 | 156 | |
| 157 | | if (rising_bits & 0x10) sample_start(state->m_samples, 3, 6, 0); /* Shooting Star and Rescue Ship sounds */ |
| 158 | | if ((~data & 0x10) && (state->m_port_2_last_extra & 0x10)) sample_stop (state->m_samples, 3); /* This makes the rescue ship sound beep on and off */ |
| 157 | if (rising_bits & 0x10) state->m_samples->start(3, 6); /* Shooting Star and Rescue Ship sounds */ |
| 158 | if ((~data & 0x10) && (state->m_port_2_last_extra & 0x10)) state->m_samples->stop(3); /* This makes the rescue ship sound beep on and off */ |
| 159 | 159 | |
| 160 | 160 | state->m_c8080bw_flip_screen = data & 0x20; |
| 161 | 161 | |
| r14521 | r14522 | |
| 188 | 188 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 189 | 189 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; |
| 190 | 190 | |
| 191 | | if (rising_bits & 0x01) sample_start(state->m_samples, 1, 2, 0); /* Hit a balloon */ |
| 192 | | if (rising_bits & 0x02) sample_start(state->m_samples, 2, 0, 0); /* Shot Sound */ |
| 193 | | if (rising_bits & 0x04) sample_start(state->m_samples, 2, 1, 0); /* Base Hit */ |
| 194 | | if (rising_bits & 0x08) sample_start(state->m_samples, 1, 7, 0); /* Hit a Bomb */ |
| 195 | | if (rising_bits & 0x10) sample_start(state->m_samples, 3, 8, 0); /* Bonus Base at 1500 points */ |
| 191 | if (rising_bits & 0x01) state->m_samples->start(1, 2); /* Hit a balloon */ |
| 192 | if (rising_bits & 0x02) state->m_samples->start(2, 0); /* Shot Sound */ |
| 193 | if (rising_bits & 0x04) state->m_samples->start(2, 1); /* Base Hit */ |
| 194 | if (rising_bits & 0x08) state->m_samples->start(1, 7); /* Hit a Bomb */ |
| 195 | if (rising_bits & 0x10) state->m_samples->start(3, 8); /* Bonus Base at 1500 points */ |
| 196 | 196 | |
| 197 | 197 | space->machine().sound().system_enable(data & 0x20); |
| 198 | 198 | |
| r14521 | r14522 | |
| 206 | 206 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 207 | 207 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; |
| 208 | 208 | |
| 209 | | if (data & 0x01) sample_start(state->m_samples, 0, 7, 0); /* Indicates plane will drop bombs */ |
| 210 | | if (data & 0x04) sample_start(state->m_samples, 0, 4, 0); /* Plane is dropping new balloons at start of level */ |
| 211 | | if (rising_bits & 0x10) sample_start(state->m_samples, 2, 2, 0); /* Balloon hit and bomb drops */ |
| 209 | if (data & 0x01) state->m_samples->start(0, 7); /* Indicates plane will drop bombs */ |
| 210 | if (data & 0x04) state->m_samples->start(0, 4); /* Plane is dropping new balloons at start of level */ |
| 211 | if (rising_bits & 0x10) state->m_samples->start(2, 2); /* Balloon hit and bomb drops */ |
| 212 | 212 | |
| 213 | 213 | state->m_c8080bw_flip_screen = data & 0x20; |
| 214 | 214 | |
| r14521 | r14522 | |
| 265 | 265 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 266 | 266 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; |
| 267 | 267 | |
| 268 | | if (rising_bits & 0x01) sample_start(state->m_samples, 1, 7, 0); /* Death */ |
| 269 | | if (rising_bits & 0x02) sample_start(state->m_samples, 0, 1, 0); /* Shot Sound */ |
| 270 | | if (rising_bits & 0x04) sample_start(state->m_samples, 2, 3, 0); /* Move */ |
| 271 | | if (rising_bits & 0x08) sample_start(state->m_samples, 3, 2, 0); /* Hit */ |
| 268 | if (rising_bits & 0x01) state->m_samples->start(1, 7); /* Death */ |
| 269 | if (rising_bits & 0x02) state->m_samples->start(0, 1); /* Shot Sound */ |
| 270 | if (rising_bits & 0x04) state->m_samples->start(2, 3); /* Move */ |
| 271 | if (rising_bits & 0x08) state->m_samples->start(3, 2); /* Hit */ |
| 272 | 272 | |
| 273 | 273 | space->machine().sound().system_enable(data & 0x20); |
| 274 | 274 | |
| r14521 | r14522 | |
| 282 | 282 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 283 | 283 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; |
| 284 | 284 | |
| 285 | | if (rising_bits & 0x01) sample_start(state->m_samples, 4, 0, 0); /* Bird dropped an egg, Lasso used */ |
| 286 | | if (rising_bits & 0x02) sample_start(state->m_samples, 4, 2, 0); /* Egg hatches, egg shot */ |
| 287 | | if (rising_bits & 0x08) sample_start(state->m_samples, 5, 0, 0); /* Grabber, Lasso caught something */ |
| 288 | | if (rising_bits & 0x10) sample_start(state->m_samples, 3, 7, 0); /* Lasso sound */ |
| 285 | if (rising_bits & 0x01) state->m_samples->start(4, 0); /* Bird dropped an egg, Lasso used */ |
| 286 | if (rising_bits & 0x02) state->m_samples->start(4, 2); /* Egg hatches, egg shot */ |
| 287 | if (rising_bits & 0x08) state->m_samples->start(5, 0); /* Grabber, Lasso caught something */ |
| 288 | if (rising_bits & 0x10) state->m_samples->start(3, 7); /* Lasso sound */ |
| 289 | 289 | |
| 290 | 290 | state->m_port_2_last_extra = data; |
| 291 | 291 | } |
| r14521 | r14522 | |
| 954 | 954 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 955 | 955 | UINT8 rising_bits = data & ~state->m_port_3_last_extra; |
| 956 | 956 | |
| 957 | | if (rising_bits & 0x02) sample_start(state->m_samples, 4, 0, 0); /* Steering */ |
| 958 | | if (rising_bits & 0x04) sample_start(state->m_samples, 0, 1, 0); /* Collision */ |
| 959 | | if (rising_bits & 0x10) sample_start(state->m_samples, 1, 8, 0); /* Computer car is starting to move */ |
| 957 | if (rising_bits & 0x02) state->m_samples->start(4, 0); /* Steering */ |
| 958 | if (rising_bits & 0x04) state->m_samples->start(0, 1); /* Collision */ |
| 959 | if (rising_bits & 0x10) state->m_samples->start(1, 8); /* Computer car is starting to move */ |
| 960 | 960 | |
| 961 | 961 | state->m_port_3_last_extra = data; |
| 962 | 962 | } |
| r14521 | r14522 | |
| 980 | 980 | switch (data) |
| 981 | 981 | { |
| 982 | 982 | case 0x06: |
| 983 | | sample_start(state->m_samples, 1, 0, 0); /* Shoot */ |
| 983 | state->m_samples->start(1, 0); /* Shoot */ |
| 984 | 984 | break; |
| 985 | 985 | |
| 986 | 986 | case 0x14: |
| 987 | | sample_start(state->m_samples, 2, 2, 0); /* Hit Alien */ |
| 987 | state->m_samples->start(2, 2); /* Hit Alien */ |
| 988 | 988 | break; |
| 989 | 989 | |
| 990 | 990 | case 0x16: |
| 991 | | sample_start(state->m_samples, 2, 5, 0); /* Hit Asteroid */ |
| 991 | state->m_samples->start(2, 5); /* Hit Asteroid */ |
| 992 | 992 | break; |
| 993 | 993 | |
| 994 | 994 | case 0x1e: |
| 995 | | sample_start(state->m_samples, 3, 1, 0); /* Death (followed by 0x0a byte), also bit 4 of port 5 */ |
| 995 | state->m_samples->start(3, 1); /* Death (followed by 0x0a byte), also bit 4 of port 5 */ |
| 996 | 996 | break; |
| 997 | 997 | |
| 998 | 998 | case 0x18: /* Fuel Low */ |
| 999 | 999 | case 0x30: /* Fuel bar filling up */ |
| 1000 | | sample_start(state->m_samples, 4, 7, 0); |
| 1000 | state->m_samples->start(4, 7); |
| 1001 | 1001 | break; |
| 1002 | 1002 | |
| 1003 | 1003 | case 0x02: /* Coin */ |
| r14521 | r14522 | |
| 1007 | 1007 | break; |
| 1008 | 1008 | |
| 1009 | 1009 | case 0x3a: /* Thrust, Docking, extra ship? */ |
| 1010 | | sample_start(state->m_samples, 0, 8, 0); |
| 1010 | state->m_samples->start(0, 8); |
| 1011 | 1011 | break; |
| 1012 | 1012 | } |
| 1013 | 1013 | } |
| r14521 | r14522 | |
| 1023 | 1023 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 1024 | 1024 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; |
| 1025 | 1025 | |
| 1026 | | if (rising_bits & 0x01) sample_start(state->m_samples, 0, 6, 0); /* Walking, get money */ |
| 1026 | if (rising_bits & 0x01) state->m_samples->start(0, 6); /* Walking, get money */ |
| 1027 | 1027 | |
| 1028 | 1028 | sn76477_enable_w(state->m_sn, data & 0x02 ? 0:1); /* Helicopter */ |
| 1029 | 1029 | |
| 1030 | | if (rising_bits & 0x04) sample_start(state->m_samples, 0, 7, 0); /* Translocate */ |
| 1031 | | if (rising_bits & 0x08) sample_start(state->m_samples, 0, 1, 0); /* Jail */ |
| 1032 | | if (rising_bits & 0x10) sample_start(state->m_samples, 3, 8, 0); /* Bonus Man */ |
| 1030 | if (rising_bits & 0x04) state->m_samples->start(0, 7); /* Translocate */ |
| 1031 | if (rising_bits & 0x08) state->m_samples->start(0, 1); /* Jail */ |
| 1032 | if (rising_bits & 0x10) state->m_samples->start(3, 8); /* Bonus Man */ |
| 1033 | 1033 | |
| 1034 | 1034 | state->m_port_1_last_extra = data; |
| 1035 | 1035 | } |
| r14521 | r14522 | |
| 1039 | 1039 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 1040 | 1040 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; |
| 1041 | 1041 | |
| 1042 | | if (rising_bits & 0x01) sample_start(state->m_samples, 0, 3, 0); /* Lands on top of building, wife kicks man */ |
| 1043 | | if (rising_bits & 0x02) sample_start(state->m_samples, 1, 2, 0); /* deposit money, start intermission, end game */ |
| 1044 | | if (rising_bits & 0x04) sample_start(state->m_samples, 2, 5, 0); /* deposit money, start intermission, Slides down rope */ |
| 1045 | | if (rising_bits & 0x08) sample_start(state->m_samples, 3, 0, 0); /* start intermission, end game */ |
| 1046 | | //if (rising_bits & 0x10) sample_start(state->m_samples, 3, 9, 0); /* Dog barking */ |
| 1042 | if (rising_bits & 0x01) state->m_samples->start(0, 3); /* Lands on top of building, wife kicks man */ |
| 1043 | if (rising_bits & 0x02) state->m_samples->start(1, 2); /* deposit money, start intermission, end game */ |
| 1044 | if (rising_bits & 0x04) state->m_samples->start(2, 5); /* deposit money, start intermission, Slides down rope */ |
| 1045 | if (rising_bits & 0x08) state->m_samples->start(3, 0); /* start intermission, end game */ |
| 1046 | //if (rising_bits & 0x10) state->m_samples->start(3, 9); /* Dog barking */ |
| 1047 | 1047 | |
| 1048 | 1048 | state->m_color_map = data & 0x40; |
| 1049 | 1049 | |
| r14521 | r14522 | |
| 1068 | 1068 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 1069 | 1069 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; |
| 1070 | 1070 | |
| 1071 | | if (rising_bits & 0x02) sample_start(state->m_samples, 1, 6, 0); /* Ran over a dot */ |
| 1072 | | if (rising_bits & 0x10) sample_start(state->m_samples, 0, 1, 0); /* Death */ |
| 1071 | if (rising_bits & 0x02) state->m_samples->start(1, 6); /* Ran over a dot */ |
| 1072 | if (rising_bits & 0x10) state->m_samples->start(0, 1); /* Death */ |
| 1073 | 1073 | |
| 1074 | 1074 | state->m_port_1_last_extra = data; |
| 1075 | 1075 | } |
| r14521 | r14522 | |
| 1096 | 1096 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 1097 | 1097 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; |
| 1098 | 1098 | |
| 1099 | | if (rising_bits & 0x01) sample_start(state->m_samples, 0, 3, 0); /* Game Over */ |
| 1100 | | if (rising_bits & 0x02) sample_start(state->m_samples, 2, 0, 0); /* Bird dead */ |
| 1101 | | if (rising_bits & 0x04) sample_start(state->m_samples, 0, 1, 0); /* Rifle being fired */ |
| 1102 | | if (rising_bits & 0x08) sample_start(state->m_samples, 1, 2, 0); /* Man dead */ |
| 1103 | | if (rising_bits & 0x10) sample_start(state->m_samples, 5, 8, 0); /* Bonus Man? */ |
| 1099 | if (rising_bits & 0x01) state->m_samples->start(0, 3); /* Game Over */ |
| 1100 | if (rising_bits & 0x02) state->m_samples->start(2, 0); /* Bird dead */ |
| 1101 | if (rising_bits & 0x04) state->m_samples->start(0, 1); /* Rifle being fired */ |
| 1102 | if (rising_bits & 0x08) state->m_samples->start(1, 2); /* Man dead */ |
| 1103 | if (rising_bits & 0x10) state->m_samples->start(5, 8); /* Bonus Man? */ |
| 1104 | 1104 | |
| 1105 | 1105 | space->machine().sound().system_enable(data & 0x20); |
| 1106 | 1106 | |
| r14521 | r14522 | |
| 1112 | 1112 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 1113 | 1113 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; |
| 1114 | 1114 | |
| 1115 | | if (rising_bits & 0x01) sample_start(state->m_samples, 1, 6, 0); /* Ready? , Game Over */ |
| 1116 | | if (rising_bits & 0x04) sample_start(state->m_samples, 3, 7, 0); /* Big bird dead */ |
| 1115 | if (rising_bits & 0x01) state->m_samples->start(1, 6); /* Ready? , Game Over */ |
| 1116 | if (rising_bits & 0x04) state->m_samples->start(3, 7); /* Big bird dead */ |
| 1117 | 1117 | |
| 1118 | 1118 | sn76477_enable_w(state->m_sn, data & 0x08 ? 0:1); /* Big bird */ |
| 1119 | 1119 | |
| 1120 | | if (rising_bits & 0x10) sample_start(state->m_samples, 2, 7, 0); /* Game Over */ |
| 1120 | if (rising_bits & 0x10) state->m_samples->start(2, 7); /* Game Over */ |
| 1121 | 1121 | |
| 1122 | 1122 | state->m_c8080bw_flip_screen = data & 0x20; |
| 1123 | 1123 | |
| r14521 | r14522 | |
| 1136 | 1136 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); |
| 1137 | 1137 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; |
| 1138 | 1138 | |
| 1139 | | if (rising_bits & 0x01) sample_start(state->m_samples, 4, 4, 0); /* Fleet move */ |
| 1140 | | if (rising_bits & 0x02) sample_start(state->m_samples, 5, 8, 0); /* Extra Tank */ |
| 1139 | if (rising_bits & 0x01) state->m_samples->start(4, 4); /* Fleet move */ |
| 1140 | if (rising_bits & 0x02) state->m_samples->start(5, 8); /* Extra Tank */ |
| 1141 | 1141 | |
| 1142 | 1142 | sn76477_enable_w(state->m_sn, data & 0x04 ? 0:1); /* UFO */ |
| 1143 | 1143 | |
| r14521 | r14522 | |
| 1151 | 1151 | switch (data) |
| 1152 | 1152 | { |
| 1153 | 1153 | case 0x23: |
| 1154 | | sample_start(state->m_samples, 2, 2, 0); /* Hit */ |
| 1154 | state->m_samples->start(2, 2); /* Hit */ |
| 1155 | 1155 | break; |
| 1156 | 1156 | |
| 1157 | 1157 | case 0x2b: |
| 1158 | | sample_start(state->m_samples, 0, 0, 0); /* Shoot */ |
| 1158 | state->m_samples->start(0, 0); /* Shoot */ |
| 1159 | 1159 | break; |
| 1160 | 1160 | |
| 1161 | 1161 | case 0xa3: |
| 1162 | | sample_start(state->m_samples, 3, 7, 0); /* Hit UFO */ |
| 1162 | state->m_samples->start(3, 7); /* Hit UFO */ |
| 1163 | 1163 | break; |
| 1164 | 1164 | |
| 1165 | 1165 | case 0xab: |
| 1166 | | sample_start(state->m_samples, 1, 1, 0); /* Death */ |
| 1166 | state->m_samples->start(1, 1); /* Death */ |
| 1167 | 1167 | break; |
| 1168 | 1168 | } |
| 1169 | 1169 | } |
src/mame/audio/cinemat.c
| r14521 | r14522 | |
| 143 | 143 | |
| 144 | 144 | static void spacewar_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 145 | 145 | { |
| 146 | | device_t *samples = machine.device("samples"); |
| 146 | samples_device *samples = machine.device<samples_device>("samples"); |
| 147 | 147 | |
| 148 | 148 | /* Explosion - rising edge */ |
| 149 | 149 | if (SOUNDVAL_RISING_EDGE(0x01)) |
| 150 | | sample_start(samples, 0, (machine.rand() & 1) ? 0 : 6, 0); |
| 150 | samples->start(0, (machine.rand() & 1) ? 0 : 6); |
| 151 | 151 | |
| 152 | 152 | /* Fire sound - rising edge */ |
| 153 | 153 | if (SOUNDVAL_RISING_EDGE(0x02)) |
| 154 | | sample_start(samples, 1, (machine.rand() & 1) ? 1 : 7, 0); |
| 154 | samples->start(1, (machine.rand() & 1) ? 1 : 7); |
| 155 | 155 | |
| 156 | 156 | /* Player 1 thrust - 0=on, 1=off */ |
| 157 | 157 | if (SOUNDVAL_FALLING_EDGE(0x04)) |
| 158 | | sample_start(samples, 3, 3, 1); |
| 158 | samples->start(3, 3, true); |
| 159 | 159 | if (SOUNDVAL_RISING_EDGE(0x04)) |
| 160 | | sample_stop(samples, 3); |
| 160 | samples->stop(3); |
| 161 | 161 | |
| 162 | 162 | /* Player 2 thrust - 0=on, 1-off */ |
| 163 | 163 | if (SOUNDVAL_FALLING_EDGE(0x08)) |
| 164 | | sample_start(samples, 4, 4, 1); |
| 164 | samples->start(4, 4, true); |
| 165 | 165 | if (SOUNDVAL_RISING_EDGE(0x08)) |
| 166 | | sample_stop(samples, 4); |
| 166 | samples->stop(4); |
| 167 | 167 | |
| 168 | 168 | /* Mute - 0=off, 1=on */ |
| 169 | 169 | if (SOUNDVAL_FALLING_EDGE(0x10)) |
| 170 | | sample_start(samples, 2, 2, 1); /* play idle sound */ |
| 170 | samples->start(2, 2, true); /* play idle sound */ |
| 171 | 171 | if (SOUNDVAL_RISING_EDGE(0x10)) |
| 172 | 172 | { |
| 173 | 173 | int i; |
| r14521 | r14522 | |
| 175 | 175 | /* turn off all but the idle sound */ |
| 176 | 176 | for (i = 0; i < 5; i++) |
| 177 | 177 | if (i != 2) |
| 178 | | sample_stop(samples, i); |
| 178 | samples->stop(i); |
| 179 | 179 | |
| 180 | 180 | /* Pop when board is shut off */ |
| 181 | | sample_start(samples, 2, 5, 0); |
| 181 | samples->start(2, 5); |
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | |
| r14521 | r14522 | |
| 193 | 193 | |
| 194 | 194 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 195 | 195 | |
| 196 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 197 | | MCFG_SOUND_CONFIG(spacewar_samples_interface) |
| 196 | MCFG_SAMPLES_ADD("samples", spacewar_samples_interface) |
| 198 | 197 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 199 | 198 | MACHINE_CONFIG_END |
| 200 | 199 | |
| r14521 | r14522 | |
| 223 | 222 | |
| 224 | 223 | static void barrier_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 225 | 224 | { |
| 226 | | device_t *samples = machine.device("samples"); |
| 225 | samples_device *samples = machine.device<samples_device>("samples"); |
| 227 | 226 | |
| 228 | 227 | /* Player die - rising edge */ |
| 229 | 228 | if (SOUNDVAL_RISING_EDGE(0x01)) |
| 230 | | sample_start(samples, 0, 0, 0); |
| 229 | samples->start(0, 0); |
| 231 | 230 | |
| 232 | 231 | /* Player move - falling edge */ |
| 233 | 232 | if (SOUNDVAL_FALLING_EDGE(0x02)) |
| 234 | | sample_start(samples, 1, 1, 0); |
| 233 | samples->start(1, 1); |
| 235 | 234 | |
| 236 | 235 | /* Enemy move - falling edge */ |
| 237 | 236 | if (SOUNDVAL_FALLING_EDGE(0x04)) |
| 238 | | sample_start(samples, 2, 2, 0); |
| 237 | samples->start(2, 2); |
| 239 | 238 | } |
| 240 | 239 | |
| 241 | 240 | static MACHINE_RESET( barrier ) |
| r14521 | r14522 | |
| 249 | 248 | |
| 250 | 249 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 251 | 250 | |
| 252 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 253 | | MCFG_SOUND_CONFIG(barrier_samples_interface) |
| 251 | MCFG_SAMPLES_ADD("samples", barrier_samples_interface) |
| 254 | 252 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 255 | 253 | MACHINE_CONFIG_END |
| 256 | 254 | |
| r14521 | r14522 | |
| 278 | 276 | static void speedfrk_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 279 | 277 | { |
| 280 | 278 | cinemat_state *state = machine.driver_data<cinemat_state>(); |
| 281 | | device_t *samples = machine.device("samples"); |
| 279 | samples_device *samples = machine.device<samples_device>("samples"); |
| 282 | 280 | |
| 283 | 281 | /* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */ |
| 284 | 282 | if (SOUNDVAL_FALLING_EDGE(0x08)) |
| r14521 | r14522 | |
| 292 | 290 | |
| 293 | 291 | /* off-road - 1=on, 0=off */ |
| 294 | 292 | if (SOUNDVAL_RISING_EDGE(0x10)) |
| 295 | | sample_start(samples, 0, 0, 1); |
| 293 | samples->start(0, 0, true); |
| 296 | 294 | if (SOUNDVAL_FALLING_EDGE(0x10)) |
| 297 | | sample_stop(samples, 0); |
| 295 | samples->stop(0); |
| 298 | 296 | |
| 299 | 297 | /* start LED is controlled by bit 0x02 */ |
| 300 | 298 | set_led_status(machine, 0, ~sound_val & 0x02); |
| r14521 | r14522 | |
| 311 | 309 | |
| 312 | 310 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 313 | 311 | |
| 314 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 315 | | MCFG_SOUND_CONFIG(speedfrk_samples_interface) |
| 312 | MCFG_SAMPLES_ADD("samples", speedfrk_samples_interface) |
| 316 | 313 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 317 | 314 | MACHINE_CONFIG_END |
| 318 | 315 | |
| r14521 | r14522 | |
| 344 | 341 | |
| 345 | 342 | static void starhawk_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 346 | 343 | { |
| 347 | | device_t *samples = machine.device("samples"); |
| 344 | samples_device *samples = machine.device<samples_device>("samples"); |
| 348 | 345 | |
| 349 | 346 | /* explosion - falling edge */ |
| 350 | 347 | if (SOUNDVAL_FALLING_EDGE(0x01)) |
| 351 | | sample_start(samples, 0, 0, 0); |
| 348 | samples->start(0, 0); |
| 352 | 349 | |
| 353 | 350 | /* right laser - falling edge */ |
| 354 | 351 | if (SOUNDVAL_FALLING_EDGE(0x02)) |
| 355 | | sample_start(samples, 1, 1, 0); |
| 352 | samples->start(1, 1); |
| 356 | 353 | |
| 357 | 354 | /* left laser - falling edge */ |
| 358 | 355 | if (SOUNDVAL_FALLING_EDGE(0x04)) |
| 359 | | sample_start(samples, 2, 2, 0); |
| 356 | samples->start(2, 2); |
| 360 | 357 | |
| 361 | 358 | /* K - 0=on, 1=off */ |
| 362 | 359 | if (SOUNDVAL_FALLING_EDGE(0x08)) |
| 363 | | sample_start(samples, 3, 3, 1); |
| 360 | samples->start(3, 3, true); |
| 364 | 361 | if (SOUNDVAL_RISING_EDGE(0x08)) |
| 365 | | sample_stop(samples, 3); |
| 362 | samples->stop(3); |
| 366 | 363 | |
| 367 | 364 | /* master - 0=on, 1=off */ |
| 368 | 365 | if (SOUNDVAL_FALLING_EDGE(0x10)) |
| 369 | | sample_start(samples, 4, 4, 1); |
| 366 | samples->start(4, 4, true); |
| 370 | 367 | if (SOUNDVAL_RISING_EDGE(0x10)) |
| 371 | | sample_stop(samples, 4); |
| 368 | samples->stop(4); |
| 372 | 369 | |
| 373 | 370 | /* K exit - 1=on, 0=off */ |
| 374 | 371 | if (SOUNDVAL_RISING_EDGE(0x80)) |
| 375 | | sample_start(samples, 3, 5, 1); |
| 372 | samples->start(3, 5, true); |
| 376 | 373 | if (SOUNDVAL_FALLING_EDGE(0x80)) |
| 377 | | sample_stop(samples, 3); |
| 374 | samples->stop(3); |
| 378 | 375 | } |
| 379 | 376 | |
| 380 | 377 | static MACHINE_RESET( starhawk ) |
| r14521 | r14522 | |
| 388 | 385 | |
| 389 | 386 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 390 | 387 | |
| 391 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 392 | | MCFG_SOUND_CONFIG(starhawk_samples_interface) |
| 388 | MCFG_SAMPLES_ADD("samples", starhawk_samples_interface) |
| 393 | 389 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 394 | 390 | MACHINE_CONFIG_END |
| 395 | 391 | |
| r14521 | r14522 | |
| 421 | 417 | |
| 422 | 418 | static void sundance_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 423 | 419 | { |
| 424 | | device_t *samples = machine.device("samples"); |
| 420 | samples_device *samples = machine.device<samples_device>("samples"); |
| 425 | 421 | |
| 426 | 422 | /* bong - falling edge */ |
| 427 | 423 | if (SOUNDVAL_FALLING_EDGE(0x01)) |
| 428 | | sample_start(samples, 0, 0, 0); |
| 424 | samples->start(0, 0); |
| 429 | 425 | |
| 430 | 426 | /* whoosh - falling edge */ |
| 431 | 427 | if (SOUNDVAL_FALLING_EDGE(0x02)) |
| 432 | | sample_start(samples, 1, 1, 0); |
| 428 | samples->start(1, 1); |
| 433 | 429 | |
| 434 | 430 | /* explosion - falling edge */ |
| 435 | 431 | if (SOUNDVAL_FALLING_EDGE(0x04)) |
| 436 | | sample_start(samples, 2, 2, 0); |
| 432 | samples->start(2, 2); |
| 437 | 433 | |
| 438 | 434 | /* ping - falling edge */ |
| 439 | 435 | if (SOUNDVAL_FALLING_EDGE(0x08)) |
| 440 | | sample_start(samples, 3, 3, 0); |
| 436 | samples->start(3, 3); |
| 441 | 437 | |
| 442 | 438 | /* ping - falling edge */ |
| 443 | 439 | if (SOUNDVAL_FALLING_EDGE(0x10)) |
| 444 | | sample_start(samples, 4, 4, 0); |
| 440 | samples->start(4, 4); |
| 445 | 441 | |
| 446 | 442 | /* hatch - falling edge */ |
| 447 | 443 | if (SOUNDVAL_FALLING_EDGE(0x80)) |
| 448 | | sample_start(samples, 5, 5, 0); |
| 444 | samples->start(5, 5); |
| 449 | 445 | } |
| 450 | 446 | |
| 451 | 447 | static MACHINE_RESET( sundance ) |
| r14521 | r14522 | |
| 459 | 455 | |
| 460 | 456 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 461 | 457 | |
| 462 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 463 | | MCFG_SOUND_CONFIG(sundance_samples_interface) |
| 458 | MCFG_SAMPLES_ADD("samples", sundance_samples_interface) |
| 464 | 459 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 465 | 460 | MACHINE_CONFIG_END |
| 466 | 461 | |
| r14521 | r14522 | |
| 496 | 491 | /* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */ |
| 497 | 492 | if (SOUNDVAL_FALLING_EDGE(0x10)) |
| 498 | 493 | { |
| 499 | | device_t *samples = machine.device("samples"); |
| 494 | samples_device *samples = machine.device<samples_device>("samples"); |
| 500 | 495 | |
| 501 | 496 | /* update the shift register (actually just a simple mux) */ |
| 502 | 497 | state->m_current_shift = (state->m_current_shift & ~(1 << (sound_val & 7))) | (((sound_val >> 3) & 1) << (sound_val & 7)); |
| 503 | 498 | |
| 504 | 499 | /* explosion - falling edge */ |
| 505 | 500 | if (SHIFTREG_FALLING_EDGE(0x01)) |
| 506 | | sample_start(samples, 0, 0, 0); |
| 501 | samples->start(0, 0); |
| 507 | 502 | |
| 508 | 503 | /* rumble - 0=on, 1=off */ |
| 509 | 504 | if (SHIFTREG_FALLING_EDGE(0x02)) |
| 510 | | sample_start(samples, 1, 1, 1); |
| 505 | samples->start(1, 1, true); |
| 511 | 506 | if (SHIFTREG_RISING_EDGE(0x02)) |
| 512 | | sample_stop(samples, 1); |
| 507 | samples->stop(1); |
| 513 | 508 | |
| 514 | 509 | /* laser - 0=on, 1=off */ |
| 515 | 510 | if (SHIFTREG_FALLING_EDGE(0x04)) |
| 516 | | sample_start(samples, 2, 2, 1); |
| 511 | samples->start(2, 2, true); |
| 517 | 512 | if (SHIFTREG_RISING_EDGE(0x04)) |
| 518 | | sample_stop(samples, 2); |
| 513 | samples->stop(2); |
| 519 | 514 | |
| 520 | 515 | /* shield - 0=on, 1=off */ |
| 521 | 516 | if (SHIFTREG_FALLING_EDGE(0x08)) |
| 522 | | sample_start(samples, 3, 3, 1); |
| 517 | samples->start(3, 3, true); |
| 523 | 518 | if (SHIFTREG_RISING_EDGE(0x08)) |
| 524 | | sample_stop(samples, 3); |
| 519 | samples->stop(3); |
| 525 | 520 | |
| 526 | 521 | /* bounce - falling edge */ |
| 527 | 522 | if (SHIFTREG_FALLING_EDGE(0x10)) |
| 528 | | sample_start(samples, 4, 4, 0); |
| 523 | samples->start(4, 4); |
| 529 | 524 | |
| 530 | 525 | /* hyperspace - falling edge */ |
| 531 | 526 | if (SHIFTREG_FALLING_EDGE(0x20)) |
| 532 | | sample_start(samples, 5, 5, 0); |
| 527 | samples->start(5, 5); |
| 533 | 528 | |
| 534 | 529 | /* LED */ |
| 535 | 530 | set_led_status(machine, 0, state->m_current_shift & 0x40); |
| r14521 | r14522 | |
| 550 | 545 | |
| 551 | 546 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 552 | 547 | |
| 553 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 554 | | MCFG_SOUND_CONFIG(tailg_samples_interface) |
| 548 | MCFG_SAMPLES_ADD("samples", tailg_samples_interface) |
| 555 | 549 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 556 | 550 | MACHINE_CONFIG_END |
| 557 | 551 | |
| r14521 | r14522 | |
| 582 | 576 | |
| 583 | 577 | static void warrior_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 584 | 578 | { |
| 585 | | device_t *samples = machine.device("samples"); |
| 579 | samples_device *samples = machine.device<samples_device>("samples"); |
| 586 | 580 | |
| 587 | 581 | /* normal level - 0=on, 1=off */ |
| 588 | 582 | if (SOUNDVAL_FALLING_EDGE(0x01)) |
| 589 | | sample_start(samples, 0, 0, 1); |
| 583 | samples->start(0, 0, true); |
| 590 | 584 | if (SOUNDVAL_RISING_EDGE(0x01)) |
| 591 | | sample_stop(samples, 0); |
| 585 | samples->stop(0); |
| 592 | 586 | |
| 593 | 587 | /* hi level - 0=on, 1=off */ |
| 594 | 588 | if (SOUNDVAL_FALLING_EDGE(0x02)) |
| 595 | | sample_start(samples, 1, 1, 1); |
| 589 | samples->start(1, 1, true); |
| 596 | 590 | if (SOUNDVAL_RISING_EDGE(0x02)) |
| 597 | | sample_stop(samples, 1); |
| 591 | samples->stop(1); |
| 598 | 592 | |
| 599 | 593 | /* explosion - falling edge */ |
| 600 | 594 | if (SOUNDVAL_FALLING_EDGE(0x04)) |
| 601 | | sample_start(samples, 2, 2, 0); |
| 595 | samples->start(2, 2); |
| 602 | 596 | |
| 603 | 597 | /* fall - falling edge */ |
| 604 | 598 | if (SOUNDVAL_FALLING_EDGE(0x08)) |
| 605 | | sample_start(samples, 3, 3, 0); |
| 599 | samples->start(3, 3); |
| 606 | 600 | |
| 607 | 601 | /* appear - falling edge */ |
| 608 | 602 | if (SOUNDVAL_FALLING_EDGE(0x10)) |
| 609 | | sample_start(samples, 4, 4, 0); |
| 603 | samples->start(4, 4); |
| 610 | 604 | } |
| 611 | 605 | |
| 612 | 606 | static MACHINE_RESET( warrior ) |
| r14521 | r14522 | |
| 620 | 614 | |
| 621 | 615 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 622 | 616 | |
| 623 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 624 | | MCFG_SOUND_CONFIG(warrior_samples_interface) |
| 617 | MCFG_SAMPLES_ADD("samples", warrior_samples_interface) |
| 625 | 618 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 626 | 619 | MACHINE_CONFIG_END |
| 627 | 620 | |
| r14521 | r14522 | |
| 655 | 648 | static void armora_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 656 | 649 | { |
| 657 | 650 | cinemat_state *state = machine.driver_data<cinemat_state>(); |
| 658 | | device_t *samples = machine.device("samples"); |
| 651 | samples_device *samples = machine.device<samples_device>("samples"); |
| 659 | 652 | |
| 660 | 653 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| 661 | 654 | if (SOUNDVAL_RISING_EDGE(0x10)) |
| r14521 | r14522 | |
| 668 | 661 | |
| 669 | 662 | /* lo explosion - falling edge */ |
| 670 | 663 | if (SHIFTREG_FALLING_EDGE(0x10)) |
| 671 | | sample_start(samples, 0, 0, 0); |
| 664 | samples->start(0, 0); |
| 672 | 665 | |
| 673 | 666 | /* jeep fire - falling edge */ |
| 674 | 667 | if (SHIFTREG_FALLING_EDGE(0x20)) |
| 675 | | sample_start(samples, 1, 1, 0); |
| 668 | samples->start(1, 1); |
| 676 | 669 | |
| 677 | 670 | /* hi explosion - falling edge */ |
| 678 | 671 | if (SHIFTREG_FALLING_EDGE(0x40)) |
| 679 | | sample_start(samples, 2, 2, 0); |
| 672 | samples->start(2, 2); |
| 680 | 673 | |
| 681 | 674 | /* tank fire - falling edge */ |
| 682 | 675 | if (SHIFTREG_FALLING_EDGE(0x80)) |
| 683 | | sample_start(samples, 3, 3, 0); |
| 676 | samples->start(3, 3); |
| 684 | 677 | |
| 685 | 678 | /* remember the previous value */ |
| 686 | 679 | state->m_last_shift = state->m_current_shift; |
| r14521 | r14522 | |
| 689 | 682 | /* tank sound - 0=on, 1=off */ |
| 690 | 683 | /* still not totally correct - should be multiple speeds based on remaining bits in shift reg */ |
| 691 | 684 | if (SOUNDVAL_FALLING_EDGE(0x02)) |
| 692 | | sample_start(samples, 4, 4, 1); |
| 685 | samples->start(4, 4, true); |
| 693 | 686 | if (SOUNDVAL_RISING_EDGE(0x02)) |
| 694 | | sample_stop(samples, 4); |
| 687 | samples->stop(4); |
| 695 | 688 | |
| 696 | 689 | /* beep sound - 0=on, 1=off */ |
| 697 | 690 | if (SOUNDVAL_FALLING_EDGE(0x04)) |
| 698 | | sample_start(samples, 5, 5, 1); |
| 691 | samples->start(5, 5, true); |
| 699 | 692 | if (SOUNDVAL_RISING_EDGE(0x04)) |
| 700 | | sample_stop(samples, 5); |
| 693 | samples->stop(5); |
| 701 | 694 | |
| 702 | 695 | /* chopper sound - 0=on, 1=off */ |
| 703 | 696 | if (SOUNDVAL_FALLING_EDGE(0x08)) |
| 704 | | sample_start(samples, 6, 6, 1); |
| 697 | samples->start(6, 6, true); |
| 705 | 698 | if (SOUNDVAL_RISING_EDGE(0x08)) |
| 706 | | sample_stop(samples, 6); |
| 699 | samples->stop(6); |
| 707 | 700 | } |
| 708 | 701 | |
| 709 | 702 | static MACHINE_RESET( armora ) |
| r14521 | r14522 | |
| 717 | 710 | |
| 718 | 711 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 719 | 712 | |
| 720 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 721 | | MCFG_SOUND_CONFIG(armora_samples_interface) |
| 713 | MCFG_SAMPLES_ADD("samples", armora_samples_interface) |
| 722 | 714 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 723 | 715 | MACHINE_CONFIG_END |
| 724 | 716 | |
| r14521 | r14522 | |
| 758 | 750 | static void ripoff_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 759 | 751 | { |
| 760 | 752 | cinemat_state *state = machine.driver_data<cinemat_state>(); |
| 761 | | device_t *samples = machine.device("samples"); |
| 753 | samples_device *samples = machine.device<samples_device>("samples"); |
| 762 | 754 | |
| 763 | 755 | /* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */ |
| 764 | 756 | if (SOUNDVAL_RISING_EDGE(0x02)) |
| r14521 | r14522 | |
| 769 | 761 | { |
| 770 | 762 | /* background - 0=on, 1=off, selected by bits 0x38 */ |
| 771 | 763 | if ((((state->m_current_shift ^ state->m_last_shift) & 0x38) && !(state->m_current_shift & 0x04)) || SHIFTREG_FALLING_EDGE(0x04)) |
| 772 | | sample_start(samples, 5, 5 + ((state->m_current_shift >> 5) & 7), 1); |
| 764 | samples->start(5, 5 + ((state->m_current_shift >> 5) & 7), true); |
| 773 | 765 | if (SHIFTREG_RISING_EDGE(0x04)) |
| 774 | | sample_stop(samples, 5); |
| 766 | samples->stop(5); |
| 775 | 767 | |
| 776 | 768 | /* beep - falling edge */ |
| 777 | 769 | if (SHIFTREG_FALLING_EDGE(0x02)) |
| 778 | | sample_start(samples, 0, 0, 0); |
| 770 | samples->start(0, 0); |
| 779 | 771 | |
| 780 | 772 | /* motor - 0=on, 1=off */ |
| 781 | 773 | if (SHIFTREG_FALLING_EDGE(0x01)) |
| 782 | | sample_start(samples, 1, 1, 1); |
| 774 | samples->start(1, 1, true); |
| 783 | 775 | if (SHIFTREG_RISING_EDGE(0x01)) |
| 784 | | sample_stop(samples, 1); |
| 776 | samples->stop(1); |
| 785 | 777 | |
| 786 | 778 | /* remember the previous value */ |
| 787 | 779 | state->m_last_shift = state->m_current_shift; |
| r14521 | r14522 | |
| 789 | 781 | |
| 790 | 782 | /* torpedo - falling edge */ |
| 791 | 783 | if (SOUNDVAL_FALLING_EDGE(0x08)) |
| 792 | | sample_start(samples, 2, 2, 0); |
| 784 | samples->start(2, 2); |
| 793 | 785 | |
| 794 | 786 | /* laser - falling edge */ |
| 795 | 787 | if (SOUNDVAL_FALLING_EDGE(0x10)) |
| 796 | | sample_start(samples, 3, 3, 0); |
| 788 | samples->start(3, 3); |
| 797 | 789 | |
| 798 | 790 | /* explosion - falling edge */ |
| 799 | 791 | if (SOUNDVAL_FALLING_EDGE(0x80)) |
| 800 | | sample_start(samples, 4, 4, 0); |
| 792 | samples->start(4, 4); |
| 801 | 793 | } |
| 802 | 794 | |
| 803 | 795 | static MACHINE_RESET( ripoff ) |
| r14521 | r14522 | |
| 811 | 803 | |
| 812 | 804 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 813 | 805 | |
| 814 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 815 | | MCFG_SOUND_CONFIG(ripoff_samples_interface) |
| 806 | MCFG_SAMPLES_ADD("samples", ripoff_samples_interface) |
| 816 | 807 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 817 | 808 | MACHINE_CONFIG_END |
| 818 | 809 | |
| r14521 | r14522 | |
| 847 | 838 | static void starcas_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 848 | 839 | { |
| 849 | 840 | cinemat_state *state = machine.driver_data<cinemat_state>(); |
| 850 | | device_t *samples = machine.device("samples"); |
| 841 | samples_device *samples = machine.device<samples_device>("samples"); |
| 851 | 842 | UINT32 target_pitch; |
| 852 | 843 | |
| 853 | 844 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| r14521 | r14522 | |
| 859 | 850 | { |
| 860 | 851 | /* fireball - falling edge */ |
| 861 | 852 | if (SHIFTREG_FALLING_EDGE(0x80)) |
| 862 | | sample_start(samples, 0, 0, 0); |
| 853 | samples->start(0, 0); |
| 863 | 854 | |
| 864 | 855 | /* shield hit - falling edge */ |
| 865 | 856 | if (SHIFTREG_FALLING_EDGE(0x40)) |
| 866 | | sample_start(samples, 1, 1, 0); |
| 857 | samples->start(1, 1); |
| 867 | 858 | |
| 868 | 859 | /* star sound - 0=off, 1=on */ |
| 869 | 860 | if (SHIFTREG_RISING_EDGE(0x20)) |
| 870 | | sample_start(samples, 2, 2, 1); |
| 861 | samples->start(2, 2, true); |
| 871 | 862 | if (SHIFTREG_FALLING_EDGE(0x20)) |
| 872 | | sample_stop(samples, 2); |
| 863 | samples->stop(2); |
| 873 | 864 | |
| 874 | 865 | /* thrust sound - 1=off, 0=on*/ |
| 875 | 866 | if (SHIFTREG_FALLING_EDGE(0x10)) |
| 876 | | sample_start(samples, 3, 3, 1); |
| 867 | samples->start(3, 3, true); |
| 877 | 868 | if (SHIFTREG_RISING_EDGE(0x10)) |
| 878 | | sample_stop(samples, 3); |
| 869 | samples->stop(3); |
| 879 | 870 | |
| 880 | 871 | /* drone - 1=off, 0=on */ |
| 881 | 872 | if (SHIFTREG_FALLING_EDGE(0x08)) |
| 882 | | sample_start(samples, 4, 4, 1); |
| 873 | samples->start(4, 4, true); |
| 883 | 874 | if (SHIFTREG_RISING_EDGE(0x08)) |
| 884 | | sample_stop(samples, 4); |
| 875 | samples->stop(4); |
| 885 | 876 | |
| 886 | 877 | /* latch the drone pitch */ |
| 887 | 878 | target_pitch = (state->m_current_shift & 7) + ((state->m_current_shift & 2) << 2); |
| r14521 | r14522 | |
| 894 | 885 | state->m_current_pitch -= 225; |
| 895 | 886 | if (state->m_current_pitch < target_pitch) |
| 896 | 887 | state->m_current_pitch += 150; |
| 897 | | sample_set_freq(samples, 4, state->m_current_pitch); |
| 888 | samples->set_frequency(4, state->m_current_pitch); |
| 898 | 889 | state->m_last_frame = machine.primary_screen->frame_number(); |
| 899 | 890 | } |
| 900 | 891 | |
| r14521 | r14522 | |
| 904 | 895 | |
| 905 | 896 | /* loud explosion - falling edge */ |
| 906 | 897 | if (SOUNDVAL_FALLING_EDGE(0x02)) |
| 907 | | sample_start(samples, 5, 5, 0); |
| 898 | samples->start(5, 5); |
| 908 | 899 | |
| 909 | 900 | /* soft explosion - falling edge */ |
| 910 | 901 | if (SOUNDVAL_FALLING_EDGE(0x04)) |
| 911 | | sample_start(samples, 6, 6, 0); |
| 902 | samples->start(6, 6); |
| 912 | 903 | |
| 913 | 904 | /* player fire - falling edge */ |
| 914 | 905 | if (SOUNDVAL_FALLING_EDGE(0x08)) |
| 915 | | sample_start(samples, 7, 7, 0); |
| 906 | samples->start(7, 7); |
| 916 | 907 | } |
| 917 | 908 | |
| 918 | 909 | static MACHINE_RESET( starcas ) |
| r14521 | r14522 | |
| 926 | 917 | |
| 927 | 918 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 928 | 919 | |
| 929 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 930 | | MCFG_SOUND_CONFIG(starcas_samples_interface) |
| 920 | MCFG_SAMPLES_ADD("samples", starcas_samples_interface) |
| 931 | 921 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 932 | 922 | MACHINE_CONFIG_END |
| 933 | 923 | |
| r14521 | r14522 | |
| 962 | 952 | static void solarq_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 963 | 953 | { |
| 964 | 954 | cinemat_state *state = machine.driver_data<cinemat_state>(); |
| 965 | | device_t *samples = machine.device("samples"); |
| 955 | samples_device *samples = machine.device<samples_device>("samples"); |
| 966 | 956 | |
| 967 | 957 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| 968 | 958 | if (SOUNDVAL_RISING_EDGE(0x10)) |
| r14521 | r14522 | |
| 976 | 966 | |
| 977 | 967 | /* loud explosion - falling edge */ |
| 978 | 968 | if (SHIFTREG_FALLING_EDGE(0x80)) |
| 979 | | sample_start(samples, 0, 0, 0); |
| 969 | samples->start(0, 0); |
| 980 | 970 | |
| 981 | 971 | /* soft explosion - falling edge */ |
| 982 | 972 | if (SHIFTREG_FALLING_EDGE(0x40)) |
| 983 | | sample_start(samples, 1, 1, 0); |
| 973 | samples->start(1, 1); |
| 984 | 974 | |
| 985 | 975 | /* thrust - 0=on, 1=off */ |
| 986 | 976 | if (SHIFTREG_FALLING_EDGE(0x20)) |
| 987 | 977 | { |
| 988 | 978 | state->m_target_volume = 1.0; |
| 989 | | if (!sample_playing(samples, 2)) |
| 990 | | sample_start(samples, 2, 2, 1); |
| 979 | if (!samples->playing(2)) |
| 980 | samples->start(2, 2, true); |
| 991 | 981 | } |
| 992 | 982 | if (SHIFTREG_RISING_EDGE(0x20)) |
| 993 | 983 | state->m_target_volume = 0; |
| 994 | 984 | |
| 995 | 985 | /* ramp the thrust volume */ |
| 996 | | if (sample_playing(samples, 2) && machine.primary_screen->frame_number() > state->m_last_frame) |
| 986 | if (samples->playing(2) && machine.primary_screen->frame_number() > state->m_last_frame) |
| 997 | 987 | { |
| 998 | 988 | if (state->m_current_volume > state->m_target_volume) |
| 999 | 989 | state->m_current_volume -= 0.078f; |
| 1000 | 990 | if (state->m_current_volume < state->m_target_volume) |
| 1001 | 991 | state->m_current_volume += 0.078f; |
| 1002 | 992 | if (state->m_current_volume > 0) |
| 1003 | | sample_set_volume(samples, 2, state->m_current_volume); |
| 993 | samples->set_volume(2, state->m_current_volume); |
| 1004 | 994 | else |
| 1005 | | sample_stop(samples, 2); |
| 995 | samples->stop(2); |
| 1006 | 996 | state->m_last_frame = machine.primary_screen->frame_number(); |
| 1007 | 997 | } |
| 1008 | 998 | |
| 1009 | 999 | /* fire - falling edge */ |
| 1010 | 1000 | if (SHIFTREG_FALLING_EDGE(0x10)) |
| 1011 | | sample_start(samples, 3, 3, 0); |
| 1001 | samples->start(3, 3); |
| 1012 | 1002 | |
| 1013 | 1003 | /* capture - falling edge */ |
| 1014 | 1004 | if (SHIFTREG_FALLING_EDGE(0x08)) |
| 1015 | | sample_start(samples, 4, 4, 0); |
| 1005 | samples->start(4, 4); |
| 1016 | 1006 | |
| 1017 | 1007 | /* nuke - 1=on, 0=off */ |
| 1018 | 1008 | if (SHIFTREG_RISING_EDGE(0x04)) |
| 1019 | | sample_start(samples, 5, 5, 1); |
| 1009 | samples->start(5, 5, true); |
| 1020 | 1010 | if (SHIFTREG_FALLING_EDGE(0x04)) |
| 1021 | | sample_stop(samples, 5); |
| 1011 | samples->stop(5); |
| 1022 | 1012 | |
| 1023 | 1013 | /* photon - falling edge */ |
| 1024 | 1014 | if (SHIFTREG_FALLING_EDGE(0x02)) |
| 1025 | | sample_start(samples, 6, 6, 0); |
| 1015 | samples->start(6, 6); |
| 1026 | 1016 | |
| 1027 | 1017 | /* remember the previous value */ |
| 1028 | 1018 | state->m_last_shift = state->m_current_shift; |
| r14521 | r14522 | |
| 1035 | 1025 | |
| 1036 | 1026 | /* start/stop the music sample on the high bit */ |
| 1037 | 1027 | if (SHIFTREG2_RISING_EDGE(0x8000)) |
| 1038 | | sample_start(samples, 7, 7, 1); |
| 1028 | samples->start(7, 7, true); |
| 1039 | 1029 | if (SHIFTREG2_FALLING_EDGE(0x8000)) |
| 1040 | | sample_stop(samples, 7); |
| 1030 | samples->stop(7); |
| 1041 | 1031 | |
| 1042 | 1032 | /* set the frequency */ |
| 1043 | 1033 | freq = 56818.181818 / (4096 - (state->m_current_shift & 0xfff)); |
| 1044 | | sample_set_freq(samples, 7, 44100 * freq / 1050); |
| 1034 | samples->set_frequency(7, 44100 * freq / 1050); |
| 1045 | 1035 | |
| 1046 | 1036 | /* set the volume */ |
| 1047 | 1037 | vol = (~state->m_current_shift >> 12) & 7; |
| 1048 | | sample_set_volume(samples, 7, vol / 7.0); |
| 1038 | samples->set_volume(7, vol / 7.0); |
| 1049 | 1039 | |
| 1050 | 1040 | /* remember the previous value */ |
| 1051 | 1041 | state->m_last_shift2 = state->m_current_shift; |
| r14521 | r14522 | |
| 1063 | 1053 | |
| 1064 | 1054 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1065 | 1055 | |
| 1066 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1067 | | MCFG_SOUND_CONFIG(solarq_samples_interface) |
| 1056 | MCFG_SAMPLES_ADD("samples", solarq_samples_interface) |
| 1068 | 1057 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 1069 | 1058 | MACHINE_CONFIG_END |
| 1070 | 1059 | |
| r14521 | r14522 | |
| 1103 | 1092 | static void boxingb_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 1104 | 1093 | { |
| 1105 | 1094 | cinemat_state *state = machine.driver_data<cinemat_state>(); |
| 1106 | | device_t *samples = machine.device("samples"); |
| 1095 | samples_device *samples = machine.device<samples_device>("samples"); |
| 1107 | 1096 | |
| 1108 | 1097 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| 1109 | 1098 | if (SOUNDVAL_RISING_EDGE(0x10)) |
| r14521 | r14522 | |
| 1117 | 1106 | |
| 1118 | 1107 | /* soft explosion - falling edge */ |
| 1119 | 1108 | if (SHIFTREG_FALLING_EDGE(0x80)) |
| 1120 | | sample_start(samples, 0, 0, 0); |
| 1109 | samples->start(0, 0); |
| 1121 | 1110 | |
| 1122 | 1111 | /* loud explosion - falling edge */ |
| 1123 | 1112 | if (SHIFTREG_FALLING_EDGE(0x40)) |
| 1124 | | sample_start(samples, 1, 1, 0); |
| 1113 | samples->start(1, 1); |
| 1125 | 1114 | |
| 1126 | 1115 | /* chirping birds - 0=on, 1=off */ |
| 1127 | 1116 | if (SHIFTREG_FALLING_EDGE(0x20)) |
| 1128 | | sample_start(samples, 2, 2, 0); |
| 1117 | samples->start(2, 2); |
| 1129 | 1118 | if (SHIFTREG_RISING_EDGE(0x20)) |
| 1130 | | sample_stop(samples, 2); |
| 1119 | samples->stop(2); |
| 1131 | 1120 | |
| 1132 | 1121 | /* egg cracking - falling edge */ |
| 1133 | 1122 | if (SHIFTREG_FALLING_EDGE(0x10)) |
| 1134 | | sample_start(samples, 3, 3, 0); |
| 1123 | samples->start(3, 3); |
| 1135 | 1124 | |
| 1136 | 1125 | /* bug pushing A - rising edge */ |
| 1137 | 1126 | if (SHIFTREG_RISING_EDGE(0x08)) |
| 1138 | | sample_start(samples, 4, 4, 0); |
| 1127 | samples->start(4, 4); |
| 1139 | 1128 | |
| 1140 | 1129 | /* bug pushing B - rising edge */ |
| 1141 | 1130 | if (SHIFTREG_RISING_EDGE(0x04)) |
| 1142 | | sample_start(samples, 5, 5, 0); |
| 1131 | samples->start(5, 5); |
| 1143 | 1132 | |
| 1144 | 1133 | /* bug dying - falling edge */ |
| 1145 | 1134 | if (SHIFTREG_FALLING_EDGE(0x02)) |
| 1146 | | sample_start(samples, 6, 6, 0); |
| 1135 | samples->start(6, 6); |
| 1147 | 1136 | |
| 1148 | 1137 | /* beetle on screen - falling edge */ |
| 1149 | 1138 | if (SHIFTREG_FALLING_EDGE(0x01)) |
| 1150 | | sample_start(samples, 7, 7, 0); |
| 1139 | samples->start(7, 7); |
| 1151 | 1140 | |
| 1152 | 1141 | /* remember the previous value */ |
| 1153 | 1142 | state->m_last_shift = state->m_current_shift; |
| r14521 | r14522 | |
| 1160 | 1149 | |
| 1161 | 1150 | /* start/stop the music sample on the high bit */ |
| 1162 | 1151 | if (SHIFTREG2_RISING_EDGE(0x8000)) |
| 1163 | | sample_start(samples, 8, 8, 1); |
| 1152 | samples->start(8, 8, true); |
| 1164 | 1153 | if (SHIFTREG2_FALLING_EDGE(0x8000)) |
| 1165 | | sample_stop(samples, 8); |
| 1154 | samples->stop(8); |
| 1166 | 1155 | |
| 1167 | 1156 | /* set the frequency */ |
| 1168 | 1157 | freq = 56818.181818 / (4096 - (state->m_current_shift & 0xfff)); |
| 1169 | | sample_set_freq(samples, 8, 44100 * freq / 1050); |
| 1158 | samples->set_frequency(8, 44100 * freq / 1050); |
| 1170 | 1159 | |
| 1171 | 1160 | /* set the volume */ |
| 1172 | 1161 | vol = (~state->m_current_shift >> 12) & 3; |
| 1173 | | sample_set_volume(samples, 8, vol / 3.0); |
| 1162 | samples->set_volume(8, vol / 3.0); |
| 1174 | 1163 | |
| 1175 | 1164 | /* cannon - falling edge */ |
| 1176 | 1165 | if (SHIFTREG2_RISING_EDGE(0x4000)) |
| 1177 | | sample_start(samples, 9, 9, 0); |
| 1166 | samples->start(9, 9); |
| 1178 | 1167 | |
| 1179 | 1168 | /* remember the previous value */ |
| 1180 | 1169 | state->m_last_shift2 = state->m_current_shift; |
| r14521 | r14522 | |
| 1182 | 1171 | |
| 1183 | 1172 | /* bounce - rising edge */ |
| 1184 | 1173 | if (SOUNDVAL_RISING_EDGE(0x04)) |
| 1185 | | sample_start(samples, 10, 10, 0); |
| 1174 | samples->start(10, 10); |
| 1186 | 1175 | |
| 1187 | 1176 | /* bell - falling edge */ |
| 1188 | 1177 | if (SOUNDVAL_RISING_EDGE(0x08)) |
| 1189 | | sample_start(samples, 11, 11, 0); |
| 1178 | samples->start(11, 11); |
| 1190 | 1179 | } |
| 1191 | 1180 | |
| 1192 | 1181 | static MACHINE_RESET( boxingb ) |
| r14521 | r14522 | |
| 1200 | 1189 | |
| 1201 | 1190 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1202 | 1191 | |
| 1203 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1204 | | MCFG_SOUND_CONFIG(boxingb_samples_interface) |
| 1192 | MCFG_SAMPLES_ADD("samples", boxingb_samples_interface) |
| 1205 | 1193 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 1206 | 1194 | MACHINE_CONFIG_END |
| 1207 | 1195 | |
| r14521 | r14522 | |
| 1236 | 1224 | static void wotw_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 1237 | 1225 | { |
| 1238 | 1226 | cinemat_state *state = machine.driver_data<cinemat_state>(); |
| 1239 | | device_t *samples = machine.device("samples"); |
| 1227 | samples_device *samples = machine.device<samples_device>("samples"); |
| 1240 | 1228 | UINT32 target_pitch; |
| 1241 | 1229 | |
| 1242 | 1230 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| r14521 | r14522 | |
| 1248 | 1236 | { |
| 1249 | 1237 | /* fireball - falling edge */ |
| 1250 | 1238 | if (SHIFTREG_FALLING_EDGE(0x80)) |
| 1251 | | sample_start(samples, 0, 0, 0); |
| 1239 | samples->start(0, 0); |
| 1252 | 1240 | |
| 1253 | 1241 | /* shield hit - falling edge */ |
| 1254 | 1242 | if (SHIFTREG_FALLING_EDGE(0x40)) |
| 1255 | | sample_start(samples, 1, 1, 0); |
| 1243 | samples->start(1, 1); |
| 1256 | 1244 | |
| 1257 | 1245 | /* star sound - 0=off, 1=on */ |
| 1258 | 1246 | if (SHIFTREG_RISING_EDGE(0x20)) |
| 1259 | | sample_start(samples, 2, 2, 1); |
| 1247 | samples->start(2, 2, true); |
| 1260 | 1248 | if (SHIFTREG_FALLING_EDGE(0x20)) |
| 1261 | | sample_stop(samples, 2); |
| 1249 | samples->stop(2); |
| 1262 | 1250 | |
| 1263 | 1251 | /* thrust sound - 1=off, 0=on*/ |
| 1264 | 1252 | if (SHIFTREG_FALLING_EDGE(0x10)) |
| 1265 | | sample_start(samples, 3, 3, 1); |
| 1253 | samples->start(3, 3, true); |
| 1266 | 1254 | if (SHIFTREG_RISING_EDGE(0x10)) |
| 1267 | | sample_stop(samples, 3); |
| 1255 | samples->stop(3); |
| 1268 | 1256 | |
| 1269 | 1257 | /* drone - 1=off, 0=on */ |
| 1270 | 1258 | if (SHIFTREG_FALLING_EDGE(0x08)) |
| 1271 | | sample_start(samples, 4, 4, 1); |
| 1259 | samples->start(4, 4, true); |
| 1272 | 1260 | if (SHIFTREG_RISING_EDGE(0x08)) |
| 1273 | | sample_stop(samples, 4); |
| 1261 | samples->stop(4); |
| 1274 | 1262 | |
| 1275 | 1263 | /* latch the drone pitch */ |
| 1276 | 1264 | target_pitch = (state->m_current_shift & 7) + ((state->m_current_shift & 2) << 2); |
| r14521 | r14522 | |
| 1283 | 1271 | state->m_current_pitch -= 300; |
| 1284 | 1272 | if (state->m_current_pitch < target_pitch) |
| 1285 | 1273 | state->m_current_pitch += 200; |
| 1286 | | sample_set_freq(samples, 4, state->m_current_pitch); |
| 1274 | samples->set_frequency(4, state->m_current_pitch); |
| 1287 | 1275 | state->m_last_frame = machine.primary_screen->frame_number(); |
| 1288 | 1276 | } |
| 1289 | 1277 | |
| r14521 | r14522 | |
| 1293 | 1281 | |
| 1294 | 1282 | /* loud explosion - falling edge */ |
| 1295 | 1283 | if (SOUNDVAL_FALLING_EDGE(0x02)) |
| 1296 | | sample_start(samples, 5, 5, 0); |
| 1284 | samples->start(5, 5); |
| 1297 | 1285 | |
| 1298 | 1286 | /* soft explosion - falling edge */ |
| 1299 | 1287 | if (SOUNDVAL_FALLING_EDGE(0x04)) |
| 1300 | | sample_start(samples, 6, 6, 0); |
| 1288 | samples->start(6, 6); |
| 1301 | 1289 | |
| 1302 | 1290 | /* player fire - falling edge */ |
| 1303 | 1291 | if (SOUNDVAL_FALLING_EDGE(0x08)) |
| 1304 | | sample_start(samples, 7, 7, 0); |
| 1292 | samples->start(7, 7); |
| 1305 | 1293 | } |
| 1306 | 1294 | |
| 1307 | 1295 | static MACHINE_RESET( wotw ) |
| r14521 | r14522 | |
| 1315 | 1303 | |
| 1316 | 1304 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1317 | 1305 | |
| 1318 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1319 | | MCFG_SOUND_CONFIG(wotw_samples_interface) |
| 1306 | MCFG_SAMPLES_ADD("samples", wotw_samples_interface) |
| 1320 | 1307 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 1321 | 1308 | MACHINE_CONFIG_END |
| 1322 | 1309 | |
| r14521 | r14522 | |
| 1351 | 1338 | static void wotwc_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed) |
| 1352 | 1339 | { |
| 1353 | 1340 | cinemat_state *state = machine.driver_data<cinemat_state>(); |
| 1354 | | device_t *samples = machine.device("samples"); |
| 1341 | samples_device *samples = machine.device<samples_device>("samples"); |
| 1355 | 1342 | UINT32 target_pitch; |
| 1356 | 1343 | |
| 1357 | 1344 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| r14521 | r14522 | |
| 1363 | 1350 | { |
| 1364 | 1351 | /* fireball - falling edge */ |
| 1365 | 1352 | if (SHIFTREG_FALLING_EDGE(0x80)) |
| 1366 | | sample_start(samples, 0, 0, 0); |
| 1353 | samples->start(0, 0); |
| 1367 | 1354 | |
| 1368 | 1355 | /* shield hit - falling edge */ |
| 1369 | 1356 | if (SHIFTREG_FALLING_EDGE(0x40)) |
| 1370 | | sample_start(samples, 1, 1, 0); |
| 1357 | samples->start(1, 1); |
| 1371 | 1358 | |
| 1372 | 1359 | /* star sound - 0=off, 1=on */ |
| 1373 | 1360 | if (SHIFTREG_RISING_EDGE(0x20)) |
| 1374 | | sample_start(samples, 2, 2, 1); |
| 1361 | samples->start(2, 2, true); |
| 1375 | 1362 | if (SHIFTREG_FALLING_EDGE(0x20)) |
| 1376 | | sample_stop(samples, 2); |
| 1363 | samples->stop(2); |
| 1377 | 1364 | |
| 1378 | 1365 | /* thrust sound - 1=off, 0=on*/ |
| 1379 | 1366 | if (SHIFTREG_FALLING_EDGE(0x10)) |
| 1380 | | sample_start(samples, 3, 3, 1); |
| 1367 | samples->start(3, 3, true); |
| 1381 | 1368 | if (SHIFTREG_RISING_EDGE(0x10)) |
| 1382 | | sample_stop(samples, 3); |
| 1369 | samples->stop(3); |
| 1383 | 1370 | |
| 1384 | 1371 | /* drone - 1=off, 0=on */ |
| 1385 | 1372 | if (SHIFTREG_FALLING_EDGE(0x08)) |
| 1386 | | sample_start(samples, 4, 4, 1); |
| 1373 | samples->start(4, 4, true); |
| 1387 | 1374 | if (SHIFTREG_RISING_EDGE(0x08)) |
| 1388 | | sample_stop(samples, 4); |
| 1375 | samples->stop(4); |
| 1389 | 1376 | |
| 1390 | 1377 | /* latch the drone pitch */ |
| 1391 | 1378 | target_pitch = (state->m_current_shift & 7) + ((state->m_current_shift & 2) << 2); |
| r14521 | r14522 | |
| 1398 | 1385 | state->m_current_pitch -= 300; |
| 1399 | 1386 | if (state->m_current_pitch < target_pitch) |
| 1400 | 1387 | state->m_current_pitch += 200; |
| 1401 | | sample_set_freq(samples, 4, state->m_current_pitch); |
| 1388 | samples->set_frequency(4, state->m_current_pitch); |
| 1402 | 1389 | state->m_last_frame = machine.primary_screen->frame_number(); |
| 1403 | 1390 | } |
| 1404 | 1391 | |
| r14521 | r14522 | |
| 1408 | 1395 | |
| 1409 | 1396 | /* loud explosion - falling edge */ |
| 1410 | 1397 | if (SOUNDVAL_FALLING_EDGE(0x02)) |
| 1411 | | sample_start(samples, 5, 5, 0); |
| 1398 | samples->start(5, 5); |
| 1412 | 1399 | |
| 1413 | 1400 | /* soft explosion - falling edge */ |
| 1414 | 1401 | if (SOUNDVAL_FALLING_EDGE(0x04)) |
| 1415 | | sample_start(samples, 6, 6, 0); |
| 1402 | samples->start(6, 6); |
| 1416 | 1403 | |
| 1417 | 1404 | /* player fire - falling edge */ |
| 1418 | 1405 | if (SOUNDVAL_FALLING_EDGE(0x08)) |
| 1419 | | sample_start(samples, 7, 7, 0); |
| 1406 | samples->start(7, 7); |
| 1420 | 1407 | } |
| 1421 | 1408 | |
| 1422 | 1409 | static MACHINE_RESET( wotwc ) |
| r14521 | r14522 | |
| 1430 | 1417 | |
| 1431 | 1418 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1432 | 1419 | |
| 1433 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1434 | | MCFG_SOUND_CONFIG(wotwc_samples_interface) |
| 1420 | MCFG_SAMPLES_ADD("samples", wotwc_samples_interface) |
| 1435 | 1421 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 1436 | 1422 | MACHINE_CONFIG_END |
| 1437 | 1423 | |
src/mame/audio/zaxxon.c
| r14521 | r14522 | |
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | MACHINE_CONFIG_FRAGMENT( zaxxon_samples ) |
| 101 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 102 | | MCFG_SOUND_CONFIG(zaxxon_samples_interface) |
| 101 | MCFG_SAMPLES_ADD("samples", zaxxon_samples_interface) |
| 103 | 102 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 104 | 103 | MACHINE_CONFIG_END |
| 105 | 104 | |
| r14521 | r14522 | |
| 114 | 113 | WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w ) |
| 115 | 114 | { |
| 116 | 115 | zaxxon_state *state = device->machine().driver_data<zaxxon_state>(); |
| 117 | | device_t *samples = device->machine().device("samples"); |
| 116 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 118 | 117 | UINT8 diff = data ^ state->m_sound_state[0]; |
| 119 | 118 | state->m_sound_state[0] = data; |
| 120 | 119 | |
| 121 | 120 | /* PLAYER SHIP A/B: volume */ |
| 122 | | sample_set_volume(samples, 10, 0.5 + 0.157 * (data & 0x03)); |
| 123 | | sample_set_volume(samples, 11, 0.5 + 0.157 * (data & 0x03)); |
| 121 | samples->set_volume(10, 0.5 + 0.157 * (data & 0x03)); |
| 122 | samples->set_volume(11, 0.5 + 0.157 * (data & 0x03)); |
| 124 | 123 | |
| 125 | 124 | /* PLAYER SHIP C: channel 10 */ |
| 126 | | if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 10, 10, TRUE); |
| 127 | | if ((diff & 0x04) && (data & 0x04)) sample_stop(samples, 10); |
| 125 | if ((diff & 0x04) && !(data & 0x04)) samples->start(10, 10, true); |
| 126 | if ((diff & 0x04) && (data & 0x04)) samples->stop(10); |
| 128 | 127 | |
| 129 | 128 | /* PLAYER SHIP D: channel 11 */ |
| 130 | | if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 11, 11, TRUE); |
| 131 | | if ((diff & 0x08) && (data & 0x08)) sample_stop(samples, 11); |
| 129 | if ((diff & 0x08) && !(data & 0x08)) samples->start(11, 11, true); |
| 130 | if ((diff & 0x08) && (data & 0x08)) samples->stop(11); |
| 132 | 131 | |
| 133 | 132 | /* HOMING MISSILE: channel 0 */ |
| 134 | | if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 0, 0, TRUE); |
| 135 | | if ((diff & 0x10) && (data & 0x10)) sample_stop(samples, 0); |
| 133 | if ((diff & 0x10) && !(data & 0x10)) samples->start(0, 0, true); |
| 134 | if ((diff & 0x10) && (data & 0x10)) samples->stop(0); |
| 136 | 135 | |
| 137 | 136 | /* BASE MISSILE: channel 1 */ |
| 138 | | if ((diff & 0x20) && !(data & 0x20)) sample_start(samples, 1, 1, FALSE); |
| 137 | if ((diff & 0x20) && !(data & 0x20)) samples->start(1, 1); |
| 139 | 138 | |
| 140 | 139 | /* LASER: channel 2 */ |
| 141 | | if ((diff & 0x40) && !(data & 0x40)) sample_start(samples, 2, 2, TRUE); |
| 142 | | if ((diff & 0x40) && (data & 0x40)) sample_stop(samples, 2); |
| 140 | if ((diff & 0x40) && !(data & 0x40)) samples->start(2, 2, true); |
| 141 | if ((diff & 0x40) && (data & 0x40)) samples->stop(2); |
| 143 | 142 | |
| 144 | 143 | /* BATTLESHIP: channel 3 */ |
| 145 | | if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 3, 3, TRUE); |
| 146 | | if ((diff & 0x80) && (data & 0x80)) sample_stop(samples, 3); |
| 144 | if ((diff & 0x80) && !(data & 0x80)) samples->start(3, 3, true); |
| 145 | if ((diff & 0x80) && (data & 0x80)) samples->stop(3); |
| 147 | 146 | } |
| 148 | 147 | |
| 149 | 148 | |
| 150 | 149 | WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w ) |
| 151 | 150 | { |
| 152 | 151 | zaxxon_state *state = device->machine().driver_data<zaxxon_state>(); |
| 153 | | device_t *samples = device->machine().device("samples"); |
| 152 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 154 | 153 | UINT8 diff = data ^ state->m_sound_state[1]; |
| 155 | 154 | state->m_sound_state[1] = data; |
| 156 | 155 | |
| 157 | 156 | /* S-EXP: channel 4 */ |
| 158 | | if ((diff & 0x10) && !(data & 0x10)) sample_start(samples, 4, 4, FALSE); |
| 157 | if ((diff & 0x10) && !(data & 0x10)) samples->start(4, 4); |
| 159 | 158 | |
| 160 | 159 | /* M-EXP: channel 5 */ |
| 161 | | if ((diff & 0x20) && !(data & 0x20) && !sample_playing(samples, 5)) sample_start(samples, 5, 5, FALSE); |
| 160 | if ((diff & 0x20) && !(data & 0x20) && !samples->playing(5)) samples->start(5, 5); |
| 162 | 161 | |
| 163 | 162 | /* CANNON: channel 6 */ |
| 164 | | if ((diff & 0x80) && !(data & 0x80)) sample_start(samples, 6, 6, FALSE); |
| 163 | if ((diff & 0x80) && !(data & 0x80)) samples->start(6, 6); |
| 165 | 164 | } |
| 166 | 165 | |
| 167 | 166 | |
| 168 | 167 | WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w ) |
| 169 | 168 | { |
| 170 | 169 | zaxxon_state *state = device->machine().driver_data<zaxxon_state>(); |
| 171 | | device_t *samples = device->machine().device("samples"); |
| 170 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 172 | 171 | UINT8 diff = data ^ state->m_sound_state[2]; |
| 173 | 172 | state->m_sound_state[2] = data; |
| 174 | 173 | |
| 175 | 174 | /* SHOT: channel 7 */ |
| 176 | | if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 7, 7, FALSE); |
| 175 | if ((diff & 0x01) && !(data & 0x01)) samples->start(7, 7); |
| 177 | 176 | |
| 178 | 177 | /* ALARM2: channel 8 */ |
| 179 | | if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 8, 8, FALSE); |
| 178 | if ((diff & 0x04) && !(data & 0x04)) samples->start(8, 8); |
| 180 | 179 | |
| 181 | 180 | /* ALARM3: channel 9 */ |
| 182 | | if ((diff & 0x08) && !(data & 0x08) && !sample_playing(samples, 9)) sample_start(samples, 9, 9, FALSE); |
| 181 | if ((diff & 0x08) && !(data & 0x08) && !samples->playing(9)) samples->start(9, 9); |
| 183 | 182 | } |
| 184 | 183 | |
| 185 | 184 | |
| r14521 | r14522 | |
| 210 | 209 | |
| 211 | 210 | |
| 212 | 211 | MACHINE_CONFIG_FRAGMENT( congo_samples ) |
| 213 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 214 | | MCFG_SOUND_CONFIG(congo_samples_interface) |
| 212 | MCFG_SAMPLES_ADD("samples", congo_samples_interface) |
| 215 | 213 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 216 | 214 | MACHINE_CONFIG_END |
| 217 | 215 | |
| r14521 | r14522 | |
| 226 | 224 | WRITE8_DEVICE_HANDLER( congo_sound_b_w ) |
| 227 | 225 | { |
| 228 | 226 | zaxxon_state *state = device->machine().driver_data<zaxxon_state>(); |
| 229 | | device_t *samples = device->machine().device("samples"); |
| 227 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 230 | 228 | UINT8 diff = data ^ state->m_sound_state[1]; |
| 231 | 229 | state->m_sound_state[1] = data; |
| 232 | 230 | |
| 233 | 231 | /* bit 7 = mute */ |
| 234 | 232 | |
| 235 | 233 | /* GORILLA: channel 0 */ |
| 236 | | if ((diff & 0x02) && !(data & 0x02) && !sample_playing(samples, 0)) sample_start(samples, 0, 0, FALSE); |
| 234 | if ((diff & 0x02) && !(data & 0x02) && !samples->playing(0)) samples->start(0, 0); |
| 237 | 235 | } |
| 238 | 236 | |
| 239 | 237 | |
| 240 | 238 | WRITE8_DEVICE_HANDLER( congo_sound_c_w ) |
| 241 | 239 | { |
| 242 | 240 | zaxxon_state *state = device->machine().driver_data<zaxxon_state>(); |
| 243 | | device_t *samples = device->machine().device("samples"); |
| 241 | samples_device *samples = device->machine().device<samples_device>("samples"); |
| 244 | 242 | UINT8 diff = data ^ state->m_sound_state[2]; |
| 245 | 243 | state->m_sound_state[2] = data; |
| 246 | 244 | |
| 247 | 245 | /* BASS DRUM: channel 1 */ |
| 248 | | if ((diff & 0x01) && !(data & 0x01)) sample_start(samples, 1, 1, FALSE); |
| 249 | | if ((diff & 0x01) && (data & 0x01)) sample_stop(samples, 1); |
| 246 | if ((diff & 0x01) && !(data & 0x01)) samples->start(1, 1); |
| 247 | if ((diff & 0x01) && (data & 0x01)) samples->stop(1); |
| 250 | 248 | |
| 251 | 249 | /* CONGA (LOW): channel 2 */ |
| 252 | | if ((diff & 0x02) && !(data & 0x02)) sample_start(samples, 2, 2, FALSE); |
| 253 | | if ((diff & 0x02) && (data & 0x02)) sample_stop(samples, 2); |
| 250 | if ((diff & 0x02) && !(data & 0x02)) samples->start(2, 2); |
| 251 | if ((diff & 0x02) && (data & 0x02)) samples->stop(2); |
| 254 | 252 | |
| 255 | 253 | /* CONGA (HIGH): channel 3 */ |
| 256 | | if ((diff & 0x04) && !(data & 0x04)) sample_start(samples, 3, 3, FALSE); |
| 257 | | if ((diff & 0x04) && (data & 0x04)) sample_stop(samples, 3); |
| 254 | if ((diff & 0x04) && !(data & 0x04)) samples->start(3, 3); |
| 255 | if ((diff & 0x04) && (data & 0x04)) samples->stop(3); |
| 258 | 256 | |
| 259 | 257 | /* RIM: channel 4 */ |
| 260 | | if ((diff & 0x08) && !(data & 0x08)) sample_start(samples, 4, 4, FALSE); |
| 261 | | if ((diff & 0x08) && (data & 0x08)) sample_stop(samples, 4); |
| 258 | if ((diff & 0x08) && !(data & 0x08)) samples->start(4, 4); |
| 259 | if ((diff & 0x08) && (data & 0x08)) samples->stop(4); |
| 262 | 260 | } |
src/mame/audio/mw8080bw.c
| r14521 | r14522 | |
| 157 | 157 | MCFG_SOUND_START(samples) |
| 158 | 158 | |
| 159 | 159 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 160 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 161 | | MCFG_SOUND_CONFIG(seawolf_samples_interface) |
| 160 | MCFG_SAMPLES_ADD("samples", seawolf_samples_interface) |
| 162 | 161 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.6) |
| 163 | 162 | MACHINE_CONFIG_END |
| 164 | 163 | |
| r14521 | r14522 | |
| 169 | 168 | UINT8 rising_bits = data & ~state->m_port_1_last; |
| 170 | 169 | |
| 171 | 170 | /* if (data & 0x01) enable SHIP HIT sound */ |
| 172 | | if (rising_bits & 0x01) sample_start(state->m_samples, 0, 0, 0); |
| 171 | if (rising_bits & 0x01) state->m_samples->start(0, 0); |
| 173 | 172 | |
| 174 | 173 | /* if (data & 0x02) enable TORPEDO sound */ |
| 175 | | if (rising_bits & 0x02) sample_start(state->m_samples, 1, 1, 0); |
| 174 | if (rising_bits & 0x02) state->m_samples->start(1, 1); |
| 176 | 175 | |
| 177 | 176 | /* if (data & 0x04) enable DIVE sound */ |
| 178 | | if (rising_bits & 0x04) sample_start(state->m_samples, 2, 2, 0); |
| 177 | if (rising_bits & 0x04) state->m_samples->start(2, 2); |
| 179 | 178 | |
| 180 | 179 | /* if (data & 0x08) enable SONAR sound */ |
| 181 | | if (rising_bits & 0x08) sample_start(state->m_samples, 3, 3, 0); |
| 180 | if (rising_bits & 0x08) state->m_samples->start(3, 3); |
| 182 | 181 | |
| 183 | 182 | /* if (data & 0x10) enable MINE HIT sound */ |
| 184 | | if (rising_bits & 0x10) sample_start(state->m_samples, 4, 4, 0); |
| 183 | if (rising_bits & 0x10) state->m_samples->start(4, 4); |
| 185 | 184 | |
| 186 | 185 | coin_counter_w(space->machine(), 0, (data >> 5) & 0x01); |
| 187 | 186 | |
| r14521 | r14522 | |
| 219 | 218 | |
| 220 | 219 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 221 | 220 | |
| 222 | | MCFG_SOUND_ADD("samples1", SAMPLES, 0) |
| 223 | | MCFG_SOUND_CONFIG(gunfight_samples_interface) |
| 221 | MCFG_SAMPLES_ADD("samples1", gunfight_samples_interface) |
| 224 | 222 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) |
| 225 | 223 | |
| 226 | | MCFG_SOUND_ADD("samples2", SAMPLES, 0) |
| 227 | | MCFG_SOUND_CONFIG(gunfight_samples_interface) |
| 224 | MCFG_SAMPLES_ADD("samples2", gunfight_samples_interface) |
| 228 | 225 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) |
| 229 | 226 | MACHINE_CONFIG_END |
| 230 | 227 | |
| r14521 | r14522 | |
| 245 | 242 | |
| 246 | 243 | case 0x01: |
| 247 | 244 | /* enable LEFT SHOOT sound (left speaker) */ |
| 248 | | sample_start(state->m_samples1, 0, 0, 0); |
| 245 | state->m_samples1->start(0, 0); |
| 249 | 246 | break; |
| 250 | 247 | |
| 251 | 248 | case 0x02: |
| 252 | 249 | /* enable RIGHT SHOOT sound (right speaker) */ |
| 253 | | sample_start(state->m_samples2, 0, 0, 0); |
| 250 | state->m_samples2->start(0, 0); |
| 254 | 251 | break; |
| 255 | 252 | |
| 256 | 253 | case 0x03: |
| 257 | 254 | /* enable LEFT HIT sound (left speaker) */ |
| 258 | | sample_start(state->m_samples1, 0, 1, 0); |
| 255 | state->m_samples1->start(0, 1); |
| 259 | 256 | break; |
| 260 | 257 | |
| 261 | 258 | case 0x04: |
| 262 | 259 | /* enable RIGHT HIT sound (right speaker) */ |
| 263 | | sample_start(state->m_samples2, 0, 1, 0); |
| 260 | state->m_samples2->start(0, 1); |
| 264 | 261 | break; |
| 265 | 262 | |
| 266 | 263 | default: |
| r14521 | r14522 | |
| 1577 | 1574 | |
| 1578 | 1575 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1579 | 1576 | |
| 1580 | | MCFG_SOUND_ADD("samples1", SAMPLES, 0) |
| 1581 | | MCFG_SOUND_CONFIG(gmissile_samples_interface) |
| 1577 | MCFG_SAMPLES_ADD("samples1", gmissile_samples_interface) |
| 1582 | 1578 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.9) |
| 1583 | 1579 | |
| 1584 | | MCFG_SOUND_ADD("samples2", SAMPLES, 0) |
| 1585 | | MCFG_SOUND_CONFIG(gmissile_samples_interface) |
| 1580 | MCFG_SAMPLES_ADD("samples2", gmissile_samples_interface) |
| 1586 | 1581 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.9) |
| 1587 | 1582 | MACHINE_CONFIG_END |
| 1588 | 1583 | |
| r14521 | r14522 | |
| 1603 | 1598 | space->machine().sound().system_enable((data >> 3) & 0x01); |
| 1604 | 1599 | |
| 1605 | 1600 | /* if (data & 0x10) enable RIGHT MISSILE sound (goes to right speaker) */ |
| 1606 | | if (rising_bits & 0x10) sample_start(state->m_samples2, 0, 0, 0); |
| 1601 | if (rising_bits & 0x10) state->m_samples2->start(0, 0); |
| 1607 | 1602 | |
| 1608 | 1603 | /* if (data & 0x20) enable LEFT EXPLOSION sound (goes to left speaker) */ |
| 1609 | 1604 | output_set_value("L_EXP_LIGHT", (data >> 5) & 0x01); |
| 1610 | | if (rising_bits & 0x20) sample_start(state->m_samples1, 0, 1, 0); |
| 1605 | if (rising_bits & 0x20) state->m_samples1->start(0, 1); |
| 1611 | 1606 | |
| 1612 | 1607 | /* if (data & 0x40) enable LEFT MISSILE sound (goes to left speaker) */ |
| 1613 | | if (rising_bits & 0x40) sample_start(state->m_samples1, 0, 0, 0); |
| 1608 | if (rising_bits & 0x40) state->m_samples1->start(0, 0); |
| 1614 | 1609 | |
| 1615 | 1610 | /* if (data & 0x80) enable RIGHT EXPLOSION sound (goes to right speaker) */ |
| 1616 | 1611 | output_set_value("R_EXP_LIGHT", (data >> 7) & 0x01); |
| 1617 | | if (rising_bits & 0x80) sample_start(state->m_samples2, 0, 1, 0); |
| 1612 | if (rising_bits & 0x80) state->m_samples2->start(0, 1); |
| 1618 | 1613 | |
| 1619 | 1614 | state->m_port_1_last = data; |
| 1620 | 1615 | } |
| r14521 | r14522 | |
| 1676 | 1671 | |
| 1677 | 1672 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1678 | 1673 | |
| 1679 | | MCFG_SOUND_ADD("samples1", SAMPLES, 0) |
| 1680 | | MCFG_SOUND_CONFIG(m4_samples_interface) |
| 1674 | MCFG_SAMPLES_ADD("samples1", m4_samples_interface) |
| 1681 | 1675 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1) |
| 1682 | 1676 | |
| 1683 | | MCFG_SOUND_ADD("samples2", SAMPLES, 0) |
| 1684 | | MCFG_SOUND_CONFIG(m4_samples_interface) |
| 1677 | MCFG_SAMPLES_ADD("samples2", m4_samples_interface) |
| 1685 | 1678 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1) |
| 1686 | 1679 | MACHINE_CONFIG_END |
| 1687 | 1680 | |
| r14521 | r14522 | |
| 1698 | 1691 | space->machine().sound().system_enable((data >> 3) & 0x01); |
| 1699 | 1692 | |
| 1700 | 1693 | /* if (data & 0x10) enable LEFT PLAYER SHOT sound (goes to left speaker) */ |
| 1701 | | if (rising_bits & 0x10) sample_start(state->m_samples1, 0, 0, 0); |
| 1694 | if (rising_bits & 0x10) state->m_samples1->start(0, 0); |
| 1702 | 1695 | |
| 1703 | 1696 | /* if (data & 0x20) enable RIGHT PLAYER SHOT sound (goes to right speaker) */ |
| 1704 | | if (rising_bits & 0x20) sample_start(state->m_samples2, 0, 0, 0); |
| 1697 | if (rising_bits & 0x20) state->m_samples2->start(0, 0); |
| 1705 | 1698 | |
| 1706 | 1699 | /* if (data & 0x40) enable LEFT PLAYER EXPLOSION sound via 300K res (goes to left speaker) */ |
| 1707 | | if (rising_bits & 0x40) sample_start(state->m_samples1, 1, 1, 0); |
| 1700 | if (rising_bits & 0x40) state->m_samples1->start(1, 1); |
| 1708 | 1701 | |
| 1709 | 1702 | /* if (data & 0x80) enable RIGHT PLAYER EXPLOSION sound via 300K res (goes to right speaker) */ |
| 1710 | | if (rising_bits & 0x80) sample_start(state->m_samples2, 1, 1, 0); |
| 1703 | if (rising_bits & 0x80) state->m_samples2->start(1, 1); |
| 1711 | 1704 | |
| 1712 | 1705 | state->m_port_1_last = data; |
| 1713 | 1706 | } |
| r14521 | r14522 | |
| 1719 | 1712 | UINT8 rising_bits = data & ~state->m_port_2_last; |
| 1720 | 1713 | |
| 1721 | 1714 | /* if (data & 0x01) enable LEFT PLAYER EXPLOSION sound via 510K res (goes to left speaker) */ |
| 1722 | | if (rising_bits & 0x01) sample_start(state->m_samples1, 1, 1, 0); |
| 1715 | if (rising_bits & 0x01) state->m_samples1->start(1, 1); |
| 1723 | 1716 | |
| 1724 | 1717 | /* if (data & 0x02) enable RIGHT PLAYER EXPLOSION sound via 510K res (goes to right speaker) */ |
| 1725 | | if (rising_bits & 0x02) sample_start(state->m_samples2, 1, 1, 0); |
| 1718 | if (rising_bits & 0x02) state->m_samples2->start(1, 1); |
| 1726 | 1719 | |
| 1727 | 1720 | /* if (data & 0x04) enable LEFT TANK MOTOR sound (goes to left speaker) */ |
| 1728 | 1721 | |
| r14521 | r14522 | |
| 1938 | 1931 | |
| 1939 | 1932 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1940 | 1933 | |
| 1941 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1942 | | MCFG_SOUND_CONFIG(clowns_samples_interface) |
| 1934 | MCFG_SAMPLES_ADD("samples", clowns_samples_interface) |
| 1943 | 1935 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70) |
| 1944 | 1936 | |
| 1945 | 1937 | MCFG_SOUND_ADD("discrete", DISCRETE, 0) |
| r14521 | r14522 | |
| 1974 | 1966 | |
| 1975 | 1967 | discrete_sound_w(device, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01); |
| 1976 | 1968 | |
| 1977 | | if (rising_bits & 0x20) sample_start(state->m_samples, 0, 0, 0); /* springboard miss */ |
| 1969 | if (rising_bits & 0x20) state->m_samples->start(0, 0); /* springboard miss */ |
| 1978 | 1970 | |
| 1979 | 1971 | /* D6 and D7 are not connected */ |
| 1980 | 1972 | |
| r14521 | r14522 | |
| 3341 | 3333 | MCFG_SOUND_START(samples) |
| 3342 | 3334 | |
| 3343 | 3335 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 3344 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 3345 | | MCFG_SOUND_CONFIG(phantom2_samples_interface) |
| 3336 | MCFG_SAMPLES_ADD("samples", phantom2_samples_interface) |
| 3346 | 3337 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1) |
| 3347 | 3338 | MACHINE_CONFIG_END |
| 3348 | 3339 | |
| r14521 | r14522 | |
| 3353 | 3344 | UINT8 rising_bits = data & ~state->m_port_1_last; |
| 3354 | 3345 | |
| 3355 | 3346 | /* if (data & 0x01) enable PLAYER SHOT sound */ |
| 3356 | | if (rising_bits & 0x01) sample_start(state->m_samples, 0, 0, 0); |
| 3347 | if (rising_bits & 0x01) state->m_samples->start(0, 0); |
| 3357 | 3348 | |
| 3358 | 3349 | /* if (data & 0x02) enable ENEMY SHOT sound */ |
| 3359 | 3350 | |
| r14521 | r14522 | |
| 3378 | 3369 | /* D0-D2 are not connected */ |
| 3379 | 3370 | |
| 3380 | 3371 | /* if (data & 0x08) enable EXPLOSION sound */ |
| 3381 | | if (rising_bits & 0x08) sample_start(state->m_samples, 1, 1, 0); |
| 3372 | if (rising_bits & 0x08) state->m_samples->start(1, 1); |
| 3382 | 3373 | |
| 3383 | 3374 | output_set_value("EXPLAMP", (data >> 4) & 0x01); |
| 3384 | 3375 | |
| r14521 | r14522 | |
| 3628 | 3619 | MCFG_SOUND_CONFIG(invaders_sn76477_interface) |
| 3629 | 3620 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 3630 | 3621 | |
| 3631 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 3632 | | MCFG_SOUND_CONFIG(invaders_samples_interface) |
| 3622 | MCFG_SAMPLES_ADD("samples", invaders_samples_interface) |
| 3633 | 3623 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 3634 | 3624 | MACHINE_CONFIG_END |
| 3635 | 3625 | |
src/mame/drivers/cosmic.c
| r14521 | r14522 | |
| 48 | 48 | int count; |
| 49 | 49 | if (data == 0) |
| 50 | 50 | for (count = 0; count < 9; count++) |
| 51 | | sample_stop(state->m_samples, count); |
| 51 | state->m_samples->stop(count); |
| 52 | 52 | |
| 53 | 53 | state->m_sound_enabled = data; |
| 54 | 54 | } |
| r14521 | r14522 | |
| 57 | 57 | { |
| 58 | 58 | switch (offset) |
| 59 | 59 | { |
| 60 | | case 0: if (data) sample_start(state->m_samples, 0, 0, 0); break; /* Walk */ |
| 61 | | case 1: if (data) sample_start(state->m_samples, 0, 5, 0); break; /* Enemy Die 1 */ |
| 60 | case 0: if (data) state->m_samples->start(0, 0); break; /* Walk */ |
| 61 | case 1: if (data) state->m_samples->start(0, 5); break; /* Enemy Die 1 */ |
| 62 | 62 | case 2: if (data) /* Drop 1 */ |
| 63 | 63 | { |
| 64 | | if (!sample_playing(state->m_samples, 1)) |
| 64 | if (!state->m_samples->playing(1)) |
| 65 | 65 | { |
| 66 | | sample_stop(state->m_samples, 2); |
| 67 | | sample_start(state->m_samples, 1, 3, 0); |
| 66 | state->m_samples->stop(2); |
| 67 | state->m_samples->start(1, 3); |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | else |
| 71 | | sample_stop(state->m_samples, 1); |
| 71 | state->m_samples->stop(1); |
| 72 | 72 | break; |
| 73 | 73 | |
| 74 | | case 3: if (data && !sample_playing(state->m_samples, 6)) /* Oxygen */ |
| 75 | | sample_start(state->m_samples, 6, 9, 1); |
| 74 | case 3: if (data && !state->m_samples->playing(6)) /* Oxygen */ |
| 75 | state->m_samples->start(6, 9, true); |
| 76 | 76 | break; |
| 77 | 77 | |
| 78 | 78 | case 4: break; /* Drop 2 */ |
| 79 | | case 5: if (data) sample_start(state->m_samples, 0, 5, 0); break; /* Enemy Die 2 (use same sample as 1) */ |
| 80 | | case 6: if (data && !sample_playing(state->m_samples, 1) && !sample_playing(state->m_samples, 3)) /* Hang */ |
| 81 | | sample_start(state->m_samples, 2, 2, 0); |
| 79 | case 5: if (data) state->m_samples->start(0, 5); break; /* Enemy Die 2 (use same sample as 1) */ |
| 80 | case 6: if (data && !state->m_samples->playing(1) && !state->m_samples->playing(3)) /* Hang */ |
| 81 | state->m_samples->start(2, 2); |
| 82 | 82 | break; |
| 83 | 83 | |
| 84 | 84 | case 7: if (data) /* Escape */ |
| 85 | 85 | { |
| 86 | | sample_stop(state->m_samples, 2); |
| 87 | | sample_start(state->m_samples, 3, 4, 0); |
| 86 | state->m_samples->stop(2); |
| 87 | state->m_samples->start(3, 4); |
| 88 | 88 | } |
| 89 | 89 | else |
| 90 | | sample_stop(state->m_samples, 3); |
| 90 | state->m_samples->stop(3); |
| 91 | 91 | break; |
| 92 | 92 | |
| 93 | | case 8: if (data) sample_start(state->m_samples, 0, 1, 0); break; /* Stairs */ |
| 93 | case 8: if (data) state->m_samples->start(0, 1); break; /* Stairs */ |
| 94 | 94 | case 9: if (data) /* Extend */ |
| 95 | | sample_start(state->m_samples, 4, 8, 0); |
| 95 | state->m_samples->start(4, 8); |
| 96 | 96 | else |
| 97 | | sample_stop(state->m_samples, 4); |
| 97 | state->m_samples->stop(4); |
| 98 | 98 | break; |
| 99 | 99 | |
| 100 | 100 | case 10: dac_data_w(state->m_dac, data); break;/* Bonus */ |
| 101 | | case 15: if (data) sample_start(state->m_samples, 0, 6, 0); break; /* Player Die */ |
| 102 | | case 16: if (data) sample_start(state->m_samples, 5, 7, 0); break; /* Enemy Laugh */ |
| 103 | | case 17: if (data) sample_start(state->m_samples, 0, 10, 0); break; /* Coin - Not triggered by software */ |
| 101 | case 15: if (data) state->m_samples->start(0, 6); break; /* Player Die */ |
| 102 | case 16: if (data) state->m_samples->start(5, 7); break; /* Enemy Laugh */ |
| 103 | case 17: if (data) state->m_samples->start(0, 10); break; /* Coin - Not triggered by software */ |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
| r14521 | r14522 | |
| 126 | 126 | state->m_sound_enabled = data; |
| 127 | 127 | if (data == 0) |
| 128 | 128 | for (count = 0; count < 9; count++) |
| 129 | | sample_stop(state->m_samples, count); |
| 129 | state->m_samples->stop(count); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (state->m_sound_enabled) |
| r14521 | r14522 | |
| 138 | 138 | /* be used for anything. It is implemented for sake of */ |
| 139 | 139 | /* completness. Maybe it plays a tune if you win ? */ |
| 140 | 140 | case 1: dac_data_w(state->m_dac, -data); break; |
| 141 | | case 2: if (data) sample_start(state->m_samples, 0, state->m_march_select, 0); break; /* March Sound */ |
| 141 | case 2: if (data) state->m_samples->start(0, state->m_march_select); break; /* March Sound */ |
| 142 | 142 | case 3: state->m_march_select = (state->m_march_select & 0xfe) | data; break; |
| 143 | 143 | case 4: state->m_march_select = (state->m_march_select & 0xfd) | (data << 1); break; |
| 144 | 144 | case 5: state->m_march_select = (state->m_march_select & 0xfb) | (data << 2); break; |
| 145 | 145 | |
| 146 | 146 | case 6: if (data) /* Killer Attack (crawly thing at bottom of screen) */ |
| 147 | | sample_start(state->m_samples, 1, 8, 1); |
| 147 | state->m_samples->start(1, 8, true); |
| 148 | 148 | else |
| 149 | | sample_stop(state->m_samples, 1); |
| 149 | state->m_samples->stop(1); |
| 150 | 150 | break; |
| 151 | 151 | |
| 152 | 152 | case 7: if (data) /* Bonus Chance & Got Bonus */ |
| 153 | 153 | { |
| 154 | | sample_stop(state->m_samples, 4); |
| 155 | | sample_start(state->m_samples, 4, 10, 0); |
| 154 | state->m_samples->stop(4); |
| 155 | state->m_samples->start(4, 10); |
| 156 | 156 | } |
| 157 | 157 | break; |
| 158 | 158 | |
| 159 | 159 | case 8: if (data) |
| 160 | 160 | { |
| 161 | | if (!sample_playing(state->m_samples, 4)) sample_start(state->m_samples, 4, 9, 1); |
| 161 | if (!state->m_samples->playing(4)) state->m_samples->start(4, 9, true); |
| 162 | 162 | } |
| 163 | 163 | else |
| 164 | | sample_stop(state->m_samples, 4); |
| 164 | state->m_samples->stop(4); |
| 165 | 165 | break; |
| 166 | 166 | |
| 167 | | case 9: if (data) sample_start(state->m_samples, 3, 11, 0); break; /* Got Ship */ |
| 167 | case 9: if (data) state->m_samples->start(3, 11); break; /* Got Ship */ |
| 168 | 168 | // case 11: watchdog_reset_w(0, 0); break; /* Watchdog */ |
| 169 | | case 13: if (data) sample_start(state->m_samples, 8, 13 - state->m_gun_die_select, 0); break; /* Got Monster / Gunshot */ |
| 169 | case 13: if (data) state->m_samples->start(8, 13 - state->m_gun_die_select); break; /* Got Monster / Gunshot */ |
| 170 | 170 | case 14: state->m_gun_die_select = data; break; |
| 171 | | case 15: if (data) sample_start(state->m_samples, 5, 14, 0); break; /* Coin Extend (extra base) */ |
| 171 | case 15: if (data) state->m_samples->start(5, 14); break; /* Coin Extend (extra base) */ |
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | |
| r14521 | r14522 | |
| 188 | 188 | int count; |
| 189 | 189 | if (data == 0) |
| 190 | 190 | for (count = 0; count < 12; count++) |
| 191 | | sample_stop(state->m_samples, count); |
| 191 | state->m_samples->stop(count); |
| 192 | 192 | else |
| 193 | 193 | { |
| 194 | | sample_start(state->m_samples, 0, 0, 1); /*Background Noise*/ |
| 194 | state->m_samples->start(0, 0, true); /*Background Noise*/ |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | state->m_sound_enabled = data; |
| r14521 | r14522 | |
| 201 | 201 | { |
| 202 | 202 | switch (offset) |
| 203 | 203 | { |
| 204 | | case 0: if (data) sample_start(state->m_samples, 1, 2, 0); break; /*Dive Bombing Type A*/ |
| 204 | case 0: if (data) state->m_samples->start(1, 2); break; /*Dive Bombing Type A*/ |
| 205 | 205 | |
| 206 | 206 | case 2: /*Dive Bombing Type B (Main Control)*/ |
| 207 | 207 | if (data) |
| r14521 | r14522 | |
| 209 | 209 | switch (state->m_dive_bomb_b_select) |
| 210 | 210 | { |
| 211 | 211 | case 2: |
| 212 | | if (sample_playing(state->m_samples, 2)) |
| 212 | if (state->m_samples->playing(2)) |
| 213 | 213 | { |
| 214 | | sample_stop(state->m_samples, 2); |
| 215 | | sample_start(state->m_samples, 2, 3, 0); break; |
| 214 | state->m_samples->stop(2); |
| 215 | state->m_samples->start(2, 3); break; |
| 216 | 216 | } |
| 217 | 217 | else |
| 218 | | sample_start(state->m_samples, 2, 3, 0); break; |
| 218 | state->m_samples->start(2, 3); break; |
| 219 | 219 | |
| 220 | 220 | case 3: |
| 221 | | if (sample_playing(state->m_samples, 3)) |
| 221 | if (state->m_samples->playing(3)) |
| 222 | 222 | { |
| 223 | | sample_stop(state->m_samples, 3); |
| 224 | | sample_start(state->m_samples, 3, 4, 0); break; |
| 223 | state->m_samples->stop(3); |
| 224 | state->m_samples->start(3, 4); break; |
| 225 | 225 | } |
| 226 | 226 | else |
| 227 | | sample_start(state->m_samples, 3, 4, 0); break; |
| 227 | state->m_samples->start(3, 4); break; |
| 228 | 228 | |
| 229 | 229 | case 4: |
| 230 | | if (sample_playing(state->m_samples, 4)) |
| 230 | if (state->m_samples->playing(4)) |
| 231 | 231 | { |
| 232 | | sample_stop(state->m_samples, 4); |
| 233 | | sample_start(state->m_samples, 4, 5, 0); break; |
| 232 | state->m_samples->stop(4); |
| 233 | state->m_samples->start(4, 5); break; |
| 234 | 234 | } |
| 235 | 235 | else |
| 236 | | sample_start(state->m_samples, 4, 5, 0); break; |
| 236 | state->m_samples->start(4, 5); break; |
| 237 | 237 | |
| 238 | 238 | case 5: |
| 239 | | if (sample_playing(state->m_samples, 5)) |
| 239 | if (state->m_samples->playing(5)) |
| 240 | 240 | { |
| 241 | | sample_stop(state->m_samples, 5); |
| 242 | | sample_start(state->m_samples, 5, 6, 0); break; |
| 241 | state->m_samples->stop(5); |
| 242 | state->m_samples->start(5, 6); break; |
| 243 | 243 | } |
| 244 | 244 | else |
| 245 | | sample_start(state->m_samples, 5, 6, 0); break; |
| 245 | state->m_samples->start(5, 6); break; |
| 246 | 246 | |
| 247 | 247 | case 6: |
| 248 | | if (sample_playing(state->m_samples, 6)) |
| 248 | if (state->m_samples->playing(6)) |
| 249 | 249 | { |
| 250 | | sample_stop(state->m_samples, 6); |
| 251 | | sample_start(state->m_samples, 6, 7, 0); break; |
| 250 | state->m_samples->stop(6); |
| 251 | state->m_samples->start(6, 7); break; |
| 252 | 252 | } |
| 253 | 253 | else |
| 254 | | sample_start(state->m_samples, 6, 7, 0); break; |
| 254 | state->m_samples->start(6, 7); break; |
| 255 | 255 | |
| 256 | 256 | case 7: |
| 257 | | if (sample_playing(state->m_samples, 7)) |
| 257 | if (state->m_samples->playing(7)) |
| 258 | 258 | { |
| 259 | | sample_stop(state->m_samples, 7); |
| 260 | | sample_start(state->m_samples, 7, 8, 0); break; |
| 259 | state->m_samples->stop(7); |
| 260 | state->m_samples->start(7, 8); break; |
| 261 | 261 | } |
| 262 | 262 | else |
| 263 | | sample_start(state->m_samples, 7, 8, 0); break; |
| 263 | state->m_samples->start(7, 8); break; |
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | |
| r14521 | r14522 | |
| 287 | 287 | break; |
| 288 | 288 | |
| 289 | 289 | |
| 290 | | case 6: if (data) sample_start(state->m_samples, 8, 9, 0); break; /*Fire Control*/ |
| 290 | case 6: if (data) state->m_samples->start(8, 9); break; /*Fire Control*/ |
| 291 | 291 | |
| 292 | | case 7: if (data) sample_start(state->m_samples, 9, 10, 0); break; /*Small Explosion*/ |
| 292 | case 7: if (data) state->m_samples->start(9, 10); break; /*Small Explosion*/ |
| 293 | 293 | |
| 294 | | case 8: if (data) sample_start(state->m_samples, 10, 11, 0); break; /*Loud Explosion*/ |
| 294 | case 8: if (data) state->m_samples->start(10, 11); break; /*Loud Explosion*/ |
| 295 | 295 | |
| 296 | 296 | case 9: |
| 297 | 297 | if (data) |
| 298 | | sample_start(state->m_samples, 11, 1, 1); |
| 298 | state->m_samples->start(11, 1, true); |
| 299 | 299 | else |
| 300 | | sample_stop(state->m_samples, 11); |
| 300 | state->m_samples->stop(11); |
| 301 | 301 | break; /*Extend Sound control*/ |
| 302 | 302 | |
| 303 | | case 12: if (data) sample_start(state->m_samples, 11,12, 0); break; /*Insert Coin*/ |
| 303 | case 12: if (data) state->m_samples->start(11,12); break; /*Insert Coin*/ |
| 304 | 304 | } |
| 305 | 305 | } |
| 306 | 306 | |
| r14521 | r14522 | |
| 965 | 965 | { |
| 966 | 966 | cosmic_state *state = machine.driver_data<cosmic_state>(); |
| 967 | 967 | |
| 968 | | state->m_samples = machine.device("samples"); |
| 968 | state->m_samples = machine.device<samples_device>("samples"); |
| 969 | 969 | state->m_dac = machine.device("dac"); |
| 970 | 970 | |
| 971 | 971 | state->save_item(NAME(state->m_sound_enabled)); |
| r14521 | r14522 | |
| 1035 | 1035 | /* sound hardware */ |
| 1036 | 1036 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1037 | 1037 | |
| 1038 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1039 | | MCFG_SOUND_CONFIG(panic_samples_interface) |
| 1038 | MCFG_SAMPLES_ADD("samples", panic_samples_interface) |
| 1040 | 1039 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1041 | 1040 | |
| 1042 | 1041 | MCFG_SOUND_ADD("dac", DAC, 0) |
| r14521 | r14522 | |
| 1061 | 1060 | /* sound hardware */ |
| 1062 | 1061 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1063 | 1062 | |
| 1064 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1065 | | MCFG_SOUND_CONFIG(cosmica_samples_interface) |
| 1063 | MCFG_SAMPLES_ADD("samples", cosmica_samples_interface) |
| 1066 | 1064 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1067 | 1065 | |
| 1068 | 1066 | MCFG_SOUND_ADD("dac", DAC, 0) |
| r14521 | r14522 | |
| 1099 | 1097 | /* sound hardware */ |
| 1100 | 1098 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1101 | 1099 | |
| 1102 | | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1103 | | MCFG_SOUND_CONFIG(cosmicg_samples_interface) |
| 1100 | MCFG_SAMPLES_ADD("samples", cosmicg_samples_interface) |
| 1104 | 1101 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1105 | 1102 | |
| 1106 | 1103 | MCFG_SOUND_ADD("dac", DAC, 0) |
src/mame/drivers/jaguar.c
| r14521 | r14522 | |
| 2157 | 2157 | |
| 2158 | 2158 | ROM_START( freezeat2 ) |
| 2159 | 2159 | ROM_REGION32_BE( 0x200000, "user1", 0 ) /* 2MB for R3000 code */ |
| 2160 | | ROM_LOAD32_BYTE( "prog.hh", 0x000000, 0x040000, CRC(a8aefa52) SHA1(ba95da93035520de4b15245f68217c59dfb69dbd) ) |
| 2161 | | ROM_LOAD32_BYTE( "prog.hl", 0x000001, 0x040000, CRC(152dd641) SHA1(52fa260baf1979ed8f15f8abcbbeebd8e595d0e4) ) |
| 2162 | | ROM_LOAD32_BYTE( "prog.lh", 0x000002, 0x040000, CRC(416d26ed) SHA1(11cf3b88415a8a5d0bb8e1df08603a85202186ef) ) |
| 2163 | | ROM_LOAD32_BYTE( "prog.ll", 0x000003, 0x040000, CRC(d6a5dbc8) SHA1(0e2176c35cbc59b2a5283366210409d0e930bac7) ) |
| 2160 | ROM_LOAD32_BYTE( "961018_prog.hh", 0x000000, 0x040000, CRC(a8aefa52) SHA1(ba95da93035520de4b15245f68217c59dfb69dbd) ) |
| 2161 | ROM_LOAD32_BYTE( "961018_prog.hl", 0x000001, 0x040000, CRC(152dd641) SHA1(52fa260baf1979ed8f15f8abcbbeebd8e595d0e4) ) |
| 2162 | ROM_LOAD32_BYTE( "961018_prog.lh", 0x000002, 0x040000, CRC(416d26ed) SHA1(11cf3b88415a8a5d0bb8e1df08603a85202186ef) ) |
| 2163 | ROM_LOAD32_BYTE( "961018_prog.ll", 0x000003, 0x040000, CRC(d6a5dbc8) SHA1(0e2176c35cbc59b2a5283366210409d0e930bac7) ) |
| 2164 | 2164 | |
| 2165 | 2165 | ROM_REGION32_BE( 0x1000000, "user2", 0 ) /* 16MB for 64-bit ROM data */ |
| 2166 | | ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(99d0dc75) SHA1(b32126eea70c7584d1c34a6ca33282fbaf4b03aa), ROM_SKIP(7) ) |
| 2167 | | ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(2dfdfe62) SHA1(e0554d36ef5cf4b6ce171857ea4f2737f11286a5), ROM_SKIP(7) ) |
| 2168 | | ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(722aee2a) SHA1(bc79433131bed5b08453d1b80324a28a552783de), ROM_SKIP(7) ) |
| 2169 | | ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(919e31b4) SHA1(3807d4629d8277c780dba888c23d17ba47803f27), ROM_SKIP(7) ) |
| 2170 | | ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(a957ac95) SHA1(ddfaca994c06976bee8b123857904e64f40b7f31), ROM_SKIP(7) ) |
| 2171 | | ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(a147ec66) SHA1(6291008158d581b81e025ed34ff0950983c12c67), ROM_SKIP(7) ) |
| 2172 | | ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(206d2f38) SHA1(6aca89df26d3602ff1da3c23f19e0782439623ff), ROM_SKIP(7) ) |
| 2173 | | ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(06559831) SHA1(b2c022457425d7900337cfa2fd1622336c0c0bc5), ROM_SKIP(7) ) |
| 2174 | | ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(30c624d2) SHA1(4ced77d1663169d0cb37d6728ec52e67f05064c5), ROM_SKIP(7) ) |
| 2175 | | ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(049cd60f) SHA1(8a7615a76b57a4e6ef5d95a5ee6c56086671dbb6), ROM_SKIP(7) ) |
| 2176 | | ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(d6aaf3bf) SHA1(1c597bdc0e61fd0941cff5a8a93f24f108bd0daa), ROM_SKIP(7) ) |
| 2177 | | ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(7d6ebc69) SHA1(668769297f75f9c367bc5cde26419ed092fc9dd8), ROM_SKIP(7) ) |
| 2178 | | ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(6e5fee1f) SHA1(1eca79c8d395f881d0a05f10073998fcae70c3b1), ROM_SKIP(7) ) |
| 2179 | | ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(a8b1e9b4) SHA1(066285928e574e656510b90bc212a8d86660bd07), ROM_SKIP(7) ) |
| 2180 | | ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(c90080e6) SHA1(a764bdd6b4e9e727f7468a53424a9211ec5fd5a8), ROM_SKIP(7) ) |
| 2181 | | ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(1f20c020) SHA1(71b32386dc0444264f2f1e2a81899e0e9260994c), ROM_SKIP(7) ) |
| 2166 | ROMX_LOAD( "fish961018_gr0.63-56", 0x000000, 0x100000, CRC(99d0dc75) SHA1(b32126eea70c7584d1c34a6ca33282fbaf4b03aa), ROM_SKIP(7) ) |
| 2167 | ROMX_LOAD( "fish961018_gr0.55-48", 0x000001, 0x100000, CRC(2dfdfe62) SHA1(e0554d36ef5cf4b6ce171857ea4f2737f11286a5), ROM_SKIP(7) ) |
| 2168 | ROMX_LOAD( "fish961018_gr0.47-40", 0x000002, 0x100000, CRC(722aee2a) SHA1(bc79433131bed5b08453d1b80324a28a552783de), ROM_SKIP(7) ) |
| 2169 | ROMX_LOAD( "fish961018_gr0.39-32", 0x000003, 0x100000, CRC(919e31b4) SHA1(3807d4629d8277c780dba888c23d17ba47803f27), ROM_SKIP(7) ) |
| 2170 | ROMX_LOAD( "fish961018_gr0.31-24", 0x000004, 0x100000, CRC(a957ac95) SHA1(ddfaca994c06976bee8b123857904e64f40b7f31), ROM_SKIP(7) ) |
| 2171 | ROMX_LOAD( "fish961018_gr0.23-16", 0x000005, 0x100000, CRC(a147ec66) SHA1(6291008158d581b81e025ed34ff0950983c12c67), ROM_SKIP(7) ) |
| 2172 | ROMX_LOAD( "fish961018_gr0.15-08", 0x000006, 0x100000, CRC(206d2f38) SHA1(6aca89df26d3602ff1da3c23f19e0782439623ff), ROM_SKIP(7) ) |
| 2173 | ROMX_LOAD( "fish961018_gr0.07-00", 0x000007, 0x100000, CRC(06559831) SHA1(b2c022457425d7900337cfa2fd1622336c0c0bc5), ROM_SKIP(7) ) |
| 2174 | ROMX_LOAD( "fish961018_gr1.63-56", 0x800000, 0x100000, CRC(30c624d2) SHA1(4ced77d1663169d0cb37d6728ec52e67f05064c5), ROM_SKIP(7) ) |
| 2175 | ROMX_LOAD( "fish961018_gr1.55-48", 0x800001, 0x100000, CRC(049cd60f) SHA1(8a7615a76b57a4e6ef5d95a5ee6c56086671dbb6), ROM_SKIP(7) ) |
| 2176 | ROMX_LOAD( "fish961018_gr1.47-40", 0x800002, 0x100000, CRC(d6aaf3bf) SHA1(1c597bdc0e61fd0941cff5a8a93f24f108bd0daa), ROM_SKIP(7) ) |
| 2177 | ROMX_LOAD( "fish961018_gr1.39-32", 0x800003, 0x100000, CRC(7d6ebc69) SHA1(668769297f75f9c367bc5cde26419ed092fc9dd8), ROM_SKIP(7) ) |
| 2178 | ROMX_LOAD( "fish961018_gr1.31-24", 0x800004, 0x100000, CRC(6e5fee1f) SHA1(1eca79c8d395f881d0a05f10073998fcae70c3b1), ROM_SKIP(7) ) |
| 2179 | ROMX_LOAD( "fish961018_gr1.23-16", 0x800005, 0x100000, CRC(a8b1e9b4) SHA1(066285928e574e656510b90bc212a8d86660bd07), ROM_SKIP(7) ) |
| 2180 | ROMX_LOAD( "fish961018_gr1.15-08", 0x800006, 0x100000, CRC(c90080e6) SHA1(a764bdd6b4e9e727f7468a53424a9211ec5fd5a8), ROM_SKIP(7) ) |
| 2181 | ROMX_LOAD( "fish961018_gr1.07-00", 0x800007, 0x100000, CRC(1f20c020) SHA1(71b32386dc0444264f2f1e2a81899e0e9260994c), ROM_SKIP(7) ) |
| 2182 | 2182 | ROM_END |
| 2183 | 2183 | |
| 2184 | 2184 | ROM_START( freezeat3 ) |
| 2185 | 2185 | ROM_REGION32_BE( 0x200000, "user1", 0 ) /* 2MB for R3000 code */ |
| 2186 | | ROM_LOAD32_BYTE( "prog.hh", 0x000000, 0x040000, CRC(863942e6) SHA1(c7429c8a5c86ff93c64950e201cffca83dd7b7b0) ) |
| 2187 | | ROM_LOAD32_BYTE( "prog.hl", 0x000001, 0x040000, CRC(2acc18ef) SHA1(ead02566f7641b1d1066bd2e257b695e5c7e8437) ) |
| 2188 | | ROM_LOAD32_BYTE( "prog.lh", 0x000002, 0x040000, CRC(948cf20c) SHA1(86c757aa3c849ef5ba94ed4d5dbf10e833dab6bd) ) |
| 2189 | | ROM_LOAD32_BYTE( "prog.ll", 0x000003, 0x040000, CRC(5f44969e) SHA1(32345d7c56a3a890e71f8c71f25414d442b60af8) ) |
| 2186 | ROM_LOAD32_BYTE( "961007_prog.hh", 0x000000, 0x040000, CRC(863942e6) SHA1(c7429c8a5c86ff93c64950e201cffca83dd7b7b0) ) |
| 2187 | ROM_LOAD32_BYTE( "961007_prog.hl", 0x000001, 0x040000, CRC(2acc18ef) SHA1(ead02566f7641b1d1066bd2e257b695e5c7e8437) ) |
| 2188 | ROM_LOAD32_BYTE( "961007_prog.lh", 0x000002, 0x040000, CRC(948cf20c) SHA1(86c757aa3c849ef5ba94ed4d5dbf10e833dab6bd) ) |
| 2189 | ROM_LOAD32_BYTE( "961007_prog.ll", 0x000003, 0x040000, CRC(5f44969e) SHA1(32345d7c56a3a890e71f8c71f25414d442b60af8) ) |
| 2190 | 2190 | |
| 2191 | 2191 | ROM_REGION32_BE( 0x1000000, "user2", 0 ) /* 16MB for 64-bit ROM data */ |
| 2192 | | ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) ) |
| 2193 | | ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) ) |
| 2194 | | ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) ) |
| 2195 | | ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) ) |
| 2196 | | ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) ) |
| 2197 | | ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) ) |
| 2198 | | ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) ) |
| 2199 | | ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) ) |
| 2200 | | ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(ead678c9) SHA1(f83d467f6685965b6176b10adbd4e35ef808baf3), ROM_SKIP(7) ) |
| 2201 | | ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(3591e752) SHA1(df242d2f724edfd78f7191f0ba7a8cde2c09b25f), ROM_SKIP(7) ) |
| 2202 | | ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(e29a7a6c) SHA1(0bfb26076b390492eed81d4c4f0852c64fdccfce), ROM_SKIP(7) ) |
| 2203 | | ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(e980f957) SHA1(78e8ef07f443ce7991a46005627d5802d36d731c), ROM_SKIP(7) ) |
| 2204 | | ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(d90c5221) SHA1(7a330f39f3751d58157f872d92c3c2b91fe60d14), ROM_SKIP(7) ) |
| 2205 | | ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(9be0d4de) SHA1(9bb67a1f1db77483e896fed7096c1e23c153ede4), ROM_SKIP(7) ) |
| 2206 | | ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(122248af) SHA1(80dd5486106d475bd9f6d78919ebeb176e7becff), ROM_SKIP(7) ) |
| 2207 | | ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(5ae08327) SHA1(822d8292793509ebfbfce27e92a74c78c4328bda), ROM_SKIP(7) ) |
| 2192 | ROMX_LOAD( "fish961007_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) ) |
| 2193 | ROMX_LOAD( "fish961007_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) ) |
| 2194 | ROMX_LOAD( "fish961007_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) ) |
| 2195 | ROMX_LOAD( "fish961007_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) ) |
| 2196 | ROMX_LOAD( "fish961007_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) ) |
| 2197 | ROMX_LOAD( "fish961007_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) ) |
| 2198 | ROMX_LOAD( "fish961007_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) ) |
| 2199 | ROMX_LOAD( "fish961007_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) ) |
| 2200 | ROMX_LOAD( "fish961007_gr1.63-56", 0x800000, 0x100000, CRC(ead678c9) SHA1(f83d467f6685965b6176b10adbd4e35ef808baf3), ROM_SKIP(7) ) |
| 2201 | ROMX_LOAD( "fish961007_gr1.55-48", 0x800001, 0x100000, CRC(3591e752) SHA1(df242d2f724edfd78f7191f0ba7a8cde2c09b25f), ROM_SKIP(7) ) |
| 2202 | ROMX_LOAD( "fish961007_gr1.47-40", 0x800002, 0x100000, CRC(e29a7a6c) SHA1(0bfb26076b390492eed81d4c4f0852c64fdccfce), ROM_SKIP(7) ) |
| 2203 | ROMX_LOAD( "fish961007_gr1.39-32", 0x800003, 0x100000, CRC(e980f957) SHA1(78e8ef07f443ce7991a46005627d5802d36d731c), ROM_SKIP(7) ) |
| 2204 | ROMX_LOAD( "fish961007_gr1.31-24", 0x800004, 0x100000, CRC(d90c5221) SHA1(7a330f39f3751d58157f872d92c3c2b91fe60d14), ROM_SKIP(7) ) |
| 2205 | ROMX_LOAD( "fish961007_gr1.23-16", 0x800005, 0x100000, CRC(9be0d4de) SHA1(9bb67a1f1db77483e896fed7096c1e23c153ede4), ROM_SKIP(7) ) |
| 2206 | ROMX_LOAD( "fish961007_gr1.15-08", 0x800006, 0x100000, CRC(122248af) SHA1(80dd5486106d475bd9f6d78919ebeb176e7becff), ROM_SKIP(7) ) |
| 2207 | ROMX_LOAD( "fish961007_gr1.07-00", 0x800007, 0x100000, CRC(5ae08327) SHA1(822d8292793509ebfbfce27e92a74c78c4328bda), ROM_SKIP(7) ) |
| 2208 | 2208 | ROM_END |
| 2209 | 2209 | |
| 2210 | 2210 | ROM_START( freezeat4 ) |
| 2211 | 2211 | ROM_REGION32_BE( 0x200000, "user1", 0 ) /* 2MB for R3000 code */ |
| 2212 | | ROM_LOAD32_BYTE( "prog.hh", 0x000000, 0x040000, CRC(80336f5e) SHA1(9946e8eebec2cd68db059f40f535ea212f41913d) ) |
| 2213 | | ROM_LOAD32_BYTE( "prog.hl", 0x000001, 0x040000, CRC(55125520) SHA1(13be4fbf32bcd94a2ea97fd690bd1dfdff146d33) ) |
| 2214 | | ROM_LOAD32_BYTE( "prog.lh", 0x000002, 0x040000, CRC(9d99c794) SHA1(f443f05a5979db66d61ef4174f0369a1cf4b7793) ) |
| 2215 | | ROM_LOAD32_BYTE( "prog.ll", 0x000003, 0x040000, CRC(e03700e0) SHA1(24d41750f02ee7e8fb379e517751b661400aa521) ) |
| 2212 | ROM_LOAD32_BYTE( "961003_prog.hh", 0x000000, 0x040000, CRC(80336f5e) SHA1(9946e8eebec2cd68db059f40f535ea212f41913d) ) |
| 2213 | ROM_LOAD32_BYTE( "961003_prog.hl", 0x000001, 0x040000, CRC(55125520) SHA1(13be4fbf32bcd94a2ea97fd690bd1dfdff146d33) ) |
| 2214 | ROM_LOAD32_BYTE( "961003_prog.lh", 0x000002, 0x040000, CRC(9d99c794) SHA1(f443f05a5979db66d61ef4174f0369a1cf4b7793) ) |
| 2215 | ROM_LOAD32_BYTE( "961003_prog.ll", 0x000003, 0x040000, CRC(e03700e0) SHA1(24d41750f02ee7e8fb379e517751b661400aa521) ) |
| 2216 | 2216 | |
| 2217 | 2217 | ROM_REGION32_BE( 0x1000000, "user2", 0 ) /* 16MB for 64-bit ROM data */ |
| 2218 | | ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) ) |
| 2219 | | ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) ) |
| 2220 | | ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) ) |
| 2221 | | ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) ) |
| 2222 | | ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) ) |
| 2223 | | ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) ) |
| 2224 | | ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) ) |
| 2225 | | ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) ) |
| 2226 | | ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(c91b6ee4) SHA1(58d2d6b1b9847150b8b3e358842c4a097ef91475), ROM_SKIP(7) ) |
| 2227 | | ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(65528e55) SHA1(18020cababed379f77149b7e89e80b294766df31), ROM_SKIP(7) ) |
| 2228 | | ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(8fe4187f) SHA1(c9ceec40688617e1251142465d0e608f80a83e40), ROM_SKIP(7) ) |
| 2229 | | ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(fdf05a42) SHA1(849e224b68be2fb396ee4cb4729517470af7c282), ROM_SKIP(7) ) |
| 2230 | | ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(bb2cd741) SHA1(ac55a54c702d222cb1b9bb480b0f7a71bc315878), ROM_SKIP(7) ) |
| 2231 | | ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(ea8c5984) SHA1(eca1619c17dfac154a2024ec49b4b4f9f06a50c9), ROM_SKIP(7) ) |
| 2232 | | ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(0b00c816) SHA1(879b0e9d92fe737d740c348dc1cc376c8abfbdb8), ROM_SKIP(7) ) |
| 2233 | | ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(a84335c3) SHA1(340f5ddb9bff1ecd469eab8be36cc0ede84f1f5e), ROM_SKIP(7) ) |
| 2218 | ROMX_LOAD( "fish961003_gr0.63-56", 0x000000, 0x100000, CRC(36799449) SHA1(bb706fe7fdc68f840702a127eed7d4519dd45869), ROM_SKIP(7) ) |
| 2219 | ROMX_LOAD( "fish961003_gr0.55-48", 0x000001, 0x100000, CRC(23959947) SHA1(a35a6e62c7b2be57d41b1b64be93713cbf897f0a), ROM_SKIP(7) ) |
| 2220 | ROMX_LOAD( "fish961003_gr0.47-40", 0x000002, 0x100000, CRC(4657e4e0) SHA1(b6c07182babcb0a106bf4a8f2e3f524371dd882d), ROM_SKIP(7) ) |
| 2221 | ROMX_LOAD( "fish961003_gr0.39-32", 0x000003, 0x100000, CRC(b6ea4b64) SHA1(176f94f14307c40b9c611d6f6bc9118e498cdfad), ROM_SKIP(7) ) |
| 2222 | ROMX_LOAD( "fish961003_gr0.31-24", 0x000004, 0x100000, CRC(7d4ce71f) SHA1(a1cf5aa9df8dd29c777c10cfdce0925981584261), ROM_SKIP(7) ) |
| 2223 | ROMX_LOAD( "fish961003_gr0.23-16", 0x000005, 0x100000, CRC(02db4fd1) SHA1(fce6f31802bf36d6b006f0b212f553bdf21f9374), ROM_SKIP(7) ) |
| 2224 | ROMX_LOAD( "fish961003_gr0.15-08", 0x000006, 0x100000, CRC(7d496d6c) SHA1(f82db0621729a00acf4077482e9dfab040ac829b), ROM_SKIP(7) ) |
| 2225 | ROMX_LOAD( "fish961003_gr0.07-00", 0x000007, 0x100000, CRC(3aa389d8) SHA1(52502f2f3c91d7c29261f60fe8f489a352399c96), ROM_SKIP(7) ) |
| 2226 | ROMX_LOAD( "fish961003_gr1.63-56", 0x800000, 0x100000, CRC(c91b6ee4) SHA1(58d2d6b1b9847150b8b3e358842c4a097ef91475), ROM_SKIP(7) ) |
| 2227 | ROMX_LOAD( "fish961003_gr1.55-48", 0x800001, 0x100000, CRC(65528e55) SHA1(18020cababed379f77149b7e89e80b294766df31), ROM_SKIP(7) ) |
| 2228 | ROMX_LOAD( "fish961003_gr1.47-40", 0x800002, 0x100000, CRC(8fe4187f) SHA1(c9ceec40688617e1251142465d0e608f80a83e40), ROM_SKIP(7) ) |
| 2229 | ROMX_LOAD( "fish961003_gr1.39-32", 0x800003, 0x100000, CRC(fdf05a42) SHA1(849e224b68be2fb396ee4cb4729517470af7c282), ROM_SKIP(7) ) |
| 2230 | ROMX_LOAD( "fish961003_gr1.31-24", 0x800004, 0x100000, CRC(bb2cd741) SHA1(ac55a54c702d222cb1b9bb480b0f7a71bc315878), ROM_SKIP(7) ) |
| 2231 | ROMX_LOAD( "fish961003_gr1.23-16", 0x800005, 0x100000, CRC(ea8c5984) SHA1(eca1619c17dfac154a2024ec49b4b4f9f06a50c9), ROM_SKIP(7) ) |
| 2232 | ROMX_LOAD( "fish961003_gr1.15-08", 0x800006, 0x100000, CRC(0b00c816) SHA1(879b0e9d92fe737d740c348dc1cc376c8abfbdb8), ROM_SKIP(7) ) |
| 2233 | ROMX_LOAD( "fish961003_gr1.07-00", 0x800007, 0x100000, CRC(a84335c3) SHA1(340f5ddb9bff1ecd469eab8be36cc0ede84f1f5e), ROM_SKIP(7) ) |
| 2234 | 2234 | ROM_END |
| 2235 | 2235 | |
| 2236 | 2236 | ROM_START( freezeat5 ) |
| 2237 | 2237 | ROM_REGION32_BE( 0x200000, "user1", 0 ) /* 2MB for R3000 code */ |
| 2238 | | ROM_LOAD32_BYTE( "prog.hh", 0x000000, 0x040000, CRC(95c4fc64) SHA1(cd00efe7f760ef1e4cdc4bc8a3b368427cb15d8a) ) |
| 2239 | | ROM_LOAD32_BYTE( "prog.hl", 0x000001, 0x040000, CRC(ffb9cb71) SHA1(35d6a5440d63bc5b94c4447645365039169da368) ) |
| 2240 | | ROM_LOAD32_BYTE( "prog.lh", 0x000002, 0x040000, CRC(3ddacd80) SHA1(79f9650531847eefd83908b6ea1e8362688b377c) ) |
| 2241 | | ROM_LOAD32_BYTE( "prog.ll", 0x000003, 0x040000, CRC(95ebefb0) SHA1(b88b12adabd7b0902c3a78919bcec8d9a2b04168) ) |
| 2238 | ROM_LOAD32_BYTE( "960920_prog.hh", 0x000000, 0x040000, CRC(95c4fc64) SHA1(cd00efe7f760ef1e4cdc4bc8a3b368427cb15d8a) ) |
| 2239 | ROM_LOAD32_BYTE( "960920_prog.hl", 0x000001, 0x040000, CRC(ffb9cb71) SHA1(35d6a5440d63bc5b94c4447645365039169da368) ) |
| 2240 | ROM_LOAD32_BYTE( "960920_prog.lh", 0x000002, 0x040000, CRC(3ddacd80) SHA1(79f9650531847eefd83908b6ea1e8362688b377c) ) |
| 2241 | ROM_LOAD32_BYTE( "960920_prog.ll", 0x000003, 0x040000, CRC(95ebefb0) SHA1(b88b12adabd7b0902c3a78919bcec8d9a2b04168) ) |
| 2242 | 2242 | |
| 2243 | 2243 | ROM_REGION32_BE( 0x1000000, "user2", 0 ) /* 16MB for 64-bit ROM data */ |
| 2244 | | ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(404a10c3) SHA1(8e353ac7608bd54f0fea610c85166ad14f2faadb), ROM_SKIP(7) ) |
| 2245 | | ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(0b262f2f) SHA1(2a963cb5c3344091406d090edfdda498709c6aa6), ROM_SKIP(7) ) |
| 2246 | | ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(43f86d26) SHA1(b31d36b11052514b5bcd5bf8e400457ca572c306), ROM_SKIP(7) ) |
| 2247 | | ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(5cf0228f) SHA1(7a8c59cf9a7744e9f332db5f661f507323375968), ROM_SKIP(7) ) |
| 2248 | | ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(7a24ff98) SHA1(db9e0e8bb417f187267a6e4fc1e66ff060ee4096), ROM_SKIP(7) ) |
| 2249 | | ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(ea163c93) SHA1(d07ed26191d36497c56b15774625a49ecb958386), ROM_SKIP(7) ) |
| 2250 | | ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(d364534f) SHA1(153908bb8929a898945f768f8bc3d853c6aeaceb), ROM_SKIP(7) ) |
| 2251 | | ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(7ba4cb0d) SHA1(16bd487123f499b7080596dc76253081179a0f66), ROM_SKIP(7) ) |
| 2252 | | ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(0e1fc4a9) SHA1(a200bb0af5f1e2c3f8d221ae4e9ba55b9dfb8550), ROM_SKIP(7) ) |
| 2253 | | ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(b696b875) SHA1(16dc4d5cee3f08360cf19926584419c21d781f45), ROM_SKIP(7) ) |
| 2254 | | ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(e78d9302) SHA1(f8b5ed992c433d63677edbeafd3e465b1d42b455), ROM_SKIP(7) ) |
| 2255 | | ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(9b50374c) SHA1(d8af3c9d8e0459e24b974cdf2e75c7c39582912f), ROM_SKIP(7) ) |
| 2256 | | ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(b6a19b7e) SHA1(5668b27db4dade8efb1524b8ecd1fe78498e8460), ROM_SKIP(7) ) |
| 2257 | | ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(ff835b67) SHA1(19da2de1d067069871c33c8b25fd2eac2d03f627), ROM_SKIP(7) ) |
| 2258 | | ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(8daf6995) SHA1(2f44031378b5fb1ba1f80a966dbe902316dc6fe8), ROM_SKIP(7) ) |
| 2259 | | ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(3676ac70) SHA1(640c4d4f53ca2bcae2009e402fd6ad70e40defa4), ROM_SKIP(7) ) |
| 2244 | ROMX_LOAD( "fish960920_gr0.63-56", 0x000000, 0x100000, CRC(404a10c3) SHA1(8e353ac7608bd54f0fea610c85166ad14f2faadb), ROM_SKIP(7) ) |
| 2245 | ROMX_LOAD( "fish960920_gr0.55-48", 0x000001, 0x100000, CRC(0b262f2f) SHA1(2a963cb5c3344091406d090edfdda498709c6aa6), ROM_SKIP(7) ) |
| 2246 | ROMX_LOAD( "fish960920_gr0.47-40", 0x000002, 0x100000, CRC(43f86d26) SHA1(b31d36b11052514b5bcd5bf8e400457ca572c306), ROM_SKIP(7) ) |
| 2247 | ROMX_LOAD( "fish960920_gr0.39-32", 0x000003, 0x100000, CRC(5cf0228f) SHA1(7a8c59cf9a7744e9f332db5f661f507323375968), ROM_SKIP(7) ) |
| 2248 | ROMX_LOAD( "fish960920_gr0.31-24", 0x000004, 0x100000, CRC(7a24ff98) SHA1(db9e0e8bb417f187267a6e4fc1e66ff060ee4096), ROM_SKIP(7) ) |
| 2249 | ROMX_LOAD( "fish960920_gr0.23-16", 0x000005, 0x100000, CRC(ea163c93) SHA1(d07ed26191d36497c56b15774625a49ecb958386), ROM_SKIP(7) ) |
| 2250 | ROMX_LOAD( "fish960920_gr0.15-08", 0x000006, 0x100000, CRC(d364534f) SHA1(153908bb8929a898945f768f8bc3d853c6aeaceb), ROM_SKIP(7) ) |
| 2251 | ROMX_LOAD( "fish960920_gr0.07-00", 0x000007, 0x100000, CRC(7ba4cb0d) SHA1(16bd487123f499b7080596dc76253081179a0f66), ROM_SKIP(7) ) |
| 2252 | ROMX_LOAD( "fish960920_gr1.63-56", 0x800000, 0x100000, CRC(0e1fc4a9) SHA1(a200bb0af5f1e2c3f8d221ae4e9ba55b9dfb8550), ROM_SKIP(7) ) |
| 2253 | ROMX_LOAD( "fish960920_gr1.55-48", 0x800001, 0x100000, CRC(b696b875) SHA1(16dc4d5cee3f08360cf19926584419c21d781f45), ROM_SKIP(7) ) |
| 2254 | ROMX_LOAD( "fish960920_gr1.47-40", 0x800002, 0x100000, CRC(e78d9302) SHA1(f8b5ed992c433d63677edbeafd3e465b1d42b455), ROM_SKIP(7) ) |
| 2255 | ROMX_LOAD( "fish960920_gr1.39-32", 0x800003, 0x100000, CRC(9b50374c) SHA1(d8af3c9d8e0459e24b974cdf2e75c7c39582912f), ROM_SKIP(7) ) |
| 2256 | ROMX_LOAD( "fish960920_gr1.31-24", 0x800004, 0x100000, CRC(b6a19b7e) SHA1(5668b27db4dade8efb1524b8ecd1fe78498e8460), ROM_SKIP(7) ) |
| 2257 | ROMX_LOAD( "fish960920_gr1.23-16", 0x800005, 0x100000, CRC(ff835b67) SHA1(19da2de1d067069871c33c8b25fd2eac2d03f627), ROM_SKIP(7) ) |
| 2258 | ROMX_LOAD( "fish960920_gr1.15-08", 0x800006, 0x100000, CRC(8daf6995) SHA1(2f44031378b5fb1ba1f80a966dbe902316dc6fe8), ROM_SKIP(7) ) |
| 2259 | ROMX_LOAD( "fish960920_gr1.07-00", 0x800007, 0x100000, CRC(3676ac70) SHA1(640c4d4f53ca2bcae2009e402fd6ad70e40defa4), ROM_SKIP(7) ) |
| 2260 | 2260 | ROM_END |
| 2261 | 2261 | |
| 2262 | 2262 | ROM_START( freezeat6 ) |
| 2263 | 2263 | ROM_REGION32_BE( 0x200000, "user1", 0 ) /* 2MB for R3000 code */ |
| 2264 | | ROM_LOAD32_BYTE( "prog.hh", 0x000000, 0x040000, CRC(120711fe) SHA1(387e3cc8a1a9ea7d65c528387891d09ed9889fe3) ) |
| 2265 | | ROM_LOAD32_BYTE( "prog.hl", 0x000001, 0x040000, CRC(18dd292a) SHA1(00e79851140716985f43594142c97e510a06b24a) ) |
| 2266 | | ROM_LOAD32_BYTE( "prog.lh", 0x000002, 0x040000, CRC(ce387e72) SHA1(021a274da0b828550a47c3778e1059d4e759693a) ) |
| 2267 | | ROM_LOAD32_BYTE( "prog.ll", 0x000003, 0x040000, CRC(9b307b7c) SHA1(71b696802fe7c867525d2626351dcfacedabd696) ) |
| 2264 | ROM_LOAD32_BYTE( "960907_prog.hh", 0x000000, 0x040000, CRC(120711fe) SHA1(387e3cc8a1a9ea7d65c528387891d09ed9889fe3) ) |
| 2265 | ROM_LOAD32_BYTE( "960907_prog.hl", 0x000001, 0x040000, CRC(18dd292a) SHA1(00e79851140716985f43594142c97e510a06b24a) ) |
| 2266 | ROM_LOAD32_BYTE( "960907_prog.lh", 0x000002, 0x040000, CRC(ce387e72) SHA1(021a274da0b828550a47c3778e1059d4e759693a) ) |
| 2267 | ROM_LOAD32_BYTE( "960907_prog.ll", 0x000003, 0x040000, CRC(9b307b7c) SHA1(71b696802fe7c867525d2626351dcfacedabd696) ) |
| 2268 | 2268 | |
| 2269 | 2269 | ROM_REGION32_BE( 0x1000000, "user2", 0 ) /* 16MB for 64-bit ROM data */ |
| 2270 | | ROMX_LOAD( "fish_gr0.63-56", 0x000000, 0x100000, CRC(293a3308) SHA1(e4c88759c3b8f8a359db83817dbd0428350b4f7e), ROM_SKIP(7) ) |
| 2271 | | ROMX_LOAD( "fish_gr0.55-48", 0x000001, 0x100000, CRC(18bb4bdf) SHA1(1f6c49b3b5946390fa7582b531f8d9af3baa2567), ROM_SKIP(7) ) |
| 2272 | | ROMX_LOAD( "fish_gr0.47-40", 0x000002, 0x100000, CRC(1faedcc6) SHA1(1e4ecbe4553fb3ebfbd03bd7e16066ccb531d00b), ROM_SKIP(7) ) |
| 2273 | | ROMX_LOAD( "fish_gr0.39-32", 0x000003, 0x100000, CRC(536bc349) SHA1(06d7ac38b2c8cdc85e2cb531bba9c836e50c8247), ROM_SKIP(7) ) |
| 2274 | | ROMX_LOAD( "fish_gr0.31-24", 0x000004, 0x100000, CRC(813d4a31) SHA1(e024f9da2f15a482d8142870baf487297b995ed9), ROM_SKIP(7) ) |
| 2275 | | ROMX_LOAD( "fish_gr0.23-16", 0x000005, 0x100000, CRC(f881514b) SHA1(a694f90621e2c1569a6a5ed8920838ba5506f72e), ROM_SKIP(7) ) |
| 2276 | | ROMX_LOAD( "fish_gr0.15-08", 0x000006, 0x100000, CRC(d7634655) SHA1(d7ac83c0fa5d0ec57d096d4d704fe99ee8160e09), ROM_SKIP(7) ) |
| 2277 | | ROMX_LOAD( "fish_gr0.07-00", 0x000007, 0x100000, CRC(3fca32a3) SHA1(22753a9678e04d9355238e013e58d9f45315579d), ROM_SKIP(7) ) |
| 2278 | | ROMX_LOAD( "fish_gr1.63-56", 0x800000, 0x100000, CRC(a2b89d3a) SHA1(9cfcd0b88dea192ba39efcdccc78d1a0fd8f3388), ROM_SKIP(7) ) |
| 2279 | | ROMX_LOAD( "fish_gr1.55-48", 0x800001, 0x100000, CRC(766822a8) SHA1(2c9b14542a5467c1a3451559ea296da09c2cfdb9), ROM_SKIP(7) ) |
| 2280 | | ROMX_LOAD( "fish_gr1.47-40", 0x800002, 0x100000, CRC(112b519c) SHA1(f0e1ed1b8ad271fa9708f513b11d5cca6e550668), ROM_SKIP(7) ) |
| 2281 | | ROMX_LOAD( "fish_gr1.39-32", 0x800003, 0x100000, CRC(435b5d37) SHA1(ecb6e7271d993f8e315b85e69166838e66dd41a8), ROM_SKIP(7) ) |
| 2282 | | ROMX_LOAD( "fish_gr1.31-24", 0x800004, 0x100000, CRC(2637ae7f) SHA1(5e0bd0e08d8c1eaae725b4d55030c2698abd46e7), ROM_SKIP(7) ) |
| 2283 | | ROMX_LOAD( "fish_gr1.23-16", 0x800005, 0x100000, CRC(e732f1bf) SHA1(a228aee0cc36a0089716f20bfa75d87750692adb), ROM_SKIP(7) ) |
| 2284 | | ROMX_LOAD( "fish_gr1.15-08", 0x800006, 0x100000, CRC(7d4e2d9e) SHA1(4cb9b754b7585df4cae6bdd7085a57729d53e643), ROM_SKIP(7) ) |
| 2285 | | ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(8ea036af) SHA1(1f9baec6712e0ba0e8a744529e41799217760194), ROM_SKIP(7) ) |
| 2270 | ROMX_LOAD( "fish960907_gr0.63-56", 0x000000, 0x100000, CRC(293a3308) SHA1(e4c88759c3b8f8a359db83817dbd0428350b4f7e), ROM_SKIP(7) ) |
| 2271 | ROMX_LOAD( "fish960907_gr0.55-48", 0x000001, 0x100000, CRC(18bb4bdf) SHA1(1f6c49b3b5946390fa7582b531f8d9af3baa2567), ROM_SKIP(7) ) |
| 2272 | ROMX_LOAD( "fish960907_gr0.47-40", 0x000002, 0x100000, CRC(1faedcc6) SHA1(1e4ecbe4553fb3ebfbd03bd7e16066ccb531d00b), ROM_SKIP(7) ) |
| 2273 | ROMX_LOAD( "fish960907_gr0.39-32", 0x000003, 0x100000, CRC(536bc349) SHA1(06d7ac38b2c8cdc85e2cb531bba9c836e50c8247), ROM_SKIP(7) ) |
| 2274 | ROMX_LOAD( "fish960907_gr0.31-24", 0x000004, 0x100000, CRC(813d4a31) SHA1(e024f9da2f15a482d8142870baf487297b995ed9), ROM_SKIP(7) ) |
| 2275 | ROMX_LOAD( "fish960907_gr0.23-16", 0x000005, 0x100000, CRC(f881514b) SHA1(a694f90621e2c1569a6a5ed8920838ba5506f72e), ROM_SKIP(7) ) |
| 2276 | ROMX_LOAD( "fish960907_gr0.15-08", 0x000006, 0x100000, CRC(d7634655) SHA1(d7ac83c0fa5d0ec57d096d4d704fe99ee8160e09), ROM_SKIP(7) ) |
| 2277 | ROMX_LOAD( "fish960907_gr0.07-00", 0x000007, 0x100000, CRC(3fca32a3) SHA1(22753a9678e04d9355238e013e58d9f45315579d), ROM_SKIP(7) ) |
| 2278 | ROMX_LOAD( "fish960907_gr1.63-56", 0x800000, 0x100000, CRC(a2b89d3a) SHA1(9cfcd0b88dea192ba39efcdccc78d1a0fd8f3388), ROM_SKIP(7) ) |
| 2279 | ROMX_LOAD( "fish960907_gr1.55-48", 0x800001, 0x100000, CRC(766822a8) SHA1(2c9b14542a5467c1a3451559ea296da09c2cfdb9), ROM_SKIP(7) ) |
| 2280 | ROMX_LOAD( "fish960907_gr1.47-40", 0x800002, 0x100000, CRC(112b519c) SHA1(f0e1ed1b8ad271fa9708f513b11d5cca6e550668), ROM_SKIP(7) ) |
| 2281 | ROMX_LOAD( "fish960907_gr1.39-32", 0x800003, 0x100000, CRC(435b5d37) SHA1(ecb6e7271d993f8e315b85e69166838e66dd41a8), ROM_SKIP(7) ) |
| 2282 | ROMX_LOAD( "fish960907_gr1.31-24", 0x800004, 0x100000, CRC(2637ae7f) SHA1(5e0bd0e08d8c1eaae725b4d55030c2698abd46e7), ROM_SKIP(7) ) |
| 2283 | ROMX_LOAD( "fish960907_gr1.23-16", 0x800005, 0x100000, CRC(e732f1bf) SHA1(a228aee0cc36a0089716f20bfa75d87750692adb), ROM_SKIP(7) ) |
| 2284 | ROMX_LOAD( "fish960907_gr1.15-08", 0x800006, 0x100000, CRC(7d4e2d9e) SHA1(4cb9b754b7585df4cae6bdd7085a57729d53e643), ROM_SKIP(7) ) |
| 2285 | ROMX_LOAD( "fish960907_gr1.07-00", 0x800007, 0x100000, CRC(8ea036af) SHA1(1f9baec6712e0ba0e8a744529e41799217760194), ROM_SKIP(7) ) |
| 2286 | 2286 | ROM_END |
| 2287 | 2287 | |
| 2288 | 2288 | |
src/mame/drivers/naomi.c
| r14521 | r14522 | |
| 6852 | 6852 | ROM_LOAD("gds-0032_pic", 0x00, 0x50, NO_DUMP ) // PIC was missing |
| 6853 | 6853 | ROM_END |
| 6854 | 6854 | |
| 6855 | ROM_START( initdv3e ) |
| 6856 | NAOMI2_BIOS |
| 6857 | NAOMI_DEFAULT_EEPROM |
| 6858 | |
| 6859 | DISK_REGION( "gdrom" ) |
| 6860 | DISK_IMAGE_READONLY( "gds-0033", 0, SHA1(8908238a0211c6343ce6f3f27729e33c4e276d35) ) |
| 6861 | |
| 6862 | ROM_REGION( 0x4300, "pic", ROMREGION_ERASEFF) |
| 6863 | //PIC16C622A (317-0384-COM) |
| 6864 | ROM_LOAD( "317-0384-com.pic", 0x000000, 0x004300, CRC(081ccd51) SHA1(598b3bd9e8b16f5954d15738c1ca55703609b690) ) |
| 6865 | ROM_END |
| 6866 | |
| 6855 | 6867 | /* |
| 6856 | 6868 | Title THE_MAZE_OF_THE_KINGS |
| 6857 | 6869 | Media ID E3D0 |
| r14521 | r14522 | |
| 7044 | 7056 | ROM_LOAD( "mpr-23818.ic20", 0xa000000, 0x800000, CRC(be902c2b) SHA1(1f1aa6933da528bdcef45942a0caa33cb24e7ddd) ) |
| 7045 | 7057 | ROM_END |
| 7046 | 7058 | |
| 7059 | ROM_START( soulsurf ) |
| 7060 | NAOMI2_BIOS |
| 7061 | NAOMI_DEFAULT_EEPROM |
| 7062 | |
| 7063 | ROM_REGION( 0xb000000, "rom_board", ROMREGION_ERASEFF) |
| 7064 | // Cart has a Sega factory EPROM sticker stating "EPR-23838C" and a Sega factory sticker stating "Rev. A". Seriously. |
| 7065 | ROM_LOAD( "epr-23838c.ic22", 0x000000, 0x400000, CRC(5e5fb00f) SHA1(c5e81ebead9072cc08f09d1715d609cb0f7631ba) ) |
| 7066 | ROM_RELOAD( 0x400000, 0x400000) |
| 7067 | ROM_LOAD( "ssf01.ic1s", 0x0800000, 0x800000, CRC(4f12f789) SHA1(7b79b687fc61e2e981b9e5e8e0939c4ad24a98f0) ) |
| 7068 | ROM_LOAD( "ssf02.ic2s", 0x1000000, 0x800000, CRC(a255d41a) SHA1(3e932527eb68edf3e8538c1ad264a1c599f6a9d5) ) |
| 7069 | ROM_LOAD( "ssf03.ic3s", 0x1800000, 0x800000, CRC(0f8d6577) SHA1(afaf440e667bacc941c0a5418a0e3b0f2bb725b7) ) |
| 7070 | ROM_LOAD( "ssf04.ic4s", 0x2000000, 0x800000, CRC(bdf25bd0) SHA1(f79b1fdba9c48969c49617c43c1919637adb13ba) ) |
| 7071 | ROM_LOAD( "ssf05.ic5s", 0x2800000, 0x800000, CRC(a74b3bb4) SHA1(0ce7cef849061a9af7a61d69dc633f6971a3a63d) ) |
| 7072 | ROM_LOAD( "ssf06.ic6s", 0x3000000, 0x800000, CRC(3cd1f5d5) SHA1(77573c3a60af64e6e6a0eb85d5b8176ed98b0723) ) |
| 7073 | ROM_LOAD( "ssf07.ic7s", 0x3800000, 0x800000, CRC(00d240f5) SHA1(43010fc596f2cdffdff35a6122f2ab02a5251bc0) ) |
| 7074 | ROM_LOAD( "ssf08.ic8s", 0x4000000, 0x800000, CRC(d4907fa1) SHA1(79b1c771819f6e4baa048010bfb940a45370eba2) ) |
| 7075 | ROM_LOAD( "ssf09.ic9s", 0x4800000, 0x800000, CRC(6327d49e) SHA1(a10e3c27f70dbf18e63cf51962b6a79a52eba26c) ) |
| 7076 | ROM_LOAD( "ssf10.ic10s", 0x5000000, 0x800000, CRC(7975dc80) SHA1(81bda50968f0153a0c4432d8d81e817c1e82e5b2) ) |
| 7077 | ROM_LOAD( "ssf11.ic11s", 0x5800000, 0x800000, CRC(a242f682) SHA1(435ea5bb1b3667f9ef3d7de081b15f4e8e6a0d01) ) |
| 7078 | ROM_LOAD( "ssf12.ic12s", 0x6000000, 0x800000, CRC(45fa259e) SHA1(8d7e708e7a2cbc2d60b68715dd79bac28d894d4c) ) |
| 7079 | ROM_LOAD( "ssf13.ic13s", 0x6800000, 0x800000, CRC(e9578063) SHA1(618f66d01f6bdacbf2a3242774a316b130594e02) ) |
| 7080 | ROM_LOAD( "ssf14.ic14s", 0x7000000, 0x800000, CRC(2edc1311) SHA1(bceb54dd29012580e2e6f15f16c6b31195010153) ) |
| 7081 | ROM_LOAD( "ssf15.ic15s", 0x7800000, 0x800000, CRC(416db320) SHA1(34536716a35260d9457703704bb9174fb1616d60) ) |
| 7082 | ROM_LOAD( "ssf16.ic16s", 0x8000000, 0x800000, CRC(2530cc04) SHA1(6425c031e5a129a3c9451bc694b5da8553f154c2) ) |
| 7083 | ROM_LOAD( "ssf17.ic17s", 0x8800000, 0x800000, CRC(9e6afcc2) SHA1(4fb69d834ea12c82e897af47a22dcc47f3c83768) ) |
| 7084 | ROM_LOAD( "ssf18.ic18s", 0x9000000, 0x800000, CRC(854ed5e5) SHA1(e445599f6a9e9d05c279259307edc08bce5d6d1f) ) |
| 7085 | ROM_LOAD( "ssf19.ic19s", 0x9800000, 0x800000, CRC(4f8ec86a) SHA1(406ab9eeccd99fa5515d4a2c229c8db1a5cb8f83) ) |
| 7086 | ROM_LOAD( "ssf20.ic20s", 0xa000000, 0x800000, CRC(c90b960d) SHA1(66e9f09d1f7f6a991371574a2e095c0e22fb7031) ) |
| 7087 | ROM_LOAD( "ssf21.ic21s", 0xa800000, 0x800000, CRC(1477c064) SHA1(87fb8d8a91d6bed70b246a8df88fa77fbf3db443) ) |
| 7088 | ROM_END |
| 7089 | |
| 7047 | 7090 | /* |
| 7048 | 7091 | Tests IC1 like gram2000 if actel_id is 0xffff, see ROM_COPY |
| 7049 | 7092 | */ |
| r14521 | r14522 | |
| 7481 | 7524 | AW_BIOS |
| 7482 | 7525 | |
| 7483 | 7526 | ROM_REGION( 0x8000000, "rom_board", ROMREGION_ERASE) |
| 7484 | | ROM_LOAD( "ax2201p01.ic18", 0x0000000, 0x0800000, CRC(27aab918) SHA1(41c5ddd8bd4c91481750606ab44aa115b5fe01d0) ) |
| 7527 | ROM_LOAD( "ax2201en_p01.ic18", 0x0000000, 0x0800000, CRC(27aab918) SHA1(41c5ddd8bd4c91481750606ab44aa115b5fe01d0) ) |
| 7485 | 7528 | ROM_LOAD( "ax2201m01.ic11", 0x1000000, 0x1000000, CRC(22ea665b) SHA1(292c92c9ae43eea2d1c27cedfb89c3956b8dea32) ) |
| 7486 | 7529 | ROM_LOAD( "ax2202m01.ic12", 0x2000000, 0x1000000, CRC(7fad1bea) SHA1(89f3f88af48973a4685955d86ef97a1487b8e7a8) ) |
| 7487 | 7530 | ROM_LOAD( "ax2203m01.ic13", 0x3000000, 0x1000000, CRC(78986ca4) SHA1(5a6c8c12955573f33361d2c6f20f85de35ac7bae) ) |
| r14521 | r14522 | |
| 7497 | 7540 | AW_BIOS |
| 7498 | 7541 | |
| 7499 | 7542 | ROM_REGION( 0x8000000, "rom_board", ROMREGION_ERASE) |
| 7500 | | ROM_LOAD( "ax2201p01.ic18", 0x0000000, 0x0800000, CRC(ecc4a5c7) SHA1(97c2ef2be95b39bc978474a8243740df50255a8b) ) |
| 7501 | | /* these are taken from the above set, game *seems* to work fine with these ... */ |
| 7543 | ROM_LOAD( "ax2201jp_p01.ic18", 0x0000000, 0x0800000, CRC(ecc4a5c7) SHA1(97c2ef2be95b39bc978474a8243740df50255a8b) ) |
| 7544 | |
| 7545 | /* these are taken from the above set, game *seems* to work fine with these ... */ |
| 7502 | 7546 | ROM_LOAD( "ax2201m01.ic11", 0x1000000, 0x1000000, CRC(22ea665b) SHA1(292c92c9ae43eea2d1c27cedfb89c3956b8dea32) ) |
| 7503 | 7547 | ROM_LOAD( "ax2202m01.ic12", 0x2000000, 0x1000000, CRC(7fad1bea) SHA1(89f3f88af48973a4685955d86ef97a1487b8e7a8) ) |
| 7504 | 7548 | ROM_LOAD( "ax2203m01.ic13", 0x3000000, 0x1000000, CRC(78986ca4) SHA1(5a6c8c12955573f33361d2c6f20f85de35ac7bae) ) |
| r14521 | r14522 | |
| 7811 | 7855 | /* 0062 */ GAME( 2002, clubkrte, naomi2, naomi2, naomi, naomi2, ROT0, "Sega", "Club Kart: European Session (Rev D)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS ) |
| 7812 | 7856 | /* 0080 */ GAME( 2002, vf4cart, naomi2, naomi2m2, naomi, naomi2, ROT0, "Sega", "Virtua Fighter 4 (Cartridge)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS ) |
| 7813 | 7857 | /* 0087 */ GAME( 2002, kingrt66, naomi2, naomi2, naomi, naomi2, ROT0, "Sega", "King of Route 66 (Rev A)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS ) |
| 7814 | | // 0095 Soul Surfer |
| 7858 | /* 0095 */ GAME( 2002, soulsurf, naomi2, naomi2, naomi, naomi2, ROT0, "Sega", "Soul Surfer (Rev A)", GAME_FLAGS ) |
| 7815 | 7859 | /* 0106 */ GAME( 2002, vf4evoct, naomi2, naomi2m1, naomi, vf4evoct, ROT0, "Sega", "Virtua Fighter 4 Evolution (Cartridge)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS ) |
| 7816 | 7860 | // 0129 Club Kart Prize |
| 7817 | 7861 | |
| r14521 | r14522 | |
| 7904 | 7948 | // 0032A Initial D Arcade Stage Ver. 3 (Japan) (Rev A) |
| 7905 | 7949 | /* 0032B */ GAME( 2004, initdv3jb, initdv3j, naomigd, naomi, naomi2, ROT0, "Sega", "Initial D Arcade Stage Ver. 3 (Japan) (Rev. B) (GDS-0032B)", GAME_FLAGS ) |
| 7906 | 7950 | /* 0032C */ GAME( 2004, initdv3j, naomi2, naomi2gd,naomi, naomi2, ROT0, "Sega", "Initial D Arcade Stage Ver. 3 (Japan) (Rev. C) (GDS-0032C)", GAME_FLAGS ) |
| 7907 | | // 0033 Initial D Arcade Stage Ver. 3 (Export) |
| 7951 | /* 0033 */ GAME( 2004, initdv3e, naomi2, naomi2gd,naomi, naomi2, ROT0, "Sega", "Initial D Arcade Stage Ver. 3 (Export) (GDS-0033)", GAME_FLAGS ) |
| 7908 | 7952 | // 0034 |
| 7909 | 7953 | // 0035 |
| 7910 | 7954 | // 0036 Virtua Fighter 4 Final Tuned |
src/mame/drivers/ddragon.c
| r14521 | r14522 | |
| 1489 | 1489 | |
| 1490 | 1490 | ROM_START( ddragonb2 ) |
| 1491 | 1491 | ROM_REGION( 0x30000, "maincpu", 0 ) /* 64k for code + bankswitched memory */ |
| 1492 | | ROM_LOAD( "4.bin", 0x08000, 0x08000, CRC(668dfa19) SHA1(9b2ff1b66eeba0989e4ed850b7df1f5719ba5572) ) |
| 1493 | | ROM_LOAD( "5.bin", 0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */ |
| 1494 | | ROM_LOAD( "6.bin", 0x18000, 0x08000, CRC(3bdea613) SHA1(d9038c80646a6ce3ea61da222873237b0383680e) ) /* banked at 0x4000-0x8000 */ |
| 1495 | | ROM_LOAD( "7.bin", 0x20000, 0x08000, CRC(728f87b9) SHA1(d7442be24d41bb9fc021587ef44ae5b830e4503d) ) /* banked at 0x4000-0x8000 */ |
| 1492 | ROM_LOAD( "b2_4.bin", 0x08000, 0x08000, CRC(668dfa19) SHA1(9b2ff1b66eeba0989e4ed850b7df1f5719ba5572) ) |
| 1493 | ROM_LOAD( "b2_5.bin", 0x10000, 0x08000, CRC(5779705e) SHA1(4b8f22225d10f5414253ce0383bbebd6f720f3af) ) /* banked at 0x4000-0x8000 */ |
| 1494 | ROM_LOAD( "b2_6.bin", 0x18000, 0x08000, CRC(3bdea613) SHA1(d9038c80646a6ce3ea61da222873237b0383680e) ) /* banked at 0x4000-0x8000 */ |
| 1495 | ROM_LOAD( "b2_7.bin", 0x20000, 0x08000, CRC(728f87b9) SHA1(d7442be24d41bb9fc021587ef44ae5b830e4503d) ) /* banked at 0x4000-0x8000 */ |
| 1496 | 1496 | |
| 1497 | 1497 | ROM_REGION( 0x10000, "sub", 0 ) /* sprite cpu */ |
| 1498 | 1498 | ROM_LOAD( "63701.bin", 0xc000, 0x4000, CRC(f5232d03) SHA1(e2a194e38633592fd6587690b3cb2669d93985c7) ) |
| r14521 | r14522 | |
| 1501 | 1501 | ROM_LOAD( "b2_3.bin", 0x08000, 0x08000, CRC(9efa95bb) SHA1(da997d9cc7b9e7b2c70a4b6d30db693086a6f7d8) ) |
| 1502 | 1502 | |
| 1503 | 1503 | ROM_REGION( 0x08000, "gfx1", 0 ) |
| 1504 | | ROM_LOAD( "8.bin", 0x00000, 0x08000, CRC(7a8b8db4) SHA1(8368182234f9d4d763d4714fd7567a9e31b7ebeb) ) /* chars */ |
| 1504 | ROM_LOAD( "b2_8.bin", 0x00000, 0x08000, CRC(7a8b8db4) SHA1(8368182234f9d4d763d4714fd7567a9e31b7ebeb) ) /* chars */ |
| 1505 | 1505 | |
| 1506 | 1506 | ROM_REGION( 0x80000, "gfx2", 0 ) |
| 1507 | 1507 | ROM_LOAD( "11.bin", 0x00000, 0x10000, CRC(574face3) SHA1(481fe574cb79d0159a65ff7486cbc945d50538c5) ) /* sprites */ |
| r14521 | r14522 | |
| 1537 | 1537 | */ |
| 1538 | 1538 | ROM_START( ddragon6809 ) |
| 1539 | 1539 | ROM_REGION( 0x30000, "maincpu", 0 ) /* 64k for code + bankswitched memory */ |
| 1540 | | ROM_LOAD( "16.bin", 0x08000, 0x08000, CRC(f4c72690) SHA1(c70d032355acf3f7f6586b6e57a94f80e099bf1a) ) |
| 1541 | | ROM_LOAD( "17.bin", 0x10000, 0x08000, CRC(6489d637) SHA1(fd17fd870e9386a3e3bdd56c8d731c73d8c70b88) ) /* banked at 0x4000-0x8000 */ |
| 1542 | | ROM_LOAD( "18.bin", 0x18000, 0x08000, CRC(154d50c4) SHA1(4ffdd29406b6c6b552344f820f83715b1c7727d1) ) /* banked at 0x4000-0x8000 */ |
| 1543 | | ROM_LOAD( "19.bin", 0x20000, 0x08000, CRC(090e2baf) SHA1(29b775c59c7a4d30a33e3d10e736cd1a83baf3bb) ) /* banked at 0x4000-0x8000 */ |
| 1540 | ROM_LOAD( "6809_16.bin", 0x08000, 0x08000, CRC(f4c72690) SHA1(c70d032355acf3f7f6586b6e57a94f80e099bf1a) ) |
| 1541 | ROM_LOAD( "6809_17.bin", 0x10000, 0x08000, CRC(6489d637) SHA1(fd17fd870e9386a3e3bdd56c8d731c73d8c70b88) ) /* banked at 0x4000-0x8000 */ |
| 1542 | ROM_LOAD( "6809_18.bin", 0x18000, 0x08000, CRC(154d50c4) SHA1(4ffdd29406b6c6b552344f820f83715b1c7727d1) ) /* banked at 0x4000-0x8000 */ |
| 1543 | ROM_LOAD( "6809_19.bin", 0x20000, 0x08000, CRC(090e2baf) SHA1(29b775c59c7a4d30a33e3d10e736cd1a83baf3bb) ) /* banked at 0x4000-0x8000 */ |
| 1544 | 1544 | |
| 1545 | 1545 | ROM_REGION( 0x10000, "sub", 0 ) /* sprite cpu */ |
| 1546 | | ROM_LOAD( "20.bin", 0x8000, 0x8000, CRC(67e3b4f1) SHA1(4945d76b0694299f2f4739ebfba98da6d96fe4cb) ) |
| 1546 | ROM_LOAD( "6809_20.bin", 0x8000, 0x8000, CRC(67e3b4f1) SHA1(4945d76b0694299f2f4739ebfba98da6d96fe4cb) ) |
| 1547 | 1547 | |
| 1548 | 1548 | ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */ |
| 1549 | 1549 | ROM_LOAD( "21.bin", 0x08000, 0x08000, CRC(4437fc51) SHA1(fffcf2bec50d0b79861904b4abc607206b7794e6) ) |
| r14521 | r14522 | |
| 1552 | 1552 | ROM_REGION( 0x08000, "gfx1", ROMREGION_ERASEFF ) |
| 1553 | 1553 | |
| 1554 | 1554 | ROM_REGION( 0x08000, "chars", 0 ) |
| 1555 | | ROM_LOAD( "13.bin", 0x00000, 0x08000, CRC(b5a54537) SHA1(a6157cde4f9738565008d11a4a6d8576ae3abfef) ) /* chars */ |
| 1555 | ROM_LOAD( "6809_13.bin", 0x00000, 0x08000, CRC(b5a54537) SHA1(a6157cde4f9738565008d11a4a6d8576ae3abfef) ) /* chars */ |
| 1556 | 1556 | |
| 1557 | 1557 | ROM_REGION( 0x80000, "gfx2", 0 ) |
| 1558 | 1558 | ROM_LOAD( "22.bin", 0x00000, 0x08000, CRC(fe08ef61) SHA1(50404936934dc61f3553add4d4b918529b3b5ef3) ) |
| r14521 | r14522 | |
| 1564 | 1564 | ROM_LOAD( "28.bin", 0x30000, 0x08000, CRC(51b8a217) SHA1(60c067cd7272f856e29cdb64312535236656891a) ) |
| 1565 | 1565 | ROM_LOAD( "29.bin", 0x38000, 0x08000, CRC(e4ec2394) SHA1(43376ce2a07c1fc3053f7ac9b750e944d289105b) ) |
| 1566 | 1566 | ROM_LOAD( "6809_1.bin", 0x40000, 0x08000, CRC(2485a71d) SHA1(3e987a2f3e9a59da5fdc7bb779a43736ca67aac7) ) |
| 1567 | | ROM_LOAD( "2.bin", 0x48000, 0x08000, CRC(6940120d) SHA1(bbe94f095ef983f54658c936f916ba6a72a84ead) ) |
| 1568 | | ROM_LOAD( "3.bin", 0x50000, 0x08000, CRC(c67aac12) SHA1(aab535507e3889bf1bdc2f4fe4828a70a350ba63) ) |
| 1569 | | ROM_LOAD( "4.bin", 0x58000, 0x08000, CRC(941dcd08) SHA1(266dee264f28affe8c3f57fe569929817ae16508) ) |
| 1570 | | ROM_LOAD( "5.bin", 0x60000, 0x08000, CRC(42d36bc3) SHA1(080cbc3ffda8ab26dc65a8e9eaf948c509d064b3) ) |
| 1571 | | ROM_LOAD( "6.bin", 0x68000, 0x08000, CRC(d5d19a8d) SHA1(c4b044dd12d6468c0ad114644f01813d4fe9a673) ) |
| 1572 | | ROM_LOAD( "7.bin", 0x70000, 0x08000, CRC(d4e350cd) SHA1(78ed2baa8c52b766f998091e7ce9e1a2941352e7) ) |
| 1573 | | ROM_LOAD( "8.bin", 0x78000, 0x08000, CRC(204fdb7d) SHA1(f75b1bc6f65e7a33927cd451267fcd7e2aa44f7e) ) |
| 1567 | ROM_LOAD( "6809_2.bin", 0x48000, 0x08000, CRC(6940120d) SHA1(bbe94f095ef983f54658c936f916ba6a72a84ead) ) |
| 1568 | ROM_LOAD( "6809_3.bin", 0x50000, 0x08000, CRC(c67aac12) SHA1(aab535507e3889bf1bdc2f4fe4828a70a350ba63) ) |
| 1569 | ROM_LOAD( "6809_4.bin", 0x58000, 0x08000, CRC(941dcd08) SHA1(266dee264f28affe8c3f57fe569929817ae16508) ) |
| 1570 | ROM_LOAD( "6809_5.bin", 0x60000, 0x08000, CRC(42d36bc3) SHA1(080cbc3ffda8ab26dc65a8e9eaf948c509d064b3) ) |
| 1571 | ROM_LOAD( "6809_6.bin", 0x68000, 0x08000, CRC(d5d19a8d) SHA1(c4b044dd12d6468c0ad114644f01813d4fe9a673) ) |
| 1572 | ROM_LOAD( "6809_7.bin", 0x70000, 0x08000, CRC(d4e350cd) SHA1(78ed2baa8c52b766f998091e7ce9e1a2941352e7) ) |
| 1573 | ROM_LOAD( "6809_8.bin", 0x78000, 0x08000, CRC(204fdb7d) SHA1(f75b1bc6f65e7a33927cd451267fcd7e2aa44f7e) ) |
| 1574 | 1574 | |
| 1575 | 1575 | ROM_REGION( 0x40000, "gfx3", 0 ) |
| 1576 | | ROM_LOAD( "9.bin", 0x00000, 0x10000, CRC(736eff0f) SHA1(ae2ec2d5c8ab1db579a08256d874426dc5d889c6) ) |
| 1576 | ROM_LOAD( "6809_9.bin", 0x00000, 0x10000, CRC(736eff0f) SHA1(ae2ec2d5c8ab1db579a08256d874426dc5d889c6) ) |
| 1577 | 1577 | ROM_LOAD( "6809_10.bin", 0x10000, 0x10000, CRC(a670d088) SHA1(27e7b49645753dd039f104c3e0a7e6513a98710d) ) |
| 1578 | | ROM_LOAD( "11.bin", 0x20000, 0x10000, CRC(4171b70d) SHA1(dc300c9bca6481417e97ad03c973e47389f261c1) ) |
| 1579 | | ROM_LOAD( "12.bin", 0x30000, 0x10000, CRC(5f6a6d6f) SHA1(7d546a226cda81c28e7ccfb4c5daebc65072198d) ) |
| 1578 | ROM_LOAD( "6809_11.bin", 0x20000, 0x10000, CRC(4171b70d) SHA1(dc300c9bca6481417e97ad03c973e47389f261c1) ) |
| 1579 | ROM_LOAD( "6809_12.bin", 0x30000, 0x10000, CRC(5f6a6d6f) SHA1(7d546a226cda81c28e7ccfb4c5daebc65072198d) ) |
| 1580 | 1580 | |
| 1581 | 1581 | ROM_REGION( 0x20000, "adpcm", 0 ) /* adpcm samples */ |
| 1582 | | ROM_LOAD( "14.bin", 0x00000, 0x08000, CRC(678f8657) SHA1(2652fdc6719d2c889ca87802f6e2cefae59fc2eb) ) |
| 1583 | | ROM_LOAD( "15.bin", 0x10000, 0x08000, CRC(10f21dea) SHA1(739cf649f91490384297a81a2cc9855acb58a1c0) ) |
| 1582 | ROM_LOAD( "6809_14.bin", 0x00000, 0x08000, CRC(678f8657) SHA1(2652fdc6719d2c889ca87802f6e2cefae59fc2eb) ) |
| 1583 | ROM_LOAD( "6809_15.bin", 0x10000, 0x08000, CRC(10f21dea) SHA1(739cf649f91490384297a81a2cc9855acb58a1c0) ) |
| 1584 | 1584 | ROM_END |
| 1585 | 1585 | |
| 1586 | 1586 | /* |
src/mame/drivers/cps1.c
| r14521 | r14522 | |
| 10147 | 10147 | |
| 10148 | 10148 | ROM_REGION( 0x800000, "gfx", 0 ) |
| 10149 | 10149 | ROMX_LOAD( "rcm_01.3a", 0x000000, 0x80000, CRC(6ecdf13f) SHA1(2a8fe06bf5011e3f990f90d9224f91d8631ec0cc) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10150 | | ROMX_LOAD( "rcm_03.5a", 0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10151 | | ROMX_LOAD( "rcm_02.4a", 0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10150 | ROMX_LOAD( "rcm_02.4a", 0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) ) // Dumped as rcm_03.5a |
| 10151 | ROMX_LOAD( "rcm_03.5a", 0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) ) // Dumped as rcm_02.4a |
| 10152 | 10152 | ROMX_LOAD( "rcm_04.6a", 0x000006, 0x80000, CRC(54e622ff) SHA1(36f6297e3d410f041be5e582919478b0d52520ca) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10153 | 10153 | ROMX_LOAD( "rcm_05.7a", 0x200000, 0x80000, CRC(5dd131fd) SHA1(1a7fc8cf38901245d40901996e946e7ad9c0e0c5) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10154 | | ROMX_LOAD( "rcm_07.9a", 0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10155 | | ROMX_LOAD( "rcm_06.8a", 0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10154 | ROMX_LOAD( "rcm_06.8a", 0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) ) // Dumped as rcm_07.9a |
| 10155 | ROMX_LOAD( "rcm_07.9a", 0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) ) // Dumped as rcm_06.8a |
| 10156 | 10156 | ROMX_LOAD( "rcm_08.10a", 0x200006, 0x80000, CRC(fbff64cf) SHA1(f0cb531ef195dc1dcd224a208906a62fb5d199a1) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10157 | 10157 | ROMX_LOAD( "rcm_10.3c", 0x400000, 0x80000, CRC(4dc8ada9) SHA1(776c2b3ef24c2b8f390c05a9c6728b14ceec696e) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10158 | | ROMX_LOAD( "rcm_12.5c", 0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10159 | | ROMX_LOAD( "rcm_11.4c", 0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10158 | ROMX_LOAD( "rcm_11.4c", 0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) ) // Dumped as rcm_12.5c |
| 10159 | ROMX_LOAD( "rcm_12.5c", 0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) ) // Dumped as rcm_11.4c |
| 10160 | 10160 | ROMX_LOAD( "rcm_13.6c", 0x400006, 0x80000, CRC(5069d4a9) SHA1(b832b98be94371af52bd4bb911e18ec57430a7db) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10161 | 10161 | ROMX_LOAD( "rcm_14.7c", 0x600000, 0x80000, CRC(303be3bd) SHA1(1e5c3fd71966ea9f457840c40582795b501c323e) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10162 | | ROMX_LOAD( "rcm_16.9c", 0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10163 | | ROMX_LOAD( "rcm_15.8c", 0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10162 | ROMX_LOAD( "rcm_15.8c", 0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) ) // Dumped as rcm_16_9c |
| 10163 | ROMX_LOAD( "rcm_16.9c", 0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) ) // Dumped as rcm_15_8c |
| 10164 | 10164 | ROMX_LOAD( "rcm_17.10c", 0x600006, 0x80000, CRC(92371042) SHA1(c55833cbaddcc986edd23c009a3e3c7ff09c2708) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10165 | 10165 | |
| 10166 | 10166 | ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ |
| r14521 | r14522 | |
| 10197 | 10197 | |
| 10198 | 10198 | ROM_REGION( 0x800000, "gfx", 0 ) |
| 10199 | 10199 | ROMX_LOAD( "rcm_01.3a", 0x000000, 0x80000, CRC(6ecdf13f) SHA1(2a8fe06bf5011e3f990f90d9224f91d8631ec0cc) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10200 | | ROMX_LOAD( "rcm_02.4a", 0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_03.5a |
| 10201 | | ROMX_LOAD( "rcm_03.5a", 0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_02.4a |
| 10200 | ROMX_LOAD( "rcm_02.4a", 0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10201 | ROMX_LOAD( "rcm_03.5a", 0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10202 | 10202 | ROMX_LOAD( "rcm_04.6a", 0x000006, 0x80000, CRC(54e622ff) SHA1(36f6297e3d410f041be5e582919478b0d52520ca) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10203 | 10203 | ROMX_LOAD( "rcm_05.7a", 0x200000, 0x80000, CRC(5dd131fd) SHA1(1a7fc8cf38901245d40901996e946e7ad9c0e0c5) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10204 | | ROMX_LOAD( "rcm_06.8a", 0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_07.9a |
| 10205 | | ROMX_LOAD( "rcm_07.9a", 0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_06.8a |
| 10204 | ROMX_LOAD( "rcm_06.8a", 0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10205 | ROMX_LOAD( "rcm_07.9a", 0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10206 | 10206 | ROMX_LOAD( "rcm_08.10a", 0x200006, 0x80000, CRC(fbff64cf) SHA1(f0cb531ef195dc1dcd224a208906a62fb5d199a1) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10207 | 10207 | ROMX_LOAD( "rcm_10.3c", 0x400000, 0x80000, CRC(4dc8ada9) SHA1(776c2b3ef24c2b8f390c05a9c6728b14ceec696e) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10208 | | ROMX_LOAD( "rcm_11.4c", 0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_12.5c |
| 10209 | | ROMX_LOAD( "rcm_12.5c", 0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_11.4c |
| 10208 | ROMX_LOAD( "rcm_11.4c", 0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10209 | ROMX_LOAD( "rcm_12.5c", 0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10210 | 10210 | ROMX_LOAD( "rcm_13.6c", 0x400006, 0x80000, CRC(5069d4a9) SHA1(b832b98be94371af52bd4bb911e18ec57430a7db) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10211 | 10211 | ROMX_LOAD( "rcm_14.7c", 0x600000, 0x80000, CRC(303be3bd) SHA1(1e5c3fd71966ea9f457840c40582795b501c323e) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10212 | | ROMX_LOAD( "rcm_15.8c", 0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_16.9c |
| 10213 | | ROMX_LOAD( "rcm_16.9c", 0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_15.8c |
| 10212 | ROMX_LOAD( "rcm_15.8c", 0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10213 | ROMX_LOAD( "rcm_16.9c", 0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10214 | 10214 | ROMX_LOAD( "rcm_17.10c", 0x600006, 0x80000, CRC(92371042) SHA1(c55833cbaddcc986edd23c009a3e3c7ff09c2708) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10215 | 10215 | |
| 10216 | 10216 | ROM_REGION( 0x28000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ |
| r14521 | r14522 | |
| 10247 | 10247 | |
| 10248 | 10248 | ROM_REGION( 0x800000, "gfx", 0 ) |
| 10249 | 10249 | ROMX_LOAD( "rcm_01.3a", 0x000000, 0x80000, CRC(6ecdf13f) SHA1(2a8fe06bf5011e3f990f90d9224f91d8631ec0cc) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10250 | | ROMX_LOAD( "rcm_02.4a", 0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_03.5a |
| 10251 | | ROMX_LOAD( "rcm_03.5a", 0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_02.4a |
| 10250 | ROMX_LOAD( "rcm_02.4a", 0x000002, 0x80000, CRC(944d4f0f) SHA1(665dc9a537e9c9b565f6136f939ff5c2861f875f) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10251 | ROMX_LOAD( "rcm_03.5a", 0x000004, 0x80000, CRC(36f3073c) SHA1(457d68e63599d06a136e152a9ad60adac1c91edd) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10252 | 10252 | ROMX_LOAD( "rcm_04.6a", 0x000006, 0x80000, CRC(54e622ff) SHA1(36f6297e3d410f041be5e582919478b0d52520ca) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10253 | 10253 | ROMX_LOAD( "rcm_05.7a", 0x200000, 0x80000, CRC(5dd131fd) SHA1(1a7fc8cf38901245d40901996e946e7ad9c0e0c5) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10254 | | ROMX_LOAD( "rcm_06.8a", 0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_07.9a |
| 10255 | | ROMX_LOAD( "rcm_07.9a", 0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_06.8a |
| 10254 | ROMX_LOAD( "rcm_06.8a", 0x200002, 0x80000, CRC(f0faf813) SHA1(adff01c2ecc4c8ce6f8a50cbd07d8f8bb9f48168) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10255 | ROMX_LOAD( "rcm_07.9a", 0x200004, 0x80000, CRC(826de013) SHA1(47f36b1d92a487c43c8dadc8293b8e6f40649286) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10256 | 10256 | ROMX_LOAD( "rcm_08.10a", 0x200006, 0x80000, CRC(fbff64cf) SHA1(f0cb531ef195dc1dcd224a208906a62fb5d199a1) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10257 | 10257 | ROMX_LOAD( "rcm_10.3c", 0x400000, 0x80000, CRC(4dc8ada9) SHA1(776c2b3ef24c2b8f390c05a9c6728b14ceec696e) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10258 | | ROMX_LOAD( "rcm_11.4c", 0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_12.5c |
| 10259 | | ROMX_LOAD( "rcm_12.5c", 0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_11.4c |
| 10258 | ROMX_LOAD( "rcm_11.4c", 0x400002, 0x80000, CRC(f2b9ee06) SHA1(db315b00d1caed1a8c0f6e0ae726e8fa05b011fa) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10259 | ROMX_LOAD( "rcm_12.5c", 0x400004, 0x80000, CRC(fed5f203) SHA1(23db14490519b5e2d0bb92ffe6e14540d1999e4b) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10260 | 10260 | ROMX_LOAD( "rcm_13.6c", 0x400006, 0x80000, CRC(5069d4a9) SHA1(b832b98be94371af52bd4bb911e18ec57430a7db) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10261 | 10261 | ROMX_LOAD( "rcm_14.7c", 0x600000, 0x80000, CRC(303be3bd) SHA1(1e5c3fd71966ea9f457840c40582795b501c323e) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10262 | | ROMX_LOAD( "rcm_15.8c", 0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_16.9c |
| 10263 | | ROMX_LOAD( "rcm_16.9c", 0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) ) // == rcm_15.8c |
| 10262 | ROMX_LOAD( "rcm_15.8c", 0x600002, 0x80000, CRC(4f2d372f) SHA1(db6a94d1f92c1b96e404b38ebcb1eedbec3ae6cc) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10263 | ROMX_LOAD( "rcm_16.9c", 0x600004, 0x80000, CRC(93d97fde) SHA1(e4be5216f98ad08a9118d629d398be2bd54e2e2a) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10264 | 10264 | ROMX_LOAD( "rcm_17.10c", 0x600006, 0x80000, CRC(92371042) SHA1(c55833cbaddcc986edd23c009a3e3c7ff09c2708) , ROM_GROUPWORD | ROM_SKIP(6) ) |
| 10265 | 10265 | |
| 10266 | 10266 | ROM_REGION( 0x28000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ |
src/mame/drivers/pacman.c
| r14521 | r14522 | |
| 3635 | 3635 | |
| 3636 | 3636 | ROM_START( popeyeman ) |
| 3637 | 3637 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 3638 | | ROM_LOAD( "1.6e", 0x0000, 0x0800, CRC(9d027c4a) SHA1(88e094880057451a75cdc2ce9477403021813982) ) |
| 3639 | | ROM_LOAD( "5.6k", 0x0800, 0x0800, CRC(194c7189) SHA1(fd423bac2810015313841c7b935054565390fbd0) ) |
| 3640 | | ROM_LOAD( "2.6f", 0x1000, 0x0800, CRC(5ba228bb) SHA1(b0e902cdf98bee72d6ec8069eec96adce3245074) ) |
| 3641 | | ROM_LOAD( "6.6m", 0x1800, 0x0800, CRC(baf5461e) SHA1(754586a6449fd54a342f260e572c1cd60ab70815) ) |
| 3642 | | ROM_LOAD( "3.6h", 0x2000, 0x0800, CRC(08419c4a) SHA1(7e5001adad401080c788737c1d2349f218750442) ) |
| 3643 | | ROM_LOAD( "7.6n", 0x2800, 0x0800, CRC(ab74b51f) SHA1(1bce8933ed7807eb7aca9670df8994f8d1a8b5b7) ) |
| 3644 | | ROM_LOAD( "4.6j", 0x3000, 0x0800, CRC(5039b082) SHA1(086a6ac4742734167d283b1121fce29d8ac4a6cd) ) |
| 3645 | | ROM_LOAD( "8.6p", 0x3800, 0x0800, CRC(931770d7) SHA1(78fcf88e07ec5126c12c3297b62ca388809e947c) ) |
| 3638 | ROM_LOAD( "pop1.6e", 0x0000, 0x0800, CRC(9d027c4a) SHA1(88e094880057451a75cdc2ce9477403021813982) ) |
| 3639 | ROM_LOAD( "pop5.6k", 0x0800, 0x0800, CRC(194c7189) SHA1(fd423bac2810015313841c7b935054565390fbd0) ) |
| 3640 | ROM_LOAD( "pop2.6f", 0x1000, 0x0800, CRC(5ba228bb) SHA1(b0e902cdf98bee72d6ec8069eec96adce3245074) ) |
| 3641 | ROM_LOAD( "pop6.6m", 0x1800, 0x0800, CRC(baf5461e) SHA1(754586a6449fd54a342f260e572c1cd60ab70815) ) |
| 3642 | ROM_LOAD( "pop3.6h", 0x2000, 0x0800, CRC(08419c4a) SHA1(7e5001adad401080c788737c1d2349f218750442) ) |
| 3643 | ROM_LOAD( "pop7.6n", 0x2800, 0x0800, CRC(ab74b51f) SHA1(1bce8933ed7807eb7aca9670df8994f8d1a8b5b7) ) |
| 3644 | ROM_LOAD( "pop4.6j", 0x3000, 0x0800, CRC(5039b082) SHA1(086a6ac4742734167d283b1121fce29d8ac4a6cd) ) |
| 3645 | ROM_LOAD( "pop8.6p", 0x3800, 0x0800, CRC(931770d7) SHA1(78fcf88e07ec5126c12c3297b62ca388809e947c) ) |
| 3646 | 3646 | |
| 3647 | 3647 | ROM_REGION( 0x2000, "gfx1", 0 ) |
| 3648 | | ROM_LOAD( "9.5e", 0x0000, 0x0800, CRC(b569c4c1) SHA1(34a09bcb6eb08375cd5e9ce0aa66b23d60489f92) ) |
| 3649 | | ROM_LOAD( "11.5h", 0x0800, 0x0800, CRC(3591b89d) SHA1(79bb456be6c39c1ccd7d077fbe181523131fb300) ) |
| 3650 | | ROM_LOAD( "10.5f", 0x1000, 0x0800, CRC(014fb5a4) SHA1(7779f0f0d11027adf3b9175af26d53f1e3a54f29) ) |
| 3651 | | ROM_LOAD( "12.5j", 0x1800, 0x0800, CRC(21b91c64) SHA1(4818194ecc18b5df159f3799ea93c911fd4b9556) ) |
| 3648 | ROM_LOAD( "pop9.5e", 0x0000, 0x0800, CRC(b569c4c1) SHA1(34a09bcb6eb08375cd5e9ce0aa66b23d60489f92) ) |
| 3649 | ROM_LOAD( "pop11.5h", 0x0800, 0x0800, CRC(3591b89d) SHA1(79bb456be6c39c1ccd7d077fbe181523131fb300) ) |
| 3650 | ROM_LOAD( "pop10.5f", 0x1000, 0x0800, CRC(014fb5a4) SHA1(7779f0f0d11027adf3b9175af26d53f1e3a54f29) ) |
| 3651 | ROM_LOAD( "pop12.5j", 0x1800, 0x0800, CRC(21b91c64) SHA1(4818194ecc18b5df159f3799ea93c911fd4b9556) ) |
| 3652 | 3652 | |
| 3653 | 3653 | ROM_REGION( 0x0120, "proms", 0 ) |
| 3654 | 3654 | ROM_LOAD( "82s123.7f", 0x0000, 0x0020, CRC(2fc650bd) SHA1(8d0268dee78e47c712202b0ec4f1f51109b1f2a5) ) |
| r14521 | r14522 | |
| 3731 | 3731 | |
| 3732 | 3732 | ROM_START( pacheart ) |
| 3733 | 3733 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 3734 | | ROM_LOAD( "1.6e", 0x0000, 0x0800, CRC(d844b679) SHA1(c4486198b3126bb8e05a308c53787e51065f77ae) ) |
| 3734 | ROM_LOAD( "pacheart1.6e", 0x0000, 0x0800, CRC(d844b679) SHA1(c4486198b3126bb8e05a308c53787e51065f77ae) ) |
| 3735 | 3735 | ROM_LOAD( "pacheart.pg2", 0x0800, 0x0800, CRC(b9152a38) SHA1(b6be2cb6bc7dd123503eb6bf1165dd1c99456813) ) |
| 3736 | | ROM_LOAD( "2.6f", 0x1000, 0x0800, CRC(7d177853) SHA1(9b5ddaaa8b564654f97af193dbcc29f81f230a25) ) |
| 3736 | ROM_LOAD( "pacheart2.6f", 0x1000, 0x0800, CRC(7d177853) SHA1(9b5ddaaa8b564654f97af193dbcc29f81f230a25) ) |
| 3737 | 3737 | ROM_LOAD( "pacheart.pg4", 0x1800, 0x0800, CRC(842d6574) SHA1(40e32d09cc8d701eb318716493a68cf3f95d3d6d) ) |
| 3738 | | ROM_LOAD( "3.6h", 0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) ) |
| 3739 | | ROM_LOAD( "7.6n", 0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) ) |
| 3738 | ROM_LOAD( "pacheart3.6h", 0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) ) |
| 3739 | ROM_LOAD( "pacheart7.6n", 0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) ) |
| 3740 | 3740 | ROM_LOAD( "pacheart.pg7", 0x3000, 0x0800, CRC(f5265c10) SHA1(9a320790d7a03fd6192a92d30b3e9c754bbc6a9d) ) |
| 3741 | 3741 | ROM_LOAD( "pacheart.pg8", 0x3800, 0x0800, CRC(1a21a381) SHA1(d5367a327d19fb57ba5e484bd4fda1b10953c040) ) |
| 3742 | 3742 | |
| r14521 | r14522 | |
| 3757 | 3757 | |
| 3758 | 3758 | ROM_START( bucaner ) |
| 3759 | 3759 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 3760 | | ROM_LOAD( "1.6e", 0x0000, 0x0800, CRC(2c0fa0ab) SHA1(37680e4502771ae69d51d07ce43f65b9b2dd2a49) ) |
| 3761 | | ROM_LOAD( "5.6k", 0x0800, 0x0800, CRC(afeca2f1) SHA1(1e6d6c75eeb3a354ce2dc88da62caf9e7d53d0cb) ) |
| 3762 | | ROM_LOAD( "2.6f", 0x1000, 0x0800, CRC(6b53ada9) SHA1(a905688b389bfbc6792965d8f3d5bb1b9f0f4ec6) ) |
| 3763 | | ROM_LOAD( "6.6m", 0x1800, 0x0800, CRC(35f3ca84) SHA1(3da7336caa0742ea79f1e0e8f6b80f8560507a33) ) |
| 3764 | | ROM_LOAD( "3.6h", 0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) ) |
| 3765 | | ROM_LOAD( "7.6n", 0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) ) |
| 3766 | | ROM_LOAD( "4.6j", 0x3000, 0x0800, CRC(292de161) SHA1(09b439c301d7bedb76c1590e937e9d8d5e24a048) ) |
| 3767 | | ROM_LOAD( "8.6p", 0x3800, 0x0800, CRC(884af858) SHA1(bad8b0dfdaf221dff0f84928f20873b01a168be5) ) |
| 3760 | ROM_LOAD( "buc1.6e", 0x0000, 0x0800, CRC(2c0fa0ab) SHA1(37680e4502771ae69d51d07ce43f65b9b2dd2a49) ) |
| 3761 | ROM_LOAD( "buc5.6k", 0x0800, 0x0800, CRC(afeca2f1) SHA1(1e6d6c75eeb3a354ce2dc88da62caf9e7d53d0cb) ) |
| 3762 | ROM_LOAD( "buc2.6f", 0x1000, 0x0800, CRC(6b53ada9) SHA1(a905688b389bfbc6792965d8f3d5bb1b9f0f4ec6) ) |
| 3763 | ROM_LOAD( "buc6.6m", 0x1800, 0x0800, CRC(35f3ca84) SHA1(3da7336caa0742ea79f1e0e8f6b80f8560507a33) ) |
| 3764 | ROM_LOAD( "buc3.6h", 0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) ) |
| 3765 | ROM_LOAD( "buc7.6n", 0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) ) |
| 3766 | ROM_LOAD( "buc4.6j", 0x3000, 0x0800, CRC(292de161) SHA1(09b439c301d7bedb76c1590e937e9d8d5e24a048) ) |
| 3767 | ROM_LOAD( "buc8.6p", 0x3800, 0x0800, CRC(884af858) SHA1(bad8b0dfdaf221dff0f84928f20873b01a168be5) ) |
| 3768 | 3768 | |
| 3769 | 3769 | ROM_REGION( 0x2000, "gfx1", 0 ) |
| 3770 | | ROM_LOAD( "9.5e", 0x0000, 0x0800, CRC(4060c077) SHA1(78d4aa5243246f73533fc0886438dc1fa6f7ebe5) ) |
| 3771 | | ROM_LOAD( "11.5h", 0x0800, 0x0800, CRC(e3861283) SHA1(61cf8ed24902910e98438d9e2e2745f226ad2a13) ) |
| 3772 | | ROM_LOAD( "10.5f", 0x1000, 0x0800, CRC(09f66dec) SHA1(2d3649341fed19bac15ec274f7d747de46a3edb2) ) |
| 3773 | | ROM_LOAD( "12.5j", 0x1800, 0x0800, CRC(653314e7) SHA1(c466a421917b3502e9115ebda1b2d11f7f586de8) ) |
| 3770 | ROM_LOAD( "buc9.5e", 0x0000, 0x0800, CRC(4060c077) SHA1(78d4aa5243246f73533fc0886438dc1fa6f7ebe5) ) |
| 3771 | ROM_LOAD( "buc11.5h", 0x0800, 0x0800, CRC(e3861283) SHA1(61cf8ed24902910e98438d9e2e2745f226ad2a13) ) |
| 3772 | ROM_LOAD( "buc10.5f", 0x1000, 0x0800, CRC(09f66dec) SHA1(2d3649341fed19bac15ec274f7d747de46a3edb2) ) |
| 3773 | ROM_LOAD( "buc12.5j", 0x1800, 0x0800, CRC(653314e7) SHA1(c466a421917b3502e9115ebda1b2d11f7f586de8) ) |
| 3774 | 3774 | |
| 3775 | 3775 | ROM_REGION( 0x0120, "proms", 0 ) |
| 3776 | 3776 | ROM_LOAD( "82s123.7f", 0x0000, 0x0020, CRC(2fc650bd) SHA1(8d0268dee78e47c712202b0ec4f1f51109b1f2a5) ) |
| r14521 | r14522 | |
| 3783 | 3783 | |
| 3784 | 3784 | ROM_START( joyman ) |
| 3785 | 3785 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 3786 | | ROM_LOAD( "1.6e", 0x0000, 0x0800, CRC(d844b679) SHA1(c4486198b3126bb8e05a308c53787e51065f77ae) ) |
| 3787 | | ROM_LOAD( "5.6k", 0x0800, 0x0800, CRC(ab9c8f29) SHA1(3753b8609c30d85d89acf745cf9303b77be440fd) ) |
| 3788 | | ROM_LOAD( "2.6f", 0x1000, 0x0800, CRC(7d177853) SHA1(9b5ddaaa8b564654f97af193dbcc29f81f230a25) ) |
| 3789 | | ROM_LOAD( "6.6m", 0x1800, 0x0800, CRC(b3c8d32e) SHA1(8b336fca1300820308cd5c4efc60bf2ba4199302) ) |
| 3790 | | ROM_LOAD( "3.6h", 0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) ) |
| 3791 | | ROM_LOAD( "7.6n", 0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) ) |
| 3792 | | ROM_LOAD( "4.6j", 0x3000, 0x0800, CRC(00b553f8) SHA1(57f2e4a6da9f00935fead447b2123a8b95e5d672) ) |
| 3793 | | ROM_LOAD( "8.6p", 0x3800, 0x0800, CRC(5d5ce992) SHA1(ced7ed39cfc7ec7b2c0459e275577976109ee82f) ) |
| 3786 | ROM_LOAD( "joy1.6e", 0x0000, 0x0800, CRC(d844b679) SHA1(c4486198b3126bb8e05a308c53787e51065f77ae) ) |
| 3787 | ROM_LOAD( "joy5.6k", 0x0800, 0x0800, CRC(ab9c8f29) SHA1(3753b8609c30d85d89acf745cf9303b77be440fd) ) |
| 3788 | ROM_LOAD( "joy2.6f", 0x1000, 0x0800, CRC(7d177853) SHA1(9b5ddaaa8b564654f97af193dbcc29f81f230a25) ) |
| 3789 | ROM_LOAD( "joy6.6m", 0x1800, 0x0800, CRC(b3c8d32e) SHA1(8b336fca1300820308cd5c4efc60bf2ba4199302) ) |
| 3790 | ROM_LOAD( "joy3.6h", 0x2000, 0x0800, CRC(9045a44c) SHA1(a97d7016effbd2ace9a7d92ceb04a6ce18fb42f9) ) |
| 3791 | ROM_LOAD( "joy7.6n", 0x2800, 0x0800, CRC(888f3c3e) SHA1(c2b5917bf13071131dd53ea76f0da86706db2d80) ) |
| 3792 | ROM_LOAD( "joy4.6j", 0x3000, 0x0800, CRC(00b553f8) SHA1(57f2e4a6da9f00935fead447b2123a8b95e5d672) ) |
| 3793 | ROM_LOAD( "joy8.6p", 0x3800, 0x0800, CRC(5d5ce992) SHA1(ced7ed39cfc7ec7b2c0459e275577976109ee82f) ) |
| 3794 | 3794 | |
| 3795 | 3795 | ROM_REGION( 0x2000, "gfx1", 0 ) |
| 3796 | | ROM_LOAD( "9.5e", 0x0000, 0x0800, CRC(39b557bc) SHA1(0f602ec84cb25fced89699e430b95b5ae93c83bd) ) |
| 3797 | | ROM_LOAD( "11.5h", 0x0800, 0x0800, CRC(33e0289e) SHA1(c1b910bdc61e560a8c34298deb11401f718e7330) ) |
| 3798 | | ROM_LOAD( "10.5f", 0x1000, 0x0800, CRC(338771a6) SHA1(7cd68cc428986255d0de29aae894900519e7fda5) ) |
| 3799 | | ROM_LOAD( "12.5j", 0x1800, 0x0800, CRC(f4f0add5) SHA1(d71c54ef55a755ec1316623d183b4f615ef7c055) ) |
| 3796 | ROM_LOAD( "joy9.5e", 0x0000, 0x0800, CRC(39b557bc) SHA1(0f602ec84cb25fced89699e430b95b5ae93c83bd) ) |
| 3797 | ROM_LOAD( "joy11.5h", 0x0800, 0x0800, CRC(33e0289e) SHA1(c1b910bdc61e560a8c34298deb11401f718e7330) ) |
| 3798 | ROM_LOAD( "joy10.5f", 0x1000, 0x0800, CRC(338771a6) SHA1(7cd68cc428986255d0de29aae894900519e7fda5) ) |
| 3799 | ROM_LOAD( "joy12.5j", 0x1800, 0x0800, CRC(f4f0add5) SHA1(d71c54ef55a755ec1316623d183b4f615ef7c055) ) |
| 3800 | 3800 | |
| 3801 | 3801 | ROM_REGION( 0x0120, "proms", 0 ) |
| 3802 | 3802 | ROM_LOAD( "82s123.7f", 0x0000, 0x0020, CRC(2fc650bd) SHA1(8d0268dee78e47c712202b0ec4f1f51109b1f2a5) ) |
| r14521 | r14522 | |
| 4598 | 4598 | roms marked with a comment were in the set but we're not using them */ |
| 4599 | 4599 | ROM_START( eyeszacb ) |
| 4600 | 4600 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 4601 | | /**/ROM_LOAD( "11.bin", 0x0000, 0x0800, CRC(69c1602a) SHA1(47b0935406b7ee2f414de58da1d4e81c6277a0c2) ) // "no diagnostics, bad custom??" (unused) |
| 4602 | | ROM_LOAD( "1.bin", 0x0000, 0x0800, CRC(a4a9d7a0) SHA1(f0b807d2fa347e50df52971aa7539a88f342bad6) ) |
| 4603 | | ROM_LOAD( "5.bin", 0x0800, 0x0800, CRC(c32b3f73) SHA1(80d2e987f0318b984e5c7c4d0b5faa262eebeca4) ) |
| 4604 | | ROM_LOAD( "2.bin", 0x1000, 0x0800, CRC(195b9473) SHA1(62eb16af38cc9004787dc55433ed3db11af44a4b) ) |
| 4605 | | ROM_LOAD( "6.bin", 0x1800, 0x0800, CRC(292886cb) SHA1(e77c3724c7cd8cd95014194ba4bb2f7e04afb0dd) ) |
| 4601 | ROM_LOAD( "zacb_11.bin", 0x0000, 0x0800, CRC(69c1602a) SHA1(47b0935406b7ee2f414de58da1d4e81c6277a0c2) ) // "no diagnostics, bad custom??" (unused) |
| 4602 | ROM_LOAD( "zacb_1.bin", 0x0000, 0x0800, CRC(a4a9d7a0) SHA1(f0b807d2fa347e50df52971aa7539a88f342bad6) ) |
| 4603 | ROM_LOAD( "zacb_5.bin", 0x0800, 0x0800, CRC(c32b3f73) SHA1(80d2e987f0318b984e5c7c4d0b5faa262eebeca4) ) |
| 4604 | ROM_LOAD( "zacb_2.bin", 0x1000, 0x0800, CRC(195b9473) SHA1(62eb16af38cc9004787dc55433ed3db11af44a4b) ) |
| 4605 | ROM_LOAD( "zacb_6.bin", 0x1800, 0x0800, CRC(292886cb) SHA1(e77c3724c7cd8cd95014194ba4bb2f7e04afb0dd) ) |
| 4606 | 4606 | // ROM_LOAD( "33.bin", 0x2000, 0x0800, CRC(df983e1d) SHA1(7c06fc69b7d0424f7b9348649d5587ff4d6dfc2d) ) // alt rom with copyright removed (unused) |
| 4607 | | ROM_LOAD( "3.bin", 0x2000, 0x0800, CRC(ff94b015) SHA1(6d8f43db3c98cadb35f70e3bff788e653dc132cd) ) |
| 4608 | | ROM_LOAD( "7.bin", 0x2800, 0x0800, CRC(9271c58c) SHA1(e6b8f1807c5852ae4e822d80719a4e8f8b036c31) ) |
| 4609 | | ROM_LOAD( "4.bin", 0x3000, 0x0800, CRC(965cf32b) SHA1(68cc573a24c74f2ab417d0330fc9523e77fda961) ) |
| 4610 | | ROM_LOAD( "8.bin", 0x3800, 0x0800, CRC(c254e92e) SHA1(023b45403ebc69c29516d77950dc69f05a1a130c) ) |
| 4607 | ROM_LOAD( "zacb_3.bin", 0x2000, 0x0800, CRC(ff94b015) SHA1(6d8f43db3c98cadb35f70e3bff788e653dc132cd) ) |
| 4608 | ROM_LOAD( "zacb_7.bin", 0x2800, 0x0800, CRC(9271c58c) SHA1(e6b8f1807c5852ae4e822d80719a4e8f8b036c31) ) |
| 4609 | ROM_LOAD( "zacb_4.bin", 0x3000, 0x0800, CRC(965cf32b) SHA1(68cc573a24c74f2ab417d0330fc9523e77fda961) ) |
| 4610 | ROM_LOAD( "zacb_8.bin", 0x3800, 0x0800, CRC(c254e92e) SHA1(023b45403ebc69c29516d77950dc69f05a1a130c) ) |
| 4611 | 4611 | |
| 4612 | 4612 | ROM_REGION( 0x2000, "gfx1", 0 ) |
| 4613 | 4613 | ROM_LOAD( "x.bin", 0x0000, 0x0800, CRC(59dce22e) SHA1(81eaef3e4d8299b5133b62d04460abfa519696f5) ) |
src/emu/sound/votrax.c
| r14521 | r14522 | |
| 1 | | /************************************************************************** |
| 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | Votrax SC-01 Emulator |
| 3 | votrax.c |
| 4 | 4 | |
| 5 | | Mike@Dissfulfils.co.uk |
| 5 | Hacked up votrax simulator that maps to samples, until a real one |
| 6 | is written. |
| 6 | 7 | |
| 7 | | ************************************************************************** |
| 8 | **************************************************************************** |
| 8 | 9 | |
| 9 | | DEVICE_START(votrax)- Start emulation, load samples from Votrax subdirectory |
| 10 | | votrax_w - Write data to votrax port |
| 11 | | votrax_status_r - Return busy status (-1 = busy) |
| 10 | Copyright Aaron Giles |
| 11 | All rights reserved. |
| 12 | 12 | |
| 13 | | If you need to alter the base frequency (i.e. Qbert) then just alter |
| 14 | | the variable VotraxBaseFrequency, this is defaulted to 8000 |
| 13 | Redistribution and use in source and binary forms, with or without |
| 14 | modification, are permitted provided that the following conditions are |
| 15 | met: |
| 15 | 16 | |
| 16 | | **************************************************************************/ |
| 17 | * Redistributions of source code must retain the above copyright |
| 18 | notice, this list of conditions and the following disclaimer. |
| 19 | * Redistributions in binary form must reproduce the above copyright |
| 20 | notice, this list of conditions and the following disclaimer in |
| 21 | the documentation and/or other materials provided with the |
| 22 | distribution. |
| 23 | * Neither the name 'MAME' nor the names of its contributors may be |
| 24 | used to endorse or promote products derived from this software |
| 25 | without specific prior written permission. |
| 17 | 26 | |
| 27 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR |
| 28 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 30 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, |
| 31 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 33 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 34 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 35 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 36 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 37 | POSSIBILITY OF SUCH DAMAGE. |
| 38 | |
| 39 | ***************************************************************************/ |
| 40 | |
| 18 | 41 | #include "emu.h" |
| 19 | | #include "samples.h" |
| 20 | 42 | #include "votrax.h" |
| 21 | 43 | |
| 22 | 44 | |
| 23 | | typedef struct _votrax_state votrax_state; |
| 24 | | struct _votrax_state |
| 25 | | { |
| 26 | | device_t *device; |
| 27 | | int stream; |
| 28 | | int frequency; /* Some games (Qbert) change this */ |
| 29 | | int volume; |
| 30 | | sound_stream * channel; |
| 31 | 45 | |
| 32 | | loaded_sample *sample; |
| 33 | | UINT32 pos; |
| 34 | | UINT32 frac; |
| 35 | | UINT32 step; |
| 46 | //************************************************************************** |
| 47 | // GLOBAL VARIABLES |
| 48 | //************************************************************************** |
| 36 | 49 | |
| 37 | | loaded_samples *samples; |
| 38 | | }; |
| 50 | // device type definition |
| 51 | const device_type VOTRAX = &device_creator<votrax_device>; |
| 39 | 52 | |
| 40 | | INLINE votrax_state *get_safe_token(device_t *device) |
| 53 | const char *const votrax_device::s_phoneme_table[64] = |
| 41 | 54 | { |
| 42 | | assert(device != NULL); |
| 43 | | assert(device->type() == VOTRAX); |
| 44 | | return (votrax_state *)downcast<legacy_device_base *>(device)->token(); |
| 45 | | } |
| 46 | | |
| 47 | | #define FRAC_BITS 24 |
| 48 | | #define FRAC_ONE (1 << FRAC_BITS) |
| 49 | | #define FRAC_MASK (FRAC_ONE - 1) |
| 50 | | |
| 51 | | |
| 52 | | /**************************************************************************** |
| 53 | | * 64 Phonemes - currently 1 sample per phoneme, will be combined sometime! |
| 54 | | ****************************************************************************/ |
| 55 | | |
| 56 | | static const char *const VotraxTable[65] = |
| 57 | | { |
| 58 | | "EH3","EH2","EH1","PA0","DT" ,"A1" ,"A2" ,"ZH", |
| 59 | | "AH2","I3" ,"I2" ,"I1" ,"M" ,"N" ,"B" ,"V", |
| 60 | | "CH" ,"SH" ,"Z" ,"AW1","NG" ,"AH1","OO1","OO", |
| 61 | | "L" ,"K" ,"J" ,"H" ,"G" ,"F" ,"D" ,"S", |
| 62 | | "A" ,"AY" ,"Y1" ,"UH3","AH" ,"P" ,"O" ,"I", |
| 63 | | "U" ,"Y" ,"T" ,"R" ,"E" ,"W" ,"AE" ,"AE1", |
| 64 | | "AW2","UH2","UH1","UH" ,"O2" ,"O1" ,"IU" ,"U1", |
| 65 | | "THV","TH" ,"ER" ,"EH" ,"E1" ,"AW" ,"PA1","STOP", |
| 66 | | 0 |
| 55 | "EH3", "EH2", "EH1", " "/*PA0*/"DT", "A1", "A2", "ZH", |
| 56 | "AH2", "I3", "I2", "I1", "M", "N", "B", "V", |
| 57 | "CH", "SH", "Z", "AW1", "NG", "AH1", "OO1", "OO", |
| 58 | "L", "K", "J", "H", "G", "F", "D", "S", |
| 59 | "A", "AY", "Y1", "UH3", "AH", "P", "O", "I", |
| 60 | "U", "Y", "T", "R", "E", "W", "AE", "AE1", |
| 61 | "AW2", "UH2", "UH1", "UH", "O2", "O1", "IU", "U1", |
| 62 | "THV", "TH", "ER", "EH", "E1", "AW", " "/*PA1*/, "."/*STOP*/ |
| 67 | 63 | }; |
| 68 | 64 | |
| 69 | | static STREAM_UPDATE( votrax_update_sound ) |
| 70 | | { |
| 71 | | votrax_state *info = (votrax_state*) param; |
| 72 | | stream_sample_t *buffer = outputs[0]; |
| 73 | 65 | |
| 74 | | if (info->sample) |
| 75 | | { |
| 76 | | /* load some info locally */ |
| 77 | | UINT32 pos = info->pos; |
| 78 | | UINT32 frac = info->frac; |
| 79 | | UINT32 step = info->step; |
| 80 | | UINT32 length = info->sample->length; |
| 81 | | INT16 *sample = info->sample->data; |
| 82 | 66 | |
| 83 | | while (length--) |
| 84 | | { |
| 85 | | /* do a linear interp on the sample */ |
| 86 | | INT32 sample1 = sample[pos]; |
| 87 | | INT32 sample2 = sample[(pos + 1) % length]; |
| 88 | | INT32 fracmult = frac >> (FRAC_BITS - 14); |
| 89 | | *buffer++ = ((0x4000 - fracmult) * sample1 + fracmult * sample2) >> 14; |
| 67 | //************************************************************************** |
| 68 | // LIVE DEVICE |
| 69 | //************************************************************************** |
| 90 | 70 | |
| 91 | | /* advance */ |
| 92 | | frac += step; |
| 93 | | pos += frac >> FRAC_BITS; |
| 94 | | frac = frac & ((1 << FRAC_BITS) - 1); |
| 71 | //------------------------------------------------- |
| 72 | // votrax_device - constructor |
| 73 | //------------------------------------------------- |
| 95 | 74 | |
| 96 | | /* handle looping/ending */ |
| 97 | | if (pos >= length) |
| 98 | | { |
| 99 | | info->sample = NULL; |
| 100 | | break; |
| 101 | | } |
| 102 | | } |
| 103 | | |
| 104 | | /* push position back out */ |
| 105 | | info->pos = pos; |
| 106 | | info->frac = frac; |
| 107 | | } |
| 75 | votrax_device::votrax_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 76 | : samples_device(mconfig, VOTRAX, "VOTRAX SC-01", tag, owner, clock) |
| 77 | { |
| 108 | 78 | } |
| 109 | 79 | |
| 110 | 80 | |
| 111 | | static DEVICE_START( votrax ) |
| 112 | | { |
| 113 | | votrax_state *votrax = get_safe_token(device); |
| 81 | //------------------------------------------------- |
| 82 | // static_set_interface - configuration helper |
| 83 | // to set the interface |
| 84 | //------------------------------------------------- |
| 114 | 85 | |
| 115 | | votrax->device = device; |
| 116 | | votrax->samples = readsamples(device->machine(),VotraxTable,"votrax"); |
| 117 | | votrax->frequency = 8000; |
| 118 | | votrax->volume = 230; |
| 119 | | |
| 120 | | votrax->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), votrax, votrax_update_sound); |
| 121 | | |
| 122 | | votrax->sample = NULL; |
| 123 | | votrax->step = 0; |
| 86 | void votrax_device::static_set_interface(device_t &device, const votrax_interface &interface) |
| 87 | { |
| 88 | votrax_device &samples = downcast<votrax_device &>(device); |
| 89 | static_cast<votrax_interface &>(samples) = interface; |
| 124 | 90 | } |
| 125 | 91 | |
| 126 | 92 | |
| 127 | | WRITE8_DEVICE_HANDLER( votrax_w ) |
| 128 | | { |
| 129 | | votrax_state *info = get_safe_token(device); |
| 130 | | int Phoneme,Intonation; |
| 131 | 93 | |
| 132 | | info->channel->update(); |
| 94 | //************************************************************************** |
| 95 | // READ/WRITE HANDLERS |
| 96 | //************************************************************************** |
| 133 | 97 | |
| 134 | | Phoneme = data & 0x3F; |
| 135 | | Intonation = data >> 6; |
| 98 | //------------------------------------------------- |
| 99 | // write - handle a write to the control register |
| 100 | //------------------------------------------------- |
| 136 | 101 | |
| 137 | | logerror("Speech : %s at intonation %d\n",VotraxTable[Phoneme],Intonation); |
| 138 | | |
| 139 | | if(Phoneme==63) |
| 140 | | info->sample = NULL; |
| 141 | | |
| 142 | | if(info->samples->sample[Phoneme].data) |
| 102 | WRITE8_MEMBER( votrax_device::write ) |
| 103 | { |
| 104 | // append to the current string |
| 105 | m_current.cat(s_phoneme_table[data & 0x3f]); |
| 106 | |
| 107 | // look for a match in our sample table |
| 108 | for (int index = 0; m_votrax_map[index].phoneme != NULL; index++) |
| 109 | if (m_current.find(m_votrax_map[index].phoneme) != -1) |
| 110 | { |
| 111 | // if we found it, play the corresponding sample and flush the buffer |
| 112 | start(0, index); |
| 113 | m_current.replace(m_votrax_map[index].phoneme, ""); |
| 114 | m_current.trimspace(); |
| 115 | if (m_current.len() > 0) |
| 116 | mame_printf_warning("Votrax missed partial match: %s\n", m_current.cstr()); |
| 117 | m_current.reset(); |
| 118 | return; |
| 119 | } |
| 120 | |
| 121 | // if we got a stop and didn't find a match, print it |
| 122 | if ((data & 0x3f) == 0x3f) |
| 143 | 123 | { |
| 144 | | info->sample = &info->samples->sample[Phoneme]; |
| 145 | | info->pos = 0; |
| 146 | | info->frac = 0; |
| 147 | | info->step = ((INT64)(info->sample->frequency + (256*Intonation)) << FRAC_BITS) / info->device->machine().sample_rate(); |
| 148 | | info->channel->set_output_gain(0, (info->volume + (8*Intonation)*100/255) / 100.0); |
| 124 | mame_printf_warning("Votrax missed match: %s\n", m_current.cstr()); |
| 125 | m_current.reset(); |
| 149 | 126 | } |
| 150 | 127 | } |
| 151 | 128 | |
| 152 | | int votrax_status_r(device_t *device) |
| 129 | |
| 130 | //------------------------------------------------- |
| 131 | // status - read the status line |
| 132 | //------------------------------------------------- |
| 133 | |
| 134 | READ_LINE_MEMBER( votrax_device::status ) |
| 153 | 135 | { |
| 154 | | votrax_state *info = get_safe_token(device); |
| 155 | | info->channel->update(); |
| 156 | | return (info->sample != NULL); |
| 136 | // is this correct, or is it really a ready line and should be inverted? |
| 137 | return (m_current.len() > 0 || playing(0)) ? ASSERT_LINE : CLEAR_LINE; |
| 157 | 138 | } |
| 158 | 139 | |
| 159 | 140 | |
| 160 | 141 | |
| 161 | | /************************************************************************** |
| 162 | | * Generic get_info |
| 163 | | **************************************************************************/ |
| 142 | //************************************************************************** |
| 143 | // DEVICE INTERFACE |
| 144 | //************************************************************************** |
| 164 | 145 | |
| 165 | | DEVICE_GET_INFO( votrax ) |
| 146 | //------------------------------------------------- |
| 147 | // device_start - handle device startup |
| 148 | //------------------------------------------------- |
| 149 | |
| 150 | void votrax_device::device_start() |
| 166 | 151 | { |
| 167 | | switch (state) |
| 168 | | { |
| 169 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 170 | | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(votrax_state); break; |
| 152 | // build up a samples list |
| 153 | for (const votrax_map *curmap = m_votrax_map; curmap->phoneme != NULL; curmap++) |
| 154 | m_sample_list.append((curmap->samplename != NULL) ? curmap->samplename : ""); |
| 171 | 155 | |
| 172 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 173 | | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( votrax ); break; |
| 174 | | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 175 | | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 176 | | |
| 177 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 178 | | case DEVINFO_STR_NAME: strcpy(info->s, "Votrax SC-01"); break; |
| 179 | | case DEVINFO_STR_FAMILY: strcpy(info->s, "Votrax speech"); break; |
| 180 | | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 181 | | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 182 | | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; |
| 183 | | } |
| 156 | // create the samples interface |
| 157 | m_channels = 1; |
| 158 | m_names = m_sample_list; |
| 159 | m_start = NULL; |
| 160 | |
| 161 | // let the samples device do the rest |
| 162 | samples_device::device_start(); |
| 184 | 163 | } |
| 185 | | |
| 186 | | |
| 187 | | DEFINE_LEGACY_SOUND_DEVICE(VOTRAX, votrax); |
src/emu/sound/samples.c
| r14521 | r14522 | |
| 1 | | /* samples.c |
| 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | Playback of pre-recorded samples. Used for high-level simulation of discrete sound circuits |
| 4 | | where proper low-level simulation isn't available. Also used for tape loops and similar. |
| 3 | samples.c |
| 5 | 4 | |
| 6 | | Current limitations |
| 7 | | - Only supports single channel samples! |
| 5 | Sound device for sample playback. |
| 8 | 6 | |
| 9 | | Considerations |
| 10 | | - Maybe this should be part of the presentation layer (artwork etc.) with samples specified |
| 11 | | in .lay files instead of in drivers? |
| 7 | **************************************************************************** |
| 12 | 8 | |
| 13 | | */ |
| 9 | Playback of pre-recorded samples. Used for high-level simulation of |
| 10 | discrete sound circuits where proper low-level simulation isn't |
| 11 | available. Also used for tape loops and similar. |
| 14 | 12 | |
| 13 | Current limitations |
| 14 | - Only supports single channel samples! |
| 15 | 15 | |
| 16 | | #include "emu.h" |
| 17 | | #include "emuopts.h" |
| 18 | | #include "samples.h" |
| 19 | | #include "../../lib/libflac/include/flac/all.h" |
| 16 | Considerations |
| 17 | - Maybe this should be part of the presentation layer |
| 18 | (artwork etc.) with samples specified in .lay files instead of |
| 19 | in drivers? |
| 20 | 20 | |
| 21 | | typedef struct _sample_channel sample_channel; |
| 22 | | struct _sample_channel |
| 23 | | { |
| 24 | | sound_stream *stream; |
| 25 | | const INT16 *source; |
| 26 | | INT32 source_length; |
| 27 | | INT32 source_num; |
| 28 | | UINT32 pos; |
| 29 | | UINT32 frac; |
| 30 | | UINT32 step; |
| 31 | | UINT32 basefreq; |
| 32 | | UINT8 loop; |
| 33 | | UINT8 paused; |
| 34 | | }; |
| 21 | **************************************************************************** |
| 35 | 22 | |
| 23 | Copyright Aaron Giles |
| 24 | All rights reserved. |
| 36 | 25 | |
| 37 | | typedef struct _samples_info samples_info; |
| 38 | | struct _samples_info |
| 39 | | { |
| 40 | | device_t *device; |
| 41 | | int numchannels; /* how many channels */ |
| 42 | | sample_channel *channel;/* array of channels */ |
| 43 | | loaded_samples *samples;/* array of samples */ |
| 44 | | }; |
| 26 | Redistribution and use in source and binary forms, with or without |
| 27 | modification, are permitted provided that the following conditions are |
| 28 | met: |
| 45 | 29 | |
| 30 | * Redistributions of source code must retain the above copyright |
| 31 | notice, this list of conditions and the following disclaimer. |
| 32 | * Redistributions in binary form must reproduce the above copyright |
| 33 | notice, this list of conditions and the following disclaimer in |
| 34 | the documentation and/or other materials provided with the |
| 35 | distribution. |
| 36 | * Neither the name 'MAME' nor the names of its contributors may be |
| 37 | used to endorse or promote products derived from this software |
| 38 | without specific prior written permission. |
| 46 | 39 | |
| 47 | | INLINE samples_info *get_safe_token(device_t *device) |
| 48 | | { |
| 49 | | assert(device != NULL); |
| 50 | | assert(device->type() == SAMPLES); |
| 51 | | return (samples_info *)downcast<legacy_device_base *>(device)->token(); |
| 52 | | } |
| 40 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR |
| 41 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 42 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 43 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, |
| 44 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 45 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 46 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 47 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 48 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 49 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 50 | POSSIBILITY OF SUCH DAMAGE. |
| 53 | 51 | |
| 52 | ***************************************************************************/ |
| 54 | 53 | |
| 54 | #include "emu.h" |
| 55 | #include "emuopts.h" |
| 56 | #include "samples.h" |
| 57 | #include "flac.h" |
| 55 | 58 | |
| 56 | | #define FRAC_BITS 24 |
| 57 | | #define FRAC_ONE (1 << FRAC_BITS) |
| 58 | | #define FRAC_MASK (FRAC_ONE - 1) |
| 59 | | #define MAX_CHANNELS 100 |
| 60 | 59 | |
| 61 | | struct flac_reader |
| 62 | | { |
| 63 | | UINT8* rawdata; |
| 64 | | INT16* write_data; |
| 65 | | int position; |
| 66 | | int length; |
| 67 | | int decoded_size; |
| 68 | | int sample_rate; |
| 69 | | int channels; |
| 70 | | int bits_per_sample; |
| 71 | | int total_samples; |
| 72 | | int write_position; |
| 73 | | } flacread; |
| 60 | //************************************************************************** |
| 61 | // GLOBAL VARIABLES |
| 62 | //************************************************************************** |
| 74 | 63 | |
| 75 | | static flac_reader* flacreadptr; |
| 64 | // device type definition |
| 65 | const device_type SAMPLES = &device_creator<samples_device>; |
| 76 | 66 | |
| 77 | | void my_error_callback(const FLAC__StreamDecoder * decoder, FLAC__StreamDecoderErrorStatus status, void * client_data) |
| 78 | | { |
| 79 | | fatalerror("FLAC error Callback\n"); |
| 80 | | } |
| 81 | 67 | |
| 82 | | void my_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) |
| 83 | | { |
| 84 | 68 | |
| 85 | | flac_reader* flacrd = ((flac_reader*)client_data); |
| 69 | //************************************************************************** |
| 70 | // LIVE DEVICE |
| 71 | //************************************************************************** |
| 86 | 72 | |
| 87 | | if (metadata->type==0) |
| 88 | | { |
| 89 | | const FLAC__StreamMetadata_StreamInfo *streaminfo = &(metadata->data.stream_info); |
| 73 | //------------------------------------------------- |
| 74 | // samples_device - constructors |
| 75 | //------------------------------------------------- |
| 90 | 76 | |
| 91 | | flacrd->sample_rate = streaminfo->sample_rate; |
| 92 | | flacrd->channels = streaminfo->channels; |
| 93 | | flacrd->bits_per_sample = streaminfo->bits_per_sample; |
| 94 | | flacrd->total_samples = streaminfo->total_samples; |
| 95 | | } |
| 77 | samples_device::samples_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 78 | : device_t(mconfig, SAMPLES, "Samples", tag, owner, clock), |
| 79 | device_sound_interface(mconfig, *this) |
| 80 | { |
| 96 | 81 | } |
| 97 | 82 | |
| 83 | samples_device::samples_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| 84 | : device_t(mconfig, type, name, tag, owner, clock), |
| 85 | device_sound_interface(mconfig, *this) |
| 86 | { |
| 87 | } |
| 98 | 88 | |
| 99 | 89 | |
| 90 | //------------------------------------------------- |
| 91 | // static_set_interface - configuration helper |
| 92 | // to set the interface |
| 93 | //------------------------------------------------- |
| 100 | 94 | |
| 101 | | FLAC__StreamDecoderReadStatus my_read_callback(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) |
| 95 | void samples_device::static_set_interface(device_t &device, const samples_interface &interface) |
| 102 | 96 | { |
| 103 | | flac_reader* flacrd = ((flac_reader*)client_data); |
| 97 | samples_device &samples = downcast<samples_device &>(device); |
| 98 | static_cast<samples_interface &>(samples) = interface; |
| 99 | } |
| 104 | 100 | |
| 105 | | if(*bytes > 0) |
| 106 | | { |
| 107 | | if (*bytes <= flacrd->length) |
| 108 | | { |
| 109 | | memcpy(buffer, flacrd->rawdata+flacrd->position, *bytes); |
| 110 | | flacrd->position+=*bytes; |
| 111 | | flacrd->length-=*bytes; |
| 112 | | return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; |
| 113 | | } |
| 114 | | else |
| 115 | | { |
| 116 | | memcpy(buffer, flacrd->rawdata+flacrd->position, flacrd->length); |
| 117 | | flacrd->position+= flacrd->length; |
| 118 | | flacrd->length = 0; |
| 119 | 101 | |
| 120 | | return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; |
| 121 | | } |
| 122 | | } |
| 123 | | else |
| 124 | | { |
| 125 | | return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; |
| 126 | | } |
| 127 | 102 | |
| 128 | | if ( flacrd->length==0) |
| 129 | | { |
| 130 | | return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; |
| 131 | | } |
| 103 | //************************************************************************** |
| 104 | // PUBLIC INTERFACE |
| 105 | //************************************************************************** |
| 132 | 106 | |
| 133 | | return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; |
| 107 | //------------------------------------------------- |
| 108 | // start - start playing a loaded sample |
| 109 | //------------------------------------------------- |
| 134 | 110 | |
| 135 | | } |
| 136 | | |
| 137 | | FLAC__StreamDecoderWriteStatus my_write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data) |
| 111 | void samples_device::start(UINT8 channel, UINT32 samplenum, bool loop) |
| 138 | 112 | { |
| 139 | | flac_reader* flacrd = ((flac_reader*)client_data); |
| 113 | // if samples are disabled, just return quietly |
| 114 | if (m_sample.count() == 0) |
| 115 | return; |
| 140 | 116 | |
| 141 | | flacrd->decoded_size += frame->header.blocksize; |
| 117 | assert(samplenum < m_sample.count()); |
| 118 | assert(channel < m_channels); |
| 142 | 119 | |
| 143 | | for (int i=0;i<frame->header.blocksize;i++) |
| 144 | | { |
| 145 | | flacrd->write_data[i+flacrd->write_position] = buffer[0][i]; |
| 146 | | } |
| 120 | // force an update before we start |
| 121 | channel_t &chan = m_channel[channel]; |
| 122 | chan.stream->update(); |
| 147 | 123 | |
| 148 | | flacrd->write_position += frame->header.blocksize; |
| 149 | | |
| 150 | | return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; |
| 124 | // update the parameters |
| 125 | loaded_sample &sample = m_sample[samplenum]; |
| 126 | chan.source = sample.data; |
| 127 | chan.source_length = sample.length; |
| 128 | chan.source_num = (sample.data.count() > 0) ? samplenum : -1; |
| 129 | chan.pos = 0; |
| 130 | chan.frac = 0; |
| 131 | chan.basefreq = sample.frequency; |
| 132 | chan.step = (INT64(chan.basefreq) << FRAC_BITS) / machine().sample_rate(); |
| 133 | chan.loop = loop; |
| 151 | 134 | } |
| 152 | 135 | |
| 153 | 136 | |
| 137 | //------------------------------------------------- |
| 138 | // start_raw - start playing an externally |
| 139 | // provided sample |
| 140 | //------------------------------------------------- |
| 154 | 141 | |
| 155 | | |
| 156 | | |
| 157 | | |
| 158 | | /*------------------------------------------------- |
| 159 | | read_wav_sample - read a WAV file as a sample |
| 160 | | -------------------------------------------------*/ |
| 161 | | |
| 162 | | static int read_wav_sample(running_machine &machine, emu_file &file, loaded_sample *sample, char* filename) |
| 142 | void samples_device::start_raw(UINT8 channel, const INT16 *sampledata, UINT32 samples, UINT32 frequency, bool loop) |
| 163 | 143 | { |
| 164 | | unsigned long offset = 0; |
| 165 | | UINT32 length, rate, filesize; |
| 166 | | UINT16 bits, temp16; |
| 167 | | char buf[32]; |
| 168 | | UINT32 sindex; |
| 169 | | int type = 0; |
| 144 | assert(channel < m_channels); |
| 170 | 145 | |
| 171 | | /* read the core header and make sure it's a WAVE file */ |
| 172 | | offset += file.read(buf, 4); |
| 173 | | if (offset < 4) |
| 174 | | { |
| 175 | | mame_printf_warning("unable to read %s, 0-byte file?\n", filename); |
| 176 | | return 0; |
| 177 | | } |
| 178 | | if (memcmp(&buf[0], "RIFF", 4) == 0) |
| 179 | | type = 1; |
| 180 | | else if (memcmp(&buf[0], "fLaC", 4) == 0) |
| 181 | | type = 2; |
| 182 | | else |
| 183 | | { |
| 184 | | mame_printf_warning("unable to read %s, corrupt file?\n", filename); |
| 185 | | return 0; |
| 186 | | } |
| 146 | // force an update before we start |
| 147 | channel_t &chan = m_channel[channel]; |
| 148 | chan.stream->update(); |
| 187 | 149 | |
| 188 | | if (type==1) |
| 189 | | { |
| 190 | | /* get the total size */ |
| 191 | | offset += file.read(&filesize, 4); |
| 192 | | if (offset < 8) |
| 193 | | return 0; |
| 194 | | filesize = LITTLE_ENDIANIZE_INT32(filesize); |
| 150 | // update the parameters |
| 151 | chan.source = sampledata; |
| 152 | chan.source_length = samples; |
| 153 | chan.source_num = -1; |
| 154 | chan.pos = 0; |
| 155 | chan.frac = 0; |
| 156 | chan.basefreq = frequency; |
| 157 | chan.step = (INT64(chan.basefreq) << FRAC_BITS) / machine().sample_rate(); |
| 158 | chan.loop = loop; |
| 159 | } |
| 195 | 160 | |
| 196 | | /* read the RIFF file type and make sure it's a WAVE file */ |
| 197 | | offset += file.read(buf, 4); |
| 198 | | if (offset < 12) |
| 199 | | return 0; |
| 200 | | if (memcmp(&buf[0], "WAVE", 4) != 0) |
| 201 | | return 0; |
| 202 | 161 | |
| 203 | | /* seek until we find a format tag */ |
| 204 | | while (1) |
| 205 | | { |
| 206 | | offset += file.read(buf, 4); |
| 207 | | offset += file.read(&length, 4); |
| 208 | | length = LITTLE_ENDIANIZE_INT32(length); |
| 209 | | if (memcmp(&buf[0], "fmt ", 4) == 0) |
| 210 | | break; |
| 162 | //------------------------------------------------- |
| 163 | // set_frequency - set the playback frequency of |
| 164 | // a sample |
| 165 | //------------------------------------------------- |
| 211 | 166 | |
| 212 | | /* seek to the next block */ |
| 213 | | file.seek(length, SEEK_CUR); |
| 214 | | offset += length; |
| 215 | | if (offset >= filesize) |
| 216 | | return 0; |
| 217 | | } |
| 167 | void samples_device::set_frequency(UINT8 channel, UINT32 freq) |
| 168 | { |
| 169 | assert(channel < m_channels); |
| 218 | 170 | |
| 219 | | /* read the format -- make sure it is PCM */ |
| 220 | | offset += file.read(&temp16, 2); |
| 221 | | temp16 = LITTLE_ENDIANIZE_INT16(temp16); |
| 222 | | if (temp16 != 1) |
| 223 | | return 0; |
| 171 | // force an update before we start |
| 172 | channel_t &chan = m_channel[channel]; |
| 173 | chan.stream->update(); |
| 174 | chan.step = (INT64(freq) << FRAC_BITS) / machine().sample_rate(); |
| 175 | } |
| 224 | 176 | |
| 225 | | /* number of channels -- only mono is supported */ |
| 226 | | offset += file.read(&temp16, 2); |
| 227 | | temp16 = LITTLE_ENDIANIZE_INT16(temp16); |
| 228 | | if (temp16 != 1) |
| 229 | | return 0; |
| 230 | 177 | |
| 231 | | /* sample rate */ |
| 232 | | offset += file.read(&rate, 4); |
| 233 | | rate = LITTLE_ENDIANIZE_INT32(rate); |
| 178 | //------------------------------------------------- |
| 179 | // set_volume - set the playback volume of a |
| 180 | // sample |
| 181 | //------------------------------------------------- |
| 234 | 182 | |
| 235 | | /* bytes/second and block alignment are ignored */ |
| 236 | | offset += file.read(buf, 6); |
| 183 | void samples_device::set_volume(UINT8 channel, float volume) |
| 184 | { |
| 185 | assert(channel < m_channels); |
| 237 | 186 | |
| 238 | | /* bits/sample */ |
| 239 | | offset += file.read(&bits, 2); |
| 240 | | bits = LITTLE_ENDIANIZE_INT16(bits); |
| 241 | | if (bits != 8 && bits != 16) |
| 242 | | return 0; |
| 187 | // force an update before we start |
| 188 | channel_t &chan = m_channel[channel]; |
| 189 | chan.stream->set_output_gain(0, volume); |
| 190 | } |
| 243 | 191 | |
| 244 | | /* seek past any extra data */ |
| 245 | | file.seek(length - 16, SEEK_CUR); |
| 246 | | offset += length - 16; |
| 247 | 192 | |
| 248 | | /* seek until we find a data tag */ |
| 249 | | while (1) |
| 250 | | { |
| 251 | | offset += file.read(buf, 4); |
| 252 | | offset += file.read(&length, 4); |
| 253 | | length = LITTLE_ENDIANIZE_INT32(length); |
| 254 | | if (memcmp(&buf[0], "data", 4) == 0) |
| 255 | | break; |
| 193 | //------------------------------------------------- |
| 194 | // pause - pause playback on a channel |
| 195 | //------------------------------------------------- |
| 256 | 196 | |
| 257 | | /* seek to the next block */ |
| 258 | | file.seek(length, SEEK_CUR); |
| 259 | | offset += length; |
| 260 | | if (offset >= filesize) |
| 261 | | return 0; |
| 262 | | } |
| 197 | void samples_device::pause(UINT8 channel, bool pause) |
| 198 | { |
| 199 | assert(channel < m_channels); |
| 263 | 200 | |
| 264 | | /* if there was a 0 length data block, we're done */ |
| 265 | | if (length == 0) |
| 266 | | return 0; |
| 201 | // force an update before we start |
| 202 | channel_t &chan = m_channel[channel]; |
| 203 | chan.paused = pause; |
| 204 | } |
| 267 | 205 | |
| 268 | | /* fill in the sample data */ |
| 269 | | sample->length = length; |
| 270 | | sample->frequency = rate; |
| 271 | 206 | |
| 272 | | /* read the data in */ |
| 273 | | if (bits == 8) |
| 274 | | { |
| 275 | | unsigned char *tempptr; |
| 276 | | int sindex; |
| 207 | //------------------------------------------------- |
| 208 | // stop - stop playback on a channel |
| 209 | //------------------------------------------------- |
| 277 | 210 | |
| 278 | | sample->data = auto_alloc_array(machine, INT16, length); |
| 279 | | file.read(sample->data, length); |
| 211 | void samples_device::stop(UINT8 channel) |
| 212 | { |
| 213 | assert(channel < m_channels); |
| 280 | 214 | |
| 281 | | /* convert 8-bit data to signed samples */ |
| 282 | | tempptr = (unsigned char *)sample->data; |
| 283 | | for (sindex = length - 1; sindex >= 0; sindex--) |
| 284 | | sample->data[sindex] = (INT8)(tempptr[sindex] ^ 0x80) * 256; |
| 215 | // force an update before we start |
| 216 | channel_t &chan = m_channel[channel]; |
| 217 | chan.source = NULL; |
| 218 | chan.source_num = -1; |
| 219 | } |
| 285 | 220 | |
| 286 | | } |
| 287 | | else |
| 288 | | { |
| 289 | | /* 16-bit data is fine as-is */ |
| 290 | | sample->data = auto_alloc_array(machine, INT16, length/2); |
| 291 | | file.read(sample->data, length); |
| 292 | 221 | |
| 293 | | sample->length /= 2; |
| 294 | | if (ENDIANNESS_NATIVE != ENDIANNESS_LITTLE) |
| 295 | | for (sindex = 0; sindex < sample->length; sindex++) |
| 296 | | sample->data[sindex] = LITTLE_ENDIANIZE_INT16(sample->data[sindex]); |
| 297 | | } |
| 298 | | } |
| 299 | | else |
| 300 | | { |
| 301 | | int length; |
| 222 | //------------------------------------------------- |
| 223 | // stop_all - stop playback on all channels |
| 224 | //------------------------------------------------- |
| 302 | 225 | |
| 303 | | file.seek(0, SEEK_END); |
| 304 | | length = file.tell(); |
| 305 | | file.seek(0, 0); |
| 226 | void samples_device::stop_all() |
| 227 | { |
| 228 | // just iterate over channels and stop them |
| 229 | for (UINT8 channel = 0; channel < m_channels; channel++) |
| 230 | stop(channel); |
| 231 | } |
| 306 | 232 | |
| 307 | | flacread.rawdata = auto_alloc_array(machine, UINT8, length); |
| 308 | | flacread.length = length; |
| 309 | | flacread.position = 0; |
| 310 | | flacread.decoded_size = 0; |
| 311 | 233 | |
| 312 | | flacreadptr = &flacread; |
| 234 | //------------------------------------------------- |
| 235 | // base_frequency - return the base frequency of |
| 236 | // a channel being played |
| 237 | //------------------------------------------------- |
| 313 | 238 | |
| 314 | | file.read(flacread.rawdata, length); |
| 239 | UINT32 samples_device::base_frequency(UINT8 channel) const |
| 240 | { |
| 241 | assert(channel < m_channels); |
| 315 | 242 | |
| 316 | | FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new(); |
| 243 | // force an update before we start |
| 244 | const channel_t &chan = m_channel[channel]; |
| 245 | chan.stream->update(); |
| 246 | return chan.basefreq; |
| 247 | } |
| 317 | 248 | |
| 318 | | if (!decoder) |
| 319 | | fatalerror("Fail FLAC__stream_decoder_new\n"); |
| 320 | 249 | |
| 321 | | if(FLAC__stream_decoder_init_stream( |
| 322 | | decoder, |
| 323 | | my_read_callback, |
| 324 | | NULL, //my_seek_callback, // or NULL |
| 325 | | NULL, //my_tell_callback, // or NULL |
| 326 | | NULL, //my_length_callback, // or NULL |
| 327 | | NULL, //my_eof_callback, // or NULL |
| 328 | | my_write_callback, |
| 329 | | my_metadata_callback, //my_metadata_callback, // or NULL |
| 330 | | my_error_callback, |
| 331 | | (void*)flacreadptr /*my_client_data*/ ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) |
| 332 | | fatalerror("Fail FLAC__stream_decoder_init_stream\n"); |
| 250 | //------------------------------------------------- |
| 251 | // playing - return true if a sample is still |
| 252 | // playing on the given channel |
| 253 | //------------------------------------------------- |
| 333 | 254 | |
| 334 | | if (FLAC__stream_decoder_process_until_end_of_metadata(decoder) != FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM) |
| 335 | | fatalerror("Fail FLAC__stream_decoder_process_until_end_of_metadata\n"); |
| 255 | bool samples_device::playing(UINT8 channel) const |
| 256 | { |
| 257 | assert(channel < m_channels); |
| 336 | 258 | |
| 337 | | if (flacread.channels != 1) // only Mono supported |
| 338 | | fatalerror("Only MONO samples are supported\n"); |
| 259 | // force an update before we start |
| 260 | const channel_t &chan = m_channel[channel]; |
| 261 | chan.stream->update(); |
| 262 | return (chan.source != NULL); |
| 263 | } |
| 339 | 264 | |
| 340 | 265 | |
| 341 | | sample->data = auto_alloc_array(machine, INT16, flacread.total_samples*2); |
| 342 | | flacread.write_position = 0; |
| 343 | | flacread.write_data = sample->data; |
| 344 | 266 | |
| 345 | | if (FLAC__stream_decoder_process_until_end_of_stream (decoder) != FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM) |
| 346 | | { |
| 347 | | fatalerror("Fail FLAC__stream_decoder_process_until_end_of_stream\n"); |
| 348 | | } |
| 267 | //************************************************************************** |
| 268 | // DEVICE INTERFACE |
| 269 | //************************************************************************** |
| 349 | 270 | |
| 350 | | if (FLAC__stream_decoder_finish (decoder) != true) |
| 351 | | fatalerror("Fail FLAC__stream_decoder_finish\n"); |
| 271 | //------------------------------------------------- |
| 272 | // device_start - handle device startup |
| 273 | //------------------------------------------------- |
| 352 | 274 | |
| 353 | | FLAC__stream_decoder_delete(decoder); |
| 275 | void samples_device::device_start() |
| 276 | { |
| 277 | // read audio samples |
| 278 | load_samples(); |
| 354 | 279 | |
| 355 | | /* fill in the sample data */ |
| 280 | // allocate channels |
| 281 | m_channel.resize(m_channels); |
| 282 | for (int channel = 0; channel < m_channels; channel++) |
| 283 | { |
| 284 | // initialize channel |
| 285 | channel_t &chan = m_channel[channel]; |
| 286 | chan.stream = stream_alloc(0, 1, machine().sample_rate()); |
| 287 | chan.source = NULL; |
| 288 | chan.source_num = -1; |
| 289 | chan.step = 0; |
| 290 | chan.loop = 0; |
| 291 | chan.paused = 0; |
| 356 | 292 | |
| 357 | | sample->frequency = flacread.sample_rate; |
| 358 | | sample->length = flacread.total_samples * (flacread.bits_per_sample/8); |
| 359 | | |
| 360 | | if (flacread.bits_per_sample == 8) |
| 361 | | { |
| 362 | | for (sindex = 0; sindex <= sample->length; sindex++) |
| 363 | | sample->data[sindex] = ((sample->data[sindex])&0xff)*256; |
| 364 | | } |
| 365 | | else // don't need to process 16-bit samples? |
| 366 | | { |
| 367 | | sample->length = sample->length /2; //?? |
| 368 | | } |
| 293 | // register with the save state system |
| 294 | save_item(NAME(chan.source_length), channel); |
| 295 | save_item(NAME(chan.source_num), channel); |
| 296 | save_item(NAME(chan.pos), channel); |
| 297 | save_item(NAME(chan.frac), channel); |
| 298 | save_item(NAME(chan.step), channel); |
| 299 | save_item(NAME(chan.loop), channel); |
| 300 | save_item(NAME(chan.paused), channel); |
| 369 | 301 | } |
| 370 | 302 | |
| 371 | | return 1; |
| 303 | // initialize any custom handlers |
| 304 | if (m_start != NULL) |
| 305 | (*m_start)(*this); |
| 372 | 306 | } |
| 373 | 307 | |
| 374 | 308 | |
| 375 | | /*------------------------------------------------- |
| 376 | | readsamples - load all samples |
| 377 | | -------------------------------------------------*/ |
| 309 | //------------------------------------------------- |
| 310 | // device_reset - handle device reset |
| 311 | //------------------------------------------------- |
| 378 | 312 | |
| 379 | | loaded_samples *readsamples(running_machine &machine, const char *const *samplenames, const char *basename) |
| 313 | void samples_device::device_reset() |
| 380 | 314 | { |
| 381 | | loaded_samples *samples; |
| 382 | | int skipfirst = 0; |
| 383 | | int i; |
| 315 | stop_all(); |
| 316 | } |
| 384 | 317 | |
| 385 | | /* if the user doesn't want to use samples, bail */ |
| 386 | | if (!machine.options().samples()) |
| 387 | | return NULL; |
| 388 | | if (samplenames == 0 || samplenames[0] == 0) |
| 389 | | return NULL; |
| 390 | 318 | |
| 391 | | /* if a name begins with '*', we will also look under that as an alternate basename */ |
| 392 | | if (samplenames[0][0] == '*') |
| 393 | | skipfirst = 1; |
| 319 | //------------------------------------------------- |
| 320 | // device_post_load - handle updating after a |
| 321 | // restore |
| 322 | //------------------------------------------------- |
| 394 | 323 | |
| 395 | | /* count the samples */ |
| 396 | | for (i = 0; samplenames[i+skipfirst] != 0; i++) ; |
| 397 | | if (i == 0) |
| 398 | | return NULL; |
| 399 | | |
| 400 | | /* allocate the array */ |
| 401 | | samples = (loaded_samples *)auto_alloc_array_clear(machine, UINT8, sizeof(loaded_samples) + (i-1) * sizeof(loaded_sample)); |
| 402 | | samples->total = i; |
| 403 | | |
| 404 | | /* load the samples */ |
| 405 | | for (i = 0; i < samples->total; i++) |
| 406 | | if (samplenames[i+skipfirst][0]) |
| 324 | void samples_device::device_post_load() |
| 325 | { |
| 326 | // loop over channels |
| 327 | for (int channel = 0; channel < m_channels; channel++) |
| 328 | { |
| 329 | // attach any samples that were loaded and playing |
| 330 | channel_t &chan = m_channel[channel]; |
| 331 | if (chan.source_num >= 0 && chan.source_num < m_sample.count()) |
| 407 | 332 | { |
| 408 | | emu_file file(machine.options().sample_path(), OPEN_FLAG_READ); |
| 409 | | file_error filerr = FILERR_NOT_FOUND; |
| 333 | loaded_sample &sample = m_sample[chan.source_num]; |
| 334 | chan.source = sample.data; |
| 335 | chan.source_length = sample.length; |
| 336 | if (sample.data == NULL) |
| 337 | chan.source_num = -1; |
| 338 | } |
| 410 | 339 | |
| 411 | | char filename[512]; |
| 412 | | |
| 413 | | if (filerr != FILERR_NONE) |
| 340 | // validate the position against the length in case the sample is smaller |
| 341 | if (chan.source != NULL && chan.pos >= chan.source_length) |
| 342 | { |
| 343 | if (chan.loop) |
| 344 | chan.pos %= chan.source_length; |
| 345 | else |
| 414 | 346 | { |
| 415 | | // first try opening samples as .flac |
| 416 | | sprintf(filename, "%s.flac", samplenames[i+skipfirst]); |
| 417 | | |
| 418 | | filerr = file.open(basename, PATH_SEPARATOR, filename); |
| 419 | | // try parent sample set |
| 420 | | if (filerr != FILERR_NONE && skipfirst) |
| 421 | | filerr = file.open(samplenames[0] + 1, PATH_SEPARATOR, filename); |
| 347 | chan.source = NULL; |
| 348 | chan.source_num = -1; |
| 422 | 349 | } |
| 423 | | |
| 424 | | if (filerr != FILERR_NONE) |
| 425 | | { |
| 426 | | // .wav fallback |
| 427 | | sprintf(filename, "%s.wav", samplenames[i+skipfirst]); |
| 428 | | |
| 429 | | filerr = file.open(basename, PATH_SEPARATOR, filename); |
| 430 | | // try parent sample set |
| 431 | | if (filerr != FILERR_NONE && skipfirst) |
| 432 | | filerr = file.open(samplenames[0] + 1, PATH_SEPARATOR, filename); |
| 433 | | } |
| 434 | | |
| 435 | | |
| 436 | | if (filerr == FILERR_NONE) |
| 437 | | read_wav_sample(machine, file, &samples->sample[i], filename); |
| 438 | | |
| 439 | | if (filerr == FILERR_NOT_FOUND) |
| 440 | | mame_printf_warning("sample '%s' NOT FOUND\n", samplenames[i+skipfirst]); |
| 441 | | |
| 442 | 350 | } |
| 443 | | |
| 444 | | return samples; |
| 351 | } |
| 445 | 352 | } |
| 446 | 353 | |
| 447 | 354 | |
| 355 | //------------------------------------------------- |
| 356 | // sound_stream_update - update a sound stream |
| 357 | //------------------------------------------------- |
| 448 | 358 | |
| 449 | | |
| 450 | | /* Start one of the samples loaded from disk. Note: channel must be in the range */ |
| 451 | | /* 0 .. Samplesinterface->channels-1. It is NOT the discrete channel to pass to */ |
| 452 | | /* mixer_play_sample() */ |
| 453 | | void sample_start(device_t *device,int channel,int samplenum,int loop) |
| 359 | void samples_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 454 | 360 | { |
| 455 | | samples_info *info = get_safe_token(device); |
| 456 | | sample_channel *chan; |
| 457 | | loaded_sample *sample; |
| 361 | // find the channel with this stream |
| 362 | for (int channel = 0; channel < m_channels; channel++) |
| 363 | if (&stream == m_channel[channel].stream) |
| 364 | { |
| 365 | channel_t &chan = m_channel[channel]; |
| 366 | stream_sample_t *buffer = outputs[0]; |
| 458 | 367 | |
| 459 | | /* if samples are disabled, just return quietly */ |
| 460 | | if (info->samples == NULL) |
| 461 | | return; |
| 368 | // process if we still have a source and we're not paused |
| 369 | if (chan.source != NULL && !chan.paused) |
| 370 | { |
| 371 | // load some info locally |
| 372 | UINT32 pos = chan.pos; |
| 373 | UINT32 frac = chan.frac; |
| 374 | UINT32 step = chan.step; |
| 375 | const INT16 *sample = chan.source; |
| 376 | UINT32 sample_length = chan.source_length; |
| 462 | 377 | |
| 463 | | assert( samplenum < info->samples->total ); |
| 464 | | assert( channel < info->numchannels ); |
| 378 | while (samples--) |
| 379 | { |
| 380 | // do a linear interp on the sample |
| 381 | INT32 sample1 = sample[pos]; |
| 382 | INT32 sample2 = sample[(pos + 1) % sample_length]; |
| 383 | INT32 fracmult = frac >> (FRAC_BITS - 14); |
| 384 | *buffer++ = ((0x4000 - fracmult) * sample1 + fracmult * sample2) >> 14; |
| 465 | 385 | |
| 466 | | chan = &info->channel[channel]; |
| 386 | // advance |
| 387 | frac += step; |
| 388 | pos += frac >> FRAC_BITS; |
| 389 | frac = frac & ((1 << FRAC_BITS) - 1); |
| 467 | 390 | |
| 468 | | /* force an update before we start */ |
| 469 | | chan->stream->update(); |
| 391 | // handle looping/ending |
| 392 | if (pos >= sample_length) |
| 393 | { |
| 394 | if (chan.loop) |
| 395 | pos %= sample_length; |
| 396 | else |
| 397 | { |
| 398 | chan.source = NULL; |
| 399 | chan.source_num = -1; |
| 400 | if (samples > 0) |
| 401 | memset(buffer, 0, samples * sizeof(*buffer)); |
| 402 | samples = 0; |
| 403 | break; |
| 404 | } |
| 405 | } |
| 406 | } |
| 470 | 407 | |
| 471 | | /* update the parameters */ |
| 472 | | sample = &info->samples->sample[samplenum]; |
| 473 | | chan->source = sample->data; |
| 474 | | chan->source_length = sample->length; |
| 475 | | chan->source_num = sample->data ? samplenum : -1; |
| 476 | | chan->pos = 0; |
| 477 | | chan->frac = 0; |
| 478 | | chan->basefreq = sample->frequency; |
| 479 | | chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine().sample_rate(); |
| 480 | | chan->loop = loop; |
| 408 | // push position back out |
| 409 | chan.pos = pos; |
| 410 | chan.frac = frac; |
| 411 | } |
| 412 | else |
| 413 | memset(buffer, 0, samples * sizeof(*buffer)); |
| 414 | break; |
| 415 | } |
| 481 | 416 | } |
| 482 | 417 | |
| 483 | 418 | |
| 484 | | void sample_start_raw(device_t *device,int channel,const INT16 *sampledata,int samples,int frequency,int loop) |
| 485 | | { |
| 486 | | samples_info *info = get_safe_token(device); |
| 487 | | sample_channel *chan; |
| 488 | 419 | |
| 489 | | assert( channel < info->numchannels ); |
| 420 | //************************************************************************** |
| 421 | // INTERNAL HELPERS |
| 422 | //************************************************************************** |
| 490 | 423 | |
| 491 | | chan = &info->channel[channel]; |
| 424 | //------------------------------------------------- |
| 425 | // read_sample - read a WAV or FLAC file as a |
| 426 | // sample |
| 427 | //------------------------------------------------- |
| 492 | 428 | |
| 493 | | /* force an update before we start */ |
| 494 | | chan->stream->update(); |
| 495 | | |
| 496 | | /* update the parameters */ |
| 497 | | chan->source = sampledata; |
| 498 | | chan->source_length = samples; |
| 499 | | chan->source_num = -1; |
| 500 | | chan->pos = 0; |
| 501 | | chan->frac = 0; |
| 502 | | chan->basefreq = frequency; |
| 503 | | chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine().sample_rate(); |
| 504 | | chan->loop = loop; |
| 505 | | } |
| 506 | | |
| 507 | | |
| 508 | | void sample_set_freq(device_t *device,int channel,int freq) |
| 429 | bool samples_device::read_sample(emu_file &file, loaded_sample &sample) |
| 509 | 430 | { |
| 510 | | samples_info *info = get_safe_token(device); |
| 511 | | sample_channel *chan; |
| 431 | // read the core header and make sure it's a proper file |
| 432 | UINT8 buf[4]; |
| 433 | UINT32 offset = file.read(buf, 4); |
| 434 | if (offset < 4) |
| 435 | { |
| 436 | mame_printf_warning("Unable to read %s, 0-byte file?\n", file.filename()); |
| 437 | return false; |
| 438 | } |
| 439 | |
| 440 | // look for the appropriate RIFF tag |
| 441 | if (memcmp(&buf[0], "RIFF", 4) == 0) |
| 442 | return read_wav_sample(file, sample); |
| 443 | else if (memcmp(&buf[0], "fLaC", 4) == 0) |
| 444 | return read_flac_sample(file, sample); |
| 512 | 445 | |
| 513 | | assert( channel < info->numchannels ); |
| 514 | | |
| 515 | | chan = &info->channel[channel]; |
| 516 | | |
| 517 | | /* force an update before we start */ |
| 518 | | chan->stream->update(); |
| 519 | | |
| 520 | | chan->step = ((INT64)freq << FRAC_BITS) / info->device->machine().sample_rate(); |
| 446 | // if nothing appropriate, emit a warning |
| 447 | mame_printf_warning("Unable to read %s, corrupt file?\n", file.filename()); |
| 448 | return false; |
| 521 | 449 | } |
| 522 | 450 | |
| 523 | 451 | |
| 524 | | void sample_set_volume(device_t *device,int channel,float volume) |
| 525 | | { |
| 526 | | samples_info *info = get_safe_token(device); |
| 527 | | sample_channel *chan; |
| 452 | //------------------------------------------------- |
| 453 | // read_wav_sample - read a WAV file as a sample |
| 454 | //------------------------------------------------- |
| 528 | 455 | |
| 529 | | assert( channel < info->numchannels ); |
| 530 | | |
| 531 | | chan = &info->channel[channel]; |
| 532 | | |
| 533 | | chan->stream->set_output_gain(0, volume); |
| 534 | | } |
| 535 | | |
| 536 | | |
| 537 | | void sample_set_pause(device_t *device,int channel,int pause) |
| 456 | bool samples_device::read_wav_sample(emu_file &file, loaded_sample &sample) |
| 538 | 457 | { |
| 539 | | samples_info *info = get_safe_token(device); |
| 540 | | sample_channel *chan; |
| 458 | printf("Reading %s as WAV\n", file.filename()); |
| 459 | // we already read the opening 'WAVE' header |
| 460 | UINT32 offset = 4; |
| 461 | |
| 462 | // get the total size |
| 463 | UINT32 filesize; |
| 464 | offset += file.read(&filesize, 4); |
| 465 | if (offset < 8) |
| 466 | return false; |
| 467 | filesize = LITTLE_ENDIANIZE_INT32(filesize); |
| 541 | 468 | |
| 542 | | assert( channel < info->numchannels ); |
| 469 | // read the RIFF file type and make sure it's a WAVE file |
| 470 | char buf[32]; |
| 471 | offset += file.read(buf, 4); |
| 472 | if (offset < 12) |
| 473 | return false; |
| 474 | if (memcmp(&buf[0], "WAVE", 4) != 0) |
| 475 | return false; |
| 543 | 476 | |
| 544 | | chan = &info->channel[channel]; |
| 477 | // seek until we find a format tag |
| 478 | UINT32 length; |
| 479 | while (1) |
| 480 | { |
| 481 | offset += file.read(buf, 4); |
| 482 | offset += file.read(&length, 4); |
| 483 | length = LITTLE_ENDIANIZE_INT32(length); |
| 484 | if (memcmp(&buf[0], "fmt ", 4) == 0) |
| 485 | break; |
| 545 | 486 | |
| 546 | | /* force an update before we start */ |
| 547 | | chan->stream->update(); |
| 487 | // seek to the next block |
| 488 | file.seek(length, SEEK_CUR); |
| 489 | offset += length; |
| 490 | if (offset >= filesize) |
| 491 | return false; |
| 492 | } |
| 548 | 493 | |
| 549 | | chan->paused = pause; |
| 550 | | } |
| 494 | // read the format -- make sure it is PCM |
| 495 | UINT16 temp16; |
| 496 | offset += file.read(&temp16, 2); |
| 497 | temp16 = LITTLE_ENDIANIZE_INT16(temp16); |
| 498 | if (temp16 != 1) |
| 499 | return false; |
| 551 | 500 | |
| 501 | // number of channels -- only mono is supported |
| 502 | offset += file.read(&temp16, 2); |
| 503 | temp16 = LITTLE_ENDIANIZE_INT16(temp16); |
| 504 | if (temp16 != 1) |
| 505 | return false; |
| 552 | 506 | |
| 553 | | void sample_stop(device_t *device,int channel) |
| 554 | | { |
| 555 | | samples_info *info = get_safe_token(device); |
| 556 | | sample_channel *chan; |
| 507 | // sample rate |
| 508 | UINT32 rate; |
| 509 | offset += file.read(&rate, 4); |
| 510 | rate = LITTLE_ENDIANIZE_INT32(rate); |
| 557 | 511 | |
| 558 | | assert( channel < info->numchannels ); |
| 512 | // bytes/second and block alignment are ignored |
| 513 | offset += file.read(buf, 6); |
| 559 | 514 | |
| 560 | | chan = &info->channel[channel]; |
| 515 | // bits/sample |
| 516 | UINT16 bits; |
| 517 | offset += file.read(&bits, 2); |
| 518 | bits = LITTLE_ENDIANIZE_INT16(bits); |
| 519 | if (bits != 8 && bits != 16) |
| 520 | return false; |
| 561 | 521 | |
| 562 | | /* force an update before we start */ |
| 563 | | chan->stream->update(); |
| 564 | | chan->source = NULL; |
| 565 | | chan->source_num = -1; |
| 566 | | } |
| 522 | // seek past any extra data |
| 523 | file.seek(length - 16, SEEK_CUR); |
| 524 | offset += length - 16; |
| 567 | 525 | |
| 526 | // seek until we find a data tag |
| 527 | while (1) |
| 528 | { |
| 529 | offset += file.read(buf, 4); |
| 530 | offset += file.read(&length, 4); |
| 531 | length = LITTLE_ENDIANIZE_INT32(length); |
| 532 | if (memcmp(&buf[0], "data", 4) == 0) |
| 533 | break; |
| 568 | 534 | |
| 569 | | int sample_get_base_freq(device_t *device,int channel) |
| 570 | | { |
| 571 | | samples_info *info = get_safe_token(device); |
| 572 | | sample_channel *chan; |
| 535 | // seek to the next block |
| 536 | file.seek(length, SEEK_CUR); |
| 537 | offset += length; |
| 538 | if (offset >= filesize) |
| 539 | return false; |
| 540 | } |
| 573 | 541 | |
| 574 | | assert( channel < info->numchannels ); |
| 542 | // if there was a 0 length data block, we're done |
| 543 | if (length == 0) |
| 544 | return false; |
| 575 | 545 | |
| 576 | | chan = &info->channel[channel]; |
| 546 | // fill in the sample data |
| 547 | sample.length = length / 2; |
| 548 | sample.frequency = rate; |
| 577 | 549 | |
| 578 | | /* force an update before we start */ |
| 579 | | chan->stream->update(); |
| 580 | | return chan->basefreq; |
| 581 | | } |
| 582 | | |
| 583 | | |
| 584 | | int sample_playing(device_t *device,int channel) |
| 585 | | { |
| 586 | | samples_info *info = get_safe_token(device); |
| 587 | | sample_channel *chan; |
| 588 | | |
| 589 | | assert( channel < info->numchannels ); |
| 590 | | |
| 591 | | chan = &info->channel[channel]; |
| 592 | | |
| 593 | | /* force an update before we start */ |
| 594 | | chan->stream->update(); |
| 595 | | return (chan->source != NULL); |
| 596 | | } |
| 597 | | |
| 598 | | |
| 599 | | static STREAM_UPDATE( sample_update_sound ) |
| 600 | | { |
| 601 | | sample_channel *chan = (sample_channel *)param; |
| 602 | | stream_sample_t *buffer = outputs[0]; |
| 603 | | |
| 604 | | if (chan->source && !chan->paused) |
| 550 | // read the data in |
| 551 | if (bits == 8) |
| 605 | 552 | { |
| 606 | | /* load some info locally */ |
| 607 | | UINT32 pos = chan->pos; |
| 608 | | UINT32 frac = chan->frac; |
| 609 | | UINT32 step = chan->step; |
| 610 | | const INT16 *sample = chan->source; |
| 611 | | UINT32 sample_length = chan->source_length; |
| 553 | sample.data.resize(length); |
| 554 | file.read(sample.data, length); |
| 612 | 555 | |
| 613 | | while (samples--) |
| 614 | | { |
| 615 | | /* do a linear interp on the sample */ |
| 616 | | INT32 sample1 = sample[pos]; |
| 617 | | INT32 sample2 = sample[(pos + 1) % sample_length]; |
| 618 | | INT32 fracmult = frac >> (FRAC_BITS - 14); |
| 619 | | *buffer++ = ((0x4000 - fracmult) * sample1 + fracmult * sample2) >> 14; |
| 620 | | |
| 621 | | /* advance */ |
| 622 | | frac += step; |
| 623 | | pos += frac >> FRAC_BITS; |
| 624 | | frac = frac & ((1 << FRAC_BITS) - 1); |
| 625 | | |
| 626 | | /* handle looping/ending */ |
| 627 | | if (pos >= sample_length) |
| 628 | | { |
| 629 | | if (chan->loop) |
| 630 | | pos %= sample_length; |
| 631 | | else |
| 632 | | { |
| 633 | | chan->source = NULL; |
| 634 | | chan->source_num = -1; |
| 635 | | if (samples > 0) |
| 636 | | memset(buffer, 0, samples * sizeof(*buffer)); |
| 637 | | break; |
| 638 | | } |
| 639 | | } |
| 640 | | } |
| 641 | | |
| 642 | | /* push position back out */ |
| 643 | | chan->pos = pos; |
| 644 | | chan->frac = frac; |
| 556 | // convert 8-bit data to signed samples |
| 557 | UINT8 *tempptr = reinterpret_cast<UINT8 *>(&sample.data[0]); |
| 558 | for (UINT32 sindex = length - 1; sindex >= 0; sindex--) |
| 559 | sample.data[sindex] = INT8(tempptr[sindex] ^ 0x80) * 256; |
| 645 | 560 | } |
| 646 | 561 | else |
| 647 | | memset(buffer, 0, samples * sizeof(*buffer)); |
| 648 | | } |
| 649 | | |
| 650 | | |
| 651 | | static void samples_postload(samples_info *info) |
| 652 | | { |
| 653 | | int i; |
| 654 | | |
| 655 | | /* loop over channels */ |
| 656 | | for (i = 0; i < info->numchannels; i++) |
| 657 | 562 | { |
| 658 | | sample_channel *chan = &info->channel[i]; |
| 563 | // 16-bit data is fine as-is |
| 564 | sample.data.resize(length / 2); |
| 565 | file.read(sample.data, length); |
| 659 | 566 | |
| 660 | | /* attach any samples that were loaded and playing */ |
| 661 | | if (chan->source_num >= 0 && chan->source_num < info->samples->total) |
| 662 | | { |
| 663 | | loaded_sample *sample = &info->samples->sample[chan->source_num]; |
| 664 | | chan->source = sample->data; |
| 665 | | chan->source_length = sample->length; |
| 666 | | if (!sample->data) |
| 667 | | chan->source_num = -1; |
| 668 | | } |
| 669 | | |
| 670 | | /* validate the position against the length in case the sample is smaller */ |
| 671 | | if (chan->source && chan->pos >= chan->source_length) |
| 672 | | { |
| 673 | | if (chan->loop) |
| 674 | | chan->pos %= chan->source_length; |
| 675 | | else |
| 676 | | { |
| 677 | | chan->source = NULL; |
| 678 | | chan->source_num = -1; |
| 679 | | } |
| 680 | | } |
| 567 | // swap high/low on big-endian systems |
| 568 | if (ENDIANNESS_NATIVE != ENDIANNESS_LITTLE) |
| 569 | for (UINT32 sindex = 0; sindex < sample.length; sindex++) |
| 570 | sample.data[sindex] = LITTLE_ENDIANIZE_INT16(sample.data[sindex]); |
| 681 | 571 | } |
| 572 | return true; |
| 682 | 573 | } |
| 683 | 574 | |
| 684 | 575 | |
| 685 | | static DEVICE_START( samples ) |
| 576 | //------------------------------------------------- |
| 577 | // read_flac_sample - read a FLAC file as a sample |
| 578 | //------------------------------------------------- |
| 579 | |
| 580 | bool samples_device::read_flac_sample(emu_file &file, loaded_sample &sample) |
| 686 | 581 | { |
| 687 | | int i; |
| 688 | | const samples_interface *intf = (const samples_interface *)device->static_config(); |
| 689 | | samples_info *info = get_safe_token(device); |
| 582 | printf("Reading %s as FLAC\n", file.filename()); |
| 583 | // seek back to the start of the file |
| 584 | file.seek(0, SEEK_SET); |
| 690 | 585 | |
| 691 | | info->device = device; |
| 586 | // create the FLAC decoder and fill in the sample data |
| 587 | flac_decoder decoder(file); |
| 588 | sample.length = decoder.total_samples(); |
| 589 | sample.frequency = decoder.sample_rate(); |
| 692 | 590 | |
| 693 | | /* read audio samples */ |
| 694 | | if (intf->samplenames) |
| 695 | | info->samples = readsamples(device->machine(), intf->samplenames,device->machine().system().name); |
| 696 | | |
| 697 | | /* allocate channels */ |
| 698 | | info->numchannels = intf->channels; |
| 699 | | assert(info->numchannels < MAX_CHANNELS); |
| 700 | | info->channel = auto_alloc_array(device->machine(), sample_channel, info->numchannels); |
| 701 | | for (i = 0; i < info->numchannels; i++) |
| 702 | | { |
| 703 | | info->channel[i].stream = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), &info->channel[i], sample_update_sound); |
| 704 | | |
| 705 | | info->channel[i].source = NULL; |
| 706 | | info->channel[i].source_num = -1; |
| 707 | | info->channel[i].step = 0; |
| 708 | | info->channel[i].loop = 0; |
| 709 | | info->channel[i].paused = 0; |
| 710 | | |
| 711 | | /* register with the save state system */ |
| 712 | | device->save_item(NAME(info->channel[i].source_length), i); |
| 713 | | device->save_item(NAME(info->channel[i].source_num), i); |
| 714 | | device->save_item(NAME(info->channel[i].pos), i); |
| 715 | | device->save_item(NAME(info->channel[i].frac), i); |
| 716 | | device->save_item(NAME(info->channel[i].step), i); |
| 717 | | device->save_item(NAME(info->channel[i].loop), i); |
| 718 | | device->save_item(NAME(info->channel[i].paused), i); |
| 719 | | } |
| 720 | | device->machine().save().register_postload(save_prepost_delegate(FUNC(samples_postload), info)); |
| 721 | | |
| 722 | | /* initialize any custom handlers */ |
| 723 | | if (intf->start) |
| 724 | | (*intf->start)(device); |
| 591 | // error if more than 1 channel or not 16bpp |
| 592 | if (decoder.channels() != 1) |
| 593 | return false; |
| 594 | if (decoder.bits_per_sample() != 16) |
| 595 | return false; |
| 596 | |
| 597 | // resize the array and read |
| 598 | sample.data.resize(sample.length); |
| 599 | if (!decoder.decode_interleaved(sample.data, sample.length)) |
| 600 | return false; |
| 601 | |
| 602 | // finish up and clean up |
| 603 | decoder.finish(); |
| 604 | return true; |
| 725 | 605 | } |
| 726 | 606 | |
| 727 | 607 | |
| 608 | //------------------------------------------------- |
| 609 | // load_samples - load all the samples in our |
| 610 | // attached interface |
| 611 | //------------------------------------------------- |
| 728 | 612 | |
| 729 | | /************************************************************************** |
| 730 | | * Generic get_info |
| 731 | | **************************************************************************/ |
| 732 | | |
| 733 | | DEVICE_GET_INFO( samples ) |
| 613 | void samples_device::load_samples() |
| 734 | 614 | { |
| 735 | | switch (state) |
| 736 | | { |
| 737 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 738 | | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(samples_info); break; |
| 615 | // if the user doesn't want to use samples, bail |
| 616 | if (!machine().options().samples()) |
| 617 | return; |
| 618 | |
| 619 | // iterate over ourself |
| 620 | const char *basename = machine().basename(); |
| 621 | samples_iterator iter(*this); |
| 622 | const char *altbasename = iter.altbasename(); |
| 739 | 623 | |
| 740 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 741 | | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( samples ); break; |
| 742 | | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 743 | | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 624 | // pre-size the array |
| 625 | m_sample.resize(iter.count()); |
| 744 | 626 | |
| 745 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 746 | | case DEVINFO_STR_NAME: strcpy(info->s, "Samples"); break; |
| 747 | | case DEVINFO_STR_FAMILY: strcpy(info->s, "Big Hack"); break; |
| 748 | | case DEVINFO_STR_VERSION: strcpy(info->s, "1.1"); break; |
| 749 | | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 750 | | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; |
| 627 | // load the samples |
| 628 | int index = 0; |
| 629 | for (const char *samplename = iter.first(); samplename != NULL; index++, samplename = iter.next()) |
| 630 | { |
| 631 | printf("Sample %d = %s\n", index, samplename); |
| 632 | // attempt to open as FLAC first |
| 633 | emu_file file(machine().options().sample_path(), OPEN_FLAG_READ); |
| 634 | file_error filerr = file.open(basename, PATH_SEPARATOR, samplename, ".flac"); |
| 635 | if (filerr != FILERR_NONE && altbasename != NULL) |
| 636 | filerr = file.open(altbasename, PATH_SEPARATOR, samplename, ".flac"); |
| 637 | |
| 638 | // if not, try as WAV |
| 639 | if (filerr != FILERR_NONE) |
| 640 | filerr = file.open(basename, PATH_SEPARATOR, samplename, ".wav"); |
| 641 | if (filerr != FILERR_NONE && altbasename != NULL) |
| 642 | filerr = file.open(altbasename, PATH_SEPARATOR, samplename, ".wav"); |
| 643 | |
| 644 | // if opened, read it |
| 645 | if (filerr == FILERR_NONE) |
| 646 | read_sample(file, m_sample[index]); |
| 647 | else if (filerr == FILERR_NOT_FOUND) |
| 648 | mame_printf_warning("Sample '%s' NOT FOUND\n", samplename); |
| 751 | 649 | } |
| 752 | 650 | } |
| 753 | | |
| 754 | | |
| 755 | | DEFINE_LEGACY_SOUND_DEVICE(SAMPLES, samples); |
src/emu/sound/samples.h
| r14521 | r14522 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | samples.h |
| 4 | |
| 5 | Sound device for sample playback. |
| 6 | |
| 7 | **************************************************************************** |
| 8 | |
| 9 | Copyright Aaron Giles |
| 10 | All rights reserved. |
| 11 | |
| 12 | Redistribution and use in source and binary forms, with or without |
| 13 | modification, are permitted provided that the following conditions are |
| 14 | met: |
| 15 | |
| 16 | * Redistributions of source code must retain the above copyright |
| 17 | notice, this list of conditions and the following disclaimer. |
| 18 | * Redistributions in binary form must reproduce the above copyright |
| 19 | notice, this list of conditions and the following disclaimer in |
| 20 | the documentation and/or other materials provided with the |
| 21 | distribution. |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be |
| 23 | used to endorse or promote products derived from this software |
| 24 | without specific prior written permission. |
| 25 | |
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 36 | POSSIBILITY OF SUCH DAMAGE. |
| 37 | |
| 38 | ***************************************************************************/ |
| 39 | |
| 1 | 40 | #pragma once |
| 2 | 41 | |
| 3 | 42 | #ifndef __SAMPLES_H__ |
| r14521 | r14522 | |
| 3 | 42 | #define __SAMPLES_H__ |
| 4 | 43 | |
| 5 | | #include "devlegcy.h" |
| 6 | 44 | |
| 7 | | typedef struct _loaded_sample loaded_sample; |
| 8 | | struct _loaded_sample |
| 45 | //************************************************************************** |
| 46 | // INTERFACE CONFIGURATION MACROS |
| 47 | //************************************************************************** |
| 48 | |
| 49 | #define MCFG_SAMPLES_ADD(_tag, _interface) \ |
| 50 | MCFG_DEVICE_ADD(_tag, SAMPLES, 0) \ |
| 51 | samples_device::static_set_interface(*device, _interface); |
| 52 | |
| 53 | #define MCFG_SAMPLES_REPLACE(_tag, _interface) \ |
| 54 | MCFG_DEVICE_REPLACE(_tag, SAMPLES, 0) \ |
| 55 | samples_device::static_set_interface(*device, _interface); |
| 56 | |
| 57 | |
| 58 | #define SAMPLES_START(name) void name(samples_device &device) |
| 59 | |
| 60 | |
| 61 | |
| 62 | //************************************************************************** |
| 63 | // TYPE DEFINITIONS |
| 64 | //************************************************************************** |
| 65 | |
| 66 | class samples_device; |
| 67 | |
| 68 | |
| 69 | // ======================> samples_interface sample |
| 70 | |
| 71 | struct samples_interface |
| 9 | 72 | { |
| 10 | | int length; /* length in samples */ |
| 11 | | int frequency; /* frequency of the sample */ |
| 12 | | INT16 * data; /* 16-bit signed data */ |
| 73 | UINT8 m_channels; // number of discrete audio channels needed |
| 74 | const char *const *m_names; // array of sample names |
| 75 | void (*m_start)(samples_device &device); // optional callback |
| 13 | 76 | }; |
| 14 | 77 | |
| 15 | | typedef struct _loaded_samples loaded_samples; |
| 16 | | struct _loaded_samples |
| 78 | |
| 79 | // ======================> samples_device |
| 80 | |
| 81 | class samples_device : public device_t, |
| 82 | public device_sound_interface, |
| 83 | public samples_interface |
| 17 | 84 | { |
| 18 | | int total; /* number of samples */ |
| 19 | | loaded_sample sample[1]; /* array of samples */ |
| 85 | public: |
| 86 | // construction/destruction |
| 87 | samples_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 88 | |
| 89 | // static configuration helpers |
| 90 | static void static_set_interface(device_t &device, const samples_interface &interface); |
| 91 | |
| 92 | // getters |
| 93 | bool playing(UINT8 channel) const; |
| 94 | UINT32 base_frequency(UINT8 channel) const; |
| 95 | |
| 96 | // start/stop helpers |
| 97 | void start(UINT8 channel, UINT32 samplenum, bool loop = false); |
| 98 | void start_raw(UINT8 channel, const INT16 *sampledata, UINT32 samples, UINT32 frequency, bool loop = false); |
| 99 | void pause(UINT8 channel, bool pause = true); |
| 100 | void stop(UINT8 channel); |
| 101 | void stop_all(); |
| 102 | |
| 103 | // dynamic control |
| 104 | void set_frequency(UINT8 channel, UINT32 frequency); |
| 105 | void set_volume(UINT8 channel, float volume); |
| 106 | |
| 107 | protected: |
| 108 | // subclasses can do it this way |
| 109 | samples_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 110 | |
| 111 | // device-level overrides |
| 112 | virtual void device_start(); |
| 113 | virtual void device_reset(); |
| 114 | virtual void device_post_load(); |
| 115 | |
| 116 | // device_sound_interface overrides |
| 117 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); |
| 118 | |
| 119 | private: |
| 120 | // internal classes |
| 121 | struct loaded_sample |
| 122 | { |
| 123 | // shouldn't need a copy, but in case it happens, catch it here |
| 124 | loaded_sample &operator=(const loaded_sample &rhs) { assert(false); return *this; } |
| 125 | |
| 126 | UINT32 length; // length in samples |
| 127 | UINT32 frequency; // frequency of the sample |
| 128 | dynamic_array<INT16> data; // 16-bit signed data |
| 129 | }; |
| 130 | |
| 131 | struct channel_t |
| 132 | { |
| 133 | sound_stream * stream; |
| 134 | const INT16 * source; |
| 135 | INT32 source_length; |
| 136 | INT32 source_num; |
| 137 | UINT32 pos; |
| 138 | UINT32 frac; |
| 139 | UINT32 step; |
| 140 | UINT32 basefreq; |
| 141 | bool loop; |
| 142 | bool paused; |
| 143 | }; |
| 144 | |
| 145 | // internal helpers |
| 146 | bool read_sample(emu_file &file, loaded_sample &sample); |
| 147 | bool read_wav_sample(emu_file &file, loaded_sample &sample); |
| 148 | bool read_flac_sample(emu_file &file, loaded_sample &sample); |
| 149 | void load_samples(); |
| 150 | |
| 151 | // internal state |
| 152 | dynamic_array<channel_t> m_channel; |
| 153 | dynamic_array<loaded_sample> m_sample; |
| 154 | |
| 155 | // internal constants |
| 156 | static const UINT8 FRAC_BITS = 24; |
| 157 | static const UINT32 FRAC_ONE = 1 << FRAC_BITS; |
| 158 | static const UINT32 FRAC_MASK = FRAC_ONE - 1; |
| 20 | 159 | }; |
| 21 | 160 | |
| 22 | | typedef struct _samples_interface samples_interface; |
| 23 | | struct _samples_interface |
| 161 | // iterator, since lots of people are interested in these devices |
| 162 | typedef device_type_iterator<&device_creator<samples_device>, samples_device> samples_device_iterator; |
| 163 | |
| 164 | |
| 165 | // ======================> samples_iterator |
| 166 | |
| 167 | class samples_iterator |
| 24 | 168 | { |
| 25 | | int channels; /* number of discrete audio channels needed */ |
| 26 | | const char *const *samplenames; |
| 27 | | void (*start)(device_t *device); |
| 169 | public: |
| 170 | // construction/destruction |
| 171 | samples_iterator(samples_interface &intf) |
| 172 | : m_intf(intf), |
| 173 | m_current(-1) { } |
| 174 | |
| 175 | // getters |
| 176 | const char *altbasename() const { return (m_intf.m_names != NULL && m_intf.m_names[0] != NULL && m_intf.m_names[0][0] == '*') ? &m_intf.m_names[0][1] : NULL; } |
| 177 | |
| 178 | // iteration |
| 179 | const char *first() |
| 180 | { |
| 181 | if (m_intf.m_names == NULL || m_intf.m_names[0] == NULL) |
| 182 | return NULL; |
| 183 | m_current = 0; |
| 184 | if (m_intf.m_names[0][0] == '*') |
| 185 | m_current++; |
| 186 | return m_intf.m_names[m_current++]; |
| 187 | } |
| 188 | |
| 189 | const char *next() |
| 190 | { |
| 191 | if (m_current == -1 || m_intf.m_names[m_current] == NULL) |
| 192 | return NULL; |
| 193 | return m_intf.m_names[m_current++]; |
| 194 | } |
| 195 | |
| 196 | // counting |
| 197 | int count() |
| 198 | { |
| 199 | int save = m_current; |
| 200 | int result = 0; |
| 201 | for (const char *scan = first(); scan != NULL; scan = next()) |
| 202 | result++; |
| 203 | m_current = save; |
| 204 | return result; |
| 205 | } |
| 206 | |
| 207 | private: |
| 208 | // internal state |
| 209 | samples_interface & m_intf; |
| 210 | int m_current; |
| 28 | 211 | }; |
| 29 | 212 | |
| 30 | | #define SAMPLES_START(name) void name(device_t *device) |
| 31 | 213 | |
| 32 | 214 | |
| 33 | | void sample_start(device_t *device,int channel,int samplenum,int loop); |
| 34 | | void sample_start_raw(device_t *device,int channel,const INT16 *sampledata,int samples,int frequency,int loop); |
| 35 | | void sample_set_freq(device_t *device,int channel,int freq); |
| 36 | | void sample_set_volume(device_t *device,int channel,float volume); |
| 37 | | void sample_set_pause(device_t *device,int channel,int pause); |
| 38 | | void sample_stop(device_t *device,int channel); |
| 39 | | int sample_get_base_freq(device_t *device,int channel); |
| 40 | | int sample_playing(device_t *device,int channel); |
| 215 | //************************************************************************** |
| 216 | // GLOBAL VARIABLES |
| 217 | //************************************************************************** |
| 41 | 218 | |
| 42 | | /* helper function that reads samples from disk - this can be used by other */ |
| 43 | | /* drivers as well (e.g. a sound chip emulator needing drum samples) */ |
| 44 | | loaded_samples *readsamples(running_machine &machine, const char *const *samplenames, const char *name); |
| 219 | // device type definition |
| 220 | extern const device_type SAMPLES; |
| 45 | 221 | |
| 46 | | DECLARE_LEGACY_SOUND_DEVICE(SAMPLES, samples); |
| 47 | 222 | |
| 48 | | typedef device_type_iterator<&legacy_device_creator<samples_device>, samples_device> samples_device_iterator; |
| 49 | | |
| 50 | | #endif /* __SAMPLES_H__ */ |
| 223 | #endif |