trunk/src/mame/drivers/wecleman.cpp
| r250364 | r250365 | |
| 336 | 336 | m_subcpu->set_input_line(4, HOLD_LINE); |
| 337 | 337 | |
| 338 | 338 | // Bit 1 : NSUBRST |
| 339 | | if (data & 2) |
| 340 | | m_subcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); |
| 341 | | else |
| 342 | | m_subcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
| 343 | | |
| 344 | | // Bit 2 : SOUND-ON |
| 345 | | // Bit 3 : SOUNDRST |
| 339 | m_subcpu->set_input_line(INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE); |
| 340 | |
| 341 | // Bit 2 : SOUND-ON: send a interrupt to sound CPU, 0 -> 1 transition |
| 342 | if ( (m_irqctrl & 4) && (!(data & 4)) ) |
| 343 | { |
| 344 | if(m_sound_hw_type == 0) // wec le mans |
| 345 | m_audiocpu->set_input_line(0, HOLD_LINE); |
| 346 | else // hot chase |
| 347 | { |
| 348 | m_hotchase_sound_hs = false; |
| 349 | // TODO: ASSERT_LINE here? |
| 350 | m_audiocpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE); |
| 351 | } |
| 352 | } |
| 353 | // Bit 3 : SOUNDRST, pc=0x18ea in Hot Chase POST, 1 -> 0 -> 1 |
| 354 | m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 8) ? CLEAR_LINE : ASSERT_LINE); |
| 346 | 355 | // Bit 4 : SCR-HCNT |
| 347 | | // Bit 5 : SCR-VCNT |
| 348 | | // Bit 6 : TV-KILL |
| 356 | // Bit 5 : SCR-VCNT: active in WEC Le Mans, disabled in Hot Chase (where's the latch anyway?) |
| 357 | // Bit 6 : TV-KILL: active low, disables screen. |
| 349 | 358 | m_irqctrl = data; // latch the value |
| 350 | 359 | } |
| 351 | 360 | } |
| r250364 | r250365 | |
| 545 | 554 | AM_RANGE(0x140014, 0x140015) AM_READ_PORT("DSW2") // DSW 2 |
| 546 | 555 | AM_RANGE(0x140016, 0x140017) AM_READ_PORT("DSW1") // DSW 1 |
| 547 | 556 | AM_RANGE(0x140020, 0x140021) AM_READ(selected_ip_r) AM_WRITENOP // Paired with writes to $140003 |
| 548 | | AM_RANGE(0x140022, 0x140023) AM_READNOP // ?? |
| 557 | AM_RANGE(0x140022, 0x140023) AM_READNOP // read and written at $601c0, unknown purpose |
| 549 | 558 | AM_RANGE(0x140030, 0x140031) AM_WRITENOP // signal to cabinet vibration motors? |
| 550 | 559 | ADDRESS_MAP_END |
| 551 | 560 | |
| r250364 | r250365 | |
| 584 | 593 | if (ACCESSING_BITS_0_7) |
| 585 | 594 | { |
| 586 | 595 | soundlatch_byte_w(space, 0, data & 0xFF); |
| 587 | | m_audiocpu->set_input_line(0, HOLD_LINE); |
| 588 | 596 | } |
| 589 | 597 | } |
| 590 | 598 | |
| r250364 | r250365 | |
| 650 | 658 | if (ACCESSING_BITS_0_7) |
| 651 | 659 | { |
| 652 | 660 | soundlatch_byte_w(space, 0, data & 0xFF); |
| 653 | | m_audiocpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE); |
| 654 | 661 | } |
| 655 | 662 | } |
| 656 | 663 | |
| r250364 | r250365 | |
| 704 | 711 | } |
| 705 | 712 | } |
| 706 | 713 | |
| 714 | WRITE8_MEMBER(wecleman_state::hotchase_sound_hs_w) |
| 715 | { |
| 716 | m_hotchase_sound_hs = true; |
| 717 | } |
| 718 | |
| 707 | 719 | /* Read and write handlers for one K007232 chip: |
| 708 | 720 | even and odd register are mapped swapped */ |
| 709 | 721 | READ8_MEMBER(wecleman_state::hotchase_1_k007232_r) |
| r250364 | r250365 | |
| 742 | 754 | AM_RANGE(0x2000, 0x200d) AM_READWRITE(hotchase_2_k007232_r, hotchase_2_k007232_w) |
| 743 | 755 | AM_RANGE(0x3000, 0x300d) AM_READWRITE(hotchase_3_k007232_r, hotchase_3_k007232_w) |
| 744 | 756 | AM_RANGE(0x4000, 0x4007) AM_WRITE(hotchase_sound_control_w) // Sound volume, banking, etc. |
| 745 | | AM_RANGE(0x5000, 0x5000) AM_WRITENOP // ? (written with 0 on IRQ, 1 on FIRQ) |
| 757 | AM_RANGE(0x5000, 0x5000) AM_WRITENOP // 0 at start of IRQ service, 1 at end (irq mask?) |
| 746 | 758 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) // From main CPU (Read on IRQ) |
| 747 | | AM_RANGE(0x7000, 0x7000) AM_WRITENOP // Command acknowledge ? |
| 759 | AM_RANGE(0x7000, 0x7000) AM_WRITE(hotchase_sound_hs_w) // Command acknowledge ? |
| 748 | 760 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 749 | 761 | ADDRESS_MAP_END |
| 750 | 762 | |
| r250364 | r250365 | |
| 765 | 777 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 766 | 778 | |
| 767 | 779 | PORT_START("IN1") /* Motor? - $140013.b */ |
| 768 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) // right sw |
| 769 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 ) // left sw |
| 770 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE4 ) // thermo |
| 780 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Right SW") // right sw |
| 781 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Left SW") // left sw |
| 782 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE4 ) PORT_NAME("Thermo SW") // thermo |
| 771 | 783 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) // from sound cpu ? |
| 772 | 784 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 773 | 785 | |
| r250364 | r250365 | |
| 845 | 857 | Hot Chase Input Ports |
| 846 | 858 | ***************************************************************************/ |
| 847 | 859 | |
| 860 | CUSTOM_INPUT_MEMBER(wecleman_state::hotchase_sound_status_r) |
| 861 | { |
| 862 | return m_hotchase_sound_hs; |
| 863 | } |
| 864 | |
| 848 | 865 | static INPUT_PORTS_START( hotchase ) |
| 849 | 866 | PORT_START("IN0") /* $140011.b */ |
| 850 | 867 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r250364 | r250365 | |
| 857 | 874 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 858 | 875 | |
| 859 | 876 | PORT_START("IN1") /* Motor? - $140013.b */ |
| 860 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) // right sw |
| 861 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 ) // left sw |
| 862 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE4 ) // thermo |
| 863 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) // from sound cpu ? |
| 864 | | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 877 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Right SW") // right sw |
| 878 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Left SW") // left sw |
| 879 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE4 ) PORT_NAME("Thermo SW") // thermo |
| 880 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) // from sound cpu |
| 881 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wecleman_state,hotchase_sound_status_r, NULL) |
| 882 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 865 | 883 | |
| 866 | 884 | PORT_START("DSW2") /* $140015.b */ |
| 867 | 885 | PORT_DIPNAME( 0x01, 0x01, "Speed Unit" ) |
| r250364 | r250365 | |
| 1026 | 1044 | |
| 1027 | 1045 | if(scanline == 232) // vblank irq |
| 1028 | 1046 | m_maincpu->set_input_line(4, HOLD_LINE); |
| 1029 | | else if(((scanline % 64) == 0)) // timer irq TODO: timings |
| 1047 | else if(((scanline % 64) == 0)) // timer irq TODO: timings (and actually I believe it's from the blitter device) |
| 1030 | 1048 | m_maincpu->set_input_line(5, HOLD_LINE); |
| 1031 | 1049 | } |
| 1032 | 1050 | |
| r250364 | r250365 | |
| 1036 | 1054 | |
| 1037 | 1055 | if(scanline == 224) // vblank irq |
| 1038 | 1056 | m_maincpu->set_input_line(4, HOLD_LINE); |
| 1039 | | else if(((scanline % 64) == 0)) // timer irq TODO: timings |
| 1040 | | m_maincpu->set_input_line(5, HOLD_LINE); |
| 1041 | 1057 | } |
| 1042 | 1058 | |
| 1043 | 1059 | |
| r250364 | r250365 | |
| 1403 | 1419 | 20,19,18,17,16,15,14,7,12,4,2,5,6,13,8,9,11,3,10,1,0); |
| 1404 | 1420 | |
| 1405 | 1421 | m_spr_color_offs = 0x40; |
| 1422 | m_sound_hw_type = 0; |
| 1406 | 1423 | } |
| 1407 | 1424 | |
| 1408 | 1425 | |
| r250364 | r250365 | |
| 1680 | 1697 | hotchase_sprite_decode(3,0x80000*2); // num banks, bank len |
| 1681 | 1698 | |
| 1682 | 1699 | m_spr_color_offs = 0; |
| 1700 | m_sound_hw_type = 1; |
| 1683 | 1701 | } |
| 1684 | 1702 | |
| 1685 | 1703 | |