summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-01-07 16:25:08 -0500
committer AJR <ajrhacker@users.noreply.github.com>2018-01-07 16:25:08 -0500
commit1b55a2cde967b2620c485513c6d95fe2403f44a0 (patch)
tree5e29ab6c633b6086ed8c78cc504a89401c940b4f
parent83dd83b47a453497aa915f3211a0ea80c09535dc (diff)
thief: Interrupt modernization; use MCFG_SCREEN_RAW_PARAMS (nw)
-rw-r--r--src/mame/drivers/thief.cpp28
-rw-r--r--src/mame/includes/thief.h3
2 files changed, 16 insertions, 15 deletions
diff --git a/src/mame/drivers/thief.cpp b/src/mame/drivers/thief.cpp
index 633257fe6f1..788330d5704 100644
--- a/src/mame/drivers/thief.cpp
+++ b/src/mame/drivers/thief.cpp
@@ -34,13 +34,16 @@ Credits:
-INTERRUPT_GEN_MEMBER(thief_state::thief_interrupt)
+WRITE_LINE_MEMBER(thief_state::slam_w)
{
/* SLAM switch causes an NMI if it's pressed */
- if( (ioport("P2")->read() & 0x10) == 0 )
- device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- else
- device.execute().set_input_line(0, HOLD_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, state ? CLEAR_LINE : ASSERT_LINE);
+}
+
+IRQ_CALLBACK_MEMBER(thief_state::iack)
+{
+ m_maincpu->set_input_line(0, CLEAR_LINE);
+ return 0xff;
}
/**********************************************************/
@@ -213,7 +216,7 @@ static INPUT_PORTS_START( sharkatt )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT ) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, thief_state, slam_w)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
@@ -282,7 +285,7 @@ static INPUT_PORTS_START( thief )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT ) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, thief_state, slam_w)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -349,7 +352,7 @@ static INPUT_PORTS_START( natodef )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT ) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, thief_state, slam_w)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -391,7 +394,7 @@ static MACHINE_CONFIG_START( thief )
MCFG_CPU_ADD("maincpu", Z80, XTAL_8MHz/2)
MCFG_CPU_PROGRAM_MAP(thief_main_map)
MCFG_CPU_IO_MAP(io_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", thief_state, thief_interrupt)
+ MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(thief_state, iack)
MCFG_DEVICE_ADD("ppi", I8255A, 0)
MCFG_I8255_OUT_PORTA_CB(WRITE8(thief_state, thief_input_select_w))
@@ -400,16 +403,13 @@ static MACHINE_CONFIG_START( thief )
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
+ MCFG_SCREEN_RAW_PARAMS(XTAL_20MHz/4, 320, 0, 256, 272, 0, 256)
MCFG_SCREEN_UPDATE_DRIVER(thief_state, screen_update_thief)
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("tms", TMS9927, XTAL_20MHz/4)
MCFG_TMS9927_CHAR_WIDTH(8)
-
+ MCFG_TMS9927_VSYN_CALLBACK(ASSERTLINE("maincpu", 0))
MCFG_PALETTE_ADD("palette", 16)
// sound hardware
diff --git a/src/mame/includes/thief.h b/src/mame/includes/thief.h
index c30ba655a5c..ff0ecb4ddef 100644
--- a/src/mame/includes/thief.h
+++ b/src/mame/includes/thief.h
@@ -43,7 +43,8 @@ public:
DECLARE_DRIVER_INIT(thief);
virtual void video_start() override;
uint32_t screen_update_thief(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(thief_interrupt);
+ DECLARE_WRITE_LINE_MEMBER(slam_w);
+ IRQ_CALLBACK_MEMBER(iack);
uint16_t fetch_image_addr( coprocessor_t &thief_coprocessor );
void tape_set_audio( int track, int bOn );
void tape_set_motor( int bOn );