trunk/src/mame/machine/megadriv.c
r22022 | r22023 | |
35 | 35 | { |
36 | 36 | md_base_state *state = machine.driver_data<md_base_state>(); |
37 | 37 | if ((state->m_genz80.z80_has_bus == 1) && (state->m_genz80.z80_is_reset == 0)) |
38 | | machine.device(":genesis_snd_z80")->execute().set_input_line(0, HOLD_LINE); |
| 38 | state->m_z80snd->set_input_line(0, HOLD_LINE); |
39 | 39 | } |
40 | 40 | |
41 | 41 | void megadriv_z80_clear(running_machine &machine) |
42 | 42 | { |
43 | | machine.device(":genesis_snd_z80")->execute().set_input_line(0, CLEAR_LINE); |
| 43 | md_base_state *state = machine.driver_data<md_base_state>(); |
| 44 | state->m_z80snd->set_input_line(0, CLEAR_LINE); |
44 | 45 | } |
45 | 46 | |
46 | 47 | static void megadriv_z80_bank_w(address_space &space, UINT16 data) |
r22022 | r22023 | |
770 | 771 | static READ8_HANDLER( z80_read_68k_banked_data ) |
771 | 772 | { |
772 | 773 | md_base_state *state = space.machine().driver_data<md_base_state>(); |
773 | | address_space &space68k = space.machine().device<legacy_cpu_device>("maincpu")->space(); |
| 774 | address_space &space68k = state->m_maincpu->space(); |
774 | 775 | UINT8 ret = space68k.read_byte(state->m_genz80.z80_bank_addr+offset); |
775 | 776 | return ret; |
776 | 777 | } |
r22022 | r22023 | |
778 | 779 | static WRITE8_HANDLER( z80_write_68k_banked_data ) |
779 | 780 | { |
780 | 781 | md_base_state *state = space.machine().driver_data<md_base_state>(); |
781 | | address_space &space68k = space.machine().device<legacy_cpu_device>("maincpu")->space(); |
| 782 | address_space &space68k = state->m_maincpu->space(); |
782 | 783 | space68k.write_byte(state->m_genz80.z80_bank_addr+offset,data); |
783 | 784 | } |
784 | 785 | |
r22022 | r22023 | |
1012 | 1013 | // this comes from the vdp, and is connected to 68k irq level 6 (main vbl interrupt) |
1013 | 1014 | void genesis_vdp_lv6irqline_callback_genesis_68k(running_machine &machine, bool state) |
1014 | 1015 | { |
1015 | | if (state==true) |
1016 | | machine.device("maincpu")->execute().set_input_line(6, HOLD_LINE); |
| 1016 | md_base_state *md_state = machine.driver_data<md_base_state>(); |
| 1017 | if (state == true) |
| 1018 | md_state->m_maincpu->set_input_line(6, HOLD_LINE); |
1017 | 1019 | else |
1018 | | machine.device("maincpu")->execute().set_input_line(6, CLEAR_LINE); |
| 1020 | md_state->m_maincpu->set_input_line(6, CLEAR_LINE); |
1019 | 1021 | } |
1020 | 1022 | |
1021 | 1023 | // this comes from the vdp, and is connected to 68k irq level 4 (raster interrupt) |
1022 | 1024 | void genesis_vdp_lv4irqline_callback_genesis_68k(running_machine &machine, bool state) |
1023 | 1025 | { |
1024 | | if (state==true) |
1025 | | machine.device("maincpu")->execute().set_input_line(4, HOLD_LINE); |
| 1026 | md_base_state *md_state = machine.driver_data<md_base_state>(); |
| 1027 | if (state == true) |
| 1028 | md_state->m_maincpu->set_input_line(4, HOLD_LINE); |
1026 | 1029 | else |
1027 | | machine.device("maincpu")->execute().set_input_line(4, CLEAR_LINE); |
| 1030 | md_state->m_maincpu->set_input_line(4, CLEAR_LINE); |
1028 | 1031 | } |
1029 | 1032 | |
1030 | 1033 | /* Callback when the 68k takes an IRQ */ |
r22022 | r22023 | |
1373 | 1376 | md_base_state *state = screen.machine().driver_data<md_base_state>(); |
1374 | 1377 | |
1375 | 1378 | if (screen.ioport(":RESET")->read_safe(0x00) & 0x01) |
1376 | | screen.machine().device(":maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); |
| 1379 | state->m_maincpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE); |
1377 | 1380 | |
1378 | 1381 | // rising edge |
1379 | 1382 | if (vblank_on) |