From c9812adf063709fc220dfe29d15cd6eeb63ad948 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Mon, 5 Dec 2011 21:30:58 +0000 Subject: [PATCH] deprecat.h --- src/mame/drivers/hng64.c | 1 - src/mame/drivers/hvyunit.c | 21 +++++++++++---------- src/mame/drivers/hyprduel.c | 19 +++++++++---------- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c index 4bcbf69496f..3f8581794d0 100644 --- a/src/mame/drivers/hng64.c +++ b/src/mame/drivers/hng64.c @@ -443,7 +443,6 @@ or Fatal Fury for example). #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/nec/nec.h" -#include "deprecat.h" #include "cpu/mips/mips3.h" #include "machine/nvram.h" #include "includes/hng64.h" diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c index 856701c62c6..da72c1e54d3 100644 --- a/src/mame/drivers/hvyunit.c +++ b/src/mame/drivers/hvyunit.c @@ -58,7 +58,6 @@ To Do: ***************************************************************************************/ #include "emu.h" -#include "deprecat.h" #include "cpu/z80/z80.h" #include "cpu/mcs51/mcs51.h" #include "sound/2203intf.h" @@ -86,9 +85,6 @@ public: UINT16 m_scrolly; UINT16 m_port0_data; - /* Interrupts */ - UINT8 m_int_vector; - /* Mermaid */ UINT8 m_data_to_mermaid; UINT8 m_data_to_z80; @@ -129,7 +125,6 @@ static MACHINE_RESET( hvyunit ) { hvyunit_state *state = machine.driver_data(); - state->m_int_vector = 0xff; state->m_mermaid_int0_l = 1; state->m_mermaid_to_z80_full = 0; state->m_z80_to_mermaid_full = 0; @@ -618,12 +613,18 @@ GFXDECODE_END * *************************************/ -static INTERRUPT_GEN( hvyunit_interrupt ) +/* Main Z80 uses IM2 */ +static TIMER_DEVICE_CALLBACK( hvyunit_scanline ) { - hvyunit_state *state = device->machine().driver_data(); + hvyunit_state *state = timer.machine().driver_data(); + int scanline = param; - state->m_int_vector ^= 0x02; - device_set_input_line_and_vector(device, 0, HOLD_LINE, state->m_int_vector); + if(scanline == 240) // vblank-out irq + device_set_input_line_and_vector(state->m_master_cpu, 0, HOLD_LINE, 0xfd); + + /* Pandora "sprite end dma" irq? TODO: timing is likely off */ + if(scanline == 64) + device_set_input_line_and_vector(state->m_master_cpu, 0, HOLD_LINE, 0xff); } static const kaneko_pandora_interface hvyunit_pandora_config = @@ -645,7 +646,7 @@ static MACHINE_CONFIG_START( hvyunit, hvyunit_state ) MCFG_CPU_ADD("master", Z80, 6000000) MCFG_CPU_PROGRAM_MAP(master_memory) MCFG_CPU_IO_MAP(master_io) - MCFG_CPU_VBLANK_INT_HACK(hvyunit_interrupt, 2) + MCFG_TIMER_ADD_SCANLINE("scantimer", hvyunit_scanline, "screen", 0, 1) MCFG_CPU_ADD("slave", Z80, 6000000) MCFG_CPU_PROGRAM_MAP(slave_memory) diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c index 7200f1e60bf..4956b772118 100644 --- a/src/mame/drivers/hyprduel.c +++ b/src/mame/drivers/hyprduel.c @@ -36,7 +36,6 @@ fix comms so it boots, it's a bit of a hack for hyperduel at the moment ;-) #include "emu.h" #include "cpu/m68000/m68000.h" -#include "deprecat.h" #include "sound/2151intf.h" #include "sound/okim6295.h" #include "sound/2413intf.h" @@ -60,23 +59,23 @@ static TIMER_CALLBACK( vblank_end_callback ) state->m_requested_int &= ~param; } -static INTERRUPT_GEN( hyprduel_interrupt ) +static TIMER_DEVICE_CALLBACK( hyprduel_interrupt ) { - hyprduel_state *state = device->machine().driver_data(); - int line = RASTER_LINES - cpu_getiloops(device); + hyprduel_state *state = timer.machine().driver_data(); + int line = param; - if (line == RASTER_LINES) + if (line == 0) /* TODO: fix this! */ { state->m_requested_int |= 0x01; /* vblank */ state->m_requested_int |= 0x20; - device_set_input_line(device, 2, HOLD_LINE); + device_set_input_line(state->m_maincpu, 2, HOLD_LINE); /* the duration is a guess */ - device->machine().scheduler().timer_set(attotime::from_usec(2500), FUNC(vblank_end_callback), 0x20); + timer.machine().scheduler().timer_set(attotime::from_usec(2500), FUNC(vblank_end_callback), 0x20); } else state->m_requested_int |= 0x12; /* hsync */ - update_irq_state(device->machine()); + update_irq_state(timer.machine()); } static READ16_HANDLER( hyprduel_irq_cause_r ) @@ -676,7 +675,7 @@ static MACHINE_CONFIG_START( hyprduel, hyprduel_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000,20000000/2) /* 10MHz */ MCFG_CPU_PROGRAM_MAP(hyprduel_map) - MCFG_CPU_VBLANK_INT_HACK(hyprduel_interrupt,RASTER_LINES) + MCFG_TIMER_ADD_SCANLINE("scantimer", hyprduel_interrupt, "screen", 0, 1) MCFG_CPU_ADD("sub", M68000,20000000/2) /* 10MHz */ MCFG_CPU_PROGRAM_MAP(hyprduel_map2) @@ -719,7 +718,7 @@ static MACHINE_CONFIG_START( magerror, hyprduel_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000,20000000/2) /* 10MHz */ MCFG_CPU_PROGRAM_MAP(magerror_map) - MCFG_CPU_VBLANK_INT_HACK(hyprduel_interrupt,RASTER_LINES) + MCFG_TIMER_ADD_SCANLINE("scantimer", hyprduel_interrupt, "screen", 0, 1) MCFG_CPU_ADD("sub", M68000,20000000/2) /* 10MHz */ MCFG_CPU_PROGRAM_MAP(magerror_map2)