From dfbcf3106b5ca14459d130f48ca06e7fd83b4d52 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Mon, 5 Dec 2011 02:36:54 +0000 Subject: [PATCH] deprecat.h --- src/mame/drivers/battlera.c | 4 ++-- src/mame/drivers/big10.c | 7 +++---- src/mame/includes/battlera.h | 8 ++++++-- src/mame/video/battlera.c | 15 +++++++-------- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c index bcb91b44618..d547a0bde94 100644 --- a/src/mame/drivers/battlera.c +++ b/src/mame/drivers/battlera.c @@ -13,6 +13,7 @@ Twice as much VRAM. Todo: + - Convert this driver to use proper PC-Engine video. - Priority is wrong for the submarine at the end of level 1. - There seems to be a bug with a stuck note from the YM2203 FM channel at the start of scene 3 and near the ending when your characters are @@ -21,7 +22,6 @@ **********************************************************************/ #include "emu.h" -#include "deprecat.h" #include "cpu/h6280/h6280.h" #include "sound/2203intf.h" #include "sound/msm5205.h" @@ -236,7 +236,7 @@ static MACHINE_CONFIG_START( battlera, battlera_state ) MCFG_CPU_ADD("maincpu", H6280,21477200/3) MCFG_CPU_PROGRAM_MAP(battlera_map) MCFG_CPU_IO_MAP(battlera_portmap) - MCFG_CPU_VBLANK_INT_HACK(battlera_interrupt,256) /* 8 prelines, 232 lines, 16 vblank? */ + MCFG_TIMER_ADD_SCANLINE("scantimer", battlera_irq, "screen", 0, 1) /* 8 prelines, 232 lines, 16 vblank? */ MCFG_CPU_ADD("audiocpu", H6280,21477200/3) MCFG_CPU_PROGRAM_MAP(sound_map) diff --git a/src/mame/drivers/big10.c b/src/mame/drivers/big10.c index d47ac823063..8f61f9f641d 100644 --- a/src/mame/drivers/big10.c +++ b/src/mame/drivers/big10.c @@ -61,7 +61,6 @@ #include "sound/ay8910.h" #include "video/v9938.h" #include "machine/nvram.h" -#include "deprecat.h" class big10_state : public driver_device @@ -86,9 +85,9 @@ static void big10_vdp_interrupt(running_machine &machine, int i) cputag_set_input_line (machine, "maincpu", 0, (i ? ASSERT_LINE : CLEAR_LINE)); } -static INTERRUPT_GEN( big10_interrupt ) +static TIMER_DEVICE_CALLBACK( big10_interrupt ) { - v9938_interrupt(device->machine(), 0); + v9938_interrupt(timer.machine(), 0); } @@ -256,7 +255,7 @@ static MACHINE_CONFIG_START( big10, big10_state ) MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* guess */ MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_IO_MAP(main_io) - MCFG_CPU_VBLANK_INT_HACK(big10_interrupt, 262) + MCFG_TIMER_ADD_SCANLINE("scantimer", big10_interrupt, "screen", 0, 1) MCFG_MACHINE_RESET(big10) diff --git a/src/mame/includes/battlera.h b/src/mame/includes/battlera.h index 011f0b39078..c180708cdbb 100644 --- a/src/mame/includes/battlera.h +++ b/src/mame/includes/battlera.h @@ -2,7 +2,9 @@ class battlera_state : public driver_device { public: battlera_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) { } + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } int m_control_port_select; int m_msm5205next; @@ -23,6 +25,8 @@ public: int m_bb_enable; int m_bldwolf_vblank; UINT8 m_blank_tile[32]; + + required_device m_maincpu; }; @@ -30,7 +34,7 @@ public: SCREEN_UPDATE( battlera ); VIDEO_START( battlera ); -INTERRUPT_GEN( battlera_interrupt ); +TIMER_DEVICE_CALLBACK( battlera_irq ); READ8_HANDLER( HuC6270_register_r ); WRITE8_HANDLER( HuC6270_register_w ); diff --git a/src/mame/video/battlera.c b/src/mame/video/battlera.c index 42f5649d6ac..5fee862f5b3 100644 --- a/src/mame/video/battlera.c +++ b/src/mame/video/battlera.c @@ -8,7 +8,6 @@ *******************************************************************************/ #include "emu.h" -#include "deprecat.h" #include "cpu/h6280/h6280.h" #include "includes/battlera.h" @@ -370,23 +369,23 @@ SCREEN_UPDATE( battlera ) /******************************************************************************/ -INTERRUPT_GEN( battlera_interrupt ) +TIMER_DEVICE_CALLBACK( battlera_irq ) { - battlera_state *state = device->machine().driver_data(); - state->m_current_scanline=255-cpu_getiloops(device); /* 8 lines clipped at top */ + battlera_state *state = timer.machine().driver_data(); + state->m_current_scanline = param; /* 8 lines clipped at top */ /* If raster interrupt occurs, refresh screen _up_ to this point */ if (state->m_rcr_enable && (state->m_current_scanline+56)==state->m_HuC6270_registers[6]) { - device->machine().primary_screen->update_partial(state->m_current_scanline); - device_set_input_line(device, 0, HOLD_LINE); /* RCR interrupt */ + timer.machine().primary_screen->update_partial(state->m_current_scanline); + device_set_input_line(state->m_maincpu, 0, HOLD_LINE); /* RCR interrupt */ } /* Start of vblank */ else if (state->m_current_scanline==240) { state->m_bldwolf_vblank=1; - device->machine().primary_screen->update_partial(240); + timer.machine().primary_screen->update_partial(240); if (state->m_irq_enable) - device_set_input_line(device, 0, HOLD_LINE); /* VBL */ + device_set_input_line(state->m_maincpu, 0, HOLD_LINE); /* VBL */ } /* End of vblank */