src/mame/audio/leland.c
| r869 | r870 | |
| 197 | 197 | static sound_stream * nondma_stream; |
| 198 | 198 | static sound_stream * extern_stream; |
| 199 | 199 | |
| 200 | | static UINT8 *ram_base; |
| 201 | 200 | static UINT8 has_ym2151; |
| 202 | 201 | static UINT8 is_redline; |
| 203 | 202 | |
| r869 | r870 | |
| 205 | 204 | static UINT8 clock_active; |
| 206 | 205 | static UINT8 clock_tick; |
| 207 | 206 | |
| 208 | | static UINT8 sound_command[2]; |
| 207 | static UINT16 sound_command; |
| 209 | 208 | static UINT8 sound_response; |
| 210 | 209 | |
| 211 | 210 | static UINT32 ext_start; |
| r869 | r870 | |
| 258 | 257 | UINT16 ext[4]; |
| 259 | 258 | }; |
| 260 | 259 | |
| 261 | | static struct i186_state |
| 260 | static struct i80186_state |
| 262 | 261 | { |
| 263 | 262 | struct timer_state timer[3]; |
| 264 | 263 | struct dma_state dma[2]; |
| 265 | 264 | struct intr_state intr; |
| 266 | 265 | struct mem_state mem; |
| 267 | | } i186; |
| 266 | } i80186; |
| 268 | 267 | |
| 269 | 268 | |
| 270 | 269 | #define DAC_BUFFER_SIZE 1024 |
| r869 | r870 | |
| 294 | 293 | |
| 295 | 294 | static void set_dac_frequency(int which, int frequency); |
| 296 | 295 | |
| 297 | | static READ8_HANDLER( peripheral_r ); |
| 298 | | static WRITE8_HANDLER( peripheral_w ); |
| 296 | static READ16_HANDLER( peripheral_r ); |
| 297 | static WRITE16_HANDLER( peripheral_w ); |
| 299 | 298 | |
| 300 | 299 | |
| 301 | 300 | |
| r869 | r870 | |
| 305 | 304 | * |
| 306 | 305 | *************************************/ |
| 307 | 306 | |
| 308 | | static void leland_i186_dac_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length) |
| 307 | static void leland_80186_dac_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length) |
| 309 | 308 | { |
| 310 | 309 | stream_sample_t *buffer = outputs[0]; |
| 311 | 310 | int i, j, start, stop; |
| r869 | r870 | |
| 368 | 367 | * |
| 369 | 368 | *************************************/ |
| 370 | 369 | |
| 371 | | static void leland_i186_dma_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length) |
| 370 | static void leland_80186_dma_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length) |
| 372 | 371 | { |
| 373 | 372 | stream_sample_t *buffer = outputs[0]; |
| 374 | 373 | int i, j; |
| r869 | r870 | |
| 380 | 379 | cpuintrf_push_context(2); |
| 381 | 380 | for (i = 0; i < 2; i++) |
| 382 | 381 | { |
| 383 | | struct dma_state *d = &i186.dma[i]; |
| 382 | struct dma_state *d = &i80186.dma[i]; |
| 384 | 383 | |
| 385 | 384 | /* check for enabled DMA */ |
| 386 | 385 | if (d->control & 0x0002) |
| r869 | r870 | |
| 458 | 457 | * |
| 459 | 458 | *************************************/ |
| 460 | 459 | |
| 461 | | static void leland_i186_extern_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length) |
| 460 | static void leland_80186_extern_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length) |
| 462 | 461 | { |
| 463 | 462 | stream_sample_t *buffer = outputs[0]; |
| 464 | 463 | struct dac_state *d = &dac[7]; |
| r869 | r870 | |
| 502 | 501 | static TIMER_CALLBACK( internal_timer_int ); |
| 503 | 502 | static TIMER_CALLBACK( dma_timer_callback ); |
| 504 | 503 | |
| 505 | | void *leland_i186_sh_start(int clock, const struct CustomSound_interface *config) |
| 504 | void *leland_80186_sh_start(int clock, const struct CustomSound_interface *config) |
| 506 | 505 | { |
| 507 | 506 | int i; |
| 508 | 507 | |
| r869 | r870 | |
| 513 | 512 | has_ym2151 = 1; |
| 514 | 513 | |
| 515 | 514 | /* allocate separate streams for the DMA and non-DMA DACs */ |
| 516 | | dma_stream = stream_create(0, 1, OUTPUT_RATE, NULL, leland_i186_dma_update); |
| 517 | | nondma_stream = stream_create(0, 1, OUTPUT_RATE, NULL, leland_i186_dac_update); |
| 515 | dma_stream = stream_create(0, 1, OUTPUT_RATE, NULL, leland_80186_dma_update); |
| 516 | nondma_stream = stream_create(0, 1, OUTPUT_RATE, NULL, leland_80186_dac_update); |
| 518 | 517 | |
| 519 | 518 | /* if we have a 2151, install an externally driven DAC stream */ |
| 520 | 519 | if (has_ym2151) |
| 521 | 520 | { |
| 522 | 521 | ext_base = memory_region(REGION_SOUND1); |
| 523 | | extern_stream = stream_create(0, 1, OUTPUT_RATE, NULL, leland_i186_extern_update); |
| 522 | extern_stream = stream_create(0, 1, OUTPUT_RATE, NULL, leland_80186_extern_update); |
| 524 | 523 | } |
| 525 | 524 | |
| 526 | 525 | /* by default, we're not redline racer */ |
| 527 | 526 | is_redline = 0; |
| 528 | 527 | |
| 529 | 528 | /* create timers here so they stick around */ |
| 530 | | i186.timer[0].int_timer = mame_timer_alloc(internal_timer_int); |
| 531 | | i186.timer[1].int_timer = mame_timer_alloc(internal_timer_int); |
| 532 | | i186.timer[2].int_timer = mame_timer_alloc(internal_timer_int); |
| 533 | | i186.timer[0].time_timer = mame_timer_alloc(NULL); |
| 534 | | i186.timer[1].time_timer = mame_timer_alloc(NULL); |
| 535 | | i186.timer[2].time_timer = mame_timer_alloc(NULL); |
| 536 | | i186.dma[0].finish_timer = mame_timer_alloc(dma_timer_callback); |
| 537 | | i186.dma[1].finish_timer = mame_timer_alloc(dma_timer_callback); |
| 529 | i80186.timer[0].int_timer = mame_timer_alloc(internal_timer_int); |
| 530 | i80186.timer[1].int_timer = mame_timer_alloc(internal_timer_int); |
| 531 | i80186.timer[2].int_timer = mame_timer_alloc(internal_timer_int); |
| 532 | i80186.timer[0].time_timer = mame_timer_alloc(NULL); |
| 533 | i80186.timer[1].time_timer = mame_timer_alloc(NULL); |
| 534 | i80186.timer[2].time_timer = mame_timer_alloc(NULL); |
| 535 | i80186.dma[0].finish_timer = mame_timer_alloc(dma_timer_callback); |
| 536 | i80186.dma[1].finish_timer = mame_timer_alloc(dma_timer_callback); |
| 538 | 537 | |
| 539 | 538 | for (i = 0; i < 9; i++) |
| 540 | 539 | counter[i].timer = mame_timer_alloc(NULL); |
| r869 | r870 | |
| 543 | 542 | } |
| 544 | 543 | |
| 545 | 544 | |
| 546 | | void *redline_i186_sh_start(int clock, const struct CustomSound_interface *config) |
| 545 | void *redline_80186_sh_start(int clock, const struct CustomSound_interface *config) |
| 547 | 546 | { |
| 548 | | void *result = leland_i186_sh_start(clock, config); |
| 547 | void *result = leland_80186_sh_start(clock, config); |
| 549 | 548 | is_redline = 1; |
| 550 | 549 | return result; |
| 551 | 550 | } |
| 552 | 551 | |
| 553 | 552 | |
| 554 | | static void leland_i186_reset(void) |
| 553 | static void leland_80186_reset(void) |
| 555 | 554 | { |
| 556 | | struct i186_state oldstate = i186; |
| 555 | struct i80186_state oldstate = i80186; |
| 557 | 556 | mame_timer *counter_timer[9]; |
| 558 | 557 | int i; |
| 559 | 558 | |
| 560 | | /* reset the i186 state, but save the timers */ |
| 561 | | memset(&i186, 0, sizeof(i186)); |
| 562 | | i186.timer[0].int_timer = oldstate.timer[0].int_timer; |
| 563 | | i186.timer[1].int_timer = oldstate.timer[1].int_timer; |
| 564 | | i186.timer[2].int_timer = oldstate.timer[2].int_timer; |
| 565 | | i186.timer[0].time_timer = oldstate.timer[0].time_timer; |
| 566 | | i186.timer[1].time_timer = oldstate.timer[1].time_timer; |
| 567 | | i186.timer[2].time_timer = oldstate.timer[2].time_timer; |
| 568 | | i186.dma[0].finish_timer = oldstate.dma[0].finish_timer; |
| 569 | | i186.dma[1].finish_timer = oldstate.dma[1].finish_timer; |
| 559 | /* reset the i80186 state, but save the timers */ |
| 560 | memset(&i80186, 0, sizeof(i80186)); |
| 561 | i80186.timer[0].int_timer = oldstate.timer[0].int_timer; |
| 562 | i80186.timer[1].int_timer = oldstate.timer[1].int_timer; |
| 563 | i80186.timer[2].int_timer = oldstate.timer[2].int_timer; |
| 564 | i80186.timer[0].time_timer = oldstate.timer[0].time_timer; |
| 565 | i80186.timer[1].time_timer = oldstate.timer[1].time_timer; |
| 566 | i80186.timer[2].time_timer = oldstate.timer[2].time_timer; |
| 567 | i80186.dma[0].finish_timer = oldstate.dma[0].finish_timer; |
| 568 | i80186.dma[1].finish_timer = oldstate.dma[1].finish_timer; |
| 570 | 569 | |
| 571 | 570 | /* reset the interrupt state */ |
| 572 | | i186.intr.priority_mask = 0x0007; |
| 573 | | i186.intr.timer = 0x000f; |
| 574 | | i186.intr.dma[0] = 0x000f; |
| 575 | | i186.intr.dma[1] = 0x000f; |
| 576 | | i186.intr.ext[0] = 0x000f; |
| 577 | | i186.intr.ext[1] = 0x000f; |
| 578 | | i186.intr.ext[2] = 0x000f; |
| 579 | | i186.intr.ext[3] = 0x000f; |
| 571 | i80186.intr.priority_mask = 0x0007; |
| 572 | i80186.intr.timer = 0x000f; |
| 573 | i80186.intr.dma[0] = 0x000f; |
| 574 | i80186.intr.dma[1] = 0x000f; |
| 575 | i80186.intr.ext[0] = 0x000f; |
| 576 | i80186.intr.ext[1] = 0x000f; |
| 577 | i80186.intr.ext[2] = 0x000f; |
| 578 | i80186.intr.ext[3] = 0x000f; |
| 580 | 579 | |
| 581 | 580 | /* reset the DAC and counter states as well */ |
| 582 | 581 | memset(&dac, 0, sizeof(dac)); |
| r869 | r870 | |
| 588 | 587 | } |
| 589 | 588 | |
| 590 | 589 | |
| 591 | | void leland_i186_sound_init(void) |
| 590 | void leland_80186_sound_init(void) |
| 592 | 591 | { |
| 593 | | /* reset the I86 registers */ |
| 594 | | leland_i186_reset(); |
| 592 | /* reset the 80186 registers */ |
| 593 | leland_80186_reset(); |
| 595 | 594 | |
| 596 | 595 | /* reset our internal stuff */ |
| 597 | 596 | last_control = 0xf8; |
| r869 | r870 | |
| 613 | 612 | |
| 614 | 613 | static int int_callback(int line) |
| 615 | 614 | { |
| 616 | | if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", mame_time_to_double(mame_timer_get_time()), i186.intr.poll_status & 0x1f); |
| 615 | if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", mame_time_to_double(mame_timer_get_time()), i80186.intr.poll_status & 0x1f); |
| 617 | 616 | |
| 618 | 617 | /* clear the interrupt */ |
| 619 | 618 | activecpu_set_info_int(CPUINFO_INT_INPUT_STATE + 0, CLEAR_LINE); |
| 620 | | i186.intr.pending = 0; |
| 619 | i80186.intr.pending = 0; |
| 621 | 620 | |
| 622 | 621 | /* clear the request and set the in-service bit */ |
| 623 | 622 | #if LATCH_INTS |
| 624 | | i186.intr.request &= ~i186.intr.ack_mask; |
| 623 | i80186.intr.request &= ~i80186.intr.ack_mask; |
| 625 | 624 | #else |
| 626 | | i186.intr.request &= ~(i186.intr.ack_mask & 0x0f); |
| 625 | i80186.intr.request &= ~(i80186.intr.ack_mask & 0x0f); |
| 627 | 626 | #endif |
| 628 | | i186.intr.in_service |= i186.intr.ack_mask; |
| 629 | | if (i186.intr.ack_mask == 0x0001) |
| 627 | i80186.intr.in_service |= i80186.intr.ack_mask; |
| 628 | if (i80186.intr.ack_mask == 0x0001) |
| 630 | 629 | { |
| 631 | | switch (i186.intr.poll_status & 0x1f) |
| 630 | switch (i80186.intr.poll_status & 0x1f) |
| 632 | 631 | { |
| 633 | | case 0x08: i186.intr.status &= ~0x01; break; |
| 634 | | case 0x12: i186.intr.status &= ~0x02; break; |
| 635 | | case 0x13: i186.intr.status &= ~0x04; break; |
| 632 | case 0x08: i80186.intr.status &= ~0x01; break; |
| 633 | case 0x12: i80186.intr.status &= ~0x02; break; |
| 634 | case 0x13: i80186.intr.status &= ~0x04; break; |
| 636 | 635 | } |
| 637 | 636 | } |
| 638 | | i186.intr.ack_mask = 0; |
| 637 | i80186.intr.ack_mask = 0; |
| 639 | 638 | |
| 640 | 639 | /* a request no longer pending */ |
| 641 | | i186.intr.poll_status &= ~0x8000; |
| 640 | i80186.intr.poll_status &= ~0x8000; |
| 642 | 641 | |
| 643 | 642 | /* return the vector */ |
| 644 | | return i186.intr.poll_status & 0x1f; |
| 643 | return i80186.intr.poll_status & 0x1f; |
| 645 | 644 | } |
| 646 | 645 | |
| 647 | 646 | |
| r869 | r870 | |
| 649 | 648 | { |
| 650 | 649 | int i, j, new_vector = 0; |
| 651 | 650 | |
| 652 | | if (LOG_INTERRUPTS) logerror("update_interrupt_status: req=%02X stat=%02X serv=%02X\n", i186.intr.request, i186.intr.status, i186.intr.in_service); |
| 651 | if (LOG_INTERRUPTS) logerror("update_interrupt_status: req=%02X stat=%02X serv=%02X\n", i80186.intr.request, i80186.intr.status, i80186.intr.in_service); |
| 653 | 652 | |
| 654 | 653 | /* loop over priorities */ |
| 655 | | for (i = 0; i <= i186.intr.priority_mask; i++) |
| 654 | for (i = 0; i <= i80186.intr.priority_mask; i++) |
| 656 | 655 | { |
| 657 | 656 | /* note: by checking 4 bits, we also verify that the mask is off */ |
| 658 | | if ((i186.intr.timer & 15) == i) |
| 657 | if ((i80186.intr.timer & 15) == i) |
| 659 | 658 | { |
| 660 | 659 | /* if we're already servicing something at this level, don't generate anything new */ |
| 661 | | if (i186.intr.in_service & 0x01) |
| 660 | if (i80186.intr.in_service & 0x01) |
| 662 | 661 | return; |
| 663 | 662 | |
| 664 | 663 | /* if there's something pending, generate an interrupt */ |
| 665 | | if (i186.intr.status & 0x07) |
| 664 | if (i80186.intr.status & 0x07) |
| 666 | 665 | { |
| 667 | | if (i186.intr.status & 1) |
| 666 | if (i80186.intr.status & 1) |
| 668 | 667 | new_vector = 0x08; |
| 669 | | else if (i186.intr.status & 2) |
| 668 | else if (i80186.intr.status & 2) |
| 670 | 669 | new_vector = 0x12; |
| 671 | | else if (i186.intr.status & 4) |
| 670 | else if (i80186.intr.status & 4) |
| 672 | 671 | new_vector = 0x13; |
| 673 | 672 | else |
| 674 | 673 | popmessage("Invalid timer interrupt!"); |
| 675 | 674 | |
| 676 | 675 | /* set the clear mask and generate the int */ |
| 677 | | i186.intr.ack_mask = 0x0001; |
| 676 | i80186.intr.ack_mask = 0x0001; |
| 678 | 677 | goto generate_int; |
| 679 | 678 | } |
| 680 | 679 | } |
| 681 | 680 | |
| 682 | 681 | /* check DMA interrupts */ |
| 683 | 682 | for (j = 0; j < 2; j++) |
| 684 | | if ((i186.intr.dma[j] & 15) == i) |
| 683 | if ((i80186.intr.dma[j] & 15) == i) |
| 685 | 684 | { |
| 686 | 685 | /* if we're already servicing something at this level, don't generate anything new */ |
| 687 | | if (i186.intr.in_service & (0x04 << j)) |
| 686 | if (i80186.intr.in_service & (0x04 << j)) |
| 688 | 687 | return; |
| 689 | 688 | |
| 690 | 689 | /* if there's something pending, generate an interrupt */ |
| 691 | | if (i186.intr.request & (0x04 << j)) |
| 690 | if (i80186.intr.request & (0x04 << j)) |
| 692 | 691 | { |
| 693 | 692 | new_vector = 0x0a + j; |
| 694 | 693 | |
| 695 | 694 | /* set the clear mask and generate the int */ |
| 696 | | i186.intr.ack_mask = 0x0004 << j; |
| 695 | i80186.intr.ack_mask = 0x0004 << j; |
| 697 | 696 | goto generate_int; |
| 698 | 697 | } |
| 699 | 698 | } |
| 700 | 699 | |
| 701 | 700 | /* check external interrupts */ |
| 702 | 701 | for (j = 0; j < 4; j++) |
| 703 | | if ((i186.intr.ext[j] & 15) == i) |
| 702 | if ((i80186.intr.ext[j] & 15) == i) |
| 704 | 703 | { |
| 705 | 704 | /* if we're already servicing something at this level, don't generate anything new */ |
| 706 | | if (i186.intr.in_service & (0x10 << j)) |
| 705 | if (i80186.intr.in_service & (0x10 << j)) |
| 707 | 706 | return; |
| 708 | 707 | |
| 709 | 708 | /* if there's something pending, generate an interrupt */ |
| 710 | | if (i186.intr.request & (0x10 << j)) |
| 709 | if (i80186.intr.request & (0x10 << j)) |
| 711 | 710 | { |
| 712 | 711 | /* otherwise, generate an interrupt for this request */ |
| 713 | 712 | new_vector = 0x0c + j; |
| 714 | 713 | |
| 715 | 714 | /* set the clear mask and generate the int */ |
| 716 | | i186.intr.ack_mask = 0x0010 << j; |
| 715 | i80186.intr.ack_mask = 0x0010 << j; |
| 717 | 716 | goto generate_int; |
| 718 | 717 | } |
| 719 | 718 | } |
| r869 | r870 | |
| 722 | 721 | |
| 723 | 722 | generate_int: |
| 724 | 723 | /* generate the appropriate interrupt */ |
| 725 | | i186.intr.poll_status = 0x8000 | new_vector; |
| 726 | | if (!i186.intr.pending) |
| 724 | i80186.intr.poll_status = 0x8000 | new_vector; |
| 725 | if (!i80186.intr.pending) |
| 727 | 726 | cpunum_set_input_line(2, 0, ASSERT_LINE); |
| 728 | | i186.intr.pending = 1; |
| 727 | i80186.intr.pending = 1; |
| 729 | 728 | if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", mame_time_to_double(mame_timer_get_time()), new_vector); |
| 730 | 729 | } |
| 731 | 730 | |
| r869 | r870 | |
| 740 | 739 | /* turn off the appropriate in-service bit */ |
| 741 | 740 | switch (data & 0x1f) |
| 742 | 741 | { |
| 743 | | case 0x08: i186.intr.in_service &= ~0x01; break; |
| 744 | | case 0x12: i186.intr.in_service &= ~0x01; break; |
| 745 | | case 0x13: i186.intr.in_service &= ~0x01; break; |
| 746 | | case 0x0a: i186.intr.in_service &= ~0x04; break; |
| 747 | | case 0x0b: i186.intr.in_service &= ~0x08; break; |
| 748 | | case 0x0c: i186.intr.in_service &= ~0x10; break; |
| 749 | | case 0x0d: i186.intr.in_service &= ~0x20; break; |
| 750 | | case 0x0e: i186.intr.in_service &= ~0x40; break; |
| 751 | | case 0x0f: i186.intr.in_service &= ~0x80; break; |
| 742 | case 0x08: i80186.intr.in_service &= ~0x01; break; |
| 743 | case 0x12: i80186.intr.in_service &= ~0x01; break; |
| 744 | case 0x13: i80186.intr.in_service &= ~0x01; break; |
| 745 | case 0x0a: i80186.intr.in_service &= ~0x04; break; |
| 746 | case 0x0b: i80186.intr.in_service &= ~0x08; break; |
| 747 | case 0x0c: i80186.intr.in_service &= ~0x10; break; |
| 748 | case 0x0d: i80186.intr.in_service &= ~0x20; break; |
| 749 | case 0x0e: i80186.intr.in_service &= ~0x40; break; |
| 750 | case 0x0f: i80186.intr.in_service &= ~0x80; break; |
| 752 | 751 | default: logerror("%05X:ERROR - 80186 EOI with unknown vector %02X\n", activecpu_get_pc(), data & 0x1f); |
| 753 | 752 | } |
| 754 | 753 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", mame_time_to_double(mame_timer_get_time()), data & 0x1f); |
| r869 | r870 | |
| 761 | 760 | for (i = 0; i <= 7; i++) |
| 762 | 761 | { |
| 763 | 762 | /* check for in-service timers */ |
| 764 | | if ((i186.intr.timer & 7) == i && (i186.intr.in_service & 0x01)) |
| 763 | if ((i80186.intr.timer & 7) == i && (i80186.intr.in_service & 0x01)) |
| 765 | 764 | { |
| 766 | | i186.intr.in_service &= ~0x01; |
| 765 | i80186.intr.in_service &= ~0x01; |
| 767 | 766 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for timer\n", mame_time_to_double(mame_timer_get_time())); |
| 768 | 767 | return; |
| 769 | 768 | } |
| 770 | 769 | |
| 771 | 770 | /* check for in-service DMA interrupts */ |
| 772 | 771 | for (j = 0; j < 2; j++) |
| 773 | | if ((i186.intr.dma[j] & 7) == i && (i186.intr.in_service & (0x04 << j))) |
| 772 | if ((i80186.intr.dma[j] & 7) == i && (i80186.intr.in_service & (0x04 << j))) |
| 774 | 773 | { |
| 775 | | i186.intr.in_service &= ~(0x04 << j); |
| 774 | i80186.intr.in_service &= ~(0x04 << j); |
| 776 | 775 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for DMA%d\n", mame_time_to_double(mame_timer_get_time()), j); |
| 777 | 776 | return; |
| 778 | 777 | } |
| 779 | 778 | |
| 780 | 779 | /* check external interrupts */ |
| 781 | 780 | for (j = 0; j < 4; j++) |
| 782 | | if ((i186.intr.ext[j] & 7) == i && (i186.intr.in_service & (0x10 << j))) |
| 781 | if ((i80186.intr.ext[j] & 7) == i && (i80186.intr.in_service & (0x10 << j))) |
| 783 | 782 | { |
| 784 | | i186.intr.in_service &= ~(0x10 << j); |
| 783 | i80186.intr.in_service &= ~(0x10 << j); |
| 785 | 784 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for INT%d\n", mame_time_to_double(mame_timer_get_time()), j); |
| 786 | 785 | return; |
| 787 | 786 | } |
| r869 | r870 | |
| 800 | 799 | static TIMER_CALLBACK( internal_timer_int ) |
| 801 | 800 | { |
| 802 | 801 | int which = param; |
| 803 | | struct timer_state *t = &i186.timer[which]; |
| 802 | struct timer_state *t = &i80186.timer[which]; |
| 804 | 803 | |
| 805 | 804 | if (LOG_TIMER) logerror("Hit interrupt callback for timer %d\n", which); |
| 806 | 805 | |
| r869 | r870 | |
| 810 | 809 | /* request an interrupt */ |
| 811 | 810 | if (t->control & 0x2000) |
| 812 | 811 | { |
| 813 | | i186.intr.status |= 0x01 << which; |
| 812 | i80186.intr.status |= 0x01 << which; |
| 814 | 813 | update_interrupt_state(); |
| 815 | 814 | if (LOG_TIMER) logerror(" Generating timer interrupt\n"); |
| 816 | 815 | } |
| r869 | r870 | |
| 829 | 828 | |
| 830 | 829 | static void internal_timer_sync(int which) |
| 831 | 830 | { |
| 832 | | struct timer_state *t = &i186.timer[which]; |
| 831 | struct timer_state *t = &i80186.timer[which]; |
| 833 | 832 | |
| 834 | 833 | /* if we have a timing timer running, adjust the count */ |
| 835 | 834 | if (t->time_timer_active) |
| r869 | r870 | |
| 853 | 852 | |
| 854 | 853 | static void internal_timer_update(int which, int new_count, int new_maxA, int new_maxB, int new_control) |
| 855 | 854 | { |
| 856 | | struct timer_state *t = &i186.timer[which]; |
| 855 | struct timer_state *t = &i80186.timer[which]; |
| 857 | 856 | int update_int_timer = 0; |
| 858 | 857 | |
| 859 | 858 | /* if we have a new count and we're on, update things */ |
| r869 | r870 | |
| 994 | 993 | static TIMER_CALLBACK( dma_timer_callback ) |
| 995 | 994 | { |
| 996 | 995 | int which = param; |
| 997 | | struct dma_state *d = &i186.dma[which]; |
| 996 | struct dma_state *d = &i80186.dma[which]; |
| 998 | 997 | |
| 999 | 998 | /* force an update and see if we're really done */ |
| 1000 | 999 | stream_update(dma_stream); |
| r869 | r870 | |
| 1008 | 1007 | if (d->control & 0x0100) |
| 1009 | 1008 | { |
| 1010 | 1009 | if (LOG_DMA) logerror("DMA%d timer callback - requesting interrupt: count = %04X, source = %04X\n", which, d->count, d->source); |
| 1011 | | i186.intr.request |= 0x04 << which; |
| 1010 | i80186.intr.request |= 0x04 << which; |
| 1012 | 1011 | update_interrupt_state(); |
| 1013 | 1012 | } |
| 1014 | 1013 | } |
| r869 | r870 | |
| 1016 | 1015 | |
| 1017 | 1016 | static void update_dma_control(int which, int new_control) |
| 1018 | 1017 | { |
| 1019 | | struct dma_state *d = &i186.dma[which]; |
| 1018 | struct dma_state *d = &i80186.dma[which]; |
| 1020 | 1019 | int diff; |
| 1021 | 1020 | |
| 1022 | 1021 | /* handle the CHG bit */ |
| r869 | r870 | |
| 1080 | 1079 | * |
| 1081 | 1080 | *************************************/ |
| 1082 | 1081 | |
| 1083 | | static READ8_HANDLER( i186_internal_port_r ) |
| 1082 | static READ16_HANDLER( i80186_internal_port_r ) |
| 1084 | 1083 | { |
| 1085 | | int shift = 8 * (offset & 1); |
| 1086 | 1084 | int temp, which; |
| 1087 | 1085 | |
| 1088 | | switch (offset & ~1) |
| 1086 | switch (offset) |
| 1089 | 1087 | { |
| 1090 | | case 0x22: |
| 1088 | case 0x22/2: |
| 1091 | 1089 | logerror("%05X:ERROR - read from 80186 EOI\n", activecpu_get_pc()); |
| 1092 | 1090 | break; |
| 1093 | 1091 | |
| 1094 | | case 0x24: |
| 1092 | case 0x24/2: |
| 1095 | 1093 | if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll\n", activecpu_get_pc()); |
| 1096 | | if (i186.intr.poll_status & 0x8000) |
| 1094 | if (i80186.intr.poll_status & 0x8000) |
| 1097 | 1095 | int_callback(0); |
| 1098 | | return (i186.intr.poll_status >> shift) & 0xff; |
| 1096 | return i80186.intr.poll_status; |
| 1099 | 1097 | |
| 1100 | | case 0x26: |
| 1098 | case 0x26/2: |
| 1101 | 1099 | if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll status\n", activecpu_get_pc()); |
| 1102 | | return (i186.intr.poll_status >> shift) & 0xff; |
| 1100 | return i80186.intr.poll_status; |
| 1103 | 1101 | |
| 1104 | | case 0x28: |
| 1102 | case 0x28/2: |
| 1105 | 1103 | if (LOG_PORTS) logerror("%05X:read 80186 interrupt mask\n", activecpu_get_pc()); |
| 1106 | | temp = (i186.intr.timer >> 3) & 0x01; |
| 1107 | | temp |= (i186.intr.dma[0] >> 1) & 0x04; |
| 1108 | | temp |= (i186.intr.dma[1] >> 0) & 0x08; |
| 1109 | | temp |= (i186.intr.ext[0] << 1) & 0x10; |
| 1110 | | temp |= (i186.intr.ext[1] << 2) & 0x20; |
| 1111 | | temp |= (i186.intr.ext[2] << 3) & 0x40; |
| 1112 | | temp |= (i186.intr.ext[3] << 4) & 0x80; |
| 1113 | | return (temp >> shift) & 0xff; |
| 1104 | temp = (i80186.intr.timer >> 3) & 0x01; |
| 1105 | temp |= (i80186.intr.dma[0] >> 1) & 0x04; |
| 1106 | temp |= (i80186.intr.dma[1] >> 0) & 0x08; |
| 1107 | temp |= (i80186.intr.ext[0] << 1) & 0x10; |
| 1108 | temp |= (i80186.intr.ext[1] << 2) & 0x20; |
| 1109 | temp |= (i80186.intr.ext[2] << 3) & 0x40; |
| 1110 | temp |= (i80186.intr.ext[3] << 4) & 0x80; |
| 1111 | return temp; |
| 1114 | 1112 | |
| 1115 | | case 0x2a: |
| 1113 | case 0x2a/2: |
| 1116 | 1114 | if (LOG_PORTS) logerror("%05X:read 80186 interrupt priority mask\n", activecpu_get_pc()); |
| 1117 | | return (i186.intr.priority_mask >> shift) & 0xff; |
| 1115 | return i80186.intr.priority_mask; |
| 1118 | 1116 | |
| 1119 | | case 0x2c: |
| 1117 | case 0x2c/2: |
| 1120 | 1118 | if (LOG_PORTS) logerror("%05X:read 80186 interrupt in-service\n", activecpu_get_pc()); |
| 1121 | | return (i186.intr.in_service >> shift) & 0xff; |
| 1119 | return i80186.intr.in_service; |
| 1122 | 1120 | |
| 1123 | | case 0x2e: |
| 1121 | case 0x2e/2: |
| 1124 | 1122 | if (LOG_PORTS) logerror("%05X:read 80186 interrupt request\n", activecpu_get_pc()); |
| 1125 | | temp = i186.intr.request & ~0x0001; |
| 1126 | | if (i186.intr.status & 0x0007) |
| 1123 | temp = i80186.intr.request & ~0x0001; |
| 1124 | if (i80186.intr.status & 0x0007) |
| 1127 | 1125 | temp |= 1; |
| 1128 | | return (temp >> shift) & 0xff; |
| 1126 | return temp; |
| 1129 | 1127 | |
| 1130 | | case 0x30: |
| 1128 | case 0x30/2: |
| 1131 | 1129 | if (LOG_PORTS) logerror("%05X:read 80186 interrupt status\n", activecpu_get_pc()); |
| 1132 | | return (i186.intr.status >> shift) & 0xff; |
| 1130 | return i80186.intr.status; |
| 1133 | 1131 | |
| 1134 | | case 0x32: |
| 1132 | case 0x32/2: |
| 1135 | 1133 | if (LOG_PORTS) logerror("%05X:read 80186 timer interrupt control\n", activecpu_get_pc()); |
| 1136 | | return (i186.intr.timer >> shift) & 0xff; |
| 1134 | return i80186.intr.timer; |
| 1137 | 1135 | |
| 1138 | | case 0x34: |
| 1136 | case 0x34/2: |
| 1139 | 1137 | if (LOG_PORTS) logerror("%05X:read 80186 DMA 0 interrupt control\n", activecpu_get_pc()); |
| 1140 | | return (i186.intr.dma[0] >> shift) & 0xff; |
| 1138 | return i80186.intr.dma[0]; |
| 1141 | 1139 | |
| 1142 | | case 0x36: |
| 1140 | case 0x36/2: |
| 1143 | 1141 | if (LOG_PORTS) logerror("%05X:read 80186 DMA 1 interrupt control\n", activecpu_get_pc()); |
| 1144 | | return (i186.intr.dma[1] >> shift) & 0xff; |
| 1142 | return i80186.intr.dma[1]; |
| 1145 | 1143 | |
| 1146 | | case 0x38: |
| 1144 | case 0x38/2: |
| 1147 | 1145 | if (LOG_PORTS) logerror("%05X:read 80186 INT 0 interrupt control\n", activecpu_get_pc()); |
| 1148 | | return (i186.intr.ext[0] >> shift) & 0xff; |
| 1146 | return i80186.intr.ext[0]; |
| 1149 | 1147 | |
| 1150 | | case 0x3a: |
| 1148 | case 0x3a/2: |
| 1151 | 1149 | if (LOG_PORTS) logerror("%05X:read 80186 INT 1 interrupt control\n", activecpu_get_pc()); |
| 1152 | | return (i186.intr.ext[1] >> shift) & 0xff; |
| 1150 | return i80186.intr.ext[1]; |
| 1153 | 1151 | |
| 1154 | | case 0x3c: |
| 1152 | case 0x3c/2: |
| 1155 | 1153 | if (LOG_PORTS) logerror("%05X:read 80186 INT 2 interrupt control\n", activecpu_get_pc()); |
| 1156 | | return (i186.intr.ext[2] >> shift) & 0xff; |
| 1154 | return i80186.intr.ext[2]; |
| 1157 | 1155 | |
| 1158 | | case 0x3e: |
| 1156 | case 0x3e/2: |
| 1159 | 1157 | if (LOG_PORTS) logerror("%05X:read 80186 INT 3 interrupt control\n", activecpu_get_pc()); |
| 1160 | | return (i186.intr.ext[3] >> shift) & 0xff; |
| 1158 | return i80186.intr.ext[3]; |
| 1161 | 1159 | |
| 1162 | | case 0x50: |
| 1163 | | case 0x58: |
| 1164 | | case 0x60: |
| 1165 | | if (LOG_PORTS) logerror("%05X:read 80186 Timer %d count\n", activecpu_get_pc(), (offset - 0x50) / 8); |
| 1166 | | which = (offset - 0x50) / 8; |
| 1167 | | if (!(offset & 1)) |
| 1160 | case 0x50/2: |
| 1161 | case 0x58/2: |
| 1162 | case 0x60/2: |
| 1163 | if (LOG_PORTS) logerror("%05X:read 80186 Timer %d count\n", activecpu_get_pc(), (offset - 0x50/2) / 4); |
| 1164 | which = (offset - 0x50/2) / 4; |
| 1165 | if (ACCESSING_LSB) |
| 1168 | 1166 | internal_timer_sync(which); |
| 1169 | | return (i186.timer[which].count >> shift) & 0xff; |
| 1167 | return i80186.timer[which].count; |
| 1170 | 1168 | |
| 1171 | | case 0x52: |
| 1172 | | case 0x5a: |
| 1173 | | case 0x62: |
| 1174 | | if (LOG_PORTS) logerror("%05X:read 80186 Timer %d max A\n", activecpu_get_pc(), (offset - 0x50) / 8); |
| 1175 | | which = (offset - 0x50) / 8; |
| 1176 | | return (i186.timer[which].maxA >> shift) & 0xff; |
| 1169 | case 0x52/2: |
| 1170 | case 0x5a/2: |
| 1171 | case 0x62/2: |
| 1172 | if (LOG_PORTS) logerror("%05X:read 80186 Timer %d max A\n", activecpu_get_pc(), (offset - 0x50/2) / 4); |
| 1173 | which = (offset - 0x50/2) / 4; |
| 1174 | return i80186.timer[which].maxA; |
| 1177 | 1175 | |
| 1178 | | case 0x54: |
| 1179 | | case 0x5c: |
| 1180 | | logerror("%05X:read 80186 Timer %d max B\n", activecpu_get_pc(), (offset - 0x50) / 8); |
| 1181 | | which = (offset - 0x50) / 8; |
| 1182 | | return (i186.timer[which].maxB >> shift) & 0xff; |
| 1176 | case 0x54/2: |
| 1177 | case 0x5c/2: |
| 1178 | logerror("%05X:read 80186 Timer %d max B\n", activecpu_get_pc(), (offset/2 - 0x50) / 4); |
| 1179 | which = (offset - 0x50/2) / 4; |
| 1180 | return i80186.timer[which].maxB; |
| 1183 | 1181 | |
| 1184 | | case 0x56: |
| 1185 | | case 0x5e: |
| 1186 | | case 0x66: |
| 1187 | | if (LOG_PORTS) logerror("%05X:read 80186 Timer %d control\n", activecpu_get_pc(), (offset - 0x50) / 8); |
| 1188 | | which = (offset - 0x50) / 8; |
| 1189 | | return (i186.timer[which].control >> shift) & 0xff; |
| 1182 | case 0x56/2: |
| 1183 | case 0x5e/2: |
| 1184 | case 0x66/2: |
| 1185 | if (LOG_PORTS) logerror("%05X:read 80186 Timer %d control\n", activecpu_get_pc(), (offset - 0x50/2) / 4); |
| 1186 | which = (offset - 0x50/2) / 4; |
| 1187 | return i80186.timer[which].control; |
| 1190 | 1188 | |
| 1191 | | case 0xa0: |
| 1189 | case 0xa0/2: |
| 1192 | 1190 | if (LOG_PORTS) logerror("%05X:read 80186 upper chip select\n", activecpu_get_pc()); |
| 1193 | | return (i186.mem.upper >> shift) & 0xff; |
| 1191 | return i80186.mem.upper; |
| 1194 | 1192 | |
| 1195 | | case 0xa2: |
| 1193 | case 0xa2/2: |
| 1196 | 1194 | if (LOG_PORTS) logerror("%05X:read 80186 lower chip select\n", activecpu_get_pc()); |
| 1197 | | return (i186.mem.lower >> shift) & 0xff; |
| 1195 | return i80186.mem.lower; |
| 1198 | 1196 | |
| 1199 | | case 0xa4: |
| 1197 | case 0xa4/2: |
| 1200 | 1198 | if (LOG_PORTS) logerror("%05X:read 80186 peripheral chip select\n", activecpu_get_pc()); |
| 1201 | | return (i186.mem.peripheral >> shift) & 0xff; |
| 1199 | return i80186.mem.peripheral; |
| 1202 | 1200 | |
| 1203 | | case 0xa6: |
| 1201 | case 0xa6/2: |
| 1204 | 1202 | if (LOG_PORTS) logerror("%05X:read 80186 middle chip select\n", activecpu_get_pc()); |
| 1205 | | return (i186.mem.middle >> shift) & 0xff; |
| 1203 | return i80186.mem.middle; |
| 1206 | 1204 | |
| 1207 | | case 0xa8: |
| 1205 | case 0xa8/2: |
| 1208 | 1206 | if (LOG_PORTS) logerror("%05X:read 80186 middle P chip select\n", activecpu_get_pc()); |
| 1209 | | return (i186.mem.middle_size >> shift) & 0xff; |
| 1207 | return i80186.mem.middle_size; |
| 1210 | 1208 | |
| 1211 | | case 0xc0: |
| 1212 | | case 0xd0: |
| 1213 | | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower source address\n", activecpu_get_pc(), (offset - 0xc0) / 0x10); |
| 1214 | | which = (offset - 0xc0) / 0x10; |
| 1209 | case 0xc0/2: |
| 1210 | case 0xd0/2: |
| 1211 | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower source address\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); |
| 1212 | which = (offset - 0xc0/2) / 8; |
| 1215 | 1213 | stream_update(dma_stream); |
| 1216 | | return (i186.dma[which].source >> shift) & 0xff; |
| 1214 | return i80186.dma[which].source; |
| 1217 | 1215 | |
| 1218 | | case 0xc2: |
| 1219 | | case 0xd2: |
| 1220 | | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper source address\n", activecpu_get_pc(), (offset - 0xc0) / 0x10); |
| 1221 | | which = (offset - 0xc0) / 0x10; |
| 1216 | case 0xc2/2: |
| 1217 | case 0xd2/2: |
| 1218 | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper source address\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); |
| 1219 | which = (offset - 0xc0/2) / 8; |
| 1222 | 1220 | stream_update(dma_stream); |
| 1223 | | return (i186.dma[which].source >> (shift + 16)) & 0xff; |
| 1221 | return i80186.dma[which].source >> 16; |
| 1224 | 1222 | |
| 1225 | | case 0xc4: |
| 1226 | | case 0xd4: |
| 1227 | | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower dest address\n", activecpu_get_pc(), (offset - 0xc0) / 0x10); |
| 1228 | | which = (offset - 0xc0) / 0x10; |
| 1223 | case 0xc4/2: |
| 1224 | case 0xd4/2: |
| 1225 | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower dest address\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); |
| 1226 | which = (offset - 0xc0/2) / 8; |
| 1229 | 1227 | stream_update(dma_stream); |
| 1230 | | return (i186.dma[which].dest >> shift) & 0xff; |
| 1228 | return i80186.dma[which].dest; |
| 1231 | 1229 | |
| 1232 | | case 0xc6: |
| 1233 | | case 0xd6: |
| 1234 | | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper dest address\n", activecpu_get_pc(), (offset - 0xc0) / 0x10); |
| 1235 | | which = (offset - 0xc0) / 0x10; |
| 1230 | case 0xc6/2: |
| 1231 | case 0xd6/2: |
| 1232 | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper dest address\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); |
| 1233 | which = (offset - 0xc0/2) / 8; |
| 1236 | 1234 | stream_update(dma_stream); |
| 1237 | | return (i186.dma[which].dest >> (shift + 16)) & 0xff; |
| 1235 | return i80186.dma[which].dest >> 16; |
| 1238 | 1236 | |
| 1239 | | case 0xc8: |
| 1240 | | case 0xd8: |
| 1241 | | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d transfer count\n", activecpu_get_pc(), (offset - 0xc0) / 0x10); |
| 1242 | | which = (offset - 0xc0) / 0x10; |
| 1237 | case 0xc8/2: |
| 1238 | case 0xd8/2: |
| 1239 | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d transfer count\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); |
| 1240 | which = (offset - 0xc0/2) / 8; |
| 1243 | 1241 | stream_update(dma_stream); |
| 1244 | | return (i186.dma[which].count >> shift) & 0xff; |
| 1242 | return i80186.dma[which].count; |
| 1245 | 1243 | |
| 1246 | | case 0xca: |
| 1247 | | case 0xda: |
| 1248 | | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d control\n", activecpu_get_pc(), (offset - 0xc0) / 0x10); |
| 1249 | | which = (offset - 0xc0) / 0x10; |
| 1244 | case 0xca/2: |
| 1245 | case 0xda/2: |
| 1246 | if (LOG_PORTS) logerror("%05X:read 80186 DMA%d control\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); |
| 1247 | which = (offset - 0xc0/2) / 8; |
| 1250 | 1248 | stream_update(dma_stream); |
| 1251 | | return (i186.dma[which].control >> shift) & 0xff; |
| 1249 | return i80186.dma[which].control; |
| 1252 | 1250 | |
| 1253 | 1251 | default: |
| 1254 | | logerror("%05X:read 80186 port %02X\n", activecpu_get_pc(), offset); |
| 1252 | logerror("%05X:read 80186 port %02X\n", activecpu_get_pc(), offset*2); |
| 1255 | 1253 | break; |
| 1256 | 1254 | } |
| 1257 | 1255 | return 0x00; |
| r869 | r870 | |
| 1265 | 1263 | * |
| 1266 | 1264 | *************************************/ |
| 1267 | 1265 | |
| 1268 | | static WRITE8_HANDLER( i186_internal_port_w ) |
| 1266 | static WRITE16_HANDLER( i80186_internal_port_w ) |
| 1269 | 1267 | { |
| 1270 | | static UINT8 even_byte; |
| 1271 | | int temp, which, data16; |
| 1268 | int temp, which; |
| 1272 | 1269 | |
| 1273 | | /* warning: this assumes all port writes here are word-sized */ |
| 1274 | | if (!(offset & 1)) |
| 1275 | | { |
| 1276 | | even_byte = data; |
| 1277 | | return; |
| 1278 | | } |
| 1279 | | data16 = (data << 8) | even_byte; |
| 1270 | /* handle partials */ |
| 1271 | if (!ACCESSING_MSB) |
| 1272 | data = (i80186_internal_port_r(offset, 0) & 0xff00) | (data & 0x00ff); |
| 1273 | else if (!ACCESSING_LSB) |
| 1274 | data = (i80186_internal_port_r(offset, 0) & 0x00ff) | (data & 0xff00); |
| 1280 | 1275 | |
| 1281 | | switch (offset & ~1) |
| 1276 | switch (offset) |
| 1282 | 1277 | { |
| 1283 | | case 0x22: |
| 1284 | | if (LOG_PORTS) logerror("%05X:80186 EOI = %04X\n", activecpu_get_pc(), data16); |
| 1278 | case 0x22/2: |
| 1279 | if (LOG_PORTS) logerror("%05X:80186 EOI = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1285 | 1280 | handle_eoi(0x8000); |
| 1286 | 1281 | update_interrupt_state(); |
| 1287 | 1282 | break; |
| 1288 | 1283 | |
| 1289 | | case 0x24: |
| 1290 | | logerror("%05X:ERROR - write to 80186 interrupt poll = %04X\n", activecpu_get_pc(), data16); |
| 1284 | case 0x24/2: |
| 1285 | logerror("%05X:ERROR - write to 80186 interrupt poll = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1291 | 1286 | break; |
| 1292 | 1287 | |
| 1293 | | case 0x26: |
| 1294 | | logerror("%05X:ERROR - write to 80186 interrupt poll status = %04X\n", activecpu_get_pc(), data16); |
| 1288 | case 0x26/2: |
| 1289 | logerror("%05X:ERROR - write to 80186 interrupt poll status = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1295 | 1290 | break; |
| 1296 | 1291 | |
| 1297 | | case 0x28: |
| 1298 | | if (LOG_PORTS) logerror("%05X:80186 interrupt mask = %04X\n", activecpu_get_pc(), data16); |
| 1299 | | i186.intr.timer = (i186.intr.timer & ~0x08) | ((data16 << 3) & 0x08); |
| 1300 | | i186.intr.dma[0] = (i186.intr.dma[0] & ~0x08) | ((data16 << 1) & 0x08); |
| 1301 | | i186.intr.dma[1] = (i186.intr.dma[1] & ~0x08) | ((data16 << 0) & 0x08); |
| 1302 | | i186.intr.ext[0] = (i186.intr.ext[0] & ~0x08) | ((data16 >> 1) & 0x08); |
| 1303 | | i186.intr.ext[1] = (i186.intr.ext[1] & ~0x08) | ((data16 >> 2) & 0x08); |
| 1304 | | i186.intr.ext[2] = (i186.intr.ext[2] & ~0x08) | ((data16 >> 3) & 0x08); |
| 1305 | | i186.intr.ext[3] = (i186.intr.ext[3] & ~0x08) | ((data16 >> 4) & 0x08); |
| 1292 | case 0x28/2: |
| 1293 | if (LOG_PORTS) logerror("%05X:80186 interrupt mask = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1294 | i80186.intr.timer = (i80186.intr.timer & ~0x08) | ((data << 3) & 0x08); |
| 1295 | i80186.intr.dma[0] = (i80186.intr.dma[0] & ~0x08) | ((data << 1) & 0x08); |
| 1296 | i80186.intr.dma[1] = (i80186.intr.dma[1] & ~0x08) | ((data << 0) & 0x08); |
| 1297 | i80186.intr.ext[0] = (i80186.intr.ext[0] & ~0x08) | ((data >> 1) & 0x08); |
| 1298 | i80186.intr.ext[1] = (i80186.intr.ext[1] & ~0x08) | ((data >> 2) & 0x08); |
| 1299 | i80186.intr.ext[2] = (i80186.intr.ext[2] & ~0x08) | ((data >> 3) & 0x08); |
| 1300 | i80186.intr.ext[3] = (i80186.intr.ext[3] & ~0x08) | ((data >> 4) & 0x08); |
| 1306 | 1301 | update_interrupt_state(); |
| 1307 | 1302 | break; |
| 1308 | 1303 | |
| 1309 | | case 0x2a: |
| 1310 | | if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X\n", activecpu_get_pc(), data16); |
| 1311 | | i186.intr.priority_mask = data16 & 0x0007; |
| 1304 | case 0x2a/2: |
| 1305 | if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1306 | i80186.intr.priority_mask = data & 0x0007; |
| 1312 | 1307 | update_interrupt_state(); |
| 1313 | 1308 | break; |
| 1314 | 1309 | |
| 1315 | | case 0x2c: |
| 1316 | | if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X\n", activecpu_get_pc(), data16); |
| 1317 | | i186.intr.in_service = data16 & 0x00ff; |
| 1310 | case 0x2c/2: |
| 1311 | if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1312 | i80186.intr.in_service = data & 0x00ff; |
| 1318 | 1313 | update_interrupt_state(); |
| 1319 | 1314 | break; |
| 1320 | 1315 | |
| 1321 | | case 0x2e: |
| 1322 | | if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X\n", activecpu_get_pc(), data16); |
| 1323 | | i186.intr.request = (i186.intr.request & ~0x00c0) | (data16 & 0x00c0); |
| 1316 | case 0x2e/2: |
| 1317 | if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1318 | i80186.intr.request = (i80186.intr.request & ~0x00c0) | (data & 0x00c0); |
| 1324 | 1319 | update_interrupt_state(); |
| 1325 | 1320 | break; |
| 1326 | 1321 | |
| 1327 | | case 0x30: |
| 1328 | | if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X\n", activecpu_get_pc(), data16); |
| 1329 | | i186.intr.status = (i186.intr.status & ~0x8007) | (data16 & 0x8007); |
| 1322 | case 0x30/2: |
| 1323 | if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1324 | i80186.intr.status = (i80186.intr.status & ~0x8000) | (data & 0x8000); |
| 1325 | i80186.intr.status = (i80186.intr.status & ~0x0007) | (data & 0x0007); |
| 1330 | 1326 | update_interrupt_state(); |
| 1331 | 1327 | break; |
| 1332 | 1328 | |
| 1333 | | case 0x32: |
| 1334 | | if (LOG_PORTS) logerror("%05X:80186 timer interrupt contol = %04X\n", activecpu_get_pc(), data16); |
| 1335 | | i186.intr.timer = data16 & 0x000f; |
| 1329 | case 0x32/2: |
| 1330 | if (LOG_PORTS) logerror("%05X:80186 timer interrupt contol = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1331 | i80186.intr.timer = data & 0x000f; |
| 1336 | 1332 | break; |
| 1337 | 1333 | |
| 1338 | | case 0x34: |
| 1339 | | if (LOG_PORTS) logerror("%05X:80186 DMA 0 interrupt control = %04X\n", activecpu_get_pc(), data16); |
| 1340 | | i186.intr.dma[0] = data16 & 0x000f; |
| 1334 | case 0x34/2: |
| 1335 | if (LOG_PORTS) logerror("%05X:80186 DMA 0 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1336 | i80186.intr.dma[0] = data & 0x000f; |
| 1341 | 1337 | break; |
| 1342 | 1338 | |
| 1343 | | case 0x36: |
| 1344 | | if (LOG_PORTS) logerror("%05X:80186 DMA 1 interrupt control = %04X\n", activecpu_get_pc(), data16); |
| 1345 | | i186.intr.dma[1] = data16 & 0x000f; |
| 1339 | case 0x36/2: |
| 1340 | if (LOG_PORTS) logerror("%05X:80186 DMA 1 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1341 | i80186.intr.dma[1] = data & 0x000f; |
| 1346 | 1342 | break; |
| 1347 | 1343 | |
| 1348 | | case 0x38: |
| 1349 | | if (LOG_PORTS) logerror("%05X:80186 INT 0 interrupt control = %04X\n", activecpu_get_pc(), data16); |
| 1350 | | i186.intr.ext[0] = data16 & 0x007f; |
| 1344 | case 0x38/2: |
| 1345 | if (LOG_PORTS) logerror("%05X:80186 INT 0 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1346 | i80186.intr.ext[0] = data & 0x007f; |
| 1351 | 1347 | break; |
| 1352 | 1348 | |
| 1353 | | case 0x3a: |
| 1354 | | if (LOG_PORTS) logerror("%05X:80186 INT 1 interrupt control = %04X\n", activecpu_get_pc(), data16); |
| 1355 | | i186.intr.ext[1] = data16 & 0x007f; |
| 1349 | case 0x3a/2: |
| 1350 | if (LOG_PORTS) logerror("%05X:80186 INT 1 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1351 | i80186.intr.ext[1] = data & 0x007f; |
| 1356 | 1352 | break; |
| 1357 | 1353 | |
| 1358 | | case 0x3c: |
| 1359 | | if (LOG_PORTS) logerror("%05X:80186 INT 2 interrupt control = %04X\n", activecpu_get_pc(), data16); |
| 1360 | | i186.intr.ext[2] = data16 & 0x001f; |
| 1354 | case 0x3c/2: |
| 1355 | if (LOG_PORTS) logerror("%05X:80186 INT 2 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1356 | i80186.intr.ext[2] = data & 0x001f; |
| 1361 | 1357 | break; |
| 1362 | 1358 | |
| 1363 | | case 0x3e: |
| 1364 | | if (LOG_PORTS) logerror("%05X:80186 INT 3 interrupt control = %04X\n", activecpu_get_pc(), data16); |
| 1365 | | i186.intr.ext[3] = data16 & 0x001f; |
| 1359 | case 0x3e/2: |
| 1360 | if (LOG_PORTS) logerror("%05X:80186 INT 3 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1361 | i80186.intr.ext[3] = data & 0x001f; |
| 1366 | 1362 | break; |
| 1367 | 1363 | |
| 1368 | | case 0x50: |
| 1369 | | case 0x58: |
| 1370 | | case 0x60: |
| 1371 | | if (LOG_PORTS) logerror("%05X:80186 Timer %d count = %04X\n", activecpu_get_pc(), (offset - 0x50) / 8, data16); |
| 1372 | | which = (offset - 0x50) / 8; |
| 1373 | | internal_timer_update(which, data16, -1, -1, -1); |
| 1364 | case 0x50/2: |
| 1365 | case 0x58/2: |
| 1366 | case 0x60/2: |
| 1367 | if (LOG_PORTS) logerror("%05X:80186 Timer %d count = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask ^ 0xffff); |
| 1368 | which = (offset - 0x50/2) / 4; |
| 1369 | internal_timer_update(which, data, -1, -1, -1); |
| 1374 | 1370 | break; |
| 1375 | 1371 | |
| 1376 | | case 0x52: |
| 1377 | | case 0x5a: |
| 1378 | | case 0x62: |
| 1379 | | if (LOG_PORTS) logerror("%05X:80186 Timer %d max A = %04X\n", activecpu_get_pc(), (offset - 0x50) / 8, data16); |
| 1380 | | which = (offset - 0x50) / 8; |
| 1381 | | internal_timer_update(which, -1, data16, -1, -1); |
| 1372 | case 0x52/2: |
| 1373 | case 0x5a/2: |
| 1374 | case 0x62/2: |
| 1375 | if (LOG_PORTS) logerror("%05X:80186 Timer %d max A = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask ^ 0xffff); |
| 1376 | which = (offset - 0x50/2) / 4; |
| 1377 | internal_timer_update(which, -1, data, -1, -1); |
| 1382 | 1378 | break; |
| 1383 | 1379 | |
| 1384 | | case 0x54: |
| 1385 | | case 0x5c: |
| 1386 | | if (LOG_PORTS) logerror("%05X:80186 Timer %d max B = %04X\n", activecpu_get_pc(), (offset - 0x50) / 8, data16); |
| 1387 | | which = (offset - 0x50) / 8; |
| 1388 | | internal_timer_update(which, -1, -1, data16, -1); |
| 1380 | case 0x54/2: |
| 1381 | case 0x5c/2: |
| 1382 | if (LOG_PORTS) logerror("%05X:80186 Timer %d max B = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask ^ 0xffff); |
| 1383 | which = (offset - 0x50/2) / 4; |
| 1384 | internal_timer_update(which, -1, -1, data, -1); |
| 1389 | 1385 | break; |
| 1390 | 1386 | |
| 1391 | | case 0x56: |
| 1392 | | case 0x5e: |
| 1393 | | case 0x66: |
| 1394 | | if (LOG_PORTS) logerror("%05X:80186 Timer %d control = %04X\n", activecpu_get_pc(), (offset - 0x50) / 8, data16); |
| 1395 | | which = (offset - 0x50) / 8; |
| 1396 | | internal_timer_update(which, -1, -1, -1, data16); |
| 1387 | case 0x56/2: |
| 1388 | case 0x5e/2: |
| 1389 | case 0x66/2: |
| 1390 | if (LOG_PORTS) logerror("%05X:80186 Timer %d control = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask ^ 0xffff); |
| 1391 | which = (offset - 0x50/2) / 4; |
| 1392 | internal_timer_update(which, -1, -1, -1, data); |
| 1397 | 1393 | break; |
| 1398 | 1394 | |
| 1399 | | case 0xa0: |
| 1400 | | if (LOG_PORTS) logerror("%05X:80186 upper chip select = %04X\n", activecpu_get_pc(), data16); |
| 1401 | | i186.mem.upper = data16 | 0xc038; |
| 1395 | case 0xa0/2: |
| 1396 | if (LOG_PORTS) logerror("%05X:80186 upper chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1397 | i80186.mem.upper = data | 0xc038; |
| 1402 | 1398 | break; |
| 1403 | 1399 | |
| 1404 | | case 0xa2: |
| 1405 | | if (LOG_PORTS) logerror("%05X:80186 lower chip select = %04X\n", activecpu_get_pc(), data16); |
| 1406 | | i186.mem.lower = (data16 & 0x3fff) | 0x0038; |
| 1400 | case 0xa2/2: |
| 1401 | if (LOG_PORTS) logerror("%05X:80186 lower chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1402 | i80186.mem.lower = (data & 0x3fff) | 0x0038; |
| 1407 | 1403 | break; |
| 1408 | 1404 | |
| 1409 | | case 0xa4: |
| 1410 | | if (LOG_PORTS) logerror("%05X:80186 peripheral chip select = %04X\n", activecpu_get_pc(), data16); |
| 1411 | | i186.mem.peripheral = data16 | 0x0038; |
| 1405 | case 0xa4/2: |
| 1406 | if (LOG_PORTS) logerror("%05X:80186 peripheral chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1407 | i80186.mem.peripheral = data | 0x0038; |
| 1412 | 1408 | break; |
| 1413 | 1409 | |
| 1414 | | case 0xa6: |
| 1415 | | if (LOG_PORTS) logerror("%05X:80186 middle chip select = %04X\n", activecpu_get_pc(), data16); |
| 1416 | | i186.mem.middle = data16 | 0x01f8; |
| 1410 | case 0xa6/2: |
| 1411 | if (LOG_PORTS) logerror("%05X:80186 middle chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1412 | i80186.mem.middle = data | 0x01f8; |
| 1417 | 1413 | break; |
| 1418 | 1414 | |
| 1419 | | case 0xa8: |
| 1420 | | if (LOG_PORTS) logerror("%05X:80186 middle P chip select = %04X\n", activecpu_get_pc(), data16); |
| 1421 | | i186.mem.middle_size = data16 | 0x8038; |
| 1415 | case 0xa8/2: |
| 1416 | if (LOG_PORTS) logerror("%05X:80186 middle P chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1417 | i80186.mem.middle_size = data | 0x8038; |
| 1422 | 1418 | |
| 1423 | | temp = (i186.mem.peripheral & 0xffc0) << 4; |
| 1424 | | if (i186.mem.middle_size & 0x0040) |
| 1419 | temp = (i80186.mem.peripheral & 0xffc0) << 4; |
| 1420 | if (i80186.mem.middle_size & 0x0040) |
| 1425 | 1421 | { |
| 1426 | | memory_install_read8_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0x2ff, 0, 0, peripheral_r); |
| 1427 | | memory_install_write8_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0x2ff, 0, 0, peripheral_w); |
| 1422 | memory_install_read16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0x2ff, 0, 0, peripheral_r); |
| 1423 | memory_install_write16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0x2ff, 0, 0, peripheral_w); |
| 1428 | 1424 | } |
| 1429 | 1425 | else |
| 1430 | 1426 | { |
| 1431 | 1427 | temp &= 0xffff; |
| 1432 | | memory_install_read8_handler(2, ADDRESS_SPACE_IO, temp, temp + 0x2ff, 0, 0, peripheral_r); |
| 1433 | | memory_install_write8_handler(2, ADDRESS_SPACE_IO, temp, temp + 0x2ff, 0, 0, peripheral_w); |
| 1428 | memory_install_read16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0x2ff, 0, 0, peripheral_r); |
| 1429 | memory_install_write16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0x2ff, 0, 0, peripheral_w); |
| 1434 | 1430 | } |
| 1435 | 1431 | |
| 1436 | | /* we need to do this at a time when the I86 context is swapped in */ |
| 1432 | /* we need to do this at a time when the 80186 context is swapped in */ |
| 1437 | 1433 | /* this register is generally set once at startup and never again, so it's a good */ |
| 1438 | 1434 | /* time to set it up */ |
| 1439 | 1435 | cpunum_set_irq_callback(cpu_getactivecpu(), int_callback); |
| 1440 | 1436 | break; |
| 1441 | 1437 | |
| 1442 | | case 0xc0: |
| 1443 | | case 0xd0: |
| 1444 | | if (LOG_PORTS) logerror("%05X:80186 DMA%d lower source address = %04X\n", activecpu_get_pc(), (offset - 0xc0) / 0x10, data16); |
| 1445 | | which = (offset - 0xc0) / 0x10; |
| 1438 | case 0xc0/2: |
| 1439 | case 0xd0/2: |
| 1440 | if (LOG_PORTS) logerror("%05X:80186 DMA%d lower source address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff); |
| 1441 | which = (offset - 0xc0/2) / 8; |
| 1446 | 1442 | stream_update(dma_stream); |
| 1447 | | i186.dma[which].source = (i186.dma[which].source & ~0x0ffff) | (data16 & 0x0ffff); |
| 1443 | i80186.dma[which].source = (i80186.dma[which].source & ~0x0ffff) | (data & 0x0ffff); |
| 1448 | 1444 | break; |
| 1449 | 1445 | |
| 1450 | | case 0xc2: |
| 1451 | | case 0xd2: |
| 1452 | | if (LOG_PORTS) logerror("%05X:80186 DMA%d upper source address = %04X\n", activecpu_get_pc(), (offset - 0xc0) / 0x10, data16); |
| 1453 | | which = (offset - 0xc0) / 0x10; |
| 1446 | case 0xc2/2: |
| 1447 | case 0xd2/2: |
| 1448 | if (LOG_PORTS) logerror("%05X:80186 DMA%d upper source address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff); |
| 1449 | which = (offset - 0xc0/2) / 8; |
| 1454 | 1450 | stream_update(dma_stream); |
| 1455 | | i186.dma[which].source = (i186.dma[which].source & ~0xf0000) | ((data16 << 16) & 0xf0000); |
| 1451 | i80186.dma[which].source = (i80186.dma[which].source & ~0xf0000) | ((data << 16) & 0xf0000); |
| 1456 | 1452 | break; |
| 1457 | 1453 | |
| 1458 | | case 0xc4: |
| 1459 | | case 0xd4: |
| 1460 | | if (LOG_PORTS) logerror("%05X:80186 DMA%d lower dest address = %04X\n", activecpu_get_pc(), (offset - 0xc0) / 0x10, data16); |
| 1461 | | which = (offset - 0xc0) / 0x10; |
| 1454 | case 0xc4/2: |
| 1455 | case 0xd4/2: |
| 1456 | if (LOG_PORTS) logerror("%05X:80186 DMA%d lower dest address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff); |
| 1457 | which = (offset - 0xc0/2) / 8; |
| 1462 | 1458 | stream_update(dma_stream); |
| 1463 | | i186.dma[which].dest = (i186.dma[which].dest & ~0x0ffff) | (data16 & 0x0ffff); |
| 1459 | i80186.dma[which].dest = (i80186.dma[which].dest & ~0x0ffff) | (data & 0x0ffff); |
| 1464 | 1460 | break; |
| 1465 | 1461 | |
| 1466 | | case 0xc6: |
| 1467 | | case 0xd6: |
| 1468 | | if (LOG_PORTS) logerror("%05X:80186 DMA%d upper dest address = %04X\n", activecpu_get_pc(), (offset - 0xc0) / 0x10, data16); |
| 1469 | | which = (offset - 0xc0) / 0x10; |
| 1462 | case 0xc6/2: |
| 1463 | case 0xd6/2: |
| 1464 | if (LOG_PORTS) logerror("%05X:80186 DMA%d upper dest address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff); |
| 1465 | which = (offset - 0xc0/2) / 8; |
| 1470 | 1466 | stream_update(dma_stream); |
| 1471 | | i186.dma[which].dest = (i186.dma[which].dest & ~0xf0000) | ((data16 << 16) & 0xf0000); |
| 1467 | i80186.dma[which].dest = (i80186.dma[which].dest & ~0xf0000) | ((data << 16) & 0xf0000); |
| 1472 | 1468 | break; |
| 1473 | 1469 | |
| 1474 | | case 0xc8: |
| 1475 | | case 0xd8: |
| 1476 | | if (LOG_PORTS) logerror("%05X:80186 DMA%d transfer count = %04X\n", activecpu_get_pc(), (offset - 0xc0) / 0x10, data16); |
| 1477 | | which = (offset - 0xc0) / 0x10; |
| 1470 | case 0xc8/2: |
| 1471 | case 0xd8/2: |
| 1472 | if (LOG_PORTS) logerror("%05X:80186 DMA%d transfer count = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff); |
| 1473 | which = (offset - 0xc0/2) / 8; |
| 1478 | 1474 | stream_update(dma_stream); |
| 1479 | | i186.dma[which].count = data16; |
| 1475 | i80186.dma[which].count = data; |
| 1480 | 1476 | break; |
| 1481 | 1477 | |
| 1482 | | case 0xca: |
| 1483 | | case 0xda: |
| 1484 | | if (LOG_PORTS) logerror("%05X:80186 DMA%d control = %04X\n", activecpu_get_pc(), (offset - 0xc0) / 0x10, data16); |
| 1485 | | which = (offset - 0xc0) / 0x10; |
| 1478 | case 0xca/2: |
| 1479 | case 0xda/2: |
| 1480 | if (LOG_PORTS) logerror("%05X:80186 DMA%d control = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask ^ 0xffff); |
| 1481 | which = (offset - 0xc0/2) / 8; |
| 1486 | 1482 | stream_update(dma_stream); |
| 1487 | | update_dma_control(which, data16); |
| 1483 | update_dma_control(which, data); |
| 1488 | 1484 | break; |
| 1489 | 1485 | |
| 1490 | | case 0xfe: |
| 1491 | | if (LOG_PORTS) logerror("%05X:80186 relocation register = %04X\n", activecpu_get_pc(), data16); |
| 1486 | case 0xfe/2: |
| 1487 | if (LOG_PORTS) logerror("%05X:80186 relocation register = %04X & %04X\n", activecpu_get_pc(), data, mem_mask ^ 0xffff); |
| 1492 | 1488 | |
| 1493 | 1489 | /* we assume here there that this doesn't happen too often */ |
| 1494 | 1490 | /* plus, we can't really remove the old memory range, so we also assume that it's */ |
| 1495 | 1491 | /* okay to leave us mapped where we were */ |
| 1496 | | temp = (data16 & 0x0fff) << 8; |
| 1497 | | if (data16 & 0x1000) |
| 1492 | temp = (data & 0x0fff) << 8; |
| 1493 | if (data & 0x1000) |
| 1498 | 1494 | { |
| 1499 | | memory_install_read8_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i186_internal_port_r); |
| 1500 | | memory_install_write8_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i186_internal_port_w); |
| 1495 | memory_install_read16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i80186_internal_port_r); |
| 1496 | memory_install_write16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i80186_internal_port_w); |
| 1501 | 1497 | } |
| 1502 | 1498 | else |
| 1503 | 1499 | { |
| 1504 | 1500 | temp &= 0xffff; |
| 1505 | | memory_install_read8_handler(2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i186_internal_port_r); |
| 1506 | | memory_install_write8_handler(2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i186_internal_port_w); |
| 1501 | memory_install_read16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i80186_internal_port_r); |
| 1502 | memory_install_write16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i80186_internal_port_w); |
| 1507 | 1503 | } |
| 1508 | 1504 | /* popmessage("Sound CPU reset");*/ |
| 1509 | 1505 | break; |
| 1510 | 1506 | |
| 1511 | 1507 | default: |
| 1512 | | logerror("%05X:80186 port %02X = %04X\n", activecpu_get_pc(), offset, data16); |
| 1508 | logerror("%05X:80186 port %02X = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask ^ 0xffff); |
| 1513 | 1509 | break; |
| 1514 | 1510 | } |
| 1515 | 1511 | } |
| r869 | r870 | |
| 1534 | 1530 | } |
| 1535 | 1531 | |
| 1536 | 1532 | |
| 1537 | | static READ8_HANDLER( pit8254_r ) |
| 1533 | static READ16_HANDLER( pit8254_r ) |
| 1538 | 1534 | { |
| 1539 | 1535 | struct counter_state *ctr; |
| 1540 | | int which = offset / 0x80; |
| 1541 | | int reg = (offset / 2) & 3; |
| 1536 | int which = offset / 0x40; |
| 1537 | int reg = offset & 3; |
| 1542 | 1538 | |
| 1543 | | /* ignore odd offsets */ |
| 1544 | | if (offset & 1) |
| 1545 | | return 0; |
| 1546 | | |
| 1547 | 1539 | /* switch off the register */ |
| 1548 | | switch (offset & 3) |
| 1540 | switch (reg) |
| 1549 | 1541 | { |
| 1550 | 1542 | case 0: |
| 1551 | 1543 | case 1: |
| r869 | r870 | |
| 1576 | 1568 | } |
| 1577 | 1569 | |
| 1578 | 1570 | |
| 1579 | | static WRITE8_HANDLER( pit8254_w ) |
| 1571 | static WRITE16_HANDLER( pit8254_w ) |
| 1580 | 1572 | { |
| 1581 | 1573 | struct counter_state *ctr; |
| 1582 | | int which = offset / 0x80; |
| 1583 | | int reg = (offset / 2) & 3; |
| 1574 | int which = offset / 0x40; |
| 1575 | int reg = offset & 3; |
| 1584 | 1576 | |
| 1585 | 1577 | /* ignore odd offsets */ |
| 1586 | | if (offset & 1) |
| 1578 | if (!ACCESSING_LSB) |
| 1587 | 1579 | return; |
| 1580 | data &= 0xff; |
| 1588 | 1581 | |
| 1589 | 1582 | /* switch off the register */ |
| 1590 | 1583 | switch (reg) |
| r869 | r870 | |
| 1654 | 1647 | * |
| 1655 | 1648 | *************************************/ |
| 1656 | 1649 | |
| 1657 | | WRITE8_HANDLER( leland_i86_control_w ) |
| 1650 | WRITE8_HANDLER( leland_80186_control_w ) |
| 1658 | 1651 | { |
| 1659 | 1652 | /* see if anything changed */ |
| 1660 | 1653 | int diff = (last_control ^ data) & 0xf8; |
| r869 | r870 | |
| 1664 | 1657 | |
| 1665 | 1658 | if (LOG_COMM) |
| 1666 | 1659 | { |
| 1667 | | logerror("%04X:I86 control = %02X", activecpu_get_previouspc(), data); |
| 1660 | logerror("%04X:80186 control = %02X", activecpu_get_previouspc(), data); |
| 1668 | 1661 | if (!(data & 0x80)) logerror(" /RESET"); |
| 1669 | 1662 | if (!(data & 0x40)) logerror(" ZNMI"); |
| 1670 | 1663 | if (!(data & 0x20)) logerror(" INT0"); |
| r869 | r870 | |
| 1686 | 1679 | /* INT0 */ |
| 1687 | 1680 | if (data & 0x20) |
| 1688 | 1681 | { |
| 1689 | | if (!LATCH_INTS) i186.intr.request &= ~0x10; |
| 1682 | if (!LATCH_INTS) i80186.intr.request &= ~0x10; |
| 1690 | 1683 | } |
| 1691 | | else if (i186.intr.ext[0] & 0x10) |
| 1692 | | i186.intr.request |= 0x10; |
| 1684 | else if (i80186.intr.ext[0] & 0x10) |
| 1685 | i80186.intr.request |= 0x10; |
| 1693 | 1686 | else if (diff & 0x20) |
| 1694 | | i186.intr.request |= 0x10; |
| 1687 | i80186.intr.request |= 0x10; |
| 1695 | 1688 | |
| 1696 | 1689 | /* INT1 */ |
| 1697 | 1690 | if (data & 0x08) |
| 1698 | 1691 | { |
| 1699 | | if (!LATCH_INTS) i186.intr.request &= ~0x20; |
| 1692 | if (!LATCH_INTS) i80186.intr.request &= ~0x20; |
| 1700 | 1693 | } |
| 1701 | | else if (i186.intr.ext[1] & 0x10) |
| 1702 | | i186.intr.request |= 0x20; |
| 1694 | else if (i80186.intr.ext[1] & 0x10) |
| 1695 | i80186.intr.request |= 0x20; |
| 1703 | 1696 | else if (diff & 0x08) |
| 1704 | | i186.intr.request |= 0x20; |
| 1697 | i80186.intr.request |= 0x20; |
| 1705 | 1698 | |
| 1706 | 1699 | /* handle reset here */ |
| 1707 | 1700 | if ((diff & 0x80) && (data & 0x80)) |
| 1708 | | leland_i186_reset(); |
| 1701 | leland_80186_reset(); |
| 1709 | 1702 | |
| 1710 | 1703 | update_interrupt_state(); |
| 1711 | 1704 | } |
| r869 | r870 | |
| 1721 | 1714 | static TIMER_CALLBACK( command_lo_sync ) |
| 1722 | 1715 | { |
| 1723 | 1716 | if (LOG_COMM) logerror("%04X:Write sound command latch lo = %02X\n", activecpu_get_previouspc(), param); |
| 1724 | | sound_command[0] = param; |
| 1717 | sound_command = (sound_command & 0xff00) | param; |
| 1725 | 1718 | } |
| 1726 | 1719 | |
| 1727 | 1720 | |
| 1728 | | WRITE8_HANDLER( leland_i86_command_lo_w ) |
| 1721 | WRITE8_HANDLER( leland_80186_command_lo_w ) |
| 1729 | 1722 | { |
| 1730 | 1723 | timer_call_after_resynch(data, command_lo_sync); |
| 1731 | 1724 | } |
| 1732 | 1725 | |
| 1733 | 1726 | |
| 1734 | | WRITE8_HANDLER( leland_i86_command_hi_w ) |
| 1727 | WRITE8_HANDLER( leland_80186_command_hi_w ) |
| 1735 | 1728 | { |
| 1736 | 1729 | if (LOG_COMM) logerror("%04X:Write sound command latch hi = %02X\n", activecpu_get_previouspc(), data); |
| 1737 | | sound_command[1] = data; |
| 1730 | sound_command = (sound_command & 0x00ff) | (data << 8); |
| 1738 | 1731 | } |
| 1739 | 1732 | |
| 1740 | 1733 | |
| 1741 | | static READ8_HANDLER( main_to_sound_comm_r ) |
| 1734 | static READ16_HANDLER( main_to_sound_comm_r ) |
| 1742 | 1735 | { |
| 1743 | | if (!(offset & 1)) |
| 1744 | | { |
| 1745 | | if (LOG_COMM) logerror("%05X:Read sound command latch lo = %02X\n", activecpu_get_pc(), sound_command[0]); |
| 1746 | | return sound_command[0]; |
| 1747 | | } |
| 1748 | | else |
| 1749 | | { |
| 1750 | | if (LOG_COMM) logerror("%05X:Read sound command latch hi = %02X\n", activecpu_get_pc(), sound_command[1]); |
| 1751 | | return sound_command[1]; |
| 1752 | | } |
| 1736 | if (LOG_COMM) logerror("%05X:Read sound command latch = %02X\n", activecpu_get_pc(), sound_command); |
| 1737 | return sound_command; |
| 1753 | 1738 | } |
| 1754 | 1739 | |
| 1755 | 1740 | |
| r869 | r870 | |
| 1761 | 1746 | * |
| 1762 | 1747 | *************************************/ |
| 1763 | 1748 | |
| 1764 | | static TIMER_CALLBACK( delayed_response_r) |
| 1749 | static TIMER_CALLBACK( delayed_response_r ) |
| 1765 | 1750 | { |
| 1766 | 1751 | int checkpc = param; |
| 1767 | 1752 | int pc = cpunum_get_reg(0, Z80_PC); |
| r869 | r870 | |
| 1785 | 1770 | } |
| 1786 | 1771 | |
| 1787 | 1772 | |
| 1788 | | READ8_HANDLER( leland_i86_response_r ) |
| 1773 | READ8_HANDLER( leland_80186_response_r ) |
| 1789 | 1774 | { |
| 1790 | 1775 | if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", activecpu_get_previouspc(), sound_response); |
| 1791 | 1776 | |
| r869 | r870 | |
| 1795 | 1780 | } |
| 1796 | 1781 | |
| 1797 | 1782 | |
| 1798 | | static WRITE8_HANDLER( sound_to_main_comm_w ) |
| 1783 | static WRITE16_HANDLER( sound_to_main_comm_w ) |
| 1799 | 1784 | { |
| 1800 | 1785 | if (LOG_COMM) logerror("%05X:Write sound response latch = %02X\n", activecpu_get_pc(), data); |
| 1801 | 1786 | sound_response = data; |
| r869 | r870 | |
| 1833 | 1818 | } |
| 1834 | 1819 | |
| 1835 | 1820 | |
| 1836 | | static WRITE8_HANDLER( dac_w ) |
| 1821 | static WRITE16_HANDLER( dac_w ) |
| 1837 | 1822 | { |
| 1838 | | int which = offset / 2; |
| 1823 | int which = offset; |
| 1839 | 1824 | struct dac_state *d = &dac[which]; |
| 1840 | 1825 | |
| 1841 | 1826 | /* handle value changes */ |
| 1842 | | if (!(offset & 1)) |
| 1827 | if (ACCESSING_LSB) |
| 1843 | 1828 | { |
| 1844 | 1829 | int count = (d->bufin - d->bufout) & DAC_BUFFER_SIZE_MASK; |
| 1845 | 1830 | |
| 1846 | 1831 | /* set the new value */ |
| 1847 | | d->value = (INT16)data - 0x80; |
| 1848 | | if (LOG_DAC) logerror("%05X:DAC %d value = %02X\n", activecpu_get_pc(), offset / 2, data); |
| 1832 | d->value = (INT16)(UINT8)data - 0x80; |
| 1833 | if (LOG_DAC) logerror("%05X:DAC %d value = %02X\n", activecpu_get_pc(), offset, (UINT8)data); |
| 1849 | 1834 | |
| 1850 | 1835 | /* if we haven't overflowed the buffer, add the value value to it */ |
| 1851 | 1836 | if (count < DAC_BUFFER_SIZE - 1) |
| r869 | r870 | |
| 1865 | 1850 | } |
| 1866 | 1851 | |
| 1867 | 1852 | /* handle volume changes */ |
| 1868 | | else |
| 1853 | if (ACCESSING_MSB) |
| 1869 | 1854 | { |
| 1870 | | d->volume = (data ^ 0x00) / DAC_VOLUME_SCALE; |
| 1871 | | if (LOG_DAC) logerror("%05X:DAC %d volume = %02X\n", activecpu_get_pc(), offset / 2, data); |
| 1855 | d->volume = ((data >> 8) ^ 0x00) / DAC_VOLUME_SCALE; |
| 1856 | if (LOG_DAC) logerror("%05X:DAC %d volume = %02X\n", activecpu_get_pc(), offset, data); |
| 1872 | 1857 | } |
| 1873 | 1858 | } |
| 1874 | 1859 | |
| 1875 | 1860 | |
| 1876 | | static WRITE8_HANDLER( redline_dac_w ) |
| 1861 | static WRITE16_HANDLER( redline_dac_w ) |
| 1877 | 1862 | { |
| 1878 | | int which = offset / 0x200; |
| 1863 | int which = offset / 0x100; |
| 1879 | 1864 | struct dac_state *d = &dac[which]; |
| 1880 | 1865 | int count = (d->bufin - d->bufout) & DAC_BUFFER_SIZE_MASK; |
| 1881 | 1866 | |
| 1882 | 1867 | /* set the new value */ |
| 1883 | | d->value = (INT16)data - 0x80; |
| 1868 | d->value = (INT16)(UINT8)data - 0x80; |
| 1884 | 1869 | |
| 1885 | 1870 | /* if we haven't overflowed the buffer, add the value value to it */ |
| 1886 | 1871 | if (count < DAC_BUFFER_SIZE - 1) |
| r869 | r870 | |
| 1899 | 1884 | } |
| 1900 | 1885 | |
| 1901 | 1886 | /* update the volume */ |
| 1902 | | d->volume = (offset & 0x1fe) / 2 / DAC_VOLUME_SCALE; |
| 1887 | d->volume = (offset & 0xff) / DAC_VOLUME_SCALE; |
| 1903 | 1888 | if (LOG_DAC) logerror("%05X:DAC %d value = %02X, volume = %02X\n", activecpu_get_pc(), which, data, (offset & 0x1fe) / 2); |
| 1904 | 1889 | } |
| 1905 | 1890 | |
| 1906 | 1891 | |
| 1907 | | static WRITE8_HANDLER( dac_10bit_w ) |
| 1892 | static WRITE16_HANDLER( dac_10bit_w ) |
| 1908 | 1893 | { |
| 1909 | | static UINT8 even_byte; |
| 1910 | 1894 | struct dac_state *d = &dac[6]; |
| 1911 | 1895 | int count = (d->bufin - d->bufout) & DAC_BUFFER_SIZE_MASK; |
| 1912 | 1896 | int data16; |
| 1913 | 1897 | |
| 1914 | 1898 | /* warning: this assumes all port writes here are word-sized */ |
| 1915 | | /* if the offset is even, just stash the value */ |
| 1916 | | if (!(offset & 1)) |
| 1917 | | { |
| 1918 | | even_byte = data; |
| 1919 | | return; |
| 1920 | | } |
| 1921 | | data16 = (data << 8) | even_byte; |
| 1899 | assert(ACCESSING_LSB && ACCESSING_MSB); |
| 1900 | data16 = data; |
| 1922 | 1901 | |
| 1923 | 1902 | /* set the new value */ |
| 1924 | 1903 | d->value = (INT16)data16 - 0x200; |
| r869 | r870 | |
| 1942 | 1921 | } |
| 1943 | 1922 | |
| 1944 | 1923 | |
| 1945 | | static WRITE8_HANDLER( ataxx_dac_control ) |
| 1924 | static WRITE16_HANDLER( ataxx_dac_control ) |
| 1946 | 1925 | { |
| 1947 | 1926 | /* handle common offsets */ |
| 1948 | 1927 | switch (offset) |
| 1949 | 1928 | { |
| 1950 | 1929 | case 0x00: |
| 1930 | case 0x01: |
| 1951 | 1931 | case 0x02: |
| 1952 | | case 0x04: |
| 1953 | | dac_w(offset, data); |
| 1932 | if (ACCESSING_LSB) |
| 1933 | dac_w(offset, data, 0xff00); |
| 1954 | 1934 | return; |
| 1955 | 1935 | |
| 1956 | | case 0x06: |
| 1957 | | dac_w(1, ((data << 5) & 0xe0) | ((data << 2) & 0x1c) | (data & 0x03)); |
| 1958 | | dac_w(3, ((data << 2) & 0xe0) | ((data >> 1) & 0x1c) | ((data >> 4) & 0x03)); |
| 1959 | | dac_w(5, (data & 0xc0) | ((data >> 2) & 0x30) | ((data >> 4) & 0x0c) | ((data >> 6) & 0x03)); |
| 1936 | case 0x03: |
| 1937 | dac_w(0, ((data << 13) & 0xe000) | ((data << 10) & 0x1c00) | ((data << 7) & 0x0300), 0x00ff); |
| 1938 | dac_w(2, ((data << 10) & 0xe000) | ((data << 7) & 0x1c00) | ((data << 4) & 0x0300), 0x00ff); |
| 1939 | dac_w(4, ((data << 8) & 0xc000) | ((data << 6) & 0x3000) | ((data << 4) & 0x0c00) | ((data << 2) & 0x0300), 0x00ff); |
| 1960 | 1940 | return; |
| 1961 | 1941 | } |
| 1962 | 1942 | |
| r869 | r870 | |
| 1966 | 1946 | stream_update(extern_stream); |
| 1967 | 1947 | switch (offset) |
| 1968 | 1948 | { |
| 1969 | | case 0x08: |
| 1970 | | case 0x09: |
| 1949 | case 0x04: |
| 1971 | 1950 | ext_active = 1; |
| 1972 | 1951 | if (LOG_EXTERN) logerror("External DAC active\n"); |
| 1973 | 1952 | return; |
| 1974 | 1953 | |
| 1975 | | case 0x0a: |
| 1976 | | case 0x0b: |
| 1954 | case 0x05: |
| 1977 | 1955 | ext_active = 0; |
| 1978 | 1956 | if (LOG_EXTERN) logerror("External DAC inactive\n"); |
| 1979 | 1957 | return; |
| 1980 | 1958 | |
| 1981 | | case 0x0c: |
| 1982 | | ext_start = (ext_start & 0xff00f) | ((data << 4) & 0x00ff0); |
| 1959 | case 0x06: |
| 1960 | ext_start >>= 4; |
| 1961 | COMBINE_DATA(&ext_start); |
| 1962 | ext_start <<= 4; |
| 1983 | 1963 | if (LOG_EXTERN) logerror("External DAC start = %05X\n", ext_start); |
| 1984 | 1964 | return; |
| 1985 | 1965 | |
| 1986 | | case 0x0d: |
| 1987 | | ext_start = (ext_start & 0x00fff) | ((data << 12) & 0xff000); |
| 1988 | | if (LOG_EXTERN) logerror("External DAC start = %05X\n", ext_start); |
| 1989 | | return; |
| 1990 | | |
| 1991 | | case 0x0e: |
| 1992 | | ext_stop = (ext_stop & 0xff00f) | ((data << 4) & 0x00ff0); |
| 1966 | case 0x07: |
| 1967 | ext_stop >>= 4; |
| 1968 | COMBINE_DATA(&ext_stop); |
| 1969 | ext_stop <<= 4; |
| 1993 | 1970 | if (LOG_EXTERN) logerror("External DAC stop = %05X\n", ext_stop); |
| 1994 | 1971 | return; |
| 1995 | 1972 | |
| 1996 | | case 0x0f: |
| 1997 | | ext_stop = (ext_stop & 0x00fff) | ((data << 12) & 0xff000); |
| 1998 | | if (LOG_EXTERN) logerror("External DAC stop = %05X\n", ext_stop); |
| 1973 | case 0x21: |
| 1974 | dac_w(offset - 0x21 + 7, data, mem_mask); |
| 1999 | 1975 | return; |
| 2000 | | |
| 2001 | | case 0x42: |
| 2002 | | case 0x43: |
| 2003 | | dac_w(offset - 0x42 + 14, data); |
| 2004 | | return; |
| 2005 | 1976 | } |
| 2006 | 1977 | } |
| 2007 | 1978 | logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", activecpu_get_pc(), 5, offset, data); |
| r869 | r870 | |
| 2015 | 1986 | * |
| 2016 | 1987 | *************************************/ |
| 2017 | 1988 | |
| 2018 | | static READ8_HANDLER( peripheral_r ) |
| 1989 | static READ16_HANDLER( peripheral_r ) |
| 2019 | 1990 | { |
| 2020 | | int select = offset / 0x80; |
| 2021 | | offset &= 0x7f; |
| 1991 | int select = offset / 0x40; |
| 1992 | offset &= 0x3f; |
| 2022 | 1993 | |
| 2023 | 1994 | switch (select) |
| 2024 | 1995 | { |
| 2025 | 1996 | case 0: |
| 2026 | | if (offset & 1) |
| 2027 | | return 0; |
| 2028 | | |
| 2029 | 1997 | /* we have to return 0 periodically so that they handle interrupts */ |
| 2030 | 1998 | if ((++clock_tick & 7) == 0) |
| 2031 | 1999 | return 0; |
| 2032 | 2000 | |
| 2033 | 2001 | /* if we've filled up all the active channels, we can give this CPU a reset */ |
| 2034 | 2002 | /* until the next interrupt */ |
| 2035 | | { |
| 2036 | | UINT8 result; |
| 2003 | if (!is_redline) |
| 2004 | return ((clock_active >> 1) & 0x3e); |
| 2005 | else |
| 2006 | return ((clock_active << 1) & 0x7e); |
| 2037 | 2007 | |
| 2038 | | if (!is_redline) |
| 2039 | | result = ((clock_active >> 1) & 0x3e); |
| 2040 | | else |
| 2041 | | result = ((clock_active << 1) & 0x7e); |
| 2042 | | |
| 2043 | | return result; |
| 2044 | | } |
| 2045 | | |
| 2046 | 2008 | case 1: |
| 2047 | | return main_to_sound_comm_r(offset); |
| 2009 | return main_to_sound_comm_r(offset, mem_mask); |
| 2048 | 2010 | |
| 2049 | 2011 | case 2: |
| 2050 | | return pit8254_r(offset); |
| 2012 | return pit8254_r(offset, mem_mask); |
| 2051 | 2013 | |
| 2052 | 2014 | case 3: |
| 2053 | 2015 | if (!has_ym2151) |
| 2054 | | return pit8254_r(offset | 0x80); |
| 2016 | return pit8254_r(offset | 0x40, mem_mask); |
| 2055 | 2017 | else |
| 2056 | | return (offset & 1) ? 0 : YM2151_status_port_0_r(offset); |
| 2018 | return YM2151_status_port_0_lsb_r(offset, mem_mask); |
| 2057 | 2019 | |
| 2058 | 2020 | case 4: |
| 2059 | 2021 | if (is_redline) |
| 2060 | | return pit8254_r(offset | 0x100); |
| 2022 | return pit8254_r(offset | 0x80, mem_mask); |
| 2061 | 2023 | else |
| 2062 | | logerror("%05X:Unexpected peripheral read %d/%02X\n", activecpu_get_pc(), select, offset); |
| 2024 | logerror("%05X:Unexpected peripheral read %d/%02X\n", activecpu_get_pc(), select, offset*2); |
| 2063 | 2025 | break; |
| 2064 | 2026 | |
| 2065 | 2027 | default: |
| 2066 | | logerror("%05X:Unexpected peripheral read %d/%02X\n", activecpu_get_pc(), select, offset); |
| 2028 | logerror("%05X:Unexpected peripheral read %d/%02X\n", activecpu_get_pc(), select, offset*2); |
| 2067 | 2029 | break; |
| 2068 | 2030 | } |
| 2069 | | return 0xff; |
| 2031 | return 0xffff; |
| 2070 | 2032 | } |
| 2071 | 2033 | |
| 2072 | 2034 | |
| 2073 | | static WRITE8_HANDLER( peripheral_w ) |
| 2035 | static WRITE16_HANDLER( peripheral_w ) |
| 2074 | 2036 | { |
| 2075 | | int select = offset / 0x80; |
| 2076 | | offset &= 0x7f; |
| 2037 | int select = offset / 0x40; |
| 2038 | offset &= 0x3f; |
| 2077 | 2039 | |
| 2078 | 2040 | switch (select) |
| 2079 | 2041 | { |
| 2080 | 2042 | case 1: |
| 2081 | | sound_to_main_comm_w(offset, data); |
| 2043 | sound_to_main_comm_w(offset, data, mem_mask); |
| 2082 | 2044 | break; |
| 2083 | 2045 | |
| 2084 | 2046 | case 2: |
| 2085 | | pit8254_w(offset, data); |
| 2047 | pit8254_w(offset, data, mem_mask); |
| 2086 | 2048 | break; |
| 2087 | 2049 | |
| 2088 | 2050 | case 3: |
| 2089 | 2051 | if (!has_ym2151) |
| 2090 | | pit8254_w(offset | 0x80, data); |
| 2052 | pit8254_w(offset | 0x40, data, mem_mask); |
| 2091 | 2053 | else if (offset == 0) |
| 2092 | | YM2151_register_port_0_w(offset, data); |
| 2093 | | else if (offset == 2) |
| 2094 | | YM2151_data_port_0_w(offset, data); |
| 2054 | YM2151_register_port_0_lsb_w(offset, data, mem_mask); |
| 2055 | else if (offset == 1) |
| 2056 | YM2151_data_port_0_lsb_w(offset, data, mem_mask); |
| 2095 | 2057 | break; |
| 2096 | 2058 | |
| 2097 | 2059 | case 4: |
| 2098 | 2060 | if (is_redline) |
| 2099 | | pit8254_w(offset | 0x100, data); |
| 2061 | pit8254_w(offset | 0x80, data, mem_mask); |
| 2100 | 2062 | else |
| 2101 | | dac_10bit_w(offset, data); |
| 2063 | dac_10bit_w(offset, data, mem_mask); |
| 2102 | 2064 | break; |
| 2103 | 2065 | |
| 2104 | 2066 | case 5: /* Ataxx/WSF/Indy Heat only */ |
| 2105 | | ataxx_dac_control(offset, data); |
| 2067 | ataxx_dac_control(offset, data, mem_mask); |
| 2106 | 2068 | break; |
| 2107 | 2069 | |
| 2108 | 2070 | default: |
| r869 | r870 | |
| 2119 | 2081 | * |
| 2120 | 2082 | *************************************/ |
| 2121 | 2083 | |
| 2122 | | WRITE8_HANDLER( ataxx_i86_control_w ) |
| 2084 | WRITE8_HANDLER( ataxx_80186_control_w ) |
| 2123 | 2085 | { |
| 2124 | 2086 | /* compute the bit-shuffled variants of the bits and then write them */ |
| 2125 | 2087 | int modified = ((data & 0x01) << 7) | |
| 2126 | 2088 | ((data & 0x02) << 5) | |
| 2127 | 2089 | ((data & 0x04) << 3) | |
| 2128 | 2090 | ((data & 0x08) << 1); |
| 2129 | | leland_i86_control_w(offset, modified); |
| 2091 | leland_80186_control_w(offset, modified); |
| 2130 | 2092 | } |
| 2131 | 2093 | |
| 2132 | 2094 | |
| r869 | r870 | |
| 2137 | 2099 | * |
| 2138 | 2100 | *************************************/ |
| 2139 | 2101 | |
| 2140 | | ADDRESS_MAP_START( leland_i86_map_program, ADDRESS_SPACE_PROGRAM, 8 ) |
| 2141 | | AM_RANGE(0x00000, 0x03fff) AM_MIRROR(0x1c000) AM_RAM AM_BASE(&ram_base) |
| 2102 | ADDRESS_MAP_START( leland_80186_map_program, ADDRESS_SPACE_PROGRAM, 16 ) |
| 2103 | AM_RANGE(0x00000, 0x03fff) AM_MIRROR(0x1c000) AM_RAM |
| 2142 | 2104 | AM_RANGE(0x20000, 0xfffff) AM_ROM |
| 2143 | 2105 | ADDRESS_MAP_END |
| 2144 | 2106 | |
| 2145 | 2107 | |
| 2146 | | ADDRESS_MAP_START( ataxx_i86_map_io, ADDRESS_SPACE_IO, 8 ) |
| 2147 | | AM_RANGE(0xff00, 0xffff) AM_READWRITE(i186_internal_port_r, i186_internal_port_w) |
| 2108 | ADDRESS_MAP_START( ataxx_80186_map_io, ADDRESS_SPACE_IO, 16 ) |
| 2109 | AM_RANGE(0xff00, 0xffff) AM_READWRITE(i80186_internal_port_r, i80186_internal_port_w) |
| 2148 | 2110 | ADDRESS_MAP_END |
| 2149 | 2111 | |
| 2150 | 2112 | |
| 2151 | | ADDRESS_MAP_START( redline_i86_map_io, ADDRESS_SPACE_IO, 8 ) |
| 2113 | ADDRESS_MAP_START( redline_80186_map_io, ADDRESS_SPACE_IO, 16 ) |
| 2152 | 2114 | AM_RANGE(0x6000, 0x6fff) AM_WRITE(redline_dac_w) |
| 2153 | | AM_RANGE(0xff00, 0xffff) AM_READWRITE(i186_internal_port_r, i186_internal_port_w) |
| 2115 | AM_RANGE(0xff00, 0xffff) AM_READWRITE(i80186_internal_port_r, i80186_internal_port_w) |
| 2154 | 2116 | ADDRESS_MAP_END |
| 2155 | 2117 | |
| 2156 | 2118 | |
| 2157 | | ADDRESS_MAP_START( leland_i86_map_io, ADDRESS_SPACE_IO, 8 ) |
| 2119 | ADDRESS_MAP_START( leland_80186_map_io, ADDRESS_SPACE_IO, 16 ) |
| 2158 | 2120 | AM_RANGE(0x0000, 0x000b) AM_WRITE(dac_w) |
| 2159 | 2121 | AM_RANGE(0x0080, 0x008b) AM_WRITE(dac_w) |
| 2160 | 2122 | AM_RANGE(0x00c0, 0x00cb) AM_WRITE(dac_w) |
| 2161 | | AM_RANGE(0xff00, 0xffff) AM_READWRITE(i186_internal_port_r, i186_internal_port_w) |
| 2123 | AM_RANGE(0xff00, 0xffff) AM_READWRITE(i80186_internal_port_r, i80186_internal_port_w) |
| 2162 | 2124 | ADDRESS_MAP_END |
| 2163 | 2125 | |
| 2164 | 2126 | |
src/mame/drivers/wgp.c
| r869 | r870 | |
| 289 | 289 | Be aware that the "Machine ID" Dip Switch must be set to 1, or the tests are |
| 290 | 290 | NOT performed (I can't explain why for the moment) ! |
| 291 | 291 | |
| 292 | | The "Machine ID" determines which motorbike you will use and has an incidence |
| 293 | | on the start position on the grid. Motorbike 2 seems to be the best one as |
| 294 | | it is always on 1st position (against 2nd position for motorbike 1). |
| 292 | 2) 'wgpjoy*' |
| 295 | 293 | |
| 296 | | The "Slave / Master" Dip Switch is only a guess according to some other linked |
| 297 | | machines (eg: "Cadash"), and due to incomplete LAN RAM emulation, I haven't |
| 298 | | seen any visible effect 8( |
| 299 | | |
| 300 | | The "Motor Test" Dip Switch is a feature that is available (or not) in the |
| 301 | | "test mode". I can't tell for the moment if it has any effect during gameplay. |
| 302 | | |
| 303 | | 2) 'wgpj' |
| 304 | | |
| 305 | 294 | LAN stuff : |
| 306 | 295 | |
| 307 | | Same stuff for the LAN RAM as in 'wgp' (the ROMS for CPUB are the same) ... |
| 296 | It is very surprising, but you also find the text about the LAN stuff in |
| 297 | the ROMS (still version 1.06), but you can't perform lan tests in the |
| 298 | "test mode". |
| 308 | 299 | |
| 309 | | Dip Switches : |
| 300 | As the LAN version is the same, I'll have to look at the code to see where |
| 301 | the differences are. |
| 310 | 302 | |
| 311 | | Same as the ones for 'wgp' if you except the "Coinage" Dip Switches. |
| 312 | | |
| 313 | 303 | 3) 'wgp2' |
| 314 | 304 | |
| 315 | 305 | LAN stuff : |
| 316 | 306 | |
| 317 | 307 | I haven't tested the LAN stuff for the moment. |
| 318 | 308 | |
| 319 | | Dip Switches : |
| 320 | 309 | |
| 321 | | They are almost the same as for 'wgpj' : the only is that there is no |
| 322 | | "Motor Test" Dip Switch has this feature is ALWAYS available in the "test mode". |
| 310 | Stephh's notes (based on the game M68000 code and some tests) : |
| 323 | 311 | |
| 324 | | 4) 'wgpjoy' |
| 312 | 1) 'wgp' and 'wgpj' |
| 325 | 313 | |
| 326 | | LAN stuff : |
| 314 | - Region stored at 0x03fffe.w and sub-region stored at 0x03fffc.w |
| 315 | - Sets : |
| 316 | * 'wgp' : region = 0x0001 - sub-region = 0x0002 |
| 317 | * 'wgpj' : region = 0x0000 - sub-region = 0x0000 |
| 318 | - Coinage relies on the region (code at 0x00dd10) : |
| 319 | * 0x0000 (Japan) use TAITO_COINAGE_JAPAN_NEW |
| 320 | * 0x0001 (US) use TAITO_COINAGE_US |
| 321 | * 0x0002 (World), 0x0003 (US, licenced to ROMSTAR) and 0x0004 (licenced to PHOENIX ELECTRONICS CO.) |
| 322 | use slighlty different TAITO_COINAGE_WORLD : 1C_7C instead of 1C_6C for Coin B |
| 323 | - GP order relies on the sub-region (code at 0x00bc9c) : |
| 324 | * 0x0000 : 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 |
| 325 | * 0x0001 : 0x01 0x00 0x02 0x03 0x04 0x05 0x06 0x07 |
| 326 | * 0x0002 : 0x02 0x00 0x01 0x02 0x04 0x05 0x06 0x07 |
| 327 | * 0x0003 : 0x03 0x00 0x01 0x03 0x04 0x05 0x06 0x07 |
| 328 | * 0x0004 : 0x04 0x00 0x01 0x02 0x03 0x05 0x06 0x07 |
| 329 | * 0x0005 : 0x05 0x00 0x01 0x02 0x03 0x04 0x06 0x07 |
| 330 | * 0x0006 : 0x06 0x00 0x01 0x02 0x03 0x04 0x05 0x07 |
| 331 | * 0x0007 : 0x07 0x00 0x01 0x02 0x03 0x04 0x05 0x06 |
| 332 | GP country : |
| 333 | * 0x00 : Japan |
| 334 | * 0x01 : Australia |
| 335 | * 0x02 : USA |
| 336 | * 0x03 : Germany |
| 337 | * 0x04 : Netherlands |
| 338 | * 0x05 : Belgium |
| 339 | * 0x06 : France |
| 340 | * 0x07 : England |
| 341 | - Notice screen only if region = 0x0000 or region = 0x0001 |
| 342 | - FBI logo only if region = 0x0001 |
| 343 | - DSWA bit 0 does the following things when set to ON : |
| 344 | * "MACHINE TEST" message and additional tests on startup (code at 0x00b06e) |
| 345 | * alternate "SHIFT PATTERN SELECT" screen (code at 0x00ccdc) |
| 346 | * accel / brake "buttons" have different behaviour (code at 0x029ca0) : |
| 347 | . same as default when selecting "NORMAL" (4 gears, street machines) |
| 348 | . swapped "buttons" when selecting "RACING" (6 gears, racing machines) |
| 349 | * additional value sent to shared memory every frame (code at 0x00afd2) |
| 350 | * additional "MOTOR TEST" in the "test mode" |
| 327 | 351 | |
| 328 | | It is very surprising, but you also find the text about the LAN stuff in |
| 329 | | the ROMS (still version 1.06), but you can't perform lan tests in the |
| 330 | | "test mode". |
| 331 | 352 | |
| 332 | | 5) 'wgpjoya' |
| 353 | 2) 'wgpjoy*' |
| 333 | 354 | |
| 334 | | LAN stuff : |
| 355 | - Region stored at 0x03fffe.w and sub-region stored at 0x03fffc.w |
| 356 | - Sets : |
| 357 | * 'wgpjoy' : region = 0x0000 - sub-region = 0x0000 |
| 358 | * 'wgpjoya' : region = 0x0000 - sub-region = 0x0000 |
| 359 | - DSWA bit 0 does the following things when set to ON : |
| 360 | * "MACHINE TEST" message and additional tests on startup (code at 0x00b094) |
| 361 | * alternate "SHIFT PATTERN SELECT" screen (code at 0x00cd02) |
| 362 | * accel / brake "buttons" have different behaviour (code at 0x0298c6) : |
| 363 | . same as default when selecting "NORMAL" (4 gears, street machines) |
| 364 | . swapped "buttons" when selecting "RACING" (6 gears, racing machines) |
| 365 | * additional value sent to shared memory every frame (code at 0x00aff8) |
| 366 | - DSWB bits 4 to 7 ("Communication" and "Machine ID") have no effect |
| 367 | due to "ori.w #$f0ff, D0" instruction at 0x003300 ! |
| 368 | - "Test mode" is completely different |
| 369 | - Same other notes as for 'wgp' (different addresses though) |
| 335 | 370 | |
| 336 | | It is very surprising, but you also find the text about the LAN stuff in |
| 337 | | the ROMS (still version 1.06), but you can't perform lan tests in the |
| 338 | | "test mode". |
| 339 | 371 | |
| 340 | | As the LAN version is the same, I'll have to look at the code to see where |
| 341 | | the differences are. |
| 372 | 3) 'wgp2' |
| 342 | 373 | |
| 374 | - Region stored at 0x03fffe.w and sub-region stored at 0x03fffc.w |
| 375 | - Sets : |
| 376 | * 'wgp2' : region = 0x0000 - sub-region = 0x0000 |
| 377 | - Coinage relies on the region (code at 0x00166e) : |
| 378 | * 0x0000 (Japan) use TAITO_COINAGE_JAPAN_NEW |
| 379 | * 0x0001 (US) use TAITO_COINAGE_US |
| 380 | * 0x0002 (World) use slighlty different TAITO_COINAGE_WORLD : |
| 381 | 1C_7C instead of 1C_6C for Coin B, same settings otherwise |
| 382 | - Notice screen only if region = 0x0000 or region = 0x0001 |
| 383 | - FBI logo only if region = 0x0001 |
| 384 | - Routine at 0x01116c is the same as the one in 'wgp' based on sub-region; |
| 385 | however, as you can partically select your GP at start, and as I suck |
| 386 | at such driving game, I wonder if this routine is still called ! |
| 387 | - DSWA bit 0 does the following things when set to ON : |
| 388 | * unknown effect (code at 0x0126f6) |
| 389 | * accel / brake "buttons" have different behaviour (code at 0x0142d2) : |
| 390 | . same as default when selecting "NORMAL" (4 gears, street machines) |
| 391 | . swapped "buttons" when selecting "RACING" (6 gears, racing machines) |
| 392 | - Always "MOTOR TEST" in the "test mode" |
| 393 | |
| 343 | 394 | ***************************************************************************/ |
| 344 | 395 | |
| 345 | 396 | #include "driver.h" |
| 397 | #include "taitoipt.h" |
| 346 | 398 | #include "cpu/m68000/m68000.h" |
| 347 | 399 | #include "video/taitoic.h" |
| 348 | 400 | #include "audio/taitosnd.h" |
| r869 | r870 | |
| 488 | 540 | } |
| 489 | 541 | |
| 490 | 542 | |
| 543 | #define STEER_PORT_TAG "STEER" |
| 544 | #define UNKNOWN_PORT_TAG "UNKNOWN" |
| 545 | #define FAKE_PORT_TAG "FAKE" |
| 546 | |
| 491 | 547 | static READ16_HANDLER( wgp_adinput_r ) |
| 492 | 548 | { |
| 493 | 549 | int steer = 0x40; |
| 494 | | int fake = input_port_5_word_r(0,0); |
| 550 | int fake = readinputportbytag_safe(FAKE_PORT_TAG,0x00); |
| 495 | 551 | |
| 496 | | if (!(fake &0x10)) /* Analogue steer (the real control method) */ |
| 552 | if (!(fake & 0x10)) /* Analogue steer (the real control method) */ |
| 497 | 553 | { |
| 498 | 554 | /* Reduce span to 0x80 */ |
| 499 | | steer = ((input_port_6_word_r(0,0)) * 0x80) / 0x100; |
| 555 | steer = (readinputportbytag_safe(STEER_PORT_TAG,0x00) * 0x80) / 0x100; |
| 500 | 556 | } |
| 501 | 557 | else /* Digital steer */ |
| 502 | 558 | { |
| 503 | | if (fake & 0x8) /* pressing down */ |
| 559 | if (fake & 0x08) /* pressing down */ |
| 504 | 560 | steer = 0x20; |
| 505 | 561 | |
| 506 | | if (fake & 0x4) /* pressing up */ |
| 562 | if (fake & 0x04) /* pressing up */ |
| 507 | 563 | steer = 0x60; |
| 508 | 564 | |
| 509 | | if (fake & 0x2) /* pressing right */ |
| 565 | if (fake & 0x02) /* pressing right */ |
| 510 | 566 | steer = 0x00; |
| 511 | 567 | |
| 512 | | if (fake & 0x1) /* pressing left */ |
| 568 | if (fake & 0x01) /* pressing left */ |
| 513 | 569 | steer = 0x80; |
| 514 | 570 | } |
| 515 | 571 | |
| r869 | r870 | |
| 517 | 573 | { |
| 518 | 574 | case 0x00: |
| 519 | 575 | { |
| 520 | | if (input_port_5_word_r(0,0) &0x40) /* pressing accel */ |
| 576 | if (fake & 0x40) /* pressing accel */ |
| 521 | 577 | return 0xff; |
| 522 | 578 | else |
| 523 | 579 | return 0x00; |
| r869 | r870 | |
| 534 | 590 | |
| 535 | 591 | case 0x04: |
| 536 | 592 | { |
| 537 | | if (input_port_5_word_r(0,0) &0x80) /* pressing brake */ |
| 593 | if (fake & 0x80) /* pressing brake */ |
| 538 | 594 | return 0xcf; |
| 539 | 595 | else |
| 540 | 596 | return 0xff; |
| 541 | 597 | } |
| 542 | 598 | |
| 543 | 599 | case 0x05: |
| 544 | | return input_port_7_word_r(0,0); /* unknown */ |
| 600 | return readinputportbytag_safe(UNKNOWN_PORT_TAG,0x00); /* unknown */ |
| 545 | 601 | } |
| 546 | 602 | |
| 547 | 603 | logerror("CPU #0 PC %06x: warning - read unmapped a/d input offset %06x\n",activecpu_get_pc(),offset); |
| r869 | r870 | |
| 685 | 741 | INPUT PORTS, DIPs |
| 686 | 742 | ***********************************************************/ |
| 687 | 743 | |
| 688 | | /* Duplicated macros from most other Taito drivers : |
| 689 | | |
| 690 | | asuka.c |
| 691 | | exzisus.c |
| 692 | | ninjaw.c |
| 693 | | opwolf.c |
| 694 | | othunder.c |
| 695 | | taito_b.c |
| 696 | | taito_f2.c |
| 697 | | taito_h.c |
| 698 | | taito_l.c |
| 699 | | taito_x.c |
| 700 | | taitoair.c |
| 701 | | topspeed.c |
| 702 | | warriorb.c |
| 703 | | */ |
| 704 | | |
| 705 | | /* Same as TAITO_DIFFICULTY_8 in most Taito drivers. */ |
| 706 | | #define TAITO_DIFFICULTY_8 \ |
| 707 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) \ |
| 708 | | PORT_DIPSETTING( 0x02, DEF_STR( Easy ) ) \ |
| 709 | | PORT_DIPSETTING( 0x03, DEF_STR( Medium ) ) \ |
| 710 | | PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) \ |
| 711 | | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 712 | | |
| 713 | | /* Same as TAITO_COINAGE_JAPAN_NEW_8 in most Taito drivers. */ |
| 714 | | #define TAITO_COINAGE_JAPAN_NEW_8 \ |
| 715 | | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) \ |
| 716 | | PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) \ |
| 717 | | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) \ |
| 718 | | PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) \ |
| 719 | | PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) \ |
| 720 | | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) \ |
| 721 | | PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) \ |
| 722 | | PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) \ |
| 723 | | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) \ |
| 724 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) |
| 725 | | |
| 726 | | /* Same as TAITO_COINAGE_US_8 in most Taito drivers. */ |
| 727 | | #define TAITO_COINAGE_US_8 \ |
| 728 | | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) ) \ |
| 729 | | PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) \ |
| 730 | | PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) \ |
| 731 | | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) \ |
| 732 | | PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) \ |
| 733 | | PORT_DIPNAME( 0xc0, 0xc0, "Price to Continue" ) \ |
| 734 | | PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) \ |
| 735 | | PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) \ |
| 736 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_1C ) ) \ |
| 737 | | PORT_DIPSETTING( 0xc0, "Same as Start" ) |
| 738 | | |
| 739 | | |
| 740 | | /* Duplicated macros from some other Taito drivers */ |
| 741 | | |
| 742 | | /* Same as TAITO_B_DSWA_2_4 in taito_b.c and TAITO_L_DSWA_2_4 in taito_l.c */ |
| 743 | | #define TAITO_WGP_DSWA_2_4 \ |
| 744 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) \ |
| 745 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) \ |
| 746 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) \ |
| 747 | | PORT_SERVICE( 0x04, IP_ACTIVE_LOW ) \ |
| 748 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) \ |
| 749 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ |
| 750 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 751 | | |
| 752 | | /* Same as TAITO_X_SYSTEM_INPUT in taito_x.c */ |
| 753 | | #define TAITO_WGP_SYSTEM_INPUT \ |
| 754 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT ) \ |
| 755 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) \ |
| 756 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) \ |
| 757 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 758 | | |
| 759 | | |
| 760 | | /* Driver specific macros */ |
| 761 | | |
| 762 | | /* Slightly different from TAITO_COINAGE_WORLD_8 in MANY Taito drivers : |
| 763 | | 1C_7C instead of 1C_6C for "Coin B". */ |
| 764 | | #define WGP_COINAGE_WORLD_8 \ |
| 765 | | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) \ |
| 766 | | PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) \ |
| 767 | | PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) \ |
| 768 | | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) \ |
| 769 | | PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) \ |
| 770 | | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) \ |
| 771 | | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) \ |
| 772 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) \ |
| 773 | | PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) \ |
| 774 | | PORT_DIPSETTING( 0x00, DEF_STR( 1C_7C ) ) |
| 775 | | |
| 776 | | #define WGP_MACHINE_ID_8 \ |
| 777 | | PORT_DIPNAME( 0xe0, 0xe0, "Machine ID" ) \ |
| 778 | | PORT_DIPSETTING( 0xe0, "1" ) \ |
| 779 | | PORT_DIPSETTING( 0xc0, "2" ) \ |
| 780 | | PORT_DIPSETTING( 0xa0, "3" ) \ |
| 781 | | PORT_DIPSETTING( 0x80, "4" ) \ |
| 782 | | PORT_DIPSETTING( 0x60, "5" ) \ |
| 783 | | PORT_DIPSETTING( 0x40, "6" ) \ |
| 784 | | PORT_DIPSETTING( 0x20, "7" ) \ |
| 785 | | PORT_DIPSETTING( 0x00, "8" ) |
| 786 | | |
| 787 | | |
| 788 | | INPUT_PORTS_START( wgp ) |
| 789 | | PORT_START /* DSW A */ |
| 790 | | PORT_DIPNAME( 0x01, 0x01, "Motor Test" ) // Only available in "test mode" |
| 791 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 744 | INPUT_PORTS_START( wgp_joy_generic ) |
| 745 | PORT_START_TAG("DSWA") |
| 746 | PORT_DIPNAME( 0x01, 0x01, "Gear Shift" ) /* see notes */ |
| 747 | PORT_DIPSETTING( 0x01, DEF_STR( Normal ) ) |
| 748 | PORT_DIPSETTING( 0x00, "Normal / Racing" ) |
| 749 | TAITO_DSWA_BITS_1_TO_3 |
| 750 | /* The 4 following Dip Switches will be filled by TAITO_COINAGE_* macros */ |
| 751 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 752 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 792 | 753 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 793 | | TAITO_WGP_DSWA_2_4 |
| 794 | | TAITO_COINAGE_US_8 |
| 754 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 755 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 756 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 757 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 758 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 759 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 760 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 761 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 762 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 795 | 763 | |
| 796 | | PORT_START /* DSW B */ |
| 797 | | TAITO_DIFFICULTY_8 |
| 764 | PORT_START_TAG("DSWB") |
| 765 | TAITO_DIFFICULTY |
| 798 | 766 | PORT_DIPNAME( 0x04, 0x04, "Shift Pattern Select" ) |
| 799 | 767 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 800 | 768 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 801 | | PORT_DIPNAME( 0x08, 0x08, "Slave / Master ???" ) |
| 802 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 803 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 804 | | PORT_DIPNAME( 0x10, 0x10, "Communication" ) |
| 805 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 806 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 807 | | WGP_MACHINE_ID_8 |
| 769 | PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW ) |
| 770 | PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW ) /* see notes */ |
| 771 | PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW ) /* see notes */ |
| 772 | PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW ) /* see notes */ |
| 773 | PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW ) /* see notes */ |
| 808 | 774 | |
| 809 | | PORT_START /* IN0 */ |
| 810 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(1) /* freeze */ |
| 811 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) /* shift up */ |
| 812 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) /* shift down */ |
| 813 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 814 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 815 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 816 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 817 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 818 | | |
| 819 | | PORT_START /* IN1 */ |
| 820 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1) /* "start lump" (lamp?) */ |
| 821 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1) /* "brake lump" (lamp?) */ |
| 822 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 823 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 824 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 825 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 826 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 827 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 828 | | |
| 829 | | PORT_START /* IN2 */ |
| 830 | | TAITO_WGP_SYSTEM_INPUT |
| 775 | PORT_START_TAG("IN0") |
| 776 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 777 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) /* shift up - see notes */ |
| 778 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) /* shift down - see notes */ |
| 779 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 831 | 780 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 832 | 781 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 833 | 782 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 834 | 783 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 835 | 784 | |
| 836 | | PORT_START /* fake inputs, allowing digital steer etc. */ |
| 837 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1) |
| 838 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) |
| 839 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1) |
| 840 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) |
| 841 | | PORT_DIPNAME( 0x10, 0x10, "Steering type" ) |
| 842 | | PORT_DIPSETTING( 0x10, "Digital" ) |
| 843 | | PORT_DIPSETTING( 0x00, "Analogue" ) |
| 844 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) /* accel */ |
| 845 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) /* brake */ |
| 846 | | |
| 847 | | /* It's not clear for accel and brake which is the input and |
| 848 | | which the offset, but that doesn't matter. These continuous |
| 849 | | inputs are replaced by discrete values derived from the fake |
| 850 | | input port above, so keyboard control is feasible. */ |
| 851 | | |
| 852 | | // PORT_START /* accel, 0-255 */ |
| 853 | | // PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_REVERSE PORT_PLAYER(1) |
| 854 | | |
| 855 | | PORT_START /* steer */ |
| 856 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_REVERSE PORT_PLAYER(1) |
| 857 | | |
| 858 | | // PORT_START /* steer offset */ |
| 859 | | |
| 860 | | // PORT_START /* accel offset */ |
| 861 | | |
| 862 | | // PORT_START /* brake, 0-0x30: needs to start at 0xff; then 0xcf is max brake */ |
| 863 | | // PORT_BIT( 0xff, 0xff, IPT_AD_STICK_X ) PORT_MINMAX(0xcf,0xff) PORT_SENSITIVITY(10) PORT_KEYDELTA(5) PORT_PLAYER(2) |
| 864 | | |
| 865 | | PORT_START /* unknown */ |
| 866 | | PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(2) |
| 867 | | INPUT_PORTS_END |
| 868 | | |
| 869 | | /* Same as 'wgp', but different coinage */ |
| 870 | | INPUT_PORTS_START( wgpj ) |
| 871 | | PORT_START /* DSW A */ |
| 872 | | PORT_DIPNAME( 0x01, 0x01, "Motor Test" ) // Only available in "test mode" |
| 873 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 874 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 875 | | TAITO_WGP_DSWA_2_4 |
| 876 | | TAITO_COINAGE_JAPAN_NEW_8 |
| 877 | | |
| 878 | | PORT_START /* DSW B */ |
| 879 | | TAITO_DIFFICULTY_8 |
| 880 | | PORT_DIPNAME( 0x04, 0x04, "Shift Pattern Select" ) |
| 881 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 882 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 883 | | PORT_DIPNAME( 0x08, 0x08, "Slave / Master ???" ) |
| 884 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 885 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 886 | | PORT_DIPNAME( 0x10, 0x10, "Communication" ) |
| 887 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 888 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 889 | | WGP_MACHINE_ID_8 |
| 890 | | |
| 891 | | PORT_START /* IN0 */ |
| 892 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(1) /* freeze */ |
| 893 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) /* shift up */ |
| 894 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) /* shift down */ |
| 895 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 896 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 897 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 898 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 899 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 900 | | |
| 901 | | PORT_START /* IN1 */ |
| 902 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1) /* "start lump" (lamp?) */ |
| 903 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1) /* "brake lump" (lamp?) */ |
| 904 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 905 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 906 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 907 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 908 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 909 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 910 | | |
| 911 | | PORT_START /* IN2 */ |
| 912 | | TAITO_WGP_SYSTEM_INPUT |
| 785 | PORT_START_TAG("IN1") |
| 786 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 787 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 788 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 789 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 913 | 790 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 914 | 791 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 915 | 792 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 916 | 793 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 917 | 794 | |
| 918 | | PORT_START /* fake inputs, allowing digital steer etc. */ |
| 919 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1) |
| 920 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) |
| 921 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1) |
| 922 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) |
| 923 | | PORT_DIPNAME( 0x10, 0x10, "Steering type" ) |
| 924 | | PORT_DIPSETTING( 0x10, "Digital" ) |
| 925 | | PORT_DIPSETTING( 0x00, "Analogue" ) |
| 926 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) /* accel */ |
| 927 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) /* brake */ |
| 928 | | |
| 929 | | /* It's not clear for accel and brake which is the input and |
| 930 | | which the offset, but that doesn't matter. These continuous |
| 931 | | inputs are replaced by discrete values derived from the fake |
| 932 | | input port above, so keyboard control is feasible. */ |
| 933 | | |
| 934 | | // PORT_START /* accel, 0-255 */ |
| 935 | | // PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_REVERSE PORT_PLAYER(1) |
| 936 | | |
| 937 | | PORT_START /* steer */ |
| 938 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_REVERSE PORT_PLAYER(1) |
| 939 | | |
| 940 | | // PORT_START /* steer offset */ |
| 941 | | |
| 942 | | // PORT_START /* accel offset */ |
| 943 | | |
| 944 | | // PORT_START /* brake, 0-0x30: needs to start at 0xff; then 0xcf is max brake */ |
| 945 | | // PORT_BIT( 0xff, 0xff, IPT_AD_STICK_X ) PORT_MINMAX(0xcf,0xff) PORT_SENSITIVITY(10) PORT_KEYDELTA(5) PORT_PLAYER(2) |
| 946 | | |
| 947 | | PORT_START /* unknown */ |
| 948 | | PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(2) |
| 795 | PORT_START_TAG("IN2") |
| 796 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) /* brake */ |
| 797 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 798 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 799 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) /* accel */ |
| 800 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 801 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 802 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 803 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 949 | 804 | INPUT_PORTS_END |
| 950 | 805 | |
| 951 | | INPUT_PORTS_START( wgpjoy ) |
| 952 | | PORT_START /* DSW A */ |
| 953 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 954 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 955 | | TAITO_WGP_DSWA_2_4 |
| 956 | | TAITO_COINAGE_JAPAN_NEW_8 |
| 806 | INPUT_PORTS_START( wgp_no_joy_generic ) |
| 807 | PORT_INCLUDE(wgp_joy_generic) |
| 957 | 808 | |
| 958 | | PORT_START /* DSW B */ |
| 959 | | TAITO_DIFFICULTY_8 |
| 960 | | PORT_DIPNAME( 0x04, 0x04, "Shift Pattern Select" ) |
| 961 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 962 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 963 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 964 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 965 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 966 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 809 | PORT_MODIFY("DSWB") |
| 810 | PORT_DIPNAME( 0x10, 0x10, "Communication" ) |
| 967 | 811 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 968 | 812 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 969 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 970 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 971 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 972 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 973 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 974 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 975 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 976 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 977 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 813 | PORT_DIPNAME( 0xe0, 0xe0, "Machine ID" ) |
| 814 | PORT_DIPSETTING( 0xe0, "1" ) |
| 815 | PORT_DIPSETTING( 0xc0, "2" ) |
| 816 | PORT_DIPSETTING( 0xa0, "3" ) |
| 817 | PORT_DIPSETTING( 0x80, "4" ) |
| 818 | PORT_DIPSETTING( 0x60, "5" ) |
| 819 | PORT_DIPSETTING( 0x40, "6" ) |
| 820 | PORT_DIPSETTING( 0x20, "7" ) |
| 821 | PORT_DIPSETTING( 0x00, "8" ) |
| 978 | 822 | |
| 979 | | PORT_START /* IN0 */ |
| 980 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 981 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 982 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 983 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 984 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 985 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 986 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 987 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 823 | PORT_MODIFY("IN0") |
| 824 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F1) |
| 825 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) /* shift up - see notes */ |
| 826 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) /* shift down - see notes */ |
| 827 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 988 | 828 | |
| 989 | | PORT_START /* IN1, is it read? */ |
| 990 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 991 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 992 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 993 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 994 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 995 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 996 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 997 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 998 | | |
| 999 | | PORT_START /* IN2 */ |
| 1000 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 829 | PORT_MODIFY("IN2") |
| 830 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT ) |
| 1001 | 831 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1002 | 832 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1003 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 1004 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1005 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1006 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1007 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 833 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1008 | 834 | |
| 1009 | | PORT_START /* doesn't exist */ |
| 835 | PORT_START_TAG(STEER_PORT_TAG) |
| 836 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_REVERSE PORT_PLAYER(1) |
| 1010 | 837 | |
| 1011 | | PORT_START /* doesn't exist */ |
| 838 | PORT_START_TAG(UNKNOWN_PORT_TAG) |
| 839 | PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(2) |
| 840 | |
| 841 | /* fake inputs, allowing digital steer etc. */ |
| 842 | PORT_START_TAG(FAKE_PORT_TAG) |
| 843 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1) |
| 844 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) |
| 845 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1) |
| 846 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) |
| 847 | PORT_CONFNAME( 0x10, 0x10, "Steering type" ) |
| 848 | PORT_CONFSETTING( 0x10, "Digital" ) |
| 849 | PORT_CONFSETTING( 0x00, "Analogue" ) |
| 850 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) /* accel */ |
| 851 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) /* brake */ |
| 1012 | 852 | INPUT_PORTS_END |
| 1013 | 853 | |
| 1014 | | /* Same as 'wgpj', but no "Motor Test" Dip Switch (DSWA 0) */ |
| 1015 | | INPUT_PORTS_START( wgp2 ) /* Wgp2 has no "lumps" ? */ |
| 1016 | | PORT_START /* DSW A */ |
| 1017 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 1018 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1019 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1020 | | TAITO_WGP_DSWA_2_4 |
| 1021 | | TAITO_COINAGE_JAPAN_NEW_8 |
| 1022 | 854 | |
| 1023 | | PORT_START /* DSW B */ |
| 1024 | | TAITO_DIFFICULTY_8 |
| 1025 | | PORT_DIPNAME( 0x04, 0x04, "Shift Pattern Select" ) |
| 1026 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1027 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1028 | | PORT_DIPNAME( 0x08, 0x08, "Slave / Master ???" ) |
| 1029 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 1030 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1031 | | PORT_DIPNAME( 0x10, 0x10, "Communication" ) |
| 1032 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 1033 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1034 | | WGP_MACHINE_ID_8 |
| 855 | INPUT_PORTS_START( wgp ) |
| 856 | PORT_INCLUDE(wgp_no_joy_generic) |
| 1035 | 857 | |
| 1036 | | PORT_START /* IN0 */ |
| 1037 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(1) /* freeze */ |
| 1038 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) /* shift up */ |
| 1039 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) /* shift down */ |
| 1040 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 1041 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1042 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1043 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1044 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 858 | /* 0x180000 -> 0x10bf16 and 0x140010 (shared RAM) */ |
| 859 | PORT_MODIFY("DSWA") |
| 860 | TAITO_COINAGE_US |
| 1045 | 861 | |
| 1046 | | PORT_START /* IN1 */ |
| 1047 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1) /* "start lump" (lamp?) */ |
| 1048 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1) /* "brake lump" (lamp?) */ |
| 1049 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1050 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1051 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1052 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1053 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1054 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 862 | /* 0x180002 -> 0x10bf18 and 0x140012 (shared RAM) : DSWB */ |
| 1055 | 863 | |
| 1056 | | PORT_START /* IN2 */ |
| 1057 | | TAITO_WGP_SYSTEM_INPUT |
| 1058 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1059 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1060 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1061 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 864 | PORT_MODIFY("IN1") |
| 865 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1) /* "start lump" (lamp?) - test mode only */ |
| 866 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1) /* "brake lump" (lamp?) - test mode only */ |
| 867 | INPUT_PORTS_END |
| 1062 | 868 | |
| 1063 | | PORT_START /* fake inputs, allowing digital steer etc. */ |
| 1064 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1) |
| 1065 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) |
| 1066 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1) |
| 1067 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) |
| 1068 | | PORT_DIPNAME( 0x10, 0x10, "Steering type" ) |
| 1069 | | PORT_DIPSETTING( 0x10, "Digital" ) |
| 1070 | | PORT_DIPSETTING( 0x00, "Analogue" ) |
| 1071 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) /* accel */ |
| 1072 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) /* brake */ |
| 869 | INPUT_PORTS_START( wgpj ) |
| 870 | PORT_INCLUDE(wgp) |
| 1073 | 871 | |
| 1074 | | /* It's not clear for accel and brake which is the input and |
| 1075 | | which the offset, but that doesn't matter. These continuous |
| 1076 | | inputs are replaced by discrete values derived from the fake |
| 1077 | | input port above, so keyboard control is feasible. */ |
| 872 | PORT_MODIFY("DSWA") |
| 873 | TAITO_COINAGE_JAPAN_NEW |
| 874 | INPUT_PORTS_END |
| 1078 | 875 | |
| 1079 | | // PORT_START /* accel, 0-255 */ |
| 1080 | | // PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_REVERSE PORT_PLAYER(1) |
| 876 | INPUT_PORTS_START( wgpjoy ) |
| 877 | PORT_INCLUDE(wgp_joy_generic) |
| 1081 | 878 | |
| 1082 | | PORT_START /* steer */ |
| 1083 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_REVERSE PORT_PLAYER(1) |
| 879 | /* 0x180000 -> 0x10bf1a and 0x140010 (shared RAM) */ |
| 880 | PORT_MODIFY("DSWA") |
| 881 | TAITO_COINAGE_JAPAN_NEW |
| 1084 | 882 | |
| 1085 | | // PORT_START /* steer offset */ |
| 883 | /* 0x180002 -> 0x10bf1c and 0x140012 (shared RAM) : DSWB*/ |
| 884 | INPUT_PORTS_END |
| 1086 | 885 | |
| 1087 | | // PORT_START /* accel offset */ |
| 886 | INPUT_PORTS_START( wgp2 ) |
| 887 | PORT_INCLUDE(wgp_no_joy_generic) |
| 1088 | 888 | |
| 1089 | | // PORT_START /* brake, 0-0x30: needs to start at 0xff; then 0xcf is max brake */ |
| 1090 | | // PORT_BIT( 0xff, 0xff, IPT_AD_STICK_X ) PORT_MINMAX(0xcf,0xff) PORT_SENSITIVITY(10) PORT_KEYDELTA(5) PORT_PLAYER(2) |
| 889 | /* 0x180000 -> 0x107d3a.b (-$2c6,A5) and 0x140018 (shared RAM) */ |
| 890 | PORT_MODIFY("DSWA") |
| 891 | TAITO_COINAGE_JAPAN_NEW |
| 1091 | 892 | |
| 1092 | | PORT_START /* unknown */ |
| 1093 | | PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(2) |
| 893 | /* 0x180002 -> 0x107d3b.b (-$2c5,A5) and 0x140012 (shared RAM) : DSWB */ |
| 1094 | 894 | INPUT_PORTS_END |
| 1095 | 895 | |
| 1096 | 896 | |
| r869 | r870 | |
| 1498 | 1298 | |
| 1499 | 1299 | GAME( 1989, wgp, 0, wgp, wgp, wgp, ROT0, "Taito America Corporation", "World Grand Prix (US)", GAME_IMPERFECT_GRAPHICS ) |
| 1500 | 1300 | GAME( 1989, wgpj, wgp, wgp, wgpj, wgp, ROT0, "Taito Corporation", "World Grand Prix (Japan)", GAME_IMPERFECT_GRAPHICS ) |
| 1501 | | GAME( 1989, wgpjoy, wgp, wgp, wgpjoy, wgp, ROT0, "Taito Corporation", "World Grand Prix (joystick version set 1) (Japan)", GAME_IMPERFECT_GRAPHICS ) |
| 1502 | | GAME( 1989, wgpjoya, wgp, wgp, wgpjoy, wgp, ROT0, "Taito Corporation", "World Grand Prix (joystick version set 2) (Japan)", GAME_IMPERFECT_GRAPHICS ) |
| 1301 | GAME( 1989, wgpjoy, wgp, wgp, wgpjoy, wgp, ROT0, "Taito Corporation", "World Grand Prix (joystick version) (Japan, set 1)", GAME_IMPERFECT_GRAPHICS ) |
| 1302 | GAME( 1989, wgpjoya, wgp, wgp, wgpjoy, wgp, ROT0, "Taito Corporation", "World Grand Prix (joystick version) (Japan, set 2)", GAME_IMPERFECT_GRAPHICS ) |
| 1503 | 1303 | GAME( 1990, wgp2, wgp, wgp2, wgp2, wgp2, ROT0, "Taito Corporation", "World Grand Prix 2 (Japan)", GAME_IMPERFECT_GRAPHICS ) |
| 1504 | 1304 | |
src/mame/drivers/tx1.c
| r869 | r870 | |
| 65 | 65 | |
| 66 | 66 | static int TS, z80_int = 0; |
| 67 | 67 | |
| 68 | | UINT8 *tx1_vram; |
| 69 | | UINT8 *tx1_object_ram; |
| 68 | UINT16 *tx1_vram; |
| 69 | UINT16 *tx1_object_ram; |
| 70 | 70 | |
| 71 | | UINT8 *buggyboy_vram; /* Tile RAM (three monitor) */ |
| 72 | | UINT8 *buggyb1_vram; /* Tile RAM (single monitor) */ |
| 71 | UINT16 *buggyboy_vram; /* Tile RAM (three monitor) */ |
| 72 | UINT16 *buggyb1_vram; /* Tile RAM (single monitor) */ |
| 73 | 73 | static UINT8 *z80_ram; /* Main 8086/Z80 shared RAM */ |
| 74 | | UINT8 *bb_objram; |
| 75 | | UINT8 *bb_sky; /* Sky register */ |
| 76 | | UINT8 *bb_rcram; |
| 74 | UINT16 *bb_objram; |
| 75 | UINT16 *bb_sky; /* Sky register */ |
| 76 | UINT16 *bb_rcram; |
| 77 | 77 | |
| 78 | 78 | size_t tx1_objectram_size; |
| 79 | 79 | size_t bb_objectram_size; |
| r869 | r870 | |
| 85 | 85 | |
| 86 | 86 | /* machine/tx1.c */ |
| 87 | 87 | void MMI_74S516(int ins, UINT16 *data); |
| 88 | | READ8_HANDLER( BB_AU_R ); |
| 89 | | WRITE8_HANDLER( BB_AU_W ); |
| 88 | READ16_HANDLER( BB_AU_R ); |
| 89 | WRITE16_HANDLER( BB_AU_W ); |
| 90 | 90 | |
| 91 | 91 | /* video/tx1.c */ |
| 92 | | WRITE8_HANDLER( tx1_vram_w ); |
| 92 | WRITE16_HANDLER( tx1_vram_w ); |
| 93 | 93 | VIDEO_START( tx1 ); |
| 94 | 94 | VIDEO_UPDATE( tx1 ); |
| 95 | 95 | |
| 96 | 96 | PALETTE_INIT( buggyboy ); |
| 97 | | WRITE8_HANDLER( buggyboy_vram_w ); |
| 98 | | WRITE8_HANDLER( buggyb1_vram_w ); |
| 97 | WRITE16_HANDLER( buggyboy_vram_w ); |
| 98 | WRITE16_HANDLER( buggyb1_vram_w ); |
| 99 | 99 | VIDEO_START( buggyboy ); |
| 100 | 100 | VIDEO_UPDATE( buggyboy ); |
| 101 | 101 | VIDEO_START( buggyb1 ); |
| r869 | r870 | |
| 119 | 119 | |
| 120 | 120 | /* HD46505S-2 CRT Controller */ |
| 121 | 121 | /* Buggy Boy: The main 8086 at F003C expects non-zero value or else jump to 4000:0000 and execute crap */ |
| 122 | | static READ8_HANDLER(crt_read) |
| 122 | static READ16_HANDLER(crt_read) |
| 123 | 123 | { |
| 124 | 124 | return 1; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /* Remove this eventually */ |
| 128 | | static WRITE8_HANDLER(crt_write) |
| 128 | static WRITE16_HANDLER(crt_write) |
| 129 | 129 | { |
| 130 | 130 | #if PRINT_CRT |
| 131 | if (ACCESSING_LSB) |
| 132 | { |
| 133 | data &= 0xff; |
| 131 | 134 | if(offset==0) |
| 132 | 135 | { |
| 133 | 136 | switch (data) |
| r869 | r870 | |
| 170 | 173 | break; |
| 171 | 174 | } |
| 172 | 175 | } |
| 173 | | if(offset==2) mame_printf_debug("= 0x%x, %d\n",data,data); |
| 176 | if(offset==1) mame_printf_debug("= 0x%x, %d\n",data,data); |
| 177 | } |
| 174 | 178 | #endif |
| 175 | 179 | } |
| 176 | 180 | |
| 177 | 181 | |
| 178 | 182 | /* Main CPU and Z80 synchronisation*/ |
| 179 | | static WRITE8_HANDLER(z80_busreq) |
| 183 | static WRITE16_HANDLER(z80_busreq) |
| 180 | 184 | { |
| 181 | | if(data) |
| 182 | | { |
| 183 | | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); |
| 184 | | } |
| 185 | | else |
| 186 | | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); |
| 185 | if (ACCESSING_LSB) |
| 186 | { |
| 187 | if (data & 0xff) |
| 188 | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); |
| 189 | else |
| 190 | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); |
| 191 | } |
| 187 | 192 | } |
| 188 | 193 | |
| 189 | 194 | |
| 190 | 195 | /* Called by main 8086 to wake up slave */ |
| 191 | | static WRITE8_HANDLER(resume_slave) |
| 196 | static WRITE16_HANDLER(resume_slave) |
| 192 | 197 | { |
| 193 | 198 | cpunum_set_input_line(1, INPUT_LINE_TEST, ASSERT_LINE); |
| 194 | 199 | } |
| 195 | 200 | |
| 196 | | static READ8_HANDLER(halt_slave_r) |
| 201 | static READ16_HANDLER(halt_slave_r) |
| 197 | 202 | { |
| 198 | 203 | cpunum_set_input_line(1, INPUT_LINE_TEST, CLEAR_LINE); |
| 199 | 204 | return 0; |
| r869 | r870 | |
| 219 | 224 | |
| 220 | 225 | |
| 221 | 226 | /* Handlers for main CPU<->Z80 RAM */ |
| 222 | | static READ8_HANDLER(z80_shared_r) |
| 227 | static READ16_HANDLER(z80_shared_r) |
| 223 | 228 | { |
| 224 | | return z80_ram[offset/2]; |
| 229 | return z80_ram[offset]; |
| 225 | 230 | } |
| 226 | 231 | |
| 227 | | static WRITE8_HANDLER(z80_shared_w) |
| 232 | static WRITE16_HANDLER(z80_shared_w) |
| 228 | 233 | { |
| 229 | | if(offset%2 == 0) |
| 230 | | z80_ram[offset/2]=data; |
| 234 | if (ACCESSING_LSB) |
| 235 | z80_ram[offset] = data; |
| 231 | 236 | } |
| 232 | 237 | |
| 233 | 238 | INPUT_PORTS_START( tx1 ) |
| 234 | | PORT_START_TAG("DSW1") |
| 235 | | PORT_DIPNAME( 0x07, 0x03, DEF_STR( Difficulty ) ) |
| 236 | | PORT_DIPSETTING( 0x00, "A" ) |
| 237 | | PORT_DIPSETTING( 0x01, "B" ) |
| 238 | | PORT_DIPSETTING( 0x02, "C" ) |
| 239 | | PORT_DIPSETTING( 0x03, "D" ) |
| 240 | | PORT_DIPSETTING( 0x04, "E" ) |
| 241 | | PORT_DIPSETTING( 0x05, "F" ) |
| 242 | | PORT_DIPSETTING( 0x06, "G" ) |
| 243 | | PORT_DIPSETTING( 0x07, "H" ) |
| 239 | PORT_START_TAG("DSW1") |
| 240 | PORT_DIPNAME( 0x0700, 0x0300, DEF_STR( Difficulty ) ) |
| 241 | PORT_DIPSETTING( 0x0000, "A" ) |
| 242 | PORT_DIPSETTING( 0x0100, "B" ) |
| 243 | PORT_DIPSETTING( 0x0200, "C" ) |
| 244 | PORT_DIPSETTING( 0x0300, "D" ) |
| 245 | PORT_DIPSETTING( 0x0400, "E" ) |
| 246 | PORT_DIPSETTING( 0x0500, "F" ) |
| 247 | PORT_DIPSETTING( 0x0600, "G" ) |
| 248 | PORT_DIPSETTING( 0x0700, "H" ) |
| 244 | 249 | |
| 245 | | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Game_Time ) ) |
| 246 | | PORT_DIPSETTING( 0x00, "A" ) |
| 247 | | PORT_DIPSETTING( 0x08, "B" ) |
| 248 | | PORT_DIPSETTING( 0x10, "C" ) |
| 249 | | PORT_DIPSETTING( 0x18, "D" ) |
| 250 | PORT_DIPNAME( 0x1800, 0x0800, DEF_STR( Game_Time ) ) |
| 251 | PORT_DIPSETTING( 0x0000, "A" ) |
| 252 | PORT_DIPSETTING( 0x0800, "B" ) |
| 253 | PORT_DIPSETTING( 0x1000, "C" ) |
| 254 | PORT_DIPSETTING( 0x1800, "D" ) |
| 250 | 255 | |
| 251 | | PORT_DIPNAME( 0xe0, 0xe0, "Bonus Adder" ) |
| 252 | | PORT_DIPSETTING( 0x00, "No Bonus" ) |
| 253 | | PORT_DIPSETTING( 0x20, "2 Coin Units for 1 Credit" ) |
| 254 | | PORT_DIPSETTING( 0x40, "3 Coin Units for 1 Credit" ) |
| 255 | | PORT_DIPSETTING( 0x60, "4 Coin Units for 1 Credit" ) |
| 256 | | PORT_DIPSETTING( 0x80, "5 Coin Units for 1 Credit" ) |
| 257 | | PORT_DIPSETTING( 0xa0, "4 Coin Units for 2 Credit" ) |
| 258 | | PORT_DIPSETTING( 0xc0, DEF_STR( Free_Play ) ) |
| 259 | | PORT_DIPSETTING( 0xe0, "No Bonus" ) |
| 256 | PORT_DIPNAME( 0xe000, 0xe000, "Bonus Adder" ) |
| 257 | PORT_DIPSETTING( 0x0000, "No Bonus" ) |
| 258 | PORT_DIPSETTING( 0x2000, "2 Coin Units for 1 Credit" ) |
| 259 | PORT_DIPSETTING( 0x4000, "3 Coin Units for 1 Credit" ) |
| 260 | PORT_DIPSETTING( 0x6000, "4 Coin Units for 1 Credit" ) |
| 261 | PORT_DIPSETTING( 0x8000, "5 Coin Units for 1 Credit" ) |
| 262 | PORT_DIPSETTING( 0xa000, "4 Coin Units for 2 Credit" ) |
| 263 | PORT_DIPSETTING( 0xc000, DEF_STR( Free_Play ) ) |
| 264 | PORT_DIPSETTING( 0xe000, "No Bonus" ) |
| 260 | 265 | |
| 261 | | /* These don't correspond to the Atari manual :( */ |
| 262 | | PORT_START_TAG("DSW2") |
| 263 | | PORT_DIPNAME( 0x03, 0x03, "Game Cost" ) |
| 264 | | PORT_DIPSETTING( 0x00, "1 Coin Unit for 1 Credit" ) |
| 265 | | PORT_DIPSETTING( 0x01, "2 Coin Units for 1 Credit" ) |
| 266 | | PORT_DIPSETTING( 0x02, "3 Coin Units for 1 Credit" ) |
| 267 | | PORT_DIPSETTING( 0x03, "4 Coin Units for 1 Credit" ) |
| 266 | /* These don't correspond to the Atari manual :( */ |
| 267 | PORT_DIPNAME( 0x0003, 0x0003, "Game Cost" ) |
| 268 | PORT_DIPSETTING( 0x0000, "1 Coin Unit for 1 Credit" ) |
| 269 | PORT_DIPSETTING( 0x0001, "2 Coin Units for 1 Credit" ) |
| 270 | PORT_DIPSETTING( 0x0002, "3 Coin Units for 1 Credit" ) |
| 271 | PORT_DIPSETTING( 0x0003, "4 Coin Units for 1 Credit" ) |
| 268 | 272 | |
| 269 | | PORT_DIPNAME( 0x04, 0x04, "Left Coin Mechanism" ) |
| 270 | | PORT_DIPSETTING( 0x00, "1 Coin for 1 Coin Unit" ) |
| 271 | | PORT_DIPSETTING( 0x04, "1 Coin for 2 Coin Units" ) |
| 273 | PORT_DIPNAME( 0x0004, 0x0004, "Left Coin Mechanism" ) |
| 274 | PORT_DIPSETTING( 0x0000, "1 Coin for 1 Coin Unit" ) |
| 275 | PORT_DIPSETTING( 0x0004, "1 Coin for 2 Coin Units" ) |
| 272 | 276 | |
| 273 | | PORT_DIPNAME( 0x18, 0x00, "Right Coin Mechanism" ) |
| 274 | | PORT_DIPSETTING( 0x00, "1 Coin Units 1 Credit" ) |
| 275 | | PORT_DIPSETTING( 0x08, "1 Coin Units 4 Credit" ) |
| 276 | | PORT_DIPSETTING( 0x10, "1 Coin Units 5 Credit" ) |
| 277 | | PORT_DIPSETTING( 0x18, "1 Coin Unit 6 Credit" ) |
| 277 | PORT_DIPNAME( 0x0018, 0x0000, "Right Coin Mechanism" ) |
| 278 | PORT_DIPSETTING( 0x0000, "1 Coin Units 1 Credit" ) |
| 279 | PORT_DIPSETTING( 0x0008, "1 Coin Units 4 Credit" ) |
| 280 | PORT_DIPSETTING( 0x0010, "1 Coin Units 5 Credit" ) |
| 281 | PORT_DIPSETTING( 0x0018, "1 Coin Unit 6 Credit" ) |
| 278 | 282 | |
| 279 | | PORT_START_TAG("ANALOG_A") |
| 280 | | PORT_BIT( 0x0f, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1) /* Accelerator */ |
| 283 | PORT_START_TAG("ANALOG_A") |
| 284 | PORT_BIT( 0x000f, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1) /* Accelerator */ |
| 281 | 285 | PORT_BIT( 0xf0, 0x10, IPT_PEDAL ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(2) /* Brake */ |
| 282 | | PORT_START_TAG("ANALOG_B") |
| 286 | PORT_START_TAG("ANALOG_B") |
| 283 | 287 | PORT_BIT( 0x0f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1) /* Steering */ |
| 284 | | /* Wire jumper setting on sound PCB */ |
| 288 | /* Wire jumper setting on sound PCB */ |
| 285 | 289 | PORT_DIPNAME( 0xf0, 0x80, DEF_STR( Unknown ) ) |
| 286 | 290 | PORT_DIPSETTING( 0x10, "1" ) |
| 287 | 291 | PORT_DIPSETTING( 0x20, "2" ) |
| 288 | 292 | PORT_DIPSETTING( 0x40, "3" ) |
| 289 | 293 | PORT_DIPSETTING( 0x80, "4" ) |
| 290 | 294 | |
| 291 | | PORT_START_TAG("INPUTS") |
| 295 | PORT_START_TAG("INPUTS") |
| 292 | 296 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 293 | 297 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 294 | 298 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE |
| r869 | r870 | |
| 297 | 301 | |
| 298 | 302 | |
| 299 | 303 | INPUT_PORTS_START( buggyboy ) |
| 300 | | PORT_START_TAG("DSW1") |
| 301 | | PORT_DIPNAME( 0xe0, 0x00, DEF_STR( Coin_A ) ) |
| 302 | | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) |
| 303 | | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) |
| 304 | | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 305 | | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) |
| 306 | | PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) |
| 307 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_5C ) ) |
| 308 | | PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) ) |
| 309 | | PORT_DIPSETTING( 0xe0, "Free-Play" ) |
| 304 | PORT_START_TAG("DSW1") |
| 305 | PORT_DIPNAME( 0xe000, 0x0000, DEF_STR( Coin_A ) ) |
| 306 | PORT_DIPSETTING( 0x4000, DEF_STR( 3C_1C ) ) |
| 307 | PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) |
| 308 | PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) |
| 309 | PORT_DIPSETTING( 0xc000, DEF_STR( 2C_3C ) ) |
| 310 | PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) |
| 311 | PORT_DIPSETTING( 0x8000, DEF_STR( 1C_5C ) ) |
| 312 | PORT_DIPSETTING( 0xa000, DEF_STR( 1C_6C ) ) |
| 313 | PORT_DIPSETTING( 0xe000, "Free-Play" ) |
| 310 | 314 | |
| 311 | | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Coin_B ) ) |
| 312 | | PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) |
| 313 | | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 314 | | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) |
| 315 | | PORT_DIPSETTING( 0x18, DEF_STR( 1C_5C ) ) |
| 315 | PORT_DIPNAME( 0x1800, 0x0800, DEF_STR( Coin_B ) ) |
| 316 | PORT_DIPSETTING( 0x0800, DEF_STR( 2C_1C ) ) |
| 317 | PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) |
| 318 | PORT_DIPSETTING( 0x1000, DEF_STR( 1C_2C ) ) |
| 319 | PORT_DIPSETTING( 0x1800, DEF_STR( 1C_5C ) ) |
| 316 | 320 | |
| 317 | | PORT_DIPNAME( 0x07, 0x07, "Do not change 1" ) |
| 318 | | PORT_DIPSETTING( 0x00, "0" ) |
| 319 | | PORT_DIPSETTING( 0x01, "1" ) |
| 320 | | PORT_DIPSETTING( 0x02, "2" ) |
| 321 | | PORT_DIPSETTING( 0x03, "3" ) |
| 322 | | PORT_DIPSETTING( 0x04, "4" ) |
| 323 | | PORT_DIPSETTING( 0x05, "5" ) |
| 324 | | PORT_DIPSETTING( 0x06, "6" ) |
| 325 | | PORT_DIPSETTING( 0x07, "7" ) |
| 321 | PORT_DIPNAME( 0x0700, 0x0700, "Do not change 1" ) |
| 322 | PORT_DIPSETTING( 0x0000, "0" ) |
| 323 | PORT_DIPSETTING( 0x0100, "1" ) |
| 324 | PORT_DIPSETTING( 0x0200, "2" ) |
| 325 | PORT_DIPSETTING( 0x0300, "3" ) |
| 326 | PORT_DIPSETTING( 0x0400, "4" ) |
| 327 | PORT_DIPSETTING( 0x0500, "5" ) |
| 328 | PORT_DIPSETTING( 0x0600, "6" ) |
| 329 | PORT_DIPSETTING( 0x0700, "7" ) |
| 326 | 330 | |
| 327 | | PORT_START_TAG("DSW2") |
| 328 | | PORT_DIPNAME( 0x03, 0x03, "Do not change 2" ) /* Dipswitch 0 is unconnected */ |
| 329 | | PORT_DIPSETTING( 0x00, "0" ) |
| 330 | | PORT_DIPSETTING( 0x01, "1" ) |
| 331 | | PORT_DIPSETTING( 0x02, "2" ) |
| 332 | | PORT_DIPSETTING( 0x03, "3" ) |
| 331 | PORT_DIPNAME( 0x0003, 0x0003, "Do not change 2" ) /* Dipswitch 0 is unconnected */ |
| 332 | PORT_DIPSETTING( 0x0000, "0" ) |
| 333 | PORT_DIPSETTING( 0x0001, "1" ) |
| 334 | PORT_DIPSETTING( 0x0002, "2" ) |
| 335 | PORT_DIPSETTING( 0x0003, "3" ) |
| 333 | 336 | |
| 334 | | PORT_DIPNAME( 0x04, 0x04, "Message" ) |
| 335 | | PORT_DIPSETTING( 0x04, DEF_STR( English ) ) |
| 336 | | PORT_DIPSETTING( 0x00, DEF_STR( Japanese ) ) |
| 337 | PORT_DIPNAME( 0x0004, 0x0004, "Message" ) |
| 338 | PORT_DIPSETTING( 0x0004, DEF_STR( English ) ) |
| 339 | PORT_DIPSETTING( 0x0000, DEF_STR( Japanese ) ) |
| 337 | 340 | |
| 338 | | PORT_DIPNAME( 0x08, 0x08, "Do not Change 3" ) |
| 339 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 340 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 341 | PORT_DIPNAME( 0x0008, 0x0008, "Do not Change 3" ) |
| 342 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 343 | PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) |
| 341 | 344 | |
| 342 | | PORT_DIPNAME( 0x30, 0x30, "Time Rank" ) |
| 343 | | PORT_DIPSETTING( 0x00, "A" ) |
| 344 | | PORT_DIPSETTING( 0x10, "B" ) |
| 345 | | PORT_DIPSETTING( 0x20, "C" ) |
| 346 | | PORT_DIPSETTING( 0x30, "D" ) |
| 345 | PORT_DIPNAME( 0x0030, 0x0030, "Time Rank" ) |
| 346 | PORT_DIPSETTING( 0x0000, "A" ) |
| 347 | PORT_DIPSETTING( 0x0010, "B" ) |
| 348 | PORT_DIPSETTING( 0x0020, "C" ) |
| 349 | PORT_DIPSETTING( 0x0030, "D" ) |
| 347 | 350 | |
| 348 | | PORT_DIPNAME( 0xc0, 0x40, "Game Rank" ) |
| 349 | | PORT_DIPSETTING( 0x00, "A") |
| 350 | | PORT_DIPSETTING( 0x40, "B" ) |
| 351 | | PORT_DIPSETTING( 0x80, "C" ) |
| 352 | | PORT_DIPSETTING( 0xc0, "D" ) |
| 351 | PORT_DIPNAME( 0x00c0, 0x0040, "Game Rank" ) |
| 352 | PORT_DIPSETTING( 0x0000, "A") |
| 353 | PORT_DIPSETTING( 0x0040, "B" ) |
| 354 | PORT_DIPSETTING( 0x0080, "C" ) |
| 355 | PORT_DIPSETTING( 0x00c0, "D" ) |
| 353 | 356 | |
| 354 | | PORT_START_TAG("YM2149_IC19_A") |
| 357 | PORT_START_TAG("YM2149_IC19_A") |
| 355 | 358 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 356 | 359 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 357 | 360 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) |
| r869 | r870 | |
| 359 | 362 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE |
| 360 | 363 | |
| 361 | 364 | |
| 362 | | /* Read by 8255 I think */ |
| 363 | | PORT_START_TAG("YM2149_IC19_B") |
| 365 | /* Read by 8255 I think */ |
| 366 | PORT_START_TAG("YM2149_IC19_B") |
| 364 | 367 | PORT_DIPNAME( 0xff, 0x80, "Sound PCB Jumper:" ) |
| 365 | 368 | PORT_DIPSETTING( 0x00, "0" ) |
| 366 | 369 | PORT_DIPSETTING( 0x01, "1" ) |
| r869 | r870 | |
| 372 | 375 | PORT_DIPSETTING( 0x40, "Buggy Boy/Taito" ) |
| 373 | 376 | PORT_DIPSETTING( 0x80, "Buggy Boy/Tatsumi" ) |
| 374 | 377 | |
| 375 | | /* Fix me */ |
| 376 | | PORT_START_TAG("ANALOG_A") |
| 378 | /* Fix me */ |
| 379 | PORT_START_TAG("ANALOG_A") |
| 377 | 380 | PORT_BIT( 0x0f, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1) /* Accelerator */ |
| 378 | 381 | PORT_BIT( 0xf0, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1) /* Steering */ |
| 379 | | PORT_START_TAG("ANALOG_B") |
| 382 | PORT_START_TAG("ANALOG_B") |
| 380 | 383 | PORT_BIT( 0xf0, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(2) /* Brake */ |
| 381 | 384 | |
| 382 | 385 | INPUT_PORTS_END |
| 383 | 386 | |
| 384 | 387 | INPUT_PORTS_START( buggyb1 ) |
| 385 | | PORT_START_TAG("DSW1") |
| 386 | | PORT_DIPNAME( 0xe0, 0x00, DEF_STR( Coin_A ) ) |
| 387 | | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) |
| 388 | | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) |
| 389 | | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 390 | | PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) |
| 391 | | PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) |
| 392 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_5C ) ) |
| 393 | | PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) ) |
| 394 | | PORT_DIPSETTING( 0xe0, "Free-Play" ) |
| 388 | PORT_START_TAG("DSW1") |
| 389 | PORT_DIPNAME( 0xe000, 0x0000, DEF_STR( Coin_A ) ) |
| 390 | PORT_DIPSETTING( 0x4000, DEF_STR( 3C_1C ) ) |
| 391 | PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) |
| 392 | PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) |
| 393 | PORT_DIPSETTING( 0xc000, DEF_STR( 2C_3C ) ) |
| 394 | PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) |
| 395 | PORT_DIPSETTING( 0x8000, DEF_STR( 1C_5C ) ) |
| 396 | PORT_DIPSETTING( 0xa000, DEF_STR( 1C_6C ) ) |
| 397 | PORT_DIPSETTING( 0xe000, "Free-Play" ) |
| 395 | 398 | |
| 396 | | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Coin_B ) ) |
| 397 | | PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) |
| 398 | | PORT_DIPSETTING( 0x10, DEF_STR( 1C_4C ) ) |
| 399 | | PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) ) |
| 400 | | PORT_DIPSETTING( 0x18, DEF_STR( 1C_6C ) ) |
| 399 | PORT_DIPNAME( 0x1800, 0x0800, DEF_STR( Coin_B ) ) |
| 400 | PORT_DIPSETTING( 0x0000, DEF_STR( 2C_1C ) ) |
| 401 | PORT_DIPSETTING( 0x1000, DEF_STR( 1C_4C ) ) |
| 402 | PORT_DIPSETTING( 0x0800, DEF_STR( 1C_5C ) ) |
| 403 | PORT_DIPSETTING( 0x1800, DEF_STR( 1C_6C ) ) |
| 401 | 404 | |
| 402 | | PORT_DIPNAME( 0x07, 0x07, "Do not change 1" ) |
| 403 | | PORT_DIPSETTING( 0x00, "0" ) |
| 404 | | PORT_DIPSETTING( 0x01, "1" ) |
| 405 | | PORT_DIPSETTING( 0x02, "2" ) |
| 406 | | PORT_DIPSETTING( 0x03, "3" ) |
| 407 | | PORT_DIPSETTING( 0x04, "4" ) |
| 408 | | PORT_DIPSETTING( 0x05, "5" ) |
| 409 | | PORT_DIPSETTING( 0x06, "6" ) |
| 410 | | PORT_DIPSETTING( 0x07, "7" ) |
| 405 | PORT_DIPNAME( 0x0700, 0x0700, "Do not change 1" ) |
| 406 | PORT_DIPSETTING( 0x0000, "0" ) |
| 407 | PORT_DIPSETTING( 0x0100, "1" ) |
| 408 | PORT_DIPSETTING( 0x0200, "2" ) |
| 409 | PORT_DIPSETTING( 0x0300, "3" ) |
| 410 | PORT_DIPSETTING( 0x0400, "4" ) |
| 411 | PORT_DIPSETTING( 0x0500, "5" ) |
| 412 | PORT_DIPSETTING( 0x0600, "6" ) |
| 413 | PORT_DIPSETTING( 0x0700, "7" ) |
| 411 | 414 | |
| 412 | | PORT_START_TAG("DSW2") |
| 413 | | PORT_DIPNAME( 0x03, 0x03, "Do not change 2" ) /* Dipswitch 0 is unconnected */ |
| 414 | | PORT_DIPSETTING( 0x00, "0" ) |
| 415 | | PORT_DIPSETTING( 0x01, "1" ) |
| 416 | | PORT_DIPSETTING( 0x02, "2" ) |
| 417 | | PORT_DIPSETTING( 0x03, "3" ) |
| 415 | PORT_DIPNAME( 0x0003, 0x0003, "Do not change 2" ) /* Dipswitch 0 is unconnected */ |
| 416 | PORT_DIPSETTING( 0x0000, "0" ) |
| 417 | PORT_DIPSETTING( 0x0001, "1" ) |
| 418 | PORT_DIPSETTING( 0x0002, "2" ) |
| 419 | PORT_DIPSETTING( 0x0003, "3" ) |
| 418 | 420 | |
| 419 | | PORT_DIPNAME( 0x04, 0x04, "Message" ) |
| 420 | | PORT_DIPSETTING( 0x04, DEF_STR( English ) ) |
| 421 | | PORT_DIPSETTING( 0x00, DEF_STR( Japanese ) ) |
| 421 | PORT_DIPNAME( 0x0004, 0x0004, "Message" ) |
| 422 | PORT_DIPSETTING( 0x0004, DEF_STR( English ) ) |
| 423 | PORT_DIPSETTING( 0x0000, DEF_STR( Japanese ) ) |
| 422 | 424 | |
| 423 | | PORT_DIPNAME( 0x08, 0x08, "Do not Change 3" ) |
| 424 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 425 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 425 | PORT_DIPNAME( 0x0008, 0x0008, "Do not Change 3" ) |
| 426 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 427 | PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) |
| 426 | 428 | |
| 427 | | PORT_DIPNAME( 0x30, 0x30, "Time Rank" ) |
| 428 | | PORT_DIPSETTING( 0x00, "A" ) |
| 429 | | PORT_DIPSETTING( 0x10, "B" ) |
| 430 | | PORT_DIPSETTING( 0x20, "C" ) |
| 431 | | PORT_DIPSETTING( 0x30, "D" ) |
| 429 | PORT_DIPNAME( 0x0030, 0x0030, "Time Rank" ) |
| 430 | PORT_DIPSETTING( 0x0000, "A" ) |
| 431 | PORT_DIPSETTING( 0x0010, "B" ) |
| 432 | PORT_DIPSETTING( 0x0020, "C" ) |
| 433 | PORT_DIPSETTING( 0x0030, "D" ) |
| 432 | 434 | |
| 433 | | PORT_DIPNAME( 0xc0, 0x40, "Game Rank" ) |
| 434 | | PORT_DIPSETTING( 0x00, "A") |
| 435 | | PORT_DIPSETTING( 0x40, "B" ) |
| 436 | | PORT_DIPSETTING( 0x80, "C" ) |
| 437 | | PORT_DIPSETTING( 0xc0, "D" ) |
| 435 | PORT_DIPNAME( 0x00c0, 0x0040, "Game Rank" ) |
| 436 | PORT_DIPSETTING( 0x0000, "A") |
| 437 | PORT_DIPSETTING( 0x0040, "B" ) |
| 438 | PORT_DIPSETTING( 0x0080, "C" ) |
| 439 | PORT_DIPSETTING( 0x00c0, "D" ) |
| 438 | 440 | |
| 439 | | PORT_START_TAG("YM2149_IC19_A") |
| 441 | PORT_START_TAG("YM2149_IC19_A") |
| 440 | 442 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 441 | 443 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 442 | 444 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) |
| 443 | 445 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_TOGGLE /* Gear shift */ |
| 444 | 446 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE |
| 445 | 447 | |
| 446 | | /* Wire jumper setting on sound PCB */ |
| 447 | | PORT_START_TAG("YM2149_IC19_B") |
| 448 | /* Wire jumper setting on sound PCB */ |
| 449 | PORT_START_TAG("YM2149_IC19_B") |
| 448 | 450 | PORT_DIPNAME( 0xff, 0x80, "Sound PCB Jumper:" ) |
| 449 | 451 | PORT_DIPSETTING( 0x00, "0" ) |
| 450 | 452 | PORT_DIPSETTING( 0x01, "1" ) |
| r869 | r870 | |
| 456 | 458 | PORT_DIPSETTING( 0x40, "Buggy Boy/Taito" ) |
| 457 | 459 | PORT_DIPSETTING( 0x80, "Buggy Boy/Tatsumi" ) |
| 458 | 460 | |
| 459 | | PORT_START_TAG("ANALOG_A") |
| 461 | PORT_START_TAG("ANALOG_A") |
| 460 | 462 | PORT_BIT( 0x0f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1) /* Steering */ |
| 461 | 463 | PORT_BIT( 0xf0, 0x10, IPT_PEDAL ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1) /* Accelerator */ |
| 462 | | PORT_START_TAG("ANALOG_B") |
| 464 | PORT_START_TAG("ANALOG_B") |
| 463 | 465 | PORT_BIT( 0xf0, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(2) /* Brake */ |
| 464 | 466 | INPUT_PORTS_END |
| 465 | 467 | |
| r869 | r870 | |
| 467 | 469 | /********************/ |
| 468 | 470 | /* TX-1 Memory Maps */ |
| 469 | 471 | /********************/ |
| 470 | | static ADDRESS_MAP_START( tx1_master, ADDRESS_SPACE_PROGRAM, 8 ) |
| 471 | | AM_RANGE(0x00000, 0x00fff) AM_MIRROR(0x1000) AM_RAM /* RAM */ |
| 472 | | AM_RANGE(0x02000, 0x02fff) AM_MIRROR(0x1000) AM_RAM /* RAM */ |
| 473 | | AM_RANGE(0x04000, 0x04fff) AM_MIRROR(0x1000) AM_RAM /* Backup RAM */ |
| 474 | | AM_RANGE(0x06000, 0x06008) AM_READWRITE(crt_read, crt_write) |
| 475 | | AM_RANGE(0x08000, 0x09fff) AM_READWRITE(MRA8_RAM,tx1_vram_w) AM_BASE(&tx1_vram) |
| 476 | | AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE(1) /* Road/common RAM */ |
| 477 | | AM_RANGE(0x0b000, 0x0b000) AM_READWRITE (input_port_1_r, z80_busreq) |
| 478 | | AM_RANGE(0x0b001, 0x0b001) AM_READWRITE (input_port_0_r, MWA8_NOP) |
| 479 | | AM_RANGE(0x0c000, 0x0c001) AM_RAM /* /SCOLST */ |
| 480 | | AM_RANGE(0x0d000, 0x0d001) AM_RAM /* /SLINCS */ |
| 481 | | AM_RANGE(0x0e000, 0x0e001) AM_RAM /* /SLOCK */ |
| 482 | | AM_RANGE(0x0f000, 0x0f003) AM_READWRITE (MRA8_NOP, resume_slave) /* Watchdog and slave resume */ |
| 483 | | AM_RANGE(0x10000, 0x13fff) AM_ROM /* Z80 ROM */ |
| 484 | | AM_RANGE(0x16000, 0x16fff) AM_READWRITE (z80_shared_r, z80_shared_w) |
| 485 | | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 472 | static ADDRESS_MAP_START( tx1_master, ADDRESS_SPACE_PROGRAM, 16 ) |
| 473 | AM_RANGE(0x00000, 0x00fff) AM_MIRROR(0x1000) AM_RAM /* RAM */ |
| 474 | AM_RANGE(0x02000, 0x02fff) AM_MIRROR(0x1000) AM_RAM /* RAM */ |
| 475 | AM_RANGE(0x04000, 0x04fff) AM_MIRROR(0x1000) AM_RAM /* Backup RAM */ |
| 476 | AM_RANGE(0x06000, 0x06009) AM_READWRITE(crt_read, crt_write) |
| 477 | AM_RANGE(0x08000, 0x09fff) AM_READWRITE(MRA16_RAM,tx1_vram_w) AM_BASE(&tx1_vram) |
| 478 | AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE(1) /* Road/common RAM */ |
| 479 | AM_RANGE(0x0b000, 0x0b001) AM_READWRITE (input_port_0_word_r, z80_busreq) |
| 480 | AM_RANGE(0x0c000, 0x0c001) AM_RAM /* /SCOLST */ |
| 481 | AM_RANGE(0x0d000, 0x0d001) AM_RAM /* /SLINCS */ |
| 482 | AM_RANGE(0x0e000, 0x0e001) AM_RAM /* /SLOCK */ |
| 483 | AM_RANGE(0x0f000, 0x0f003) AM_READWRITE (MRA16_NOP, resume_slave) /* Watchdog and slave resume */ |
| 484 | AM_RANGE(0x10000, 0x13fff) AM_ROM /* Z80 ROM */ |
| 485 | AM_RANGE(0x16000, 0x16fff) AM_READWRITE (z80_shared_r, z80_shared_w) |
| 486 | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 486 | 487 | ADDRESS_MAP_END |
| 487 | 488 | |
| 488 | 489 | /* Lot of unknown writes - I haven't investigated further */ |
| 489 | | static ADDRESS_MAP_START( tx1_slave, ADDRESS_SPACE_PROGRAM, 8 ) |
| 490 | | AM_RANGE(0x00000, 0x007ff) AM_MIRROR(0x800) AM_RAM /* Arithmetic RAM (IC169, IC158) A10 is grounded */ |
| 491 | | AM_RANGE(0x01000, 0x01fff) AM_RAM AM_SHARE(1) /* Common RAM (IC195, IC210) */ |
| 492 | | AM_RANGE(0x02000, 0x022ff) AM_RAM AM_BASE(&tx1_object_ram) AM_SIZE(&tx1_objectram_size) /* Object RAM (IC43, IC68) A10-A8 are grounded*/ |
| 493 | | AM_RANGE(0x02400, 0x027ff) AM_RAM /* /BANKCS */ |
| 494 | | AM_RANGE(0x02800, 0x02bff) AM_READWRITE(halt_slave_r, MWA8_NOP) /* /DRAK */ |
| 495 | | AM_RANGE(0x02C00, 0x02fff) AM_RAM /* /FLGCS */ |
| 496 | | AM_RANGE(0x03000, 0x03fff) AM_RAM /* SN74S516 arithmetic unit */ |
| 497 | | AM_RANGE(0x04000, 0x07fff) AM_ROM /* ROM mirror? */ |
| 498 | | AM_RANGE(0x08000, 0x0bfff) AM_ROM /* ROM mirror? */ |
| 499 | | AM_RANGE(0x0c000, 0x0ffff) AM_ROM /* ROM mirror? */ |
| 490 | static ADDRESS_MAP_START( tx1_slave, ADDRESS_SPACE_PROGRAM, 16 ) |
| 491 | AM_RANGE(0x00000, 0x007ff) AM_MIRROR(0x800) AM_RAM /* Arithmetic RAM (IC169, IC158) A10 is grounded */ |
| 492 | AM_RANGE(0x01000, 0x01fff) AM_RAM AM_SHARE(1) /* Common RAM (IC195, IC210) */ |
| 493 | AM_RANGE(0x02000, 0x022ff) AM_RAM AM_BASE(&tx1_object_ram) AM_SIZE(&tx1_objectram_size) /* Object RAM (IC43, IC68) A10-A8 are grounded*/ |
| 494 | AM_RANGE(0x02400, 0x027ff) AM_RAM /* /BANKCS */ |
| 495 | AM_RANGE(0x02800, 0x02bff) AM_READWRITE(halt_slave_r, MWA16_NOP) /* /DRAK */ |
| 496 | AM_RANGE(0x02C00, 0x02fff) AM_RAM /* /FLGCS */ |
| 497 | AM_RANGE(0x03000, 0x03fff) AM_RAM /* SN74S516 arithmetic unit */ |
| 498 | AM_RANGE(0x04000, 0x07fff) AM_ROM /* ROM mirror? */ |
| 499 | AM_RANGE(0x08000, 0x0bfff) AM_ROM /* ROM mirror? */ |
| 500 | AM_RANGE(0x0c000, 0x0ffff) AM_ROM /* ROM mirror? */ |
| 500 | 501 | AM_RANGE(0xfc000, 0xfffff) AM_ROM |
| 501 | 502 | ADDRESS_MAP_END |
| 502 | 503 | |
| r869 | r870 | |
| 509 | 510 | AM_RANGE(0x5000, 0x5003) AM_READWRITE(ppi8255_0_r, ppi8255_0_w) |
| 510 | 511 | AM_RANGE(0x6000, 0x6003) AM_RAM /* 8253A PIT */ |
| 511 | 512 | AM_RANGE(0x7000, 0x70DF) AM_RAM /* Propigate input signals into 8255 */ |
| 512 | | AM_RANGE(0xb00b, 0xb00b) AM_RAM /* Read once - TS?*/ |
| 513 | AM_RANGE(0xb00b, 0xb00b) AM_RAM /* Read once - TS?*/ |
| 513 | 514 | ADDRESS_MAP_END |
| 514 | 515 | |
| 515 | 516 | |
| r869 | r870 | |
| 524 | 525 | /* Buggy Boy Memory Maps */ |
| 525 | 526 | /*************************/ |
| 526 | 527 | |
| 527 | | static READ8_HANDLER(input_port_1A_r) |
| 528 | static READ16_HANDLER(input_port_0A_r) |
| 528 | 529 | { |
| 529 | | return (readinputport(1) & 0xfe) | TS; |
| 530 | return (readinputport(0) & 0xfffe) | TS; |
| 530 | 531 | } |
| 531 | 532 | |
| 532 | | static ADDRESS_MAP_START( buggyb1_master, ADDRESS_SPACE_PROGRAM, 8 ) |
| 533 | | AM_RANGE(0x00000, 0x03fff) AM_RAM /* 1kB RAM - battery backed */ |
| 534 | | AM_RANGE(0x04000, 0x04fff) AM_READWRITE(crt_read, crt_write) /* HD46505S-2 or equivalent CRT controller */ |
| 535 | | AM_RANGE(0x08000, 0x08fff) AM_READWRITE(MRA8_RAM,buggyb1_vram_w) AM_BASE(&buggyb1_vram) /* Character mapped RAM */ |
| 536 | | AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE(1) AM_BASE(&bb_rcram) AM_SIZE(&bb_rcram_size) /* Road/common RAM - 1800-18ff & 1c00-1cff are read by road H/W */ |
| 537 | | AM_RANGE(0x0b000, 0x0b000) AM_READWRITE (input_port_1A_r, z80_busreq) /* Dipswitches and Z80 busreq */ |
| 538 | | AM_RANGE(0x0b001, 0x0b001) AM_READWRITE (input_port_0_r, MWA8_NOP) |
| 539 | | AM_RANGE(0x0c000, 0x0c001) AM_RAM /* /SCOLW */ |
| 540 | | AM_RANGE(0x0d000, 0x0d003) AM_RAM /* /SLINCS */ |
| 541 | | AM_RANGE(0x0e000, 0x0e001) AM_RAM AM_BASE(&bb_sky) /* /SKYCS */ |
| 542 | | AM_RANGE(0x0f000, 0x0f003) AM_READWRITE (MRA8_NOP, resume_slave) /* Watchdog and slave resume */ |
| 543 | | AM_RANGE(0x10000, 0x17fff) AM_ROM /* Z80 ROM */ |
| 544 | | AM_RANGE(0x18000, 0x18fff) AM_READWRITE (z80_shared_r, z80_shared_w) |
| 545 | | AM_RANGE(0x20000, 0x2ffff) AM_ROM |
| 533 | static ADDRESS_MAP_START( buggyb1_master, ADDRESS_SPACE_PROGRAM, 16 ) |
| 534 | AM_RANGE(0x00000, 0x03fff) AM_RAM /* 1kB RAM - battery backed */ |
| 535 | AM_RANGE(0x04000, 0x04fff) AM_READWRITE(crt_read, crt_write) /* HD46505S-2 or equivalent CRT controller */ |
| 536 | AM_RANGE(0x08000, 0x08fff) AM_READWRITE(MRA16_RAM,buggyb1_vram_w) AM_BASE(&buggyb1_vram) /* Character mapped RAM */ |
| 537 | AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE(1) AM_BASE(&bb_rcram) AM_SIZE(&bb_rcram_size) /* Road/common RAM - 1800-18ff & 1c00-1cff are read by road H/W */ |
| 538 | AM_RANGE(0x0b000, 0x0b001) AM_READWRITE (input_port_0A_r, z80_busreq) /* Dipswitches and Z80 busreq */ |
| 539 | AM_RANGE(0x0c000, 0x0c001) AM_RAM /* /SCOLW */ |
| 540 | AM_RANGE(0x0d000, 0x0d003) AM_RAM /* /SLINCS */ |
| 541 | AM_RANGE(0x0e000, 0x0e001) AM_RAM AM_BASE(&bb_sky) /* /SKYCS */ |
| 542 | AM_RANGE(0x0f000, 0x0f003) AM_READWRITE (MRA16_NOP, resume_slave) /* Watchdog and slave resume */ |
| 543 | AM_RANGE(0x10000, 0x17fff) AM_ROM /* Z80 ROM */ |
| 544 | AM_RANGE(0x18000, 0x18fff) AM_READWRITE (z80_shared_r, z80_shared_w) |
| 545 | AM_RANGE(0x20000, 0x2ffff) AM_ROM |
| 546 | 546 | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 547 | 547 | ADDRESS_MAP_END |
| 548 | 548 | |
| 549 | 549 | |
| 550 | | static ADDRESS_MAP_START( buggyboy_master, ADDRESS_SPACE_PROGRAM, 8 ) |
| 551 | | AM_RANGE(0x00000, 0x03fff) AM_RAM /* 1kB RAM - battery backed */ |
| 552 | | AM_RANGE(0x04000, 0x04fff) AM_READWRITE(crt_read, crt_write) /* HD46505S-2 or equivalent CRT controller */ |
| 553 | | AM_RANGE(0x08000, 0x09fff) AM_READWRITE(MRA8_RAM,buggyboy_vram_w) AM_BASE(&buggyboy_vram) /* Character mapped RAM */ |
| 554 | | AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE(1) AM_BASE(&bb_rcram) AM_SIZE(&bb_rcram_size) /* Road/common RAM */ |
| 555 | | AM_RANGE(0x0b000, 0x0b000) AM_READWRITE (input_port_1A_r, z80_busreq) /* Dipswitches and Z80 busreq */ |
| 556 | | AM_RANGE(0x0b001, 0x0b001) AM_READWRITE (input_port_0_r, MWA8_NOP) |
| 557 | | AM_RANGE(0x0c000, 0x0c001) AM_RAM /* /SCOLW */ |
| 558 | | AM_RANGE(0x0d000, 0x0d003) AM_RAM /* /SLINCS */ |
| 559 | | AM_RANGE(0x0e000, 0x0e001) AM_RAM AM_BASE(&bb_sky) /* /SKYCS */ |
| 560 | | AM_RANGE(0x0f000, 0x0f003) AM_READWRITE (MRA8_NOP, resume_slave) /* Watchdog and slave resume */ |
| 561 | | AM_RANGE(0x10000, 0x17fff) AM_ROM /* Z80 ROM */ |
| 562 | | AM_RANGE(0x18000, 0x18fff) AM_READWRITE (z80_shared_r, z80_shared_w) |
| 563 | | AM_RANGE(0x20000, 0x2ffff) AM_ROM |
| 550 | static ADDRESS_MAP_START( buggyboy_master, ADDRESS_SPACE_PROGRAM, 16 ) |
| 551 | AM_RANGE(0x00000, 0x03fff) AM_RAM /* 1kB RAM - battery backed */ |
| 552 | AM_RANGE(0x04000, 0x04fff) AM_READWRITE(crt_read, crt_write) /* HD46505S-2 or equivalent CRT controller */ |
| 553 | AM_RANGE(0x08000, 0x09fff) AM_READWRITE(MRA16_RAM,buggyboy_vram_w) AM_BASE(&buggyboy_vram) /* Character mapped RAM */ |
| 554 | AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE(1) AM_BASE(&bb_rcram) AM_SIZE(&bb_rcram_size) /* Road/common RAM */ |
| 555 | AM_RANGE(0x0b000, 0x0b001) AM_READWRITE (input_port_0A_r, z80_busreq) /* Dipswitches and Z80 busreq */ |
| 556 | AM_RANGE(0x0c000, 0x0c001) AM_RAM /* /SCOLW */ |
| 557 | AM_RANGE(0x0d000, 0x0d003) AM_RAM /* /SLINCS */ |
| 558 | AM_RANGE(0x0e000, 0x0e001) AM_RAM AM_BASE(&bb_sky) /* /SKYCS */ |
| 559 | AM_RANGE(0x0f000, 0x0f003) AM_READWRITE (MRA16_NOP, resume_slave) /* Watchdog and slave resume */ |
| 560 | AM_RANGE(0x10000, 0x17fff) AM_ROM /* Z80 ROM */ |
| 561 | AM_RANGE(0x18000, 0x18fff) AM_READWRITE (z80_shared_r, z80_shared_w) |
| 562 | AM_RANGE(0x20000, 0x2ffff) AM_ROM |
| 564 | 563 | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 565 | 564 | ADDRESS_MAP_END |
| 566 | 565 | |
| r869 | r870 | |
| 580 | 579 | -FLAGS = 24E0-F, 24F0-F |
| 581 | 580 | */ |
| 582 | 581 | |
| 583 | | static READ8_HANDLER(GAS_r) |
| 582 | static READ16_HANDLER(GAS_r) |
| 584 | 583 | { |
| 585 | | if(offset >= 0xe0) halt_slave(); |
| 584 | if(offset >= 0xe0/2) halt_slave(); |
| 586 | 585 | return 0; |
| 587 | 586 | } |
| 588 | 587 | |
| 589 | | static WRITE8_HANDLER(GAS_w) |
| 588 | static WRITE16_HANDLER(GAS_w) |
| 590 | 589 | { |
| 591 | | if(offset >= 0xe0) halt_slave(); |
| 590 | if(offset >= 0xe0/2) halt_slave(); |
| 592 | 591 | } |
| 593 | 592 | |
| 594 | 593 | |
| r869 | r870 | |
| 619 | 618 | */ |
| 620 | 619 | |
| 621 | 620 | /* Memory map and ROM contents are the same for both versions */ |
| 622 | | static ADDRESS_MAP_START( buggyboy_slave, ADDRESS_SPACE_PROGRAM, 8 ) |
| 623 | | AM_RANGE(0x00000, 0x00fff) AM_RAM /* 4kB RAM */ |
| 624 | | AM_RANGE(0x01000, 0x01fff) AM_RAM AM_SHARE(1) /* Road/Common RAM */ |
| 625 | | AM_RANGE(0x02000, 0x022ff) AM_RAM AM_BASE(&bb_objram) AM_SIZE(&bb_objectram_size) /* RAM A10-A8 are grounded */ |
| 626 | | AM_RANGE(0x02400, 0x024ff) AM_READWRITE (GAS_r, GAS_w) /* Road control registers */ |
| 627 | | AM_RANGE(0x03000, 0x03fff) AM_READWRITE (BB_AU_R, BB_AU_W) /* SN74S516 arithmetic unit */ |
| 628 | | AM_RANGE(0x04000, 0x07fff) AM_ROM /* ROM mirror */ |
| 629 | | AM_RANGE(0x08000, 0x0bfff) AM_ROM /* ROM mirror */ |
| 630 | | AM_RANGE(0x0c000, 0x0ffff) AM_ROM /* ROM mirror */ |
| 631 | | AM_RANGE(0xfc000, 0xfffff) AM_ROM /* ROM */ |
| 621 | static ADDRESS_MAP_START( buggyboy_slave, ADDRESS_SPACE_PROGRAM, 16 ) |
| 622 | AM_RANGE(0x00000, 0x00fff) AM_RAM /* 4kB RAM */ |
| 623 | AM_RANGE(0x01000, 0x01fff) AM_RAM AM_SHARE(1) /* Road/Common RAM */ |
| 624 | AM_RANGE(0x02000, 0x022ff) AM_RAM AM_BASE(&bb_objram) AM_SIZE(&bb_objectram_size) /* RAM A10-A8 are grounded */ |
| 625 | AM_RANGE(0x02400, 0x024ff) AM_READWRITE (GAS_r, GAS_w) /* Road control registers */ |
| 626 | AM_RANGE(0x03000, 0x03fff) AM_READWRITE (BB_AU_R, BB_AU_W) /* SN74S516 arithmetic unit */ |
| 627 | AM_RANGE(0x04000, 0x07fff) AM_ROM /* ROM mirror */ |
| 628 | AM_RANGE(0x08000, 0x0bfff) AM_ROM /* ROM mirror */ |
| 629 | AM_RANGE(0x0c000, 0x0ffff) AM_ROM /* ROM mirror */ |
| 630 | AM_RANGE(0xfc000, 0xfffff) AM_ROM /* ROM */ |
| 632 | 631 | ADDRESS_MAP_END |
| 633 | 632 | |
| 634 | 633 | |
| r869 | r870 | |
| 645 | 644 | AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE(&z80_ram) /* 2kB RAM - shared with Main CPU */ |
| 646 | 645 | AM_RANGE(0x6000, 0x6000) AM_READ(input_port_4_r) /* Steering and accelerator */ |
| 647 | 646 | AM_RANGE(0x6001, 0x6001) AM_READ(input_port_5_r) /* Brake (NOT USED) */ |
| 648 | | AM_RANGE(0x6800, 0x6803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w) /* Digital inputs (coins etc.) - check me */ |
| 647 | AM_RANGE(0x6800, 0x6803) AM_READWRITE(ppi8255_0_r, ppi8255_0_w) /* Digital inputs (coins etc.) - check me */ |
| 649 | 648 | AM_RANGE(0x7000, 0x7003) AM_RAM /* 8253 Programmable Interval Timer (Engine Sound) */ |
| 650 | 649 | AM_RANGE(0xc024, 0xc024) AM_WRITE(_TS_) /* /TS? */ |
| 651 | 650 | AM_RANGE(0x7800, 0x7800) AM_WRITE(z80_intreq_w) /* /INTREQ? */ |
| r869 | r870 | |
| 667 | 666 | static ADDRESS_MAP_START( buggyboy_sound_io, ADDRESS_SPACE_IO, 8 ) |
| 668 | 667 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 669 | 668 | AM_RANGE(0x40, 0x40) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w) |
| 670 | | AM_RANGE(0x41, 0x41) AM_WRITE(AY8910_control_port_0_w) |
| 669 | AM_RANGE(0x41, 0x41) AM_WRITE(AY8910_control_port_0_w) |
| 671 | 670 | |
| 672 | 671 | AM_RANGE(0x80, 0x80) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w) |
| 673 | | AM_RANGE(0x81, 0x81) AM_WRITE(AY8910_control_port_1_w) |
| 672 | AM_RANGE(0x81, 0x81) AM_WRITE(AY8910_control_port_1_w) |
| 674 | 673 | ADDRESS_MAP_END |
| 675 | 674 | |
| 676 | 675 | |
| r869 | r870 | |
| 906 | 905 | } |
| 907 | 906 | |
| 908 | 907 | static MACHINE_DRIVER_START( tx1 ) |
| 909 | | MDRV_CPU_ADD(I86,5000000 ) |
| 908 | MDRV_CPU_ADD(I8086,5000000 ) |
| 910 | 909 | MDRV_CPU_PROGRAM_MAP(tx1_master,0) |
| 911 | 910 | MDRV_CPU_PERIODIC_INT(main_irq, 46 ) /* To do: measure HD46505 CUDISP output rate */ |
| 912 | 911 | //MDRV_WATCHDOG_TIME_INIT(MAME_TIME_IN_SEC(5)) /* To do: measure watchdog time interval */ |
| 913 | 912 | |
| 914 | | MDRV_CPU_ADD(I86,5000000 ) |
| 913 | MDRV_CPU_ADD(I8086,5000000 ) |
| 915 | 914 | MDRV_CPU_PROGRAM_MAP(tx1_slave,0) |
| 916 | 915 | |
| 917 | 916 | MDRV_CPU_ADD(Z80,3750000 ) /* Guess */ |
| 918 | | /* audio CPU */ |
| 919 | 917 | MDRV_CPU_PROGRAM_MAP(tx1_sound_prg,0) |
| 920 | 918 | MDRV_CPU_IO_MAP(tx1_sound_io,0) |
| 921 | 919 | MDRV_CPU_PERIODIC_INT(irq0_line_hold, 915.52734375/2 ) /* Guess */ |
| r869 | r870 | |
| 960 | 958 | MACHINE_DRIVER_END |
| 961 | 959 | |
| 962 | 960 | static MACHINE_DRIVER_START( buggyboy ) |
| 963 | | MDRV_CPU_ADD(I86,5000000 ) |
| 961 | MDRV_CPU_ADD(I8086,5000000 ) |
| 964 | 962 | MDRV_CPU_PROGRAM_MAP(buggyboy_master,0) |
| 965 | 963 | MDRV_CPU_PERIODIC_INT(main_irq, 46 ) /* To do: measure HD46505 CUDISP output rate */ |
| 966 | 964 | //MDRV_WATCHDOG_TIME_INIT(MAME_TIME_IN_SEC(5)) /* To do: measure watchdog time interval */ |
| 967 | 965 | |
| 968 | | MDRV_CPU_ADD(I86,5000000 ) |
| 966 | MDRV_CPU_ADD(I8086,5000000 ) |
| 969 | 967 | MDRV_CPU_PROGRAM_MAP(buggyboy_slave,0) |
| 970 | 968 | |
| 971 | 969 | MDRV_CPU_ADD(Z80,3750000 ) /* audio CPU */ |
| r869 | r870 | |
| 1023 | 1021 | |
| 1024 | 1022 | /* Need to verify clocks on real PCB */ |
| 1025 | 1023 | static MACHINE_DRIVER_START( buggyb1 ) |
| 1026 | | MDRV_CPU_ADD(I86,5000000 ) |
| 1024 | MDRV_CPU_ADD(I8086,5000000 ) |
| 1027 | 1025 | MDRV_CPU_PROGRAM_MAP(buggyb1_master,0) |
| 1028 | 1026 | MDRV_CPU_PERIODIC_INT(main_irq, 46 ) /* To do: measure HD46505 CUDISP output rate */ |
| 1029 | 1027 | //MDRV_WATCHDOG_TIME_INIT(MAME_TIME_IN_SEC(5)) /* To do: measure watchdog time interval */ |
| 1030 | 1028 | |
| 1031 | | MDRV_CPU_ADD(I86,5000000 ) |
| 1029 | MDRV_CPU_ADD(I8086,5000000 ) |
| 1032 | 1030 | MDRV_CPU_PROGRAM_MAP(buggyboy_slave,0) |
| 1033 | 1031 | |
| 1034 | 1032 | MDRV_CPU_ADD(Z80,3750000 ) /* audio CPU */ |
src/mame/drivers/tatsumi.c
| r869 | r870 | |
| 78 | 78 | UINT16 *roundup5_d0000_ram, *roundup5_e0000_ram; |
| 79 | 79 | UINT8 *tatsumi_rom_sprite_lookup1, *tatsumi_rom_sprite_lookup2; |
| 80 | 80 | UINT8 *tatsumi_rom_clut0, *tatsumi_rom_clut1; |
| 81 | | UINT8 *roundup5_unknown0, *roundup5_unknown1, *roundup5_unknown2; |
| 81 | UINT16 *roundup5_unknown0, *roundup5_unknown1, *roundup5_unknown2; |
| 82 | 82 | UINT8 *apache3_bg_ram; |
| 83 | 83 | |
| 84 | 84 | /***************************************************************************/ |
| r869 | r870 | |
| 95 | 95 | |
| 96 | 96 | /***************************************************************************/ |
| 97 | 97 | |
| 98 | | static ADDRESS_MAP_START( readmem_apache3, ADDRESS_SPACE_PROGRAM, 8 ) |
| 99 | | AM_RANGE(0x00000, 0x07fff) AM_READ(MRA8_RAM) |
| 100 | | AM_RANGE(0x08000, 0x08fff) AM_READ(MRA8_RAM) |
| 101 | | AM_RANGE(0x0c000, 0x0dfff) AM_READ(MRA8_RAM) |
| 102 | | // AM_RANGE(0x0e800, 0x0e803) AM_READ(MRA_NOP) // CRT |
| 103 | | AM_RANGE(0x0f000, 0x0f000) AM_READ(input_port_3_r) // Dip 1 |
| 104 | | AM_RANGE(0x0f001, 0x0f001) AM_READ(input_port_4_r) // Dip 2 |
| 105 | | AM_RANGE(0x0f800, 0x0f801) AM_READ(apache3_bank_r) |
| 106 | | AM_RANGE(0x10000, 0x1ffff) AM_READ(apache3_v30_v20_r) |
| 107 | | AM_RANGE(0x20000, 0x2ffff) AM_READ(tatsumi_v30_68000_r) |
| 108 | | AM_RANGE(0xa0000, 0xfffff) AM_READ(MRA8_ROM) |
| 98 | static ADDRESS_MAP_START( apache3_v30_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 99 | AM_RANGE(0x00000, 0x07fff) AM_RAM |
| 100 | AM_RANGE(0x08000, 0x08fff) AM_READWRITE(MRA16_RAM, apache3_palette_w) AM_BASE(&paletteram16) |
| 101 | AM_RANGE(0x0c000, 0x0dfff) AM_READWRITE(MRA16_RAM, roundup5_text_w) AM_BASE(&videoram16) |
| 102 | AM_RANGE(0x0e800, 0x0e803) AM_WRITE(MWA16_NOP) // CRT |
| 103 | AM_RANGE(0x0f000, 0x0f001) AM_READ(input_port_3_word_r) // Dip 1+2 |
| 104 | AM_RANGE(0x0f000, 0x0f001) AM_WRITE(MWA16_NOP) // todo |
| 105 | AM_RANGE(0x0f800, 0x0f801) AM_READWRITE(apache3_bank_r, apache3_bank_w) |
| 106 | AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(apache3_v30_v20_r, apache3_v30_v20_w) |
| 107 | AM_RANGE(0x20000, 0x2ffff) AM_READWRITE(tatsumi_v30_68000_r, tatsumi_v30_68000_w) |
| 108 | AM_RANGE(0xa0000, 0xfffff) AM_ROM |
| 109 | 109 | ADDRESS_MAP_END |
| 110 | 110 | |
| 111 | | static ADDRESS_MAP_START( writemem_apache3, ADDRESS_SPACE_PROGRAM, 8 ) |
| 112 | | AM_RANGE(0x00000, 0x07fff) AM_WRITE(MWA8_RAM) |
| 113 | | AM_RANGE(0x08000, 0x08fff) AM_WRITE(apache3_palette_w) AM_BASE(&paletteram) |
| 114 | | AM_RANGE(0x0c000, 0x0dfff) AM_WRITE(roundup5_text_w) AM_BASE(&videoram) |
| 115 | | AM_RANGE(0x0e800, 0x0e803) AM_WRITE(MWA8_NOP) // CRT |
| 116 | | AM_RANGE(0x0f000, 0x0f001) AM_WRITE(MWA8_NOP) // todo |
| 117 | | AM_RANGE(0x0f800, 0x0f801) AM_WRITE(apache3_bank_w) |
| 118 | | AM_RANGE(0x10000, 0x1ffff) AM_WRITE(apache3_v30_v20_w) |
| 119 | | AM_RANGE(0x20000, 0x23fff) AM_WRITE(tatsumi_v30_68000_w) |
| 120 | | AM_RANGE(0xa0000, 0xfffff) AM_WRITE(MWA8_ROM) |
| 121 | | ADDRESS_MAP_END |
| 122 | | |
| 123 | | static ADDRESS_MAP_START( sub_readmem_apache3, ADDRESS_SPACE_PROGRAM, 16 ) |
| 124 | | AM_RANGE(0x00000, 0x7ffff) AM_READ(MRA16_ROM) |
| 125 | | AM_RANGE(0x80000, 0x83fff) AM_READ(MRA16_RAM) |
| 126 | | AM_RANGE(0x90000, 0x93fff) AM_READ(MRA16_RAM) |
| 127 | | AM_RANGE(0xd0000, 0xdffff) AM_READ(MRA16_RAM) |
| 128 | | AM_RANGE(0xe0000, 0xe7fff) AM_READ(apache3_z80_r) |
| 129 | | ADDRESS_MAP_END |
| 130 | | |
| 131 | | static ADDRESS_MAP_START( sub_writemem_apache3, ADDRESS_SPACE_PROGRAM, 16 ) |
| 132 | | AM_RANGE(0x00000, 0x7ffff) AM_WRITE(MWA16_ROM) |
| 133 | | AM_RANGE(0x80000, 0x83fff) AM_WRITE(MWA16_RAM) AM_BASE(&tatsumi_68k_ram) |
| 134 | | AM_RANGE(0x90000, 0x93fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) |
| 111 | static ADDRESS_MAP_START( apache3_68000_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 112 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 113 | AM_RANGE(0x80000, 0x83fff) AM_RAM AM_BASE(&tatsumi_68k_ram) |
| 114 | AM_RANGE(0x90000, 0x93fff) AM_RAM AM_BASE(&spriteram16) |
| 135 | 115 | AM_RANGE(0x9a000, 0x9a1ff) AM_WRITE(tatsumi_sprite_control_w) AM_BASE(&tatsumi_sprite_control_ram) |
| 136 | 116 | AM_RANGE(0xa0000, 0xa0001) AM_WRITE(apache3_a0000_w) |
| 137 | 117 | AM_RANGE(0xb0000, 0xb0001) AM_WRITE(apache3_irq_ack_w) //todo - z80 reset? |
| 138 | 118 | AM_RANGE(0xc0000, 0xc0001) AM_WRITE(MWA16_RAM) AM_BASE(&tatsumi_c_ram) |
| 139 | | AM_RANGE(0xd0000, 0xdffff) AM_WRITE(MWA16_RAM) AM_BASE(&apache3_g_ram) |
| 140 | | AM_RANGE(0xe0000, 0xe7fff) AM_WRITE(apache3_z80_w) |
| 119 | AM_RANGE(0xd0000, 0xdffff) AM_RAM AM_BASE(&apache3_g_ram) |
| 120 | AM_RANGE(0xe0000, 0xe7fff) AM_READWRITE(apache3_z80_r, apache3_z80_w) |
| 141 | 121 | ADDRESS_MAP_END |
| 142 | 122 | |
| 143 | | static ADDRESS_MAP_START( readmem_iop_apache3, ADDRESS_SPACE_PROGRAM, 8 ) |
| 144 | | AM_RANGE(0x00000, 0x01fff) AM_READ(MRA8_RAM) |
| 145 | | AM_RANGE(0x04000, 0x04003) AM_READ(MRA8_NOP) // piu select .. ? |
| 146 | | AM_RANGE(0x06000, 0x06000) AM_READ(input_port_0_r) // esw |
| 147 | | AM_RANGE(0x08001, 0x08001) AM_READ(tatsumi_hack_ym2151_r) //YM2151_status_port_0_r) |
| 148 | | AM_RANGE(0x0a000, 0x0a000) AM_READ(tatsumi_hack_oki_r) //OKIM6295_status_0_r) |
| 149 | | AM_RANGE(0x0e000, 0x0e000) AM_READ(apache3_adc_r) // adc |
| 150 | | AM_RANGE(0xf0000, 0xfffff) AM_READ(MRA8_ROM) |
| 151 | | ADDRESS_MAP_END |
| 152 | | |
| 153 | | static ADDRESS_MAP_START( writemem_iop_apache3, ADDRESS_SPACE_PROGRAM, 8 ) |
| 154 | | AM_RANGE(0x00000, 0x01fff) AM_WRITE(MWA8_RAM) |
| 155 | | AM_RANGE(0x04000, 0x04003) AM_WRITE(MWA8_NOP) // piu select .. ? |
| 123 | static ADDRESS_MAP_START( apache3_v20_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 124 | AM_RANGE(0x00000, 0x01fff) AM_RAM |
| 125 | AM_RANGE(0x04000, 0x04003) AM_NOP // piu select .. ? |
| 126 | AM_RANGE(0x06000, 0x06001) AM_READ(input_port_0_r) // esw |
| 156 | 127 | AM_RANGE(0x08000, 0x08000) AM_WRITE(YM2151_register_port_0_w) |
| 157 | | AM_RANGE(0x08001, 0x08001) AM_WRITE(YM2151_data_port_0_w) |
| 158 | | AM_RANGE(0x0a000, 0x0a000) AM_WRITE(OKIM6295_data_0_w) |
| 159 | | AM_RANGE(0x0e000, 0x0e007) AM_WRITE(apache3_adc_w) //adc select |
| 160 | | AM_RANGE(0xf0000, 0xfffff) AM_WRITE(MWA8_ROM) |
| 128 | AM_RANGE(0x08001, 0x08001) AM_READWRITE(tatsumi_hack_ym2151_r, YM2151_data_port_0_w) |
| 129 | AM_RANGE(0x0a000, 0x0a000) AM_READWRITE(tatsumi_hack_oki_r, OKIM6295_data_0_w) |
| 130 | AM_RANGE(0x0e000, 0x0e007) AM_READWRITE(apache3_adc_r, apache3_adc_w) //adc select |
| 131 | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 161 | 132 | ADDRESS_MAP_END |
| 162 | 133 | |
| 163 | | static ADDRESS_MAP_START( z80_readmem_apache3, ADDRESS_SPACE_PROGRAM, 8 ) |
| 164 | | AM_RANGE(0x00000, 0x1fff) AM_READ(MRA8_RAM) |
| 165 | | AM_RANGE(0x08000, 0x83ff) AM_READ(MRA8_RAM) |
| 134 | static ADDRESS_MAP_START( apache3_z80_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 135 | AM_RANGE(0x00000, 0x1fff) AM_RAM AM_BASE(&apache3_z80_ram) |
| 136 | AM_RANGE(0x08000, 0x83ff) AM_RAM AM_BASE(&apache3_bg_ram) |
| 166 | 137 | ADDRESS_MAP_END |
| 167 | 138 | |
| 168 | | static ADDRESS_MAP_START( z80_writemem_apache3, ADDRESS_SPACE_PROGRAM, 8 ) |
| 169 | | AM_RANGE(0x00000, 0x1fff) AM_WRITE(MWA8_RAM) AM_BASE(&apache3_z80_ram) |
| 170 | | AM_RANGE(0x08000, 0x83ff) AM_WRITE(MWA8_RAM) AM_BASE(&apache3_bg_ram) |
| 171 | | ADDRESS_MAP_END |
| 172 | | |
| 173 | 139 | /*****************************************************************/ |
| 174 | 140 | |
| 175 | | static ADDRESS_MAP_START( readmem_roundup5, ADDRESS_SPACE_PROGRAM, 8 ) |
| 176 | | AM_RANGE(0x00000, 0x07fff) AM_READ(MRA8_RAM) |
| 177 | | AM_RANGE(0x08000, 0x0bfff) AM_READ(MRA8_RAM) |
| 178 | | AM_RANGE(0x0d000, 0x0d000) AM_READ(input_port_3_r) /* Dip 1 */ |
| 179 | | AM_RANGE(0x0d001, 0x0d001) AM_READ(input_port_4_r) /* Dip 2 */ |
| 180 | | AM_RANGE(0x0f000, 0x0ffff) AM_READ(MRA8_RAM) |
| 181 | | AM_RANGE(0x10000, 0x1ffff) AM_READ(roundup_v30_z80_r) |
| 182 | | AM_RANGE(0x20000, 0x2ffff) AM_READ(tatsumi_v30_68000_r) |
| 183 | | AM_RANGE(0x30000, 0x3ffff) AM_READ(roundup5_vram_r) |
| 184 | | AM_RANGE(0x80000, 0xfffff) AM_READ(MRA8_ROM) |
| 185 | | ADDRESS_MAP_END |
| 186 | | |
| 187 | | static ADDRESS_MAP_START( writemem_roundup5, ADDRESS_SPACE_PROGRAM, 8 ) |
| 188 | | AM_RANGE(0x00000, 0x07fff) AM_WRITE(MWA8_RAM) |
| 189 | | AM_RANGE(0x08000, 0x0bfff) AM_WRITE(roundup5_text_w) AM_BASE(&videoram) |
| 141 | static ADDRESS_MAP_START( roundup5_v30_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 142 | AM_RANGE(0x00000, 0x07fff) AM_RAM |
| 143 | AM_RANGE(0x08000, 0x0bfff) AM_READWRITE(MRA16_RAM, roundup5_text_w) AM_BASE(&videoram16) |
| 190 | 144 | AM_RANGE(0x0c000, 0x0c003) AM_WRITE(roundup5_crt_w) |
| 191 | | AM_RANGE(0x0d400, 0x0d40f) AM_WRITE(MWA8_RAM) AM_BASE(&roundup5_unknown0) |
| 192 | | AM_RANGE(0x0d800, 0x0d801) AM_WRITE(MWA8_RAM) AM_BASE(&roundup5_unknown1) // VRAM2 X scroll (todo) |
| 193 | | AM_RANGE(0x0dc00, 0x0dc01) AM_WRITE(MWA8_RAM) AM_BASE(&roundup5_unknown2) // VRAM2 Y scroll (todo) |
| 145 | AM_RANGE(0x0d000, 0x0d001) AM_READ(input_port_3_word_r) /* Dip 1+2 */ |
| 146 | AM_RANGE(0x0d400, 0x0d40f) AM_WRITE(MWA16_RAM) AM_BASE(&roundup5_unknown0) |
| 147 | AM_RANGE(0x0d800, 0x0d801) AM_WRITE(MWA16_RAM) AM_BASE(&roundup5_unknown1) // VRAM2 X scroll (todo) |
| 148 | AM_RANGE(0x0dc00, 0x0dc01) AM_WRITE(MWA16_RAM) AM_BASE(&roundup5_unknown2) // VRAM2 Y scroll (todo) |
| 194 | 149 | AM_RANGE(0x0e000, 0x0e001) AM_WRITE(roundup5_control_w) |
| 195 | | AM_RANGE(0x0f000, 0x0ffff) AM_WRITE(roundup5_palette_w) AM_BASE(&paletteram) |
| 196 | | AM_RANGE(0x10000, 0x1ffff) AM_WRITE(roundup_v30_z80_w) |
| 197 | | AM_RANGE(0x20000, 0x23fff) AM_WRITE(tatsumi_v30_68000_w) |
| 198 | | AM_RANGE(0x30000, 0x3ffff) AM_WRITE(roundup5_vram_w) |
| 199 | | AM_RANGE(0x80000, 0xfffff) AM_WRITE(MWA8_ROM) |
| 150 | AM_RANGE(0x0f000, 0x0ffff) AM_READWRITE(MRA16_RAM, roundup5_palette_w) AM_BASE(&paletteram16) |
| 151 | AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(roundup_v30_z80_r, roundup_v30_z80_w) |
| 152 | AM_RANGE(0x20000, 0x2ffff) AM_READWRITE(tatsumi_v30_68000_r, tatsumi_v30_68000_w) |
| 153 | AM_RANGE(0x30000, 0x3ffff) AM_READWRITE(roundup5_vram_r, roundup5_vram_w) |
| 154 | AM_RANGE(0x80000, 0xfffff) AM_ROM |
| 200 | 155 | ADDRESS_MAP_END |
| 201 | 156 | |
| 202 | | static ADDRESS_MAP_START( readmem_roundup5_sub, ADDRESS_SPACE_PROGRAM, 16 ) |
| 203 | | AM_RANGE(0x00000, 0x7ffff) AM_READ(MRA16_ROM) |
| 204 | | AM_RANGE(0x80000, 0x83fff) AM_READ(MRA16_RAM) |
| 205 | | AM_RANGE(0x90000, 0x93fff) AM_READ(MRA16_RAM) |
| 206 | | AM_RANGE(0xa0000, 0xa0fff) AM_READ(MRA16_RAM) |
| 207 | | AM_RANGE(0xb0000, 0xb0fff) AM_READ(MRA16_RAM) |
| 208 | | AM_RANGE(0xc0000, 0xc0fff) AM_READ(MRA16_RAM) |
| 209 | | ADDRESS_MAP_END |
| 210 | | |
| 211 | | static ADDRESS_MAP_START( writemem_roundup5_sub, ADDRESS_SPACE_PROGRAM, 16 ) |
| 212 | | AM_RANGE(0x00000, 0x7ffff) AM_WRITE(MWA16_ROM) |
| 213 | | AM_RANGE(0x80000, 0x83fff) AM_WRITE(MWA16_RAM) AM_BASE(&tatsumi_68k_ram) |
| 214 | | AM_RANGE(0x90000, 0x93fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) |
| 157 | static ADDRESS_MAP_START( roundup5_68000_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 158 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 159 | AM_RANGE(0x80000, 0x83fff) AM_RAM AM_BASE(&tatsumi_68k_ram) |
| 160 | AM_RANGE(0x90000, 0x93fff) AM_RAM AM_BASE(&spriteram16) |
| 215 | 161 | AM_RANGE(0x9a000, 0x9a1ff) AM_WRITE(tatsumi_sprite_control_w) AM_BASE(&tatsumi_sprite_control_ram) |
| 216 | | AM_RANGE(0xa0000, 0xa0fff) AM_WRITE(MWA16_RAM) AM_BASE(&roundup_r_ram) // Road control data |
| 217 | | AM_RANGE(0xb0000, 0xb0fff) AM_WRITE(MWA16_RAM) AM_BASE(&roundup_p_ram) // Road pixel data |
| 218 | | AM_RANGE(0xc0000, 0xc0fff) AM_WRITE(MWA16_RAM) AM_BASE(&roundup_l_ram) // Road colour data |
| 162 | AM_RANGE(0xa0000, 0xa0fff) AM_RAM AM_BASE(&roundup_r_ram) // Road control data |
| 163 | AM_RANGE(0xb0000, 0xb0fff) AM_RAM AM_BASE(&roundup_p_ram) // Road pixel data |
| 164 | AM_RANGE(0xc0000, 0xc0fff) AM_RAM AM_BASE(&roundup_l_ram) // Road colour data |
| 219 | 165 | AM_RANGE(0xd0002, 0xd0003) AM_WRITE(roundup5_d0000_w) AM_BASE(&roundup5_d0000_ram) |
| 220 | 166 | AM_RANGE(0xe0000, 0xe0001) AM_WRITE(roundup5_e0000_w) AM_BASE(&roundup5_e0000_ram) |
| 221 | 167 | ADDRESS_MAP_END |
| 222 | 168 | |
| 223 | | static ADDRESS_MAP_START( readmem_roundup5_sound, ADDRESS_SPACE_PROGRAM, 8 ) |
| 224 | | AM_RANGE(0x0000, 0xdfff) AM_READ(MRA8_ROM) |
| 225 | | AM_RANGE(0xe000, 0xffef) AM_READ(MRA8_RAM) // maybe less than this... |
| 226 | | AM_RANGE(0xfff1, 0xfff1) AM_READ(tatsumi_hack_ym2151_r) //YM2151_status_port_0_r) |
| 227 | | AM_RANGE(0xfff4, 0xfff4) AM_READ(tatsumi_hack_oki_r) //OKIM6295_status_0_r) |
| 169 | static ADDRESS_MAP_START( roundup5_z80_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 170 | AM_RANGE(0x0000, 0xdfff) AM_ROM |
| 171 | AM_RANGE(0xe000, 0xffef) AM_RAM |
| 172 | AM_RANGE(0xfff0, 0xfff0) AM_WRITE(YM2151_register_port_0_w) |
| 173 | AM_RANGE(0xfff1, 0xfff1) AM_READWRITE(tatsumi_hack_ym2151_r, YM2151_data_port_0_w) |
| 174 | AM_RANGE(0xfff4, 0xfff4) AM_READWRITE(tatsumi_hack_oki_r, OKIM6295_data_0_w) |
| 228 | 175 | AM_RANGE(0xfff8, 0xfff8) AM_READ(input_port_0_r) |
| 229 | 176 | AM_RANGE(0xfff9, 0xfff9) AM_READ(input_port_1_r) |
| 230 | 177 | AM_RANGE(0xfffc, 0xfffc) AM_READ(input_port_2_r) |
| 231 | | ADDRESS_MAP_END |
| 232 | | |
| 233 | | static ADDRESS_MAP_START( writemem_roundup5_sound, ADDRESS_SPACE_PROGRAM, 8 ) |
| 234 | | AM_RANGE(0x0000, 0xdfff) AM_WRITE(MWA8_ROM) |
| 235 | | AM_RANGE(0xe000, 0xffef) AM_WRITE(MWA8_RAM) |
| 236 | | AM_RANGE(0xfff0, 0xfff0) AM_WRITE(YM2151_register_port_0_w) |
| 237 | | AM_RANGE(0xfff1, 0xfff1) AM_WRITE(YM2151_data_port_0_w) |
| 238 | | AM_RANGE(0xfff4, 0xfff4) AM_WRITE(OKIM6295_data_0_w) |
| 239 | | |
| 240 | 178 | AM_RANGE(0xfff9, 0xfff9) AM_WRITE(MWA8_NOP) //irq ack? |
| 241 | 179 | AM_RANGE(0xfffa, 0xfffa) AM_WRITE(MWA8_NOP) //irq ack? |
| 242 | 180 | ADDRESS_MAP_END |
| 243 | 181 | |
| 244 | 182 | /******************************************************************************/ |
| 245 | 183 | |
| 246 | | static ADDRESS_MAP_START( readmem_cyclwarr_a, ADDRESS_SPACE_PROGRAM, 16 ) |
| 247 | | AM_RANGE(0x000000, 0x00ffff) AM_READ(MRA16_RAM) |
| 248 | | AM_RANGE(0x03e000, 0x03efff) AM_READ(MRA16_RAM) |
| 249 | | AM_RANGE(0x040000, 0x043fff) AM_READ(cyclwarr_cpu_bb_r) |
| 250 | | AM_RANGE(0x080000, 0x08ffff) AM_READ(cyclwarr_videoram2_r) |
| 251 | | AM_RANGE(0x090000, 0x09ffff) AM_READ(cyclwarr_videoram_r) |
| 184 | static ADDRESS_MAP_START( cyclwarr_68000a_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 185 | AM_RANGE(0x000000, 0x00dfff) AM_RAM AM_BASE(&cyclwarr_cpua_ram) |
| 186 | AM_RANGE(0x00e000, 0x00ffff) AM_RAM AM_BASE(&videoram16) |
| 187 | AM_RANGE(0x03e000, 0x03efff) AM_RAM |
| 188 | AM_RANGE(0x040000, 0x043fff) AM_READWRITE(cyclwarr_cpu_bb_r, cyclwarr_cpu_bb_w) |
| 189 | AM_RANGE(0x080000, 0x08ffff) AM_READWRITE(cyclwarr_videoram2_r, cyclwarr_videoram2_w) AM_BASE(&cyclwarr_videoram2) |
| 190 | AM_RANGE(0x090000, 0x09ffff) AM_READWRITE(cyclwarr_videoram_r, cyclwarr_videoram_w) AM_BASE(&cyclwarr_videoram) |
| 252 | 191 | AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) //b9008 - dips |
| 253 | 192 | // ba000 + ba002 - dips |
| 254 | 193 | AM_RANGE(0x0ba000, 0x0ba003) AM_READ(cyclwarr_input2_r) //temp |
| 255 | 194 | AM_RANGE(0x0ba004, 0x0ba007) AM_READ(cyclwarr_input2_r) |
| 256 | | AM_RANGE(0x0ba008, 0x0ba009) AM_READ(cyclwarr_control_r) |
| 257 | | AM_RANGE(0x0c0000, 0x0c3fff) AM_READ(cyclwarr_sprite_r) |
| 258 | | AM_RANGE(0x0d0000, 0x0d3fff) AM_READ(cyclwarr_palette_r) |
| 259 | | AM_RANGE(0x140000, 0x1bffff) AM_READ(MRA16_BANK2) /* CPU B ROM */ |
| 260 | | AM_RANGE(0x2c0000, 0x33ffff) AM_READ(MRA16_BANK1) /* CPU A ROM */ |
| 261 | | ADDRESS_MAP_END |
| 262 | | |
| 263 | | static ADDRESS_MAP_START( writemem_cyclwarr_a, ADDRESS_SPACE_PROGRAM, 16 ) |
| 264 | | AM_RANGE(0x000000, 0x00dfff) AM_WRITE(MWA16_RAM) AM_BASE(&cyclwarr_cpua_ram) |
| 265 | | AM_RANGE(0x00e000, 0x00ffff) AM_WRITE(MWA16_RAM) AM_BASE(&videoram16) |
| 266 | | AM_RANGE(0x03e000, 0x03efff) AM_WRITE(MWA16_RAM) |
| 267 | | AM_RANGE(0x040000, 0x043fff) AM_WRITE(cyclwarr_cpu_bb_w) |
| 268 | | AM_RANGE(0x080000, 0x08ffff) AM_WRITE(cyclwarr_videoram2_w) AM_BASE(&cyclwarr_videoram2) |
| 269 | | AM_RANGE(0x090000, 0x09ffff) AM_WRITE(cyclwarr_videoram_w) AM_BASE(&cyclwarr_videoram) |
| 270 | | AM_RANGE(0x0ba008, 0x0ba009) AM_WRITE(cyclwarr_control_w) |
| 271 | | AM_RANGE(0x0c0000, 0x0c3fff) AM_WRITE(cyclwarr_sprite_w) AM_BASE(&spriteram16) |
| 195 | AM_RANGE(0x0ba008, 0x0ba009) AM_READWRITE(cyclwarr_control_r, cyclwarr_control_w) |
| 196 | AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) AM_BASE(&spriteram16) |
| 272 | 197 | AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) AM_BASE(&tatsumi_sprite_control_ram) |
| 273 | | AM_RANGE(0x0d0000, 0x0d3fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) |
| 198 | AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) |
| 199 | AM_RANGE(0x140000, 0x1bffff) AM_ROMBANK(2) /* CPU B ROM */ |
| 200 | AM_RANGE(0x2c0000, 0x33ffff) AM_ROMBANK(1) /* CPU A ROM */ |
| 274 | 201 | ADDRESS_MAP_END |
| 275 | 202 | |
| 276 | | static ADDRESS_MAP_START( readmem_cyclwarr_b, ADDRESS_SPACE_PROGRAM, 16 ) |
| 277 | | AM_RANGE(0x000000, 0x00ffff) AM_READ(MRA16_RAM) |
| 278 | | AM_RANGE(0x080000, 0x08ffff) AM_READ(cyclwarr_videoram2_r) |
| 279 | | AM_RANGE(0x090000, 0x09ffff) AM_READ(cyclwarr_videoram_r) |
| 280 | | AM_RANGE(0x0c0000, 0x0c3fff) AM_READ(cyclwarr_sprite_r) |
| 281 | | AM_RANGE(0x0d0000, 0x0d3fff) AM_READ(cyclwarr_palette_r) |
| 282 | | AM_RANGE(0x140000, 0x1bffff) AM_READ(MRA16_BANK2) |
| 283 | | AM_RANGE(0x2c0000, 0x33ffff) AM_READ(MRA16_BANK1) |
| 284 | | ADDRESS_MAP_END |
| 285 | | |
| 286 | | static ADDRESS_MAP_START( writemem_cyclwarr_b, ADDRESS_SPACE_PROGRAM, 16 ) |
| 287 | | AM_RANGE(0x000000, 0x00dfff) AM_WRITE(MWA16_RAM) AM_BASE(&cyclwarr_cpub_ram) |
| 288 | | AM_RANGE(0x00e000, 0x00ffff) AM_WRITE(MWA16_RAM) |
| 289 | | AM_RANGE(0x080000, 0x08ffff) AM_WRITE(cyclwarr_videoram2_w) |
| 290 | | AM_RANGE(0x090000, 0x09ffff) AM_WRITE(cyclwarr_videoram_w) |
| 291 | | AM_RANGE(0x0c0000, 0x0c3fff) AM_WRITE(cyclwarr_sprite_w) |
| 203 | static ADDRESS_MAP_START( cyclwarr_68000b_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 204 | AM_RANGE(0x000000, 0x00dfff) AM_RAM AM_BASE(&cyclwarr_cpub_ram) |
| 205 | AM_RANGE(0x00e000, 0x00ffff) AM_RAM |
| 206 | AM_RANGE(0x080000, 0x08ffff) AM_READWRITE(cyclwarr_videoram2_r, cyclwarr_videoram2_w) |
| 207 | AM_RANGE(0x090000, 0x09ffff) AM_READWRITE(cyclwarr_videoram_r, cyclwarr_videoram_w) |
| 208 | AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) |
| 292 | 209 | AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) |
| 293 | | AM_RANGE(0x0d0000, 0x0d3fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) |
| 210 | AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram16_xRRRRRGGGGGBBBBB_word_w) |
| 211 | AM_RANGE(0x140000, 0x1bffff) AM_ROMBANK(2) /* CPU B ROM */ |
| 212 | AM_RANGE(0x2c0000, 0x33ffff) AM_ROMBANK(1) /* CPU A ROM */ |
| 294 | 213 | ADDRESS_MAP_END |
| 295 | 214 | |
| 296 | | static ADDRESS_MAP_START( readmem_cyclwarr_c, ADDRESS_SPACE_PROGRAM, 8 ) |
| 297 | | AM_RANGE(0x0000, 0xdfff) AM_READ(MRA8_ROM) |
| 298 | | AM_RANGE(0xe000, 0xffef) AM_READ(MRA8_RAM) // maybe less than this... |
| 299 | | AM_RANGE(0xfff1, 0xfff1) AM_READ(tatsumi_hack_ym2151_r) //YM2151_status_port_0_r) |
| 300 | | AM_RANGE(0xfff4, 0xfff4) AM_READ(tatsumi_hack_oki_r) // OKIM6295_status_0_r) |
| 215 | static ADDRESS_MAP_START( cyclwarr_z80_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 216 | AM_RANGE(0x0000, 0xdfff) AM_ROM |
| 217 | AM_RANGE(0xe000, 0xffef) AM_RAM |
| 218 | AM_RANGE(0xfff0, 0xfff0) AM_WRITE(YM2151_register_port_0_w) |
| 219 | AM_RANGE(0xfff1, 0xfff1) AM_READWRITE(tatsumi_hack_ym2151_r, YM2151_data_port_0_w) |
| 220 | AM_RANGE(0xfff4, 0xfff4) AM_READWRITE(tatsumi_hack_oki_r, OKIM6295_data_0_w) |
| 301 | 221 | AM_RANGE(0xfff8, 0xfff8) AM_READ(input_port_0_r) |
| 302 | 222 | AM_RANGE(0xfff9, 0xfff9) AM_READ(input_port_1_r) |
| 303 | 223 | // AM_RANGE(0xfffa, 0xfffa) AM_READ(input_port_0_r)// MRA_NOP) //irq ack??? |
| 304 | 224 | AM_RANGE(0xfffc, 0xfffc) AM_READ(input_port_2_r)// MRA_NOP) |
| 305 | | ADDRESS_MAP_END |
| 306 | | |
| 307 | | static ADDRESS_MAP_START( writemem_cyclwarr_c, ADDRESS_SPACE_PROGRAM, 8 ) |
| 308 | | AM_RANGE(0x0000, 0xdfff) AM_WRITE(MWA8_ROM) |
| 309 | | AM_RANGE(0xe000, 0xffef) AM_WRITE(MWA8_RAM) |
| 310 | | AM_RANGE(0xfff0, 0xfff0) AM_WRITE(YM2151_register_port_0_w) |
| 311 | | AM_RANGE(0xfff1, 0xfff1) AM_WRITE(YM2151_data_port_0_w) |
| 312 | | AM_RANGE(0xfff4, 0xfff4) AM_WRITE(OKIM6295_data_0_w) |
| 313 | 225 | AM_RANGE(0xfff9, 0xfff9) AM_WRITE(MWA8_NOP) //irq ack? |
| 314 | 226 | AM_RANGE(0xfffa, 0xfffa) AM_WRITE(MWA8_NOP) //irq ack? |
| 315 | 227 | ADDRESS_MAP_END |
| r869 | r870 | |
| 334 | 246 | PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) |
| 335 | 247 | |
| 336 | 248 | PORT_START |
| 337 | | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") |
| 338 | | PORT_DIPSETTING( 0x00, "3" ) |
| 339 | | PORT_DIPSETTING( 0x01, "4" ) |
| 340 | | PORT_DIPSETTING( 0x02, "5" ) |
| 341 | | PORT_DIPSETTING( 0x03, "6" ) |
| 342 | | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") |
| 343 | | PORT_DIPSETTING( 0x04, DEF_STR( Easy ) ) |
| 344 | | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 345 | | PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) |
| 346 | | PORT_DIPSETTING( 0x0c, DEF_STR( Hardest ) ) |
| 347 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) |
| 348 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 349 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 350 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") /* Listed as "Always On" */ |
| 351 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 352 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 353 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") /* Listed as "Not Used" */ |
| 354 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 355 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 356 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") /* Listed as "Always On" */ |
| 357 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 358 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 359 | | |
| 360 | | PORT_START |
| 361 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3") |
| 362 | | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) |
| 363 | | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| 364 | | PORT_DIPSETTING( 0x07, DEF_STR( 3C_2C ) ) |
| 365 | | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 366 | | PORT_DIPSETTING( 0x06, DEF_STR( 2C_3C ) ) |
| 367 | | PORT_DIPSETTING( 0x03, DEF_STR( 1C_2C ) ) |
| 368 | | PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) ) |
| 369 | | PORT_DIPSETTING( 0x05, DEF_STR( 1C_6C ) ) |
| 370 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") /* Manual only shows a 3-Way dip box, so 4-8 are unknown */ |
| 371 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 372 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 373 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") |
| 374 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 375 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 376 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6") |
| 377 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 378 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 379 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") |
| 380 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 381 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 382 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Test ) ) PORT_DIPLOCATION("SW1:8") |
| 383 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 384 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 249 | PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") |
| 250 | PORT_DIPSETTING( 0x0000, "3" ) |
| 251 | PORT_DIPSETTING( 0x0001, "4" ) |
| 252 | PORT_DIPSETTING( 0x0002, "5" ) |
| 253 | PORT_DIPSETTING( 0x0003, "6" ) |
| 254 | PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") |
| 255 | PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) |
| 256 | PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) |
| 257 | PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) |
| 258 | PORT_DIPSETTING( 0x000c, DEF_STR( Hardest ) ) |
| 259 | PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 260 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 261 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 262 | PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") /* Listed as "Always On" */ |
| 263 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) |
| 264 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 265 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") /* Listed as "Not Used" */ |
| 266 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 267 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 268 | PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") /* Listed as "Always On" */ |
| 269 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 270 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 271 | PORT_DIPNAME( 0x0700, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3") |
| 272 | PORT_DIPSETTING( 0x0200, DEF_STR( 3C_1C ) ) |
| 273 | PORT_DIPSETTING( 0x0100, DEF_STR( 2C_1C ) ) |
| 274 | PORT_DIPSETTING( 0x0700, DEF_STR( 3C_2C ) ) |
| 275 | PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) |
| 276 | PORT_DIPSETTING( 0x0600, DEF_STR( 2C_3C ) ) |
| 277 | PORT_DIPSETTING( 0x0300, DEF_STR( 1C_2C ) ) |
| 278 | PORT_DIPSETTING( 0x0400, DEF_STR( 1C_5C ) ) |
| 279 | PORT_DIPSETTING( 0x0500, DEF_STR( 1C_6C ) ) |
| 280 | PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") /* Manual only shows a 3-Way dip box, so 4-8 are unknown */ |
| 281 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 282 | PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) |
| 283 | PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") |
| 284 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 285 | PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) |
| 286 | PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6") |
| 287 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 288 | PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) |
| 289 | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") |
| 290 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 291 | PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) |
| 292 | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Test ) ) PORT_DIPLOCATION("SW1:8") |
| 293 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 294 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 385 | 295 | INPUT_PORTS_END |
| 386 | 296 | |
| 387 | 297 | INPUT_PORTS_START( roundup5 ) |
| r869 | r870 | |
| 409 | 319 | PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) |
| 410 | 320 | |
| 411 | 321 | PORT_START |
| 412 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) |
| 413 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 414 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 415 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 416 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 417 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 418 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 419 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 420 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 421 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 422 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 423 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 424 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) |
| 425 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 426 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 427 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Language ) ) |
| 428 | | PORT_DIPSETTING( 0x20, DEF_STR( Japanese ) ) |
| 429 | | PORT_DIPSETTING( 0x00, DEF_STR( English ) ) |
| 430 | | PORT_DIPNAME( 0x40, 0x00, "Stage 5 Continue" ) |
| 431 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 432 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 433 | | PORT_DIPNAME( 0x80, 0x00, "Output Mode" ) |
| 434 | | PORT_DIPSETTING( 0x00, "A" ) |
| 435 | | PORT_DIPSETTING( 0x80, "B" ) |
| 436 | | |
| 437 | | PORT_START |
| 438 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) |
| 439 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 440 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 441 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 442 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 443 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 444 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 445 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 446 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 447 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 448 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 449 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 450 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 451 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 452 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 453 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 454 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 455 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 456 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 457 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 458 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 459 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Test ) ) |
| 460 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 461 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 322 | PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) ) |
| 323 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 324 | PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) |
| 325 | PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) ) |
| 326 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 327 | PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) |
| 328 | PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) |
| 329 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 330 | PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) |
| 331 | PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) ) |
| 332 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 333 | PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) |
| 334 | PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 335 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 336 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 337 | PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Language ) ) |
| 338 | PORT_DIPSETTING( 0x0020, DEF_STR( Japanese ) ) |
| 339 | PORT_DIPSETTING( 0x0000, DEF_STR( English ) ) |
| 340 | PORT_DIPNAME( 0x0040, 0x0000, "Stage 5 Continue" ) |
| 341 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 342 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 343 | PORT_DIPNAME( 0x0080, 0x0000, "Output Mode" ) |
| 344 | PORT_DIPSETTING( 0x0000, "A" ) |
| 345 | PORT_DIPSETTING( 0x0080, "B" ) |
| 346 | PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) |
| 347 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 348 | PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) |
| 349 | PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) |
| 350 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 351 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 352 | PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) |
| 353 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 354 | PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) |
| 355 | PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) |
| 356 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 357 | PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) |
| 358 | PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) |
| 359 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 360 | PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) |
| 361 | PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) |
| 362 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 363 | PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) |
| 364 | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) |
| 365 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 366 | PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) |
| 367 | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Test ) ) |
| 368 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 369 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 462 | 370 | INPUT_PORTS_END |
| 463 | 371 | |
| 464 | 372 | INPUT_PORTS_START( cyclwarr ) |
| r869 | r870 | |
| 609 | 517 | |
| 610 | 518 | /* basic machine hardware */ |
| 611 | 519 | MDRV_CPU_ADD(V30,20000000 / 2) /* NEC V30 CPU, 20MHz / 2 */ |
| 612 | | MDRV_CPU_PROGRAM_MAP(readmem_apache3,writemem_apache3) |
| 520 | MDRV_CPU_PROGRAM_MAP(apache3_v30_map,0) |
| 613 | 521 | MDRV_CPU_VBLANK_INT(roundup5_interrupt,1) |
| 614 | 522 | |
| 615 | 523 | MDRV_CPU_ADD(M68000,20000000 / 2) /* 68000 CPU, 20MHz / 2 */ |
| 616 | | MDRV_CPU_PROGRAM_MAP(sub_readmem_apache3,sub_writemem_apache3) |
| 524 | MDRV_CPU_PROGRAM_MAP(apache3_68000_map,0) |
| 617 | 525 | |
| 618 | 526 | MDRV_CPU_ADD(V20, 8000000) //??? |
| 619 | | MDRV_CPU_PROGRAM_MAP(readmem_iop_apache3,writemem_iop_apache3) |
| 527 | MDRV_CPU_PROGRAM_MAP(apache3_v20_map,0) |
| 620 | 528 | |
| 621 | 529 | MDRV_CPU_ADD(Z80, 8000000) //??? |
| 622 | | MDRV_CPU_PROGRAM_MAP(z80_readmem_apache3,z80_writemem_apache3) |
| 530 | MDRV_CPU_PROGRAM_MAP(apache3_z80_map,0) |
| 623 | 531 | |
| 624 | 532 | MDRV_SCREEN_REFRESH_RATE(60) |
| 625 | 533 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION) |
| r869 | r870 | |
| 654 | 562 | |
| 655 | 563 | /* basic machine hardware */ |
| 656 | 564 | MDRV_CPU_ADD(V30,20000000 / 2) /* NEC V30 CPU, 20MHz / 2 */ |
| 657 | | MDRV_CPU_PROGRAM_MAP(readmem_roundup5,writemem_roundup5) |
| 565 | MDRV_CPU_PROGRAM_MAP(roundup5_v30_map,0) |
| 658 | 566 | MDRV_CPU_VBLANK_INT(roundup5_interrupt,1) |
| 659 | 567 | |
| 660 | 568 | MDRV_CPU_ADD(M68000,20000000 / 2) /* 68000 CPU, 20MHz / 2 */ |
| 661 | | MDRV_CPU_PROGRAM_MAP(readmem_roundup5_sub,writemem_roundup5_sub) |
| 569 | MDRV_CPU_PROGRAM_MAP(roundup5_68000_map,0) |
| 662 | 570 | |
| 663 | 571 | MDRV_CPU_ADD(Z80, 4000000) //??? |
| 664 | | MDRV_CPU_PROGRAM_MAP(readmem_roundup5_sound,writemem_roundup5_sound) |
| 572 | MDRV_CPU_PROGRAM_MAP(roundup5_z80_map,0) |
| 665 | 573 | |
| 666 | 574 | MDRV_SCREEN_REFRESH_RATE(60) |
| 667 | 575 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION) |
| r869 | r870 | |
| 696 | 604 | |
| 697 | 605 | /* basic machine hardware */ |
| 698 | 606 | MDRV_CPU_ADD(M68000,20000000 / 2) /* NEC V30 CPU, 20MHz / 2 */ |
| 699 | | MDRV_CPU_PROGRAM_MAP(readmem_cyclwarr_a,writemem_cyclwarr_a ) |
| 607 | MDRV_CPU_PROGRAM_MAP(cyclwarr_68000a_map,0) |
| 700 | 608 | MDRV_CPU_VBLANK_INT(irq5_line_hold,1) |
| 701 | 609 | |
| 702 | 610 | MDRV_CPU_ADD(M68000,20000000 / 2) /* 68000 CPU, 20MHz / 2 */ |
| 703 | | MDRV_CPU_PROGRAM_MAP(readmem_cyclwarr_b,writemem_cyclwarr_b) |
| 611 | MDRV_CPU_PROGRAM_MAP(cyclwarr_68000b_map,0) |
| 704 | 612 | MDRV_CPU_VBLANK_INT(irq5_line_hold,1) |
| 705 | 613 | |
| 706 | 614 | MDRV_CPU_ADD(Z80, 4000000) //??? |
| 707 | | MDRV_CPU_PROGRAM_MAP(readmem_cyclwarr_c,writemem_cyclwarr_c) |
| 615 | MDRV_CPU_PROGRAM_MAP(cyclwarr_z80_map,0) |
| 708 | 616 | |
| 709 | 617 | MDRV_SCREEN_REFRESH_RATE(60) |
| 710 | 618 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION) |
src/mame/drivers/m72.c
| r869 | r870 | |
| 75 | 75 | #include "audio/m72.h" |
| 76 | 76 | #include "sound/dac.h" |
| 77 | 77 | #include "sound/2151intf.h" |
| 78 | #include "m72.h" |
| 78 | 79 | |
| 79 | 80 | |
| 80 | 81 | /* in video/m72.c */ |
| 81 | | extern UINT8 *m72_videoram1,*m72_videoram2,*majtitle_rowscrollram; |
| 82 | | MACHINE_RESET( m72 ); |
| 83 | | MACHINE_RESET( xmultipl ); |
| 84 | | MACHINE_RESET( kengo ); |
| 85 | | INTERRUPT_GEN( m72_interrupt ); |
| 86 | | VIDEO_START( m72 ); |
| 87 | | VIDEO_START( rtype2 ); |
| 88 | | VIDEO_START( majtitle ); |
| 89 | | VIDEO_START( hharry ); |
| 90 | | VIDEO_START( poundfor ); |
| 91 | | READ8_HANDLER( m72_palette1_r ); |
| 92 | | READ8_HANDLER( m72_palette2_r ); |
| 93 | | WRITE8_HANDLER( m72_palette1_w ); |
| 94 | | WRITE8_HANDLER( m72_palette2_w ); |
| 95 | | READ8_HANDLER( m72_videoram1_r ); |
| 96 | | READ8_HANDLER( m72_videoram2_r ); |
| 97 | | WRITE8_HANDLER( m72_videoram1_w ); |
| 98 | | WRITE8_HANDLER( m72_videoram2_w ); |
| 99 | | WRITE8_HANDLER( m72_irq_line_w ); |
| 100 | | WRITE8_HANDLER( m72_scrollx1_w ); |
| 101 | | WRITE8_HANDLER( m72_scrollx2_w ); |
| 102 | | WRITE8_HANDLER( m72_scrolly1_w ); |
| 103 | | WRITE8_HANDLER( m72_scrolly2_w ); |
| 104 | | WRITE8_HANDLER( m72_dmaon_w ); |
| 105 | | WRITE8_HANDLER( m72_port02_w ); |
| 106 | | WRITE8_HANDLER( rtype2_port02_w ); |
| 107 | | WRITE8_HANDLER( majtitle_gfx_ctrl_w ); |
| 108 | | VIDEO_UPDATE( m72 ); |
| 109 | | VIDEO_UPDATE( majtitle ); |
| 110 | 82 | |
| 111 | 83 | |
| 112 | | static UINT8 *protection_ram; |
| 84 | static UINT16 *protection_ram; |
| 113 | 85 | |
| 114 | 86 | |
| 115 | 87 | |
| r869 | r870 | |
| 161 | 133 | } |
| 162 | 134 | |
| 163 | 135 | |
| 164 | | static WRITE8_HANDLER( bchopper_sample_trigger_w ) |
| 136 | static WRITE16_HANDLER( bchopper_sample_trigger_w ) |
| 165 | 137 | { |
| 166 | 138 | static const int a[6] = { 0x0000, 0x0010, 0x2510, 0x6510, 0x8510, 0x9310 }; |
| 167 | | if (data < 6) m72_set_sample_start(a[data]); |
| 139 | if (ACCESSING_LSB && (data & 0xff) < 6) m72_set_sample_start(a[data & 0xff]); |
| 168 | 140 | } |
| 169 | 141 | |
| 170 | | static WRITE8_HANDLER( nspirit_sample_trigger_w ) |
| 142 | static WRITE16_HANDLER( nspirit_sample_trigger_w ) |
| 171 | 143 | { |
| 172 | 144 | static const int a[9] = { 0x0000, 0x0020, 0x2020, 0, 0x5720, 0, 0x7b60, 0x9b60, 0xc360 }; |
| 173 | | if (data < 9) m72_set_sample_start(a[data]); |
| 145 | if (ACCESSING_LSB && (data & 0xff) < 9) m72_set_sample_start(a[data & 0xff]); |
| 174 | 146 | } |
| 175 | 147 | |
| 176 | | static WRITE8_HANDLER( imgfight_sample_trigger_w ) |
| 148 | static WRITE16_HANDLER( imgfight_sample_trigger_w ) |
| 177 | 149 | { |
| 178 | 150 | static const int a[7] = { 0x0000, 0x0020, 0x44e0, 0x98a0, 0xc820, 0xf7a0, 0x108c0 }; |
| 179 | | if (data < 7) m72_set_sample_start(a[data]); |
| 151 | if (ACCESSING_LSB && (data & 0xff) < 7) m72_set_sample_start(a[data & 0xff]); |
| 180 | 152 | } |
| 181 | 153 | |
| 182 | | static WRITE8_HANDLER( loht_sample_trigger_w ) |
| 154 | static WRITE16_HANDLER( loht_sample_trigger_w ) |
| 183 | 155 | { |
| 184 | 156 | static const int a[7] = { 0x0000, 0x0020, 0, 0x2c40, 0x4320, 0x7120, 0xb200 }; |
| 185 | | if (data < 7) m72_set_sample_start(a[data]); |
| 157 | if (ACCESSING_LSB && (data & 0xff) < 7) m72_set_sample_start(a[data & 0xff]); |
| 186 | 158 | } |
| 187 | 159 | |
| 188 | | static WRITE8_HANDLER( xmultipl_sample_trigger_w ) |
| 160 | static WRITE16_HANDLER( xmultipl_sample_trigger_w ) |
| 189 | 161 | { |
| 190 | 162 | static const int a[3] = { 0x0000, 0x0020, 0x1a40 }; |
| 191 | | if (data < 3) m72_set_sample_start(a[data]); |
| 163 | if (ACCESSING_LSB && (data & 0xff) < 3) m72_set_sample_start(a[data & 0xff]); |
| 192 | 164 | } |
| 193 | 165 | |
| 194 | | static WRITE8_HANDLER( dbreed72_sample_trigger_w ) |
| 166 | static WRITE16_HANDLER( dbreed72_sample_trigger_w ) |
| 195 | 167 | { |
| 196 | 168 | static const int a[9] = { 0x00000, 0x00020, 0x02c40, 0x08160, 0x0c8c0, 0x0ffe0, 0x13000, 0x15820, 0x15f40 }; |
| 197 | | if (data < 9) m72_set_sample_start(a[data]); |
| 169 | if (ACCESSING_LSB && (data & 0xff) < 9) m72_set_sample_start(a[data & 0xff]); |
| 198 | 170 | } |
| 199 | 171 | |
| 200 | | static WRITE8_HANDLER( airduel_sample_trigger_w ) |
| 172 | static WRITE16_HANDLER( airduel_sample_trigger_w ) |
| 201 | 173 | { |
| 202 | 174 | static const int a[16] = { |
| 203 | 175 | 0x00000, 0x00020, 0x03ec0, 0x05640, 0x06dc0, 0x083a0, 0x0c000, 0x0eb60, |
| 204 | 176 | 0x112e0, 0x13dc0, 0x16520, 0x16d60, 0x18ae0, 0x1a5a0, 0x1bf00, 0x1c340 }; |
| 205 | | if (data < 16) m72_set_sample_start(a[data]); |
| 177 | if (ACCESSING_LSB && (data & 0xff) < 16) m72_set_sample_start(a[data & 0xff]); |
| 206 | 178 | } |
| 207 | 179 | |
| 208 | | static WRITE8_HANDLER( dkgenm72_sample_trigger_w ) |
| 180 | static WRITE16_HANDLER( dkgenm72_sample_trigger_w ) |
| 209 | 181 | { |
| 210 | 182 | static const int a[28] = { |
| 211 | 183 | 0x00000, 0x00020, 0x01800, 0x02da0, 0x03be0, 0x05ae0, 0x06100, 0x06de0, |
| r869 | r870 | |
| 213 | 185 | 0x10fa0, 0x10fc0, 0x10fe0, 0x11f40, 0x12b20, 0x130a0, 0x13c60, 0x14740, |
| 214 | 186 | 0x153c0, 0x197e0, 0x1af40, 0x1c080 }; |
| 215 | 187 | |
| 216 | | if (data < 28) m72_set_sample_start(a[data]); |
| 188 | if (ACCESSING_LSB && (data & 0xff) < 28) m72_set_sample_start(a[data & 0xff]); |
| 217 | 189 | } |
| 218 | 190 | |
| 219 | | static WRITE8_HANDLER( gallop_sample_trigger_w ) |
| 191 | static WRITE16_HANDLER( gallop_sample_trigger_w ) |
| 220 | 192 | { |
| 221 | 193 | static const int a[31] = { |
| 222 | 194 | 0x00000, 0x00020, 0x00040, 0x01360, 0x02580, 0x04f20, 0x06240, 0x076e0, |
| r869 | r870 | |
| 224 | 196 | 0x10200, 0x10220, 0x10240, 0x11380, 0x12760, 0x12780, 0x127a0, 0x13c40, |
| 225 | 197 | 0x140a0, 0x16760, 0x17e40, 0x18ee0, 0x19f60, 0x1bbc0, 0x1cee0 }; |
| 226 | 198 | |
| 227 | | if (data < 31) m72_set_sample_start(a[data]); |
| 199 | if (ACCESSING_LSB && (data & 0xff) < 31) m72_set_sample_start(a[data & 0xff]); |
| 228 | 200 | } |
| 229 | 201 | |
| 230 | 202 | |
| r869 | r870 | |
| 410 | 382 | 0x79,0x08,0x1c,0xb3, 0x00,0x00 }; |
| 411 | 383 | |
| 412 | 384 | |
| 413 | | static UINT8 *protection_code,*protection_crc; |
| 385 | static const UINT8 *protection_code, *protection_crc; |
| 414 | 386 | |
| 415 | | static READ8_HANDLER( protection_r ) |
| 387 | static void copy_le(UINT16 *dest, const UINT8 *src, UINT8 bytes) |
| 416 | 388 | { |
| 417 | | memcpy(protection_ram,protection_code,CODE_LEN); |
| 418 | | return protection_ram[0xffb+offset]; |
| 389 | int i; |
| 390 | |
| 391 | for (i = 0; i < bytes; i += 2) |
| 392 | dest[i/2] = src[i+0] | (src[i+1] << 8); |
| 419 | 393 | } |
| 420 | 394 | |
| 421 | | static WRITE8_HANDLER( protection_w ) |
| 395 | static READ16_HANDLER( protection_r ) |
| 422 | 396 | { |
| 423 | | protection_ram[offset] = data ^ 0xff; |
| 397 | if (ACCESSING_MSB) |
| 398 | copy_le(protection_ram,protection_code,CODE_LEN); |
| 399 | return protection_ram[0xffa/2+offset]; |
| 400 | } |
| 424 | 401 | |
| 425 | | if (offset == 0x0fff && data == 0) |
| 426 | | memcpy(&protection_ram[0x0fe0],protection_crc,CRC_LEN); |
| 402 | static WRITE16_HANDLER( protection_w ) |
| 403 | { |
| 404 | data ^= 0xffff; |
| 405 | COMBINE_DATA(&protection_ram[offset]); |
| 406 | data ^= 0xffff; |
| 407 | |
| 408 | if (offset == 0x0fff/2 && ACCESSING_MSB && (data >> 8) == 0) |
| 409 | copy_le(&protection_ram[0x0fe0],protection_crc,CRC_LEN); |
| 427 | 410 | } |
| 428 | 411 | |
| 429 | 412 | static void install_protection_handler(UINT8 *code,UINT8 *crc) |
| r869 | r870 | |
| 431 | 414 | protection_ram = auto_malloc(0x1000); |
| 432 | 415 | protection_code = code; |
| 433 | 416 | protection_crc = crc; |
| 434 | | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, MRA8_BANK1); |
| 435 | | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0ffb, 0xb0ffb, 0, 0, protection_r); |
| 436 | | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, protection_w); |
| 417 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, MRA16_BANK1); |
| 418 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0ffa, 0xb0ffb, 0, 0, protection_r); |
| 419 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, protection_w); |
| 437 | 420 | memory_set_bankptr(1, protection_ram); |
| 438 | 421 | } |
| 439 | 422 | |
| r869 | r870 | |
| 441 | 424 | { |
| 442 | 425 | install_protection_handler(bchopper_code,bchopper_crc); |
| 443 | 426 | |
| 444 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, bchopper_sample_trigger_w); |
| 427 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, bchopper_sample_trigger_w); |
| 445 | 428 | } |
| 446 | 429 | |
| 447 | 430 | static DRIVER_INIT( mrheli ) |
| 448 | 431 | { |
| 449 | 432 | install_protection_handler(bchopper_code,mrheli_crc); |
| 450 | 433 | |
| 451 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, bchopper_sample_trigger_w); |
| 434 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, bchopper_sample_trigger_w); |
| 452 | 435 | } |
| 453 | 436 | |
| 454 | 437 | static DRIVER_INIT( nspirit ) |
| 455 | 438 | { |
| 456 | 439 | install_protection_handler(nspirit_code,nspirit_crc); |
| 457 | 440 | |
| 458 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, nspirit_sample_trigger_w); |
| 441 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, nspirit_sample_trigger_w); |
| 459 | 442 | } |
| 460 | 443 | |
| 461 | 444 | static DRIVER_INIT( nspiritj ) |
| 462 | 445 | { |
| 463 | 446 | install_protection_handler(nspirit_code,nspiritj_crc); |
| 464 | 447 | |
| 465 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, nspirit_sample_trigger_w); |
| 448 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, nspirit_sample_trigger_w); |
| 466 | 449 | } |
| 467 | 450 | |
| 468 | 451 | static DRIVER_INIT( imgfight ) |
| 469 | 452 | { |
| 470 | 453 | install_protection_handler(imgfight_code,imgfight_crc); |
| 471 | 454 | |
| 472 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, imgfight_sample_trigger_w); |
| 455 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, imgfight_sample_trigger_w); |
| 473 | 456 | } |
| 474 | 457 | |
| 475 | 458 | static DRIVER_INIT( loht ) |
| 476 | 459 | { |
| 477 | 460 | install_protection_handler(loht_code,loht_crc); |
| 478 | 461 | |
| 479 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, loht_sample_trigger_w); |
| 462 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, loht_sample_trigger_w); |
| 480 | 463 | |
| 481 | 464 | /* since we skip the startup tests, clear video RAM to prevent garbage on title screen */ |
| 482 | 465 | memset(m72_videoram2,0,0x4000); |
| r869 | r870 | |
| 486 | 469 | { |
| 487 | 470 | install_protection_handler(xmultipl_code,xmultipl_crc); |
| 488 | 471 | |
| 489 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, xmultipl_sample_trigger_w); |
| 472 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, xmultipl_sample_trigger_w); |
| 490 | 473 | } |
| 491 | 474 | |
| 492 | 475 | static DRIVER_INIT( dbreed72 ) |
| 493 | 476 | { |
| 494 | 477 | install_protection_handler(dbreed72_code,dbreed72_crc); |
| 495 | 478 | |
| 496 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, dbreed72_sample_trigger_w); |
| 479 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, dbreed72_sample_trigger_w); |
| 497 | 480 | } |
| 498 | 481 | |
| 499 | 482 | static DRIVER_INIT( airduel ) |
| 500 | 483 | { |
| 501 | 484 | install_protection_handler(airduel_code,airduel_crc); |
| 502 | 485 | |
| 503 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, airduel_sample_trigger_w); |
| 486 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, airduel_sample_trigger_w); |
| 504 | 487 | } |
| 505 | 488 | |
| 506 | 489 | static DRIVER_INIT( dkgenm72 ) |
| 507 | 490 | { |
| 508 | 491 | install_protection_handler(dkgenm72_code,dkgenm72_crc); |
| 509 | 492 | |
| 510 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, dkgenm72_sample_trigger_w); |
| 493 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, dkgenm72_sample_trigger_w); |
| 511 | 494 | } |
| 512 | 495 | |
| 513 | 496 | static DRIVER_INIT( gallop ) |
| 514 | 497 | { |
| 515 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, gallop_sample_trigger_w); |
| 498 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, gallop_sample_trigger_w); |
| 516 | 499 | } |
| 517 | 500 | |
| 518 | 501 | |
| r869 | r870 | |
| 521 | 504 | static UINT8 *soundram; |
| 522 | 505 | |
| 523 | 506 | |
| 524 | | static READ8_HANDLER( soundram_r ) |
| 507 | static READ16_HANDLER( soundram_r ) |
| 525 | 508 | { |
| 526 | | return soundram[offset]; |
| 509 | return soundram[offset * 2 + 0] | (soundram[offset * 2 + 1] << 8); |
| 527 | 510 | } |
| 528 | 511 | |
| 529 | | static WRITE8_HANDLER( soundram_w ) |
| 512 | static WRITE16_HANDLER( soundram_w ) |
| 530 | 513 | { |
| 531 | | soundram[offset] = data; |
| 514 | if (ACCESSING_LSB) |
| 515 | soundram[offset * 2 + 0] = data; |
| 516 | if (ACCESSING_MSB) |
| 517 | soundram[offset * 2 + 1] = data >> 8; |
| 532 | 518 | } |
| 533 | 519 | |
| 534 | 520 | |
| 535 | | static READ8_HANDLER( poundfor_trackball_r ) |
| 521 | static READ16_HANDLER( poundfor_trackball_r ) |
| 536 | 522 | { |
| 537 | 523 | static int prev[4],diff[4]; |
| 538 | 524 | |
| r869 | r870 | |
| 542 | 528 | |
| 543 | 529 | for (i = 0;i < 4;i++) |
| 544 | 530 | { |
| 545 | | curr = readinputport(6+i); |
| 531 | curr = readinputport(3+i); |
| 546 | 532 | diff[i] = (curr - prev[i]); |
| 547 | 533 | prev[i] = curr; |
| 548 | 534 | } |
| r869 | r870 | |
| 552 | 538 | { |
| 553 | 539 | default: |
| 554 | 540 | case 0: |
| 555 | | return diff[0] & 0xff; |
| 541 | return (diff[0] & 0xff) | ((diff[2] & 0xff) << 8); |
| 556 | 542 | case 1: |
| 557 | | return diff[2] & 0xff; |
| 543 | return ((diff[0] >> 8) & 0x1f) | (diff[2] & 0x1f00) | (readinputport(0) & 0xe0e0); |
| 558 | 544 | case 2: |
| 559 | | return ((diff[0] >> 8) & 0x1f) | (readinputport(0) & 0xe0); |
| 545 | return (diff[1] & 0xff) | ((diff[3] & 0xff) << 8); |
| 560 | 546 | case 3: |
| 561 | | return ((diff[2] >> 8) & 0x1f) | (readinputport(1) & 0xe0); |
| 562 | | case 4: |
| 563 | | return diff[1] & 0xff; |
| 564 | | case 5: |
| 565 | | return diff[3] & 0xff; |
| 566 | | case 6: |
| 567 | | return ((diff[1] >> 8) & 0x1f); |
| 568 | | case 7: |
| 569 | | return ((diff[3] >> 8) & 0x1f); |
| 547 | return ((diff[1] >> 8) & 0x1f) | (diff[3] & 0x1f00); |
| 570 | 548 | } |
| 571 | 549 | } |
| 572 | 550 | |
| 573 | 551 | |
| 574 | | #define CPU1_MEMORY(NAME,ROMSIZE,WORKRAM) \ |
| 575 | | static ADDRESS_MAP_START( NAME##_readmem, ADDRESS_SPACE_PROGRAM, 8 ) \ |
| 576 | | AM_RANGE(0x00000, ROMSIZE-1) AM_READ(MRA8_ROM) \ |
| 577 | | AM_RANGE(WORKRAM, WORKRAM+0x3fff) AM_READ(MRA8_RAM) \ |
| 578 | | AM_RANGE(0xc0000, 0xc03ff) AM_READ(MRA8_RAM) \ |
| 579 | | AM_RANGE(0xc8000, 0xc8bff) AM_READ(m72_palette1_r) \ |
| 580 | | AM_RANGE(0xcc000, 0xccbff) AM_READ(m72_palette2_r) \ |
| 581 | | AM_RANGE(0xd0000, 0xd3fff) AM_READ(m72_videoram1_r) \ |
| 582 | | AM_RANGE(0xd8000, 0xdbfff) AM_READ(m72_videoram2_r) \ |
| 583 | | AM_RANGE(0xe0000, 0xeffff) AM_READ(soundram_r) \ |
| 552 | #define CPU1_MEMORY(NAME,ROMSIZE,WORKRAM) \ |
| 553 | static ADDRESS_MAP_START( NAME##_map, ADDRESS_SPACE_PROGRAM, 16 ) \ |
| 554 | AM_RANGE(0x00000, ROMSIZE-1) AM_ROM \ |
| 555 | AM_RANGE(WORKRAM, WORKRAM+0x3fff) AM_RAM /* work RAM */ \ |
| 556 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) \ |
| 557 | AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) \ |
| 558 | AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) \ |
| 559 | AM_RANGE(0xd0000, 0xd3fff) AM_READWRITE(MRA16_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) \ |
| 560 | AM_RANGE(0xd8000, 0xdbfff) AM_READWRITE(MRA16_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) \ |
| 561 | AM_RANGE(0xe0000, 0xeffff) AM_READWRITE(soundram_r, soundram_w) \ |
| 584 | 562 | AM_RANGE(0xffff0, 0xfffff) AM_ROM \ |
| 585 | | ADDRESS_MAP_END \ |
| 586 | | \ |
| 587 | | static ADDRESS_MAP_START( NAME##_writemem, ADDRESS_SPACE_PROGRAM, 8 ) \ |
| 588 | | AM_RANGE(0x00000, ROMSIZE-1) AM_WRITE(MWA8_ROM) \ |
| 589 | | AM_RANGE(WORKRAM, WORKRAM+0x3fff) AM_WRITE(MWA8_RAM) /* work RAM */ \ |
| 590 | | AM_RANGE(0xc0000, 0xc03ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) \ |
| 591 | | AM_RANGE(0xc8000, 0xc8bff) AM_WRITE(m72_palette1_w) AM_BASE(&paletteram) \ |
| 592 | | AM_RANGE(0xcc000, 0xccbff) AM_WRITE(m72_palette2_w) AM_BASE(&paletteram_2) \ |
| 593 | | AM_RANGE(0xd0000, 0xd3fff) AM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) \ |
| 594 | | AM_RANGE(0xd8000, 0xdbfff) AM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) \ |
| 595 | | AM_RANGE(0xe0000, 0xeffff) AM_WRITE(soundram_w) \ |
| 596 | 563 | ADDRESS_MAP_END |
| 597 | 564 | |
| 598 | 565 | |
| r869 | r870 | |
| 602 | 569 | CPU1_MEMORY( xmultipl, 0x80000, 0x80000 ) |
| 603 | 570 | CPU1_MEMORY( dbreed72, 0x80000, 0x90000 ) |
| 604 | 571 | |
| 605 | | static ADDRESS_MAP_START( dbreed_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 606 | | AM_RANGE(0x00000, 0x7ffff) AM_READ(MRA8_ROM) |
| 607 | | AM_RANGE(0x88000, 0x8bfff) AM_READ(MRA8_RAM) |
| 608 | | AM_RANGE(0xc0000, 0xc03ff) AM_READ(MRA8_RAM) |
| 609 | | AM_RANGE(0xc8000, 0xc8bff) AM_READ(m72_palette1_r) |
| 610 | | AM_RANGE(0xcc000, 0xccbff) AM_READ(m72_palette2_r) |
| 611 | | AM_RANGE(0xd0000, 0xd3fff) AM_READ(m72_videoram1_r) |
| 612 | | AM_RANGE(0xd8000, 0xdbfff) AM_READ(m72_videoram2_r) |
| 572 | static ADDRESS_MAP_START( dbreed_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 573 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 574 | AM_RANGE(0x88000, 0x8bfff) AM_RAM /* work RAM */ |
| 575 | AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITE(MWA16_RAM) /* leftover from protection?? */ |
| 576 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 577 | AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) |
| 578 | AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) |
| 579 | AM_RANGE(0xd0000, 0xd3fff) AM_READWRITE(MRA16_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 580 | AM_RANGE(0xd8000, 0xdbfff) AM_READWRITE(MRA16_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) |
| 613 | 581 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 614 | 582 | ADDRESS_MAP_END |
| 615 | 583 | |
| 616 | | static ADDRESS_MAP_START( dbreed_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 617 | | AM_RANGE(0x00000, 0x7ffff) AM_WRITE(MWA8_ROM) |
| 618 | | AM_RANGE(0x88000, 0x8bfff) AM_WRITE(MWA8_RAM) /* work RAM */ |
| 619 | | AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITE(MWA8_RAM) /* leftover from protection?? */ |
| 620 | | AM_RANGE(0xc0000, 0xc03ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 621 | | AM_RANGE(0xc8000, 0xc8bff) AM_WRITE(m72_palette1_w) AM_BASE(&paletteram) |
| 622 | | AM_RANGE(0xcc000, 0xccbff) AM_WRITE(m72_palette2_w) AM_BASE(&paletteram_2) |
| 623 | | AM_RANGE(0xd0000, 0xd3fff) AM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 624 | | AM_RANGE(0xd8000, 0xdbfff) AM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) |
| 625 | | ADDRESS_MAP_END |
| 626 | | |
| 627 | | static ADDRESS_MAP_START( rtype2_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 628 | | AM_RANGE(0x00000, 0x7ffff) AM_READ(MRA8_ROM) |
| 629 | | AM_RANGE(0xc0000, 0xc03ff) AM_READ(MRA8_RAM) |
| 630 | | AM_RANGE(0xc8000, 0xc8bff) AM_READ(m72_palette1_r) |
| 631 | | AM_RANGE(0xd0000, 0xd3fff) AM_READ(m72_videoram1_r) |
| 632 | | AM_RANGE(0xd4000, 0xd7fff) AM_READ(m72_videoram2_r) |
| 633 | | AM_RANGE(0xd8000, 0xd8bff) AM_READ(m72_palette2_r) |
| 634 | | AM_RANGE(0xe0000, 0xe3fff) AM_READ(MRA8_RAM) |
| 635 | | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 636 | | ADDRESS_MAP_END |
| 637 | | |
| 638 | | static ADDRESS_MAP_START( rtype2_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 639 | | AM_RANGE(0x00000, 0x7ffff) AM_WRITE(MWA8_ROM) |
| 584 | static ADDRESS_MAP_START( rtype2_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 585 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 640 | 586 | AM_RANGE(0xb0000, 0xb0001) AM_WRITE(m72_irq_line_w) |
| 641 | 587 | AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w) |
| 642 | | AM_RANGE(0xc0000, 0xc03ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 643 | | AM_RANGE(0xc8000, 0xc8bff) AM_WRITE(m72_palette1_w) AM_BASE(&paletteram) |
| 644 | | AM_RANGE(0xd0000, 0xd3fff) AM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 645 | | AM_RANGE(0xd4000, 0xd7fff) AM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) |
| 646 | | AM_RANGE(0xd8000, 0xd8bff) AM_WRITE(m72_palette2_w) AM_BASE(&paletteram_2) |
| 647 | | AM_RANGE(0xe0000, 0xe3fff) AM_WRITE(MWA8_RAM) /* work RAM */ |
| 648 | | ADDRESS_MAP_END |
| 649 | | |
| 650 | | static ADDRESS_MAP_START( majtitle_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 651 | | AM_RANGE(0x00000, 0x7ffff) AM_READ(MRA8_ROM) |
| 652 | | AM_RANGE(0xa0000, 0xa03ff) AM_READ(MRA8_RAM) |
| 653 | | AM_RANGE(0xa4000, 0xa4bff) AM_READ(m72_palette2_r) |
| 654 | | AM_RANGE(0xac000, 0xaffff) AM_READ(m72_videoram1_r) |
| 655 | | AM_RANGE(0xb0000, 0xbffff) AM_READ(m72_videoram2_r) |
| 656 | | AM_RANGE(0xc0000, 0xc03ff) AM_READ(MRA8_RAM) |
| 657 | | AM_RANGE(0xc8000, 0xc83ff) AM_READ(MRA8_RAM) |
| 658 | | AM_RANGE(0xcc000, 0xccbff) AM_READ(m72_palette1_r) |
| 659 | | AM_RANGE(0xd0000, 0xd3fff) AM_READ(MRA8_RAM) |
| 588 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 589 | AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) |
| 590 | AM_RANGE(0xd0000, 0xd3fff) AM_READWRITE(MRA16_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 591 | AM_RANGE(0xd4000, 0xd7fff) AM_READWRITE(MRA16_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) |
| 592 | AM_RANGE(0xd8000, 0xd8bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) |
| 593 | AM_RANGE(0xe0000, 0xe3fff) AM_RAM /* work RAM */ |
| 660 | 594 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 661 | 595 | ADDRESS_MAP_END |
| 662 | 596 | |
| 663 | | static ADDRESS_MAP_START( majtitle_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 664 | | AM_RANGE(0x00000, 0x7ffff) AM_WRITE(MWA8_ROM) |
| 665 | | AM_RANGE(0xa0000, 0xa03ff) AM_WRITE(MWA8_RAM) AM_BASE(&majtitle_rowscrollram) |
| 666 | | AM_RANGE(0xa4000, 0xa4bff) AM_WRITE(m72_palette2_w) AM_BASE(&paletteram_2) |
| 667 | | AM_RANGE(0xac000, 0xaffff) AM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 668 | | AM_RANGE(0xb0000, 0xbffff) AM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) /* larger than the other games */ |
| 669 | | AM_RANGE(0xc0000, 0xc03ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 670 | | AM_RANGE(0xc8000, 0xc83ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram_2) |
| 671 | | AM_RANGE(0xcc000, 0xccbff) AM_WRITE(m72_palette1_w) AM_BASE(&paletteram) |
| 672 | | AM_RANGE(0xd0000, 0xd3fff) AM_WRITE(MWA8_RAM) /* work RAM */ |
| 597 | static ADDRESS_MAP_START( majtitle_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 598 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 599 | AM_RANGE(0xa0000, 0xa03ff) AM_RAM AM_BASE(&majtitle_rowscrollram) |
| 600 | AM_RANGE(0xa4000, 0xa4bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) |
| 601 | AM_RANGE(0xac000, 0xaffff) AM_READWRITE(MRA16_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 602 | AM_RANGE(0xb0000, 0xbffff) AM_READWRITE(MRA16_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) /* larger than the other games */ |
| 603 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 604 | AM_RANGE(0xc8000, 0xc83ff) AM_RAM AM_BASE(&spriteram16_2) |
| 605 | AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) |
| 606 | AM_RANGE(0xd0000, 0xd3fff) AM_RAM /* work RAM */ |
| 673 | 607 | AM_RANGE(0xe0000, 0xe0001) AM_WRITE(m72_irq_line_w) |
| 674 | | AM_RANGE(0xe4000, 0xe4001) AM_WRITE(MWA8_RAM) /* playfield enable? 1 during screen transitions, 0 otherwise */ |
| 608 | AM_RANGE(0xe4000, 0xe4001) AM_WRITE(MWA16_RAM) /* playfield enable? 1 during screen transitions, 0 otherwise */ |
| 675 | 609 | AM_RANGE(0xec000, 0xec001) AM_WRITE(m72_dmaon_w) |
| 676 | | ADDRESS_MAP_END |
| 677 | | |
| 678 | | static ADDRESS_MAP_START( hharry_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 679 | | AM_RANGE(0x00000, 0x7ffff) AM_READ(MRA8_ROM) |
| 680 | | AM_RANGE(0xa0000, 0xa3fff) AM_READ(MRA8_RAM) |
| 681 | | AM_RANGE(0xc0000, 0xc03ff) AM_READ(MRA8_RAM) |
| 682 | | AM_RANGE(0xc8000, 0xc8bff) AM_READ(m72_palette1_r) |
| 683 | | AM_RANGE(0xcc000, 0xccbff) AM_READ(m72_palette2_r) |
| 684 | | AM_RANGE(0xd0000, 0xd3fff) AM_READ(m72_videoram1_r) |
| 685 | | AM_RANGE(0xd8000, 0xdbfff) AM_READ(m72_videoram2_r) |
| 686 | 610 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 687 | 611 | ADDRESS_MAP_END |
| 688 | 612 | |
| 689 | | static ADDRESS_MAP_START( hharry_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 690 | | AM_RANGE(0x00000, 0x7ffff) AM_WRITE(MWA8_ROM) |
| 691 | | AM_RANGE(0xa0000, 0xa3fff) AM_WRITE(MWA8_RAM) /* work RAM */ |
| 692 | | AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITE(MWA8_RAM) /* leftover from protection?? */ |
| 693 | | AM_RANGE(0xc0000, 0xc03ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 694 | | AM_RANGE(0xc8000, 0xc8bff) AM_WRITE(m72_palette1_w) AM_BASE(&paletteram) |
| 695 | | AM_RANGE(0xcc000, 0xccbff) AM_WRITE(m72_palette2_w) AM_BASE(&paletteram_2) |
| 696 | | AM_RANGE(0xd0000, 0xd3fff) AM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 697 | | AM_RANGE(0xd8000, 0xdbfff) AM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) |
| 698 | | ADDRESS_MAP_END |
| 699 | | |
| 700 | | static ADDRESS_MAP_START( hharryu_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 701 | | AM_RANGE(0x00000, 0x7ffff) AM_READ(MRA8_ROM) |
| 702 | | AM_RANGE(0xa0000, 0xa0bff) AM_READ(m72_palette1_r) |
| 703 | | AM_RANGE(0xa8000, 0xa8bff) AM_READ(m72_palette2_r) |
| 704 | | AM_RANGE(0xc0000, 0xc03ff) AM_READ(MRA8_RAM) |
| 705 | | AM_RANGE(0xd0000, 0xd3fff) AM_READ(m72_videoram1_r) |
| 706 | | AM_RANGE(0xd4000, 0xd7fff) AM_READ(m72_videoram2_r) |
| 707 | | AM_RANGE(0xe0000, 0xe3fff) AM_READ(MRA8_RAM) |
| 613 | static ADDRESS_MAP_START( hharry_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 614 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 615 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM /* work RAM */ |
| 616 | AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITE(MWA16_RAM) /* leftover from protection?? */ |
| 617 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 618 | AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) |
| 619 | AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) |
| 620 | AM_RANGE(0xd0000, 0xd3fff) AM_READWRITE(MRA16_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 621 | AM_RANGE(0xd8000, 0xdbfff) AM_READWRITE(MRA16_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) |
| 708 | 622 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 709 | 623 | ADDRESS_MAP_END |
| 710 | 624 | |
| 711 | | static ADDRESS_MAP_START( hharryu_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 712 | | AM_RANGE(0x00000, 0x7ffff) AM_WRITE(MWA8_ROM) |
| 713 | | AM_RANGE(0xa0000, 0xa0bff) AM_WRITE(m72_palette1_w) AM_BASE(&paletteram) |
| 714 | | AM_RANGE(0xa8000, 0xa8bff) AM_WRITE(m72_palette2_w) AM_BASE(&paletteram_2) |
| 625 | static ADDRESS_MAP_START( hharryu_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 626 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 627 | AM_RANGE(0xa0000, 0xa0bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) |
| 628 | AM_RANGE(0xa8000, 0xa8bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) |
| 715 | 629 | AM_RANGE(0xb0000, 0xb0001) AM_WRITE(m72_irq_line_w) |
| 716 | 630 | AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w) |
| 717 | | AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITE(MWA8_RAM) /* leftover from protection?? */ |
| 718 | | AM_RANGE(0xc0000, 0xc03ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 719 | | AM_RANGE(0xd0000, 0xd3fff) AM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 720 | | AM_RANGE(0xd4000, 0xd7fff) AM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) |
| 721 | | AM_RANGE(0xe0000, 0xe3fff) AM_WRITE(MWA8_RAM) /* work RAM */ |
| 722 | | ADDRESS_MAP_END |
| 723 | | |
| 724 | | static ADDRESS_MAP_START( kengo_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 725 | | AM_RANGE(0x00000, 0x7ffff) AM_READ(MRA8_ROM) |
| 726 | | AM_RANGE(0xa0000, 0xa0bff) AM_READ(m72_palette1_r) |
| 727 | | AM_RANGE(0xa8000, 0xa8bff) AM_READ(m72_palette2_r) |
| 728 | | AM_RANGE(0xc0000, 0xc03ff) AM_READ(MRA8_RAM) |
| 729 | | AM_RANGE(0x80000, 0x83fff) AM_READ(m72_videoram1_r) |
| 730 | | AM_RANGE(0x84000, 0x87fff) AM_READ(m72_videoram2_r) |
| 731 | | AM_RANGE(0xe0000, 0xe3fff) AM_READ(MRA8_RAM) |
| 631 | AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITE(MWA16_RAM) /* leftover from protection?? */ |
| 632 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 633 | AM_RANGE(0xd0000, 0xd3fff) AM_READWRITE(MRA16_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 634 | AM_RANGE(0xd4000, 0xd7fff) AM_READWRITE(MRA16_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) |
| 635 | AM_RANGE(0xe0000, 0xe3fff) AM_RAM /* work RAM */ |
| 732 | 636 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 733 | 637 | ADDRESS_MAP_END |
| 734 | 638 | |
| 735 | | static ADDRESS_MAP_START( kengo_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 736 | | AM_RANGE(0x00000, 0x7ffff) AM_WRITE(MWA8_ROM) |
| 737 | | AM_RANGE(0xa0000, 0xa0bff) AM_WRITE(m72_palette1_w) AM_BASE(&paletteram) |
| 738 | | AM_RANGE(0xa8000, 0xa8bff) AM_WRITE(m72_palette2_w) AM_BASE(&paletteram_2) |
| 639 | static ADDRESS_MAP_START( kengo_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 640 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 641 | AM_RANGE(0xa0000, 0xa0bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_BASE(&paletteram16) |
| 642 | AM_RANGE(0xa8000, 0xa8bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_BASE(&paletteram16_2) |
| 739 | 643 | AM_RANGE(0xb0000, 0xb0001) AM_WRITE(m72_irq_line_w) |
| 740 | | AM_RANGE(0xb4000, 0xb4001) AM_WRITE(MWA8_NOP) /* ??? */ |
| 644 | AM_RANGE(0xb4000, 0xb4001) AM_WRITE(MWA16_NOP) /* ??? */ |
| 741 | 645 | AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w) |
| 742 | | AM_RANGE(0xc0000, 0xc03ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 743 | | AM_RANGE(0x80000, 0x83fff) AM_WRITE(m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 744 | | AM_RANGE(0x84000, 0x87fff) AM_WRITE(m72_videoram2_w) AM_BASE(&m72_videoram2) |
| 745 | | AM_RANGE(0xe0000, 0xe3fff) AM_WRITE(MWA8_RAM) /* work RAM */ |
| 646 | AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 647 | AM_RANGE(0x80000, 0x83fff) AM_READWRITE(MRA16_RAM, m72_videoram1_w) AM_BASE(&m72_videoram1) |
| 648 | AM_RANGE(0x84000, 0x87fff) AM_READWRITE(MRA16_RAM, m72_videoram2_w) AM_BASE(&m72_videoram2) |
| 649 | AM_RANGE(0xe0000, 0xe3fff) AM_RAM /* work RAM */ |
| 650 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 746 | 651 | ADDRESS_MAP_END |
| 747 | 652 | |
| 748 | | static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 ) |
| 749 | | AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r) |
| 750 | | AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r) |
| 751 | | AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r) |
| 752 | | AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r) |
| 753 | | AM_RANGE(0x04, 0x04) AM_READ(input_port_4_r) |
| 754 | | AM_RANGE(0x05, 0x05) AM_READ(input_port_5_r) |
| 755 | | ADDRESS_MAP_END |
| 756 | | |
| 757 | | static ADDRESS_MAP_START( poundfor_readport, ADDRESS_SPACE_IO, 8 ) |
| 758 | | AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r) |
| 759 | | AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r) |
| 760 | | AM_RANGE(0x04, 0x04) AM_READ(input_port_4_r) |
| 761 | | AM_RANGE(0x05, 0x05) AM_READ(input_port_5_r) |
| 762 | | AM_RANGE(0x08, 0x0f) AM_READ(poundfor_trackball_r) |
| 763 | | ADDRESS_MAP_END |
| 764 | | |
| 765 | | |
| 766 | | static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 ) |
| 653 | static ADDRESS_MAP_START( m72_portmap, ADDRESS_SPACE_IO, 16 ) |
| 654 | AM_RANGE(0x00, 0x01) AM_READ(input_port_0_word_r) |
| 655 | AM_RANGE(0x02, 0x03) AM_READ(input_port_1_word_r) |
| 656 | AM_RANGE(0x04, 0x05) AM_READ(input_port_2_word_r) |
| 767 | 657 | AM_RANGE(0x00, 0x01) AM_WRITE(m72_sound_command_w) |
| 768 | 658 | AM_RANGE(0x02, 0x03) AM_WRITE(m72_port02_w) /* coin counters, reset sound cpu, other stuff? */ |
| 769 | 659 | AM_RANGE(0x04, 0x05) AM_WRITE(m72_dmaon_w) |
| 770 | 660 | AM_RANGE(0x06, 0x07) AM_WRITE(m72_irq_line_w) |
| 771 | | AM_RANGE(0x40, 0x43) AM_WRITE(MWA8_NOP) /* Interrupt controller, only written to at bootup */ |
| 661 | AM_RANGE(0x40, 0x43) AM_WRITE(MWA16_NOP) /* Interrupt controller, only written to at bootup */ |
| 772 | 662 | AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) |
| 773 | 663 | AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w) |
| 774 | 664 | AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w) |
| r869 | r870 | |
| 776 | 666 | /* { 0xc0, 0xc0 trigger sample, filled by init_ function */ |
| 777 | 667 | ADDRESS_MAP_END |
| 778 | 668 | |
| 779 | | static ADDRESS_MAP_START( xmultipl_writeport, ADDRESS_SPACE_IO, 8 ) |
| 669 | static ADDRESS_MAP_START( rtype2_portmap, ADDRESS_SPACE_IO, 16 ) |
| 670 | AM_RANGE(0x00, 0x01) AM_READ(input_port_0_word_r) |
| 671 | AM_RANGE(0x02, 0x03) AM_READ(input_port_1_word_r) |
| 672 | AM_RANGE(0x04, 0x05) AM_READ(input_port_2_word_r) |
| 780 | 673 | AM_RANGE(0x00, 0x01) AM_WRITE(m72_sound_command_w) |
| 781 | | AM_RANGE(0x02, 0x03) AM_WRITE(m72_port02_w) /* coin counters, reset sound cpu, other stuff? */ |
| 782 | | AM_RANGE(0x04, 0x05) AM_WRITE(m72_dmaon_w) |
| 783 | | AM_RANGE(0x06, 0x07) AM_WRITE(m72_irq_line_w) |
| 784 | | AM_RANGE(0x40, 0x43) AM_WRITE(MWA8_NOP) /* Interrupt controller, only written to at bootup */ |
| 674 | AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w) |
| 675 | AM_RANGE(0x40, 0x43) AM_WRITE(MWA16_NOP) /* Interrupt controller, only written to at bootup */ |
| 785 | 676 | AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) |
| 786 | 677 | AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w) |
| 787 | 678 | AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w) |
| 788 | 679 | AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w) |
| 789 | | /* { 0xc0, 0xc0 trigger sample, filled by init_ function */ |
| 790 | 680 | ADDRESS_MAP_END |
| 791 | 681 | |
| 792 | | static ADDRESS_MAP_START( rtype2_writeport, ADDRESS_SPACE_IO, 8 ) |
| 682 | static ADDRESS_MAP_START( poundfor_portmap, ADDRESS_SPACE_IO, 16 ) |
| 683 | AM_RANGE(0x02, 0x03) AM_READ(input_port_1_word_r) |
| 684 | AM_RANGE(0x04, 0x05) AM_READ(input_port_2_word_r) |
| 685 | AM_RANGE(0x08, 0x0f) AM_READ(poundfor_trackball_r) |
| 793 | 686 | AM_RANGE(0x00, 0x01) AM_WRITE(m72_sound_command_w) |
| 794 | 687 | AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w) |
| 795 | | AM_RANGE(0x40, 0x43) AM_WRITE(MWA8_NOP) /* Interrupt controller, only written to at bootup */ |
| 688 | AM_RANGE(0x40, 0x43) AM_WRITE(MWA16_NOP) /* Interrupt controller, only written to at bootup */ |
| 796 | 689 | AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) |
| 797 | 690 | AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w) |
| 798 | 691 | AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w) |
| 799 | 692 | AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w) |
| 800 | 693 | ADDRESS_MAP_END |
| 801 | 694 | |
| 802 | | static ADDRESS_MAP_START( majtitle_writeport, ADDRESS_SPACE_IO, 8 ) |
| 695 | static ADDRESS_MAP_START( majtitle_portmap, ADDRESS_SPACE_IO, 16 ) |
| 696 | AM_RANGE(0x00, 0x01) AM_READ(input_port_0_word_r) |
| 697 | AM_RANGE(0x02, 0x03) AM_READ(input_port_1_word_r) |
| 698 | AM_RANGE(0x04, 0x05) AM_READ(input_port_2_word_r) |
| 803 | 699 | AM_RANGE(0x00, 0x01) AM_WRITE(m72_sound_command_w) |
| 804 | 700 | AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w) |
| 805 | | AM_RANGE(0x40, 0x43) AM_WRITE(MWA8_NOP) /* Interrupt controller, only written to at bootup */ |
| 701 | AM_RANGE(0x40, 0x43) AM_WRITE(MWA16_NOP) /* Interrupt controller, only written to at bootup */ |
| 806 | 702 | AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) |
| 807 | 703 | AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w) |
| 808 | 704 | AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w) |
| r869 | r870 | |
| 810 | 706 | AM_RANGE(0x8e, 0x8f) AM_WRITE(majtitle_gfx_ctrl_w) |
| 811 | 707 | ADDRESS_MAP_END |
| 812 | 708 | |
| 813 | | static ADDRESS_MAP_START( hharry_writeport, ADDRESS_SPACE_IO, 8 ) |
| 709 | static ADDRESS_MAP_START( hharry_portmap, ADDRESS_SPACE_IO, 16 ) |
| 710 | AM_RANGE(0x00, 0x01) AM_READ(input_port_0_word_r) |
| 711 | AM_RANGE(0x02, 0x03) AM_READ(input_port_1_word_r) |
| 712 | AM_RANGE(0x04, 0x05) AM_READ(input_port_2_word_r) |
| 814 | 713 | AM_RANGE(0x00, 0x01) AM_WRITE(m72_sound_command_w) |
| 815 | 714 | AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w) /* coin counters, reset sound cpu, other stuff? */ |
| 816 | 715 | AM_RANGE(0x04, 0x05) AM_WRITE(m72_dmaon_w) |
| 817 | 716 | AM_RANGE(0x06, 0x07) AM_WRITE(m72_irq_line_w) |
| 818 | | AM_RANGE(0x40, 0x43) AM_WRITE(MWA8_NOP) /* Interrupt controller, only written to at bootup */ |
| 717 | AM_RANGE(0x40, 0x43) AM_WRITE(MWA16_NOP) /* Interrupt controller, only written to at bootup */ |
| 819 | 718 | AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) |
| 820 | 719 | AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w) |
| 821 | 720 | AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w) |
| 822 | 721 | AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w) |
| 823 | 722 | ADDRESS_MAP_END |
| 824 | 723 | |
| 825 | | static ADDRESS_MAP_START( kengo_writeport, ADDRESS_SPACE_IO, 8 ) |
| 724 | static ADDRESS_MAP_START( kengo_portmap, ADDRESS_SPACE_IO, 16 ) |
| 725 | AM_RANGE(0x00, 0x01) AM_READ(input_port_0_word_r) |
| 726 | AM_RANGE(0x02, 0x03) AM_READ(input_port_1_word_r) |
| 727 | AM_RANGE(0x04, 0x05) AM_READ(input_port_2_word_r) |
| 826 | 728 | AM_RANGE(0x00, 0x01) AM_WRITE(m72_sound_command_w) |
| 827 | 729 | AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w) |
| 828 | 730 | AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) |
| r869 | r870 | |
| 842 | 744 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 843 | 745 | ADDRESS_MAP_END |
| 844 | 746 | |
| 845 | | static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 ) |
| 747 | static ADDRESS_MAP_START( sound_portmap, ADDRESS_SPACE_IO, 8 ) |
| 846 | 748 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 847 | | AM_RANGE(0x01, 0x01) AM_READ(YM2151_status_port_0_r) |
| 848 | | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_r) |
| 849 | | AM_RANGE(0x84, 0x84) AM_READ(m72_sample_r) |
| 850 | | ADDRESS_MAP_END |
| 851 | | |
| 852 | | static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 ) |
| 853 | | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 854 | 749 | AM_RANGE(0x00, 0x00) AM_WRITE(YM2151_register_port_0_w) |
| 855 | | AM_RANGE(0x01, 0x01) AM_WRITE(YM2151_data_port_0_w) |
| 750 | AM_RANGE(0x01, 0x01) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) |
| 751 | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_r) |
| 856 | 752 | AM_RANGE(0x06, 0x06) AM_WRITE(m72_sound_irq_ack_w) |
| 857 | 753 | AM_RANGE(0x82, 0x82) AM_WRITE(m72_sample_w) |
| 858 | | ADDRESS_MAP_END |
| 859 | | |
| 860 | | static ADDRESS_MAP_START( rtype2_sound_readport, ADDRESS_SPACE_IO, 8 ) |
| 861 | | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 862 | | AM_RANGE(0x01, 0x01) AM_READ(YM2151_status_port_0_r) |
| 863 | | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r) |
| 864 | 754 | AM_RANGE(0x84, 0x84) AM_READ(m72_sample_r) |
| 865 | 755 | ADDRESS_MAP_END |
| 866 | 756 | |
| 867 | | static ADDRESS_MAP_START( rtype2_sound_writeport, ADDRESS_SPACE_IO, 8 ) |
| 757 | static ADDRESS_MAP_START( rtype2_sound_portmap, ADDRESS_SPACE_IO, 8 ) |
| 868 | 758 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 869 | 759 | AM_RANGE(0x00, 0x00) AM_WRITE(YM2151_register_port_0_w) |
| 870 | | AM_RANGE(0x01, 0x01) AM_WRITE(YM2151_data_port_0_w) |
| 760 | AM_RANGE(0x01, 0x01) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) |
| 761 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r) |
| 871 | 762 | AM_RANGE(0x80, 0x81) AM_WRITE(rtype2_sample_addr_w) |
| 872 | 763 | AM_RANGE(0x82, 0x82) AM_WRITE(m72_sample_w) |
| 873 | 764 | AM_RANGE(0x83, 0x83) AM_WRITE(m72_sound_irq_ack_w) |
| 765 | AM_RANGE(0x84, 0x84) AM_READ(m72_sample_r) |
| 874 | 766 | ADDRESS_MAP_END |
| 875 | 767 | |
| 876 | | static ADDRESS_MAP_START( poundfor_sound_readport, ADDRESS_SPACE_IO, 8 ) |
| 768 | static ADDRESS_MAP_START( poundfor_sound_portmap, ADDRESS_SPACE_IO, 8 ) |
| 877 | 769 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 878 | | AM_RANGE(0x41, 0x41) AM_READ(YM2151_status_port_0_r) |
| 879 | | AM_RANGE(0x42, 0x42) AM_READ(soundlatch_r) |
| 880 | | ADDRESS_MAP_END |
| 881 | | |
| 882 | | static ADDRESS_MAP_START( poundfor_sound_writeport, ADDRESS_SPACE_IO, 8 ) |
| 883 | | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 884 | 770 | AM_RANGE(0x10, 0x13) AM_WRITE(poundfor_sample_addr_w) |
| 885 | 771 | AM_RANGE(0x40, 0x40) AM_WRITE(YM2151_register_port_0_w) |
| 886 | | AM_RANGE(0x41, 0x41) AM_WRITE(YM2151_data_port_0_w) |
| 772 | AM_RANGE(0x41, 0x41) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) |
| 773 | AM_RANGE(0x42, 0x42) AM_READ(soundlatch_r) |
| 887 | 774 | AM_RANGE(0x42, 0x42) AM_WRITE(m72_sound_irq_ack_w) |
| 888 | 775 | ADDRESS_MAP_END |
| 889 | 776 | |
| 890 | 777 | |
| 891 | 778 | |
| 892 | 779 | #define JOYSTICK_1 \ |
| 893 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY \ |
| 894 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY \ |
| 895 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY \ |
| 896 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 780 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY \ |
| 781 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY \ |
| 782 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY \ |
| 783 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 897 | 784 | |
| 898 | 785 | #define JOYSTICK_2 \ |
| 899 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL \ |
| 900 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL \ |
| 901 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL \ |
| 902 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL |
| 786 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL \ |
| 787 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL \ |
| 788 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL \ |
| 789 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL |
| 903 | 790 | |
| 904 | 791 | #define COIN_MODE_1 \ |
| 905 | | PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) \ |
| 906 | | PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) \ |
| 907 | | PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) ) \ |
| 908 | | PORT_DIPSETTING( 0xc0, DEF_STR( 4C_1C ) ) \ |
| 909 | | PORT_DIPSETTING( 0xd0, DEF_STR( 3C_1C ) ) \ |
| 910 | | PORT_DIPSETTING( 0x10, DEF_STR( 8C_3C ) ) \ |
| 911 | | PORT_DIPSETTING( 0xe0, DEF_STR( 2C_1C ) ) \ |
| 912 | | PORT_DIPSETTING( 0x20, DEF_STR( 5C_3C ) ) \ |
| 913 | | PORT_DIPSETTING( 0x30, DEF_STR( 3C_2C ) ) \ |
| 914 | | PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) \ |
| 915 | | PORT_DIPSETTING( 0x40, DEF_STR( 2C_3C ) ) \ |
| 916 | | PORT_DIPSETTING( 0x90, DEF_STR( 1C_2C ) ) \ |
| 917 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) \ |
| 918 | | PORT_DIPSETTING( 0x70, DEF_STR( 1C_4C ) ) \ |
| 919 | | PORT_DIPSETTING( 0x60, DEF_STR( 1C_5C ) ) \ |
| 920 | | PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) ) \ |
| 921 | | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 792 | PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coinage ) ) \ |
| 793 | PORT_DIPSETTING( 0x00a0, DEF_STR( 6C_1C ) ) \ |
| 794 | PORT_DIPSETTING( 0x00b0, DEF_STR( 5C_1C ) ) \ |
| 795 | PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) \ |
| 796 | PORT_DIPSETTING( 0x00d0, DEF_STR( 3C_1C ) ) \ |
| 797 | PORT_DIPSETTING( 0x0010, DEF_STR( 8C_3C ) ) \ |
| 798 | PORT_DIPSETTING( 0x00e0, DEF_STR( 2C_1C ) ) \ |
| 799 | PORT_DIPSETTING( 0x0020, DEF_STR( 5C_3C ) ) \ |
| 800 | PORT_DIPSETTING( 0x0030, DEF_STR( 3C_2C ) ) \ |
| 801 | PORT_DIPSETTING( 0x00f0, DEF_STR( 1C_1C ) ) \ |
| 802 | PORT_DIPSETTING( 0x0040, DEF_STR( 2C_3C ) ) \ |
| 803 | PORT_DIPSETTING( 0x0090, DEF_STR( 1C_2C ) ) \ |
| 804 | PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) \ |
| 805 | PORT_DIPSETTING( 0x0070, DEF_STR( 1C_4C ) ) \ |
| 806 | PORT_DIPSETTING( 0x0060, DEF_STR( 1C_5C ) ) \ |
| 807 | PORT_DIPSETTING( 0x0050, DEF_STR( 1C_6C ) ) \ |
| 808 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 922 | 809 | |
| 923 | 810 | #define COIN_MODE_2 \ |
| 924 | | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) \ |
| 925 | | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) \ |
| 926 | | PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) \ |
| 927 | | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) \ |
| 928 | | PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) \ |
| 929 | | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) \ |
| 930 | | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) \ |
| 931 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) \ |
| 932 | | PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) ) \ |
| 933 | | PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) |
| 811 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) \ |
| 812 | PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) \ |
| 813 | PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) \ |
| 814 | PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) \ |
| 815 | PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) \ |
| 816 | PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) \ |
| 817 | PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) \ |
| 818 | PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) \ |
| 819 | PORT_DIPSETTING( 0x0040, DEF_STR( 1C_5C ) ) \ |
| 820 | PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) |
| 934 | 821 | |
| 935 | 822 | |
| 936 | 823 | INPUT_PORTS_START( rtype ) |
| 937 | 824 | PORT_START |
| 938 | 825 | JOYSTICK_1 |
| 939 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 940 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 941 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 942 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 943 | | |
| 944 | | PORT_START |
| 826 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 827 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 828 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 829 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 945 | 830 | JOYSTICK_2 |
| 946 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 947 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 948 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 949 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 831 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 832 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 833 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 834 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 950 | 835 | |
| 951 | 836 | PORT_START |
| 952 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 953 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 954 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 955 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 956 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 957 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 958 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 959 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 837 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 838 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 839 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 840 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 841 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 842 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 843 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 844 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 845 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 960 | 846 | |
| 961 | 847 | PORT_START |
| 962 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 963 | | |
| 964 | | PORT_START |
| 965 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 966 | | PORT_DIPSETTING( 0x02, "2" ) |
| 967 | | PORT_DIPSETTING( 0x03, "3" ) |
| 968 | | PORT_DIPSETTING( 0x01, "4" ) |
| 969 | | PORT_DIPSETTING( 0x00, "5" ) |
| 970 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) |
| 971 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 972 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 973 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) ) |
| 974 | | PORT_DIPSETTING( 0x00, "50K 150K 250K 400K 600K" ) |
| 975 | | PORT_DIPSETTING( 0x08, "100K 200K 350K 500K 700K" ) |
| 848 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 849 | PORT_DIPSETTING( 0x0002, "2" ) |
| 850 | PORT_DIPSETTING( 0x0003, "3" ) |
| 851 | PORT_DIPSETTING( 0x0001, "4" ) |
| 852 | PORT_DIPSETTING( 0x0000, "5" ) |
| 853 | PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 854 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 855 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 856 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Bonus_Life ) ) |
| 857 | PORT_DIPSETTING( 0x0000, "50K 150K 250K 400K 600K" ) |
| 858 | PORT_DIPSETTING( 0x0008, "100K 200K 350K 500K 700K" ) |
| 976 | 859 | /* Coin Mode 1 */ |
| 977 | 860 | COIN_MODE_1 |
| 978 | 861 | /* Coin Mode 2, not supported yet */ |
| 979 | 862 | // COIN_MODE_2 |
| 980 | | |
| 981 | | PORT_START |
| 982 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 983 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 984 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 985 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) |
| 986 | | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 987 | | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) ) |
| 988 | | PORT_DIPNAME( 0x04, 0x04, "Coin Mode" ) |
| 989 | | PORT_DIPSETTING( 0x04, "Mode 1" ) |
| 990 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 991 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) ) |
| 992 | | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 993 | | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 994 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) |
| 995 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 996 | | PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) |
| 863 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 864 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 865 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 866 | PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) |
| 867 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 868 | PORT_DIPSETTING( 0x0200, DEF_STR( Cocktail ) ) |
| 869 | PORT_DIPNAME( 0x0400, 0x0400, "Coin Mode" ) |
| 870 | PORT_DIPSETTING( 0x0400, "Mode 1" ) |
| 871 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 872 | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Difficulty ) ) |
| 873 | PORT_DIPSETTING( 0x0800, DEF_STR( Normal ) ) |
| 874 | PORT_DIPSETTING( 0x0000, DEF_STR( Hard ) ) |
| 875 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) |
| 876 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 877 | PORT_DIPSETTING( 0x1000, DEF_STR( Yes ) ) |
| 997 | 878 | /* In stop mode, press 2 to stop and 1 to restart */ |
| 998 | | PORT_DIPNAME( 0x20, 0x20, "Stop Mode" ) |
| 999 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1000 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1001 | | PORT_DIPNAME( 0x40, 0x40, "Invulnerability" ) |
| 1002 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1003 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1004 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 879 | PORT_DIPNAME( 0x2000, 0x2000, "Stop Mode" ) |
| 880 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 881 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 882 | PORT_DIPNAME( 0x4000, 0x4000, "Invulnerability" ) |
| 883 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 884 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 885 | PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) |
| 1005 | 886 | INPUT_PORTS_END |
| 1006 | 887 | |
| 1007 | 888 | /* identical but Demo Sounds is inverted */ |
| 1008 | 889 | INPUT_PORTS_START( rtypep ) |
| 1009 | 890 | PORT_START |
| 1010 | 891 | JOYSTICK_1 |
| 1011 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1012 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1013 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1014 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1015 | | |
| 1016 | | PORT_START |
| 892 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 893 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 894 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 895 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1017 | 896 | JOYSTICK_2 |
| 1018 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1019 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1020 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1021 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 897 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 898 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 899 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 900 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1022 | 901 | |
| 1023 | 902 | PORT_START |
| 1024 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1025 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1026 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1027 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1028 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1029 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1030 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1031 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 903 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 904 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 905 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 906 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 907 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 908 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 909 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 910 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 911 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1032 | 912 | |
| 1033 | 913 | PORT_START |
| 1034 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1035 | | |
| 1036 | | PORT_START |
| 1037 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1038 | | PORT_DIPSETTING( 0x02, "2" ) |
| 1039 | | PORT_DIPSETTING( 0x03, "3" ) |
| 1040 | | PORT_DIPSETTING( 0x01, "4" ) |
| 1041 | | PORT_DIPSETTING( 0x00, "5" ) |
| 1042 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) |
| 1043 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1044 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1045 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) ) |
| 1046 | | PORT_DIPSETTING( 0x00, "50K 150K 250K 400K 600K" ) |
| 1047 | | PORT_DIPSETTING( 0x08, "100K 200K 350K 500K 700K" ) |
| 914 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 915 | PORT_DIPSETTING( 0x0002, "2" ) |
| 916 | PORT_DIPSETTING( 0x0003, "3" ) |
| 917 | PORT_DIPSETTING( 0x0001, "4" ) |
| 918 | PORT_DIPSETTING( 0x0000, "5" ) |
| 919 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Demo_Sounds ) ) |
| 920 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 921 | PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) |
| 922 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Bonus_Life ) ) |
| 923 | PORT_DIPSETTING( 0x0000, "50K 150K 250K 400K 600K" ) |
| 924 | PORT_DIPSETTING( 0x0008, "100K 200K 350K 500K 700K" ) |
| 1048 | 925 | /* Coin Mode 1 */ |
| 1049 | 926 | COIN_MODE_1 |
| 1050 | 927 | /* Coin Mode 2, not supported yet */ |
| 1051 | 928 | // COIN_MODE_2 |
| 1052 | | |
| 1053 | | PORT_START |
| 1054 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1055 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1056 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1057 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) |
| 1058 | | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 1059 | | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) ) |
| 1060 | | PORT_DIPNAME( 0x04, 0x04, "Coin Mode" ) |
| 1061 | | PORT_DIPSETTING( 0x04, "Mode 1" ) |
| 1062 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1063 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) ) |
| 1064 | | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 1065 | | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 1066 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) |
| 1067 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1068 | | PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) |
| 929 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 930 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 931 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 932 | PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) |
| 933 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 934 | PORT_DIPSETTING( 0x0200, DEF_STR( Cocktail ) ) |
| 935 | PORT_DIPNAME( 0x0400, 0x0400, "Coin Mode" ) |
| 936 | PORT_DIPSETTING( 0x0400, "Mode 1" ) |
| 937 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 938 | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Difficulty ) ) |
| 939 | PORT_DIPSETTING( 0x0800, DEF_STR( Normal ) ) |
| 940 | PORT_DIPSETTING( 0x0000, DEF_STR( Hard ) ) |
| 941 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) |
| 942 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 943 | PORT_DIPSETTING( 0x1000, DEF_STR( Yes ) ) |
| 1069 | 944 | /* In stop mode, press 2 to stop and 1 to restart */ |
| 1070 | | PORT_DIPNAME( 0x20, 0x20, "Stop Mode" ) |
| 1071 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1072 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1073 | | PORT_DIPNAME( 0x40, 0x40, "Invulnerability" ) |
| 1074 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1075 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1076 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 945 | PORT_DIPNAME( 0x2000, 0x2000, "Stop Mode" ) |
| 946 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 947 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 948 | PORT_DIPNAME( 0x4000, 0x4000, "Invulnerability" ) |
| 949 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 950 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 951 | PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) |
| 1077 | 952 | INPUT_PORTS_END |
| 1078 | 953 | |
| 1079 | 954 | INPUT_PORTS_START( bchopper ) |
| 1080 | 955 | PORT_START |
| 1081 | 956 | JOYSTICK_1 |
| 1082 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1083 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1084 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1085 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1086 | | |
| 1087 | | PORT_START |
| 957 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 958 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 959 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 960 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1088 | 961 | JOYSTICK_2 |
| 1089 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1090 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1091 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1092 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 962 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 963 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 964 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 965 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1093 | 966 | |
| 1094 | 967 | PORT_START |
| 1095 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1096 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1097 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1098 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1099 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1100 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1101 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1102 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 968 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 969 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 970 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 971 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 972 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 973 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 974 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 975 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 976 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1103 | 977 | |
| 1104 | 978 | PORT_START |
| 1105 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1106 | | |
| 1107 | | PORT_START |
| 1108 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1109 | | PORT_DIPSETTING( 0x00, "1" ) |
| 1110 | | PORT_DIPSETTING( 0x02, "2" ) |
| 1111 | | PORT_DIPSETTING( 0x03, "3" ) |
| 1112 | | PORT_DIPSETTING( 0x01, "4" ) |
| 1113 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) |
| 1114 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 1115 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1116 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) ) |
| 1117 | | PORT_DIPSETTING( 0x08, "80K 200K 350K" ) |
| 1118 | | PORT_DIPSETTING( 0x00, "100K 250K 400K" ) |
| 979 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 980 | PORT_DIPSETTING( 0x0000, "1" ) |
| 981 | PORT_DIPSETTING( 0x0002, "2" ) |
| 982 | PORT_DIPSETTING( 0x0003, "3" ) |
| 983 | PORT_DIPSETTING( 0x0001, "4" ) |
| 984 | PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 985 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 986 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 987 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Bonus_Life ) ) |
| 988 | PORT_DIPSETTING( 0x0008, "80K 200K 350K" ) |
| 989 | PORT_DIPSETTING( 0x0000, "100K 250K 400K" ) |
| 1119 | 990 | /* Coin Mode 1 */ |
| 1120 | 991 | COIN_MODE_1 |
| 1121 | 992 | /* Coin Mode 2, not supported yet */ |
| 1122 | 993 | // COIN_MODE_2 |
| 1123 | | |
| 1124 | | PORT_START |
| 1125 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1126 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1127 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1128 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) |
| 1129 | | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 1130 | | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) ) |
| 1131 | | PORT_DIPNAME( 0x04, 0x04, "Coin Mode" ) |
| 1132 | | PORT_DIPSETTING( 0x04, "Mode 1" ) |
| 1133 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1134 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) ) |
| 1135 | | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 1136 | | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 1137 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) |
| 1138 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1139 | | PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) |
| 994 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 995 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 996 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 997 | PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) |
| 998 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 999 | PORT_DIPSETTING( 0x0200, DEF_STR( Cocktail ) ) |
| 1000 | PORT_DIPNAME( 0x0400, 0x0400, "Coin Mode" ) |
| 1001 | PORT_DIPSETTING( 0x0400, "Mode 1" ) |
| 1002 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1003 | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Difficulty ) ) |
| 1004 | PORT_DIPSETTING( 0x0800, DEF_STR( Normal ) ) |
| 1005 | PORT_DIPSETTING( 0x0000, DEF_STR( Hard ) ) |
| 1006 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) |
| 1007 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1008 | PORT_DIPSETTING( 0x1000, DEF_STR( Yes ) ) |
| 1140 | 1009 | /* In stop mode, press 2 to stop and 1 to restart */ |
| 1141 | | PORT_DIPNAME( 0x20, 0x20, "Stop Mode" ) |
| 1142 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1143 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1144 | | PORT_DIPNAME( 0x40, 0x40, "Invulnerability" ) |
| 1145 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1146 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1147 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1010 | PORT_DIPNAME( 0x2000, 0x2000, "Stop Mode" ) |
| 1011 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 1012 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1013 | PORT_DIPNAME( 0x4000, 0x4000, "Invulnerability" ) |
| 1014 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 1015 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1016 | PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) |
| 1148 | 1017 | INPUT_PORTS_END |
| 1149 | 1018 | |
| 1150 | 1019 | INPUT_PORTS_START( nspirit ) |
| 1151 | 1020 | PORT_START |
| 1152 | 1021 | JOYSTICK_1 |
| 1153 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1154 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1155 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1156 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1157 | | |
| 1158 | | PORT_START |
| 1022 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1023 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1024 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1025 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1159 | 1026 | JOYSTICK_2 |
| 1160 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1161 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1162 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1163 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1027 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1028 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1029 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1030 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1164 | 1031 | |
| 1165 | 1032 | PORT_START |
| 1166 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1167 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1168 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1169 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1170 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1171 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1172 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1173 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1033 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 1034 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1035 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1036 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1037 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1038 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1039 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1040 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1041 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1174 | 1042 | |
| 1175 | 1043 | PORT_START |
| 1176 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1177 | | |
| 1178 | | PORT_START |
| 1179 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1180 | | PORT_DIPSETTING( 0x02, "2" ) |
| 1181 | | PORT_DIPSETTING( 0x03, "3" ) |
| 1182 | | PORT_DIPSETTING( 0x01, "4" ) |
| 1183 | | PORT_DIPSETTING( 0x00, "5" ) |
| 1184 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 1185 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 1186 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 1187 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 1188 | | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 1044 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 1045 | PORT_DIPSETTING( 0x0002, "2" ) |
| 1046 | PORT_DIPSETTING( 0x0003, "3" ) |
| 1047 | PORT_DIPSETTING( 0x0001, "4" ) |
| 1048 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1049 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 1050 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 1051 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 1052 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 1053 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 1189 | 1054 | /* Coin Mode 1 */ |
| 1190 | 1055 | COIN_MODE_1 |
| 1191 | 1056 | /* Coin Mode 2, not supported yet */ |
| 1192 | 1057 | // COIN_MODE_2 |
| 1193 | | |
| 1194 | | PORT_START |
| 1195 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1196 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1197 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1198 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) |
| 1199 | | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 1200 | | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) ) |
| 1201 | | PORT_DIPNAME( 0x04, 0x04, "Coin Mode" ) |
| 1202 | | PORT_DIPSETTING( 0x04, "Mode 1" ) |
| 1203 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1204 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) |
| 1205 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 1206 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1207 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) |
| 1208 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1209 | | PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) |
| 1058 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 1059 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 1060 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1061 | PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) |
| 1062 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 1063 | PORT_DIPSETTING( 0x0200, DEF_STR( Cocktail ) ) |
| 1064 | PORT_DIPNAME( 0x0400, 0x0400, "Coin Mode" ) |
| 1065 | PORT_DIPSETTING( 0x0400, "Mode 1" ) |
| 1066 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1067 | PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 1068 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) |
| 1069 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1070 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) |
| 1071 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1072 | PORT_DIPSETTING( 0x1000, DEF_STR( Yes ) ) |
| 1210 | 1073 | /* In stop mode, press 2 to stop and 1 to restart */ |
| 1211 | | PORT_DIPNAME( 0x20, 0x20, "Stop Mode" ) |
| 1212 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1213 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1214 | | PORT_DIPNAME( 0x40, 0x40, "Invulnerability" ) |
| 1215 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1216 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1217 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1074 | PORT_DIPNAME( 0x2000, 0x2000, "Stop Mode" ) |
| 1075 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 1076 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1077 | PORT_DIPNAME( 0x4000, 0x4000, "Invulnerability" ) |
| 1078 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 1079 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1080 | PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) |
| 1218 | 1081 | INPUT_PORTS_END |
| 1219 | 1082 | |
| 1220 | 1083 | INPUT_PORTS_START( imgfight ) |
| 1221 | 1084 | PORT_START |
| 1222 | 1085 | JOYSTICK_1 |
| 1223 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1224 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1225 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1226 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1227 | | |
| 1228 | | PORT_START |
| 1086 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1087 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1088 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1089 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1229 | 1090 | JOYSTICK_2 |
| 1230 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1231 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1232 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1233 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1091 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1092 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1093 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1094 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1234 | 1095 | |
| 1235 | 1096 | PORT_START |
| 1236 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1237 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1238 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1239 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1240 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1241 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1242 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1243 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1097 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 1098 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1099 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1100 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1101 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1102 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1103 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1104 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1105 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1244 | 1106 | |
| 1245 | 1107 | PORT_START |
| 1246 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1247 | | |
| 1248 | | PORT_START |
| 1249 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1250 | | PORT_DIPSETTING( 0x02, "2" ) |
| 1251 | | PORT_DIPSETTING( 0x03, "3" ) |
| 1252 | | PORT_DIPSETTING( 0x01, "4" ) |
| 1253 | | PORT_DIPSETTING( 0x00, "5" ) |
| 1254 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 1255 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 1256 | | PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) |
| 1257 | | PORT_DIPSETTING( 0x04, DEF_STR( Hardest ) ) |
| 1258 | | PORT_DIPSETTING( 0x00, "Debug Mode 2lap" ) |
| 1108 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 1109 | PORT_DIPSETTING( 0x0002, "2" ) |
| 1110 | PORT_DIPSETTING( 0x0003, "3" ) |
| 1111 | PORT_DIPSETTING( 0x0001, "4" ) |
| 1112 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1113 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 1114 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 1115 | PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) |
| 1116 | PORT_DIPSETTING( 0x0004, DEF_STR( Hardest ) ) |
| 1117 | PORT_DIPSETTING( 0x0000, "Debug Mode 2lap" ) |
| 1259 | 1118 | /* Coin Mode 1 */ |
| 1260 | 1119 | COIN_MODE_1 |
| 1261 | 1120 | /* Coin Mode 2, not supported yet */ |
| 1262 | 1121 | // COIN_MODE_2 |
| 1263 | | |
| 1264 | | PORT_START |
| 1265 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1266 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1267 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1268 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) |
| 1269 | | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 1270 | | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) ) |
| 1271 | | PORT_DIPNAME( 0x04, 0x04, "Coin Mode" ) |
| 1272 | | PORT_DIPSETTING( 0x04, "Mode 1" ) |
| 1273 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1274 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) |
| 1275 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 1276 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1277 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 1278 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 1279 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1122 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 1123 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 1124 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1125 | PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) |
| 1126 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 1127 | PORT_DIPSETTING( 0x0200, DEF_STR( Cocktail ) ) |
| 1128 | PORT_DIPNAME( 0x0400, 0x0400, "Coin Mode" ) |
| 1129 | PORT_DIPSETTING( 0x0400, "Mode 1" ) |
| 1130 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1131 | PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 1132 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) |
| 1133 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1134 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) |
| 1135 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) |
| 1136 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1280 | 1137 | /* In stop mode, press 2 to stop and 1 to restart */ |
| 1281 | | PORT_DIPNAME( 0x20, 0x20, "Stop Mode" ) |
| 1282 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1283 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1284 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1285 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1138 | PORT_DIPNAME( 0x2000, 0x2000, "Stop Mode" ) |
| 1139 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 1140 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1141 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1142 | PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) |
| 1286 | 1143 | INPUT_PORTS_END |
| 1287 | 1144 | |
| 1288 | 1145 | INPUT_PORTS_START( loht ) |
| 1289 | 1146 | PORT_START |
| 1290 | 1147 | JOYSTICK_1 |
| 1291 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1292 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1293 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1294 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1295 | | |
| 1296 | | PORT_START |
| 1148 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1149 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1150 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1151 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1297 | 1152 | JOYSTICK_2 |
| 1298 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1299 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1300 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1301 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1153 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1154 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1155 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1156 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1302 | 1157 | |
| 1303 | 1158 | PORT_START |
| 1304 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1305 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1306 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1307 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1308 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1309 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1310 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1311 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1159 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 1160 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1161 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1162 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1163 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1164 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1165 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1166 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1167 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1312 | 1168 | |
| 1313 | 1169 | PORT_START |
| 1314 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1315 | | |
| 1316 | | PORT_START |
| 1317 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1318 | | PORT_DIPSETTING( 0x00, "2" ) |
| 1319 | | PORT_DIPSETTING( 0x03, "3" ) |
| 1320 | | PORT_DIPSETTING( 0x02, "4" ) |
| 1321 | | PORT_DIPSETTING( 0x01, "5" ) |
| 1322 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) |
| 1323 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 1324 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1325 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1170 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 1171 | PORT_DIPSETTING( 0x0000, "2" ) |
| 1172 | PORT_DIPSETTING( 0x0003, "3" ) |
| 1173 | PORT_DIPSETTING( 0x0002, "4" ) |
| 1174 | PORT_DIPSETTING( 0x0001, "5" ) |
| 1175 | PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 1176 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 1177 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1178 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1326 | 1179 | /* Coin Mode 1 */ |
| 1327 | 1180 | COIN_MODE_1 |
| 1328 | 1181 | /* Coin Mode 2, not supported yet */ |
| 1329 | 1182 | // COIN_MODE_2 |
| 1330 | | |
| 1331 | | PORT_START |
| 1332 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1333 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1334 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1335 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) |
| 1336 | | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 1337 | | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) ) |
| 1338 | | PORT_DIPNAME( 0x04, 0x04, "Coin Mode" ) |
| 1339 | | PORT_DIPSETTING( 0x04, "Mode 1" ) |
| 1340 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1341 | | PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) |
| 1342 | | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1343 | | PORT_DIPSETTING( 0x18, DEF_STR( Normal ) ) |
| 1344 | | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) |
| 1345 | | PORT_DIPSETTING( 0x08, DEF_STR( Hardest ) ) |
| 1183 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 1184 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 1185 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1186 | PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) |
| 1187 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 1188 | PORT_DIPSETTING( 0x0200, DEF_STR( Cocktail ) ) |
| 1189 | PORT_DIPNAME( 0x0400, 0x0400, "Coin Mode" ) |
| 1190 | PORT_DIPSETTING( 0x0400, "Mode 1" ) |
| 1191 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1192 | PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) ) |
| 1193 | PORT_DIPSETTING( 0x0000, DEF_STR( Easy ) ) |
| 1194 | PORT_DIPSETTING( 0x1800, DEF_STR( Normal ) ) |
| 1195 | PORT_DIPSETTING( 0x1000, DEF_STR( Hard ) ) |
| 1196 | PORT_DIPSETTING( 0x0800, DEF_STR( Hardest ) ) |
| 1346 | 1197 | /* In stop mode, press 2 to stop and 1 to restart */ |
| 1347 | | PORT_DIPNAME( 0x20, 0x20, "Stop Mode" ) |
| 1348 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1349 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1350 | | PORT_DIPNAME( 0x40, 0x40, "Invulnerability" ) |
| 1351 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1352 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1353 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1198 | PORT_DIPNAME( 0x2000, 0x2000, "Stop Mode" ) |
| 1199 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 1200 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1201 | PORT_DIPNAME( 0x4000, 0x4000, "Invulnerability" ) |
| 1202 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 1203 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1204 | PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) |
| 1354 | 1205 | INPUT_PORTS_END |
| 1355 | 1206 | |
| 1356 | 1207 | INPUT_PORTS_START( xmultipl ) |
| 1357 | 1208 | PORT_START |
| 1358 | 1209 | JOYSTICK_1 |
| 1359 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1360 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1361 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1362 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1363 | | |
| 1364 | | PORT_START |
| 1210 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1211 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1212 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1213 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1365 | 1214 | JOYSTICK_2 |
| 1366 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1367 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1368 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1369 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1215 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1216 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1217 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1218 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1370 | 1219 | |
| 1371 | 1220 | PORT_START |
| 1372 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1373 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1374 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1375 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1376 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1377 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1378 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1379 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1221 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 1222 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1223 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1224 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1225 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1226 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1227 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1228 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1229 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1380 | 1230 | |
| 1381 | | PORT_START |
| 1382 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1383 | | |
| 1384 | 1231 | PORT_START_TAG("DSW1") |
| 1385 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) |
| 1386 | | PORT_DIPSETTING( 0x02, DEF_STR( Very_Easy ) ) |
| 1387 | | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) |
| 1388 | | PORT_DIPSETTING( 0x03, DEF_STR( Normal ) ) |
| 1389 | | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 1390 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) |
| 1391 | | PORT_DIPSETTING( 0x08, "1" ) |
| 1392 | | PORT_DIPSETTING( 0x04, "2" ) |
| 1393 | | PORT_DIPSETTING( 0x0c, "3" ) |
| 1394 | | PORT_DIPSETTING( 0x00, "4" ) |
| 1232 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) |
| 1233 | PORT_DIPSETTING( 0x0002, DEF_STR( Very_Easy ) ) |
| 1234 | PORT_DIPSETTING( 0x0001, DEF_STR( Easy ) ) |
| 1235 | PORT_DIPSETTING( 0x0003, DEF_STR( Normal ) ) |
| 1236 | PORT_DIPSETTING( 0x0000, DEF_STR( Hard ) ) |
| 1237 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) ) |
| 1238 | PORT_DIPSETTING( 0x0008, "1" ) |
| 1239 | PORT_DIPSETTING( 0x0004, "2" ) |
| 1240 | PORT_DIPSETTING( 0x000c, "3" ) |
| 1241 | PORT_DIPSETTING( 0x0000, "4" ) |
| 1395 | 1242 | /* Coin Mode 1 */ |
| 1396 | 1243 | COIN_MODE_1 |
| 1397 | 1244 | /* Coin Mode 2, not supported yet */ |
| 1398 | 1245 | // COIN_MODE_2 |
| 1399 | | |
| 1400 | | PORT_START_TAG("DSW2") |
| 1401 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1402 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1403 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1404 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) |
| 1405 | | PORT_DIPSETTING( 0x00, "Upright (single)" ) PORT_CONDITION("DSW2", 0x10, PORTCOND_NOTEQUALS, 0x00) |
| 1406 | | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) ) PORT_CONDITION("DSW2", 0x10, PORTCOND_NOTEQUALS, 0x00) |
| 1407 | | PORT_DIPSETTING( 0x00, "Upright (double) On" ) PORT_CONDITION("DSW2", 0x10, PORTCOND_EQUALS, 0x00) |
| 1408 | | PORT_DIPSETTING( 0x02, "Upright (double) Off" ) PORT_CONDITION("DSW2", 0x10, PORTCOND_EQUALS, 0x00) |
| 1409 | | PORT_DIPNAME( 0x04, 0x04, "Coin Mode" ) |
| 1410 | | PORT_DIPSETTING( 0x04, "Mode 1" ) |
| 1411 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1412 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) |
| 1413 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1414 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1415 | | PORT_DIPNAME( 0x10, 0x10, "Upright (double) Mode" ) |
| 1416 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 1417 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1418 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 1419 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1420 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 1421 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1422 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1246 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 1247 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 1248 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1249 | PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) |
| 1250 | PORT_DIPSETTING( 0x0000, "Upright (single)" ) PORT_CONDITION("DSW1", 0x1000, PORTCOND_NOTEQUALS, 0x0000) |
| 1251 | PORT_DIPSETTING( 0x0200, DEF_STR( Cocktail ) ) PORT_CONDITION("DSW1", 0x1000, PORTCOND_NOTEQUALS, 0x0000) |
| 1252 | PORT_DIPSETTING( 0x0000, "Upright (double) On" ) PORT_CONDITION("DSW1", 0x1000, PORTCOND_EQUALS, 0x0000) |
| 1253 | PORT_DIPSETTING( 0x0200, "Upright (double) Off" ) PORT_CONDITION("DSW1", 0x1000, PORTCOND_EQUALS, 0x0000) |
| 1254 | PORT_DIPNAME( 0x0400, 0x0400, "Coin Mode" ) |
| 1255 | PORT_DIPSETTING( 0x0400, "Mode 1" ) |
| 1256 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1257 | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Demo_Sounds ) ) |
| 1258 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 1259 | PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) |
| 1260 | PORT_DIPNAME( 0x1000, 0x1000, "Upright (double) Mode" ) |
| 1261 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) |
| 1262 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1263 | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Allow_Continue ) ) |
| 1264 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1265 | PORT_DIPSETTING( 0x2000, DEF_STR( Yes ) ) |
| 1266 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1267 | PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) |
| 1423 | 1268 | INPUT_PORTS_END |
| 1424 | 1269 | |
| 1425 | 1270 | INPUT_PORTS_START( dbreed ) |
| 1426 | 1271 | PORT_START |
| 1427 | 1272 | JOYSTICK_1 |
| 1428 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1429 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1430 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1431 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1432 | | |
| 1433 | | PORT_START |
| 1273 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1274 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1275 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1276 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1434 | 1277 | JOYSTICK_2 |
| 1435 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1436 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1437 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1438 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1278 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1279 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1280 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1281 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1439 | 1282 | |
| 1440 | 1283 | PORT_START |
| 1441 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1442 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1443 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1444 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1445 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1446 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1447 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1448 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1284 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 1285 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1286 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1287 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1288 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1289 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1290 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1291 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1292 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1449 | 1293 | |
| 1450 | 1294 | PORT_START |
| 1451 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1452 | | |
| 1453 | | PORT_START |
| 1454 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1455 | | PORT_DIPSETTING( 0x02, "2" ) |
| 1456 | | PORT_DIPSETTING( 0x03, "3" ) |
| 1457 | | PORT_DIPSETTING( 0x01, "4" ) |
| 1458 | | PORT_DIPSETTING( 0x00, "5" ) |
| 1459 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 1460 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy ) ) |
| 1461 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 1462 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 1463 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 1295 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 1296 | PORT_DIPSETTING( 0x0002, "2" ) |
| 1297 | PORT_DIPSETTING( 0x0003, "3" ) |
| 1298 | PORT_DIPSETTING( 0x0001, "4" ) |
| 1299 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1300 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 1301 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy ) ) |
| 1302 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 1303 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 1304 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 1464 | 1305 | /* Coin Mode 1 */ |
| 1465 | 1306 | COIN_MODE_1 |
| 1466 | 1307 | /* Coin Mode 2, not supported yet */ |
| 1467 | 1308 | // COIN_MODE_2 |
| 1468 | | |
| 1469 | | PORT_START |
| 1470 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1471 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1472 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1473 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) |
| 1474 | | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 1475 | | PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) ) |
| 1476 | | PORT_DIPNAME( 0x04, 0x04, "Coin Mode" ) |
| 1477 | | PORT_DIPSETTING( 0x04, "Mode 1" ) |
| 1478 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1479 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) |
| 1480 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 1481 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1482 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) |
| 1483 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1484 | | PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) |
| 1309 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 1310 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 1311 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1312 | PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) |
| 1313 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 1314 | PORT_DIPSETTING( 0x0200, DEF_STR( Cocktail ) ) |
| 1315 | PORT_DIPNAME( 0x0400, 0x0400, "Coin Mode" ) |
| 1316 | PORT_DIPSETTING( 0x0400, "Mode 1" ) |
| 1317 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1318 | PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 1319 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) |
| 1320 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1321 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) |
| 1322 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1323 | PORT_DIPSETTING( 0x1000, DEF_STR( Yes ) ) |
| 1485 | 1324 | /* In stop mode, press 2 to stop and 1 to restart */ |
| 1486 | | PORT_DIPNAME( 0x20, 0x20, "Stop Mode" ) |
| 1487 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1488 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1489 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1490 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1325 | PORT_DIPNAME( 0x2000, 0x2000, "Stop Mode" ) |
| 1326 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 1327 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1328 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1329 | PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) |
| 1491 | 1330 | INPUT_PORTS_END |
| 1492 | 1331 | |
| 1493 | 1332 | INPUT_PORTS_START( rtype2 ) |
| 1494 | 1333 | PORT_START |
| 1495 | 1334 | JOYSTICK_1 |
| 1496 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1497 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1498 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1499 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1500 | | |
| 1501 | | PORT_START |
| 1335 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1336 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1337 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1338 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1502 | 1339 | JOYSTICK_2 |
| 1503 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1504 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1505 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1506 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1340 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1341 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1342 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1343 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1507 | 1344 | |
| 1508 | 1345 | PORT_START |
| 1509 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1510 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1511 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1512 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1513 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1514 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1515 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1516 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1346 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 1347 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1348 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1349 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1350 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1351 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x0020 is another test mode */ |
| 1352 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1353 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1354 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1517 | 1355 | |
| 1518 | 1356 | PORT_START |
| 1519 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1520 | | |
| 1521 | | PORT_START |
| 1522 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1523 | | PORT_DIPSETTING( 0x02, "2" ) |
| 1524 | | PORT_DIPSETTING( 0x03, "3" ) |
| 1525 | | PORT_DIPSETTING( 0x01, "4" ) |
| 1526 | | PORT_DIPSETTING( 0x00, "5" ) |
| 1527 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 1528 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 1529 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 1530 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 1531 | | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 1357 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 1358 | PORT_DIPSETTING( 0x0002, "2" ) |
| 1359 | PORT_DIPSETTING( 0x0003, "3" ) |
| 1360 | PORT_DIPSETTING( 0x0001, "4" ) |
| 1361 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1362 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 1363 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 1364 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 1365 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 1366 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 1532 | 1367 | /* Coin Mode 1 */ |
| 1533 | 1368 | COIN_MODE_1 |
| 1534 | 1369 | /* Coin Mode 2, not supported yet */ |
| 1535 | 1370 | // COIN_MODE_2 |
| 1536 | | |
| 1537 | | PORT_START |
| 1538 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1539 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1540 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1541 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) |
| 1542 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1543 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1544 | | PORT_DIPNAME( 0x04, 0x04, "Coin Mode" ) |
| 1545 | | PORT_DIPSETTING( 0x04, "Mode 1" ) |
| 1546 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1547 | | PORT_DIPNAME( 0x18, 0x10, DEF_STR( Cabinet ) ) |
| 1548 | | PORT_DIPSETTING( 0x10, DEF_STR( Upright ) ) |
| 1549 | | PORT_DIPSETTING( 0x00, "Upright (2P)" ) |
| 1550 | | PORT_DIPSETTING( 0x18, DEF_STR( Cocktail ) ) |
| 1371 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 1372 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 1373 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1374 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Demo_Sounds ) ) |
| 1375 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 1376 | PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) |
| 1377 | PORT_DIPNAME( 0x0400, 0x0400, "Coin Mode" ) |
| 1378 | PORT_DIPSETTING( 0x0400, "Mode 1" ) |
| 1379 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1380 | PORT_DIPNAME( 0x1800, 0x1000, DEF_STR( Cabinet ) ) |
| 1381 | PORT_DIPSETTING( 0x1000, DEF_STR( Upright ) ) |
| 1382 | PORT_DIPSETTING( 0x0000, "Upright (2P)" ) |
| 1383 | PORT_DIPSETTING( 0x1800, DEF_STR( Cocktail ) ) |
| 1551 | 1384 | /* In stop mode, press 2 to stop and 1 to restart */ |
| 1552 | | PORT_DIPNAME( 0x20, 0x20, "Stop Mode" ) |
| 1553 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1554 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1555 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1556 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1385 | PORT_DIPNAME( 0x2000, 0x2000, "Stop Mode" ) |
| 1386 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 1387 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1388 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1389 | PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) |
| 1557 | 1390 | INPUT_PORTS_END |
| 1558 | 1391 | |
| 1559 | 1392 | INPUT_PORTS_START( hharry ) |
| 1560 | 1393 | PORT_START |
| 1561 | 1394 | JOYSTICK_1 |
| 1562 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1563 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1564 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1565 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1566 | | |
| 1567 | | PORT_START |
| 1395 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1396 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1397 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1398 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1568 | 1399 | JOYSTICK_2 |
| 1569 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1570 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1571 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1572 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1400 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1401 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1402 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1403 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1573 | 1404 | |
| 1574 | 1405 | PORT_START |
| 1575 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1576 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1577 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1578 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1579 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1580 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1581 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1582 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1406 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 1407 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1408 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1409 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1410 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1411 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x0020 is another test mode */ |
| 1412 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1413 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1414 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1583 | 1415 | |
| 1584 | 1416 | PORT_START |
| 1585 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1586 | | |
| 1587 | | PORT_START |
| 1588 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1589 | | PORT_DIPSETTING( 0x02, "2" ) |
| 1590 | | PORT_DIPSETTING( 0x03, "3" ) |
| 1591 | | PORT_DIPSETTING( 0x01, "4" ) |
| 1592 | | PORT_DIPSETTING( 0x00, "5" ) |
| 1593 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 1594 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy ) ) |
| 1595 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 1596 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 1597 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 1598 | | PORT_DIPNAME( 0x10, 0x10, "Continue Limit" ) |
| 1599 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1600 | | PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) |
| 1601 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 1602 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1603 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 1604 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 1605 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1606 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1607 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1608 | | |
| 1609 | | PORT_START |
| 1610 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1611 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1612 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1613 | | PORT_DIPNAME( 0x06, 0x04, DEF_STR( Cabinet ) ) |
| 1614 | | PORT_DIPSETTING( 0x04, DEF_STR( Upright ) ) |
| 1615 | | PORT_DIPSETTING( 0x00, "Upright (2P)" ) |
| 1616 | | PORT_DIPSETTING( 0x06, DEF_STR( Cocktail ) ) |
| 1617 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) |
| 1618 | | PORT_DIPSETTING( 0x08, "Mode 1" ) |
| 1619 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1417 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 1418 | PORT_DIPSETTING( 0x0002, "2" ) |
| 1419 | PORT_DIPSETTING( 0x0003, "3" ) |
| 1420 | PORT_DIPSETTING( 0x0001, "4" ) |
| 1421 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1422 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 1423 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy ) ) |
| 1424 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 1425 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 1426 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 1427 | PORT_DIPNAME( 0x0010, 0x0010, "Continue Limit" ) |
| 1428 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1429 | PORT_DIPSETTING( 0x0010, DEF_STR( Yes ) ) |
| 1430 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) |
| 1431 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1432 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 1433 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 1434 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 1435 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1436 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) |
| 1437 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 1438 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 1439 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1440 | PORT_DIPNAME( 0x0600, 0x0400, DEF_STR( Cabinet ) ) |
| 1441 | PORT_DIPSETTING( 0x0400, DEF_STR( Upright ) ) |
| 1442 | PORT_DIPSETTING( 0x0000, "Upright (2P)" ) |
| 1443 | PORT_DIPSETTING( 0x0600, DEF_STR( Cocktail ) ) |
| 1444 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) |
| 1445 | PORT_DIPSETTING( 0x0800, "Mode 1" ) |
| 1446 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1620 | 1447 | /* Coin Mode 1 */ |
| 1621 | | PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) |
| 1622 | | PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) |
| 1623 | | PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) ) |
| 1624 | | PORT_DIPSETTING( 0xc0, DEF_STR( 4C_1C ) ) |
| 1625 | | PORT_DIPSETTING( 0xd0, DEF_STR( 3C_1C ) ) |
| 1626 | | PORT_DIPSETTING( 0x10, "2 Coins/1 Credit, 1 Coin/Continue" ) |
| 1627 | | PORT_DIPSETTING( 0xe0, DEF_STR( 2C_1C ) ) |
| 1628 | | PORT_DIPSETTING( 0x30, DEF_STR( 3C_2C ) ) |
| 1629 | | PORT_DIPSETTING( 0x20, DEF_STR( 4C_3C ) ) |
| 1630 | | PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) |
| 1631 | | PORT_DIPSETTING( 0x40, DEF_STR( 2C_3C ) ) |
| 1632 | | PORT_DIPSETTING( 0x90, DEF_STR( 1C_2C ) ) |
| 1633 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) |
| 1634 | | PORT_DIPSETTING( 0x70, DEF_STR( 1C_4C ) ) |
| 1635 | | PORT_DIPSETTING( 0x60, DEF_STR( 1C_5C ) ) |
| 1636 | | PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) ) |
| 1637 | | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 1448 | PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) |
| 1449 | PORT_DIPSETTING( 0xa000, DEF_STR( 6C_1C ) ) |
| 1450 | PORT_DIPSETTING( 0xb000, DEF_STR( 5C_1C ) ) |
| 1451 | PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) ) |
| 1452 | PORT_DIPSETTING( 0xd000, DEF_STR( 3C_1C ) ) |
| 1453 | PORT_DIPSETTING( 0x1000, "2 Coins/1 Credit, 1 Coin/Continue" ) |
| 1454 | PORT_DIPSETTING( 0xe000, DEF_STR( 2C_1C ) ) |
| 1455 | PORT_DIPSETTING( 0x3000, DEF_STR( 3C_2C ) ) |
| 1456 | PORT_DIPSETTING( 0x2000, DEF_STR( 4C_3C ) ) |
| 1457 | PORT_DIPSETTING( 0xf000, DEF_STR( 1C_1C ) ) |
| 1458 | PORT_DIPSETTING( 0x4000, DEF_STR( 2C_3C ) ) |
| 1459 | PORT_DIPSETTING( 0x9000, DEF_STR( 1C_2C ) ) |
| 1460 | PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) |
| 1461 | PORT_DIPSETTING( 0x7000, DEF_STR( 1C_4C ) ) |
| 1462 | PORT_DIPSETTING( 0x6000, DEF_STR( 1C_5C ) ) |
| 1463 | PORT_DIPSETTING( 0x5000, DEF_STR( 1C_6C ) ) |
| 1464 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 1638 | 1465 | /* Coin mode 2, not supported yet */ |
| 1639 | 1466 | // COIN_MODE_2 |
| 1640 | 1467 | INPUT_PORTS_END |
| 1641 | 1468 | |
| 1642 | 1469 | INPUT_PORTS_START( poundfor ) |
| 1643 | 1470 | PORT_START |
| 1644 | | PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* high bits of trackball X */ |
| 1645 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 1646 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 1647 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1471 | PORT_BIT( 0x001f, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* high bits of trackball X */ |
| 1472 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 1473 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 1474 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1475 | PORT_BIT( 0x1f00, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* high bits of trackball X */ |
| 1476 | PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1477 | PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1478 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1648 | 1479 | |
| 1649 | 1480 | PORT_START |
| 1650 | | PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* high bits of trackball X */ |
| 1651 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1652 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1653 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1481 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 1482 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1483 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1484 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1485 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1486 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x0020 is another test mode */ |
| 1487 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1488 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1489 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1654 | 1490 | |
| 1655 | 1491 | PORT_START |
| 1656 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1657 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1658 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1659 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1660 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1661 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1662 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1663 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1492 | PORT_DIPNAME( 0x0003, 0x0003, "Round Time" ) |
| 1493 | PORT_DIPSETTING( 0x0002, "60" ) |
| 1494 | PORT_DIPSETTING( 0x0003, "90" ) |
| 1495 | PORT_DIPSETTING( 0x0001, "120" ) |
| 1496 | PORT_DIPSETTING( 0x0000, "150" ) |
| 1497 | PORT_DIPNAME( 0x0004, 0x0004, "Matches/Credit (2P)" ) |
| 1498 | PORT_DIPSETTING( 0x0004, "1" ) |
| 1499 | PORT_DIPSETTING( 0x0000, "2" ) |
| 1500 | PORT_DIPNAME( 0x0008, 0x0008, "Rounds/Match" ) |
| 1501 | PORT_DIPSETTING( 0x0008, "2" ) |
| 1502 | PORT_DIPSETTING( 0x0000, "3" ) |
| 1503 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Difficulty ) ) |
| 1504 | PORT_DIPSETTING( 0x0010, DEF_STR( Normal ) ) |
| 1505 | PORT_DIPSETTING( 0x0000, DEF_STR( Hard ) ) |
| 1506 | PORT_DIPNAME( 0x0020, 0x0020, "Trackball Size" ) |
| 1507 | PORT_DIPSETTING( 0x0020, "Small" ) |
| 1508 | PORT_DIPSETTING( 0x0000, "Large" ) |
| 1509 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 1510 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 1511 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1512 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) |
| 1513 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 1514 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 1515 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1516 | PORT_DIPNAME( 0x0600, 0x0400, DEF_STR( Cabinet ) ) |
| 1517 | PORT_DIPSETTING( 0x0400, DEF_STR( Upright ) ) |
| 1518 | PORT_DIPSETTING( 0x0200, "Upright (2P)" ) |
| 1519 | PORT_DIPSETTING( 0x0600, DEF_STR( Cocktail ) ) |
| 1520 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) |
| 1521 | PORT_DIPSETTING( 0x0800, "Mode 1" ) |
| 1522 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1664 | 1523 | |
| 1665 | | PORT_START |
| 1666 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1667 | | |
| 1668 | | PORT_START |
| 1669 | | PORT_DIPNAME( 0x03, 0x03, "Round Time" ) |
| 1670 | | PORT_DIPSETTING( 0x02, "60" ) |
| 1671 | | PORT_DIPSETTING( 0x03, "90" ) |
| 1672 | | PORT_DIPSETTING( 0x01, "120" ) |
| 1673 | | PORT_DIPSETTING( 0x00, "150" ) |
| 1674 | | PORT_DIPNAME( 0x04, 0x04, "Matches/Credit (2P)" ) |
| 1675 | | PORT_DIPSETTING( 0x04, "1" ) |
| 1676 | | PORT_DIPSETTING( 0x00, "2" ) |
| 1677 | | PORT_DIPNAME( 0x08, 0x08, "Rounds/Match" ) |
| 1678 | | PORT_DIPSETTING( 0x08, "2" ) |
| 1679 | | PORT_DIPSETTING( 0x00, "3" ) |
| 1680 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Difficulty ) ) |
| 1681 | | PORT_DIPSETTING( 0x10, DEF_STR( Normal ) ) |
| 1682 | | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 1683 | | PORT_DIPNAME( 0x20, 0x20, "Trackball Size" ) |
| 1684 | | PORT_DIPSETTING( 0x20, "Small" ) |
| 1685 | | PORT_DIPSETTING( 0x00, "Large" ) |
| 1686 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 1687 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1688 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1689 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1690 | | |
| 1691 | | PORT_START |
| 1692 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1693 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1694 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1695 | | PORT_DIPNAME( 0x06, 0x04, DEF_STR( Cabinet ) ) |
| 1696 | | PORT_DIPSETTING( 0x04, DEF_STR( Upright ) ) |
| 1697 | | PORT_DIPSETTING( 0x02, "Upright (2P)" ) |
| 1698 | | PORT_DIPSETTING( 0x06, DEF_STR( Cocktail ) ) |
| 1699 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) |
| 1700 | | PORT_DIPSETTING( 0x08, "Mode 1" ) |
| 1701 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1702 | | |
| 1703 | 1524 | /* Coin Mode 1 */ |
| 1704 | | PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) |
| 1705 | | PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) |
| 1706 | | PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) ) |
| 1707 | | PORT_DIPSETTING( 0xc0, DEF_STR( 4C_1C ) ) |
| 1708 | | PORT_DIPSETTING( 0xd0, DEF_STR( 3C_1C ) ) |
| 1709 | | PORT_DIPSETTING( 0xe0, DEF_STR( 2C_1C ) ) |
| 1710 | | PORT_DIPSETTING( 0x30, DEF_STR( 3C_2C ) ) |
| 1711 | | PORT_DIPSETTING( 0x20, DEF_STR( 4C_3C ) ) |
| 1712 | | PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) |
| 1713 | | PORT_DIPSETTING( 0x10, "1 Coin/1 Credit, 1 Coin/Continue" ) |
| 1714 | | PORT_DIPSETTING( 0x40, DEF_STR( 2C_3C ) ) |
| 1715 | | PORT_DIPSETTING( 0x90, DEF_STR( 1C_2C ) ) |
| 1716 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) |
| 1717 | | PORT_DIPSETTING( 0x70, DEF_STR( 1C_4C ) ) |
| 1718 | | PORT_DIPSETTING( 0x60, DEF_STR( 1C_5C ) ) |
| 1719 | | PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) ) |
| 1720 | | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 1525 | PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) |
| 1526 | PORT_DIPSETTING( 0xa000, DEF_STR( 6C_1C ) ) |
| 1527 | PORT_DIPSETTING( 0xb000, DEF_STR( 5C_1C ) ) |
| 1528 | PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) ) |
| 1529 | PORT_DIPSETTING( 0xd000, DEF_STR( 3C_1C ) ) |
| 1530 | PORT_DIPSETTING( 0xe000, DEF_STR( 2C_1C ) ) |
| 1531 | PORT_DIPSETTING( 0x3000, DEF_STR( 3C_2C ) ) |
| 1532 | PORT_DIPSETTING( 0x2000, DEF_STR( 4C_3C ) ) |
| 1533 | PORT_DIPSETTING( 0xf000, DEF_STR( 1C_1C ) ) |
| 1534 | PORT_DIPSETTING( 0x1000, "1 Coin/1 Credit, 1 Coin/Continue" ) |
| 1535 | PORT_DIPSETTING( 0x4000, DEF_STR( 2C_3C ) ) |
| 1536 | PORT_DIPSETTING( 0x9000, DEF_STR( 1C_2C ) ) |
| 1537 | PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) |
| 1538 | PORT_DIPSETTING( 0x7000, DEF_STR( 1C_4C ) ) |
| 1539 | PORT_DIPSETTING( 0x6000, DEF_STR( 1C_5C ) ) |
| 1540 | PORT_DIPSETTING( 0x5000, DEF_STR( 1C_6C ) ) |
| 1541 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 1721 | 1542 | /* Coin Mode 2, not supported yet */ |
| 1722 | 1543 | // COIN_MODE_2 |
| 1723 | 1544 | |
| r869 | r870 | |
| 1737 | 1558 | INPUT_PORTS_START( airduel ) |
| 1738 | 1559 | PORT_START |
| 1739 | 1560 | JOYSTICK_1 |
| 1740 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1741 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1742 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1743 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1744 | | |
| 1745 | | PORT_START |
| 1561 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1562 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1563 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1564 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1746 | 1565 | JOYSTICK_2 |
| 1747 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1748 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1749 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1750 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1566 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1567 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1568 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1569 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1751 | 1570 | |
| 1752 | 1571 | PORT_START |
| 1753 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1754 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1755 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1756 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1757 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1758 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1759 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1760 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1572 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 1573 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1574 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1575 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1576 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1577 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x0020 is another test mode */ |
| 1578 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1579 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1580 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1761 | 1581 | |
| 1762 | 1582 | PORT_START |
| 1763 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1764 | | |
| 1765 | | PORT_START |
| 1766 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1767 | | PORT_DIPSETTING( 0x02, "2" ) |
| 1768 | | PORT_DIPSETTING( 0x03, "3" ) |
| 1769 | | PORT_DIPSETTING( 0x01, "4" ) |
| 1770 | | PORT_DIPSETTING( 0x00, "5" ) |
| 1771 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 1772 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy ) ) |
| 1773 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 1774 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 1775 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 1776 | | PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1777 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 1778 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1779 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1780 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1781 | | |
| 1782 | | PORT_START |
| 1783 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1784 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1785 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1786 | | PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1787 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) |
| 1788 | | PORT_DIPSETTING( 0x08, "Mode 1" ) |
| 1789 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1790 | | |
| 1583 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 1584 | PORT_DIPSETTING( 0x0002, "2" ) |
| 1585 | PORT_DIPSETTING( 0x0003, "3" ) |
| 1586 | PORT_DIPSETTING( 0x0001, "4" ) |
| 1587 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1588 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 1589 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy ) ) |
| 1590 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 1591 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 1592 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 1593 | PORT_BIT( 0x0030, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1594 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 1595 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 1596 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1597 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) |
| 1598 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 1599 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 1600 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1601 | PORT_BIT( 0x0600, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1602 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) |
| 1603 | PORT_DIPSETTING( 0x0800, "Mode 1" ) |
| 1604 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1791 | 1605 | /* Coin Mode 1 */ |
| 1792 | | PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) |
| 1793 | | PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) |
| 1794 | | PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) ) |
| 1795 | | PORT_DIPSETTING( 0xc0, DEF_STR( 4C_1C ) ) |
| 1796 | | PORT_DIPSETTING( 0xd0, DEF_STR( 3C_1C ) ) |
| 1797 | | // PORT_DIPSETTING( 0x10, DEF_STR( Free-Play ) ) /* another free play */ |
| 1798 | | PORT_DIPSETTING( 0xe0, DEF_STR( 2C_1C ) ) |
| 1799 | | PORT_DIPSETTING( 0x30, DEF_STR( 3C_2C ) ) |
| 1800 | | PORT_DIPSETTING( 0x20, DEF_STR( 4C_3C ) ) |
| 1801 | | PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) |
| 1802 | | PORT_DIPSETTING( 0x40, DEF_STR( 2C_3C ) ) |
| 1803 | | PORT_DIPSETTING( 0x90, DEF_STR( 1C_2C ) ) |
| 1804 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) |
| 1805 | | PORT_DIPSETTING( 0x70, DEF_STR( 1C_4C ) ) |
| 1806 | | PORT_DIPSETTING( 0x60, DEF_STR( 1C_5C ) ) |
| 1807 | | PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) ) |
| 1808 | | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 1606 | PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) |
| 1607 | PORT_DIPSETTING( 0xa000, DEF_STR( 6C_1C ) ) |
| 1608 | PORT_DIPSETTING( 0xb000, DEF_STR( 5C_1C ) ) |
| 1609 | PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) ) |
| 1610 | PORT_DIPSETTING( 0xd000, DEF_STR( 3C_1C ) ) |
| 1611 | // PORT_DIPSETTING( 0x1000, DEF_STR( Free-Play ) ) /* another free play */ |
| 1612 | PORT_DIPSETTING( 0xe000, DEF_STR( 2C_1C ) ) |
| 1613 | PORT_DIPSETTING( 0x3000, DEF_STR( 3C_2C ) ) |
| 1614 | PORT_DIPSETTING( 0x2000, DEF_STR( 4C_3C ) ) |
| 1615 | PORT_DIPSETTING( 0xf000, DEF_STR( 1C_1C ) ) |
| 1616 | PORT_DIPSETTING( 0x4000, DEF_STR( 2C_3C ) ) |
| 1617 | PORT_DIPSETTING( 0x9000, DEF_STR( 1C_2C ) ) |
| 1618 | PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) |
| 1619 | PORT_DIPSETTING( 0x7000, DEF_STR( 1C_4C ) ) |
| 1620 | PORT_DIPSETTING( 0x6000, DEF_STR( 1C_5C ) ) |
| 1621 | PORT_DIPSETTING( 0x5000, DEF_STR( 1C_6C ) ) |
| 1622 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 1809 | 1623 | /* Coin Mode 2, not supported yet */ |
| 1810 | 1624 | // COIN_MODE_2 |
| 1811 | 1625 | INPUT_PORTS_END |
| r869 | r870 | |
| 1813 | 1627 | INPUT_PORTS_START( gallop ) |
| 1814 | 1628 | PORT_START |
| 1815 | 1629 | JOYSTICK_1 |
| 1816 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1817 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1818 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1819 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1820 | | |
| 1821 | | PORT_START |
| 1630 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1631 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1632 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1633 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1822 | 1634 | JOYSTICK_2 |
| 1823 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1824 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1825 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1826 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1635 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1636 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1637 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1638 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1827 | 1639 | |
| 1828 | 1640 | PORT_START |
| 1829 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1830 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1831 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1832 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1833 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1834 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1835 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1836 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1641 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 1642 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1643 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1644 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1645 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1646 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x0020 is another test mode */ |
| 1647 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1648 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1649 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1837 | 1650 | |
| 1838 | 1651 | PORT_START |
| 1839 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1840 | | |
| 1841 | | PORT_START |
| 1842 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1843 | | PORT_DIPSETTING( 0x02, "2" ) |
| 1844 | | PORT_DIPSETTING( 0x03, "3" ) |
| 1845 | | PORT_DIPSETTING( 0x01, "4" ) |
| 1846 | | PORT_DIPSETTING( 0x00, "5" ) |
| 1847 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 1848 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy ) ) |
| 1849 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 1850 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 1851 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 1852 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1853 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 1854 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1855 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 1856 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 1857 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1858 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1859 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1860 | | |
| 1861 | | PORT_START |
| 1862 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1863 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1864 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1865 | | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Cabinet ) ) |
| 1866 | | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 1867 | | PORT_DIPSETTING( 0x02, "Upright (2P)" ) |
| 1868 | | PORT_DIPSETTING( 0x06, DEF_STR( Cocktail ) ) |
| 1869 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) |
| 1870 | | PORT_DIPSETTING( 0x08, "Mode 1" ) |
| 1871 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1652 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 1653 | PORT_DIPSETTING( 0x0002, "2" ) |
| 1654 | PORT_DIPSETTING( 0x0003, "3" ) |
| 1655 | PORT_DIPSETTING( 0x0001, "4" ) |
| 1656 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1657 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 1658 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy ) ) |
| 1659 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 1660 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 1661 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 1662 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1663 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) |
| 1664 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1665 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 1666 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 1667 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 1668 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1669 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) |
| 1670 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 1671 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 1672 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1673 | PORT_DIPNAME( 0x0600, 0x0000, DEF_STR( Cabinet ) ) |
| 1674 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 1675 | PORT_DIPSETTING( 0x0200, "Upright (2P)" ) |
| 1676 | PORT_DIPSETTING( 0x0600, DEF_STR( Cocktail ) ) |
| 1677 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) |
| 1678 | PORT_DIPSETTING( 0x0800, "Mode 1" ) |
| 1679 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1872 | 1680 | /* Coin Mode 1 */ |
| 1873 | | PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) |
| 1874 | | PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) |
| 1875 | | PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) ) |
| 1876 | | PORT_DIPSETTING( 0xc0, DEF_STR( 4C_1C ) ) |
| 1877 | | PORT_DIPSETTING( 0xd0, DEF_STR( 3C_1C ) ) |
| 1878 | | PORT_DIPSETTING( 0x10, "2 Coins/1 Credit, 1 Coin/Continue" ) |
| 1879 | | PORT_DIPSETTING( 0xe0, DEF_STR( 2C_1C ) ) |
| 1880 | | PORT_DIPSETTING( 0x30, DEF_STR( 3C_2C ) ) |
| 1881 | | PORT_DIPSETTING( 0x20, DEF_STR( 4C_3C ) ) |
| 1882 | | PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) |
| 1883 | | PORT_DIPSETTING( 0x40, DEF_STR( 2C_3C ) ) |
| 1884 | | PORT_DIPSETTING( 0x90, DEF_STR( 1C_2C ) ) |
| 1885 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) |
| 1886 | | PORT_DIPSETTING( 0x70, DEF_STR( 1C_4C ) ) |
| 1887 | | PORT_DIPSETTING( 0x60, DEF_STR( 1C_5C ) ) |
| 1888 | | PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) ) |
| 1889 | | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 1681 | PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) |
| 1682 | PORT_DIPSETTING( 0xa000, DEF_STR( 6C_1C ) ) |
| 1683 | PORT_DIPSETTING( 0xb000, DEF_STR( 5C_1C ) ) |
| 1684 | PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) ) |
| 1685 | PORT_DIPSETTING( 0xd000, DEF_STR( 3C_1C ) ) |
| 1686 | PORT_DIPSETTING( 0x1000, "2 Coins/1 Credit, 1 Coin/Continue" ) |
| 1687 | PORT_DIPSETTING( 0xe000, DEF_STR( 2C_1C ) ) |
| 1688 | PORT_DIPSETTING( 0x3000, DEF_STR( 3C_2C ) ) |
| 1689 | PORT_DIPSETTING( 0x2000, DEF_STR( 4C_3C ) ) |
| 1690 | PORT_DIPSETTING( 0xf000, DEF_STR( 1C_1C ) ) |
| 1691 | PORT_DIPSETTING( 0x4000, DEF_STR( 2C_3C ) ) |
| 1692 | PORT_DIPSETTING( 0x9000, DEF_STR( 1C_2C ) ) |
| 1693 | PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) |
| 1694 | PORT_DIPSETTING( 0x7000, DEF_STR( 1C_4C ) ) |
| 1695 | PORT_DIPSETTING( 0x6000, DEF_STR( 1C_5C ) ) |
| 1696 | PORT_DIPSETTING( 0x5000, DEF_STR( 1C_6C ) ) |
| 1697 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 1890 | 1698 | /* Coin mode 2, not supported yet */ |
| 1891 | 1699 | // COIN_MODE_2 |
| 1892 | 1700 | INPUT_PORTS_END |
| r869 | r870 | |
| 1894 | 1702 | INPUT_PORTS_START( kengo ) |
| 1895 | 1703 | PORT_START |
| 1896 | 1704 | JOYSTICK_1 |
| 1897 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1898 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1899 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1900 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1901 | | |
| 1902 | | PORT_START |
| 1705 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 1706 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 1707 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1708 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1903 | 1709 | JOYSTICK_2 |
| 1904 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1905 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1906 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1907 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1710 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL |
| 1711 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 1712 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL |
| 1713 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 1908 | 1714 | |
| 1909 | 1715 | PORT_START |
| 1910 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 1911 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1912 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1913 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1914 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1915 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x20 is another test mode */ |
| 1916 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1917 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1716 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 1717 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1718 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1719 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1720 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1721 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) /* 0x0020 is another test mode */ |
| 1722 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1723 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* sprite DMA complete */ |
| 1724 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1918 | 1725 | |
| 1919 | 1726 | PORT_START |
| 1920 | | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1921 | | |
| 1922 | | PORT_START |
| 1923 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1924 | | PORT_DIPSETTING( 0x02, "2" ) |
| 1925 | | PORT_DIPSETTING( 0x03, "3" ) |
| 1926 | | PORT_DIPSETTING( 0x01, "4" ) |
| 1927 | | PORT_DIPSETTING( 0x00, "5" ) |
| 1928 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 1929 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy ) ) |
| 1930 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 1931 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 1932 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 1933 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 1934 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 1935 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1936 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 1937 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1938 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 1939 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 1940 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1941 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1942 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1943 | | |
| 1944 | | PORT_START |
| 1945 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 1946 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1947 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1948 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 1949 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 1950 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1951 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 1952 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 1953 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1954 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) |
| 1955 | | PORT_DIPSETTING( 0x08, "Mode 1" ) |
| 1956 | | PORT_DIPSETTING( 0x00, "Mode 2" ) |
| 1727 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 1728 | PORT_DIPSETTING( 0x0002, "2" ) |
| 1729 | PORT_DIPSETTING( 0x0003, "3" ) |
| 1730 | PORT_DIPSETTING( 0x0001, "4" ) |
| 1731 | PORT_DIPSETTING( 0x0000, "5" ) |
| 1732 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 1733 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy ) ) |
| 1734 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 1735 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 1736 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 1737 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) |
| 1738 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 1739 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1740 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) |
| 1741 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 1742 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 1743 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 1744 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 1745 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1746 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) |
| 1747 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 1748 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 1749 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1750 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) |
| 1751 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 1752 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1753 | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) |
| 1754 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) |
| 1755 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1756 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) |
| 1757 | PORT_DIPSETTING( 0x0800, "Mode 1" ) |
| 1758 | PORT_DIPSETTING( 0x0000, "Mode 2" ) |
| 1957 | 1759 | /* Coin Mode 1 */ |
| 1958 | | PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) |
| 1959 | | PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) |
| 1960 | | PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) ) |
| 1961 | | PORT_DIPSETTING( 0xc0, DEF_STR( 4C_1C ) ) |
| 1962 | | PORT_DIPSETTING( 0xd0, DEF_STR( 3C_1C ) ) |
| 1963 | | PORT_DIPSETTING( 0x10, "2 Coins/1 Credit, 1 Coin/Continue" ) |
| 1964 | | PORT_DIPSETTING( 0xe0, DEF_STR( 2C_1C ) ) |
| 1965 | | PORT_DIPSETTING( 0x30, DEF_STR( 3C_2C ) ) |
| 1966 | | PORT_DIPSETTING( 0x20, DEF_STR( 4C_3C ) ) |
| 1967 | | PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) |
| 1968 | | PORT_DIPSETTING( 0x40, DEF_STR( 2C_3C ) ) |
| 1969 | | PORT_DIPSETTING( 0x90, DEF_STR( 1C_2C ) ) |
| 1970 | | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) |
| 1971 | | PORT_DIPSETTING( 0x70, DEF_STR( 1C_4C ) ) |
| 1972 | | PORT_DIPSETTING( 0x60, DEF_STR( 1C_5C ) ) |
| 1973 | | PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) ) |
| 1974 | | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 1760 | PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) |
| 1761 | PORT_DIPSETTING( 0xa000, DEF_STR( 6C_1C ) ) |
| 1762 | PORT_DIPSETTING( 0xb000, DEF_STR( 5C_1C ) ) |
| 1763 | PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) ) |
| 1764 | PORT_DIPSETTING( 0xd000, DEF_STR( 3C_1C ) ) |
| 1765 | PORT_DIPSETTING( 0x1000, "2 Coins/1 Credit, 1 Coin/Continue" ) |
| 1766 | PORT_DIPSETTING( 0xe000, DEF_STR( 2C_1C ) ) |
| 1767 | PORT_DIPSETTING( 0x3000, DEF_STR( 3C_2C ) ) |
| 1768 | PORT_DIPSETTING( 0x2000, DEF_STR( 4C_3C ) ) |
| 1769 | PORT_DIPSETTING( 0xf000, DEF_STR( 1C_1C ) ) |
| 1770 | PORT_DIPSETTING( 0x4000, DEF_STR( 2C_3C ) ) |
| 1771 | PORT_DIPSETTING( 0x9000, DEF_STR( 1C_2C ) ) |
| 1772 | PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) |
| 1773 | PORT_DIPSETTING( 0x7000, DEF_STR( 1C_4C ) ) |
| 1774 | PORT_DIPSETTING( 0x6000, DEF_STR( 1C_5C ) ) |
| 1775 | PORT_DIPSETTING( 0x5000, DEF_STR( 1C_6C ) ) |
| 1776 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 1975 | 1777 | /* Coin mode 2, not supported yet */ |
| 1976 | 1778 | // COIN_MODE_2 |
| 1977 | 1779 | INPUT_PORTS_END |
| r869 | r870 | |
| 2038 | 1840 | |
| 2039 | 1841 | /* basic machine hardware */ |
| 2040 | 1842 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2041 | | MDRV_CPU_PROGRAM_MAP(rtype_readmem,rtype_writemem) |
| 2042 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 1843 | MDRV_CPU_PROGRAM_MAP(rtype_map,0) |
| 1844 | MDRV_CPU_IO_MAP(m72_portmap,0) |
| 2043 | 1845 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2044 | 1846 | |
| 2045 | 1847 | MDRV_CPU_ADD(Z80, 3579545) |
| 2046 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2047 | 1848 | MDRV_CPU_PROGRAM_MAP(sound_ram_map,0) |
| 2048 | | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 1849 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 2049 | 1850 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2050 | 1851 | MDRV_SCREEN_REFRESH_RATE(55) |
| 2051 | 1852 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) |
| r869 | r870 | |
| 2077 | 1878 | |
| 2078 | 1879 | /* basic machine hardware */ |
| 2079 | 1880 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2080 | | MDRV_CPU_PROGRAM_MAP(m72_readmem,m72_writemem) |
| 2081 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 1881 | MDRV_CPU_PROGRAM_MAP(m72_map,0) |
| 1882 | MDRV_CPU_IO_MAP(m72_portmap,0) |
| 2082 | 1883 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2083 | 1884 | |
| 2084 | 1885 | MDRV_CPU_ADD(Z80, 3579545) |
| 2085 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2086 | 1886 | MDRV_CPU_PROGRAM_MAP(sound_ram_map,0) |
| 2087 | | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 1887 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 2088 | 1888 | MDRV_CPU_VBLANK_INT(fake_nmi,128) /* clocked by V1? (Vigilante) */ |
| 2089 | 1889 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2090 | 1890 | MDRV_SCREEN_REFRESH_RATE(55) |
| r869 | r870 | |
| 2121 | 1921 | |
| 2122 | 1922 | /* basic machine hardware */ |
| 2123 | 1923 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2124 | | MDRV_CPU_PROGRAM_MAP(m72_readmem,m72_writemem) |
| 2125 | | MDRV_CPU_IO_MAP(readport,xmultipl_writeport) |
| 1924 | MDRV_CPU_PROGRAM_MAP(m72_map,0) |
| 1925 | MDRV_CPU_IO_MAP(m72_portmap,0) |
| 2126 | 1926 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2127 | 1927 | |
| 2128 | 1928 | MDRV_CPU_ADD(Z80, 3579545) |
| 2129 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2130 | 1929 | MDRV_CPU_PROGRAM_MAP(sound_ram_map,0) |
| 2131 | | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 1930 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 2132 | 1931 | MDRV_CPU_VBLANK_INT(fake_nmi,128) /* clocked by V1? (Vigilante) */ |
| 2133 | 1932 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2134 | 1933 | MDRV_SCREEN_REFRESH_RATE(55) |
| r869 | r870 | |
| 2165 | 1964 | |
| 2166 | 1965 | /* basic machine hardware */ |
| 2167 | 1966 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2168 | | MDRV_CPU_PROGRAM_MAP(xmultipl_readmem,xmultipl_writemem) |
| 2169 | | MDRV_CPU_IO_MAP(readport,xmultipl_writeport) |
| 1967 | MDRV_CPU_PROGRAM_MAP(xmultipl_map,0) |
| 1968 | MDRV_CPU_IO_MAP(m72_portmap,0) |
| 2170 | 1969 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2171 | 1970 | |
| 2172 | 1971 | MDRV_CPU_ADD(Z80, 3579545) |
| 2173 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2174 | 1972 | MDRV_CPU_PROGRAM_MAP(sound_ram_map,0) |
| 2175 | | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 1973 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 2176 | 1974 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ |
| 2177 | 1975 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2178 | 1976 | MDRV_SCREEN_REFRESH_RATE(55) |
| r869 | r870 | |
| 2209 | 2007 | |
| 2210 | 2008 | /* basic machine hardware */ |
| 2211 | 2009 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2212 | | MDRV_CPU_PROGRAM_MAP(dbreed_readmem,dbreed_writemem) |
| 2213 | | MDRV_CPU_IO_MAP(readport,hharry_writeport)//xmultipl_writeport) |
| 2010 | MDRV_CPU_PROGRAM_MAP(dbreed_map,0) |
| 2011 | MDRV_CPU_IO_MAP(hharry_portmap,0) |
| 2214 | 2012 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2215 | 2013 | |
| 2216 | 2014 | MDRV_CPU_ADD(Z80, 3579545) |
| 2217 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2218 | 2015 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2219 | | MDRV_CPU_IO_MAP(rtype2_sound_readport,rtype2_sound_writeport) |
| 2016 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2220 | 2017 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ |
| 2221 | 2018 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2222 | 2019 | MDRV_SCREEN_REFRESH_RATE(55) |
| r869 | r870 | |
| 2251 | 2048 | |
| 2252 | 2049 | /* basic machine hardware */ |
| 2253 | 2050 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2254 | | MDRV_CPU_PROGRAM_MAP(dbreed72_readmem,dbreed72_writemem) |
| 2255 | | MDRV_CPU_IO_MAP(readport,xmultipl_writeport) |
| 2051 | MDRV_CPU_PROGRAM_MAP(dbreed72_map,0) |
| 2052 | MDRV_CPU_IO_MAP(m72_portmap,0) |
| 2256 | 2053 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2257 | 2054 | |
| 2258 | 2055 | MDRV_CPU_ADD(Z80, 3579545) |
| 2259 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2260 | 2056 | MDRV_CPU_PROGRAM_MAP(sound_ram_map,0) |
| 2261 | | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 2057 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 2262 | 2058 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ |
| 2263 | 2059 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2264 | 2060 | MDRV_SCREEN_REFRESH_RATE(55) |
| r869 | r870 | |
| 2294 | 2090 | |
| 2295 | 2091 | /* basic machine hardware */ |
| 2296 | 2092 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2297 | | MDRV_CPU_PROGRAM_MAP(rtype2_readmem,rtype2_writemem) |
| 2298 | | MDRV_CPU_IO_MAP(readport,rtype2_writeport) |
| 2093 | MDRV_CPU_PROGRAM_MAP(rtype2_map,0) |
| 2094 | MDRV_CPU_IO_MAP(rtype2_portmap,0) |
| 2299 | 2095 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2300 | 2096 | |
| 2301 | 2097 | MDRV_CPU_ADD(Z80, 3579545) |
| 2302 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2303 | 2098 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2304 | | MDRV_CPU_IO_MAP(rtype2_sound_readport,rtype2_sound_writeport) |
| 2099 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2305 | 2100 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ |
| 2306 | 2101 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2307 | 2102 | MDRV_SCREEN_REFRESH_RATE(55) |
| r869 | r870 | |
| 2337 | 2132 | |
| 2338 | 2133 | /* basic machine hardware */ |
| 2339 | 2134 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2340 | | MDRV_CPU_PROGRAM_MAP(majtitle_readmem,majtitle_writemem) |
| 2341 | | MDRV_CPU_IO_MAP(readport,majtitle_writeport) |
| 2135 | MDRV_CPU_PROGRAM_MAP(majtitle_map,0) |
| 2136 | MDRV_CPU_IO_MAP(majtitle_portmap,0) |
| 2342 | 2137 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2343 | 2138 | |
| 2344 | 2139 | MDRV_CPU_ADD(Z80, 3579545) |
| 2345 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2346 | 2140 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2347 | | MDRV_CPU_IO_MAP(rtype2_sound_readport,rtype2_sound_writeport) |
| 2141 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2348 | 2142 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ |
| 2349 | 2143 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2350 | 2144 | MDRV_SCREEN_REFRESH_RATE(55) |
| r869 | r870 | |
| 2380 | 2174 | |
| 2381 | 2175 | /* basic machine hardware */ |
| 2382 | 2176 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2383 | | MDRV_CPU_PROGRAM_MAP(hharry_readmem,hharry_writemem) |
| 2384 | | MDRV_CPU_IO_MAP(readport,hharry_writeport) |
| 2177 | MDRV_CPU_PROGRAM_MAP(hharry_map,0) |
| 2178 | MDRV_CPU_IO_MAP(hharry_portmap,0) |
| 2385 | 2179 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2386 | 2180 | |
| 2387 | 2181 | MDRV_CPU_ADD(Z80, 3579545) |
| 2388 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2389 | 2182 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2390 | | MDRV_CPU_IO_MAP(rtype2_sound_readport,rtype2_sound_writeport) |
| 2183 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2391 | 2184 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ |
| 2392 | 2185 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2393 | 2186 | MDRV_SCREEN_REFRESH_RATE(55) |
| r869 | r870 | |
| 2424 | 2217 | |
| 2425 | 2218 | /* basic machine hardware */ |
| 2426 | 2219 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2427 | | MDRV_CPU_PROGRAM_MAP(hharryu_readmem,hharryu_writemem) |
| 2428 | | MDRV_CPU_IO_MAP(readport,rtype2_writeport) |
| 2220 | MDRV_CPU_PROGRAM_MAP(hharryu_map,0) |
| 2221 | MDRV_CPU_IO_MAP(rtype2_portmap,0) |
| 2429 | 2222 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2430 | 2223 | |
| 2431 | 2224 | MDRV_CPU_ADD(Z80, 3579545) |
| 2432 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2433 | 2225 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2434 | | MDRV_CPU_IO_MAP(rtype2_sound_readport,rtype2_sound_writeport) |
| 2226 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2435 | 2227 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ |
| 2436 | 2228 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2437 | 2229 | MDRV_SCREEN_REFRESH_RATE(55) |
| r869 | r870 | |
| 2468 | 2260 | |
| 2469 | 2261 | /* basic machine hardware */ |
| 2470 | 2262 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2471 | | MDRV_CPU_PROGRAM_MAP(rtype2_readmem,rtype2_writemem) |
| 2472 | | MDRV_CPU_IO_MAP(poundfor_readport,rtype2_writeport) |
| 2263 | MDRV_CPU_PROGRAM_MAP(rtype2_map,0) |
| 2264 | MDRV_CPU_IO_MAP(poundfor_portmap,0) |
| 2473 | 2265 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2474 | 2266 | |
| 2475 | 2267 | MDRV_CPU_ADD(Z80, 3579545) |
| 2476 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2477 | 2268 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2478 | | MDRV_CPU_IO_MAP(poundfor_sound_readport,poundfor_sound_writeport) |
| 2269 | MDRV_CPU_IO_MAP(poundfor_sound_portmap,0) |
| 2479 | 2270 | MDRV_CPU_VBLANK_INT(fake_nmi,128) /* clocked by V1? (Vigilante) */ |
| 2480 | 2271 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2481 | 2272 | MDRV_SCREEN_REFRESH_RATE(55) |
| r869 | r870 | |
| 2510 | 2301 | |
| 2511 | 2302 | /* basic machine hardware */ |
| 2512 | 2303 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz external freq (8MHz internal) */ |
| 2513 | | MDRV_CPU_PROGRAM_MAP(kengo_readmem,kengo_writemem) |
| 2514 | | MDRV_CPU_IO_MAP(readport,kengo_writeport) |
| 2304 | MDRV_CPU_PROGRAM_MAP(kengo_map,0) |
| 2305 | MDRV_CPU_IO_MAP(kengo_portmap,0) |
| 2515 | 2306 | MDRV_CPU_VBLANK_INT(m72_interrupt,256) |
| 2516 | 2307 | |
| 2517 | 2308 | MDRV_CPU_ADD(Z80, 3579545) |
| 2518 | | /* audio CPU */ /* 3.579545 MHz */ |
| 2519 | 2309 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2520 | | MDRV_CPU_IO_MAP(rtype2_sound_readport,rtype2_sound_writeport) |
| 2310 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2521 | 2311 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ |
| 2522 | 2312 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2523 | 2313 | MDRV_SCREEN_REFRESH_RATE(55) |
src/mame/drivers/m90.c
| r869 | r870 | |
| 38 | 38 | |
| 39 | 39 | static UINT32 bankaddress; |
| 40 | 40 | |
| 41 | | extern UINT8 *m90_video_data; |
| 41 | extern UINT16 *m90_video_data; |
| 42 | 42 | |
| 43 | 43 | extern int m90_game_kludge; |
| 44 | 44 | |
| 45 | 45 | VIDEO_UPDATE( m90 ); |
| 46 | 46 | VIDEO_UPDATE( m90_bootleg ); |
| 47 | | WRITE8_HANDLER( m90_video_control_w ); |
| 48 | | WRITE8_HANDLER( m90_video_w ); |
| 47 | WRITE16_HANDLER( m90_video_control_w ); |
| 48 | WRITE16_HANDLER( m90_video_w ); |
| 49 | 49 | VIDEO_START( m90 ); |
| 50 | 50 | |
| 51 | 51 | /***************************************************************************/ |
| r869 | r870 | |
| 62 | 62 | |
| 63 | 63 | /***************************************************************************/ |
| 64 | 64 | |
| 65 | | static WRITE8_HANDLER( m90_coincounter_w ) |
| 65 | static WRITE16_HANDLER( m90_coincounter_w ) |
| 66 | 66 | { |
| 67 | | if (offset==0) |
| 67 | if (ACCESSING_LSB) |
| 68 | 68 | { |
| 69 | 69 | coin_counter_w(0,data & 0x01); |
| 70 | 70 | coin_counter_w(1,data & 0x02); |
| r869 | r870 | |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | | static WRITE8_HANDLER( quizf1_bankswitch_w ) |
| 76 | static WRITE16_HANDLER( quizf1_bankswitch_w ) |
| 77 | 77 | { |
| 78 | | if (offset == 0) |
| 78 | if (ACCESSING_LSB) |
| 79 | 79 | { |
| 80 | 80 | bankaddress = 0x10000 * (data & 0x0f); |
| 81 | 81 | set_m90_bank(); |
| r869 | r870 | |
| 84 | 84 | |
| 85 | 85 | /***************************************************************************/ |
| 86 | 86 | |
| 87 | | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 88 | | AM_RANGE(0x00000, 0x7ffff) AM_READ(MRA8_ROM) |
| 89 | | AM_RANGE(0x80000, 0x8ffff) AM_READ(MRA8_BANK1) /* Quiz F1 only */ |
| 90 | | AM_RANGE(0xa0000, 0xa3fff) AM_READ(MRA8_RAM) |
| 91 | | AM_RANGE(0xd0000, 0xdffff) AM_READ(MRA8_RAM) |
| 92 | | AM_RANGE(0xe0000, 0xe03ff) AM_READ(paletteram_r) |
| 93 | | AM_RANGE(0xffff0, 0xfffff) AM_READ(MRA8_ROM) |
| 87 | static ADDRESS_MAP_START( main_cpu, ADDRESS_SPACE_PROGRAM, 16 ) |
| 88 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 89 | AM_RANGE(0x80000, 0x8ffff) AM_ROMBANK(1) /* Quiz F1 only */ |
| 90 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 91 | AM_RANGE(0xd0000, 0xdffff) AM_RAM AM_WRITE(m90_video_w) AM_BASE(&m90_video_data) |
| 92 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) |
| 93 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 94 | 94 | ADDRESS_MAP_END |
| 95 | 95 | |
| 96 | | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 97 | | AM_RANGE(0x00000, 0x7ffff) AM_WRITE(MWA8_ROM) |
| 98 | | AM_RANGE(0x80000, 0x8ffff) AM_WRITE(MWA8_ROM) /* Quiz F1 only */ |
| 99 | | AM_RANGE(0xa0000, 0xa3fff) AM_WRITE(MWA8_RAM) |
| 100 | | AM_RANGE(0xd0000, 0xdffff) AM_WRITE(m90_video_w) AM_BASE(&m90_video_data) |
| 101 | | AM_RANGE(0xe0000, 0xe03ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_BASE(&paletteram) |
| 102 | | AM_RANGE(0xffff0, 0xfffff) AM_WRITE(MWA8_ROM) |
| 96 | static ADDRESS_MAP_START( bootleg_main_cpu, ADDRESS_SPACE_PROGRAM, 16 ) |
| 97 | AM_RANGE(0x00000, 0x3ffff) AM_ROM |
| 98 | AM_RANGE(0x6000e, 0x60fff) AM_RAM AM_BASE(&spriteram16) |
| 99 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 100 | AM_RANGE(0xd0000, 0xdffff) AM_RAM AM_WRITE(m90_video_w) AM_BASE(&m90_video_data) |
| 101 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) |
| 102 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 103 | 103 | ADDRESS_MAP_END |
| 104 | 104 | |
| 105 | | static ADDRESS_MAP_START( bootleg_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 106 | | AM_RANGE(0x00000, 0x3ffff) AM_READ(MRA8_ROM) |
| 107 | | AM_RANGE(0x60000, 0x60fff) AM_READ(MRA8_RAM) |
| 108 | | AM_RANGE(0xa0000, 0xa3fff) AM_READ(MRA8_RAM) |
| 109 | | AM_RANGE(0xd0000, 0xdffff) AM_READ(MRA8_RAM) |
| 110 | | AM_RANGE(0xe0000, 0xe03ff) AM_READ(paletteram_r) |
| 111 | | AM_RANGE(0xffff0, 0xfffff) AM_READ(MRA8_ROM) |
| 112 | | ADDRESS_MAP_END |
| 113 | | |
| 114 | | static ADDRESS_MAP_START( bootleg_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 115 | | AM_RANGE(0x00000, 0x3ffff) AM_WRITE(MWA8_ROM) |
| 116 | | AM_RANGE(0x6000e, 0x60fff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) |
| 117 | | AM_RANGE(0xa0000, 0xa3fff) AM_WRITE(MWA8_RAM) |
| 118 | | AM_RANGE(0xd0000, 0xdffff) AM_WRITE(m90_video_w) AM_BASE(&m90_video_data) |
| 119 | | AM_RANGE(0xe0000, 0xe03ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_BASE(&paletteram) |
| 120 | | AM_RANGE(0xffff0, 0xfffff) AM_WRITE(MWA8_ROM) |
| 121 | | ADDRESS_MAP_END |
| 122 | | |
| 123 | | static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 ) |
| 124 | | AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r) /* Player 1 */ |
| 125 | | AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r) /* Player 2 */ |
| 126 | | AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r) /* Coins */ |
| 127 | | AM_RANGE(0x03, 0x03) AM_READ(MRA8_NOP) /* Unused? High byte of above */ |
| 128 | | AM_RANGE(0x04, 0x04) AM_READ(input_port_3_r) /* Dip 1 */ |
| 129 | | AM_RANGE(0x05, 0x05) AM_READ(input_port_4_r) /* Dip 2 */ |
| 130 | | AM_RANGE(0x06, 0x06) AM_READ(input_port_5_r) /* Player 3 */ |
| 131 | | AM_RANGE(0x07, 0x07) AM_READ(input_port_6_r) /* Player 4 */ |
| 132 | | ADDRESS_MAP_END |
| 133 | | |
| 134 | | static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 ) |
| 105 | static ADDRESS_MAP_START( main_cpu_io, ADDRESS_SPACE_IO, 16 ) |
| 135 | 106 | AM_RANGE(0x00, 0x01) AM_WRITE(m72_sound_command_w) |
| 107 | AM_RANGE(0x00, 0x01) AM_READ(input_port_0_word_r) /* Player 1 & Player 2 */ |
| 136 | 108 | AM_RANGE(0x02, 0x03) AM_WRITE(m90_coincounter_w) |
| 109 | AM_RANGE(0x02, 0x03) AM_READ(input_port_1_word_r) /* Coins */ |
| 137 | 110 | AM_RANGE(0x04, 0x05) AM_WRITE(quizf1_bankswitch_w) |
| 111 | AM_RANGE(0x04, 0x05) AM_READ(input_port_2_word_r) /* Dip 1 & Dip 2 */ |
| 112 | AM_RANGE(0x06, 0x07) AM_READ(input_port_3_word_r) /* Player 3 & Player 4 */ |
| 138 | 113 | AM_RANGE(0x80, 0x8f) AM_WRITE(m90_video_control_w) |
| 139 | 114 | ADDRESS_MAP_END |
| 140 | 115 | |
| r869 | r870 | |
| 186 | 161 | |
| 187 | 162 | |
| 188 | 163 | INPUT_PORTS_START( hasamu ) |
| 189 | | IREM_JOYSTICK_1_2(1) |
| 190 | | IREM_JOYSTICK_1_2(2) |
| 164 | IREM_JOYSTICKS_1_2 |
| 165 | |
| 191 | 166 | IREM_COINS |
| 192 | 167 | |
| 193 | 168 | PORT_START /* Dip switch bank 1 */ |
| 194 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1") |
| 195 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 196 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 197 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") |
| 198 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 199 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 200 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") |
| 201 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 202 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 203 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") |
| 204 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 205 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 206 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") |
| 207 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 208 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 209 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:6") |
| 210 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 211 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 212 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 213 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 214 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 215 | | PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:8" ) |
| 216 | | |
| 217 | | PORT_START /* Dip switch bank 2 */ |
| 218 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 219 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 220 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 221 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") |
| 222 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 223 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 224 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") |
| 225 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 226 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 227 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 228 | | PORT_DIPSETTING( 0x08, "1" ) |
| 229 | | PORT_DIPSETTING( 0x00, "2" ) |
| 169 | PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1") |
| 170 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) |
| 171 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 172 | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") |
| 173 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) |
| 174 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 175 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") |
| 176 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 177 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 178 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") |
| 179 | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) |
| 180 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 181 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") |
| 182 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 183 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 184 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:6") |
| 185 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 186 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 187 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 188 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 189 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 190 | PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) |
| 191 | /* Dip switch bank 2 */ |
| 192 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 193 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 194 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 195 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") |
| 196 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 197 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 198 | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") |
| 199 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) |
| 200 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 201 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 202 | PORT_DIPSETTING( 0x0800, "1" ) |
| 203 | PORT_DIPSETTING( 0x0000, "2" ) |
| 230 | 204 | /* Coin Mode 1 */ |
| 231 | | IREM_COIN_MODE_1_NEW |
| 205 | IREM_COIN_MODE_1_NEW_HIGH |
| 232 | 206 | /* Coin Mode 2, not supported yet */ |
| 233 | 207 | // IREM_COIN_MODE_2 |
| 234 | 208 | INPUT_PORTS_END |
| 235 | 209 | |
| 236 | 210 | INPUT_PORTS_START( dynablst ) |
| 237 | | IREM_JOYSTICK_1_2(1) |
| 238 | | IREM_JOYSTICK_1_2(2) |
| 211 | IREM_JOYSTICKS_1_2 |
| 212 | |
| 239 | 213 | IREM_COINS |
| 240 | 214 | |
| 241 | | PORT_START_TAG("DSWA") /* Dip switch bank 1 */ |
| 242 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") |
| 243 | | PORT_DIPSETTING( 0x02, "2" ) |
| 244 | | PORT_DIPSETTING( 0x03, "3" ) |
| 245 | | PORT_DIPSETTING( 0x01, "4" ) |
| 246 | | PORT_DIPSETTING( 0x00, "5" ) |
| 247 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") |
| 248 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 249 | | PORT_DIPSETTING( 0x0c, DEF_STR( Medium ) ) |
| 250 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 251 | | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 252 | | PORT_DIPNAME( 0x10, 0x10, "Game Title" ) PORT_DIPLOCATION("SW1:5") /* Manual says "NOT USE" */ |
| 253 | | PORT_DIPSETTING( 0x10, "Dynablaster" ) |
| 254 | | PORT_DIPSETTING( 0x00, "Bomber Man" ) |
| 255 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:6") |
| 256 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 257 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 258 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 259 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 260 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 261 | | PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:8" ) |
| 262 | | |
| 263 | | PORT_START_TAG("DSWB") /* Dip switch bank 2 */ |
| 264 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 265 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 266 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 267 | | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2,3") |
| 268 | | PORT_DIPSETTING( 0x04, "2 Player Upright" ) |
| 269 | | PORT_DIPSETTING( 0x06, "4 Player Upright A" ) /* Seperate Coin Slots */ |
| 270 | | PORT_DIPSETTING( 0x02, "4 Player Upright B" ) /* Shared Coin Slots */ |
| 271 | | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) /* This setting shows screen with offset, no cocktail support :-( */ |
| 272 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 273 | | PORT_DIPSETTING( 0x08, "1" ) |
| 274 | | PORT_DIPSETTING( 0x00, "2" ) |
| 215 | PORT_START_TAG("DSW") /* Dip switch bank 1 */ |
| 216 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") |
| 217 | PORT_DIPSETTING( 0x0002, "2" ) |
| 218 | PORT_DIPSETTING( 0x0003, "3" ) |
| 219 | PORT_DIPSETTING( 0x0001, "4" ) |
| 220 | PORT_DIPSETTING( 0x0000, "5" ) |
| 221 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") |
| 222 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 223 | PORT_DIPSETTING( 0x000c, DEF_STR( Medium ) ) |
| 224 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 225 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 226 | PORT_DIPNAME( 0x0010, 0x0010, "Game Title" ) PORT_DIPLOCATION("SW1:5") /* Manual says "NOT USE" */ |
| 227 | PORT_DIPSETTING( 0x0010, "Dynablaster" ) |
| 228 | PORT_DIPSETTING( 0x0000, "Bomber Man" ) |
| 229 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:6") |
| 230 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 231 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 232 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 233 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 234 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 235 | PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) |
| 236 | /* Dip switch bank 2 */ |
| 237 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 238 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 239 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 240 | PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2,3") |
| 241 | PORT_DIPSETTING( 0x0400, "2 Player Upright" ) |
| 242 | PORT_DIPSETTING( 0x0600, "4 Player Upright A" ) /* Seperate Coin Slots */ |
| 243 | PORT_DIPSETTING( 0x0200, "4 Player Upright B" ) /* Shared Coin Slots */ |
| 244 | PORT_DIPSETTING( 0x0000, DEF_STR( Cocktail ) ) /* This setting shows screen with offset, no cocktail support :-( */ |
| 245 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 246 | PORT_DIPSETTING( 0x0800, "1" ) |
| 247 | PORT_DIPSETTING( 0x0000, "2" ) |
| 275 | 248 | /* Coin Mode 1 */ |
| 276 | | IREM_COIN_MODE_1_NEW |
| 249 | IREM_COIN_MODE_1_NEW_HIGH |
| 277 | 250 | /* Coin Mode 2, not supported yet */ |
| 278 | 251 | // IREM_COIN_MODE_2 |
| 279 | 252 | |
| 280 | | IREM_JOYSTICK_3_4(3) |
| 281 | | IREM_JOYSTICK_3_4(4) |
| 253 | IREM_JOYSTICKS_3_4 |
| 282 | 254 | INPUT_PORTS_END |
| 283 | 255 | |
| 284 | 256 | INPUT_PORTS_START( atompunk ) |
| 285 | 257 | PORT_INCLUDE(dynablst) |
| 286 | 258 | |
| 287 | | PORT_MODIFY("DSWA") |
| 288 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") /* Manual says "NOT USE" */ |
| 289 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 290 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 259 | PORT_MODIFY("DSW") |
| 260 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") /* Manual says "NOT USE" */ |
| 261 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 262 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 291 | 263 | INPUT_PORTS_END |
| 292 | 264 | |
| 293 | 265 | INPUT_PORTS_START( bombrman ) /* Does not appear to support 4 players or cocktail mode */ |
| 294 | | IREM_JOYSTICK_1_2(1) |
| 295 | | IREM_JOYSTICK_1_2(2) |
| 266 | IREM_JOYSTICKS_1_2 |
| 267 | |
| 296 | 268 | IREM_COINS |
| 297 | 269 | |
| 298 | 270 | PORT_START /* Dip switch bank 1 */ |
| 299 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 300 | | PORT_DIPSETTING( 0x02, "2" ) |
| 301 | | PORT_DIPSETTING( 0x03, "3" ) |
| 302 | | PORT_DIPSETTING( 0x01, "4" ) |
| 303 | | PORT_DIPSETTING( 0x00, "5" ) |
| 304 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 305 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 306 | | PORT_DIPSETTING( 0x0c, DEF_STR( Medium ) ) |
| 307 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 308 | | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 309 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) /* Manual says "NOT USE" */ |
| 310 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 311 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 312 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 313 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 314 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 315 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 316 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 317 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 318 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 319 | | |
| 320 | | PORT_START /* Dip switch bank 2 */ |
| 321 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) |
| 322 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 323 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 324 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) /* Manual says "NOT USE" */ |
| 325 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 326 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 327 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* Manual says "NOT USE" */ |
| 328 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 329 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 330 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) |
| 331 | | PORT_DIPSETTING( 0x08, "1" ) |
| 332 | | PORT_DIPSETTING( 0x00, "2" ) |
| 271 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 272 | PORT_DIPSETTING( 0x0002, "2" ) |
| 273 | PORT_DIPSETTING( 0x0003, "3" ) |
| 274 | PORT_DIPSETTING( 0x0001, "4" ) |
| 275 | PORT_DIPSETTING( 0x0000, "5" ) |
| 276 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 277 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 278 | PORT_DIPSETTING( 0x000c, DEF_STR( Medium ) ) |
| 279 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 280 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 281 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) /* Manual says "NOT USE" */ |
| 282 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 283 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 284 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) |
| 285 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 286 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 287 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 288 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 289 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 290 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) |
| 291 | /* Dip switch bank 2 */ |
| 292 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 293 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 294 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 295 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) /* Manual says "NOT USE" */ |
| 296 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 297 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 298 | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) /* Manual says "NOT USE" */ |
| 299 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) |
| 300 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 301 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) |
| 302 | PORT_DIPSETTING( 0x0800, "1" ) |
| 303 | PORT_DIPSETTING( 0x0000, "2" ) |
| 333 | 304 | /* Coin Mode 1 */ |
| 334 | | IREM_COIN_MODE_1_NEW |
| 305 | IREM_COIN_MODE_1_NEW_HIGH |
| 335 | 306 | /* Coin Mode 2, not supported yet */ |
| 336 | 307 | // IREM_COIN_MODE_2 |
| 337 | 308 | INPUT_PORTS_END |
| 338 | 309 | |
| 339 | 310 | INPUT_PORTS_START( bbmanw ) |
| 340 | | IREM_JOYSTICK_1_2(1) |
| 341 | | IREM_JOYSTICK_1_2(2) |
| 311 | IREM_JOYSTICKS_1_2 |
| 312 | |
| 342 | 313 | IREM_COINS |
| 343 | 314 | |
| 344 | | PORT_START_TAG("DSWA") /* Dip switch bank 1 */ |
| 345 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") |
| 346 | | PORT_DIPSETTING( 0x02, "2" ) |
| 347 | | PORT_DIPSETTING( 0x03, "3" ) |
| 348 | | PORT_DIPSETTING( 0x01, "4" ) |
| 349 | | PORT_DIPSETTING( 0x00, "5" ) |
| 350 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") |
| 351 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 352 | | PORT_DIPSETTING( 0x0c, DEF_STR( Medium ) ) |
| 353 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 354 | | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 355 | | PORT_DIPNAME( 0x10, 0x10, "Game Title" ) PORT_DIPLOCATION("SW1:5") /* Manual says "NOT USE" */ |
| 356 | | PORT_DIPSETTING( 0x10, "Bomber Man World" ) |
| 357 | | PORT_DIPSETTING( 0x00, "New Dyna Blaster Global Quest" ) |
| 358 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:6") |
| 359 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 360 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 361 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 362 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 363 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 364 | | PORT_SERVICE_DIPLOC ( 0x80, IP_ACTIVE_LOW, "SW1:8" ) |
| 365 | | |
| 366 | | PORT_START_TAG("DSWB") /* Dip switch bank 2 */ |
| 367 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 368 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 369 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 370 | | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2,3") |
| 371 | | PORT_DIPSETTING( 0x04, "2 Player" ) |
| 372 | | PORT_DIPSETTING( 0x06, "4 Player Seprate Coins" ) /* Each player has a seperate Coin Slot */ |
| 373 | | PORT_DIPSETTING( 0x02, "4 Player Shared Coins" ) /* All 4 players Share coin 1&2 */ |
| 374 | | PORT_DIPSETTING( 0x00, "4 Player 1&2 3&4 Share Coins" ) /* Players 1&2 share coin 1&2, Players 3&4 share coin 3&4 */ |
| 375 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 376 | | PORT_DIPSETTING( 0x08, "1" ) |
| 377 | | PORT_DIPSETTING( 0x00, "2" ) |
| 315 | PORT_START_TAG("DSW") /* Dip switch bank 1 */ |
| 316 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") |
| 317 | PORT_DIPSETTING( 0x0002, "2" ) |
| 318 | PORT_DIPSETTING( 0x0003, "3" ) |
| 319 | PORT_DIPSETTING( 0x0001, "4" ) |
| 320 | PORT_DIPSETTING( 0x0000, "5" ) |
| 321 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") |
| 322 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 323 | PORT_DIPSETTING( 0x000c, DEF_STR( Medium ) ) |
| 324 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 325 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 326 | PORT_DIPNAME( 0x0010, 0x0010, "Game Title" ) PORT_DIPLOCATION("SW1:5") /* Manual says "NOT USE" */ |
| 327 | PORT_DIPSETTING( 0x0010, "Bomber Man World" ) |
| 328 | PORT_DIPSETTING( 0x0000, "New Dyna Blaster Global Quest" ) |
| 329 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:6") |
| 330 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 331 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 332 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 333 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 334 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 335 | PORT_SERVICE_DIPLOC ( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) |
| 336 | /* Dip switch bank 2 */ |
| 337 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 338 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 339 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 340 | PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2,3") |
| 341 | PORT_DIPSETTING( 0x0400, "2 Player" ) |
| 342 | PORT_DIPSETTING( 0x0600, "4 Player Seprate Coins" ) /* Each player has a seperate Coin Slot */ |
| 343 | PORT_DIPSETTING( 0x0200, "4 Player Shared Coins" ) /* All 4 players Share coin 1&2 */ |
| 344 | PORT_DIPSETTING( 0x0000, "4 Player 1&2 3&4 Share Coins" ) /* Players 1&2 share coin 1&2, Players 3&4 share coin 3&4 */ |
| 345 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 346 | PORT_DIPSETTING( 0x0800, "1" ) |
| 347 | PORT_DIPSETTING( 0x0000, "2" ) |
| 378 | 348 | /* Coin Mode 1 */ |
| 379 | | IREM_COIN_MODE_1_NEW |
| 349 | IREM_COIN_MODE_1_NEW_HIGH |
| 380 | 350 | /* Coin Mode 2, not supported yet */ |
| 381 | 351 | // IREM_COIN_MODE_2 |
| 382 | 352 | |
| 383 | | IREM_JOYSTICK_3_4(3) |
| 384 | | IREM_JOYSTICK_3_4(4) |
| 353 | IREM_JOYSTICKS_3_4 |
| 385 | 354 | INPUT_PORTS_END |
| 386 | 355 | |
| 387 | 356 | INPUT_PORTS_START( bbmanwj ) |
| 388 | 357 | PORT_INCLUDE(bbmanw) |
| 389 | 358 | |
| 390 | | PORT_MODIFY("DSWA") |
| 391 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") /* Manual says "NOT USE" */ |
| 392 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 393 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 359 | PORT_MODIFY("DSW") |
| 360 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") /* Manual says "NOT USE" */ |
| 361 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 362 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 394 | 363 | INPUT_PORTS_END |
| 395 | 364 | |
| 396 | 365 | INPUT_PORTS_START( quizf1 ) |
| 397 | 366 | PORT_START |
| 398 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 399 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 400 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 401 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 402 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) |
| 403 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 404 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 405 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 406 | | PORT_START |
| 407 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 408 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 409 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 410 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 411 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) |
| 412 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 413 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 414 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 367 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 368 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 369 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 370 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 371 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) |
| 372 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 373 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 374 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 375 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 376 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 377 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 378 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 379 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) |
| 380 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 381 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 382 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 383 | |
| 415 | 384 | IREM_COINS |
| 416 | 385 | |
| 417 | 386 | PORT_START /* Dip switch bank 1 */ |
| 418 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") |
| 419 | | PORT_DIPSETTING( 0x02, "2" ) |
| 420 | | PORT_DIPSETTING( 0x03, "3" ) |
| 421 | | PORT_DIPSETTING( 0x01, "4" ) |
| 422 | | PORT_DIPSETTING( 0x00, "5" ) |
| 423 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") /* Probably difficulty */ |
| 424 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 425 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 426 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") |
| 427 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 428 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 429 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") |
| 430 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 431 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 432 | | PORT_DIPNAME( 0x20, 0x00, "Input Device" ) PORT_DIPLOCATION("SW1:6") /* input related (joystick/buttons select?) */ |
| 433 | | PORT_DIPSETTING( 0x20, DEF_STR( Joystick ) ) |
| 434 | | PORT_DIPSETTING( 0x00, "Buttons" ) |
| 435 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 436 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 437 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 438 | | PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:8" ) |
| 439 | | |
| 440 | | PORT_START /* Dip switch bank 2 */ |
| 441 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 442 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 443 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 444 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") |
| 445 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 446 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 447 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") |
| 448 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 449 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 450 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 451 | | PORT_DIPSETTING( 0x08, "1" ) |
| 452 | | PORT_DIPSETTING( 0x00, "2" ) |
| 387 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") |
| 388 | PORT_DIPSETTING( 0x0002, "2" ) |
| 389 | PORT_DIPSETTING( 0x0003, "3" ) |
| 390 | PORT_DIPSETTING( 0x0001, "4" ) |
| 391 | PORT_DIPSETTING( 0x0000, "5" ) |
| 392 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") /* Probably difficulty */ |
| 393 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 394 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 395 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") |
| 396 | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) |
| 397 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 398 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") |
| 399 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 400 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 401 | PORT_DIPNAME( 0x0020, 0x0000, "Input Device" ) PORT_DIPLOCATION("SW1:6") /* input related (joystick/buttons select?) */ |
| 402 | PORT_DIPSETTING( 0x0020, DEF_STR( Joystick ) ) |
| 403 | PORT_DIPSETTING( 0x0000, "Buttons" ) |
| 404 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 405 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 406 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 407 | PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) |
| 408 | /* Dip switch bank 2 */ |
| 409 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 410 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 411 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 412 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") |
| 413 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 414 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 415 | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") |
| 416 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) |
| 417 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 418 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 419 | PORT_DIPSETTING( 0x0800, "1" ) |
| 420 | PORT_DIPSETTING( 0x0000, "2" ) |
| 453 | 421 | /* Coin Mode 1 */ |
| 454 | | IREM_COIN_MODE_1_NEW |
| 422 | IREM_COIN_MODE_1_NEW_HIGH |
| 455 | 423 | /* Coin Mode 2, not supported yet */ |
| 456 | 424 | // IREM_COIN_MODE_2 |
| 457 | 425 | INPUT_PORTS_END |
| 458 | 426 | |
| 459 | 427 | INPUT_PORTS_START( matchit2 ) |
| 460 | 428 | PORT_START |
| 461 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 462 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 463 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 464 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 465 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 466 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 467 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 468 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 429 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 430 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 431 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 432 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 433 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 434 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 435 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 436 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 437 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 438 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 439 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 440 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 441 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 442 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 443 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 444 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 469 | 445 | |
| 470 | 446 | PORT_START |
| 471 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 472 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 473 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 474 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 475 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 476 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 477 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 478 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 479 | | |
| 480 | | PORT_START |
| 481 | 447 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 482 | 448 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 483 | 449 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r869 | r870 | |
| 488 | 454 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 489 | 455 | |
| 490 | 456 | PORT_START /* Dip switch bank 1 */ |
| 491 | | PORT_DIPNAME( 0x01, 0x01, "Girls Mode" ) PORT_DIPLOCATION("SW1:1") |
| 492 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 493 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 494 | | PORT_DIPNAME( 0x02, 0x02, "China Tiles" ) PORT_DIPLOCATION("SW1:2") |
| 495 | | PORT_DIPSETTING( 0x02, "Mahjong" ) |
| 496 | | PORT_DIPSETTING( 0x00, "Alpha-Numeric" ) |
| 497 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") |
| 498 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) |
| 499 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 500 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 501 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 502 | | PORT_DIPNAME( 0x30, 0x30, "Timer Speed" ) PORT_DIPLOCATION("SW1:5,6") |
| 503 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) |
| 504 | | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) |
| 505 | | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) |
| 506 | | PORT_DIPSETTING( 0x20, DEF_STR( Easy ) ) |
| 507 | | PORT_DIPNAME( 0x40, 0x40, "Title Screen" ) PORT_DIPLOCATION("SW1:7") |
| 508 | | PORT_DIPSETTING( 0x40, "Match It II" ) |
| 509 | | PORT_DIPSETTING( 0x00, "Shisensho II" ) |
| 510 | | PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:8" ) |
| 511 | | |
| 512 | | PORT_START /* Dip switch bank 2 */ |
| 513 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 514 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 515 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 516 | | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:2,3") |
| 517 | | PORT_DIPSETTING( 0x06, DEF_STR( English ) ) |
| 518 | | PORT_DIPSETTING( 0x04, DEF_STR( German ) ) |
| 519 | | PORT_DIPSETTING( 0x02, "Korean" ) |
| 520 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 521 | | PORT_DIPSETTING( 0x08, "1" ) |
| 522 | | PORT_DIPSETTING( 0x00, "2" ) |
| 457 | PORT_DIPNAME( 0x0001, 0x0001, "Girls Mode" ) PORT_DIPLOCATION("SW1:1") |
| 458 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 459 | PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) |
| 460 | PORT_DIPNAME( 0x0002, 0x0002, "China Tiles" ) PORT_DIPLOCATION("SW1:2") |
| 461 | PORT_DIPSETTING( 0x0002, "Mahjong" ) |
| 462 | PORT_DIPSETTING( 0x0000, "Alpha-Numeric" ) |
| 463 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") |
| 464 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Hard ) ) |
| 465 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 466 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 467 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 468 | PORT_DIPNAME( 0x0030, 0x0030, "Timer Speed" ) PORT_DIPLOCATION("SW1:5,6") |
| 469 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Hard ) ) |
| 470 | PORT_DIPSETTING( 0x0010, DEF_STR( Hard ) ) |
| 471 | PORT_DIPSETTING( 0x0030, DEF_STR( Normal ) ) |
| 472 | PORT_DIPSETTING( 0x0020, DEF_STR( Easy ) ) |
| 473 | PORT_DIPNAME( 0x0040, 0x0040, "Title Screen" ) PORT_DIPLOCATION("SW1:7") |
| 474 | PORT_DIPSETTING( 0x0040, "Match It II" ) |
| 475 | PORT_DIPSETTING( 0x0000, "Shisensho II" ) |
| 476 | PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) |
| 477 | /* Dip switch bank 2 */ |
| 478 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 479 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 480 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 481 | PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:2,3") |
| 482 | PORT_DIPSETTING( 0x0600, DEF_STR( English ) ) |
| 483 | PORT_DIPSETTING( 0x0400, DEF_STR( German ) ) |
| 484 | PORT_DIPSETTING( 0x0200, "Korean" ) |
| 485 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 486 | PORT_DIPSETTING( 0x0800, "1" ) |
| 487 | PORT_DIPSETTING( 0x0000, "2" ) |
| 523 | 488 | /* Coin Mode 1 */ |
| 524 | | IREM_COIN_MODE_1_NEW |
| 489 | IREM_COIN_MODE_1_NEW_HIGH |
| 525 | 490 | /* Coin Mode 2, not supported yet */ |
| 526 | 491 | // IREM_COIN_MODE_2 |
| 527 | 492 | INPUT_PORTS_END |
| 528 | 493 | |
| 529 | 494 | INPUT_PORTS_START( shisen2 ) |
| 530 | 495 | PORT_START |
| 531 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 532 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 533 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 534 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 535 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 536 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 537 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 538 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 496 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 497 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 498 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 499 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 500 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 501 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 502 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 503 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 504 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 505 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 506 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 507 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 508 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 509 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 510 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 511 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 539 | 512 | |
| 540 | 513 | PORT_START |
| 541 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 542 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 543 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 544 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 545 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 546 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 547 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 548 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 549 | | |
| 550 | | PORT_START |
| 551 | 514 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 552 | 515 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 553 | 516 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r869 | r870 | |
| 558 | 521 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 559 | 522 | |
| 560 | 523 | PORT_START /* Dip switch bank 1 */ |
| 561 | | PORT_DIPNAME( 0x01, 0x01, "Girls Mode" ) PORT_DIPLOCATION("SW1:1") |
| 562 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 563 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 564 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") |
| 565 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 566 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 567 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") |
| 568 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) |
| 569 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 570 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 571 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 572 | | PORT_DIPNAME( 0x30, 0x30, "Timer Speed" ) PORT_DIPLOCATION("SW1:5,6") |
| 573 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) |
| 574 | | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) |
| 575 | | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) |
| 576 | | PORT_DIPSETTING( 0x20, DEF_STR( Easy ) ) |
| 577 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 578 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 579 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 580 | | PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:8" ) |
| 581 | | |
| 582 | | PORT_START /* Dip switch bank 2 */ |
| 583 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 584 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 585 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 586 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") |
| 587 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 588 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 589 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") |
| 590 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 591 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 592 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 593 | | PORT_DIPSETTING( 0x08, "1" ) |
| 594 | | PORT_DIPSETTING( 0x00, "2" ) |
| 524 | PORT_DIPNAME( 0x0001, 0x0001, "Girls Mode" ) PORT_DIPLOCATION("SW1:1") |
| 525 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 526 | PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) |
| 527 | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") |
| 528 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) |
| 529 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 530 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") |
| 531 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Hard ) ) |
| 532 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 533 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 534 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 535 | PORT_DIPNAME( 0x0030, 0x0030, "Timer Speed" ) PORT_DIPLOCATION("SW1:5,6") |
| 536 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Hard ) ) |
| 537 | PORT_DIPSETTING( 0x0010, DEF_STR( Hard ) ) |
| 538 | PORT_DIPSETTING( 0x0030, DEF_STR( Normal ) ) |
| 539 | PORT_DIPSETTING( 0x0020, DEF_STR( Easy ) ) |
| 540 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 541 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 542 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 543 | PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) |
| 544 | /* Dip switch bank 2 */ |
| 545 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 546 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 547 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 548 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") |
| 549 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 550 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 551 | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") |
| 552 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) |
| 553 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 554 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 555 | PORT_DIPSETTING( 0x0800, "1" ) |
| 556 | PORT_DIPSETTING( 0x0000, "2" ) |
| 595 | 557 | /* Coin Mode 1 */ |
| 596 | | IREM_COIN_MODE_1_NEW |
| 558 | IREM_COIN_MODE_1_NEW_HIGH |
| 597 | 559 | /* Coin Mode 2, not supported yet */ |
| 598 | 560 | // IREM_COIN_MODE_2 |
| 599 | 561 | INPUT_PORTS_END |
| 600 | 562 | |
| 601 | 563 | INPUT_PORTS_START( riskchal ) |
| 602 | | IREM_JOYSTICK_1_2(1) |
| 603 | | IREM_JOYSTICK_1_2(2) |
| 564 | IREM_JOYSTICKS_1_2 |
| 565 | |
| 604 | 566 | IREM_COINS |
| 605 | 567 | |
| 606 | 568 | PORT_START /* Dip switch bank 1 */ |
| 607 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") |
| 608 | | PORT_DIPSETTING( 0x02, "2" ) |
| 609 | | PORT_DIPSETTING( 0x03, "3" ) |
| 610 | | PORT_DIPSETTING( 0x01, "4" ) |
| 611 | | PORT_DIPSETTING( 0x00, "5" ) |
| 612 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") |
| 613 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 614 | | PORT_DIPSETTING( 0x0c, DEF_STR( Medium ) ) |
| 615 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 616 | | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 617 | | PORT_DIPNAME( 0x10, 0x10, "Game Title" ) PORT_DIPLOCATION("SW1:5") /* Manual says "NOT USE" */ |
| 618 | | PORT_DIPSETTING( 0x10, "Bomber Man World" ) |
| 619 | | PORT_DIPSETTING( 0x00, "New Dyna Blaster Global Quest" ) |
| 620 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:6") |
| 621 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 622 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 623 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 624 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 625 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 626 | | PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:8" ) |
| 627 | | |
| 628 | | PORT_START /* Dip switch bank 2 */ |
| 629 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 630 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 631 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 632 | | PORT_DIPNAME( 0x06, 0x06, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2,3") |
| 633 | | PORT_DIPSETTING( 0x04, "2 Player" ) |
| 634 | | PORT_DIPSETTING( 0x06, "4 Player Seprate Coins" ) /* Each player has a seperate Coin Slot */ |
| 635 | | PORT_DIPSETTING( 0x02, "4 Player Shared Coins" ) /* All 4 players Share coin 1&2 */ |
| 636 | | PORT_DIPSETTING( 0x00, "4 Player 1&2 3&4 Share Coins" ) /* Players 1&2 share coin 1&2, Players 3&4 share coin 3&4 */ |
| 637 | | PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 638 | | PORT_DIPSETTING( 0x08, "1" ) |
| 639 | | PORT_DIPSETTING( 0x00, "2" ) |
| 569 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") |
| 570 | PORT_DIPSETTING( 0x0002, "2" ) |
| 571 | PORT_DIPSETTING( 0x0003, "3" ) |
| 572 | PORT_DIPSETTING( 0x0001, "4" ) |
| 573 | PORT_DIPSETTING( 0x0000, "5" ) |
| 574 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") |
| 575 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 576 | PORT_DIPSETTING( 0x000c, DEF_STR( Medium ) ) |
| 577 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 578 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 579 | PORT_DIPNAME( 0x0010, 0x0010, "Game Title" ) PORT_DIPLOCATION("SW1:5") /* Manual says "NOT USE" */ |
| 580 | PORT_DIPSETTING( 0x0010, "Bomber Man World" ) |
| 581 | PORT_DIPSETTING( 0x0000, "New Dyna Blaster Global Quest" ) |
| 582 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:6") |
| 583 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 584 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 585 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") |
| 586 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 587 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 588 | PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) |
| 589 | /* Dip switch bank 2 */ |
| 590 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") |
| 591 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 592 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 593 | PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2,3") |
| 594 | PORT_DIPSETTING( 0x0400, "2 Player" ) |
| 595 | PORT_DIPSETTING( 0x0600, "4 Player Seprate Coins" ) /* Each player has a seperate Coin Slot */ |
| 596 | PORT_DIPSETTING( 0x0200, "4 Player Shared Coins" ) /* All 4 players Share coin 1&2 */ |
| 597 | PORT_DIPSETTING( 0x0000, "4 Player 1&2 3&4 Share Coins" ) /* Players 1&2 share coin 1&2, Players 3&4 share coin 3&4 */ |
| 598 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) PORT_DIPLOCATION("SW2:4") |
| 599 | PORT_DIPSETTING( 0x0800, "1" ) |
| 600 | PORT_DIPSETTING( 0x0000, "2" ) |
| 640 | 601 | /* Coin Mode 1 */ |
| 641 | | IREM_COIN_MODE_1_NEW |
| 602 | IREM_COIN_MODE_1_NEW_HIGH |
| 642 | 603 | /* Coin Mode 2, not supported yet */ |
| 643 | 604 | // IREM_COIN_MODE_2 |
| 644 | 605 | |
| 645 | | IREM_JOYSTICK_3_4(3) |
| 646 | | IREM_JOYSTICK_3_4(4) |
| 606 | IREM_JOYSTICKS_3_4 |
| 647 | 607 | INPUT_PORTS_END |
| 648 | 608 | |
| 649 | 609 | /*****************************************************************************/ |
| r869 | r870 | |
| 702 | 662 | |
| 703 | 663 | /* basic machine hardware */ |
| 704 | 664 | MDRV_CPU_ADD(V30,32000000/4) /* 8 MHz ??????? */ |
| 705 | | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 706 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 665 | MDRV_CPU_PROGRAM_MAP(main_cpu,0) |
| 666 | MDRV_CPU_IO_MAP(main_cpu_io,0) |
| 707 | 667 | MDRV_CPU_VBLANK_INT(m90_interrupt,1) |
| 708 | 668 | |
| 709 | 669 | MDRV_CPU_ADD(Z80, 3579545) |
| r869 | r870 | |
| 752 | 712 | |
| 753 | 713 | /* basic machine hardware */ |
| 754 | 714 | MDRV_CPU_ADD(V30,32000000/4) /* 8 MHz ??????? */ |
| 755 | | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 756 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 715 | MDRV_CPU_PROGRAM_MAP(main_cpu,0) |
| 716 | MDRV_CPU_IO_MAP(main_cpu_io,0) |
| 757 | 717 | MDRV_CPU_VBLANK_INT(m90_interrupt,1) |
| 758 | 718 | |
| 759 | 719 | MDRV_CPU_ADD(Z80, 3579545) |
| r869 | r870 | |
| 794 | 754 | |
| 795 | 755 | /* basic machine hardware */ |
| 796 | 756 | MDRV_CPU_ADD_TAG("main",V30,32000000/4) /* 8 MHz ??????? */ |
| 797 | | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 798 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 757 | MDRV_CPU_PROGRAM_MAP(main_cpu,0) |
| 758 | MDRV_CPU_IO_MAP(main_cpu_io,0) |
| 799 | 759 | MDRV_CPU_VBLANK_INT(m90_interrupt,1) |
| 800 | 760 | |
| 801 | 761 | MDRV_CPU_ADD(Z80, 3579545) |
| r869 | r870 | |
| 843 | 803 | |
| 844 | 804 | /* basic machine hardware */ |
| 845 | 805 | MDRV_CPU_ADD(V30,32000000/4) /* 16 MHz */ |
| 846 | | MDRV_CPU_PROGRAM_MAP(bootleg_readmem,bootleg_writemem) |
| 847 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 806 | MDRV_CPU_PROGRAM_MAP(bootleg_main_cpu,0) |
| 807 | MDRV_CPU_IO_MAP(main_cpu_io,0) |
| 848 | 808 | MDRV_CPU_VBLANK_INT(m90_interrupt,1) |
| 849 | 809 | |
| 850 | 810 | MDRV_CPU_ADD(Z80, 3579545) |
| r869 | r870 | |
| 1169 | 1129 | } |
| 1170 | 1130 | |
| 1171 | 1131 | /* Bomberman World executes encrypted code from RAM! */ |
| 1172 | | static UINT8 *bbmanw_ram_base; |
| 1132 | static UINT16 *bbmanw_ram_base; |
| 1173 | 1133 | extern UINT8 *irem_cpu_decrypted; |
| 1174 | 1134 | |
| 1175 | | static WRITE8_HANDLER( bbmanw_ram_write ) |
| 1135 | static WRITE16_HANDLER( bbmanw_ram_write ) |
| 1176 | 1136 | { |
| 1177 | | bbmanw_ram_base[offset]=data; |
| 1178 | | irem_cpu_decrypted[0xa0c00+offset]=dynablaster_decryption_table[data]; |
| 1137 | COMBINE_DATA(&bbmanw_ram_base[offset]); |
| 1138 | if (ACCESSING_LSB) |
| 1139 | irem_cpu_decrypted[0xa0c00+offset*2]=dynablaster_decryption_table[data & 0xff]; |
| 1140 | if (ACCESSING_MSB) |
| 1141 | irem_cpu_decrypted[0xa0c00+offset*2+1]=dynablaster_decryption_table[(data >> 8) & 0xff]; |
| 1179 | 1142 | } |
| 1180 | 1143 | |
| 1181 | | static READ8_HANDLER( bbmanw_ram_read ) |
| 1144 | static READ16_HANDLER( bbmanw_ram_read ) |
| 1182 | 1145 | { |
| 1183 | 1146 | return bbmanw_ram_base[offset]; |
| 1184 | 1147 | } |
| r869 | r870 | |
| 1188 | 1151 | m90_game_kludge=0; |
| 1189 | 1152 | irem_cpu_decrypt(0,dynablaster_decryption_table); |
| 1190 | 1153 | |
| 1191 | | bbmanw_ram_base = memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0c00, 0xa0cff, 0, 0, bbmanw_ram_write); |
| 1192 | | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0c00, 0xa0cff, 0, 0, bbmanw_ram_read); |
| 1154 | bbmanw_ram_base = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0c00, 0xa0cff, 0, 0, bbmanw_ram_write); |
| 1155 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa0c00, 0xa0cff, 0, 0, bbmanw_ram_read); |
| 1193 | 1156 | } |
| 1194 | 1157 | |
| 1195 | 1158 | static DRIVER_INIT( quizf1 ) |
src/mame/drivers/lockon.c
| r869 | r870 | |
| 22 | 22 | #include "driver.h" |
| 23 | 23 | #include "sound/2203intf.h" |
| 24 | 24 | |
| 25 | | static UINT8 *lockon_vram0; |
| 26 | | static UINT8 *lockon_vram1; |
| 27 | | static UINT8 *lockon_vram2; |
| 28 | | static UINT8 *object_ram; |
| 29 | | static UINT8 *ground_ram; |
| 25 | static UINT16 *lockon_vram0; |
| 26 | static UINT16 *lockon_vram1; |
| 27 | static UINT16 *lockon_vram2; |
| 28 | static UINT16 *object_ram; |
| 29 | static UINT16 *ground_ram; |
| 30 | 30 | static UINT8 *z80_ram; |
| 31 | | static UINT8 *v30_gnd; |
| 32 | | static UINT8 *v30_obj; |
| 33 | | static UINT8 *clut_ram; |
| 31 | static UINT16 *v30_gnd; |
| 32 | static UINT16 *v30_obj; |
| 33 | static UINT16 *clut_ram; |
| 34 | 34 | |
| 35 | 35 | static int v30_obj_addr=0; |
| 36 | 36 | static int v30_gnd_addr=0; |
| r869 | r870 | |
| 71 | 71 | UINT8 *ROM_LUTB = (UINT8 *)memory_region(REGION_USER2); |
| 72 | 72 | UINT8 *ROM_LUTC = (UINT8 *)memory_region(REGION_USER2)+0x8000; // Selected by bit 7... |
| 73 | 73 | |
| 74 | | for (offs = 0x0; offs <= (objectram_size); offs += 8) |
| 74 | for (offs = 0x0; offs <= (objectram_size/2); offs += 4) |
| 75 | 75 | { |
| 76 | | |
| 77 | | |
| 78 | | int offs0 = object_ram[offs+6] << 8; // Lower 6-bits go into upper ROM portion |
| 79 | | int bit7 = (object_ram[offs+6] >> 7) & 0x1; // Selects which ROM to use in calculating lookup |
| 76 | int offs0 = (object_ram[offs+3] & 0x3f) << 8; // Lower 6-bits go into upper ROM portion |
| 77 | int bit7 = (object_ram[offs+3] >> 7) & 0x1; // Selects which ROM to use in calculating lookup |
| 80 | 78 | int lut; |
| 81 | 79 | |
| 82 | | if(!object_ram[offs+4] && !object_ram[offs+5]) |
| 83 | | continue; |
| 84 | | if(object_ram[offs+7] == 0xfc || object_ram[offs+7] == 0xff) // ? |
| 85 | | break; |
| 80 | if(!object_ram[offs+2]) |
| 81 | continue; |
| 82 | if((object_ram[offs+3] >> 8) == 0xfc || (object_ram[offs+3] >> 8) == 0xff) // ? |
| 83 | break; |
| 86 | 84 | |
| 87 | 85 | if(!bit7) |
| 88 | 86 | lut = (ROM_LUTC[offs0 | (index_y<<4) | index_x]) & 0x7f; |
| r869 | r870 | |
| 93 | 91 | // Bits 0-11 obj |
| 94 | 92 | for(index_y=0; index_y<8; index_y++) |
| 95 | 93 | { |
| 96 | | |
| 97 | 94 | int index_x; |
| 98 | | for(index_x=0; index_x<8; index_x++) |
| 99 | | { |
| 95 | for(index_x=0; index_x<8; index_x++) |
| 96 | { |
| 100 | 97 | |
| 101 | | /* Index into the object lookup table */ |
| 98 | /* Index into the object lookup table */ |
| 99 | int ref = object_ram[offs+2] + lut; |
| 102 | 100 | |
| 103 | | int ROM_LUT_HI = object_ram[offs+5] << 8; |
| 101 | int pix = ROM_LUTA[ref+index_x+(16*index_y)]; // ??? |
| 104 | 102 | |
| 105 | | /* This is calculated from another LUT and current tile? */ |
| 106 | | int ROM_LUT_LO = object_ram[offs+4] + lut; |
| 103 | int flip_x = 0;//(object_ram[offs+1] >> 7) & 0x1; // Bit 15 |
| 104 | int flip_y = 0;//(object_ram[offs+1] >> 6) & 0x1; // Bit 14 |
| 107 | 105 | |
| 108 | | int ref = ROM_LUT_LO + ROM_LUT_HI; |
| 106 | int scale_x = 0xffff; //+ object_ram[offs+1] & 0xff; //0x1ffff; |
| 107 | int scale_y = 0xffff; //+ object_ram[offs+1] >> 8; //0x1ffff; |
| 109 | 108 | |
| 110 | | int pix = ROM_LUTA[ref+index_x+(16*index_y)]; // ??? |
| 109 | int sy = 255-(object_ram[offs] & 0xff)+(index_y*8)*(scale_y/0xffff); |
| 110 | int sx = (object_ram[offs] >> 8)+(index_x*8)*(scale_x/0xffff); |
| 111 | 111 | |
| 112 | | int flip_x = 0;//(object_ram[offs+3] >> 8) & 0x1; // Bit 15 |
| 113 | | int flip_y = 0;//(object_ram[offs+3] >> 7) & 0x1; // Bit 14 |
| 112 | int bank = ((pix >> 12) & 0x7); |
| 113 | int index = pix & 0xfff; |
| 114 | 114 | |
| 115 | | int scale_x = 0xffff; //+ object_ram[offs+2]; //0x1ffff; |
| 116 | | int scale_y = 0xffff; //+ object_ram[offs+3]; //0x1ffff; |
| 115 | int color = 1; |
| 117 | 116 | |
| 118 | | int sy = 255-object_ram[offs]+(index_y*8)*(scale_y/0xffff); |
| 119 | | int sx = (object_ram[offs+1])+(index_x*8)*(scale_x/0xffff); |
| 117 | const gfx_element *gfx = machine->gfx[bank]; |
| 120 | 118 | |
| 121 | | int bank = ((pix >> 12) & 0x7); |
| 122 | | int index = pix & 0xfff; |
| 123 | | |
| 124 | | int color = 1; |
| 125 | | |
| 126 | | const gfx_element *gfx = machine->gfx[bank]; |
| 127 | | |
| 128 | | drawgfxzoom(bitmap, gfx, |
| 129 | | index, |
| 130 | | color, |
| 131 | | flip_x,flip_y, // FlipX, flipY |
| 132 | | sx,sy, |
| 133 | | cliprect,TRANSPARENCY_PEN,1, |
| 134 | | scale_x,scale_y); |
| 135 | | } |
| 119 | drawgfxzoom(bitmap, gfx, |
| 120 | index, |
| 121 | color, |
| 122 | flip_x,flip_y, // FlipX, flipY |
| 123 | sx,sy, |
| 124 | cliprect,TRANSPARENCY_PEN,1, |
| 125 | scale_x,scale_y); |
| 126 | } |
| 136 | 127 | } |
| 137 | | } |
| 128 | } |
| 138 | 129 | } |
| 139 | 130 | |
| 140 | 131 | /* Characters */ |
| 141 | | WRITE8_HANDLER( lockon_vram_0_w ) |
| 132 | WRITE16_HANDLER( lockon_vram_0_w ) |
| 142 | 133 | { |
| 143 | | lockon_vram0[offset] = data; |
| 144 | | tilemap_mark_tile_dirty(lockon_tilemap0,offset/2); |
| 134 | COMBINE_DATA(&lockon_vram0[offset]); |
| 135 | tilemap_mark_tile_dirty(lockon_tilemap0,offset); |
| 145 | 136 | } |
| 146 | 137 | |
| 147 | 138 | /* Scene */ |
| 148 | | WRITE8_HANDLER( lockon_vram_1_w ) |
| 139 | WRITE16_HANDLER( lockon_vram_1_w ) |
| 149 | 140 | { |
| 150 | | lockon_vram1[offset] = data; |
| 151 | | tilemap_mark_tile_dirty(lockon_tilemap1,offset/2); |
| 141 | COMBINE_DATA(&lockon_vram1[offset]); |
| 142 | tilemap_mark_tile_dirty(lockon_tilemap1,offset); |
| 152 | 143 | } |
| 153 | 144 | |
| 154 | 145 | /* HUD */ |
| 155 | | WRITE8_HANDLER( lockon_vram_2_w ) |
| 146 | WRITE16_HANDLER( lockon_vram_2_w ) |
| 156 | 147 | { |
| 157 | | lockon_vram2[offset] = data; |
| 158 | | tilemap_mark_tile_dirty(lockon_tilemap2,offset/2); |
| 148 | COMBINE_DATA(&lockon_vram2[offset]); |
| 149 | tilemap_mark_tile_dirty(lockon_tilemap2,offset); |
| 159 | 150 | } |
| 160 | 151 | |
| 161 | 152 | /* 8*8 characters */ |
| 162 | 153 | static TILE_GET_INFO( get_lockon_tile_info0 ) |
| 163 | 154 | { |
| 164 | | int upper, lower, tileno, color; |
| 165 | | tile_index <<= 1; |
| 166 | | upper = (lockon_vram0[tile_index+1]&0x03)<<8; |
| 167 | | lower = (lockon_vram0[tile_index]); |
| 168 | | tileno = (upper + lower); |
| 155 | int tileno, color; |
| 156 | tileno = lockon_vram0[tile_index]; |
| 169 | 157 | color = 0; |
| 170 | 158 | |
| 171 | 159 | SET_TILE_INFO(4,tileno,color,0); |
| r869 | r870 | |
| 174 | 162 | /* Scene tiles */ |
| 175 | 163 | static TILE_GET_INFO( get_lockon_tile_info1 ) |
| 176 | 164 | { |
| 177 | | int upper, lower, tileno, color; |
| 178 | | tile_index <<= 1; |
| 179 | | upper = (lockon_vram1[tile_index+1]<<8); |
| 180 | | lower = (lockon_vram1[tile_index]); |
| 181 | | tileno = (upper + lower); |
| 165 | int tileno, color; |
| 166 | tileno = lockon_vram1[tile_index]; |
| 182 | 167 | color = 0; |
| 183 | 168 | |
| 184 | 169 | SET_TILE_INFO(5,tileno,color,0); |
| r869 | r870 | |
| 187 | 172 | /* HUD tiles */ |
| 188 | 173 | static TILE_GET_INFO( get_lockon_tile_info2 ) |
| 189 | 174 | { |
| 190 | | int upper, lower, tileno, color; |
| 191 | | tile_index <<= 1; |
| 192 | | upper = (lockon_vram1[tile_index+1]<<8); |
| 193 | | lower = (lockon_vram1[tile_index]); |
| 194 | | tileno = (upper + lower); |
| 175 | int tileno, color; |
| 176 | tileno = lockon_vram2[tile_index]; |
| 195 | 177 | color = 0; |
| 196 | 178 | |
| 197 | 179 | SET_TILE_INFO(6,tileno,color,0); |
| r869 | r870 | |
| 208 | 190 | |
| 209 | 191 | VIDEO_UPDATE( lockon ) |
| 210 | 192 | { |
| 211 | | tilemap_draw(bitmap,cliprect,lockon_tilemap1,0,0); // Scene |
| 212 | | tilemap_draw(bitmap,cliprect,lockon_tilemap0,0,0); // Characters |
| 213 | | // tilemap_draw(bitmap,cliprect,lockon_tilemap2,0,0); // HUD |
| 214 | | draw_sprites(machine,bitmap,cliprect); |
| 193 | tilemap_draw(bitmap,cliprect,lockon_tilemap1,0,0); // Scene |
| 194 | tilemap_draw(bitmap,cliprect,lockon_tilemap0,0,0); // Characters |
| 195 | //tilemap_draw(bitmap,cliprect,lockon_tilemap2,0,0); // HUD |
| 196 | draw_sprites(machine,bitmap,cliprect); |
| 215 | 197 | return 0; |
| 216 | 198 | } |
| 217 | 199 | |
| 218 | 200 | /* Wrong last time I checked */ |
| 219 | 201 | INPUT_PORTS_START( lockon ) |
| 220 | | PORT_START_TAG("DSWA") |
| 221 | | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) |
| 222 | | PORT_DIPSETTING( 0x00, "5" ) |
| 223 | | PORT_DIPSETTING( 0x01, "4" ) |
| 224 | | PORT_DIPSETTING( 0x02, "2" ) |
| 225 | | PORT_DIPSETTING( 0x03, "3" ) |
| 202 | PORT_START_TAG("DSW") |
| 203 | PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Lives ) ) |
| 204 | PORT_DIPSETTING( 0x0000, "5" ) |
| 205 | PORT_DIPSETTING( 0x0001, "4" ) |
| 206 | PORT_DIPSETTING( 0x0002, "2" ) |
| 207 | PORT_DIPSETTING( 0x0003, "3" ) |
| 226 | 208 | |
| 227 | | PORT_DIPNAME( 0x06, 0x08, DEF_STR( Difficulty ) ) |
| 228 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 229 | | PORT_DIPSETTING( 0x06, DEF_STR( Normal ) ) |
| 230 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 231 | | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 209 | PORT_DIPNAME( 0x0006, 0x0008, DEF_STR( Difficulty ) ) |
| 210 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 211 | PORT_DIPSETTING( 0x0006, DEF_STR( Normal ) ) |
| 212 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 213 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 232 | 214 | |
| 233 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) |
| 234 | | PORT_DIPSETTING( 0x10, "150K & every 200K" ) |
| 235 | | PORT_DIPSETTING( 0x00, "200K & every 200K" ) |
| 215 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) ) |
| 216 | PORT_DIPSETTING( 0x0010, "150K & every 200K" ) |
| 217 | PORT_DIPSETTING( 0x0000, "200K & every 200K" ) |
| 236 | 218 | |
| 237 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 238 | | PORT_DIPSETTING( 0x20, DEF_STR( No ) ) |
| 239 | | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 219 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) |
| 220 | PORT_DIPSETTING( 0x0020, DEF_STR( No ) ) |
| 221 | PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) |
| 240 | 222 | |
| 241 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) |
| 242 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 243 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 223 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) ) |
| 224 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 225 | PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) |
| 244 | 226 | |
| 245 | | PORT_START_TAG("DSWB") |
| 246 | | PORT_DIPNAME( 0x03, 0x00, "Coins" ) |
| 247 | | PORT_DIPSETTING( 0x00, "Free" ) |
| 248 | | PORT_DIPSETTING( 0x01, "4" ) |
| 249 | | PORT_DIPSETTING( 0x02, "2" ) |
| 250 | | PORT_DIPSETTING( 0x03, "3" ) |
| 227 | PORT_DIPNAME( 0x0300, 0x0000, "Coins" ) |
| 228 | PORT_DIPSETTING( 0x0000, "Free" ) |
| 229 | PORT_DIPSETTING( 0x0100, "4" ) |
| 230 | PORT_DIPSETTING( 0x0200, "2" ) |
| 231 | PORT_DIPSETTING( 0x0300, "3" ) |
| 251 | 232 | |
| 252 | | PORT_START |
| 233 | PORT_START |
| 253 | 234 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 254 | 235 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 255 | 236 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) // Service coin |
| r869 | r870 | |
| 263 | 244 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 264 | 245 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 265 | 246 | |
| 266 | | PORT_START_TAG("analog_bank") |
| 247 | PORT_START_TAG("analog_bank") |
| 267 | 248 | PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) |
| 268 | | PORT_START_TAG("analog_pitch") |
| 249 | |
| 250 | PORT_START_TAG("analog_pitch") |
| 269 | 251 | PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) |
| 270 | | PORT_START_TAG("analog_missile") |
| 252 | |
| 253 | PORT_START_TAG("analog_missile") |
| 271 | 254 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_BUTTON3 ) // Digital input read by ADC |
| 272 | | PORT_START_TAG("analog_hover") |
| 255 | |
| 256 | PORT_START_TAG("analog_hover") |
| 273 | 257 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_BUTTON4 ) // Digital input read by ADC |
| 274 | 258 | INPUT_PORTS_END |
| 275 | 259 | |
| 276 | 260 | |
| 277 | 261 | static READ8_HANDLER(adc_r) |
| 278 | 262 | { |
| 279 | | switch(offset) |
| 280 | | { |
| 281 | | case 0: return readinputportbytag("analog_bank"); |
| 282 | | case 1: return readinputportbytag("analog_pitch"); |
| 283 | | case 2: return readinputportbytag("analog_missile"); |
| 284 | | case 3: return readinputportbytag("analog_hover"); |
| 285 | | default: return 0; |
| 286 | | } |
| 263 | switch(offset) |
| 264 | { |
| 265 | case 0: return readinputportbytag("analog_bank"); |
| 266 | case 1: return readinputportbytag("analog_pitch"); |
| 267 | case 2: return readinputportbytag("analog_missile"); |
| 268 | case 3: return readinputportbytag("analog_hover"); |
| 269 | default: return 0; |
| 270 | } |
| 287 | 271 | } |
| 288 | 272 | |
| 289 | | static READ8_HANDLER(unk_read) |
| 273 | static READ16_HANDLER(unk_read) |
| 290 | 274 | { |
| 291 | | return 1; // Main CPU jumps to 18002 otherwise |
| 275 | return 1; // Main CPU jumps to 18002 otherwise |
| 292 | 276 | } |
| 293 | 277 | |
| 294 | 278 | |
| r869 | r870 | |
| 316 | 300 | Bit 7 = /ZCCLR Clear screen |
| 317 | 301 | */ |
| 318 | 302 | |
| 319 | | static WRITE8_HANDLER(adrst_w) |
| 303 | static WRITE16_HANDLER(adrst_w) |
| 320 | 304 | { |
| 321 | | v30_gnd_addr = (data & 0x3); |
| 322 | | v30_obj_addr = (data & 0x18) >> 3; |
| 305 | if (ACCESSING_LSB) |
| 306 | { |
| 307 | v30_gnd_addr = (data & 0x3); |
| 308 | v30_obj_addr = (data & 0x18) >> 3; |
| 323 | 309 | |
| 324 | | if (data & 0x04) |
| 325 | | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); |
| 326 | | else |
| 327 | | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); |
| 310 | if (data & 0x04) |
| 311 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); |
| 312 | else |
| 313 | cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE); |
| 328 | 314 | |
| 329 | | if (data & 0x20) |
| 330 | | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); |
| 331 | | else |
| 332 | | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); |
| 315 | if (data & 0x20) |
| 316 | cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); |
| 317 | else |
| 318 | cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); |
| 333 | 319 | |
| 334 | | /* Suspend the Z80 when writing to shared RAM */ |
| 335 | | if (data & 0x40) |
| 336 | | cpunum_set_input_line(3, INPUT_LINE_HALT, CLEAR_LINE); |
| 337 | | else |
| 338 | | cpunum_set_input_line(3, INPUT_LINE_HALT, ASSERT_LINE); |
| 320 | /* Suspend the Z80 when writing to shared RAM */ |
| 321 | if (data & 0x40) |
| 322 | cpunum_set_input_line(3, INPUT_LINE_HALT, CLEAR_LINE); |
| 323 | else |
| 324 | cpunum_set_input_line(3, INPUT_LINE_HALT, ASSERT_LINE); |
| 325 | } |
| 339 | 326 | } |
| 340 | 327 | |
| 341 | | static READ8_HANDLER(z80_shared_r) |
| 328 | static READ16_HANDLER(z80_shared_r) |
| 342 | 329 | { |
| 343 | | return z80_ram[offset/2]; |
| 330 | return z80_ram[offset] | 0xff00; |
| 344 | 331 | } |
| 345 | 332 | |
| 346 | | static WRITE8_HANDLER(z80_shared_w) |
| 333 | static WRITE16_HANDLER(z80_shared_w) |
| 347 | 334 | { |
| 348 | | if(offset%2 == 0) z80_ram[offset/2]=data; |
| 335 | if (ACCESSING_LSB) |
| 336 | z80_ram[offset] = data; |
| 349 | 337 | } |
| 350 | 338 | |
| 351 | | static READ8_HANDLER(main_gnd_r) |
| 339 | static READ16_HANDLER(main_gnd_r) |
| 352 | 340 | { |
| 353 | | UINT8 result; |
| 341 | UINT16 result; |
| 354 | 342 | cpuintrf_push_context(1); |
| 355 | | result = program_read_byte(offset | (v30_gnd_addr << 16)); |
| 343 | result = program_read_word((offset * 2) | (v30_gnd_addr << 16)); |
| 356 | 344 | cpuintrf_pop_context(); |
| 357 | 345 | return result; |
| 358 | 346 | } |
| 359 | 347 | |
| 360 | | static WRITE8_HANDLER(main_gnd_w) |
| 348 | static WRITE16_HANDLER(main_gnd_w) |
| 361 | 349 | { |
| 362 | 350 | cpuintrf_push_context(1); |
| 363 | | program_write_byte(offset | (v30_gnd_addr << 16), data); |
| 351 | if (ACCESSING_LSB) |
| 352 | program_write_byte((offset * 2 + 0) | (v30_gnd_addr << 16), data); |
| 353 | if (ACCESSING_MSB) |
| 354 | program_write_byte((offset * 2 + 1) | (v30_gnd_addr << 16), data >> 8); |
| 364 | 355 | cpuintrf_pop_context(); |
| 365 | 356 | } |
| 366 | 357 | |
| 367 | | static READ8_HANDLER(main_obj_r) |
| 358 | static READ16_HANDLER(main_obj_r) |
| 368 | 359 | { |
| 369 | | UINT8 result; |
| 360 | UINT16 result; |
| 370 | 361 | cpuintrf_push_context(2); |
| 371 | | result = program_read_byte(offset | (v30_obj_addr << 16)); |
| 362 | result = program_read_word((offset * 2) | (v30_obj_addr << 16)); |
| 372 | 363 | cpuintrf_pop_context(); |
| 373 | 364 | return result; |
| 374 | 365 | } |
| 375 | 366 | |
| 376 | | static WRITE8_HANDLER(main_obj_w) |
| 367 | static WRITE16_HANDLER(main_obj_w) |
| 377 | 368 | { |
| 378 | 369 | cpuintrf_push_context(2); |
| 379 | | program_write_byte(offset | (v30_obj_addr << 16), data); |
| 370 | if (ACCESSING_LSB) |
| 371 | program_write_byte((offset * 2 + 0) | (v30_obj_addr << 16), data); |
| 372 | if (ACCESSING_MSB) |
| 373 | program_write_byte((offset * 2 + 1) | (v30_obj_addr << 16), data >> 8); |
| 380 | 374 | cpuintrf_pop_context(); |
| 381 | 375 | } |
| 382 | 376 | |
| 383 | 377 | |
| 384 | | static WRITE8_HANDLER(testcs_w) |
| 378 | static WRITE16_HANDLER(testcs_w) |
| 385 | 379 | { |
| 386 | | if(offset<0x800) |
| 380 | if (offset < 0x400) |
| 387 | 381 | { |
| 388 | 382 | cpuintrf_push_context(1); |
| 389 | | program_write_byte(offset | (v30_gnd_addr << 16), data); |
| 383 | if (ACCESSING_LSB) |
| 384 | program_write_byte((offset*2+0) | (v30_gnd_addr << 16), data); |
| 385 | if (ACCESSING_MSB) |
| 386 | program_write_byte((offset*2+1) | (v30_gnd_addr << 16), data >> 8); |
| 390 | 387 | cpuintrf_pop_context(); |
| 391 | 388 | |
| 392 | 389 | cpuintrf_push_context(2); |
| 393 | | program_write_byte(offset | (v30_obj_addr << 16), data); |
| 390 | if (ACCESSING_LSB) |
| 391 | program_write_byte((offset*2+0) | (v30_obj_addr << 16), data); |
| 392 | if (ACCESSING_MSB) |
| 393 | program_write_byte((offset*2+1) | (v30_obj_addr << 16), data >> 8); |
| 394 | 394 | cpuintrf_pop_context(); |
| 395 | 395 | } |
| 396 | 396 | } |
| r869 | r870 | |
| 407 | 407 | 6 LO3_04A A14 |
| 408 | 408 | 7 CS - ROMs |
| 409 | 409 | */ |
| 410 | | static WRITE8_HANDLER(ground_bank_w) |
| 410 | static WRITE16_HANDLER(ground_bank_w) |
| 411 | 411 | { |
| 412 | 412 | // Nothing here yet |
| 413 | 413 | } |
| r869 | r870 | |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | /* Allow /CUDISP to interrupt main CPU */ |
| 423 | | static WRITE8_HANDLER(inten_w) |
| 423 | static WRITE16_HANDLER(inten_w) |
| 424 | 424 | { |
| 425 | | main_inten = 1; |
| 425 | main_inten = TRUE; |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | /* Reset watchdog and mask /CUDISP interrupt */ |
| 429 | | static WRITE8_HANDLER(emres_w) |
| 429 | static WRITE16_HANDLER(emres_w) |
| 430 | 430 | { |
| 431 | | // Implement watchdog reset here. |
| 432 | | main_inten = 0; |
| 431 | // Implement watchdog reset here. |
| 432 | main_inten = FALSE; |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | |
| 436 | | static ADDRESS_MAP_START( main_v30, ADDRESS_SPACE_PROGRAM, 8 ) |
| 437 | | AM_RANGE(0x00000, 0x03fff) AM_RAM // IC69/IC70 |
| 438 | | AM_RANGE(0x04000, 0x04003) AM_NOP // CRT Controller |
| 439 | | AM_RANGE(0x06000, 0x06000) AM_READ(port_tag_to_handler8("DSWA")) |
| 440 | | AM_RANGE(0x06001, 0x06001) AM_READ(port_tag_to_handler8("DSWB")) |
| 441 | | AM_RANGE(0x08000, 0x081ff) AM_READWRITE(MRA8_RAM,lockon_vram_2_w) AM_BASE(&lockon_vram2) // HUD RAM (IC30/IC31) |
| 442 | | AM_RANGE(0x09000, 0x09fff) AM_READWRITE(MRA8_RAM,lockon_vram_0_w) AM_BASE(&lockon_vram0) // Character RAM |
| 443 | | AM_RANGE(0x0a000, 0x0a001) AM_WRITE(adrst_w) // /ADRST: CPU access register |
| 444 | | AM_RANGE(0x0b000, 0x0bfff) AM_RAM // /BKBCS - ground control registers |
| 445 | | AM_RANGE(0x0c000, 0x0cfff) AM_RAM AM_BASE(&clut_ram) // /CCRS - 8kB palette RAM - write only |
| 446 | | AM_RANGE(0x0e000, 0x0e001) AM_WRITE(inten_w) // /INTEN: /CUDISP interrupt enable |
| 447 | | AM_RANGE(0x0f000, 0x0f001) AM_WRITE(emres_w) // /EMRES: Watchdog reset and interrupt mask |
| 448 | | AM_RANGE(0x10000, 0x1ffff) AM_WRITE(testcs_w) // /TESTCS: Write to both object and ground CPU RAM |
| 449 | | AM_RANGE(0x18000, 0x18001) AM_READ(unk_read) // Not sure what this is |
| 450 | | AM_RANGE(0x20000, 0x2dfff) AM_ROM // Z80 ROM |
| 451 | | AM_RANGE(0x2f000, 0x2ffff) AM_READWRITE(z80_shared_r, z80_shared_w) // Z80 shared RAM |
| 452 | | AM_RANGE(0x30000, 0x3ffff) AM_READWRITE(main_gnd_r, main_gnd_w) // Ground CPU memory access |
| 453 | | AM_RANGE(0x40000, 0x4ffff) AM_READWRITE(main_obj_r, main_obj_w) // Object CPU memory access |
| 454 | | AM_RANGE(0x50000, 0x5ffff) AM_ROM // IC76/IC77 |
| 455 | | AM_RANGE(0x60000, 0x6ffff) AM_ROM // IC88/IC89 |
| 456 | | AM_RANGE(0xf0000, 0xfffff) AM_ROM // IC95/IC96 |
| 436 | static ADDRESS_MAP_START( main_v30, ADDRESS_SPACE_PROGRAM, 16 ) |
| 437 | AM_RANGE(0x00000, 0x03fff) AM_RAM // IC69/IC70 |
| 438 | AM_RANGE(0x04000, 0x04003) AM_NOP // CRT Controller |
| 439 | AM_RANGE(0x06000, 0x06001) AM_READ_PORT("DSW") |
| 440 | AM_RANGE(0x08000, 0x081ff) AM_READWRITE(MRA16_RAM,lockon_vram_2_w) AM_BASE(&lockon_vram2) // HUD RAM (IC30/IC31) |
| 441 | AM_RANGE(0x09000, 0x09fff) AM_READWRITE(MRA16_RAM,lockon_vram_0_w) AM_BASE(&lockon_vram0) // Character RAM |
| 442 | AM_RANGE(0x0a000, 0x0a001) AM_WRITE(adrst_w) // /ADRST: CPU access register |
| 443 | AM_RANGE(0x0b000, 0x0bfff) AM_RAM // /BKBCS - ground control registers |
| 444 | AM_RANGE(0x0c000, 0x0cfff) AM_RAM AM_BASE(&clut_ram) // /CCRS - 8kB palette RAM - write only |
| 445 | AM_RANGE(0x0e000, 0x0e001) AM_WRITE(inten_w) // /INTEN: /CUDISP interrupt enable |
| 446 | AM_RANGE(0x0f000, 0x0f001) AM_WRITE(emres_w) // /EMRES: Watchdog reset and interrupt mask |
| 447 | AM_RANGE(0x10000, 0x1ffff) AM_WRITE(testcs_w) // /TESTCS: Write to both object and ground CPU RAM |
| 448 | AM_RANGE(0x18000, 0x18001) AM_READ(unk_read) // Not sure what this is |
| 449 | AM_RANGE(0x20000, 0x2dfff) AM_ROM // Z80 ROM |
| 450 | AM_RANGE(0x2f000, 0x2ffff) AM_READWRITE(z80_shared_r, z80_shared_w) // Z80 shared RAM |
| 451 | AM_RANGE(0x30000, 0x3ffff) AM_READWRITE(main_gnd_r, main_gnd_w) // Ground CPU memory access |
| 452 | AM_RANGE(0x40000, 0x4ffff) AM_READWRITE(main_obj_r, main_obj_w) // Object CPU memory access |
| 453 | AM_RANGE(0x50000, 0x5ffff) AM_ROM // IC76/IC77 |
| 454 | AM_RANGE(0x60000, 0x6ffff) AM_ROM // IC88/IC89 |
| 455 | AM_RANGE(0xf0000, 0xfffff) AM_ROM // IC95/IC96 |
| 457 | 456 | ADDRESS_MAP_END |
| 458 | 457 | |
| 459 | | static ADDRESS_MAP_START( ground_v30, ADDRESS_SPACE_PROGRAM, 8 ) |
| 460 | | ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) ) |
| 461 | | AM_RANGE(0x00000, 0x03fff) AM_RAM AM_BASE(&v30_gnd) // IC31/IC34) |
| 462 | | AM_RANGE(0x04000, 0x04fff) AM_READWRITE(MRA8_RAM,lockon_vram_1_w) AM_BASE(&lockon_vram1) // Scene RAM (IC112/IC113) |
| 463 | | AM_RANGE(0x08000, 0x08fff) AM_RAM AM_BASE(&ground_ram) AM_SIZE(&lockon_ground_size) // Ground RAM (IC98/IC99) |
| 464 | | AM_RANGE(0x0C000, 0x0C001) AM_RAM // /SHNH CS: Horizontal Scroll |
| 465 | | AM_RANGE(0x0C002, 0x0C003) AM_RAM // /SHNV CS: Vertical Scroll |
| 466 | | AM_RANGE(0x0C004, 0x0C005) AM_RAM AM_WRITE(ground_bank_w) // /UNB CS: Ground ROM Bank select |
| 467 | | AM_RANGE(0x20000, 0x2ffff) AM_ROM // Ground ROM (IC30/IC33) |
| 468 | | AM_RANGE(0x30000, 0x3ffff) AM_ROM // Program ROM mirror (use macros?) |
| 469 | | AM_RANGE(0xe0000, 0xeffff) AM_ROM // Ground ROM mirror |
| 470 | | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 458 | static ADDRESS_MAP_START( ground_v30, ADDRESS_SPACE_PROGRAM, 16 ) |
| 459 | ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) ) |
| 460 | AM_RANGE(0x00000, 0x03fff) AM_RAM AM_BASE(&v30_gnd) // IC31/IC34) |
| 461 | AM_RANGE(0x04000, 0x04fff) AM_READWRITE(MRA16_RAM,lockon_vram_1_w) AM_BASE(&lockon_vram1) // Scene RAM (IC112/IC113) |
| 462 | AM_RANGE(0x08000, 0x08fff) AM_RAM AM_BASE(&ground_ram) AM_SIZE(&lockon_ground_size) // Ground RAM (IC98/IC99) |
| 463 | AM_RANGE(0x0c000, 0x0c001) AM_RAM // /SHNH CS: Horizontal Scroll |
| 464 | AM_RANGE(0x0c002, 0x0c003) AM_RAM // /SHNV CS: Vertical Scroll |
| 465 | AM_RANGE(0x0c004, 0x0c005) AM_RAM AM_WRITE(ground_bank_w) // /UNB CS: Ground ROM Bank select |
| 466 | AM_RANGE(0x20000, 0x2ffff) AM_ROM // Ground ROM (IC30/IC33) |
| 467 | AM_RANGE(0x30000, 0x3ffff) AM_ROM // Program ROM mirror (use macros?) |
| 468 | AM_RANGE(0xe0000, 0xeffff) AM_ROM // Ground ROM mirror |
| 469 | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 471 | 470 | ADDRESS_MAP_END |
| 472 | 471 | |
| 473 | | static ADDRESS_MAP_START( object_v30, ADDRESS_SPACE_PROGRAM, 8 ) |
| 474 | | AM_RANGE(0x00000, 0x03fff) AM_RAM AM_BASE(&v30_obj) // Work RAM (IC29, IC44) |
| 475 | | AM_RANGE(0x04000, 0x04001) AM_RAM // Read = assert CPU /POLL input (halt on WAIT instruction) |
| 476 | | AM_RANGE(0x08000, 0x081ff) AM_RAM // TZA112 sprite chip write? |
| 477 | | AM_RANGE(0x0c000, 0x0c1ff) AM_RAM AM_BASE(&object_ram) AM_SIZE(&objectram_size) // Object RAM (IC39/IC54) |
| 478 | | AM_RANGE(0x20000, 0x2ffff) AM_ROM // Program ROM mirror |
| 479 | | AM_RANGE(0xf0000, 0xfffff) AM_ROM // Program ROM |
| 472 | static ADDRESS_MAP_START( object_v30, ADDRESS_SPACE_PROGRAM, 16 ) |
| 473 | AM_RANGE(0x00000, 0x03fff) AM_RAM AM_BASE(&v30_obj) // Work RAM (IC29, IC44) |
| 474 | AM_RANGE(0x04000, 0x04001) AM_RAM // Read = assert CPU /POLL input (halt on WAIT instruction) |
| 475 | AM_RANGE(0x08000, 0x081ff) AM_RAM // TZA112 sprite chip write? |
| 476 | AM_RANGE(0x0c000, 0x0c1ff) AM_RAM AM_BASE(&object_ram) AM_SIZE(&objectram_size) // Object RAM (IC39/IC54) |
| 477 | AM_RANGE(0x20000, 0x2ffff) AM_ROM // Program ROM mirror |
| 478 | AM_RANGE(0xf0000, 0xfffff) AM_ROM // Program ROM |
| 480 | 479 | ADDRESS_MAP_END |
| 481 | 480 | |
| 482 | 481 | static ADDRESS_MAP_START( sound_prg, ADDRESS_SPACE_PROGRAM, 8 ) |
| 483 | 482 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 484 | 483 | AM_RANGE(0xf810, 0xf810) AM_WRITE(MWA8_NOP) // /TS |
| 485 | 484 | AM_RANGE(0x7000, 0x7000) AM_WRITE(MWA8_NOP) // Attenuate YM3014 output (not used?) |
| 486 | | AM_RANGE(0x7400, 0x7403) AM_READWRITE(adc_r,MWA8_NOP) // M58990 ADC |
| 485 | AM_RANGE(0x7400, 0x7403) AM_READWRITE(adc_r,MWA8_NOP) // M58990 ADC |
| 487 | 486 | AM_RANGE(0x7800, 0x7fff) AM_RAM AM_BASE(&z80_ram) |
| 488 | 487 | ADDRESS_MAP_END |
| 489 | 488 | |
| 490 | 489 | static ADDRESS_MAP_START( sound_io, ADDRESS_SPACE_IO, 8 ) |
| 491 | 490 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 492 | | AM_RANGE(0x00, 0x00) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w) |
| 491 | AM_RANGE(0x00, 0x00) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w) |
| 493 | 492 | AM_RANGE(0x01, 0x01) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w) |
| 494 | 493 | ADDRESS_MAP_END |
| 495 | 494 | |
| r869 | r870 | |
| 586 | 585 | }; |
| 587 | 586 | |
| 588 | 587 | static MACHINE_DRIVER_START( lockon ) |
| 589 | | MDRV_CPU_ADD(V30,8000000 ) |
| 590 | | MDRV_CPU_PROGRAM_MAP(main_v30,0) |
| 588 | MDRV_CPU_ADD(V30,8000000) |
| 589 | MDRV_CPU_PROGRAM_MAP(main_v30,0) |
| 591 | 590 | |
| 592 | | MDRV_CPU_ADD(V30,8000000 ) |
| 591 | MDRV_CPU_ADD(V30,8000000) |
| 593 | 592 | MDRV_CPU_PROGRAM_MAP(ground_v30,0) |
| 594 | 593 | |
| 595 | | MDRV_CPU_ADD(V30,8000000 ) |
| 594 | MDRV_CPU_ADD(V30,8000000) |
| 596 | 595 | MDRV_CPU_PROGRAM_MAP(object_v30,0) |
| 597 | 596 | |
| 598 | | MDRV_CPU_ADD(Z80,4000000 ) |
| 597 | MDRV_CPU_ADD(Z80,4000000) |
| 599 | 598 | MDRV_CPU_PROGRAM_MAP(sound_prg,0) |
| 600 | 599 | MDRV_CPU_IO_MAP(sound_io,0) |
| 601 | 600 | |
| r869 | r870 | |
| 606 | 605 | |
| 607 | 606 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 608 | 607 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 609 | | MDRV_SCREEN_SIZE(320, 240) |
| 610 | | MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239) |
| 608 | MDRV_SCREEN_SIZE(320, 240) |
| 609 | MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239) |
| 611 | 610 | MDRV_GFXDECODE(gfxdecodeinfo) |
| 612 | 611 | |
| 613 | 612 | MDRV_PALETTE_LENGTH(1024) |
| r869 | r870 | |
| 622 | 621 | MDRV_SOUND_ROUTE(0, "left", 0.2) |
| 623 | 622 | MDRV_SOUND_ROUTE(1, "left", 0.4) |
| 624 | 623 | MDRV_SOUND_ROUTE(2, "left", 0.4) |
| 625 | | MDRV_SOUND_ROUTE(3, "left", 0.4) |
| 624 | MDRV_SOUND_ROUTE(3, "left", 0.4) |
| 626 | 625 | MDRV_SOUND_ROUTE(0, "right", 0.2) |
| 627 | 626 | MDRV_SOUND_ROUTE(1, "right", 0.4) |
| 628 | 627 | MDRV_SOUND_ROUTE(2, "right", 0.4) |
| r869 | r870 | |
| 632 | 631 | |
| 633 | 632 | ROM_START( lockon ) |
| 634 | 633 | ROM_REGION( 0x100000, REGION_CPU1, 0 ) |
| 635 | | ROM_LOAD16_BYTE( "lo1_02c", 0x50000, 0x8000, CRC(bbf17263) SHA1(96821a0ecd6efe6764380fef094f87c1d6e1d299) ) |
| 636 | | ROM_LOAD16_BYTE( "lo1_03c", 0x50001, 0x8000, CRC(fa58fd36) SHA1(16af24027610bf6d3fdc4c3df3bf6d94c6776420) ) |
| 634 | ROM_LOAD16_BYTE( "lo1_02c", 0x50000, 0x8000, CRC(bbf17263) SHA1(96821a0ecd6efe6764380fef094f87c1d6e1d299) ) |
| 635 | ROM_LOAD16_BYTE( "lo1_03c", 0x50001, 0x8000, CRC(fa58fd36) SHA1(16af24027610bf6d3fdc4c3df3bf6d94c6776420) ) |
| 637 | 636 | |
| 638 | | ROM_LOAD16_BYTE( "lo1_04c", 0x60000, 0x8000, CRC(4a88576e) SHA1(80a8bd89cedebf080b2c08a6e81d3c2754024d8a) ) |
| 639 | | ROM_LOAD16_BYTE( "lo1_05c", 0x60001, 0x8000, CRC(5a171b02) SHA1(f41f641136574e6af67c2245eb5a84799984474a) ) |
| 637 | ROM_LOAD16_BYTE( "lo1_04c", 0x60000, 0x8000, CRC(4a88576e) SHA1(80a8bd89cedebf080b2c08a6e81d3c2754024d8a) ) |
| 638 | ROM_LOAD16_BYTE( "lo1_05c", 0x60001, 0x8000, CRC(5a171b02) SHA1(f41f641136574e6af67c2245eb5a84799984474a) ) |
| 640 | 639 | |
| 641 | | ROM_LOAD16_BYTE( "lo1_00c", 0xf0000, 0x8000, CRC(e2db493b) SHA1(7491c634b698973ea54c25612d1e79c7efea8a45) ) |
| 642 | | ROM_LOAD16_BYTE( "lo1_01c", 0xf0001, 0x8000, CRC(3e6065e0) SHA1(d870f5b466fab90d5c51dd27ecc807e7b38b5f79)) |
| 640 | ROM_LOAD16_BYTE( "lo1_00c", 0xf0000, 0x8000, CRC(e2db493b) SHA1(7491c634b698973ea54c25612d1e79c7efea8a45) ) |
| 641 | ROM_LOAD16_BYTE( "lo1_01c", 0xf0001, 0x8000, CRC(3e6065e0) SHA1(d870f5b466fab90d5c51dd27ecc807e7b38b5f79)) |
| 643 | 642 | |
| 644 | | // Z80 |
| 645 | | ROM_LOAD16_BYTE( "lo1_08b", 0x20000, 0x8000, CRC(73860ec9) SHA1(a94afa274321b9f9ac2184e133132f9829fb9485) ) |
| 643 | // Z80 |
| 644 | ROM_LOAD16_BYTE( "lo1_08b", 0x20000, 0x8000, CRC(73860ec9) SHA1(a94afa274321b9f9ac2184e133132f9829fb9485) ) |
| 646 | 645 | |
| 647 | | // TF013 V30 (Ground) |
| 648 | | ROM_REGION( 0x100000, REGION_CPU2, 0 ) |
| 649 | | ROM_LOAD16_BYTE( "lo3_01a", 0x20000, 0x8000, CRC(3eacdb6b) SHA1(7934c36dac9253dec4d8910954f6f2ae85951fe9) ) |
| 650 | | ROM_RELOAD( 0xe0000, 0x8000 ) |
| 651 | | ROM_LOAD16_BYTE( "lo3_03a", 0x20001, 0x8000, CRC(4ce96d71) SHA1(cedbc33e86a93d11d5e11c2ef18bcf6390790a88) ) |
| 652 | | ROM_RELOAD( 0xe0001, 0x8000 ) |
| 646 | // TF013 V30 (Ground) |
| 647 | ROM_REGION( 0x100000, REGION_CPU2, 0 ) |
| 648 | ROM_LOAD16_BYTE( "lo3_01a", 0x20000, 0x8000, CRC(3eacdb6b) SHA1(7934c36dac9253dec4d8910954f6f2ae85951fe9) ) |
| 649 | ROM_RELOAD( 0xe0000, 0x8000 ) |
| 650 | ROM_LOAD16_BYTE( "lo3_03a", 0x20001, 0x8000, CRC(4ce96d71) SHA1(cedbc33e86a93d11d5e11c2ef18bcf6390790a88) ) |
| 651 | ROM_RELOAD( 0xe0001, 0x8000 ) |
| 653 | 652 | |
| 654 | | ROM_LOAD16_BYTE( "lo3_00b", 0xf0000, 0x8000, CRC(1835dccb) SHA1(8dfb0fea61a3e61f4da3b7f0da02cd19df2e68be) ) |
| 655 | | ROM_RELOAD( 0x30000, 0x8000 ) |
| 656 | | ROM_LOAD16_BYTE( "lo3_02b", 0xf0001, 0x8000, CRC(2b8931d3) SHA1(f6f40b7857f3d47da8626450b1c1d3c46a1072ab) ) |
| 657 | | ROM_RELOAD( 0x30001, 0x8000 ) |
| 653 | ROM_LOAD16_BYTE( "lo3_00b", 0xf0000, 0x8000, CRC(1835dccb) SHA1(8dfb0fea61a3e61f4da3b7f0da02cd19df2e68be) ) |
| 654 | ROM_RELOAD( 0x30000, 0x8000 ) |
| 655 | ROM_LOAD16_BYTE( "lo3_02b", 0xf0001, 0x8000, CRC(2b8931d3) SHA1(f6f40b7857f3d47da8626450b1c1d3c46a1072ab) ) |
| 656 | ROM_RELOAD( 0x30001, 0x8000 ) |
| 658 | 657 | |
| 659 | | // TF014 V30 (Object) |
| 658 | // TF014 V30 (Object) |
| 660 | 659 | ROM_REGION( 0x100000, REGION_CPU3, 0 ) |
| 661 | | ROM_LOAD16_BYTE( "lo4_00b", 0xf0000, 0x8000, CRC(5f6b5a50) SHA1(daf82cafcae86d05587c191b0ff194ca7950e130) ) |
| 662 | | ROM_RELOAD( 0x30000, 0x8000 ) |
| 660 | ROM_LOAD16_BYTE( "lo4_00b", 0xf0000, 0x8000, CRC(5f6b5a50) SHA1(daf82cafcae86d05587c191b0ff194ca7950e130) ) |
| 661 | ROM_RELOAD( 0x30000, 0x8000 ) |
| 663 | 662 | |
| 664 | | ROM_LOAD16_BYTE( "lo4_01b", 0xf0001, 0x8000, CRC(7e88bcf2) SHA1(d541458ba6178ec3bce0e9b872b9fa1d8edb107c) ) |
| 665 | | ROM_RELOAD( 0x30001, 0x8000 ) |
| 663 | ROM_LOAD16_BYTE( "lo4_01b", 0xf0001, 0x8000, CRC(7e88bcf2) SHA1(d541458ba6178ec3bce0e9b872b9fa1d8edb107c) ) |
| 664 | ROM_RELOAD( 0x30001, 0x8000 ) |
| 666 | 665 | |
| 667 | | // TF014 Z80 (Sound) |
| 668 | | ROM_REGION( 0x10000, REGION_CPU4, 0 ) |
| 669 | | ROM_LOAD( "lo1_08b", 0x00000, 0x8000, CRC(73860ec9) SHA1(a94afa274321b9f9ac2184e133132f9829fb9485) ) |
| 666 | // TF014 Z80 (Sound) |
| 667 | ROM_REGION( 0x10000, REGION_CPU4, 0 ) |
| 668 | ROM_LOAD( "lo1_08b", 0x00000, 0x8000, CRC(73860ec9) SHA1(a94afa274321b9f9ac2184e133132f9829fb9485) ) |
| 670 | 669 | |
| 671 | | // 8x8x8 object chunks |
| 672 | | ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 673 | | ROM_LOAD( "lo5_00a", 0x00000, 0x8000, CRC(e9f23ce6) SHA1(4030384a0e8f47e8eea9483482ed1be264aec992) ) |
| 674 | | ROM_LOAD( "lo5_04a", 0x08000, 0x8000, CRC(099323bc) SHA1(001d30f4c3c27277fadac89dcf616ff89eb0ea1c) ) |
| 675 | | ROM_LOAD( "lo5_08a", 0x10000, 0x8000, CRC(9dedeff5) SHA1(53b0917a4fde4053182d38ea7f99f66e52543c10) ) |
| 676 | | ROM_LOAD( "lo5_12a", 0x18000, 0x8000, CRC(2f5164ab) SHA1(df775b9e1c3c605a85d44404e4db42e33e80e664) ) |
| 677 | | ROM_LOAD( "lo5_16a", 0x20000, 0x8000, CRC(c4500159) SHA1(e695e31e363cc954aab449f9d3dbc027e27fe7bf) ) |
| 678 | | ROM_LOAD( "lo5_20a", 0x28000, 0x8000, CRC(3c1a67b5) SHA1(399935830b32a457ad0de243dd3eb4d368d5c6a6) ) |
| 679 | | ROM_LOAD( "lo5_24a", 0x30000, 0x8000, CRC(1892d083) SHA1(8ee92be93ac222ecc2d9f4fcda3099b1db67516c) ) |
| 680 | | ROM_LOAD( "lo5_28a", 0x38000, 0x8000, CRC(1186f9b4) SHA1(55598552dafa8cccfb423fc3b65a7fa15831d75b) ) |
| 670 | // 8x8x8 object chunks |
| 671 | ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 672 | ROM_LOAD( "lo5_00a", 0x00000, 0x8000, CRC(e9f23ce6) SHA1(4030384a0e8f47e8eea9483482ed1be264aec992) ) |
| 673 | ROM_LOAD( "lo5_04a", 0x08000, 0x8000, CRC(099323bc) SHA1(001d30f4c3c27277fadac89dcf616ff89eb0ea1c) ) |
| 674 | ROM_LOAD( "lo5_08a", 0x10000, 0x8000, CRC(9dedeff5) SHA1(53b0917a4fde4053182d38ea7f99f66e52543c10) ) |
| 675 | ROM_LOAD( "lo5_12a", 0x18000, 0x8000, CRC(2f5164ab) SHA1(df775b9e1c3c605a85d44404e4db42e33e80e664) ) |
| 676 | ROM_LOAD( "lo5_16a", 0x20000, 0x8000, CRC(c4500159) SHA1(e695e31e363cc954aab449f9d3dbc027e27fe7bf) ) |
| 677 | ROM_LOAD( "lo5_20a", 0x28000, 0x8000, CRC(3c1a67b5) SHA1(399935830b32a457ad0de243dd3eb4d368d5c6a6) ) |
| 678 | ROM_LOAD( "lo5_24a", 0x30000, 0x8000, CRC(1892d083) SHA1(8ee92be93ac222ecc2d9f4fcda3099b1db67516c) ) |
| 679 | ROM_LOAD( "lo5_28a", 0x38000, 0x8000, CRC(1186f9b4) SHA1(55598552dafa8cccfb423fc3b65a7fa15831d75b) ) |
| 681 | 680 | |
| 682 | | // 8x8x8 object chunks |
| 683 | | ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE ) |
| 684 | | ROM_LOAD( "lo5_01a", 0x00000, 0x8000, CRC(528d1395) SHA1(0221f81900757c10f288807f5c9549b9fdf5390f) ) |
| 685 | | ROM_LOAD( "lo5_06a", 0x08000, 0x8000, CRC(be539b01) SHA1(1eebcbc592c51a676409b5be6c5d6609cd7118c9) ) |
| 686 | | ROM_LOAD( "lo5_10a", 0x10000, 0x8000, CRC(23eeec5a) SHA1(08edd997d773684d329ef554776bc7acff1ac4ce) ) |
| 687 | | ROM_LOAD( "lo5_14a", 0x18000, 0x8000, CRC(e63cd59e) SHA1(0518461acdc6c65dca8f21ca29bf528197e7cabe) ) |
| 688 | | ROM_LOAD( "lo5_17a", 0x20000, 0x8000, CRC(ccf138d3) SHA1(971e7abe5b4d1a9dc8fc71b1ded5d2b81bcffaf2) ) |
| 689 | | ROM_LOAD( "lo5_21a", 0x28000, 0x8000, CRC(39ce2000) SHA1(05f8e6f364ad714232fcea5b535ed5e181febd1e) ) |
| 690 | | ROM_LOAD( "lo5_25a", 0x30000, 0x8000, CRC(7f3418bd) SHA1(5e595500f996b71aa73c637a6fddced30d78e222) ) |
| 691 | | ROM_LOAD( "lo5_29a", 0x38000, 0x8000, CRC(45353d8d) SHA1(45cacd36700d24ae9f6eeaebed2fc860ef2d2978) ) |
| 681 | // 8x8x8 object chunks |
| 682 | ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE ) |
| 683 | ROM_LOAD( "lo5_01a", 0x00000, 0x8000, CRC(528d1395) SHA1(0221f81900757c10f288807f5c9549b9fdf5390f) ) |
| 684 | ROM_LOAD( "lo5_06a", 0x08000, 0x8000, CRC(be539b01) SHA1(1eebcbc592c51a676409b5be6c5d6609cd7118c9) ) |
| 685 | ROM_LOAD( "lo5_10a", 0x10000, 0x8000, CRC(23eeec5a) SHA1(08edd997d773684d329ef554776bc7acff1ac4ce) ) |
| 686 | ROM_LOAD( "lo5_14a", 0x18000, 0x8000, CRC(e63cd59e) SHA1(0518461acdc6c65dca8f21ca29bf528197e7cabe) ) |
| 687 | ROM_LOAD( "lo5_17a", 0x20000, 0x8000, CRC(ccf138d3) SHA1(971e7abe5b4d1a9dc8fc71b1ded5d2b81bcffaf2) ) |
| 688 | ROM_LOAD( "lo5_21a", 0x28000, 0x8000, CRC(39ce2000) SHA1(05f8e6f364ad714232fcea5b535ed5e181febd1e) ) |
| 689 | ROM_LOAD( "lo5_25a", 0x30000, 0x8000, CRC(7f3418bd) SHA1(5e595500f996b71aa73c637a6fddced30d78e222) ) |
| 690 | ROM_LOAD( "lo5_29a", 0x38000, 0x8000, CRC(45353d8d) SHA1(45cacd36700d24ae9f6eeaebed2fc860ef2d2978) ) |
| 692 | 691 | |
| 693 | | // 8x8x8 object chunks |
| 694 | | ROM_REGION( 0x400000, REGION_GFX3, ROMREGION_DISPOSE ) |
| 695 | | ROM_LOAD( "lo5_02a", 0x00000, 0x8000, CRC(07aa32a1) SHA1(712b1983747acdd754d3abe934642cbc02ee13f2) ) |
| 696 | | ROM_LOAD( "lo5_05a", 0x08000, 0x8000, CRC(f6b775a2) SHA1(e0146866f2e89675181c5d9d5aba23116daac420) ) |
| 697 | | ROM_LOAD( "lo5_09a", 0x10000, 0x8000, CRC(953289bc) SHA1(197066af45c1193c36cd59b4b72b14f1c3bdd33e) ) |
| 698 | | ROM_LOAD( "lo5_13a", 0x18000, 0x8000, CRC(67fbb061) SHA1(78b071cd54642ee7b6d7b9f6b759a1412bb9eef5) ) |
| 699 | | ROM_LOAD( "lo5_18a", 0x20000, 0x8000, CRC(89884b24) SHA1(23c1fcc97f3a1abcaad413f4448db26f7c55fd5e) ) |
| 700 | | ROM_LOAD( "lo5_22a", 0x28000, 0x8000, CRC(b1ed0361) SHA1(4bdf439026a858fdd929d5a7baac7d76f51550c5) ) |
| 701 | | ROM_LOAD( "lo5_26a", 0x30000, 0x8000, CRC(a0b5c040) SHA1(ef63f89a368bc73eb77fc02d83b499a0231c1989) ) |
| 702 | | ROM_LOAD( "lo5_30a", 0x38000, 0x8000, CRC(7d3993c5) SHA1(fb18daffcfc46bc1e1cfdee928eea861494af221) ) |
| 692 | // 8x8x8 object chunks |
| 693 | ROM_REGION( 0x400000, REGION_GFX3, ROMREGION_DISPOSE ) |
| 694 | ROM_LOAD( "lo5_02a", 0x00000, 0x8000, CRC(07aa32a1) SHA1(712b1983747acdd754d3abe934642cbc02ee13f2) ) |
| 695 | ROM_LOAD( "lo5_05a", 0x08000, 0x8000, CRC(f6b775a2) SHA1(e0146866f2e89675181c5d9d5aba23116daac420) ) |
| 696 | ROM_LOAD( "lo5_09a", 0x10000, 0x8000, CRC(953289bc) SHA1(197066af45c1193c36cd59b4b72b14f1c3bdd33e) ) |
| 697 | ROM_LOAD( "lo5_13a", 0x18000, 0x8000, CRC(67fbb061) SHA1(78b071cd54642ee7b6d7b9f6b759a1412bb9eef5) ) |
| 698 | ROM_LOAD( "lo5_18a", 0x20000, 0x8000, CRC(89884b24) SHA1(23c1fcc97f3a1abcaad413f4448db26f7c55fd5e) ) |
| 699 | ROM_LOAD( "lo5_22a", 0x28000, 0x8000, CRC(b1ed0361) SHA1(4bdf439026a858fdd929d5a7baac7d76f51550c5) ) |
| 700 | ROM_LOAD( "lo5_26a", 0x30000, 0x8000, CRC(a0b5c040) SHA1(ef63f89a368bc73eb77fc02d83b499a0231c1989) ) |
| 701 | ROM_LOAD( "lo5_30a", 0x38000, 0x8000, CRC(7d3993c5) SHA1(fb18daffcfc46bc1e1cfdee928eea861494af221) ) |
| 703 | 702 | |
| 704 | | // 8x8x8 object chunks |
| 705 | | ROM_REGION( 0x400000, REGION_GFX4, ROMREGION_DISPOSE ) |
| 706 | | ROM_LOAD( "lo5_03a", 0x00000, 0x8000, CRC(7aca5d83) SHA1(95456b6c5adc5b776fbd33fd95cc62d4a83c34b6) ) |
| 707 | | ROM_LOAD( "lo5_07a", 0x08000, 0x8000, CRC(313f127f) SHA1(0782b8dd5f3a3384c3e7bc9cacaadf6804e06a38) ) |
| 708 | | ROM_LOAD( "lo5_11a", 0x10000, 0x8000, CRC(9df0b287) SHA1(6ea3b32a7826186c854cc079711ddea4ebf2ab7c) ) |
| 709 | | ROM_LOAD( "lo5_15a", 0x18000, 0x8000, CRC(66f9c5db) SHA1(cc68da9312ee0a3441b62d14107e1b7de9b04de3) ) |
| 710 | | ROM_LOAD( "lo5_19a", 0x20000, 0x8000, CRC(5aaa6a53) SHA1(f8ff547979883ac9a969e76d90d028ec4286ec4c) ) |
| 711 | | ROM_LOAD( "lo5_23a", 0x28000, 0x8000, CRC(1487895b) SHA1(9d617f37932ca17d902307a97d16cf3b4bb5bc4e) ) |
| 712 | | ROM_LOAD( "lo5_27a", 0x30000, 0x8000, CRC(119ff70a) SHA1(e64d41bc7822c9e99fd025b771551a6c511d13f2) ) |
| 713 | | ROM_LOAD( "lo5_31a", 0x38000, 0x8000, CRC(d3595292) SHA1(9c45be919296626796b07f70b871fba5d444dbb3) ) |
| 703 | // 8x8x8 object chunks |
| 704 | ROM_REGION( 0x400000, REGION_GFX4, ROMREGION_DISPOSE ) |
| 705 | ROM_LOAD( "lo5_03a", 0x00000, 0x8000, CRC(7aca5d83) SHA1(95456b6c5adc5b776fbd33fd95cc62d4a83c34b6) ) |
| 706 | ROM_LOAD( "lo5_07a", 0x08000, 0x8000, CRC(313f127f) SHA1(0782b8dd5f3a3384c3e7bc9cacaadf6804e06a38) ) |
| 707 | ROM_LOAD( "lo5_11a", 0x10000, 0x8000, CRC(9df0b287) SHA1(6ea3b32a7826186c854cc079711ddea4ebf2ab7c) ) |
| 708 | ROM_LOAD( "lo5_15a", 0x18000, 0x8000, CRC(66f9c5db) SHA1(cc68da9312ee0a3441b62d14107e1b7de9b04de3) ) |
| 709 | ROM_LOAD( "lo5_19a", 0x20000, 0x8000, CRC(5aaa6a53) SHA1(f8ff547979883ac9a969e76d90d028ec4286ec4c) ) |
| 710 | ROM_LOAD( "lo5_23a", 0x28000, 0x8000, CRC(1487895b) SHA1(9d617f37932ca17d902307a97d16cf3b4bb5bc4e) ) |
| 711 | ROM_LOAD( "lo5_27a", 0x30000, 0x8000, CRC(119ff70a) SHA1(e64d41bc7822c9e99fd025b771551a6c511d13f2) ) |
| 712 | ROM_LOAD( "lo5_31a", 0x38000, 0x8000, CRC(d3595292) SHA1(9c45be919296626796b07f70b871fba5d444dbb3) ) |
| 714 | 713 | |
| 715 | | // 8x8x2 characters |
| 716 | | ROM_REGION( 0x20000, REGION_GFX5, ROMREGION_DISPOSE ) |
| 717 | | ROM_LOAD( "lo1_06a", 0x00000, 0x2000, CRC(c8205913) SHA1(c791ff14418873ce68b502440c3d7ccc1f9cc00e) ) |
| 718 | | ROM_LOAD( "lo1_07a", 0x02000, 0x2000, CRC(73673b79) SHA1(246b80f0c465cefb7ce1c87dc90a58f0f0ea3e0d) ) |
| 714 | // 8x8x2 characters |
| 715 | ROM_REGION( 0x20000, REGION_GFX5, ROMREGION_DISPOSE ) |
| 716 | ROM_LOAD( "lo1_06a", 0x00000, 0x2000, CRC(c8205913) SHA1(c791ff14418873ce68b502440c3d7ccc1f9cc00e) ) |
| 717 | ROM_LOAD( "lo1_07a", 0x02000, 0x2000, CRC(73673b79) SHA1(246b80f0c465cefb7ce1c87dc90a58f0f0ea3e0d) ) |
| 719 | 718 | |
| 720 | | // 8x8x3 'scene' tiles |
| 721 | | ROM_REGION( 0x40000, REGION_GFX6, ROMREGION_DISPOSE ) |
| 722 | | ROM_LOAD( "lo3_10a", 0x00000, 0x10000, CRC(d5f4a8f3) SHA1(fcfaef46ef89c4b97970418a75d110271e94d55f) ) |
| 723 | | ROM_LOAD( "lo3_11a", 0x10000, 0x10000, CRC(018efa36) SHA1(99eec3f06146627c7f7177b854424e7162ab7c8e) ) |
| 724 | | ROM_LOAD( "lo3_12a", 0x20000, 0x10000, CRC(a34262a7) SHA1(08204a4474ab1b07b9114da8af03442737922d3b) ) |
| 719 | // 8x8x3 'scene' tiles |
| 720 | ROM_REGION( 0x40000, REGION_GFX6, ROMREGION_DISPOSE ) |
| 721 | ROM_LOAD( "lo3_10a", 0x00000, 0x10000, CRC(d5f4a8f3) SHA1(fcfaef46ef89c4b97970418a75d110271e94d55f) ) |
| 722 | ROM_LOAD( "lo3_11a", 0x10000, 0x10000, CRC(018efa36) SHA1(99eec3f06146627c7f7177b854424e7162ab7c8e) ) |
| 723 | ROM_LOAD( "lo3_12a", 0x20000, 0x10000, CRC(a34262a7) SHA1(08204a4474ab1b07b9114da8af03442737922d3b) ) |
| 725 | 724 | |
| 726 | | // 8x8x1 HUD tiles |
| 727 | | ROM_REGION( 0x40000, REGION_GFX7, ROMREGION_DISPOSE ) |
| 728 | | ROM_LOAD( "lo2_00", 0x00000, 0x2000, CRC(8affea15) SHA1(b7bcf0abde9c933e3f2c75c1f5e2ca3417d50ca1) ) |
| 725 | // 8x8x1 HUD tiles |
| 726 | ROM_REGION( 0x40000, REGION_GFX7, ROMREGION_DISPOSE ) |
| 727 | ROM_LOAD( "lo2_00", 0x00000, 0x2000, CRC(8affea15) SHA1(b7bcf0abde9c933e3f2c75c1f5e2ca3417d50ca1) ) |
| 729 | 728 | |
| 730 | | // 8x8 ground GFX |
| 731 | | ROM_REGION( 0x400000, REGION_GFX8, ROMREGION_DISPOSE ) |
| 732 | | ROM_LOAD( "lo3_05a", 0x00000, 0x10000, CRC(5b6f4c8e) SHA1(fc8b2c929c60fb0177ed3e407e3f0aacc5df8401) ) |
| 733 | | ROM_LOAD( "lo3_06a", 0x10000, 0x10000, CRC(f6b6ebdd) SHA1(30e92da3bf83c4bb30faf00cbf01664b993f137c) ) |
| 734 | | ROM_LOAD( "lo3_07a", 0x20000, 0x10000, CRC(cebc50e1) SHA1(f8b06ce576c3d41b0a8e2cc3ac60d3515d434812) ) |
| 729 | // 8x8 ground GFX |
| 730 | ROM_REGION( 0x400000, REGION_GFX8, ROMREGION_DISPOSE ) |
| 731 | ROM_LOAD( "lo3_05a", 0x00000, 0x10000, CRC(5b6f4c8e) SHA1(fc8b2c929c60fb0177ed3e407e3f0aacc5df8401) ) |
| 732 | ROM_LOAD( "lo3_06a", 0x10000, 0x10000, CRC(f6b6ebdd) SHA1(30e92da3bf83c4bb30faf00cbf01664b993f137c) ) |
| 733 | ROM_LOAD( "lo3_07a", 0x20000, 0x10000, CRC(cebc50e1) SHA1(f8b06ce576c3d41b0a8e2cc3ac60d3515d434812) ) |
| 735 | 734 | |
| 736 | | // Object chunk LUTs |
| 737 | | ROM_REGION( 0x30000, REGION_USER1, 0 ) |
| 738 | | ROM_LOAD16_BYTE( "lo4_04a", 0x00000, 0x10000, CRC(098f4151) SHA1(cf38e3c5f3442fbfa97870d25f7c89c465f847a9) ) |
| 739 | | ROM_LOAD16_BYTE( "lo4_05a", 0x00001, 0x10000, CRC(3b21667c) SHA1(b8337f733ede35145602ee3f0de25c2d4db1b2a5) ) |
| 735 | // Object chunk LUTs |
| 736 | ROM_REGION( 0x30000, REGION_USER1, 0 ) |
| 737 | ROM_LOAD16_BYTE( "lo4_04a", 0x00000, 0x10000, CRC(098f4151) SHA1(cf38e3c5f3442fbfa97870d25f7c89c465f847a9) ) |
| 738 | ROM_LOAD16_BYTE( "lo4_05a", 0x00001, 0x10000, CRC(3b21667c) SHA1(b8337f733ede35145602ee3f0de25c2d4db1b2a5) ) |
| 740 | 739 | |
| 741 | | // Object LUTs |
| 742 | | ROM_REGION( 0x30000, REGION_USER2, 0 ) |
| 743 | | ROM_LOAD( "lo4_02", 0x0000, 0x8000, CRC(0832edde) SHA1(77f9efbe029773417dbc3836a36687e37b5bee4b) ) |
| 744 | | ROM_LOAD( "lo4_03", 0x8000, 0x8000, CRC(1efac891) SHA1(faf305a30cab1c6bf8a9d6e2682b2c3745aec956) ) |
| 740 | // Object LUTs |
| 741 | ROM_REGION( 0x30000, REGION_USER2, 0 ) |
| 742 | ROM_LOAD( "lo4_02", 0x0000, 0x8000, CRC(0832edde) SHA1(77f9efbe029773417dbc3836a36687e37b5bee4b) ) |
| 743 | ROM_LOAD( "lo4_03", 0x8000, 0x8000, CRC(1efac891) SHA1(faf305a30cab1c6bf8a9d6e2682b2c3745aec956) ) |
| 745 | 744 | |
| 746 | | // Ground LUTs |
| 747 | | ROM_REGION( 0x30000, REGION_USER3, 0 ) |
| 748 | | ROM_LOAD( "lo3_08", 0x00000, 0x10000, CRC(f418cecd) SHA1(6cf2d13c9df86bad9c24609cb8387e817b5d4281) ) |
| 749 | | ROM_LOAD( "lo3_09", 0x10000, 0x10000, CRC(3c245568) SHA1(9ff6a23d83627f55c9d4f68e0bd89927bfe10664) ) |
| 750 | | ROM_LOAD( "lo3_04a", 0x00000, 0x10000, CRC(80b67ba9) SHA1(fdbef463b26cd13c43596310f585432c6e0896d0) ) |
| 745 | // Ground LUTs |
| 746 | ROM_REGION( 0x30000, REGION_USER3, 0 ) |
| 747 | ROM_LOAD( "lo3_08", 0x00000, 0x10000, CRC(f418cecd) SHA1(6cf2d13c9df86bad9c24609cb8387e817b5d4281) ) |
| 748 | ROM_LOAD( "lo3_09", 0x10000, 0x10000, CRC(3c245568) SHA1(9ff6a23d83627f55c9d4f68e0bd89927bfe10664) ) |
| 749 | ROM_LOAD( "lo3_04a", 0x00000, 0x10000, CRC(80b67ba9) SHA1(fdbef463b26cd13c43596310f585432c6e0896d0) ) |
| 751 | 750 | |
| 752 | | // Scene tiles CLUT |
| 753 | | ROM_REGION( 0x10000, REGION_USER4, 0 ) |
| 754 | | ROM_LOAD( "lo3_13a", 0x0000, 0x10000, CRC(e44774a7) SHA1(010d95ea497690ddd2406b8fef1b0aee375a165e) ) |
| 751 | // Scene tiles CLUT |
| 752 | ROM_REGION( 0x10000, REGION_USER4, 0 ) |
| 753 | ROM_LOAD( "lo3_13a", 0x0000, 0x10000, CRC(e44774a7) SHA1(010d95ea497690ddd2406b8fef1b0aee375a165e) ) |
| 755 | 754 | |
| 756 | | // Colour PROMs |
| 757 | | ROM_REGION( 0x1000, REGION_PROMS, 0 ) |
| 758 | | ROM_LOAD( "lo1a", 0x400, 0x400, CRC(82391f30) SHA1(d7153c1f3a3e54de4d4d6f432fbcd66449b96b6e) ) |
| 759 | | ROM_LOAD( "lo2a", 0x000, 0x400, CRC(2bfc6288) SHA1(03d293ddc0c614b606be823826a4375b3d35901f) ) |
| 755 | // Colour PROMs |
| 756 | ROM_REGION( 0x1000, REGION_PROMS, 0 ) |
| 757 | ROM_LOAD( "lo1a", 0x400, 0x400, CRC(82391f30) SHA1(d7153c1f3a3e54de4d4d6f432fbcd66449b96b6e) ) |
| 758 | ROM_LOAD( "lo2a", 0x000, 0x400, CRC(2bfc6288) SHA1(03d293ddc0c614b606be823826a4375b3d35901f) ) |
| 760 | 759 | ROM_END |
| 761 | 760 | |
| 762 | 761 | GAME( 1986, lockon, 0, lockon, lockon, 0, ROT0, "Tatsumi", "Lock-On", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS ) |
src/mame/drivers/m92.c
| r869 | r870 | |
| 44 | 44 | * Scrolling water in Undercover Cops |
| 45 | 45 | * Score display in R-Type Leo |
| 46 | 46 | |
| 47 | | These are slow to emulate, and can be turned on/off by pressing |
| 48 | | F1 - they are on by default. |
| 49 | | Todo: Raster effects don't work in flipscreen mode. |
| 50 | | |
| 51 | 47 | Glitch list! |
| 52 | 48 | |
| 53 | 49 | Gunforce: |
| r869 | r870 | |
| 193 | 189 | *****************************************************************************/ |
| 194 | 190 | |
| 195 | 191 | #include "driver.h" |
| 196 | | #include "m92.h" |
| 192 | #include "includes/m92.h" |
| 193 | #include "drivers/m92.h" |
| 197 | 194 | #include "machine/irem_cpu.h" |
| 198 | 195 | #include "sound/2151intf.h" |
| 199 | 196 | #include "sound/iremga20.h" |
| r869 | r870 | |
| 201 | 198 | static UINT8 irqvector; |
| 202 | 199 | static UINT16 sound_status; |
| 203 | 200 | static UINT32 bankaddress; |
| 201 | static mame_timer *scanline_timer; |
| 204 | 202 | |
| 205 | | static int m92_irq_vectorbase; |
| 206 | | static UINT8 *m92_ram,*m92_snd_ram; |
| 203 | static UINT8 m92_irq_vectorbase; |
| 207 | 204 | |
| 208 | 205 | #define M92_IRQ_0 ((m92_irq_vectorbase+0)/4) /* VBL interrupt*/ |
| 209 | 206 | #define M92_IRQ_1 ((m92_irq_vectorbase+4)/4) /* Sprite buffer complete interrupt */ |
| 210 | 207 | #define M92_IRQ_2 ((m92_irq_vectorbase+8)/4) /* Raster interrupt */ |
| 211 | 208 | #define M92_IRQ_3 ((m92_irq_vectorbase+12)/4) /* Sound cpu interrupt */ |
| 212 | 209 | |
| 213 | | #define M92_SCANLINES 256 |
| 214 | 210 | |
| 215 | | /* From video/m92.c */ |
| 216 | | WRITE8_HANDLER( m92_spritecontrol_w ); |
| 217 | | WRITE8_HANDLER( m92_videocontrol_w ); |
| 218 | | READ8_HANDLER( m92_paletteram_r ); |
| 219 | | WRITE8_HANDLER( m92_paletteram_w ); |
| 220 | | READ8_HANDLER( m92_vram_r ); |
| 221 | | WRITE8_HANDLER( m92_vram_w ); |
| 222 | | WRITE8_HANDLER( m92_pf1_control_w ); |
| 223 | | WRITE8_HANDLER( m92_pf2_control_w ); |
| 224 | | WRITE8_HANDLER( m92_pf3_control_w ); |
| 225 | | WRITE8_HANDLER( m92_master_control_w ); |
| 226 | | VIDEO_START( m92 ); |
| 227 | | VIDEO_UPDATE( m92 ); |
| 211 | static TIMER_CALLBACK( m92_scanline_interrupt ); |
| 228 | 212 | |
| 229 | | extern int m92_raster_irq_position,m92_raster_enable; |
| 230 | | extern UINT8 *m92_vram_data,*m92_spritecontrol; |
| 231 | | |
| 232 | | extern int m92_sprite_buffer_busy,m92_game_kludge; |
| 233 | | |
| 234 | 213 | /*****************************************************************************/ |
| 235 | 214 | |
| 236 | 215 | static void set_m92_bank(void) |
| r869 | r870 | |
| 245 | 224 | state_save_register_global(sound_status); |
| 246 | 225 | state_save_register_global(bankaddress); |
| 247 | 226 | state_save_register_func_postload(set_m92_bank); |
| 227 | |
| 228 | scanline_timer = mame_timer_alloc(m92_scanline_interrupt); |
| 248 | 229 | } |
| 249 | 230 | |
| 231 | static MACHINE_RESET( m92 ) |
| 232 | { |
| 233 | mame_timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, time_never); |
| 234 | } |
| 250 | 235 | |
| 251 | 236 | /*****************************************************************************/ |
| 252 | 237 | |
| 253 | | static READ8_HANDLER( m92_eeprom_r ) |
| 238 | static TIMER_CALLBACK( m92_scanline_interrupt ) |
| 254 | 239 | { |
| 240 | int scanline = param; |
| 241 | |
| 242 | /* raster interrupt */ |
| 243 | if (scanline == m92_raster_irq_position) |
| 244 | { |
| 245 | video_screen_update_partial(0, scanline); |
| 246 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M92_IRQ_2); |
| 247 | } |
| 248 | |
| 249 | /* VBLANK interrupt */ |
| 250 | else if (scanline == machine->screen[0].visarea.max_y + 1) |
| 251 | { |
| 252 | video_screen_update_partial(0, scanline); |
| 253 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M92_IRQ_0); |
| 254 | } |
| 255 | |
| 256 | /* adjust for next scanline */ |
| 257 | if (++scanline >= machine->screen[0].height) |
| 258 | scanline = 0; |
| 259 | mame_timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, time_never); |
| 260 | } |
| 261 | |
| 262 | /*****************************************************************************/ |
| 263 | |
| 264 | static READ16_HANDLER( m92_eeprom_r ) |
| 265 | { |
| 255 | 266 | UINT8 *RAM = memory_region(REGION_USER1); |
| 256 | 267 | // logerror("%05x: EEPROM RE %04x\n",activecpu_get_pc(),offset); |
| 257 | | return RAM[offset/2]; |
| 268 | return RAM[offset] | 0xff00; |
| 258 | 269 | } |
| 259 | 270 | |
| 260 | | static WRITE8_HANDLER( m92_eeprom_w ) |
| 271 | static WRITE16_HANDLER( m92_eeprom_w ) |
| 261 | 272 | { |
| 262 | 273 | UINT8 *RAM = memory_region(REGION_USER1); |
| 263 | 274 | // logerror("%05x: EEPROM WR %04x\n",activecpu_get_pc(),offset); |
| 264 | | RAM[offset/2]=data; |
| 275 | if (ACCESSING_LSB) |
| 276 | RAM[offset] = data; |
| 265 | 277 | } |
| 266 | 278 | |
| 267 | | static WRITE8_HANDLER( m92_coincounter_w ) |
| 279 | static WRITE16_HANDLER( m92_coincounter_w ) |
| 268 | 280 | { |
| 269 | | if (offset==0) { |
| 270 | | coin_counter_w(0,data & 0x01); |
| 271 | | coin_counter_w(1,data & 0x02); |
| 281 | if (ACCESSING_LSB) |
| 282 | { |
| 283 | coin_counter_w(0, data & 0x01); |
| 284 | coin_counter_w(1, data & 0x02); |
| 272 | 285 | /* Bit 0x8 is Motor(?!), used in Hook, In The Hunt, UCops */ |
| 273 | 286 | /* Bit 0x8 is Memcard related in RTypeLeo */ |
| 274 | 287 | /* Bit 0x40 set in Blade Master test mode input check */ |
| 275 | 288 | } |
| 276 | 289 | } |
| 277 | 290 | |
| 278 | | static WRITE8_HANDLER( m92_bankswitch_w ) |
| 291 | static WRITE16_HANDLER( m92_bankswitch_w ) |
| 279 | 292 | { |
| 280 | | if (offset==1) return; /* Unused top byte */ |
| 281 | | bankaddress = 0x100000 + ((data&0x7)*0x10000); |
| 282 | | set_m92_bank(); |
| 293 | if (ACCESSING_LSB) |
| 294 | { |
| 295 | bankaddress = 0x100000 + ((data & 0x7) * 0x10000); |
| 296 | set_m92_bank(); |
| 297 | } |
| 283 | 298 | } |
| 284 | 299 | |
| 285 | | static READ8_HANDLER( m92_port_4_r ) |
| 300 | static UINT32 m92_sprite_busy_r(void *param) |
| 286 | 301 | { |
| 287 | | return readinputport(4) | m92_sprite_buffer_busy; /* Bit 7 low indicates busy */ |
| 302 | return m92_sprite_buffer_busy; |
| 288 | 303 | } |
| 289 | 304 | |
| 290 | 305 | /*****************************************************************************/ |
| r869 | r870 | |
| 303 | 318 | } |
| 304 | 319 | |
| 305 | 320 | if (irqvector & 0x2) /* YM2151 has precedence */ |
| 306 | | cpunum_set_input_line_vector(1,0,0x18); |
| 321 | cpunum_set_input_line_vector(1, 0, 0x18); |
| 307 | 322 | else if (irqvector & 0x1) /* V30 */ |
| 308 | | cpunum_set_input_line_vector(1,0,0x19); |
| 323 | cpunum_set_input_line_vector(1, 0, 0x19); |
| 309 | 324 | |
| 310 | 325 | if (irqvector == 0) /* no IRQs pending */ |
| 311 | | cpunum_set_input_line(1,0,CLEAR_LINE); |
| 326 | cpunum_set_input_line(1, 0, CLEAR_LINE); |
| 312 | 327 | else /* IRQ pending */ |
| 313 | | cpunum_set_input_line(1,0,ASSERT_LINE); |
| 328 | cpunum_set_input_line(1, 0, ASSERT_LINE); |
| 314 | 329 | } |
| 315 | 330 | |
| 316 | | static WRITE8_HANDLER( m92_soundlatch_w ) |
| 331 | static WRITE16_HANDLER( m92_soundlatch_w ) |
| 317 | 332 | { |
| 318 | | if (offset==0) |
| 319 | | { |
| 320 | | timer_call_after_resynch(V30_ASSERT,setvector_callback); |
| 321 | | soundlatch_w(0,data); |
| 322 | | // logerror("soundlatch_w %02x\n",data); |
| 323 | | } |
| 333 | timer_call_after_resynch(V30_ASSERT, setvector_callback); |
| 334 | soundlatch_w(0, data & 0xff); |
| 324 | 335 | } |
| 325 | 336 | |
| 326 | | static READ8_HANDLER( m92_sound_status_r ) |
| 337 | static READ16_HANDLER( m92_sound_status_r ) |
| 327 | 338 | { |
| 328 | 339 | //logerror("%06x: read sound status\n",activecpu_get_pc()); |
| 329 | | if (offset == 0) |
| 330 | | return sound_status&0xff; |
| 331 | | return sound_status>>8; |
| 340 | return sound_status; |
| 332 | 341 | } |
| 333 | 342 | |
| 334 | | static READ8_HANDLER( m92_soundlatch_r ) |
| 343 | static READ16_HANDLER( m92_soundlatch_r ) |
| 335 | 344 | { |
| 336 | | if (offset == 0) |
| 337 | | { |
| 338 | | int res = soundlatch_r(offset); |
| 339 | | // logerror("soundlatch_r %02x\n",res); |
| 340 | | return res; |
| 341 | | } |
| 342 | | else return 0xff; |
| 345 | return soundlatch_r(offset) | 0xff00; |
| 343 | 346 | } |
| 344 | 347 | |
| 345 | | static WRITE8_HANDLER( m92_sound_irq_ack_w ) |
| 348 | static WRITE16_HANDLER( m92_sound_irq_ack_w ) |
| 346 | 349 | { |
| 347 | | if (offset == 0) |
| 348 | | timer_call_after_resynch(V30_CLEAR,setvector_callback); |
| 350 | timer_call_after_resynch(V30_CLEAR, setvector_callback); |
| 349 | 351 | } |
| 350 | 352 | |
| 351 | | static WRITE8_HANDLER( m92_sound_status_w ) |
| 353 | static WRITE16_HANDLER( m92_sound_status_w ) |
| 352 | 354 | { |
| 353 | | if (offset == 0) { |
| 354 | | sound_status = data | (sound_status&0xff00); |
| 355 | | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,M92_IRQ_3); |
| 356 | | } |
| 357 | | else |
| 358 | | sound_status = (data<<8) | (sound_status&0xff); |
| 355 | COMBINE_DATA(&sound_status); |
| 356 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M92_IRQ_3); |
| 359 | 357 | } |
| 360 | 358 | |
| 361 | 359 | /*****************************************************************************/ |
| 362 | 360 | |
| 363 | | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 364 | | AM_RANGE(0x00000, 0x9ffff) AM_READ(MRA8_ROM) |
| 365 | | AM_RANGE(0xa0000, 0xbffff) AM_READ(MRA8_BANK1) |
| 366 | | AM_RANGE(0xc0000, 0xcffff) AM_READ(MRA8_BANK2) /* Mirror of rom: Used by In The Hunt as protection */ |
| 367 | | AM_RANGE(0xd0000, 0xdffff) AM_READ(m92_vram_r) |
| 368 | | AM_RANGE(0xe0000, 0xeffff) AM_READ(MRA8_RAM) |
| 369 | | AM_RANGE(0xf8000, 0xf87ff) AM_READ(MRA8_RAM) |
| 370 | | AM_RANGE(0xf8800, 0xf8fff) AM_READ(m92_paletteram_r) |
| 371 | | AM_RANGE(0xffff0, 0xfffff) AM_READ(MRA8_ROM) |
| 372 | | ADDRESS_MAP_END |
| 373 | | |
| 374 | | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 375 | | AM_RANGE(0x00000, 0xbffff) AM_WRITE(MWA8_ROM) |
| 376 | | AM_RANGE(0xd0000, 0xdffff) AM_WRITE(m92_vram_w) AM_BASE(&m92_vram_data) |
| 377 | | AM_RANGE(0xe0000, 0xeffff) AM_WRITE(MWA8_RAM) AM_BASE(&m92_ram) /* System ram */ |
| 378 | | AM_RANGE(0xf8000, 0xf87ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 379 | | AM_RANGE(0xf8800, 0xf8fff) AM_WRITE(m92_paletteram_w) |
| 361 | /* appears to be an earlier board */ |
| 362 | static ADDRESS_MAP_START( lethalth_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 363 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 364 | AM_RANGE(0x80000, 0x8ffff) AM_READWRITE(MRA16_RAM, m92_vram_w) AM_BASE(&m92_vram_data) |
| 365 | AM_RANGE(0xe0000, 0xeffff) AM_RAM /* System ram */ |
| 366 | AM_RANGE(0xf8000, 0xf87ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 367 | AM_RANGE(0xf8800, 0xf8fff) AM_READWRITE(m92_paletteram_r, m92_paletteram_w) |
| 380 | 368 | AM_RANGE(0xf9000, 0xf900f) AM_WRITE(m92_spritecontrol_w) AM_BASE(&m92_spritecontrol) |
| 381 | 369 | AM_RANGE(0xf9800, 0xf9801) AM_WRITE(m92_videocontrol_w) |
| 382 | | AM_RANGE(0xffff0, 0xfffff) AM_WRITE(MWA8_ROM) |
| 370 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 383 | 371 | ADDRESS_MAP_END |
| 384 | 372 | |
| 385 | | static ADDRESS_MAP_START( lethalth_readmem, ADDRESS_SPACE_PROGRAM, 8 ) /* Same as above but with different VRAM addressing PAL */ |
| 386 | | AM_RANGE(0x00000, 0x7ffff) AM_READ(MRA8_ROM) |
| 387 | | AM_RANGE(0x80000, 0x8ffff) AM_READ(m92_vram_r) |
| 388 | | AM_RANGE(0xe0000, 0xeffff) AM_READ(MRA8_RAM) |
| 389 | | AM_RANGE(0xf8000, 0xf87ff) AM_READ(MRA8_RAM) |
| 390 | | AM_RANGE(0xf8800, 0xf8fff) AM_READ(paletteram_r) |
| 391 | | AM_RANGE(0xffff0, 0xfffff) AM_READ(MRA8_ROM) |
| 392 | | ADDRESS_MAP_END |
| 393 | | |
| 394 | | static ADDRESS_MAP_START( lethalth_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 395 | | AM_RANGE(0x00000, 0x7ffff) AM_WRITE(MWA8_ROM) |
| 396 | | AM_RANGE(0x80000, 0x8ffff) AM_WRITE(m92_vram_w) AM_BASE(&m92_vram_data) |
| 397 | | AM_RANGE(0xe0000, 0xeffff) AM_WRITE(MWA8_RAM) AM_BASE(&m92_ram) /* System ram */ |
| 398 | | AM_RANGE(0xf8000, 0xf87ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 399 | | AM_RANGE(0xf8800, 0xf8fff) AM_WRITE(m92_paletteram_w) |
| 373 | static ADDRESS_MAP_START( m92_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 374 | AM_RANGE(0x00000, 0x9ffff) AM_ROM |
| 375 | AM_RANGE(0xa0000, 0xbffff) AM_ROMBANK(1) |
| 376 | AM_RANGE(0xc0000, 0xcffff) AM_ROMBANK(2) /* Mirror of rom: Used by In The Hunt as protection */ |
| 377 | AM_RANGE(0xd0000, 0xdffff) AM_READWRITE(MRA16_RAM, m92_vram_w) AM_BASE(&m92_vram_data) |
| 378 | AM_RANGE(0xe0000, 0xeffff) AM_RAM /* System ram */ |
| 379 | AM_RANGE(0xf8000, 0xf87ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) |
| 380 | AM_RANGE(0xf8800, 0xf8fff) AM_READWRITE(m92_paletteram_r, m92_paletteram_w) |
| 400 | 381 | AM_RANGE(0xf9000, 0xf900f) AM_WRITE(m92_spritecontrol_w) AM_BASE(&m92_spritecontrol) |
| 401 | 382 | AM_RANGE(0xf9800, 0xf9801) AM_WRITE(m92_videocontrol_w) |
| 402 | | AM_RANGE(0xffff0, 0xfffff) AM_WRITE(MWA8_ROM) |
| 383 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 403 | 384 | ADDRESS_MAP_END |
| 404 | 385 | |
| 405 | | static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 ) |
| 406 | | AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r) /* Player 1 */ |
| 407 | | AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r) /* Player 2 */ |
| 408 | | AM_RANGE(0x02, 0x02) AM_READ(m92_port_4_r) /* Coins & VBL */ |
| 409 | | AM_RANGE(0x03, 0x03) AM_READ(input_port_7_r) /* Dip 3 */ |
| 410 | | AM_RANGE(0x04, 0x04) AM_READ(input_port_6_r) /* Dip 2 */ |
| 411 | | AM_RANGE(0x05, 0x05) AM_READ(input_port_5_r) /* Dip 1 */ |
| 412 | | AM_RANGE(0x06, 0x06) AM_READ(input_port_2_r) /* Player 3 */ |
| 413 | | AM_RANGE(0x07, 0x07) AM_READ(input_port_3_r) /* Player 4 */ |
| 386 | static ADDRESS_MAP_START( m92_portmap, ADDRESS_SPACE_IO, 16 ) |
| 387 | AM_RANGE(0x00, 0x01) AM_READ(input_port_0_word_r) /* Player 1/2 */ |
| 388 | AM_RANGE(0x02, 0x03) AM_READ(input_port_1_word_r) /* Coins & VBL, DIP3 */ |
| 389 | AM_RANGE(0x04, 0x05) AM_READ(input_port_2_word_r) /* Dip 2,1 */ |
| 390 | AM_RANGE(0x06, 0x07) AM_READ(input_port_3_word_r) /* Player 3/4 */ |
| 414 | 391 | AM_RANGE(0x08, 0x09) AM_READ(m92_sound_status_r) /* answer from sound CPU */ |
| 415 | | ADDRESS_MAP_END |
| 416 | | |
| 417 | | static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 ) |
| 418 | 392 | AM_RANGE(0x00, 0x01) AM_WRITE(m92_soundlatch_w) |
| 419 | 393 | AM_RANGE(0x02, 0x03) AM_WRITE(m92_coincounter_w) |
| 420 | 394 | AM_RANGE(0x20, 0x21) AM_WRITE(m92_bankswitch_w) |
| 421 | | AM_RANGE(0x40, 0x43) AM_WRITE(MWA8_NOP) /* Interrupt controller, only written to at bootup */ |
| 395 | AM_RANGE(0x40, 0x43) AM_WRITE(MWA16_NOP) /* Interrupt controller, only written to at bootup */ |
| 422 | 396 | AM_RANGE(0x80, 0x87) AM_WRITE(m92_pf1_control_w) |
| 423 | 397 | AM_RANGE(0x88, 0x8f) AM_WRITE(m92_pf2_control_w) |
| 424 | 398 | AM_RANGE(0x90, 0x97) AM_WRITE(m92_pf3_control_w) |
| r869 | r870 | |
| 428 | 402 | |
| 429 | 403 | /******************************************************************************/ |
| 430 | 404 | |
| 431 | | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 432 | | AM_RANGE(0x00000, 0x1ffff) AM_READ(MRA8_ROM) |
| 433 | | AM_RANGE(0xa0000, 0xa3fff) AM_READ(MRA8_RAM) |
| 434 | | AM_RANGE(0xa8000, 0xa803f) AM_READ(IremGA20_r) |
| 435 | | AM_RANGE(0xa8042, 0xa8043) AM_READ(YM2151_status_port_0_r) |
| 436 | | AM_RANGE(0xa8044, 0xa8045) AM_READ(m92_soundlatch_r) |
| 437 | | AM_RANGE(0xffff0, 0xfffff) AM_READ(MRA8_ROM) |
| 438 | | ADDRESS_MAP_END |
| 439 | | |
| 440 | | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 441 | | AM_RANGE(0x00000, 0x1ffff) AM_WRITE(MWA8_ROM) |
| 442 | | AM_RANGE(0x9ff00, 0x9ffff) AM_WRITE(MWA8_NOP) /* Irq controller? */ |
| 443 | | AM_RANGE(0xa0000, 0xa3fff) AM_WRITE(MWA8_RAM) AM_BASE(&m92_snd_ram) |
| 444 | | AM_RANGE(0xa8000, 0xa803f) AM_WRITE(IremGA20_w) |
| 445 | | AM_RANGE(0xa8040, 0xa8041) AM_WRITE(YM2151_register_port_0_w) |
| 446 | | AM_RANGE(0xa8042, 0xa8043) AM_WRITE(YM2151_data_port_0_w) |
| 447 | | AM_RANGE(0xa8044, 0xa8045) AM_WRITE(m92_sound_irq_ack_w) |
| 405 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 406 | AM_RANGE(0x00000, 0x1ffff) AM_ROM |
| 407 | AM_RANGE(0x9ff00, 0x9ffff) AM_WRITE(MWA16_NOP) /* Irq controller? */ |
| 408 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 409 | AM_RANGE(0xa8000, 0xa803f) AM_READWRITE(IremGA20_r, IremGA20_w) |
| 410 | AM_RANGE(0xa8040, 0xa8041) AM_WRITE(YM2151_register_port_0_lsb_w) |
| 411 | AM_RANGE(0xa8042, 0xa8043) AM_READWRITE(YM2151_status_port_0_lsb_r, YM2151_data_port_0_lsb_w) |
| 412 | AM_RANGE(0xa8044, 0xa8045) AM_READWRITE(m92_soundlatch_r, m92_sound_irq_ack_w) |
| 448 | 413 | AM_RANGE(0xa8046, 0xa8047) AM_WRITE(m92_sound_status_w) |
| 449 | | AM_RANGE(0xffff0, 0xfffff) AM_WRITE(MWA8_ROM) |
| 414 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 450 | 415 | ADDRESS_MAP_END |
| 451 | 416 | |
| 452 | 417 | /******************************************************************************/ |
| 453 | 418 | |
| 454 | | INPUT_PORTS_START( bmaster ) |
| 455 | | IREM_JOYSTICK_1_2(1) |
| 456 | | IREM_JOYSTICK_1_2(2) |
| 457 | | IREM_PORT_UNUSED |
| 458 | | IREM_PORT_UNUSED |
| 459 | | IREM_COINS |
| 460 | | IREM_SYSTEM_DIPSWITCH |
| 419 | static INPUT_PORTS_START( m92_2player ) |
| 420 | PORT_START_TAG("JOY12") |
| 421 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 422 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 423 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 424 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 425 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 426 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 427 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 428 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 429 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 430 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 431 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 432 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 433 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 434 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 435 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 436 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 461 | 437 | |
| 462 | | PORT_START /* Dip switch bank 1 */ |
| 463 | | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) |
| 464 | | PORT_DIPSETTING( 0x00, "1" ) |
| 465 | | PORT_DIPSETTING( 0x03, "2" ) |
| 466 | | PORT_DIPSETTING( 0x02, "3" ) |
| 467 | | PORT_DIPSETTING( 0x01, "4" ) |
| 468 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 469 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy) ) |
| 470 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 471 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 472 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 473 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) |
| 474 | | PORT_DIPSETTING( 0x10, "300k only" ) |
| 475 | | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) |
| 476 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 477 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 478 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 479 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 480 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 481 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 482 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 438 | PORT_START_TAG("COINS_DIPS") |
| 439 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 440 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 441 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 442 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 443 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 444 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) |
| 445 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 446 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(m92_sprite_busy_r, 0) |
| 447 | /* DIP switch bank 3 */ |
| 448 | PORT_DIPUNKNOWN( 0x0100, 0x0100 ) |
| 449 | PORT_DIPUNKNOWN( 0x0200, 0x0200 ) |
| 450 | PORT_DIPUNKNOWN( 0x0400, 0x0400 ) |
| 451 | PORT_DIPUNKNOWN( 0x0800, 0x0800 ) |
| 452 | PORT_DIPUNKNOWN( 0x1000, 0x1000 ) |
| 453 | PORT_DIPUNKNOWN( 0x2000, 0x2000 ) |
| 454 | PORT_DIPUNKNOWN( 0x4000, 0x4000 ) |
| 455 | PORT_DIPUNKNOWN( 0x8000, 0x8000 ) |
| 483 | 456 | |
| 457 | PORT_START_TAG("DIPS21") |
| 458 | /* Dip switch bank 1 */ |
| 459 | PORT_DIPUNKNOWN( 0x0001, 0x0001 ) |
| 460 | PORT_DIPUNKNOWN( 0x0002, 0x0002 ) |
| 461 | PORT_DIPUNKNOWN( 0x0004, 0x0004 ) |
| 462 | PORT_DIPUNKNOWN( 0x0008, 0x0008 ) |
| 463 | PORT_DIPUNKNOWN( 0x0010, 0x0010 ) |
| 464 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) |
| 465 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 466 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 467 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 468 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 469 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 470 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) |
| 471 | /* Dip switch bank 2 */ |
| 472 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 473 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 474 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 475 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) |
| 476 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 477 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 478 | PORT_DIPNAME( 0x0400, 0x0400, "Coin Slots" ) |
| 479 | PORT_DIPSETTING( 0x0400, "Common" ) |
| 480 | PORT_DIPSETTING( 0x0000, "Separate" ) |
| 481 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) /* Default 1 */ |
| 482 | PORT_DIPSETTING( 0x0800, "1" ) |
| 483 | PORT_DIPSETTING( 0x0000, "2" ) |
| 484 | PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:5,6,7,8") |
| 485 | PORT_DIPSETTING( 0xa000, DEF_STR( 6C_1C ) ) |
| 486 | PORT_DIPSETTING( 0xb000, DEF_STR( 5C_1C ) ) |
| 487 | PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) ) |
| 488 | PORT_DIPSETTING( 0xd000, DEF_STR( 3C_1C ) ) |
| 489 | PORT_DIPSETTING( 0xe000, DEF_STR( 2C_1C ) ) |
| 490 | PORT_DIPSETTING( 0x1000, "2 Coins to Start/1 to Continue") |
| 491 | PORT_DIPSETTING( 0x3000, DEF_STR( 3C_2C ) ) |
| 492 | PORT_DIPSETTING( 0x2000, DEF_STR( 4C_3C ) ) |
| 493 | PORT_DIPSETTING( 0xf000, DEF_STR( 1C_1C ) ) |
| 494 | PORT_DIPSETTING( 0x4000, DEF_STR( 2C_3C ) ) |
| 495 | PORT_DIPSETTING( 0x9000, DEF_STR( 1C_2C ) ) |
| 496 | PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) |
| 497 | PORT_DIPSETTING( 0x7000, DEF_STR( 1C_4C ) ) |
| 498 | PORT_DIPSETTING( 0x6000, DEF_STR( 1C_5C ) ) |
| 499 | PORT_DIPSETTING( 0x5000, DEF_STR( 1C_6C ) ) |
| 500 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 484 | 501 | |
| 485 | | IREM_PORT_UNUSED /* Game manual specificly mentions dip switch bank 3 is unused */ |
| 502 | PORT_START_TAG("JOY34") |
| 503 | PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 486 | 504 | INPUT_PORTS_END |
| 487 | 505 | |
| 488 | | INPUT_PORTS_START( gunforce ) |
| 489 | | IREM_JOYSTICK_1_2(1) |
| 490 | | IREM_JOYSTICK_1_2(2) |
| 491 | | IREM_PORT_UNUSED |
| 492 | | IREM_PORT_UNUSED |
| 493 | | IREM_COINS |
| 494 | | IREM_SYSTEM_DIPSWITCH |
| 495 | 506 | |
| 496 | | PORT_START /* Dip switch bank 1 */ |
| 497 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 498 | | PORT_DIPSETTING( 0x02, "2" ) |
| 499 | | PORT_DIPSETTING( 0x03, "3" ) |
| 500 | | PORT_DIPSETTING( 0x01, "4" ) |
| 501 | | PORT_DIPSETTING( 0x00, "5" ) |
| 502 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 503 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy) ) |
| 504 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 505 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 506 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 507 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) |
| 508 | | PORT_DIPSETTING( 0x00, "15000 35000 75000 120000" ) |
| 509 | | PORT_DIPSETTING( 0x10, "20000 40000 90000 150000" ) |
| 510 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 511 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 512 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 513 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 514 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 515 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 516 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 507 | static INPUT_PORTS_START( m92_3player ) |
| 508 | PORT_INCLUDE(m92_2player) |
| 517 | 509 | |
| 518 | | IREM_PORT_UNUSED /* Game manual only mentions 2 dips */ |
| 510 | PORT_MODIFY("DIPS21") |
| 511 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Cabinet ) ) |
| 512 | PORT_DIPSETTING( 0x0200, "2 Players" ) |
| 513 | PORT_DIPSETTING( 0x0000, "3 Players" ) |
| 514 | |
| 515 | PORT_MODIFY("JOY34") |
| 516 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) |
| 517 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) |
| 518 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) |
| 519 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) |
| 520 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START3 ) /* If common slots, Coin3 if separate */ |
| 521 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN3 ) |
| 522 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) |
| 523 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) |
| 524 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 519 | 525 | INPUT_PORTS_END |
| 520 | 526 | |
| 521 | | INPUT_PORTS_START( lethalth ) |
| 522 | | IREM_JOYSTICK_1_2(1) |
| 523 | | IREM_JOYSTICK_1_2(2) |
| 524 | | IREM_PORT_UNUSED |
| 525 | | IREM_PORT_UNUSED |
| 526 | | IREM_COINS |
| 527 | | IREM_SYSTEM_DIPSWITCH |
| 528 | 527 | |
| 529 | | PORT_START /* Dip switch bank 1 */ |
| 530 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 531 | | PORT_DIPSETTING( 0x02, "2" ) |
| 532 | | PORT_DIPSETTING( 0x03, "3" ) |
| 533 | | PORT_DIPSETTING( 0x01, "4" ) |
| 534 | | PORT_DIPSETTING( 0x00, "5" ) |
| 535 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 536 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy) ) |
| 537 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 538 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 539 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 540 | | PORT_DIPNAME( 0x10, 0x10, "Continuous Play" ) |
| 541 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 542 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 543 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 544 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 545 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 546 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 547 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 548 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 549 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 528 | static INPUT_PORTS_START( m92_4player ) |
| 529 | PORT_INCLUDE(m92_3player) |
| 550 | 530 | |
| 551 | | PORT_START /* Dip switch bank 3 */ |
| 552 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) ) |
| 553 | | PORT_DIPSETTING( 0x02, "500K & 1M" ) |
| 554 | | PORT_DIPSETTING( 0x03, "700K & 1.5M" ) |
| 555 | | PORT_DIPSETTING( 0x00, "700K, 1.5M, 3M & 4.5M" ) |
| 556 | | PORT_DIPSETTING( 0x01, "1M & 2M" ) |
| 557 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) /* Manual states the rest are "Unused" */ |
| 558 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 559 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 560 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) |
| 561 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 562 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 563 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) |
| 564 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 565 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 566 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) |
| 567 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 568 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 569 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) |
| 570 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 571 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 572 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) |
| 573 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 574 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 531 | PORT_MODIFY("DIPS21") |
| 532 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Cabinet ) ) |
| 533 | PORT_DIPSETTING( 0x0200, "2 Players" ) |
| 534 | PORT_DIPSETTING( 0x0000, "4 Players" ) |
| 535 | |
| 536 | PORT_MODIFY("JOY34") |
| 537 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) |
| 538 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) |
| 539 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) |
| 540 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) |
| 541 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_START4 ) /* If common slots, Coin3 if separate */ |
| 542 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN4 ) |
| 543 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) |
| 544 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) |
| 575 | 545 | INPUT_PORTS_END |
| 576 | 546 | |
| 577 | | INPUT_PORTS_START( hook ) |
| 578 | | IREM_JOYSTICK_1_2(1) |
| 579 | | IREM_JOYSTICK_1_2(2) |
| 580 | | IREM_JOYSTICK_3_4(3) |
| 581 | | IREM_JOYSTICK_3_4(4) |
| 582 | | IREM_COINS |
| 583 | | IREM_SYSTEM_DIPSWITCH_4PLAYERS |
| 547 | /******************************************************************************/ |
| 584 | 548 | |
| 585 | | PORT_START /* Dip switch bank 1 */ |
| 586 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 587 | | PORT_DIPSETTING( 0x00, "1" ) |
| 588 | | PORT_DIPSETTING( 0x03, "2" ) |
| 589 | | PORT_DIPSETTING( 0x02, "3" ) |
| 590 | | PORT_DIPSETTING( 0x01, "4" ) |
| 591 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 592 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy) ) |
| 593 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 594 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 595 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 596 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 597 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 598 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 599 | | PORT_DIPNAME( 0x20, 0x20, "Any Button to Start" ) |
| 600 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 601 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 602 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 603 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 604 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 605 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 549 | static INPUT_PORTS_START( bmaster ) |
| 550 | PORT_INCLUDE(m92_2player) |
| 606 | 551 | |
| 607 | | IREM_PORT_UNUSED /* Game manual only mentions 2 dips */ |
| 552 | /* Game manual specificly mentions dip switch bank 3 is unused */ |
| 553 | |
| 554 | PORT_MODIFY("DIPS21") |
| 555 | /* Dip switch bank 1 */ |
| 556 | PORT_DIPNAME( 0x0003, 0x0002, DEF_STR( Lives ) ) |
| 557 | PORT_DIPSETTING( 0x0000, "1" ) |
| 558 | PORT_DIPSETTING( 0x0003, "2" ) |
| 559 | PORT_DIPSETTING( 0x0002, "3" ) |
| 560 | PORT_DIPSETTING( 0x0001, "4" ) |
| 561 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 562 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy ) ) |
| 563 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 564 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 565 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 566 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) ) |
| 567 | PORT_DIPSETTING( 0x0010, "300k only" ) |
| 568 | PORT_DIPSETTING( 0x0000, DEF_STR( None ) ) |
| 608 | 569 | INPUT_PORTS_END |
| 609 | 570 | |
| 610 | | INPUT_PORTS_START( majtitl2 ) |
| 611 | | IREM_JOYSTICK_1_2(1) |
| 612 | | IREM_JOYSTICK_1_2(2) |
| 613 | | IREM_JOYSTICK_3_4(3) |
| 614 | | IREM_JOYSTICK_3_4(4) |
| 615 | | IREM_COINS |
| 616 | | IREM_SYSTEM_DIPSWITCH_CABINET |
| 617 | 571 | |
| 618 | | PORT_START /* Dip switch bank 1 */ |
| 619 | | PORT_DIPNAME( 0x01, 0x01, "Given Holes/Stroke Play" ) |
| 620 | | PORT_DIPSETTING( 0x00, "1" ) |
| 621 | | PORT_DIPSETTING( 0x01, "2" ) |
| 622 | | PORT_DIPNAME( 0x02, 0x02, "Given Holes/Match or Skins" ) |
| 623 | | PORT_DIPSETTING( 0x00, "1" ) |
| 624 | | PORT_DIPSETTING( 0x02, "2" ) |
| 625 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Difficulty ) ) |
| 626 | | PORT_DIPSETTING( 0x04, DEF_STR( Normal ) ) |
| 627 | | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 628 | | PORT_DIPNAME( 0x08, 0x08, "Joystick Configuration" ) /* Listed as "Joysticks on" */ |
| 629 | | PORT_DIPSETTING( 0x08, DEF_STR( Upright ) ) /* "One Side" */ |
| 630 | | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) /* "Both Sides" */ |
| 631 | | PORT_DIPNAME( 0x10, 0x10, "Number of Joysticks" ) /* 4 Way joysticks with 2 buttons each player */ |
| 632 | | PORT_DIPSETTING( 0x10, "2 Joysticks" ) |
| 633 | | PORT_DIPSETTING( 0x00, "4 Joysticks" ) |
| 634 | | PORT_DIPNAME( 0x20, 0x00, "Any Button to Start" ) |
| 635 | | PORT_DIPSETTING( 0x20, DEF_STR( No ) ) |
| 636 | | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 637 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 638 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 639 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 640 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 572 | INPUT_PORTS_START( gunforce ) |
| 573 | PORT_INCLUDE(m92_2player) |
| 641 | 574 | |
| 642 | | PORT_START /* Dip switch bank 3 */ |
| 643 | | PORT_DIPNAME( 0x01, 0x01, "Ticket Dispenser" ) |
| 644 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) /* "Ticket payout function is not working now" will be shown on screen */ |
| 645 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) /* Stored data is shown on screen with the option to clear data */ |
| 646 | | PORT_DIPNAME( 0x02, 0x06, "Points Per Ticket" ) /* Conversion Rate for Ticket */ |
| 647 | | PORT_DIPSETTING( 0x06, "1 Point - 1 Ticket" ) |
| 648 | | PORT_DIPSETTING( 0x06, "2 Points - 1 Ticket" ) |
| 649 | | PORT_DIPSETTING( 0x02, "5 Points - 1 Ticket" ) |
| 650 | | PORT_DIPSETTING( 0x00, "10 Points - 1 Ticket" ) |
| 651 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) /* Game manual states dips 4, 5, 6 & 7 are "Unused" */ |
| 652 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 653 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 654 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) |
| 655 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 656 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 657 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) |
| 658 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 659 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 660 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) |
| 661 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 662 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 663 | | PORT_DIPNAME( 0x80, 0x80, "Deltronics Model" ) /* Ticket Despenser Model Type */ |
| 664 | | PORT_DIPSETTING( 0x80, "DL 1275" ) |
| 665 | | PORT_DIPSETTING( 0x00, "DL 4SS" ) |
| 575 | PORT_MODIFY("DIPS21") |
| 576 | /* Dip switch bank 1 */ |
| 577 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 578 | PORT_DIPSETTING( 0x0002, "2" ) |
| 579 | PORT_DIPSETTING( 0x0003, "3" ) |
| 580 | PORT_DIPSETTING( 0x0001, "4" ) |
| 581 | PORT_DIPSETTING( 0x0000, "5" ) |
| 582 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 583 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy ) ) |
| 584 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 585 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 586 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 587 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) ) |
| 588 | PORT_DIPSETTING( 0x0000, "15000 35000 75000 120000" ) |
| 589 | PORT_DIPSETTING( 0x0010, "20000 40000 90000 150000" ) |
| 666 | 590 | INPUT_PORTS_END |
| 667 | 591 | |
| 668 | | INPUT_PORTS_START( mysticri ) |
| 669 | | IREM_JOYSTICK_1_2(1) |
| 670 | | IREM_JOYSTICK_1_2(2) |
| 671 | | IREM_PORT_UNUSED |
| 672 | | IREM_PORT_UNUSED |
| 673 | | IREM_COINS |
| 674 | | IREM_SYSTEM_DIPSWITCH |
| 675 | 592 | |
| 676 | | PORT_START /* Dip switch bank 1 */ |
| 677 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 678 | | PORT_DIPSETTING( 0x02, "2" ) |
| 679 | | PORT_DIPSETTING( 0x03, "3" ) |
| 680 | | PORT_DIPSETTING( 0x01, "4" ) |
| 681 | | PORT_DIPSETTING( 0x00, "5" ) |
| 682 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 683 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 684 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 685 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 686 | | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 687 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) |
| 688 | | PORT_DIPSETTING( 0x00, "15000 35000 60000" ) |
| 689 | | PORT_DIPSETTING( 0x10, "20000 50000 90000" ) |
| 690 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 691 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 692 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 693 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 694 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 695 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 696 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 593 | INPUT_PORTS_START( lethalth ) |
| 594 | PORT_INCLUDE(m92_2player) |
| 697 | 595 | |
| 698 | | IREM_PORT_UNUSED /* Game manual specificly mentions dip switch bank 3 is unused */ |
| 596 | PORT_MODIFY("COINS_DIPS") |
| 597 | /* Dip switch bank 3 */ |
| 598 | PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Bonus_Life ) ) |
| 599 | PORT_DIPSETTING( 0x0200, "500K & 1M" ) |
| 600 | PORT_DIPSETTING( 0x0300, "700K & 1.5M" ) |
| 601 | PORT_DIPSETTING( 0x0000, "700K, 1.5M, 3M & 4.5M" ) |
| 602 | PORT_DIPSETTING( 0x0100, "1M & 2M" ) |
| 603 | |
| 604 | PORT_MODIFY("DIPS21") |
| 605 | /* Dip switch bank 1 */ |
| 606 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 607 | PORT_DIPSETTING( 0x0002, "2" ) |
| 608 | PORT_DIPSETTING( 0x0003, "3" ) |
| 609 | PORT_DIPSETTING( 0x0001, "4" ) |
| 610 | PORT_DIPSETTING( 0x0000, "5" ) |
| 611 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 612 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy) ) |
| 613 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 614 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 615 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 616 | PORT_DIPNAME( 0x0010, 0x0010, "Continuous Play" ) |
| 617 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 618 | PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) |
| 699 | 619 | INPUT_PORTS_END |
| 700 | 620 | |
| 701 | | INPUT_PORTS_START( uccops ) |
| 702 | | IREM_JOYSTICK_1_2(1) |
| 703 | | IREM_JOYSTICK_1_2(2) |
| 704 | | IREM_JOYSTICK_3_4(3) |
| 705 | | IREM_PORT_UNUSED |
| 706 | | IREM_COINS |
| 707 | | IREM_SYSTEM_DIPSWITCH_3PLAYERS |
| 708 | 621 | |
| 709 | | PORT_START /* Dip switch bank 1 */ |
| 710 | | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) |
| 711 | | PORT_DIPSETTING( 0x00, "1" ) |
| 712 | | PORT_DIPSETTING( 0x03, "2" ) |
| 713 | | PORT_DIPSETTING( 0x02, "3" ) |
| 714 | | PORT_DIPSETTING( 0x01, "4" ) |
| 715 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 716 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy) ) |
| 717 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 718 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 719 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 720 | | /* There is ALLWAYS a Bonus Life at 300K */ |
| 721 | | /* It does not depends on the value of bit 0x10 */ |
| 722 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) |
| 723 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 724 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 725 | | PORT_DIPNAME( 0x20, 0x20, "Any Button to Start" ) |
| 726 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 727 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 728 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 729 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 730 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 731 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 622 | INPUT_PORTS_START( hook ) |
| 623 | PORT_INCLUDE(m92_4player) |
| 732 | 624 | |
| 733 | | IREM_PORT_UNUSED /* Game manual only mentions 2 dips */ |
| 625 | PORT_MODIFY("DIPS21") |
| 626 | /* Dip switch bank 1 */ |
| 627 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 628 | PORT_DIPSETTING( 0x0000, "1" ) |
| 629 | PORT_DIPSETTING( 0x0003, "2" ) |
| 630 | PORT_DIPSETTING( 0x0002, "3" ) |
| 631 | PORT_DIPSETTING( 0x0001, "4" ) |
| 632 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 633 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy) ) |
| 634 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 635 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 636 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 637 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) |
| 638 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 639 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 640 | PORT_DIPNAME( 0x0020, 0x0020, "Any Button to Start" ) |
| 641 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 642 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 734 | 643 | INPUT_PORTS_END |
| 735 | 644 | |
| 736 | | INPUT_PORTS_START( rtypeleo ) |
| 737 | | IREM_JOYSTICK_1_2(1) |
| 738 | | IREM_JOYSTICK_1_2(2) |
| 739 | | IREM_PORT_UNUSED |
| 740 | | IREM_PORT_UNUSED |
| 741 | | IREM_COINS |
| 742 | | IREM_SYSTEM_DIPSWITCH |
| 743 | 645 | |
| 744 | | PORT_START /* Dip switch bank 1 */ |
| 745 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 746 | | PORT_DIPSETTING( 0x02, "2" ) |
| 747 | | PORT_DIPSETTING( 0x03, "3" ) |
| 748 | | PORT_DIPSETTING( 0x01, "4" ) |
| 749 | | PORT_DIPSETTING( 0x00, "5" ) |
| 750 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 751 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy) ) |
| 752 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 753 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 754 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 755 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) |
| 756 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 757 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 758 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 759 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 760 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 761 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 762 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 763 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 764 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 646 | INPUT_PORTS_START( majtitl2 ) |
| 647 | PORT_INCLUDE(m92_4player) |
| 765 | 648 | |
| 766 | | IREM_PORT_UNUSED /* Game manual only mentions 2 dips */ |
| 649 | PORT_MODIFY("COINS_DIPS") |
| 650 | /* Dip switch bank 3 */ |
| 651 | PORT_DIPNAME( 0x0100, 0x0100, "Ticket Dispenser" ) |
| 652 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) /* "Ticket payout function is not working now" will be shown on screen */ |
| 653 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) /* Stored data is shown on screen with the option to clear data */ |
| 654 | PORT_DIPNAME( 0x0200, 0x0600, "Points Per Ticket" ) /* Conversion Rate for Ticket */ |
| 655 | PORT_DIPSETTING( 0x0600, "1 Point - 1 Ticket" ) |
| 656 | PORT_DIPSETTING( 0x0600, "2 Points - 1 Ticket" ) |
| 657 | PORT_DIPSETTING( 0x0200, "5 Points - 1 Ticket" ) |
| 658 | PORT_DIPSETTING( 0x0000, "10 Points - 1 Ticket" ) |
| 659 | PORT_DIPUNUSED( 0x0800, 0x0800 ) /* Game manual states dips 4, 5, 6 & 7 are "Unused" */ |
| 660 | PORT_DIPUNUSED( 0x1000, 0x1000 ) |
| 661 | PORT_DIPUNUSED( 0x2000, 0x2000 ) |
| 662 | PORT_DIPUNUSED( 0x4000, 0x4000 ) |
| 663 | PORT_DIPNAME( 0x8000, 0x8000, "Deltronics Model" ) /* Ticket Despenser Model Type */ |
| 664 | PORT_DIPSETTING( 0x8000, "DL 1275" ) |
| 665 | PORT_DIPSETTING( 0x0000, "DL 4SS" ) |
| 666 | |
| 667 | PORT_MODIFY("DIPS21") |
| 668 | /* Dip switch bank 2 */ |
| 669 | PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) |
| 670 | PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) |
| 671 | PORT_DIPSETTING( 0x0200, DEF_STR( Cocktail ) ) |
| 672 | |
| 673 | /* Dip switch bank 1 */ |
| 674 | PORT_DIPNAME( 0x0001, 0x0001, "Given Holes/Stroke Play" ) |
| 675 | PORT_DIPSETTING( 0x0000, "1" ) |
| 676 | PORT_DIPSETTING( 0x0001, "2" ) |
| 677 | PORT_DIPNAME( 0x0002, 0x0002, "Given Holes/Match or Skins" ) |
| 678 | PORT_DIPSETTING( 0x0000, "1" ) |
| 679 | PORT_DIPSETTING( 0x0002, "2" ) |
| 680 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Difficulty ) ) |
| 681 | PORT_DIPSETTING( 0x0004, DEF_STR( Normal ) ) |
| 682 | PORT_DIPSETTING( 0x0000, DEF_STR( Hard ) ) |
| 683 | PORT_DIPNAME( 0x0008, 0x0008, "Joystick Configuration" ) /* Listed as "Joysticks on" */ |
| 684 | PORT_DIPSETTING( 0x0008, DEF_STR( Upright ) ) /* "One Side" */ |
| 685 | PORT_DIPSETTING( 0x0000, DEF_STR( Cocktail ) ) /* "Both Sides" */ |
| 686 | PORT_DIPNAME( 0x0010, 0x0010, "Number of Joysticks" ) /* 4 Way joysticks with 2 buttons each player */ |
| 687 | PORT_DIPSETTING( 0x0010, "2 Joysticks" ) |
| 688 | PORT_DIPSETTING( 0x0000, "4 Joysticks" ) |
| 689 | PORT_DIPNAME( 0x0020, 0x0000, "Any Button to Start" ) |
| 690 | PORT_DIPSETTING( 0x0020, DEF_STR( No ) ) |
| 691 | PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) |
| 767 | 692 | INPUT_PORTS_END |
| 768 | 693 | |
| 769 | | INPUT_PORTS_START( inthunt ) |
| 770 | | IREM_JOYSTICK_1_2(1) |
| 771 | | IREM_JOYSTICK_1_2(2) |
| 772 | | IREM_PORT_UNUSED |
| 773 | | IREM_PORT_UNUSED |
| 774 | | IREM_COINS |
| 775 | | IREM_SYSTEM_DIPSWITCH |
| 776 | 694 | |
| 777 | | PORT_START /* Dip switch bank 1 */ |
| 778 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 779 | | PORT_DIPSETTING( 0x02, "2" ) |
| 780 | | PORT_DIPSETTING( 0x03, "3" ) |
| 781 | | PORT_DIPSETTING( 0x01, "4" ) |
| 782 | | PORT_DIPSETTING( 0x00, "5" ) |
| 783 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 784 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy) ) |
| 785 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 786 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 787 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 788 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) |
| 789 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 790 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 791 | | PORT_DIPNAME( 0x20, 0x20, "Any Button to Start" ) |
| 792 | | PORT_DIPSETTING( 0x20, DEF_STR( No ) ) |
| 793 | | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 794 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 795 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 796 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 797 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 695 | INPUT_PORTS_START( mysticri ) |
| 696 | PORT_INCLUDE(m92_2player) |
| 798 | 697 | |
| 799 | | IREM_PORT_UNUSED /* Game manual only mentions 2 dips */ |
| 698 | PORT_MODIFY("DIPS21") |
| 699 | /* Dip switch bank 1 */ |
| 700 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 701 | PORT_DIPSETTING( 0x0002, "2" ) |
| 702 | PORT_DIPSETTING( 0x0003, "3" ) |
| 703 | PORT_DIPSETTING( 0x0001, "4" ) |
| 704 | PORT_DIPSETTING( 0x0000, "5" ) |
| 705 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 706 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 707 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 708 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 709 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 710 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) ) |
| 711 | PORT_DIPSETTING( 0x0000, "15000 35000 60000" ) |
| 712 | PORT_DIPSETTING( 0x0010, "20000 50000 90000" ) |
| 800 | 713 | INPUT_PORTS_END |
| 801 | 714 | |
| 802 | | INPUT_PORTS_START( nbbatman ) |
| 803 | | IREM_JOYSTICK_1_2(1) |
| 804 | | IREM_JOYSTICK_1_2(2) |
| 805 | | IREM_JOYSTICK_3_4(3) |
| 806 | | IREM_JOYSTICK_3_4(4) |
| 807 | | IREM_COINS |
| 808 | | IREM_SYSTEM_DIPSWITCH_4PLAYERS |
| 809 | 715 | |
| 810 | | PORT_START /* Dip switch bank 1 */ |
| 811 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 812 | | PORT_DIPSETTING( 0x00, "1" ) |
| 813 | | PORT_DIPSETTING( 0x03, "2" ) |
| 814 | | PORT_DIPSETTING( 0x02, "3" ) |
| 815 | | PORT_DIPSETTING( 0x01, "4" ) |
| 816 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 817 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 818 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 819 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 820 | | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 821 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) /* One of these is continue */ |
| 822 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 823 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 824 | | PORT_DIPNAME( 0x20, 0x00, "Any Button to Start" ) |
| 825 | | PORT_DIPSETTING( 0x20, DEF_STR( No ) ) |
| 826 | | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 827 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 828 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 829 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 830 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 716 | INPUT_PORTS_START( uccops ) |
| 717 | PORT_INCLUDE(m92_3player) |
| 831 | 718 | |
| 832 | | PORT_START /* Dip switch bank 3 */ |
| 833 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 834 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 835 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 836 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 837 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 838 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 839 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 840 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 841 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 842 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 843 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 844 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 845 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 846 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 847 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 848 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 849 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 850 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 851 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 852 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 853 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 854 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 855 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 856 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 719 | PORT_MODIFY("DIPS21") |
| 720 | /* Dip switch bank 1 */ |
| 721 | PORT_DIPNAME( 0x0003, 0x0002, DEF_STR( Lives ) ) |
| 722 | PORT_DIPSETTING( 0x0000, "1" ) |
| 723 | PORT_DIPSETTING( 0x0003, "2" ) |
| 724 | PORT_DIPSETTING( 0x0002, "3" ) |
| 725 | PORT_DIPSETTING( 0x0001, "4" ) |
| 726 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 727 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy) ) |
| 728 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 729 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 730 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 731 | /* There is ALLWAYS a Bonus Life at 300K */ |
| 732 | /* It does not depends on the value of bit 0x0010 */ |
| 733 | PORT_DIPNAME( 0x0020, 0x0020, "Any Button to Start" ) |
| 734 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 735 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 857 | 736 | INPUT_PORTS_END |
| 858 | 737 | |
| 859 | | INPUT_PORTS_START( psoldier ) |
| 860 | | PORT_START |
| 861 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 862 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 863 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 864 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 865 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 866 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 867 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 868 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 869 | 738 | |
| 870 | | PORT_START |
| 871 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 872 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 873 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 874 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 875 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 876 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 877 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 878 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 739 | INPUT_PORTS_START( rtypeleo ) |
| 740 | PORT_INCLUDE(m92_2player) |
| 879 | 741 | |
| 880 | | IREM_PORT_UNUSED |
| 742 | PORT_MODIFY("DIPS21") |
| 743 | /* Dip switch bank 1 */ |
| 744 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 745 | PORT_DIPSETTING( 0x0002, "2" ) |
| 746 | PORT_DIPSETTING( 0x0003, "3" ) |
| 747 | PORT_DIPSETTING( 0x0001, "4" ) |
| 748 | PORT_DIPSETTING( 0x0000, "5" ) |
| 749 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 750 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy ) ) |
| 751 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 752 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 753 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 754 | INPUT_PORTS_END |
| 881 | 755 | |
| 882 | | PORT_START /* Extra connector for kick buttons */ |
| 883 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 884 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) |
| 885 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) |
| 886 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) |
| 887 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 888 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) |
| 889 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) |
| 890 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) |
| 891 | 756 | |
| 892 | | IREM_COINS |
| 893 | | IREM_SYSTEM_DIPSWITCH |
| 757 | INPUT_PORTS_START( inthunt ) |
| 758 | PORT_INCLUDE(m92_2player) |
| 894 | 759 | |
| 895 | | PORT_START /* Dip switch bank 1 */ |
| 896 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 897 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 898 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 899 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 900 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 901 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 902 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* Probably difficulty */ |
| 903 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 904 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 905 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 906 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 907 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 908 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 909 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 910 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 911 | | PORT_DIPNAME( 0x20, 0x00, "Any Button to Start" ) |
| 912 | | PORT_DIPSETTING( 0x20, DEF_STR( No ) ) |
| 913 | | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 914 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 915 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 916 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 917 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 760 | PORT_MODIFY("DIPS21") |
| 761 | /* Dip switch bank 1 */ |
| 762 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 763 | PORT_DIPSETTING( 0x0002, "2" ) |
| 764 | PORT_DIPSETTING( 0x0003, "3" ) |
| 765 | PORT_DIPSETTING( 0x0001, "4" ) |
| 766 | PORT_DIPSETTING( 0x0000, "5" ) |
| 767 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 768 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy) ) |
| 769 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 770 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 771 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 772 | PORT_DIPNAME( 0x0020, 0x0020, "Any Button to Start" ) |
| 773 | PORT_DIPSETTING( 0x0020, DEF_STR( No ) ) |
| 774 | PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) |
| 775 | INPUT_PORTS_END |
| 918 | 776 | |
| 919 | | PORT_START /* Dip switch bank 3 */ |
| 920 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 921 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 922 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 923 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 924 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 925 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 926 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 927 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 928 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 929 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 930 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 931 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 932 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 933 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 934 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 935 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 936 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 937 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 938 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 939 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 940 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 941 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 942 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 943 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 777 | |
| 778 | INPUT_PORTS_START( nbbatman ) |
| 779 | PORT_INCLUDE(m92_4player) |
| 780 | |
| 781 | PORT_MODIFY("DIPS21") |
| 782 | /* Dip switch bank 1 */ |
| 783 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 784 | PORT_DIPSETTING( 0x0000, "1" ) |
| 785 | PORT_DIPSETTING( 0x0003, "2" ) |
| 786 | PORT_DIPSETTING( 0x0002, "3" ) |
| 787 | PORT_DIPSETTING( 0x0001, "4" ) |
| 788 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 789 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 790 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 791 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 792 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 793 | PORT_DIPNAME( 0x0020, 0x0000, "Any Button to Start" ) |
| 794 | PORT_DIPSETTING( 0x0020, DEF_STR( No ) ) |
| 795 | PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) |
| 944 | 796 | INPUT_PORTS_END |
| 945 | 797 | |
| 798 | |
| 799 | INPUT_PORTS_START( psoldier ) |
| 800 | PORT_INCLUDE(m92_2player) |
| 801 | |
| 802 | PORT_MODIFY("DIPS21") |
| 803 | /* Dip switch bank 1 */ |
| 804 | PORT_DIPNAME( 0x0020, 0x0000, "Any Button to Start" ) |
| 805 | PORT_DIPSETTING( 0x0020, DEF_STR( No ) ) |
| 806 | PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) |
| 807 | |
| 808 | PORT_MODIFY("JOY34") /* Extra connector for kick buttons */ |
| 809 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 810 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) |
| 811 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) |
| 812 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) |
| 813 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 814 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) |
| 815 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) |
| 816 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) |
| 817 | INPUT_PORTS_END |
| 818 | |
| 819 | |
| 946 | 820 | INPUT_PORTS_START( dsccr94j ) |
| 947 | | IREM_JOYSTICK_1_2(1) |
| 948 | | IREM_JOYSTICK_1_2(2) |
| 949 | | IREM_JOYSTICK_3_4(3) |
| 950 | | IREM_JOYSTICK_3_4(4) |
| 951 | | IREM_COINS |
| 952 | | IREM_SYSTEM_DIPSWITCH /* Dip Switch 2, dip 2 is listed as "Don't Change" and is "OFF" */ |
| 821 | PORT_INCLUDE(m92_4player) |
| 822 | /* Dip Switch 2, dip 2 is listed as "Don't Change" and is "OFF" */ |
| 953 | 823 | |
| 954 | | PORT_START /* Dip switch bank 1 */ |
| 955 | | PORT_DIPNAME( 0x03, 0x03, "Time" ) |
| 956 | | PORT_DIPSETTING( 0x00, "1:30" ) |
| 957 | | PORT_DIPSETTING( 0x03, "2:00" ) |
| 958 | | PORT_DIPSETTING( 0x02, "2:30" ) |
| 959 | | PORT_DIPSETTING( 0x01, "3:00" ) |
| 960 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 961 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy) ) |
| 962 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 963 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 964 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 965 | | PORT_DIPNAME( 0x10, 0x10, "Game Mode" ) |
| 966 | | PORT_DIPSETTING( 0x10, "Match Mode" ) |
| 967 | | PORT_DIPSETTING( 0x00, "Power Mode" ) |
| 824 | PORT_MODIFY("COINS_DIPS") |
| 825 | /* Dip switch bank 3 */ |
| 826 | PORT_DIPNAME( 0x0300, 0x0300, "Player Power" ) |
| 827 | PORT_DIPSETTING( 0x0000, "500" ) |
| 828 | PORT_DIPSETTING( 0x0300, "1000" ) |
| 829 | PORT_DIPSETTING( 0x0100, "1500" ) |
| 830 | PORT_DIPSETTING( 0x0200, "2000" ) |
| 831 | |
| 832 | PORT_MODIFY("DIPS21") |
| 833 | /* Dip switch bank 1 */ |
| 834 | PORT_DIPNAME( 0x0003, 0x0003, "Time" ) |
| 835 | PORT_DIPSETTING( 0x0000, "1:30" ) |
| 836 | PORT_DIPSETTING( 0x0003, "2:00" ) |
| 837 | PORT_DIPSETTING( 0x0002, "2:30" ) |
| 838 | PORT_DIPSETTING( 0x0001, "3:00" ) |
| 839 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 840 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy) ) |
| 841 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 842 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 843 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 844 | PORT_DIPNAME( 0x0010, 0x0010, "Game Mode" ) |
| 845 | PORT_DIPSETTING( 0x0010, "Match Mode" ) |
| 846 | PORT_DIPSETTING( 0x0000, "Power Mode" ) |
| 968 | 847 | /* |
| 969 | 848 | Match Mode: Winner advances to the next game. Game Over for the loser |
| 970 | 849 | Power Mode: The Players can play the game until their respective powers run |
| r869 | r870 | |
| 972 | 851 | Player 2 can join in any time during the game |
| 973 | 852 | Player power (time) can be adjusted by dip switch #3 |
| 974 | 853 | */ |
| 975 | | PORT_DIPNAME( 0x20, 0x20, "Starting Button" ) |
| 976 | | PORT_DIPSETTING( 0x00, "Button 1" ) |
| 977 | | PORT_DIPSETTING( 0x20, "Start Button" ) |
| 978 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 979 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 980 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 981 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 982 | | |
| 983 | | PORT_START /* Dip switch bank 3 */ |
| 984 | | PORT_DIPNAME( 0x03, 0x03, "Player Power" ) |
| 985 | | PORT_DIPSETTING( 0x00, "500" ) |
| 986 | | PORT_DIPSETTING( 0x03, "1000" ) |
| 987 | | PORT_DIPSETTING( 0x01, "1500" ) |
| 988 | | PORT_DIPSETTING( 0x02, "2000" ) |
| 989 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 990 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 991 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 992 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 993 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 994 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 995 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 996 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 997 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 998 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 999 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1000 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1001 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 1002 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1003 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1004 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 1005 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 1006 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 854 | PORT_DIPNAME( 0x0020, 0x0020, "Starting Button" ) |
| 855 | PORT_DIPSETTING( 0x0000, "Button 1" ) |
| 856 | PORT_DIPSETTING( 0x0020, "Start Button" ) |
| 1007 | 857 | INPUT_PORTS_END |
| 1008 | 858 | |
| 859 | |
| 1009 | 860 | INPUT_PORTS_START( gunforc2 ) |
| 1010 | | IREM_JOYSTICK_1_2(1) |
| 1011 | | IREM_JOYSTICK_1_2(2) |
| 1012 | | IREM_PORT_UNUSED |
| 1013 | | IREM_PORT_UNUSED |
| 1014 | | IREM_COINS |
| 1015 | | IREM_SYSTEM_DIPSWITCH |
| 861 | PORT_INCLUDE(m92_2player) |
| 1016 | 862 | |
| 1017 | | PORT_START /* Dip switch bank 1 */ |
| 1018 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 1019 | | PORT_DIPSETTING( 0x02, "3" ) |
| 1020 | | PORT_DIPSETTING( 0x03, "2" ) |
| 1021 | | PORT_DIPSETTING( 0x01, "4" ) |
| 1022 | | PORT_DIPSETTING( 0x00, "1" ) |
| 1023 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 1024 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy) ) |
| 1025 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 1026 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 1027 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 1028 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) |
| 1029 | | PORT_DIPSETTING( 0x00, "15000 35000 75000 120000" ) |
| 1030 | | PORT_DIPSETTING( 0x10, "20000 40000 90000 150000" ) |
| 1031 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) |
| 1032 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1033 | | PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) |
| 1034 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 1035 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1036 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1037 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 1038 | | |
| 1039 | | IREM_PORT_UNUSED /* Game manual only mentions 2 dips */ |
| 863 | PORT_MODIFY("DIPS21") |
| 864 | /* Dip switch bank 1 */ |
| 865 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 866 | PORT_DIPSETTING( 0x0002, "3" ) |
| 867 | PORT_DIPSETTING( 0x0003, "2" ) |
| 868 | PORT_DIPSETTING( 0x0001, "4" ) |
| 869 | PORT_DIPSETTING( 0x0000, "1" ) |
| 870 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 871 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy) ) |
| 872 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 873 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 874 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 875 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) ) |
| 876 | PORT_DIPSETTING( 0x0000, "15000 35000 75000 120000" ) |
| 877 | PORT_DIPSETTING( 0x0010, "20000 40000 90000 150000" ) |
| 1040 | 878 | INPUT_PORTS_END |
| 1041 | 879 | |
| 880 | |
| 1042 | 881 | /***************************************************************************/ |
| 1043 | 882 | |
| 1044 | 883 | static const gfx_layout charlayout = |
| r869 | r870 | |
| 1093 | 932 | static void sound_irq(int state) |
| 1094 | 933 | { |
| 1095 | 934 | if (state) |
| 1096 | | timer_call_after_resynch(YM2151_ASSERT,setvector_callback); |
| 935 | timer_call_after_resynch(YM2151_ASSERT, setvector_callback); |
| 1097 | 936 | else |
| 1098 | | timer_call_after_resynch(YM2151_CLEAR,setvector_callback); |
| 937 | timer_call_after_resynch(YM2151_CLEAR, setvector_callback); |
| 1099 | 938 | } |
| 1100 | 939 | |
| 1101 | 940 | static struct YM2151interface ym2151_interface = |
| r869 | r870 | |
| 1110 | 949 | |
| 1111 | 950 | /***************************************************************************/ |
| 1112 | 951 | |
| 1113 | | static INTERRUPT_GEN( m92_interrupt ) |
| 1114 | | { |
| 1115 | | video_screen_update_partial(0, 249+128); |
| 1116 | | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M92_IRQ_0); /* VBL */ |
| 1117 | | } |
| 1118 | | |
| 1119 | | static INTERRUPT_GEN( m92_raster_interrupt ) |
| 1120 | | { |
| 1121 | | int line = M92_SCANLINES - cpu_getiloops(); |
| 1122 | | |
| 1123 | | /* Raster interrupt */ |
| 1124 | | if (m92_raster_enable && line==m92_raster_irq_position) { |
| 1125 | | video_screen_update_partial(0, line+128); |
| 1126 | | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M92_IRQ_2); |
| 1127 | | } |
| 1128 | | |
| 1129 | | /* Redraw screen, then set vblank and trigger the VBL interrupt */ |
| 1130 | | else if (line==249) { /* 248 is last visible line */ |
| 1131 | | video_screen_update_partial(0, 249+128); |
| 1132 | | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M92_IRQ_0); |
| 1133 | | } |
| 1134 | | } |
| 1135 | | |
| 1136 | 952 | void m92_sprite_interrupt(void) |
| 1137 | 953 | { |
| 1138 | | cpunum_set_input_line_and_vector(0,0,HOLD_LINE,M92_IRQ_1); |
| 954 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M92_IRQ_1); |
| 1139 | 955 | } |
| 1140 | 956 | |
| 1141 | | static MACHINE_DRIVER_START( raster ) |
| 957 | static MACHINE_DRIVER_START( m92 ) |
| 1142 | 958 | |
| 1143 | 959 | /* basic machine hardware */ |
| 1144 | | MDRV_CPU_ADD(V33,18000000/2) /* NEC V33, 18 MHz clock */ |
| 1145 | | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1146 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 1147 | | MDRV_CPU_VBLANK_INT(m92_raster_interrupt,M92_SCANLINES) /* First visible line 8? */ |
| 960 | MDRV_CPU_ADD_TAG("main",V33,18000000/2) /* NEC V33, 18 MHz clock */ |
| 961 | MDRV_CPU_PROGRAM_MAP(m92_map,0) |
| 962 | MDRV_CPU_IO_MAP(m92_portmap,0) |
| 1148 | 963 | |
| 1149 | 964 | MDRV_CPU_ADD(V30, 14318180/2) /* 14.31818 MHz */ |
| 1150 | | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 965 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 1151 | 966 | |
| 1152 | 967 | MDRV_MACHINE_START(m92) |
| 968 | MDRV_MACHINE_RESET(m92) |
| 1153 | 969 | MDRV_SCREEN_REFRESH_RATE(60) |
| 1154 | 970 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) |
| 1155 | 971 | |
| 1156 | 972 | /* video hardware */ |
| 1157 | 973 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_BUFFERS_SPRITERAM) |
| 1158 | 974 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 1159 | | MDRV_SCREEN_SIZE(512, 512) |
| 1160 | | MDRV_SCREEN_VISIBLE_AREA(80, 511-112, 128+8, 511-128-8) /* 320 x 240 */ |
| 975 | MDRV_SCREEN_SIZE(512, 256) |
| 976 | MDRV_SCREEN_VISIBLE_AREA(80, 511-112, 8, 247) /* 320 x 240 */ |
| 1161 | 977 | MDRV_GFXDECODE(gfxdecodeinfo) |
| 1162 | 978 | MDRV_PALETTE_LENGTH(2048) |
| 1163 | 979 | |
| r869 | r870 | |
| 1178 | 994 | MACHINE_DRIVER_END |
| 1179 | 995 | |
| 1180 | 996 | |
| 1181 | | static MACHINE_DRIVER_START( nonraster ) |
| 1182 | | |
| 1183 | | /* basic machine hardware */ |
| 1184 | | MDRV_CPU_ADD(V33, 18000000/2) /* NEC V33, 18 MHz clock */ |
| 1185 | | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1186 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 1187 | | MDRV_CPU_VBLANK_INT(m92_interrupt,1) |
| 1188 | | |
| 1189 | | MDRV_CPU_ADD(V30, 14318180/2) |
| 1190 | | /* audio CPU */ /* 14.31818 MHz */ |
| 1191 | | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 1192 | | |
| 1193 | | MDRV_MACHINE_START(m92) |
| 1194 | | MDRV_SCREEN_REFRESH_RATE(60) |
| 1195 | | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) |
| 1196 | | |
| 1197 | | /* video hardware */ |
| 1198 | | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_BUFFERS_SPRITERAM) |
| 1199 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 1200 | | MDRV_SCREEN_SIZE(512, 512) |
| 1201 | | MDRV_SCREEN_VISIBLE_AREA(80, 511-112, 128+8, 511-128-8) /* 320 x 240 */ |
| 1202 | | MDRV_GFXDECODE(gfxdecodeinfo) |
| 1203 | | MDRV_PALETTE_LENGTH(2048) |
| 1204 | | |
| 1205 | | MDRV_VIDEO_START(m92) |
| 1206 | | MDRV_VIDEO_UPDATE(m92) |
| 1207 | | |
| 1208 | | /* sound hardware */ |
| 1209 | | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1210 | | |
| 1211 | | MDRV_SOUND_ADD(YM2151, 14318180/4) |
| 1212 | | MDRV_SOUND_CONFIG(ym2151_interface) |
| 1213 | | MDRV_SOUND_ROUTE(0, "mono", 0.40) |
| 1214 | | MDRV_SOUND_ROUTE(1, "mono", 0.40) |
| 1215 | | |
| 1216 | | MDRV_SOUND_ADD(IREMGA20, 14318180/4) |
| 1217 | | MDRV_SOUND_CONFIG(iremGA20_interface) |
| 1218 | | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1219 | | MACHINE_DRIVER_END |
| 1220 | | |
| 1221 | | |
| 1222 | 997 | static MACHINE_DRIVER_START( lethalth ) |
| 998 | MDRV_IMPORT_FROM(m92) |
| 1223 | 999 | |
| 1224 | 1000 | /* basic machine hardware */ |
| 1225 | | MDRV_CPU_ADD(V33, 18000000/2) /* NEC V33, 18 MHz clock */ |
| 1226 | | MDRV_CPU_PROGRAM_MAP(lethalth_readmem,lethalth_writemem) |
| 1227 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 1228 | | MDRV_CPU_VBLANK_INT(m92_interrupt,1) |
| 1229 | | |
| 1230 | | MDRV_CPU_ADD(V30, 14318180/2) |
| 1231 | | /* audio CPU */ /* 14.31818 MHz */ |
| 1232 | | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 1233 | | |
| 1234 | | MDRV_MACHINE_START(m92) |
| 1235 | | MDRV_SCREEN_REFRESH_RATE(60) |
| 1236 | | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) |
| 1237 | | |
| 1238 | | /* video hardware */ |
| 1239 | | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_BUFFERS_SPRITERAM) |
| 1240 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 1241 | | MDRV_SCREEN_SIZE(512, 512) |
| 1242 | | MDRV_SCREEN_VISIBLE_AREA(80, 511-112, 128+8, 511-128-8) /* 320 x 240 */ |
| 1243 | | MDRV_GFXDECODE(gfxdecodeinfo) |
| 1244 | | MDRV_PALETTE_LENGTH(2048) |
| 1245 | | |
| 1246 | | MDRV_VIDEO_START(m92) |
| 1247 | | MDRV_VIDEO_UPDATE(m92) |
| 1248 | | |
| 1249 | | /* sound hardware */ |
| 1250 | | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1251 | | |
| 1252 | | MDRV_SOUND_ADD(YM2151, 14318180/4) |
| 1253 | | MDRV_SOUND_CONFIG(ym2151_interface) |
| 1254 | | MDRV_SOUND_ROUTE(0, "mono", 0.40) |
| 1255 | | MDRV_SOUND_ROUTE(1, "mono", 0.40) |
| 1256 | | |
| 1257 | | MDRV_SOUND_ADD(IREMGA20, 14318180/4) |
| 1258 | | MDRV_SOUND_CONFIG(iremGA20_interface) |
| 1259 | | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1001 | MDRV_CPU_MODIFY("main") |
| 1002 | MDRV_CPU_PROGRAM_MAP(lethalth_map,0) |
| 1260 | 1003 | MACHINE_DRIVER_END |
| 1261 | 1004 | |
| 1262 | 1005 | |
| 1263 | 1006 | static MACHINE_DRIVER_START( psoldier ) |
| 1007 | MDRV_IMPORT_FROM(m92) |
| 1264 | 1008 | |
| 1265 | | /* basic machine hardware */ |
| 1266 | | MDRV_CPU_ADD(V33, 18000000/2) /* NEC V33, 18 MHz clock */ |
| 1267 | | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1268 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 1269 | | MDRV_CPU_VBLANK_INT(m92_interrupt,1) |
| 1270 | | |
| 1271 | | MDRV_CPU_ADD(V30, 14318180/2) |
| 1272 | | /* audio CPU */ /* 14.31818 MHz */ |
| 1273 | | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 1274 | | |
| 1275 | | MDRV_MACHINE_START(m92) |
| 1276 | | MDRV_SCREEN_REFRESH_RATE(60) |
| 1277 | | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) |
| 1278 | | |
| 1279 | 1009 | /* video hardware */ |
| 1280 | | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_BUFFERS_SPRITERAM) |
| 1281 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 1282 | | MDRV_SCREEN_SIZE(512, 512) |
| 1283 | | MDRV_SCREEN_VISIBLE_AREA(80, 511-112, 128+8, 511-128-8) /* 320 x 240 */ |
| 1284 | 1010 | MDRV_GFXDECODE(gfxdecodeinfo2) |
| 1285 | | MDRV_PALETTE_LENGTH(2048) |
| 1286 | | |
| 1287 | | MDRV_VIDEO_START(m92) |
| 1288 | | MDRV_VIDEO_UPDATE(m92) |
| 1289 | | |
| 1290 | | /* sound hardware */ |
| 1291 | | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1292 | | |
| 1293 | | MDRV_SOUND_ADD(YM2151, 14318180/4) |
| 1294 | | MDRV_SOUND_CONFIG(ym2151_interface) |
| 1295 | | MDRV_SOUND_ROUTE(0, "mono", 0.40) |
| 1296 | | MDRV_SOUND_ROUTE(1, "mono", 0.40) |
| 1297 | | |
| 1298 | | MDRV_SOUND_ADD(IREMGA20, 14318180/4) |
| 1299 | | MDRV_SOUND_CONFIG(iremGA20_interface) |
| 1300 | | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1301 | 1011 | MACHINE_DRIVER_END |
| 1302 | 1012 | |
| 1303 | 1013 | /***************************************************************************/ |
| r869 | r870 | |
| 2165 | 1875 | ROM_END |
| 2166 | 1876 | |
| 2167 | 1877 | |
| 2168 | | static void m92_startup(int hasbanks) |
| 1878 | static void init_m92(running_machine *machine, const UINT8 *decryption_table, int hasbanks) |
| 2169 | 1879 | { |
| 2170 | 1880 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 2171 | 1881 | |
| r869 | r870 | |
| 2181 | 1891 | } |
| 2182 | 1892 | |
| 2183 | 1893 | RAM = memory_region(REGION_CPU2); |
| 2184 | | memcpy(RAM+0xffff0,RAM+0x1fff0,0x10); /* Sound cpu Start vector */ |
| 1894 | memcpy(RAM+0xffff0, RAM+0x1fff0, 0x10); /* Sound cpu Start vector */ |
| 2185 | 1895 | |
| 2186 | 1896 | m92_game_kludge=0; |
| 2187 | 1897 | m92_irq_vectorbase=0x80; |
| 2188 | | m92_raster_enable=1; |
| 2189 | | m92_sprite_buffer_busy=0x80; |
| 2190 | | } |
| 1898 | m92_sprite_buffer_busy=1; |
| 2191 | 1899 | |
| 2192 | | static void init_m92(running_machine *machine, const UINT8 *decryption_table, int hasbanks) |
| 2193 | | { |
| 2194 | | m92_startup(hasbanks); |
| 2195 | 1900 | setvector_callback(machine, VECTOR_INIT); |
| 2196 | 1901 | irem_cpu_decrypt(1,decryption_table); |
| 2197 | 1902 | } |
| r869 | r870 | |
| 2238 | 1943 | init_m92(machine, majtitl2_decryption_table, 1); |
| 2239 | 1944 | |
| 2240 | 1945 | /* This game has an eprom on the game board */ |
| 2241 | | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0000, 0xf3fff, 0, 0, m92_eeprom_r); |
| 2242 | | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0000, 0xf3fff, 0, 0, m92_eeprom_w); |
| 1946 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0000, 0xf3fff, 0, 0, m92_eeprom_r); |
| 1947 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0000, 0xf3fff, 0, 0, m92_eeprom_w); |
| 2243 | 1948 | |
| 2244 | 1949 | m92_game_kludge=2; |
| 2245 | 1950 | } |
| r869 | r870 | |
| 2261 | 1966 | m92_irq_vectorbase=0x20; |
| 2262 | 1967 | |
| 2263 | 1968 | /* NOP out the bankswitcher */ |
| 2264 | | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x20, 0x21, 0, 0, MWA8_NOP); |
| 2265 | | |
| 2266 | | /* This game sets the raster IRQ position, but the interrupt routine |
| 2267 | | is just an iret, no need to emulate it */ |
| 2268 | | m92_raster_enable=0; |
| 2269 | | m92_game_kludge=3; /* No upper palette bank? It could be a different motherboard */ |
| 1969 | memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0x20, 0x21, 0, 0, MWA16_NOP); |
| 2270 | 1970 | } |
| 2271 | 1971 | |
| 2272 | 1972 | static DRIVER_INIT( nbbatman ) |
| r869 | r870 | |
| 2308 | 2008 | |
| 2309 | 2009 | /***************************************************************************/ |
| 2310 | 2010 | |
| 2311 | | /* The 'nonraster' machine is for games that don't use the raster interrupt feature - slightly faster to emulate */ |
| 2312 | | GAME( 1991, gunforce, 0, raster, gunforce, gunforce, ROT0, "Irem", "Gunforce - Battle Fire Engulfed Terror Island (World)", 0 ) |
| 2313 | | GAME( 1991, gunforcj, gunforce, raster, gunforce, gunforce, ROT0, "Irem", "Gunforce - Battle Fire Engulfed Terror Island (Japan)", 0 ) |
| 2314 | | GAME( 1991, gunforcu, gunforce, raster, gunforce, gunforce, ROT0, "Irem America", "Gunforce - Battle Fire Engulfed Terror Island (US)", 0 ) |
| 2315 | | GAME( 1991, bmaster, 0, nonraster, bmaster, bmaster, ROT0, "Irem", "Blade Master (World)", 0 ) |
| 2316 | | GAME( 1991, crossbld, bmaster, nonraster, bmaster, bmaster, ROT0, "Irem", "Cross Blades! (Japan)", 0 ) |
| 2317 | | GAME( 1991, lethalth, 0, lethalth, lethalth, lethalth, ROT270, "Irem", "Lethal Thunder (World)", 0 ) |
| 2318 | | GAME( 1991, thndblst, lethalth, lethalth, lethalth, lethalth, ROT270, "Irem", "Thunder Blaster (Japan)", 0 ) |
| 2319 | | GAME( 1992, uccops, 0, raster, uccops, uccops, ROT0, "Irem", "Undercover Cops (World)", 0 ) |
| 2320 | | GAME( 1992, uccopsj, uccops, raster, uccops, uccops, ROT0, "Irem", "Undercover Cops (Japan)", 0 ) |
| 2321 | | GAME( 1992, mysticri, 0, nonraster, mysticri, mysticri, ROT0, "Irem", "Mystic Riders (World)", 0 ) |
| 2322 | | GAME( 1992, gunhohki, mysticri, nonraster, mysticri, mysticri, ROT0, "Irem", "Gun Hohki (Japan)", 0 ) |
| 2323 | | GAME( 1992, majtitl2, 0, raster, majtitl2, majtitl2, ROT0, "Irem", "Major Title 2 (World)", 0 ) |
| 2324 | | GAME( 1992, majtit2j, majtitl2, raster, majtitl2, majtitl2, ROT0, "Irem", "Major Title 2 (Japan)", 0 ) |
| 2325 | | GAME( 1992, skingame, majtitl2, raster, majtitl2, majtitl2, ROT0, "Irem America", "The Irem Skins Game (US set 1)", 0 ) |
| 2326 | | GAME( 1992, skingam2, majtitl2, raster, majtitl2, majtitl2, ROT0, "Irem America", "The Irem Skins Game (US set 2)", 0 ) |
| 2327 | | GAME( 1992, hook, 0, nonraster, hook, hook, ROT0, "Irem", "Hook (World)", 0 ) |
| 2328 | | GAME( 1992, hooku, hook, nonraster, hook, hook, ROT0, "Irem America", "Hook (US)", 0 ) |
| 2329 | | GAME( 1992, hookj, hook, nonraster, hook, hook, ROT0, "Irem", "Hook (Japan)", 0 ) |
| 2330 | | GAME( 1992, rtypeleo, 0, raster, rtypeleo, rtypeleo, ROT0, "Irem", "R-Type Leo (World)", 0 ) |
| 2331 | | GAME( 1992, rtypelej, rtypeleo, raster, rtypeleo, rtypelej, ROT0, "Irem", "R-Type Leo (Japan)", 0 ) |
| 2332 | | GAME( 1993, inthunt, 0, raster, inthunt, inthunt, ROT0, "Irem", "In The Hunt (World)", 0 ) |
| 2333 | | GAME( 1993, inthuntu, inthunt, raster, inthunt, inthunt, ROT0, "Irem America", "In The Hunt (US)", 0 ) |
| 2334 | | GAME( 1993, kaiteids, inthunt, raster, inthunt, kaiteids, ROT0, "Irem", "Kaitei Daisensou (Japan)", 0 ) |
| 2335 | | GAME( 1993, nbbatman, 0, raster, nbbatman, nbbatman, ROT0, "Irem America", "Ninja Baseball Batman (US)", GAME_IMPERFECT_GRAPHICS ) |
| 2336 | | GAME( 1993, leaguemn, nbbatman, raster, nbbatman, nbbatman, ROT0, "Irem", "Yakyuu Kakutou League-Man (Japan)", GAME_IMPERFECT_GRAPHICS ) |
| 2337 | | GAME( 1993, ssoldier, 0, psoldier, psoldier, ssoldier, ROT0, "Irem America", "Superior Soldiers (US)", GAME_IMPERFECT_SOUND ) |
| 2338 | | GAME( 1993, psoldier, ssoldier, psoldier, psoldier, psoldier, ROT0, "Irem", "Perfect Soldiers (Japan)", GAME_IMPERFECT_SOUND ) |
| 2339 | | GAME( 1994, dsccr94j, dsoccr94, psoldier, dsccr94j, dsccr94j, ROT0, "Irem", "Dream Soccer '94 (Japan)", 0 ) |
| 2340 | | GAME( 1994, gunforc2, 0, raster, gunforc2, gunforc2, ROT0, "Irem", "Gunforce 2 (US)", 0 ) |
| 2341 | | GAME( 1994, geostorm, gunforc2, raster, gunforc2, gunforc2, ROT0, "Irem", "Geostorm (Japan)", 0 ) |
| 2011 | GAME( 1991, gunforce, 0, m92, gunforce, gunforce, ROT0, "Irem", "Gunforce - Battle Fire Engulfed Terror Island (World)", 0 ) |
| 2012 | GAME( 1991, gunforcj, gunforce, m92, gunforce, gunforce, ROT0, "Irem", "Gunforce - Battle Fire Engulfed Terror Island (Japan)", 0 ) |
| 2013 | GAME( 1991, gunforcu, gunforce, m92, gunforce, gunforce, ROT0, "Irem America", "Gunforce - Battle Fire Engulfed Terror Island (US)", 0 ) |
| 2014 | GAME( 1991, bmaster, 0, m92, bmaster, bmaster, ROT0, "Irem", "Blade Master (World)", 0 ) |
| 2015 | GAME( 1991, crossbld, bmaster, m92, bmaster, bmaster, ROT0, "Irem", "Cross Blades! (Japan)", 0 ) |
| 2016 | GAME( 1991, lethalth, 0, lethalth, lethalth, lethalth, ROT270, "Irem", "Lethal Thunder (World)", 0 ) |
| 2017 | GAME( 1991, thndblst, lethalth, lethalth, lethalth, lethalth, ROT270, "Irem", "Thunder Blaster (Japan)", 0 ) |
| 2018 | GAME( 1992, uccops, 0, m92, uccops, uccops, ROT0, "Irem", "Undercover Cops (World)", 0 ) |
| 2019 | GAME( 1992, uccopsj, uccops, m92, uccops, uccops, ROT0, "Irem", "Undercover Cops (Japan)", 0 ) |
| 2020 | GAME( 1992, mysticri, 0, m92, mysticri, mysticri, ROT0, "Irem", "Mystic Riders (World)", 0 ) |
| 2021 | GAME( 1992, gunhohki, mysticri, m92, mysticri, mysticri, ROT0, "Irem", "Gun Hohki (Japan)", 0 ) |
| 2022 | GAME( 1992, majtitl2, 0, m92, majtitl2, majtitl2, ROT0, "Irem", "Major Title 2 (World)", 0 ) |
| 2023 | GAME( 1992, majtit2j, majtitl2, m92, majtitl2, majtitl2, ROT0, "Irem", "Major Title 2 (Japan)", 0 ) |
| 2024 | GAME( 1992, skingame, majtitl2, m92, majtitl2, majtitl2, ROT0, "Irem America", "The Irem Skins Game (US set 1)", 0 ) |
| 2025 | GAME( 1992, skingam2, majtitl2, m92, majtitl2, majtitl2, ROT0, "Irem America", "The Irem Skins Game (US set 2)", 0 ) |
| 2026 | GAME( 1992, hook, 0, m92, hook, hook, ROT0, "Irem", "Hook (World)", 0 ) |
| 2027 | GAME( 1992, hooku, hook, m92, hook, hook, ROT0, "Irem America", "Hook (US)", 0 ) |
| 2028 | GAME( 1992, hookj, hook, m92, hook, hook, ROT0, "Irem", "Hook (Japan)", 0 ) |
| 2029 | GAME( 1992, rtypeleo, 0, m92, rtypeleo, rtypeleo, ROT0, "Irem", "R-Type Leo (World)", 0 ) |
| 2030 | GAME( 1992, rtypelej, rtypeleo, m92, rtypeleo, rtypelej, ROT0, "Irem", "R-Type Leo (Japan)", 0 ) |
| 2031 | GAME( 1993, inthunt, 0, m92, inthunt, inthunt, ROT0, "Irem", "In The Hunt (World)", 0 ) |
| 2032 | GAME( 1993, inthuntu, inthunt, m92, inthunt, inthunt, ROT0, "Irem America", "In The Hunt (US)", 0 ) |
| 2033 | GAME( 1993, kaiteids, inthunt, m92, inthunt, kaiteids, ROT0, "Irem", "Kaitei Daisensou (Japan)", 0 ) |
| 2034 | GAME( 1993, nbbatman, 0, m92, nbbatman, nbbatman, ROT0, "Irem America", "Ninja Baseball Batman (US)", GAME_IMPERFECT_GRAPHICS ) |
| 2035 | GAME( 1993, leaguemn, nbbatman, m92, nbbatman, nbbatman, ROT0, "Irem", "Yakyuu Kakutou League-Man (Japan)", GAME_IMPERFECT_GRAPHICS ) |
| 2036 | GAME( 1993, ssoldier, 0, psoldier, psoldier, ssoldier, ROT0, "Irem America", "Superior Soldiers (US)", GAME_IMPERFECT_SOUND ) |
| 2037 | GAME( 1993, psoldier, ssoldier, psoldier, psoldier, psoldier, ROT0, "Irem", "Perfect Soldiers (Japan)", GAME_IMPERFECT_SOUND ) |
| 2038 | GAME( 1994, dsccr94j, dsoccr94, psoldier, dsccr94j, dsccr94j, ROT0, "Irem", "Dream Soccer '94 (Japan)", 0 ) |
| 2039 | GAME( 1994, gunforc2, 0, m92, gunforc2, gunforc2, ROT0, "Irem", "Gunforce 2 (US)", 0 ) |
| 2040 | GAME( 1994, geostorm, gunforc2, m92, gunforc2, gunforc2, ROT0, "Irem", "Geostorm (Japan)", 0 ) |
src/mame/drivers/m107.c
| r869 | r870 | |
| 14 | 14 | *******************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | | #include "m92.h" |
| 17 | #include "m107.h" |
| 18 | 18 | #include "machine/irem_cpu.h" |
| 19 | 19 | #include "sound/2151intf.h" |
| 20 | 20 | #include "sound/iremga20.h" |
| 21 | 21 | |
| 22 | | extern UINT8 *m107_vram_data; |
| 23 | | extern int m107_spritesystem; |
| 24 | | static UINT8 *m107_ram; |
| 25 | | static int m107_irq_vectorbase,m107_vblank,raster_enable; |
| 26 | | extern int m107_raster_irq_position,m107_sprite_list; |
| 27 | 22 | |
| 28 | | #define m107_IRQ_0 ((m107_irq_vectorbase+0)/4) /* VBL interrupt*/ |
| 29 | | #define m107_IRQ_1 ((m107_irq_vectorbase+4)/4) /* ??? */ |
| 30 | | #define m107_IRQ_2 ((m107_irq_vectorbase+8)/4) /* Raster interrupt */ |
| 31 | | #define m107_IRQ_3 ((m107_irq_vectorbase+12)/4) /* ??? */ |
| 23 | #define M107_IRQ_0 ((m107_irq_vectorbase+0)/4) /* VBL interrupt*/ |
| 24 | #define M107_IRQ_1 ((m107_irq_vectorbase+4)/4) /* ??? */ |
| 25 | #define M107_IRQ_2 ((m107_irq_vectorbase+8)/4) /* Raster interrupt */ |
| 26 | #define M107_IRQ_3 ((m107_irq_vectorbase+12)/4) /* ??? */ |
| 32 | 27 | |
| 33 | | WRITE8_HANDLER( m107_spritebuffer_w ); |
| 34 | | void m107_screenrefresh(mame_bitmap *bitmap,const rectangle *clip); |
| 35 | | VIDEO_UPDATE( m107 ); |
| 36 | | VIDEO_UPDATE( dsoccr ); |
| 37 | | VIDEO_START( m107 ); |
| 38 | | WRITE8_HANDLER( m107_control_w ); |
| 39 | | WRITE8_HANDLER( m107_vram_w ); |
| 40 | | READ8_HANDLER( m107_vram_r ); |
| 41 | 28 | |
| 29 | |
| 30 | static mame_timer *scanline_timer; |
| 31 | static UINT8 m107_irq_vectorbase; |
| 32 | |
| 33 | static TIMER_CALLBACK( m107_scanline_interrupt ); |
| 34 | |
| 42 | 35 | /*****************************************************************************/ |
| 43 | 36 | |
| 44 | | static WRITE8_HANDLER( bankswitch_w ) |
| 37 | static WRITE16_HANDLER( bankswitch_w ) |
| 45 | 38 | { |
| 46 | | UINT8 *RAM = memory_region(REGION_CPU1); |
| 39 | if (ACCESSING_LSB) |
| 40 | { |
| 41 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 42 | memory_set_bankptr(1,&RAM[0x100000 + ((data&0x7)*0x10000)]); |
| 43 | } |
| 44 | } |
| 47 | 45 | |
| 48 | | if (offset==1) return; /* Unused top byte */ |
| 49 | | memory_set_bankptr(1,&RAM[0x100000 + ((data&0x7)*0x10000)]); |
| 46 | static MACHINE_START( m107 ) |
| 47 | { |
| 48 | scanline_timer = mame_timer_alloc(m107_scanline_interrupt); |
| 50 | 49 | } |
| 51 | 50 | |
| 52 | | static READ8_HANDLER( m107_port_4_r ) |
| 51 | static MACHINE_RESET( m107 ) |
| 53 | 52 | { |
| 54 | | if (m107_vblank) return readinputport(4) | 0; |
| 55 | | return readinputport(4) | 0x80; |
| 53 | mame_timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, time_never); |
| 56 | 54 | } |
| 57 | 55 | |
| 58 | | static WRITE8_HANDLER( m107_coincounter_w ) |
| 56 | /*****************************************************************************/ |
| 57 | |
| 58 | static TIMER_CALLBACK( m107_scanline_interrupt ) |
| 59 | 59 | { |
| 60 | | if (offset==0) { |
| 60 | int scanline = param; |
| 61 | |
| 62 | /* raster interrupt */ |
| 63 | if (scanline == m107_raster_irq_position) |
| 64 | { |
| 65 | video_screen_update_partial(0, scanline); |
| 66 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M107_IRQ_2); |
| 67 | } |
| 68 | |
| 69 | /* VBLANK interrupt */ |
| 70 | else if (scanline == machine->screen[0].visarea.max_y + 1) |
| 71 | { |
| 72 | video_screen_update_partial(0, scanline); |
| 73 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M107_IRQ_0); |
| 74 | } |
| 75 | |
| 76 | /* adjust for next scanline */ |
| 77 | if (++scanline >= machine->screen[0].height) |
| 78 | scanline = 0; |
| 79 | mame_timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, time_never); |
| 80 | } |
| 81 | |
| 82 | |
| 83 | static WRITE16_HANDLER( m107_coincounter_w ) |
| 84 | { |
| 85 | if (ACCESSING_LSB) |
| 86 | { |
| 61 | 87 | coin_counter_w(0,data & 0x01); |
| 62 | 88 | coin_counter_w(1,data & 0x02); |
| 63 | 89 | } |
| r869 | r870 | |
| 91 | 117 | cpunum_set_input_line(1,0,ASSERT_LINE); |
| 92 | 118 | } |
| 93 | 119 | |
| 94 | | static WRITE8_HANDLER( m92_soundlatch_w ) |
| 120 | static WRITE16_HANDLER( m107_soundlatch_w ) |
| 95 | 121 | { |
| 96 | | if (offset==0) |
| 97 | | { |
| 98 | | timer_call_after_resynch(V30_ASSERT,setvector_callback); |
| 99 | | soundlatch_w(0,data); |
| 122 | timer_call_after_resynch(V30_ASSERT,setvector_callback); |
| 123 | soundlatch_w(0, data & 0xff); |
| 100 | 124 | // logerror("soundlatch_w %02x\n",data); |
| 101 | | } |
| 102 | 125 | } |
| 103 | 126 | |
| 104 | 127 | static int sound_status; |
| 105 | 128 | |
| 106 | | static READ8_HANDLER( m92_sound_status_r ) |
| 129 | static READ16_HANDLER( m107_sound_status_r ) |
| 107 | 130 | { |
| 108 | | return 0xff; |
| 131 | return sound_status; |
| 109 | 132 | } |
| 110 | 133 | |
| 111 | | static READ8_HANDLER( m92_soundlatch_r ) |
| 134 | static READ16_HANDLER( m107_soundlatch_r ) |
| 112 | 135 | { |
| 113 | | if (offset == 0) |
| 114 | | { |
| 115 | | int res = soundlatch_r(offset); |
| 116 | | // logerror("soundlatch_r %02x\n",res); |
| 117 | | return res; |
| 118 | | } |
| 119 | | else return 0xff; |
| 136 | return soundlatch_r(offset) | 0xff00; |
| 120 | 137 | } |
| 121 | 138 | |
| 122 | | static WRITE8_HANDLER( m92_sound_irq_ack_w ) |
| 139 | static WRITE16_HANDLER( m107_sound_irq_ack_w ) |
| 123 | 140 | { |
| 124 | | if (offset == 0) |
| 125 | | { |
| 126 | | timer_call_after_resynch(V30_CLEAR,setvector_callback); |
| 127 | | } |
| 141 | timer_call_after_resynch(V30_CLEAR,setvector_callback); |
| 128 | 142 | } |
| 129 | 143 | |
| 130 | | static WRITE8_HANDLER( m92_sound_status_w ) |
| 144 | static WRITE16_HANDLER( m107_sound_status_w ) |
| 131 | 145 | { |
| 132 | | if (offset == 0) |
| 133 | | { |
| 134 | | // popmessage("sound answer %02x",data); |
| 135 | | sound_status = data; |
| 136 | | } |
| 146 | COMBINE_DATA(&sound_status); |
| 147 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, M107_IRQ_3); |
| 137 | 148 | } |
| 138 | 149 | |
| 139 | 150 | /*****************************************************************************/ |
| 140 | 151 | |
| 141 | | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 142 | | AM_RANGE(0x00000, 0x9ffff) AM_READ(MRA8_ROM) |
| 143 | | AM_RANGE(0xa0000, 0xbffff) AM_READ(MRA8_BANK1) |
| 144 | | AM_RANGE(0xd0000, 0xdffff) AM_READ(m107_vram_r) |
| 145 | | AM_RANGE(0xe0000, 0xeffff) AM_READ(MRA8_RAM) |
| 146 | | AM_RANGE(0xf8000, 0xf8fff) AM_READ(MRA8_RAM) |
| 147 | | AM_RANGE(0xf9000, 0xf9fff) AM_READ(paletteram_r) |
| 148 | | AM_RANGE(0xffff0, 0xfffff) AM_READ(MRA8_ROM) |
| 152 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 153 | AM_RANGE(0x00000, 0x9ffff) AM_ROM |
| 154 | AM_RANGE(0xa0000, 0xbffff) AM_ROMBANK(1) |
| 155 | AM_RANGE(0xd0000, 0xdffff) AM_READWRITE(MRA16_RAM, m107_vram_w) AM_BASE(&m107_vram_data) |
| 156 | AM_RANGE(0xe0000, 0xeffff) AM_RAM /* System ram */ |
| 157 | AM_RANGE(0xf8000, 0xf8fff) AM_RAM AM_BASE(&spriteram16) |
| 158 | AM_RANGE(0xf9000, 0xf9fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) |
| 159 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 149 | 160 | ADDRESS_MAP_END |
| 150 | 161 | |
| 151 | | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 152 | | AM_RANGE(0x00000, 0xbffff) AM_WRITE(MWA8_ROM) |
| 153 | | AM_RANGE(0xd0000, 0xdffff) AM_WRITE(m107_vram_w) AM_BASE(&m107_vram_data) |
| 154 | | AM_RANGE(0xe0000, 0xeffff) AM_WRITE(MWA8_RAM) AM_BASE(&m107_ram) /* System ram */ |
| 155 | | AM_RANGE(0xf8000, 0xf8fff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) |
| 156 | | AM_RANGE(0xf9000, 0xf9fff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_BASE(&paletteram) |
| 157 | | AM_RANGE(0xffff0, 0xfffff) AM_WRITE(MWA8_ROM) |
| 158 | | ADDRESS_MAP_END |
| 159 | | |
| 160 | | static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 ) |
| 161 | | AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r) /* Player 1 */ |
| 162 | | AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r) /* Player 2 */ |
| 163 | | AM_RANGE(0x02, 0x02) AM_READ(m107_port_4_r) /* Coins */ |
| 164 | | AM_RANGE(0x03, 0x03) AM_READ(input_port_7_r) /* Dip 3 */ |
| 165 | | AM_RANGE(0x04, 0x04) AM_READ(input_port_6_r) /* Dip 2 */ |
| 166 | | AM_RANGE(0x05, 0x05) AM_READ(input_port_5_r) /* Dip 1 */ |
| 167 | | AM_RANGE(0x06, 0x06) AM_READ(input_port_2_r) /* Player 3 */ |
| 168 | | AM_RANGE(0x07, 0x07) AM_READ(input_port_3_r) /* Player 4 */ |
| 169 | | AM_RANGE(0x08, 0x09) AM_READ(m92_sound_status_r) /* answer from sound CPU */ |
| 170 | | AM_RANGE(0xc0, 0xc2) AM_READ(MRA8_NOP) /* Only wpksoc: ticket related? */ |
| 171 | | ADDRESS_MAP_END |
| 172 | | |
| 173 | | static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 ) |
| 174 | | AM_RANGE(0x00, 0x01) AM_WRITE(m92_soundlatch_w) |
| 162 | static ADDRESS_MAP_START( main_portmap, ADDRESS_SPACE_IO, 16 ) |
| 163 | AM_RANGE(0x00, 0x01) AM_READ(input_port_0_word_r) /* Player 1+2 */ |
| 164 | AM_RANGE(0x02, 0x03) AM_READ(input_port_1_word_r) /* Coins + DIP 3 */ |
| 165 | AM_RANGE(0x04, 0x05) AM_READ(input_port_2_word_r) /* Dip 2+1 */ |
| 166 | AM_RANGE(0x06, 0x07) AM_READ(input_port_3_word_r) /* Player 3+4 */ |
| 167 | AM_RANGE(0x08, 0x09) AM_READ(m107_sound_status_r) /* answer from sound CPU */ |
| 168 | AM_RANGE(0x00, 0x01) AM_WRITE(m107_soundlatch_w) |
| 175 | 169 | AM_RANGE(0x02, 0x03) AM_WRITE(m107_coincounter_w) |
| 176 | | AM_RANGE(0x04, 0x05) AM_WRITE(MWA8_NOP) /* ??? 0008 */ |
| 170 | AM_RANGE(0x04, 0x05) AM_WRITE(MWA16_NOP) /* ??? 0008 */ |
| 177 | 171 | AM_RANGE(0x06, 0x07) AM_WRITE(bankswitch_w) |
| 178 | 172 | AM_RANGE(0x80, 0x9f) AM_WRITE(m107_control_w) |
| 179 | | AM_RANGE(0xa0, 0xaf) AM_WRITE(MWA8_NOP) /* Written with 0's in interrupt */ |
| 173 | AM_RANGE(0xa0, 0xaf) AM_WRITE(MWA16_NOP) /* Written with 0's in interrupt */ |
| 180 | 174 | AM_RANGE(0xb0, 0xb1) AM_WRITE(m107_spritebuffer_w) |
| 175 | AM_RANGE(0xc0, 0xc3) AM_READ(MRA16_NOP) /* Only wpksoc: ticket related? */ |
| 181 | 176 | ADDRESS_MAP_END |
| 182 | 177 | |
| 183 | 178 | /******************************************************************************/ |
| 184 | 179 | |
| 185 | | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 186 | | AM_RANGE(0x00000, 0x1ffff) AM_READ(MRA8_ROM) |
| 187 | | AM_RANGE(0xa0000, 0xa3fff) AM_READ(MRA8_RAM) |
| 188 | | AM_RANGE(0xa8000, 0xa803f) AM_READ(IremGA20_r) |
| 189 | | AM_RANGE(0xa8042, 0xa8043) AM_READ(YM2151_status_port_0_r) |
| 190 | | AM_RANGE(0xa8044, 0xa8045) AM_READ(m92_soundlatch_r) |
| 191 | | AM_RANGE(0xffff0, 0xfffff) AM_READ(MRA8_ROM) |
| 180 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 181 | AM_RANGE(0x00000, 0x1ffff) AM_ROM |
| 182 | AM_RANGE(0x9ff00, 0x9ffff) AM_WRITE(MWA16_NOP) /* Irq controller? */ |
| 183 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 184 | AM_RANGE(0xa8000, 0xa803f) AM_READWRITE(IremGA20_r, IremGA20_w) |
| 185 | AM_RANGE(0xa8040, 0xa8041) AM_WRITE(YM2151_register_port_0_lsb_w) |
| 186 | AM_RANGE(0xa8042, 0xa8043) AM_READWRITE(YM2151_status_port_0_lsb_r, YM2151_data_port_0_lsb_w) |
| 187 | AM_RANGE(0xa8044, 0xa8045) AM_READWRITE(m107_soundlatch_r, m107_sound_irq_ack_w) |
| 188 | AM_RANGE(0xa8046, 0xa8047) AM_WRITE(m107_sound_status_w) |
| 189 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 192 | 190 | ADDRESS_MAP_END |
| 193 | 191 | |
| 194 | | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 195 | | AM_RANGE(0x00000, 0x1ffff) AM_WRITE(MWA8_ROM) |
| 196 | | AM_RANGE(0x9ff00, 0x9ffff) AM_WRITE(MWA8_NOP) /* Irq controller? */ |
| 197 | | AM_RANGE(0xa0000, 0xa3fff) AM_WRITE(MWA8_RAM) |
| 198 | | AM_RANGE(0xa8000, 0xa803f) AM_WRITE(IremGA20_w) |
| 199 | | AM_RANGE(0xa8040, 0xa8041) AM_WRITE(YM2151_register_port_0_w) |
| 200 | | AM_RANGE(0xa8042, 0xa8043) AM_WRITE(YM2151_data_port_0_w) |
| 201 | | AM_RANGE(0xa8044, 0xa8045) AM_WRITE(m92_sound_irq_ack_w) |
| 202 | | AM_RANGE(0xa8046, 0xa8047) AM_WRITE(m92_sound_status_w) |
| 203 | | AM_RANGE(0xffff0, 0xfffff) AM_WRITE(MWA8_ROM) |
| 204 | | ADDRESS_MAP_END |
| 192 | /******************************************************************************/ |
| 205 | 193 | |
| 194 | static INPUT_PORTS_START( m107_2player ) |
| 195 | PORT_START_TAG("JOY12") |
| 196 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 197 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 198 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 199 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 200 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 201 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 202 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 203 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 204 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 205 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 206 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 207 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 208 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 209 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 210 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 211 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 212 | |
| 213 | PORT_START_TAG("COINS_DIPS") |
| 214 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) |
| 215 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 216 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 217 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 218 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 219 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) |
| 220 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 221 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 222 | |
| 223 | /* DIP switch bank 3 */ |
| 224 | PORT_DIPUNKNOWN( 0x0100, 0x0100 ) |
| 225 | PORT_DIPUNKNOWN( 0x0200, 0x0200 ) |
| 226 | PORT_DIPUNKNOWN( 0x0400, 0x0400 ) |
| 227 | PORT_DIPUNKNOWN( 0x0800, 0x0800 ) |
| 228 | PORT_DIPUNKNOWN( 0x1000, 0x1000 ) |
| 229 | PORT_DIPUNKNOWN( 0x2000, 0x2000 ) |
| 230 | PORT_DIPUNKNOWN( 0x4000, 0x4000 ) |
| 231 | PORT_DIPUNKNOWN( 0x8000, 0x8000 ) |
| 232 | |
| 233 | PORT_START_TAG("DIPS21") |
| 234 | /* Dip switch bank 1 */ |
| 235 | PORT_DIPUNKNOWN( 0x0001, 0x0001 ) |
| 236 | PORT_DIPUNKNOWN( 0x0002, 0x0002 ) |
| 237 | PORT_DIPUNKNOWN( 0x0004, 0x0004 ) |
| 238 | PORT_DIPUNKNOWN( 0x0008, 0x0008 ) |
| 239 | PORT_DIPUNKNOWN( 0x0010, 0x0010 ) |
| 240 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Allow_Continue ) ) |
| 241 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) |
| 242 | PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) ) |
| 243 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 244 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 245 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 246 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) |
| 247 | /* Dip switch bank 2 */ |
| 248 | PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) |
| 249 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 250 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 251 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) |
| 252 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 253 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 254 | PORT_DIPNAME( 0x0400, 0x0400, "Coin Slots" ) |
| 255 | PORT_DIPSETTING( 0x0400, "Common" ) |
| 256 | PORT_DIPSETTING( 0x0000, "Separate" ) |
| 257 | PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) /* Default 1 */ |
| 258 | PORT_DIPSETTING( 0x0800, "1" ) |
| 259 | PORT_DIPSETTING( 0x0000, "2" ) |
| 260 | PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:5,6,7,8") |
| 261 | PORT_DIPSETTING( 0xa000, DEF_STR( 6C_1C ) ) |
| 262 | PORT_DIPSETTING( 0xb000, DEF_STR( 5C_1C ) ) |
| 263 | PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) ) |
| 264 | PORT_DIPSETTING( 0xd000, DEF_STR( 3C_1C ) ) |
| 265 | PORT_DIPSETTING( 0xe000, DEF_STR( 2C_1C ) ) |
| 266 | PORT_DIPSETTING( 0x1000, "2 Coins to Start/1 to Continue") |
| 267 | PORT_DIPSETTING( 0x3000, DEF_STR( 3C_2C ) ) |
| 268 | PORT_DIPSETTING( 0x2000, DEF_STR( 4C_3C ) ) |
| 269 | PORT_DIPSETTING( 0xf000, DEF_STR( 1C_1C ) ) |
| 270 | PORT_DIPSETTING( 0x4000, DEF_STR( 2C_3C ) ) |
| 271 | PORT_DIPSETTING( 0x9000, DEF_STR( 1C_2C ) ) |
| 272 | PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) |
| 273 | PORT_DIPSETTING( 0x7000, DEF_STR( 1C_4C ) ) |
| 274 | PORT_DIPSETTING( 0x6000, DEF_STR( 1C_5C ) ) |
| 275 | PORT_DIPSETTING( 0x5000, DEF_STR( 1C_6C ) ) |
| 276 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) |
| 277 | |
| 278 | PORT_START_TAG("JOY34") |
| 279 | PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 280 | INPUT_PORTS_END |
| 281 | |
| 282 | |
| 283 | static INPUT_PORTS_START( m107_3player ) |
| 284 | PORT_INCLUDE(m107_2player) |
| 285 | |
| 286 | PORT_MODIFY("DIPS21") |
| 287 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Cabinet ) ) |
| 288 | PORT_DIPSETTING( 0x0200, "2 Players" ) |
| 289 | PORT_DIPSETTING( 0x0000, "3 Players" ) |
| 290 | |
| 291 | PORT_MODIFY("JOY34") |
| 292 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) |
| 293 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) |
| 294 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) |
| 295 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) |
| 296 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START3 ) /* If common slots, Coin3 if separate */ |
| 297 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN3 ) |
| 298 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) |
| 299 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) |
| 300 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 301 | INPUT_PORTS_END |
| 302 | |
| 303 | |
| 304 | static INPUT_PORTS_START( m107_4player ) |
| 305 | PORT_INCLUDE(m107_3player) |
| 306 | |
| 307 | PORT_MODIFY("DIPS21") |
| 308 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Cabinet ) ) |
| 309 | PORT_DIPSETTING( 0x0200, "2 Players" ) |
| 310 | PORT_DIPSETTING( 0x0000, "4 Players" ) |
| 311 | |
| 312 | PORT_MODIFY("JOY34") |
| 313 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) |
| 314 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) |
| 315 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) |
| 316 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) |
| 317 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_START4 ) /* If common slots, Coin3 if separate */ |
| 318 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN4 ) |
| 319 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) |
| 320 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) |
| 321 | INPUT_PORTS_END |
| 322 | |
| 206 | 323 | /******************************************************************************/ |
| 207 | 324 | |
| 208 | 325 | INPUT_PORTS_START( firebarr ) |
| 209 | | IREM_JOYSTICK_1_2(1) |
| 210 | | IREM_JOYSTICK_1_2(2) |
| 211 | | IREM_PORT_UNUSED |
| 212 | | IREM_PORT_UNUSED |
| 213 | | IREM_COINS |
| 214 | | IREM_SYSTEM_DIPSWITCH |
| 326 | PORT_INCLUDE(m107_2player) |
| 215 | 327 | |
| 216 | | PORT_START |
| 217 | | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| 218 | | PORT_DIPSETTING( 0x00, "2" ) |
| 219 | | PORT_DIPSETTING( 0x03, "3" ) |
| 220 | | PORT_DIPSETTING( 0x02, "4" ) |
| 221 | | PORT_DIPSETTING( 0x01, "5" ) |
| 222 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 223 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 224 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 225 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 226 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 227 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 228 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 229 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 230 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 231 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 232 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 233 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 234 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 235 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 236 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 237 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 328 | PORT_MODIFY("COINS_DIPS") |
| 329 | PORT_DIPNAME( 0x1000, 0x0000, "Continuous Play" ) |
| 330 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) |
| 331 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 238 | 332 | |
| 239 | | PORT_START |
| 240 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 241 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 242 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 243 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 244 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 245 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 246 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 247 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 248 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 249 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 250 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 251 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 252 | | PORT_DIPNAME( 0x10, 0x00, "Continuous Play" ) |
| 253 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 254 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 255 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 256 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 257 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 258 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 259 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 260 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 261 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 262 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 263 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 333 | PORT_MODIFY("DIPS21") |
| 334 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) |
| 335 | PORT_DIPSETTING( 0x0000, "2" ) |
| 336 | PORT_DIPSETTING( 0x0003, "3" ) |
| 337 | PORT_DIPSETTING( 0x0002, "4" ) |
| 338 | PORT_DIPSETTING( 0x0001, "5" ) |
| 264 | 339 | INPUT_PORTS_END |
| 265 | 340 | |
| 341 | |
| 266 | 342 | INPUT_PORTS_START( dsoccr94 ) |
| 267 | | IREM_JOYSTICK_1_2(1) |
| 268 | | IREM_JOYSTICK_1_2(2) |
| 269 | | IREM_JOYSTICK_3_4(3) |
| 270 | | IREM_JOYSTICK_3_4(4) |
| 271 | | IREM_COINS |
| 272 | | IREM_SYSTEM_DIPSWITCH /* Dip Switch 2, dip 2 is listed as "Don't Change" and is "OFF" */ |
| 343 | PORT_INCLUDE(m107_4player) |
| 273 | 344 | |
| 274 | | PORT_START /* Dip switch bank 1 */ |
| 275 | | PORT_DIPNAME( 0x03, 0x03, "Time" ) |
| 276 | | PORT_DIPSETTING( 0x00, "1:30" ) |
| 277 | | PORT_DIPSETTING( 0x03, "2:00" ) |
| 278 | | PORT_DIPSETTING( 0x02, "2:30" ) |
| 279 | | PORT_DIPSETTING( 0x01, "3:00" ) |
| 280 | | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) |
| 281 | | PORT_DIPSETTING( 0x00, DEF_STR( Very_Easy) ) |
| 282 | | PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) |
| 283 | | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) |
| 284 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 285 | | PORT_DIPNAME( 0x10, 0x10, "Game Mode" ) |
| 286 | | PORT_DIPSETTING( 0x10, "Match Mode" ) |
| 287 | | PORT_DIPSETTING( 0x00, "Power Mode" ) |
| 345 | PORT_MODIFY("COINS_DIPS") |
| 346 | PORT_DIPNAME( 0x0300, 0x0300, "Player Power" ) |
| 347 | PORT_DIPSETTING( 0x0000, "500" ) |
| 348 | PORT_DIPSETTING( 0x0300, "1000" ) |
| 349 | PORT_DIPSETTING( 0x0100, "1500" ) |
| 350 | PORT_DIPSETTING( 0x0200, "2000" ) |
| 351 | |
| 352 | PORT_MODIFY("DIPS21") |
| 353 | /* Dip switch bank 1 */ |
| 354 | PORT_DIPNAME( 0x0003, 0x0003, "Time" ) |
| 355 | PORT_DIPSETTING( 0x0000, "1:30" ) |
| 356 | PORT_DIPSETTING( 0x0003, "2:00" ) |
| 357 | PORT_DIPSETTING( 0x0002, "2:30" ) |
| 358 | PORT_DIPSETTING( 0x0001, "3:00" ) |
| 359 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) |
| 360 | PORT_DIPSETTING( 0x0000, DEF_STR( Very_Easy ) ) |
| 361 | PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) |
| 362 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) |
| 363 | PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) |
| 364 | PORT_DIPNAME( 0x0010, 0x0010, "Game Mode" ) |
| 365 | PORT_DIPSETTING( 0x0010, "Match Mode" ) |
| 366 | PORT_DIPSETTING( 0x0000, "Power Mode" ) |
| 288 | 367 | /* |
| 289 | 368 | Match Mode: Winner advances to the next game. Game Over for the loser |
| 290 | 369 | Power Mode: The Players can play the game until their respective powers run |
| r869 | r870 | |
| 292 | 371 | Player 2 can join in any time during the game |
| 293 | 372 | Player power (time) can be adjusted by dip switch #3 |
| 294 | 373 | */ |
| 295 | | PORT_DIPNAME( 0x20, 0x20, "Starting Button" ) |
| 296 | | PORT_DIPSETTING( 0x00, "Button 1" ) |
| 297 | | PORT_DIPSETTING( 0x20, "Start Button" ) |
| 298 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) |
| 299 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 300 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 301 | | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 374 | PORT_DIPNAME( 0x0020, 0x0020, "Starting Button" ) |
| 375 | PORT_DIPSETTING( 0x0000, "Button 1" ) |
| 376 | PORT_DIPSETTING( 0x0020, "Start Button" ) |
| 377 | PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) ) |
| 378 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 379 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 380 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) |
| 302 | 381 | |
| 303 | 382 | PORT_START /* Dip switch bank 3 */ |
| 304 | | PORT_DIPNAME( 0x03, 0x03, "Player Power" ) |
| 305 | | PORT_DIPSETTING( 0x00, "500" ) |
| 306 | | PORT_DIPSETTING( 0x03, "1000" ) |
| 307 | | PORT_DIPSETTING( 0x01, "1500" ) |
| 308 | | PORT_DIPSETTING( 0x02, "2000" ) |
| 309 | 383 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 310 | 384 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 311 | 385 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| r869 | r870 | |
| 327 | 401 | INPUT_PORTS_END |
| 328 | 402 | |
| 329 | 403 | INPUT_PORTS_START( wpksoc ) |
| 330 | | IREM_JOYSTICK_1_2(1) |
| 331 | | IREM_JOYSTICK_1_2(2) |
| 332 | | PORT_START /* not used */ |
| 333 | | PORT_START /* not used*/ |
| 334 | | IREM_COINS |
| 335 | | IREM_SYSTEM_DIPSWITCH_4PLAYERS |
| 336 | | |
| 337 | | PORT_START |
| 338 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 339 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 340 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 341 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 342 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 343 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 344 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 345 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 346 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 347 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 348 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 349 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 350 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 351 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 352 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 353 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 354 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 355 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 356 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 357 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 358 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 359 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 360 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 361 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 362 | | |
| 363 | | PORT_START |
| 364 | | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 365 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 366 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 367 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 368 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 369 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 370 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 371 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 372 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 373 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 374 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 375 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 376 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 377 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 378 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 379 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 380 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 381 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 382 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 383 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 384 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 385 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 386 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 387 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 404 | PORT_INCLUDE(m107_2player) |
| 388 | 405 | INPUT_PORTS_END |
| 389 | 406 | |
| 390 | 407 | /***************************************************************************/ |
| r869 | r870 | |
| 461 | 478 | |
| 462 | 479 | /***************************************************************************/ |
| 463 | 480 | |
| 464 | | static INTERRUPT_GEN( m107_interrupt ) |
| 465 | | { |
| 466 | | m107_vblank=0; |
| 467 | | video_screen_update_partial(0, 248+128); |
| 468 | | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_0); /* VBL */ |
| 469 | | } |
| 470 | | |
| 471 | | static INTERRUPT_GEN( m107_raster_interrupt ) |
| 472 | | { |
| 473 | | int line = 256 - cpu_getiloops(); |
| 474 | | |
| 475 | | if (input_code_pressed_once(KEYCODE_F1)) { |
| 476 | | raster_enable ^= 1; |
| 477 | | if (raster_enable) |
| 478 | | popmessage("Raster IRQ enabled"); |
| 479 | | else |
| 480 | | popmessage("Raster IRQ disabled"); |
| 481 | | } |
| 482 | | |
| 483 | | /* Raster interrupt */ |
| 484 | | if (raster_enable && line==m107_raster_irq_position) { |
| 485 | | video_screen_update_partial(0, line); |
| 486 | | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_2); |
| 487 | | } |
| 488 | | |
| 489 | | /* Kludge to get Fire Barrel running */ |
| 490 | | else if (line==118) |
| 491 | | { |
| 492 | | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_3); |
| 493 | | } |
| 494 | | |
| 495 | | /* Redraw screen, then set vblank and trigger the VBL interrupt */ |
| 496 | | else if (line==248) { |
| 497 | | video_screen_update_partial(0, 248); |
| 498 | | m107_vblank=1; |
| 499 | | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_0); |
| 500 | | } |
| 501 | | |
| 502 | | /* End of vblank */ |
| 503 | | else if (line==255) |
| 504 | | m107_vblank=0; |
| 505 | | } |
| 506 | | |
| 507 | 481 | static MACHINE_DRIVER_START( firebarr ) |
| 508 | 482 | |
| 509 | 483 | /* basic machine hardware */ |
| 510 | | MDRV_CPU_ADD(V33, 28000000/2) /* NEC V33, 28MHz clock */ |
| 511 | | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 512 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 513 | | MDRV_CPU_VBLANK_INT(m107_raster_interrupt,256) /* 8 prelines, 240 visible lines, 8 for vblank? */ |
| 484 | MDRV_CPU_ADD_TAG("main", V33, 28000000/2) /* NEC V33, 28MHz clock */ |
| 485 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 486 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 514 | 487 | |
| 515 | 488 | MDRV_CPU_ADD(V30, 14318000/2) |
| 516 | 489 | /* audio CPU */ /* 14.318 MHz */ |
| 517 | | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 490 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 518 | 491 | |
| 492 | MDRV_MACHINE_START(m107) |
| 493 | MDRV_MACHINE_RESET(m107) |
| 519 | 494 | MDRV_SCREEN_REFRESH_RATE(60) |
| 520 | 495 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) |
| 521 | 496 | |
| 522 | 497 | /* video hardware */ |
| 523 | 498 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 524 | 499 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 525 | | MDRV_SCREEN_SIZE(512, 512) |
| 526 | | MDRV_SCREEN_VISIBLE_AREA(80, 511-112, 128+8, 511-128-8) /* 320 x 240 */ |
| 500 | MDRV_SCREEN_SIZE(512, 256) |
| 501 | MDRV_SCREEN_VISIBLE_AREA(80, 511-112, 8, 247) /* 320 x 240 */ |
| 527 | 502 | MDRV_GFXDECODE(firebarr_gfxdecodeinfo) |
| 528 | 503 | MDRV_PALETTE_LENGTH(2048) |
| 529 | 504 | |
| r869 | r870 | |
| 546 | 521 | |
| 547 | 522 | |
| 548 | 523 | static MACHINE_DRIVER_START( dsoccr94 ) |
| 524 | MDRV_IMPORT_FROM(firebarr) |
| 549 | 525 | |
| 550 | 526 | /* basic machine hardware */ |
| 551 | | MDRV_CPU_ADD(V33, 20000000/2) /* NEC V33, Could be 28MHz clock? */ |
| 552 | | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 553 | | MDRV_CPU_IO_MAP(readport,writeport) |
| 554 | | MDRV_CPU_VBLANK_INT(m107_interrupt,1) |
| 527 | MDRV_CPU_REPLACE("main", V33, 20000000/2) /* NEC V33, Could be 28MHz clock? */ |
| 555 | 528 | |
| 556 | | MDRV_CPU_ADD(V30, 14318000/2) |
| 557 | | /* audio CPU */ /* 14.318 MHz */ |
| 558 | | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 559 | | |
| 560 | | MDRV_SCREEN_REFRESH_RATE(60) |
| 561 | | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) |
| 562 | | |
| 563 | 529 | /* video hardware */ |
| 564 | | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 565 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 566 | | MDRV_SCREEN_SIZE(512, 512) |
| 567 | | MDRV_SCREEN_VISIBLE_AREA(80, 511-112, 128+8, 511-128-8) /* 320 x 240 */ |
| 568 | 530 | MDRV_GFXDECODE(gfxdecodeinfo) |
| 569 | | MDRV_PALETTE_LENGTH(2048) |
| 570 | | |
| 571 | | MDRV_VIDEO_START(m107) |
| 572 | | MDRV_VIDEO_UPDATE(m107) |
| 573 | | |
| 574 | | /* sound hardware */ |
| 575 | | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 576 | | |
| 577 | | MDRV_SOUND_ADD(YM2151, 14318180/4) |
| 578 | | MDRV_SOUND_CONFIG(ym2151_interface) |
| 579 | | MDRV_SOUND_ROUTE(0, "left", 0.40) |
| 580 | | MDRV_SOUND_ROUTE(1, "right", 0.40) |
| 581 | | |
| 582 | | MDRV_SOUND_ADD(IREMGA20, 14318180/4) |
| 583 | | MDRV_SOUND_CONFIG(iremGA20_interface) |
| 584 | | MDRV_SOUND_ROUTE(0, "left", 1.0) |
| 585 | | MDRV_SOUND_ROUTE(1, "right", 1.0) |
| 586 | 531 | MACHINE_DRIVER_END |
| 587 | 532 | |
| 588 | 533 | /***************************************************************************/ |
| r869 | r870 | |
| 694 | 639 | |
| 695 | 640 | m107_irq_vectorbase=0x20; |
| 696 | 641 | m107_spritesystem = 1; |
| 697 | | |
| 698 | | raster_enable=1; |
| 699 | 642 | } |
| 700 | 643 | |
| 701 | 644 | static DRIVER_INIT( dsoccr94 ) |
| r869 | r870 | |
| 712 | 655 | |
| 713 | 656 | m107_irq_vectorbase=0x80; |
| 714 | 657 | m107_spritesystem = 0; |
| 715 | | |
| 716 | | /* This game doesn't use raster IRQ's */ |
| 717 | | raster_enable=0; |
| 718 | 658 | } |
| 719 | 659 | |
| 720 | 660 | static DRIVER_INIT( wpksoc ) |
| r869 | r870 | |
| 731 | 671 | |
| 732 | 672 | m107_irq_vectorbase=0x80; |
| 733 | 673 | m107_spritesystem = 0; |
| 734 | | |
| 735 | | raster_enable=0; |
| 736 | 674 | } |
| 737 | 675 | |
| 738 | 676 | /***************************************************************************/ |
src/emu/cpu/nec/nec.c
| r869 | r870 | |
| 2 | 2 | |
| 3 | 3 | NEC V20/V30/V33 emulator |
| 4 | 4 | |
| 5 | --------------------------------------------- |
| 6 | |
| 7 | V20 = uPD70108 = 8-bit data bus @ 5MHz or 8MHz |
| 8 | V20HL = uPD70108H = V20 with EMS support (24-bit address bus) |
| 9 | |
| 10 | V25 = uPD70320 = V20 with on-chip features: |
| 11 | - 256 bytes on-chip RAM |
| 12 | - 8 register banks |
| 13 | - 4-bit input port |
| 14 | - 20-bit I/O port |
| 15 | - 2 channel serial interface |
| 16 | - interrupt controller |
| 17 | - 2 channel DMA controller |
| 18 | - 2 channel 16-bit timer |
| 19 | - new instructions: BTCLR, RETRBI, STOP, BRKCS, TSKSW, |
| 20 | MOVSPA, MOVSPB |
| 21 | |
| 22 | V25+ = uPD70325 = V25 @ 8MHz or 10MHz plus changes: |
| 23 | - faster DMA |
| 24 | - improved serial interface |
| 25 | |
| 26 | --------------------------------------------- |
| 27 | |
| 28 | V30 = uPD70116 = 16-bit data bus version of V20 |
| 29 | V30HL = uPD70116H = 16-bit data bus version of V20HL |
| 30 | V30MX = V30HL with separate address and data busses |
| 31 | |
| 32 | V35 = uPD70330 = 16-bit data bus version of V25 |
| 33 | |
| 34 | V35+ = uPD70335 = 16-bit data bus version of V25+ |
| 35 | |
| 36 | --------------------------------------------- |
| 37 | |
| 38 | V40 = uPD70208 = 8-bit data bus @ 10MHz |
| 39 | V40HL = uPD70208H = V40 with support up to 20Mhz |
| 40 | |
| 41 | --------------------------------------------- |
| 42 | |
| 43 | V50 = uPD70216 = 16-bit data bus version of V40 |
| 44 | V50HL = uPD70216H = 16-bit data bus version of V40HL |
| 45 | |
| 46 | --------------------------------------------- |
| 47 | |
| 48 | V41 = uPD70270 |
| 49 | |
| 50 | V51 = uPD70280 |
| 51 | |
| 52 | |
| 53 | |
| 54 | V33A = uPD70136A |
| 55 | |
| 56 | V53A = uPD70236A |
| 57 | |
| 58 | |
| 59 | |
| 60 | Instruction differences: |
| 61 | V20, V30, V40, V50 have dedicated emulation instructions |
| 62 | (BRKEM, RETEM, CALLN) |
| 63 | |
| 64 | V33A, V53A has dedicated address mode instructions |
| 65 | (BRKXA, RETXA) |
| 66 | |
| 67 | |
| 68 | |
| 5 | 69 | (Re)Written June-September 2000 by Bryan McPhail (mish@tendril.co.uk) based |
| 6 | 70 | on code by Oliver Bergmann (Raul_Bloodworth@hotmail.com) who based code |
| 7 | 71 | on the i286 emulator by Fabrice Frances which had initial work based on |
| r869 | r870 | |
| 36 | 100 | |
| 37 | 101 | Todo! |
| 38 | 102 | Double check cycle timing is 100%. |
| 39 | | Fix memory interface (should be 16 bit). |
| 40 | 103 | |
| 41 | 104 | ****************************************************************************/ |
| 42 | 105 | |
| r869 | r870 | |
| 61 | 124 | |
| 62 | 125 | typedef struct |
| 63 | 126 | { |
| 127 | offs_t fetch_xor; |
| 128 | |
| 129 | UINT8 (*rbyte)(offs_t); |
| 130 | UINT16 (*rword)(offs_t); |
| 131 | void (*wbyte)(offs_t, UINT8); |
| 132 | void (*wword)(offs_t, UINT16); |
| 133 | |
| 134 | UINT8 (*rbyte_port)(offs_t); |
| 135 | UINT16 (*rword_port)(offs_t); |
| 136 | void (*wbyte_port)(offs_t, UINT8); |
| 137 | void (*wword_port)(offs_t, UINT16); |
| 138 | } memory_interface; |
| 139 | |
| 140 | typedef struct |
| 141 | { |
| 64 | 142 | necbasicregs regs; |
| 65 | 143 | UINT16 sregs[4]; |
| 66 | 144 | |
| r869 | r870 | |
| 76 | 154 | UINT8 no_interrupt; |
| 77 | 155 | |
| 78 | 156 | int (*irq_callback)(int irqline); |
| 157 | |
| 158 | memory_interface mem; |
| 79 | 159 | } nec_Regs; |
| 80 | 160 | |
| 81 | 161 | /***************************************************************************/ |
| r869 | r870 | |
| 110 | 190 | unsigned int i,j,c; |
| 111 | 191 | static const BREGS reg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH }; |
| 112 | 192 | int (*save_irqcallback)(int); |
| 193 | memory_interface save_mem; |
| 113 | 194 | |
| 114 | 195 | save_irqcallback = I.irq_callback; |
| 196 | save_mem = I.mem; |
| 115 | 197 | memset( &I, 0, sizeof(I) ); |
| 116 | 198 | I.irq_callback = save_irqcallback; |
| 199 | I.mem = save_mem; |
| 117 | 200 | |
| 118 | | I.sregs[CS] = 0xffff; |
| 201 | I.sregs[PS] = 0xffff; |
| 119 | 202 | |
| 120 | 203 | CHANGE_PC; |
| 121 | 204 | |
| r869 | r870 | |
| 163 | 246 | I.pending_irq &= ~INT_IRQ; |
| 164 | 247 | } |
| 165 | 248 | |
| 166 | | dest_off = ReadWord(int_num*4); |
| 167 | | dest_seg = ReadWord(int_num*4+2); |
| 249 | dest_off = read_word(int_num*4); |
| 250 | dest_seg = read_word(int_num*4+2); |
| 168 | 251 | |
| 169 | | PUSH(I.sregs[CS]); |
| 252 | PUSH(I.sregs[PS]); |
| 170 | 253 | PUSH(I.ip); |
| 171 | 254 | I.ip = (WORD)dest_off; |
| 172 | | I.sregs[CS] = (WORD)dest_seg; |
| 255 | I.sregs[PS] = (WORD)dest_seg; |
| 173 | 256 | CHANGE_PC; |
| 174 | 257 | } |
| 175 | 258 | |
| r869 | r870 | |
| 206 | 289 | OP( 0x03, i_add_r16w ) { DEF_r16w; ADDW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } |
| 207 | 290 | OP( 0x04, i_add_ald8 ) { DEF_ald8; ADDB; I.regs.b[AL]=dst; CLKS(4,4,2); } |
| 208 | 291 | OP( 0x05, i_add_axd16) { DEF_axd16; ADDW; I.regs.w[AW]=dst; CLKS(4,4,2); } |
| 209 | | OP( 0x06, i_push_es ) { PUSH(I.sregs[ES]); CLKS(12,8,3); } |
| 210 | | OP( 0x07, i_pop_es ) { POP(I.sregs[ES]); CLKS(12,8,5); } |
| 292 | OP( 0x06, i_push_es ) { PUSH(I.sregs[DS1]); CLKS(12,8,3); } |
| 293 | OP( 0x07, i_pop_es ) { POP(I.sregs[DS1]); CLKS(12,8,5); } |
| 211 | 294 | |
| 212 | 295 | OP( 0x08, i_or_br8 ) { DEF_br8; ORB; PutbackRMByte(ModRM,dst); CLKM(2,2,2,16,13,7); } |
| 213 | 296 | OP( 0x09, i_or_wr16 ) { DEF_wr16; ORW; PutbackRMWord(ModRM,dst); CLKR(24,24,11,24,16,7,2,EA);} |
| r869 | r870 | |
| 215 | 298 | OP( 0x0b, i_or_r16w ) { DEF_r16w; ORW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } |
| 216 | 299 | OP( 0x0c, i_or_ald8 ) { DEF_ald8; ORB; I.regs.b[AL]=dst; CLKS(4,4,2); } |
| 217 | 300 | OP( 0x0d, i_or_axd16 ) { DEF_axd16; ORW; I.regs.w[AW]=dst; CLKS(4,4,2); } |
| 218 | | OP( 0x0e, i_push_cs ) { PUSH(I.sregs[CS]); CLKS(12,8,5); } |
| 301 | OP( 0x0e, i_push_cs ) { PUSH(I.sregs[PS]); CLKS(12,8,5); } |
| 219 | 302 | OP( 0x0f, i_pre_nec ) { UINT32 ModRM, tmp, tmp2; |
| 220 | 303 | switch (FETCH) { |
| 221 | 304 | case 0x10 : BITOP_BYTE; CLKS(3,3,4); tmp2 = I.regs.b[CL] & 0x7; I.ZeroVal = (tmp & (1<<tmp2)) ? 1 : 0; I.CarryVal=I.OverVal=0; break; /* Test */ |
| r869 | r870 | |
| 266 | 349 | OP( 0x1b, i_sbb_r16w ) { DEF_r16w; src+=CF; SUBW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } |
| 267 | 350 | OP( 0x1c, i_sbb_ald8 ) { DEF_ald8; src+=CF; SUBB; I.regs.b[AL]=dst; CLKS(4,4,2); } |
| 268 | 351 | OP( 0x1d, i_sbb_axd16) { DEF_axd16; src+=CF; SUBW; I.regs.w[AW]=dst; CLKS(4,4,2); } |
| 269 | | OP( 0x1e, i_push_ds ) { PUSH(I.sregs[DS]); CLKS(12,8,3); } |
| 270 | | OP( 0x1f, i_pop_ds ) { POP(I.sregs[DS]); CLKS(12,8,5); } |
| 352 | OP( 0x1e, i_push_ds ) { PUSH(I.sregs[DS0]); CLKS(12,8,3); } |
| 353 | OP( 0x1f, i_pop_ds ) { POP(I.sregs[DS0]); CLKS(12,8,5); } |
| 271 | 354 | |
| 272 | 355 | OP( 0x20, i_and_br8 ) { DEF_br8; ANDB; PutbackRMByte(ModRM,dst); CLKM(2,2,2,16,13,7); } |
| 273 | 356 | OP( 0x21, i_and_wr16 ) { DEF_wr16; ANDW; PutbackRMWord(ModRM,dst); CLKR(24,24,11,24,16,7,2,EA);} |
| r869 | r870 | |
| 275 | 358 | OP( 0x23, i_and_r16w ) { DEF_r16w; ANDW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } |
| 276 | 359 | OP( 0x24, i_and_ald8 ) { DEF_ald8; ANDB; I.regs.b[AL]=dst; CLKS(4,4,2); } |
| 277 | 360 | OP( 0x25, i_and_axd16) { DEF_axd16; ANDW; I.regs.w[AW]=dst; CLKS(4,4,2); } |
| 278 | | OP( 0x26, i_es ) { seg_prefix=TRUE; prefix_base=I.sregs[ES]<<4; CLK(2); nec_instruction[FETCHOP](); seg_prefix=FALSE; } |
| 361 | OP( 0x26, i_es ) { seg_prefix=TRUE; prefix_base=I.sregs[DS1]<<4; CLK(2); nec_instruction[FETCHOP](); seg_prefix=FALSE; } |
| 279 | 362 | OP( 0x27, i_daa ) { ADJ4(6,0x60); CLKS(3,3,2); } |
| 280 | 363 | |
| 281 | 364 | OP( 0x28, i_sub_br8 ) { DEF_br8; SUBB; PutbackRMByte(ModRM,dst); CLKM(2,2,2,16,13,7); } |
| r869 | r870 | |
| 284 | 367 | OP( 0x2b, i_sub_r16w ) { DEF_r16w; SUBW; RegWord(ModRM)=dst; CLKR(15,15,8,15,11,6,2,EA); } |
| 285 | 368 | OP( 0x2c, i_sub_ald8 ) { DEF_ald8; SUBB; I.regs.b[AL]=dst; CLKS(4,4,2); } |
| 286 | 369 | OP( 0x2d, i_sub_axd16) { DEF_axd16; SUBW; I.regs.w[AW]=dst; CLKS(4,4,2); } |
| 287 | | OP( 0x2e, i_cs ) { seg_prefix=TRUE; prefix_base=I.sregs[CS]<<4; CLK(2); nec_instruction[FETCHOP](); seg_prefix=FALSE; } |
| 370 | OP( 0x2e, i_cs ) { seg_prefix=TRUE; prefix_base=I.sregs[PS]<<4; CLK(2); nec_instruction[FETCHOP](); seg_prefix=FALSE; } |
| 288 | 371 | OP( 0x2f, i_das ) { ADJ4(-6,-0x60); CLKS(3,3,2); } |
| 289 | 372 | |
| 290 | 373 | OP( 0x30, i_xor_br8 ) { DEF_br8; XORB; PutbackRMByte(ModRM,dst); CLKM(2,2,2,16,13,7); } |
| r869 | r870 | |
| 302 | 385 | OP( 0x3b, i_cmp_r16w ) { DEF_r16w; SUBW; CLKR(15,15,8,15,11,6,2,EA); } |
| 303 | 386 | OP( 0x3c, i_cmp_ald8 ) { DEF_ald8; SUBB; CLKS(4,4,2); } |
| 304 | 387 | OP( 0x3d, i_cmp_axd16) { DEF_axd16; SUBW; CLKS(4,4,2); } |
| 305 | | OP( 0x3e, i_ds ) { seg_prefix=TRUE; prefix_base=I.sregs[DS]<<4; CLK(2); nec_instruction[FETCHOP](); seg_prefix=FALSE; } |
| 388 | OP( 0x3e, i_ds ) { seg_prefix=TRUE; prefix_base=I.sregs[DS0]<<4; CLK(2); nec_instruction[FETCHOP](); seg_prefix=FALSE; } |
| 306 | 389 | OP( 0x3f, i_aas ) { ADJB(-6, (I.regs.b[AL] < 6) ? -2 : -1); CLKS(7,7,4); } |
| 307 | 390 | |
| 308 | 391 | OP( 0x40, i_inc_ax ) { IncWordReg(AW); CLK(2); } |
| r869 | r870 | |
| 379 | 462 | } |
| 380 | 463 | OP( 0x64, i_repnc ) { UINT32 next = FETCHOP; UINT16 c = I.regs.w[CW]; |
| 381 | 464 | switch(next) { /* Segments */ |
| 382 | | case 0x26: seg_prefix=TRUE; prefix_base=I.sregs[ES]<<4; next = FETCHOP; CLK(2); break; |
| 383 | | case 0x2e: seg_prefix=TRUE; prefix_base=I.sregs[CS]<<4; next = FETCHOP; CLK(2); break; |
| 465 | case 0x26: seg_prefix=TRUE; prefix_base=I.sregs[DS1]<<4; next = FETCHOP; CLK(2); break; |
| 466 | case 0x2e: seg_prefix=TRUE; prefix_base=I.sregs[PS]<<4; next = FETCHOP; CLK(2); break; |
| 384 | 467 | case 0x36: seg_prefix=TRUE; prefix_base=I.sregs[SS]<<4; next = FETCHOP; CLK(2); break; |
| 385 | | case 0x3e: seg_prefix=TRUE; prefix_base=I.sregs[DS]<<4; next = FETCHOP; CLK(2); break; |
| 468 | case 0x3e: seg_prefix=TRUE; prefix_base=I.sregs[DS0]<<4; next = FETCHOP; CLK(2); break; |
| 386 | 469 | } |
| 387 | 470 | |
| 388 | 471 | switch(next) { |
| r869 | r870 | |
| 407 | 490 | |
| 408 | 491 | OP( 0x65, i_repc ) { UINT32 next = FETCHOP; UINT16 c = I.regs.w[CW]; |
| 409 | 492 | switch(next) { /* Segments */ |
| 410 | | case 0x26: seg_prefix=TRUE; prefix_base=I.sregs[ES]<<4; next = FETCHOP; CLK(2); break; |
| 411 | | case 0x2e: seg_prefix=TRUE; prefix_base=I.sregs[CS]<<4; next = FETCHOP; CLK(2); break; |
| 493 | case 0x26: seg_prefix=TRUE; prefix_base=I.sregs[DS1]<<4; next = FETCHOP; CLK(2); break; |
| 494 | case 0x2e: seg_prefix=TRUE; prefix_base=I.sregs[PS]<<4; next = FETCHOP; CLK(2); break; |
| 412 | 495 | case 0x36: seg_prefix=TRUE; prefix_base=I.sregs[SS]<<4; next = FETCHOP; CLK(2); break; |
| 413 | | case 0x3e: seg_prefix=TRUE; prefix_base=I.sregs[DS]<<4; next = FETCHOP; CLK(2); break; |
| 496 | case 0x3e: seg_prefix=TRUE; prefix_base=I.sregs[DS0]<<4; next = FETCHOP; CLK(2); break; |
| 414 | 497 | } |
| 415 | 498 | |
| 416 | 499 | switch(next) { |
| r869 | r870 | |
| 437 | 520 | OP( 0x69, i_imul_d16 ) { UINT32 tmp; DEF_r16w; FETCHWORD(tmp); dst = (INT32)((INT16)src)*(INT32)((INT16)tmp); I.CarryVal = I.OverVal = (((INT32)dst) >> 15 != 0) && (((INT32)dst) >> 15 != -1); RegWord(ModRM)=(WORD)dst; nec_ICount-=(ModRM >=0xc0 )?38:47;} |
| 438 | 521 | OP( 0x6a, i_push_d8 ) { UINT32 tmp = (WORD)((INT16)((INT8)FETCH)); PUSH(tmp); CLKW(11,11,5,11,7,3,I.regs.w[SP]); } |
| 439 | 522 | OP( 0x6b, i_imul_d8 ) { UINT32 src2; DEF_r16w; src2= (WORD)((INT16)((INT8)FETCH)); dst = (INT32)((INT16)src)*(INT32)((INT16)src2); I.CarryVal = I.OverVal = (((INT32)dst) >> 15 != 0) && (((INT32)dst) >> 15 != -1); RegWord(ModRM)=(WORD)dst; nec_ICount-=(ModRM >=0xc0 )?31:39; } |
| 440 | | OP( 0x6c, i_insb ) { PutMemB(ES,I.regs.w[IY],read_port(I.regs.w[DW])); I.regs.w[IY]+= -2 * I.DF + 1; CLK(8); } |
| 441 | | OP( 0x6d, i_insw ) { PutMemB(ES,I.regs.w[IY],read_port(I.regs.w[DW])); PutMemB(ES,(I.regs.w[IY]+1)&0xffff,read_port((I.regs.w[DW]+1)&0xffff)); I.regs.w[IY]+= -4 * I.DF + 2; CLKS(18,10,8); } |
| 442 | | OP( 0x6e, i_outsb ) { write_port(I.regs.w[DW],GetMemB(DS,I.regs.w[IX])); I.regs.w[IX]+= -2 * I.DF + 1; CLK(8); } |
| 443 | | OP( 0x6f, i_outsw ) { write_port(I.regs.w[DW],GetMemB(DS,I.regs.w[IX])); write_port((I.regs.w[DW]+1)&0xffff,GetMemB(DS,(I.regs.w[IX]+1)&0xffff)); I.regs.w[IX]+= -4 * I.DF + 2; CLKS(18,10,8); } |
| 523 | OP( 0x6c, i_insb ) { PutMemB(DS1,I.regs.w[IY],read_port_byte(I.regs.w[DW])); I.regs.w[IY]+= -2 * I.DF + 1; CLK(8); } |
| 524 | OP( 0x6d, i_insw ) { PutMemW(DS1,I.regs.w[IY],read_port_word(I.regs.w[DW])); I.regs.w[IY]+= -4 * I.DF + 2; CLKS(18,10,8); } |
| 525 | OP( 0x6e, i_outsb ) { write_port_byte(I.regs.w[DW],GetMemB(DS0,I.regs.w[IX])); I.regs.w[IX]+= -2 * I.DF + 1; CLK(8); } |
| 526 | OP( 0x6f, i_outsw ) { write_port_word(I.regs.w[DW],GetMemW(DS0,I.regs.w[IX])); I.regs.w[IX]+= -4 * I.DF + 2; CLKS(18,10,8); } |
| 444 | 527 | |
| 445 | 528 | OP( 0x70, i_jo ) { JMP( OF); CLKS(4,4,3); } |
| 446 | 529 | OP( 0x71, i_jno ) { JMP(!OF); CLKS(4,4,3); } |
| r869 | r870 | |
| 528 | 611 | OP( 0x8d, i_lea ) { UINT16 ModRM = FETCH; (void)(*GetEA[ModRM])(); RegWord(ModRM)=EO; CLKS(4,4,2); } |
| 529 | 612 | OP( 0x8e, i_mov_sregw ) { UINT16 src; GetModRM; src = GetRMWord(ModRM); CLKR(15,15,7,15,11,5,2,EA); |
| 530 | 613 | switch (ModRM & 0x38) { |
| 531 | | case 0x00: I.sregs[ES] = src; break; /* mov es,ew */ |
| 532 | | case 0x08: I.sregs[CS] = src; break; /* mov cs,ew */ |
| 614 | case 0x00: I.sregs[DS1] = src; break; /* mov es,ew */ |
| 615 | case 0x08: I.sregs[PS] = src; break; /* mov cs,ew */ |
| 533 | 616 | case 0x10: I.sregs[SS] = src; break; /* mov ss,ew */ |
| 534 | | case 0x18: I.sregs[DS] = src; break; /* mov ds,ew */ |
| 617 | case 0x18: I.sregs[DS0] = src; break; /* mov ds,ew */ |
| 535 | 618 | default: logerror("%06x: Mov Sreg - Invalid register\n",activecpu_get_pc()); |
| 536 | 619 | } |
| 537 | 620 | I.no_interrupt=1; |
| r869 | r870 | |
| 539 | 622 | OP( 0x8f, i_popw ) { UINT16 tmp; GetModRM; POP(tmp); PutRMWord(ModRM,tmp); nec_ICount-=21; } |
| 540 | 623 | OP( 0x90, i_nop ) { CLK(3); |
| 541 | 624 | /* Cycle skip for idle loops (0: NOP 1: JMP 0) */ |
| 542 | | if (I.no_interrupt==0 && nec_ICount>0 && (I.pending_irq==0) && (PEEKOP((I.sregs[CS]<<4)+I.ip))==0xeb && (PEEK((I.sregs[CS]<<4)+I.ip+1))==0xfd) |
| 625 | if (I.no_interrupt==0 && nec_ICount>0 && (I.pending_irq==0) && (PEEKOP((I.sregs[PS]<<4)+I.ip))==0xeb && (PEEK((I.sregs[PS]<<4)+I.ip+1))==0xfd) |
| 543 | 626 | nec_ICount%=15; |
| 544 | 627 | } |
| 545 | 628 | OP( 0x91, i_xchg_axcx ) { XchgAWReg(CW); CLK(3); } |
| r869 | r870 | |
| 552 | 635 | |
| 553 | 636 | OP( 0x98, i_cbw ) { I.regs.b[AH] = (I.regs.b[AL] & 0x80) ? 0xff : 0; CLK(2); } |
| 554 | 637 | OP( 0x99, i_cwd ) { I.regs.w[DW] = (I.regs.b[AH] & 0x80) ? 0xffff : 0; CLK(4); } |
| 555 | | OP( 0x9a, i_call_far ) { UINT32 tmp, tmp2; FETCHWORD(tmp); FETCHWORD(tmp2); PUSH(I.sregs[CS]); PUSH(I.ip); I.ip = (WORD)tmp; I.sregs[CS] = (WORD)tmp2; CHANGE_PC; CLKW(29,29,13,29,21,9,I.regs.w[SP]); } |
| 638 | OP( 0x9a, i_call_far ) { UINT32 tmp, tmp2; FETCHWORD(tmp); FETCHWORD(tmp2); PUSH(I.sregs[PS]); PUSH(I.ip); I.ip = (WORD)tmp; I.sregs[PS] = (WORD)tmp2; CHANGE_PC; CLKW(29,29,13,29,21,9,I.regs.w[SP]); } |
| 556 | 639 | OP( 0x9b, i_wait ) { logerror("%06x: Hardware POLL\n",activecpu_get_pc()); } |
| 557 | 640 | OP( 0x9c, i_pushf ) { UINT16 tmp = CompressFlags(); PUSH( tmp ); CLKS(12,8,3); } |
| 558 | 641 | OP( 0x9d, i_popf ) { UINT32 tmp; POP(tmp); ExpandFlags(tmp); CLKS(12,8,5); if (I.TF) nec_trap(); } |
| 559 | 642 | OP( 0x9e, i_sahf ) { UINT32 tmp = (CompressFlags() & 0xff00) | (I.regs.b[AH] & 0xd5); ExpandFlags(tmp); CLKS(3,3,2); } |
| 560 | 643 | OP( 0x9f, i_lahf ) { I.regs.b[AH] = CompressFlags() & 0xff; CLKS(3,3,2); } |
| 561 | 644 | |
| 562 | | OP( 0xa0, i_mov_aldisp ) { UINT32 addr; FETCHWORD(addr); I.regs.b[AL] = GetMemB(DS, addr); CLKS(10,10,5); } |
| 563 | | OP( 0xa1, i_mov_axdisp ) { UINT32 addr; FETCHWORD(addr); I.regs.b[AL] = GetMemB(DS, addr); I.regs.b[AH] = GetMemB(DS, (addr+1)&0xffff); CLKW(14,14,7,14,10,5,addr); } |
| 564 | | OP( 0xa2, i_mov_dispal ) { UINT32 addr; FETCHWORD(addr); PutMemB(DS, addr, I.regs.b[AL]); CLKS(9,9,3); } |
| 565 | | OP( 0xa3, i_mov_dispax ) { UINT32 addr; FETCHWORD(addr); PutMemB(DS, addr, I.regs.b[AL]); PutMemB(DS, (addr+1)&0xffff, I.regs.b[AH]); CLKW(13,13,5,13,9,3,addr); } |
| 566 | | OP( 0xa4, i_movsb ) { UINT32 tmp = GetMemB(DS,I.regs.w[IX]); PutMemB(ES,I.regs.w[IY], tmp); I.regs.w[IY] += -2 * I.DF + 1; I.regs.w[IX] += -2 * I.DF + 1; CLKS(8,8,6); } |
| 567 | | OP( 0xa5, i_movsw ) { UINT32 tmp = GetMemW(DS,I.regs.w[IX]); PutMemW(ES,I.regs.w[IY], tmp); I.regs.w[IY] += -4 * I.DF + 2; I.regs.w[IX] += -4 * I.DF + 2; CLKS(16,16,10); } |
| 568 | | OP( 0xa6, i_cmpsb ) { UINT32 src = GetMemB(ES, I.regs.w[IY]); UINT32 dst = GetMemB(DS, I.regs.w[IX]); SUBB; I.regs.w[IY] += -2 * I.DF + 1; I.regs.w[IX] += -2 * I.DF + 1; CLKS(14,14,14); } |
| 569 | | OP( 0xa7, i_cmpsw ) { UINT32 src = GetMemW(ES, I.regs.w[IY]); UINT32 dst = GetMemW(DS, I.regs.w[IX]); SUBW; I.regs.w[IY] += -4 * I.DF + 2; I.regs.w[IX] += -4 * I.DF + 2; CLKS(14,14,14); } |
| 645 | OP( 0xa0, i_mov_aldisp ) { UINT32 addr; FETCHWORD(addr); I.regs.b[AL] = GetMemB(DS0, addr); CLKS(10,10,5); } |
| 646 | OP( 0xa1, i_mov_axdisp ) { UINT32 addr; FETCHWORD(addr); I.regs.b[AL] = GetMemB(DS0, addr); I.regs.b[AH] = GetMemB(DS0, (addr+1)&0xffff); CLKW(14,14,7,14,10,5,addr); } |
| 647 | OP( 0xa2, i_mov_dispal ) { UINT32 addr; FETCHWORD(addr); PutMemB(DS0, addr, I.regs.b[AL]); CLKS(9,9,3); } |
| 648 | OP( 0xa3, i_mov_dispax ) { UINT32 addr; FETCHWORD(addr); PutMemB(DS0, addr, I.regs.b[AL]); PutMemB(DS0, (addr+1)&0xffff, I.regs.b[AH]); CLKW(13,13,5,13,9,3,addr); } |
| 649 | OP( 0xa4, i_movsb ) { UINT32 tmp = GetMemB(DS0,I.regs.w[IX]); PutMemB(DS1,I.regs.w[IY], tmp); I.regs.w[IY] += -2 * I.DF + 1; I.regs.w[IX] += -2 * I.DF + 1; CLKS(8,8,6); } |
| 650 | OP( 0xa5, i_movsw ) { UINT32 tmp = GetMemW(DS0,I.regs.w[IX]); PutMemW(DS1,I.regs.w[IY], tmp); I.regs.w[IY] += -4 * I.DF + 2; I.regs.w[IX] += -4 * I.DF + 2; CLKS(16,16,10); } |
| 651 | OP( 0xa6, i_cmpsb ) { UINT32 src = GetMemB(DS1, I.regs.w[IY]); UINT32 dst = GetMemB(DS0, I.regs.w[IX]); SUBB; I.regs.w[IY] += -2 * I.DF + 1; I.regs.w[IX] += -2 * I.DF + 1; CLKS(14,14,14); } |
| 652 | OP( 0xa7, i_cmpsw ) { UINT32 src = GetMemW(DS1, I.regs.w[IY]); UINT32 dst = GetMemW(DS0, I.regs.w[IX]); SUBW; I.regs.w[IY] += -4 * I.DF + 2; I.regs.w[IX] += -4 * I.DF + 2; CLKS(14,14,14); } |
| 570 | 653 | |
| 571 | 654 | OP( 0xa8, i_test_ald8 ) { DEF_ald8; ANDB; CLKS(4,4,2); } |
| 572 | 655 | OP( 0xa9, i_test_axd16 ) { DEF_axd16; ANDW; CLKS(4,4,2); } |
| 573 | | OP( 0xaa, i_stosb ) { PutMemB(ES,I.regs.w[IY],I.regs.b[AL]); I.regs.w[IY] += -2 * I.DF + 1; CLKS(4,4,3); } |
| 574 | | OP( 0xab, i_stosw ) { PutMemW(ES,I.regs.w[IY],I.regs.w[AW]); I.regs.w[IY] += -4 * I.DF + 2; CLKW(8,8,5,8,4,3,I.regs.w[IY]); } |
| 575 | | OP( 0xac, i_lodsb ) { I.regs.b[AL] = GetMemB(DS,I.regs.w[IX]); I.regs.w[IX] += -2 * I.DF + 1; CLKS(4,4,3); } |
| 576 | | OP( 0xad, i_lodsw ) { I.regs.w[AW] = GetMemW(DS,I.regs.w[IX]); I.regs.w[IX] += -4 * I.DF + 2; CLKW(8,8,5,8,4,3,I.regs.w[IX]); } |
| 577 | | OP( 0xae, i_scasb ) { UINT32 src = GetMemB(ES, I.regs.w[IY]); UINT32 dst = I.regs.b[AL]; SUBB; I.regs.w[IY] += -2 * I.DF + 1; CLKS(4,4,3); } |
| 578 | | OP( 0xaf, i_scasw ) { UINT32 src = GetMemW(ES, I.regs.w[IY]); UINT32 dst = I.regs.w[AW]; SUBW; I.regs.w[IY] += -4 * I.DF + 2; CLKW(8,8,5,8,4,3,I.regs.w[IY]); } |
| 656 | OP( 0xaa, i_stosb ) { PutMemB(DS1,I.regs.w[IY],I.regs.b[AL]); I.regs.w[IY] += -2 * I.DF + 1; CLKS(4,4,3); } |
| 657 | OP( 0xab, i_stosw ) { PutMemW(DS1,I.regs.w[IY],I.regs.w[AW]); I.regs.w[IY] += -4 * I.DF + 2; CLKW(8,8,5,8,4,3,I.regs.w[IY]); } |
| 658 | OP( 0xac, i_lodsb ) { I.regs.b[AL] = GetMemB(DS0,I.regs.w[IX]); I.regs.w[IX] += -2 * I.DF + 1; CLKS(4,4,3); } |
| 659 | OP( 0xad, i_lodsw ) { I.regs.w[AW] = GetMemW(DS0,I.regs.w[IX]); I.regs.w[IX] += -4 * I.DF + 2; CLKW(8,8,5,8,4,3,I.regs.w[IX]); } |
| 660 | OP( 0xae, i_scasb ) { UINT32 src = GetMemB(DS1, I.regs.w[IY]); UINT32 dst = I.regs.b[AL]; SUBB; I.regs.w[IY] += -2 * I.DF + 1; CLKS(4,4,3); } |
| 661 | OP( 0xaf, i_scasw ) { UINT32 src = GetMemW(DS1, I.regs.w[IY]); UINT32 dst = I.regs.w[AW]; SUBW; I.regs.w[IY] += -4 * I.DF + 2; CLKW(8,8,5,8,4,3,I.regs.w[IY]); } |
| 579 | 662 | |
| 580 | 663 | OP( 0xb0, i_mov_ald8 ) { I.regs.b[AL] = FETCH; CLKS(4,4,2); } |
| 581 | 664 | OP( 0xb1, i_mov_cld8 ) { I.regs.b[CL] = FETCH; CLKS(4,4,2); } |
| r869 | r870 | |
| 631 | 714 | |
| 632 | 715 | OP( 0xc2, i_ret_d16 ) { UINT32 count = FETCH; count += FETCH << 8; POP(I.ip); I.regs.w[SP]+=count; CHANGE_PC; CLKS(24,24,10); } |
| 633 | 716 | OP( 0xc3, i_ret ) { POP(I.ip); CHANGE_PC; CLKS(19,19,10); } |
| 634 | | OP( 0xc4, i_les_dw ) { GetModRM; WORD tmp = GetRMWord(ModRM); RegWord(ModRM)=tmp; I.sregs[ES] = GetnextRMWord; CLKW(26,26,14,26,18,10,EA); } |
| 635 | | OP( 0xc5, i_lds_dw ) { GetModRM; WORD tmp = GetRMWord(ModRM); RegWord(ModRM)=tmp; I.sregs[DS] = GetnextRMWord; CLKW(26,26,14,26,18,10,EA); } |
| 717 | OP( 0xc4, i_les_dw ) { GetModRM; WORD tmp = GetRMWord(ModRM); RegWord(ModRM)=tmp; I.sregs[DS1] = GetnextRMWord; CLKW(26,26,14,26,18,10,EA); } |
| 718 | OP( 0xc5, i_lds_dw ) { GetModRM; WORD tmp = GetRMWord(ModRM); RegWord(ModRM)=tmp; I.sregs[DS0] = GetnextRMWord; CLKW(26,26,14,26,18,10,EA); } |
| 636 | 719 | OP( 0xc6, i_mov_bd8 ) { GetModRM; PutImmRMByte(ModRM); nec_ICount-=(ModRM >=0xc0 )?4:11; } |
| 637 | 720 | OP( 0xc7, i_mov_wd16 ) { GetModRM; PutImmRMWord(ModRM); nec_ICount-=(ModRM >=0xc0 )?4:15; } |
| 638 | 721 | |
| r869 | r870 | |
| 657 | 740 | POP(I.regs.w[BP]); |
| 658 | 741 | nec_ICount-=8; |
| 659 | 742 | } |
| 660 | | OP( 0xca, i_retf_d16 ) { UINT32 count = FETCH; count += FETCH << 8; POP(I.ip); POP(I.sregs[CS]); I.regs.w[SP]+=count; CHANGE_PC; CLKS(32,32,16); } |
| 661 | | OP( 0xcb, i_retf ) { POP(I.ip); POP(I.sregs[CS]); CHANGE_PC; CLKS(29,29,16); } |
| 743 | OP( 0xca, i_retf_d16 ) { UINT32 count = FETCH; count += FETCH << 8; POP(I.ip); POP(I.sregs[PS]); I.regs.w[SP]+=count; CHANGE_PC; CLKS(32,32,16); } |
| 744 | OP( 0xcb, i_retf ) { POP(I.ip); POP(I.sregs[PS]); CHANGE_PC; CLKS(29,29,16); } |
| 662 | 745 | OP( 0xcc, i_int3 ) { nec_interrupt(3,0); CLKS(50,50,24); } |
| 663 | 746 | OP( 0xcd, i_int ) { nec_interrupt(FETCH,0); CLKS(50,50,24); } |
| 664 | 747 | OP( 0xce, i_into ) { if (OF) { nec_interrupt(4,0); CLKS(52,52,26); } else CLK(3); } |
| 665 | | OP( 0xcf, i_iret ) { POP(I.ip); POP(I.sregs[CS]); i_popf(); CHANGE_PC; CLKS(39,39,19); } |
| 748 | OP( 0xcf, i_iret ) { POP(I.ip); POP(I.sregs[PS]); i_popf(); CHANGE_PC; CLKS(39,39,19); } |
| 666 | 749 | |
| 667 | 750 | OP( 0xd0, i_rotshft_b ) { |
| 668 | 751 | UINT32 src, dst; GetModRM; src = (UINT32)GetRMByte(ModRM); dst=src; |
| r869 | r870 | |
| 729 | 812 | OP( 0xd4, i_aam ) { UINT32 mult=FETCH; mult=0; I.regs.b[AH] = I.regs.b[AL] / 10; I.regs.b[AL] %= 10; SetSZPF_Word(I.regs.w[AW]); CLKS(15,15,12); } |
| 730 | 813 | OP( 0xd5, i_aad ) { UINT32 mult=FETCH; mult=0; I.regs.b[AL] = I.regs.b[AH] * 10 + I.regs.b[AL]; I.regs.b[AH] = 0; SetSZPF_Byte(I.regs.b[AL]); CLKS(7,7,8); } |
| 731 | 814 | OP( 0xd6, i_setalc ) { I.regs.b[AL] = (CF)?0xff:0x00; nec_ICount-=3; logerror("%06x: Undefined opcode (SETALC)\n",activecpu_get_pc()); } |
| 732 | | OP( 0xd7, i_trans ) { UINT32 dest = (I.regs.w[BW]+I.regs.b[AL])&0xffff; I.regs.b[AL] = GetMemB(DS, dest); CLKS(9,9,5); } |
| 815 | OP( 0xd7, i_trans ) { UINT32 dest = (I.regs.w[BW]+I.regs.b[AL])&0xffff; I.regs.b[AL] = GetMemB(DS0, dest); CLKS(9,9,5); } |
| 733 | 816 | OP( 0xd8, i_fpo ) { GetModRM; nec_ICount-=2; logerror("%06x: Unimplemented floating point control %04x\n",activecpu_get_pc(),ModRM); } |
| 734 | 817 | |
| 735 | 818 | OP( 0xe0, i_loopne ) { INT8 disp = (INT8)FETCH; I.regs.w[CW]--; if (!ZF && I.regs.w[CW]) { I.ip = (WORD)(I.ip+disp); /*CHANGE_PC;*/ CLKS(14,14,6); } else CLKS(5,5,3); } |
| 736 | 819 | OP( 0xe1, i_loope ) { INT8 disp = (INT8)FETCH; I.regs.w[CW]--; if ( ZF && I.regs.w[CW]) { I.ip = (WORD)(I.ip+disp); /*CHANGE_PC;*/ CLKS(14,14,6); } else CLKS(5,5,3); } |
| 737 | 820 | OP( 0xe2, i_loop ) { INT8 disp = (INT8)FETCH; I.regs.w[CW]--; if (I.regs.w[CW]) { I.ip = (WORD)(I.ip+disp); /*CHANGE_PC;*/ CLKS(13,13,6); } else CLKS(5,5,3); } |
| 738 | 821 | OP( 0xe3, i_jcxz ) { INT8 disp = (INT8)FETCH; if (I.regs.w[CW] == 0) { I.ip = (WORD)(I.ip+disp); /*CHANGE_PC;*/ CLKS(13,13,6); } else CLKS(5,5,3); } |
| 739 | | OP( 0xe4, i_inal ) { UINT8 port = FETCH; I.regs.b[AL] = read_port(port); CLKS(9,9,5); } |
| 740 | | OP( 0xe5, i_inax ) { UINT8 port = FETCH; I.regs.b[AL] = read_port(port); I.regs.b[AH] = read_port(port+1); CLKW(13,13,7,13,9,5,port); } |
| 741 | | OP( 0xe6, i_outal ) { UINT8 port = FETCH; write_port(port, I.regs.b[AL]); CLKS(8,8,3); } |
| 742 | | OP( 0xe7, i_outax ) { UINT8 port = FETCH; write_port(port, I.regs.b[AL]); write_port(port+1, I.regs.b[AH]); CLKW(12,12,5,12,8,3,port); } |
| 822 | OP( 0xe4, i_inal ) { UINT8 port = FETCH; I.regs.b[AL] = read_port_byte(port); CLKS(9,9,5); } |
| 823 | OP( 0xe5, i_inax ) { UINT8 port = FETCH; I.regs.w[AW] = read_port_word(port); CLKW(13,13,7,13,9,5,port); } |
| 824 | OP( 0xe6, i_outal ) { UINT8 port = FETCH; write_port_byte(port, I.regs.b[AL]); CLKS(8,8,3); } |
| 825 | OP( 0xe7, i_outax ) { UINT8 port = FETCH; write_port_word(port, I.regs.w[AW]); CLKW(12,12,5,12,8,3,port); } |
| 743 | 826 | |
| 744 | 827 | OP( 0xe8, i_call_d16 ) { UINT32 tmp; FETCHWORD(tmp); PUSH(I.ip); I.ip = (WORD)(I.ip+(INT16)tmp); CHANGE_PC; nec_ICount-=24; } |
| 745 | 828 | OP( 0xe9, i_jmp_d16 ) { UINT32 tmp; FETCHWORD(tmp); I.ip = (WORD)(I.ip+(INT16)tmp); CHANGE_PC; nec_ICount-=15; } |
| 746 | | OP( 0xea, i_jmp_far ) { UINT32 tmp,tmp1; FETCHWORD(tmp); FETCHWORD(tmp1); I.sregs[CS] = (WORD)tmp1; I.ip = (WORD)tmp; CHANGE_PC; nec_ICount-=27; } |
| 829 | OP( 0xea, i_jmp_far ) { UINT32 tmp,tmp1; FETCHWORD(tmp); FETCHWORD(tmp1); I.sregs[PS] = (WORD)tmp1; I.ip = (WORD)tmp; CHANGE_PC; nec_ICount-=27; } |
| 747 | 830 | OP( 0xeb, i_jmp_d8 ) { int tmp = (int)((INT8)FETCH); nec_ICount-=12; |
| 748 | 831 | if (tmp==-2 && I.no_interrupt==0 && (I.pending_irq==0) && nec_ICount>0) nec_ICount%=12; /* cycle skip */ |
| 749 | 832 | I.ip = (WORD)(I.ip+tmp); |
| 750 | 833 | } |
| 751 | | OP( 0xec, i_inaldx ) { I.regs.b[AL] = read_port(I.regs.w[DW]); CLKS(8,8,5);} |
| 752 | | OP( 0xed, i_inaxdx ) { UINT32 port = I.regs.w[DW]; I.regs.b[AL] = read_port(port); I.regs.b[AH] = read_port(port+1); CLKW(12,12,7,12,8,5,port); } |
| 753 | | OP( 0xee, i_outdxal ) { write_port(I.regs.w[DW], I.regs.b[AL]); CLKS(8,8,3); } |
| 754 | | OP( 0xef, i_outdxax ) { UINT32 port = I.regs.w[DW]; write_port(port, I.regs.b[AL]); write_port(port+1, I.regs.b[AH]); CLKW(12,12,5,12,8,3,port); } |
| 834 | OP( 0xec, i_inaldx ) { I.regs.b[AL] = read_port_byte(I.regs.w[DW]); CLKS(8,8,5);} |
| 835 | OP( 0xed, i_inaxdx ) { I.regs.w[AW] = read_port_word(I.regs.w[DW]); CLKW(12,12,7,12,8,5,I.regs.w[DW]); } |
| 836 | OP( 0xee, i_outdxal ) { write_port_byte(I.regs.w[DW], I.regs.b[AL]); CLKS(8,8,3); } |
| 837 | OP( 0xef, i_outdxax ) { write_port_word(I.regs.w[DW], I.regs.w[AW]); CLKW(12,12,5,12,8,3,I.regs.w[DW]); } |
| 755 | 838 | |
| 756 | 839 | OP( 0xf0, i_lock ) { logerror("%06x: Warning - BUSLOCK\n",activecpu_get_pc()); I.no_interrupt=1; CLK(2); } |
| 757 | 840 | OP( 0xf2, i_repne ) { UINT32 next = FETCHOP; UINT16 c = I.regs.w[CW]; |
| 758 | 841 | switch(next) { /* Segments */ |
| 759 | | case 0x26: seg_prefix=TRUE; prefix_base=I.sregs[ES]<<4; next = FETCHOP; CLK(2); break; |
| 760 | | case 0x2e: seg_prefix=TRUE; prefix_base=I.sregs[CS]<<4; next = FETCHOP; CLK(2); break; |
| 842 | case 0x26: seg_prefix=TRUE; prefix_base=I.sregs[DS1]<<4; next = FETCHOP; CLK(2); break; |
| 843 | case 0x2e: seg_prefix=TRUE; prefix_base=I.sregs[PS]<<4; next = FETCHOP; CLK(2); break; |
| 761 | 844 | case 0x36: seg_prefix=TRUE; prefix_base=I.sregs[SS]<<4; next = FETCHOP; CLK(2); break; |
| 762 | | case 0x3e: seg_prefix=TRUE; prefix_base=I.sregs[DS]<<4; next = FETCHOP; CLK(2); break; |
| 845 | case 0x3e: seg_prefix=TRUE; prefix_base=I.sregs[DS0]<<4; next = FETCHOP; CLK(2); break; |
| 763 | 846 | } |
| 764 | 847 | |
| 765 | 848 | switch(next) { |
| r869 | r870 | |
| 783 | 866 | } |
| 784 | 867 | OP( 0xf3, i_repe ) { UINT32 next = FETCHOP; UINT16 c = I.regs.w[CW]; |
| 785 | 868 | switch(next) { /* Segments */ |
| 786 | | case 0x26: seg_prefix=TRUE; prefix_base=I.sregs[ES]<<4; next = FETCHOP; CLK(2); break; |
| 787 | | case 0x2e: seg_prefix=TRUE; prefix_base=I.sregs[CS]<<4; next = FETCHOP; CLK(2); break; |
| 869 | case 0x26: seg_prefix=TRUE; prefix_base=I.sregs[DS1]<<4; next = FETCHOP; CLK(2); break; |
| 870 | case 0x2e: seg_prefix=TRUE; prefix_base=I.sregs[PS]<<4; next = FETCHOP; CLK(2); break; |
| 788 | 871 | case 0x36: seg_prefix=TRUE; prefix_base=I.sregs[SS]<<4; next = FETCHOP; CLK(2); break; |
| 789 | | case 0x3e: seg_prefix=TRUE; prefix_base=I.sregs[DS]<<4; next = FETCHOP; CLK(2); break; |
| 872 | case 0x3e: seg_prefix=TRUE; prefix_base=I.sregs[DS0]<<4; next = FETCHOP; CLK(2); break; |
| 790 | 873 | } |
| 791 | 874 | |
| 792 | 875 | switch(next) { |
| r869 | r870 | |
| 856 | 939 | case 0x00: tmp1 = tmp+1; I.OverVal = (tmp==0x7fff); SetAF(tmp1,tmp,1); SetSZPF_Word(tmp1); PutbackRMWord(ModRM,(WORD)tmp1); CLKM(2,2,2,24,16,7); break; /* INC */ |
| 857 | 940 | case 0x08: tmp1 = tmp-1; I.OverVal = (tmp==0x8000); SetAF(tmp1,tmp,1); SetSZPF_Word(tmp1); PutbackRMWord(ModRM,(WORD)tmp1); CLKM(2,2,2,24,16,7); break; /* DEC */ |
| 858 | 941 | case 0x10: PUSH(I.ip); I.ip = (WORD)tmp; CHANGE_PC; nec_ICount-=(ModRM >=0xc0 )?16:20; break; /* CALL */ |
| 859 | | case 0x18: tmp1 = I.sregs[CS]; I.sregs[CS] = GetnextRMWord; PUSH(tmp1); PUSH(I.ip); I.ip = tmp; CHANGE_PC; nec_ICount-=(ModRM >=0xc0 )?16:26; break; /* CALL FAR */ |
| 942 | case 0x18: tmp1 = I.sregs[PS]; I.sregs[PS] = GetnextRMWord; PUSH(tmp1); PUSH(I.ip); I.ip = tmp; CHANGE_PC; nec_ICount-=(ModRM >=0xc0 )?16:26; break; /* CALL FAR */ |
| 860 | 943 | case 0x20: I.ip = tmp; CHANGE_PC; nec_ICount-=13; break; /* JMP */ |
| 861 | | case 0x28: I.ip = tmp; I.sregs[CS] = GetnextRMWord; CHANGE_PC; nec_ICount-=15; break; /* JMP FAR */ |
| 944 | case 0x28: I.ip = tmp; I.sregs[PS] = GetnextRMWord; CHANGE_PC; nec_ICount-=15; break; /* JMP FAR */ |
| 862 | 945 | case 0x30: PUSH(tmp); nec_ICount-=4; break; |
| 863 | 946 | default: logerror("%06x: FF Pre with unimplemented mod\n",activecpu_get_pc()); |
| 864 | 947 | } |
| r869 | r870 | |
| 947 | 1030 | I.irq_callback = irqcallback; |
| 948 | 1031 | } |
| 949 | 1032 | |
| 1033 | |
| 1034 | /***************************************************************************** |
| 1035 | 8-bit memory accessors |
| 1036 | *****************************************************************************/ |
| 1037 | |
| 1038 | static UINT16 read_word_8(offs_t addr) |
| 1039 | { |
| 1040 | UINT16 result = program_read_byte_8(addr); |
| 1041 | return result | (program_read_byte_8(addr + 1) << 8); |
| 1042 | } |
| 1043 | |
| 1044 | static void write_word_8(offs_t addr, UINT16 data) |
| 1045 | { |
| 1046 | program_write_byte_8(addr, data); |
| 1047 | program_write_byte_8(addr + 1, data >> 8); |
| 1048 | } |
| 1049 | |
| 1050 | static UINT16 read_port_word_8(offs_t addr) |
| 1051 | { |
| 1052 | UINT16 result = io_read_byte_8(addr); |
| 1053 | return result | (io_read_byte_8(addr + 1) << 8); |
| 1054 | } |
| 1055 | |
| 1056 | static void write_port_word_8(offs_t addr, UINT16 data) |
| 1057 | { |
| 1058 | io_write_byte_8(addr, data); |
| 1059 | io_write_byte_8(addr + 1, data >> 8); |
| 1060 | } |
| 1061 | |
| 1062 | static void configure_memory_8bit(void) |
| 1063 | { |
| 1064 | I.mem.fetch_xor = 0; |
| 1065 | |
| 1066 | I.mem.rbyte = program_read_byte_8; |
| 1067 | I.mem.rword = read_word_8; |
| 1068 | I.mem.wbyte = program_write_byte_8; |
| 1069 | I.mem.wword = write_word_8; |
| 1070 | |
| 1071 | I.mem.rbyte_port = io_read_byte_8; |
| 1072 | I.mem.rword_port = read_port_word_8; |
| 1073 | I.mem.wbyte_port = io_write_byte_8; |
| 1074 | I.mem.wword_port = write_port_word_8; |
| 1075 | } |
| 1076 | |
| 1077 | |
| 1078 | /***************************************************************************** |
| 1079 | 16-bit memory accessors |
| 1080 | *****************************************************************************/ |
| 1081 | |
| 1082 | static UINT16 read_word_16le(offs_t addr) |
| 1083 | { |
| 1084 | if (!(addr & 1)) |
| 1085 | return program_read_word_16le(addr); |
| 1086 | else |
| 1087 | { |
| 1088 | UINT16 result = program_read_byte_16le(addr); |
| 1089 | return result | (program_read_byte_16le(addr + 1) << 8); |
| 1090 | } |
| 1091 | } |
| 1092 | |
| 1093 | static void write_word_16le(offs_t addr, UINT16 data) |
| 1094 | { |
| 1095 | if (!(addr & 1)) |
| 1096 | program_write_word_16le(addr, data); |
| 1097 | else |
| 1098 | { |
| 1099 | program_write_byte_16le(addr, data); |
| 1100 | program_write_byte_16le(addr + 1, data >> 8); |
| 1101 | } |
| 1102 | } |
| 1103 | |
| 1104 | static UINT16 read_port_word_16le(offs_t addr) |
| 1105 | { |
| 1106 | if (!(addr & 1)) |
| 1107 | return io_read_word_16le(addr); |
| 1108 | else |
| 1109 | { |
| 1110 | UINT16 result = io_read_byte_16le(addr); |
| 1111 | return result | (io_read_byte_16le(addr + 1) << 8); |
| 1112 | } |
| 1113 | } |
| 1114 | |
| 1115 | static void write_port_word_16le(offs_t addr, UINT16 data) |
| 1116 | { |
| 1117 | if (!(addr & 1)) |
| 1118 | io_write_word_16le(addr, data); |
| 1119 | else |
| 1120 | { |
| 1121 | io_write_byte_16le(addr, data); |
| 1122 | io_write_byte_16le(addr + 1, data >> 8); |
| 1123 | } |
| 1124 | } |
| 1125 | |
| 1126 | static void configure_memory_16bit(void) |
| 1127 | { |
| 1128 | I.mem.fetch_xor = BYTE_XOR_LE(0); |
| 1129 | |
| 1130 | I.mem.rbyte = program_read_byte_16le; |
| 1131 | I.mem.rword = read_word_16le; |
| 1132 | I.mem.wbyte = program_write_byte_16le; |
| 1133 | I.mem.wword = write_word_16le; |
| 1134 | |
| 1135 | I.mem.rbyte_port = io_read_byte_16le; |
| 1136 | I.mem.rword_port = read_port_word_16le; |
| 1137 | I.mem.wbyte_port = io_write_byte_16le; |
| 1138 | I.mem.wword_port = write_port_word_16le; |
| 1139 | } |
| 1140 | |
| 1141 | |
| 950 | 1142 | /* Wrappers for the different CPU types */ |
| 951 | 1143 | #if (HAS_V20) |
| 952 | | void v20_init(int index, int clock, const void *config, int (*irqcallback)(int)) { nec_init(index, clock, config, irqcallback, 0); } |
| 1144 | void v20_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 1145 | { |
| 1146 | nec_init(index, clock, config, irqcallback, 0); |
| 1147 | configure_memory_8bit(); |
| 1148 | } |
| 953 | 1149 | int v20_execute(int cycles) |
| 954 | 1150 | { |
| 955 | 1151 | nec_ICount=cycles; |
| r869 | r870 | |
| 977 | 1173 | #endif |
| 978 | 1174 | |
| 979 | 1175 | #if (HAS_V30) |
| 980 | | void v30_init(int index, int clock, const void *config, int (*irqcallback)(int)) { nec_init(index, clock, config, irqcallback, 1); } |
| 1176 | void v30_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 1177 | { |
| 1178 | nec_init(index, clock, config, irqcallback, 1); |
| 1179 | configure_memory_16bit(); |
| 1180 | } |
| 981 | 1181 | int v30_execute(int cycles) { |
| 982 | 1182 | nec_ICount=cycles; |
| 983 | 1183 | cpu_type=V30; |
| r869 | r870 | |
| 1004 | 1204 | #endif |
| 1005 | 1205 | |
| 1006 | 1206 | #if (HAS_V33) |
| 1007 | | void v33_init(int index, int clock, const void *config, int (*irqcallback)(int)) { nec_init(index, clock, config, irqcallback, 2); } |
| 1207 | void v33_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 1208 | { |
| 1209 | nec_init(index, clock, config, irqcallback, 2); |
| 1210 | configure_memory_16bit(); |
| 1211 | } |
| 1008 | 1212 | int v33_execute(int cycles) |
| 1009 | 1213 | { |
| 1010 | 1214 | nec_ICount=cycles; |
| r869 | r870 | |
| 1048 | 1252 | |
| 1049 | 1253 | case CPUINFO_INT_PC: |
| 1050 | 1254 | case CPUINFO_INT_REGISTER + NEC_PC: |
| 1051 | | if( info->i - (I.sregs[CS]<<4) < 0x10000 ) |
| 1255 | if( info->i - (I.sregs[PS]<<4) < 0x10000 ) |
| 1052 | 1256 | { |
| 1053 | | I.ip = info->i - (I.sregs[CS]<<4); |
| 1257 | I.ip = info->i - (I.sregs[PS]<<4); |
| 1054 | 1258 | } |
| 1055 | 1259 | else |
| 1056 | 1260 | { |
| 1057 | | I.sregs[CS] = info->i >> 4; |
| 1261 | I.sregs[PS] = info->i >> 4; |
| 1058 | 1262 | I.ip = info->i & 0x0000f; |
| 1059 | 1263 | } |
| 1060 | 1264 | break; |
| r869 | r870 | |
| 1079 | 1283 | case CPUINFO_INT_REGISTER + NEC_BP: I.regs.w[BP] = info->i; break; |
| 1080 | 1284 | case CPUINFO_INT_REGISTER + NEC_IX: I.regs.w[IX] = info->i; break; |
| 1081 | 1285 | case CPUINFO_INT_REGISTER + NEC_IY: I.regs.w[IY] = info->i; break; |
| 1082 | | case CPUINFO_INT_REGISTER + NEC_ES: I.sregs[ES] = info->i; break; |
| 1083 | | case CPUINFO_INT_REGISTER + NEC_CS: I.sregs[CS] = info->i; break; |
| 1286 | case CPUINFO_INT_REGISTER + NEC_ES: I.sregs[DS1] = info->i; break; |
| 1287 | case CPUINFO_INT_REGISTER + NEC_CS: I.sregs[PS] = info->i; break; |
| 1084 | 1288 | case CPUINFO_INT_REGISTER + NEC_SS: I.sregs[SS] = info->i; break; |
| 1085 | | case CPUINFO_INT_REGISTER + NEC_DS: I.sregs[DS] = info->i; break; |
| 1289 | case CPUINFO_INT_REGISTER + NEC_DS: I.sregs[DS0] = info->i; break; |
| 1086 | 1290 | case CPUINFO_INT_REGISTER + NEC_VECTOR: I.int_vector = info->i; break; |
| 1087 | 1291 | } |
| 1088 | 1292 | } |
| r869 | r870 | |
| 1110 | 1314 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1111 | 1315 | case CPUINFO_INT_MAX_CYCLES: info->i = 80; break; |
| 1112 | 1316 | |
| 1113 | | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; |
| 1317 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16; break; |
| 1114 | 1318 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20; break; |
| 1115 | 1319 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; |
| 1116 | 1320 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; |
| 1117 | 1321 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; |
| 1118 | 1322 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; |
| 1119 | | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; |
| 1323 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; |
| 1120 | 1324 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 16; break; |
| 1121 | 1325 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; |
| 1122 | 1326 | |
| r869 | r870 | |
| 1126 | 1330 | case CPUINFO_INT_PREVIOUSPC: /* not supported */ break; |
| 1127 | 1331 | |
| 1128 | 1332 | case CPUINFO_INT_PC: |
| 1129 | | case CPUINFO_INT_REGISTER + NEC_PC: info->i = ((I.sregs[CS]<<4) + I.ip); break; |
| 1333 | case CPUINFO_INT_REGISTER + NEC_PC: info->i = ((I.sregs[PS]<<4) + I.ip); break; |
| 1130 | 1334 | case CPUINFO_INT_REGISTER + NEC_IP: info->i = I.ip; break; |
| 1131 | 1335 | case CPUINFO_INT_SP: info->i = (I.sregs[SS]<<4) + I.regs.w[SP]; break; |
| 1132 | 1336 | case CPUINFO_INT_REGISTER + NEC_SP: info->i = I.regs.w[SP]; break; |
| r869 | r870 | |
| 1138 | 1342 | case CPUINFO_INT_REGISTER + NEC_BP: info->i = I.regs.w[BP]; break; |
| 1139 | 1343 | case CPUINFO_INT_REGISTER + NEC_IX: info->i = I.regs.w[IX]; break; |
| 1140 | 1344 | case CPUINFO_INT_REGISTER + NEC_IY: info->i = I.regs.w[IY]; break; |
| 1141 | | case CPUINFO_INT_REGISTER + NEC_ES: info->i = I.sregs[ES]; break; |
| 1142 | | case CPUINFO_INT_REGISTER + NEC_CS: info->i = I.sregs[CS]; break; |
| 1345 | case CPUINFO_INT_REGISTER + NEC_ES: info->i = I.sregs[DS1]; break; |
| 1346 | case CPUINFO_INT_REGISTER + NEC_CS: info->i = I.sregs[PS]; break; |
| 1143 | 1347 | case CPUINFO_INT_REGISTER + NEC_SS: info->i = I.sregs[SS]; break; |
| 1144 | | case CPUINFO_INT_REGISTER + NEC_DS: info->i = I.sregs[DS]; break; |
| 1348 | case CPUINFO_INT_REGISTER + NEC_DS: info->i = I.sregs[DS0]; break; |
| 1145 | 1349 | case CPUINFO_INT_REGISTER + NEC_VECTOR: info->i = I.int_vector; break; |
| 1146 | 1350 | case CPUINFO_INT_REGISTER + NEC_PENDING: info->i = I.pending_irq; break; |
| 1147 | 1351 | |
| r869 | r870 | |
| 1187 | 1391 | flags & 0x0001 ? 'C':'.'); |
| 1188 | 1392 | break; |
| 1189 | 1393 | |
| 1190 | | case CPUINFO_STR_REGISTER + NEC_PC: sprintf(info->s, "PC:%04X", (I.sregs[CS]<<4) + I.ip); break; |
| 1394 | case CPUINFO_STR_REGISTER + NEC_PC: sprintf(info->s, "PC:%04X", (I.sregs[PS]<<4) + I.ip); break; |
| 1191 | 1395 | case CPUINFO_STR_REGISTER + NEC_IP: sprintf(info->s, "IP:%04X", I.ip); break; |
| 1192 | 1396 | case CPUINFO_STR_REGISTER + NEC_SP: sprintf(info->s, "SP:%04X", I.regs.w[SP]); break; |
| 1193 | 1397 | case CPUINFO_STR_REGISTER + NEC_FLAGS: sprintf(info->s, "F:%04X", CompressFlags()); break; |
| r869 | r870 | |
| 1198 | 1402 | case CPUINFO_STR_REGISTER + NEC_BP: sprintf(info->s, "BP:%04X", I.regs.w[BP]); break; |
| 1199 | 1403 | case CPUINFO_STR_REGISTER + NEC_IX: sprintf(info->s, "IX:%04X", I.regs.w[IX]); break; |
| 1200 | 1404 | case CPUINFO_STR_REGISTER + NEC_IY: sprintf(info->s, "IY:%04X", I.regs.w[IY]); break; |
| 1201 | | case CPUINFO_STR_REGISTER + NEC_ES: sprintf(info->s, "ES:%04X", I.sregs[ES]); break; |
| 1202 | | case CPUINFO_STR_REGISTER + NEC_CS: sprintf(info->s, "CS:%04X", I.sregs[CS]); break; |
| 1405 | case CPUINFO_STR_REGISTER + NEC_ES: sprintf(info->s, "DS1:%04X", I.sregs[DS1]); break; |
| 1406 | case CPUINFO_STR_REGISTER + NEC_CS: sprintf(info->s, "PS:%04X", I.sregs[PS]); break; |
| 1203 | 1407 | case CPUINFO_STR_REGISTER + NEC_SS: sprintf(info->s, "SS:%04X", I.sregs[SS]); break; |
| 1204 | | case CPUINFO_STR_REGISTER + NEC_DS: sprintf(info->s, "DS:%04X", I.sregs[DS]); break; |
| 1408 | case CPUINFO_STR_REGISTER + NEC_DS: sprintf(info->s, "DS0:%04X", I.sregs[DS0]); break; |
| 1205 | 1409 | case CPUINFO_STR_REGISTER + NEC_VECTOR: sprintf(info->s, "V:%02X", I.int_vector); break; |
| 1206 | 1410 | } |
| 1207 | 1411 | } |
| r869 | r870 | |
| 1216 | 1420 | { |
| 1217 | 1421 | switch (state) |
| 1218 | 1422 | { |
| 1423 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1424 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; |
| 1425 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; |
| 1426 | |
| 1219 | 1427 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1220 | 1428 | case CPUINFO_PTR_INIT: info->init = v20_init; break; |
| 1221 | 1429 | case CPUINFO_PTR_EXECUTE: info->execute = v20_execute; break; |
| r869 | r870 | |
| 1229 | 1437 | #endif |
| 1230 | 1438 | |
| 1231 | 1439 | |
| 1440 | #if (HAS_V25) |
| 1441 | /************************************************************************** |
| 1442 | * CPU-specific set_info |
| 1443 | **************************************************************************/ |
| 1444 | |
| 1445 | void v25_get_info(UINT32 state, cpuinfo *info) |
| 1446 | { |
| 1447 | switch (state) |
| 1448 | { |
| 1449 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1450 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 8; break; |
| 1451 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 8; break; |
| 1452 | |
| 1453 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1454 | case CPUINFO_PTR_INIT: info->init = v20_init; break; |
| 1455 | case CPUINFO_PTR_EXECUTE: info->execute = v20_execute; break; |
| 1456 | |
| 1457 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1458 | case CPUINFO_STR_NAME: strcpy(info->s, "V25"); break; |
| 1459 | |
| 1460 | default: nec_get_info(state, info); break; |
| 1461 | } |
| 1462 | } |
| 1463 | #endif |
| 1464 | |
| 1465 | |
| 1232 | 1466 | #if (HAS_V30) |
| 1233 | 1467 | /************************************************************************** |
| 1234 | 1468 | * CPU-specific set_info |
| r869 | r870 | |
| 1271 | 1505 | } |
| 1272 | 1506 | } |
| 1273 | 1507 | #endif |
| 1508 | |
| 1509 | |
| 1510 | #if (HAS_V35) |
| 1511 | /************************************************************************** |
| 1512 | * CPU-specific set_info |
| 1513 | **************************************************************************/ |
| 1514 | |
| 1515 | void v35_get_info(UINT32 state, cpuinfo *info) |
| 1516 | { |
| 1517 | switch (state) |
| 1518 | { |
| 1519 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1520 | case CPUINFO_PTR_INIT: info->init = v30_init; break; |
| 1521 | case CPUINFO_PTR_EXECUTE: info->execute = v30_execute; break; |
| 1522 | |
| 1523 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1524 | case CPUINFO_STR_NAME: strcpy(info->s, "V35"); break; |
| 1525 | |
| 1526 | default: nec_get_info(state, info); break; |
| 1527 | } |
| 1528 | } |
| 1529 | #endif |
src/emu/cpu/nec/necdasm.c
| r0 | r870 | |
| 1 | /* |
| 2 | NEC V-series Disassembler |
| 3 | |
| 4 | Originally Written for i386 by Ville Linde |
| 5 | Converted to NEC-V by Aaron Giles |
| 6 | */ |
| 7 | |
| 8 | #include "cpuintrf.h" |
| 9 | |
| 10 | enum { |
| 11 | PARAM_REG8 = 1, /* 8-bit register */ |
| 12 | PARAM_REG16, /* 16-bit register */ |
| 13 | PARAM_REG2_8, /* 8-bit register */ |
| 14 | PARAM_REG2_16, /* 16-bit register */ |
| 15 | PARAM_RM8, /* 8-bit memory or register */ |
| 16 | PARAM_RM16, /* 16-bit memory or register */ |
| 17 | PARAM_I4, /* 4-bit signed immediate */ |
| 18 | PARAM_I8, /* 8-bit signed immediate */ |
| 19 | PARAM_I16, /* 16-bit signed immediate */ |
| 20 | PARAM_UI8, /* 8-bit unsigned immediate */ |
| 21 | PARAM_UI16, /* 16-bit unsigned immediate */ |
| 22 | PARAM_IMM, /* 16-bit immediate */ |
| 23 | PARAM_ADDR, /* 16:16 address */ |
| 24 | PARAM_REL8, /* 8-bit PC-relative displacement */ |
| 25 | PARAM_REL16, /* 16-bit PC-relative displacement */ |
| 26 | PARAM_MEM_OFFS_B, /* 8-bit mem offset */ |
| 27 | PARAM_MEM_OFFS_W, /* 16-bit mem offset */ |
| 28 | PARAM_SREG, /* segment register */ |
| 29 | PARAM_RBANK, /* register bank (V25) */ |
| 30 | PARAM_1, /* used by shift/rotate instructions */ |
| 31 | PARAM_AL, |
| 32 | PARAM_CL, |
| 33 | PARAM_DL, |
| 34 | PARAM_BL, |
| 35 | PARAM_AH, |
| 36 | PARAM_CH, |
| 37 | PARAM_DH, |
| 38 | PARAM_BH, |
| 39 | PARAM_AW, |
| 40 | PARAM_CW, |
| 41 | PARAM_DW, |
| 42 | PARAM_BW, |
| 43 | PARAM_SP, |
| 44 | PARAM_BP, |
| 45 | PARAM_IX, |
| 46 | PARAM_IY |
| 47 | }; |
| 48 | |
| 49 | enum { |
| 50 | MODRM = 1, |
| 51 | GROUP, |
| 52 | FPU, |
| 53 | TWO_BYTE, |
| 54 | PREFIX, |
| 55 | SEG_PS, |
| 56 | SEG_DS0, |
| 57 | SEG_DS1, |
| 58 | SEG_SS |
| 59 | }; |
| 60 | |
| 61 | typedef struct { |
| 62 | char mnemonic[32]; |
| 63 | UINT32 flags; |
| 64 | UINT32 param1; |
| 65 | UINT32 param2; |
| 66 | UINT32 param3; |
| 67 | offs_t dasm_flags; |
| 68 | } I386_OPCODE; |
| 69 | |
| 70 | typedef struct { |
| 71 | char mnemonic[32]; |
| 72 | const I386_OPCODE *opcode; |
| 73 | } GROUP_OP; |
| 74 | |
| 75 | static const UINT8 *opcode_ptr; |
| 76 | static const UINT8 *opcode_ptr_base; |
| 77 | |
| 78 | static const I386_OPCODE necv_opcode_table1[256] = |
| 79 | { |
| 80 | // 0x00 |
| 81 | {"add", MODRM, PARAM_RM8, PARAM_REG8, 0 }, |
| 82 | {"add", MODRM, PARAM_RM16, PARAM_REG16, 0 }, |
| 83 | {"add", MODRM, PARAM_REG8, PARAM_RM8, 0 }, |
| 84 | {"add", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 85 | {"add", 0, PARAM_AL, PARAM_UI8, 0 }, |
| 86 | {"add", 0, PARAM_AW, PARAM_IMM, 0 }, |
| 87 | {"push ds1", 0, 0, 0, 0 }, |
| 88 | {"pop ds1", 0, 0, 0, 0 }, |
| 89 | {"or", MODRM, PARAM_RM8, PARAM_REG8, 0 }, |
| 90 | {"or", MODRM, PARAM_RM16, PARAM_REG16, 0 }, |
| 91 | {"or", MODRM, PARAM_REG8, PARAM_RM8, 0 }, |
| 92 | {"or", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 93 | {"or", 0, PARAM_AL, PARAM_UI8, 0 }, |
| 94 | {"or", 0, PARAM_AW, PARAM_IMM, 0 }, |
| 95 | {"push ps", 0, 0, 0, 0 }, |
| 96 | {"two_byte", TWO_BYTE, 0, 0, 0 }, |
| 97 | // 0x10 |
| 98 | {"addc", MODRM, PARAM_RM8, PARAM_REG8, 0 }, |
| 99 | {"addc", MODRM, PARAM_RM16, PARAM_REG16, 0 }, |
| 100 | {"addc", MODRM, PARAM_REG8, PARAM_RM8, 0 }, |
| 101 | {"addc", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 102 | {"addc", 0, PARAM_AL, PARAM_UI8, 0 }, |
| 103 | {"addc", 0, PARAM_AW, PARAM_IMM, 0 }, |
| 104 | {"push ss", 0, 0, 0, 0 }, |
| 105 | {"pop ss", 0, 0, 0, 0 }, |
| 106 | {"subc", MODRM, PARAM_RM8, PARAM_REG8, 0 }, |
| 107 | {"subc", MODRM, PARAM_RM16, PARAM_REG16, 0 }, |
| 108 | {"subc", MODRM, PARAM_REG8, PARAM_RM8, 0 }, |
| 109 | {"subc", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 110 | {"subc", 0, PARAM_AL, PARAM_UI8, 0 }, |
| 111 | {"subc", 0, PARAM_AW, PARAM_IMM, 0 }, |
| 112 | {"push ds0", 0, 0, 0, 0 }, |
| 113 | {"pop ds0", 0, 0, 0, 0 }, |
| 114 | // 0x20 |
| 115 | {"and", MODRM, PARAM_RM8, PARAM_REG8, 0 }, |
| 116 | {"and", MODRM, PARAM_RM16, PARAM_REG16, 0 }, |
| 117 | {"and", MODRM, PARAM_REG8, PARAM_RM8, 0 }, |
| 118 | {"and", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 119 | {"and", 0, PARAM_AL, PARAM_UI8, 0 }, |
| 120 | {"and", 0, PARAM_AW, PARAM_IMM, 0 }, |
| 121 | {"ds1:", SEG_DS1, 0, 0, 0 }, |
| 122 | {"adj4a", 0, 0, 0, 0 }, |
| 123 | {"sub", MODRM, PARAM_RM8, PARAM_REG8, 0 }, |
| 124 | {"sub", MODRM, PARAM_RM16, PARAM_REG16, 0 }, |
| 125 | {"sub", MODRM, PARAM_REG8, PARAM_RM8, 0 }, |
| 126 | {"sub", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 127 | {"sub", 0, PARAM_AL, PARAM_I8, 0 }, |
| 128 | {"sub", 0, PARAM_AW, PARAM_IMM, 0 }, |
| 129 | {"ps:", SEG_PS, 0, 0, 0 }, |
| 130 | {"adj4s", 0, 0, 0, 0 }, |
| 131 | // 0x30 |
| 132 | {"xor", MODRM, PARAM_RM8, PARAM_REG8, 0 }, |
| 133 | {"xor", MODRM, PARAM_RM16, PARAM_REG16, 0 }, |
| 134 | {"xor", MODRM, PARAM_REG8, PARAM_RM8, 0 }, |
| 135 | {"xor", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 136 | {"xor", 0, PARAM_AL, PARAM_UI8, 0 }, |
| 137 | {"xor", 0, PARAM_AW, PARAM_IMM, 0 }, |
| 138 | {"ss:", SEG_SS, 0, 0, 0 }, |
| 139 | {"adjba", 0, 0, 0, 0 }, |
| 140 | {"cmp", MODRM, PARAM_RM8, PARAM_REG8, 0 }, |
| 141 | {"cmp", MODRM, PARAM_RM16, PARAM_REG16, 0 }, |
| 142 | {"cmp", MODRM, PARAM_REG8, PARAM_RM8, 0 }, |
| 143 | {"cmp", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 144 | {"cmp", 0, PARAM_AL, PARAM_UI8, 0 }, |
| 145 | {"cmp", 0, PARAM_AW, PARAM_IMM, 0 }, |
| 146 | {"ds0:", SEG_DS0, 0, 0, 0 }, |
| 147 | {"adjbs", 0, 0, 0, 0 }, |
| 148 | // 0x40 |
| 149 | {"inc", 0, PARAM_AW, 0, 0 }, |
| 150 | {"inc", 0, PARAM_CW, 0, 0 }, |
| 151 | {"inc", 0, PARAM_DW, 0, 0 }, |
| 152 | {"inc", 0, PARAM_BW, 0, 0 }, |
| 153 | {"inc", 0, PARAM_SP, 0, 0 }, |
| 154 | {"inc", 0, PARAM_BP, 0, 0 }, |
| 155 | {"inc", 0, PARAM_IX, 0, 0 }, |
| 156 | {"inc", 0, PARAM_IY, 0, 0 }, |
| 157 | {"dec", 0, PARAM_AW, 0, 0 }, |
| 158 | {"dec", 0, PARAM_CW, 0, 0 }, |
| 159 | {"dec", 0, PARAM_DW, 0, 0 }, |
| 160 | {"dec", 0, PARAM_BW, 0, 0 }, |
| 161 | {"dec", 0, PARAM_SP, 0, 0 }, |
| 162 | {"dec", 0, PARAM_BP, 0, 0 }, |
| 163 | {"dec", 0, PARAM_IX, 0, 0 }, |
| 164 | {"dec", 0, PARAM_IY, 0, 0 }, |
| 165 | // 0x50 |
| 166 | {"push", 0, PARAM_AW, 0, 0 }, |
| 167 | {"push", 0, PARAM_CW, 0, 0 }, |
| 168 | {"push", 0, PARAM_DW, 0, 0 }, |
| 169 | {"push", 0, PARAM_BW, 0, 0 }, |
| 170 | {"push", 0, PARAM_SP, 0, 0 }, |
| 171 | {"push", 0, PARAM_BP, 0, 0 }, |
| 172 | {"push", 0, PARAM_IX, 0, 0 }, |
| 173 | {"push", 0, PARAM_IY, 0, 0 }, |
| 174 | {"pop", 0, PARAM_AW, 0, 0 }, |
| 175 | {"pop", 0, PARAM_CW, 0, 0 }, |
| 176 | {"pop", 0, PARAM_DW, 0, 0 }, |
| 177 | {"pop", 0, PARAM_BW, 0, 0 }, |
| 178 | {"pop", 0, PARAM_SP, 0, 0 }, |
| 179 | {"pop", 0, PARAM_BP, 0, 0 }, |
| 180 | {"pop", 0, PARAM_IX, 0, 0 }, |
| 181 | {"pop", 0, PARAM_IY, 0, 0 }, |
| 182 | // 0x60 |
| 183 | {"push r", 0, 0, 0, 0 }, |
| 184 | {"pop r", 0, 0, 0, 0 }, |
| 185 | {"chkind", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 186 | {"brkn", MODRM, PARAM_RM16, PARAM_REG16, 0 }, /* break into native */ |
| 187 | {"repnc", PREFIX, 0, 0, 0 }, |
| 188 | {"repc", PREFIX, 0, 0, 0 }, |
| 189 | {"fpo2 0", 0,/*OP_SIZE*/ 0, 0, 0 }, |
| 190 | {"fpo2 1", 0,/*ADDR_SIZE*/ 0, 0, 0 }, |
| 191 | {"push", 0, PARAM_IMM, 0, 0 }, |
| 192 | {"mul", MODRM, PARAM_REG16, PARAM_RM16, PARAM_IMM }, |
| 193 | {"push", 0, PARAM_I8, 0, 0 }, |
| 194 | {"mul", MODRM, PARAM_REG16, PARAM_RM16, PARAM_I8 }, |
| 195 | {"inmb", 0, 0, 0, 0 }, |
| 196 | {"inmw", 0, 0, 0, 0 }, |
| 197 | {"outmb", 0, 0, 0, 0 }, |
| 198 | {"outmw", 0, 0, 0, 0 }, |
| 199 | // 0x70 |
| 200 | {"bv", 0, PARAM_REL8, 0, 0 }, |
| 201 | {"bnv", 0, PARAM_REL8, 0, 0 }, |
| 202 | {"bc", 0, PARAM_REL8, 0, 0 }, |
| 203 | {"bnc", 0, PARAM_REL8, 0, 0 }, |
| 204 | {"be", 0, PARAM_REL8, 0, 0 }, |
| 205 | {"bne", 0, PARAM_REL8, 0, 0 }, |
| 206 | {"bnh", 0, PARAM_REL8, 0, 0 }, |
| 207 | {"bh", 0, PARAM_REL8, 0, 0 }, |
| 208 | {"bn", 0, PARAM_REL8, 0, 0 }, |
| 209 | {"bp", 0, PARAM_REL8, 0, 0 }, |
| 210 | {"bpe", 0, PARAM_REL8, 0, 0 }, |
| 211 | {"bpo", 0, PARAM_REL8, 0, 0 }, |
| 212 | {"blt", 0, PARAM_REL8, 0, 0 }, |
| 213 | {"bge", 0, PARAM_REL8, 0, 0 }, |
| 214 | {"ble", 0, PARAM_REL8, 0, 0 }, |
| 215 | {"bgt", 0, PARAM_REL8, 0, 0 }, |
| 216 | // 0x80 |
| 217 | {"immb", GROUP, 0, 0, 0 }, |
| 218 | {"immw", GROUP, 0, 0, 0 }, |
| 219 | {"immb", GROUP, 0, 0, 0 }, |
| 220 | {"immws", GROUP, 0, 0, 0 }, |
| 221 | {"test", MODRM, PARAM_RM8, PARAM_REG8, 0 }, |
| 222 | {"test", MODRM, PARAM_RM16, PARAM_REG16, 0 }, |
| 223 | {"xch", MODRM, PARAM_REG8, PARAM_RM8, 0 }, |
| 224 | {"xch", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 225 | {"mov", MODRM, PARAM_RM8, PARAM_REG8, 0 }, |
| 226 | {"mov", MODRM, PARAM_RM16, PARAM_REG16, 0 }, |
| 227 | {"mov", MODRM, PARAM_REG8, PARAM_RM8, 0 }, |
| 228 | {"mov", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 229 | {"mov", MODRM, PARAM_RM16, PARAM_SREG, 0 }, |
| 230 | {"ldea", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 231 | {"mov", MODRM, PARAM_SREG, PARAM_RM16, 0 }, |
| 232 | {"pop", MODRM, PARAM_RM16, 0, 0 }, |
| 233 | // 0x90 |
| 234 | {"nop", 0, 0, 0, 0 }, |
| 235 | {"xch", 0, PARAM_AW, PARAM_CW, 0 }, |
| 236 | {"xch", 0, PARAM_AW, PARAM_DW, 0 }, |
| 237 | {"xch", 0, PARAM_AW, PARAM_BW, 0 }, |
| 238 | {"xch", 0, PARAM_AW, PARAM_SP, 0 }, |
| 239 | {"xch", 0, PARAM_AW, PARAM_BP, 0 }, |
| 240 | {"xch", 0, PARAM_AW, PARAM_IX, 0 }, |
| 241 | {"xch", 0, PARAM_AW, PARAM_IY, 0 }, |
| 242 | {"cvtbw", 0, 0, 0, 0 }, |
| 243 | {"cvtwl", 0, 0, 0, 0 }, |
| 244 | {"call", 0, PARAM_ADDR, 0, 0, DASMFLAG_STEP_OVER}, |
| 245 | {"poll", 0, 0, 0, 0 }, |
| 246 | {"push psw", 0, 0, 0, 0 }, |
| 247 | {"pop psw", 0, 0, 0, 0 }, |
| 248 | {"mov psw,ah", 0, 0, 0, 0 }, |
| 249 | {"mov ah,psw", 0, 0, 0, 0 }, |
| 250 | // 0xa0 |
| 251 | {"mov", 0, PARAM_AL, PARAM_MEM_OFFS_W, 0 }, |
| 252 | {"mov", 0, PARAM_AW, PARAM_MEM_OFFS_W, 0 }, |
| 253 | {"mov", 0, PARAM_MEM_OFFS_W, PARAM_AL, 0 }, |
| 254 | {"mov", 0, PARAM_MEM_OFFS_W, PARAM_AW, 0 }, |
| 255 | {"movbkb", 0, 0, 0, 0 }, |
| 256 | {"movbkw", 0, 0, 0, 0 }, |
| 257 | {"cmpbkb", 0, 0, 0, 0 }, |
| 258 | {"cmpbkw", 0, 0, 0, 0 }, |
| 259 | {"test", 0, PARAM_AL, PARAM_UI8, 0 }, |
| 260 | {"test", 0, PARAM_AW, PARAM_IMM, 0 }, |
| 261 | {"stmb", 0, 0, 0, 0 }, |
| 262 | {"stmw", 0, 0, 0, 0 }, |
| 263 | {"ldmb", 0, 0, 0, 0 }, |
| 264 | {"ldmw", 0, 0, 0, 0 }, |
| 265 | {"cmpmb", 0, 0, 0, 0 }, |
| 266 | {"cmpmw", 0, 0, 0, 0 }, |
| 267 | // 0xb0 |
| 268 | {"mov", 0, PARAM_AL, PARAM_UI8, 0 }, |
| 269 | {"mov", 0, PARAM_CL, PARAM_UI8, 0 }, |
| 270 | {"mov", 0, PARAM_DL, PARAM_UI8, 0 }, |
| 271 | {"mov", 0, PARAM_BL, PARAM_UI8, 0 }, |
| 272 | {"mov", 0, PARAM_AH, PARAM_UI8, 0 }, |
| 273 | {"mov", 0, PARAM_CH, PARAM_UI8, 0 }, |
| 274 | {"mov", 0, PARAM_DH, PARAM_UI8, 0 }, |
| 275 | {"mov", 0, PARAM_BH, PARAM_UI8, 0 }, |
| 276 | {"mov", 0, PARAM_AW, PARAM_IMM, 0 }, |
| 277 | {"mov", 0, PARAM_CW, PARAM_IMM, 0 }, |
| 278 | {"mov", 0, PARAM_DW, PARAM_IMM, 0 }, |
| 279 | {"mov", 0, PARAM_BW, PARAM_IMM, 0 }, |
| 280 | {"mov", 0, PARAM_SP, PARAM_IMM, 0 }, |
| 281 | {"mov", 0, PARAM_BP, PARAM_IMM, 0 }, |
| 282 | {"mov", 0, PARAM_IX, PARAM_IMM, 0 }, |
| 283 | {"mov", 0, PARAM_IY, PARAM_IMM, 0 }, |
| 284 | // 0xc0 |
| 285 | {"shiftbi", GROUP, 0, 0, 0 }, |
| 286 | {"shiftwi", GROUP, 0, 0, 0 }, |
| 287 | {"ret", 0, PARAM_I16, 0, 0, DASMFLAG_STEP_OUT}, |
| 288 | {"ret", 0, 0, 0, 0, DASMFLAG_STEP_OUT}, |
| 289 | {"mov ds1,", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 290 | {"mov ds0,", MODRM, PARAM_REG16, PARAM_RM16, 0 }, |
| 291 | {"mov", MODRM, PARAM_RM8, PARAM_UI8, 0 }, |
| 292 | {"mov", MODRM, PARAM_RM16, PARAM_IMM, 0 }, |
| 293 | {"prepare", 0, PARAM_I16, PARAM_UI8, 0 }, |
| 294 | {"dispose", 0, 0, 0, 0 }, |
| 295 | {"retf", 0, PARAM_I16, 0, 0, DASMFLAG_STEP_OUT}, |
| 296 | {"retf", 0, 0, 0, 0, DASMFLAG_STEP_OUT}, |
| 297 | {"brk 3", 0, 0, 0, 0, DASMFLAG_STEP_OVER}, |
| 298 | {"brk", 0, PARAM_UI8, 0, 0, DASMFLAG_STEP_OVER}, |
| 299 | {"brkv", 0, 0, 0, 0 }, |
| 300 | {"reti", 0, 0, 0, 0, DASMFLAG_STEP_OUT}, |
| 301 | // 0xd0 |
| 302 | {"shiftb", GROUP, 0, 0, 0 }, |
| 303 | {"shiftw", GROUP, 0, 0, 0 }, |
| 304 | {"shiftbv", GROUP, 0, 0, 0 }, |
| 305 | {"shiftwv", GROUP, 0, 0, 0 }, |
| 306 | {"cvtbd", 0, PARAM_I8, 0, 0 }, |
| 307 | {"cvtdb", 0, PARAM_I8, 0, 0 }, |
| 308 | {"???", 0, 0, 0, 0 }, |
| 309 | {"trans", 0, 0, 0, 0 }, |
| 310 | {"escape", FPU, 0, 0, 0 }, |
| 311 | {"escape", FPU, 0, 0, 0 }, |
| 312 | {"escape", FPU, 0, 0, 0 }, |
| 313 | {"escape", FPU, 0, 0, 0 }, |
| 314 | {"escape", FPU, 0, 0, 0 }, |
| 315 | {"escape", FPU, 0, 0, 0 }, |
| 316 | {"escape", FPU, 0, 0, 0 }, |
| 317 | {"escape", FPU, 0, 0, 0 }, |
| 318 | // 0xe0 |
| 319 | {"dbnzne", 0, PARAM_REL8, 0, 0, DASMFLAG_STEP_OVER}, |
| 320 | {"dbnze", 0, PARAM_REL8, 0, 0, DASMFLAG_STEP_OVER}, |
| 321 | {"dbnz", 0, PARAM_REL8, 0, 0, DASMFLAG_STEP_OVER}, |
| 322 | {"bcwz", 0, PARAM_REL8, 0, 0 }, |
| 323 | {"in", 0, PARAM_AL, PARAM_UI8, 0 }, |
| 324 | {"in", 0, PARAM_AW, PARAM_UI8, 0 }, |
| 325 | {"out", 0, PARAM_UI8, PARAM_AL, 0 }, |
| 326 | {"out", 0, PARAM_UI8, PARAM_AW, 0 }, |
| 327 | {"call", 0, PARAM_REL16, 0, 0, DASMFLAG_STEP_OVER}, |
| 328 | {"br", 0, PARAM_REL16, 0, 0 }, |
| 329 | {"br", 0, PARAM_ADDR, 0, 0 }, |
| 330 | {"br", 0, PARAM_REL8, 0, 0 }, |
| 331 | {"in", 0, PARAM_AL, PARAM_DW, 0 }, |
| 332 | {"in", 0, PARAM_AW, PARAM_DW, 0 }, |
| 333 | {"out", 0, PARAM_DW, PARAM_AL, 0 }, |
| 334 | {"out", 0, PARAM_DW, PARAM_AW, 0 }, |
| 335 | // 0xf0 |
| 336 | {"buslock", PREFIX, 0, 0, 0 }, |
| 337 | {"brks", 0, 0, 0, 0 }, /* break into secure mode */ |
| 338 | {"repne", PREFIX, 0, 0, 0 }, |
| 339 | {"rep", PREFIX, 0, 0, 0 }, |
| 340 | {"halt", 0, 0, 0, 0 }, |
| 341 | {"not1 cy", 0, 0, 0, 0 }, |
| 342 | {"group1b", GROUP, 0, 0, 0 }, |
| 343 | {"group1w", GROUP, 0, 0, 0 }, |
| 344 | {"clr1 cy", 0, 0, 0, 0 }, |
| 345 | {"set1 cy", 0, 0, 0, 0 }, |
| 346 | {"di", 0, 0, 0, 0 }, |
| 347 | {"ei", 0, 0, 0, 0 }, |
| 348 | {"clr1 dir", 0, 0, 0, 0 }, |
| 349 | {"set1 dir", 0, 0, 0, 0 }, |
| 350 | {"group2b", GROUP, 0, 0, 0 }, |
| 351 | {"group2w", GROUP, 0, 0, 0 } |
| 352 | }; |
| 353 | |
| 354 | static const I386_OPCODE necv_opcode_table2[256] = |
| 355 | { |
| 356 | // 0x00 |
| 357 | {"???", 0, 0, 0, 0 }, |
| 358 | {"???", 0, 0, 0, 0 }, |
| 359 | {"???", 0, 0, 0, 0 }, |
| 360 | {"???", 0, 0, 0, 0 }, |
| 361 | {"???", 0, 0, 0, 0 }, |
| 362 | {"???", 0, 0, 0, 0 }, |
| 363 | {"???", 0, 0, 0, 0 }, |
| 364 | {"???", 0, 0, 0, 0 }, |
| 365 | {"???", 0, 0, 0, 0 }, |
| 366 | {"???", 0, 0, 0, 0 }, |
| 367 | {"???", 0, 0, 0, 0 }, |
| 368 | {"???", 0, 0, 0, 0 }, |
| 369 | {"???", 0, 0, 0, 0 }, |
| 370 | {"???", 0, 0, 0, 0 }, |
| 371 | {"???", 0, 0, 0, 0 }, |
| 372 | {"???", 0, 0, 0, 0 }, |
| 373 | // 0x10 - NEC V series only |
| 374 | {"test1", MODRM, PARAM_RM8, PARAM_1, 0 }, |
| 375 | {"test1", MODRM, PARAM_RM16, PARAM_1, 0 }, |
| 376 | {"clr1", MODRM, PARAM_RM8, PARAM_1, 0 }, |
| 377 | {"clr1", MODRM, PARAM_RM16, PARAM_1, 0 }, |
| 378 | {"set1", MODRM, PARAM_RM8, PARAM_1, 0 }, |
| 379 | {"set1", MODRM, PARAM_RM16, PARAM_1, 0 }, |
| 380 | {"not1", MODRM, PARAM_RM8, PARAM_1, 0 }, |
| 381 | {"not1", MODRM, PARAM_RM16, PARAM_1, 0 }, |
| 382 | {"test1", MODRM, PARAM_RM8, PARAM_I8, 0 }, |
| 383 | {"test1", MODRM, PARAM_RM16, PARAM_I8, 0 }, |
| 384 | {"clr1", MODRM, PARAM_RM8, PARAM_I8, 0 }, |
| 385 | {"clr1", MODRM, PARAM_RM16, PARAM_I8, 0 }, |
| 386 | {"set1", MODRM, PARAM_RM8, PARAM_I8, 0 }, |
| 387 | {"set1", MODRM, PARAM_RM16, PARAM_I8, 0 }, |
| 388 | {"not1", MODRM, PARAM_RM8, PARAM_I8, 0 }, |
| 389 | {"not1", MODRM, PARAM_RM16, PARAM_I8, 0 }, |
| 390 | // 0x20 |
| 391 | {"add4s", 0, 0, 0, 0 }, |
| 392 | {"???", 0, 0, 0, 0 }, |
| 393 | {"sub4s", 0, 0, 0, 0 }, |
| 394 | {"???", 0, 0, 0, 0 }, |
| 395 | {"???", 0, 0, 0, 0 }, |
| 396 | {"movspa", 0, 0, 0, 0 }, /* V25/35 only */ |
| 397 | {"cmp4s", 0, 0, 0, 0 }, |
| 398 | {"???", 0, 0, 0, 0 }, |
| 399 | {"rol4", MODRM, PARAM_RM8, 0, 0 }, |
| 400 | {"???", 0, 0, 0, 0 }, |
| 401 | {"ror4", MODRM, PARAM_RM8, 0, 0 }, |
| 402 | {"???", 0, 0, 0, 0 }, |
| 403 | {"???", 0, 0, 0, 0 }, |
| 404 | {"brkcs", MODRM, PARAM_REG2_8, 0, 0 }, /* V25/35 only */ |
| 405 | {"???", 0, 0, 0, 0 }, |
| 406 | {"???", 0, 0, 0, 0 }, |
| 407 | // 0x30 |
| 408 | {"???", 0, 0, 0, 0 }, |
| 409 | {"ins", MODRM, PARAM_REG2_8, PARAM_REG8, 0 }, |
| 410 | {"???", 0, 0, 0, 0 }, |
| 411 | {"ext", MODRM, PARAM_REG2_8, PARAM_REG8, 0 }, |
| 412 | {"???", 0, 0, 0, 0 }, |
| 413 | {"???", 0, 0, 0, 0 }, |
| 414 | {"???", 0, 0, 0, 0 }, |
| 415 | {"???", 0, 0, 0, 0 }, |
| 416 | {"???", 0, 0, 0, 0 }, |
| 417 | {"ins", MODRM, PARAM_REG2_8, PARAM_I4, 0 }, |
| 418 | {"???", 0, 0, 0, 0 }, |
| 419 | {"ext", MODRM, PARAM_REG2_8, PARAM_I4, 0 }, |
| 420 | {"???", 0, 0, 0, 0 }, |
| 421 | {"???", 0, 0, 0, 0 }, |
| 422 | {"???", 0, 0, 0, 0 }, |
| 423 | {"???", 0, 0, 0, 0 }, |
| 424 | // 0x40 |
| 425 | {"???", 0, 0, 0, 0 }, |
| 426 | {"???", 0, 0, 0, 0 }, |
| 427 | {"???", 0, 0, 0, 0 }, |
| 428 | {"???", 0, 0, 0, 0 }, |
| 429 | {"???", 0, 0, 0, 0 }, |
| 430 | {"???", 0, 0, 0, 0 }, |
| 431 | {"???", 0, 0, 0, 0 }, |
| 432 | {"???", 0, 0, 0, 0 }, |
| 433 | {"???", 0, 0, 0, 0 }, |
| 434 | {"???", 0, 0, 0, 0 }, |
| 435 | {"???", 0, 0, 0, 0 }, |
| 436 | {"???", 0, 0, 0, 0 }, |
| 437 | {"???", 0, 0, 0, 0 }, |
| 438 | {"???", 0, 0, 0, 0 }, |
| 439 | {"???", 0, 0, 0, 0 }, |
| 440 | {"???", 0, 0, 0, 0 }, |
| 441 | // 0x50 |
| 442 | {"???", 0, 0, 0, 0 }, |
| 443 | {"???", 0, 0, 0, 0 }, |
| 444 | {"???", 0, 0, 0, 0 }, |
| 445 | {"???", 0, 0, 0, 0 }, |
| 446 | {"???", 0, 0, 0, 0 }, |
| 447 | {"???", 0, 0, 0, 0 }, |
| 448 | {"???", 0, 0, 0, 0 }, |
| 449 | {"???", 0, 0, 0, 0 }, |
| 450 | {"???", 0, 0, 0, 0 }, |
| 451 | {"???", 0, 0, 0, 0 }, |
| 452 | {"???", 0, 0, 0, 0 }, |
| 453 | {"???", 0, 0, 0, 0 }, |
| 454 | {"???", 0, 0, 0, 0 }, |
| 455 | {"???", 0, 0, 0, 0 }, |
| 456 | {"???", 0, 0, 0, 0 }, |
| 457 | {"???", 0, 0, 0, 0 }, |
| 458 | // 0x60 |
| 459 | {"???", 0, 0, 0, 0 }, |
| 460 | {"???", 0, 0, 0, 0 }, |
| 461 | {"???", 0, 0, 0, 0 }, |
| 462 | {"???", 0, 0, 0, 0 }, |
| 463 | {"???", 0, 0, 0, 0 }, |
| 464 | {"???", 0, 0, 0, 0 }, |
| 465 | {"???", 0, 0, 0, 0 }, |
| 466 | {"???", 0, 0, 0, 0 }, |
| 467 | {"???", 0, 0, 0, 0 }, |
| 468 | {"???", 0, 0, 0, 0 }, |
| 469 | {"???", 0, 0, 0, 0 }, |
| 470 | {"???", 0, 0, 0, 0 }, |
| 471 | {"???", 0, 0, 0, 0 }, |
| 472 | {"???", 0, 0, 0, 0 }, |
| 473 | {"???", 0, 0, 0, 0 }, |
| 474 | {"???", 0, 0, 0, 0 }, |
| 475 | // 0x70 |
| 476 | {"???", 0, 0, 0, 0 }, |
| 477 | {"???", 0, 0, 0, 0 }, |
| 478 | {"???", 0, 0, 0, 0 }, |
| 479 | {"???", 0, 0, 0, 0 }, |
| 480 | {"???", 0, 0, 0, 0 }, |
| 481 | {"???", 0, 0, 0, 0 }, |
| 482 | {"???", 0, 0, 0, 0 }, |
| 483 | {"???", 0, 0, 0, 0 }, |
| 484 | {"???", 0, 0, 0, 0 }, |
| 485 | {"???", 0, 0, 0, 0 }, |
| 486 | {"???", 0, 0, 0, 0 }, |
| 487 | {"???", 0, 0, 0, 0 }, |
| 488 | {"???", 0, 0, 0, 0 }, |
| 489 | {"???", 0, 0, 0, 0 }, |
| 490 | {"???", 0, 0, 0, 0 }, |
| 491 | {"???", 0, 0, 0, 0 }, |
| 492 | // 0x80 |
| 493 | {"???", 0, 0, 0, 0 }, |
| 494 | {"???", 0, 0, 0, 0 }, |
| 495 | {"???", 0, 0, 0, 0 }, |
| 496 | {"???", 0, 0, 0, 0 }, |
| 497 | {"???", 0, 0, 0, 0 }, |
| 498 | {"???", 0, 0, 0, 0 }, |
| 499 | {"???", 0, 0, 0, 0 }, |
| 500 | {"???", 0, 0, 0, 0 }, |
| 501 | {"???", 0, 0, 0, 0 }, |
| 502 | {"???", 0, 0, 0, 0 }, |
| 503 | {"???", 0, 0, 0, 0 }, |
| 504 | {"???", 0, 0, 0, 0 }, |
| 505 | {"???", 0, 0, 0, 0 }, |
| 506 | {"???", 0, 0, 0, 0 }, |
| 507 | {"???", 0, 0, 0, 0 }, |
| 508 | {"???", 0, 0, 0, 0 }, |
| 509 | // 0x90 |
| 510 | {"???", 0, 0, 0, 0 }, |
| 511 | {"retrbi", 0, 0, 0, 0 }, /* V25/35 only */ |
| 512 | {"fint", 0, 0, 0, 0 }, /* V25/35 only */ |
| 513 | {"???", 0, 0, 0, 0 }, |
| 514 | {"tsksw", MODRM, PARAM_REG2_8, 0, 0 }, /* V25/35 only */ |
| 515 | {"movspb", 0, PARAM_RBANK, 0, 0 }, /* V25/35 only */ |
| 516 | {"???", 0, 0, 0, 0 }, |
| 517 | {"???", 0, 0, 0, 0 }, |
| 518 | {"???", 0, 0, 0, 0 }, |
| 519 | {"???", 0, 0, 0, 0 }, |
| 520 | {"???", 0, 0, 0, 0 }, |
| 521 | {"???", 0, 0, 0, 0 }, |
| 522 | {"btclr", MODRM, PARAM_REG2_8, PARAM_I8, PARAM_REL8 }, /* V25/35 only */ |
| 523 | {"???", 0, 0, 0, 0 }, |
| 524 | {"stop", 0, 0, 0, 0 }, /* V25/35 only */ |
| 525 | {"???", 0, 0, 0, 0 }, |
| 526 | // 0xa0 |
| 527 | {"???", 0, 0, 0, 0 }, |
| 528 | {"???", 0, 0, 0, 0 }, |
| 529 | {"???", 0, 0, 0, 0 }, |
| 530 | {"???", 0, 0, 0, 0 }, |
| 531 | {"???", 0, 0, 0, 0 }, |
| 532 | {"???", 0, 0, 0, 0 }, |
| 533 | {"???", 0, 0, 0, 0 }, |
| 534 | {"???", 0, 0, 0, 0 }, |
| 535 | {"???", 0, 0, 0, 0 }, |
| 536 | {"???", 0, 0, 0, 0 }, |
| 537 | {"???", 0, 0, 0, 0 }, |
| 538 | {"???", 0, 0, 0, 0 }, |
| 539 | {"???", 0, 0, 0, 0 }, |
| 540 | {"???", 0, 0, 0, 0 }, |
| 541 | {"???", 0, 0, 0, 0 }, |
| 542 | {"???", 0, 0, 0, 0 }, |
| 543 | // 0xb0 |
| 544 | {"???", 0, 0, 0, 0 }, |
| 545 | {"???", 0, 0, 0, 0 }, |
| 546 | {"???", 0, 0, 0, 0 }, |
| 547 | {"???", 0, 0, 0, 0 }, |
| 548 | {"???", 0, 0, 0, 0 }, |
| 549 | {"???", 0, 0, 0, 0 }, |
| 550 | {"???", 0, 0, 0, 0 }, |
| 551 | {"???", 0, 0, 0, 0 }, |
| 552 | {"???", 0, 0, 0, 0 }, |
| 553 | {"???", 0, 0, 0, 0 }, |
| 554 | {"???", 0, 0, 0, 0 }, |
| 555 | {"???", 0, 0, 0, 0 }, |
| 556 | {"???", 0, 0, 0, 0 }, |
| 557 | {"???", 0, 0, 0, 0 }, |
| 558 | {"???", 0, 0, 0, 0 }, |
| 559 | {"???", 0, 0, 0, 0 }, |
| 560 | // 0xc0 |
| 561 | {"???", 0, 0, 0, 0 }, |
| 562 | {"???", 0, 0, 0, 0 }, |
| 563 | {"???", 0, 0, 0, 0 }, |
| 564 | {"???", 0, 0, 0, 0 }, |
| 565 | {"???", 0, 0, 0, 0 }, |
| 566 | {"???", 0, 0, 0, 0 }, |
| 567 | {"???", 0, 0, 0, 0 }, |
| 568 | {"???", 0, 0, 0, 0 }, |
| 569 | {"???", 0, 0, 0, 0 }, |
| 570 | {"???", 0, 0, 0, 0 }, |
| 571 | {"???", 0, 0, 0, 0 }, |
| 572 | {"???", 0, 0, 0, 0 }, |
| 573 | {"???", 0, 0, 0, 0 }, |
| 574 | {"???", 0, 0, 0, 0 }, |
| 575 | {"???", 0, 0, 0, 0 }, |
| 576 | {"???", 0, 0, 0, 0 }, |
| 577 | // 0xd0 |
| 578 | {"???", 0, 0, 0, 0 }, |
| 579 | {"???", 0, 0, 0, 0 }, |
| 580 | {"???", 0, 0, 0, 0 }, |
| 581 | {"???", 0, 0, 0, 0 }, |
| 582 | {"???", 0, 0, 0, 0 }, |
| 583 | {"???", 0, 0, 0, 0 }, |
| 584 | {"???", 0, 0, 0, 0 }, |
| 585 | {"???", 0, 0, 0, 0 }, |
| 586 | {"???", 0, 0, 0, 0 }, |
| 587 | {"???", 0, 0, 0, 0 }, |
| 588 | {"???", 0, 0, 0, 0 }, |
| 589 | {"???", 0, 0, 0, 0 }, |
| 590 | {"???", 0, 0, 0, 0 }, |
| 591 | {"???", 0, 0, 0, 0 }, |
| 592 | {"???", 0, 0, 0, 0 }, |
| 593 | {"???", 0, 0, 0, 0 }, |
| 594 | // 0xe0 |
| 595 | {"brkxa", 0, PARAM_UI8, 0, 0 }, /* V33,53 only */ |
| 596 | {"???", 0, 0, 0, 0 }, |
| 597 | {"???", 0, 0, 0, 0 }, |
| 598 | {"???", 0, 0, 0, 0 }, |
| 599 | {"???", 0, 0, 0, 0 }, |
| 600 | {"???", 0, 0, 0, 0 }, |
| 601 | {"???", 0, 0, 0, 0 }, |
| 602 | {"???", 0, 0, 0, 0 }, |
| 603 | {"???", 0, 0, 0, 0 }, |
| 604 | {"???", 0, 0, 0, 0 }, |
| 605 | {"???", 0, 0, 0, 0 }, |
| 606 | {"???", 0, 0, 0, 0 }, |
| 607 | {"???", 0, 0, 0, 0 }, |
| 608 | {"???", 0, 0, 0, 0 }, |
| 609 | {"???", 0, 0, 0, 0 }, |
| 610 | {"???", 0, 0, 0, 0 }, |
| 611 | // 0xf0 |
| 612 | {"retxa", 0, PARAM_UI8, 0, 0 }, /* V33,53 only */ |
| 613 | {"???", 0, 0, 0, 0 }, |
| 614 | {"???", 0, 0, 0, 0 }, |
| 615 | {"???", 0, 0, 0, 0 }, |
| 616 | {"???", 0, 0, 0, 0 }, |
| 617 | {"???", 0, 0, 0, 0 }, |
| 618 | {"???", 0, 0, 0, 0 }, |
| 619 | {"???", 0, 0, 0, 0 }, |
| 620 | {"???", 0, 0, 0, 0 }, |
| 621 | {"???", 0, 0, 0, 0 }, |
| 622 | {"???", 0, 0, 0, 0 }, |
| 623 | {"???", 0, 0, 0, 0 }, |
| 624 | {"???", 0, 0, 0, 0 }, |
| 625 | {"???", 0, 0, 0, 0 }, |
| 626 | {"???", 0, 0, 0, 0 }, |
| 627 | {"brkem", 0, PARAM_UI8, 0, 0 } /* V20,30,40,50 only */ |
| 628 | }; |
| 629 | |
| 630 | static const I386_OPCODE immb_table[8] = |
| 631 | { |
| 632 | {"add", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 633 | {"or", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 634 | {"addc", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 635 | {"subc", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 636 | {"and", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 637 | {"sub", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 638 | {"xor", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 639 | {"cmp", 0, PARAM_RM8, PARAM_I8, 0 } |
| 640 | }; |
| 641 | |
| 642 | static const I386_OPCODE immw_table[8] = |
| 643 | { |
| 644 | {"add", 0, PARAM_RM16, PARAM_IMM, 0 }, |
| 645 | {"or", 0, PARAM_RM16, PARAM_IMM, 0 }, |
| 646 | {"addc", 0, PARAM_RM16, PARAM_IMM, 0 }, |
| 647 | {"subc", 0, PARAM_RM16, PARAM_IMM, 0 }, |
| 648 | {"and", 0, PARAM_RM16, PARAM_IMM, 0 }, |
| 649 | {"sub", 0, PARAM_RM16, PARAM_IMM, 0 }, |
| 650 | {"xor", 0, PARAM_RM16, PARAM_IMM, 0 }, |
| 651 | {"cmp", 0, PARAM_RM16, PARAM_IMM, 0 } |
| 652 | }; |
| 653 | |
| 654 | static const I386_OPCODE immws_table[8] = |
| 655 | { |
| 656 | {"add", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 657 | {"or", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 658 | {"addc", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 659 | {"subc", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 660 | {"and", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 661 | {"sub", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 662 | {"xor", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 663 | {"cmp", 0, PARAM_RM16, PARAM_I8, 0 } |
| 664 | }; |
| 665 | |
| 666 | static const I386_OPCODE shiftbi_table[8] = |
| 667 | { |
| 668 | {"rol", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 669 | {"ror", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 670 | {"rolc", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 671 | {"rorc", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 672 | {"shl", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 673 | {"shr", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 674 | {"???", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 675 | {"shra", 0, PARAM_RM8, PARAM_I8, 0 } |
| 676 | }; |
| 677 | |
| 678 | static const I386_OPCODE shiftwi_table[8] = |
| 679 | { |
| 680 | {"rol", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 681 | {"ror", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 682 | {"rolc", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 683 | {"rorc", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 684 | {"shl", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 685 | {"shr", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 686 | {"???", 0, PARAM_RM16, PARAM_I8, 0 }, |
| 687 | {"shra", 0, PARAM_RM16, PARAM_I8, 0 } |
| 688 | }; |
| 689 | |
| 690 | static const I386_OPCODE shiftb_table[8] = |
| 691 | { |
| 692 | {"rol", 0, PARAM_RM8, PARAM_1, 0 }, |
| 693 | {"ror", 0, PARAM_RM8, PARAM_1, 0 }, |
| 694 | {"rolc", 0, PARAM_RM8, PARAM_1, 0 }, |
| 695 | {"rorc", 0, PARAM_RM8, PARAM_1, 0 }, |
| 696 | {"shl", 0, PARAM_RM8, PARAM_1, 0 }, |
| 697 | {"shr", 0, PARAM_RM8, PARAM_1, 0 }, |
| 698 | {"???", 0, PARAM_RM8, PARAM_1, 0 }, |
| 699 | {"shra", 0, PARAM_RM8, PARAM_1, 0 } |
| 700 | }; |
| 701 | |
| 702 | static const I386_OPCODE shiftw_table[8] = |
| 703 | { |
| 704 | {"rol", 0, PARAM_RM16, PARAM_1, 0 }, |
| 705 | {"ror", 0, PARAM_RM16, PARAM_1, 0 }, |
| 706 | {"rolc", 0, PARAM_RM16, PARAM_1, 0 }, |
| 707 | {"rorc", 0, PARAM_RM16, PARAM_1, 0 }, |
| 708 | {"shl", 0, PARAM_RM16, PARAM_1, 0 }, |
| 709 | {"shr", 0, PARAM_RM16, PARAM_1, 0 }, |
| 710 | {"???", 0, PARAM_RM16, PARAM_1, 0 }, |
| 711 | {"shra", 0, PARAM_RM16, PARAM_1, 0 } |
| 712 | }; |
| 713 | |
| 714 | static const I386_OPCODE shiftbv_table[8] = |
| 715 | { |
| 716 | {"rol", 0, PARAM_RM8, PARAM_CL, 0 }, |
| 717 | {"ror", 0, PARAM_RM8, PARAM_CL, 0 }, |
| 718 | {"rolc", 0, PARAM_RM8, PARAM_CL, 0 }, |
| 719 | {"rorc", 0, PARAM_RM8, PARAM_CL, 0 }, |
| 720 | {"shl", 0, PARAM_RM8, PARAM_CL, 0 }, |
| 721 | {"shr", 0, PARAM_RM8, PARAM_CL, 0 }, |
| 722 | {"???", 0, PARAM_RM8, PARAM_CL, 0 }, |
| 723 | {"shra", 0, PARAM_RM8, PARAM_CL, 0 } |
| 724 | }; |
| 725 | |
| 726 | static const I386_OPCODE shiftwv_table[8] = |
| 727 | { |
| 728 | {"rol", 0, PARAM_RM16, PARAM_CL, 0 }, |
| 729 | {"ror", 0, PARAM_RM16, PARAM_CL, 0 }, |
| 730 | {"rolc", 0, PARAM_RM16, PARAM_CL, 0 }, |
| 731 | {"rorc", 0, PARAM_RM16, PARAM_CL, 0 }, |
| 732 | {"shl", 0, PARAM_RM16, PARAM_CL, 0 }, |
| 733 | {"shr", 0, PARAM_RM16, PARAM_CL, 0 }, |
| 734 | {"???", 0, PARAM_RM16, PARAM_CL, 0 }, |
| 735 | {"shra", 0, PARAM_RM16, PARAM_CL, 0 } |
| 736 | }; |
| 737 | |
| 738 | static const I386_OPCODE group1b_table[8] = |
| 739 | { |
| 740 | {"test", 0, PARAM_RM8, PARAM_I8, 0 }, |
| 741 | {"???", 0, 0, 0, 0 }, |
| 742 | {"not", 0, PARAM_RM8, 0, 0 }, |
| 743 | {"neg", 0, PARAM_RM8, 0, 0 }, |
| 744 | {"mulu", 0, PARAM_RM8, 0, 0 }, |
| 745 | {"mul", 0, PARAM_RM8, 0, 0 }, |
| 746 | {"divu", 0, PARAM_RM8, 0, 0 }, |
| 747 | {"div", 0, PARAM_RM8, 0, 0 } |
| 748 | }; |
| 749 | |
| 750 | static const I386_OPCODE group1w_table[8] = |
| 751 | { |
| 752 | {"test", 0, PARAM_RM16, PARAM_IMM, 0 }, |
| 753 | {"???", 0, 0, 0, 0 }, |
| 754 | {"not", 0, PARAM_RM16, 0, 0 }, |
| 755 | {"neg", 0, PARAM_RM16, 0, 0 }, |
| 756 | {"mulu", 0, PARAM_RM16, 0, 0 }, |
| 757 | {"mul", 0, PARAM_RM16, 0, 0 }, |
| 758 | {"divu", 0, PARAM_RM16, 0, 0 }, |
| 759 | {"div", 0, PARAM_RM16, 0, 0 } |
| 760 | }; |
| 761 | |
| 762 | static const I386_OPCODE group2b_table[8] = |
| 763 | { |
| 764 | {"inc", 0, PARAM_RM8, 0, 0 }, |
| 765 | {"dec", 0, PARAM_RM8, 0, 0 }, |
| 766 | {"???", 0, 0, 0, 0 }, |
| 767 | {"???", 0, 0, 0, 0 }, |
| 768 | {"???", 0, 0, 0, 0 }, |
| 769 | {"???", 0, 0, 0, 0 }, |
| 770 | {"???", 0, 0, 0, 0 }, |
| 771 | {"???", 0, 0, 0, 0 } |
| 772 | }; |
| 773 | |
| 774 | static const I386_OPCODE group2w_table[8] = |
| 775 | { |
| 776 | {"inc", 0, PARAM_RM16, 0, 0 }, |
| 777 | {"dec", 0, PARAM_RM16, 0, 0 }, |
| 778 | {"call", 0, PARAM_RM16, 0, 0, DASMFLAG_STEP_OVER}, |
| 779 | {"call far ptr ",0, PARAM_RM16, 0, 0, DASMFLAG_STEP_OVER}, |
| 780 | {"br", 0, PARAM_RM16, 0, 0 }, |
| 781 | {"br far ptr ",0, PARAM_RM16, 0, 0 }, |
| 782 | {"push", 0, PARAM_RM16, 0, 0 }, |
| 783 | {"???", 0, 0, 0, 0 } |
| 784 | }; |
| 785 | |
| 786 | static const GROUP_OP group_op_table[] = |
| 787 | { |
| 788 | { "immb", immb_table }, |
| 789 | { "immw", immw_table }, |
| 790 | { "immws", immws_table }, |
| 791 | { "shiftbi", shiftbi_table }, |
| 792 | { "shiftwi", shiftwi_table }, |
| 793 | { "shiftb", shiftb_table }, |
| 794 | { "shiftw", shiftw_table }, |
| 795 | { "shiftbv", shiftbv_table }, |
| 796 | { "shiftwv", shiftwv_table }, |
| 797 | { "group1b", group1b_table }, |
| 798 | { "group1w", group1w_table }, |
| 799 | { "group2b", group2b_table }, |
| 800 | { "group2w", group2w_table } |
| 801 | }; |
| 802 | |
| 803 | |
| 804 | |
| 805 | static const char *nec_reg[8] = { "aw", "cw", "dw", "bw", "sp", "bp", "ix", "iy" }; |
| 806 | static const char *neg_reg8[8] = { "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh" }; |
| 807 | static const char *nec_sreg[8] = { "ds1", "ps", "ss", "ds0", "???", "???", "???", "???" }; |
| 808 | |
| 809 | static UINT32 pc; |
| 810 | static UINT8 modrm; |
| 811 | static UINT32 segment; |
| 812 | static offs_t dasm_flags; |
| 813 | static char modrm_string[256]; |
| 814 | |
| 815 | #define MODRM_REG1 ((modrm >> 3) & 0x7) |
| 816 | #define MODRM_REG2 (modrm & 0x7) |
| 817 | |
| 818 | INLINE UINT8 FETCH(void) |
| 819 | { |
| 820 | if ((opcode_ptr - opcode_ptr_base) + 1 > 15) |
| 821 | return 0xff; |
| 822 | pc++; |
| 823 | return *opcode_ptr++; |
| 824 | } |
| 825 | |
| 826 | INLINE UINT16 FETCH16(void) |
| 827 | { |
| 828 | UINT16 d; |
| 829 | if ((opcode_ptr - opcode_ptr_base) + 2 > 15) |
| 830 | return 0xffff; |
| 831 | d = opcode_ptr[0] | (opcode_ptr[1] << 8); |
| 832 | opcode_ptr += 2; |
| 833 | pc += 2; |
| 834 | return d; |
| 835 | } |
| 836 | |
| 837 | INLINE UINT8 FETCHD(void) |
| 838 | { |
| 839 | if ((opcode_ptr - opcode_ptr_base) + 1 > 15) |
| 840 | return 0xff; |
| 841 | pc++; |
| 842 | return *opcode_ptr++; |
| 843 | } |
| 844 | |
| 845 | INLINE UINT16 FETCHD16(void) |
| 846 | { |
| 847 | UINT16 d; |
| 848 | if ((opcode_ptr - opcode_ptr_base) + 2 > 15) |
| 849 | return 0xffff; |
| 850 | d = opcode_ptr[0] | (opcode_ptr[1] << 8); |
| 851 | opcode_ptr += 2; |
| 852 | pc += 2; |
| 853 | return d; |
| 854 | } |
| 855 | |
| 856 | static char *hexstring(UINT32 value, int digits) |
| 857 | { |
| 858 | static char buffer[20]; |
| 859 | buffer[0] = '0'; |
| 860 | if (digits) |
| 861 | sprintf(&buffer[1], "%0*Xh", digits, value); |
| 862 | else |
| 863 | sprintf(&buffer[1], "%Xh", value); |
| 864 | return (buffer[1] >= '0' && buffer[1] <= '9') ? &buffer[1] : &buffer[0]; |
| 865 | } |
| 866 | |
| 867 | static char *shexstring(UINT32 value, int digits, int always) |
| 868 | { |
| 869 | static char buffer[20]; |
| 870 | if (value >= 0x80000000) |
| 871 | sprintf(buffer, "-%s", hexstring(-value, digits)); |
| 872 | else if (always) |
| 873 | sprintf(buffer, "+%s", hexstring(value, digits)); |
| 874 | else |
| 875 | return hexstring(value, digits); |
| 876 | return buffer; |
| 877 | } |
| 878 | |
| 879 | static void handle_modrm(char* s) |
| 880 | { |
| 881 | INT8 disp8; |
| 882 | INT16 disp16; |
| 883 | UINT8 mod, rm; |
| 884 | |
| 885 | modrm = FETCHD(); |
| 886 | mod = (modrm >> 6) & 0x3; |
| 887 | rm = (modrm & 0x7); |
| 888 | |
| 889 | if( modrm >= 0xc0 ) |
| 890 | return; |
| 891 | |
| 892 | switch(segment) |
| 893 | { |
| 894 | case SEG_PS: s += sprintf( s, "ps:" ); break; |
| 895 | case SEG_DS0: s += sprintf( s, "ds0:" ); break; |
| 896 | case SEG_DS1: s += sprintf( s, "ds1:" ); break; |
| 897 | case SEG_SS: s += sprintf( s, "ss:" ); break; |
| 898 | } |
| 899 | |
| 900 | s += sprintf( s, "[" ); |
| 901 | switch( rm ) |
| 902 | { |
| 903 | case 0: s += sprintf( s, "bw+ix" ); break; |
| 904 | case 1: s += sprintf( s, "bw+iy" ); break; |
| 905 | case 2: s += sprintf( s, "bw+ix" ); break; |
| 906 | case 3: s += sprintf( s, "bw+iy" ); break; |
| 907 | case 4: s += sprintf( s, "ix" ); break; |
| 908 | case 5: s += sprintf( s, "iy" ); break; |
| 909 | case 6: |
| 910 | if( mod == 0 ) { |
| 911 | disp16 = FETCHD16(); |
| 912 | s += sprintf( s, "%s", hexstring((unsigned) (UINT16) disp16, 0) ); |
| 913 | } else { |
| 914 | s += sprintf( s, "bp" ); |
| 915 | } |
| 916 | break; |
| 917 | case 7: s += sprintf( s, "bw" ); break; |
| 918 | } |
| 919 | if( mod == 1 ) { |
| 920 | disp8 = FETCHD(); |
| 921 | s += sprintf( s, "%s", shexstring((INT32)disp8, 0, TRUE) ); |
| 922 | } else if( mod == 2 ) { |
| 923 | disp16 = FETCHD16(); |
| 924 | s += sprintf( s, "%s", shexstring((INT32)disp16, 0, TRUE) ); |
| 925 | } |
| 926 | s += sprintf( s, "]" ); |
| 927 | } |
| 928 | |
| 929 | static char* handle_param(char* s, UINT32 param) |
| 930 | { |
| 931 | UINT8 i8; |
| 932 | UINT16 i16; |
| 933 | UINT16 ptr; |
| 934 | UINT32 addr; |
| 935 | INT8 d8; |
| 936 | INT16 d16; |
| 937 | |
| 938 | switch(param) |
| 939 | { |
| 940 | case PARAM_REG8: |
| 941 | s += sprintf( s, "%s", neg_reg8[MODRM_REG1] ); |
| 942 | break; |
| 943 | |
| 944 | case PARAM_REG16: |
| 945 | s += sprintf( s, "%s", nec_reg[MODRM_REG1] ); |
| 946 | break; |
| 947 | |
| 948 | case PARAM_REG2_8: |
| 949 | s += sprintf( s, "%s", neg_reg8[MODRM_REG2] ); |
| 950 | break; |
| 951 | |
| 952 | case PARAM_REG2_16: |
| 953 | s += sprintf( s, "%s", nec_reg[MODRM_REG2] ); |
| 954 | break; |
| 955 | |
| 956 | case PARAM_RM8: |
| 957 | if( modrm >= 0xc0 ) { |
| 958 | s += sprintf( s, "%s", neg_reg8[MODRM_REG2] ); |
| 959 | } else { |
| 960 | s += sprintf( s, "byte ptr " ); |
| 961 | s += sprintf( s, "%s", modrm_string ); |
| 962 | } |
| 963 | break; |
| 964 | |
| 965 | case PARAM_RM16: |
| 966 | if( modrm >= 0xc0 ) { |
| 967 | s += sprintf( s, "%s", nec_reg[MODRM_REG2] ); |
| 968 | } else { |
| 969 | s += sprintf( s, "word ptr " ); |
| 970 | s += sprintf( s, "%s", modrm_string ); |
| 971 | } |
| 972 | break; |
| 973 | |
| 974 | case PARAM_I4: |
| 975 | i8 = FETCHD(); |
| 976 | s += sprintf( s, "%d", i8 & 0x0f ); |
| 977 | break; |
| 978 | |
| 979 | case PARAM_I8: |
| 980 | i8 = FETCHD(); |
| 981 | s += sprintf( s, "%s", shexstring((INT8)i8, 0, FALSE) ); |
| 982 | break; |
| 983 | |
| 984 | case PARAM_I16: |
| 985 | i16 = FETCHD16(); |
| 986 | s += sprintf( s, "%s", shexstring((INT16)i16, 0, FALSE) ); |
| 987 | break; |
| 988 | |
| 989 | case PARAM_UI8: |
| 990 | i8 = FETCHD(); |
| 991 | s += sprintf( s, "%s", shexstring((UINT8)i8, 0, FALSE) ); |
| 992 | break; |
| 993 | |
| 994 | case PARAM_UI16: |
| 995 | i16 = FETCHD16(); |
| 996 | s += sprintf( s, "%s", shexstring((UINT16)i16, 0, FALSE) ); |
| 997 | break; |
| 998 | |
| 999 | case PARAM_IMM: |
| 1000 | i16 = FETCHD16(); |
| 1001 | s += sprintf( s, "%s", hexstring(i16, 0) ); |
| 1002 | break; |
| 1003 | |
| 1004 | case PARAM_ADDR: |
| 1005 | addr = FETCHD16(); |
| 1006 | ptr = FETCHD16(); |
| 1007 | s += sprintf( s, "%s:", hexstring(ptr, 4) ); |
| 1008 | s += sprintf( s, "%s", hexstring(addr, 0) ); |
| 1009 | break; |
| 1010 | |
| 1011 | case PARAM_REL16: |
| 1012 | /* make sure to keep the relative offset within the segment */ |
| 1013 | d16 = FETCHD16(); |
| 1014 | s += sprintf( s, "%s", hexstring((pc & 0xFFFF0000) | ((pc + d16) & 0x0000FFFF), 0) ); |
| 1015 | break; |
| 1016 | |
| 1017 | case PARAM_REL8: |
| 1018 | d8 = FETCHD(); |
| 1019 | s += sprintf( s, "%s", hexstring(pc + d8, 0) ); |
| 1020 | break; |
| 1021 | |
| 1022 | case PARAM_MEM_OFFS_B: |
| 1023 | d8 = FETCHD(); |
| 1024 | s += sprintf( s, "[%s]", hexstring(d8, 0) ); |
| 1025 | break; |
| 1026 | |
| 1027 | case PARAM_MEM_OFFS_W: |
| 1028 | d16 = FETCHD16(); |
| 1029 | s += sprintf( s, "[%s]", hexstring(d16, 0) ); |
| 1030 | break; |
| 1031 | |
| 1032 | case PARAM_SREG: |
| 1033 | s += sprintf( s, "%s", nec_sreg[MODRM_REG1] ); |
| 1034 | break; |
| 1035 | |
| 1036 | case PARAM_1: |
| 1037 | s += sprintf( s, "1" ); |
| 1038 | break; |
| 1039 | |
| 1040 | case PARAM_RBANK: |
| 1041 | s += sprintf( s, "%d", FETCHD() & 7 ); |
| 1042 | break; |
| 1043 | |
| 1044 | case PARAM_AL: s += sprintf( s, "al" ); break; |
| 1045 | case PARAM_CL: s += sprintf( s, "cl" ); break; |
| 1046 | case PARAM_DL: s += sprintf( s, "dl" ); break; |
| 1047 | case PARAM_BL: s += sprintf( s, "bl" ); break; |
| 1048 | case PARAM_AH: s += sprintf( s, "ah" ); break; |
| 1049 | case PARAM_CH: s += sprintf( s, "ch" ); break; |
| 1050 | case PARAM_DH: s += sprintf( s, "dh" ); break; |
| 1051 | case PARAM_BH: s += sprintf( s, "bh" ); break; |
| 1052 | |
| 1053 | case PARAM_AW: s += sprintf( s, "aw" ); break; |
| 1054 | case PARAM_CW: s += sprintf( s, "cw" ); break; |
| 1055 | case PARAM_DW: s += sprintf( s, "dw" ); break; |
| 1056 | case PARAM_BW: s += sprintf( s, "bw" ); break; |
| 1057 | case PARAM_SP: s += sprintf( s, "sp" ); break; |
| 1058 | case PARAM_BP: s += sprintf( s, "bp" ); break; |
| 1059 | case PARAM_IX: s += sprintf( s, "ix" ); break; |
| 1060 | case PARAM_IY: s += sprintf( s, "iy" ); break; |
| 1061 | } |
| 1062 | return s; |
| 1063 | } |
| 1064 | |
| 1065 | static void handle_fpu(char *s, UINT8 op1, UINT8 op2) |
| 1066 | { |
| 1067 | switch (op1 & 0x7) |
| 1068 | { |
| 1069 | case 0: // Group D8 |
| 1070 | { |
| 1071 | if (op2 < 0xc0) |
| 1072 | { |
| 1073 | pc--; // adjust fetch pointer, so modrm byte read again |
| 1074 | opcode_ptr--; |
| 1075 | handle_modrm( modrm_string ); |
| 1076 | switch ((op2 >> 3) & 0x7) |
| 1077 | { |
| 1078 | case 0: sprintf(s, "fadd dword ptr %s", modrm_string); break; |
| 1079 | case 1: sprintf(s, "fmul dword ptr %s", modrm_string); break; |
| 1080 | case 2: sprintf(s, "fcom dword ptr %s", modrm_string); break; |
| 1081 | case 3: sprintf(s, "fcomp dword ptr %s", modrm_string); break; |
| 1082 | case 4: sprintf(s, "fsub dword ptr %s", modrm_string); break; |
| 1083 | case 5: sprintf(s, "fsubr dword ptr %s", modrm_string); break; |
| 1084 | case 6: sprintf(s, "fdiv dword ptr %s", modrm_string); break; |
| 1085 | case 7: sprintf(s, "fdivr dword ptr %s", modrm_string); break; |
| 1086 | } |
| 1087 | } |
| 1088 | else |
| 1089 | { |
| 1090 | switch ((op2 >> 3) & 0x7) |
| 1091 | { |
| 1092 | case 0: sprintf(s, "fadd st(0),st(%d)", op2 & 0x7); break; |
| 1093 | case 1: sprintf(s, "fcom st(0),st(%d)", op2 & 0x7); break; |
| 1094 | case 2: sprintf(s, "fsub st(0),st(%d)", op2 & 0x7); break; |
| 1095 | case 3: sprintf(s, "fdiv st(0),st(%d)", op2 & 0x7); break; |
| 1096 | case 4: sprintf(s, "fmul st(0),st(%d)", op2 & 0x7); break; |
| 1097 | case 5: sprintf(s, "fcomp st(0),st(%d)", op2 & 0x7); break; |
| 1098 | case 6: sprintf(s, "fsubr st(0),st(%d)", op2 & 0x7); break; |
| 1099 | case 7: sprintf(s, "fdivr st(0),st(%d)", op2 & 0x7); break; |
| 1100 | } |
| 1101 | } |
| 1102 | break; |
| 1103 | } |
| 1104 | |
| 1105 | case 1: // Group D9 |
| 1106 | { |
| 1107 | if (op2 < 0xc0) |
| 1108 | { |
| 1109 | pc--; // adjust fetch pointer, so modrm byte read again |
| 1110 | opcode_ptr--; |
| 1111 | handle_modrm( modrm_string ); |
| 1112 | switch ((op2 >> 3) & 0x7) |
| 1113 | { |
| 1114 | case 0: sprintf(s, "fld dword ptr %s", modrm_string); break; |
| 1115 | case 1: sprintf(s, "??? (FPU)"); break; |
| 1116 | case 2: sprintf(s, "fst dword ptr %s", modrm_string); break; |
| 1117 | case 3: sprintf(s, "fstp dword ptr %s", modrm_string); break; |
| 1118 | case 4: sprintf(s, "fldenv word ptr %s", modrm_string); break; |
| 1119 | case 5: sprintf(s, "fldcw word ptr %s", modrm_string); break; |
| 1120 | case 6: sprintf(s, "fstenv word ptr %s", modrm_string); break; |
| 1121 | case 7: sprintf(s, "fstcw word ptr %s", modrm_string); break; |
| 1122 | } |
| 1123 | } |
| 1124 | else |
| 1125 | { |
| 1126 | switch (op2 & 0x3f) |
| 1127 | { |
| 1128 | case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: |
| 1129 | sprintf(s, "fld st(0),st(%d)", op2 & 0x7); break; |
| 1130 | |
| 1131 | case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: |
| 1132 | sprintf(s, "fxch st(0),st(%d)", op2 & 0x7); break; |
| 1133 | |
| 1134 | case 0x10: sprintf(s, "fnop"); break; |
| 1135 | case 0x20: sprintf(s, "fchs"); break; |
| 1136 | case 0x21: sprintf(s, "fabs"); break; |
| 1137 | case 0x24: sprintf(s, "ftst"); break; |
| 1138 | case 0x25: sprintf(s, "fxam"); break; |
| 1139 | case 0x28: sprintf(s, "fld1"); break; |
| 1140 | case 0x29: sprintf(s, "fldl2t"); break; |
| 1141 | case 0x2a: sprintf(s, "fldl2e"); break; |
| 1142 | case 0x2b: sprintf(s, "fldpi"); break; |
| 1143 | case 0x2c: sprintf(s, "fldlg2"); break; |
| 1144 | case 0x2d: sprintf(s, "fldln2"); break; |
| 1145 | case 0x2e: sprintf(s, "fldz"); break; |
| 1146 | case 0x30: sprintf(s, "f2xm1"); break; |
| 1147 | case 0x31: sprintf(s, "fyl2x"); break; |
| 1148 | case 0x32: sprintf(s, "fptan"); break; |
| 1149 | case 0x33: sprintf(s, "fpatan"); break; |
| 1150 | case 0x34: sprintf(s, "fxtract"); break; |
| 1151 | case 0x35: sprintf(s, "fprem1"); break; |
| 1152 | case 0x36: sprintf(s, "fdecstp"); break; |
| 1153 | case 0x37: sprintf(s, "fincstp"); break; |
| 1154 | case 0x38: sprintf(s, "fprem"); break; |
| 1155 | case 0x39: sprintf(s, "fyl2xp1"); break; |
| 1156 | case 0x3a: sprintf(s, "fsqrt"); break; |
| 1157 | case 0x3b: sprintf(s, "fsincos"); break; |
| 1158 | case 0x3c: sprintf(s, "frndint"); break; |
| 1159 | case 0x3d: sprintf(s, "fscale"); break; |
| 1160 | case 0x3e: sprintf(s, "fsin"); break; |
| 1161 | case 0x3f: sprintf(s, "fcos"); break; |
| 1162 | |
| 1163 | default: sprintf(s, "??? (FPU)"); break; |
| 1164 | } |
| 1165 | } |
| 1166 | break; |
| 1167 | } |
| 1168 | |
| 1169 | case 2: // Group DA |
| 1170 | { |
| 1171 | if (op2 < 0xc0) |
| 1172 | { |
| 1173 | pc--; // adjust fetch pointer, so modrm byte read again |
| 1174 | opcode_ptr--; |
| 1175 | handle_modrm( modrm_string ); |
| 1176 | switch ((op2 >> 3) & 0x7) |
| 1177 | { |
| 1178 | case 0: sprintf(s, "fiadd dword ptr %s", modrm_string); break; |
| 1179 | case 1: sprintf(s, "fimul dword ptr %s", modrm_string); break; |
| 1180 | case 2: sprintf(s, "ficom dword ptr %s", modrm_string); break; |
| 1181 | case 3: sprintf(s, "ficomp dword ptr %s", modrm_string); break; |
| 1182 | case 4: sprintf(s, "fisub dword ptr %s", modrm_string); break; |
| 1183 | case 5: sprintf(s, "fisubr dword ptr %s", modrm_string); break; |
| 1184 | case 6: sprintf(s, "fidiv dword ptr %s", modrm_string); break; |
| 1185 | case 7: sprintf(s, "fidivr dword ptr %s", modrm_string); break; |
| 1186 | } |
| 1187 | } |
| 1188 | else |
| 1189 | { |
| 1190 | switch (op2 & 0x3f) |
| 1191 | { |
| 1192 | case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: |
| 1193 | sprintf(s, "fcmovb st(0),st(%d)", op2 & 0x7); break; |
| 1194 | |
| 1195 | case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: |
| 1196 | sprintf(s, "fcmove st(0),st(%d)", op2 & 0x7); break; |
| 1197 | |
| 1198 | case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: |
| 1199 | sprintf(s, "fcmovbe st(0),st(%d)", op2 & 0x7); break; |
| 1200 | |
| 1201 | case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: |
| 1202 | sprintf(s, "fcmovu st(0),st(%d)", op2 & 0x7); break; |
| 1203 | |
| 1204 | default: sprintf(s, "??? (FPU)"); break; |
| 1205 | |
| 1206 | } |
| 1207 | } |
| 1208 | break; |
| 1209 | } |
| 1210 | |
| 1211 | case 3: // Group DB |
| 1212 | { |
| 1213 | if (op2 < 0xc0) |
| 1214 | { |
| 1215 | pc--; // adjust fetch pointer, so modrm byte read again |
| 1216 | opcode_ptr--; |
| 1217 | handle_modrm( modrm_string ); |
| 1218 | switch ((op2 >> 3) & 0x7) |
| 1219 | { |
| 1220 | case 0: sprintf(s, "fild dword ptr %s", modrm_string); break; |
| 1221 | case 1: sprintf(s, "??? (FPU)"); break; |
| 1222 | case 2: sprintf(s, "fist dword ptr %s", modrm_string); break; |
| 1223 | case 3: sprintf(s, "fistp dword ptr %s", modrm_string); break; |
| 1224 | case 4: sprintf(s, "??? (FPU)"); break; |
| 1225 | case 5: sprintf(s, "fld tword ptr %s", modrm_string); break; |
| 1226 | case 6: sprintf(s, "??? (FPU)"); break; |
| 1227 | case 7: sprintf(s, "fstp tword ptr %s", modrm_string); break; |
| 1228 | } |
| 1229 | } |
| 1230 | else |
| 1231 | { |
| 1232 | switch (op2 & 0x3f) |
| 1233 | { |
| 1234 | case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: |
| 1235 | sprintf(s, "fcmovnb st(0),st(%d)", op2 & 0x7); break; |
| 1236 | |
| 1237 | case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: |
| 1238 | sprintf(s, "fcmovne st(0),st(%d)", op2 & 0x7); break; |
| 1239 | |
| 1240 | case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: |
| 1241 | sprintf(s, "fcmovnbe st(0),st(%d)", op2 & 0x7); break; |
| 1242 | |
| 1243 | case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: |
| 1244 | sprintf(s, "fcmovnu st(0),st(%d)", op2 & 0x7); break; |
| 1245 | |
| 1246 | case 0x22: sprintf(s, "fclex"); break; |
| 1247 | case 0x23: sprintf(s, "finit"); break; |
| 1248 | |
| 1249 | case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: |
| 1250 | sprintf(s, "fucomi st(0),st(%d)", op2 & 0x7); break; |
| 1251 | |
| 1252 | case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: |
| 1253 | sprintf(s, "fcomi st(0),st(%d)", op2 & 0x7); break; |
| 1254 | |
| 1255 | default: sprintf(s, "??? (FPU)"); break; |
| 1256 | } |
| 1257 | } |
| 1258 | break; |
| 1259 | } |
| 1260 | |
| 1261 | case 4: // Group DC |
| 1262 | { |
| 1263 | if (op2 < 0xc0) |
| 1264 | { |
| 1265 | pc--; // adjust fetch pointer, so modrm byte read again |
| 1266 | opcode_ptr--; |
| 1267 | handle_modrm( modrm_string ); |
| 1268 | switch ((op2 >> 3) & 0x7) |
| 1269 | { |
| 1270 | case 0: sprintf(s, "fadd qword ptr %s", modrm_string); break; |
| 1271 | case 1: sprintf(s, "fmul qword ptr %s", modrm_string); break; |
| 1272 | case 2: sprintf(s, "fcom qword ptr %s", modrm_string); break; |
| 1273 | case 3: sprintf(s, "fcomp qword ptr %s", modrm_string); break; |
| 1274 | case 4: sprintf(s, "fsub qword ptr %s", modrm_string); break; |
| 1275 | case 5: sprintf(s, "fsubr qword ptr %s", modrm_string); break; |
| 1276 | case 6: sprintf(s, "fdiv qword ptr %s", modrm_string); break; |
| 1277 | case 7: sprintf(s, "fdivr qword ptr %s", modrm_string); break; |
| 1278 | } |
| 1279 | } |
| 1280 | else |
| 1281 | { |
| 1282 | switch (op2 & 0x3f) |
| 1283 | { |
| 1284 | case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: |
| 1285 | sprintf(s, "fadd st(%d),st(0)", op2 & 0x7); break; |
| 1286 | |
| 1287 | case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: |
| 1288 | sprintf(s, "fmul st(%d),st(0)", op2 & 0x7); break; |
| 1289 | |
| 1290 | case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: |
| 1291 | sprintf(s, "fsubr st(%d),st(0)", op2 & 0x7); break; |
| 1292 | |
| 1293 | case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: |
| 1294 | sprintf(s, "fsub st(%d),st(0)", op2 & 0x7); break; |
| 1295 | |
| 1296 | case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: |
| 1297 | sprintf(s, "fdivr st(%d),st(0)", op2 & 0x7); break; |
| 1298 | |
| 1299 | case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: |
| 1300 | sprintf(s, "fdiv st(%d),st(0)", op2 & 0x7); break; |
| 1301 | |
| 1302 | default: sprintf(s, "??? (FPU)"); break; |
| 1303 | } |
| 1304 | } |
| 1305 | break; |
| 1306 | } |
| 1307 | |
| 1308 | case 5: // Group DD |
| 1309 | { |
| 1310 | if (op2 < 0xc0) |
| 1311 | { |
| 1312 | pc--; // adjust fetch pointer, so modrm byte read again |
| 1313 | opcode_ptr--; |
| 1314 | handle_modrm( modrm_string ); |
| 1315 | switch ((op2 >> 3) & 0x7) |
| 1316 | { |
| 1317 | case 0: sprintf(s, "fld qword ptr %s", modrm_string); break; |
| 1318 | case 1: sprintf(s, "??? (FPU)"); break; |
| 1319 | case 2: sprintf(s, "fst qword ptr %s", modrm_string); break; |
| 1320 | case 3: sprintf(s, "fstp qword ptr %s", modrm_string); break; |
| 1321 | case 4: sprintf(s, "frstor %s", modrm_string); break; |
| 1322 | case 5: sprintf(s, "??? (FPU)"); break; |
| 1323 | case 6: sprintf(s, "fsave %s", modrm_string); break; |
| 1324 | case 7: sprintf(s, "fstsw word ptr %s", modrm_string); break; |
| 1325 | } |
| 1326 | } |
| 1327 | else |
| 1328 | { |
| 1329 | switch (op2 & 0x3f) |
| 1330 | { |
| 1331 | case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: |
| 1332 | sprintf(s, "ffree st(%d)", op2 & 0x7); break; |
| 1333 | |
| 1334 | case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: |
| 1335 | sprintf(s, "fst st(%d)", op2 & 0x7); break; |
| 1336 | |
| 1337 | case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: |
| 1338 | sprintf(s, "fstp st(%d)", op2 & 0x7); break; |
| 1339 | |
| 1340 | case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: |
| 1341 | sprintf(s, "fucom st(%d), st(0)", op2 & 0x7); break; |
| 1342 | |
| 1343 | case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: |
| 1344 | sprintf(s, "fucomp st(%d)", op2 & 0x7); break; |
| 1345 | |
| 1346 | default: sprintf(s, "??? (FPU)"); break; |
| 1347 | } |
| 1348 | } |
| 1349 | break; |
| 1350 | } |
| 1351 | |
| 1352 | case 6: // Group DE |
| 1353 | { |
| 1354 | if (op2 < 0xc0) |
| 1355 | { |
| 1356 | pc--; // adjust fetch pointer, so modrm byte read again |
| 1357 | opcode_ptr--; |
| 1358 | handle_modrm( modrm_string ); |
| 1359 | switch ((op2 >> 3) & 0x7) |
| 1360 | { |
| 1361 | case 0: sprintf(s, "fiadd word ptr %s", modrm_string); break; |
| 1362 | case 1: sprintf(s, "fimul word ptr %s", modrm_string); break; |
| 1363 | case 2: sprintf(s, "ficom word ptr %s", modrm_string); break; |
| 1364 | case 3: sprintf(s, "ficomp word ptr %s", modrm_string); break; |
| 1365 | case 4: sprintf(s, "fisub word ptr %s", modrm_string); break; |
| 1366 | case 5: sprintf(s, "fisubr word ptr %s", modrm_string); break; |
| 1367 | case 6: sprintf(s, "fidiv word ptr %s", modrm_string); break; |
| 1368 | case 7: sprintf(s, "fidivr word ptr %s", modrm_string); break; |
| 1369 | } |
| 1370 | } |
| 1371 | else |
| 1372 | { |
| 1373 | switch (op2 & 0x3f) |
| 1374 | { |
| 1375 | case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: |
| 1376 | sprintf(s, "faddp st(%d)", op2 & 0x7); break; |
| 1377 | |
| 1378 | case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: |
| 1379 | sprintf(s, "fmulp st(%d)", op2 & 0x7); break; |
| 1380 | |
| 1381 | case 0x19: sprintf(s, "fcompp"); break; |
| 1382 | |
| 1383 | case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: |
| 1384 | sprintf(s, "fsubrp st(%d)", op2 & 0x7); break; |
| 1385 | |
| 1386 | case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: |
| 1387 | sprintf(s, "fsubp st(%d)", op2 & 0x7); break; |
| 1388 | |
| 1389 | case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: |
| 1390 | sprintf(s, "fdivrp st(%d), st(0)", op2 & 0x7); break; |
| 1391 | |
| 1392 | case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: |
| 1393 | sprintf(s, "fdivp st(%d)", op2 & 0x7); break; |
| 1394 | |
| 1395 | default: sprintf(s, "??? (FPU)"); break; |
| 1396 | } |
| 1397 | } |
| 1398 | break; |
| 1399 | } |
| 1400 | |
| 1401 | case 7: // Group DF |
| 1402 | { |
| 1403 | if (op2 < 0xc0) |
| 1404 | { |
| 1405 | pc--; // adjust fetch pointer, so modrm byte read again |
| 1406 | opcode_ptr--; |
| 1407 | handle_modrm( modrm_string ); |
| 1408 | switch ((op2 >> 3) & 0x7) |
| 1409 | { |
| 1410 | case 0: sprintf(s, "fild word ptr %s", modrm_string); break; |
| 1411 | case 1: sprintf(s, "??? (FPU)"); break; |
| 1412 | case 2: sprintf(s, "fist word ptr %s", modrm_string); break; |
| 1413 | case 3: sprintf(s, "fistp word ptr %s", modrm_string); break; |
| 1414 | case 4: sprintf(s, "fbld %s", modrm_string); break; |
| 1415 | case 5: sprintf(s, "fild qword ptr %s", modrm_string); break; |
| 1416 | case 6: sprintf(s, "fbstp %s", modrm_string); break; |
| 1417 | case 7: sprintf(s, "fistp qword ptr %s", modrm_string); break; |
| 1418 | } |
| 1419 | } |
| 1420 | else |
| 1421 | { |
| 1422 | switch (op2 & 0x3f) |
| 1423 | { |
| 1424 | case 0x20: sprintf(s, "fstsw aw"); break; |
| 1425 | |
| 1426 | case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: |
| 1427 | sprintf(s, "fucomip st(%d)", op2 & 0x7); break; |
| 1428 | |
| 1429 | case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: |
| 1430 | sprintf(s, "fcomip st(%d),st(0)", op2 & 0x7); break; |
| 1431 | |
| 1432 | default: sprintf(s, "??? (FPU)"); break; |
| 1433 | } |
| 1434 | } |
| 1435 | break; |
| 1436 | } |
| 1437 | } |
| 1438 | } |
| 1439 | |
| 1440 | static void decode_opcode(char *s, const I386_OPCODE *op, UINT8 op1) |
| 1441 | { |
| 1442 | int i; |
| 1443 | UINT8 op2; |
| 1444 | |
| 1445 | switch( op->flags ) |
| 1446 | { |
| 1447 | case TWO_BYTE: |
| 1448 | op2 = FETCHD(); |
| 1449 | decode_opcode( s, &necv_opcode_table2[op2], op1 ); |
| 1450 | return; |
| 1451 | |
| 1452 | case SEG_PS: |
| 1453 | case SEG_DS0: |
| 1454 | case SEG_DS1: |
| 1455 | case SEG_SS: |
| 1456 | segment = op->flags; |
| 1457 | op2 = FETCH(); |
| 1458 | decode_opcode( s, &necv_opcode_table1[op2], op1 ); |
| 1459 | return; |
| 1460 | |
| 1461 | case PREFIX: |
| 1462 | s += sprintf( s, "%-8s", op->mnemonic ); |
| 1463 | op2 = FETCH(); |
| 1464 | decode_opcode( s, &necv_opcode_table1[op2], op1 ); |
| 1465 | return; |
| 1466 | |
| 1467 | case GROUP: |
| 1468 | handle_modrm( modrm_string ); |
| 1469 | for( i=0; i < ARRAY_LENGTH(group_op_table); i++ ) { |
| 1470 | if( mame_stricmp(op->mnemonic, group_op_table[i].mnemonic) == 0 ) { |
| 1471 | decode_opcode( s, &group_op_table[i].opcode[MODRM_REG1], op1 ); |
| 1472 | return; |
| 1473 | } |
| 1474 | } |
| 1475 | goto handle_unknown; |
| 1476 | |
| 1477 | case FPU: |
| 1478 | op2 = FETCHD(); |
| 1479 | handle_fpu( s, op1, op2); |
| 1480 | return; |
| 1481 | |
| 1482 | case MODRM: |
| 1483 | handle_modrm( modrm_string ); |
| 1484 | break; |
| 1485 | } |
| 1486 | |
| 1487 | s += sprintf( s, "%-8s", op->mnemonic ); |
| 1488 | dasm_flags = op->dasm_flags; |
| 1489 | |
| 1490 | if( op->param1 != 0 ) { |
| 1491 | s = handle_param( s, op->param1 ); |
| 1492 | } |
| 1493 | |
| 1494 | if( op->param2 != 0 ) { |
| 1495 | s += sprintf( s, "," ); |
| 1496 | s = handle_param( s, op->param2 ); |
| 1497 | } |
| 1498 | |
| 1499 | if( op->param3 != 0 ) { |
| 1500 | s += sprintf( s, "," ); |
| 1501 | s = handle_param( s, op->param3 ); |
| 1502 | } |
| 1503 | return; |
| 1504 | |
| 1505 | handle_unknown: |
| 1506 | sprintf(s, "???"); |
| 1507 | } |
| 1508 | |
| 1509 | int necv_dasm_one(char *buffer, UINT32 eip, const UINT8 *oprom) |
| 1510 | { |
| 1511 | UINT8 op; |
| 1512 | |
| 1513 | opcode_ptr = opcode_ptr_base = oprom; |
| 1514 | pc = eip; |
| 1515 | dasm_flags = 0; |
| 1516 | segment = 0; |
| 1517 | |
| 1518 | op = FETCH(); |
| 1519 | |
| 1520 | decode_opcode( buffer, &necv_opcode_table1[op], op ); |
| 1521 | return (pc-eip) | dasm_flags | DASMFLAG_SUPPORTED; |
| 1522 | } |
src/emu/cpu/mips/mdrcold.c
| r869 | r870 | |
| 1 | #include "cpu/x86drc.h" |
| 2 | |
| 3 | |
| 1 | 4 | /*************************************************************************** |
| 2 | 5 | CONFIGURATION |
| 3 | 6 | ***************************************************************************/ |
| r869 | r870 | |
| 4 | 7 | |
| 5 | 8 | #define STRIP_NOPS 1 /* 1 is faster */ |
| 6 | 9 | #define USE_SSE 0 /* can't tell any speed difference here */ |
| 10 | #define CACHE_SIZE (16 * 1024 * 1024) |
| 7 | 11 | |
| 8 | 12 | |
| 9 | 13 | |
| r869 | r870 | |
| 24 | 28 | |
| 25 | 29 | |
| 26 | 30 | /*************************************************************************** |
| 31 | TYPEDEFS |
| 32 | ***************************************************************************/ |
| 33 | |
| 34 | struct _mips3drc_data |
| 35 | { |
| 36 | drc_core * core; |
| 37 | |
| 38 | void * generate_interrupt_exception; |
| 39 | void * generate_cop_exception; |
| 40 | void * generate_overflow_exception; |
| 41 | void * generate_invalidop_exception; |
| 42 | void * generate_syscall_exception; |
| 43 | void * generate_break_exception; |
| 44 | void * generate_trap_exception; |
| 45 | void * generate_tlbload_exception; |
| 46 | void * generate_tlbstore_exception; |
| 47 | void * handle_pc_tlb_mismatch; |
| 48 | void * read_and_translate_byte_signed; |
| 49 | void * read_and_translate_byte_unsigned; |
| 50 | void * read_and_translate_word_signed; |
| 51 | void * read_and_translate_word_unsigned; |
| 52 | void * read_and_translate_long; |
| 53 | void * read_and_translate_double; |
| 54 | void * write_and_translate_byte; |
| 55 | void * write_and_translate_word; |
| 56 | void * write_and_translate_long; |
| 57 | void * write_and_translate_double; |
| 58 | void * write_back_long; |
| 59 | void * write_back_double; |
| 60 | }; |
| 61 | |
| 62 | |
| 63 | |
| 64 | /*************************************************************************** |
| 27 | 65 | FUNCTION PROTOTYPES |
| 28 | 66 | ***************************************************************************/ |
| 29 | 67 | |
| 68 | static void drc_reset_callback(drc_core *drc); |
| 69 | static void drc_recompile_callback(drc_core *drc); |
| 70 | static void drc_entrygen_callback(drc_core *drc); |
| 71 | |
| 30 | 72 | static UINT32 compile_one(drc_core *drc, UINT32 pc, UINT32 physpc); |
| 31 | 73 | |
| 32 | 74 | static void append_generate_exception(drc_core *drc, UINT8 exception); |
| r869 | r870 | |
| 59 | 101 | |
| 60 | 102 | |
| 61 | 103 | /*************************************************************************** |
| 62 | | RECOMPILER CALLBACKS |
| 104 | CORE RECOMPILER SYSTEMS |
| 63 | 105 | ***************************************************************************/ |
| 64 | 106 | |
| 65 | | /*------------------------------------------------------------------ |
| 66 | | mips3drc_init |
| 67 | | ------------------------------------------------------------------*/ |
| 107 | /*------------------------------------------------- |
| 108 | mips3drc_init - initialize the drc-specific |
| 109 | state |
| 110 | -------------------------------------------------*/ |
| 68 | 111 | |
| 69 | 112 | static void mips3drc_init(void) |
| 70 | 113 | { |
| 71 | 114 | drc_config drconfig; |
| 72 | 115 | |
| 116 | /* allocate our data */ |
| 117 | mips3.drc = auto_malloc(sizeof(*mips3.drc)); |
| 118 | memset(mips3.drc, 0, sizeof(*mips3.drc)); |
| 119 | |
| 73 | 120 | /* fill in the config */ |
| 74 | 121 | memset(&drconfig, 0, sizeof(drconfig)); |
| 75 | 122 | drconfig.cache_size = CACHE_SIZE; |
| r869 | r870 | |
| 80 | 127 | drconfig.uses_sse = USE_SSE; |
| 81 | 128 | drconfig.pc_in_memory = 0; |
| 82 | 129 | drconfig.icount_in_memory = 0; |
| 83 | | drconfig.pcptr = (UINT32 *)&mips3.pc; |
| 130 | drconfig.pcptr = (UINT32 *)&mips3.core.pc; |
| 84 | 131 | drconfig.icountptr = (UINT32 *)&mips3_icount; |
| 85 | 132 | drconfig.esiptr = NULL; |
| 86 | | drconfig.cb_reset = mips3drc_reset; |
| 87 | | drconfig.cb_recompile = mips3drc_recompile; |
| 88 | | drconfig.cb_entrygen = mips3drc_entrygen; |
| 133 | drconfig.cb_reset = drc_reset_callback; |
| 134 | drconfig.cb_recompile = drc_recompile_callback; |
| 135 | drconfig.cb_entrygen = drc_entrygen_callback; |
| 89 | 136 | |
| 90 | 137 | /* initialize the compiler */ |
| 91 | | mips3.drc = drc_init(cpu_getactivecpu(), &drconfig); |
| 138 | mips3.drc->core = drc_init(cpu_getactivecpu(), &drconfig); |
| 92 | 139 | mips3.drcoptions = MIPS3DRC_FASTEST_OPTIONS; |
| 93 | 140 | } |
| 94 | 141 | |
| 95 | 142 | |
| 143 | /*------------------------------------------------- |
| 144 | mips3drc_reset - reset the drc-specific state |
| 145 | -------------------------------------------------*/ |
| 96 | 146 | |
| 147 | static void mips3drc_reset(void) |
| 148 | { |
| 149 | /* reset the cache */ |
| 150 | drc_cache_reset(mips3.drc->core); |
| 151 | } |
| 152 | |
| 153 | |
| 154 | /*------------------------------------------------- |
| 155 | mips3drc_execute - execute the code |
| 156 | -------------------------------------------------*/ |
| 157 | |
| 158 | static void mips3drc_execute(void) |
| 159 | { |
| 160 | drc_execute(mips3.drc->core); |
| 161 | } |
| 162 | |
| 163 | |
| 164 | /*------------------------------------------------- |
| 165 | mips3drc_exit - clean up the drc-specific |
| 166 | state |
| 167 | -------------------------------------------------*/ |
| 168 | |
| 169 | static void mips3drc_exit(void) |
| 170 | { |
| 171 | drc_exit(mips3.drc->core); |
| 172 | } |
| 173 | |
| 174 | |
| 175 | |
| 176 | /*************************************************************************** |
| 177 | RECOMPILER CALLBACKS |
| 178 | ***************************************************************************/ |
| 179 | |
| 97 | 180 | /*------------------------------------------------------------------ |
| 98 | | mips3drc_reset |
| 181 | drc_reset_callback |
| 99 | 182 | ------------------------------------------------------------------*/ |
| 100 | 183 | |
| 101 | | static void mips3drc_reset(drc_core *drc) |
| 184 | static void drc_reset_callback(drc_core *drc) |
| 102 | 185 | { |
| 103 | 186 | code_log_reset(); |
| 104 | 187 | |
| 105 | | mips3.generate_interrupt_exception = drc->cache_top; |
| 188 | mips3.drc->generate_interrupt_exception = drc->cache_top; |
| 106 | 189 | append_generate_exception(drc, EXCEPTION_INTERRUPT); |
| 107 | | code_log(drc, "generate_interrupt_exception:", mips3.generate_interrupt_exception); |
| 190 | code_log("generate_interrupt_exception:", mips3.drc->generate_interrupt_exception, drc->cache_top); |
| 108 | 191 | |
| 109 | | mips3.generate_cop_exception = drc->cache_top; |
| 192 | mips3.drc->generate_cop_exception = drc->cache_top; |
| 110 | 193 | append_generate_exception(drc, EXCEPTION_BADCOP); |
| 111 | | code_log(drc, "generate_cop_exception:", mips3.generate_cop_exception); |
| 194 | code_log("generate_cop_exception:", mips3.drc->generate_cop_exception, drc->cache_top); |
| 112 | 195 | |
| 113 | | mips3.generate_overflow_exception = drc->cache_top; |
| 196 | mips3.drc->generate_overflow_exception = drc->cache_top; |
| 114 | 197 | append_generate_exception(drc, EXCEPTION_OVERFLOW); |
| 115 | | code_log(drc, "generate_overflow_exception:", mips3.generate_overflow_exception); |
| 198 | code_log("generate_overflow_exception:", mips3.drc->generate_overflow_exception, drc->cache_top); |
| 116 | 199 | |
| 117 | | mips3.generate_invalidop_exception = drc->cache_top; |
| 200 | mips3.drc->generate_invalidop_exception = drc->cache_top; |
| 118 | 201 | append_generate_exception(drc, EXCEPTION_INVALIDOP); |
| 119 | | code_log(drc, "generate_invalidop_exception:", mips3.generate_invalidop_exception); |
| 202 | code_log("generate_invalidop_exception:", mips3.drc->generate_invalidop_exception, drc->cache_top); |
| 120 | 203 | |
| 121 | | mips3.generate_syscall_exception = drc->cache_top; |
| 204 | mips3.drc->generate_syscall_exception = drc->cache_top; |
| 122 | 205 | append_generate_exception(drc, EXCEPTION_SYSCALL); |
| 123 | | code_log(drc, "generate_syscall_exception:", mips3.generate_syscall_exception); |
| 206 | code_log("generate_syscall_exception:", mips3.drc->generate_syscall_exception, drc->cache_top); |
| 124 | 207 | |
| 125 | | mips3.generate_break_exception = drc->cache_top; |
| 208 | mips3.drc->generate_break_exception = drc->cache_top; |
| 126 | 209 | append_generate_exception(drc, EXCEPTION_BREAK); |
| 127 | | code_log(drc, "generate_break_exception:", mips3.generate_break_exception); |
| 210 | code_log("generate_break_exception:", mips3.drc->generate_break_exception, drc->cache_top); |
| 128 | 211 | |
| 129 | | mips3.generate_trap_exception = drc->cache_top; |
| 212 | mips3.drc->generate_trap_exception = drc->cache_top; |
| 130 | 213 | append_generate_exception(drc, EXCEPTION_TRAP); |
| 131 | | code_log(drc, "generate_trap_exception:", mips3.generate_trap_exception); |
| 214 | code_log("generate_trap_exception:", mips3.drc->generate_trap_exception, drc->cache_top); |
| 132 | 215 | |
| 133 | | mips3.generate_tlbload_exception = drc->cache_top; |
| 216 | mips3.drc->generate_tlbload_exception = drc->cache_top; |
| 134 | 217 | append_generate_exception(drc, EXCEPTION_TLBLOAD); |
| 135 | | code_log(drc, "generate_tlbload_exception:", mips3.generate_tlbload_exception); |
| 218 | code_log("generate_tlbload_exception:", mips3.drc->generate_tlbload_exception, drc->cache_top); |
| 136 | 219 | |
| 137 | | mips3.generate_tlbstore_exception = drc->cache_top; |
| 220 | mips3.drc->generate_tlbstore_exception = drc->cache_top; |
| 138 | 221 | append_generate_exception(drc, EXCEPTION_TLBSTORE); |
| 139 | | code_log(drc, "generate_tlbstore_exception:", mips3.generate_tlbstore_exception); |
| 222 | code_log("generate_tlbstore_exception:", mips3.drc->generate_tlbstore_exception, drc->cache_top); |
| 140 | 223 | |
| 141 | | mips3.handle_pc_tlb_mismatch = drc->cache_top; |
| 224 | mips3.drc->handle_pc_tlb_mismatch = drc->cache_top; |
| 142 | 225 | _mov_r32_r32(REG_EAX, REG_EDI); // mov eax,edi |
| 143 | 226 | _shr_r32_imm(REG_EAX, 12); // shr eax,12 |
| 144 | | _mov_r32_m32isd(REG_EBX, REG_EAX, 4, &mips3.tlb_table); // mov ebx,tlb_table[eax*4] |
| 227 | _mov_r32_m32isd(REG_EBX, REG_EAX, 4, &mips3.core.tlb_table); // mov ebx,tlb_table[eax*4] |
| 145 | 228 | _test_r32_imm(REG_EBX, 2); // test ebx,2 |
| 146 | 229 | _mov_r32_r32(REG_EAX, REG_EDI); // mov eax,edi |
| 147 | | _jcc(COND_NZ, mips3.generate_tlbload_exception); // jnz generate_tlbload_exception |
| 230 | _jcc(COND_NZ, mips3.drc->generate_tlbload_exception); // jnz generate_tlbload_exception |
| 148 | 231 | _mov_m32abs_r32(drc->pcptr, REG_EDI); // mov [pcptr],edi |
| 149 | 232 | _jmp(drc->recompile); // call recompile |
| 150 | | code_log(drc, "handle_pc_tlb_mismatch:", mips3.handle_pc_tlb_mismatch); |
| 233 | code_log("handle_pc_tlb_mismatch:", mips3.drc->handle_pc_tlb_mismatch, drc->cache_top); |
| 151 | 234 | |
| 152 | | mips3.read_and_translate_byte_signed = drc->cache_top; |
| 235 | mips3.drc->read_and_translate_byte_signed = drc->cache_top; |
| 153 | 236 | append_readwrite_and_translate(drc, FALSE, 1, TRUE, TRUE); |
| 154 | | code_log(drc, "read_and_translate_byte_signed:", mips3.read_and_translate_byte_signed); |
| 237 | code_log("read_and_translate_byte_signed:", mips3.drc->read_and_translate_byte_signed, drc->cache_top); |
| 155 | 238 | |
| 156 | | mips3.read_and_translate_byte_unsigned = drc->cache_top; |
| 239 | mips3.drc->read_and_translate_byte_unsigned = drc->cache_top; |
| 157 | 240 | append_readwrite_and_translate(drc, FALSE, 1, FALSE, TRUE); |
| 158 | | code_log(drc, "read_and_translate_byte_unsigned:", mips3.read_and_translate_byte_unsigned); |
| 241 | code_log("read_and_translate_byte_unsigned:", mips3.drc->read_and_translate_byte_unsigned, drc->cache_top); |
| 159 | 242 | |
| 160 | | mips3.read_and_translate_word_signed = drc->cache_top; |
| 243 | mips3.drc->read_and_translate_word_signed = drc->cache_top; |
| 161 | 244 | append_readwrite_and_translate(drc, FALSE, 2, TRUE, TRUE); |
| 162 | | code_log(drc, "read_and_translate_word_signed:", mips3.read_and_translate_word_signed); |
| 245 | code_log("read_and_translate_word_signed:", mips3.drc->read_and_translate_word_signed, drc->cache_top); |
| 163 | 246 | |
| 164 | | mips3.read_and_translate_word_unsigned = drc->cache_top; |
| 247 | mips3.drc->read_and_translate_word_unsigned = drc->cache_top; |
| 165 | 248 | append_readwrite_and_translate(drc, FALSE, 2, FALSE, TRUE); |
| 166 | | code_log(drc, "read_and_translate_word_unsigned:", mips3.read_and_translate_word_unsigned); |
| 249 | code_log("read_and_translate_word_unsigned:", mips3.drc->read_and_translate_word_unsigned, drc->cache_top); |
| 167 | 250 | |
| 168 | | mips3.read_and_translate_long = drc->cache_top; |
| 251 | mips3.drc->read_and_translate_long = drc->cache_top; |
| 169 | 252 | append_readwrite_and_translate(drc, FALSE, 4, FALSE, TRUE); |
| 170 | | code_log(drc, "read_and_translate_long:", mips3.read_and_translate_long); |
| 253 | code_log("read_and_translate_long:", mips3.drc->read_and_translate_long, drc->cache_top); |
| 171 | 254 | |
| 172 | | mips3.read_and_translate_double = drc->cache_top; |
| 255 | mips3.drc->read_and_translate_double = drc->cache_top; |
| 173 | 256 | append_readwrite_and_translate(drc, FALSE, 8, FALSE, TRUE); |
| 174 | | code_log(drc, "read_and_translate_double:", mips3.read_and_translate_double); |
| 257 | code_log("read_and_translate_double:", mips3.drc->read_and_translate_double, drc->cache_top); |
| 175 | 258 | |
| 176 | | mips3.write_and_translate_byte = drc->cache_top; |
| 259 | mips3.drc->write_and_translate_byte = drc->cache_top; |
| 177 | 260 | append_readwrite_and_translate(drc, TRUE, 1, FALSE, TRUE); |
| 178 | | code_log(drc, "write_and_translate_byte:", mips3.write_and_translate_byte); |
| 261 | code_log("write_and_translate_byte:", mips3.drc->write_and_translate_byte, drc->cache_top); |
| 179 | 262 | |
| 180 | | mips3.write_and_translate_word = drc->cache_top; |
| 263 | mips3.drc->write_and_translate_word = drc->cache_top; |
| 181 | 264 | append_readwrite_and_translate(drc, TRUE, 2, FALSE, TRUE); |
| 182 | | code_log(drc, "write_and_translate_word:", mips3.write_and_translate_word); |
| 265 | code_log("write_and_translate_word:", mips3.drc->write_and_translate_word, drc->cache_top); |
| 183 | 266 | |
| 184 | | mips3.write_and_translate_long = drc->cache_top; |
| 267 | mips3.drc->write_and_translate_long = drc->cache_top; |
| 185 | 268 | append_readwrite_and_translate(drc, TRUE, 4, FALSE, TRUE); |
| 186 | | code_log(drc, "write_and_translate_long:", mips3.write_and_translate_long); |
| 269 | code_log("write_and_translate_long:", mips3.drc->write_and_translate_long, drc->cache_top); |
| 187 | 270 | |
| 188 | | mips3.write_and_translate_double = drc->cache_top; |
| 271 | mips3.drc->write_and_translate_double = drc->cache_top; |
| 189 | 272 | append_readwrite_and_translate(drc, TRUE, 8, FALSE, TRUE); |
| 190 | | code_log(drc, "write_and_translate_double:", mips3.write_and_translate_double); |
| 273 | code_log("write_and_translate_double:", mips3.drc->write_and_translate_double, drc->cache_top); |
| 191 | 274 | |
| 192 | | mips3.write_back_long = drc->cache_top; |
| 275 | mips3.drc->write_back_long = drc->cache_top; |
| 193 | 276 | append_readwrite_and_translate(drc, TRUE, 4, FALSE, FALSE); |
| 194 | | code_log(drc, "write_back_long:", mips3.write_back_long); |
| 277 | code_log("write_back_long:", mips3.drc->write_back_long, drc->cache_top); |
| 195 | 278 | |
| 196 | | mips3.write_back_double = drc->cache_top; |
| 279 | mips3.drc->write_back_double = drc->cache_top; |
| 197 | 280 | append_readwrite_and_translate(drc, TRUE, 8, FALSE, FALSE); |
| 198 | | code_log(drc, "write_back_double:", mips3.write_back_double); |
| 281 | code_log("write_back_double:", mips3.drc->write_back_double, drc->cache_top); |
| 199 | 282 | } |
| 200 | 283 | |
| 201 | 284 | |
| 202 | | |
| 203 | 285 | /*------------------------------------------------------------------ |
| 204 | | mips3drc_recompile |
| 286 | drc_recompile_callback |
| 205 | 287 | ------------------------------------------------------------------*/ |
| 206 | 288 | |
| 207 | | static void mips3drc_recompile(drc_core *drc) |
| 289 | static void drc_recompile_callback(drc_core *drc) |
| 208 | 290 | { |
| 209 | 291 | int remaining = MAX_INSTRUCTIONS; |
| 210 | 292 | void *start = drc->cache_top; |
| 211 | | UINT32 pc = mips3.pc; |
| 293 | UINT32 pc = mips3.core.pc; |
| 212 | 294 | UINT32 lastpc = pc; |
| 213 | 295 | UINT32 physpc; |
| 214 | 296 | |
| r869 | r870 | |
| 219 | 301 | code_log_reset(); |
| 220 | 302 | |
| 221 | 303 | /* make sure our FR flag matches the last time */ |
| 222 | | _test_m32abs_imm(&mips3.cpr[0][COP0_Status], SR_FR); // test [COP0_Status],SR_FR |
| 304 | _test_m32abs_imm(&mips3.core.cpr[0][COP0_Status], SR_FR); // test [COP0_Status],SR_FR |
| 223 | 305 | _jcc(IS_FR0 ? COND_NZ : COND_Z, drc->recompile); // jnz/z recompile |
| 224 | 306 | |
| 225 | 307 | /* ensure that we are still mapped */ |
| 226 | | append_tlb_verify(drc, pc, mips3.handle_pc_tlb_mismatch); |
| 308 | append_tlb_verify(drc, pc, mips3.drc->handle_pc_tlb_mismatch); |
| 227 | 309 | physpc = pc; |
| 228 | | if (!translate_address(ADDRESS_SPACE_PROGRAM, &physpc)) |
| 310 | if (!mips3com_translate_address(&mips3.core, ADDRESS_SPACE_PROGRAM, &physpc)) |
| 229 | 311 | { |
| 230 | 312 | _mov_r32_r32(REG_EAX, REG_EDI); // mov eax,edi |
| 231 | | _jmp(mips3.generate_tlbload_exception); // jmp tlbload_exception |
| 313 | _jmp(mips3.drc->generate_tlbload_exception); // jmp tlbload_exception |
| 232 | 314 | goto exit; |
| 233 | 315 | } |
| 234 | 316 | change_pc(physpc); |
| r869 | r870 | |
| 246 | 328 | if ((pc ^ lastpc) & 0xfffff000) |
| 247 | 329 | { |
| 248 | 330 | physpc = pc; |
| 249 | | if (!translate_address(ADDRESS_SPACE_PROGRAM, &physpc)) |
| 331 | if (!mips3com_translate_address(&mips3.core, ADDRESS_SPACE_PROGRAM, &physpc)) |
| 250 | 332 | break; |
| 251 | 333 | append_tlb_verify(drc, pc, drc->dispatch); |
| 252 | 334 | change_pc(physpc); |
| r869 | r870 | |
| 272 | 354 | #if LOG_CODE |
| 273 | 355 | { |
| 274 | 356 | char label[40]; |
| 275 | | physpc = mips3.pc; |
| 276 | | translate_address(ADDRESS_SPACE_PROGRAM, &physpc); |
| 277 | | sprintf(label, "Code @ %08X (%08X physical)", mips3.pc, physpc); |
| 278 | | code_log(drc, label, start); |
| 357 | physpc = mips3.core.pc; |
| 358 | mips3com_translate_address(&mips3.core, ADDRESS_SPACE_PROGRAM, &physpc); |
| 359 | sprintf(label, "Code @ %08X (%08X physical)", mips3.core.pc, physpc); |
| 360 | code_log(label, start, drc->cache_top); |
| 279 | 361 | } |
| 280 | 362 | #endif |
| 281 | 363 | } |
| 282 | 364 | |
| 283 | 365 | |
| 284 | 366 | /*------------------------------------------------------------------ |
| 285 | | mips3drc_entrygen |
| 367 | drc_entrygen_callback |
| 286 | 368 | ------------------------------------------------------------------*/ |
| 287 | 369 | |
| 288 | | static void mips3drc_entrygen(drc_core *drc) |
| 370 | static void drc_entrygen_callback(drc_core *drc) |
| 289 | 371 | { |
| 290 | | _mov_r32_imm(REG_ESI, &mips3.r[17]); |
| 372 | _mov_r32_imm(REG_ESI, &mips3.core.r[17]); |
| 291 | 373 | append_check_interrupts(drc, 1); |
| 292 | 374 | } |
| 293 | 375 | |
| r869 | r870 | |
| 379 | 461 | /* assumes address is in EAX */ |
| 380 | 462 | if (exception == EXCEPTION_TLBLOAD || exception == EXCEPTION_TLBSTORE) |
| 381 | 463 | { |
| 382 | | _mov_m32abs_r32(&mips3.cpr[0][COP0_BadVAddr], REG_EAX); // mov [mips3.cpr[0][BadVAddr]],eax |
| 383 | | _and_m32abs_imm(&mips3.cpr[0][COP0_EntryHi], 0x000000ff); // and [mips3.cpr[0][EntryHi]],0x000000ff |
| 464 | _mov_m32abs_r32(&mips3.core.cpr[0][COP0_BadVAddr], REG_EAX); // mov [mips3.core.cpr[0][BadVAddr]],eax |
| 465 | _and_m32abs_imm(&mips3.core.cpr[0][COP0_EntryHi], 0x000000ff); // and [mips3.core.cpr[0][EntryHi]],0x000000ff |
| 384 | 466 | _and_r32_imm(REG_EAX, 0xffffe000); // and eax,0xffffe000 |
| 385 | | _or_m32abs_r32(&mips3.cpr[0][COP0_EntryHi], REG_EAX); // or [mips3.cpr[0][EntryHi]],eax |
| 386 | | _and_m32abs_imm(&mips3.cpr[0][COP0_Context], 0xff800000); // and [mips3.cpr[0][Context]],0xff800000 |
| 467 | _or_m32abs_r32(&mips3.core.cpr[0][COP0_EntryHi], REG_EAX); // or [mips3.core.cpr[0][EntryHi]],eax |
| 468 | _and_m32abs_imm(&mips3.core.cpr[0][COP0_Context], 0xff800000); // and [mips3.core.cpr[0][Context]],0xff800000 |
| 387 | 469 | _shr_r32_imm(REG_EAX, 9); // shr eax,9 |
| 388 | | _or_m32abs_r32(&mips3.cpr[0][COP0_Context], REG_EAX); // or [mips3.cpr[0][Context]],eax |
| 470 | _or_m32abs_r32(&mips3.core.cpr[0][COP0_Context], REG_EAX); // or [mips3.core.cpr[0][Context]],eax |
| 389 | 471 | } |
| 390 | 472 | |
| 391 | | _mov_m32abs_r32(&mips3.cpr[0][COP0_EPC], REG_EDI); // mov [mips3.cpr[0][COP0_EPC]],edi |
| 392 | | _mov_r32_m32abs(REG_EAX, &mips3.cpr[0][COP0_Cause]); // mov eax,[mips3.cpr[0][COP0_Cause]] |
| 473 | _mov_m32abs_r32(&mips3.core.cpr[0][COP0_EPC], REG_EDI); // mov [mips3.core.cpr[0][COP0_EPC]],edi |
| 474 | _mov_r32_m32abs(REG_EAX, &mips3.core.cpr[0][COP0_Cause]); // mov eax,[mips3.core.cpr[0][COP0_Cause]] |
| 393 | 475 | _and_r32_imm(REG_EAX, ~0x800000ff); // and eax,~0x800000ff |
| 394 | 476 | if (exception) |
| 395 | 477 | _or_r32_imm(REG_EAX, exception << 2); // or eax,exception << 2 |
| 396 | 478 | _cmp_m32abs_imm(&mips3.nextpc, ~0); // cmp [mips3.nextpc],~0 |
| 397 | 479 | _jcc_short_link(COND_E, &link1); // je skip |
| 398 | 480 | _mov_m32abs_imm(&mips3.nextpc, ~0); // mov [mips3.nextpc],~0 |
| 399 | | _sub_m32abs_imm(&mips3.cpr[0][COP0_EPC], 4); // sub [mips3.cpr[0][COP0_EPC]],4 |
| 481 | _sub_m32abs_imm(&mips3.core.cpr[0][COP0_EPC], 4); // sub [mips3.core.cpr[0][COP0_EPC]],4 |
| 400 | 482 | _or_r32_imm(REG_EAX, 0x80000000); // or eax,0x80000000 |
| 401 | 483 | _resolve_link(&link1); // skip: |
| 402 | | _mov_m32abs_r32(&mips3.cpr[0][COP0_Cause], REG_EAX); // mov [mips3.cpr[0][COP0_Cause]],eax |
| 403 | | _mov_r32_m32abs(REG_EAX, &mips3.cpr[0][COP0_Status]); // mov eax,[[mips3.cpr[0][COP0_Status]] |
| 484 | _mov_m32abs_r32(&mips3.core.cpr[0][COP0_Cause], REG_EAX); // mov [mips3.core.cpr[0][COP0_Cause]],eax |
| 485 | _mov_r32_m32abs(REG_EAX, &mips3.core.cpr[0][COP0_Status]); // mov eax,[[mips3.core.cpr[0][COP0_Status]] |
| 404 | 486 | _or_r32_imm(REG_EAX, SR_EXL); // or eax,SR_EXL |
| 405 | 487 | _test_r32_imm(REG_EAX, SR_BEV); // test eax,SR_BEV |
| 406 | | _mov_m32abs_r32(&mips3.cpr[0][COP0_Status], REG_EAX); // mov [[mips3.cpr[0][COP0_Status]],eax |
| 488 | _mov_m32abs_r32(&mips3.core.cpr[0][COP0_Status], REG_EAX); // mov [[mips3.core.cpr[0][COP0_Status]],eax |
| 407 | 489 | _mov_r32_imm(REG_EDI, 0xbfc00200 + offset); // mov edi,0xbfc00200+offset |
| 408 | 490 | _jcc_short_link(COND_NZ, &link2); // jnz skip2 |
| 409 | 491 | _mov_r32_imm(REG_EDI, 0x80000000 + offset); // mov edi,0x80000000+offset |
| r869 | r870 | |
| 426 | 508 | _mov_r32_m32bd(REG_EAX, REG_ESP, 4); // mov eax,[esp+4] |
| 427 | 509 | _mov_r32_r32(REG_EBX, REG_EAX); // mov ebx,eax |
| 428 | 510 | _shr_r32_imm(REG_EBX, 12); // shr ebx,12 |
| 429 | | _mov_r32_m32isd(REG_EBX, REG_EBX, 4, mips3.tlb_table); // mov ebx,tlb_table[ebx*4] |
| 511 | _mov_r32_m32isd(REG_EBX, REG_EBX, 4, mips3.core.tlb_table); // mov ebx,tlb_table[ebx*4] |
| 430 | 512 | _and_r32_imm(REG_EAX, 0xfff); // and eax,0xfff |
| 431 | 513 | _shr_r32_imm(REG_EBX, (is_write ? 1 : 2)); // shr ebx,2/1 (read/write) |
| 432 | 514 | _lea_r32_m32bisd(REG_EBX, REG_EAX, REG_EBX, (is_write ? 2 : 4), 0); // lea ebx,[eax+ebx*4/2] (read/write) |
| r869 | r870 | |
| 451 | 533 | { |
| 452 | 534 | if (size == 1) |
| 453 | 535 | { |
| 454 | | if (mips3.bigendian) |
| 536 | if (mips3.core.bigendian) |
| 455 | 537 | _xor_r32_imm(REG_EBX, 3); // xor ebx,3 |
| 456 | 538 | if (is_signed) |
| 457 | 539 | _movsx_r32_m8bd(REG_EAX, REG_EBX, fastbase); // movsx eax,byte ptr [ebx+fastbase] |
| r869 | r870 | |
| 460 | 542 | } |
| 461 | 543 | else if (size == 2) |
| 462 | 544 | { |
| 463 | | if (mips3.bigendian) |
| 545 | if (mips3.core.bigendian) |
| 464 | 546 | _xor_r32_imm(REG_EBX, 2); // xor ebx,2 |
| 465 | 547 | if (is_signed) |
| 466 | 548 | _movsx_r32_m16bd(REG_EAX, REG_EBX, fastbase); // movsx eax,word ptr [ebx+fastbase] |
| r869 | r870 | |
| 471 | 553 | _mov_r32_m32bd(REG_EAX, REG_EBX, fastbase); // mov eax,[ebx+fastbase] |
| 472 | 554 | else if (size == 8) |
| 473 | 555 | { |
| 474 | | if (mips3.bigendian) |
| 556 | if (mips3.core.bigendian) |
| 475 | 557 | _mov_r64_m64bd(REG_EAX, REG_EDX, REG_EBX, fastbase); // mov eax:edx,[ebx+fastbase] |
| 476 | 558 | else |
| 477 | 559 | _mov_r64_m64bd(REG_EDX, REG_EAX, REG_EBX, fastbase); // mov edx:eax,[ebx+fastbase] |
| r869 | r870 | |
| 483 | 565 | if (size == 1) |
| 484 | 566 | { |
| 485 | 567 | _mov_r8_m8bd(REG_AL, REG_ESP, 8); // mov al,[esp+8] |
| 486 | | if (mips3.bigendian) |
| 568 | if (mips3.core.bigendian) |
| 487 | 569 | _xor_r32_imm(REG_EBX, 3); // xor ebx,3 |
| 488 | 570 | _mov_m8bd_r8(REG_EBX, fastbase, REG_AL); // mov [ebx+fastbase],al |
| 489 | 571 | } |
| 490 | 572 | else if (size == 2) |
| 491 | 573 | { |
| 492 | 574 | _mov_r16_m16bd(REG_AX, REG_ESP, 8); // mov ax,[esp+8] |
| 493 | | if (mips3.bigendian) |
| 575 | if (mips3.core.bigendian) |
| 494 | 576 | _xor_r32_imm(REG_EBX, 2); // xor ebx,2 |
| 495 | 577 | _mov_m16bd_r16(REG_EBX, fastbase, REG_AX); // mov [ebx+fastbase],ax |
| 496 | 578 | } |
| r869 | r870 | |
| 501 | 583 | } |
| 502 | 584 | else if (size == 8) |
| 503 | 585 | { |
| 504 | | if (mips3.bigendian) |
| 586 | if (mips3.core.bigendian) |
| 505 | 587 | { |
| 506 | 588 | _mov_r32_m32bd(REG_EAX, REG_ESP, 8); // mov eax,[esp+8] |
| 507 | 589 | _mov_m32bd_r32(REG_EBX, fastbase+4, REG_EAX); // mov [ebx+fastbase+4],eax |
| r869 | r870 | |
| 531 | 613 | { |
| 532 | 614 | _mov_m32bd_r32(REG_ESP, 4, REG_EBX); // mov [esp+4],ebx |
| 533 | 615 | if (size == 1) |
| 534 | | _jmp(mips3.memory.writebyte); // jmp writebyte |
| 616 | _jmp(mips3.core.memory.writebyte); // jmp writebyte |
| 535 | 617 | else if (size == 2) |
| 536 | | _jmp(mips3.memory.writeword); // jmp writeword |
| 618 | _jmp(mips3.core.memory.writeword); // jmp writeword |
| 537 | 619 | else |
| 538 | | _jmp(mips3.memory.writelong); // jmp writelong |
| 620 | _jmp(mips3.core.memory.writelong); // jmp writelong |
| 539 | 621 | } |
| 540 | 622 | else |
| 541 | 623 | { |
| 542 | 624 | _sub_r32_imm(REG_ESP, 4); // sub esp,4 |
| 543 | | _push_m32bd(REG_ESP, mips3.bigendian ? 16 : 12); // push [esp+12/16] |
| 625 | _push_m32bd(REG_ESP, mips3.core.bigendian ? 16 : 12); // push [esp+12/16] |
| 544 | 626 | _push_r32(REG_EBX); // push ebx |
| 545 | | _call(mips3.memory.writelong); // call writelong |
| 627 | _call(mips3.core.memory.writelong); // call writelong |
| 546 | 628 | _add_r32_imm(REG_EBX, 4); // add ebx,4 |
| 547 | 629 | _sub_r32_imm(REG_ESP, 8); // sub esp,8 |
| 548 | | _push_m32bd(REG_ESP, mips3.bigendian ? (12+16) : (16+16)); // push [esp+16+12/16] |
| 630 | _push_m32bd(REG_ESP, mips3.core.bigendian ? (12+16) : (16+16)); // push [esp+16+12/16] |
| 549 | 631 | _push_r32(REG_EBX); // push ebx |
| 550 | | _call(mips3.memory.writelong); // call writelong |
| 632 | _call(mips3.core.memory.writelong); // call writelong |
| 551 | 633 | _sub_r32_imm(REG_EBX, 4); // sub ebx,4 |
| 552 | 634 | _add_r32_imm(REG_ESP, 28); // add esp,28 |
| 553 | 635 | _ret(); // ret |
| r869 | r870 | |
| 559 | 641 | { |
| 560 | 642 | _sub_r32_imm(REG_ESP, 8); // sub esp,8 |
| 561 | 643 | _push_r32(REG_EBX); // push ebx |
| 562 | | _call(mips3.memory.readbyte); // call readbyte |
| 644 | _call(mips3.core.memory.readbyte); // call readbyte |
| 563 | 645 | if (is_signed) |
| 564 | 646 | _movsx_r32_r8(REG_EAX, REG_AL); // movsx eax,al |
| 565 | 647 | else |
| r869 | r870 | |
| 571 | 653 | { |
| 572 | 654 | _sub_r32_imm(REG_ESP, 8); // sub esp,8 |
| 573 | 655 | _push_r32(REG_EBX); // push ebx |
| 574 | | _call(mips3.memory.readword); // call readword |
| 656 | _call(mips3.core.memory.readword); // call readword |
| 575 | 657 | if (is_signed) |
| 576 | 658 | _movsx_r32_r16(REG_EAX, REG_AX); // movsx eax,ax |
| 577 | 659 | else |
| r869 | r870 | |
| 582 | 664 | else if (size == 4) |
| 583 | 665 | { |
| 584 | 666 | _mov_m32bd_r32(REG_ESP, 4, REG_EBX); // mov [esp+4],ebx |
| 585 | | _jmp(mips3.memory.readlong); // jmp readlong |
| 667 | _jmp(mips3.core.memory.readlong); // jmp readlong |
| 586 | 668 | } |
| 587 | 669 | else |
| 588 | 670 | { |
| 589 | 671 | _sub_r32_imm(REG_ESP, 8); // sub esp,8 |
| 590 | 672 | _push_r32(REG_EBX); // push ebx |
| 591 | | _call(mips3.memory.readlong); // call readlong |
| 673 | _call(mips3.core.memory.readlong); // call readlong |
| 592 | 674 | _add_r32_imm(REG_EBX, 4); // add ebx,4 |
| 593 | 675 | _mov_m32bd_r32(REG_ESP, 4, REG_EAX); // mov [esp+4],eax |
| 594 | 676 | _mov_m32bd_r32(REG_ESP, 0, REG_EBX); // mov [esp],ebx |
| 595 | | _call(mips3.memory.readlong); // call readlong |
| 677 | _call(mips3.core.memory.readlong); // call readlong |
| 596 | 678 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| 597 | | if (mips3.bigendian) |
| 679 | if (mips3.core.bigendian) |
| 598 | 680 | _pop_r32(REG_EDX); // pop edx |
| 599 | 681 | else |
| 600 | 682 | { |
| r869 | r870 | |
| 611 | 693 | _resolve_link(&link1); // error: |
| 612 | 694 | _mov_r32_m32bd(REG_EAX, REG_ESP, 4); // mov eax,[esp+4] |
| 613 | 695 | _add_r32_imm(REG_ESP, is_write ? (8+4) : (4+4)); // add esp,stack_bytes |
| 614 | | _jmp(is_write ? mips3.generate_tlbstore_exception : mips3.generate_tlbload_exception);// jmp generate_exception |
| 696 | _jmp(is_write ? mips3.drc->generate_tlbstore_exception : mips3.drc->generate_tlbload_exception);// jmp generate_exception |
| 615 | 697 | } |
| 616 | 698 | } |
| 617 | 699 | |
| r869 | r870 | |
| 625 | 707 | /* addresses 0x80000000-0xbfffffff are direct-mapped; no checking needed */ |
| 626 | 708 | if (pc < 0x80000000 || pc >= 0xc0000000) |
| 627 | 709 | { |
| 628 | | _cmp_m32abs_imm(&mips3.tlb_table[pc >> 12], mips3.tlb_table[pc >> 12]); // cmp tlbtable[pc >> 12],physpc & 0xfffff000 |
| 710 | _cmp_m32abs_imm(&mips3.core.tlb_table[pc >> 12], mips3.core.tlb_table[pc >> 12]);// cmp tlbtable[pc >> 12],physpc & 0xfffff000 |
| 629 | 711 | _jcc(COND_NE, target); // jne handle_pc_tlb_mismatch |
| 630 | 712 | } |
| 631 | 713 | } |
| r869 | r870 | |
| 637 | 719 | |
| 638 | 720 | static void append_update_cycle_counting(drc_core *drc) |
| 639 | 721 | { |
| 722 | _sub_r32_imm(REG_ESP, 8); |
| 640 | 723 | _mov_m32abs_r32(&mips3_icount, REG_EBP); // mov [mips3_icount],ebp |
| 641 | | _sub_r32_imm(REG_ESP, 12); // sub esp,12 |
| 642 | | _call((genf *)update_cycle_counting); // call update_cycle_counting |
| 724 | _push_imm(&mips3.core); // sub esp,12 |
| 725 | _call((genf *)mips3com_update_cycle_counting); // call update_cycle_counting |
| 643 | 726 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 644 | 727 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 645 | 728 | } |
| r869 | r870 | |
| 652 | 735 | static void append_check_interrupts(drc_core *drc, int inline_generate) |
| 653 | 736 | { |
| 654 | 737 | link_info link1, link2, link3; |
| 655 | | _mov_r32_m32abs(REG_EAX, &mips3.cpr[0][COP0_Cause]); // mov eax,[mips3.cpr[0][COP0_Cause]] |
| 656 | | _and_r32_m32abs(REG_EAX, &mips3.cpr[0][COP0_Status]); // and eax,[mips3.cpr[0][COP0_Status]] |
| 738 | _mov_r32_m32abs(REG_EAX, &mips3.core.cpr[0][COP0_Cause]); // mov eax,[mips3.core.cpr[0][COP0_Cause]] |
| 739 | _and_r32_m32abs(REG_EAX, &mips3.core.cpr[0][COP0_Status]); // and eax,[mips3.core.cpr[0][COP0_Status]] |
| 657 | 740 | _and_r32_imm(REG_EAX, 0xfc00); // and eax,0xfc00 |
| 658 | 741 | if (!inline_generate) |
| 659 | 742 | _jcc_short_link(COND_Z, &link1); // jz skip |
| 660 | 743 | else |
| 661 | 744 | _jcc_near_link(COND_Z, &link1); // jz skip |
| 662 | | _test_m32abs_imm(&mips3.cpr[0][COP0_Status], SR_IE); // test [mips3.cpr[0][COP0_Status],SR_IE |
| 745 | _test_m32abs_imm(&mips3.core.cpr[0][COP0_Status], SR_IE); // test [mips3.core.cpr[0][COP0_Status],SR_IE |
| 663 | 746 | if (!inline_generate) |
| 664 | 747 | _jcc_short_link(COND_Z, &link2); // jz skip |
| 665 | 748 | else |
| 666 | 749 | _jcc_near_link(COND_Z, &link2); // jz skip |
| 667 | | _test_m32abs_imm(&mips3.cpr[0][COP0_Status], SR_EXL | SR_ERL); // test [mips3.cpr[0][COP0_Status],SR_EXL | SR_ERL |
| 750 | _test_m32abs_imm(&mips3.core.cpr[0][COP0_Status], SR_EXL | SR_ERL); // test [mips3.core.cpr[0][COP0_Status],SR_EXL | SR_ERL |
| 668 | 751 | if (!inline_generate) |
| 669 | | _jcc(COND_Z, mips3.generate_interrupt_exception); // jz generate_interrupt_exception |
| 752 | _jcc(COND_Z, mips3.drc->generate_interrupt_exception); // jz generate_interrupt_exception |
| 670 | 753 | else |
| 671 | 754 | { |
| 672 | 755 | _jcc_near_link(COND_NZ, &link3); // jnz skip |
| r869 | r870 | |
| 684 | 767 | |
| 685 | 768 | static void append_check_sw_interrupts(drc_core *drc, int inline_generate) |
| 686 | 769 | { |
| 687 | | _test_m32abs_imm(&mips3.cpr[0][COP0_Cause], 0x300); // test [mips3.cpr[0][COP0_Cause]],0x300 |
| 688 | | _jcc(COND_NZ, mips3.generate_interrupt_exception); // jnz generate_interrupt_exception |
| 770 | _test_m32abs_imm(&mips3.core.cpr[0][COP0_Cause], 0x300); // test [mips3.core.cpr[0][COP0_Cause]],0x300 |
| 771 | _jcc(COND_NZ, mips3.drc->generate_interrupt_exception); // jnz generate_interrupt_exception |
| 689 | 772 | } |
| 690 | 773 | |
| 691 | 774 | |
| r869 | r870 | |
| 711 | 794 | USEFUL PRIMITIVES |
| 712 | 795 | ***************************************************************************/ |
| 713 | 796 | |
| 714 | | #define REGDISP(reg) offsetof(mips3_regs, r[reg]) - offsetof(mips3_regs, r[17]) |
| 797 | #define REGDISP(reg) offsetof(mips3_regs, core.r[reg]) - offsetof(mips3_regs, core.r[17]) |
| 715 | 798 | |
| 716 | 799 | #define _zero_m64abs(addr) \ |
| 717 | 800 | do { \ |
| r869 | r870 | |
| 798 | 881 | } while (0) |
| 799 | 882 | |
| 800 | 883 | #define FPR32(x) \ |
| 801 | | (IS_FR0 ? &((float *)&mips3.cpr[1][0])[x] : \ |
| 802 | | (float *)&mips3.cpr[1][x]) \ |
| 884 | (IS_FR0 ? &((float *)&mips3.core.cpr[1][0])[x] :\ |
| 885 | (float *)&mips3.core.cpr[1][x]) \ |
| 803 | 886 | |
| 804 | 887 | #define FPR64(x) \ |
| 805 | | (IS_FR0 ? (double *)&mips3.cpr[1][(x)/2] : \ |
| 806 | | (double *)&mips3.cpr[1][x]) \ |
| 888 | (IS_FR0 ? (double *)&mips3.core.cpr[1][(x)/2] : \ |
| 889 | (double *)&mips3.core.cpr[1][x]) \ |
| 807 | 890 | |
| 808 | 891 | |
| 809 | 892 | /*************************************************************************** |
| r869 | r870 | |
| 814 | 897 | { |
| 815 | 898 | if (*rt) |
| 816 | 899 | { |
| 817 | | mips3.lo = *rs / *rt; |
| 818 | | mips3.hi = *rs % *rt; |
| 900 | mips3.core.lo = *rs / *rt; |
| 901 | mips3.core.hi = *rs % *rt; |
| 819 | 902 | } |
| 820 | 903 | } |
| 821 | 904 | |
| r869 | r870 | |
| 823 | 906 | { |
| 824 | 907 | if (*rt) |
| 825 | 908 | { |
| 826 | | mips3.lo = *rs / *rt; |
| 827 | | mips3.hi = *rs % *rt; |
| 909 | mips3.core.lo = *rs / *rt; |
| 910 | mips3.core.hi = *rs % *rt; |
| 828 | 911 | } |
| 829 | 912 | } |
| 830 | 913 | |
| r869 | r870 | |
| 853 | 936 | /* recompile the instruction as-is */ |
| 854 | 937 | in_delay_slot = 1; |
| 855 | 938 | physpc = pc; |
| 856 | | translate_address(ADDRESS_SPACE_PROGRAM, &physpc); |
| 939 | mips3com_translate_address(&mips3.core, ADDRESS_SPACE_PROGRAM, &physpc); |
| 857 | 940 | result = recompile_instruction(drc, pc, physpc); // <next instruction> |
| 858 | 941 | in_delay_slot = 0; |
| 859 | 942 | |
| r869 | r870 | |
| 1057 | 1140 | { |
| 1058 | 1141 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| 1059 | 1142 | _add_r32_imm(REG_EAX, SIMMVAL); // add eax,SIMMVAL |
| 1060 | | _jcc(COND_O, mips3.generate_overflow_exception); // jo generate_overflow_exception |
| 1143 | _jcc(COND_O, mips3.drc->generate_overflow_exception); // jo generate_overflow_exception |
| 1061 | 1144 | if (RTREG != 0) |
| 1062 | 1145 | { |
| 1063 | 1146 | _cdq(); // cdq |
| r869 | r870 | |
| 1193 | 1276 | return recompile_cop1(drc, pc, op) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 1194 | 1277 | |
| 1195 | 1278 | case 0x12: /* COP2 */ |
| 1196 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 1279 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 1197 | 1280 | return RECOMPILE_SUCCESSFUL | RECOMPILE_MAY_CAUSE_EXCEPTION | RECOMPILE_END_OF_STRING; |
| 1198 | 1281 | |
| 1199 | 1282 | case 0x13: /* COP1X - R5000 */ |
| 1200 | | if (!mips3.is_mips4) |
| 1283 | if (mips3.core.flavor < MIPS3_TYPE_MIPS_IV) |
| 1201 | 1284 | { |
| 1202 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 1285 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 1203 | 1286 | return RECOMPILE_SUCCESSFUL | RECOMPILE_MAY_CAUSE_EXCEPTION | RECOMPILE_END_OF_STRING; |
| 1204 | 1287 | } |
| 1205 | 1288 | return recompile_cop1x(drc, pc, op) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| r869 | r870 | |
| 1317 | 1400 | _mov_r64_m64bd(REG_EDX, REG_EAX, REG_ESI, REGDISP(RSREG)); // mov edx:eax,[rsreg] |
| 1318 | 1401 | _add_r32_imm(REG_EAX, SIMMVAL); // add eax,SIMMVAL |
| 1319 | 1402 | _adc_r32_imm(REG_EDX, (SIMMVAL < 0) ? -1 : 0); // adc edx,signext(SIMMVAL) |
| 1320 | | _jcc(COND_O, mips3.generate_overflow_exception); // jo generate_overflow_exception |
| 1403 | _jcc(COND_O, mips3.drc->generate_overflow_exception); // jo generate_overflow_exception |
| 1321 | 1404 | if (RTREG != 0) |
| 1322 | 1405 | _mov_m64bd_r64(REG_ESI, REGDISP(RTREG), REG_EDX, REG_EAX); // mov [rtreg],edx:eax |
| 1323 | 1406 | } |
| r869 | r870 | |
| 1350 | 1433 | _push_r32(REG_EAX); // push eax |
| 1351 | 1434 | _and_r32_imm(REG_EAX, ~7); // and eax,~7 |
| 1352 | 1435 | _push_r32(REG_EAX); // push eax |
| 1353 | | _call((genf *)mips3.read_and_translate_double); // call read_and_translate_double |
| 1436 | _call((genf *)mips3.drc->read_and_translate_double); // call read_and_translate_double |
| 1354 | 1437 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| 1355 | 1438 | _pop_r32(REG_ECX); // pop ecx |
| 1356 | 1439 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| r869 | r870 | |
| 1359 | 1442 | { |
| 1360 | 1443 | _and_r32_imm(REG_ECX, 7); // and ecx,7 |
| 1361 | 1444 | _shl_r32_imm(REG_ECX, 3); // shl ecx,3 |
| 1362 | | if (!mips3.bigendian) |
| 1445 | if (!mips3.core.bigendian) |
| 1363 | 1446 | _xor_r32_imm(REG_ECX, 0x38); // xor ecx,0x38 |
| 1364 | 1447 | _test_r32_imm(REG_ECX, 0x20); // test ecx,0x20 |
| 1365 | 1448 | _jcc_short_link(COND_Z, &link1); // jz skip |
| r869 | r870 | |
| 1389 | 1472 | _push_r32(REG_EAX); // push eax |
| 1390 | 1473 | _and_r32_imm(REG_EAX, ~7); // and eax,~7 |
| 1391 | 1474 | _push_r32(REG_EAX); // push eax |
| 1392 | | _call((genf *)mips3.read_and_translate_double); // call read_and_translate_double |
| 1475 | _call((genf *)mips3.drc->read_and_translate_double); // call read_and_translate_double |
| 1393 | 1476 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| 1394 | 1477 | _pop_r32(REG_ECX); // pop ecx |
| 1395 | 1478 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| r869 | r870 | |
| 1398 | 1481 | { |
| 1399 | 1482 | _and_r32_imm(REG_ECX, 7); // and ecx,7 |
| 1400 | 1483 | _shl_r32_imm(REG_ECX, 3); // shl ecx,3 |
| 1401 | | if (mips3.bigendian) |
| 1484 | if (mips3.core.bigendian) |
| 1402 | 1485 | _xor_r32_imm(REG_ECX, 0x38); // xor ecx,0x38 |
| 1403 | 1486 | _test_r32_imm(REG_ECX, 0x20); // test ecx,0x20 |
| 1404 | 1487 | _jcc_short_link(COND_Z, &link1); // jz skip |
| r869 | r870 | |
| 1424 | 1507 | case 0: /* MAD */ |
| 1425 | 1508 | if (RSREG != 0 && RTREG != 0) |
| 1426 | 1509 | { |
| 1427 | | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| 1428 | | _mov_r32_m32bd(REG_EDX, REG_ESI, REGDISP(RTREG)); // mov edx,[rtreg] |
| 1429 | | _imul_r32(REG_EDX); // imul edx |
| 1430 | | _add_r32_m32abs(REG_EAX, &mips3.lo); // add eax,[lo] |
| 1431 | | _adc_r32_m32abs(REG_EDX, &mips3.hi); // adc edx,[hi] |
| 1432 | | _mov_r32_r32(REG_EBX, REG_EDX); // mov ebx,edx |
| 1433 | | _cdq(); // cdq |
| 1434 | | _mov_m64abs_r64(&mips3.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 1435 | | _mov_r32_r32(REG_EAX, REG_EBX); // mov eax,ebx |
| 1436 | | _cdq(); // cdq |
| 1437 | | _mov_m64abs_r64(&mips3.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 1510 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| 1511 | _mov_r32_m32bd(REG_EDX, REG_ESI, REGDISP(RTREG)); // mov edx,[rtreg] |
| 1512 | _imul_r32(REG_EDX); // imul edx |
| 1513 | _add_r32_m32abs(REG_EAX, &mips3.core.lo); // add eax,[lo] |
| 1514 | _adc_r32_m32abs(REG_EDX, &mips3.core.hi); // adc edx,[hi] |
| 1515 | _mov_r32_r32(REG_EBX, REG_EDX); // mov ebx,edx |
| 1516 | _cdq(); // cdq |
| 1517 | _mov_m64abs_r64(&mips3.core.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 1518 | _mov_r32_r32(REG_EAX, REG_EBX); // mov eax,ebx |
| 1519 | _cdq(); // cdq |
| 1520 | _mov_m64abs_r64(&mips3.core.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 1438 | 1521 | } |
| 1439 | 1522 | return RECOMPILE_SUCCESSFUL_CP(3,4); |
| 1440 | 1523 | |
| 1441 | 1524 | case 1: /* MADU */ |
| 1442 | 1525 | if (RSREG != 0 && RTREG != 0) |
| 1443 | 1526 | { |
| 1444 | | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| 1445 | | _mov_r32_m32bd(REG_EDX, REG_ESI, REGDISP(RTREG)); // mov edx,[rtreg] |
| 1446 | | _mul_r32(REG_EDX); // mul edx |
| 1447 | | _add_r32_m32abs(REG_EAX, &mips3.lo); // add eax,[lo] |
| 1448 | | _adc_r32_m32abs(REG_EDX, &mips3.hi); // adc edx,[hi] |
| 1449 | | _mov_r32_r32(REG_EBX, REG_EDX); // mov ebx,edx |
| 1450 | | _cdq(); // cdq |
| 1451 | | _mov_m64abs_r64(&mips3.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 1452 | | _mov_r32_r32(REG_EAX, REG_EBX); // mov eax,ebx |
| 1453 | | _cdq(); // cdq |
| 1454 | | _mov_m64abs_r64(&mips3.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 1527 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| 1528 | _mov_r32_m32bd(REG_EDX, REG_ESI, REGDISP(RTREG)); // mov edx,[rtreg] |
| 1529 | _mul_r32(REG_EDX); // mul edx |
| 1530 | _add_r32_m32abs(REG_EAX, &mips3.core.lo); // add eax,[lo] |
| 1531 | _adc_r32_m32abs(REG_EDX, &mips3.core.hi); // adc edx,[hi] |
| 1532 | _mov_r32_r32(REG_EBX, REG_EDX); // mov ebx,edx |
| 1533 | _cdq(); // cdq |
| 1534 | _mov_m64abs_r64(&mips3.core.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 1535 | _mov_r32_r32(REG_EAX, REG_EBX); // mov eax,ebx |
| 1536 | _cdq(); // cdq |
| 1537 | _mov_m64abs_r64(&mips3.core.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 1455 | 1538 | } |
| 1456 | 1539 | return RECOMPILE_SUCCESSFUL_CP(3,4); |
| 1457 | 1540 | |
| r869 | r870 | |
| 1486 | 1569 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1487 | 1570 | else |
| 1488 | 1571 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1489 | | _call(mips3.read_and_translate_byte_signed); // call read_and_translate_byte_signed |
| 1572 | _call(mips3.drc->read_and_translate_byte_signed); // call read_and_translate_byte_signed |
| 1490 | 1573 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1491 | 1574 | if (RTREG != 0) |
| 1492 | 1575 | { |
| r869 | r870 | |
| 1510 | 1593 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1511 | 1594 | else |
| 1512 | 1595 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1513 | | _call(mips3.read_and_translate_word_signed); // call read_and_translate_word_signed |
| 1596 | _call(mips3.drc->read_and_translate_word_signed); // call read_and_translate_word_signed |
| 1514 | 1597 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1515 | 1598 | if (RTREG != 0) |
| 1516 | 1599 | { |
| r869 | r870 | |
| 1530 | 1613 | _push_r32(REG_EAX); // push eax |
| 1531 | 1614 | _and_r32_imm(REG_EAX, ~3); // and eax,~3 |
| 1532 | 1615 | _push_r32(REG_EAX); // push eax |
| 1533 | | _call((genf *)mips3.read_and_translate_long); // call read_and_translate_long |
| 1616 | _call((genf *)mips3.drc->read_and_translate_long); // call read_and_translate_long |
| 1534 | 1617 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| 1535 | 1618 | _pop_r32(REG_ECX); // pop ecx |
| 1536 | 1619 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| r869 | r870 | |
| 1539 | 1622 | { |
| 1540 | 1623 | _and_r32_imm(REG_ECX, 3); // and ecx,3 |
| 1541 | 1624 | _shl_r32_imm(REG_ECX, 3); // shl ecx,3 |
| 1542 | | if (!mips3.bigendian) |
| 1625 | if (!mips3.core.bigendian) |
| 1543 | 1626 | _xor_r32_imm(REG_ECX, 0x18); // xor ecx,0x18 |
| 1544 | 1627 | _shl_r32_cl(REG_EAX); // shl eax,cl |
| 1545 | 1628 | _mov_r32_m32bd(REG_EBX, REG_ESI, REGDISP(RTREG)); // mov ebx,[rtreg].lo |
| r869 | r870 | |
| 1565 | 1648 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1566 | 1649 | else |
| 1567 | 1650 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1568 | | _call(mips3.read_and_translate_long); // call read_and_translate_long |
| 1651 | _call(mips3.drc->read_and_translate_long); // call read_and_translate_long |
| 1569 | 1652 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1570 | 1653 | if (RTREG != 0) |
| 1571 | 1654 | { |
| r869 | r870 | |
| 1589 | 1672 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1590 | 1673 | else |
| 1591 | 1674 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1592 | | _call(mips3.read_and_translate_byte_unsigned); // call read_and_translate_byte_unsigned |
| 1675 | _call(mips3.drc->read_and_translate_byte_unsigned); // call read_and_translate_byte_unsigned |
| 1593 | 1676 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1594 | 1677 | if (RTREG != 0) |
| 1595 | 1678 | { |
| r869 | r870 | |
| 1613 | 1696 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1614 | 1697 | else |
| 1615 | 1698 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1616 | | _call(mips3.read_and_translate_word_unsigned); // call read_and_translate_word_unsigned |
| 1699 | _call(mips3.drc->read_and_translate_word_unsigned); // call read_and_translate_word_unsigned |
| 1617 | 1700 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1618 | 1701 | if (RTREG != 0) |
| 1619 | 1702 | { |
| r869 | r870 | |
| 1633 | 1716 | _push_r32(REG_EAX); // push eax |
| 1634 | 1717 | _and_r32_imm(REG_EAX, ~3); // and eax,~3 |
| 1635 | 1718 | _push_r32(REG_EAX); // push eax |
| 1636 | | _call((genf *)mips3.read_and_translate_long); // call read_and_translate_long |
| 1719 | _call((genf *)mips3.drc->read_and_translate_long); // call read_and_translate_long |
| 1637 | 1720 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| 1638 | 1721 | _pop_r32(REG_ECX); // pop ecx |
| 1639 | 1722 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| r869 | r870 | |
| 1642 | 1725 | { |
| 1643 | 1726 | _and_r32_imm(REG_ECX, 3); // and ecx,3 |
| 1644 | 1727 | _shl_r32_imm(REG_ECX, 3); // shl ecx,3 |
| 1645 | | if (mips3.bigendian) |
| 1728 | if (mips3.core.bigendian) |
| 1646 | 1729 | _xor_r32_imm(REG_ECX, 0x18); // xor ecx,0x18 |
| 1647 | 1730 | _shr_r32_cl(REG_EAX); // shr eax,cl |
| 1648 | 1731 | _mov_r32_m32bd(REG_EBX, REG_ESI, REGDISP(RTREG)); // mov ebx,[rtreg].lo |
| r869 | r870 | |
| 1668 | 1751 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1669 | 1752 | else |
| 1670 | 1753 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1671 | | _call(mips3.read_and_translate_long); // call read_and_translate_long |
| 1754 | _call(mips3.drc->read_and_translate_long); // call read_and_translate_long |
| 1672 | 1755 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1673 | 1756 | if (RTREG != 0) |
| 1674 | 1757 | { |
| r869 | r870 | |
| 1696 | 1779 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1697 | 1780 | else |
| 1698 | 1781 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1699 | | _call(mips3.write_and_translate_byte); // call writebyte |
| 1782 | _call(mips3.drc->write_and_translate_byte); // call writebyte |
| 1700 | 1783 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1701 | 1784 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 1702 | 1785 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 1719 | 1802 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1720 | 1803 | else |
| 1721 | 1804 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1722 | | _call(mips3.write_and_translate_word); // call writeword |
| 1805 | _call(mips3.drc->write_and_translate_word); // call writeword |
| 1723 | 1806 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1724 | 1807 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 1725 | 1808 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 1734 | 1817 | _push_r32(REG_EAX); // push eax |
| 1735 | 1818 | _and_r32_imm(REG_EAX, ~3); // and eax,~3 |
| 1736 | 1819 | _push_r32(REG_EAX); // push eax |
| 1737 | | _call((genf *)mips3.read_and_translate_long); // call read_and_translate_long |
| 1820 | _call((genf *)mips3.drc->read_and_translate_long); // call read_and_translate_long |
| 1738 | 1821 | _mov_r32_m32bd(REG_ECX, REG_ESP, 4); // mov ecx,[esp+4] |
| 1739 | 1822 | _add_r32_imm(REG_ESP, 8); // add esp,8 |
| 1740 | 1823 | |
| 1741 | 1824 | _and_r32_imm(REG_ECX, 3); // and ecx,3 |
| 1742 | 1825 | _shl_r32_imm(REG_ECX, 3); // shl ecx,3 |
| 1743 | | if (!mips3.bigendian) |
| 1826 | if (!mips3.core.bigendian) |
| 1744 | 1827 | _xor_r32_imm(REG_ECX, 0x18); // xor ecx,0x18 |
| 1745 | 1828 | |
| 1746 | 1829 | _and_r32_m32bd(REG_EAX, REG_ECX, sdl_mask); // and eax,[sdl_mask + ecx] |
| r869 | r870 | |
| 1754 | 1837 | |
| 1755 | 1838 | _push_r32(REG_EAX); // push eax |
| 1756 | 1839 | _push_r32(REG_EBX); // push ebx |
| 1757 | | _call((genf *)mips3.write_back_long); // call writelong |
| 1840 | _call((genf *)mips3.drc->write_back_long); // call writelong |
| 1758 | 1841 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1759 | 1842 | |
| 1760 | 1843 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| r869 | r870 | |
| 1778 | 1861 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1779 | 1862 | else |
| 1780 | 1863 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1781 | | _call(mips3.write_and_translate_long); // call write_and_translate_long |
| 1864 | _call(mips3.drc->write_and_translate_long); // call write_and_translate_long |
| 1782 | 1865 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1783 | 1866 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 1784 | 1867 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 1793 | 1876 | _push_r32(REG_EAX); // push eax |
| 1794 | 1877 | _and_r32_imm(REG_EAX, ~7); // and eax,~7 |
| 1795 | 1878 | _push_r32(REG_EAX); // push eax |
| 1796 | | _call((genf *)mips3.read_and_translate_double); // call read_and_translate_double |
| 1879 | _call((genf *)mips3.drc->read_and_translate_double); // call read_and_translate_double |
| 1797 | 1880 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| 1798 | 1881 | _pop_r32(REG_ECX); // pop ecx |
| 1799 | 1882 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| 1800 | 1883 | |
| 1801 | 1884 | _and_r32_imm(REG_ECX, 7); // and ecx,7 |
| 1802 | 1885 | _shl_r32_imm(REG_ECX, 3); // shl ecx,3 |
| 1803 | | if (!mips3.bigendian) |
| 1886 | if (!mips3.core.bigendian) |
| 1804 | 1887 | _xor_r32_imm(REG_ECX, 0x38); // xor ecx,0x38 |
| 1805 | 1888 | |
| 1806 | 1889 | _and_r32_m32bd(REG_EAX, REG_ECX, sdl_mask + 1); // and eax,[sdl_mask + ecx + 4] |
| r869 | r870 | |
| 1811 | 1894 | _push_r32(REG_EBX); // push ebx |
| 1812 | 1895 | _push_r32(REG_ESI); // push esi |
| 1813 | 1896 | _test_r32_imm(REG_ECX, 0x20); // test ecx,0x20 |
| 1814 | | _mov_r64_m64abs(REG_ESI, REG_EBX, &mips3.r[RTREG]); // mov esi:ebx,[rtreg] |
| 1897 | _mov_r64_m64abs(REG_ESI, REG_EBX, &mips3.core.r[RTREG]); // mov esi:ebx,[rtreg] |
| 1815 | 1898 | _jcc_short_link(COND_Z, &link1); // jz skip |
| 1816 | 1899 | _mov_r32_r32(REG_EBX, REG_ESI); // mov ebx,esi |
| 1817 | 1900 | _xor_r32_r32(REG_ESI, REG_ESI); // xor esi,esi |
| r869 | r870 | |
| 1827 | 1910 | _push_r32(REG_EDX); // push edx |
| 1828 | 1911 | _push_r32(REG_EAX); // push eax |
| 1829 | 1912 | _push_r32(REG_EBX); // push ebx |
| 1830 | | _call((genf *)mips3.write_back_double); // call write_back_double |
| 1913 | _call((genf *)mips3.drc->write_back_double); // call write_back_double |
| 1831 | 1914 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1832 | 1915 | |
| 1833 | 1916 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| r869 | r870 | |
| 1843 | 1926 | _push_r32(REG_EAX); // push eax |
| 1844 | 1927 | _and_r32_imm(REG_EAX, ~7); // and eax,~7 |
| 1845 | 1928 | _push_r32(REG_EAX); // push eax |
| 1846 | | _call((genf *)mips3.read_and_translate_double); // call read_and_translate_double |
| 1929 | _call((genf *)mips3.drc->read_and_translate_double); // call read_and_translate_double |
| 1847 | 1930 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| 1848 | 1931 | _pop_r32(REG_ECX); // pop ecx |
| 1849 | 1932 | _add_r32_imm(REG_ESP, 4); // add esp,4 |
| 1850 | 1933 | |
| 1851 | 1934 | _and_r32_imm(REG_ECX, 7); // and ecx,7 |
| 1852 | 1935 | _shl_r32_imm(REG_ECX, 3); // shl ecx,3 |
| 1853 | | if (mips3.bigendian) |
| 1936 | if (mips3.core.bigendian) |
| 1854 | 1937 | _xor_r32_imm(REG_ECX, 0x38); // xor ecx,0x38 |
| 1855 | 1938 | |
| 1856 | 1939 | _and_r32_m32bd(REG_EAX, REG_ECX, sdr_mask + 1); // and eax,[sdr_mask + ecx + 4] |
| r869 | r870 | |
| 1861 | 1944 | _push_r32(REG_EBX); // push ebx |
| 1862 | 1945 | _push_r32(REG_ESI); // push esi |
| 1863 | 1946 | _test_r32_imm(REG_ECX, 0x20); // test ecx,0x20 |
| 1864 | | _mov_r64_m64abs(REG_ESI, REG_EBX, &mips3.r[RTREG]); // mov esi:ebx,[rtreg] |
| 1947 | _mov_r64_m64abs(REG_ESI, REG_EBX, &mips3.core.r[RTREG]); // mov esi:ebx,[rtreg] |
| 1865 | 1948 | _jcc_short_link(COND_Z, &link1); // jz skip |
| 1866 | 1949 | _mov_r32_r32(REG_ESI, REG_EBX); // mov esi,ebx |
| 1867 | 1950 | _xor_r32_r32(REG_EBX, REG_EBX); // xor ebx,ebx |
| r869 | r870 | |
| 1877 | 1960 | _push_r32(REG_EDX); // push edx |
| 1878 | 1961 | _push_r32(REG_EAX); // push eax |
| 1879 | 1962 | _push_r32(REG_EBX); // push ebx |
| 1880 | | _call((genf *)mips3.write_back_double); // call write_back_double |
| 1963 | _call((genf *)mips3.drc->write_back_double); // call write_back_double |
| 1881 | 1964 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1882 | 1965 | |
| 1883 | 1966 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| r869 | r870 | |
| 1893 | 1976 | _push_r32(REG_EAX); // push eax |
| 1894 | 1977 | _and_r32_imm(REG_EAX, ~3); // and eax,~3 |
| 1895 | 1978 | _push_r32(REG_EAX); // push eax |
| 1896 | | _call((genf *)mips3.read_and_translate_long); // call read_and_translate_long |
| 1979 | _call((genf *)mips3.drc->read_and_translate_long); // call read_and_translate_long |
| 1897 | 1980 | _mov_r32_m32bd(REG_ECX, REG_ESP, 4); // mov ecx,[esp+4] |
| 1898 | 1981 | _add_r32_imm(REG_ESP, 8); // add esp,8 |
| 1899 | 1982 | |
| 1900 | 1983 | _and_r32_imm(REG_ECX, 3); // and ecx,3 |
| 1901 | 1984 | _shl_r32_imm(REG_ECX, 3); // shl ecx,3 |
| 1902 | | if (mips3.bigendian) |
| 1985 | if (mips3.core.bigendian) |
| 1903 | 1986 | _xor_r32_imm(REG_ECX, 0x18); // xor ecx,0x18 |
| 1904 | 1987 | |
| 1905 | 1988 | _and_r32_m32bd(REG_EAX, REG_ECX, sdr_mask + 1); // and eax,[sdr_mask + ecx + 4] |
| r869 | r870 | |
| 1913 | 1996 | |
| 1914 | 1997 | _push_r32(REG_EAX); // push eax |
| 1915 | 1998 | _push_r32(REG_EBX); // push ebx |
| 1916 | | _call((genf *)mips3.write_back_long); // call write_back_long |
| 1999 | _call((genf *)mips3.drc->write_back_long); // call write_back_long |
| 1917 | 2000 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1918 | 2001 | |
| 1919 | 2002 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| r869 | r870 | |
| 1938 | 2021 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1939 | 2022 | else |
| 1940 | 2023 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1941 | | _call(mips3.read_and_translate_long); // call read_and_translate_long |
| 2024 | _call(mips3.drc->read_and_translate_long); // call read_and_translate_long |
| 1942 | 2025 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1943 | 2026 | _mov_m32abs_r32(FPR32(RTREG), REG_EAX); // mov [rtreg],eax |
| 1944 | 2027 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| r869 | r870 | |
| 1958 | 2041 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1959 | 2042 | else |
| 1960 | 2043 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1961 | | _call(mips3.read_and_translate_long); // call read_and_translate_long |
| 2044 | _call(mips3.drc->read_and_translate_long); // call read_and_translate_long |
| 1962 | 2045 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 1963 | | _mov_m32abs_r32(&mips3.cpr[2][RTREG], REG_EAX); // mov [rtreg],eax |
| 2046 | _mov_m32abs_r32(&mips3.core.cpr[2][RTREG], REG_EAX); // mov [rtreg],eax |
| 1964 | 2047 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 1965 | 2048 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 1966 | 2049 | |
| 1967 | 2050 | case 0x33: /* PREF */ |
| 1968 | | if (mips3.is_mips4) |
| 2051 | if (mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) |
| 1969 | 2052 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 1970 | 2053 | else |
| 1971 | 2054 | { |
| 1972 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 2055 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 1973 | 2056 | return RECOMPILE_SUCCESSFUL | RECOMPILE_MAY_CAUSE_EXCEPTION | RECOMPILE_END_OF_STRING; |
| 1974 | 2057 | } |
| 1975 | 2058 | |
| r869 | r870 | |
| 1989 | 2072 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 1990 | 2073 | else |
| 1991 | 2074 | _push_imm(SIMMVAL); // push SIMMVAL |
| 1992 | | _call((genf *)mips3.read_and_translate_double); // call read_and_translate_double |
| 2075 | _call((genf *)mips3.drc->read_and_translate_double); // call read_and_translate_double |
| 1993 | 2076 | _mov_m32abs_r32(LO(FPR64(RTREG)), REG_EAX); // mov [rtreg].lo,eax |
| 1994 | 2077 | _mov_m32abs_r32(HI(FPR64(RTREG)), REG_EDX); // mov [rtreg].hi,edx |
| 1995 | 2078 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| r869 | r870 | |
| 2010 | 2093 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 2011 | 2094 | else |
| 2012 | 2095 | _push_imm(SIMMVAL); // push SIMMVAL |
| 2013 | | _call((genf *)mips3.read_and_translate_double); // call read_and_translate_long |
| 2014 | | _mov_m32abs_r32(LO(&mips3.cpr[2][RTREG]), REG_EAX); // mov [rtreg].lo,eax |
| 2015 | | _mov_m32abs_r32(HI(&mips3.cpr[2][RTREG]), REG_EDX); // mov [rtreg].hi,edx |
| 2096 | _call((genf *)mips3.drc->read_and_translate_double); // call read_and_translate_long |
| 2097 | _mov_m32abs_r32(LO(&mips3.core.cpr[2][RTREG]), REG_EAX); // mov [rtreg].lo,eax |
| 2098 | _mov_m32abs_r32(HI(&mips3.core.cpr[2][RTREG]), REG_EDX); // mov [rtreg].hi,edx |
| 2016 | 2099 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 2017 | 2100 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 2018 | 2101 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 2031 | 2114 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 2032 | 2115 | else |
| 2033 | 2116 | _push_imm(SIMMVAL); // push SIMMVAL |
| 2034 | | _call((genf *)mips3.read_and_translate_double); // call read_and_translate_double |
| 2117 | _call((genf *)mips3.drc->read_and_translate_double); // call read_and_translate_double |
| 2035 | 2118 | if (RTREG != 0) |
| 2036 | 2119 | { |
| 2037 | 2120 | _mov_m32bd_r32(REG_ESI, REGDISP(RTREG), REG_EAX); // mov [rtreg].lo,eax |
| r869 | r870 | |
| 2059 | 2142 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 2060 | 2143 | else |
| 2061 | 2144 | _push_imm(SIMMVAL); // push SIMMVAL |
| 2062 | | _call(mips3.write_and_translate_long); // call write_and_translate_long |
| 2145 | _call(mips3.drc->write_and_translate_long); // call write_and_translate_long |
| 2063 | 2146 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 2064 | 2147 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 2065 | 2148 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 2068 | 2151 | _mov_m32abs_r32(&mips3_icount, REG_EBP); // mov [mips3_icount],ebp |
| 2069 | 2152 | _save_pc_before_call(); // save pc |
| 2070 | 2153 | _sub_r32_imm(REG_ESP, 4); // sub esp,4 |
| 2071 | | _push_m32abs(&mips3.cpr[2][RTREG]); // push dword [rtreg] |
| 2154 | _push_m32abs(&mips3.core.cpr[2][RTREG]); // push dword [rtreg] |
| 2072 | 2155 | if (RSREG != 0 && SIMMVAL != 0) |
| 2073 | 2156 | { |
| 2074 | 2157 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| r869 | r870 | |
| 2079 | 2162 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 2080 | 2163 | else |
| 2081 | 2164 | _push_imm(SIMMVAL); // push SIMMVAL |
| 2082 | | _call(mips3.write_and_translate_long); // call write_and_translate_long |
| 2165 | _call(mips3.drc->write_and_translate_long); // call write_and_translate_long |
| 2083 | 2166 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 2084 | 2167 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 2085 | 2168 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 2102 | 2185 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 2103 | 2186 | else |
| 2104 | 2187 | _push_imm(SIMMVAL); // push SIMMVAL |
| 2105 | | _call((genf *)mips3.write_and_translate_double); // call write_and_translate_double |
| 2188 | _call((genf *)mips3.drc->write_and_translate_double); // call write_and_translate_double |
| 2106 | 2189 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 2107 | 2190 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 2108 | 2191 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 2110 | 2193 | case 0x3e: /* SDC2 */ |
| 2111 | 2194 | _mov_m32abs_r32(&mips3_icount, REG_EBP); // mov [mips3_icount],ebp |
| 2112 | 2195 | _save_pc_before_call(); // save pc |
| 2113 | | _push_m32abs(HI(&mips3.cpr[2][RTREG])); // push dword [rtreg].hi |
| 2114 | | _push_m32abs(LO(&mips3.cpr[2][RTREG])); // push dword [rtreg].lo |
| 2196 | _push_m32abs(HI(&mips3.core.cpr[2][RTREG])); // push dword [rtreg].hi |
| 2197 | _push_m32abs(LO(&mips3.core.cpr[2][RTREG])); // push dword [rtreg].lo |
| 2115 | 2198 | if (RSREG != 0 && SIMMVAL != 0) |
| 2116 | 2199 | { |
| 2117 | 2200 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| r869 | r870 | |
| 2122 | 2205 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 2123 | 2206 | else |
| 2124 | 2207 | _push_imm(SIMMVAL); // push SIMMVAL |
| 2125 | | _call((genf *)mips3.write_and_translate_double); // call write_and_translate_double |
| 2208 | _call((genf *)mips3.drc->write_and_translate_double); // call write_and_translate_double |
| 2126 | 2209 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 2127 | 2210 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 2128 | 2211 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 2150 | 2233 | _push_m32bd(REG_ESI, REGDISP(RSREG)); // push [rsreg] |
| 2151 | 2234 | else |
| 2152 | 2235 | _push_imm(SIMMVAL); // push SIMMVAL |
| 2153 | | _call((genf *)mips3.write_and_translate_double); // call write_and_translate_double |
| 2236 | _call((genf *)mips3.drc->write_and_translate_double); // call write_and_translate_double |
| 2154 | 2237 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 2155 | 2238 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 2156 | 2239 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 2189 | 2272 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 2190 | 2273 | |
| 2191 | 2274 | case 0x01: /* MOVF - R5000*/ |
| 2192 | | if (!mips3.is_mips4) |
| 2275 | if (mips3.core.flavor < MIPS3_TYPE_MIPS_IV) |
| 2193 | 2276 | { |
| 2194 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 2277 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 2195 | 2278 | return RECOMPILE_SUCCESSFUL | RECOMPILE_MAY_CAUSE_EXCEPTION | RECOMPILE_END_OF_STRING; |
| 2196 | 2279 | } |
| 2197 | | _cmp_m8abs_imm(&mips3.cf[1][(op >> 18) & 7], 0); // cmp [cf[x]],0 |
| 2280 | _cmp_m8abs_imm(&mips3.core.cf[1][(op >> 18) & 7], 0); // cmp [cf[x]],0 |
| 2198 | 2281 | _jcc_short_link(((op >> 16) & 1) ? COND_Z : COND_NZ, &link1); // jz/nz skip |
| 2199 | 2282 | _mov_r64_m64bd(REG_EDX, REG_EAX, REG_ESI, REGDISP(RSREG)); // mov edx:eax,[rsreg] |
| 2200 | 2283 | _mov_m64bd_r64(REG_ESI, REGDISP(RDREG), REG_EDX, REG_EAX); // mov [rdreg],edx:eax |
| r869 | r870 | |
| 2305 | 2388 | return RECOMPILE_SUCCESSFUL_CP(1+cycles,0) | RECOMPILE_END_OF_STRING | RECOMPILE_ADD_DISPATCH; |
| 2306 | 2389 | |
| 2307 | 2390 | case 0x0a: /* MOVZ - R5000 */ |
| 2308 | | if (!mips3.is_mips4) |
| 2391 | if (mips3.core.flavor < MIPS3_TYPE_MIPS_IV) |
| 2309 | 2392 | { |
| 2310 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 2393 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 2311 | 2394 | return RECOMPILE_SUCCESSFUL | RECOMPILE_MAY_CAUSE_EXCEPTION | RECOMPILE_END_OF_STRING; |
| 2312 | 2395 | } |
| 2313 | 2396 | if (RDREG != 0) |
| r869 | r870 | |
| 2321 | 2404 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 2322 | 2405 | |
| 2323 | 2406 | case 0x0b: /* MOVN - R5000 */ |
| 2324 | | if (!mips3.is_mips4) |
| 2407 | if (mips3.core.flavor < MIPS3_TYPE_MIPS_IV) |
| 2325 | 2408 | { |
| 2326 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 2409 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 2327 | 2410 | return RECOMPILE_SUCCESSFUL | RECOMPILE_MAY_CAUSE_EXCEPTION | RECOMPILE_END_OF_STRING; |
| 2328 | 2411 | } |
| 2329 | 2412 | if (RDREG != 0) |
| r869 | r870 | |
| 2337 | 2420 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 2338 | 2421 | |
| 2339 | 2422 | case 0x0c: /* SYSCALL */ |
| 2340 | | _jmp((void *)mips3.generate_syscall_exception); // jmp generate_syscall_exception |
| 2423 | _jmp((void *)mips3.drc->generate_syscall_exception); // jmp generate_syscall_exception |
| 2341 | 2424 | return RECOMPILE_SUCCESSFUL | RECOMPILE_MAY_CAUSE_EXCEPTION | RECOMPILE_END_OF_STRING; |
| 2342 | 2425 | |
| 2343 | 2426 | case 0x0d: /* BREAK */ |
| 2344 | | _jmp((void *)mips3.generate_break_exception); // jmp generate_break_exception |
| 2427 | _jmp((void *)mips3.drc->generate_break_exception); // jmp generate_break_exception |
| 2345 | 2428 | return RECOMPILE_SUCCESSFUL | RECOMPILE_MAY_CAUSE_EXCEPTION | RECOMPILE_END_OF_STRING; |
| 2346 | 2429 | |
| 2347 | 2430 | case 0x0f: /* SYNC */ |
| r869 | r870 | |
| 2349 | 2432 | |
| 2350 | 2433 | case 0x10: /* MFHI */ |
| 2351 | 2434 | if (RDREG != 0) |
| 2352 | | _mov_m64bd_m64abs(REG_ESI, REGDISP(RDREG), &mips3.hi); // mov [rdreg],[hi] |
| 2435 | _mov_m64bd_m64abs(REG_ESI, REGDISP(RDREG), &mips3.core.hi); // mov [rdreg],[hi] |
| 2353 | 2436 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 2354 | 2437 | |
| 2355 | 2438 | case 0x11: /* MTHI */ |
| 2356 | | _mov_m64abs_m64bd(&mips3.hi, REG_ESI, REGDISP(RSREG)); // mov [hi],[rsreg] |
| 2439 | _mov_m64abs_m64bd(&mips3.core.hi, REG_ESI, REGDISP(RSREG)); // mov [hi],[rsreg] |
| 2357 | 2440 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 2358 | 2441 | |
| 2359 | 2442 | case 0x12: /* MFLO */ |
| 2360 | 2443 | if (RDREG != 0) |
| 2361 | | _mov_m64bd_m64abs(REG_ESI, REGDISP(RDREG), &mips3.lo); // mov [rdreg],[lo] |
| 2444 | _mov_m64bd_m64abs(REG_ESI, REGDISP(RDREG), &mips3.core.lo); // mov [rdreg],[lo] |
| 2362 | 2445 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 2363 | 2446 | |
| 2364 | 2447 | case 0x13: /* MTLO */ |
| 2365 | | _mov_m64abs_m64bd(&mips3.lo, REG_ESI, REGDISP(RSREG)); // mov [lo],[rsreg] |
| 2448 | _mov_m64abs_m64bd(&mips3.core.lo, REG_ESI, REGDISP(RSREG)); // mov [lo],[rsreg] |
| 2366 | 2449 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 2367 | 2450 | |
| 2368 | 2451 | case 0x14: /* DSLLV */ |
| r869 | r870 | |
| 2443 | 2526 | _imul_r32(REG_ECX); // imul ecx |
| 2444 | 2527 | _push_r32(REG_EDX); // push edx |
| 2445 | 2528 | _cdq(); // cdq |
| 2446 | | _mov_m64abs_r64(&mips3.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 2529 | _mov_m64abs_r64(&mips3.core.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 2447 | 2530 | _pop_r32(REG_EAX); // pop eax |
| 2448 | 2531 | _cdq(); // cdq |
| 2449 | | _mov_m64abs_r64(&mips3.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 2532 | _mov_m64abs_r64(&mips3.core.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 2450 | 2533 | return RECOMPILE_SUCCESSFUL_CP(4,4); |
| 2451 | 2534 | |
| 2452 | 2535 | case 0x19: /* MULTU */ |
| r869 | r870 | |
| 2455 | 2538 | _mul_r32(REG_ECX); // mul ecx |
| 2456 | 2539 | _push_r32(REG_EDX); // push edx |
| 2457 | 2540 | _cdq(); // cdq |
| 2458 | | _mov_m64abs_r64(&mips3.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 2541 | _mov_m64abs_r64(&mips3.core.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 2459 | 2542 | _pop_r32(REG_EAX); // pop eax |
| 2460 | 2543 | _cdq(); // cdq |
| 2461 | | _mov_m64abs_r64(&mips3.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 2544 | _mov_m64abs_r64(&mips3.core.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 2462 | 2545 | return RECOMPILE_SUCCESSFUL_CP(4,4); |
| 2463 | 2546 | |
| 2464 | 2547 | case 0x1a: /* DIV */ |
| r869 | r870 | |
| 2472 | 2555 | _idiv_r32(REG_ECX); // idiv ecx |
| 2473 | 2556 | _push_r32(REG_EDX); // push edx |
| 2474 | 2557 | _cdq(); // cdq |
| 2475 | | _mov_m64abs_r64(&mips3.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 2558 | _mov_m64abs_r64(&mips3.core.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 2476 | 2559 | _pop_r32(REG_EAX); // pop eax |
| 2477 | 2560 | _cdq(); // cdq |
| 2478 | | _mov_m64abs_r64(&mips3.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 2561 | _mov_m64abs_r64(&mips3.core.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 2479 | 2562 | _resolve_link(&link1); // skip: |
| 2480 | 2563 | } |
| 2481 | 2564 | return RECOMPILE_SUCCESSFUL_CP(36,4); |
| r869 | r870 | |
| 2491 | 2574 | _div_r32(REG_ECX); // div ecx |
| 2492 | 2575 | _push_r32(REG_EDX); // push edx |
| 2493 | 2576 | _cdq(); // cdq |
| 2494 | | _mov_m64abs_r64(&mips3.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 2577 | _mov_m64abs_r64(&mips3.core.lo, REG_EDX, REG_EAX); // mov [lo],edx:eax |
| 2495 | 2578 | _pop_r32(REG_EAX); // pop eax |
| 2496 | 2579 | _cdq(); // cdq |
| 2497 | | _mov_m64abs_r64(&mips3.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 2580 | _mov_m64abs_r64(&mips3.core.hi, REG_EDX, REG_EAX); // mov [hi],edx:eax |
| 2498 | 2581 | _resolve_link(&link1); // skip: |
| 2499 | 2582 | } |
| 2500 | 2583 | return RECOMPILE_SUCCESSFUL_CP(36,4); |
| r869 | r870 | |
| 2524 | 2607 | _mul_m32abs(LO(&dmult_temp2)); // mul [dmult_temp2].lo |
| 2525 | 2608 | _mov_r32_r32(REG_ECX, REG_EDX); // mov ecx,edx |
| 2526 | 2609 | _xor_r32_r32(REG_EBX, REG_EBX); // xor ebx,ebx |
| 2527 | | _mov_m32abs_r32(LO(&mips3.lo), REG_EAX); // mov [lo].lo,eax |
| 2610 | _mov_m32abs_r32(LO(&mips3.core.lo), REG_EAX); // mov [lo].lo,eax |
| 2528 | 2611 | |
| 2529 | 2612 | _mov_r32_m32abs(REG_EAX, HI(&dmult_temp1)); // mov eax,[dmult_temp1].hi |
| 2530 | 2613 | _mul_m32abs(LO(&dmult_temp2)); // mul [dmult_temp2].lo |
| r869 | r870 | |
| 2535 | 2618 | _mul_m32abs(HI(&dmult_temp2)); // mul [dmult_temp2].hi |
| 2536 | 2619 | _add_r32_r32(REG_ECX, REG_EAX); // add ecx,eax |
| 2537 | 2620 | _adc_r32_r32(REG_EBX, REG_EDX); // adc ebx,edx |
| 2538 | | _mov_m32abs_r32(HI(&mips3.lo), REG_ECX); // mov [lo].hi,ecx |
| 2621 | _mov_m32abs_r32(HI(&mips3.core.lo), REG_ECX); // mov [lo].hi,ecx |
| 2539 | 2622 | |
| 2540 | 2623 | _mov_r32_m32abs(REG_EAX, HI(&dmult_temp1)); // mov eax,[dmult_temp1].hi |
| 2541 | 2624 | _mul_m32abs(HI(&dmult_temp2)); // mul [dmult_temp2].hi |
| 2542 | 2625 | _add_r32_r32(REG_EBX, REG_EAX); // add ebx,eax |
| 2543 | 2626 | _adc_r32_imm(REG_EDX, 0); // adc edx,0 |
| 2544 | | _mov_m32abs_r32(LO(&mips3.hi), REG_EBX); // mov [hi].lo,ebx |
| 2545 | | _mov_m32abs_r32(HI(&mips3.hi), REG_EDX); // mov [hi].hi,edx |
| 2627 | _mov_m32abs_r32(LO(&mips3.core.hi), REG_EBX); // mov [hi].lo,ebx |
| 2628 | _mov_m32abs_r32(HI(&mips3.core.hi), REG_EDX); // mov [hi].hi,edx |
| 2546 | 2629 | |
| 2547 | 2630 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)+4); // mov eax,[rsreg].hi |
| 2548 | 2631 | _xor_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)+4); // xor eax,[rtreg].hi |
| r869 | r870 | |
| 2551 | 2634 | _xor_r32_r32(REG_EBX, REG_EBX); // xor ebx,ebx |
| 2552 | 2635 | _xor_r32_r32(REG_ECX, REG_ECX); // xor ecx,ecx |
| 2553 | 2636 | _xor_r32_r32(REG_EDX, REG_EDX); // xor edx,edx |
| 2554 | | _sub_r32_m32abs(REG_EAX, LO(&mips3.lo)); // sub eax,[lo].lo |
| 2555 | | _sbb_r32_m32abs(REG_EBX, HI(&mips3.lo)); // sbb ebx,[lo].hi |
| 2556 | | _sbb_r32_m32abs(REG_ECX, LO(&mips3.hi)); // sbb ecx,[hi].lo |
| 2557 | | _sbb_r32_m32abs(REG_EDX, HI(&mips3.hi)); // sbb edx,[hi].hi |
| 2558 | | _mov_m64abs_r64(&mips3.lo, REG_EBX, REG_EAX); // mov [lo],ebx:eax |
| 2559 | | _mov_m64abs_r64(&mips3.hi, REG_EDX, REG_ECX); // mov [lo],edx:ecx |
| 2637 | _sub_r32_m32abs(REG_EAX, LO(&mips3.core.lo)); // sub eax,[lo].lo |
| 2638 | _sbb_r32_m32abs(REG_EBX, HI(&mips3.core.lo)); // sbb ebx,[lo].hi |
| 2639 | _sbb_r32_m32abs(REG_ECX, LO(&mips3.core.hi)); // sbb ecx,[hi].lo |
| 2640 | _sbb_r32_m32abs(REG_EDX, HI(&mips3.core.hi)); // sbb edx,[hi].hi |
| 2641 | _mov_m64abs_r64(&mips3.core.lo, REG_EBX, REG_EAX); // mov [lo],ebx:eax |
| 2642 | _mov_m64abs_r64(&mips3.core.hi, REG_EDX, REG_ECX); // mov [lo],edx:ecx |
| 2560 | 2643 | _resolve_link(&link3); // noflip: |
| 2561 | 2644 | return RECOMPILE_SUCCESSFUL_CP(8,4); |
| 2562 | 2645 | |
| r869 | r870 | |
| 2565 | 2648 | _mul_m32bd(REG_ESI, REGDISP(RTREG)); // mul [rtreg].lo |
| 2566 | 2649 | _mov_r32_r32(REG_ECX, REG_EDX); // mov ecx,edx |
| 2567 | 2650 | _xor_r32_r32(REG_EBX, REG_EBX); // xor ebx,ebx |
| 2568 | | _mov_m32abs_r32(LO(&mips3.lo), REG_EAX); // mov [lo].lo,eax |
| 2651 | _mov_m32abs_r32(LO(&mips3.core.lo), REG_EAX); // mov [lo].lo,eax |
| 2569 | 2652 | |
| 2570 | 2653 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)+4); // mov eax,[rsreg].hi |
| 2571 | 2654 | _mul_m32bd(REG_ESI, REGDISP(RTREG)); // mul [rtreg].lo |
| r869 | r870 | |
| 2576 | 2659 | _mul_m32bd(REG_ESI, REGDISP(RTREG)+4); // mul [rtreg].hi |
| 2577 | 2660 | _add_r32_r32(REG_ECX, REG_EAX); // add ecx,eax |
| 2578 | 2661 | _adc_r32_r32(REG_EBX, REG_EDX); // adc ebx,edx |
| 2579 | | _mov_m32abs_r32(HI(&mips3.lo), REG_ECX); // mov [lo].hi,ecx |
| 2662 | _mov_m32abs_r32(HI(&mips3.core.lo), REG_ECX); // mov [lo].hi,ecx |
| 2580 | 2663 | |
| 2581 | 2664 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)+4); // mov eax,[rsreg].hi |
| 2582 | 2665 | _mul_m32bd(REG_ESI, REGDISP(RTREG)+4); // mul [rtreg].hi |
| 2583 | 2666 | _add_r32_r32(REG_EBX, REG_EAX); // add ebx,eax |
| 2584 | 2667 | _adc_r32_imm(REG_EDX, 0); // adc edx,0 |
| 2585 | | _mov_m32abs_r32(LO(&mips3.hi), REG_EBX); // mov [hi].lo,ebx |
| 2586 | | _mov_m32abs_r32(HI(&mips3.hi), REG_EDX); // mov [hi].hi,edx |
| 2668 | _mov_m32abs_r32(LO(&mips3.core.hi), REG_EBX); // mov [hi].lo,ebx |
| 2669 | _mov_m32abs_r32(HI(&mips3.core.hi), REG_EDX); // mov [hi].hi,edx |
| 2587 | 2670 | return RECOMPILE_SUCCESSFUL_CP(8,4); |
| 2588 | 2671 | |
| 2589 | 2672 | case 0x1e: /* DDIV */ |
| 2590 | 2673 | _sub_r32_imm(REG_ESP, 4); // sub esp,4 |
| 2591 | | _push_imm(&mips3.r[RTREG]); // push [rtreg] |
| 2592 | | _push_imm(&mips3.r[RSREG]); // push [rsreg] |
| 2674 | _push_imm(&mips3.core.r[RTREG]); // push [rtreg] |
| 2675 | _push_imm(&mips3.core.r[RSREG]); // push [rsreg] |
| 2593 | 2676 | _call((genf *)ddiv); // call ddiv |
| 2594 | 2677 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 2595 | 2678 | return RECOMPILE_SUCCESSFUL_CP(68,4); |
| 2596 | 2679 | |
| 2597 | 2680 | case 0x1f: /* DDIVU */ |
| 2598 | 2681 | _sub_r32_imm(REG_ESP, 4); // sub esp,4 |
| 2599 | | _push_imm(&mips3.r[RTREG]); // push [rtreg] |
| 2600 | | _push_imm(&mips3.r[RSREG]); // push [rsreg] |
| 2682 | _push_imm(&mips3.core.r[RTREG]); // push [rtreg] |
| 2683 | _push_imm(&mips3.core.r[RSREG]); // push [rsreg] |
| 2601 | 2684 | _call((genf *)ddivu); // call ddivu |
| 2602 | 2685 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 2603 | 2686 | return RECOMPILE_SUCCESSFUL_CP(68,4); |
| 2604 | 2687 | } |
| 2605 | 2688 | |
| 2606 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 2689 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 2607 | 2690 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 2608 | 2691 | } |
| 2609 | 2692 | |
| r869 | r870 | |
| 2618 | 2701 | { |
| 2619 | 2702 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| 2620 | 2703 | _add_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // add eax,[rtreg] |
| 2621 | | _jcc(COND_O, mips3.generate_overflow_exception); // jo generate_overflow_exception |
| 2704 | _jcc(COND_O, mips3.drc->generate_overflow_exception); // jo generate_overflow_exception |
| 2622 | 2705 | if (RDREG != 0) |
| 2623 | 2706 | { |
| 2624 | 2707 | _cdq(); // cdq |
| r869 | r870 | |
| 2676 | 2759 | { |
| 2677 | 2760 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| 2678 | 2761 | _sub_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // sub eax,[rtreg] |
| 2679 | | _jcc(COND_O, mips3.generate_overflow_exception); // jo generate_overflow_exception |
| 2762 | _jcc(COND_O, mips3.drc->generate_overflow_exception); // jo generate_overflow_exception |
| 2680 | 2763 | if (RDREG != 0) |
| 2681 | 2764 | { |
| 2682 | 2765 | _cdq(); // cdq |
| r869 | r870 | |
| 2895 | 2978 | _mov_r64_m64bd(REG_EDX, REG_EAX, REG_ESI, REGDISP(RSREG)); // mov edx:eax,[rsreg] |
| 2896 | 2979 | _add_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // add eax,[rtreg].lo |
| 2897 | 2980 | _adc_r32_m32bd(REG_EDX, REG_ESI, REGDISP(RTREG)+4); // adc edx,[rtreg].hi |
| 2898 | | _jcc(COND_O, mips3.generate_overflow_exception); // jo generate_overflow_exception |
| 2981 | _jcc(COND_O, mips3.drc->generate_overflow_exception); // jo generate_overflow_exception |
| 2899 | 2982 | if (RDREG != 0) |
| 2900 | 2983 | _mov_m64bd_r64(REG_ESI, REGDISP(RDREG), REG_EDX, REG_EAX); // mov [rdreg],edx:eax |
| 2901 | 2984 | } |
| r869 | r870 | |
| 2945 | 3028 | _mov_r64_m64bd(REG_EDX, REG_EAX, REG_ESI, REGDISP(RSREG)); // mov edx:eax,[rsreg] |
| 2946 | 3029 | _sub_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // sub eax,[rtreg].lo |
| 2947 | 3030 | _sbb_r32_m32bd(REG_EDX, REG_ESI, REGDISP(RTREG)+4); // sbb edx,[rtreg].hi |
| 2948 | | _jcc(COND_O, mips3.generate_overflow_exception); // jo generate_overflow_exception |
| 3031 | _jcc(COND_O, mips3.drc->generate_overflow_exception); // jo generate_overflow_exception |
| 2949 | 3032 | if (RDREG != 0) |
| 2950 | 3033 | _mov_m64bd_r64(REG_ESI, REGDISP(RDREG), REG_EDX, REG_EAX); // mov [rdreg],edx:eax |
| 2951 | 3034 | } |
| r869 | r870 | |
| 3036 | 3119 | } |
| 3037 | 3120 | else |
| 3038 | 3121 | _cmp_r32_imm(REG_EDX, 0); // cmp edx,0 |
| 3039 | | _jcc(COND_GE, mips3.generate_trap_exception); // jge generate_trap_exception |
| 3122 | _jcc(COND_GE, mips3.drc->generate_trap_exception); // jge generate_trap_exception |
| 3040 | 3123 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 3041 | 3124 | |
| 3042 | 3125 | case 0x31: /* TGEU */ |
| 3043 | 3126 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)+4); // mov eax,[rsreg].hi |
| 3044 | 3127 | _cmp_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)+4); // cmp eax,[rtreg].hi |
| 3045 | | _jcc(COND_A, mips3.generate_trap_exception); // ja generate_trap_exception |
| 3128 | _jcc(COND_A, mips3.drc->generate_trap_exception); // ja generate_trap_exception |
| 3046 | 3129 | _jcc_short_link(COND_B, &link1); // jb skipit |
| 3047 | 3130 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg].lo |
| 3048 | 3131 | _cmp_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // cmp eax,[rtreg].lo |
| 3049 | | _jcc(COND_AE, mips3.generate_trap_exception); // jae generate_trap_exception |
| 3132 | _jcc(COND_AE, mips3.drc->generate_trap_exception); // jae generate_trap_exception |
| 3050 | 3133 | _resolve_link(&link1); // skipit: |
| 3051 | 3134 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 3052 | 3135 | |
| r869 | r870 | |
| 3065 | 3148 | } |
| 3066 | 3149 | else |
| 3067 | 3150 | _cmp_r32_imm(REG_EDX, 0); // cmp edx,0 |
| 3068 | | _jcc(COND_L, mips3.generate_trap_exception); // jl generate_trap_exception |
| 3151 | _jcc(COND_L, mips3.drc->generate_trap_exception); // jl generate_trap_exception |
| 3069 | 3152 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 3070 | 3153 | |
| 3071 | 3154 | case 0x33: /* TLTU */ |
| 3072 | 3155 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)+4); // mov eax,[rsreg].hi |
| 3073 | 3156 | _cmp_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)+4); // cmp eax,[rtreg].hi |
| 3074 | | _jcc(COND_B, mips3.generate_trap_exception); // jb generate_trap_exception |
| 3157 | _jcc(COND_B, mips3.drc->generate_trap_exception); // jb generate_trap_exception |
| 3075 | 3158 | _jcc_short_link(COND_A, &link1); // ja skipit |
| 3076 | 3159 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg].lo |
| 3077 | 3160 | _cmp_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // cmp eax,[rtreg].lo |
| 3078 | | _jcc(COND_B, mips3.generate_trap_exception); // jb generate_trap_exception |
| 3161 | _jcc(COND_B, mips3.drc->generate_trap_exception); // jb generate_trap_exception |
| 3079 | 3162 | _resolve_link(&link1); // skipit: |
| 3080 | 3163 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 3081 | 3164 | |
| r869 | r870 | |
| 3085 | 3168 | _jcc_short_link(COND_NE, &link1); // jne skipit |
| 3086 | 3169 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg].lo |
| 3087 | 3170 | _cmp_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // cmp eax,[rtreg].lo |
| 3088 | | _jcc(COND_E, mips3.generate_trap_exception); // je generate_trap_exception |
| 3171 | _jcc(COND_E, mips3.drc->generate_trap_exception); // je generate_trap_exception |
| 3089 | 3172 | _resolve_link(&link1); // skipit: |
| 3090 | 3173 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 3091 | 3174 | |
| r869 | r870 | |
| 3095 | 3178 | _jcc_short_link(COND_E, &link1); // je skipit |
| 3096 | 3179 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg].lo |
| 3097 | 3180 | _cmp_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // cmp eax,[rtreg].lo |
| 3098 | | _jcc(COND_NE, mips3.generate_trap_exception); // jne generate_trap_exception |
| 3181 | _jcc(COND_NE, mips3.drc->generate_trap_exception); // jne generate_trap_exception |
| 3099 | 3182 | _resolve_link(&link1); // skipit: |
| 3100 | 3183 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 3101 | 3184 | |
| r869 | r870 | |
| 3240 | 3323 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3241 | 3324 | } |
| 3242 | 3325 | |
| 3243 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 3326 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 3244 | 3327 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 3245 | 3328 | } |
| 3246 | 3329 | |
| r869 | r870 | |
| 3335 | 3418 | _mov_r64_m64bd(REG_EDX, REG_EAX, REG_ESI, REGDISP(RSREG)); // mov edx:eax,[rsreg] |
| 3336 | 3419 | _sub_r32_imm(REG_EAX, SIMMVAL); // sub eax,[rtreg].lo |
| 3337 | 3420 | _sbb_r32_imm(REG_EDX, ((INT32)SIMMVAL >> 31)); // sbb edx,[rtreg].lo |
| 3338 | | _jcc(COND_GE, mips3.generate_trap_exception); // jge generate_trap_exception |
| 3421 | _jcc(COND_GE, mips3.drc->generate_trap_exception); // jge generate_trap_exception |
| 3339 | 3422 | } |
| 3340 | 3423 | else |
| 3341 | 3424 | { |
| 3342 | 3425 | if (0 >= SIMMVAL) |
| 3343 | | _jmp(mips3.generate_trap_exception); // jmp generate_trap_exception |
| 3426 | _jmp(mips3.drc->generate_trap_exception); // jmp generate_trap_exception |
| 3344 | 3427 | } |
| 3345 | 3428 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 3346 | 3429 | |
| r869 | r870 | |
| 3348 | 3431 | if (RSREG != 0) |
| 3349 | 3432 | { |
| 3350 | 3433 | _cmp_m32bd_imm(REG_ESI, REGDISP(RSREG)+4, ((INT32)SIMMVAL >> 31)); // cmp [rsreg].hi,upper |
| 3351 | | _jcc(COND_A, mips3.generate_trap_exception); // ja generate_trap_exception |
| 3434 | _jcc(COND_A, mips3.drc->generate_trap_exception); // ja generate_trap_exception |
| 3352 | 3435 | _jcc_short_link(COND_B, &link1); // jb skip |
| 3353 | 3436 | _cmp_m32bd_imm(REG_ESI, REGDISP(RSREG), SIMMVAL); // cmp [rsreg].lo,lower |
| 3354 | | _jcc(COND_AE, mips3.generate_trap_exception); // jae generate_trap_exception |
| 3437 | _jcc(COND_AE, mips3.drc->generate_trap_exception); // jae generate_trap_exception |
| 3355 | 3438 | _resolve_link(&link1); // skip: |
| 3356 | 3439 | } |
| 3357 | 3440 | else |
| 3358 | 3441 | { |
| 3359 | 3442 | if (0 >= SIMMVAL) |
| 3360 | | _jmp(mips3.generate_trap_exception); // jmp generate_trap_exception |
| 3443 | _jmp(mips3.drc->generate_trap_exception); // jmp generate_trap_exception |
| 3361 | 3444 | } |
| 3362 | 3445 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 3363 | 3446 | |
| r869 | r870 | |
| 3367 | 3450 | _mov_r64_m64bd(REG_EDX, REG_EAX, REG_ESI, REGDISP(RSREG)); // mov edx:eax,[rsreg] |
| 3368 | 3451 | _sub_r32_imm(REG_EAX, SIMMVAL); // sub eax,[rtreg].lo |
| 3369 | 3452 | _sbb_r32_imm(REG_EDX, ((INT32)SIMMVAL >> 31)); // sbb edx,[rtreg].lo |
| 3370 | | _jcc(COND_L, mips3.generate_trap_exception); // jl generate_trap_exception |
| 3453 | _jcc(COND_L, mips3.drc->generate_trap_exception); // jl generate_trap_exception |
| 3371 | 3454 | } |
| 3372 | 3455 | else |
| 3373 | 3456 | { |
| 3374 | 3457 | if (0 < SIMMVAL) |
| 3375 | | _jmp(mips3.generate_trap_exception); // jmp generate_trap_exception |
| 3458 | _jmp(mips3.drc->generate_trap_exception); // jmp generate_trap_exception |
| 3376 | 3459 | } |
| 3377 | 3460 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 3378 | 3461 | |
| r869 | r870 | |
| 3380 | 3463 | if (RSREG != 0) |
| 3381 | 3464 | { |
| 3382 | 3465 | _cmp_m32bd_imm(REG_ESI, REGDISP(RSREG)+4, ((INT32)SIMMVAL >> 31)); // cmp [rsreg].hi,upper |
| 3383 | | _jcc(COND_B, mips3.generate_trap_exception); // jb generate_trap_exception |
| 3466 | _jcc(COND_B, mips3.drc->generate_trap_exception); // jb generate_trap_exception |
| 3384 | 3467 | _jcc_short_link(COND_A, &link1); // ja skip |
| 3385 | 3468 | _cmp_m32bd_imm(REG_ESI, REGDISP(RSREG), SIMMVAL); // cmp [rsreg].lo,lower |
| 3386 | | _jcc(COND_B, mips3.generate_trap_exception); // jb generate_trap_exception |
| 3469 | _jcc(COND_B, mips3.drc->generate_trap_exception); // jb generate_trap_exception |
| 3387 | 3470 | _resolve_link(&link1); // skip: |
| 3388 | 3471 | } |
| 3389 | 3472 | else |
| r869 | r870 | |
| 3399 | 3482 | _cmp_m32bd_imm(REG_ESI, REGDISP(RSREG)+4, ((INT32)SIMMVAL >> 31)); // cmp [rsreg].hi,upper |
| 3400 | 3483 | _jcc_short_link(COND_NE, &link1); // jne skip |
| 3401 | 3484 | _cmp_m32bd_imm(REG_ESI, REGDISP(RSREG), SIMMVAL); // cmp [rsreg].lo,lower |
| 3402 | | _jcc(COND_E, mips3.generate_trap_exception); // je generate_trap_exception |
| 3485 | _jcc(COND_E, mips3.drc->generate_trap_exception); // je generate_trap_exception |
| 3403 | 3486 | _resolve_link(&link1); // skip: |
| 3404 | 3487 | } |
| 3405 | 3488 | else |
| 3406 | 3489 | { |
| 3407 | 3490 | if (0 == SIMMVAL) |
| 3408 | | _jmp(mips3.generate_trap_exception); // jmp generate_trap_exception |
| 3491 | _jmp(mips3.drc->generate_trap_exception); // jmp generate_trap_exception |
| 3409 | 3492 | } |
| 3410 | 3493 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 3411 | 3494 | |
| r869 | r870 | |
| 3415 | 3498 | _cmp_m32bd_imm(REG_ESI, REGDISP(RSREG)+4, ((INT32)SIMMVAL >> 31)); // cmp [rsreg].hi,upper |
| 3416 | 3499 | _jcc_short_link(COND_E, &link1); // je skip |
| 3417 | 3500 | _cmp_m32bd_imm(REG_ESI, REGDISP(RSREG), SIMMVAL); // cmp [rsreg].lo,lower |
| 3418 | | _jcc(COND_NE, mips3.generate_trap_exception); // jne generate_trap_exception |
| 3501 | _jcc(COND_NE, mips3.drc->generate_trap_exception); // jne generate_trap_exception |
| 3419 | 3502 | _resolve_link(&link1); // skip: |
| 3420 | 3503 | } |
| 3421 | 3504 | else |
| 3422 | 3505 | { |
| 3423 | 3506 | if (0 != SIMMVAL) |
| 3424 | | _jmp(mips3.generate_trap_exception); // jmp generate_trap_exception |
| 3507 | _jmp(mips3.drc->generate_trap_exception); // jmp generate_trap_exception |
| 3425 | 3508 | } |
| 3426 | 3509 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_MAY_CAUSE_EXCEPTION; |
| 3427 | 3510 | |
| r869 | r870 | |
| 3435 | 3518 | } |
| 3436 | 3519 | |
| 3437 | 3520 | cycles = recompile_delay_slot(drc, pc + 4); // <next instruction> |
| 3438 | | _mov_m64abs_imm32(&mips3.r[31], pc + 8); // mov [31],pc + 8 |
| 3521 | _mov_m64abs_imm32(&mips3.core.r[31], pc + 8); // mov [31],pc + 8 |
| 3439 | 3522 | append_branch_or_dispatch(drc, pc + 4 + (SIMMVAL << 2), 1+cycles); // <branch or dispatch> |
| 3440 | 3523 | _resolve_link(&link1); // skip: |
| 3441 | 3524 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 3444 | 3527 | if (RSREG == 0) |
| 3445 | 3528 | { |
| 3446 | 3529 | cycles = recompile_delay_slot(drc, pc + 4); // <next instruction> |
| 3447 | | _mov_m64abs_imm32(&mips3.r[31], pc + 8); // mov [31],pc + 8 |
| 3530 | _mov_m64abs_imm32(&mips3.core.r[31], pc + 8); // mov [31],pc + 8 |
| 3448 | 3531 | append_branch_or_dispatch(drc, pc + 4 + (SIMMVAL << 2), 1+cycles); // <branch or dispatch> |
| 3449 | 3532 | return RECOMPILE_SUCCESSFUL_CP(0,0) | RECOMPILE_END_OF_STRING; |
| 3450 | 3533 | } |
| r869 | r870 | |
| 3455 | 3538 | } |
| 3456 | 3539 | |
| 3457 | 3540 | cycles = recompile_delay_slot(drc, pc + 4); // <next instruction> |
| 3458 | | _mov_m64abs_imm32(&mips3.r[31], pc + 8); // mov [31],pc + 8 |
| 3541 | _mov_m64abs_imm32(&mips3.core.r[31], pc + 8); // mov [31],pc + 8 |
| 3459 | 3542 | append_branch_or_dispatch(drc, pc + 4 + (SIMMVAL << 2), 1+cycles); // <branch or dispatch> |
| 3460 | 3543 | _resolve_link(&link1); // skip: |
| 3461 | 3544 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 3470 | 3553 | } |
| 3471 | 3554 | |
| 3472 | 3555 | cycles = recompile_delay_slot(drc, pc + 4); // <next instruction> |
| 3473 | | _mov_m64abs_imm32(&mips3.r[31], pc + 8); // mov [31],pc + 8 |
| 3556 | _mov_m64abs_imm32(&mips3.core.r[31], pc + 8); // mov [31],pc + 8 |
| 3474 | 3557 | append_branch_or_dispatch(drc, pc + 4 + (SIMMVAL << 2), 1+cycles); // <branch or dispatch> |
| 3475 | 3558 | _resolve_link(&link1); // skip: |
| 3476 | 3559 | return RECOMPILE_SUCCESSFUL_CP(1,8); |
| r869 | r870 | |
| 3479 | 3562 | if (RSREG == 0) |
| 3480 | 3563 | { |
| 3481 | 3564 | cycles = recompile_delay_slot(drc, pc + 4); // <next instruction> |
| 3482 | | _mov_m64abs_imm32(&mips3.r[31], pc + 8); // mov [31],pc + 8 |
| 3565 | _mov_m64abs_imm32(&mips3.core.r[31], pc + 8); // mov [31],pc + 8 |
| 3483 | 3566 | append_branch_or_dispatch(drc, pc + 4 + (SIMMVAL << 2), 1+cycles); // <branch or dispatch> |
| 3484 | 3567 | return RECOMPILE_SUCCESSFUL_CP(0,0) | RECOMPILE_END_OF_STRING; |
| 3485 | 3568 | } |
| r869 | r870 | |
| 3490 | 3573 | } |
| 3491 | 3574 | |
| 3492 | 3575 | cycles = recompile_delay_slot(drc, pc + 4); // <next instruction> |
| 3493 | | _mov_m64abs_imm32(&mips3.r[31], pc + 8); // mov [31],pc + 8 |
| 3576 | _mov_m64abs_imm32(&mips3.core.r[31], pc + 8); // mov [31],pc + 8 |
| 3494 | 3577 | append_branch_or_dispatch(drc, pc + 4 + (SIMMVAL << 2), 1+cycles); // <branch or dispatch> |
| 3495 | 3578 | _resolve_link(&link1); // skip: |
| 3496 | 3579 | return RECOMPILE_SUCCESSFUL_CP(1,8); |
| 3497 | 3580 | } |
| 3498 | 3581 | |
| 3499 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 3582 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 3500 | 3583 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 3501 | 3584 | } |
| 3502 | 3585 | |
| r869 | r870 | |
| 3517 | 3600 | switch (reg) |
| 3518 | 3601 | { |
| 3519 | 3602 | case COP0_Cause: |
| 3520 | | _mov_r32_m32abs(REG_EBX, &mips3.cpr[0][COP0_Cause]); // mov ebx,[mips3.cpr[0][COP0_Cause]] |
| 3603 | _mov_r32_m32abs(REG_EBX, &mips3.core.cpr[0][COP0_Cause]); // mov ebx,[mips3.core.cpr[0][COP0_Cause]] |
| 3521 | 3604 | _and_r32_imm(REG_EAX, ~0xfc00); // and eax,~0xfc00 |
| 3522 | 3605 | _and_r32_imm(REG_EBX, 0xfc00); // and ebx,0xfc00 |
| 3523 | 3606 | _or_r32_r32(REG_EAX, REG_EBX); // or eax,ebx |
| 3524 | | _mov_m32abs_r32(&mips3.cpr[0][COP0_Cause], REG_EAX); // mov [mips3.cpr[0][COP0_Cause]],eax |
| 3525 | | _and_r32_m32abs(REG_EAX, &mips3.cpr[0][COP0_Status]); // and eax,[mips3.cpr[0][COP0_Status]] |
| 3607 | _mov_m32abs_r32(&mips3.core.cpr[0][COP0_Cause], REG_EAX); // mov [mips3.core.cpr[0][COP0_Cause]],eax |
| 3608 | _and_r32_m32abs(REG_EAX, &mips3.core.cpr[0][COP0_Status]); // and eax,[mips3.core.cpr[0][COP0_Status]] |
| 3526 | 3609 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_CHECK_SW_INTERRUPTS; |
| 3527 | 3610 | |
| 3528 | 3611 | case COP0_Status: |
| 3529 | | _mov_r32_m32abs(REG_EBX, &mips3.cpr[0][COP0_Status]); // mov ebx,[mips3.cpr[0][COP0_Status]] |
| 3530 | | _mov_m32abs_r32(&mips3.cpr[0][COP0_Status], REG_EAX); // mov [mips3.cpr[0][COP0_Status]],eax |
| 3612 | _mov_r32_m32abs(REG_EBX, &mips3.core.cpr[0][COP0_Status]); // mov ebx,[mips3.core.cpr[0][COP0_Status]] |
| 3613 | _mov_m32abs_r32(&mips3.core.cpr[0][COP0_Status], REG_EAX); // mov [mips3.core.cpr[0][COP0_Status]],eax |
| 3531 | 3614 | _xor_r32_r32(REG_EBX, REG_EAX); // xor ebx,eax |
| 3532 | 3615 | /* |
| 3533 | 3616 | #ifdef MAME_DEBUG |
| r869 | r870 | |
| 3549 | 3632 | return RECOMPILE_SUCCESSFUL_CP(1,4) | RECOMPILE_CHECK_INTERRUPTS | RECOMPILE_END_OF_STRING | RECOMPILE_ADD_DISPATCH; |
| 3550 | 3633 | |
| 3551 | 3634 | case COP0_Count: |
| 3552 | | _mov_m32abs_r32(&mips3.cpr[0][COP0_Count], REG_EAX); // mov [mips3.cpr[0][COP0_Count]],eax |
| 3635 | _mov_m32abs_r32(&mips3.core.cpr[0][COP0_Count], REG_EAX); // mov [mips3.core.cpr[0][COP0_Count]],eax |
| 3553 | 3636 | _mov_m32abs_r32(&mips3_icount, REG_EBP); // mov [mips3_icount],ebp |
| 3554 | 3637 | _sub_r32_imm(REG_ESP, 8); // sub esp,8 |
| 3555 | 3638 | _push_r32(REG_EAX); // push eax |
| r869 | r870 | |
| 3560 | 3643 | _sbb_r32_imm(REG_EDX, 0); // sbb edx,0 |
| 3561 | 3644 | _sub_r32_r32(REG_EAX, REG_EBX); // sub eax,ebx |
| 3562 | 3645 | _sbb_r32_imm(REG_EDX, 0); // sbb edx,0 |
| 3563 | | _mov_m64abs_r64(&mips3.count_zero_time, REG_EDX, REG_EAX); // mov [mips3.count_zero_time],edx:eax |
| 3646 | _mov_m64abs_r64(&mips3.core.count_zero_time, REG_EDX, REG_EAX); // mov [mips3.core.count_zero_time],edx:eax |
| 3564 | 3647 | append_update_cycle_counting(drc); // update cycle counting |
| 3565 | 3648 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3566 | 3649 | |
| 3567 | 3650 | case COP0_Compare: |
| 3568 | | _mov_m32abs_r32(&mips3.cpr[0][COP0_Compare], REG_EAX); // mov [mips3.cpr[0][COP0_Compare]],eax |
| 3569 | | _and_m32abs_imm(&mips3.cpr[0][COP0_Cause], ~0x8000); // and [mips3.cpr[0][COP0_Cause]],~0x8000 |
| 3651 | _mov_m32abs_r32(&mips3.core.cpr[0][COP0_Compare], REG_EAX); // mov [mips3.core.cpr[0][COP0_Compare]],eax |
| 3652 | _and_m32abs_imm(&mips3.core.cpr[0][COP0_Cause], ~0x8000); // and [mips3.core.cpr[0][COP0_Cause]],~0x8000 |
| 3570 | 3653 | append_update_cycle_counting(drc); // update cycle counting |
| 3571 | 3654 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3572 | 3655 | |
| r869 | r870 | |
| 3574 | 3657 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3575 | 3658 | |
| 3576 | 3659 | case COP0_Config: |
| 3577 | | _mov_r32_m32abs(REG_EBX, &mips3.cpr[0][COP0_Config]); // mov ebx,[mips3.cpr[0][COP0_Cause]] |
| 3660 | _mov_r32_m32abs(REG_EBX, &mips3.core.cpr[0][COP0_Config]); // mov ebx,[mips3.core.cpr[0][COP0_Cause]] |
| 3578 | 3661 | _and_r32_imm(REG_EAX, 0x0007); // and eax,0x0007 |
| 3579 | 3662 | _and_r32_imm(REG_EBX, ~0x0007); // and ebx,~0x0007 |
| 3580 | 3663 | _or_r32_r32(REG_EAX, REG_EBX); // or eax,ebx |
| 3581 | | _mov_m32abs_r32(&mips3.cpr[0][COP0_Config], REG_EAX); // mov [mips3.cpr[0][COP0_Cause]],eax |
| 3664 | _mov_m32abs_r32(&mips3.core.cpr[0][COP0_Config], REG_EAX); // mov [mips3.core.cpr[0][COP0_Cause]],eax |
| 3582 | 3665 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3583 | 3666 | |
| 3584 | 3667 | default: |
| 3585 | | _mov_m32abs_r32(&mips3.cpr[0][reg], REG_EAX); // mov [mips3.cpr[0][reg]],eax |
| 3668 | _mov_m32abs_r32(&mips3.core.cpr[0][reg], REG_EAX); // mov [mips3.core.cpr[0][reg]],eax |
| 3586 | 3669 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3587 | 3670 | } |
| 3588 | 3671 | return RECOMPILE_UNIMPLEMENTED; |
| r869 | r870 | |
| 3608 | 3691 | _sub_r32_imm(REG_ESP, 12); // sub esp,12 |
| 3609 | 3692 | _call((genf *)activecpu_gettotalcycles64); // call activecpu_gettotalcycles64 |
| 3610 | 3693 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 3611 | | _sub_r32_m32abs(REG_EAX, LO(&mips3.count_zero_time)); // sub eax,[mips3.count_zero_time+0] |
| 3612 | | _sbb_r32_m32abs(REG_EDX, HI(&mips3.count_zero_time)); // sbb edx,[mips3.count_zero_time+4] |
| 3694 | _sub_r32_m32abs(REG_EAX, LO(&mips3.core.count_zero_time)); // sub eax,[mips3.core.count_zero_time+0] |
| 3695 | _sbb_r32_m32abs(REG_EDX, HI(&mips3.core.count_zero_time)); // sbb edx,[mips3.core.count_zero_time+4] |
| 3613 | 3696 | _shrd_r32_r32_imm(REG_EAX, REG_EDX, 1); // shrd eax,edx,1 |
| 3614 | 3697 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3615 | 3698 | |
| r869 | r870 | |
| 3618 | 3701 | _jcc_short_link(COND_NS, &link1); // jns notneg |
| 3619 | 3702 | _xor_r32_r32(REG_EBP, REG_EBP); // xor ebp,ebp |
| 3620 | 3703 | _resolve_link(&link1); // notneg: |
| 3621 | | _mov_r32_m32abs(REG_EAX, &mips3.cpr[0][reg]); // mov eax,[mips3.cpr[0][reg]] |
| 3704 | _mov_r32_m32abs(REG_EAX, &mips3.core.cpr[0][reg]); // mov eax,[mips3.core.cpr[0][reg]] |
| 3622 | 3705 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3623 | 3706 | |
| 3624 | 3707 | default: |
| 3625 | | _mov_r32_m32abs(REG_EAX, &mips3.cpr[0][reg]); // mov eax,[mips3.cpr[0][reg]] |
| 3708 | _mov_r32_m32abs(REG_EAX, &mips3.core.cpr[0][reg]); // mov eax,[mips3.core.cpr[0][reg]] |
| 3626 | 3709 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3627 | 3710 | } |
| 3628 | 3711 | return RECOMPILE_UNIMPLEMENTED; |
| r869 | r870 | |
| 3640 | 3723 | |
| 3641 | 3724 | if (mips3.drcoptions & MIPS3DRC_STRICT_COP0) |
| 3642 | 3725 | { |
| 3643 | | _test_m32abs_imm(&mips3.cpr[0][COP0_Status], SR_KSU_MASK); // test [mips3.cpr[0][COP0_Status]],SR_KSU_MASK |
| 3726 | _test_m32abs_imm(&mips3.core.cpr[0][COP0_Status], SR_KSU_MASK); // test [mips3.core.cpr[0][COP0_Status]],SR_KSU_MASK |
| 3644 | 3727 | _jcc_short_link(COND_Z, &checklink); // jz okay |
| 3645 | | _test_m32abs_imm(&mips3.cpr[0][COP0_Status], SR_COP0); // test [mips3.cpr[0][COP0_Status]],SR_COP0 |
| 3646 | | _jcc(COND_Z, mips3.generate_cop_exception); // jz generate_cop_exception |
| 3728 | _test_m32abs_imm(&mips3.core.cpr[0][COP0_Status], SR_COP0); // test [mips3.core.cpr[0][COP0_Status]],SR_COP0 |
| 3729 | _jcc(COND_Z, mips3.drc->generate_cop_exception); // jz generate_cop_exception |
| 3647 | 3730 | _resolve_link(&checklink); // okay: |
| 3648 | 3731 | } |
| 3649 | 3732 | |
| r869 | r870 | |
| 3672 | 3755 | case 0x02: /* CFCz */ |
| 3673 | 3756 | if (RTREG != 0) |
| 3674 | 3757 | { |
| 3675 | | _mov_r32_m32abs(REG_EAX, &mips3.ccr[0][RDREG]); // mov eax,[mips3.ccr[0][rdreg]] |
| 3758 | _mov_r32_m32abs(REG_EAX, &mips3.core.ccr[0][RDREG]); // mov eax,[mips3.core.ccr[0][rdreg]] |
| 3676 | 3759 | _cdq(); // cdq |
| 3677 | 3760 | _mov_m64bd_r64(REG_ESI, REGDISP(RTREG), REG_EDX, REG_EAX); // mov [rtreg],edx:eax |
| 3678 | 3761 | } |
| r869 | r870 | |
| 3680 | 3763 | |
| 3681 | 3764 | case 0x04: /* MTCz */ |
| 3682 | 3765 | if (RTREG != 0) |
| 3683 | | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[mips3.r[RTREG]] |
| 3766 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[mips3.core.r[RTREG]] |
| 3684 | 3767 | else |
| 3685 | 3768 | _xor_r32_r32(REG_EAX, REG_EAX); // xor eax,eax |
| 3686 | 3769 | result = recompile_set_cop0_reg(drc, RDREG); // write cop0 reg |
| r869 | r870 | |
| 3688 | 3771 | |
| 3689 | 3772 | case 0x05: /* DMTCz */ |
| 3690 | 3773 | if (RTREG != 0) |
| 3691 | | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[mips3.r[RTREG]] |
| 3774 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[mips3.core.r[RTREG]] |
| 3692 | 3775 | else |
| 3693 | 3776 | _xor_r32_r32(REG_EAX, REG_EAX); // xor eax,eax |
| 3694 | 3777 | result = recompile_set_cop0_reg(drc, RDREG); // write cop0 reg |
| r869 | r870 | |
| 3696 | 3779 | |
| 3697 | 3780 | case 0x06: /* CTCz */ |
| 3698 | 3781 | if (RTREG != 0) |
| 3699 | | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[mips3.r[RTREG]] |
| 3782 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[mips3.core.r[RTREG]] |
| 3700 | 3783 | else |
| 3701 | 3784 | _xor_r32_r32(REG_EAX, REG_EAX); // xor eax,eax |
| 3702 | | _mov_m32abs_r32(&mips3.ccr[0][RDREG], REG_EAX); // mov [mips3.ccr[0][RDREG]],eax |
| 3785 | _mov_m32abs_r32(&mips3.core.ccr[0][RDREG], REG_EAX); // mov [mips3.core.ccr[0][RDREG]],eax |
| 3703 | 3786 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3704 | 3787 | |
| 3705 | 3788 | // case 0x08: /* BC */ |
| 3706 | 3789 | // switch (RTREG) |
| 3707 | 3790 | // { |
| 3708 | | // case 0x00: /* BCzF */ if (!mips3.cf[0][0]) ADDPC(SIMMVAL); break; |
| 3709 | | // case 0x01: /* BCzF */ if (mips3.cf[0][0]) ADDPC(SIMMVAL); break; |
| 3791 | // case 0x00: /* BCzF */ if (!mips3.core.cf[0][0]) ADDPC(SIMMVAL); break; |
| 3792 | // case 0x01: /* BCzF */ if (mips3.core.cf[0][0]) ADDPC(SIMMVAL); break; |
| 3710 | 3793 | // case 0x02: /* BCzFL */ invalid_instruction(op); break; |
| 3711 | 3794 | // case 0x03: /* BCzTL */ invalid_instruction(op); break; |
| 3712 | 3795 | // default: invalid_instruction(op); break; |
| r869 | r870 | |
| 3732 | 3815 | switch (op & 0x01ffffff) |
| 3733 | 3816 | { |
| 3734 | 3817 | case 0x01: /* TLBR */ |
| 3735 | | _sub_r32_imm(REG_ESP, 12); |
| 3736 | | drc_append_save_call_restore(drc, (genf *)tlbr, 12); |
| 3818 | _sub_r32_imm(REG_ESP, 8); |
| 3819 | _push_imm(&mips3.core); |
| 3820 | drc_append_save_call_restore(drc, (genf *)mips3com_tlbr, 12); |
| 3737 | 3821 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3738 | 3822 | |
| 3739 | 3823 | case 0x02: /* TLBWI */ |
| 3740 | | _sub_r32_imm(REG_ESP, 12); |
| 3741 | | drc_append_save_call_restore(drc, (genf *)tlbwi, 12); |
| 3824 | _sub_r32_imm(REG_ESP, 8); |
| 3825 | _push_imm(&mips3.core); |
| 3826 | drc_append_save_call_restore(drc, (genf *)mips3com_tlbwi, 12); |
| 3742 | 3827 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3743 | 3828 | |
| 3744 | 3829 | case 0x06: /* TLBWR */ |
| 3745 | | _sub_r32_imm(REG_ESP, 12); |
| 3746 | | drc_append_save_call_restore(drc, (genf *)tlbwr, 12); |
| 3830 | _sub_r32_imm(REG_ESP, 8); |
| 3831 | _push_imm(&mips3.core); |
| 3832 | drc_append_save_call_restore(drc, (genf *)mips3com_tlbwr, 12); |
| 3747 | 3833 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3748 | 3834 | |
| 3749 | 3835 | case 0x08: /* TLBP */ |
| 3750 | | _sub_r32_imm(REG_ESP, 12); |
| 3751 | | drc_append_save_call_restore(drc, (genf *)tlbp, 12); |
| 3836 | _sub_r32_imm(REG_ESP, 8); |
| 3837 | _push_imm(&mips3.core); |
| 3838 | drc_append_save_call_restore(drc, (genf *)mips3com_tlbp, 12); |
| 3752 | 3839 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3753 | 3840 | |
| 3754 | 3841 | case 0x10: /* RFE */ |
| 3755 | | _jmp(mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 3842 | _jmp(mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 3756 | 3843 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 3757 | 3844 | |
| 3758 | 3845 | case 0x18: /* ERET */ |
| 3759 | | _mov_r32_m32abs(REG_EDI, &mips3.cpr[0][COP0_EPC]); // mov edi,[mips3.cpr[0][COP0_EPC]] |
| 3760 | | _and_m32abs_imm(&mips3.cpr[0][COP0_Status], ~SR_EXL); // and [mips3.cpr[0][COP0_Status]],~SR_EXL |
| 3846 | _mov_r32_m32abs(REG_EDI, &mips3.core.cpr[0][COP0_EPC]); // mov edi,[mips3.core.cpr[0][COP0_EPC]] |
| 3847 | _and_m32abs_imm(&mips3.core.cpr[0][COP0_Status], ~SR_EXL); // and [mips3.core.cpr[0][COP0_Status]],~SR_EXL |
| 3761 | 3848 | return RECOMPILE_SUCCESSFUL_CP(1,0) | RECOMPILE_CHECK_INTERRUPTS | RECOMPILE_END_OF_STRING | RECOMPILE_ADD_DISPATCH; |
| 3762 | 3849 | |
| 3763 | 3850 | default: |
| 3764 | | _jmp(mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 3851 | _jmp(mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 3765 | 3852 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 3766 | 3853 | } |
| 3767 | 3854 | break; |
| 3768 | 3855 | |
| 3769 | 3856 | // default: |
| 3770 | | // _jmp(mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 3857 | // _jmp(mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 3771 | 3858 | // return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 3772 | 3859 | } |
| 3773 | 3860 | return RECOMPILE_UNIMPLEMENTED; |
| r869 | r870 | |
| 3790 | 3877 | |
| 3791 | 3878 | if (mips3.drcoptions & MIPS3DRC_STRICT_COP1) |
| 3792 | 3879 | { |
| 3793 | | _test_m32abs_imm(&mips3.cpr[0][COP0_Status], SR_COP1); // test [mips3.cpr[0][COP0_Status]],SR_COP1 |
| 3794 | | _jcc(COND_Z, mips3.generate_cop_exception); // jz generate_cop_exception |
| 3880 | _test_m32abs_imm(&mips3.core.cpr[0][COP0_Status], SR_COP1); // test [mips3.core.cpr[0][COP0_Status]],SR_COP1 |
| 3881 | _jcc(COND_Z, mips3.drc->generate_cop_exception); // jz generate_cop_exception |
| 3795 | 3882 | } |
| 3796 | 3883 | |
| 3797 | 3884 | switch (RSREG) |
| r869 | r870 | |
| 3799 | 3886 | case 0x00: /* MFCz */ |
| 3800 | 3887 | if (RTREG != 0) |
| 3801 | 3888 | { |
| 3802 | | _mov_r32_m32abs(REG_EAX, FPR32(RDREG)); // mov eax,[mips3.cpr[1][RDREG]] |
| 3889 | _mov_r32_m32abs(REG_EAX, FPR32(RDREG)); // mov eax,[mips3.core.cpr[1][RDREG]] |
| 3803 | 3890 | _cdq(); // cdq |
| 3804 | | _mov_m64bd_r64(REG_ESI, REGDISP(RTREG), REG_EDX, REG_EAX); // mov [mips3.r[RTREG]],edx:eax |
| 3891 | _mov_m64bd_r64(REG_ESI, REGDISP(RTREG), REG_EDX, REG_EAX); // mov [mips3.core.r[RTREG]],edx:eax |
| 3805 | 3892 | } |
| 3806 | 3893 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3807 | 3894 | |
| r869 | r870 | |
| 3813 | 3900 | case 0x02: /* CFCz */ |
| 3814 | 3901 | if (RTREG != 0) |
| 3815 | 3902 | { |
| 3816 | | _mov_r32_m32abs(REG_EAX, &mips3.ccr[1][RDREG]); // mov eax,[mips3.ccr[1][RDREG]] |
| 3903 | _mov_r32_m32abs(REG_EAX, &mips3.core.ccr[1][RDREG]); // mov eax,[mips3.core.ccr[1][RDREG]] |
| 3817 | 3904 | if (RDREG == 31) |
| 3818 | 3905 | { |
| 3819 | 3906 | _and_r32_imm(REG_EAX, ~0xfe800000); // and eax,~0xfe800000 |
| 3820 | 3907 | _xor_r32_r32(REG_EBX, REG_EBX); // xor ebx,ebx |
| 3821 | | _cmp_m8abs_imm(&mips3.cf[1][0], 0); // cmp [cf[0]],0 |
| 3908 | _cmp_m8abs_imm(&mips3.core.cf[1][0], 0); // cmp [cf[0]],0 |
| 3822 | 3909 | _setcc_r8(COND_NZ, REG_BL); // setnz bl |
| 3823 | 3910 | _shl_r32_imm(REG_EBX, 23); // shl ebx,23 |
| 3824 | 3911 | _or_r32_r32(REG_EAX, REG_EBX); // or eax,ebx |
| 3825 | | if (mips3.is_mips4) |
| 3912 | if (mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) |
| 3826 | 3913 | for (i = 1; i <= 7; i++) |
| 3827 | 3914 | { |
| 3828 | | _cmp_m8abs_imm(&mips3.cf[1][i], 0); // cmp [cf[i]],0 |
| 3915 | _cmp_m8abs_imm(&mips3.core.cf[1][i], 0); // cmp [cf[i]],0 |
| 3829 | 3916 | _setcc_r8(COND_NZ, REG_BL); // setnz bl |
| 3830 | 3917 | _shl_r32_imm(REG_EBX, 24+i); // shl ebx,24+i |
| 3831 | 3918 | _or_r32_r32(REG_EAX, REG_EBX); // or eax,ebx |
| 3832 | 3919 | } |
| 3833 | 3920 | } |
| 3834 | 3921 | _cdq(); // cdq |
| 3835 | | _mov_m64bd_r64(REG_ESI, REGDISP(RTREG), REG_EDX, REG_EAX); // mov [mips3.r[RTREG]],edx:eax |
| 3922 | _mov_m64bd_r64(REG_ESI, REGDISP(RTREG), REG_EDX, REG_EAX); // mov [mips3.core.r[RTREG]],edx:eax |
| 3836 | 3923 | } |
| 3837 | 3924 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3838 | 3925 | |
| 3839 | 3926 | case 0x04: /* MTCz */ |
| 3840 | 3927 | if (RTREG != 0) |
| 3841 | 3928 | { |
| 3842 | | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[mips3.r[RTREG]] |
| 3843 | | _mov_m32abs_r32(FPR32(RDREG), REG_EAX); // mov [mips3.cpr[1][RDREG]],eax |
| 3929 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[mips3.core.r[RTREG]] |
| 3930 | _mov_m32abs_r32(FPR32(RDREG), REG_EAX); // mov [mips3.core.cpr[1][RDREG]],eax |
| 3844 | 3931 | } |
| 3845 | 3932 | else |
| 3846 | | _mov_m32abs_imm(FPR32(RDREG), 0); // mov [mips3.cpr[1][RDREG]],0 |
| 3933 | _mov_m32abs_imm(FPR32(RDREG), 0); // mov [mips3.core.cpr[1][RDREG]],0 |
| 3847 | 3934 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3848 | 3935 | |
| 3849 | 3936 | case 0x05: /* DMTCz */ |
| 3850 | 3937 | if (RTREG != 0) |
| 3851 | 3938 | _mov_m64abs_m64bd(FPR64(RDREG), REG_ESI, REGDISP(RTREG)); |
| 3852 | 3939 | else |
| 3853 | | _zero_m64abs(FPR64(RDREG)); // mov [mips3.cpr[1][RDREG]],0 |
| 3940 | _zero_m64abs(FPR64(RDREG)); // mov [mips3.core.cpr[1][RDREG]],0 |
| 3854 | 3941 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3855 | 3942 | |
| 3856 | 3943 | case 0x06: /* CTCz */ |
| 3857 | 3944 | if (RTREG != 0) |
| 3858 | 3945 | { |
| 3859 | | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[mips3.r[RTREG]] |
| 3860 | | _mov_m32abs_r32(&mips3.ccr[1][RDREG], REG_EAX); // mov [mips3.ccr[1][RDREG]],eax |
| 3946 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[mips3.core.r[RTREG]] |
| 3947 | _mov_m32abs_r32(&mips3.core.ccr[1][RDREG], REG_EAX); // mov [mips3.core.ccr[1][RDREG]],eax |
| 3861 | 3948 | } |
| 3862 | 3949 | else |
| 3863 | | _mov_m32abs_imm(&mips3.ccr[1][RDREG], 0); // mov [mips3.ccr[1][RDREG]],0 |
| 3950 | _mov_m32abs_imm(&mips3.core.ccr[1][RDREG], 0); // mov [mips3.core.ccr[1][RDREG]],0 |
| 3864 | 3951 | if (RDREG == 31) |
| 3865 | 3952 | { |
| 3866 | | _mov_r32_m32abs(REG_EAX, LO(&mips3.ccr[1][RDREG])); // mov eax,[mips3.ccr[1][RDREG]] |
| 3953 | _mov_r32_m32abs(REG_EAX, LO(&mips3.core.ccr[1][RDREG])); // mov eax,[mips3.core.ccr[1][RDREG]] |
| 3867 | 3954 | _test_r32_imm(REG_EAX, 1 << 23); // test eax,1<<23 |
| 3868 | | _setcc_m8abs(COND_NZ, &mips3.cf[1][0]); // setnz [cf[0]] |
| 3869 | | if (mips3.is_mips4) |
| 3955 | _setcc_m8abs(COND_NZ, &mips3.core.cf[1][0]); // setnz [cf[0]] |
| 3956 | if (mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) |
| 3870 | 3957 | for (i = 1; i <= 7; i++) |
| 3871 | 3958 | { |
| 3872 | 3959 | _test_r32_imm(REG_EAX, 1 << (24+i)); // test eax,1<<(24+i) |
| 3873 | | _setcc_m8abs(COND_NZ, &mips3.cf[1][i]); // setnz [cf[i]] |
| 3960 | _setcc_m8abs(COND_NZ, &mips3.core.cf[1][i]); // setnz [cf[i]] |
| 3874 | 3961 | } |
| 3875 | 3962 | _and_r32_imm(REG_EAX, 3); // and eax,3 |
| 3876 | 3963 | _test_r32_imm(REG_EAX, 1); // test eax,1 |
| r869 | r870 | |
| 3885 | 3972 | switch ((op >> 16) & 3) |
| 3886 | 3973 | { |
| 3887 | 3974 | case 0x00: /* BCzF */ |
| 3888 | | _cmp_m8abs_imm(&mips3.cf[1][mips3.is_mips4 ? ((op >> 18) & 7) : 0], 0); // cmp [cf[x]],0 |
| 3975 | _cmp_m8abs_imm(&mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 18) & 7) : 0], 0); // cmp [cf[x]],0 |
| 3889 | 3976 | _jcc_near_link(COND_NZ, &link1); // jnz link1 |
| 3890 | 3977 | cycles = recompile_delay_slot(drc, pc + 4); // <next instruction> |
| 3891 | 3978 | append_branch_or_dispatch(drc, pc + 4 + (SIMMVAL << 2), 1+cycles);// <branch or dispatch> |
| r869 | r870 | |
| 3893 | 3980 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3894 | 3981 | |
| 3895 | 3982 | case 0x01: /* BCzT */ |
| 3896 | | _cmp_m8abs_imm(&mips3.cf[1][mips3.is_mips4 ? ((op >> 18) & 7) : 0], 0); // cmp [cf[x]],0 |
| 3983 | _cmp_m8abs_imm(&mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 18) & 7) : 0], 0); // cmp [cf[x]],0 |
| 3897 | 3984 | _jcc_near_link(COND_Z, &link1); // jz link1 |
| 3898 | 3985 | cycles = recompile_delay_slot(drc, pc + 4); // <next instruction> |
| 3899 | 3986 | append_branch_or_dispatch(drc, pc + 4 + (SIMMVAL << 2), 1+cycles);// <branch or dispatch> |
| r869 | r870 | |
| 3901 | 3988 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 3902 | 3989 | |
| 3903 | 3990 | case 0x02: /* BCzFL */ |
| 3904 | | _cmp_m8abs_imm(&mips3.cf[1][mips3.is_mips4 ? ((op >> 18) & 7) : 0], 0); // cmp [cf[x]],0 |
| 3991 | _cmp_m8abs_imm(&mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 18) & 7) : 0], 0); // cmp [cf[x]],0 |
| 3905 | 3992 | _jcc_near_link(COND_NZ, &link1); // jnz link1 |
| 3906 | 3993 | cycles = recompile_delay_slot(drc, pc + 4); // <next instruction> |
| 3907 | 3994 | append_branch_or_dispatch(drc, pc + 4 + (SIMMVAL << 2), 1+cycles);// <branch or dispatch> |
| r869 | r870 | |
| 3909 | 3996 | return RECOMPILE_SUCCESSFUL_CP(1,8); |
| 3910 | 3997 | |
| 3911 | 3998 | case 0x03: /* BCzTL */ |
| 3912 | | _cmp_m8abs_imm(&mips3.cf[1][mips3.is_mips4 ? ((op >> 18) & 7) : 0], 0); // cmp [cf[x]],0 |
| 3999 | _cmp_m8abs_imm(&mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 18) & 7) : 0], 0); // cmp [cf[x]],0 |
| 3913 | 4000 | _jcc_near_link(COND_Z, &link1); // jz link1 |
| 3914 | 4001 | cycles = recompile_delay_slot(drc, pc + 4); // <next instruction> |
| 3915 | 4002 | append_branch_or_dispatch(drc, pc + 4 + (SIMMVAL << 2), 1+cycles);// <branch or dispatch> |
| r869 | r870 | |
| 4213 | 4300 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4214 | 4301 | |
| 4215 | 4302 | case 0x11: /* R5000 */ |
| 4216 | | if (!mips3.is_mips4) |
| 4303 | if (mips3.core.flavor < MIPS3_TYPE_MIPS_IV) |
| 4217 | 4304 | { |
| 4218 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4305 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4219 | 4306 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 4220 | 4307 | } |
| 4221 | | _cmp_m8abs_imm(&mips3.cf[1][(op >> 18) & 7], 0); // cmp [cf[x]],0 |
| 4308 | _cmp_m8abs_imm(&mips3.core.cf[1][(op >> 18) & 7], 0); // cmp [cf[x]],0 |
| 4222 | 4309 | _jcc_short_link(((op >> 16) & 1) ? COND_Z : COND_NZ, &link1); // jz/nz skip |
| 4223 | 4310 | if (IS_SINGLE(op)) /* MOVT/F.S */ |
| 4224 | 4311 | { |
| r869 | r870 | |
| 4231 | 4318 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4232 | 4319 | |
| 4233 | 4320 | case 0x12: /* R5000 */ |
| 4234 | | if (!mips3.is_mips4) |
| 4321 | if (mips3.core.flavor < MIPS3_TYPE_MIPS_IV) |
| 4235 | 4322 | { |
| 4236 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4323 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4237 | 4324 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 4238 | 4325 | } |
| 4239 | 4326 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[rtreg].lo |
| r869 | r870 | |
| 4250 | 4337 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4251 | 4338 | |
| 4252 | 4339 | case 0x13: /* R5000 */ |
| 4253 | | if (!mips3.is_mips4) |
| 4340 | if (mips3.core.flavor < MIPS3_TYPE_MIPS_IV) |
| 4254 | 4341 | { |
| 4255 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4342 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4256 | 4343 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 4257 | 4344 | } |
| 4258 | 4345 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // mov eax,[rtreg].lo |
| r869 | r870 | |
| 4269 | 4356 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4270 | 4357 | |
| 4271 | 4358 | case 0x15: /* R5000 */ |
| 4272 | | if (!mips3.is_mips4) |
| 4359 | if (mips3.core.flavor < MIPS3_TYPE_MIPS_IV) |
| 4273 | 4360 | { |
| 4274 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4361 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4275 | 4362 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 4276 | 4363 | } |
| 4277 | 4364 | _fld1(); // fld1 |
| r869 | r870 | |
| 4290 | 4377 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4291 | 4378 | |
| 4292 | 4379 | case 0x16: /* R5000 */ |
| 4293 | | if (!mips3.is_mips4) |
| 4380 | if (mips3.core.flavor < MIPS3_TYPE_MIPS_IV) |
| 4294 | 4381 | { |
| 4295 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4382 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4296 | 4383 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 4297 | 4384 | } |
| 4298 | 4385 | _fld1(); // fld1 |
| r869 | r870 | |
| 4356 | 4443 | |
| 4357 | 4444 | case 0x30: |
| 4358 | 4445 | case 0x38: |
| 4359 | | _mov_m8abs_imm(&mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0], 0); /* C.F.S/D */ |
| 4446 | _mov_m8abs_imm(&mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0], 0); /* C.F.S/D */ |
| 4360 | 4447 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4361 | 4448 | |
| 4362 | 4449 | case 0x31: |
| 4363 | 4450 | case 0x39: |
| 4364 | | _mov_m8abs_imm(&mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0], 0); /* C.UN.S/D */ |
| 4451 | _mov_m8abs_imm(&mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0], 0); /* C.UN.S/D */ |
| 4365 | 4452 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4366 | 4453 | |
| 4367 | 4454 | case 0x32: |
| r869 | r870 | |
| 4378 | 4465 | _movsd_r128_m64abs(REG_XMM0, FPR64(FSREG)); // movsd xmm0,[fsreg] |
| 4379 | 4466 | _comisd_r128_m64abs(REG_XMM0, FPR64(FTREG)); // comisd xmm0,[ftreg] |
| 4380 | 4467 | } |
| 4381 | | _setcc_m8abs(COND_E, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // sete [cf[x]] |
| 4468 | _setcc_m8abs(COND_E, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // sete [cf[x]] |
| 4382 | 4469 | } |
| 4383 | 4470 | else |
| 4384 | 4471 | { |
| r869 | r870 | |
| 4395 | 4482 | _fcompp(); // fcompp |
| 4396 | 4483 | _fnstsw_ax(); // fnstsw ax |
| 4397 | 4484 | _sahf(); // sahf |
| 4398 | | _setcc_m8abs(COND_E, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // sete [cf[x]] |
| 4485 | _setcc_m8abs(COND_E, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // sete [cf[x]] |
| 4399 | 4486 | } |
| 4400 | 4487 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4401 | 4488 | |
| r869 | r870 | |
| 4413 | 4500 | _movsd_r128_m64abs(REG_XMM0, FPR64(FSREG)); // movsd xmm0,[fsreg] |
| 4414 | 4501 | _ucomisd_r128_m64abs(REG_XMM0, FPR64(FTREG)); // ucomisd xmm0,[ftreg] |
| 4415 | 4502 | } |
| 4416 | | _setcc_m8abs(COND_E, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // sete [cf[x]] |
| 4503 | _setcc_m8abs(COND_E, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // sete [cf[x]] |
| 4417 | 4504 | } |
| 4418 | 4505 | else |
| 4419 | 4506 | { |
| r869 | r870 | |
| 4430 | 4517 | _fucompp(); // fucompp |
| 4431 | 4518 | _fnstsw_ax(); // fnstsw ax |
| 4432 | 4519 | _sahf(); // sahf |
| 4433 | | _setcc_m8abs(COND_E, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // sete [cf[x]] |
| 4520 | _setcc_m8abs(COND_E, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // sete [cf[x]] |
| 4434 | 4521 | } |
| 4435 | 4522 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4436 | 4523 | |
| r869 | r870 | |
| 4448 | 4535 | _movsd_r128_m64abs(REG_XMM0, FPR64(FSREG)); // movsd xmm0,[fsreg] |
| 4449 | 4536 | _comisd_r128_m64abs(REG_XMM0, FPR64(FTREG)); // comisd xmm0,[ftreg] |
| 4450 | 4537 | } |
| 4451 | | _setcc_m8abs(COND_B, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // setb [cf[x]] |
| 4538 | _setcc_m8abs(COND_B, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // setb [cf[x]] |
| 4452 | 4539 | } |
| 4453 | 4540 | else |
| 4454 | 4541 | { |
| r869 | r870 | |
| 4465 | 4552 | _fcompp(); // fcompp |
| 4466 | 4553 | _fnstsw_ax(); // fnstsw ax |
| 4467 | 4554 | _sahf(); // sahf |
| 4468 | | _setcc_m8abs(COND_B, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // setb [cf[x]] |
| 4555 | _setcc_m8abs(COND_B, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // setb [cf[x]] |
| 4469 | 4556 | } |
| 4470 | 4557 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4471 | 4558 | |
| r869 | r870 | |
| 4483 | 4570 | _movsd_r128_m64abs(REG_XMM0, FPR64(FSREG)); // movsd xmm0,[fsreg] |
| 4484 | 4571 | _ucomisd_r128_m64abs(REG_XMM0, FPR64(FTREG)); // ucomisd xmm0,[ftreg] |
| 4485 | 4572 | } |
| 4486 | | _setcc_m8abs(COND_B, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // setb [cf[x]] |
| 4573 | _setcc_m8abs(COND_B, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // setb [cf[x]] |
| 4487 | 4574 | } |
| 4488 | 4575 | else |
| 4489 | 4576 | { |
| r869 | r870 | |
| 4500 | 4587 | _fucompp(); // fucompp |
| 4501 | 4588 | _fnstsw_ax(); // fnstsw ax |
| 4502 | 4589 | _sahf(); // sahf |
| 4503 | | _setcc_m8abs(COND_B, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // setb [cf[x]] |
| 4590 | _setcc_m8abs(COND_B, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // setb [cf[x]] |
| 4504 | 4591 | } |
| 4505 | 4592 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4506 | 4593 | |
| r869 | r870 | |
| 4518 | 4605 | _movsd_r128_m64abs(REG_XMM0, FPR64(FSREG)); // movsd xmm0,[fsreg] |
| 4519 | 4606 | _comisd_r128_m64abs(REG_XMM0, FPR64(FTREG)); // comisd xmm0,[ftreg] |
| 4520 | 4607 | } |
| 4521 | | _setcc_m8abs(COND_BE, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // setle [cf[x]] |
| 4608 | _setcc_m8abs(COND_BE, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // setle [cf[x]] |
| 4522 | 4609 | } |
| 4523 | 4610 | else |
| 4524 | 4611 | { |
| r869 | r870 | |
| 4535 | 4622 | _fcompp(); // fcompp |
| 4536 | 4623 | _fnstsw_ax(); // fnstsw ax |
| 4537 | 4624 | _sahf(); // sahf |
| 4538 | | _setcc_m8abs(COND_BE, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // setbe [cf[x]] |
| 4625 | _setcc_m8abs(COND_BE, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // setbe [cf[x]] |
| 4539 | 4626 | } |
| 4540 | 4627 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4541 | 4628 | |
| r869 | r870 | |
| 4553 | 4640 | _movsd_r128_m64abs(REG_XMM0, FPR64(FSREG)); // movsd xmm0,[fsreg] |
| 4554 | 4641 | _ucomisd_r128_m64abs(REG_XMM0, FPR64(FTREG)); // ucomisd xmm0,[ftreg] |
| 4555 | 4642 | } |
| 4556 | | _setcc_m8abs(COND_BE, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // setl [cf[x]] |
| 4643 | _setcc_m8abs(COND_BE, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // setl [cf[x]] |
| 4557 | 4644 | } |
| 4558 | 4645 | else |
| 4559 | 4646 | { |
| r869 | r870 | |
| 4570 | 4657 | _fucompp(); // fucompp |
| 4571 | 4658 | _fnstsw_ax(); // fnstsw ax |
| 4572 | 4659 | _sahf(); // sahf |
| 4573 | | _setcc_m8abs(COND_BE, &mips3.cf[1][mips3.is_mips4 ? ((op >> 8) & 7) : 0]); // setbe [cf[x]] |
| 4660 | _setcc_m8abs(COND_BE, &mips3.core.cf[1][(mips3.core.flavor >= MIPS3_TYPE_MIPS_IV) ? ((op >> 8) & 7) : 0]); // setbe [cf[x]] |
| 4574 | 4661 | } |
| 4575 | 4662 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| 4576 | 4663 | } |
| 4577 | 4664 | break; |
| 4578 | 4665 | } |
| 4579 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4666 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4580 | 4667 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 4581 | 4668 | } |
| 4582 | 4669 | |
| r869 | r870 | |
| 4594 | 4681 | { |
| 4595 | 4682 | if (mips3.drcoptions & MIPS3DRC_STRICT_COP1) |
| 4596 | 4683 | { |
| 4597 | | _test_m32abs_imm(&mips3.cpr[0][COP0_Status], SR_COP1); // test [mips3.cpr[0][COP0_Status]],SR_COP1 |
| 4598 | | _jcc(COND_Z, mips3.generate_cop_exception); // jz generate_cop_exception |
| 4684 | _test_m32abs_imm(&mips3.core.cpr[0][COP0_Status], SR_COP1); // test [mips3.core.cpr[0][COP0_Status]],SR_COP1 |
| 4685 | _jcc(COND_Z, mips3.drc->generate_cop_exception); // jz generate_cop_exception |
| 4599 | 4686 | } |
| 4600 | 4687 | |
| 4601 | 4688 | switch (op & 0x3f) |
| r869 | r870 | |
| 4607 | 4694 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| 4608 | 4695 | _add_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // add eax,[rtreg] |
| 4609 | 4696 | _push_r32(REG_EAX); // push eax |
| 4610 | | _call(mips3.read_and_translate_long); // call read_and_translate_long |
| 4697 | _call(mips3.drc->read_and_translate_long); // call read_and_translate_long |
| 4611 | 4698 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 4612 | 4699 | _mov_m32abs_r32(FPR32(FDREG), REG_EAX); // mov [fdreg],eax |
| 4613 | 4700 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| r869 | r870 | |
| 4620 | 4707 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| 4621 | 4708 | _add_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // add eax,[rtreg] |
| 4622 | 4709 | _push_r32(REG_EAX); // push eax |
| 4623 | | _call(mips3.read_and_translate_double); // call read_and_translate_double |
| 4710 | _call(mips3.drc->read_and_translate_double); // call read_and_translate_double |
| 4624 | 4711 | _mov_m32abs_r32(LO(FPR64(FDREG)), REG_EAX); // mov [fdreg].lo,eax |
| 4625 | 4712 | _mov_m32abs_r32(HI(FPR64(FDREG)), REG_EDX); // mov [fdreg].hi,edx |
| 4626 | 4713 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| r869 | r870 | |
| 4635 | 4722 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| 4636 | 4723 | _add_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // add eax,[rtreg] |
| 4637 | 4724 | _push_r32(REG_EAX); // push eax |
| 4638 | | _call(mips3.write_and_translate_long); // call write_and_translate_long |
| 4725 | _call(mips3.drc->write_and_translate_long); // call write_and_translate_long |
| 4639 | 4726 | _add_r32_imm(REG_ESP, 12); // add esp,8 |
| 4640 | 4727 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 4641 | 4728 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 4644 | 4731 | // REVISIT: does this actually work? |
| 4645 | 4732 | // Two 32-bit words are pushed, before the call, but three are popped afterwards! |
| 4646 | 4733 | // This, as far as I can see, will kill off the return address. |
| 4647 | | // All other calls to mips3.write_and_translate_double take three 32-bit words as arguments. |
| 4734 | // All other calls to mips3.drc->write_and_translate_double take three 32-bit words as arguments. |
| 4648 | 4735 | // So is one argument too few being pushed, or is one too many being popped? |
| 4649 | 4736 | _mov_m32abs_r32(&mips3_icount, REG_EBP); // mov [mips3_icount],ebp |
| 4650 | 4737 | _save_pc_before_call(); // save pc |
| r869 | r870 | |
| 4652 | 4739 | _push_m32abs(LO(FPR64(FSREG))); // push [fsreg].lo |
| 4653 | 4740 | _mov_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RSREG)); // mov eax,[rsreg] |
| 4654 | 4741 | _add_r32_m32bd(REG_EAX, REG_ESI, REGDISP(RTREG)); // add eax,[rtreg] |
| 4655 | | _call(mips3.write_and_translate_double); // call write_and_translate_double |
| 4742 | _call(mips3.drc->write_and_translate_double); // call write_and_translate_double |
| 4656 | 4743 | _add_r32_imm(REG_ESP, 12); // add esp,12 |
| 4657 | 4744 | _mov_r32_m32abs(REG_EBP, &mips3_icount); // mov ebp,[mips3_icount] |
| 4658 | 4745 | return RECOMPILE_SUCCESSFUL_CP(1,4); |
| r869 | r870 | |
| 4832 | 4919 | fprintf(stderr, "cop1x %X\n", op); |
| 4833 | 4920 | break; |
| 4834 | 4921 | } |
| 4835 | | _jmp((void *)mips3.generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4922 | _jmp((void *)mips3.drc->generate_invalidop_exception); // jmp generate_invalidop_exception |
| 4836 | 4923 | return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING; |
| 4837 | 4924 | } |
src/emu/cpu/mips/mips3drc.c
| r869 | r870 | |
| 14 | 14 | #include <stddef.h> |
| 15 | 15 | #include "cpuintrf.h" |
| 16 | 16 | #include "debugger.h" |
| 17 | | #include "mips3.h" |
| 18 | | #include "cpu/x86drc.h" |
| 17 | #include "mips3com.h" |
| 19 | 18 | |
| 20 | 19 | |
| 21 | | //In GCC, ECX/EDX are volatile |
| 22 | | //EBX/EBP/ESI/EDI are non-volatile |
| 23 | 20 | |
| 24 | | |
| 25 | | |
| 26 | 21 | /*************************************************************************** |
| 27 | | CONFIGURATION |
| 22 | DEBUGGING |
| 28 | 23 | ***************************************************************************/ |
| 29 | 24 | |
| 30 | 25 | #define LOG_CODE (0) |
| 31 | | #define PRINTF_TLB (0) |
| 32 | 26 | |
| 33 | | #define CACHE_SIZE (16 * 1024 * 1024) |
| 34 | | #define MAX_INSTRUCTIONS 512 |
| 35 | 27 | |
| 36 | 28 | |
| 37 | | |
| 38 | 29 | /*************************************************************************** |
| 39 | | CONSTANTS |
| 30 | CONFIGURATION |
| 40 | 31 | ***************************************************************************/ |
| 41 | 32 | |
| 42 | | /* COP0 registers */ |
| 43 | | #define COP0_Index 0 |
| 44 | | #define COP0_Random 1 |
| 45 | | #define COP0_EntryLo 2 |
| 46 | | #define COP0_EntryLo0 2 |
| 47 | | #define COP0_EntryLo1 3 |
| 48 | | #define COP0_Context 4 |
| 49 | | #define COP0_PageMask 5 |
| 50 | | #define COP0_Wired 6 |
| 51 | | #define COP0_BadVAddr 8 |
| 52 | | #define COP0_Count 9 |
| 53 | | #define COP0_EntryHi 10 |
| 54 | | #define COP0_Compare 11 |
| 55 | | #define COP0_Status 12 |
| 56 | | #define COP0_Cause 13 |
| 57 | | #define COP0_EPC 14 |
| 58 | | #define COP0_PRId 15 |
| 59 | | #define COP0_Config 16 |
| 60 | | #define COP0_XContext 20 |
| 33 | #define MAX_INSTRUCTIONS 512 |
| 61 | 34 | |
| 62 | | /* Status register bits */ |
| 63 | | #define SR_IE 0x00000001 |
| 64 | | #define SR_EXL 0x00000002 |
| 65 | | #define SR_ERL 0x00000004 |
| 66 | | #define SR_KSU_MASK 0x00000018 |
| 67 | | #define SR_KSU_KERNEL 0x00000000 |
| 68 | | #define SR_KSU_SUPERVISOR 0x00000008 |
| 69 | | #define SR_KSU_USER 0x00000010 |
| 70 | | #define SR_IMSW0 0x00000100 |
| 71 | | #define SR_IMSW1 0x00000200 |
| 72 | | #define SR_IMEX0 0x00000400 |
| 73 | | #define SR_IMEX1 0x00000800 |
| 74 | | #define SR_IMEX2 0x00001000 |
| 75 | | #define SR_IMEX3 0x00002000 |
| 76 | | #define SR_IMEX4 0x00004000 |
| 77 | | #define SR_IMEX5 0x00008000 |
| 78 | | #define SR_DE 0x00010000 |
| 79 | | #define SR_CE 0x00020000 |
| 80 | | #define SR_CH 0x00040000 |
| 81 | | #define SR_SR 0x00100000 |
| 82 | | #define SR_TS 0x00200000 |
| 83 | | #define SR_BEV 0x00400000 |
| 84 | | #define SR_RE 0x02000000 |
| 85 | | #define SR_FR 0x04000000 |
| 86 | | #define SR_RP 0x08000000 |
| 87 | | #define SR_COP0 0x10000000 |
| 88 | | #define SR_COP1 0x20000000 |
| 89 | | #define SR_COP2 0x40000000 |
| 90 | | #define SR_COP3 0x80000000 |
| 91 | 35 | |
| 92 | | /* exception types */ |
| 93 | | #define EXCEPTION_INTERRUPT 0 |
| 94 | | #define EXCEPTION_TLBMOD 1 |
| 95 | | #define EXCEPTION_TLBLOAD 2 |
| 96 | | #define EXCEPTION_TLBSTORE 3 |
| 97 | | #define EXCEPTION_ADDRLOAD 4 |
| 98 | | #define EXCEPTION_ADDRSTORE 5 |
| 99 | | #define EXCEPTION_BUSINST 6 |
| 100 | | #define EXCEPTION_BUSDATA 7 |
| 101 | | #define EXCEPTION_SYSCALL 8 |
| 102 | | #define EXCEPTION_BREAK 9 |
| 103 | | #define EXCEPTION_INVALIDOP 10 |
| 104 | | #define EXCEPTION_BADCOP 11 |
| 105 | | #define EXCEPTION_OVERFLOW 12 |
| 106 | | #define EXCEPTION_TRAP 13 |
| 107 | 36 | |
| 108 | | |
| 109 | | |
| 110 | 37 | /*************************************************************************** |
| 111 | | HELPER MACROS |
| 38 | MACROS |
| 112 | 39 | ***************************************************************************/ |
| 113 | 40 | |
| 114 | | #define RSREG ((op >> 21) & 31) |
| 115 | | #define RTREG ((op >> 16) & 31) |
| 116 | | #define RDREG ((op >> 11) & 31) |
| 117 | | #define SHIFT ((op >> 6) & 31) |
| 41 | #define SR mips3.core.cpr[0][COP0_Status] |
| 42 | #define IS_FR0 (!(SR & SR_FR)) |
| 43 | #define IS_FR1 (SR & SR_FR) |
| 118 | 44 | |
| 119 | | #define FRREG ((op >> 21) & 31) |
| 120 | | #define FTREG ((op >> 16) & 31) |
| 121 | | #define FSREG ((op >> 11) & 31) |
| 122 | | #define FDREG ((op >> 6) & 31) |
| 123 | 45 | |
| 124 | | #define IS_SINGLE(o) (((o) & (1 << 21)) == 0) |
| 125 | | #define IS_DOUBLE(o) (((o) & (1 << 21)) != 0) |
| 126 | | #define IS_FLOAT(o) (((o) & (1 << 23)) == 0) |
| 127 | | #define IS_INTEGRAL(o) (((o) & (1 << 23)) != 0) |
| 128 | 46 | |
| 129 | | #define SIMMVAL ((INT16)op) |
| 130 | | #define UIMMVAL ((UINT16)op) |
| 131 | | #define LIMMVAL (op & 0x03ffffff) |
| 132 | | |
| 133 | | #define IS_FR0 (!(mips3.cpr[0][COP0_Status] & SR_FR)) |
| 134 | | #define IS_FR1 (mips3.cpr[0][COP0_Status] & SR_FR) |
| 135 | | |
| 136 | | |
| 137 | | |
| 138 | 47 | /*************************************************************************** |
| 139 | 48 | STRUCTURES & TYPEDEFS |
| 140 | 49 | ***************************************************************************/ |
| 141 | 50 | |
| 142 | | /* memory access function table */ |
| 143 | | typedef struct |
| 144 | | { |
| 145 | | UINT8 (*readbyte)(offs_t); |
| 146 | | UINT16 (*readword)(offs_t); |
| 147 | | UINT32 (*readlong)(offs_t); |
| 148 | | void (*writebyte)(offs_t, UINT8); |
| 149 | | void (*writeword)(offs_t, UINT16); |
| 150 | | void (*writelong)(offs_t, UINT32); |
| 151 | | } memory_handlers; |
| 152 | | |
| 153 | | |
| 154 | 51 | /* code logging info */ |
| 52 | typedef struct _code_log_entry code_log_entry; |
| 155 | 53 | struct _code_log_entry |
| 156 | 54 | { |
| 157 | 55 | UINT32 pc; |
| 158 | 56 | UINT32 op; |
| 159 | 57 | void * base; |
| 160 | 58 | }; |
| 161 | | typedef struct _code_log_entry code_log_entry; |
| 162 | 59 | |
| 163 | 60 | |
| 164 | | /* MIPS3 Registers */ |
| 165 | | typedef struct |
| 61 | /* fast RAM info */ |
| 62 | typedef struct _fast_ram_info fast_ram_info; |
| 63 | struct _fast_ram_info |
| 166 | 64 | { |
| 167 | | /* core registers */ |
| 168 | | UINT32 pc; |
| 169 | | UINT64 hi; |
| 170 | | UINT64 lo; |
| 171 | | UINT64 r[32]; |
| 65 | offs_t start; |
| 66 | offs_t end; |
| 67 | UINT8 readonly; |
| 68 | void * base; |
| 69 | }; |
| 172 | 70 | |
| 173 | | /* COP registers */ |
| 174 | | UINT64 cpr[4][32]; |
| 175 | | UINT64 ccr[4][32]; |
| 176 | | UINT8 cf[4][8]; |
| 177 | 71 | |
| 178 | | /* internal stuff */ |
| 179 | | drc_core * drc; |
| 180 | | UINT32 drcoptions; |
| 181 | | UINT32 nextpc; |
| 182 | | int (*irq_callback)(int irqline); |
| 183 | | UINT64 count_zero_time; |
| 184 | | mame_timer * compare_int_timer; |
| 185 | | UINT8 is_mips4; |
| 186 | | UINT8 flush_pending; |
| 187 | | UINT32 system_clock; |
| 188 | | UINT32 cpu_clock; |
| 72 | /* hotspot info */ |
| 73 | typedef struct _hotspot_info hotspot_info; |
| 74 | struct _hotspot_info |
| 75 | { |
| 76 | offs_t pc; |
| 77 | UINT32 opcode; |
| 78 | UINT32 cycles; |
| 79 | }; |
| 189 | 80 | |
| 190 | | /* memory accesses */ |
| 191 | | UINT8 bigendian; |
| 192 | | memory_handlers memory; |
| 193 | 81 | |
| 194 | | /* cache memory */ |
| 195 | | UINT32 * icache; |
| 196 | | UINT32 * dcache; |
| 197 | | size_t icache_size; |
| 198 | | size_t dcache_size; |
| 82 | /* opaque drc-specific info */ |
| 83 | typedef struct _mips3drc_data mips3drc_data; |
| 199 | 84 | |
| 200 | | /* MMU */ |
| 201 | | struct |
| 202 | | { |
| 203 | | UINT64 page_mask; |
| 204 | | UINT64 entry_hi; |
| 205 | | UINT64 entry_lo[2]; |
| 206 | | } tlb[48]; |
| 207 | | UINT32 * tlb_table; |
| 208 | 85 | |
| 86 | /* MIPS3 registers */ |
| 87 | typedef struct _mips3_regs mips3_regs; |
| 88 | struct _mips3_regs |
| 89 | { |
| 90 | /* core state */ |
| 91 | mips3_state core; |
| 92 | mips3drc_data * drc; |
| 93 | UINT32 drcoptions; |
| 94 | |
| 95 | /* internal stuff */ |
| 96 | UINT32 nextpc; |
| 97 | |
| 209 | 98 | /* fast RAM */ |
| 210 | | UINT32 fastram_select; |
| 211 | | struct |
| 212 | | { |
| 213 | | offs_t start; |
| 214 | | offs_t end; |
| 215 | | int readonly; |
| 216 | | void * base; |
| 217 | | } fastram[MIPS3_MAX_FASTRAM]; |
| 99 | UINT32 fastram_select; |
| 100 | fast_ram_info fastram[MIPS3_MAX_FASTRAM]; |
| 218 | 101 | |
| 219 | 102 | /* hotspots */ |
| 220 | | UINT32 hotspot_select; |
| 221 | | struct |
| 222 | | { |
| 223 | | offs_t pc; |
| 224 | | UINT32 opcode; |
| 225 | | UINT32 cycles; |
| 226 | | } hotspot[MIPS3_MAX_HOTSPOTS]; |
| 103 | UINT32 hotspot_select; |
| 104 | hotspot_info hotspot[MIPS3_MAX_HOTSPOTS]; |
| 105 | }; |
| 227 | 106 | |
| 228 | | /* callbacks */ |
| 229 | | void * generate_interrupt_exception; |
| 230 | | void * generate_cop_exception; |
| 231 | | void * generate_overflow_exception; |
| 232 | | void * generate_invalidop_exception; |
| 233 | | void * generate_syscall_exception; |
| 234 | | void * generate_break_exception; |
| 235 | | void * generate_trap_exception; |
| 236 | | void * generate_tlbload_exception; |
| 237 | | void * generate_tlbstore_exception; |
| 238 | | void * handle_pc_tlb_mismatch; |
| 239 | | void * read_and_translate_byte_signed; |
| 240 | | void * read_and_translate_byte_unsigned; |
| 241 | | void * read_and_translate_word_signed; |
| 242 | | void * read_and_translate_word_unsigned; |
| 243 | | void * read_and_translate_long; |
| 244 | | void * read_and_translate_double; |
| 245 | | void * write_and_translate_byte; |
| 246 | | void * write_and_translate_word; |
| 247 | | void * write_and_translate_long; |
| 248 | | void * write_and_translate_double; |
| 249 | | void * write_back_long; |
| 250 | | void * write_back_double; |
| 251 | | } mips3_regs; |
| 252 | 107 | |
| 253 | 108 | |
| 254 | | |
| 255 | 109 | /*************************************************************************** |
| 256 | 110 | FUNCTION PROTOTYPES |
| 257 | 111 | ***************************************************************************/ |
| 258 | 112 | |
| 259 | 113 | static void mips3drc_init(void); |
| 260 | | static void mips3drc_reset(drc_core *drc); |
| 261 | | static void mips3drc_recompile(drc_core *drc); |
| 262 | | static void mips3drc_entrygen(drc_core *drc); |
| 114 | static void mips3drc_reset(void); |
| 115 | static void mips3drc_execute(void); |
| 116 | static void mips3drc_exit(void); |
| 263 | 117 | |
| 264 | | static void recompute_tlb_table(void); |
| 265 | | static void update_cycle_counting(void); |
| 266 | 118 | |
| 267 | | #ifdef MAME_DEBUG |
| 268 | | static offs_t mips3_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); |
| 269 | | #endif /* MAME_DEBUG */ |
| 270 | 119 | |
| 271 | | |
| 272 | | |
| 273 | 120 | /*************************************************************************** |
| 274 | | PUBLIC GLOBAL VARIABLES |
| 275 | | ***************************************************************************/ |
| 276 | | |
| 277 | | static int mips3_icount; |
| 278 | | |
| 279 | | |
| 280 | | |
| 281 | | /*************************************************************************** |
| 282 | 121 | PRIVATE GLOBAL VARIABLES |
| 283 | 122 | ***************************************************************************/ |
| 284 | 123 | |
| 285 | 124 | static mips3_regs mips3; |
| 286 | 125 | |
| 287 | 126 | |
| 288 | | static const memory_handlers be_memory = |
| 289 | | { |
| 290 | | program_read_byte_32be, program_read_word_32be, program_read_dword_32be, |
| 291 | | program_write_byte_32be, program_write_word_32be, program_write_dword_32be |
| 292 | | }; |
| 293 | 127 | |
| 294 | | static const memory_handlers le_memory = |
| 295 | | { |
| 296 | | program_read_byte_32le, program_read_word_32le, program_read_dword_32le, |
| 297 | | program_write_byte_32le, program_write_word_32le, program_write_dword_32le |
| 298 | | }; |
| 299 | | |
| 300 | | |
| 301 | | |
| 302 | 128 | /*************************************************************************** |
| 303 | | IRQ HANDLING |
| 129 | CORE CALLBACKS |
| 304 | 130 | ***************************************************************************/ |
| 305 | 131 | |
| 306 | | static void set_irq_line(int irqline, int state) |
| 307 | | { |
| 308 | | if (state != CLEAR_LINE) |
| 309 | | mips3.cpr[0][COP0_Cause] |= 0x400 << irqline; |
| 310 | | else |
| 311 | | mips3.cpr[0][COP0_Cause] &= ~(0x400 << irqline); |
| 312 | | } |
| 132 | /*------------------------------------------------- |
| 133 | mips3_reset - reset the processor |
| 134 | -------------------------------------------------*/ |
| 313 | 135 | |
| 314 | | |
| 315 | | |
| 316 | | /*************************************************************************** |
| 317 | | CONTEXT SWITCHING |
| 318 | | ***************************************************************************/ |
| 319 | | |
| 320 | | static void mips3_get_context(void *dst) |
| 136 | static void mips3_reset(void) |
| 321 | 137 | { |
| 322 | | /* copy the context */ |
| 323 | | if (dst) |
| 324 | | *(mips3_regs *)dst = mips3; |
| 138 | mips3com_reset(&mips3.core); |
| 139 | mips3drc_reset(); |
| 325 | 140 | } |
| 326 | 141 | |
| 327 | 142 | |
| 328 | | static void mips3_set_context(void *src) |
| 329 | | { |
| 330 | | /* copy the context */ |
| 331 | | if (src) |
| 332 | | mips3 = *(mips3_regs *)src; |
| 333 | | } |
| 143 | /*------------------------------------------------- |
| 144 | mips3_execute - execute the CPU for the |
| 145 | specified number of cycles |
| 146 | -------------------------------------------------*/ |
| 334 | 147 | |
| 335 | | |
| 336 | | |
| 337 | | /*************************************************************************** |
| 338 | | INITIALIZATION AND SHUTDOWN |
| 339 | | ***************************************************************************/ |
| 340 | | |
| 341 | | static TIMER_CALLBACK( compare_int_callback ) |
| 342 | | { |
| 343 | | cpunum_set_input_line(param, 5, ASSERT_LINE); |
| 344 | | } |
| 345 | | |
| 346 | | |
| 347 | | static void mips3_init(int index, int clock, const void *_config, int (*irqcallback)(int)) |
| 348 | | { |
| 349 | | const struct mips3_config *config = _config; |
| 350 | | mips3drc_init(); |
| 351 | | |
| 352 | | mips3.compare_int_timer = mame_timer_alloc(compare_int_callback); |
| 353 | | mips3.irq_callback = irqcallback; |
| 354 | | |
| 355 | | /* allocate memory */ |
| 356 | | mips3.icache = auto_malloc(config->icache); |
| 357 | | mips3.dcache = auto_malloc(config->dcache); |
| 358 | | mips3.tlb_table = auto_malloc(sizeof(mips3.tlb_table[0]) * (1 << (32 - 12))); |
| 359 | | |
| 360 | | /* initialize the rest of the config */ |
| 361 | | mips3.icache_size = config->icache; |
| 362 | | mips3.dcache_size = config->dcache; |
| 363 | | mips3.system_clock = config->system_clock; |
| 364 | | mips3.cpu_clock = clock; |
| 365 | | } |
| 366 | | |
| 367 | | |
| 368 | | static void mips3_reset(int bigendian, int mips4, UINT32 prid) |
| 369 | | { |
| 370 | | UINT32 configreg; |
| 371 | | int divisor; |
| 372 | | |
| 373 | | /* set up the endianness */ |
| 374 | | mips3.bigendian = bigendian; |
| 375 | | if (mips3.bigendian) |
| 376 | | mips3.memory = be_memory; |
| 377 | | else |
| 378 | | mips3.memory = le_memory; |
| 379 | | |
| 380 | | /* initialize the state */ |
| 381 | | mips3.pc = 0xbfc00000; |
| 382 | | mips3.nextpc = ~0; |
| 383 | | mips3.cpr[0][COP0_Status] = SR_BEV | SR_ERL; |
| 384 | | mips3.cpr[0][COP0_Compare] = 0xffffffff; |
| 385 | | mips3.cpr[0][COP0_Count] = 0; |
| 386 | | mips3.count_zero_time = activecpu_gettotalcycles64(); |
| 387 | | |
| 388 | | /* reset the DRC */ |
| 389 | | drc_cache_reset(mips3.drc); |
| 390 | | |
| 391 | | /* config register: set the cache line size to 32 bytes */ |
| 392 | | configreg = 0x00026030; |
| 393 | | |
| 394 | | /* config register: set the data cache size */ |
| 395 | | if (mips3.icache_size <= 0x01000) configreg |= 0 << 6; |
| 396 | | else if (mips3.icache_size <= 0x02000) configreg |= 1 << 6; |
| 397 | | else if (mips3.icache_size <= 0x04000) configreg |= 2 << 6; |
| 398 | | else if (mips3.icache_size <= 0x08000) configreg |= 3 << 6; |
| 399 | | else if (mips3.icache_size <= 0x10000) configreg |= 4 << 6; |
| 400 | | else if (mips3.icache_size <= 0x20000) configreg |= 5 << 6; |
| 401 | | else if (mips3.icache_size <= 0x40000) configreg |= 6 << 6; |
| 402 | | else configreg |= 7 << 6; |
| 403 | | |
| 404 | | /* config register: set the instruction cache size */ |
| 405 | | if (mips3.icache_size <= 0x01000) configreg |= 0 << 9; |
| 406 | | else if (mips3.icache_size <= 0x02000) configreg |= 1 << 9; |
| 407 | | else if (mips3.icache_size <= 0x04000) configreg |= 2 << 9; |
| 408 | | else if (mips3.icache_size <= 0x08000) configreg |= 3 << 9; |
| 409 | | else if (mips3.icache_size <= 0x10000) configreg |= 4 << 9; |
| 410 | | else if (mips3.icache_size <= 0x20000) configreg |= 5 << 9; |
| 411 | | else if (mips3.icache_size <= 0x40000) configreg |= 6 << 9; |
| 412 | | else configreg |= 7 << 9; |
| 413 | | |
| 414 | | /* config register: set the endianness bit */ |
| 415 | | if (bigendian) configreg |= 0x00008000; |
| 416 | | |
| 417 | | /* config register: set the system clock divider */ |
| 418 | | divisor = 2; |
| 419 | | if (mips3.system_clock != 0) |
| 420 | | { |
| 421 | | divisor = mips3.cpu_clock / mips3.system_clock; |
| 422 | | if (mips3.system_clock * divisor != mips3.cpu_clock) |
| 423 | | { |
| 424 | | configreg |= 0x80000000; |
| 425 | | divisor = mips3.cpu_clock * 2 / mips3.system_clock; |
| 426 | | } |
| 427 | | } |
| 428 | | configreg |= (((divisor < 2) ? 2 : (divisor > 8) ? 8 : divisor) - 2) << 28; |
| 429 | | |
| 430 | | /* set up the architecture */ |
| 431 | | mips3.is_mips4 = mips4; |
| 432 | | mips3.cpr[0][COP0_PRId] = prid; |
| 433 | | mips3.cpr[0][COP0_Config] = configreg; |
| 434 | | |
| 435 | | /* recompute the TLB table */ |
| 436 | | recompute_tlb_table(); |
| 437 | | } |
| 438 | | |
| 439 | | |
| 440 | | /* |
| 441 | | |
| 442 | | R6000A = 0x0600 |
| 443 | | R10000 = 0x0900 |
| 444 | | R4300 = 0x0b00 |
| 445 | | VR41XX = 0x0c00 |
| 446 | | R12000 = 0x0e00 |
| 447 | | R8000 = 0x1000 |
| 448 | | R4600 = 0x2000 |
| 449 | | R4650 = 0x2000 |
| 450 | | R5000 = 0x2300 |
| 451 | | R5432 = 0x5400 |
| 452 | | RM7000 = 0x2700 |
| 453 | | */ |
| 454 | | |
| 455 | | #if (HAS_R4600||HAS_R4650) |
| 456 | | static void r4600be_reset(void) |
| 457 | | { |
| 458 | | mips3_reset(1, 0, 0x2000); |
| 459 | | } |
| 460 | | |
| 461 | | static void r4600le_reset(void) |
| 462 | | { |
| 463 | | mips3_reset(0, 0, 0x2000); |
| 464 | | } |
| 465 | | #endif |
| 466 | | |
| 467 | | |
| 468 | | #if (HAS_R4700) |
| 469 | | static void r4700be_reset(void) |
| 470 | | { |
| 471 | | mips3_reset(1, 0, 0x2100); |
| 472 | | } |
| 473 | | |
| 474 | | static void r4700le_reset(void) |
| 475 | | { |
| 476 | | mips3_reset(0, 0, 0x2100); |
| 477 | | } |
| 478 | | #endif |
| 479 | | |
| 480 | | |
| 481 | | #if (HAS_R5000) |
| 482 | | static void r5000be_reset(void) |
| 483 | | { |
| 484 | | mips3_reset(1, 1, 0x2300); |
| 485 | | } |
| 486 | | |
| 487 | | static void r5000le_reset(void) |
| 488 | | { |
| 489 | | mips3_reset(0, 1, 0x2300); |
| 490 | | } |
| 491 | | #endif |
| 492 | | |
| 493 | | |
| 494 | | #if (HAS_QED5271) |
| 495 | | static void qed5271be_reset(void) |
| 496 | | { |
| 497 | | mips3_reset(1, 1, 0x2300); |
| 498 | | } |
| 499 | | |
| 500 | | static void qed5271le_reset(void) |
| 501 | | { |
| 502 | | mips3_reset(1, 0, 0x2300); |
| 503 | | } |
| 504 | | #endif |
| 505 | | |
| 506 | | |
| 507 | | #if (HAS_RM7000) |
| 508 | | static void rm7000be_reset(void) |
| 509 | | { |
| 510 | | mips3_reset(1, 1, 0x2700); |
| 511 | | } |
| 512 | | |
| 513 | | static void rm7000le_reset(void) |
| 514 | | { |
| 515 | | mips3_reset(0, 1, 0x2700); |
| 516 | | } |
| 517 | | #endif |
| 518 | | |
| 519 | | |
| 520 | | static void mips3_exit(void) |
| 521 | | { |
| 522 | | drc_exit(mips3.drc); |
| 523 | | } |
| 524 | | |
| 525 | | |
| 526 | 148 | static int mips3_execute(int cycles) |
| 527 | 149 | { |
| 528 | 150 | /* update the cycle timing */ |
| 529 | | update_cycle_counting(); |
| 151 | mips3com_update_cycle_counting(&mips3.core); |
| 530 | 152 | |
| 531 | | /* count cycles and interrupt cycles */ |
| 153 | /* execute */ |
| 532 | 154 | mips3_icount = cycles; |
| 533 | | drc_execute(mips3.drc); |
| 155 | mips3drc_execute(); |
| 534 | 156 | return cycles - mips3_icount; |
| 535 | 157 | } |
| 536 | 158 | |
| 537 | 159 | |
| 160 | /*------------------------------------------------- |
| 161 | mips3_exit - cleanup from execution |
| 162 | -------------------------------------------------*/ |
| 538 | 163 | |
| 539 | | /*************************************************************************** |
| 540 | | TLB HANDLING |
| 541 | | ***************************************************************************/ |
| 542 | | |
| 543 | | static void map_tlb_entries(void) |
| 164 | static void mips3_exit(void) |
| 544 | 165 | { |
| 545 | | int valid_asid = mips3.cpr[0][COP0_EntryHi] & 0xff; |
| 546 | | int index; |
| 547 | | |
| 548 | | /* iterate over all TLB entries */ |
| 549 | | for (index = 0; index < 48; index++) |
| 550 | | { |
| 551 | | UINT64 hi = mips3.tlb[index].entry_hi; |
| 552 | | |
| 553 | | /* only process if the ASID matches or if BOTH entries are marked global */ |
| 554 | | if (valid_asid == (hi & 0xff) || ((mips3.tlb[index].entry_lo[0] & 1) && (mips3.tlb[index].entry_lo[1] & 1))) |
| 555 | | { |
| 556 | | UINT32 count = (mips3.tlb[index].page_mask >> 13) & 0x00fff; |
| 557 | | UINT32 vpn = ((hi >> 13) & 0x07ffffff) << 1; |
| 558 | | int which, i; |
| 559 | | |
| 560 | | /* ignore if the virtual address is beyond 32 bits */ |
| 561 | | if (vpn < (1 << (32 - 12))) |
| 562 | | |
| 563 | | /* loop over both the even and odd pages */ |
| 564 | | for (which = 0; which < 2; which++) |
| 565 | | { |
| 566 | | UINT64 lo = mips3.tlb[index].entry_lo[which]; |
| 567 | | |
| 568 | | /* only map if the TLB entry is valid */ |
| 569 | | if (lo & 2) |
| 570 | | { |
| 571 | | UINT32 pfn = (lo >> 6) & 0x00ffffff; |
| 572 | | UINT32 wp = (~lo >> 2) & 1; |
| 573 | | |
| 574 | | for (i = 0; i <= count; i++, vpn++, pfn++) |
| 575 | | if (vpn < 0x80000 || vpn >= 0xc0000) |
| 576 | | mips3.tlb_table[vpn] = (pfn << 12) | wp; |
| 577 | | } |
| 578 | | |
| 579 | | /* otherwise, advance by the number of pages we would have mapped */ |
| 580 | | else |
| 581 | | vpn += count + 1; |
| 582 | | } |
| 583 | | } |
| 584 | | } |
| 166 | mips3drc_exit(); |
| 585 | 167 | } |
| 586 | 168 | |
| 587 | 169 | |
| 588 | | static void unmap_tlb_entries(void) |
| 589 | | { |
| 590 | | int index; |
| 170 | /*------------------------------------------------- |
| 171 | mips3_get_context - return a copy of the |
| 172 | current context |
| 173 | -------------------------------------------------*/ |
| 591 | 174 | |
| 592 | | /* iterate over all TLB entries */ |
| 593 | | for (index = 0; index < 48; index++) |
| 594 | | { |
| 595 | | UINT64 hi = mips3.tlb[index].entry_hi; |
| 596 | | UINT32 count = (mips3.tlb[index].page_mask >> 13) & 0x00fff; |
| 597 | | UINT32 vpn = ((hi >> 13) & 0x07ffffff) << 1; |
| 598 | | int which, i; |
| 599 | | |
| 600 | | /* ignore if the virtual address is beyond 32 bits */ |
| 601 | | if (vpn < (1 << (32 - 12))) |
| 602 | | |
| 603 | | /* loop over both the even and odd pages */ |
| 604 | | for (which = 0; which < 2; which++) |
| 605 | | for (i = 0; i <= count; i++, vpn++) |
| 606 | | if (vpn < 0x80000 || vpn >= 0xc0000) |
| 607 | | mips3.tlb_table[vpn] = 0xffffffff; |
| 608 | | } |
| 609 | | } |
| 610 | | |
| 611 | | |
| 612 | | static void recompute_tlb_table(void) |
| 175 | static void mips3_get_context(void *dst) |
| 613 | 176 | { |
| 614 | | UINT32 addr; |
| 615 | | |
| 616 | | /* map in the hard-coded spaces */ |
| 617 | | for (addr = 0x80000000; addr < 0xc0000000; addr += 1 << 12) |
| 618 | | mips3.tlb_table[addr >> 12] = addr & 0x1ffff000; |
| 619 | | |
| 620 | | /* reset everything else to unmapped */ |
| 621 | | memset(&mips3.tlb_table[0x00000000 >> 12], 0xff, sizeof(mips3.tlb_table[0]) * (0x80000000 >> 12)); |
| 622 | | memset(&mips3.tlb_table[0xc0000000 >> 12], 0xff, sizeof(mips3.tlb_table[0]) * (0x40000000 >> 12)); |
| 623 | | |
| 624 | | /* remap all the entries in the TLB */ |
| 625 | | map_tlb_entries(); |
| 177 | if (dst != NULL) |
| 178 | *(mips3_regs *)dst = mips3; |
| 626 | 179 | } |
| 627 | 180 | |
| 628 | 181 | |
| 629 | | static int translate_address(int space, offs_t *address) |
| 630 | | { |
| 631 | | if (space == ADDRESS_SPACE_PROGRAM) |
| 632 | | { |
| 633 | | UINT32 result = mips3.tlb_table[*address >> 12]; |
| 634 | | if (result == 0xffffffff) |
| 635 | | return 0; |
| 636 | | *address = (result & ~0xfff) | (*address & 0xfff); |
| 637 | | } |
| 638 | | return 1; |
| 639 | | } |
| 182 | /*------------------------------------------------- |
| 183 | mips3_set_context - copy the current context |
| 184 | into the global state |
| 185 | -------------------------------------------------*/ |
| 640 | 186 | |
| 641 | | |
| 642 | | INLINE void logonetlbentry(int index, int which) |
| 187 | static void mips3_set_context(void *src) |
| 643 | 188 | { |
| 644 | | #if PRINTF_TLB |
| 645 | | UINT64 hi = mips3.cpr[0][COP0_EntryHi]; |
| 646 | | UINT64 lo = mips3.cpr[0][COP0_EntryLo0 + which]; |
| 647 | | UINT32 vpn = (((hi >> 13) & 0x07ffffff) << 1); |
| 648 | | UINT32 asid = hi & 0xff; |
| 649 | | UINT32 r = (hi >> 62) & 3; |
| 650 | | UINT32 pfn = (lo >> 6) & 0x00ffffff; |
| 651 | | UINT32 c = (lo >> 3) & 7; |
| 652 | | UINT32 pagesize = (((mips3.cpr[0][COP0_PageMask] >> 13) & 0xfff) + 1) << 12; |
| 653 | | UINT64 vaddr = (UINT64)vpn * 0x1000; |
| 654 | | UINT64 paddr = (UINT64)pfn * 0x1000; |
| 655 | | |
| 656 | | vaddr += pagesize * which; |
| 657 | | |
| 658 | | mame_printf_debug("index=%08X pagesize=%08X vaddr=%08X%08X paddr=%08X%08X asid=%02X r=%X c=%X dvg=%c%c%c\n", |
| 659 | | index, pagesize, (UINT32)(vaddr >> 32), (UINT32)vaddr, (UINT32)(paddr >> 32), (UINT32)paddr, |
| 660 | | asid, r, c, (lo & 4) ? 'd' : '.', (lo & 2) ? 'v' : '.', (lo & 1) ? 'g' : '.'); |
| 661 | | #endif |
| 189 | if (src != NULL) |
| 190 | mips3 = *(mips3_regs *)src; |
| 662 | 191 | } |
| 663 | 192 | |
| 664 | 193 | |
| 665 | | static void logtlbentry(int index) |
| 666 | | { |
| 667 | | logonetlbentry(index, 0); |
| 668 | | logonetlbentry(index, 1); |
| 669 | | } |
| 194 | /*------------------------------------------------- |
| 195 | mips3_translate - perform virtual-to-physical |
| 196 | address translation |
| 197 | -------------------------------------------------*/ |
| 670 | 198 | |
| 671 | | |
| 672 | | static void tlbr(void) |
| 199 | static int mips3_translate(int space, offs_t *address) |
| 673 | 200 | { |
| 674 | | UINT32 index = mips3.cpr[0][COP0_Index] & 0x3f; |
| 675 | | if (index < 48) |
| 676 | | { |
| 677 | | mips3.cpr[0][COP0_PageMask] = mips3.tlb[index].page_mask; |
| 678 | | mips3.cpr[0][COP0_EntryHi] = mips3.tlb[index].entry_hi; |
| 679 | | mips3.cpr[0][COP0_EntryLo0] = mips3.tlb[index].entry_lo[0]; |
| 680 | | mips3.cpr[0][COP0_EntryLo1] = mips3.tlb[index].entry_lo[1]; |
| 681 | | } |
| 201 | return mips3com_translate_address(&mips3.core, space, address); |
| 682 | 202 | } |
| 683 | 203 | |
| 684 | 204 | |
| 685 | | static void tlbwi(void) |
| 686 | | { |
| 687 | | UINT32 index = mips3.cpr[0][COP0_Index] & 0x3f; |
| 688 | | logtlbentry(index); |
| 689 | | if (index < 48) |
| 690 | | { |
| 691 | | unmap_tlb_entries(); |
| 692 | | mips3.tlb[index].page_mask = mips3.cpr[0][COP0_PageMask]; |
| 693 | | mips3.tlb[index].entry_hi = mips3.cpr[0][COP0_EntryHi] & ~(mips3.tlb[index].page_mask & U64(0x0000000001ffe000)); |
| 694 | | mips3.tlb[index].entry_lo[0] = mips3.cpr[0][COP0_EntryLo0]; |
| 695 | | mips3.tlb[index].entry_lo[1] = mips3.cpr[0][COP0_EntryLo1]; |
| 696 | | map_tlb_entries(); |
| 697 | | } |
| 698 | | } |
| 205 | /*------------------------------------------------- |
| 206 | mips3_dasm - disassemble an instruction |
| 207 | -------------------------------------------------*/ |
| 699 | 208 | |
| 700 | | |
| 701 | | static void tlbwr(void) |
| 209 | #ifdef MAME_DEBUG |
| 210 | static offs_t mips3_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) |
| 702 | 211 | { |
| 703 | | UINT32 wired = mips3.cpr[0][COP0_Wired] & 0x3f; |
| 704 | | UINT32 index = 48 - wired; |
| 705 | | if (index > 0) |
| 706 | | index = ((activecpu_gettotalcycles64() - mips3.count_zero_time) % index + wired) & 0x3f; |
| 707 | | else |
| 708 | | index = 47; |
| 709 | | logtlbentry(index); |
| 710 | | { |
| 711 | | unmap_tlb_entries(); |
| 712 | | mips3.tlb[index].page_mask = mips3.cpr[0][COP0_PageMask]; |
| 713 | | mips3.tlb[index].entry_hi = mips3.cpr[0][COP0_EntryHi] & ~(mips3.tlb[index].page_mask & U64(0x0000000001ffe000)); |
| 714 | | mips3.tlb[index].entry_lo[0] = mips3.cpr[0][COP0_EntryLo0]; |
| 715 | | mips3.tlb[index].entry_lo[1] = mips3.cpr[0][COP0_EntryLo1]; |
| 716 | | map_tlb_entries(); |
| 717 | | } |
| 212 | return mips3com_dasm(&mips3.core, buffer, pc, oprom, opram); |
| 718 | 213 | } |
| 214 | #endif /* MAME_DEBUG */ |
| 719 | 215 | |
| 720 | 216 | |
| 721 | | static void tlbp(void) |
| 722 | | { |
| 723 | | UINT32 index; |
| 724 | | UINT64 vpn; |
| 725 | 217 | |
| 726 | | // DEBUGGER_BREAK; |
| 727 | | for (index = 0; index < 48; index++) |
| 728 | | { |
| 729 | | UINT64 mask = ~(mips3.tlb[index].page_mask & U64(0x0000000001ffe000)) & ~U64(0x1fff); |
| 730 | | #if PRINTF_TLB |
| 731 | | mame_printf_debug("Mask = %08X%08X TLB = %08X%08X MATCH = %08X%08X\n", |
| 732 | | (UINT32)(mask >> 32), (UINT32)mask, |
| 733 | | (UINT32)(mips3.tlb[index].entry_hi >> 32), (UINT32)mips3.tlb[index].entry_hi, |
| 734 | | (UINT32)(mips3.cpr[0][COP0_EntryHi] >> 32), (UINT32)mips3.cpr[0][COP0_EntryHi]); |
| 735 | | #endif |
| 736 | | if ((mips3.tlb[index].entry_hi & mask) == (mips3.cpr[0][COP0_EntryHi] & mask)) |
| 737 | | { |
| 738 | | if (((mips3.tlb[index].entry_lo[0] & 1) && (mips3.tlb[index].entry_lo[1] & 1)) || |
| 739 | | (mips3.tlb[index].entry_hi & 0xff) == (mips3.cpr[0][COP0_EntryHi] & 0xff)) |
| 740 | | break; |
| 741 | | } |
| 742 | | } |
| 743 | | vpn = ((mips3.cpr[0][COP0_EntryHi] >> 13) & 0x07ffffff) << 1; |
| 744 | | if (index != 48) |
| 745 | | { |
| 746 | | if (mips3.tlb_table[vpn & 0xfffff] == 0xffffffff) |
| 747 | | { |
| 748 | | #if PRINTF_TLB |
| 749 | | mame_printf_debug("TLBP: Should have not found an entry\n"); |
| 750 | | // DEBUGGER_BREAK; |
| 751 | | #endif |
| 752 | | } |
| 753 | | mips3.cpr[0][COP0_Index] = index; |
| 754 | | } |
| 755 | | else |
| 756 | | { |
| 757 | | if (mips3.tlb_table[vpn & 0xfffff] != 0xffffffff) |
| 758 | | { |
| 759 | | #if PRINTF_TLB |
| 760 | | mame_printf_debug("TLBP: Should havefound an entry\n"); |
| 761 | | // DEBUGGER_BREAK; |
| 762 | | #endif |
| 763 | | } |
| 764 | | mips3.cpr[0][COP0_Index] = 0x80000000; |
| 765 | | } |
| 766 | | } |
| 767 | | |
| 768 | | |
| 769 | | |
| 770 | 218 | /*************************************************************************** |
| 771 | | RECOMPILER CALLBACKS |
| 772 | | ***************************************************************************/ |
| 773 | | |
| 774 | | /*------------------------------------------------------------------ |
| 775 | | update_cycle_counting |
| 776 | | ------------------------------------------------------------------*/ |
| 777 | | |
| 778 | | static void update_cycle_counting(void) |
| 779 | | { |
| 780 | | /* modify the timer to go off */ |
| 781 | | if ((mips3.cpr[0][COP0_Status] & 0x8000) && mips3.cpr[0][COP0_Compare] != 0xffffffff) |
| 782 | | { |
| 783 | | UINT32 count = (activecpu_gettotalcycles64() - mips3.count_zero_time) / 2; |
| 784 | | UINT32 compare = mips3.cpr[0][COP0_Compare]; |
| 785 | | UINT32 cyclesleft = compare - count; |
| 786 | | mame_time newtime = MAME_TIME_IN_CYCLES(((INT64)cyclesleft * 2), cpu_getactivecpu()); |
| 787 | | |
| 788 | | /* due to accuracy issues, don't bother setting timers unless they're for less than 100msec */ |
| 789 | | if (compare_mame_times(newtime, MAME_TIME_IN_MSEC(100)) < 0) |
| 790 | | mame_timer_adjust(mips3.compare_int_timer, newtime, cpu_getactivecpu(), time_zero); |
| 791 | | } |
| 792 | | else |
| 793 | | mame_timer_adjust(mips3.compare_int_timer, time_never, cpu_getactivecpu(), time_zero); |
| 794 | | } |
| 795 | | |
| 796 | | |
| 797 | | |
| 798 | | |
| 799 | | /*************************************************************************** |
| 800 | 219 | CODE LOGGING |
| 801 | 220 | ***************************************************************************/ |
| 802 | 221 | |
| r869 | r870 | |
| 818 | 237 | code_log_index++; |
| 819 | 238 | } |
| 820 | 239 | |
| 821 | | static void code_log(drc_core *drc, const char *label, void *start) |
| 240 | static void code_log(const char *label, void *start, void *stop) |
| 822 | 241 | { |
| 823 | 242 | extern int i386_dasm_one(char *buffer, UINT32 eip, UINT8 *oprom, int mode); |
| 824 | 243 | extern unsigned dasmmips3(char *buffer, unsigned pc, UINT32 op); |
| r869 | r870 | |
| 833 | 252 | fprintf(f, "\n%s\n", label); |
| 834 | 253 | |
| 835 | 254 | /* loop from the start until the cache top */ |
| 836 | | while (cur < drc->cache_top) |
| 255 | while (cur < (UINT8 *)stop) |
| 837 | 256 | { |
| 838 | 257 | char buffer[100]; |
| 839 | 258 | int bytes; |
| 840 | 259 | int op; |
| 841 | 260 | |
| 842 | 261 | /* disassemble this instruction */ |
| 262 | #ifdef PTR64 |
| 263 | bytes = i386_dasm_one(buffer, (UINT32)cur, cur, 64) & DASMFLAG_LENGTHMASK; |
| 264 | #else |
| 843 | 265 | bytes = i386_dasm_one(buffer, (UINT32)cur, cur, 32) & DASMFLAG_LENGTHMASK; |
| 266 | #endif |
| 844 | 267 | |
| 845 | 268 | /* look for a match in the registered opcodes */ |
| 846 | 269 | for (op = 0; op < code_log_index; op++) |
| r869 | r870 | |
| 849 | 272 | |
| 850 | 273 | /* if no match, just output the current instruction */ |
| 851 | 274 | if (op == code_log_index) |
| 852 | | fprintf(f, "%08X: %s\n", (UINT32)cur, buffer); |
| 275 | fprintf(f, "%p: %s\n", cur, buffer); |
| 853 | 276 | |
| 854 | 277 | /* otherwise, output with the original instruction to the right */ |
| 855 | 278 | else |
| 856 | 279 | { |
| 857 | 280 | char buffer2[100]; |
| 858 | 281 | dasmmips3(buffer2, code_log_buffer[op].pc, code_log_buffer[op].op); |
| 859 | | fprintf(f, "%08X: %-50s %08X: %s\n", (UINT32)cur, buffer, code_log_buffer[op].pc, buffer2); |
| 282 | fprintf(f, "%p: %-50s %08X: %s\n", cur, buffer, code_log_buffer[op].pc, buffer2); |
| 860 | 283 | } |
| 861 | 284 | |
| 862 | 285 | /* advance past this instruction */ |
| r869 | r870 | |
| 881 | 304 | RECOMPILER CORE |
| 882 | 305 | ***************************************************************************/ |
| 883 | 306 | |
| 884 | | |
| 307 | #ifdef PTR64 |
| 308 | #include "mdrc64.c" |
| 309 | #else |
| 885 | 310 | #include "mdrcold.c" |
| 886 | | //#include "mdrc32.c" |
| 311 | #endif |
| 887 | 312 | |
| 888 | 313 | |
| 889 | 314 | |
| 890 | 315 | /*************************************************************************** |
| 891 | | DISASSEMBLY HOOK |
| 316 | GENERIC GET/SET INFO |
| 892 | 317 | ***************************************************************************/ |
| 893 | 318 | |
| 894 | | #ifdef MAME_DEBUG |
| 895 | | static offs_t mips3_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) |
| 896 | | { |
| 897 | | extern unsigned dasmmips3(char *, unsigned, UINT32); |
| 898 | | UINT32 op = *(UINT32 *)oprom; |
| 899 | | if (mips3.bigendian) |
| 900 | | op = BIG_ENDIANIZE_INT32(op); |
| 901 | | else |
| 902 | | op = LITTLE_ENDIANIZE_INT32(op); |
| 903 | | return dasmmips3(buffer, pc, op); |
| 904 | | } |
| 905 | | #endif /* MAME_DEBUG */ |
| 906 | | |
| 907 | | |
| 908 | | /************************************************************************** |
| 909 | | * Generic set_info |
| 910 | | **************************************************************************/ |
| 911 | | |
| 912 | 319 | static void mips3_set_info(UINT32 state, cpuinfo *info) |
| 913 | 320 | { |
| 914 | 321 | switch (state) |
| 915 | 322 | { |
| 916 | 323 | /* --- the following bits of info are set as 64-bit signed integers --- */ |
| 917 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ0: set_irq_line(MIPS3_IRQ0, info->i); break; |
| 918 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ1: set_irq_line(MIPS3_IRQ1, info->i); break; |
| 919 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ2: set_irq_line(MIPS3_IRQ2, info->i); break; |
| 920 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ3: set_irq_line(MIPS3_IRQ3, info->i); break; |
| 921 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ4: set_irq_line(MIPS3_IRQ4, info->i); break; |
| 922 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ5: set_irq_line(MIPS3_IRQ5, info->i); break; |
| 923 | | |
| 924 | | case CPUINFO_INT_PC: |
| 925 | | case CPUINFO_INT_REGISTER + MIPS3_PC: mips3.pc = info->i; break; |
| 926 | | case CPUINFO_INT_REGISTER + MIPS3_SR: mips3.cpr[0][COP0_Status] = info->i; break; |
| 927 | | case CPUINFO_INT_REGISTER + MIPS3_EPC: mips3.cpr[0][COP0_EPC] = info->i; break; |
| 928 | | case CPUINFO_INT_REGISTER + MIPS3_CAUSE: mips3.cpr[0][COP0_Cause] = info->i; break; |
| 929 | | case CPUINFO_INT_REGISTER + MIPS3_COUNT: mips3.cpr[0][COP0_Count] = info->i; break; |
| 930 | | case CPUINFO_INT_REGISTER + MIPS3_COMPARE: mips3.cpr[0][COP0_Compare] = info->i; break; |
| 931 | | case CPUINFO_INT_REGISTER + MIPS3_INDEX: mips3.cpr[0][COP0_Index] = info->i; break; |
| 932 | | case CPUINFO_INT_REGISTER + MIPS3_RANDOM: mips3.cpr[0][COP0_Random] = info->i; break; |
| 933 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYHI: mips3.cpr[0][COP0_EntryHi] = info->i; break; |
| 934 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO0: mips3.cpr[0][COP0_EntryLo0] = info->i; break; |
| 935 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO1: mips3.cpr[0][COP0_EntryLo1] = info->i; break; |
| 936 | | case CPUINFO_INT_REGISTER + MIPS3_PAGEMASK: mips3.cpr[0][COP0_PageMask] = info->i; break; |
| 937 | | case CPUINFO_INT_REGISTER + MIPS3_WIRED: mips3.cpr[0][COP0_Wired] = info->i; break; |
| 938 | | case CPUINFO_INT_REGISTER + MIPS3_BADVADDR: mips3.cpr[0][COP0_BadVAddr] = info->i; break; |
| 939 | | |
| 940 | | case CPUINFO_INT_REGISTER + MIPS3_R0: mips3.r[0] = info->i; break; |
| 941 | | case CPUINFO_INT_REGISTER + MIPS3_R1: mips3.r[1] = info->i; break; |
| 942 | | case CPUINFO_INT_REGISTER + MIPS3_R2: mips3.r[2] = info->i; break; |
| 943 | | case CPUINFO_INT_REGISTER + MIPS3_R3: mips3.r[3] = info->i; break; |
| 944 | | case CPUINFO_INT_REGISTER + MIPS3_R4: mips3.r[4] = info->i; break; |
| 945 | | case CPUINFO_INT_REGISTER + MIPS3_R5: mips3.r[5] = info->i; break; |
| 946 | | case CPUINFO_INT_REGISTER + MIPS3_R6: mips3.r[6] = info->i; break; |
| 947 | | case CPUINFO_INT_REGISTER + MIPS3_R7: mips3.r[7] = info->i; break; |
| 948 | | case CPUINFO_INT_REGISTER + MIPS3_R8: mips3.r[8] = info->i; break; |
| 949 | | case CPUINFO_INT_REGISTER + MIPS3_R9: mips3.r[9] = info->i; break; |
| 950 | | case CPUINFO_INT_REGISTER + MIPS3_R10: mips3.r[10] = info->i; break; |
| 951 | | case CPUINFO_INT_REGISTER + MIPS3_R11: mips3.r[11] = info->i; break; |
| 952 | | case CPUINFO_INT_REGISTER + MIPS3_R12: mips3.r[12] = info->i; break; |
| 953 | | case CPUINFO_INT_REGISTER + MIPS3_R13: mips3.r[13] = info->i; break; |
| 954 | | case CPUINFO_INT_REGISTER + MIPS3_R14: mips3.r[14] = info->i; break; |
| 955 | | case CPUINFO_INT_REGISTER + MIPS3_R15: mips3.r[15] = info->i; break; |
| 956 | | case CPUINFO_INT_REGISTER + MIPS3_R16: mips3.r[16] = info->i; break; |
| 957 | | case CPUINFO_INT_REGISTER + MIPS3_R17: mips3.r[17] = info->i; break; |
| 958 | | case CPUINFO_INT_REGISTER + MIPS3_R18: mips3.r[18] = info->i; break; |
| 959 | | case CPUINFO_INT_REGISTER + MIPS3_R19: mips3.r[19] = info->i; break; |
| 960 | | case CPUINFO_INT_REGISTER + MIPS3_R20: mips3.r[20] = info->i; break; |
| 961 | | case CPUINFO_INT_REGISTER + MIPS3_R21: mips3.r[21] = info->i; break; |
| 962 | | case CPUINFO_INT_REGISTER + MIPS3_R22: mips3.r[22] = info->i; break; |
| 963 | | case CPUINFO_INT_REGISTER + MIPS3_R23: mips3.r[23] = info->i; break; |
| 964 | | case CPUINFO_INT_REGISTER + MIPS3_R24: mips3.r[24] = info->i; break; |
| 965 | | case CPUINFO_INT_REGISTER + MIPS3_R25: mips3.r[25] = info->i; break; |
| 966 | | case CPUINFO_INT_REGISTER + MIPS3_R26: mips3.r[26] = info->i; break; |
| 967 | | case CPUINFO_INT_REGISTER + MIPS3_R27: mips3.r[27] = info->i; break; |
| 968 | | case CPUINFO_INT_REGISTER + MIPS3_R28: mips3.r[28] = info->i; break; |
| 969 | | case CPUINFO_INT_REGISTER + MIPS3_R29: mips3.r[29] = info->i; break; |
| 970 | | case CPUINFO_INT_REGISTER + MIPS3_R30: mips3.r[30] = info->i; break; |
| 971 | | case CPUINFO_INT_SP: |
| 972 | | case CPUINFO_INT_REGISTER + MIPS3_R31: mips3.r[31] = info->i; break; |
| 973 | | case CPUINFO_INT_REGISTER + MIPS3_HI: mips3.hi = info->i; break; |
| 974 | | case CPUINFO_INT_REGISTER + MIPS3_LO: mips3.lo = info->i; break; |
| 975 | | |
| 976 | 324 | case CPUINFO_INT_MIPS3_DRC_OPTIONS: mips3.drcoptions = info->i; break; |
| 977 | 325 | |
| 978 | 326 | case CPUINFO_INT_MIPS3_FASTRAM_SELECT: if (info->i >= 0 && info->i < MIPS3_MAX_FASTRAM) mips3.fastram_select = info->i; break; |
| r869 | r870 | |
| 987 | 335 | |
| 988 | 336 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 989 | 337 | case CPUINFO_PTR_MIPS3_FASTRAM_BASE: mips3.fastram[mips3.fastram_select].base = info->p; break; |
| 338 | |
| 339 | /* --- everything else is handled generically --- */ |
| 340 | default: mips3com_set_info(&mips3.core, state, info); break; |
| 990 | 341 | } |
| 991 | 342 | } |
| 992 | 343 | |
| 993 | 344 | |
| 994 | | |
| 995 | | /************************************************************************** |
| 996 | | * Generic get_info |
| 997 | | **************************************************************************/ |
| 998 | | |
| 999 | 345 | void mips3_get_info(UINT32 state, cpuinfo *info) |
| 1000 | 346 | { |
| 1001 | 347 | switch (state) |
| 1002 | 348 | { |
| 1003 | 349 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1004 | 350 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(mips3); break; |
| 1005 | | case CPUINFO_INT_INPUT_LINES: info->i = 6; break; |
| 1006 | | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; |
| 1007 | | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 1008 | | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; |
| 1009 | | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 4; break; |
| 1010 | | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; |
| 1011 | | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 1012 | | case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
| 1013 | | |
| 1014 | | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; |
| 1015 | | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; |
| 1016 | | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; |
| 1017 | | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; |
| 1018 | | case CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 12; break; |
| 1019 | | |
| 1020 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ0: info->i = (mips3.cpr[0][COP0_Cause] & 0x400) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1021 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ1: info->i = (mips3.cpr[0][COP0_Cause] & 0x800) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1022 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ2: info->i = (mips3.cpr[0][COP0_Cause] & 0x1000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1023 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ3: info->i = (mips3.cpr[0][COP0_Cause] & 0x2000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1024 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ4: info->i = (mips3.cpr[0][COP0_Cause] & 0x4000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1025 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ5: info->i = (mips3.cpr[0][COP0_Cause] & 0x8000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 1026 | | |
| 1027 | 351 | case CPUINFO_INT_PREVIOUSPC: /* not implemented */ break; |
| 1028 | 352 | |
| 1029 | | case CPUINFO_INT_PC: |
| 1030 | | case CPUINFO_INT_REGISTER + MIPS3_PC: info->i = mips3.pc; break; |
| 1031 | | case CPUINFO_INT_REGISTER + MIPS3_SR: info->i = mips3.cpr[0][COP0_Status]; break; |
| 1032 | | case CPUINFO_INT_REGISTER + MIPS3_EPC: info->i = mips3.cpr[0][COP0_EPC]; break; |
| 1033 | | case CPUINFO_INT_REGISTER + MIPS3_CAUSE: info->i = mips3.cpr[0][COP0_Cause]; break; |
| 1034 | | case CPUINFO_INT_REGISTER + MIPS3_COUNT: info->i = ((activecpu_gettotalcycles64() - mips3.count_zero_time) / 2); break; |
| 1035 | | case CPUINFO_INT_REGISTER + MIPS3_COMPARE: info->i = mips3.cpr[0][COP0_Compare]; break; |
| 1036 | | case CPUINFO_INT_REGISTER + MIPS3_INDEX: info->i = mips3.cpr[0][COP0_Index]; break; |
| 1037 | | case CPUINFO_INT_REGISTER + MIPS3_RANDOM: info->i = mips3.cpr[0][COP0_Random]; break; |
| 1038 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYHI: info->i = mips3.cpr[0][COP0_EntryHi]; break; |
| 1039 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO0: info->i = mips3.cpr[0][COP0_EntryLo0]; break; |
| 1040 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO1: info->i = mips3.cpr[0][COP0_EntryLo1]; break; |
| 1041 | | case CPUINFO_INT_REGISTER + MIPS3_PAGEMASK: info->i = mips3.cpr[0][COP0_PageMask]; break; |
| 1042 | | case CPUINFO_INT_REGISTER + MIPS3_WIRED: info->i = mips3.cpr[0][COP0_Wired]; break; |
| 1043 | | case CPUINFO_INT_REGISTER + MIPS3_BADVADDR: info->i = mips3.cpr[0][COP0_BadVAddr]; break; |
| 1044 | | |
| 1045 | | case CPUINFO_INT_REGISTER + MIPS3_R0: info->i = mips3.r[0]; break; |
| 1046 | | case CPUINFO_INT_REGISTER + MIPS3_R1: info->i = mips3.r[1]; break; |
| 1047 | | case CPUINFO_INT_REGISTER + MIPS3_R2: info->i = mips3.r[2]; break; |
| 1048 | | case CPUINFO_INT_REGISTER + MIPS3_R3: info->i = mips3.r[3]; break; |
| 1049 | | case CPUINFO_INT_REGISTER + MIPS3_R4: info->i = mips3.r[4]; break; |
| 1050 | | case CPUINFO_INT_REGISTER + MIPS3_R5: info->i = mips3.r[5]; break; |
| 1051 | | case CPUINFO_INT_REGISTER + MIPS3_R6: info->i = mips3.r[6]; break; |
| 1052 | | case CPUINFO_INT_REGISTER + MIPS3_R7: info->i = mips3.r[7]; break; |
| 1053 | | case CPUINFO_INT_REGISTER + MIPS3_R8: info->i = mips3.r[8]; break; |
| 1054 | | case CPUINFO_INT_REGISTER + MIPS3_R9: info->i = mips3.r[9]; break; |
| 1055 | | case CPUINFO_INT_REGISTER + MIPS3_R10: info->i = mips3.r[10]; break; |
| 1056 | | case CPUINFO_INT_REGISTER + MIPS3_R11: info->i = mips3.r[11]; break; |
| 1057 | | case CPUINFO_INT_REGISTER + MIPS3_R12: info->i = mips3.r[12]; break; |
| 1058 | | case CPUINFO_INT_REGISTER + MIPS3_R13: info->i = mips3.r[13]; break; |
| 1059 | | case CPUINFO_INT_REGISTER + MIPS3_R14: info->i = mips3.r[14]; break; |
| 1060 | | case CPUINFO_INT_REGISTER + MIPS3_R15: info->i = mips3.r[15]; break; |
| 1061 | | case CPUINFO_INT_REGISTER + MIPS3_R16: info->i = mips3.r[16]; break; |
| 1062 | | case CPUINFO_INT_REGISTER + MIPS3_R17: info->i = mips3.r[17]; break; |
| 1063 | | case CPUINFO_INT_REGISTER + MIPS3_R18: info->i = mips3.r[18]; break; |
| 1064 | | case CPUINFO_INT_REGISTER + MIPS3_R19: info->i = mips3.r[19]; break; |
| 1065 | | case CPUINFO_INT_REGISTER + MIPS3_R20: info->i = mips3.r[20]; break; |
| 1066 | | case CPUINFO_INT_REGISTER + MIPS3_R21: info->i = mips3.r[21]; break; |
| 1067 | | case CPUINFO_INT_REGISTER + MIPS3_R22: info->i = mips3.r[22]; break; |
| 1068 | | case CPUINFO_INT_REGISTER + MIPS3_R23: info->i = mips3.r[23]; break; |
| 1069 | | case CPUINFO_INT_REGISTER + MIPS3_R24: info->i = mips3.r[24]; break; |
| 1070 | | case CPUINFO_INT_REGISTER + MIPS3_R25: info->i = mips3.r[25]; break; |
| 1071 | | case CPUINFO_INT_REGISTER + MIPS3_R26: info->i = mips3.r[26]; break; |
| 1072 | | case CPUINFO_INT_REGISTER + MIPS3_R27: info->i = mips3.r[27]; break; |
| 1073 | | case CPUINFO_INT_REGISTER + MIPS3_R28: info->i = mips3.r[28]; break; |
| 1074 | | case CPUINFO_INT_REGISTER + MIPS3_R29: info->i = mips3.r[29]; break; |
| 1075 | | case CPUINFO_INT_REGISTER + MIPS3_R30: info->i = mips3.r[30]; break; |
| 1076 | | case CPUINFO_INT_SP: |
| 1077 | | case CPUINFO_INT_REGISTER + MIPS3_R31: info->i = mips3.r[31]; break; |
| 1078 | | case CPUINFO_INT_REGISTER + MIPS3_HI: info->i = mips3.hi; break; |
| 1079 | | case CPUINFO_INT_REGISTER + MIPS3_LO: info->i = mips3.lo; break; |
| 1080 | | |
| 1081 | 353 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1082 | 354 | case CPUINFO_PTR_SET_INFO: info->setinfo = mips3_set_info; break; |
| 1083 | 355 | case CPUINFO_PTR_GET_CONTEXT: info->getcontext = mips3_get_context; break; |
| 1084 | 356 | case CPUINFO_PTR_SET_CONTEXT: info->setcontext = mips3_set_context; break; |
| 1085 | | case CPUINFO_PTR_INIT: info->init = mips3_init; break; |
| 1086 | | case CPUINFO_PTR_RESET: /* provided per-CPU */ break; |
| 357 | case CPUINFO_PTR_INIT: /* provided per-CPU */ break; |
| 358 | case CPUINFO_PTR_RESET: info->reset = mips3_reset; break; |
| 1087 | 359 | case CPUINFO_PTR_EXIT: info->exit = mips3_exit; break; |
| 1088 | 360 | case CPUINFO_PTR_EXECUTE: info->execute = mips3_execute; break; |
| 1089 | | case CPUINFO_PTR_BURN: info->burn = NULL; break; |
| 1090 | 361 | #ifdef MAME_DEBUG |
| 1091 | 362 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = mips3_dasm; break; |
| 1092 | 363 | #endif /* MAME_DEBUG */ |
| 1093 | | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &mips3_icount; break; |
| 1094 | | case CPUINFO_PTR_TRANSLATE: info->translate = translate_address; break; |
| 364 | case CPUINFO_PTR_TRANSLATE: info->translate = mips3_translate; break; |
| 1095 | 365 | |
| 1096 | 366 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1097 | | case CPUINFO_STR_NAME: strcpy(info->s, "MIPS III"); break; |
| 1098 | | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "MIPS III"); break; |
| 1099 | | case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; |
| 1100 | 367 | case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; |
| 1101 | | case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright (C) Aaron Giles 2000-2004"); break; |
| 1102 | 368 | |
| 1103 | | case CPUINFO_STR_FLAGS: strcpy(info->s, " "); break; |
| 1104 | | |
| 1105 | | case CPUINFO_STR_REGISTER + MIPS3_PC: sprintf(info->s, "PC: %08X", mips3.pc); break; |
| 1106 | | case CPUINFO_STR_REGISTER + MIPS3_SR: sprintf(info->s, "SR: %08X", (UINT32)mips3.cpr[0][COP0_Status]); break; |
| 1107 | | case CPUINFO_STR_REGISTER + MIPS3_EPC: sprintf(info->s, "EPC:%08X", (UINT32)mips3.cpr[0][COP0_EPC]); break; |
| 1108 | | case CPUINFO_STR_REGISTER + MIPS3_CAUSE: sprintf(info->s, "Cause:%08X", (UINT32)mips3.cpr[0][COP0_Cause]); break; |
| 1109 | | case CPUINFO_STR_REGISTER + MIPS3_COUNT: sprintf(info->s, "Count:%08X", (UINT32)((activecpu_gettotalcycles64() - mips3.count_zero_time) / 2)); break; |
| 1110 | | case CPUINFO_STR_REGISTER + MIPS3_COMPARE: sprintf(info->s, "Compare:%08X", (UINT32)mips3.cpr[0][COP0_Compare]); break; |
| 1111 | | case CPUINFO_STR_REGISTER + MIPS3_INDEX: sprintf(info->s, "Index:%08X", (UINT32)mips3.cpr[0][COP0_Index]); break; |
| 1112 | | case CPUINFO_STR_REGISTER + MIPS3_RANDOM: sprintf(info->s, "Random:%08X", (UINT32)mips3.cpr[0][COP0_Random]); break; |
| 1113 | | case CPUINFO_STR_REGISTER + MIPS3_ENTRYHI: sprintf(info->s, "EntryHi:%08X%08X", (UINT32)(mips3.cpr[0][COP0_EntryHi] >> 32), (UINT32)mips3.cpr[0][COP0_EntryHi]); break; |
| 1114 | | case CPUINFO_STR_REGISTER + MIPS3_ENTRYLO0: sprintf(info->s, "EntryLo0:%08X%08X", (UINT32)(mips3.cpr[0][COP0_EntryLo0] >> 32), (UINT32)mips3.cpr[0][COP0_EntryLo0]); break; |
| 1115 | | case CPUINFO_STR_REGISTER + MIPS3_ENTRYLO1: sprintf(info->s, "EntryLo1:%08X%08X", (UINT32)(mips3.cpr[0][COP0_EntryLo1] >> 32), (UINT32)mips3.cpr[0][COP0_EntryLo1]); break; |
| 1116 | | case CPUINFO_STR_REGISTER + MIPS3_PAGEMASK: sprintf(info->s, "PageMask:%08X%08X", (UINT32)(mips3.cpr[0][COP0_PageMask] >> 32), (UINT32)mips3.cpr[0][COP0_PageMask]); break; |
| 1117 | | case CPUINFO_STR_REGISTER + MIPS3_WIRED: sprintf(info->s, "Wired:%08X", (UINT32)mips3.cpr[0][COP0_Wired]); break; |
| 1118 | | case CPUINFO_STR_REGISTER + MIPS3_BADVADDR: sprintf(info->s, "BadVAddr:%08X", (UINT32)mips3.cpr[0][COP0_BadVAddr]); break; |
| 1119 | | |
| 1120 | | case CPUINFO_STR_REGISTER + MIPS3_R0: sprintf(info->s, "R0: %08X%08X", (UINT32)(mips3.r[0] >> 32), (UINT32)mips3.r[0]); break; |
| 1121 | | case CPUINFO_STR_REGISTER + MIPS3_R1: sprintf(info->s, "R1: %08X%08X", (UINT32)(mips3.r[1] >> 32), (UINT32)mips3.r[1]); break; |
| 1122 | | case CPUINFO_STR_REGISTER + MIPS3_R2: sprintf(info->s, "R2: %08X%08X", (UINT32)(mips3.r[2] >> 32), (UINT32)mips3.r[2]); break; |
| 1123 | | case CPUINFO_STR_REGISTER + MIPS3_R3: sprintf(info->s, "R3: %08X%08X", (UINT32)(mips3.r[3] >> 32), (UINT32)mips3.r[3]); break; |
| 1124 | | case CPUINFO_STR_REGISTER + MIPS3_R4: sprintf(info->s, "R4: %08X%08X", (UINT32)(mips3.r[4] >> 32), (UINT32)mips3.r[4]); break; |
| 1125 | | case CPUINFO_STR_REGISTER + MIPS3_R5: sprintf(info->s, "R5: %08X%08X", (UINT32)(mips3.r[5] >> 32), (UINT32)mips3.r[5]); break; |
| 1126 | | case CPUINFO_STR_REGISTER + MIPS3_R6: sprintf(info->s, "R6: %08X%08X", (UINT32)(mips3.r[6] >> 32), (UINT32)mips3.r[6]); break; |
| 1127 | | case CPUINFO_STR_REGISTER + MIPS3_R7: sprintf(info->s, "R7: %08X%08X", (UINT32)(mips3.r[7] >> 32), (UINT32)mips3.r[7]); break; |
| 1128 | | case CPUINFO_STR_REGISTER + MIPS3_R8: sprintf(info->s, "R8: %08X%08X", (UINT32)(mips3.r[8] >> 32), (UINT32)mips3.r[8]); break; |
| 1129 | | case CPUINFO_STR_REGISTER + MIPS3_R9: sprintf(info->s, "R9: %08X%08X", (UINT32)(mips3.r[9] >> 32), (UINT32)mips3.r[9]); break; |
| 1130 | | case CPUINFO_STR_REGISTER + MIPS3_R10: sprintf(info->s, "R10:%08X%08X", (UINT32)(mips3.r[10] >> 32), (UINT32)mips3.r[10]); break; |
| 1131 | | case CPUINFO_STR_REGISTER + MIPS3_R11: sprintf(info->s, "R11:%08X%08X", (UINT32)(mips3.r[11] >> 32), (UINT32)mips3.r[11]); break; |
| 1132 | | case CPUINFO_STR_REGISTER + MIPS3_R12: sprintf(info->s, "R12:%08X%08X", (UINT32)(mips3.r[12] >> 32), (UINT32)mips3.r[12]); break; |
| 1133 | | case CPUINFO_STR_REGISTER + MIPS3_R13: sprintf(info->s, "R13:%08X%08X", (UINT32)(mips3.r[13] >> 32), (UINT32)mips3.r[13]); break; |
| 1134 | | case CPUINFO_STR_REGISTER + MIPS3_R14: sprintf(info->s, "R14:%08X%08X", (UINT32)(mips3.r[14] >> 32), (UINT32)mips3.r[14]); break; |
| 1135 | | case CPUINFO_STR_REGISTER + MIPS3_R15: sprintf(info->s, "R15:%08X%08X", (UINT32)(mips3.r[15] >> 32), (UINT32)mips3.r[15]); break; |
| 1136 | | case CPUINFO_STR_REGISTER + MIPS3_R16: sprintf(info->s, "R16:%08X%08X", (UINT32)(mips3.r[16] >> 32), (UINT32)mips3.r[16]); break; |
| 1137 | | case CPUINFO_STR_REGISTER + MIPS3_R17: sprintf(info->s, "R17:%08X%08X", (UINT32)(mips3.r[17] >> 32), (UINT32)mips3.r[17]); break; |
| 1138 | | case CPUINFO_STR_REGISTER + MIPS3_R18: sprintf(info->s, "R18:%08X%08X", (UINT32)(mips3.r[18] >> 32), (UINT32)mips3.r[18]); break; |
| 1139 | | case CPUINFO_STR_REGISTER + MIPS3_R19: sprintf(info->s, "R19:%08X%08X", (UINT32)(mips3.r[19] >> 32), (UINT32)mips3.r[19]); break; |
| 1140 | | case CPUINFO_STR_REGISTER + MIPS3_R20: sprintf(info->s, "R20:%08X%08X", (UINT32)(mips3.r[20] >> 32), (UINT32)mips3.r[20]); break; |
| 1141 | | case CPUINFO_STR_REGISTER + MIPS3_R21: sprintf(info->s, "R21:%08X%08X", (UINT32)(mips3.r[21] >> 32), (UINT32)mips3.r[21]); break; |
| 1142 | | case CPUINFO_STR_REGISTER + MIPS3_R22: sprintf(info->s, "R22:%08X%08X", (UINT32)(mips3.r[22] >> 32), (UINT32)mips3.r[22]); break; |
| 1143 | | case CPUINFO_STR_REGISTER + MIPS3_R23: sprintf(info->s, "R23:%08X%08X", (UINT32)(mips3.r[23] >> 32), (UINT32)mips3.r[23]); break; |
| 1144 | | case CPUINFO_STR_REGISTER + MIPS3_R24: sprintf(info->s, "R24:%08X%08X", (UINT32)(mips3.r[24] >> 32), (UINT32)mips3.r[24]); break; |
| 1145 | | case CPUINFO_STR_REGISTER + MIPS3_R25: sprintf(info->s, "R25:%08X%08X", (UINT32)(mips3.r[25] >> 32), (UINT32)mips3.r[25]); break; |
| 1146 | | case CPUINFO_STR_REGISTER + MIPS3_R26: sprintf(info->s, "R26:%08X%08X", (UINT32)(mips3.r[26] >> 32), (UINT32)mips3.r[26]); break; |
| 1147 | | case CPUINFO_STR_REGISTER + MIPS3_R27: sprintf(info->s, "R27:%08X%08X", (UINT32)(mips3.r[27] >> 32), (UINT32)mips3.r[27]); break; |
| 1148 | | case CPUINFO_STR_REGISTER + MIPS3_R28: sprintf(info->s, "R28:%08X%08X", (UINT32)(mips3.r[28] >> 32), (UINT32)mips3.r[28]); break; |
| 1149 | | case CPUINFO_STR_REGISTER + MIPS3_R29: sprintf(info->s, "R29:%08X%08X", (UINT32)(mips3.r[29] >> 32), (UINT32)mips3.r[29]); break; |
| 1150 | | case CPUINFO_STR_REGISTER + MIPS3_R30: sprintf(info->s, "R30:%08X%08X", (UINT32)(mips3.r[30] >> 32), (UINT32)mips3.r[30]); break; |
| 1151 | | case CPUINFO_STR_REGISTER + MIPS3_R31: sprintf(info->s, "R31:%08X%08X", (UINT32)(mips3.r[31] >> 32), (UINT32)mips3.r[31]); break; |
| 1152 | | case CPUINFO_STR_REGISTER + MIPS3_HI: sprintf(info->s, "HI: %08X%08X", (UINT32)(mips3.hi >> 32), (UINT32)mips3.hi); break; |
| 1153 | | case CPUINFO_STR_REGISTER + MIPS3_LO: sprintf(info->s, "LO: %08X%08X", (UINT32)(mips3.lo >> 32), (UINT32)mips3.lo); break; |
| 369 | /* --- everything else is handled generically --- */ |
| 370 | default: mips3com_get_info(&mips3.core, state, info); break; |
| 1154 | 371 | } |
| 1155 | 372 | } |
| 1156 | 373 | |
| 1157 | 374 | |
| 375 | |
| 376 | /*************************************************************************** |
| 377 | R4600 VARIANTS |
| 378 | ***************************************************************************/ |
| 379 | |
| 1158 | 380 | #if (HAS_R4600) |
| 1159 | | /************************************************************************** |
| 1160 | | * CPU-specific set_info |
| 1161 | | **************************************************************************/ |
| 381 | static void r4600be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 382 | { |
| 383 | mips3com_init(&mips3.core, MIPS3_TYPE_R4600, TRUE, index, clock, config, irqcallback); |
| 384 | mips3drc_init(); |
| 385 | } |
| 1162 | 386 | |
| 387 | static void r4600le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 388 | { |
| 389 | mips3com_init(&mips3.core, MIPS3_TYPE_R4600, FALSE, index, clock, config, irqcallback); |
| 390 | mips3drc_init(); |
| 391 | } |
| 392 | |
| 1163 | 393 | void r4600be_get_info(UINT32 state, cpuinfo *info) |
| 1164 | 394 | { |
| 1165 | 395 | switch (state) |
| r869 | r870 | |
| 1168 | 398 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 1169 | 399 | |
| 1170 | 400 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1171 | | case CPUINFO_PTR_RESET: info->reset = r4600be_reset; break; |
| 401 | case CPUINFO_PTR_INIT: info->init = r4600be_init; break; |
| 1172 | 402 | |
| 1173 | 403 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1174 | 404 | case CPUINFO_STR_NAME: strcpy(info->s, "R4600 (big)"); break; |
| 1175 | 405 | |
| 406 | /* --- everything else is handled generically --- */ |
| 1176 | 407 | default: mips3_get_info(state, info); break; |
| 1177 | 408 | } |
| 1178 | 409 | } |
| 1179 | 410 | |
| 1180 | | |
| 1181 | 411 | void r4600le_get_info(UINT32 state, cpuinfo *info) |
| 1182 | 412 | { |
| 1183 | 413 | switch (state) |
| r869 | r870 | |
| 1186 | 416 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 1187 | 417 | |
| 1188 | 418 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1189 | | case CPUINFO_PTR_RESET: info->reset = r4600le_reset; break; |
| 419 | case CPUINFO_PTR_INIT: info->init = r4600le_init; break; |
| 1190 | 420 | |
| 1191 | 421 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1192 | 422 | case CPUINFO_STR_NAME: strcpy(info->s, "R4600 (little)"); break; |
| 1193 | 423 | |
| 424 | /* --- everything else is handled generically --- */ |
| 1194 | 425 | default: mips3_get_info(state, info); break; |
| 1195 | 426 | } |
| 1196 | 427 | } |
| 1197 | 428 | #endif |
| 1198 | 429 | |
| 430 | |
| 431 | |
| 432 | /*************************************************************************** |
| 433 | R4650 VARIANTS |
| 434 | ***************************************************************************/ |
| 435 | |
| 1199 | 436 | #if (HAS_R4650) |
| 1200 | | /************************************************************************** |
| 1201 | | * CPU-specific set_info |
| 1202 | | **************************************************************************/ |
| 437 | static void r4650be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 438 | { |
| 439 | mips3com_init(&mips3.core, MIPS3_TYPE_R4650, TRUE, index, clock, config, irqcallback); |
| 440 | mips3drc_init(); |
| 441 | } |
| 1203 | 442 | |
| 443 | static void r4650le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 444 | { |
| 445 | mips3com_init(&mips3.core, MIPS3_TYPE_R4650, FALSE, index, clock, config, irqcallback); |
| 446 | mips3drc_init(); |
| 447 | } |
| 448 | |
| 1204 | 449 | void r4650be_get_info(UINT32 state, cpuinfo *info) |
| 1205 | 450 | { |
| 1206 | 451 | switch (state) |
| r869 | r870 | |
| 1209 | 454 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 1210 | 455 | |
| 1211 | 456 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1212 | | case CPUINFO_PTR_RESET: info->reset = r4600be_reset; break; |
| 457 | case CPUINFO_PTR_INIT: info->init = r4650be_init; break; |
| 1213 | 458 | |
| 1214 | 459 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1215 | 460 | case CPUINFO_STR_NAME: strcpy(info->s, "IDT R4650 (big)"); break; |
| 1216 | 461 | |
| 462 | /* --- everything else is handled generically --- */ |
| 1217 | 463 | default: mips3_get_info(state, info); break; |
| 1218 | 464 | } |
| 1219 | 465 | } |
| 1220 | 466 | |
| 1221 | | |
| 1222 | 467 | void r4650le_get_info(UINT32 state, cpuinfo *info) |
| 1223 | 468 | { |
| 1224 | 469 | switch (state) |
| r869 | r870 | |
| 1227 | 472 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 1228 | 473 | |
| 1229 | 474 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1230 | | case CPUINFO_PTR_RESET: info->reset = r4600le_reset; break; |
| 475 | case CPUINFO_PTR_INIT: info->init = r4650le_init; break; |
| 1231 | 476 | |
| 1232 | 477 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1233 | 478 | case CPUINFO_STR_NAME: strcpy(info->s, "IDT R4650 (little)"); break; |
| 1234 | 479 | |
| 480 | /* --- everything else is handled generically --- */ |
| 1235 | 481 | default: mips3_get_info(state, info); break; |
| 1236 | 482 | } |
| 1237 | 483 | } |
| 1238 | 484 | #endif |
| 1239 | 485 | |
| 486 | |
| 487 | |
| 488 | /*************************************************************************** |
| 489 | R4700 VARIANTS |
| 490 | ***************************************************************************/ |
| 491 | |
| 1240 | 492 | #if (HAS_R4700) |
| 1241 | | /************************************************************************** |
| 1242 | | * CPU-specific set_info |
| 1243 | | **************************************************************************/ |
| 493 | static void r4700be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 494 | { |
| 495 | mips3com_init(&mips3.core, MIPS3_TYPE_R4700, TRUE, index, clock, config, irqcallback); |
| 496 | mips3drc_init(); |
| 497 | } |
| 1244 | 498 | |
| 499 | static void r4700le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 500 | { |
| 501 | mips3com_init(&mips3.core, MIPS3_TYPE_R4700, FALSE, index, clock, config, irqcallback); |
| 502 | mips3drc_init(); |
| 503 | } |
| 504 | |
| 1245 | 505 | void r4700be_get_info(UINT32 state, cpuinfo *info) |
| 1246 | 506 | { |
| 1247 | 507 | switch (state) |
| r869 | r870 | |
| 1250 | 510 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 1251 | 511 | |
| 1252 | 512 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1253 | | case CPUINFO_PTR_RESET: info->reset = r4700be_reset; break; |
| 513 | case CPUINFO_PTR_INIT: info->init = r4700be_init; break; |
| 1254 | 514 | |
| 1255 | 515 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1256 | 516 | case CPUINFO_STR_NAME: strcpy(info->s, "R4700 (big)"); break; |
| 1257 | 517 | |
| 518 | /* --- everything else is handled generically --- */ |
| 1258 | 519 | default: mips3_get_info(state, info); break; |
| 1259 | 520 | } |
| 1260 | 521 | } |
| r869 | r870 | |
| 1268 | 529 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 1269 | 530 | |
| 1270 | 531 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1271 | | case CPUINFO_PTR_RESET: info->reset = r4700le_reset; break; |
| 532 | case CPUINFO_PTR_INIT: info->init = r4700le_init; break; |
| 1272 | 533 | |
| 1273 | 534 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1274 | 535 | case CPUINFO_STR_NAME: strcpy(info->s, "R4700 (little)"); break; |
| 1275 | 536 | |
| 537 | /* --- everything else is handled generically --- */ |
| 1276 | 538 | default: mips3_get_info(state, info); break; |
| 1277 | 539 | } |
| 1278 | 540 | } |
| 1279 | 541 | #endif |
| 1280 | 542 | |
| 1281 | 543 | |
| 544 | |
| 545 | /*************************************************************************** |
| 546 | R5000 VARIANTS |
| 547 | ***************************************************************************/ |
| 548 | |
| 1282 | 549 | #if (HAS_R5000) |
| 1283 | | /************************************************************************** |
| 1284 | | * CPU-specific set_info |
| 1285 | | **************************************************************************/ |
| 550 | static void r5000be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 551 | { |
| 552 | mips3com_init(&mips3.core, MIPS3_TYPE_R5000, TRUE, index, clock, config, irqcallback); |
| 553 | mips3drc_init(); |
| 554 | } |
| 1286 | 555 | |
| 556 | static void r5000le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 557 | { |
| 558 | mips3com_init(&mips3.core, MIPS3_TYPE_R5000, FALSE, index, clock, config, irqcallback); |
| 559 | mips3drc_init(); |
| 560 | } |
| 561 | |
| 1287 | 562 | void r5000be_get_info(UINT32 state, cpuinfo *info) |
| 1288 | 563 | { |
| 1289 | 564 | switch (state) |
| r869 | r870 | |
| 1292 | 567 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 1293 | 568 | |
| 1294 | 569 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1295 | | case CPUINFO_PTR_RESET: info->reset = r5000be_reset; break; |
| 570 | case CPUINFO_PTR_INIT: info->init = r5000be_init; break; |
| 1296 | 571 | |
| 1297 | 572 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1298 | 573 | case CPUINFO_STR_NAME: strcpy(info->s, "R5000 (big)"); break; |
| 1299 | 574 | |
| 575 | /* --- everything else is handled generically --- */ |
| 1300 | 576 | default: mips3_get_info(state, info); break; |
| 1301 | 577 | } |
| 1302 | 578 | } |
| 1303 | 579 | |
| 1304 | | |
| 1305 | 580 | void r5000le_get_info(UINT32 state, cpuinfo *info) |
| 1306 | 581 | { |
| 1307 | 582 | switch (state) |
| r869 | r870 | |
| 1310 | 585 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 1311 | 586 | |
| 1312 | 587 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1313 | | case CPUINFO_PTR_RESET: info->reset = r5000le_reset; break; |
| 588 | case CPUINFO_PTR_INIT: info->init = r5000le_init; break; |
| 1314 | 589 | |
| 1315 | 590 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1316 | 591 | case CPUINFO_STR_NAME: strcpy(info->s, "R5000 (little)"); break; |
| 1317 | 592 | |
| 593 | /* --- everything else is handled generically --- */ |
| 1318 | 594 | default: mips3_get_info(state, info); break; |
| 1319 | 595 | } |
| 1320 | 596 | } |
| 1321 | 597 | #endif |
| 1322 | 598 | |
| 1323 | 599 | |
| 600 | |
| 601 | /*************************************************************************** |
| 602 | QED5271 VARIANTS |
| 603 | ***************************************************************************/ |
| 604 | |
| 1324 | 605 | #if (HAS_QED5271) |
| 1325 | | /************************************************************************** |
| 1326 | | * CPU-specific set_info |
| 1327 | | **************************************************************************/ |
| 606 | static void qed5271be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 607 | { |
| 608 | mips3com_init(&mips3.core, MIPS3_TYPE_QED5271, TRUE, index, clock, config, irqcallback); |
| 609 | mips3drc_init(); |
| 610 | } |
| 1328 | 611 | |
| 612 | static void qed5271le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 613 | { |
| 614 | mips3com_init(&mips3.core, MIPS3_TYPE_QED5271, FALSE, index, clock, config, irqcallback); |
| 615 | mips3drc_init(); |
| 616 | } |
| 617 | |
| 1329 | 618 | void qed5271be_get_info(UINT32 state, cpuinfo *info) |
| 1330 | 619 | { |
| 1331 | 620 | switch (state) |
| r869 | r870 | |
| 1334 | 623 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 1335 | 624 | |
| 1336 | 625 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1337 | | case CPUINFO_PTR_RESET: info->reset = qed5271be_reset; break; |
| 626 | case CPUINFO_PTR_INIT: info->init = qed5271be_init; break; |
| 1338 | 627 | |
| 1339 | 628 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1340 | 629 | case CPUINFO_STR_NAME: strcpy(info->s, "QED5271 (big)"); break; |
| 1341 | 630 | |
| 631 | /* --- everything else is handled generically --- */ |
| 1342 | 632 | default: mips3_get_info(state, info); break; |
| 1343 | 633 | } |
| 1344 | 634 | } |
| 1345 | 635 | |
| 1346 | | |
| 1347 | 636 | void qed5271le_get_info(UINT32 state, cpuinfo *info) |
| 1348 | 637 | { |
| 1349 | 638 | switch (state) |
| r869 | r870 | |
| 1352 | 641 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 1353 | 642 | |
| 1354 | 643 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1355 | | case CPUINFO_PTR_RESET: info->reset = qed5271le_reset; break; |
| 644 | case CPUINFO_PTR_INIT: info->init = qed5271le_init; break; |
| 1356 | 645 | |
| 1357 | 646 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1358 | 647 | case CPUINFO_STR_NAME: strcpy(info->s, "QED5271 (little)"); break; |
| 1359 | 648 | |
| 649 | /* --- everything else is handled generically --- */ |
| 1360 | 650 | default: mips3_get_info(state, info); break; |
| 1361 | 651 | } |
| 1362 | 652 | } |
| 1363 | 653 | #endif |
| 1364 | 654 | |
| 1365 | 655 | |
| 656 | |
| 657 | /*************************************************************************** |
| 658 | RM7000 VARIANTS |
| 659 | ***************************************************************************/ |
| 660 | |
| 1366 | 661 | #if (HAS_RM7000) |
| 1367 | | /************************************************************************** |
| 1368 | | * CPU-specific set_info |
| 1369 | | **************************************************************************/ |
| 662 | static void rm7000be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 663 | { |
| 664 | mips3com_init(&mips3.core, MIPS3_TYPE_RM7000, TRUE, index, clock, config, irqcallback); |
| 665 | mips3drc_init(); |
| 666 | } |
| 1370 | 667 | |
| 668 | static void rm7000le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 669 | { |
| 670 | mips3com_init(&mips3.core, MIPS3_TYPE_RM7000, FALSE, index, clock, config, irqcallback); |
| 671 | mips3drc_init(); |
| 672 | } |
| 673 | |
| 1371 | 674 | void rm7000be_get_info(UINT32 state, cpuinfo *info) |
| 1372 | 675 | { |
| 1373 | 676 | switch (state) |
| r869 | r870 | |
| 1376 | 679 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 1377 | 680 | |
| 1378 | 681 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1379 | | case CPUINFO_PTR_RESET: info->reset = rm7000be_reset; break; |
| 682 | case CPUINFO_PTR_INIT: info->init = rm7000be_init; break; |
| 1380 | 683 | |
| 1381 | 684 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1382 | 685 | case CPUINFO_STR_NAME: strcpy(info->s, "RM7000 (big)"); break; |
| 1383 | 686 | |
| 687 | /* --- everything else is handled generically --- */ |
| 1384 | 688 | default: mips3_get_info(state, info); break; |
| 1385 | 689 | } |
| 1386 | 690 | } |
| 1387 | 691 | |
| 1388 | | |
| 1389 | 692 | void rm7000le_get_info(UINT32 state, cpuinfo *info) |
| 1390 | 693 | { |
| 1391 | 694 | switch (state) |
| r869 | r870 | |
| 1394 | 697 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 1395 | 698 | |
| 1396 | 699 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1397 | | case CPUINFO_PTR_RESET: info->reset = rm7000le_reset; break; |
| 700 | case CPUINFO_PTR_INIT: info->init = rm7000le_init; break; |
| 1398 | 701 | |
| 1399 | 702 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1400 | 703 | case CPUINFO_STR_NAME: strcpy(info->s, "RM7000 (little)"); break; |
| 1401 | 704 | |
| 705 | /* --- everything else is handled generically --- */ |
| 1402 | 706 | default: mips3_get_info(state, info); break; |
| 1403 | 707 | } |
| 1404 | 708 | } |
| r869 | r870 | |
| 1406 | 710 | |
| 1407 | 711 | |
| 1408 | 712 | |
| 713 | /*************************************************************************** |
| 714 | DISASSEMBLERS |
| 715 | ***************************************************************************/ |
| 1409 | 716 | |
| 1410 | 717 | #if !defined(MAME_DEBUG) && (LOG_CODE) |
| 1411 | 718 | #include "mips3dsm.c" |
src/emu/cpu/mips/mips3com.c
| r0 | r870 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | mips3com.c |
| 4 | |
| 5 | Common MIPS III/IV definitions and functions |
| 6 | |
| 7 | ***************************************************************************/ |
| 8 | |
| 9 | #include "mips3com.h" |
| 10 | |
| 11 | |
| 12 | /*************************************************************************** |
| 13 | DEBUGGING |
| 14 | ***************************************************************************/ |
| 15 | |
| 16 | #define PRINTF_TLB (1) |
| 17 | |
| 18 | |
| 19 | |
| 20 | /*************************************************************************** |
| 21 | FUNCTION PROTOTYPES |
| 22 | ***************************************************************************/ |
| 23 | |
| 24 | static TIMER_CALLBACK( compare_int_callback ); |
| 25 | |
| 26 | static UINT32 compute_config_register(const mips3_state *mips); |
| 27 | static UINT32 compute_prid_register(const mips3_state *mips); |
| 28 | |
| 29 | static void tlb_write_common(mips3_state *mips, int index); |
| 30 | static void tlb_entry_log_half(mips3_tlb_entry *tlbent, int index, int which); |
| 31 | |
| 32 | static UINT64 program_read_qword_32be(offs_t offset); |
| 33 | static UINT64 program_read_qword_32le(offs_t offset); |
| 34 | static void program_write_qword_32be(offs_t offset, UINT64 data); |
| 35 | static void program_write_qword_32le(offs_t offset, UINT64 data); |
| 36 | |
| 37 | |
| 38 | |
| 39 | /*************************************************************************** |
| 40 | GLOBAL VARIABLES |
| 41 | ***************************************************************************/ |
| 42 | |
| 43 | int mips3_icount; |
| 44 | |
| 45 | |
| 46 | |
| 47 | /*************************************************************************** |
| 48 | PRIVATE GLOBAL VARIABLES |
| 49 | ***************************************************************************/ |
| 50 | |
| 51 | static const memory_handlers be_memory = |
| 52 | { |
| 53 | program_read_byte_32be, program_read_word_32be, program_read_dword_32be, program_read_qword_32be, |
| 54 | program_write_byte_32be, program_write_word_32be, program_write_dword_32be, program_write_qword_32be |
| 55 | }; |
| 56 | |
| 57 | static const memory_handlers le_memory = |
| 58 | { |
| 59 | program_read_byte_32le, program_read_word_32le, program_read_dword_32le, program_read_qword_32le, |
| 60 | program_write_byte_32le, program_write_word_32le, program_write_dword_32le, program_write_qword_32le |
| 61 | }; |
| 62 | |
| 63 | |
| 64 | |
| 65 | /*************************************************************************** |
| 66 | INITIALIZATION AND SHUTDOWN |
| 67 | ***************************************************************************/ |
| 68 | |
| 69 | /*------------------------------------------------- |
| 70 | mips3com_init - initialize the mips3_state |
| 71 | structure based on the configured type |
| 72 | -------------------------------------------------*/ |
| 73 | |
| 74 | void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, int index, int clock, const struct mips3_config *config, int (*irqcallback)(int)) |
| 75 | { |
| 76 | /* initialize the state */ |
| 77 | memset(mips, 0, sizeof(*mips)); |
| 78 | |
| 79 | /* initialize based on the config */ |
| 80 | mips->flavor = flavor; |
| 81 | mips->bigendian = bigendian; |
| 82 | mips->cpu_clock = clock; |
| 83 | mips->irq_callback = irqcallback; |
| 84 | mips->icache_size = config->icache; |
| 85 | mips->dcache_size = config->dcache; |
| 86 | mips->system_clock = config->system_clock; |
| 87 | |
| 88 | /* set up the endianness */ |
| 89 | if (mips->bigendian) |
| 90 | mips->memory = be_memory; |
| 91 | else |
| 92 | mips->memory = le_memory; |
| 93 | |
| 94 | /* allocate memory */ |
| 95 | mips->icache = auto_malloc(config->icache); |
| 96 | mips->dcache = auto_malloc(config->dcache); |
| 97 | mips->tlb_table = auto_malloc(sizeof(mips->tlb_table[0]) * (1 << (MIPS3_MAX_PADDR_SHIFT - MIPS3_MIN_PAGE_SHIFT))); |
| 98 | |
| 99 | /* allocate a timer for the compare interrupt */ |
| 100 | mips->compare_int_timer = mame_timer_alloc(compare_int_callback); |
| 101 | |
| 102 | /* reset the state */ |
| 103 | mips3com_reset(mips); |
| 104 | } |
| 105 | |
| 106 | |
| 107 | /*------------------------------------------------- |
| 108 | mips3com_reset - reset the state of all the |
| 109 | registers |
| 110 | -------------------------------------------------*/ |
| 111 | |
| 112 | void mips3com_reset(mips3_state *mips) |
| 113 | { |
| 114 | /* initialize the state */ |
| 115 | mips->pc = 0xbfc00000; |
| 116 | mips->cpr[0][COP0_Status] = SR_BEV | SR_ERL; |
| 117 | mips->cpr[0][COP0_Compare] = 0xffffffff; |
| 118 | mips->cpr[0][COP0_Count] = 0; |
| 119 | mips->cpr[0][COP0_Config] = compute_config_register(mips); |
| 120 | mips->cpr[0][COP0_PRId] = compute_prid_register(mips); |
| 121 | mips->count_zero_time = activecpu_gettotalcycles64(); |
| 122 | |
| 123 | /* recompute the TLB table */ |
| 124 | mips3com_recompute_tlb_table(mips); |
| 125 | } |
| 126 | |
| 127 | |
| 128 | /*------------------------------------------------- |
| 129 | mips3com_dasm - handle disassembly for a |
| 130 | CPU |
| 131 | -------------------------------------------------*/ |
| 132 | |
| 133 | #ifdef MAME_DEBUG |
| 134 | offs_t mips3com_dasm(mips3_state *mips, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) |
| 135 | { |
| 136 | extern unsigned dasmmips3(char *, unsigned, UINT32); |
| 137 | UINT32 op = *(UINT32 *)oprom; |
| 138 | if (mips->bigendian) |
| 139 | op = BIG_ENDIANIZE_INT32(op); |
| 140 | else |
| 141 | op = LITTLE_ENDIANIZE_INT32(op); |
| 142 | return dasmmips3(buffer, pc, op); |
| 143 | } |
| 144 | #endif /* MAME_DEBUG */ |
| 145 | |
| 146 | |
| 147 | |
| 148 | /*------------------------------------------------- |
| 149 | mips3com_update_cycle_counting - update cycle |
| 150 | counts and the timers |
| 151 | -------------------------------------------------*/ |
| 152 | |
| 153 | void mips3com_update_cycle_counting(mips3_state *mips) |
| 154 | { |
| 155 | /* modify the timer to go off */ |
| 156 | if ((mips->cpr[0][COP0_Status] & 0x8000) && mips->cpr[0][COP0_Compare] != 0xffffffff) |
| 157 | { |
| 158 | UINT32 count = (activecpu_gettotalcycles64() - mips->count_zero_time) / 2; |
| 159 | UINT32 compare = mips->cpr[0][COP0_Compare]; |
| 160 | UINT32 cyclesleft = compare - count; |
| 161 | mame_time newtime = MAME_TIME_IN_CYCLES(((INT64)cyclesleft * 2), cpu_getactivecpu()); |
| 162 | |
| 163 | /* due to accuracy issues, don't bother setting timers unless they're for less than 100msec */ |
| 164 | if (compare_mame_times(newtime, MAME_TIME_IN_MSEC(100)) < 0) |
| 165 | mame_timer_adjust(mips->compare_int_timer, newtime, cpu_getactivecpu(), time_zero); |
| 166 | } |
| 167 | else |
| 168 | mame_timer_adjust(mips->compare_int_timer, time_never, cpu_getactivecpu(), time_zero); |
| 169 | } |
| 170 | |
| 171 | |
| 172 | |
| 173 | /*************************************************************************** |
| 174 | TLB HANDLING |
| 175 | ***************************************************************************/ |
| 176 | |
| 177 | /*------------------------------------------------- |
| 178 | mips3com_map_tlb_entries - map entries from the |
| 179 | TLB into the tlb_table |
| 180 | -------------------------------------------------*/ |
| 181 | |
| 182 | void mips3com_map_tlb_entries(mips3_state *mips) |
| 183 | { |
| 184 | int valid_asid = mips->cpr[0][COP0_EntryHi] & 0xff; |
| 185 | int index; |
| 186 | |
| 187 | /* iterate over all TLB entries */ |
| 188 | for (index = 0; index < ARRAY_LENGTH(mips->tlb); index++) |
| 189 | { |
| 190 | mips3_tlb_entry *tlbent = &mips->tlb[index]; |
| 191 | |
| 192 | /* only process if global or if the ASID matches */ |
| 193 | if ((tlbent->entry_hi & 0x1000) || valid_asid == (tlbent->entry_hi & 0xff)) |
| 194 | { |
| 195 | UINT32 count = (tlbent->page_mask >> 13) & 0x00fff; |
| 196 | UINT32 vpn = ((tlbent->entry_hi >> 13) & 0x07ffffff) << 1; |
| 197 | int which, i; |
| 198 | |
| 199 | /* ignore if the virtual address is beyond 32 bits */ |
| 200 | if (vpn < (1 << (MIPS3_MAX_PADDR_SHIFT - MIPS3_MIN_PAGE_SHIFT))) |
| 201 | |
| 202 | /* loop over both the even and odd pages */ |
| 203 | for (which = 0; which < 2; which++) |
| 204 | { |
| 205 | UINT64 lo = tlbent->entry_lo[which]; |
| 206 | |
| 207 | /* only map if the TLB entry is valid */ |
| 208 | if (lo & 2) |
| 209 | { |
| 210 | UINT32 pfn = (lo >> 6) & 0x00ffffff; |
| 211 | UINT32 wp = (~lo >> 2) & 1; |
| 212 | |
| 213 | for (i = 0; i <= count; i++, vpn++, pfn++) |
| 214 | if (vpn < 0x80000 || vpn >= 0xc0000) |
| 215 | mips->tlb_table[vpn] = (pfn << MIPS3_MIN_PAGE_SHIFT) | wp; |
| 216 | } |
| 217 | |
| 218 | /* otherwise, advance by the number of pages we would have mapped */ |
| 219 | else |
| 220 | vpn += count + 1; |
| 221 | } |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | |
| 227 | /*------------------------------------------------- |
| 228 | mips3com_unmap_tlb_entries - unmap entries from |
| 229 | the TLB into the tlb_table |
| 230 | -------------------------------------------------*/ |
| 231 | |
| 232 | void mips3com_unmap_tlb_entries(mips3_state *mips) |
| 233 | { |
| 234 | int index; |
| 235 | |
| 236 | /* iterate over all TLB entries */ |
| 237 | for (index = 0; index < ARRAY_LENGTH(mips->tlb); index++) |
| 238 | { |
| 239 | mips3_tlb_entry *tlbent = &mips->tlb[index]; |
| 240 | UINT32 count = (tlbent->page_mask >> 13) & 0x00fff; |
| 241 | UINT32 vpn = ((tlbent->entry_hi >> 13) & 0x07ffffff) << 1; |
| 242 | int which, i; |
| 243 | |
| 244 | /* ignore if the virtual address is beyond 32 bits */ |
| 245 | if (vpn < (1 << (MIPS3_MAX_PADDR_SHIFT - MIPS3_MIN_PAGE_SHIFT))) |
| 246 | |
| 247 | /* loop over both the even and odd pages */ |
| 248 | for (which = 0; which < 2; which++) |
| 249 | for (i = 0; i <= count; i++, vpn++) |
| 250 | if (vpn < 0x80000 || vpn >= 0xc0000) |
| 251 | mips->tlb_table[vpn] = 0xffffffff; |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | |
| 256 | /*------------------------------------------------- |
| 257 | mips3com_recompute_tlb_table - recompute the TLB |
| 258 | table from scratch |
| 259 | -------------------------------------------------*/ |
| 260 | |
| 261 | void mips3com_recompute_tlb_table(mips3_state *mips) |
| 262 | { |
| 263 | UINT32 addr; |
| 264 | |
| 265 | /* map in the hard-coded spaces */ |
| 266 | for (addr = 0x80000000; addr < 0xc0000000; addr += MIPS3_MIN_PAGE_SIZE) |
| 267 | mips->tlb_table[addr >> MIPS3_MIN_PAGE_SHIFT] = addr & 0x1ffff000; |
| 268 | |
| 269 | /* reset everything else to unmapped */ |
| 270 | memset(&mips->tlb_table[0x00000000 >> MIPS3_MIN_PAGE_SHIFT], 0xff, sizeof(mips->tlb_table[0]) * (0x80000000 >> MIPS3_MIN_PAGE_SHIFT)); |
| 271 | memset(&mips->tlb_table[0xc0000000 >> MIPS3_MIN_PAGE_SHIFT], 0xff, sizeof(mips->tlb_table[0]) * (0x40000000 >> MIPS3_MIN_PAGE_SHIFT)); |
| 272 | |
| 273 | /* remap all the entries in the TLB */ |
| 274 | mips3com_map_tlb_entries(mips); |
| 275 | } |
| 276 | |
| 277 | |
| 278 | /*------------------------------------------------- |
| 279 | mips3com_translate_address - translate an address |
| 280 | from logical to physical |
| 281 | -------------------------------------------------*/ |
| 282 | |
| 283 | int mips3com_translate_address(mips3_state *mips, int space, offs_t *address) |
| 284 | { |
| 285 | /* only applies to the program address space */ |
| 286 | if (space == ADDRESS_SPACE_PROGRAM) |
| 287 | { |
| 288 | UINT32 result = mips->tlb_table[*address >> MIPS3_MIN_PAGE_SHIFT]; |
| 289 | if (result == 0xffffffff) |
| 290 | return FALSE; |
| 291 | *address = (result & ~MIPS3_MIN_PAGE_MASK) | (*address & MIPS3_MIN_PAGE_MASK); |
| 292 | } |
| 293 | return TRUE; |
| 294 | } |
| 295 | |
| 296 | |
| 297 | /*------------------------------------------------- |
| 298 | mips3com_tlbr - execute the tlbr instruction |
| 299 | -------------------------------------------------*/ |
| 300 | |
| 301 | void mips3com_tlbr(mips3_state *mips) |
| 302 | { |
| 303 | UINT32 index = mips->cpr[0][COP0_Index] & 0x3f; |
| 304 | |
| 305 | /* only handle entries within the TLB */ |
| 306 | if (index < ARRAY_LENGTH(mips->tlb)) |
| 307 | { |
| 308 | mips3_tlb_entry *tlbent = &mips->tlb[index]; |
| 309 | |
| 310 | /* copy data from the TLB entry into the COP0 registers */ |
| 311 | mips->cpr[0][COP0_PageMask] = tlbent->page_mask; |
| 312 | mips->cpr[0][COP0_EntryHi] = tlbent->entry_hi; |
| 313 | mips->cpr[0][COP0_EntryLo0] = tlbent->entry_lo[0]; |
| 314 | mips->cpr[0][COP0_EntryLo1] = tlbent->entry_lo[1]; |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | |
| 319 | /*------------------------------------------------- |
| 320 | mips3com_tlbwi - execute the tlbwi instruction |
| 321 | -------------------------------------------------*/ |
| 322 | |
| 323 | void mips3com_tlbwi(mips3_state *mips) |
| 324 | { |
| 325 | /* use the common handler and write based off the COP0 Index register */ |
| 326 | tlb_write_common(mips, mips->cpr[0][COP0_Index] & 0x3f); |
| 327 | } |
| 328 | |
| 329 | |
| 330 | /*------------------------------------------------- |
| 331 | mips3com_tlbwr - execute the tlbwr instruction |
| 332 | -------------------------------------------------*/ |
| 333 | |
| 334 | void mips3com_tlbwr(mips3_state *mips) |
| 335 | { |
| 336 | UINT32 wired = mips->cpr[0][COP0_Wired] & 0x3f; |
| 337 | UINT32 unwired = ARRAY_LENGTH(mips->tlb) - wired; |
| 338 | UINT32 index = ARRAY_LENGTH(mips->tlb) - 1; |
| 339 | |
| 340 | /* "random" is based off of the current cycle counting through the non-wired pages */ |
| 341 | if (unwired > 0) |
| 342 | index = ((activecpu_gettotalcycles64() - mips->count_zero_time) % unwired + wired) & 0x3f; |
| 343 | |
| 344 | /* use the common handler to write to this index */ |
| 345 | tlb_write_common(mips, index); |
| 346 | } |
| 347 | |
| 348 | |
| 349 | /*------------------------------------------------- |
| 350 | mips3com_tlbp - execute the tlbp instruction |
| 351 | -------------------------------------------------*/ |
| 352 | |
| 353 | void mips3com_tlbp(mips3_state *mips) |
| 354 | { |
| 355 | UINT32 index; |
| 356 | UINT64 vpn; |
| 357 | |
| 358 | /* iterate over TLB entries */ |
| 359 | for (index = 0; index < ARRAY_LENGTH(mips->tlb); index++) |
| 360 | { |
| 361 | mips3_tlb_entry *tlbent = &mips->tlb[index]; |
| 362 | UINT64 mask = ~((tlbent->page_mask >> 13) & 0xfff) << 13; |
| 363 | |
| 364 | /* if the relevant bits of EntryHi match the relevant bits of the TLB */ |
| 365 | if ((tlbent->entry_hi & mask) == (mips->cpr[0][COP0_EntryHi] & mask)) |
| 366 | |
| 367 | /* and if we are either global or matching the current ASID, then stop */ |
| 368 | if ((tlbent->entry_hi & 0x1000) || (tlbent->entry_hi & 0xff) == (mips->cpr[0][COP0_EntryHi] & 0xff)) |
| 369 | break; |
| 370 | } |
| 371 | |
| 372 | /* validate that our tlb_table was in sync */ |
| 373 | vpn = ((mips->cpr[0][COP0_EntryHi] >> 13) & 0x07ffffff) << 1; |
| 374 | if (index != ARRAY_LENGTH(mips->tlb)) |
| 375 | { |
| 376 | assert(mips->tlb_table[vpn & 0xfffff] != 0xffffffff); |
| 377 | mips->cpr[0][COP0_Index] = index; |
| 378 | } |
| 379 | else |
| 380 | { |
| 381 | assert(mips->tlb_table[vpn & 0xfffff] == 0xffffffff); |
| 382 | mips->cpr[0][COP0_Index] = 0x80000000; |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | |
| 387 | |
| 388 | /*************************************************************************** |
| 389 | COMMON GET/SET INFO |
| 390 | ***************************************************************************/ |
| 391 | |
| 392 | /*------------------------------------------------- |
| 393 | mips3com_set_info - set information about |
| 394 | a MIPS 3 CPU |
| 395 | -------------------------------------------------*/ |
| 396 | |
| 397 | void mips3com_set_info(mips3_state *mips, UINT32 state, cpuinfo *info) |
| 398 | { |
| 399 | switch (state) |
| 400 | { |
| 401 | /* --- the following bits of info are set as 64-bit signed integers --- */ |
| 402 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ0: mips3com_set_irq_line(mips, MIPS3_IRQ0, info->i); break; |
| 403 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ1: mips3com_set_irq_line(mips, MIPS3_IRQ1, info->i); break; |
| 404 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ2: mips3com_set_irq_line(mips, MIPS3_IRQ2, info->i); break; |
| 405 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ3: mips3com_set_irq_line(mips, MIPS3_IRQ3, info->i); break; |
| 406 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ4: mips3com_set_irq_line(mips, MIPS3_IRQ4, info->i); break; |
| 407 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ5: mips3com_set_irq_line(mips, MIPS3_IRQ5, info->i); break; |
| 408 | |
| 409 | case CPUINFO_INT_PC: |
| 410 | case CPUINFO_INT_REGISTER + MIPS3_PC: mips->pc = info->i; break; |
| 411 | case CPUINFO_INT_REGISTER + MIPS3_SR: mips->cpr[0][COP0_Status] = info->i; break; |
| 412 | case CPUINFO_INT_REGISTER + MIPS3_EPC: mips->cpr[0][COP0_EPC] = info->i; break; |
| 413 | case CPUINFO_INT_REGISTER + MIPS3_CAUSE: mips->cpr[0][COP0_Cause] = info->i; break; |
| 414 | case CPUINFO_INT_REGISTER + MIPS3_COUNT: mips->cpr[0][COP0_Count] = info->i; break; |
| 415 | case CPUINFO_INT_REGISTER + MIPS3_COMPARE: mips->cpr[0][COP0_Compare] = info->i; break; |
| 416 | case CPUINFO_INT_REGISTER + MIPS3_INDEX: mips->cpr[0][COP0_Index] = info->i; break; |
| 417 | case CPUINFO_INT_REGISTER + MIPS3_RANDOM: mips->cpr[0][COP0_Random] = info->i; break; |
| 418 | case CPUINFO_INT_REGISTER + MIPS3_ENTRYHI: mips->cpr[0][COP0_EntryHi] = info->i; break; |
| 419 | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO0: mips->cpr[0][COP0_EntryLo0] = info->i; break; |
| 420 | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO1: mips->cpr[0][COP0_EntryLo1] = info->i; break; |
| 421 | case CPUINFO_INT_REGISTER + MIPS3_PAGEMASK: mips->cpr[0][COP0_PageMask] = info->i; break; |
| 422 | case CPUINFO_INT_REGISTER + MIPS3_WIRED: mips->cpr[0][COP0_Wired] = info->i; break; |
| 423 | case CPUINFO_INT_REGISTER + MIPS3_BADVADDR: mips->cpr[0][COP0_BadVAddr] = info->i; break; |
| 424 | |
| 425 | case CPUINFO_INT_REGISTER + MIPS3_R0: /* can't change R0 */ break; |
| 426 | case CPUINFO_INT_REGISTER + MIPS3_R1: mips->r[1] = info->i; break; |
| 427 | case CPUINFO_INT_REGISTER + MIPS3_R2: mips->r[2] = info->i; break; |
| 428 | case CPUINFO_INT_REGISTER + MIPS3_R3: mips->r[3] = info->i; break; |
| 429 | case CPUINFO_INT_REGISTER + MIPS3_R4: mips->r[4] = info->i; break; |
| 430 | case CPUINFO_INT_REGISTER + MIPS3_R5: mips->r[5] = info->i; break; |
| 431 | case CPUINFO_INT_REGISTER + MIPS3_R6: mips->r[6] = info->i; break; |
| 432 | case CPUINFO_INT_REGISTER + MIPS3_R7: mips->r[7] = info->i; break; |
| 433 | case CPUINFO_INT_REGISTER + MIPS3_R8: mips->r[8] = info->i; break; |
| 434 | case CPUINFO_INT_REGISTER + MIPS3_R9: mips->r[9] = info->i; break; |
| 435 | case CPUINFO_INT_REGISTER + MIPS3_R10: mips->r[10] = info->i; break; |
| 436 | case CPUINFO_INT_REGISTER + MIPS3_R11: mips->r[11] = info->i; break; |
| 437 | case CPUINFO_INT_REGISTER + MIPS3_R12: mips->r[12] = info->i; break; |
| 438 | case CPUINFO_INT_REGISTER + MIPS3_R13: mips->r[13] = info->i; break; |
| 439 | case CPUINFO_INT_REGISTER + MIPS3_R14: mips->r[14] = info->i; break; |
| 440 | case CPUINFO_INT_REGISTER + MIPS3_R15: mips->r[15] = info->i; break; |
| 441 | case CPUINFO_INT_REGISTER + MIPS3_R16: mips->r[16] = info->i; break; |
| 442 | case CPUINFO_INT_REGISTER + MIPS3_R17: mips->r[17] = info->i; break; |
| 443 | case CPUINFO_INT_REGISTER + MIPS3_R18: mips->r[18] = info->i; break; |
| 444 | case CPUINFO_INT_REGISTER + MIPS3_R19: mips->r[19] = info->i; break; |
| 445 | case CPUINFO_INT_REGISTER + MIPS3_R20: mips->r[20] = info->i; break; |
| 446 | case CPUINFO_INT_REGISTER + MIPS3_R21: mips->r[21] = info->i; break; |
| 447 | case CPUINFO_INT_REGISTER + MIPS3_R22: mips->r[22] = info->i; break; |
| 448 | case CPUINFO_INT_REGISTER + MIPS3_R23: mips->r[23] = info->i; break; |
| 449 | case CPUINFO_INT_REGISTER + MIPS3_R24: mips->r[24] = info->i; break; |
| 450 | case CPUINFO_INT_REGISTER + MIPS3_R25: mips->r[25] = info->i; break; |
| 451 | case CPUINFO_INT_REGISTER + MIPS3_R26: mips->r[26] = info->i; break; |
| 452 | case CPUINFO_INT_REGISTER + MIPS3_R27: mips->r[27] = info->i; break; |
| 453 | case CPUINFO_INT_REGISTER + MIPS3_R28: mips->r[28] = info->i; break; |
| 454 | case CPUINFO_INT_REGISTER + MIPS3_R29: mips->r[29] = info->i; break; |
| 455 | case CPUINFO_INT_REGISTER + MIPS3_R30: mips->r[30] = info->i; break; |
| 456 | case CPUINFO_INT_SP: |
| 457 | case CPUINFO_INT_REGISTER + MIPS3_R31: mips->r[31] = info->i; break; |
| 458 | case CPUINFO_INT_REGISTER + MIPS3_HI: mips->hi = info->i; break; |
| 459 | case CPUINFO_INT_REGISTER + MIPS3_LO: mips->lo = info->i; break; |
| 460 | |
| 461 | case CPUINFO_INT_REGISTER + MIPS3_FPR0: mips->cpr[1][0] = info->i; break; |
| 462 | case CPUINFO_INT_REGISTER + MIPS3_FPR1: mips->cpr[1][1] = info->i; break; |
| 463 | case CPUINFO_INT_REGISTER + MIPS3_FPR2: mips->cpr[1][2] = info->i; break; |
| 464 | case CPUINFO_INT_REGISTER + MIPS3_FPR3: mips->cpr[1][3] = info->i; break; |
| 465 | case CPUINFO_INT_REGISTER + MIPS3_FPR4: mips->cpr[1][4] = info->i; break; |
| 466 | case CPUINFO_INT_REGISTER + MIPS3_FPR5: mips->cpr[1][5] = info->i; break; |
| 467 | case CPUINFO_INT_REGISTER + MIPS3_FPR6: mips->cpr[1][6] = info->i; break; |
| 468 | case CPUINFO_INT_REGISTER + MIPS3_FPR7: mips->cpr[1][7] = info->i; break; |
| 469 | case CPUINFO_INT_REGISTER + MIPS3_FPR8: mips->cpr[1][8] = info->i; break; |
| 470 | case CPUINFO_INT_REGISTER + MIPS3_FPR9: mips->cpr[1][9] = info->i; break; |
| 471 | case CPUINFO_INT_REGISTER + MIPS3_FPR10: mips->cpr[1][10] = info->i; break; |
| 472 | case CPUINFO_INT_REGISTER + MIPS3_FPR11: mips->cpr[1][11] = info->i; break; |
| 473 | case CPUINFO_INT_REGISTER + MIPS3_FPR12: mips->cpr[1][12] = info->i; break; |
| 474 | case CPUINFO_INT_REGISTER + MIPS3_FPR13: mips->cpr[1][13] = info->i; break; |
| 475 | case CPUINFO_INT_REGISTER + MIPS3_FPR14: mips->cpr[1][14] = info->i; break; |
| 476 | case CPUINFO_INT_REGISTER + MIPS3_FPR15: mips->cpr[1][15] = info->i; break; |
| 477 | case CPUINFO_INT_REGISTER + MIPS3_FPR16: mips->cpr[1][16] = info->i; break; |
| 478 | case CPUINFO_INT_REGISTER + MIPS3_FPR17: mips->cpr[1][17] = info->i; break; |
| 479 | case CPUINFO_INT_REGISTER + MIPS3_FPR18: mips->cpr[1][18] = info->i; break; |
| 480 | case CPUINFO_INT_REGISTER + MIPS3_FPR19: mips->cpr[1][19] = info->i; break; |
| 481 | case CPUINFO_INT_REGISTER + MIPS3_FPR20: mips->cpr[1][20] = info->i; break; |
| 482 | case CPUINFO_INT_REGISTER + MIPS3_FPR21: mips->cpr[1][21] = info->i; break; |
| 483 | case CPUINFO_INT_REGISTER + MIPS3_FPR22: mips->cpr[1][22] = info->i; break; |
| 484 | case CPUINFO_INT_REGISTER + MIPS3_FPR23: mips->cpr[1][23] = info->i; break; |
| 485 | case CPUINFO_INT_REGISTER + MIPS3_FPR24: mips->cpr[1][24] = info->i; break; |
| 486 | case CPUINFO_INT_REGISTER + MIPS3_FPR25: mips->cpr[1][25] = info->i; break; |
| 487 | case CPUINFO_INT_REGISTER + MIPS3_FPR26: mips->cpr[1][26] = info->i; break; |
| 488 | case CPUINFO_INT_REGISTER + MIPS3_FPR27: mips->cpr[1][27] = info->i; break; |
| 489 | case CPUINFO_INT_REGISTER + MIPS3_FPR28: mips->cpr[1][28] = info->i; break; |
| 490 | case CPUINFO_INT_REGISTER + MIPS3_FPR29: mips->cpr[1][29] = info->i; break; |
| 491 | case CPUINFO_INT_REGISTER + MIPS3_FPR30: mips->cpr[1][30] = info->i; break; |
| 492 | case CPUINFO_INT_REGISTER + MIPS3_FPR31: mips->cpr[1][31] = info->i; break; |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | |
| 497 | /*------------------------------------------------- |
| 498 | mips3com_get_info - get information about |
| 499 | a MIPS 3 CPU |
| 500 | -------------------------------------------------*/ |
| 501 | |
| 502 | void mips3com_get_info(mips3_state *mips, UINT32 state, cpuinfo *info) |
| 503 | { |
| 504 | switch (state) |
| 505 | { |
| 506 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 507 | case CPUINFO_INT_CONTEXT_SIZE: /* provided by core */ break; |
| 508 | case CPUINFO_INT_INPUT_LINES: info->i = 6; break; |
| 509 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; |
| 510 | case CPUINFO_INT_ENDIANNESS: info->i = mips->bigendian ? CPU_IS_BE : CPU_IS_LE; break; |
| 511 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; |
| 512 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 4; break; |
| 513 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; |
| 514 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 515 | case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
| 516 | |
| 517 | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = MIPS3_MAX_PADDR_SHIFT;break; |
| 518 | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; |
| 519 | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; |
| 520 | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; |
| 521 | case CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = MIPS3_MIN_PAGE_SHIFT; break; |
| 522 | |
| 523 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ0: info->i = (mips->cpr[0][COP0_Cause] & 0x400) ? ASSERT_LINE : CLEAR_LINE; break; |
| 524 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ1: info->i = (mips->cpr[0][COP0_Cause] & 0x800) ? ASSERT_LINE : CLEAR_LINE; break; |
| 525 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ2: info->i = (mips->cpr[0][COP0_Cause] & 0x1000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 526 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ3: info->i = (mips->cpr[0][COP0_Cause] & 0x2000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 527 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ4: info->i = (mips->cpr[0][COP0_Cause] & 0x4000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 528 | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ5: info->i = (mips->cpr[0][COP0_Cause] & 0x8000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 529 | |
| 530 | case CPUINFO_INT_PREVIOUSPC: /* optionally implemented */ break; |
| 531 | |
| 532 | case CPUINFO_INT_PC: |
| 533 | case CPUINFO_INT_REGISTER + MIPS3_PC: info->i = mips->pc; break; |
| 534 | case CPUINFO_INT_REGISTER + MIPS3_SR: info->i = mips->cpr[0][COP0_Status]; break; |
| 535 | case CPUINFO_INT_REGISTER + MIPS3_EPC: info->i = mips->cpr[0][COP0_EPC]; break; |
| 536 | case CPUINFO_INT_REGISTER + MIPS3_CAUSE: info->i = mips->cpr[0][COP0_Cause]; break; |
| 537 | case CPUINFO_INT_REGISTER + MIPS3_COUNT: info->i = ((activecpu_gettotalcycles64() - mips->count_zero_time) / 2); break; |
| 538 | case CPUINFO_INT_REGISTER + MIPS3_COMPARE: info->i = mips->cpr[0][COP0_Compare]; break; |
| 539 | case CPUINFO_INT_REGISTER + MIPS3_INDEX: info->i = mips->cpr[0][COP0_Index]; break; |
| 540 | case CPUINFO_INT_REGISTER + MIPS3_RANDOM: info->i = mips->cpr[0][COP0_Random]; break; |
| 541 | case CPUINFO_INT_REGISTER + MIPS3_ENTRYHI: info->i = mips->cpr[0][COP0_EntryHi]; break; |
| 542 | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO0: info->i = mips->cpr[0][COP0_EntryLo0]; break; |
| 543 | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO1: info->i = mips->cpr[0][COP0_EntryLo1]; break; |
| 544 | case CPUINFO_INT_REGISTER + MIPS3_PAGEMASK: info->i = mips->cpr[0][COP0_PageMask]; break; |
| 545 | case CPUINFO_INT_REGISTER + MIPS3_WIRED: info->i = mips->cpr[0][COP0_Wired]; break; |
| 546 | case CPUINFO_INT_REGISTER + MIPS3_BADVADDR: info->i = mips->cpr[0][COP0_BadVAddr]; break; |
| 547 | |
| 548 | case CPUINFO_INT_REGISTER + MIPS3_R0: info->i = mips->r[0]; break; |
| 549 | case CPUINFO_INT_REGISTER + MIPS3_R1: info->i = mips->r[1]; break; |
| 550 | case CPUINFO_INT_REGISTER + MIPS3_R2: info->i = mips->r[2]; break; |
| 551 | case CPUINFO_INT_REGISTER + MIPS3_R3: info->i = mips->r[3]; break; |
| 552 | case CPUINFO_INT_REGISTER + MIPS3_R4: info->i = mips->r[4]; break; |
| 553 | case CPUINFO_INT_REGISTER + MIPS3_R5: info->i = mips->r[5]; break; |
| 554 | case CPUINFO_INT_REGISTER + MIPS3_R6: info->i = mips->r[6]; break; |
| 555 | case CPUINFO_INT_REGISTER + MIPS3_R7: info->i = mips->r[7]; break; |
| 556 | case CPUINFO_INT_REGISTER + MIPS3_R8: info->i = mips->r[8]; break; |
| 557 | case CPUINFO_INT_REGISTER + MIPS3_R9: info->i = mips->r[9]; break; |
| 558 | case CPUINFO_INT_REGISTER + MIPS3_R10: info->i = mips->r[10]; break; |
| 559 | case CPUINFO_INT_REGISTER + MIPS3_R11: info->i = mips->r[11]; break; |
| 560 | case CPUINFO_INT_REGISTER + MIPS3_R12: info->i = mips->r[12]; break; |
| 561 | case CPUINFO_INT_REGISTER + MIPS3_R13: info->i = mips->r[13]; break; |
| 562 | case CPUINFO_INT_REGISTER + MIPS3_R14: info->i = mips->r[14]; break; |
| 563 | case CPUINFO_INT_REGISTER + MIPS3_R15: info->i = mips->r[15]; break; |
| 564 | case CPUINFO_INT_REGISTER + MIPS3_R16: info->i = mips->r[16]; break; |
| 565 | case CPUINFO_INT_REGISTER + MIPS3_R17: info->i = mips->r[17]; break; |
| 566 | case CPUINFO_INT_REGISTER + MIPS3_R18: info->i = mips->r[18]; break; |
| 567 | case CPUINFO_INT_REGISTER + MIPS3_R19: info->i = mips->r[19]; break; |
| 568 | case CPUINFO_INT_REGISTER + MIPS3_R20: info->i = mips->r[20]; break; |
| 569 | case CPUINFO_INT_REGISTER + MIPS3_R21: info->i = mips->r[21]; break; |
| 570 | case CPUINFO_INT_REGISTER + MIPS3_R22: info->i = mips->r[22]; break; |
| 571 | case CPUINFO_INT_REGISTER + MIPS3_R23: info->i = mips->r[23]; break; |
| 572 | case CPUINFO_INT_REGISTER + MIPS3_R24: info->i = mips->r[24]; break; |
| 573 | case CPUINFO_INT_REGISTER + MIPS3_R25: info->i = mips->r[25]; break; |
| 574 | case CPUINFO_INT_REGISTER + MIPS3_R26: info->i = mips->r[26]; break; |
| 575 | case CPUINFO_INT_REGISTER + MIPS3_R27: info->i = mips->r[27]; break; |
| 576 | case CPUINFO_INT_REGISTER + MIPS3_R28: info->i = mips->r[28]; break; |
| 577 | case CPUINFO_INT_REGISTER + MIPS3_R29: info->i = mips->r[29]; break; |
| 578 | case CPUINFO_INT_REGISTER + MIPS3_R30: info->i = mips->r[30]; break; |
| 579 | case CPUINFO_INT_SP: |
| 580 | case CPUINFO_INT_REGISTER + MIPS3_R31: info->i = mips->r[31]; break; |
| 581 | case CPUINFO_INT_REGISTER + MIPS3_HI: info->i = mips->hi; break; |
| 582 | case CPUINFO_INT_REGISTER + MIPS3_LO: info->i = mips->lo; break; |
| 583 | |
| 584 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 585 | case CPUINFO_PTR_SET_INFO: /* provided by core */ break; |
| 586 | case CPUINFO_PTR_GET_CONTEXT: /* provided by core */ break; |
| 587 | case CPUINFO_PTR_SET_CONTEXT: /* provided by core */ break; |
| 588 | case CPUINFO_PTR_INIT: /* provided by core */ break; |
| 589 | case CPUINFO_PTR_RESET: /* provided by core */ break; |
| 590 | case CPUINFO_PTR_EXIT: /* provided by core */ break; |
| 591 | case CPUINFO_PTR_EXECUTE: /* provided by core */ break; |
| 592 | case CPUINFO_PTR_TRANSLATE: /* provided by core */ break; |
| 593 | case CPUINFO_PTR_DISASSEMBLE: /* provided by core */ break; |
| 594 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &mips3_icount; break; |
| 595 | |
| 596 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 597 | case CPUINFO_STR_NAME: strcpy(info->s, "MIPS III"); break; |
| 598 | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "MIPS III"); break; |
| 599 | case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "2.0"); break; |
| 600 | case CPUINFO_STR_CORE_FILE: /* provided by core */ break; |
| 601 | case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright (C) Aaron Giles 2000-2007"); break; |
| 602 | |
| 603 | case CPUINFO_STR_FLAGS: strcpy(info->s, " "); break; |
| 604 | |
| 605 | case CPUINFO_STR_REGISTER + MIPS3_PC: sprintf(info->s, "PC: %08X", mips->pc); break; |
| 606 | case CPUINFO_STR_REGISTER + MIPS3_SR: sprintf(info->s, "SR: %08X", (UINT32)mips->cpr[0][COP0_Status]); break; |
| 607 | case CPUINFO_STR_REGISTER + MIPS3_EPC: sprintf(info->s, "EPC:%08X", (UINT32)mips->cpr[0][COP0_EPC]); break; |
| 608 | case CPUINFO_STR_REGISTER + MIPS3_CAUSE: sprintf(info->s, "Cause:%08X", (UINT32)mips->cpr[0][COP0_Cause]); break; |
| 609 | case CPUINFO_STR_REGISTER + MIPS3_COUNT: sprintf(info->s, "Count:%08X", (UINT32)((activecpu_gettotalcycles64() - mips->count_zero_time) / 2)); break; |
| 610 | case CPUINFO_STR_REGISTER + MIPS3_COMPARE: sprintf(info->s, "Compare:%08X", (UINT32)mips->cpr[0][COP0_Compare]); break; |
| 611 | case CPUINFO_STR_REGISTER + MIPS3_INDEX: sprintf(info->s, "Index:%08X", (UINT32)mips->cpr[0][COP0_Index]); break; |
| 612 | case CPUINFO_STR_REGISTER + MIPS3_RANDOM: sprintf(info->s, "Random:%08X", (UINT32)mips->cpr[0][COP0_Random]); break; |
| 613 | case CPUINFO_STR_REGISTER + MIPS3_ENTRYHI: sprintf(info->s, "EntryHi:%08X%08X", (UINT32)(mips->cpr[0][COP0_EntryHi] >> 32), (UINT32)mips->cpr[0][COP0_EntryHi]); break; |
| 614 | case CPUINFO_STR_REGISTER + MIPS3_ENTRYLO0: sprintf(info->s, "EntryLo0:%08X%08X", (UINT32)(mips->cpr[0][COP0_EntryLo0] >> 32), (UINT32)mips->cpr[0][COP0_EntryLo0]); break; |
| 615 | case CPUINFO_STR_REGISTER + MIPS3_ENTRYLO1: sprintf(info->s, "EntryLo1:%08X%08X", (UINT32)(mips->cpr[0][COP0_EntryLo1] >> 32), (UINT32)mips->cpr[0][COP0_EntryLo1]); break; |
| 616 | case CPUINFO_STR_REGISTER + MIPS3_PAGEMASK: sprintf(info->s, "PageMask:%08X%08X", (UINT32)(mips->cpr[0][COP0_PageMask] >> 32), (UINT32)mips->cpr[0][COP0_PageMask]); break; |
| 617 | case CPUINFO_STR_REGISTER + MIPS3_WIRED: sprintf(info->s, "Wired:%08X", (UINT32)mips->cpr[0][COP0_Wired]); break; |
| 618 | case CPUINFO_STR_REGISTER + MIPS3_BADVADDR: sprintf(info->s, "BadVAddr:%08X", (UINT32)mips->cpr[0][COP0_BadVAddr]); break; |
| 619 | |
| 620 | case CPUINFO_STR_REGISTER + MIPS3_R0: sprintf(info->s, "R0: %08X%08X", (UINT32)(mips->r[0] >> 32), (UINT32)mips->r[0]); break; |
| 621 | case CPUINFO_STR_REGISTER + MIPS3_R1: sprintf(info->s, "R1: %08X%08X", (UINT32)(mips->r[1] >> 32), (UINT32)mips->r[1]); break; |
| 622 | case CPUINFO_STR_REGISTER + MIPS3_R2: sprintf(info->s, "R2: %08X%08X", (UINT32)(mips->r[2] >> 32), (UINT32)mips->r[2]); break; |
| 623 | case CPUINFO_STR_REGISTER + MIPS3_R3: sprintf(info->s, "R3: %08X%08X", (UINT32)(mips->r[3] >> 32), (UINT32)mips->r[3]); break; |
| 624 | case CPUINFO_STR_REGISTER + MIPS3_R4: sprintf(info->s, "R4: %08X%08X", (UINT32)(mips->r[4] >> 32), (UINT32)mips->r[4]); break; |
| 625 | case CPUINFO_STR_REGISTER + MIPS3_R5: sprintf(info->s, "R5: %08X%08X", (UINT32)(mips->r[5] >> 32), (UINT32)mips->r[5]); break; |
| 626 | case CPUINFO_STR_REGISTER + MIPS3_R6: sprintf(info->s, "R6: %08X%08X", (UINT32)(mips->r[6] >> 32), (UINT32)mips->r[6]); break; |
| 627 | case CPUINFO_STR_REGISTER + MIPS3_R7: sprintf(info->s, "R7: %08X%08X", (UINT32)(mips->r[7] >> 32), (UINT32)mips->r[7]); break; |
| 628 | case CPUINFO_STR_REGISTER + MIPS3_R8: sprintf(info->s, "R8: %08X%08X", (UINT32)(mips->r[8] >> 32), (UINT32)mips->r[8]); break; |
| 629 | case CPUINFO_STR_REGISTER + MIPS3_R9: sprintf(info->s, "R9: %08X%08X", (UINT32)(mips->r[9] >> 32), (UINT32)mips->r[9]); break; |
| 630 | case CPUINFO_STR_REGISTER + MIPS3_R10: sprintf(info->s, "R10:%08X%08X", (UINT32)(mips->r[10] >> 32), (UINT32)mips->r[10]); break; |
| 631 | case CPUINFO_STR_REGISTER + MIPS3_R11: sprintf(info->s, "R11:%08X%08X", (UINT32)(mips->r[11] >> 32), (UINT32)mips->r[11]); break; |
| 632 | case CPUINFO_STR_REGISTER + MIPS3_R12: sprintf(info->s, "R12:%08X%08X", (UINT32)(mips->r[12] >> 32), (UINT32)mips->r[12]); break; |
| 633 | case CPUINFO_STR_REGISTER + MIPS3_R13: sprintf(info->s, "R13:%08X%08X", (UINT32)(mips->r[13] >> 32), (UINT32)mips->r[13]); break; |
| 634 | case CPUINFO_STR_REGISTER + MIPS3_R14: sprintf(info->s, "R14:%08X%08X", (UINT32)(mips->r[14] >> 32), (UINT32)mips->r[14]); break; |
| 635 | case CPUINFO_STR_REGISTER + MIPS3_R15: sprintf(info->s, "R15:%08X%08X", (UINT32)(mips->r[15] >> 32), (UINT32)mips->r[15]); break; |
| 636 | case CPUINFO_STR_REGISTER + MIPS3_R16: sprintf(info->s, "R16:%08X%08X", (UINT32)(mips->r[16] >> 32), (UINT32)mips->r[16]); break; |
| 637 | case CPUINFO_STR_REGISTER + MIPS3_R17: sprintf(info->s, "R17:%08X%08X", (UINT32)(mips->r[17] >> 32), (UINT32)mips->r[17]); break; |
| 638 | case CPUINFO_STR_REGISTER + MIPS3_R18: sprintf(info->s, "R18:%08X%08X", (UINT32)(mips->r[18] >> 32), (UINT32)mips->r[18]); break; |
| 639 | case CPUINFO_STR_REGISTER + MIPS3_R19: sprintf(info->s, "R19:%08X%08X", (UINT32)(mips->r[19] >> 32), (UINT32)mips->r[19]); break; |
| 640 | case CPUINFO_STR_REGISTER + MIPS3_R20: sprintf(info->s, "R20:%08X%08X", (UINT32)(mips->r[20] >> 32), (UINT32)mips->r[20]); break; |
| 641 | case CPUINFO_STR_REGISTER + MIPS3_R21: sprintf(info->s, "R21:%08X%08X", (UINT32)(mips->r[21] >> 32), (UINT32)mips->r[21]); break; |
| 642 | case CPUINFO_STR_REGISTER + MIPS3_R22: sprintf(info->s, "R22:%08X%08X", (UINT32)(mips->r[22] >> 32), (UINT32)mips->r[22]); break; |
| 643 | case CPUINFO_STR_REGISTER + MIPS3_R23: sprintf(info->s, "R23:%08X%08X", (UINT32)(mips->r[23] >> 32), (UINT32)mips->r[23]); break; |
| 644 | case CPUINFO_STR_REGISTER + MIPS3_R24: sprintf(info->s, "R24:%08X%08X", (UINT32)(mips->r[24] >> 32), (UINT32)mips->r[24]); break; |
| 645 | case CPUINFO_STR_REGISTER + MIPS3_R25: sprintf(info->s, "R25:%08X%08X", (UINT32)(mips->r[25] >> 32), (UINT32)mips->r[25]); break; |
| 646 | case CPUINFO_STR_REGISTER + MIPS3_R26: sprintf(info->s, "R26:%08X%08X", (UINT32)(mips->r[26] >> 32), (UINT32)mips->r[26]); break; |
| 647 | case CPUINFO_STR_REGISTER + MIPS3_R27: sprintf(info->s, "R27:%08X%08X", (UINT32)(mips->r[27] >> 32), (UINT32)mips->r[27]); break; |
| 648 | case CPUINFO_STR_REGISTER + MIPS3_R28: sprintf(info->s, "R28:%08X%08X", (UINT32)(mips->r[28] >> 32), (UINT32)mips->r[28]); break; |
| 649 | case CPUINFO_STR_REGISTER + MIPS3_R29: sprintf(info->s, "R29:%08X%08X", (UINT32)(mips->r[29] >> 32), (UINT32)mips->r[29]); break; |
| 650 | case CPUINFO_STR_REGISTER + MIPS3_R30: sprintf(info->s, "R30:%08X%08X", (UINT32)(mips->r[30] >> 32), (UINT32)mips->r[30]); break; |
| 651 | case CPUINFO_STR_REGISTER + MIPS3_R31: sprintf(info->s, "R31:%08X%08X", (UINT32)(mips->r[31] >> 32), (UINT32)mips->r[31]); break; |
| 652 | case CPUINFO_STR_REGISTER + MIPS3_HI: sprintf(info->s, "HI: %08X%08X", (UINT32)(mips->hi >> 32), (UINT32)mips->hi); break; |
| 653 | case CPUINFO_STR_REGISTER + MIPS3_LO: sprintf(info->s, "LO: %08X%08X", (UINT32)(mips->lo >> 32), (UINT32)mips->lo); break; |
| 654 | |
| 655 | case CPUINFO_STR_REGISTER + MIPS3_FPR0: sprintf(info->s, "FPR0: %08X%08X", (UINT32)(mips->cpr[1][0] >> 32), (UINT32)mips->cpr[1][0]); break; |
| 656 | case CPUINFO_STR_REGISTER + MIPS3_FPR1: sprintf(info->s, "FPR1: %08X%08X", (UINT32)(mips->cpr[1][1] >> 32), (UINT32)mips->cpr[1][1]); break; |
| 657 | case CPUINFO_STR_REGISTER + MIPS3_FPR2: sprintf(info->s, "FPR2: %08X%08X", (UINT32)(mips->cpr[1][2] >> 32), (UINT32)mips->cpr[1][2]); break; |
| 658 | case CPUINFO_STR_REGISTER + MIPS3_FPR3: sprintf(info->s, "FPR3: %08X%08X", (UINT32)(mips->cpr[1][3] >> 32), (UINT32)mips->cpr[1][3]); break; |
| 659 | case CPUINFO_STR_REGISTER + MIPS3_FPR4: sprintf(info->s, "FPR4: %08X%08X", (UINT32)(mips->cpr[1][4] >> 32), (UINT32)mips->cpr[1][4]); break; |
| 660 | case CPUINFO_STR_REGISTER + MIPS3_FPR5: sprintf(info->s, "FPR5: %08X%08X", (UINT32)(mips->cpr[1][5] >> 32), (UINT32)mips->cpr[1][5]); break; |
| 661 | case CPUINFO_STR_REGISTER + MIPS3_FPR6: sprintf(info->s, "FPR6: %08X%08X", (UINT32)(mips->cpr[1][6] >> 32), (UINT32)mips->cpr[1][6]); break; |
| 662 | case CPUINFO_STR_REGISTER + MIPS3_FPR7: sprintf(info->s, "FPR7: %08X%08X", (UINT32)(mips->cpr[1][7] >> 32), (UINT32)mips->cpr[1][7]); break; |
| 663 | case CPUINFO_STR_REGISTER + MIPS3_FPR8: sprintf(info->s, "FPR8: %08X%08X", (UINT32)(mips->cpr[1][8] >> 32), (UINT32)mips->cpr[1][8]); break; |
| 664 | case CPUINFO_STR_REGISTER + MIPS3_FPR9: sprintf(info->s, "FPR9: %08X%08X", (UINT32)(mips->cpr[1][9] >> 32), (UINT32)mips->cpr[1][9]); break; |
| 665 | case CPUINFO_STR_REGISTER + MIPS3_FPR10: sprintf(info->s, "FPR10:%08X%08X", (UINT32)(mips->cpr[1][10] >> 32), (UINT32)mips->cpr[1][10]); break; |
| 666 | case CPUINFO_STR_REGISTER + MIPS3_FPR11: sprintf(info->s, "FPR11:%08X%08X", (UINT32)(mips->cpr[1][11] >> 32), (UINT32)mips->cpr[1][11]); break; |
| 667 | case CPUINFO_STR_REGISTER + MIPS3_FPR12: sprintf(info->s, "FPR12:%08X%08X", (UINT32)(mips->cpr[1][12] >> 32), (UINT32)mips->cpr[1][12]); break; |
| 668 | case CPUINFO_STR_REGISTER + MIPS3_FPR13: sprintf(info->s, "FPR13:%08X%08X", (UINT32)(mips->cpr[1][13] >> 32), (UINT32)mips->cpr[1][13]); break; |
| 669 | case CPUINFO_STR_REGISTER + MIPS3_FPR14: sprintf(info->s, "FPR14:%08X%08X", (UINT32)(mips->cpr[1][14] >> 32), (UINT32)mips->cpr[1][14]); break; |
| 670 | case CPUINFO_STR_REGISTER + MIPS3_FPR15: sprintf(info->s, "FPR15:%08X%08X", (UINT32)(mips->cpr[1][15] >> 32), (UINT32)mips->cpr[1][15]); break; |
| 671 | case CPUINFO_STR_REGISTER + MIPS3_FPR16: sprintf(info->s, "FPR16:%08X%08X", (UINT32)(mips->cpr[1][16] >> 32), (UINT32)mips->cpr[1][16]); break; |
| 672 | case CPUINFO_STR_REGISTER + MIPS3_FPR17: sprintf(info->s, "FPR17:%08X%08X", (UINT32)(mips->cpr[1][17] >> 32), (UINT32)mips->cpr[1][17]); break; |
| 673 | case CPUINFO_STR_REGISTER + MIPS3_FPR18: sprintf(info->s, "FPR18:%08X%08X", (UINT32)(mips->cpr[1][18] >> 32), (UINT32)mips->cpr[1][18]); break; |
| 674 | case CPUINFO_STR_REGISTER + MIPS3_FPR19: sprintf(info->s, "FPR19:%08X%08X", (UINT32)(mips->cpr[1][19] >> 32), (UINT32)mips->cpr[1][19]); break; |
| 675 | case CPUINFO_STR_REGISTER + MIPS3_FPR20: sprintf(info->s, "FPR20:%08X%08X", (UINT32)(mips->cpr[1][20] >> 32), (UINT32)mips->cpr[1][20]); break; |
| 676 | case CPUINFO_STR_REGISTER + MIPS3_FPR21: sprintf(info->s, "FPR21:%08X%08X", (UINT32)(mips->cpr[1][21] >> 32), (UINT32)mips->cpr[1][21]); break; |
| 677 | case CPUINFO_STR_REGISTER + MIPS3_FPR22: sprintf(info->s, "FPR22:%08X%08X", (UINT32)(mips->cpr[1][22] >> 32), (UINT32)mips->cpr[1][22]); break; |
| 678 | case CPUINFO_STR_REGISTER + MIPS3_FPR23: sprintf(info->s, "FPR23:%08X%08X", (UINT32)(mips->cpr[1][23] >> 32), (UINT32)mips->cpr[1][23]); break; |
| 679 | case CPUINFO_STR_REGISTER + MIPS3_FPR24: sprintf(info->s, "FPR24:%08X%08X", (UINT32)(mips->cpr[1][24] >> 32), (UINT32)mips->cpr[1][24]); break; |
| 680 | case CPUINFO_STR_REGISTER + MIPS3_FPR25: sprintf(info->s, "FPR25:%08X%08X", (UINT32)(mips->cpr[1][25] >> 32), (UINT32)mips->cpr[1][25]); break; |
| 681 | case CPUINFO_STR_REGISTER + MIPS3_FPR26: sprintf(info->s, "FPR26:%08X%08X", (UINT32)(mips->cpr[1][26] >> 32), (UINT32)mips->cpr[1][26]); break; |
| 682 | case CPUINFO_STR_REGISTER + MIPS3_FPR27: sprintf(info->s, "FPR27:%08X%08X", (UINT32)(mips->cpr[1][27] >> 32), (UINT32)mips->cpr[1][27]); break; |
| 683 | case CPUINFO_STR_REGISTER + MIPS3_FPR28: sprintf(info->s, "FPR28:%08X%08X", (UINT32)(mips->cpr[1][28] >> 32), (UINT32)mips->cpr[1][28]); break; |
| 684 | case CPUINFO_STR_REGISTER + MIPS3_FPR29: sprintf(info->s, "FPR29:%08X%08X", (UINT32)(mips->cpr[1][29] >> 32), (UINT32)mips->cpr[1][29]); break; |
| 685 | case CPUINFO_STR_REGISTER + MIPS3_FPR30: sprintf(info->s, "FPR30:%08X%08X", (UINT32)(mips->cpr[1][30] >> 32), (UINT32)mips->cpr[1][30]); break; |
| 686 | case CPUINFO_STR_REGISTER + MIPS3_FPR31: sprintf(info->s, "FPR31:%08X%08X", (UINT32)(mips->cpr[1][31] >> 32), (UINT32)mips->cpr[1][31]); break; |
| 687 | } |
| 688 | } |
| 689 | |
| 690 | |
| 691 | /*************************************************************************** |
| 692 | INTERNAL HELPERS |
| 693 | ***************************************************************************/ |
| 694 | |
| 695 | /*------------------------------------------------- |
| 696 | compare_int_callback - callback that fires |
| 697 | whenever a compare interrupt is generated |
| 698 | -------------------------------------------------*/ |
| 699 | |
| 700 | static TIMER_CALLBACK( compare_int_callback ) |
| 701 | { |
| 702 | cpunum_set_input_line(param, MIPS3_IRQ5, ASSERT_LINE); |
| 703 | } |
| 704 | |
| 705 | |
| 706 | /*------------------------------------------------- |
| 707 | compute_config_register - compute the value |
| 708 | of the config register |
| 709 | -------------------------------------------------*/ |
| 710 | |
| 711 | static UINT32 compute_config_register(const mips3_state *mips) |
| 712 | { |
| 713 | /* set the cache line size to 32 bytes */ |
| 714 | UINT32 configreg = 0x00026030; |
| 715 | int divisor; |
| 716 | |
| 717 | /* set the data cache size */ |
| 718 | if (mips->icache_size <= 0x01000) configreg |= 0 << 6; |
| 719 | else if (mips->icache_size <= 0x02000) configreg |= 1 << 6; |
| 720 | else if (mips->icache_size <= 0x04000) configreg |= 2 << 6; |
| 721 | else if (mips->icache_size <= 0x08000) configreg |= 3 << 6; |
| 722 | else if (mips->icache_size <= 0x10000) configreg |= 4 << 6; |
| 723 | else if (mips->icache_size <= 0x20000) configreg |= 5 << 6; |
| 724 | else if (mips->icache_size <= 0x40000) configreg |= 6 << 6; |
| 725 | else configreg |= 7 << 6; |
| 726 | |
| 727 | /* set the instruction cache size */ |
| 728 | if (mips->icache_size <= 0x01000) configreg |= 0 << 9; |
| 729 | else if (mips->icache_size <= 0x02000) configreg |= 1 << 9; |
| 730 | else if (mips->icache_size <= 0x04000) configreg |= 2 << 9; |
| 731 | else if (mips->icache_size <= 0x08000) configreg |= 3 << 9; |
| 732 | else if (mips->icache_size <= 0x10000) configreg |= 4 << 9; |
| 733 | else if (mips->icache_size <= 0x20000) configreg |= 5 << 9; |
| 734 | else if (mips->icache_size <= 0x40000) configreg |= 6 << 9; |
| 735 | else configreg |= 7 << 9; |
| 736 | |
| 737 | /* set the endianness bit */ |
| 738 | if (mips->bigendian) |
| 739 | configreg |= 0x00008000; |
| 740 | |
| 741 | /* set the system clock divider */ |
| 742 | divisor = 2; |
| 743 | if (mips->system_clock != 0) |
| 744 | { |
| 745 | divisor = mips->cpu_clock / mips->system_clock; |
| 746 | if (mips->system_clock * divisor != mips->cpu_clock) |
| 747 | { |
| 748 | configreg |= 0x80000000; |
| 749 | divisor = mips->cpu_clock * 2 / mips->system_clock; |
| 750 | } |
| 751 | } |
| 752 | configreg |= (((divisor < 2) ? 2 : (divisor > 8) ? 8 : divisor) - 2) << 28; |
| 753 | |
| 754 | return configreg; |
| 755 | } |
| 756 | |
| 757 | |
| 758 | /*------------------------------------------------- |
| 759 | compute_prid_register - compute the value |
| 760 | of the PRId register |
| 761 | -------------------------------------------------*/ |
| 762 | |
| 763 | static UINT32 compute_prid_register(const mips3_state *mips) |
| 764 | { |
| 765 | switch (mips->flavor) |
| 766 | { |
| 767 | case MIPS3_TYPE_R4600: |
| 768 | case MIPS3_TYPE_R4650: |
| 769 | return 0x2000; |
| 770 | |
| 771 | case MIPS3_TYPE_R4700: |
| 772 | return 0x2100; |
| 773 | |
| 774 | case MIPS3_TYPE_R5000: |
| 775 | case MIPS3_TYPE_QED5271: |
| 776 | return 0x2300; |
| 777 | |
| 778 | case MIPS3_TYPE_RM7000: |
| 779 | return 0x2700; |
| 780 | |
| 781 | default: |
| 782 | fatalerror("Unknown MIPS flavor specified"); |
| 783 | } |
| 784 | return 0x2000; |
| 785 | } |
| 786 | |
| 787 | |
| 788 | /*------------------------------------------------- |
| 789 | tlb_write_common - common routine for writing |
| 790 | a TLB entry |
| 791 | -------------------------------------------------*/ |
| 792 | |
| 793 | static void tlb_write_common(mips3_state *mips, int index) |
| 794 | { |
| 795 | /* only handle entries within the TLB */ |
| 796 | if (index < ARRAY_LENGTH(mips->tlb)) |
| 797 | { |
| 798 | mips3_tlb_entry *tlbent = &mips->tlb[index]; |
| 799 | |
| 800 | /* unmap what we have */ |
| 801 | mips3com_unmap_tlb_entries(mips); |
| 802 | |
| 803 | /* fill in the new TLB entry from the COP0 registers */ |
| 804 | tlbent->page_mask = mips->cpr[0][COP0_PageMask]; |
| 805 | tlbent->entry_hi = mips->cpr[0][COP0_EntryHi] & ~(tlbent->page_mask & U64(0x0000000001ffe000)); |
| 806 | tlbent->entry_lo[0] = mips->cpr[0][COP0_EntryLo0]; |
| 807 | tlbent->entry_lo[1] = mips->cpr[0][COP0_EntryLo1]; |
| 808 | |
| 809 | /* remap the TLB */ |
| 810 | mips3com_map_tlb_entries(mips); |
| 811 | |
| 812 | /* log the two halves once they are in */ |
| 813 | tlb_entry_log_half(tlbent, index, 0); |
| 814 | tlb_entry_log_half(tlbent, index, 1); |
| 815 | } |
| 816 | } |
| 817 | |
| 818 | |
| 819 | /*------------------------------------------------- |
| 820 | tlb_entry_log_half - log half of a single TLB |
| 821 | entry |
| 822 | -------------------------------------------------*/ |
| 823 | |
| 824 | static void tlb_entry_log_half(mips3_tlb_entry *tlbent, int index, int which) |
| 825 | { |
| 826 | #if PRINTF_TLB |
| 827 | UINT64 hi = tlbent->entry_hi; |
| 828 | UINT64 lo = tlbent->entry_lo[which]; |
| 829 | UINT32 vpn = (((hi >> 13) & 0x07ffffff) << 1); |
| 830 | UINT32 asid = hi & 0xff; |
| 831 | UINT32 r = (hi >> 62) & 3; |
| 832 | UINT32 pfn = (lo >> 6) & 0x00ffffff; |
| 833 | UINT32 c = (lo >> 3) & 7; |
| 834 | UINT32 pagesize = (((tlbent->page_mask >> 13) & 0xfff) + 1) << MIPS3_MIN_PAGE_SHIFT; |
| 835 | UINT64 vaddr = (UINT64)vpn * MIPS3_MIN_PAGE_SIZE; |
| 836 | UINT64 paddr = (UINT64)pfn * MIPS3_MIN_PAGE_SIZE; |
| 837 | |
| 838 | vaddr += pagesize * which; |
| 839 | |
| 840 | mame_printf_debug("index=%08X pagesize=%08X vaddr=%08X%08X paddr=%08X%08X asid=%02X r=%X c=%X dvg=%c%c%c\n", |
| 841 | index, pagesize, (UINT32)(vaddr >> 32), (UINT32)vaddr, (UINT32)(paddr >> 32), (UINT32)paddr, |
| 842 | asid, r, c, (lo & 4) ? 'd' : '.', (lo & 2) ? 'v' : '.', (hi & 0x1000) ? 'g' : '.'); |
| 843 | #endif |
| 844 | } |
| 845 | |
| 846 | |
| 847 | |
| 848 | /*************************************************************************** |
| 849 | DOUBLEWORD READS/WRITES |
| 850 | ***************************************************************************/ |
| 851 | |
| 852 | /*------------------------------------------------- |
| 853 | program_read_qword_32be - read a 64-bit |
| 854 | big-endian value |
| 855 | -------------------------------------------------*/ |
| 856 | |
| 857 | static UINT64 program_read_qword_32be(offs_t offset) |
| 858 | { |
| 859 | UINT64 result = (UINT64)program_read_dword_32be(offset) << 32; |
| 860 | return result | program_read_dword_32be(offset + 4); |
| 861 | } |
| 862 | |
| 863 | |
| 864 | /*------------------------------------------------- |
| 865 | program_read_qword_32le - read a 64-bit |
| 866 | little-endian value |
| 867 | -------------------------------------------------*/ |
| 868 | |
| 869 | static UINT64 program_read_qword_32le(offs_t offset) |
| 870 | { |
| 871 | UINT64 result = program_read_dword_32le(offset); |
| 872 | return result | ((UINT64)program_read_dword_32le(offset + 4) << 32); |
| 873 | } |
| 874 | |
| 875 | |
| 876 | /*------------------------------------------------- |
| 877 | program_write_qword_32be - write a 64-bit |
| 878 | big-endian value |
| 879 | -------------------------------------------------*/ |
| 880 | |
| 881 | static void program_write_qword_32be(offs_t offset, UINT64 data) |
| 882 | { |
| 883 | program_write_dword_32be(offset, data >> 32); |
| 884 | program_write_dword_32be(offset + 4, data); |
| 885 | } |
| 886 | |
| 887 | |
| 888 | /*------------------------------------------------- |
| 889 | program_write_qword_32le - write a 64-bit |
| 890 | little-endian value |
| 891 | -------------------------------------------------*/ |
| 892 | |
| 893 | static void program_write_qword_32le(offs_t offset, UINT64 data) |
| 894 | { |
| 895 | program_write_dword_32le(offset, data); |
| 896 | program_write_dword_32le(offset + 4, data >> 32); |
| 897 | } |
src/emu/cpu/mips/mips3.c
| r869 | r870 | |
| 12 | 12 | #include <math.h> |
| 13 | 13 | #include "cpuintrf.h" |
| 14 | 14 | #include "debugger.h" |
| 15 | | #include "mips3.h" |
| 15 | #include "mips3com.h" |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | #define ENABLE_OVERFLOWS 0 |
| 19 | | #define PRINTF_TLB 0 |
| 20 | 19 | |
| 21 | 20 | |
| 22 | 21 | /*************************************************************************** |
| 23 | | CONSTANTS |
| 24 | | ***************************************************************************/ |
| 25 | | |
| 26 | | /* COP0 registers */ |
| 27 | | #define COP0_Index 0 |
| 28 | | #define COP0_Random 1 |
| 29 | | #define COP0_EntryLo 2 |
| 30 | | #define COP0_EntryLo0 2 |
| 31 | | #define COP0_EntryLo1 3 |
| 32 | | #define COP0_Context 4 |
| 33 | | #define COP0_PageMask 5 |
| 34 | | #define COP0_Wired 6 |
| 35 | | #define COP0_BadVAddr 8 |
| 36 | | #define COP0_Count 9 |
| 37 | | #define COP0_EntryHi 10 |
| 38 | | #define COP0_Compare 11 |
| 39 | | #define COP0_Status 12 |
| 40 | | #define COP0_Cause 13 |
| 41 | | #define COP0_EPC 14 |
| 42 | | #define COP0_PRId 15 |
| 43 | | #define COP0_Config 16 |
| 44 | | #define COP0_XContext 20 |
| 45 | | |
| 46 | | /* Status register bits */ |
| 47 | | #define SR_IE 0x00000001 |
| 48 | | #define SR_EXL 0x00000002 |
| 49 | | #define SR_ERL 0x00000004 |
| 50 | | #define SR_KSU_MASK 0x00000018 |
| 51 | | #define SR_KSU_KERNEL 0x00000000 |
| 52 | | #define SR_KSU_SUPERVISOR 0x00000008 |
| 53 | | #define SR_KSU_USER 0x00000010 |
| 54 | | #define SR_IMSW0 0x00000100 |
| 55 | | #define SR_IMSW1 0x00000200 |
| 56 | | #define SR_IMEX0 0x00000400 |
| 57 | | #define SR_IMEX1 0x00000800 |
| 58 | | #define SR_IMEX2 0x00001000 |
| 59 | | #define SR_IMEX3 0x00002000 |
| 60 | | #define SR_IMEX4 0x00004000 |
| 61 | | #define SR_IMEX5 0x00008000 |
| 62 | | #define SR_DE 0x00010000 |
| 63 | | #define SR_CE 0x00020000 |
| 64 | | #define SR_CH 0x00040000 |
| 65 | | #define SR_SR 0x00100000 |
| 66 | | #define SR_TS 0x00200000 |
| 67 | | #define SR_BEV 0x00400000 |
| 68 | | #define SR_RE 0x02000000 |
| 69 | | #define SR_FR 0x04000000 |
| 70 | | #define SR_RP 0x08000000 |
| 71 | | #define SR_COP0 0x10000000 |
| 72 | | #define SR_COP1 0x20000000 |
| 73 | | #define SR_COP2 0x40000000 |
| 74 | | #define SR_COP3 0x80000000 |
| 75 | | |
| 76 | | /* exception types */ |
| 77 | | #define EXCEPTION_INTERRUPT 0 |
| 78 | | #define EXCEPTION_TLBMOD 1 |
| 79 | | #define EXCEPTION_TLBLOAD 2 |
| 80 | | #define EXCEPTION_TLBSTORE 3 |
| 81 | | #define EXCEPTION_ADDRLOAD 4 |
| 82 | | #define EXCEPTION_ADDRSTORE 5 |
| 83 | | #define EXCEPTION_BUSINST 6 |
| 84 | | #define EXCEPTION_BUSDATA 7 |
| 85 | | #define EXCEPTION_SYSCALL 8 |
| 86 | | #define EXCEPTION_BREAK 9 |
| 87 | | #define EXCEPTION_INVALIDOP 10 |
| 88 | | #define EXCEPTION_BADCOP 11 |
| 89 | | #define EXCEPTION_OVERFLOW 12 |
| 90 | | #define EXCEPTION_TRAP 13 |
| 91 | | |
| 92 | | |
| 93 | | |
| 94 | | /*************************************************************************** |
| 95 | 22 | HELPER MACROS |
| 96 | 23 | ***************************************************************************/ |
| 97 | 24 | |
| 98 | | #define RSREG ((op >> 21) & 31) |
| 99 | | #define RTREG ((op >> 16) & 31) |
| 100 | | #define RDREG ((op >> 11) & 31) |
| 101 | | #define SHIFT ((op >> 6) & 31) |
| 25 | #define RSVAL32 ((UINT32)mips3.core.r[RSREG]) |
| 26 | #define RTVAL32 ((UINT32)mips3.core.r[RTREG]) |
| 27 | #define RDVAL32 ((UINT32)mips3.core.r[RDREG]) |
| 102 | 28 | |
| 103 | | #define RSVAL32 ((UINT32)mips3.r[RSREG]) |
| 104 | | #define RTVAL32 ((UINT32)mips3.r[RTREG]) |
| 105 | | #define RDVAL32 ((UINT32)mips3.r[RDREG]) |
| 29 | #define RSVAL64 (mips3.core.r[RSREG]) |
| 30 | #define RTVAL64 (mips3.core.r[RTREG]) |
| 31 | #define RDVAL64 (mips3.core.r[RDREG]) |
| 106 | 32 | |
| 107 | | #define RSVAL64 (mips3.r[RSREG]) |
| 108 | | #define RTVAL64 (mips3.r[RTREG]) |
| 109 | | #define RDVAL64 (mips3.r[RDREG]) |
| 33 | #define FRVALS_FR0 (((float *)&mips3.core.cpr[1][0])[FRREG]) |
| 34 | #define FTVALS_FR0 (((float *)&mips3.core.cpr[1][0])[FTREG]) |
| 35 | #define FSVALS_FR0 (((float *)&mips3.core.cpr[1][0])[FSREG]) |
| 36 | #define FDVALS_FR0 (((float *)&mips3.core.cpr[1][0])[FDREG]) |
| 37 | #define FSVALW_FR0 (((UINT32 *)&mips3.core.cpr[1][0])[FSREG]) |
| 38 | #define FDVALW_FR0 (((UINT32 *)&mips3.core.cpr[1][0])[FDREG]) |
| 110 | 39 | |
| 111 | | #define FRREG ((op >> 21) & 31) |
| 112 | | #define FTREG ((op >> 16) & 31) |
| 113 | | #define FSREG ((op >> 11) & 31) |
| 114 | | #define FDREG ((op >> 6) & 31) |
| 40 | #define FRVALD_FR0 (*(double *)&mips3.core.cpr[1][FRREG/2]) |
| 41 | #define FTVALD_FR0 (*(double *)&mips3.core.cpr[1][FTREG/2]) |
| 42 | #define FSVALD_FR0 (*(double *)&mips3.core.cpr[1][FSREG/2]) |
| 43 | #define FDVALD_FR0 (*(double *)&mips3.core.cpr[1][FDREG/2]) |
| 44 | #define FSVALL_FR0 (((UINT64 *)&mips3.core.cpr[1][0])[FSREG/2]) |
| 45 | #define FDVALL_FR0 (((UINT64 *)&mips3.core.cpr[1][0])[FDREG/2]) |
| 115 | 46 | |
| 116 | | #define FRVALS_FR0 (((float *)&mips3.cpr[1][0])[FRREG]) |
| 117 | | #define FTVALS_FR0 (((float *)&mips3.cpr[1][0])[FTREG]) |
| 118 | | #define FSVALS_FR0 (((float *)&mips3.cpr[1][0])[FSREG]) |
| 119 | | #define FDVALS_FR0 (((float *)&mips3.cpr[1][0])[FDREG]) |
| 120 | | #define FSVALW_FR0 (((UINT32 *)&mips3.cpr[1][0])[FSREG]) |
| 121 | | #define FDVALW_FR0 (((UINT32 *)&mips3.cpr[1][0])[FDREG]) |
| 47 | #define FRVALS_FR1 (((float *)&mips3.core.cpr[1][FRREG])[BYTE_XOR_LE(0)]) |
| 48 | #define FTVALS_FR1 (((float *)&mips3.core.cpr[1][FTREG])[BYTE_XOR_LE(0)]) |
| 49 | #define FSVALS_FR1 (((float *)&mips3.core.cpr[1][FSREG])[BYTE_XOR_LE(0)]) |
| 50 | #define FDVALS_FR1 (((float *)&mips3.core.cpr[1][FDREG])[BYTE_XOR_LE(0)]) |
| 51 | #define FSVALW_FR1 (((UINT32 *)&mips3.core.cpr[1][FSREG])[BYTE_XOR_LE(0)]) |
| 52 | #define FDVALW_FR1 (((UINT32 *)&mips3.core.cpr[1][FDREG])[BYTE_XOR_LE(0)]) |
| 122 | 53 | |
| 123 | | #define FRVALD_FR0 (*(double *)&mips3.cpr[1][FRREG/2]) |
| 124 | | #define FTVALD_FR0 (*(double *)&mips3.cpr[1][FTREG/2]) |
| 125 | | #define FSVALD_FR0 (*(double *)&mips3.cpr[1][FSREG/2]) |
| 126 | | #define FDVALD_FR0 (*(double *)&mips3.cpr[1][FDREG/2]) |
| 127 | | #define FSVALL_FR0 (((UINT64 *)&mips3.cpr[1][0])[FSREG/2]) |
| 128 | | #define FDVALL_FR0 (((UINT64 *)&mips3.cpr[1][0])[FDREG/2]) |
| 54 | #define FRVALD_FR1 (*(double *)&mips3.core.cpr[1][FRREG]) |
| 55 | #define FTVALD_FR1 (*(double *)&mips3.core.cpr[1][FTREG]) |
| 56 | #define FSVALD_FR1 (*(double *)&mips3.core.cpr[1][FSREG]) |
| 57 | #define FDVALD_FR1 (*(double *)&mips3.core.cpr[1][FDREG]) |
| 58 | #define FSVALL_FR1 (*(UINT64 *)&mips3.core.cpr[1][FSREG]) |
| 59 | #define FDVALL_FR1 (*(UINT64 *)&mips3.core.cpr[1][FDREG]) |
| 129 | 60 | |
| 130 | | #define FRVALS_FR1 (((float *)&mips3.cpr[1][FRREG])[BYTE_XOR_LE(0)]) |
| 131 | | #define FTVALS_FR1 (((float *)&mips3.cpr[1][FTREG])[BYTE_XOR_LE(0)]) |
| 132 | | #define FSVALS_FR1 (((float *)&mips3.cpr[1][FSREG])[BYTE_XOR_LE(0)]) |
| 133 | | #define FDVALS_FR1 (((float *)&mips3.cpr[1][FDREG])[BYTE_XOR_LE(0)]) |
| 134 | | #define FSVALW_FR1 (((UINT32 *)&mips3.cpr[1][FSREG])[BYTE_XOR_LE(0)]) |
| 135 | | #define FDVALW_FR1 (((UINT32 *)&mips3.cpr[1][FDREG])[BYTE_XOR_LE(0)]) |
| 136 | | |
| 137 | | #define FRVALD_FR1 (*(double *)&mips3.cpr[1][FRREG]) |
| 138 | | #define FTVALD_FR1 (*(double *)&mips3.cpr[1][FTREG]) |
| 139 | | #define FSVALD_FR1 (*(double *)&mips3.cpr[1][FSREG]) |
| 140 | | #define FDVALD_FR1 (*(double *)&mips3.cpr[1][FDREG]) |
| 141 | | #define FSVALL_FR1 (*(UINT64 *)&mips3.cpr[1][FSREG]) |
| 142 | | #define FDVALL_FR1 (*(UINT64 *)&mips3.cpr[1][FDREG]) |
| 143 | | |
| 144 | | #define IS_SINGLE(o) (((o) & (1 << 21)) == 0) |
| 145 | | #define IS_DOUBLE(o) (((o) & (1 << 21)) != 0) |
| 146 | | #define IS_FLOAT(o) (((o) & (1 << 23)) == 0) |
| 147 | | #define IS_INTEGRAL(o) (((o) & (1 << 23)) != 0) |
| 148 | | |
| 149 | | #define SIMMVAL ((INT16)op) |
| 150 | | #define UIMMVAL ((UINT16)op) |
| 151 | | #define LIMMVAL (op & 0x03ffffff) |
| 152 | | |
| 153 | | #define ADDPC(x) mips3.nextpc = mips3.pc + ((x) << 2) |
| 154 | | #define ADDPCL(x,l) { mips3.nextpc = mips3.pc + ((x) << 2); mips3.r[l] = mips3.pc + 4; } |
| 155 | | #define ABSPC(x) mips3.nextpc = (mips3.pc & 0xf0000000) | ((x) << 2) |
| 156 | | #define ABSPCL(x,l) { mips3.nextpc = (mips3.pc & 0xf0000000) | ((x) << 2); mips3.r[l] = mips3.pc + 4; } |
| 61 | #define ADDPC(x) mips3.nextpc = mips3.core.pc + ((x) << 2) |
| 62 | #define ADDPCL(x,l) { mips3.nextpc = mips3.core.pc + ((x) << 2); mips3.core.r[l] = mips3.core.pc + 4; } |
| 63 | #define ABSPC(x) mips3.nextpc = (mips3.core.pc & 0xf0000000) | ((x) << 2) |
| 64 | #define ABSPCL(x,l) { mips3.nextpc = (mips3.core.pc & 0xf0000000) | ((x) << 2); mips3.core.r[l] = mips3.core.pc + 4; } |
| 157 | 65 | #define SETPC(x) mips3.nextpc = (x) |
| 158 | | #define SETPCL(x,l) { mips3.nextpc = (x); mips3.r[l] = mips3.pc + 4; } |
| 66 | #define SETPCL(x,l) { mips3.nextpc = (x); mips3.core.r[l] = mips3.core.pc + 4; } |
| 159 | 67 | |
| 160 | | #define HIVAL (UINT32)mips3.hi |
| 161 | | #define LOVAL (UINT32)mips3.lo |
| 162 | | #define HIVAL64 mips3.hi |
| 163 | | #define LOVAL64 mips3.lo |
| 164 | | #define SR mips3.cpr[0][COP0_Status] |
| 165 | | #define CAUSE mips3.cpr[0][COP0_Cause] |
| 68 | #define HIVAL (UINT32)mips3.core.hi |
| 69 | #define LOVAL (UINT32)mips3.core.lo |
| 70 | #define HIVAL64 mips3.core.hi |
| 71 | #define LOVAL64 mips3.core.lo |
| 72 | #define SR mips3.core.cpr[0][COP0_Status] |
| 73 | #define CAUSE mips3.core.cpr[0][COP0_Cause] |
| 166 | 74 | |
| 167 | | #define GET_FCC(n) ((mips3.ccr[1][31] >> fcc_shift[n]) & 1) |
| 168 | | #define SET_FCC(n,v) (mips3.ccr[1][31] = (mips3.ccr[1][31] & ~(1 << fcc_shift[n])) | ((v) << fcc_shift[n])) |
| 75 | #define GET_FCC(n) ((mips3.core.ccr[1][31] >> fcc_shift[n]) & 1) |
| 76 | #define SET_FCC(n,v) (mips3.core.ccr[1][31] = (mips3.core.ccr[1][31] & ~(1 << fcc_shift[n])) | ((v) << fcc_shift[n])) |
| 169 | 77 | |
| 170 | 78 | #define IS_FR0 (!(SR & SR_FR)) |
| 171 | 79 | #define IS_FR1 (SR & SR_FR) |
| 172 | 80 | |
| 173 | 81 | |
| 82 | |
| 174 | 83 | /*************************************************************************** |
| 175 | 84 | STRUCTURES & TYPEDEFS |
| 176 | 85 | ***************************************************************************/ |
| 177 | 86 | |
| 178 | | /* memory access function table */ |
| 179 | | typedef struct |
| 180 | | { |
| 181 | | UINT8 (*readbyte)(offs_t); |
| 182 | | UINT16 (*readword)(offs_t); |
| 183 | | UINT32 (*readlong)(offs_t); |
| 184 | | UINT64 (*readdouble)(offs_t); |
| 185 | | void (*writebyte)(offs_t, UINT8); |
| 186 | | void (*writeword)(offs_t, UINT16); |
| 187 | | void (*writelong)(offs_t, UINT32); |
| 188 | | void (*writedouble)(offs_t, UINT64); |
| 189 | | } memory_handlers; |
| 190 | | |
| 191 | | |
| 192 | 87 | /* MIPS3 Registers */ |
| 193 | 88 | typedef struct |
| 194 | 89 | { |
| 195 | | /* core registers */ |
| 196 | | UINT32 pc; |
| 197 | | UINT64 hi; |
| 198 | | UINT64 lo; |
| 199 | | UINT64 r[32]; |
| 90 | /* core state */ |
| 91 | mips3_state core; |
| 200 | 92 | |
| 201 | | /* COP registers */ |
| 202 | | UINT64 cpr[4][32]; |
| 203 | | UINT64 ccr[4][32]; |
| 204 | | UINT8 cf[4]; |
| 205 | | |
| 206 | 93 | /* internal stuff */ |
| 207 | 94 | UINT32 ppc; |
| 208 | 95 | UINT32 nextpc; |
| 209 | 96 | UINT32 pcbase; |
| 210 | 97 | int op; |
| 211 | 98 | int interrupt_cycles; |
| 212 | | int (*irq_callback)(int irqline); |
| 213 | | UINT64 count_zero_time; |
| 214 | | mame_timer * compare_int_timer; |
| 215 | | UINT8 is_mips4; |
| 216 | 99 | UINT32 ll_value; |
| 217 | 100 | UINT64 lld_value; |
| 218 | | UINT32 system_clock; |
| 219 | | UINT32 cpu_clock; |
| 220 | 101 | |
| 221 | 102 | /* endian-dependent load/store */ |
| 222 | 103 | void (*lwl)(UINT32 op); |
| r869 | r870 | |
| 227 | 108 | void (*ldr)(UINT32 op); |
| 228 | 109 | void (*sdl)(UINT32 op); |
| 229 | 110 | void (*sdr)(UINT32 op); |
| 230 | | |
| 231 | | /* memory accesses */ |
| 232 | | UINT8 bigendian; |
| 233 | | memory_handlers memory; |
| 234 | | |
| 235 | | /* cache memory */ |
| 236 | | UINT32 * icache; |
| 237 | | UINT32 * dcache; |
| 238 | | size_t icache_size; |
| 239 | | size_t dcache_size; |
| 240 | | |
| 241 | | /* MMU */ |
| 242 | | struct |
| 243 | | { |
| 244 | | UINT64 page_mask; |
| 245 | | UINT64 entry_hi; |
| 246 | | UINT64 entry_lo[2]; |
| 247 | | } tlb[48]; |
| 248 | | UINT32 * tlb_table; |
| 249 | 111 | } mips3_regs; |
| 250 | 112 | |
| 251 | 113 | |
| r869 | r870 | |
| 254 | 116 | FUNCTION PROTOTYPES |
| 255 | 117 | ***************************************************************************/ |
| 256 | 118 | |
| 257 | | static void recompute_tlb_table(void); |
| 258 | | |
| 259 | 119 | static void lwl_be(UINT32 op); |
| 260 | 120 | static void lwr_be(UINT32 op); |
| 261 | 121 | static void swl_be(UINT32 op); |
| r869 | r870 | |
| 276 | 136 | static void sdl_le(UINT32 op); |
| 277 | 137 | static void sdr_le(UINT32 op); |
| 278 | 138 | |
| 279 | | static UINT64 read_qword_32be(offs_t offset); |
| 280 | | static UINT64 read_qword_32le(offs_t offset); |
| 281 | | |
| 282 | | static void write_qword_32be(offs_t offset, UINT64 data); |
| 283 | | static void write_qword_32le(offs_t offset, UINT64 data); |
| 284 | | |
| 285 | 139 | static UINT8 fcc_shift[8] = { 23, 25, 26, 27, 28, 29, 30, 31 }; |
| 286 | 140 | |
| 287 | 141 | |
| 288 | 142 | |
| 289 | 143 | /*************************************************************************** |
| 290 | | PUBLIC GLOBAL VARIABLES |
| 291 | | ***************************************************************************/ |
| 292 | | |
| 293 | | static int mips3_icount; |
| 294 | | |
| 295 | | |
| 296 | | |
| 297 | | /*************************************************************************** |
| 298 | 144 | PRIVATE GLOBAL VARIABLES |
| 299 | 145 | ***************************************************************************/ |
| 300 | 146 | |
| 301 | 147 | static mips3_regs mips3; |
| 302 | 148 | |
| 303 | 149 | |
| 304 | | static const memory_handlers be_memory = |
| 305 | | { |
| 306 | | program_read_byte_32be, program_read_word_32be, program_read_dword_32be, read_qword_32be, |
| 307 | | program_write_byte_32be, program_write_word_32be, program_write_dword_32be, write_qword_32be |
| 308 | | }; |
| 309 | 150 | |
| 310 | | static const memory_handlers le_memory = |
| 311 | | { |
| 312 | | program_read_byte_32le, program_read_word_32le, program_read_dword_32le, read_qword_32le, |
| 313 | | program_write_byte_32le, program_write_word_32le, program_write_dword_32le, write_qword_32le |
| 314 | | }; |
| 315 | | |
| 316 | | |
| 317 | | |
| 318 | 151 | /*************************************************************************** |
| 319 | 152 | MEMORY ACCESSORS |
| 320 | 153 | ***************************************************************************/ |
| r869 | r870 | |
| 334 | 167 | |
| 335 | 168 | if (exception != 0) |
| 336 | 169 | { |
| 337 | | fprintf(stderr, "Exception: PC=%08X, PPC=%08X\n", mips3.pc, mips3.ppc); |
| 170 | fprintf(stderr, "Exception: PC=%08X, PPC=%08X\n", mips3.core.pc, mips3.ppc); |
| 338 | 171 | DEBUGGER_BREAK; |
| 339 | 172 | } |
| 340 | 173 | */ |
| 341 | 174 | |
| 342 | 175 | /* back up if necessary */ |
| 343 | 176 | if (backup) |
| 344 | | mips3.pc = mips3.ppc; |
| 177 | mips3.core.pc = mips3.ppc; |
| 345 | 178 | |
| 346 | 179 | /* set the exception PC */ |
| 347 | | mips3.cpr[0][COP0_EPC] = mips3.pc; |
| 180 | mips3.core.cpr[0][COP0_EPC] = mips3.core.pc; |
| 348 | 181 | |
| 349 | 182 | /* put the cause in the low 8 bits and clear the branch delay flag */ |
| 350 | 183 | CAUSE = (CAUSE & ~0x800000ff) | (exception << 2); |
| r869 | r870 | |
| 353 | 186 | if (mips3.nextpc != ~0) |
| 354 | 187 | { |
| 355 | 188 | mips3.nextpc = ~0; |
| 356 | | mips3.cpr[0][COP0_EPC] -= 4; |
| 189 | mips3.core.cpr[0][COP0_EPC] -= 4; |
| 357 | 190 | CAUSE |= 0x80000000; |
| 358 | 191 | } |
| 359 | 192 | |
| r869 | r870 | |
| 361 | 194 | SR |= SR_EXL; |
| 362 | 195 | |
| 363 | 196 | /* based on the BEV bit, we either go to ROM or RAM */ |
| 364 | | mips3.pc = (SR & SR_BEV) ? 0xbfc00200 : 0x80000000; |
| 197 | mips3.core.pc = (SR & SR_BEV) ? 0xbfc00200 : 0x80000000; |
| 365 | 198 | |
| 366 | 199 | /* most exceptions go to offset 0x180, except for TLB stuff */ |
| 367 | 200 | if (exception >= EXCEPTION_TLBMOD && exception <= EXCEPTION_TLBSTORE) |
| 368 | 201 | { |
| 369 | | mips3.pc += 0x00; |
| 370 | | mame_printf_debug("TLB miss @ %08X\n", (UINT32)mips3.cpr[0][COP0_BadVAddr]); |
| 202 | mips3.core.pc += 0x00; |
| 203 | mame_printf_debug("TLB miss @ %08X\n", (UINT32)mips3.core.cpr[0][COP0_BadVAddr]); |
| 371 | 204 | } |
| 372 | 205 | else |
| 373 | | mips3.pc += 0x180; |
| 206 | mips3.core.pc += 0x180; |
| 374 | 207 | |
| 375 | 208 | /* |
| 376 | 209 | useful for tracking interrupts |
| 377 | 210 | |
| 378 | 211 | if ((CAUSE & 0x7f) == 0) |
| 379 | | logerror("Took interrupt -- Cause = %08X, PC = %08X\n", (UINT32)CAUSE, mips3.pc); |
| 212 | logerror("Took interrupt -- Cause = %08X, PC = %08X\n", (UINT32)CAUSE, mips3.core.pc); |
| 380 | 213 | */ |
| 381 | 214 | } |
| 382 | 215 | |
| 383 | 216 | |
| 384 | 217 | static void generate_tlb_exception(int exception, offs_t address) |
| 385 | 218 | { |
| 386 | | mips3.cpr[0][COP0_BadVAddr] = address; |
| 387 | | mips3.cpr[0][COP0_Context] = (mips3.cpr[0][COP0_Context] & 0xff800000) | ((address >> 9) & 0x007ffff0); |
| 388 | | mips3.cpr[0][COP0_EntryHi] = (address & 0xffffe000) | (mips3.cpr[0][COP0_EntryHi] & 0xff); |
| 219 | mips3.core.cpr[0][COP0_BadVAddr] = address; |
| 220 | mips3.core.cpr[0][COP0_Context] = (mips3.core.cpr[0][COP0_Context] & 0xff800000) | ((address >> 9) & 0x007ffff0); |
| 221 | mips3.core.cpr[0][COP0_EntryHi] = (address & 0xffffe000) | (mips3.core.cpr[0][COP0_EntryHi] & 0xff); |
| 389 | 222 | generate_exception(exception, 1); |
| 390 | 223 | } |
| 391 | 224 | |
| r869 | r870 | |
| 408 | 241 | } |
| 409 | 242 | |
| 410 | 243 | |
| 411 | | static void set_irq_line(int irqline, int state) |
| 412 | | { |
| 413 | | if (state != CLEAR_LINE) |
| 414 | | CAUSE |= 0x400 << irqline; |
| 415 | | else |
| 416 | | CAUSE &= ~(0x400 << irqline); |
| 417 | | } |
| 418 | 244 | |
| 419 | | |
| 420 | | |
| 421 | 245 | /*************************************************************************** |
| 422 | | CONTEXT SWITCHING |
| 246 | CORE CALLBACKS |
| 423 | 247 | ***************************************************************************/ |
| 424 | 248 | |
| 425 | 249 | static void mips3_get_context(void *dst) |
| 426 | 250 | { |
| 427 | | /* copy the context */ |
| 428 | | if (dst) |
| 251 | if (dst != NULL) |
| 429 | 252 | *(mips3_regs *)dst = mips3; |
| 430 | 253 | } |
| 431 | 254 | |
| 432 | 255 | |
| 433 | 256 | static void mips3_set_context(void *src) |
| 434 | 257 | { |
| 435 | | /* copy the context */ |
| 436 | | if (src) |
| 258 | if (src != NULL) |
| 437 | 259 | mips3 = *(mips3_regs *)src; |
| 438 | 260 | } |
| 439 | 261 | |
| 440 | 262 | |
| 441 | | |
| 442 | | /*************************************************************************** |
| 443 | | INITIALIZATION AND SHUTDOWN |
| 444 | | ***************************************************************************/ |
| 445 | | |
| 446 | | static TIMER_CALLBACK( compare_int_callback ) |
| 263 | static void mips3_reset(void) |
| 447 | 264 | { |
| 448 | | cpunum_set_input_line(param, 5, ASSERT_LINE); |
| 449 | | } |
| 265 | /* common reset */ |
| 266 | mips3com_reset(&mips3.core); |
| 450 | 267 | |
| 451 | | |
| 452 | | static void mips3_init(int index, int clock, const void *_config, int (*irqcallback)(int)) |
| 453 | | { |
| 454 | | const struct mips3_config *config = _config; |
| 455 | | |
| 456 | | mips3.irq_callback = irqcallback; |
| 457 | | mips3.compare_int_timer = mame_timer_alloc(compare_int_callback); |
| 458 | | |
| 459 | | /* allocate memory */ |
| 460 | | mips3.icache = auto_malloc(config->icache); |
| 461 | | mips3.dcache = auto_malloc(config->dcache); |
| 462 | | mips3.tlb_table = auto_malloc(sizeof(mips3.tlb_table[0]) * (1 << (32 - 12))); |
| 463 | | |
| 464 | | /* initialize the rest of the config */ |
| 465 | | mips3.icache_size = config->icache; |
| 466 | | mips3.dcache_size = config->dcache; |
| 467 | | mips3.system_clock = config->system_clock; |
| 468 | | mips3.cpu_clock = clock; |
| 469 | | } |
| 470 | | |
| 471 | | |
| 472 | | static void mips3_reset(int bigendian, int mips4, UINT32 prid) |
| 473 | | { |
| 474 | | UINT32 configreg; |
| 475 | | int divisor; |
| 476 | | |
| 477 | 268 | /* set up the endianness */ |
| 478 | | mips3.bigendian = bigendian; |
| 479 | | if (mips3.bigendian) |
| 269 | if (mips3.core.bigendian) |
| 480 | 270 | { |
| 481 | | mips3.memory = be_memory; |
| 482 | 271 | mips3.lwl = lwl_be; |
| 483 | 272 | mips3.lwr = lwr_be; |
| 484 | 273 | mips3.swl = swl_be; |
| r869 | r870 | |
| 490 | 279 | } |
| 491 | 280 | else |
| 492 | 281 | { |
| 493 | | mips3.memory = le_memory; |
| 494 | 282 | mips3.lwl = lwl_le; |
| 495 | 283 | mips3.lwr = lwr_le; |
| 496 | 284 | mips3.swl = swl_le; |
| r869 | r870 | |
| 500 | 288 | mips3.sdl = sdl_le; |
| 501 | 289 | mips3.sdr = sdr_le; |
| 502 | 290 | } |
| 503 | | |
| 504 | | /* initialize the state */ |
| 505 | | mips3.pc = 0xbfc00000; |
| 506 | | mips3.ppc = ~mips3.pc; |
| 507 | | mips3.nextpc = ~0; |
| 508 | | mips3.cpr[0][COP0_Status] = SR_BEV | SR_ERL; |
| 509 | | mips3.cpr[0][COP0_Compare] = 0xffffffff; |
| 510 | | mips3.cpr[0][COP0_Count] = 0; |
| 511 | | mips3.count_zero_time = activecpu_gettotalcycles64(); |
| 512 | | |
| 513 | | /* config register: set the cache line size to 32 bytes */ |
| 514 | | configreg = 0x00026030; |
| 515 | | |
| 516 | | /* config register: set the data cache size */ |
| 517 | | if (mips3.icache_size <= 0x01000) configreg |= 0 << 6; |
| 518 | | else if (mips3.icache_size <= 0x02000) configreg |= 1 << 6; |
| 519 | | else if (mips3.icache_size <= 0x04000) configreg |= 2 << 6; |
| 520 | | else if (mips3.icache_size <= 0x08000) configreg |= 3 << 6; |
| 521 | | else if (mips3.icache_size <= 0x10000) configreg |= 4 << 6; |
| 522 | | else if (mips3.icache_size <= 0x20000) configreg |= 5 << 6; |
| 523 | | else if (mips3.icache_size <= 0x40000) configreg |= 6 << 6; |
| 524 | | else configreg |= 7 << 6; |
| 525 | | |
| 526 | | /* config register: set the instruction cache size */ |
| 527 | | if (mips3.icache_size <= 0x01000) configreg |= 0 << 9; |
| 528 | | else if (mips3.icache_size <= 0x02000) configreg |= 1 << 9; |
| 529 | | else if (mips3.icache_size <= 0x04000) configreg |= 2 << 9; |
| 530 | | else if (mips3.icache_size <= 0x08000) configreg |= 3 << 9; |
| 531 | | else if (mips3.icache_size <= 0x10000) configreg |= 4 << 9; |
| 532 | | else if (mips3.icache_size <= 0x20000) configreg |= 5 << 9; |
| 533 | | else if (mips3.icache_size <= 0x40000) configreg |= 6 << 9; |
| 534 | | else configreg |= 7 << 9; |
| 535 | | |
| 536 | | /* config register: set the endianness bit */ |
| 537 | | if (bigendian) configreg |= 0x00008000; |
| 538 | | |
| 539 | | /* config register: set the system clock divider */ |
| 540 | | divisor = 2; |
| 541 | | if (mips3.system_clock != 0) |
| 542 | | { |
| 543 | | divisor = mips3.cpu_clock / mips3.system_clock; |
| 544 | | if (mips3.system_clock * divisor != mips3.cpu_clock) |
| 545 | | { |
| 546 | | configreg |= 0x80000000; |
| 547 | | divisor = mips3.cpu_clock * 2 / mips3.system_clock; |
| 548 | | } |
| 549 | | } |
| 550 | | configreg |= (((divisor < 2) ? 2 : (divisor > 8) ? 8 : divisor) - 2) << 28; |
| 551 | | |
| 552 | | /* set up the architecture */ |
| 553 | | mips3.is_mips4 = mips4; |
| 554 | | mips3.cpr[0][COP0_PRId] = prid; |
| 555 | | mips3.cpr[0][COP0_Config] = configreg; |
| 556 | | |
| 557 | | /* recompute the TLB table */ |
| 558 | | recompute_tlb_table(); |
| 559 | 291 | } |
| 560 | 292 | |
| 561 | 293 | |
| 562 | | #if (HAS_R4600) |
| 563 | | static void r4600be_reset(void) |
| 294 | static int mips3_translate(int space, offs_t *address) |
| 564 | 295 | { |
| 565 | | mips3_reset(1, 0, 0x2000); |
| 296 | /* common translate */ |
| 297 | return mips3com_translate_address(&mips3.core, space, address); |
| 566 | 298 | } |
| 567 | 299 | |
| 568 | | static void r4600le_reset(void) |
| 569 | | { |
| 570 | | mips3_reset(0, 0, 0x2000); |
| 571 | | } |
| 572 | | #endif |
| 573 | 300 | |
| 574 | | |
| 575 | | #if (HAS_R4700) |
| 576 | | static void r4700be_reset(void) |
| 301 | #ifdef MAME_DEBUG |
| 302 | offs_t mips3_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) |
| 577 | 303 | { |
| 578 | | mips3_reset(1, 0, 0x2100); |
| 304 | /* common disassemble */ |
| 305 | return mips3com_dasm(&mips3.core, buffer, pc, oprom, opram); |
| 579 | 306 | } |
| 307 | #endif /* MAME_DEBUG */ |
| 580 | 308 | |
| 581 | | static void r4700le_reset(void) |
| 582 | | { |
| 583 | | mips3_reset(0, 0, 0x2100); |
| 584 | | } |
| 585 | | #endif |
| 586 | 309 | |
| 587 | 310 | |
| 588 | | #if (HAS_R5000) |
| 589 | | static void r5000be_reset(void) |
| 590 | | { |
| 591 | | mips3_reset(1, 1, 0x2300); |
| 592 | | } |
| 593 | | |
| 594 | | static void r5000le_reset(void) |
| 595 | | { |
| 596 | | mips3_reset(0, 1, 0x2300); |
| 597 | | } |
| 598 | | #endif |
| 599 | | |
| 600 | | |
| 601 | | #if (HAS_QED5271) |
| 602 | | static void qed5271be_reset(void) |
| 603 | | { |
| 604 | | mips3_reset(1, 1, 0x2300); |
| 605 | | } |
| 606 | | |
| 607 | | static void qed5271le_reset(void) |
| 608 | | { |
| 609 | | mips3_reset(1, 0, 0x2300); |
| 610 | | } |
| 611 | | #endif |
| 612 | | |
| 613 | | |
| 614 | | #if (HAS_RM7000) |
| 615 | | static void rm7000be_reset(void) |
| 616 | | { |
| 617 | | mips3_reset(1, 1, 0x2700); |
| 618 | | } |
| 619 | | |
| 620 | | static void rm7000le_reset(void) |
| 621 | | { |
| 622 | | mips3_reset(0, 1, 0x2700); |
| 623 | | } |
| 624 | | #endif |
| 625 | | |
| 626 | | |
| 627 | | static void mips3_exit(void) |
| 628 | | { |
| 629 | | } |
| 630 | | |
| 631 | | |
| 632 | | /* kludge for DRC support */ |
| 633 | | static void mips3drc_set_options(UINT8 cpunum, UINT32 opts) |
| 634 | | { |
| 635 | | } |
| 636 | | |
| 637 | | |
| 638 | | |
| 639 | 311 | /*************************************************************************** |
| 640 | 312 | TLB HANDLING |
| 641 | 313 | ***************************************************************************/ |
| 642 | 314 | |
| 643 | | static void map_tlb_entries(void) |
| 644 | | { |
| 645 | | int valid_asid = mips3.cpr[0][COP0_EntryHi] & 0xff; |
| 646 | | int index; |
| 647 | | |
| 648 | | /* iterate over all TLB entries */ |
| 649 | | for (index = 0; index < 48; index++) |
| 650 | | { |
| 651 | | UINT64 hi = mips3.tlb[index].entry_hi; |
| 652 | | |
| 653 | | /* only process if the ASID matches or if BOTH entries are marked global */ |
| 654 | | if (valid_asid == (hi & 0xff) || ((mips3.tlb[index].entry_lo[0] & 1) && (mips3.tlb[index].entry_lo[1] & 1))) |
| 655 | | { |
| 656 | | UINT32 count = (mips3.tlb[index].page_mask >> 13) & 0x00fff; |
| 657 | | UINT32 vpn = ((hi >> 13) & 0x07ffffff) << 1; |
| 658 | | int which, i; |
| 659 | | |
| 660 | | /* ignore if the virtual address is beyond 32 bits */ |
| 661 | | if (vpn < (1 << (32 - 12))) |
| 662 | | |
| 663 | | /* loop over both the even and odd pages */ |
| 664 | | for (which = 0; which < 2; which++) |
| 665 | | { |
| 666 | | UINT64 lo = mips3.tlb[index].entry_lo[which]; |
| 667 | | |
| 668 | | /* only map if the TLB entry is valid */ |
| 669 | | if (lo & 2) |
| 670 | | { |
| 671 | | UINT32 pfn = (lo >> 6) & 0x00ffffff; |
| 672 | | UINT32 wp = (~lo >> 2) & 1; |
| 673 | | |
| 674 | | for (i = 0; i <= count; i++, vpn++, pfn++) |
| 675 | | if (vpn < 0x80000 || vpn >= 0xc0000) |
| 676 | | mips3.tlb_table[vpn] = (pfn << 12) | wp; |
| 677 | | } |
| 678 | | |
| 679 | | /* otherwise, advance by the number of pages we would have mapped */ |
| 680 | | else |
| 681 | | vpn += count + 1; |
| 682 | | } |
| 683 | | } |
| 684 | | } |
| 685 | | } |
| 686 | | |
| 687 | | |
| 688 | | static void unmap_tlb_entries(void) |
| 689 | | { |
| 690 | | int index; |
| 691 | | |
| 692 | | /* iterate over all TLB entries */ |
| 693 | | for (index = 0; index < 48; index++) |
| 694 | | { |
| 695 | | UINT64 hi = mips3.tlb[index].entry_hi; |
| 696 | | UINT32 count = (mips3.tlb[index].page_mask >> 13) & 0x00fff; |
| 697 | | UINT32 vpn = ((hi >> 13) & 0x07ffffff) << 1; |
| 698 | | int which, i; |
| 699 | | |
| 700 | | /* ignore if the virtual address is beyond 32 bits */ |
| 701 | | if (vpn < (1 << (32 - 12))) |
| 702 | | |
| 703 | | /* loop over both the even and odd pages */ |
| 704 | | for (which = 0; which < 2; which++) |
| 705 | | for (i = 0; i <= count; i++, vpn++) |
| 706 | | if (vpn < 0x80000 || vpn >= 0xc0000) |
| 707 | | mips3.tlb_table[vpn] = 0xffffffff; |
| 708 | | } |
| 709 | | } |
| 710 | | |
| 711 | | |
| 712 | | static void recompute_tlb_table(void) |
| 713 | | { |
| 714 | | UINT32 addr; |
| 715 | | |
| 716 | | /* map in the hard-coded spaces */ |
| 717 | | for (addr = 0x80000000; addr < 0xc0000000; addr += 1 << 12) |
| 718 | | mips3.tlb_table[addr >> 12] = addr & 0x1ffff000; |
| 719 | | |
| 720 | | /* reset everything else to unmapped */ |
| 721 | | memset(&mips3.tlb_table[0x00000000 >> 12], 0xff, sizeof(mips3.tlb_table[0]) * (0x80000000 >> 12)); |
| 722 | | memset(&mips3.tlb_table[0xc0000000 >> 12], 0xff, sizeof(mips3.tlb_table[0]) * (0x40000000 >> 12)); |
| 723 | | |
| 724 | | /* remap all the entries in the TLB */ |
| 725 | | map_tlb_entries(); |
| 726 | | } |
| 727 | | |
| 728 | | |
| 729 | | static int translate_address(int space, offs_t *address) |
| 730 | | { |
| 731 | | if (space == ADDRESS_SPACE_PROGRAM) |
| 732 | | { |
| 733 | | UINT32 result = mips3.tlb_table[*address >> 12]; |
| 734 | | if (result == 0xffffffff) |
| 735 | | return 0; |
| 736 | | *address = (result & ~0xfff) | (*address & 0xfff); |
| 737 | | } |
| 738 | | return 1; |
| 739 | | } |
| 740 | | |
| 741 | | |
| 742 | 315 | static int update_pcbase(void) |
| 743 | 316 | { |
| 744 | | UINT32 entry = mips3.tlb_table[mips3.pc >> 12]; |
| 317 | UINT32 entry = mips3.core.tlb_table[mips3.core.pc >> 12]; |
| 745 | 318 | if (entry == 0xffffffff) |
| 746 | 319 | { |
| 747 | | generate_tlb_exception(EXCEPTION_TLBLOAD, mips3.pc); |
| 320 | generate_tlb_exception(EXCEPTION_TLBLOAD, mips3.core.pc); |
| 748 | 321 | return 0; |
| 749 | 322 | } |
| 750 | 323 | mips3.pcbase = entry & ~0xfff; |
| r869 | r870 | |
| 755 | 328 | |
| 756 | 329 | INLINE int RBYTE(offs_t address, UINT32 *result) |
| 757 | 330 | { |
| 758 | | UINT32 tlbval = mips3.tlb_table[address >> 12]; |
| 331 | UINT32 tlbval = mips3.core.tlb_table[address >> 12]; |
| 759 | 332 | if (tlbval == 0xffffffff) |
| 760 | 333 | { |
| 761 | 334 | generate_tlb_exception(EXCEPTION_TLBLOAD, address); |
| 762 | 335 | return 0; |
| 763 | 336 | } |
| 764 | | *result = (*mips3.memory.readbyte)((tlbval & ~0xfff) | (address & 0xfff)); |
| 337 | *result = (*mips3.core.memory.readbyte)((tlbval & ~0xfff) | (address & 0xfff)); |
| 765 | 338 | return 1; |
| 766 | 339 | } |
| 767 | 340 | |
| 768 | 341 | |
| 769 | 342 | INLINE int RWORD(offs_t address, UINT32 *result) |
| 770 | 343 | { |
| 771 | | UINT32 tlbval = mips3.tlb_table[address >> 12]; |
| 344 | UINT32 tlbval = mips3.core.tlb_table[address >> 12]; |
| 772 | 345 | if (tlbval == 0xffffffff) |
| 773 | 346 | { |
| 774 | 347 | generate_tlb_exception(EXCEPTION_TLBLOAD, address); |
| 775 | 348 | return 0; |
| 776 | 349 | } |
| 777 | | *result = (*mips3.memory.readword)((tlbval & ~0xfff) | (address & 0xfff)); |
| 350 | *result = (*mips3.core.memory.readword)((tlbval & ~0xfff) | (address & 0xfff)); |
| 778 | 351 | return 1; |
| 779 | 352 | } |
| 780 | 353 | |
| 781 | 354 | |
| 782 | 355 | INLINE int RLONG(offs_t address, UINT32 *result) |
| 783 | 356 | { |
| 784 | | UINT32 tlbval = mips3.tlb_table[address >> 12]; |
| 357 | UINT32 tlbval = mips3.core.tlb_table[address >> 12]; |
| 785 | 358 | if (tlbval == 0xffffffff) |
| 786 | 359 | { |
| 787 | 360 | generate_tlb_exception(EXCEPTION_TLBLOAD, address); |
| 788 | 361 | return 0; |
| 789 | 362 | } |
| 790 | | *result = (*mips3.memory.readlong)((tlbval & ~0xfff) | (address & 0xfff)); |
| 363 | *result = (*mips3.core.memory.readlong)((tlbval & ~0xfff) | (address & 0xfff)); |
| 791 | 364 | return 1; |
| 792 | 365 | } |
| 793 | 366 | |
| 794 | 367 | |
| 795 | 368 | INLINE int RDOUBLE(offs_t address, UINT64 *result) |
| 796 | 369 | { |
| 797 | | UINT32 tlbval = mips3.tlb_table[address >> 12]; |
| 370 | UINT32 tlbval = mips3.core.tlb_table[address >> 12]; |
| 798 | 371 | if (tlbval == 0xffffffff) |
| 799 | 372 | { |
| 800 | 373 | generate_tlb_exception(EXCEPTION_TLBLOAD, address); |
| 801 | 374 | return 0; |
| 802 | 375 | } |
| 803 | | *result = (*mips3.memory.readdouble)((tlbval & ~0xfff) | (address & 0xfff)); |
| 376 | *result = (*mips3.core.memory.readdouble)((tlbval & ~0xfff) | (address & 0xfff)); |
| 804 | 377 | return 1; |
| 805 | 378 | } |
| 806 | 379 | |
| 807 | 380 | |
| 808 | 381 | INLINE void WBYTE(offs_t address, UINT8 data) |
| 809 | 382 | { |
| 810 | | UINT32 tlbval = mips3.tlb_table[address >> 12]; |
| 383 | UINT32 tlbval = mips3.core.tlb_table[address >> 12]; |
| 811 | 384 | if (tlbval & 1) |
| 812 | 385 | generate_tlb_exception(EXCEPTION_TLBSTORE, address); |
| 813 | 386 | else |
| 814 | | (*mips3.memory.writebyte)(tlbval | (address & 0xfff), data); |
| 387 | (*mips3.core.memory.writebyte)(tlbval | (address & 0xfff), data); |
| 815 | 388 | } |
| 816 | 389 | |
| 817 | 390 | |
| 818 | 391 | INLINE void WWORD(offs_t address, UINT16 data) |
| 819 | 392 | { |
| 820 | | UINT32 tlbval = mips3.tlb_table[address >> 12]; |
| 393 | UINT32 tlbval = mips3.core.tlb_table[address >> 12]; |
| 821 | 394 | if (tlbval & 1) |
| 822 | 395 | generate_tlb_exception(EXCEPTION_TLBSTORE, address); |
| 823 | 396 | else |
| 824 | | (*mips3.memory.writeword)(tlbval | (address & 0xfff), data); |
| 397 | (*mips3.core.memory.writeword)(tlbval | (address & 0xfff), data); |
| 825 | 398 | } |
| 826 | 399 | |
| 827 | 400 | |
| 828 | 401 | INLINE void WLONG(offs_t address, UINT32 data) |
| 829 | 402 | { |
| 830 | | UINT32 tlbval = mips3.tlb_table[address >> 12]; |
| 403 | UINT32 tlbval = mips3.core.tlb_table[address >> 12]; |
| 831 | 404 | if (tlbval & 1) |
| 832 | 405 | generate_tlb_exception(EXCEPTION_TLBSTORE, address); |
| 833 | 406 | else |
| 834 | | (*mips3.memory.writelong)(tlbval | (address & 0xfff), data); |
| 407 | (*mips3.core.memory.writelong)(tlbval | (address & 0xfff), data); |
| 835 | 408 | } |
| 836 | 409 | |
| 837 | 410 | |
| 838 | 411 | INLINE void WDOUBLE(offs_t address, UINT64 data) |
| 839 | 412 | { |
| 840 | | UINT32 tlbval = mips3.tlb_table[address >> 12]; |
| 413 | UINT32 tlbval = mips3.core.tlb_table[address >> 12]; |
| 841 | 414 | if (tlbval & 1) |
| 842 | 415 | generate_tlb_exception(EXCEPTION_TLBSTORE, address); |
| 843 | 416 | else |
| 844 | | (*mips3.memory.writedouble)(tlbval | (address & 0xfff), data); |
| 417 | (*mips3.core.memory.writedouble)(tlbval | (address & 0xfff), data); |
| 845 | 418 | } |
| 846 | 419 | |
| 847 | 420 | |
| r869 | r870 | |
| 850 | 423 | COP0 (SYSTEM) EXECUTION HANDLING |
| 851 | 424 | ***************************************************************************/ |
| 852 | 425 | |
| 853 | | static void update_cycle_counting(void) |
| 854 | | { |
| 855 | | /* modify the timer to go off */ |
| 856 | | if ((SR & 0x8000) && mips3.cpr[0][COP0_Compare] != 0xffffffff) |
| 857 | | { |
| 858 | | UINT32 count = (activecpu_gettotalcycles64() - mips3.count_zero_time) / 2; |
| 859 | | UINT32 compare = mips3.cpr[0][COP0_Compare]; |
| 860 | | UINT32 cyclesleft = compare - count; |
| 861 | | mame_time newtime = MAME_TIME_IN_CYCLES(((INT64)cyclesleft * 2), cpu_getactivecpu()); |
| 862 | | |
| 863 | | /* due to accuracy issues, don't bother setting timers unless they're for less than 100msec */ |
| 864 | | if (compare_mame_times(newtime, MAME_TIME_IN_MSEC(100)) < 0) |
| 865 | | mame_timer_adjust(mips3.compare_int_timer, newtime, cpu_getactivecpu(), time_zero); |
| 866 | | } |
| 867 | | else |
| 868 | | mame_timer_adjust(mips3.compare_int_timer, time_never, cpu_getactivecpu(), time_zero); |
| 869 | | } |
| 870 | | |
| 871 | 426 | INLINE UINT64 get_cop0_reg(int idx) |
| 872 | 427 | { |
| 873 | 428 | if (idx == COP0_Count) |
| r869 | r870 | |
| 878 | 433 | mips3_icount -= 250; |
| 879 | 434 | else |
| 880 | 435 | mips3_icount = 0; |
| 881 | | return (UINT32)((activecpu_gettotalcycles64() - mips3.count_zero_time) / 2); |
| 436 | return (UINT32)((activecpu_gettotalcycles64() - mips3.core.count_zero_time) / 2); |
| 882 | 437 | } |
| 883 | 438 | else if (idx == COP0_Cause) |
| 884 | 439 | { |
| r869 | r870 | |
| 891 | 446 | } |
| 892 | 447 | else if (idx == COP0_Random) |
| 893 | 448 | { |
| 894 | | int wired = mips3.cpr[0][COP0_Wired] & 0x3f; |
| 449 | int wired = mips3.core.cpr[0][COP0_Wired] & 0x3f; |
| 895 | 450 | int range = 48 - wired; |
| 896 | 451 | if (range > 0) |
| 897 | | return ((activecpu_gettotalcycles64() - mips3.count_zero_time) % range + wired) & 0x3f; |
| 452 | return ((activecpu_gettotalcycles64() - mips3.core.count_zero_time) % range + wired) & 0x3f; |
| 898 | 453 | else |
| 899 | 454 | return 47; |
| 900 | 455 | } |
| 901 | | return mips3.cpr[0][idx]; |
| 456 | return mips3.core.cpr[0][idx]; |
| 902 | 457 | } |
| 903 | 458 | |
| 904 | 459 | INLINE void set_cop0_reg(int idx, UINT64 val) |
| r869 | r870 | |
| 912 | 467 | /* if we're in a delay slot, propogate the target PC before generating the exception */ |
| 913 | 468 | if (mips3.nextpc != ~0) |
| 914 | 469 | { |
| 915 | | mips3.pc = mips3.nextpc; |
| 470 | mips3.core.pc = mips3.nextpc; |
| 916 | 471 | mips3.nextpc = ~0; |
| 917 | 472 | } |
| 918 | 473 | generate_exception(EXCEPTION_INTERRUPT, 0); |
| r869 | r870 | |
| 922 | 477 | case COP0_Status: |
| 923 | 478 | { |
| 924 | 479 | /* update interrupts and cycle counting */ |
| 925 | | UINT32 diff = mips3.cpr[0][idx] ^ val; |
| 480 | UINT32 diff = mips3.core.cpr[0][idx] ^ val; |
| 926 | 481 | // if (val & 0xe0) |
| 927 | 482 | // fatalerror("System set 64-bit addressing mode, SR=%08X", val); |
| 928 | | mips3.cpr[0][idx] = val; |
| 483 | mips3.core.cpr[0][idx] = val; |
| 929 | 484 | if (diff & 0x8000) |
| 930 | | update_cycle_counting(); |
| 485 | mips3com_update_cycle_counting(&mips3.core); |
| 931 | 486 | check_irqs(); |
| 932 | 487 | break; |
| 933 | 488 | } |
| 934 | 489 | |
| 935 | 490 | case COP0_Count: |
| 936 | | mips3.count_zero_time = activecpu_gettotalcycles64() - ((UINT64)(UINT32)val * 2); |
| 937 | | update_cycle_counting(); |
| 491 | mips3.core.count_zero_time = activecpu_gettotalcycles64() - ((UINT64)(UINT32)val * 2); |
| 492 | mips3com_update_cycle_counting(&mips3.core); |
| 938 | 493 | break; |
| 939 | 494 | |
| 940 | 495 | case COP0_Compare: |
| 941 | 496 | CAUSE &= ~0x8000; |
| 942 | | mips3.cpr[0][idx] = val & 0xffffffff; |
| 943 | | update_cycle_counting(); |
| 497 | mips3.core.cpr[0][idx] = val & 0xffffffff; |
| 498 | mips3com_update_cycle_counting(&mips3.core); |
| 944 | 499 | break; |
| 945 | 500 | |
| 946 | 501 | case COP0_PRId: |
| 947 | 502 | break; |
| 948 | 503 | |
| 949 | 504 | case COP0_Config: |
| 950 | | mips3.cpr[0][idx] = (mips3.cpr[0][idx] & ~7) | (val & 7); |
| 505 | mips3.core.cpr[0][idx] = (mips3.core.cpr[0][idx] & ~7) | (val & 7); |
| 951 | 506 | break; |
| 952 | 507 | |
| 953 | 508 | case COP0_EntryHi: |
| 954 | 509 | /* if the ASID changes, remap */ |
| 955 | | if ((mips3.cpr[0][idx] ^ val) & 0xff) |
| 510 | if ((mips3.core.cpr[0][idx] ^ val) & 0xff) |
| 956 | 511 | { |
| 957 | | mips3.cpr[0][idx] = val; |
| 958 | | unmap_tlb_entries(); |
| 959 | | map_tlb_entries(); |
| 512 | mips3.core.cpr[0][idx] = val; |
| 513 | mips3com_unmap_tlb_entries(&mips3.core); |
| 514 | mips3com_map_tlb_entries(&mips3.core); |
| 960 | 515 | } |
| 961 | | mips3.cpr[0][idx] = val; |
| 516 | mips3.core.cpr[0][idx] = val; |
| 962 | 517 | break; |
| 963 | 518 | |
| 964 | 519 | default: |
| 965 | | mips3.cpr[0][idx] = val; |
| 520 | mips3.core.cpr[0][idx] = val; |
| 966 | 521 | break; |
| 967 | 522 | } |
| 968 | 523 | } |
| 969 | 524 | |
| 970 | 525 | INLINE UINT64 get_cop0_creg(int idx) |
| 971 | 526 | { |
| 972 | | return mips3.ccr[0][idx]; |
| 527 | return mips3.core.ccr[0][idx]; |
| 973 | 528 | } |
| 974 | 529 | |
| 975 | 530 | INLINE void set_cop0_creg(int idx, UINT64 val) |
| 976 | 531 | { |
| 977 | | mips3.ccr[0][idx] = val; |
| 532 | mips3.core.ccr[0][idx] = val; |
| 978 | 533 | } |
| 979 | 534 | |
| 980 | | INLINE void logonetlbentry(int index, int which) |
| 981 | | { |
| 982 | | #if PRINTF_TLB |
| 983 | | UINT64 hi = mips3.cpr[0][COP0_EntryHi]; |
| 984 | | UINT64 lo = mips3.cpr[0][COP0_EntryLo0 + which]; |
| 985 | | UINT32 vpn = (((hi >> 13) & 0x07ffffff) << 1); |
| 986 | | UINT32 asid = hi & 0xff; |
| 987 | | UINT32 r = (hi >> 62) & 3; |
| 988 | | UINT32 pfn = (lo >> 6) & 0x00ffffff; |
| 989 | | UINT32 c = (lo >> 3) & 7; |
| 990 | | UINT32 pagesize = (((mips3.cpr[0][COP0_PageMask] >> 13) & 0xfff) + 1) << 12; |
| 991 | | UINT64 vaddr = (UINT64)vpn * 0x1000; |
| 992 | | UINT64 paddr = (UINT64)pfn * 0x1000; |
| 993 | | |
| 994 | | vaddr += pagesize * which; |
| 995 | | |
| 996 | | mame_printf_debug("index=%08X pagesize=%08X vaddr=%08X%08X paddr=%08X%08X asid=%02X r=%X c=%X dvg=%c%c%c\n", |
| 997 | | index, pagesize, (UINT32)(vaddr >> 32), (UINT32)vaddr, (UINT32)(paddr >> 32), (UINT32)paddr, |
| 998 | | asid, r, c, (lo & 4) ? 'd' : '.', (lo & 2) ? 'v' : '.', (lo & 1) ? 'g' : '.'); |
| 999 | | #endif |
| 1000 | | } |
| 1001 | | |
| 1002 | | static void logtlbentry(int index) |
| 1003 | | { |
| 1004 | | logonetlbentry(index, 0); |
| 1005 | | logonetlbentry(index, 1); |
| 1006 | | } |
| 1007 | | |
| 1008 | 535 | INLINE void handle_cop0(UINT32 op) |
| 1009 | 536 | { |
| 1010 | | UINT32 index, wired, vpn; |
| 1011 | | |
| 1012 | 537 | if ((SR & SR_KSU_MASK) != SR_KSU_KERNEL && !(SR & SR_COP0)) |
| 1013 | 538 | generate_exception(EXCEPTION_BADCOP, 1); |
| 1014 | 539 | |
| r869 | r870 | |
| 1023 | 548 | case 0x08: /* BC */ |
| 1024 | 549 | switch (RTREG) |
| 1025 | 550 | { |
| 1026 | | case 0x00: /* BCzF */ if (!mips3.cf[0]) ADDPC(SIMMVAL); break; |
| 1027 | | case 0x01: /* BCzF */ if (mips3.cf[0]) ADDPC(SIMMVAL); break; |
| 551 | case 0x00: /* BCzF */ if (!mips3.core.cf[0]) ADDPC(SIMMVAL); break; |
| 552 | case 0x01: /* BCzF */ if (mips3.core.cf[0]) ADDPC(SIMMVAL); break; |
| 1028 | 553 | case 0x02: /* BCzFL */ invalid_instruction(op); break; |
| 1029 | 554 | case 0x03: /* BCzTL */ invalid_instruction(op); break; |
| 1030 | 555 | default: invalid_instruction(op); break; |
| r869 | r870 | |
| 1049 | 574 | switch (op & 0x01ffffff) |
| 1050 | 575 | { |
| 1051 | 576 | case 0x01: /* TLBR */ |
| 1052 | | index = mips3.cpr[0][COP0_Index] & 0x3f; |
| 1053 | | if (index < 48) |
| 1054 | | { |
| 1055 | | mips3.cpr[0][COP0_PageMask] = mips3.tlb[index].page_mask; |
| 1056 | | mips3.cpr[0][COP0_EntryHi] = mips3.tlb[index].entry_hi; |
| 1057 | | mips3.cpr[0][COP0_EntryLo0] = mips3.tlb[index].entry_lo[0]; |
| 1058 | | mips3.cpr[0][COP0_EntryLo1] = mips3.tlb[index].entry_lo[1]; |
| 1059 | | } |
| 577 | mips3com_tlbr(&mips3.core); |
| 1060 | 578 | break; |
| 1061 | 579 | |
| 1062 | 580 | case 0x02: /* TLBWI */ |
| 1063 | | index = mips3.cpr[0][COP0_Index] & 0x3f; |
| 1064 | | logtlbentry(index); |
| 1065 | | if (index < 48) |
| 1066 | | { |
| 1067 | | unmap_tlb_entries(); |
| 1068 | | mips3.tlb[index].page_mask = mips3.cpr[0][COP0_PageMask]; |
| 1069 | | mips3.tlb[index].entry_hi = mips3.cpr[0][COP0_EntryHi] & ~(mips3.tlb[index].page_mask & U64(0x0000000001ffe000)); |
| 1070 | | mips3.tlb[index].entry_lo[0] = mips3.cpr[0][COP0_EntryLo0]; |
| 1071 | | mips3.tlb[index].entry_lo[1] = mips3.cpr[0][COP0_EntryLo1]; |
| 1072 | | map_tlb_entries(); |
| 1073 | | } |
| 581 | mips3com_tlbwi(&mips3.core); |
| 1074 | 582 | break; |
| 1075 | 583 | |
| 1076 | 584 | case 0x06: /* TLBWR */ |
| 1077 | | wired = mips3.cpr[0][COP0_Wired] & 0x3f; |
| 1078 | | index = 48 - wired; |
| 1079 | | if (index > 0) |
| 1080 | | index = ((activecpu_gettotalcycles64() - mips3.count_zero_time) % index + wired) & 0x3f; |
| 1081 | | else |
| 1082 | | index = 47; |
| 1083 | | logtlbentry(index); |
| 1084 | | { |
| 1085 | | unmap_tlb_entries(); |
| 1086 | | mips3.tlb[index].page_mask = mips3.cpr[0][COP0_PageMask]; |
| 1087 | | mips3.tlb[index].entry_hi = mips3.cpr[0][COP0_EntryHi] & ~(mips3.tlb[index].page_mask & U64(0x0000000001ffe000)); |
| 1088 | | mips3.tlb[index].entry_lo[0] = mips3.cpr[0][COP0_EntryLo0]; |
| 1089 | | mips3.tlb[index].entry_lo[1] = mips3.cpr[0][COP0_EntryLo1]; |
| 1090 | | map_tlb_entries(); |
| 1091 | | } |
| 585 | mips3com_tlbwr(&mips3.core); |
| 1092 | 586 | break; |
| 1093 | 587 | |
| 1094 | 588 | case 0x08: /* TLBP */ |
| 1095 | | // DEBUGGER_BREAK; |
| 1096 | | for (index = 0; index < 48; index++) |
| 1097 | | { |
| 1098 | | UINT64 mask = ~(mips3.tlb[index].page_mask & U64(0x0000000001ffe000)) & ~U64(0x1fff); |
| 1099 | | #if PRINTF_TLB |
| 1100 | | mame_printf_debug("Mask = %08X%08X TLB = %08X%08X MATCH = %08X%08X\n", |
| 1101 | | (UINT32)(mask >> 32), (UINT32)mask, |
| 1102 | | (UINT32)(mips3.tlb[index].entry_hi >> 32), (UINT32)mips3.tlb[index].entry_hi, |
| 1103 | | (UINT32)(mips3.cpr[0][COP0_EntryHi] >> 32), (UINT32)mips3.cpr[0][COP0_EntryHi]); |
| 1104 | | #endif |
| 1105 | | if ((mips3.tlb[index].entry_hi & mask) == (mips3.cpr[0][COP0_EntryHi] & mask)) |
| 1106 | | { |
| 1107 | | if (((mips3.tlb[index].entry_lo[0] & 1) && (mips3.tlb[index].entry_lo[1] & 1)) || |
| 1108 | | (mips3.tlb[index].entry_hi & 0xff) == (mips3.cpr[0][COP0_EntryHi] & 0xff)) |
| 1109 | | break; |
| 1110 | | } |
| 1111 | | } |
| 1112 | | vpn = ((mips3.cpr[0][COP0_EntryHi] >> 13) & 0x07ffffff) << 1; |
| 1113 | | if (index != 48) |
| 1114 | | { |
| 1115 | | if (mips3.tlb_table[vpn & 0xfffff] == 0xffffffff) |
| 1116 | | { |
| 1117 | | #if PRINTF_TLB |
| 1118 | | mame_printf_debug("TLBP: Should have not found an entry\n"); |
| 1119 | | // DEBUGGER_BREAK; |
| 1120 | | #endif |
| 1121 | | } |
| 1122 | | mips3.cpr[0][COP0_Index] = index; |
| 1123 | | } |
| 1124 | | else |
| 1125 | | { |
| 1126 | | if (mips3.tlb_table[vpn & 0xfffff] != 0xffffffff) |
| 1127 | | { |
| 1128 | | #if PRINTF_TLB |
| 1129 | | mame_printf_debug("TLBP: Should have found an entry\n"); |
| 1130 | | // DEBUGGER_BREAK; |
| 1131 | | #endif |
| 1132 | | } |
| 1133 | | mips3.cpr[0][COP0_Index] = 0x80000000; |
| 1134 | | } |
| 589 | mips3com_tlbp(&mips3.core); |
| 1135 | 590 | break; |
| 1136 | 591 | |
| 1137 | 592 | case 0x10: /* RFE */ invalid_instruction(op); break; |
| 1138 | | case 0x18: /* ERET */ logerror("ERET\n"); mips3.pc = mips3.cpr[0][COP0_EPC]; SR &= ~SR_EXL; check_irqs(); mips3.lld_value ^= 0xffffffff; mips3.ll_value ^= 0xffffffff; break; |
| 593 | case 0x18: /* ERET */ logerror("ERET\n"); mips3.core.pc = mips3.core.cpr[0][COP0_EPC]; SR &= ~SR_EXL; check_irqs(); mips3.lld_value ^= 0xffffffff; mips3.ll_value ^= 0xffffffff; break; |
| 1139 | 594 | default: invalid_instruction(op); break; |
| 1140 | 595 | } |
| 1141 | 596 | break; |
| r869 | r870 | |
| 1152 | 607 | INLINE UINT32 get_cop1_reg32(int idx) |
| 1153 | 608 | { |
| 1154 | 609 | if (IS_FR0) |
| 1155 | | return ((UINT32 *)&mips3.cpr[1][0])[idx]; |
| 610 | return ((UINT32 *)&mips3.core.cpr[1][0])[idx]; |
| 1156 | 611 | else |
| 1157 | | return mips3.cpr[1][idx]; |
| 612 | return mips3.core.cpr[1][idx]; |
| 1158 | 613 | } |
| 1159 | 614 | |
| 1160 | 615 | INLINE UINT64 get_cop1_reg64(int idx) |
| 1161 | 616 | { |
| 1162 | 617 | if (IS_FR0) |
| 1163 | | return ((UINT64 *)&mips3.cpr[1][0])[idx/2]; |
| 618 | return ((UINT64 *)&mips3.core.cpr[1][0])[idx/2]; |
| 1164 | 619 | else |
| 1165 | | return mips3.cpr[1][idx]; |
| 620 | return mips3.core.cpr[1][idx]; |
| 1166 | 621 | } |
| 1167 | 622 | |
| 1168 | 623 | INLINE void set_cop1_reg32(int idx, UINT32 val) |
| 1169 | 624 | { |
| 1170 | 625 | if (IS_FR0) |
| 1171 | | ((UINT32 *)&mips3.cpr[1][0])[idx] = val; |
| 626 | ((UINT32 *)&mips3.core.cpr[1][0])[idx] = val; |
| 1172 | 627 | else |
| 1173 | | mips3.cpr[1][idx] = val; |
| 628 | mips3.core.cpr[1][idx] = val; |
| 1174 | 629 | } |
| 1175 | 630 | |
| 1176 | 631 | INLINE void set_cop1_reg64(int idx, UINT64 val) |
| 1177 | 632 | { |
| 1178 | 633 | if (IS_FR0) |
| 1179 | | ((UINT64 *)&mips3.cpr[1][0])[idx/2] = val; |
| 634 | ((UINT64 *)&mips3.core.cpr[1][0])[idx/2] = val; |
| 1180 | 635 | else |
| 1181 | | mips3.cpr[1][idx] = val; |
| 636 | mips3.core.cpr[1][idx] = val; |
| 1182 | 637 | } |
| 1183 | 638 | |
| 1184 | 639 | INLINE UINT64 get_cop1_creg(int idx) |
| 1185 | 640 | { |
| 1186 | | return mips3.ccr[1][idx]; |
| 641 | return mips3.core.ccr[1][idx]; |
| 1187 | 642 | } |
| 1188 | 643 | |
| 1189 | 644 | INLINE void set_cop1_creg(int idx, UINT64 val) |
| 1190 | 645 | { |
| 1191 | | mips3.ccr[1][idx] = val; |
| 646 | mips3.core.ccr[1][idx] = val; |
| 1192 | 647 | } |
| 1193 | 648 | |
| 1194 | 649 | INLINE void handle_cop1_fr0(UINT32 op) |
| r869 | r870 | |
| 1213 | 668 | { |
| 1214 | 669 | case 0x00: /* BCzF */ if (!GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); break; |
| 1215 | 670 | case 0x01: /* BCzT */ if (GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); break; |
| 1216 | | case 0x02: /* BCzFL */ if (!GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); else mips3.pc += 4; break; |
| 1217 | | case 0x03: /* BCzTL */ if (GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); else mips3.pc += 4; break; |
| 671 | case 0x02: /* BCzFL */ if (!GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); else mips3.core.pc += 4; break; |
| 672 | case 0x03: /* BCzTL */ if (GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); else mips3.core.pc += 4; break; |
| 1218 | 673 | } |
| 1219 | 674 | break; |
| 1220 | 675 | default: |
| r869 | r870 | |
| 1569 | 1024 | { |
| 1570 | 1025 | case 0x00: /* BCzF */ if (!GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); break; |
| 1571 | 1026 | case 0x01: /* BCzT */ if (GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); break; |
| 1572 | | case 0x02: /* BCzFL */ if (!GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); else mips3.pc += 4; break; |
| 1573 | | case 0x03: /* BCzTL */ if (GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); else mips3.pc += 4; break; |
| 1027 | case 0x02: /* BCzFL */ if (!GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); else mips3.core.pc += 4; break; |
| 1028 | case 0x03: /* BCzTL */ if (GET_FCC((op >> 18) & 7)) ADDPC(SIMMVAL); else mips3.core.pc += 4; break; |
| 1574 | 1029 | } |
| 1575 | 1030 | break; |
| 1576 | 1031 | default: |
| r869 | r870 | |
| 2067 | 1522 | |
| 2068 | 1523 | INLINE UINT64 get_cop2_reg(int idx) |
| 2069 | 1524 | { |
| 2070 | | return mips3.cpr[2][idx]; |
| 1525 | return mips3.core.cpr[2][idx]; |
| 2071 | 1526 | } |
| 2072 | 1527 | |
| 2073 | 1528 | INLINE void set_cop2_reg(int idx, UINT64 val) |
| 2074 | 1529 | { |
| 2075 | | mips3.cpr[2][idx] = val; |
| 1530 | mips3.core.cpr[2][idx] = val; |
| 2076 | 1531 | } |
| 2077 | 1532 | |
| 2078 | 1533 | INLINE UINT64 get_cop2_creg(int idx) |
| 2079 | 1534 | { |
| 2080 | | return mips3.ccr[2][idx]; |
| 1535 | return mips3.core.ccr[2][idx]; |
| 2081 | 1536 | } |
| 2082 | 1537 | |
| 2083 | 1538 | INLINE void set_cop2_creg(int idx, UINT64 val) |
| 2084 | 1539 | { |
| 2085 | | mips3.ccr[2][idx] = val; |
| 1540 | mips3.core.ccr[2][idx] = val; |
| 2086 | 1541 | } |
| 2087 | 1542 | |
| 2088 | 1543 | INLINE void handle_cop2(UINT32 op) |
| r869 | r870 | |
| 2101 | 1556 | case 0x08: /* BC */ |
| 2102 | 1557 | switch (RTREG) |
| 2103 | 1558 | { |
| 2104 | | case 0x00: /* BCzF */ if (!mips3.cf[2]) ADDPC(SIMMVAL); break; |
| 2105 | | case 0x01: /* BCzF */ if (mips3.cf[2]) ADDPC(SIMMVAL); break; |
| 1559 | case 0x00: /* BCzF */ if (!mips3.core.cf[2]) ADDPC(SIMMVAL); break; |
| 1560 | case 0x01: /* BCzF */ if (mips3.core.cf[2]) ADDPC(SIMMVAL); break; |
| 2106 | 1561 | case 0x02: /* BCzFL */ invalid_instruction(op); break; |
| 2107 | 1562 | case 0x03: /* BCzTL */ invalid_instruction(op); break; |
| 2108 | 1563 | default: invalid_instruction(op); break; |
| r869 | r870 | |
| 2142 | 1597 | mips3.interrupt_cycles = 0; |
| 2143 | 1598 | |
| 2144 | 1599 | /* update timers & such */ |
| 2145 | | update_cycle_counting(); |
| 1600 | mips3com_update_cycle_counting(&mips3.core); |
| 2146 | 1601 | |
| 2147 | 1602 | /* check for IRQs */ |
| 2148 | 1603 | check_irqs(); |
| r869 | r870 | |
| 2155 | 1610 | UINT32 temp; |
| 2156 | 1611 | |
| 2157 | 1612 | /* see if we crossed a page boundary */ |
| 2158 | | if ((mips3.pc ^ mips3.ppc) & 0xfffff000) |
| 1613 | if ((mips3.core.pc ^ mips3.ppc) & 0xfffff000) |
| 2159 | 1614 | if (!update_pcbase()) |
| 2160 | 1615 | continue; |
| 2161 | 1616 | |
| 2162 | 1617 | /* debugging */ |
| 2163 | | mips3.ppc = mips3.pc; |
| 1618 | mips3.ppc = mips3.core.pc; |
| 2164 | 1619 | CALL_MAME_DEBUG; |
| 2165 | 1620 | |
| 2166 | 1621 | /* instruction fetch */ |
| 2167 | | op = ROPCODE(mips3.pcbase | (mips3.pc & 0xfff)); |
| 1622 | op = ROPCODE(mips3.pcbase | (mips3.core.pc & 0xfff)); |
| 2168 | 1623 | |
| 2169 | 1624 | /* adjust for next PC */ |
| 2170 | 1625 | if (mips3.nextpc != ~0) |
| 2171 | 1626 | { |
| 2172 | | mips3.pc = mips3.nextpc; |
| 1627 | mips3.core.pc = mips3.nextpc; |
| 2173 | 1628 | mips3.nextpc = ~0; |
| 2174 | 1629 | } |
| 2175 | 1630 | else |
| 2176 | | mips3.pc += 4; |
| 1631 | mips3.core.pc += 4; |
| 2177 | 1632 | |
| 2178 | 1633 | /* parse the instruction */ |
| 2179 | 1634 | switch (op >> 26) |
| r869 | r870 | |
| 2305 | 1760 | { |
| 2306 | 1761 | case 0x00: /* BLTZ */ if ((INT64)RSVAL64 < 0) ADDPC(SIMMVAL); break; |
| 2307 | 1762 | case 0x01: /* BGEZ */ if ((INT64)RSVAL64 >= 0) ADDPC(SIMMVAL); break; |
| 2308 | | case 0x02: /* BLTZL */ if ((INT64)RSVAL64 < 0) ADDPC(SIMMVAL); else mips3.pc += 4; break; |
| 2309 | | case 0x03: /* BGEZL */ if ((INT64)RSVAL64 >= 0) ADDPC(SIMMVAL); else mips3.pc += 4; break; |
| 1763 | case 0x02: /* BLTZL */ if ((INT64)RSVAL64 < 0) ADDPC(SIMMVAL); else mips3.core.pc += 4; break; |
| 1764 | case 0x03: /* BGEZL */ if ((INT64)RSVAL64 >= 0) ADDPC(SIMMVAL); else mips3.core.pc += 4; break; |
| 2310 | 1765 | case 0x08: /* TGEI */ if ((INT64)RSVAL64 >= SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; |
| 2311 | 1766 | case 0x09: /* TGEIU */ if (RSVAL64 >= SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; |
| 2312 | 1767 | case 0x0a: /* TLTI */ if ((INT64)RSVAL64 < SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; |
| r869 | r870 | |
| 2315 | 1770 | case 0x0e: /* TNEI */ if (RSVAL64 != SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; |
| 2316 | 1771 | case 0x10: /* BLTZAL */ if ((INT64)RSVAL64 < 0) ADDPCL(SIMMVAL,31); break; |
| 2317 | 1772 | case 0x11: /* BGEZAL */ if ((INT64)RSVAL64 >= 0) ADDPCL(SIMMVAL,31); break; |
| 2318 | | case 0x12: /* BLTZALL */ if ((INT64)RSVAL64 < 0) ADDPCL(SIMMVAL,31) else mips3.pc += 4; break; |
| 2319 | | case 0x13: /* BGEZALL */ if ((INT64)RSVAL64 >= 0) ADDPCL(SIMMVAL,31) else mips3.pc += 4; break; |
| 1773 | case 0x12: /* BLTZALL */ if ((INT64)RSVAL64 < 0) ADDPCL(SIMMVAL,31) else mips3.core.pc += 4; break; |
| 1774 | case 0x13: /* BGEZALL */ if ((INT64)RSVAL64 >= 0) ADDPCL(SIMMVAL,31) else mips3.core.pc += 4; break; |
| 2320 | 1775 | default: /* ??? */ invalid_instruction(op); break; |
| 2321 | 1776 | } |
| 2322 | 1777 | break; |
| r869 | r870 | |
| 2342 | 1797 | case 0x11: /* COP1 */ if (IS_FR0) handle_cop1_fr0(op); else handle_cop1_fr1(op); break; |
| 2343 | 1798 | case 0x12: /* COP2 */ handle_cop2(op); break; |
| 2344 | 1799 | case 0x13: /* COP1X - R5000 */if (IS_FR0) handle_cop1x_fr0(op); else handle_cop1x_fr1(op); break; |
| 2345 | | case 0x14: /* BEQL */ if (RSVAL64 == RTVAL64) ADDPC(SIMMVAL); else mips3.pc += 4; break; |
| 2346 | | case 0x15: /* BNEL */ if (RSVAL64 != RTVAL64) ADDPC(SIMMVAL); else mips3.pc += 4; break; |
| 2347 | | case 0x16: /* BLEZL */ if ((INT64)RSVAL64 <= 0) ADDPC(SIMMVAL); else mips3.pc += 4; break; |
| 2348 | | case 0x17: /* BGTZL */ if ((INT64)RSVAL64 > 0) ADDPC(SIMMVAL); else mips3.pc += 4; break; |
| 1800 | case 0x14: /* BEQL */ if (RSVAL64 == RTVAL64) ADDPC(SIMMVAL); else mips3.core.pc += 4; break; |
| 1801 | case 0x15: /* BNEL */ if (RSVAL64 != RTVAL64) ADDPC(SIMMVAL); else mips3.core.pc += 4; break; |
| 1802 | case 0x16: /* BLEZL */ if ((INT64)RSVAL64 <= 0) ADDPC(SIMMVAL); else mips3.core.pc += 4; break; |
| 1803 | case 0x17: /* BGTZL */ if ((INT64)RSVAL64 > 0) ADDPC(SIMMVAL); else mips3.core.pc += 4; break; |
| 2349 | 1804 | case 0x18: /* DADDI */ |
| 2350 | 1805 | if (ENABLE_OVERFLOWS && RSVAL64 > ~SIMMVAL) generate_exception(EXCEPTION_OVERFLOW, 1); |
| 2351 | 1806 | else if (RTREG) RTVAL64 = RSVAL64 + (INT64)SIMMVAL; |
| r869 | r870 | |
| 2433 | 1888 | |
| 2434 | 1889 | |
| 2435 | 1890 | /*************************************************************************** |
| 2436 | | DISASSEMBLY HOOK |
| 2437 | | ***************************************************************************/ |
| 2438 | | |
| 2439 | | #ifdef MAME_DEBUG |
| 2440 | | static offs_t mips3_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) |
| 2441 | | { |
| 2442 | | extern unsigned dasmmips3(char *, unsigned, UINT32); |
| 2443 | | UINT32 op = *(UINT32 *)oprom; |
| 2444 | | if (mips3.bigendian) |
| 2445 | | op = BIG_ENDIANIZE_INT32(op); |
| 2446 | | else |
| 2447 | | op = LITTLE_ENDIANIZE_INT32(op); |
| 2448 | | return dasmmips3(buffer, pc, op); |
| 2449 | | } |
| 2450 | | #endif /* MAME_DEBUG */ |
| 2451 | | |
| 2452 | | |
| 2453 | | |
| 2454 | | /*************************************************************************** |
| 2455 | | DOUBLEWORD READS/WRITES |
| 2456 | | ***************************************************************************/ |
| 2457 | | |
| 2458 | | static UINT64 read_qword_32be(offs_t offset) |
| 2459 | | { |
| 2460 | | UINT64 result = (UINT64)program_read_dword_32be(offset) << 32; |
| 2461 | | return result | program_read_dword_32be(offset + 4); |
| 2462 | | } |
| 2463 | | |
| 2464 | | static UINT64 read_qword_32le(offs_t offset) |
| 2465 | | { |
| 2466 | | UINT64 result = program_read_dword_32le(offset); |
| 2467 | | return result | ((UINT64)program_read_dword_32le(offset + 4) << 32); |
| 2468 | | } |
| 2469 | | |
| 2470 | | static void write_qword_32be(offs_t offset, UINT64 data) |
| 2471 | | { |
| 2472 | | program_write_dword_32be(offset, data >> 32); |
| 2473 | | program_write_dword_32be(offset + 4, data); |
| 2474 | | } |
| 2475 | | |
| 2476 | | static void write_qword_32le(offs_t offset, UINT64 data) |
| 2477 | | { |
| 2478 | | program_write_dword_32le(offset, data); |
| 2479 | | program_write_dword_32le(offset + 4, data >> 32); |
| 2480 | | } |
| 2481 | | |
| 2482 | | |
| 2483 | | |
| 2484 | | /*************************************************************************** |
| 2485 | 1891 | COMPLEX OPCODE IMPLEMENTATIONS |
| 2486 | 1892 | ***************************************************************************/ |
| 2487 | 1893 | |
| r869 | r870 | |
| 2722 | 2128 | |
| 2723 | 2129 | |
| 2724 | 2130 | |
| 2725 | | /************************************************************************** |
| 2726 | | * Generic set_info |
| 2727 | | **************************************************************************/ |
| 2131 | /*************************************************************************** |
| 2132 | GENERIC GET/SET INFO |
| 2133 | ***************************************************************************/ |
| 2728 | 2134 | |
| 2729 | 2135 | static void mips3_set_info(UINT32 state, cpuinfo *info) |
| 2730 | 2136 | { |
| 2731 | | switch (state) |
| 2732 | | { |
| 2733 | | /* --- the following bits of info are set as 64-bit signed integers --- */ |
| 2734 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ0: set_irq_line(MIPS3_IRQ0, info->i); break; |
| 2735 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ1: set_irq_line(MIPS3_IRQ1, info->i); break; |
| 2736 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ2: set_irq_line(MIPS3_IRQ2, info->i); break; |
| 2737 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ3: set_irq_line(MIPS3_IRQ3, info->i); break; |
| 2738 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ4: set_irq_line(MIPS3_IRQ4, info->i); break; |
| 2739 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ5: set_irq_line(MIPS3_IRQ5, info->i); break; |
| 2740 | | |
| 2741 | | case CPUINFO_INT_PC: |
| 2742 | | case CPUINFO_INT_REGISTER + MIPS3_PC: mips3.pc = info->i; break; |
| 2743 | | case CPUINFO_INT_REGISTER + MIPS3_SR: mips3.cpr[0][COP0_Status] = info->i; break; |
| 2744 | | case CPUINFO_INT_REGISTER + MIPS3_EPC: mips3.cpr[0][COP0_EPC] = info->i; break; |
| 2745 | | case CPUINFO_INT_REGISTER + MIPS3_CAUSE: mips3.cpr[0][COP0_Cause] = info->i; break; |
| 2746 | | case CPUINFO_INT_REGISTER + MIPS3_COUNT: mips3.cpr[0][COP0_Count] = info->i; break; |
| 2747 | | case CPUINFO_INT_REGISTER + MIPS3_COMPARE: mips3.cpr[0][COP0_Compare] = info->i; break; |
| 2748 | | case CPUINFO_INT_REGISTER + MIPS3_INDEX: mips3.cpr[0][COP0_Index] = info->i; break; |
| 2749 | | case CPUINFO_INT_REGISTER + MIPS3_RANDOM: mips3.cpr[0][COP0_Random] = info->i; break; |
| 2750 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYHI: mips3.cpr[0][COP0_EntryHi] = info->i; break; |
| 2751 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO0: mips3.cpr[0][COP0_EntryLo0] = info->i; break; |
| 2752 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO1: mips3.cpr[0][COP0_EntryLo1] = info->i; break; |
| 2753 | | case CPUINFO_INT_REGISTER + MIPS3_PAGEMASK: mips3.cpr[0][COP0_PageMask] = info->i; break; |
| 2754 | | case CPUINFO_INT_REGISTER + MIPS3_WIRED: mips3.cpr[0][COP0_Wired] = info->i; break; |
| 2755 | | case CPUINFO_INT_REGISTER + MIPS3_BADVADDR: mips3.cpr[0][COP0_BadVAddr] = info->i; break; |
| 2756 | | |
| 2757 | | case CPUINFO_INT_REGISTER + MIPS3_R0: mips3.r[0] = info->i; break; |
| 2758 | | case CPUINFO_INT_REGISTER + MIPS3_R1: mips3.r[1] = info->i; break; |
| 2759 | | case CPUINFO_INT_REGISTER + MIPS3_R2: mips3.r[2] = info->i; break; |
| 2760 | | case CPUINFO_INT_REGISTER + MIPS3_R3: mips3.r[3] = info->i; break; |
| 2761 | | case CPUINFO_INT_REGISTER + MIPS3_R4: mips3.r[4] = info->i; break; |
| 2762 | | case CPUINFO_INT_REGISTER + MIPS3_R5: mips3.r[5] = info->i; break; |
| 2763 | | case CPUINFO_INT_REGISTER + MIPS3_R6: mips3.r[6] = info->i; break; |
| 2764 | | case CPUINFO_INT_REGISTER + MIPS3_R7: mips3.r[7] = info->i; break; |
| 2765 | | case CPUINFO_INT_REGISTER + MIPS3_R8: mips3.r[8] = info->i; break; |
| 2766 | | case CPUINFO_INT_REGISTER + MIPS3_R9: mips3.r[9] = info->i; break; |
| 2767 | | case CPUINFO_INT_REGISTER + MIPS3_R10: mips3.r[10] = info->i; break; |
| 2768 | | case CPUINFO_INT_REGISTER + MIPS3_R11: mips3.r[11] = info->i; break; |
| 2769 | | case CPUINFO_INT_REGISTER + MIPS3_R12: mips3.r[12] = info->i; break; |
| 2770 | | case CPUINFO_INT_REGISTER + MIPS3_R13: mips3.r[13] = info->i; break; |
| 2771 | | case CPUINFO_INT_REGISTER + MIPS3_R14: mips3.r[14] = info->i; break; |
| 2772 | | case CPUINFO_INT_REGISTER + MIPS3_R15: mips3.r[15] = info->i; break; |
| 2773 | | case CPUINFO_INT_REGISTER + MIPS3_R16: mips3.r[16] = info->i; break; |
| 2774 | | case CPUINFO_INT_REGISTER + MIPS3_R17: mips3.r[17] = info->i; break; |
| 2775 | | case CPUINFO_INT_REGISTER + MIPS3_R18: mips3.r[18] = info->i; break; |
| 2776 | | case CPUINFO_INT_REGISTER + MIPS3_R19: mips3.r[19] = info->i; break; |
| 2777 | | case CPUINFO_INT_REGISTER + MIPS3_R20: mips3.r[20] = info->i; break; |
| 2778 | | case CPUINFO_INT_REGISTER + MIPS3_R21: mips3.r[21] = info->i; break; |
| 2779 | | case CPUINFO_INT_REGISTER + MIPS3_R22: mips3.r[22] = info->i; break; |
| 2780 | | case CPUINFO_INT_REGISTER + MIPS3_R23: mips3.r[23] = info->i; break; |
| 2781 | | case CPUINFO_INT_REGISTER + MIPS3_R24: mips3.r[24] = info->i; break; |
| 2782 | | case CPUINFO_INT_REGISTER + MIPS3_R25: mips3.r[25] = info->i; break; |
| 2783 | | case CPUINFO_INT_REGISTER + MIPS3_R26: mips3.r[26] = info->i; break; |
| 2784 | | case CPUINFO_INT_REGISTER + MIPS3_R27: mips3.r[27] = info->i; break; |
| 2785 | | case CPUINFO_INT_REGISTER + MIPS3_R28: mips3.r[28] = info->i; break; |
| 2786 | | case CPUINFO_INT_REGISTER + MIPS3_R29: mips3.r[29] = info->i; break; |
| 2787 | | case CPUINFO_INT_REGISTER + MIPS3_R30: mips3.r[30] = info->i; break; |
| 2788 | | case CPUINFO_INT_SP: |
| 2789 | | case CPUINFO_INT_REGISTER + MIPS3_R31: mips3.r[31] = info->i; break; |
| 2790 | | case CPUINFO_INT_REGISTER + MIPS3_HI: mips3.hi = info->i; break; |
| 2791 | | case CPUINFO_INT_REGISTER + MIPS3_LO: mips3.lo = info->i; break; |
| 2792 | | } |
| 2137 | /* everything is handled generically here */ |
| 2138 | mips3com_set_info(&mips3.core, state, info); |
| 2793 | 2139 | } |
| 2794 | 2140 | |
| 2795 | 2141 | |
| 2796 | | |
| 2797 | | /************************************************************************** |
| 2798 | | * Generic get_info |
| 2799 | | **************************************************************************/ |
| 2800 | | |
| 2801 | 2142 | void mips3_get_info(UINT32 state, cpuinfo *info) |
| 2802 | 2143 | { |
| 2803 | | UINT64 temp64; |
| 2804 | | |
| 2805 | 2144 | switch (state) |
| 2806 | 2145 | { |
| 2807 | 2146 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2808 | 2147 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(mips3); break; |
| 2809 | | case CPUINFO_INT_INPUT_LINES: info->i = 6; break; |
| 2810 | | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; |
| 2811 | | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 2812 | | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; |
| 2813 | | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 4; break; |
| 2814 | | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; |
| 2815 | | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
| 2816 | | case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
| 2817 | | |
| 2818 | | case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; |
| 2819 | | case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; |
| 2820 | | case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; |
| 2821 | | case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; |
| 2822 | | case CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 12; break; |
| 2823 | | |
| 2824 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ0: info->i = (mips3.cpr[0][COP0_Cause] & 0x400) ? ASSERT_LINE : CLEAR_LINE; break; |
| 2825 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ1: info->i = (mips3.cpr[0][COP0_Cause] & 0x800) ? ASSERT_LINE : CLEAR_LINE; break; |
| 2826 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ2: info->i = (mips3.cpr[0][COP0_Cause] & 0x1000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 2827 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ3: info->i = (mips3.cpr[0][COP0_Cause] & 0x2000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 2828 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ4: info->i = (mips3.cpr[0][COP0_Cause] & 0x4000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 2829 | | case CPUINFO_INT_INPUT_STATE + MIPS3_IRQ5: info->i = (mips3.cpr[0][COP0_Cause] & 0x8000) ? ASSERT_LINE : CLEAR_LINE; break; |
| 2830 | | |
| 2831 | 2148 | case CPUINFO_INT_PREVIOUSPC: info->i = mips3.ppc; break; |
| 2832 | 2149 | |
| 2833 | | case CPUINFO_INT_PC: |
| 2834 | | case CPUINFO_INT_REGISTER + MIPS3_PC: info->i = mips3.pc; break; |
| 2835 | | case CPUINFO_INT_REGISTER + MIPS3_SR: info->i = mips3.cpr[0][COP0_Status]; break; |
| 2836 | | case CPUINFO_INT_REGISTER + MIPS3_EPC: info->i = mips3.cpr[0][COP0_EPC]; break; |
| 2837 | | case CPUINFO_INT_REGISTER + MIPS3_CAUSE: info->i = mips3.cpr[0][COP0_Cause]; break; |
| 2838 | | case CPUINFO_INT_REGISTER + MIPS3_COUNT: info->i = ((activecpu_gettotalcycles64() - mips3.count_zero_time) / 2); break; |
| 2839 | | case CPUINFO_INT_REGISTER + MIPS3_COMPARE: info->i = mips3.cpr[0][COP0_Compare]; break; |
| 2840 | | case CPUINFO_INT_REGISTER + MIPS3_INDEX: info->i = mips3.cpr[0][COP0_Index]; break; |
| 2841 | | case CPUINFO_INT_REGISTER + MIPS3_RANDOM: info->i = mips3.cpr[0][COP0_Random]; break; |
| 2842 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYHI: info->i = mips3.cpr[0][COP0_EntryHi]; break; |
| 2843 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO0: info->i = mips3.cpr[0][COP0_EntryLo0]; break; |
| 2844 | | case CPUINFO_INT_REGISTER + MIPS3_ENTRYLO1: info->i = mips3.cpr[0][COP0_EntryLo1]; break; |
| 2845 | | case CPUINFO_INT_REGISTER + MIPS3_PAGEMASK: info->i = mips3.cpr[0][COP0_PageMask]; break; |
| 2846 | | case CPUINFO_INT_REGISTER + MIPS3_WIRED: info->i = get_cop0_reg(COP0_Wired); break; |
| 2847 | | case CPUINFO_INT_REGISTER + MIPS3_BADVADDR: info->i = mips3.cpr[0][COP0_BadVAddr]; break; |
| 2848 | | |
| 2849 | | case CPUINFO_INT_REGISTER + MIPS3_R0: info->i = mips3.r[0]; break; |
| 2850 | | case CPUINFO_INT_REGISTER + MIPS3_R1: info->i = mips3.r[1]; break; |
| 2851 | | case CPUINFO_INT_REGISTER + MIPS3_R2: info->i = mips3.r[2]; break; |
| 2852 | | case CPUINFO_INT_REGISTER + MIPS3_R3: info->i = mips3.r[3]; break; |
| 2853 | | case CPUINFO_INT_REGISTER + MIPS3_R4: info->i = mips3.r[4]; break; |
| 2854 | | case CPUINFO_INT_REGISTER + MIPS3_R5: info->i = mips3.r[5]; break; |
| 2855 | | case CPUINFO_INT_REGISTER + MIPS3_R6: info->i = mips3.r[6]; break; |
| 2856 | | case CPUINFO_INT_REGISTER + MIPS3_R7: info->i = mips3.r[7]; break; |
| 2857 | | case CPUINFO_INT_REGISTER + MIPS3_R8: info->i = mips3.r[8]; break; |
| 2858 | | case CPUINFO_INT_REGISTER + MIPS3_R9: info->i = mips3.r[9]; break; |
| 2859 | | case CPUINFO_INT_REGISTER + MIPS3_R10: info->i = mips3.r[10]; break; |
| 2860 | | case CPUINFO_INT_REGISTER + MIPS3_R11: info->i = mips3.r[11]; break; |
| 2861 | | case CPUINFO_INT_REGISTER + MIPS3_R12: info->i = mips3.r[12]; break; |
| 2862 | | case CPUINFO_INT_REGISTER + MIPS3_R13: info->i = mips3.r[13]; break; |
| 2863 | | case CPUINFO_INT_REGISTER + MIPS3_R14: info->i = mips3.r[14]; break; |
| 2864 | | case CPUINFO_INT_REGISTER + MIPS3_R15: info->i = mips3.r[15]; break; |
| 2865 | | case CPUINFO_INT_REGISTER + MIPS3_R16: info->i = mips3.r[16]; break; |
| 2866 | | case CPUINFO_INT_REGISTER + MIPS3_R17: info->i = mips3.r[17]; break; |
| 2867 | | case CPUINFO_INT_REGISTER + MIPS3_R18: info->i = mips3.r[18]; break; |
| 2868 | | case CPUINFO_INT_REGISTER + MIPS3_R19: info->i = mips3.r[19]; break; |
| 2869 | | case CPUINFO_INT_REGISTER + MIPS3_R20: info->i = mips3.r[20]; break; |
| 2870 | | case CPUINFO_INT_REGISTER + MIPS3_R21: info->i = mips3.r[21]; break; |
| 2871 | | case CPUINFO_INT_REGISTER + MIPS3_R22: info->i = mips3.r[22]; break; |
| 2872 | | case CPUINFO_INT_REGISTER + MIPS3_R23: info->i = mips3.r[23]; break; |
| 2873 | | case CPUINFO_INT_REGISTER + MIPS3_R24: info->i = mips3.r[24]; break; |
| 2874 | | case CPUINFO_INT_REGISTER + MIPS3_R25: info->i = mips3.r[25]; break; |
| 2875 | | case CPUINFO_INT_REGISTER + MIPS3_R26: info->i = mips3.r[26]; break; |
| 2876 | | case CPUINFO_INT_REGISTER + MIPS3_R27: info->i = mips3.r[27]; break; |
| 2877 | | case CPUINFO_INT_REGISTER + MIPS3_R28: info->i = mips3.r[28]; break; |
| 2878 | | case CPUINFO_INT_REGISTER + MIPS3_R29: info->i = mips3.r[29]; break; |
| 2879 | | case CPUINFO_INT_REGISTER + MIPS3_R30: info->i = mips3.r[30]; break; |
| 2880 | | case CPUINFO_INT_SP: |
| 2881 | | case CPUINFO_INT_REGISTER + MIPS3_R31: info->i = mips3.r[31]; break; |
| 2882 | | case CPUINFO_INT_REGISTER + MIPS3_HI: info->i = mips3.hi; break; |
| 2883 | | case CPUINFO_INT_REGISTER + MIPS3_LO: info->i = mips3.lo; break; |
| 2884 | | |
| 2885 | 2150 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2886 | 2151 | case CPUINFO_PTR_SET_INFO: info->setinfo = mips3_set_info; break; |
| 2887 | 2152 | case CPUINFO_PTR_GET_CONTEXT: info->getcontext = mips3_get_context; break; |
| 2888 | 2153 | case CPUINFO_PTR_SET_CONTEXT: info->setcontext = mips3_set_context; break; |
| 2889 | | case CPUINFO_PTR_INIT: info->init = mips3_init; break; |
| 2890 | | case CPUINFO_PTR_RESET: /* provided per-CPU */ break; |
| 2891 | | case CPUINFO_PTR_EXIT: info->exit = mips3_exit; break; |
| 2154 | case CPUINFO_PTR_INIT: /* provided per-CPU */ break; |
| 2155 | case CPUINFO_PTR_RESET: info->reset = mips3_reset; break; |
| 2892 | 2156 | case CPUINFO_PTR_EXECUTE: info->execute = mips3_execute; break; |
| 2893 | | case CPUINFO_PTR_BURN: info->burn = NULL; break; |
| 2894 | 2157 | #ifdef MAME_DEBUG |
| 2895 | 2158 | case CPUINFO_PTR_DISASSEMBLE: info->disassemble = mips3_dasm; break; |
| 2896 | | #endif /* MAME_DEBUG */ |
| 2897 | | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &mips3_icount; break; |
| 2898 | | case CPUINFO_PTR_TRANSLATE: info->translate = translate_address; break; |
| 2159 | #endif |
| 2160 | case CPUINFO_PTR_TRANSLATE: info->translate = mips3_translate; break; |
| 2899 | 2161 | |
| 2900 | 2162 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2901 | | case CPUINFO_STR_NAME: strcpy(info->s, "MIPS III"); break; |
| 2902 | | case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "MIPS III"); break; |
| 2903 | | case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "1.0"); break; |
| 2904 | 2163 | case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; |
| 2905 | | case CPUINFO_STR_CORE_CREDITS: strcpy(info->s, "Copyright (C) Aaron Giles 2000-2004"); break; |
| 2906 | 2164 | |
| 2907 | | case CPUINFO_STR_FLAGS: strcpy(info->s, " "); break; |
| 2908 | | |
| 2909 | | case CPUINFO_STR_REGISTER + MIPS3_PC: sprintf(info->s, "PC: %08X", mips3.pc); break; |
| 2910 | | case CPUINFO_STR_REGISTER + MIPS3_SR: sprintf(info->s, "SR: %08X", (UINT32)mips3.cpr[0][COP0_Status]); break; |
| 2911 | | case CPUINFO_STR_REGISTER + MIPS3_EPC: sprintf(info->s, "EPC:%08X", (UINT32)mips3.cpr[0][COP0_EPC]); break; |
| 2912 | | case CPUINFO_STR_REGISTER + MIPS3_CAUSE: sprintf(info->s, "Cause:%08X", (UINT32)mips3.cpr[0][COP0_Cause]); break; |
| 2913 | | case CPUINFO_STR_REGISTER + MIPS3_COUNT: temp64 = ((activecpu_gettotalcycles64() - mips3.count_zero_time) / 2); sprintf(info->s, "Count:%08X%08X", (UINT32)(temp64 >> 32), (UINT32)temp64); break; |
| 2914 | | case CPUINFO_STR_REGISTER + MIPS3_COMPARE: sprintf(info->s, "Compare:%08X", (UINT32)mips3.cpr[0][COP0_Compare]); break; |
| 2915 | | case CPUINFO_STR_REGISTER + MIPS3_INDEX: sprintf(info->s, "Index:%08X", (UINT32)mips3.cpr[0][COP0_Index]); break; |
| 2916 | | case CPUINFO_STR_REGISTER + MIPS3_RANDOM: sprintf(info->s, "Random:%08X", (UINT32)mips3.cpr[0][COP0_Random]); break; |
| 2917 | | case CPUINFO_STR_REGISTER + MIPS3_ENTRYHI: sprintf(info->s, "EntryHi:%08X%08X", (UINT32)(mips3.cpr[0][COP0_EntryHi] >> 32), (UINT32)mips3.cpr[0][COP0_EntryHi]); break; |
| 2918 | | case CPUINFO_STR_REGISTER + MIPS3_ENTRYLO0: sprintf(info->s, "EntryLo0:%08X%08X", (UINT32)(mips3.cpr[0][COP0_EntryLo0] >> 32), (UINT32)mips3.cpr[0][COP0_EntryLo0]); break; |
| 2919 | | case CPUINFO_STR_REGISTER + MIPS3_ENTRYLO1: sprintf(info->s, "EntryLo1:%08X%08X", (UINT32)(mips3.cpr[0][COP0_EntryLo1] >> 32), (UINT32)mips3.cpr[0][COP0_EntryLo1]); break; |
| 2920 | | case CPUINFO_STR_REGISTER + MIPS3_PAGEMASK: sprintf(info->s, "PageMask:%08X%08X", (UINT32)(mips3.cpr[0][COP0_PageMask] >> 32), (UINT32)mips3.cpr[0][COP0_PageMask]); break; |
| 2921 | | case CPUINFO_STR_REGISTER + MIPS3_WIRED: sprintf(info->s, "Wired:%08X", (UINT32)mips3.cpr[0][COP0_Wired]); break; |
| 2922 | | case CPUINFO_STR_REGISTER + MIPS3_BADVADDR: sprintf(info->s, "BadVAddr:%08X", (UINT32)mips3.cpr[0][COP0_BadVAddr]); break; |
| 2923 | | |
| 2924 | | case CPUINFO_STR_REGISTER + MIPS3_R0: sprintf(info->s, "R0: %08X%08X", (UINT32)(mips3.r[0] >> 32), (UINT32)mips3.r[0]); break; |
| 2925 | | case CPUINFO_STR_REGISTER + MIPS3_R1: sprintf(info->s, "R1: %08X%08X", (UINT32)(mips3.r[1] >> 32), (UINT32)mips3.r[1]); break; |
| 2926 | | case CPUINFO_STR_REGISTER + MIPS3_R2: sprintf(info->s, "R2: %08X%08X", (UINT32)(mips3.r[2] >> 32), (UINT32)mips3.r[2]); break; |
| 2927 | | case CPUINFO_STR_REGISTER + MIPS3_R3: sprintf(info->s, "R3: %08X%08X", (UINT32)(mips3.r[3] >> 32), (UINT32)mips3.r[3]); break; |
| 2928 | | case CPUINFO_STR_REGISTER + MIPS3_R4: sprintf(info->s, "R4: %08X%08X", (UINT32)(mips3.r[4] >> 32), (UINT32)mips3.r[4]); break; |
| 2929 | | case CPUINFO_STR_REGISTER + MIPS3_R5: sprintf(info->s, "R5: %08X%08X", (UINT32)(mips3.r[5] >> 32), (UINT32)mips3.r[5]); break; |
| 2930 | | case CPUINFO_STR_REGISTER + MIPS3_R6: sprintf(info->s, "R6: %08X%08X", (UINT32)(mips3.r[6] >> 32), (UINT32)mips3.r[6]); break; |
| 2931 | | case CPUINFO_STR_REGISTER + MIPS3_R7: sprintf(info->s, "R7: %08X%08X", (UINT32)(mips3.r[7] >> 32), (UINT32)mips3.r[7]); break; |
| 2932 | | case CPUINFO_STR_REGISTER + MIPS3_R8: sprintf(info->s, "R8: %08X%08X", (UINT32)(mips3.r[8] >> 32), (UINT32)mips3.r[8]); break; |
| 2933 | | case CPUINFO_STR_REGISTER + MIPS3_R9: sprintf(info->s, "R9: %08X%08X", (UINT32)(mips3.r[9] >> 32), (UINT32)mips3.r[9]); break; |
| 2934 | | case CPUINFO_STR_REGISTER + MIPS3_R10: sprintf(info->s, "R10:%08X%08X", (UINT32)(mips3.r[10] >> 32), (UINT32)mips3.r[10]); break; |
| 2935 | | case CPUINFO_STR_REGISTER + MIPS3_R11: sprintf(info->s, "R11:%08X%08X", (UINT32)(mips3.r[11] >> 32), (UINT32)mips3.r[11]); break; |
| 2936 | | case CPUINFO_STR_REGISTER + MIPS3_R12: sprintf(info->s, "R12:%08X%08X", (UINT32)(mips3.r[12] >> 32), (UINT32)mips3.r[12]); break; |
| 2937 | | case CPUINFO_STR_REGISTER + MIPS3_R13: sprintf(info->s, "R13:%08X%08X", (UINT32)(mips3.r[13] >> 32), (UINT32)mips3.r[13]); break; |
| 2938 | | case CPUINFO_STR_REGISTER + MIPS3_R14: sprintf(info->s, "R14:%08X%08X", (UINT32)(mips3.r[14] >> 32), (UINT32)mips3.r[14]); break; |
| 2939 | | case CPUINFO_STR_REGISTER + MIPS3_R15: sprintf(info->s, "R15:%08X%08X", (UINT32)(mips3.r[15] >> 32), (UINT32)mips3.r[15]); break; |
| 2940 | | case CPUINFO_STR_REGISTER + MIPS3_R16: sprintf(info->s, "R16:%08X%08X", (UINT32)(mips3.r[16] >> 32), (UINT32)mips3.r[16]); break; |
| 2941 | | case CPUINFO_STR_REGISTER + MIPS3_R17: sprintf(info->s, "R17:%08X%08X", (UINT32)(mips3.r[17] >> 32), (UINT32)mips3.r[17]); break; |
| 2942 | | case CPUINFO_STR_REGISTER + MIPS3_R18: sprintf(info->s, "R18:%08X%08X", (UINT32)(mips3.r[18] >> 32), (UINT32)mips3.r[18]); break; |
| 2943 | | case CPUINFO_STR_REGISTER + MIPS3_R19: sprintf(info->s, "R19:%08X%08X", (UINT32)(mips3.r[19] >> 32), (UINT32)mips3.r[19]); break; |
| 2944 | | case CPUINFO_STR_REGISTER + MIPS3_R20: sprintf(info->s, "R20:%08X%08X", (UINT32)(mips3.r[20] >> 32), (UINT32)mips3.r[20]); break; |
| 2945 | | case CPUINFO_STR_REGISTER + MIPS3_R21: sprintf(info->s, "R21:%08X%08X", (UINT32)(mips3.r[21] >> 32), (UINT32)mips3.r[21]); break; |
| 2946 | | case CPUINFO_STR_REGISTER + MIPS3_R22: sprintf(info->s, "R22:%08X%08X", (UINT32)(mips3.r[22] >> 32), (UINT32)mips3.r[22]); break; |
| 2947 | | case CPUINFO_STR_REGISTER + MIPS3_R23: sprintf(info->s, "R23:%08X%08X", (UINT32)(mips3.r[23] >> 32), (UINT32)mips3.r[23]); break; |
| 2948 | | case CPUINFO_STR_REGISTER + MIPS3_R24: sprintf(info->s, "R24:%08X%08X", (UINT32)(mips3.r[24] >> 32), (UINT32)mips3.r[24]); break; |
| 2949 | | case CPUINFO_STR_REGISTER + MIPS3_R25: sprintf(info->s, "R25:%08X%08X", (UINT32)(mips3.r[25] >> 32), (UINT32)mips3.r[25]); break; |
| 2950 | | case CPUINFO_STR_REGISTER + MIPS3_R26: sprintf(info->s, "R26:%08X%08X", (UINT32)(mips3.r[26] >> 32), (UINT32)mips3.r[26]); break; |
| 2951 | | case CPUINFO_STR_REGISTER + MIPS3_R27: sprintf(info->s, "R27:%08X%08X", (UINT32)(mips3.r[27] >> 32), (UINT32)mips3.r[27]); break; |
| 2952 | | case CPUINFO_STR_REGISTER + MIPS3_R28: sprintf(info->s, "R28:%08X%08X", (UINT32)(mips3.r[28] >> 32), (UINT32)mips3.r[28]); break; |
| 2953 | | case CPUINFO_STR_REGISTER + MIPS3_R29: sprintf(info->s, "R29:%08X%08X", (UINT32)(mips3.r[29] >> 32), (UINT32)mips3.r[29]); break; |
| 2954 | | case CPUINFO_STR_REGISTER + MIPS3_R30: sprintf(info->s, "R30:%08X%08X", (UINT32)(mips3.r[30] >> 32), (UINT32)mips3.r[30]); break; |
| 2955 | | case CPUINFO_STR_REGISTER + MIPS3_R31: sprintf(info->s, "R31:%08X%08X", (UINT32)(mips3.r[31] >> 32), (UINT32)mips3.r[31]); break; |
| 2956 | | case CPUINFO_STR_REGISTER + MIPS3_HI: sprintf(info->s, "HI: %08X%08X", (UINT32)(mips3.hi >> 32), (UINT32)mips3.hi); break; |
| 2957 | | case CPUINFO_STR_REGISTER + MIPS3_LO: sprintf(info->s, "LO: %08X%08X", (UINT32)(mips3.lo >> 32), (UINT32)mips3.lo); break; |
| 2165 | /* --- everything else is handled generically --- */ |
| 2166 | default: mips3com_get_info(&mips3.core, state, info); break; |
| 2958 | 2167 | } |
| 2959 | 2168 | } |
| 2960 | 2169 | |
| 2961 | 2170 | |
| 2171 | |
| 2172 | /*************************************************************************** |
| 2173 | R4600 VARIANTS |
| 2174 | ***************************************************************************/ |
| 2175 | |
| 2962 | 2176 | #if (HAS_R4600) |
| 2963 | | /************************************************************************** |
| 2964 | | * CPU-specific set_info |
| 2965 | | **************************************************************************/ |
| 2177 | static void r4600be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2178 | { |
| 2179 | mips3com_init(&mips3.core, MIPS3_TYPE_R4600, TRUE, index, clock, config, irqcallback); |
| 2180 | } |
| 2966 | 2181 | |
| 2182 | static void r4600le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2183 | { |
| 2184 | mips3com_init(&mips3.core, MIPS3_TYPE_R4600, FALSE, index, clock, config, irqcallback); |
| 2185 | } |
| 2186 | |
| 2967 | 2187 | void r4600be_get_info(UINT32 state, cpuinfo *info) |
| 2968 | 2188 | { |
| 2969 | 2189 | switch (state) |
| r869 | r870 | |
| 2972 | 2192 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 2973 | 2193 | |
| 2974 | 2194 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2975 | | case CPUINFO_PTR_RESET: info->reset = r4600be_reset; break; |
| 2195 | case CPUINFO_PTR_INIT: info->init = r4600be_init; break; |
| 2976 | 2196 | |
| 2977 | 2197 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2978 | 2198 | case CPUINFO_STR_NAME: strcpy(info->s, "R4600 (big)"); break; |
| 2979 | 2199 | |
| 2200 | /* --- everything else is handled generically --- */ |
| 2980 | 2201 | default: mips3_get_info(state, info); break; |
| 2981 | 2202 | } |
| 2982 | 2203 | } |
| 2983 | 2204 | |
| 2984 | | |
| 2985 | 2205 | void r4600le_get_info(UINT32 state, cpuinfo *info) |
| 2986 | 2206 | { |
| 2987 | 2207 | switch (state) |
| r869 | r870 | |
| 2990 | 2210 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 2991 | 2211 | |
| 2992 | 2212 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2993 | | case CPUINFO_PTR_RESET: info->reset = r4600le_reset; break; |
| 2213 | case CPUINFO_PTR_INIT: info->init = r4600le_init; break; |
| 2994 | 2214 | |
| 2995 | 2215 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2996 | 2216 | case CPUINFO_STR_NAME: strcpy(info->s, "R4600 (little)"); break; |
| 2997 | 2217 | |
| 2218 | /* --- everything else is handled generically --- */ |
| 2998 | 2219 | default: mips3_get_info(state, info); break; |
| 2999 | 2220 | } |
| 3000 | 2221 | } |
| 3001 | 2222 | #endif |
| 3002 | 2223 | |
| 3003 | 2224 | |
| 2225 | |
| 2226 | /*************************************************************************** |
| 2227 | R4650 VARIANTS |
| 2228 | ***************************************************************************/ |
| 2229 | |
| 3004 | 2230 | #if (HAS_R4650) |
| 3005 | | /************************************************************************** |
| 3006 | | * CPU-specific set_info |
| 3007 | | **************************************************************************/ |
| 2231 | static void r4650be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2232 | { |
| 2233 | mips3com_init(&mips3.core, MIPS3_TYPE_R4650, TRUE, index, clock, config, irqcallback); |
| 2234 | } |
| 3008 | 2235 | |
| 2236 | static void r4650le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2237 | { |
| 2238 | mips3com_init(&mips3.core, MIPS3_TYPE_R4650, FALSE, index, clock, config, irqcallback); |
| 2239 | } |
| 2240 | |
| 3009 | 2241 | void r4650be_get_info(UINT32 state, cpuinfo *info) |
| 3010 | 2242 | { |
| 3011 | 2243 | switch (state) |
| r869 | r870 | |
| 3014 | 2246 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 3015 | 2247 | |
| 3016 | 2248 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3017 | | case CPUINFO_PTR_RESET: info->reset = r4600be_reset; break; |
| 2249 | case CPUINFO_PTR_INIT: info->init = r4650be_init; break; |
| 3018 | 2250 | |
| 3019 | 2251 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3020 | 2252 | case CPUINFO_STR_NAME: strcpy(info->s, "IDT R4650 (big)"); break; |
| 3021 | 2253 | |
| 2254 | /* --- everything else is handled generically --- */ |
| 3022 | 2255 | default: mips3_get_info(state, info); break; |
| 3023 | 2256 | } |
| 3024 | 2257 | } |
| 3025 | 2258 | |
| 3026 | | |
| 3027 | 2259 | void r4650le_get_info(UINT32 state, cpuinfo *info) |
| 3028 | 2260 | { |
| 3029 | 2261 | switch (state) |
| r869 | r870 | |
| 3032 | 2264 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 3033 | 2265 | |
| 3034 | 2266 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3035 | | case CPUINFO_PTR_RESET: info->reset = r4600le_reset; break; |
| 2267 | case CPUINFO_PTR_INIT: info->init = r4650le_init; break; |
| 3036 | 2268 | |
| 3037 | 2269 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3038 | 2270 | case CPUINFO_STR_NAME: strcpy(info->s, "IDT R4650 (little)"); break; |
| 3039 | 2271 | |
| 2272 | /* --- everything else is handled generically --- */ |
| 3040 | 2273 | default: mips3_get_info(state, info); break; |
| 3041 | 2274 | } |
| 3042 | 2275 | } |
| 3043 | 2276 | #endif |
| 3044 | 2277 | |
| 2278 | |
| 2279 | |
| 2280 | /*************************************************************************** |
| 2281 | R4700 VARIANTS |
| 2282 | ***************************************************************************/ |
| 2283 | |
| 3045 | 2284 | #if (HAS_R4700) |
| 3046 | | /************************************************************************** |
| 3047 | | * CPU-specific set_info |
| 3048 | | **************************************************************************/ |
| 2285 | static void r4700be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2286 | { |
| 2287 | mips3com_init(&mips3.core, MIPS3_TYPE_R4700, TRUE, index, clock, config, irqcallback); |
| 2288 | } |
| 3049 | 2289 | |
| 2290 | static void r4700le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2291 | { |
| 2292 | mips3com_init(&mips3.core, MIPS3_TYPE_R4700, FALSE, index, clock, config, irqcallback); |
| 2293 | } |
| 2294 | |
| 3050 | 2295 | void r4700be_get_info(UINT32 state, cpuinfo *info) |
| 3051 | 2296 | { |
| 3052 | 2297 | switch (state) |
| r869 | r870 | |
| 3055 | 2300 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 3056 | 2301 | |
| 3057 | 2302 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3058 | | case CPUINFO_PTR_RESET: info->reset = r4700be_reset; break; |
| 2303 | case CPUINFO_PTR_INIT: info->init = r4700be_init; break; |
| 3059 | 2304 | |
| 3060 | 2305 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3061 | 2306 | case CPUINFO_STR_NAME: strcpy(info->s, "R4700 (big)"); break; |
| 3062 | 2307 | |
| 2308 | /* --- everything else is handled generically --- */ |
| 3063 | 2309 | default: mips3_get_info(state, info); break; |
| 3064 | 2310 | } |
| 3065 | 2311 | } |
| r869 | r870 | |
| 3073 | 2319 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 3074 | 2320 | |
| 3075 | 2321 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3076 | | case CPUINFO_PTR_RESET: info->reset = r4700le_reset; break; |
| 2322 | case CPUINFO_PTR_INIT: info->init = r4700le_init; break; |
| 3077 | 2323 | |
| 3078 | 2324 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3079 | 2325 | case CPUINFO_STR_NAME: strcpy(info->s, "R4700 (little)"); break; |
| 3080 | 2326 | |
| 2327 | /* --- everything else is handled generically --- */ |
| 3081 | 2328 | default: mips3_get_info(state, info); break; |
| 3082 | 2329 | } |
| 3083 | 2330 | } |
| 3084 | 2331 | #endif |
| 3085 | 2332 | |
| 3086 | 2333 | |
| 2334 | |
| 2335 | /*************************************************************************** |
| 2336 | R5000 VARIANTS |
| 2337 | ***************************************************************************/ |
| 2338 | |
| 3087 | 2339 | #if (HAS_R5000) |
| 3088 | | /************************************************************************** |
| 3089 | | * CPU-specific set_info |
| 3090 | | **************************************************************************/ |
| 2340 | static void r5000be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2341 | { |
| 2342 | mips3com_init(&mips3.core, MIPS3_TYPE_R5000, TRUE, index, clock, config, irqcallback); |
| 2343 | } |
| 3091 | 2344 | |
| 2345 | static void r5000le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2346 | { |
| 2347 | mips3com_init(&mips3.core, MIPS3_TYPE_R5000, FALSE, index, clock, config, irqcallback); |
| 2348 | } |
| 2349 | |
| 3092 | 2350 | void r5000be_get_info(UINT32 state, cpuinfo *info) |
| 3093 | 2351 | { |
| 3094 | 2352 | switch (state) |
| r869 | r870 | |
| 3097 | 2355 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 3098 | 2356 | |
| 3099 | 2357 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3100 | | case CPUINFO_PTR_RESET: info->reset = r5000be_reset; break; |
| 2358 | case CPUINFO_PTR_INIT: info->init = r5000be_init; break; |
| 3101 | 2359 | |
| 3102 | 2360 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3103 | 2361 | case CPUINFO_STR_NAME: strcpy(info->s, "R5000 (big)"); break; |
| 3104 | 2362 | |
| 2363 | /* --- everything else is handled generically --- */ |
| 3105 | 2364 | default: mips3_get_info(state, info); break; |
| 3106 | 2365 | } |
| 3107 | 2366 | } |
| 3108 | 2367 | |
| 3109 | | |
| 3110 | 2368 | void r5000le_get_info(UINT32 state, cpuinfo *info) |
| 3111 | 2369 | { |
| 3112 | 2370 | switch (state) |
| r869 | r870 | |
| 3115 | 2373 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 3116 | 2374 | |
| 3117 | 2375 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3118 | | case CPUINFO_PTR_RESET: info->reset = r5000le_reset; break; |
| 2376 | case CPUINFO_PTR_INIT: info->init = r5000le_init; break; |
| 3119 | 2377 | |
| 3120 | 2378 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3121 | 2379 | case CPUINFO_STR_NAME: strcpy(info->s, "R5000 (little)"); break; |
| 3122 | 2380 | |
| 2381 | /* --- everything else is handled generically --- */ |
| 3123 | 2382 | default: mips3_get_info(state, info); break; |
| 3124 | 2383 | } |
| 3125 | 2384 | } |
| 3126 | 2385 | #endif |
| 3127 | 2386 | |
| 3128 | 2387 | |
| 2388 | |
| 2389 | /*************************************************************************** |
| 2390 | QED5271 VARIANTS |
| 2391 | ***************************************************************************/ |
| 2392 | |
| 3129 | 2393 | #if (HAS_QED5271) |
| 3130 | | /************************************************************************** |
| 3131 | | * CPU-specific set_info |
| 3132 | | **************************************************************************/ |
| 2394 | static void qed5271be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2395 | { |
| 2396 | mips3com_init(&mips3.core, MIPS3_TYPE_QED5271, TRUE, index, clock, config, irqcallback); |
| 2397 | } |
| 3133 | 2398 | |
| 2399 | static void qed5271le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2400 | { |
| 2401 | mips3com_init(&mips3.core, MIPS3_TYPE_QED5271, FALSE, index, clock, config, irqcallback); |
| 2402 | } |
| 2403 | |
| 3134 | 2404 | void qed5271be_get_info(UINT32 state, cpuinfo *info) |
| 3135 | 2405 | { |
| 3136 | 2406 | switch (state) |
| r869 | r870 | |
| 3139 | 2409 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 3140 | 2410 | |
| 3141 | 2411 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3142 | | case CPUINFO_PTR_RESET: info->reset = qed5271be_reset; break; |
| 2412 | case CPUINFO_PTR_INIT: info->init = qed5271be_init; break; |
| 3143 | 2413 | |
| 3144 | 2414 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3145 | 2415 | case CPUINFO_STR_NAME: strcpy(info->s, "QED5271 (big)"); break; |
| 3146 | 2416 | |
| 2417 | /* --- everything else is handled generically --- */ |
| 3147 | 2418 | default: mips3_get_info(state, info); break; |
| 3148 | 2419 | } |
| 3149 | 2420 | } |
| 3150 | 2421 | |
| 3151 | | |
| 3152 | 2422 | void qed5271le_get_info(UINT32 state, cpuinfo *info) |
| 3153 | 2423 | { |
| 3154 | 2424 | switch (state) |
| r869 | r870 | |
| 3157 | 2427 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 3158 | 2428 | |
| 3159 | 2429 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3160 | | case CPUINFO_PTR_RESET: info->reset = qed5271le_reset; break; |
| 2430 | case CPUINFO_PTR_INIT: info->init = qed5271le_init; break; |
| 3161 | 2431 | |
| 3162 | 2432 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3163 | 2433 | case CPUINFO_STR_NAME: strcpy(info->s, "QED5271 (little)"); break; |
| 3164 | 2434 | |
| 2435 | /* --- everything else is handled generically --- */ |
| 3165 | 2436 | default: mips3_get_info(state, info); break; |
| 3166 | 2437 | } |
| 3167 | 2438 | } |
| 3168 | 2439 | #endif |
| 3169 | 2440 | |
| 3170 | 2441 | |
| 2442 | |
| 2443 | /*************************************************************************** |
| 2444 | RM7000 VARIANTS |
| 2445 | ***************************************************************************/ |
| 2446 | |
| 3171 | 2447 | #if (HAS_RM7000) |
| 3172 | | /************************************************************************** |
| 3173 | | * CPU-specific set_info |
| 3174 | | **************************************************************************/ |
| 2448 | static void rm7000be_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2449 | { |
| 2450 | mips3com_init(&mips3.core, MIPS3_TYPE_RM7000, TRUE, index, clock, config, irqcallback); |
| 2451 | } |
| 3175 | 2452 | |
| 2453 | static void rm7000le_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 2454 | { |
| 2455 | mips3com_init(&mips3.core, MIPS3_TYPE_RM7000, FALSE, index, clock, config, irqcallback); |
| 2456 | } |
| 2457 | |
| 3176 | 2458 | void rm7000be_get_info(UINT32 state, cpuinfo *info) |
| 3177 | 2459 | { |
| 3178 | 2460 | switch (state) |
| r869 | r870 | |
| 3181 | 2463 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break; |
| 3182 | 2464 | |
| 3183 | 2465 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3184 | | case CPUINFO_PTR_RESET: info->reset = rm7000be_reset; break; |
| 2466 | case CPUINFO_PTR_INIT: info->init = rm7000be_init; break; |
| 3185 | 2467 | |
| 3186 | 2468 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3187 | 2469 | case CPUINFO_STR_NAME: strcpy(info->s, "RM7000 (big)"); break; |
| 3188 | 2470 | |
| 2471 | /* --- everything else is handled generically --- */ |
| 3189 | 2472 | default: mips3_get_info(state, info); break; |
| 3190 | 2473 | } |
| 3191 | 2474 | } |
| 3192 | 2475 | |
| 3193 | | |
| 3194 | 2476 | void rm7000le_get_info(UINT32 state, cpuinfo *info) |
| 3195 | 2477 | { |
| 3196 | 2478 | switch (state) |
| r869 | r870 | |
| 3199 | 2481 | case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
| 3200 | 2482 | |
| 3201 | 2483 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 3202 | | case CPUINFO_PTR_RESET: info->reset = rm7000le_reset; break; |
| 2484 | case CPUINFO_PTR_INIT: info->init = rm7000le_init; break; |
| 3203 | 2485 | |
| 3204 | 2486 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 3205 | 2487 | case CPUINFO_STR_NAME: strcpy(info->s, "RM7000 (little)"); break; |
| 3206 | 2488 | |
| 2489 | /* --- everything else is handled generically --- */ |
| 3207 | 2490 | default: mips3_get_info(state, info); break; |
| 3208 | 2491 | } |
| 3209 | 2492 | } |
| 3210 | 2493 | #endif |
| 3211 | | |