From 4d9716f7d2b0508c1726380c516ca761706d55f4 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Sat, 3 Dec 2011 17:06:12 +0000 Subject: [PATCH] Removed deprecat.h usage from beezer.c [Angelo Salese] --- src/mame/drivers/beezer.c | 15 +++++++++++++-- src/mame/includes/beezer.h | 5 +++-- src/mame/video/beezer.c | 21 +++++++++++---------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/mame/drivers/beezer.c b/src/mame/drivers/beezer.c index ea9bb76d698..df6b661073e 100644 --- a/src/mame/drivers/beezer.c +++ b/src/mame/drivers/beezer.c @@ -4,10 +4,12 @@ Written by Mathis Rosenhauer + TODO: + - what's really wrong with the sound? Any reference available? + */ #include "emu.h" -#include "deprecat.h" #include "machine/6522via.h" #include "cpu/m6809/m6809.h" #include "sound/dac.h" @@ -75,12 +77,19 @@ static INPUT_PORTS_START( beezer ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) INPUT_PORTS_END +static MACHINE_START(beezer) +{ + beezer_state *state = machine.driver_data(); + + state->m_maincpu = machine.device("maincpu"); +} + static MACHINE_CONFIG_START( beezer, beezer_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M6809, 1000000) /* 1 MHz */ MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_CPU_VBLANK_INT_HACK(beezer_interrupt,128) + MCFG_TIMER_ADD_SCANLINE("scantimer", beezer_interrupt, "screen", 0, 1) MCFG_CPU_ADD("audiocpu", M6809, 1000000) /* 1 MHz */ MCFG_CPU_PROGRAM_MAP(sound_map) @@ -96,6 +105,8 @@ static MACHINE_CONFIG_START( beezer, beezer_state ) MCFG_PALETTE_LENGTH(16) + MCFG_MACHINE_START(beezer) + /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/includes/beezer.h b/src/mame/includes/beezer.h index 3c2b3a50117..075e30ecf22 100644 --- a/src/mame/includes/beezer.h +++ b/src/mame/includes/beezer.h @@ -9,7 +9,8 @@ public: UINT8 *m_videoram; int m_pbus; int m_banklatch; - int m_scanline; + + device_t *m_maincpu; }; @@ -33,7 +34,7 @@ READ8_DEVICE_HANDLER( beezer_noise_r ); /*----------- defined in video/beezer.c -----------*/ -INTERRUPT_GEN( beezer_interrupt ); +TIMER_DEVICE_CALLBACK( beezer_interrupt ); SCREEN_UPDATE( beezer ); WRITE8_HANDLER( beezer_map_w ); READ8_HANDLER( beezer_line_r ); diff --git a/src/mame/video/beezer.c b/src/mame/video/beezer.c index e453a0c18cd..6c665d2908f 100644 --- a/src/mame/video/beezer.c +++ b/src/mame/video/beezer.c @@ -4,17 +4,19 @@ #include "includes/beezer.h" -INTERRUPT_GEN( beezer_interrupt ) +TIMER_DEVICE_CALLBACK( beezer_interrupt ) { - beezer_state *state = device->machine().driver_data(); - via6522_device *via_0 = device->machine().device("via6522_0"); + int scanline = param; +// beezer_state *state = timer.machine().driver_data(); + via6522_device *via_0 = timer.machine().device("via6522_0"); - state->m_scanline = (state->m_scanline + 1) % 0x80; - via_0->write_ca2((state->m_scanline & 0x10) ? 1 : 0); - if ((state->m_scanline & 0x78) == 0x78) - device_set_input_line(device, M6809_FIRQ_LINE, ASSERT_LINE); + via_0->write_ca2((scanline & 0x20) ? 1 : 0); + #if 0 + if (scanline == 240) // actually unused by the game! (points to a tight loop) + device_set_input_line(state->m_maincpu, M6809_FIRQ_LINE, ASSERT_LINE); else - device_set_input_line(device, M6809_FIRQ_LINE, CLEAR_LINE); + device_set_input_line(state->m_maincpu, M6809_FIRQ_LINE, CLEAR_LINE); + #endif } SCREEN_UPDATE( beezer ) @@ -68,7 +70,6 @@ WRITE8_HANDLER( beezer_map_w ) READ8_HANDLER( beezer_line_r ) { - beezer_state *state = space->machine().driver_data(); - return (state->m_scanline & 0xfe) << 1; + return space->machine().primary_screen->vpos(); }