TIMER_CALLBACK_DEVICE_MEMBER modernization part 2 (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2012-09-25 14:21:56 +00:00
parent 6c40f0f292
commit d8bc866c4a
105 changed files with 951 additions and 931 deletions

View File

@ -93,6 +93,7 @@ public:
TILE_GET_INFO_MEMBER(ac_get_tx_tile_info); TILE_GET_INFO_MEMBER(ac_get_tx_tile_info);
virtual void video_start(); virtual void video_start();
UINT32 screen_update_acommand(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_acommand(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(acommand_scanline);
}; };
@ -585,15 +586,15 @@ static GFXDECODE_START( acommand )
GFXDECODE_ENTRY( "gfx3", 0, tilelayout, 0x1800, 256 ) GFXDECODE_ENTRY( "gfx3", 0, tilelayout, 0x1800, 256 )
GFXDECODE_END GFXDECODE_END
static TIMER_DEVICE_CALLBACK( acommand_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(acommand_state::acommand_scanline)
{ {
int scanline = param; int scanline = param;
if(scanline == 240) // vblank-out irq if(scanline == 240) // vblank-out irq
timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
if(scanline == 0) // vblank-in irq? (update palette and layers) if(scanline == 0) // vblank-in irq? (update palette and layers)
timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
} }
static MACHINE_CONFIG_START( acommand, acommand_state ) static MACHINE_CONFIG_START( acommand, acommand_state )
@ -601,7 +602,7 @@ static MACHINE_CONFIG_START( acommand, acommand_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu",M68000,12000000) MCFG_CPU_ADD("maincpu",M68000,12000000)
MCFG_CPU_PROGRAM_MAP(acommand_map) MCFG_CPU_PROGRAM_MAP(acommand_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", acommand_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", acommand_state, acommand_scanline, "screen", 0, 1)
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -325,6 +325,7 @@ public:
TIMER_CALLBACK_MEMBER(note_input_reset); TIMER_CALLBACK_MEMBER(note_input_reset);
TIMER_CALLBACK_MEMBER(coin_input_reset); TIMER_CALLBACK_MEMBER(coin_input_reset);
TIMER_CALLBACK_MEMBER(hopper_reset); TIMER_CALLBACK_MEMBER(hopper_reset);
TIMER_DEVICE_CALLBACK_MEMBER(aristmk4_pf);
}; };
/* Partial Cashcade protocol */ /* Partial Cashcade protocol */
@ -1656,7 +1657,7 @@ void aristmk4_state::machine_reset()
} }
} }
static TIMER_DEVICE_CALLBACK( aristmk4_pf ) TIMER_DEVICE_CALLBACK_MEMBER(aristmk4_state::aristmk4_pf)
{ {
/* /*
IRQ generator pulses the NMI signal to CPU in the event of power down or power failure. IRQ generator pulses the NMI signal to CPU in the event of power down or power failure.
@ -1674,9 +1675,9 @@ static TIMER_DEVICE_CALLBACK( aristmk4_pf )
Note: The use of 1 Hz in the timer is to avoid unintentional triggering the NMI ( ie.. hold down L for at least 1 second ) Note: The use of 1 Hz in the timer is to avoid unintentional triggering the NMI ( ie.. hold down L for at least 1 second )
*/ */
if(timer.machine().root_device().ioport("powerfail")->read()) // send NMI signal if L pressed if(machine().root_device().ioport("powerfail")->read()) // send NMI signal if L pressed
{ {
timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE ); machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE );
} }
} }
@ -1687,7 +1688,7 @@ static MACHINE_CONFIG_START( aristmk4, aristmk4_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", aristmk4_state, irq0_line_hold) MCFG_CPU_VBLANK_INT_DRIVER("screen", aristmk4_state, irq0_line_hold)
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_TIMER_ADD_PERIODIC("power_fail", aristmk4_pf,attotime::from_hz(1)) // not real but required to simulate power failure to access robot test. How else can we do this ? MCFG_TIMER_DRIVER_ADD_PERIODIC("power_fail", aristmk4_state, aristmk4_pf, attotime::from_hz(1))
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -65,6 +65,7 @@ public:
DECLARE_DRIVER_INIT(showhand); DECLARE_DRIVER_INIT(showhand);
DECLARE_VIDEO_START(astrocorp); DECLARE_VIDEO_START(astrocorp);
UINT32 screen_update_astrocorp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_astrocorp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(skilldrp_scanline);
}; };
/*************************************************************************** /***************************************************************************
@ -508,15 +509,15 @@ static MACHINE_CONFIG_DERIVED( showhanc, showhand )
MACHINE_CONFIG_END MACHINE_CONFIG_END
static TIMER_DEVICE_CALLBACK( skilldrp_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(astrocorp_state::skilldrp_scanline)
{ {
int scanline = param; int scanline = param;
if(scanline == 240) // vblank-out irq. controls sprites, sound, i/o if(scanline == 240) // vblank-out irq. controls sprites, sound, i/o
timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
if(scanline == 0) // vblank-in? controls palette if(scanline == 0) // vblank-in? controls palette
timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
} }
static MACHINE_CONFIG_START( skilldrp, astrocorp_state ) static MACHINE_CONFIG_START( skilldrp, astrocorp_state )
@ -524,7 +525,7 @@ static MACHINE_CONFIG_START( skilldrp, astrocorp_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2) // JX-1689F1028N GRX586.V5 MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2) // JX-1689F1028N GRX586.V5
MCFG_CPU_PROGRAM_MAP(skilldrp_map) MCFG_CPU_PROGRAM_MAP(skilldrp_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", skilldrp_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", astrocorp_state, skilldrp_scanline, "screen", 0, 1)
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_EEPROM_93C46_ADD("eeprom") MCFG_EEPROM_93C46_ADD("eeprom")

View File

@ -75,6 +75,7 @@ public:
DECLARE_READ8_MEMBER(mux_r); DECLARE_READ8_MEMBER(mux_r);
DECLARE_WRITE8_MEMBER(mux_w); DECLARE_WRITE8_MEMBER(mux_w);
virtual void machine_reset(); virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(big10_interrupt);
}; };
@ -90,10 +91,9 @@ static void big10_vdp_interrupt(device_t *, v99x8_device &device, int i)
device.machine().device("maincpu")->execute().set_input_line(0, (i ? ASSERT_LINE : CLEAR_LINE)); device.machine().device("maincpu")->execute().set_input_line(0, (i ? ASSERT_LINE : CLEAR_LINE));
} }
static TIMER_DEVICE_CALLBACK( big10_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(big10_state::big10_interrupt)
{ {
big10_state *state = timer.machine().driver_data<big10_state>(); m_v9938->interrupt();
state->m_v9938->interrupt();
} }
@ -247,7 +247,7 @@ static MACHINE_CONFIG_START( big10, big10_state )
MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* guess */ MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* guess */
MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_IO_MAP(main_io) MCFG_CPU_IO_MAP(main_io)
MCFG_TIMER_ADD_SCANLINE("scantimer", big10_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", big10_state, big10_interrupt, "screen", 0, 1)
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")

View File

@ -175,6 +175,7 @@ public:
DECLARE_VIDEO_START(blitz68k_addr_factor1); DECLARE_VIDEO_START(blitz68k_addr_factor1);
UINT32 screen_update_blitz68k(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_blitz68k(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_blitz68k_noblit(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_blitz68k_noblit(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(steaser_mcu_sim);
}; };
/************************************************************************************************************* /*************************************************************************************************************
@ -1755,24 +1756,23 @@ MACHINE_CONFIG_END
2008ad = 1 -> hold 5 2008ad = 1 -> hold 5
*/ */
static TIMER_DEVICE_CALLBACK( steaser_mcu_sim ) TIMER_DEVICE_CALLBACK_MEMBER(blitz68k_state::steaser_mcu_sim)
{ {
blitz68k_state *state = timer.machine().driver_data<blitz68k_state>();
// static int i; // static int i;
/*first off, signal the "MCU is running" flag*/ /*first off, signal the "MCU is running" flag*/
state->m_nvram[0x932/2] = 0xffff; m_nvram[0x932/2] = 0xffff;
/*clear the inputs (they are impulsed)*/ /*clear the inputs (they are impulsed)*/
// for(i=0;i<8;i+=2) // for(i=0;i<8;i+=2)
// state->m_nvram[((0x8a0)+i)/2] = 0; // m_nvram[((0x8a0)+i)/2] = 0;
/*finally, read the inputs*/ /*finally, read the inputs*/
state->m_nvram[0x89e/2] = timer.machine().root_device().ioport("MENU")->read() & 0xffff; m_nvram[0x89e/2] = machine().root_device().ioport("MENU")->read() & 0xffff;
state->m_nvram[0x8a0/2] = timer.machine().root_device().ioport("STAT")->read() & 0xffff; m_nvram[0x8a0/2] = machine().root_device().ioport("STAT")->read() & 0xffff;
state->m_nvram[0x8a2/2] = timer.machine().root_device().ioport("BET_DEAL")->read() & 0xffff; m_nvram[0x8a2/2] = machine().root_device().ioport("BET_DEAL")->read() & 0xffff;
state->m_nvram[0x8a4/2] = timer.machine().root_device().ioport("TAKE_DOUBLE")->read() & 0xffff; m_nvram[0x8a4/2] = machine().root_device().ioport("TAKE_DOUBLE")->read() & 0xffff;
state->m_nvram[0x8a6/2] = timer.machine().root_device().ioport("SMALL_BIG")->read() & 0xffff; m_nvram[0x8a6/2] = machine().root_device().ioport("SMALL_BIG")->read() & 0xffff;
state->m_nvram[0x8a8/2] = timer.machine().root_device().ioport("CANCEL_HOLD1")->read() & 0xffff; m_nvram[0x8a8/2] = machine().root_device().ioport("CANCEL_HOLD1")->read() & 0xffff;
state->m_nvram[0x8aa/2] = timer.machine().root_device().ioport("HOLD2_HOLD3")->read() & 0xffff; m_nvram[0x8aa/2] = machine().root_device().ioport("HOLD2_HOLD3")->read() & 0xffff;
state->m_nvram[0x8ac/2] = timer.machine().root_device().ioport("HOLD4_HOLD5")->read() & 0xffff; m_nvram[0x8ac/2] = machine().root_device().ioport("HOLD4_HOLD5")->read() & 0xffff;
} }
@ -1781,7 +1781,7 @@ static MACHINE_CONFIG_DERIVED( steaser, ilpag )
MCFG_CPU_PROGRAM_MAP(steaser_map) MCFG_CPU_PROGRAM_MAP(steaser_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", blitz68k_state, irq5_line_hold) //3, 4 & 6 used, mcu comms? MCFG_CPU_VBLANK_INT_DRIVER("screen", blitz68k_state, irq5_line_hold) //3, 4 & 6 used, mcu comms?
MCFG_TIMER_ADD_PERIODIC("coinsim", steaser_mcu_sim, attotime::from_hz(10000)) // not real, but for simulating the MCU MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", blitz68k_state, steaser_mcu_sim, attotime::from_hz(10000))
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( cjffruit, blitz68k_state ) static MACHINE_CONFIG_START( cjffruit, blitz68k_state )

View File

@ -157,6 +157,7 @@ public:
virtual void video_start(); virtual void video_start();
UINT32 screen_update_bnstars_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_bnstars_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_bnstars_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_bnstars_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(ms32_interrupt);
}; };
@ -1351,11 +1352,11 @@ static void irq_raise(running_machine &machine, int level)
} }
/* TODO: fix this arrangement (derived from old deprecat lib) */ /* TODO: fix this arrangement (derived from old deprecat lib) */
static TIMER_DEVICE_CALLBACK(ms32_interrupt) TIMER_DEVICE_CALLBACK_MEMBER(bnstars_state::ms32_interrupt)
{ {
int scanline = param; int scanline = param;
if( scanline == 0 ) irq_raise(timer.machine(), 10); if( scanline == 0 ) irq_raise(machine(), 10);
if( scanline == 8) irq_raise(timer.machine(), 9); if( scanline == 8) irq_raise(machine(), 9);
/* hayaosi1 needs at least 12 IRQ 0 per frame to work (see code at FFE02289) /* hayaosi1 needs at least 12 IRQ 0 per frame to work (see code at FFE02289)
kirarast needs it too, at least 8 per frame, but waits for a variable amount kirarast needs it too, at least 8 per frame, but waits for a variable amount
47pi2 needs ?? per frame (otherwise it hangs when you lose) 47pi2 needs ?? per frame (otherwise it hangs when you lose)
@ -1364,7 +1365,7 @@ static TIMER_DEVICE_CALLBACK(ms32_interrupt)
desertwr desertwr
p47aces p47aces
*/ */
if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(timer.machine(), 0); if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(machine(), 0);
} }
void bnstars_state::machine_reset() void bnstars_state::machine_reset()
@ -1378,7 +1379,7 @@ static MACHINE_CONFIG_START( bnstars, bnstars_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", V70, 20000000) // 20MHz MCFG_CPU_ADD("maincpu", V70, 20000000) // 20MHz
MCFG_CPU_PROGRAM_MAP(bnstars_map) MCFG_CPU_PROGRAM_MAP(bnstars_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", ms32_interrupt, "lscreen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bnstars_state, ms32_interrupt, "lscreen", 0, 1)
// MCFG_CPU_ADD("audiocpu", Z80, 4000000) // MCFG_CPU_ADD("audiocpu", Z80, 4000000)
// MCFG_CPU_PROGRAM_MAP(bnstars_z80_map) // MCFG_CPU_PROGRAM_MAP(bnstars_z80_map)

View File

@ -321,6 +321,7 @@ public:
virtual void video_start(); virtual void video_start();
UINT32 screen_update_coolridr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_coolridr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(system_h1); INTERRUPT_GEN_MEMBER(system_h1);
TIMER_DEVICE_CALLBACK_MEMBER(system_h1_sub);
}; };
@ -1144,16 +1145,15 @@ INTERRUPT_GEN_MEMBER(coolridr_state::system_h1)
} }
//IRQs 10,12 and 14 are valid on SH-1 instead //IRQs 10,12 and 14 are valid on SH-1 instead
static TIMER_DEVICE_CALLBACK( system_h1_sub ) TIMER_DEVICE_CALLBACK_MEMBER(coolridr_state::system_h1_sub)
{ {
coolridr_state *state = timer.machine().driver_data<coolridr_state>();
int scanline = param; int scanline = param;
switch(scanline) switch(scanline)
{ {
case 512:state->m_subcpu->set_input_line(0xa, HOLD_LINE); break; case 512:m_subcpu->set_input_line(0xa, HOLD_LINE); break;
case 256:state->m_subcpu->set_input_line(0xc, HOLD_LINE); break; case 256:m_subcpu->set_input_line(0xc, HOLD_LINE); break;
case 0:state->m_subcpu->set_input_line(0xe, HOLD_LINE); break; case 0:m_subcpu->set_input_line(0xe, HOLD_LINE); break;
} }
} }
@ -1173,7 +1173,7 @@ static MACHINE_CONFIG_START( coolridr, coolridr_state )
MCFG_CPU_ADD("sub", SH1, 16000000) // SH7032 HD6417032F20!! 16 mhz MCFG_CPU_ADD("sub", SH1, 16000000) // SH7032 HD6417032F20!! 16 mhz
MCFG_CPU_PROGRAM_MAP(coolridr_submap) MCFG_CPU_PROGRAM_MAP(coolridr_submap)
MCFG_TIMER_ADD_SCANLINE("scantimer", system_h1_sub, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", coolridr_state, system_h1_sub, "screen", 0, 1)
MCFG_GFXDECODE(coolridr) MCFG_GFXDECODE(coolridr)

View File

@ -120,6 +120,7 @@ public:
DECLARE_MACHINE_RESET(cshooter); DECLARE_MACHINE_RESET(cshooter);
DECLARE_MACHINE_RESET(airraid); DECLARE_MACHINE_RESET(airraid);
UINT32 screen_update_cshooter(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_cshooter(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(cshooter_scanline);
}; };
@ -202,15 +203,15 @@ UINT32 cshooter_state::screen_update_cshooter(screen_device &screen, bitmap_ind1
/* main cpu */ /* main cpu */
static TIMER_DEVICE_CALLBACK( cshooter_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(cshooter_state::cshooter_scanline)
{ {
int scanline = param; int scanline = param;
if(scanline == 240) // vblank-out irq if(scanline == 240) // vblank-out irq
timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x10); /* RST 10h */ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x10); /* RST 10h */
if(scanline == 0) // vblank-in irq if(scanline == 0) // vblank-in irq
timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x08); /* RST 08h */ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x08); /* RST 08h */
} }
@ -439,7 +440,7 @@ GFXDECODE_END
static MACHINE_CONFIG_START( cshooter, cshooter_state ) static MACHINE_CONFIG_START( cshooter, cshooter_state )
MCFG_CPU_ADD("maincpu", Z80,XTAL_12MHz/2) /* verified on pcb */ MCFG_CPU_ADD("maincpu", Z80,XTAL_12MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(cshooter_map) MCFG_CPU_PROGRAM_MAP(cshooter_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", cshooter_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cshooter_state, cshooter_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80,XTAL_14_31818MHz/4) /* verified on pcb */ MCFG_CPU_ADD("audiocpu", Z80,XTAL_14_31818MHz/4) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(sound_map) MCFG_CPU_PROGRAM_MAP(sound_map)
@ -466,7 +467,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( airraid, cshooter_state ) static MACHINE_CONFIG_START( airraid, cshooter_state )
MCFG_CPU_ADD("maincpu", Z80,XTAL_12MHz/2) /* verified on pcb */ MCFG_CPU_ADD("maincpu", Z80,XTAL_12MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(airraid_map) MCFG_CPU_PROGRAM_MAP(airraid_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", cshooter_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cshooter_state, cshooter_scanline, "screen", 0, 1)
SEIBU2_AIRRAID_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verified on pcb */ SEIBU2_AIRRAID_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verified on pcb */

View File

@ -80,6 +80,7 @@ public:
DECLARE_DRIVER_INIT(csplayh7); DECLARE_DRIVER_INIT(csplayh7);
DECLARE_DRIVER_INIT(junai2); DECLARE_DRIVER_INIT(junai2);
virtual void machine_reset(); virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(csplayh5_irq);
}; };
@ -596,19 +597,18 @@ void csplayh5_state::machine_reset()
} }
} }
static TIMER_DEVICE_CALLBACK( csplayh5_irq ) TIMER_DEVICE_CALLBACK_MEMBER(csplayh5_state::csplayh5_irq)
{ {
csplayh5_state *state = timer.machine().driver_data<csplayh5_state>();
int scanline = param; int scanline = param;
if(scanline == 212*2) if(scanline == 212*2)
state->m_maincpu->set_input_line_and_vector(1, HOLD_LINE,0x100/4); m_maincpu->set_input_line_and_vector(1, HOLD_LINE,0x100/4);
if((scanline % 2) == 0) if((scanline % 2) == 0)
{ {
state->m_v9958->set_sprite_limit(0); m_v9958->set_sprite_limit(0);
state->m_v9958->set_resolution(RENDER_HIGH); m_v9958->set_resolution(RENDER_HIGH);
state->m_v9958->interrupt(); m_v9958->interrupt();
} }
} }
@ -624,7 +624,7 @@ static MACHINE_CONFIG_START( csplayh5, csplayh5_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu",M68000,16000000) /* TMP68301-16 */ MCFG_CPU_ADD("maincpu",M68000,16000000) /* TMP68301-16 */
MCFG_CPU_PROGRAM_MAP(csplayh5_map) MCFG_CPU_PROGRAM_MAP(csplayh5_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", csplayh5_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", csplayh5_state, csplayh5_irq, "screen", 0, 1)
#if USE_H8 #if USE_H8
MCFG_CPU_ADD("subcpu", H83002, 16000000) /* unknown clock */ MCFG_CPU_ADD("subcpu", H83002, 16000000) /* unknown clock */

View File

@ -158,6 +158,7 @@ public:
virtual void video_start(); virtual void video_start();
UINT32 screen_update_ddealer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_ddealer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(ddealer_interrupt); INTERRUPT_GEN_MEMBER(ddealer_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(ddealer_mcu_sim);
}; };
@ -307,69 +308,68 @@ UINT32 ddealer_state::screen_update_ddealer(screen_device &screen, bitmap_ind16
return 0; return 0;
} }
static TIMER_DEVICE_CALLBACK( ddealer_mcu_sim ) TIMER_DEVICE_CALLBACK_MEMBER(ddealer_state::ddealer_mcu_sim)
{ {
ddealer_state *state = timer.machine().driver_data<ddealer_state>();
/*coin/credit simulation*/ /*coin/credit simulation*/
/*$fe002 is used,might be for multiple coins for one credit settings.*/ /*$fe002 is used,might be for multiple coins for one credit settings.*/
state->m_coin_input = (~(timer.machine().root_device().ioport("IN0")->read())); m_coin_input = (~(machine().root_device().ioport("IN0")->read()));
if (state->m_coin_input & 0x01)//coin 1 if (m_coin_input & 0x01)//coin 1
{ {
if((state->m_input_pressed & 0x01) == 0) if((m_input_pressed & 0x01) == 0)
state->m_mcu_shared_ram[0x000 / 2]++; m_mcu_shared_ram[0x000 / 2]++;
state->m_input_pressed = (state->m_input_pressed & 0xfe) | 1; m_input_pressed = (m_input_pressed & 0xfe) | 1;
} }
else else
state->m_input_pressed = (state->m_input_pressed & 0xfe); m_input_pressed = (m_input_pressed & 0xfe);
if (state->m_coin_input & 0x02)//coin 2 if (m_coin_input & 0x02)//coin 2
{ {
if ((state->m_input_pressed & 0x02) == 0) if ((m_input_pressed & 0x02) == 0)
state->m_mcu_shared_ram[0x000 / 2]++; m_mcu_shared_ram[0x000 / 2]++;
state->m_input_pressed = (state->m_input_pressed & 0xfd) | 2; m_input_pressed = (m_input_pressed & 0xfd) | 2;
} }
else else
state->m_input_pressed = (state->m_input_pressed & 0xfd); m_input_pressed = (m_input_pressed & 0xfd);
if (state->m_coin_input & 0x04)//service 1 if (m_coin_input & 0x04)//service 1
{ {
if ((state->m_input_pressed & 0x04) == 0) if ((m_input_pressed & 0x04) == 0)
state->m_mcu_shared_ram[0x000 / 2]++; m_mcu_shared_ram[0x000 / 2]++;
state->m_input_pressed = (state->m_input_pressed & 0xfb) | 4; m_input_pressed = (m_input_pressed & 0xfb) | 4;
} }
else else
state->m_input_pressed = (state->m_input_pressed & 0xfb); m_input_pressed = (m_input_pressed & 0xfb);
/*0x104/2 is some sort of "start-lock",i.e. used on the girl selection. /*0x104/2 is some sort of "start-lock",i.e. used on the girl selection.
Without it,the game "steals" one credit if you press the start button on that.*/ Without it,the game "steals" one credit if you press the start button on that.*/
if (state->m_mcu_shared_ram[0x000 / 2] > 0 && state->m_work_ram[0x104 / 2] & 1) if (m_mcu_shared_ram[0x000 / 2] > 0 && m_work_ram[0x104 / 2] & 1)
{ {
if (state->m_coin_input & 0x08)//start 1 if (m_coin_input & 0x08)//start 1
{ {
if ((state->m_input_pressed & 0x08) == 0 && (~(state->m_work_ram[0x100 / 2] & 1))) if ((m_input_pressed & 0x08) == 0 && (~(m_work_ram[0x100 / 2] & 1)))
state->m_mcu_shared_ram[0x000 / 2]--; m_mcu_shared_ram[0x000 / 2]--;
state->m_input_pressed = (state->m_input_pressed & 0xf7) | 8; m_input_pressed = (m_input_pressed & 0xf7) | 8;
} }
else else
state->m_input_pressed = (state->m_input_pressed & 0xf7); m_input_pressed = (m_input_pressed & 0xf7);
if (state->m_coin_input & 0x10)//start 2 if (m_coin_input & 0x10)//start 2
{ {
if((state->m_input_pressed & 0x10) == 0 && (~(state->m_work_ram[0x100 / 2] & 2))) if((m_input_pressed & 0x10) == 0 && (~(m_work_ram[0x100 / 2] & 2)))
state->m_mcu_shared_ram[0x000 / 2]--; m_mcu_shared_ram[0x000 / 2]--;
state->m_input_pressed = (state->m_input_pressed & 0xef) | 0x10; m_input_pressed = (m_input_pressed & 0xef) | 0x10;
} }
else else
state->m_input_pressed = (state->m_input_pressed & 0xef); m_input_pressed = (m_input_pressed & 0xef);
} }
/*random number generators,controls order of cards*/ /*random number generators,controls order of cards*/
state->m_mcu_shared_ram[0x10 / 2] = timer.machine().rand() & 0xffff; m_mcu_shared_ram[0x10 / 2] = machine().rand() & 0xffff;
state->m_mcu_shared_ram[0x12 / 2] = timer.machine().rand() & 0xffff; m_mcu_shared_ram[0x12 / 2] = machine().rand() & 0xffff;
state->m_mcu_shared_ram[0x14 / 2] = timer.machine().rand() & 0xffff; m_mcu_shared_ram[0x14 / 2] = machine().rand() & 0xffff;
state->m_mcu_shared_ram[0x16 / 2] = timer.machine().rand() & 0xffff; m_mcu_shared_ram[0x16 / 2] = machine().rand() & 0xffff;
} }
@ -646,7 +646,7 @@ static MACHINE_CONFIG_START( ddealer, ddealer_state )
MCFG_PALETTE_LENGTH(0x400) MCFG_PALETTE_LENGTH(0x400)
MCFG_TIMER_ADD_PERIODIC("coinsim", ddealer_mcu_sim, attotime::from_hz(10000)) // not real, but for simulating the MCU MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", ddealer_state, ddealer_mcu_sim, attotime::from_hz(10000))
MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ymsnd", YM2203, 6000000 / 4)//guess MCFG_SOUND_ADD("ymsnd", YM2203, 6000000 / 4)//guess

View File

@ -64,6 +64,7 @@ public:
UINT8 ram_bank_r(UINT16 offset, UINT8 bank_num); UINT8 ram_bank_r(UINT16 offset, UINT8 bank_num);
void ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num); void ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num);
TIMER_DEVICE_CALLBACK_MEMBER(dfruit_irq_scanline);
}; };
void dfruit_state::video_start() void dfruit_state::video_start()
@ -347,24 +348,23 @@ static I8255A_INTERFACE( ppi8255_intf )
DEVCB_NULL /* Port C write */ DEVCB_NULL /* Port C write */
}; };
static TIMER_DEVICE_CALLBACK( dfruit_irq_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(dfruit_state::dfruit_irq_scanline)
{ {
dfruit_state *state = timer.machine().driver_data<dfruit_state>();
int scanline = param; int scanline = param;
if (scanline == 240 && (state->m_irq_enable & 4)) if (scanline == 240 && (m_irq_enable & 4))
{ {
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, state->m_irq_vector[2]); m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[2]);
} }
if (scanline == 0 && (state->m_irq_enable & 2)) if (scanline == 0 && (m_irq_enable & 2))
{ {
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, state->m_irq_vector[1]); m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[1]);
} }
if (scanline == 196 && (state->m_irq_enable & 1)) if (scanline == 196 && (m_irq_enable & 1))
{ {
//state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, state->m_irq_vector[0]); //m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[0]);
} }
} }
@ -387,7 +387,7 @@ static MACHINE_CONFIG_START( dfruit, dfruit_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu",Z80,MASTER_CLOCK/2) //!!! TC0091LVC !!! MCFG_CPU_ADD("maincpu",Z80,MASTER_CLOCK/2) //!!! TC0091LVC !!!
MCFG_CPU_PROGRAM_MAP(dfruit_map) MCFG_CPU_PROGRAM_MAP(dfruit_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", dfruit_irq_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dfruit_state, dfruit_irq_scanline, "screen", 0, 1)
//MCFG_MACHINE_START_OVERRIDE(dfruit_state,4enraya) //MCFG_MACHINE_START_OVERRIDE(dfruit_state,4enraya)
//MCFG_MACHINE_RESET_OVERRIDE(dfruit_state,4enraya) //MCFG_MACHINE_RESET_OVERRIDE(dfruit_state,4enraya)

View File

@ -350,6 +350,7 @@ public:
virtual void video_start(); virtual void video_start();
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_dwarfd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_dwarfd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(dwarfd_interrupt);
}; };
@ -870,9 +871,8 @@ static I8085_CONFIG( dwarfd_i8085_config )
}; };
static TIMER_DEVICE_CALLBACK( dwarfd_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(dwarfd_state::dwarfd_interrupt)
{ {
dwarfd_state *state = timer.machine().driver_data<dwarfd_state>();
int scanline = param; int scanline = param;
if((scanline % 8) != 0) if((scanline % 8) != 0)
@ -880,15 +880,15 @@ static TIMER_DEVICE_CALLBACK( dwarfd_interrupt )
if (scanline < 25*8) if (scanline < 25*8)
{ {
state->m_maincpu->set_input_line(I8085_RST65_LINE, HOLD_LINE); // 34 - every 8th line m_maincpu->set_input_line(I8085_RST65_LINE, HOLD_LINE); // 34 - every 8th line
state->m_line = scanline/8; m_line = scanline/8;
state->m_idx = 0; m_idx = 0;
} }
else else
{ {
if (scanline == 25*8) if (scanline == 25*8)
{ {
state->m_maincpu->set_input_line(I8085_RST55_LINE, HOLD_LINE);//2c - generated by crt - end of frame m_maincpu->set_input_line(I8085_RST55_LINE, HOLD_LINE);//2c - generated by crt - end of frame
} }
} }
} }
@ -1072,7 +1072,7 @@ static MACHINE_CONFIG_START( dwarfd, dwarfd_state )
MCFG_CPU_CONFIG(dwarfd_i8085_config) MCFG_CPU_CONFIG(dwarfd_i8085_config)
MCFG_CPU_PROGRAM_MAP(mem_map) MCFG_CPU_PROGRAM_MAP(mem_map)
MCFG_CPU_IO_MAP(io_map) MCFG_CPU_IO_MAP(io_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", dwarfd_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dwarfd_state, dwarfd_interrupt, "screen", 0, 1)
/* video hardware */ /* video hardware */

View File

@ -87,17 +87,17 @@ public:
DECLARE_DRIVER_INIT(ecoinfr); DECLARE_DRIVER_INIT(ecoinfr);
DECLARE_DRIVER_INIT(ecoinfrmab); DECLARE_DRIVER_INIT(ecoinfrmab);
virtual void machine_reset(); virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(ecoinfr_irq_timer);
}; };
TIMER_DEVICE_CALLBACK( ecoinfr_irq_timer ) TIMER_DEVICE_CALLBACK_MEMBER(ecoinfr_state::ecoinfr_irq_timer)
{ {
ecoinfr_state *state = timer.machine().driver_data<ecoinfr_state>(); irq_toggle^=1;
state->irq_toggle^=1;
//printf("blah %d\n", state->irq_toggle); //printf("blah %d\n", irq_toggle);
/* What are the IRQ sources / freq? /* What are the IRQ sources / freq?
It runs in IM2 It runs in IM2
@ -108,13 +108,13 @@ TIMER_DEVICE_CALLBACK( ecoinfr_irq_timer )
*/ */
if (state->irq_toggle==0) if (irq_toggle==0)
{ {
timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xe4); machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xe4);
} }
else else
{ {
timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xe0); machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xe0);
} }
@ -651,7 +651,7 @@ static MACHINE_CONFIG_START( ecoinfr, ecoinfr_state )
MCFG_CPU_ADD("maincpu", Z80,4000000) MCFG_CPU_ADD("maincpu", Z80,4000000)
MCFG_CPU_PROGRAM_MAP(memmap) MCFG_CPU_PROGRAM_MAP(memmap)
MCFG_CPU_IO_MAP(portmap) MCFG_CPU_IO_MAP(portmap)
MCFG_TIMER_ADD_PERIODIC("ectimer",ecoinfr_irq_timer, attotime::from_hz(250)) MCFG_TIMER_DRIVER_ADD_PERIODIC("ectimer", ecoinfr_state, ecoinfr_irq_timer, attotime::from_hz(250))
MCFG_I8251_ADD(UPD8251_TAG, default_i8251_interface) MCFG_I8251_ADD(UPD8251_TAG, default_i8251_interface)
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -183,6 +183,7 @@ public:
virtual void video_start(); virtual void video_start();
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_galsnew(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_galsnew(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(expro02_scanline);
}; };
@ -497,16 +498,16 @@ ADDRESS_MAP_END
* *
*************************************/ *************************************/
static TIMER_DEVICE_CALLBACK( expro02_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(expro02_state::expro02_scanline)
{ {
int scanline = param; int scanline = param;
if(scanline == 224) // vblank-out irq if(scanline == 224) // vblank-out irq
timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
else if(scanline == 0) // vblank-in irq? else if(scanline == 0) // vblank-in irq?
timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
else if(scanline == 112) // VDP end task? (controls sprite colors in gameplay) else if(scanline == 112) // VDP end task? (controls sprite colors in gameplay)
timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
} }
void expro02_state::machine_reset() void expro02_state::machine_reset()
@ -547,7 +548,7 @@ static MACHINE_CONFIG_START( galsnew, expro02_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 12000000) MCFG_CPU_ADD("maincpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(galsnew_map) MCFG_CPU_PROGRAM_MAP(galsnew_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", expro02_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", expro02_state, expro02_scanline, "screen", 0, 1)
/* CALC01 MCU @ 16Mhz (unknown type, simulated) */ /* CALC01 MCU @ 16Mhz (unknown type, simulated) */

View File

@ -99,6 +99,7 @@ public:
virtual void machine_start(); virtual void machine_start();
virtual void video_start(); virtual void video_start();
UINT32 screen_update_firefox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_firefox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(video_timer_callback);
}; };
@ -250,11 +251,11 @@ UINT32 firefox_state::screen_update_firefox(screen_device &screen, bitmap_rgb32
return 0; return 0;
} }
static TIMER_DEVICE_CALLBACK( video_timer_callback ) TIMER_DEVICE_CALLBACK_MEMBER(firefox_state::video_timer_callback)
{ {
timer.machine().primary_screen->update_now(); machine().primary_screen->update_now();
timer.machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE ); machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE );
} }
static void set_rgba( running_machine &machine, int start, int index, unsigned char *palette_ram ) static void set_rgba( running_machine &machine, int start, int index, unsigned char *palette_ram )
@ -701,7 +702,7 @@ static MACHINE_CONFIG_START( firefox, firefox_state )
MCFG_CPU_ADD("maincpu", M6809E, MASTER_XTAL/2) MCFG_CPU_ADD("maincpu", M6809E, MASTER_XTAL/2)
MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_PROGRAM_MAP(main_map)
/* interrupts count starting at end of VBLANK, which is 44, so add 44 */ /* interrupts count starting at end of VBLANK, which is 44, so add 44 */
MCFG_TIMER_ADD_SCANLINE("32v", video_timer_callback, "screen", 96+44, 128) MCFG_TIMER_DRIVER_ADD_SCANLINE("32v", firefox_state, video_timer_callback, "screen", 96+44, 128)
MCFG_CPU_ADD("audiocpu", M6502, MASTER_XTAL/8) MCFG_CPU_ADD("audiocpu", M6502, MASTER_XTAL/8)
MCFG_CPU_PROGRAM_MAP(audio_map) MCFG_CPU_PROGRAM_MAP(audio_map)

View File

@ -113,6 +113,7 @@ public:
} }
virtual void video_start(); virtual void video_start();
UINT32 screen_update_galpani3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_galpani3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(galpani3_vblank);
}; };
@ -124,19 +125,18 @@ public:
static TIMER_DEVICE_CALLBACK( galpani3_vblank ) // 2, 3, 5 ? TIMER_DEVICE_CALLBACK_MEMBER(galpani3_state::galpani3_vblank)// 2, 3, 5 ?
{ {
galpani3_state *state = timer.machine().driver_data<galpani3_state>();
int scanline = param; int scanline = param;
if(scanline == 240) if(scanline == 240)
state->m_maincpu->set_input_line(2, HOLD_LINE); m_maincpu->set_input_line(2, HOLD_LINE);
if(scanline == 0) if(scanline == 0)
state->m_maincpu->set_input_line(3, HOLD_LINE); m_maincpu->set_input_line(3, HOLD_LINE);
if(scanline == 128) if(scanline == 128)
state->m_maincpu->set_input_line(5, HOLD_LINE); // timer, related to sound chip? m_maincpu->set_input_line(5, HOLD_LINE); // timer, related to sound chip?
} }
@ -510,7 +510,7 @@ static const ymz280b_interface ymz280b_intf =
static MACHINE_CONFIG_START( galpani3, galpani3_state ) static MACHINE_CONFIG_START( galpani3, galpani3_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_28_63636MHz/2) // Confirmed from PCB MCFG_CPU_ADD("maincpu", M68000, XTAL_28_63636MHz/2) // Confirmed from PCB
MCFG_CPU_PROGRAM_MAP(galpani3_map) MCFG_CPU_PROGRAM_MAP(galpani3_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", galpani3_vblank, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", galpani3_state, galpani3_vblank, "screen", 0, 1)
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_REFRESH_RATE(60)

View File

@ -267,6 +267,8 @@ public:
UINT32 screen_update_halleys(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_halleys(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_benberob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_benberob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(blitter_reset); TIMER_CALLBACK_MEMBER(blitter_reset);
TIMER_DEVICE_CALLBACK_MEMBER(halleys_scanline);
TIMER_DEVICE_CALLBACK_MEMBER(benberob_scanline);
}; };
@ -1541,9 +1543,8 @@ READ8_MEMBER(halleys_state::debug_r)
// Interrupt and Hardware Handlers // Interrupt and Hardware Handlers
static TIMER_DEVICE_CALLBACK( halleys_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(halleys_state::halleys_scanline)
{ {
halleys_state *state = timer.machine().driver_data<halleys_state>();
int scanline = param; int scanline = param;
/* TODO: fix this */ /* TODO: fix this */
@ -1551,29 +1552,28 @@ static TIMER_DEVICE_CALLBACK( halleys_scanline )
{ {
case 248: case 248:
// clear collision list of this frame unconditionally // clear collision list of this frame unconditionally
state->m_collision_count = 0; m_collision_count = 0;
break; break;
// In Halley's Comet, NMI is used exclusively to handle coin input // In Halley's Comet, NMI is used exclusively to handle coin input
case 56*3: case 56*3:
timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
break; break;
// FIRQ drives gameplay; we need both types of NMI each frame. // FIRQ drives gameplay; we need both types of NMI each frame.
case 56*2: case 56*2:
state->m_mVectorType = 1; timer.machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); m_mVectorType = 1; machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
break; break;
case 56: case 56:
state->m_mVectorType = 0; timer.machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); m_mVectorType = 0; machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
break; break;
} }
} }
static TIMER_DEVICE_CALLBACK( benberob_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(halleys_state::benberob_scanline)
{ {
halleys_state *state = timer.machine().driver_data<halleys_state>();
int scanline = param; int scanline = param;
/* TODO: fix this */ /* TODO: fix this */
@ -1583,13 +1583,13 @@ static TIMER_DEVICE_CALLBACK( benberob_scanline )
break; break;
case 56*3: case 56*3:
timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
break; break;
case 56*2: case 56*2:
case 56*1: case 56*1:
// FIRQ must not happen when the blitter is being updated or it'll cause serious screen artifacts // FIRQ must not happen when the blitter is being updated or it'll cause serious screen artifacts
if (!state->m_blitter_busy) timer.machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); else state->m_firq_level++; if (!m_blitter_busy) machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); else m_firq_level++;
break; break;
} }
} }
@ -1959,7 +1959,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_CONFIG_START( halleys, halleys_state ) static MACHINE_CONFIG_START( halleys, halleys_state )
MCFG_CPU_ADD("maincpu", M6809, XTAL_19_968MHz/12) /* verified on pcb */ MCFG_CPU_ADD("maincpu", M6809, XTAL_19_968MHz/12) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(halleys_map) MCFG_CPU_PROGRAM_MAP(halleys_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", halleys_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", halleys_state, halleys_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_6MHz/2) /* verified on pcb */ MCFG_CPU_ADD("audiocpu", Z80, XTAL_6MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(sound_map) MCFG_CPU_PROGRAM_MAP(sound_map)
@ -2000,7 +2000,7 @@ static MACHINE_CONFIG_DERIVED( benberob, halleys )
MCFG_CPU_MODIFY("maincpu") MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_CLOCK(XTAL_19_968MHz/12) /* not verified but pcb identical to halley's comet */ MCFG_CPU_CLOCK(XTAL_19_968MHz/12) /* not verified but pcb identical to halley's comet */
MCFG_TIMER_MODIFY("scantimer") MCFG_TIMER_MODIFY("scantimer")
MCFG_TIMER_CALLBACK(benberob_scanline) MCFG_TIMER_DRIVER_CALLBACK(halleys_state, benberob_scanline)
MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(halleys_state, screen_update_benberob) MCFG_SCREEN_UPDATE_DRIVER(halleys_state, screen_update_benberob)

View File

@ -128,6 +128,7 @@ public:
virtual void video_start(); virtual void video_start();
UINT32 screen_update_hvyunit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_hvyunit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_hvyunit(screen_device &screen, bool state); void screen_eof_hvyunit(screen_device &screen, bool state);
TIMER_DEVICE_CALLBACK_MEMBER(hvyunit_scanline);
}; };
@ -624,17 +625,16 @@ GFXDECODE_END
*************************************/ *************************************/
/* Main Z80 uses IM2 */ /* Main Z80 uses IM2 */
static TIMER_DEVICE_CALLBACK( hvyunit_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(hvyunit_state::hvyunit_scanline)
{ {
hvyunit_state *state = timer.machine().driver_data<hvyunit_state>();
int scanline = param; int scanline = param;
if(scanline == 240) // vblank-out irq if(scanline == 240) // vblank-out irq
state->m_master_cpu->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd); m_master_cpu->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd);
/* Pandora "sprite end dma" irq? TODO: timing is likely off */ /* Pandora "sprite end dma" irq? TODO: timing is likely off */
if(scanline == 64) if(scanline == 64)
state->m_master_cpu->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff); m_master_cpu->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff);
} }
static const kaneko_pandora_interface hvyunit_pandora_config = static const kaneko_pandora_interface hvyunit_pandora_config =
@ -656,7 +656,7 @@ static MACHINE_CONFIG_START( hvyunit, hvyunit_state )
MCFG_CPU_ADD("master", Z80, 6000000) MCFG_CPU_ADD("master", Z80, 6000000)
MCFG_CPU_PROGRAM_MAP(master_memory) MCFG_CPU_PROGRAM_MAP(master_memory)
MCFG_CPU_IO_MAP(master_io) MCFG_CPU_IO_MAP(master_io)
MCFG_TIMER_ADD_SCANLINE("scantimer", hvyunit_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hvyunit_state, hvyunit_scanline, "screen", 0, 1)
MCFG_CPU_ADD("slave", Z80, 6000000) MCFG_CPU_ADD("slave", Z80, 6000000)
MCFG_CPU_PROGRAM_MAP(slave_memory) MCFG_CPU_PROGRAM_MAP(slave_memory)

View File

@ -56,6 +56,8 @@ public:
// motors positions // motors positions
int m_rmotor; // right motor position (0-100) int m_rmotor; // right motor position (0-100)
int m_lmotor; // left motor position (0-100) int m_lmotor; // left motor position (0-100)
TIMER_DEVICE_CALLBACK_MEMBER(icecold_sint_timer);
TIMER_DEVICE_CALLBACK_MEMBER(icecold_motors_timer);
}; };
static ADDRESS_MAP_START( icecold_map, AS_PROGRAM, 8, icecold_state ) static ADDRESS_MAP_START( icecold_map, AS_PROGRAM, 8, icecold_state )
@ -286,48 +288,46 @@ READ_LINE_MEMBER( icecold_state::sint_r )
return m_sint; return m_sint;
} }
static TIMER_DEVICE_CALLBACK( icecold_sint_timer ) TIMER_DEVICE_CALLBACK_MEMBER(icecold_state::icecold_sint_timer)
{ {
icecold_state *state = timer.machine().driver_data<icecold_state>(); m_sint = !m_sint;
state->m_sint = !state->m_sint; m_pia1->ca1_w(m_sint);
state->m_pia1->ca1_w(state->m_sint);
} }
static TIMER_DEVICE_CALLBACK( icecold_motors_timer ) TIMER_DEVICE_CALLBACK_MEMBER(icecold_state::icecold_motors_timer)
{ {
icecold_state *state = timer.machine().driver_data<icecold_state>();
// /MOTENBL is set high during reset for disable the motors control // /MOTENBL is set high during reset for disable the motors control
if (state->m_motenbl == 0) if (m_motenbl == 0)
{ {
int lmotor_dir = ((state->m_motors_ctrl & 0x0f) == 0x06) ? -1 : ((state->m_motors_ctrl & 0x0f) == 0x09) ? +1 : 0; int lmotor_dir = ((m_motors_ctrl & 0x0f) == 0x06) ? -1 : ((m_motors_ctrl & 0x0f) == 0x09) ? +1 : 0;
int rmotor_dir = ((state->m_motors_ctrl & 0xf0) == 0x60) ? -1 : ((state->m_motors_ctrl & 0xf0) == 0x90) ? +1 : 0; int rmotor_dir = ((m_motors_ctrl & 0xf0) == 0x60) ? -1 : ((m_motors_ctrl & 0xf0) == 0x90) ? +1 : 0;
// update motors position // update motors position
state->m_lmotor += lmotor_dir; m_lmotor += lmotor_dir;
state->m_rmotor += rmotor_dir; m_rmotor += rmotor_dir;
// if one motor is at the top of the playfield, closes the ball gate switch, to simulate ball movement // if one motor is at the top of the playfield, closes the ball gate switch, to simulate ball movement
if (state->m_lmotor >= 99 || state->m_rmotor >= 99 ) if (m_lmotor >= 99 || m_rmotor >= 99 )
state->m_ball_gate_sw = 1; m_ball_gate_sw = 1;
// if the motors are at the bottom of the playfield, opens the ball gate switch for start the game // if the motors are at the bottom of the playfield, opens the ball gate switch for start the game
else if (state->m_lmotor <= 1 && state->m_rmotor <= 1 ) else if (m_lmotor <= 1 && m_rmotor <= 1 )
state->m_ball_gate_sw = 0; m_ball_gate_sw = 0;
// motors are keep in range 0-100 // motors are keep in range 0-100
state->m_lmotor = MIN(state->m_lmotor, 100); m_lmotor = MIN(m_lmotor, 100);
state->m_lmotor = MAX(state->m_lmotor, 0); m_lmotor = MAX(m_lmotor, 0);
state->m_rmotor = MIN(state->m_rmotor, 100); m_rmotor = MIN(m_rmotor, 100);
state->m_rmotor = MAX(state->m_rmotor, 0); m_rmotor = MAX(m_rmotor, 0);
if (lmotor_dir != 0 || rmotor_dir != 0) if (lmotor_dir != 0 || rmotor_dir != 0)
{ {
output_set_value("lmotor", state->m_lmotor); output_set_value("lmotor", m_lmotor);
output_set_value("rmotor", state->m_rmotor); output_set_value("rmotor", m_rmotor);
popmessage("Left Motor Right Motor\n%-4s %-4s\n%02d\\100 %02d\\100", popmessage("Left Motor Right Motor\n%-4s %-4s\n%02d\\100 %02d\\100",
(lmotor_dir > 0) ? " up" : ((lmotor_dir < 0) ? "down" : "off"), (lmotor_dir > 0) ? " up" : ((lmotor_dir < 0) ? "down" : "off"),
(rmotor_dir > 0) ? " up" : ((rmotor_dir < 0) ? "down" : "off"), state->m_lmotor, state->m_rmotor); (rmotor_dir > 0) ? " up" : ((rmotor_dir < 0) ? "down" : "off"), m_lmotor, m_rmotor);
} }
} }
} }
@ -424,10 +424,10 @@ static MACHINE_CONFIG_START( icecold, icecold_state )
MCFG_I8279_ADD("i8279", XTAL_6MHz/4, icecold_i8279_intf) MCFG_I8279_ADD("i8279", XTAL_6MHz/4, icecold_i8279_intf)
// 30Hz signal from CH-C of ay0 // 30Hz signal from CH-C of ay0
MCFG_TIMER_ADD_PERIODIC("sint_timer", icecold_sint_timer, attotime::from_hz(30)) MCFG_TIMER_DRIVER_ADD_PERIODIC("sint_timer", icecold_state, icecold_sint_timer, attotime::from_hz(30))
// for update motors position // for update motors position
MCFG_TIMER_ADD_PERIODIC("motors_timer", icecold_motors_timer, attotime::from_msec(50)) MCFG_TIMER_DRIVER_ADD_PERIODIC("motors_timer", icecold_state, icecold_motors_timer, attotime::from_msec(50))
// video hardware // video hardware
MCFG_DEFAULT_LAYOUT(layout_icecold) MCFG_DEFAULT_LAYOUT(layout_icecold)

View File

@ -156,6 +156,9 @@ public:
DECLARE_MACHINE_RESET(mgcs); DECLARE_MACHINE_RESET(mgcs);
DECLARE_MACHINE_RESET(lhzb2a); DECLARE_MACHINE_RESET(lhzb2a);
UINT32 screen_update_igs017(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_igs017(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(irqblocka_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(mgcs_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(mgdh_interrupt);
}; };
@ -3221,16 +3224,15 @@ GFXDECODE_END
Machine Drivers Machine Drivers
***************************************************************************/ ***************************************************************************/
static TIMER_DEVICE_CALLBACK( irqblocka_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::irqblocka_interrupt)
{ {
igs017_state *state = timer.machine().driver_data<igs017_state>();
int scanline = param; int scanline = param;
if(scanline == 240 && state->m_irq_enable) if(scanline == 240 && m_irq_enable)
state->m_maincpu->set_input_line(0, HOLD_LINE); m_maincpu->set_input_line(0, HOLD_LINE);
if(scanline == 0 && state->m_nmi_enable) if(scanline == 0 && m_nmi_enable)
state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
} }
@ -3257,7 +3259,7 @@ static MACHINE_CONFIG_START( iqblocka, igs017_state )
MCFG_CPU_ADD("maincpu", Z180, XTAL_16MHz / 2) MCFG_CPU_ADD("maincpu", Z180, XTAL_16MHz / 2)
MCFG_CPU_PROGRAM_MAP(iqblocka_map) MCFG_CPU_PROGRAM_MAP(iqblocka_map)
MCFG_CPU_IO_MAP(iqblocka_io) MCFG_CPU_IO_MAP(iqblocka_io)
MCFG_TIMER_ADD_SCANLINE("scantimer", irqblocka_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, irqblocka_interrupt, "screen", 0, 1)
MCFG_I8255A_ADD( "ppi8255", iqblocka_ppi8255_intf ) MCFG_I8255A_ADD( "ppi8255", iqblocka_ppi8255_intf )
@ -3288,16 +3290,15 @@ MACHINE_CONFIG_END
// mgcs // mgcs
static TIMER_DEVICE_CALLBACK( mgcs_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::mgcs_interrupt)
{ {
igs017_state *state = timer.machine().driver_data<igs017_state>();
int scanline = param; int scanline = param;
if(scanline == 240 && state->m_irq1_enable) if(scanline == 240 && m_irq1_enable)
state->m_maincpu->set_input_line(1, HOLD_LINE); m_maincpu->set_input_line(1, HOLD_LINE);
if(scanline == 0 && state->m_irq2_enable) if(scanline == 0 && m_irq2_enable)
state->m_maincpu->set_input_line(2, HOLD_LINE); m_maincpu->set_input_line(2, HOLD_LINE);
} }
MACHINE_RESET_MEMBER(igs017_state,mgcs) MACHINE_RESET_MEMBER(igs017_state,mgcs)
@ -3322,7 +3323,7 @@ static I8255A_INTERFACE( mgcs_ppi8255_intf )
static MACHINE_CONFIG_START( mgcs, igs017_state ) static MACHINE_CONFIG_START( mgcs, igs017_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2) MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2)
MCFG_CPU_PROGRAM_MAP(mgcs) MCFG_CPU_PROGRAM_MAP(mgcs)
MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgcs_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs)
@ -3362,7 +3363,7 @@ static I8255A_INTERFACE( lhzb2_ppi8255_intf )
static MACHINE_CONFIG_START( lhzb2, igs017_state ) static MACHINE_CONFIG_START( lhzb2, igs017_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2) MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2)
MCFG_CPU_PROGRAM_MAP(lhzb2) MCFG_CPU_PROGRAM_MAP(lhzb2)
MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgcs_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs)
@ -3399,7 +3400,7 @@ MACHINE_RESET_MEMBER(igs017_state,lhzb2a)
static MACHINE_CONFIG_START( lhzb2a, igs017_state ) static MACHINE_CONFIG_START( lhzb2a, igs017_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz/2) MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz/2)
MCFG_CPU_PROGRAM_MAP(lhzb2a) MCFG_CPU_PROGRAM_MAP(lhzb2a)
MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgcs_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,lhzb2a) MCFG_MACHINE_RESET_OVERRIDE(igs017_state,lhzb2a)
@ -3430,7 +3431,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( slqz2, igs017_state ) static MACHINE_CONFIG_START( slqz2, igs017_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2) MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2)
MCFG_CPU_PROGRAM_MAP(slqz2) MCFG_CPU_PROGRAM_MAP(slqz2)
MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgcs_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs)
@ -3470,7 +3471,7 @@ static I8255A_INTERFACE( sdmg2_ppi8255_intf )
static MACHINE_CONFIG_START( sdmg2, igs017_state ) static MACHINE_CONFIG_START( sdmg2, igs017_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz/2) MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz/2)
MCFG_CPU_PROGRAM_MAP(sdmg2) MCFG_CPU_PROGRAM_MAP(sdmg2)
MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgcs_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs)
@ -3497,16 +3498,15 @@ MACHINE_CONFIG_END
// mgdh // mgdh
static TIMER_DEVICE_CALLBACK( mgdh_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::mgdh_interrupt)
{ {
igs017_state *state = timer.machine().driver_data<igs017_state>();
int scanline = param; int scanline = param;
if(scanline == 240 && state->m_irq1_enable) if(scanline == 240 && m_irq1_enable)
state->m_maincpu->set_input_line(1, HOLD_LINE); m_maincpu->set_input_line(1, HOLD_LINE);
if(scanline == 0 && state->m_irq2_enable) if(scanline == 0 && m_irq2_enable)
state->m_maincpu->set_input_line(3, HOLD_LINE); // lev 3 instead of 2 m_maincpu->set_input_line(3, HOLD_LINE); // lev 3 instead of 2
} }
static I8255A_INTERFACE( mgdh_ppi8255_intf ) static I8255A_INTERFACE( mgdh_ppi8255_intf )
@ -3522,7 +3522,7 @@ static I8255A_INTERFACE( mgdh_ppi8255_intf )
static MACHINE_CONFIG_START( mgdha, igs017_state ) static MACHINE_CONFIG_START( mgdha, igs017_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2) MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2)
MCFG_CPU_PROGRAM_MAP(mgdha_map) MCFG_CPU_PROGRAM_MAP(mgdha_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", mgdh_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgdh_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs)
@ -3553,7 +3553,7 @@ static MACHINE_CONFIG_START( tjsb, igs017_state )
MCFG_CPU_ADD("maincpu", Z180, XTAL_16MHz / 2) MCFG_CPU_ADD("maincpu", Z180, XTAL_16MHz / 2)
MCFG_CPU_PROGRAM_MAP(tjsb_map) MCFG_CPU_PROGRAM_MAP(tjsb_map)
MCFG_CPU_IO_MAP(tjsb_io) MCFG_CPU_IO_MAP(tjsb_io)
MCFG_TIMER_ADD_SCANLINE("scantimer", irqblocka_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, irqblocka_interrupt, "screen", 0, 1)
MCFG_I8255A_ADD( "ppi8255", iqblocka_ppi8255_intf ) MCFG_I8255A_ADD( "ppi8255", iqblocka_ppi8255_intf )

View File

@ -121,6 +121,7 @@ public:
DECLARE_VIDEO_START(cpokerpk); DECLARE_VIDEO_START(cpokerpk);
UINT32 screen_update_igs_video(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_igs_video(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_cpokerpk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_cpokerpk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(igs_interrupt);
}; };
@ -132,19 +133,18 @@ void igspoker_state::machine_reset()
} }
static TIMER_DEVICE_CALLBACK( igs_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(igspoker_state::igs_interrupt)
{ {
igspoker_state *state = timer.machine().driver_data<igspoker_state>();
int scanline = param; int scanline = param;
if((scanline % 32) != 0) if((scanline % 32) != 0)
return; return;
if((scanline % 64) == 32) if((scanline % 64) == 32)
state->m_maincpu->set_input_line(0, ASSERT_LINE); m_maincpu->set_input_line(0, ASSERT_LINE);
if((scanline % 64) == 0 && state->m_nmi_enable) if((scanline % 64) == 0 && m_nmi_enable)
state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
} }
@ -1771,7 +1771,7 @@ static MACHINE_CONFIG_START( igspoker, igspoker_state )
MCFG_CPU_ADD("maincpu",Z80, 3579545) MCFG_CPU_ADD("maincpu",Z80, 3579545)
MCFG_CPU_PROGRAM_MAP(igspoker_prg_map) MCFG_CPU_PROGRAM_MAP(igspoker_prg_map)
MCFG_CPU_IO_MAP(igspoker_io_map) MCFG_CPU_IO_MAP(igspoker_io_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", igs_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igspoker_state, igs_interrupt, "screen", 0, 1)
/* video hardware */ /* video hardware */

View File

@ -111,6 +111,7 @@ public:
virtual void machine_reset(); virtual void machine_reset();
virtual void video_start(); virtual void video_start();
UINT32 screen_update_jackie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_jackie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(jackie_irq);
}; };
@ -557,18 +558,17 @@ DRIVER_INIT_MEMBER(jackie_state,jackie)
rom[0x7e86] = 0xc3; rom[0x7e86] = 0xc3;
} }
static TIMER_DEVICE_CALLBACK( jackie_irq ) TIMER_DEVICE_CALLBACK_MEMBER(jackie_state::jackie_irq)
{ {
jackie_state *state = timer.machine().driver_data<jackie_state>();
int scanline = param; int scanline = param;
if((scanline % 32) != 0) if((scanline % 32) != 0)
return; return;
if((scanline % 64) == 32 && state->m_irq_enable) if((scanline % 64) == 32 && m_irq_enable)
state->m_maincpu->set_input_line(0, HOLD_LINE); m_maincpu->set_input_line(0, HOLD_LINE);
else if ((scanline % 64) == 0 && state->m_nmi_enable) else if ((scanline % 64) == 0 && m_nmi_enable)
state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
} }
static MACHINE_CONFIG_START( jackie, jackie_state ) static MACHINE_CONFIG_START( jackie, jackie_state )
@ -577,7 +577,7 @@ static MACHINE_CONFIG_START( jackie, jackie_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz / 2) MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz / 2)
MCFG_CPU_PROGRAM_MAP(jackie_prg_map) MCFG_CPU_PROGRAM_MAP(jackie_prg_map)
MCFG_CPU_IO_MAP(jackie_io_map) MCFG_CPU_IO_MAP(jackie_io_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", jackie_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", jackie_state, jackie_irq, "screen", 0, 1)
/* video hardware */ /* video hardware */

View File

@ -206,6 +206,7 @@ public:
DECLARE_VIDEO_START(urashima); DECLARE_VIDEO_START(urashima);
UINT32 screen_update_jalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_jalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_urashima(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_urashima(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(jalmah_mcu_sim);
}; };
@ -930,10 +931,9 @@ static void second_mcu_run(running_machine &machine)
} }
static TIMER_DEVICE_CALLBACK( jalmah_mcu_sim ) TIMER_DEVICE_CALLBACK_MEMBER(jalmah_state::jalmah_mcu_sim)
{ {
jalmah_state *state = timer.machine().driver_data<jalmah_state>(); switch(m_mcu_prg)
switch(state->m_mcu_prg)
{ {
/* /*
#define DAIREIKA_MCU (0x11) #define DAIREIKA_MCU (0x11)
@ -943,12 +943,12 @@ static TIMER_DEVICE_CALLBACK( jalmah_mcu_sim )
#define KAKUMEI2_MCU (0x22) #define KAKUMEI2_MCU (0x22)
#define SUCHIPI_MCU (0x23) #define SUCHIPI_MCU (0x23)
*/ */
case MJZOOMIN_MCU: mjzoomin_mcu_run(timer.machine()); break; case MJZOOMIN_MCU: mjzoomin_mcu_run(machine()); break;
case DAIREIKA_MCU: daireika_mcu_run(timer.machine()); break; case DAIREIKA_MCU: daireika_mcu_run(machine()); break;
case URASHIMA_MCU: urashima_mcu_run(timer.machine()); break; case URASHIMA_MCU: urashima_mcu_run(machine()); break;
case KAKUMEI_MCU: case KAKUMEI_MCU:
case KAKUMEI2_MCU: case KAKUMEI2_MCU:
case SUCHIPI_MCU: second_mcu_run(timer.machine()); break; case SUCHIPI_MCU: second_mcu_run(machine()); break;
} }
} }
@ -1422,7 +1422,7 @@ static MACHINE_CONFIG_START( jalmah, jalmah_state )
MCFG_PALETTE_LENGTH(0x400) MCFG_PALETTE_LENGTH(0x400)
MCFG_TIMER_ADD_PERIODIC("mcusim", jalmah_mcu_sim, attotime::from_hz(10000)) // not real, but for simulating the MCU MCFG_TIMER_DRIVER_ADD_PERIODIC("mcusim", jalmah_state, jalmah_mcu_sim, attotime::from_hz(10000))
MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_OKIM6295_ADD("oki", 4000000, OKIM6295_PIN7_LOW) MCFG_OKIM6295_ADD("oki", 4000000, OKIM6295_PIN7_LOW)

View File

@ -225,6 +225,7 @@ public:
DECLARE_DRIVER_INIT(jchan); DECLARE_DRIVER_INIT(jchan);
virtual void video_start(); virtual void video_start();
UINT32 screen_update_jchan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_jchan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(jchan_vblank);
}; };
@ -243,27 +244,26 @@ public:
// if it is incorrect jchan2 will crash when // if it is incorrect jchan2 will crash when
// certain characters win/lose but no finish // certain characters win/lose but no finish
// move was performed // move was performed
static TIMER_DEVICE_CALLBACK( jchan_vblank ) TIMER_DEVICE_CALLBACK_MEMBER(jchan_state::jchan_vblank)
{ {
jchan_state *state = timer.machine().driver_data<jchan_state>();
int scanline = param; int scanline = param;
if(scanline == 240) if(scanline == 240)
state->m_maincpu->set_input_line(1, HOLD_LINE); m_maincpu->set_input_line(1, HOLD_LINE);
if(scanline == 11) if(scanline == 11)
state->m_maincpu->set_input_line(2, HOLD_LINE); m_maincpu->set_input_line(2, HOLD_LINE);
if (state->m_irq_sub_enable) if (m_irq_sub_enable)
{ {
if(scanline == 240) if(scanline == 240)
state->m_subcpu->set_input_line(1, HOLD_LINE); m_subcpu->set_input_line(1, HOLD_LINE);
if(scanline == 249) if(scanline == 249)
state->m_subcpu->set_input_line(2, HOLD_LINE); m_subcpu->set_input_line(2, HOLD_LINE);
if(scanline == 11) if(scanline == 11)
state->m_subcpu->set_input_line(3, HOLD_LINE); m_subcpu->set_input_line(3, HOLD_LINE);
} }
} }
@ -599,7 +599,7 @@ static MACHINE_CONFIG_START( jchan, jchan_state )
MCFG_CPU_ADD("maincpu", M68000, 16000000) MCFG_CPU_ADD("maincpu", M68000, 16000000)
MCFG_CPU_PROGRAM_MAP(jchan_main) MCFG_CPU_PROGRAM_MAP(jchan_main)
MCFG_TIMER_ADD_SCANLINE("scantimer", jchan_vblank, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", jchan_state, jchan_vblank, "screen", 0, 1)
MCFG_CPU_ADD("sub", M68000, 16000000) MCFG_CPU_ADD("sub", M68000, 16000000)
MCFG_CPU_PROGRAM_MAP(jchan_sub) MCFG_CPU_PROGRAM_MAP(jchan_sub)

View File

@ -146,6 +146,7 @@ public:
UINT32 screen_update_darkhors(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_darkhors(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_jclub2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_jclub2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_jclub2o(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_jclub2o(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(darkhors_irq);
}; };
@ -672,25 +673,24 @@ GFXDECODE_END
***************************************************************************/ ***************************************************************************/
static TIMER_DEVICE_CALLBACK( darkhors_irq ) TIMER_DEVICE_CALLBACK_MEMBER(darkhors_state::darkhors_irq)
{ {
darkhors_state *state = timer.machine().driver_data<darkhors_state>();
int scanline = param; int scanline = param;
if(scanline == 248) if(scanline == 248)
state->m_maincpu->set_input_line(5, HOLD_LINE); m_maincpu->set_input_line(5, HOLD_LINE);
if(scanline == 0) if(scanline == 0)
state->m_maincpu->set_input_line(3, HOLD_LINE); m_maincpu->set_input_line(3, HOLD_LINE);
if(scanline == 128) if(scanline == 128)
state->m_maincpu->set_input_line(4, HOLD_LINE); m_maincpu->set_input_line(4, HOLD_LINE);
} }
static MACHINE_CONFIG_START( darkhors, darkhors_state ) static MACHINE_CONFIG_START( darkhors, darkhors_state )
MCFG_CPU_ADD("maincpu", M68EC020, 12000000) // 36MHz/3 ?? MCFG_CPU_ADD("maincpu", M68EC020, 12000000) // 36MHz/3 ??
MCFG_CPU_PROGRAM_MAP(darkhors_map) MCFG_CPU_PROGRAM_MAP(darkhors_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", darkhors_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkhors_state, darkhors_irq, "screen", 0, 1)
MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C46_8bit) MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C46_8bit)
@ -733,7 +733,7 @@ UINT32 darkhors_state::screen_update_jclub2(screen_device &screen, bitmap_ind16
static MACHINE_CONFIG_START( jclub2, darkhors_state ) static MACHINE_CONFIG_START( jclub2, darkhors_state )
MCFG_CPU_ADD("maincpu", M68EC020, 12000000) MCFG_CPU_ADD("maincpu", M68EC020, 12000000)
MCFG_CPU_PROGRAM_MAP(jclub2_map) MCFG_CPU_PROGRAM_MAP(jclub2_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", darkhors_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkhors_state, darkhors_irq, "screen", 0, 1)
MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C46_8bit) MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C46_8bit)
@ -795,7 +795,7 @@ UINT32 darkhors_state::screen_update_jclub2o(screen_device &screen, bitmap_ind16
static MACHINE_CONFIG_START( jclub2o, darkhors_state ) static MACHINE_CONFIG_START( jclub2o, darkhors_state )
MCFG_CPU_ADD("maincpu", M68EC020, 12000000) MCFG_CPU_ADD("maincpu", M68EC020, 12000000)
MCFG_CPU_PROGRAM_MAP(jclub2o_map) MCFG_CPU_PROGRAM_MAP(jclub2o_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", darkhors_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkhors_state, darkhors_irq, "screen", 0, 1)
MCFG_CPU_ADD("st0016",Z80,8000000) MCFG_CPU_ADD("st0016",Z80,8000000)
MCFG_CPU_PROGRAM_MAP(st0016_mem) MCFG_CPU_PROGRAM_MAP(st0016_mem)

View File

@ -228,6 +228,9 @@ public:
DECLARE_DRIVER_INIT(kas89); DECLARE_DRIVER_INIT(kas89);
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(kas89_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(kas89_nmi_cb);
TIMER_DEVICE_CALLBACK_MEMBER(kas89_sound_nmi_cb);
}; };
#define VDP_MEM 0x40000 #define VDP_MEM 0x40000
@ -242,13 +245,12 @@ static void kas89_vdp_interrupt(device_t *, v99x8_device &device, int i)
device.machine().device("maincpu")->execute().set_input_line(0, (i ? ASSERT_LINE : CLEAR_LINE)); device.machine().device("maincpu")->execute().set_input_line(0, (i ? ASSERT_LINE : CLEAR_LINE));
} }
static TIMER_DEVICE_CALLBACK( kas89_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(kas89_state::kas89_interrupt)
{ {
kas89_state *state = timer.machine().driver_data<kas89_state>();
int scanline = param; int scanline = param;
if((scanline % 2) == 0) if((scanline % 2) == 0)
state->m_v9938->interrupt(); m_v9938->interrupt();
} }
@ -310,19 +312,15 @@ READ8_MEMBER(kas89_state::mux_r)
return m_mux_data; return m_mux_data;
} }
static TIMER_DEVICE_CALLBACK ( kas89_nmi_cb ) TIMER_DEVICE_CALLBACK_MEMBER(kas89_state::kas89_nmi_cb)
{ {
kas89_state *state = timer.machine().driver_data<kas89_state>(); if (m_main_nmi_enable)
m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
if (state->m_main_nmi_enable)
state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
} }
static TIMER_DEVICE_CALLBACK ( kas89_sound_nmi_cb ) TIMER_DEVICE_CALLBACK_MEMBER(kas89_state::kas89_sound_nmi_cb)
{ {
kas89_state *state = timer.machine().driver_data<kas89_state>(); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
} }
@ -779,13 +777,13 @@ static MACHINE_CONFIG_START( kas89, kas89_state )
MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* Confirmed */ MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* Confirmed */
MCFG_CPU_PROGRAM_MAP(kas89_map) MCFG_CPU_PROGRAM_MAP(kas89_map)
MCFG_CPU_IO_MAP(kas89_io) MCFG_CPU_IO_MAP(kas89_io)
MCFG_TIMER_ADD_SCANLINE("scantimer", kas89_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kas89_state, kas89_interrupt, "screen", 0, 1)
MCFG_TIMER_ADD_PERIODIC("kas89_nmi", kas89_nmi_cb, attotime::from_hz(138)) /* Connected to a 138Hz osc. *AND* bit6 of port $82 */ MCFG_TIMER_DRIVER_ADD_PERIODIC("kas89_nmi", kas89_state, kas89_nmi_cb, attotime::from_hz(138))
MCFG_CPU_ADD("audiocpu", Z80, MASTER_CLOCK/6) /* Confirmed */ MCFG_CPU_ADD("audiocpu", Z80, MASTER_CLOCK/6) /* Confirmed */
MCFG_CPU_PROGRAM_MAP(audio_map) MCFG_CPU_PROGRAM_MAP(audio_map)
MCFG_CPU_IO_MAP(audio_io) MCFG_CPU_IO_MAP(audio_io)
MCFG_TIMER_ADD_PERIODIC("kas89_snmi", kas89_sound_nmi_cb, attotime::from_hz(138)) /* Connected to a 138Hz osc.*/ MCFG_TIMER_DRIVER_ADD_PERIODIC("kas89_snmi", kas89_state, kas89_sound_nmi_cb, attotime::from_hz(138))
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")

View File

@ -66,6 +66,7 @@ public:
TILE_GET_INFO_MEMBER(get_t2_tile_info); TILE_GET_INFO_MEMBER(get_t2_tile_info);
virtual void video_start(); virtual void video_start();
UINT32 screen_update_koftball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_koftball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(bmc_interrupt);
}; };
@ -209,19 +210,18 @@ static INPUT_PORTS_START( koftball )
INPUT_PORTS_END INPUT_PORTS_END
static TIMER_DEVICE_CALLBACK( bmc_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(koftball_state::bmc_interrupt)
{ {
koftball_state *state = timer.machine().driver_data<koftball_state>();
int scanline = param; int scanline = param;
if(scanline == 240) if(scanline == 240)
state->m_maincpu->set_input_line(2, HOLD_LINE); m_maincpu->set_input_line(2, HOLD_LINE);
if(scanline == 128) if(scanline == 128)
state->m_maincpu->set_input_line(3, HOLD_LINE); m_maincpu->set_input_line(3, HOLD_LINE);
if(scanline == 64) if(scanline == 64)
state->m_maincpu->set_input_line(6, HOLD_LINE); m_maincpu->set_input_line(6, HOLD_LINE);
} }
static const gfx_layout tilelayout = static const gfx_layout tilelayout =
@ -243,7 +243,7 @@ GFXDECODE_END
static MACHINE_CONFIG_START( koftball, koftball_state ) static MACHINE_CONFIG_START( koftball, koftball_state )
MCFG_CPU_ADD("maincpu", M68000, 21477270/2 ) MCFG_CPU_ADD("maincpu", M68000, 21477270/2 )
MCFG_CPU_PROGRAM_MAP(koftball_mem) MCFG_CPU_PROGRAM_MAP(koftball_mem)
MCFG_TIMER_ADD_SCANLINE("scantimer", bmc_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", koftball_state, bmc_interrupt, "screen", 0, 1)
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_REFRESH_RATE(60)

View File

@ -65,6 +65,7 @@ public:
UINT8 ram_bank_r(UINT16 offset, UINT8 bank_num); UINT8 ram_bank_r(UINT16 offset, UINT8 bank_num);
void ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num); void ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num);
TIMER_DEVICE_CALLBACK_MEMBER(lastbank_irq_scanline);
}; };
void lastbank_state::video_start() void lastbank_state::video_start()
@ -433,19 +434,18 @@ static GFXDECODE_START( lastbank )
GFXDECODE_ENTRY( "gfx1", 0, sp2_layout, 0, 16 ) GFXDECODE_ENTRY( "gfx1", 0, sp2_layout, 0, 16 )
GFXDECODE_END GFXDECODE_END
static TIMER_DEVICE_CALLBACK( lastbank_irq_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(lastbank_state::lastbank_irq_scanline)
{ {
lastbank_state *state = timer.machine().driver_data<lastbank_state>();
int scanline = param; int scanline = param;
if (scanline == 240 && (state->m_irq_enable & 4)) if (scanline == 240 && (m_irq_enable & 4))
{ {
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, state->m_irq_vector[2]); m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[2]);
} }
if (scanline == 0 && (state->m_irq_enable & 2)) if (scanline == 0 && (m_irq_enable & 2))
{ {
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, state->m_irq_vector[1]); m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[1]);
} }
} }
@ -454,7 +454,7 @@ static MACHINE_CONFIG_START( lastbank, lastbank_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu",Z80,MASTER_CLOCK/4) //!!! TC0091LVC !!! MCFG_CPU_ADD("maincpu",Z80,MASTER_CLOCK/4) //!!! TC0091LVC !!!
MCFG_CPU_PROGRAM_MAP(lastbank_map) MCFG_CPU_PROGRAM_MAP(lastbank_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", lastbank_irq_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", lastbank_state, lastbank_irq_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu",Z80,MASTER_CLOCK/4) MCFG_CPU_ADD("audiocpu",Z80,MASTER_CLOCK/4)
MCFG_CPU_PROGRAM_MAP(lastbank_audio_map) MCFG_CPU_PROGRAM_MAP(lastbank_audio_map)

View File

@ -203,6 +203,7 @@ public:
} }
virtual void video_start(); virtual void video_start();
UINT32 screen_update_littlerb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_littlerb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(littlerb_scanline);
}; };
@ -565,30 +566,29 @@ UINT32 littlerb_state::screen_update_littlerb(screen_device &screen, bitmap_ind1
return 0; return 0;
} }
static TIMER_DEVICE_CALLBACK( littlerb_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(littlerb_state::littlerb_scanline)
{ {
littlerb_state *state = timer.machine().driver_data<littlerb_state>();
int scanline = param; int scanline = param;
if((scanline % 2) == 0) if((scanline % 2) == 0)
{ {
UINT8 res; UINT8 res;
UINT8 *sample_rom = state->memregion("samples")->base(); UINT8 *sample_rom = memregion("samples")->base();
res = sample_rom[state->m_sound_pointer_l|(state->m_sound_index_l<<10)|0x40000]; res = sample_rom[m_sound_pointer_l|(m_sound_index_l<<10)|0x40000];
state->m_dacl->write_signed8(res); m_dacl->write_signed8(res);
res = sample_rom[state->m_sound_pointer_r|(state->m_sound_index_r<<10)|0x00000]; res = sample_rom[m_sound_pointer_r|(m_sound_index_r<<10)|0x00000];
state->m_dacr->write_signed8(res); m_dacr->write_signed8(res);
state->m_sound_pointer_l++; m_sound_pointer_l++;
state->m_sound_pointer_l&=0x3ff; m_sound_pointer_l&=0x3ff;
state->m_sound_pointer_r++; m_sound_pointer_r++;
state->m_sound_pointer_r&=0x3ff; m_sound_pointer_r&=0x3ff;
} }
// logerror("IRQ\n"); // logerror("IRQ\n");
if(scanline == 288) if(scanline == 288)
{ {
state->m_maincpu->set_input_line(4, HOLD_LINE); m_maincpu->set_input_line(4, HOLD_LINE);
} }
} }
@ -827,7 +827,7 @@ static void littlerb_draw_sprites(running_machine &machine)
static MACHINE_CONFIG_START( littlerb, littlerb_state ) static MACHINE_CONFIG_START( littlerb, littlerb_state )
MCFG_CPU_ADD("maincpu", M68000, 12000000) MCFG_CPU_ADD("maincpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(littlerb_main) MCFG_CPU_PROGRAM_MAP(littlerb_main)
MCFG_TIMER_ADD_SCANLINE("scantimer", littlerb_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", littlerb_state, littlerb_scanline, "screen", 0, 1)
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(50) // guess based on high vertical resolution MCFG_SCREEN_REFRESH_RATE(50) // guess based on high vertical resolution

View File

@ -59,6 +59,7 @@ public:
DECLARE_READ8_MEMBER(maxaflex_atari_pia_pb_r); DECLARE_READ8_MEMBER(maxaflex_atari_pia_pb_r);
DECLARE_DRIVER_INIT(a600xl); DECLARE_DRIVER_INIT(a600xl);
DECLARE_MACHINE_RESET(supervisor_board); DECLARE_MACHINE_RESET(supervisor_board);
TIMER_DEVICE_CALLBACK_MEMBER(mcu_timer_proc);
}; };
@ -180,15 +181,14 @@ WRITE8_MEMBER(maxaflex_state::mcu_portC_ddr_w)
m_ddrC = data; m_ddrC = data;
} }
static TIMER_DEVICE_CALLBACK( mcu_timer_proc ) TIMER_DEVICE_CALLBACK_MEMBER(maxaflex_state::mcu_timer_proc)
{ {
maxaflex_state *state = timer.machine().driver_data<maxaflex_state>(); if ( --m_tdr == 0x00 )
if ( --state->m_tdr == 0x00 )
{ {
if ( (state->m_tcr & 0x40) == 0 ) if ( (m_tcr & 0x40) == 0 )
{ {
//timer interrupt! //timer interrupt!
generic_pulse_irq_line(timer.machine().device("mcu"), M68705_INT_TIMER, 1); generic_pulse_irq_line(machine().device("mcu")->execute(), M68705_INT_TIMER, 1);
} }
} }
} }
@ -410,7 +410,7 @@ static MACHINE_CONFIG_START( a600xl, maxaflex_state )
MCFG_CPU_PROGRAM_MAP(mcu_mem) MCFG_CPU_PROGRAM_MAP(mcu_mem)
MCFG_PIA6821_ADD("pia", maxaflex_atarixl_pia_interface) MCFG_PIA6821_ADD("pia", maxaflex_atarixl_pia_interface)
MCFG_TIMER_ADD("mcu_timer", mcu_timer_proc) MCFG_TIMER_DRIVER_ADD("mcu_timer", maxaflex_state, mcu_timer_proc)
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -198,6 +198,7 @@ public:
DECLARE_READ32_MEMBER(speedup9_r); DECLARE_READ32_MEMBER(speedup9_r);
DECLARE_READ32_MEMBER(speedup10_r); DECLARE_READ32_MEMBER(speedup10_r);
DECLARE_READ32_MEMBER(speedup11_r); DECLARE_READ32_MEMBER(speedup11_r);
TIMER_DEVICE_CALLBACK_MEMBER(sound_timer_callback);
}; };
// Display controller registers // Display controller registers
@ -742,18 +743,17 @@ static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, in
/* Analog Devices AD1847 Stereo DAC */ /* Analog Devices AD1847 Stereo DAC */
static TIMER_DEVICE_CALLBACK( sound_timer_callback ) TIMER_DEVICE_CALLBACK_MEMBER(mediagx_state::sound_timer_callback)
{ {
mediagx_state *state = timer.machine().driver_data<mediagx_state>();
state->m_ad1847_sample_counter = 0; m_ad1847_sample_counter = 0;
timer.adjust(attotime::from_msec(10)); timer.adjust(attotime::from_msec(10));
dmadac_transfer(&state->m_dmadac[0], 1, 0, 1, state->m_dacl_ptr, state->m_dacl); dmadac_transfer(&m_dmadac[0], 1, 0, 1, m_dacl_ptr, m_dacl);
dmadac_transfer(&state->m_dmadac[1], 1, 0, 1, state->m_dacr_ptr, state->m_dacr); dmadac_transfer(&m_dmadac[1], 1, 0, 1, m_dacr_ptr, m_dacr);
state->m_dacl_ptr = 0; m_dacl_ptr = 0;
state->m_dacr_ptr = 0; m_dacr_ptr = 0;
} }
static void ad1847_reg_write(running_machine &machine, int reg, UINT8 data) static void ad1847_reg_write(running_machine &machine, int reg, UINT8 data)
@ -1193,7 +1193,7 @@ static MACHINE_CONFIG_START( mediagx, mediagx_state )
MCFG_IDE_CONTROLLER_ADD("ide", ide_intf, ide_devices, "hdd", NULL, true) MCFG_IDE_CONTROLLER_ADD("ide", ide_intf, ide_devices, "hdd", NULL, true)
MCFG_TIMER_ADD("sound_timer", sound_timer_callback) MCFG_TIMER_DRIVER_ADD("sound_timer", mediagx_state, sound_timer_callback)
MCFG_MC146818_ADD( "rtc", MC146818_STANDARD ) MCFG_MC146818_ADD( "rtc", MC146818_STANDARD )

View File

@ -97,6 +97,7 @@ public:
virtual void video_start(); virtual void video_start();
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_meijinsn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_meijinsn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(meijinsn_interrupt);
}; };
@ -316,16 +317,15 @@ UINT32 meijinsn_state::screen_update_meijinsn(screen_device &screen, bitmap_ind1
} }
static TIMER_DEVICE_CALLBACK( meijinsn_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(meijinsn_state::meijinsn_interrupt)
{ {
meijinsn_state *state = timer.machine().driver_data<meijinsn_state>();
int scanline = param; int scanline = param;
if(scanline == 240) if(scanline == 240)
state->m_maincpu->set_input_line(1, HOLD_LINE); m_maincpu->set_input_line(1, HOLD_LINE);
if(scanline == 0) if(scanline == 0)
state->m_maincpu->set_input_line(2, HOLD_LINE); m_maincpu->set_input_line(2, HOLD_LINE);
} }
static const ay8910_interface ay8910_config = static const ay8910_interface ay8910_config =
@ -357,7 +357,7 @@ static MACHINE_CONFIG_START( meijinsn, meijinsn_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 9000000 ) MCFG_CPU_ADD("maincpu", M68000, 9000000 )
MCFG_CPU_PROGRAM_MAP(meijinsn_map) MCFG_CPU_PROGRAM_MAP(meijinsn_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", meijinsn_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", meijinsn_state, meijinsn_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 4000000) MCFG_CPU_ADD("audiocpu", Z80, 4000000)
MCFG_CPU_PROGRAM_MAP(meijinsn_sound_map) MCFG_CPU_PROGRAM_MAP(meijinsn_sound_map)

View File

@ -240,6 +240,9 @@ public:
DECLARE_MACHINE_START(meritm_crt260); DECLARE_MACHINE_START(meritm_crt260);
DECLARE_MACHINE_START(merit_common); DECLARE_MACHINE_START(merit_common);
UINT32 screen_update_meritm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_meritm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(meritm_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(vblank_start_tick);
TIMER_DEVICE_CALLBACK_MEMBER(vblank_end_tick);
}; };
@ -422,20 +425,19 @@ static const microtouch_interface meritm_microtouch_config =
*************************************/ *************************************/
static TIMER_DEVICE_CALLBACK( meritm_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(meritm_state::meritm_interrupt)
{ {
meritm_state *state = timer.machine().driver_data<meritm_state>();
int scanline = param; int scanline = param;
if((scanline % 2) == 0) if((scanline % 2) == 0)
{ {
state->m_v9938_0->set_sprite_limit(0); m_v9938_0->set_sprite_limit(0);
state->m_v9938_0->set_resolution(RENDER_HIGH); m_v9938_0->set_resolution(RENDER_HIGH);
state->m_v9938_0->interrupt(); m_v9938_0->interrupt();
state->m_v9938_1->set_sprite_limit(0); m_v9938_1->set_sprite_limit(0);
state->m_v9938_1->set_resolution(RENDER_HIGH); m_v9938_1->set_resolution(RENDER_HIGH);
state->m_v9938_1->interrupt(); m_v9938_1->interrupt();
} }
} }
@ -1150,20 +1152,18 @@ MACHINE_START_MEMBER(meritm_state,meritm_crt260)
#define MSX2_VISIBLE_XBORDER_PIXELS 8 * 2 #define MSX2_VISIBLE_XBORDER_PIXELS 8 * 2
#define MSX2_VISIBLE_YBORDER_PIXELS 14 * 2 #define MSX2_VISIBLE_YBORDER_PIXELS 14 * 2
static TIMER_DEVICE_CALLBACK( vblank_start_tick ) TIMER_DEVICE_CALLBACK_MEMBER(meritm_state::vblank_start_tick)
{ {
meritm_state *state = timer.machine().driver_data<meritm_state>();
/* this is a workaround to signal the v9938 vblank interrupt correctly */ /* this is a workaround to signal the v9938 vblank interrupt correctly */
state->m_vint = 0x08; m_vint = 0x08;
state->m_z80pio_0->port_a_write(state->m_vint); m_z80pio_0->port_a_write(m_vint);
} }
static TIMER_DEVICE_CALLBACK( vblank_end_tick ) TIMER_DEVICE_CALLBACK_MEMBER(meritm_state::vblank_end_tick)
{ {
meritm_state *state = timer.machine().driver_data<meritm_state>();
/* this is a workaround to signal the v9938 vblank interrupt correctly */ /* this is a workaround to signal the v9938 vblank interrupt correctly */
state->m_vint = 0x18; m_vint = 0x18;
state->m_z80pio_0->port_a_write(state->m_vint); m_z80pio_0->port_a_write(m_vint);
} }
static MACHINE_CONFIG_START( meritm_crt250, meritm_state ) static MACHINE_CONFIG_START( meritm_crt250, meritm_state )
@ -1171,7 +1171,7 @@ static MACHINE_CONFIG_START( meritm_crt250, meritm_state )
MCFG_CPU_PROGRAM_MAP(meritm_crt250_map) MCFG_CPU_PROGRAM_MAP(meritm_crt250_map)
MCFG_CPU_IO_MAP(meritm_crt250_io_map) MCFG_CPU_IO_MAP(meritm_crt250_io_map)
MCFG_CPU_CONFIG(meritm_daisy_chain) MCFG_CPU_CONFIG(meritm_daisy_chain)
MCFG_TIMER_ADD_SCANLINE("scantimer", meritm_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", meritm_state, meritm_interrupt, "screen", 0, 1)
MCFG_I8255A_ADD( "ppi8255", crt250_ppi8255_intf ) MCFG_I8255A_ADD( "ppi8255", crt250_ppi8255_intf )
@ -1179,8 +1179,8 @@ static MACHINE_CONFIG_START( meritm_crt250, meritm_state )
MCFG_Z80PIO_ADD( "z80pio_0", SYSTEM_CLK/6, meritm_audio_pio_intf ) MCFG_Z80PIO_ADD( "z80pio_0", SYSTEM_CLK/6, meritm_audio_pio_intf )
MCFG_Z80PIO_ADD( "z80pio_1", SYSTEM_CLK/6, meritm_io_pio_intf ) MCFG_Z80PIO_ADD( "z80pio_1", SYSTEM_CLK/6, meritm_io_pio_intf )
MCFG_TIMER_ADD_SCANLINE("vblank_start", vblank_start_tick, "screen", 259, 262) MCFG_TIMER_DRIVER_ADD_SCANLINE("vblank_start", meritm_state, vblank_start_tick, "screen", 259, 262)
MCFG_TIMER_ADD_SCANLINE("vblank_end", vblank_end_tick, "screen", 262, 262) MCFG_TIMER_DRIVER_ADD_SCANLINE("vblank_end", meritm_state, vblank_end_tick, "screen", 262, 262)
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")

View File

@ -65,6 +65,7 @@ public:
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_meyc8088(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_meyc8088(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_meyc8088(screen_device &screen, bool state); void screen_eof_meyc8088(screen_device &screen, bool state);
TIMER_DEVICE_CALLBACK_MEMBER(heartbeat_callback);
}; };
@ -166,10 +167,9 @@ void meyc8088_state::screen_eof_meyc8088(screen_device &screen, bool state)
***************************************************************************/ ***************************************************************************/
TIMER_DEVICE_CALLBACK( heartbeat_callback ) TIMER_DEVICE_CALLBACK_MEMBER(meyc8088_state::heartbeat_callback)
{ {
meyc8088_state *state = timer.machine().driver_data<meyc8088_state>(); m_status |= 0x20;
state->m_status |= 0x20;
} }
WRITE8_MEMBER(meyc8088_state::drive_w) WRITE8_MEMBER(meyc8088_state::drive_w)
@ -380,7 +380,7 @@ static MACHINE_CONFIG_START( meyc8088, meyc8088_state )
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_TIMER_ADD("heartbeat", heartbeat_callback) MCFG_TIMER_DRIVER_ADD("heartbeat", meyc8088_state, heartbeat_callback)
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -186,6 +186,8 @@ emu_timer *m_ic21_timer;
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
TIMER_CALLBACK_MEMBER(ic21_timeout); TIMER_CALLBACK_MEMBER(ic21_timeout);
TIMER_DEVICE_CALLBACK_MEMBER(gen_50hz);
TIMER_DEVICE_CALLBACK_MEMBER(ic10_callback);
}; };
#define DISPLAY_PORT 0 #define DISPLAY_PORT 0
@ -852,26 +854,24 @@ READ8_MEMBER(mpu3_state::characteriser_r)
} }
/* generate a 50 Hz signal (some components rely on this for external sync) */ /* generate a 50 Hz signal (some components rely on this for external sync) */
static TIMER_DEVICE_CALLBACK( gen_50hz ) TIMER_DEVICE_CALLBACK_MEMBER(mpu3_state::gen_50hz)
{ {
mpu3_state *state = timer.machine().driver_data<mpu3_state>();
/* Although reported as a '50Hz' signal, the fact that both rising and /* Although reported as a '50Hz' signal, the fact that both rising and
falling edges of the pulse are used means the timer actually gives a 100Hz falling edges of the pulse are used means the timer actually gives a 100Hz
oscillating signal.*/ oscillating signal.*/
state->m_signal_50hz = state->m_signal_50hz?0:1; m_signal_50hz = m_signal_50hz?0:1;
timer.machine().device<ptm6840_device>("ptm_ic2")->set_c1(state->m_signal_50hz); machine().device<ptm6840_device>("ptm_ic2")->set_c1(m_signal_50hz);
timer.machine().device<pia6821_device>("pia_ic3")->cb1_w(~state->m_signal_50hz); machine().device<pia6821_device>("pia_ic3")->cb1_w(~m_signal_50hz);
update_triacs(timer.machine()); update_triacs(machine());
} }
static TIMER_DEVICE_CALLBACK( ic10_callback ) TIMER_DEVICE_CALLBACK_MEMBER(mpu3_state::ic10_callback)
{ {
mpu3_state *state = timer.machine().driver_data<mpu3_state>();
// TODO: Use discrete handler for 555, this is far too simplistic // TODO: Use discrete handler for 555, this is far too simplistic
state->m_ic10_output = state->m_ic10_output?0:1; m_ic10_output = m_ic10_output?0:1;
timer.machine().device<ptm6840_device>("ptm_ic2")->set_c2(state->m_ic10_output); machine().device<ptm6840_device>("ptm_ic2")->set_c2(m_ic10_output);
timer.machine().device<pia6821_device>("pia_ic4")->ca1_w(state->m_ic10_output); machine().device<pia6821_device>("pia_ic4")->ca1_w(m_ic10_output);
} }
WRITE8_MEMBER(mpu3_state::mpu3ptm_w) WRITE8_MEMBER(mpu3_state::mpu3ptm_w)
@ -905,8 +905,8 @@ static MACHINE_CONFIG_START( mpu3base, mpu3_state )
MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT) MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT)
MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100)) MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", mpu3_state, gen_50hz, attotime::from_hz(100))
MCFG_TIMER_ADD_PERIODIC("555_ic10",ic10_callback, PERIOD_OF_555_ASTABLE(10000,1000,0.0000001)) MCFG_TIMER_DRIVER_ADD_PERIODIC("555_ic10", mpu3_state, ic10_callback, PERIOD_OF_555_ASTABLE(10000,1000,0.0000001))
/* 6840 PTM */ /* 6840 PTM */
MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf) MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf)

View File

@ -269,6 +269,7 @@ public:
DECLARE_MACHINE_RESET(mpu4_vid); DECLARE_MACHINE_RESET(mpu4_vid);
DECLARE_VIDEO_START(mpu4_vid); DECLARE_VIDEO_START(mpu4_vid);
UINT32 screen_update_mpu4_vid(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_mpu4_vid(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(scanline_timer_callback);
}; };
@ -1496,11 +1497,10 @@ ADDRESS_MAP_END
static TIMER_DEVICE_CALLBACK( scanline_timer_callback ) TIMER_DEVICE_CALLBACK_MEMBER(mpu4vid_state::scanline_timer_callback)
{ {
mpu4vid_state *state = timer.machine().driver_data<mpu4vid_state>();
state->m_scn2674->scn2674_do_scanline(timer.machine(), param); m_scn2674->scn2674_do_scanline(machine(), param);
} }
@ -1545,7 +1545,7 @@ static MACHINE_CONFIG_START( mpu4_vid, mpu4vid_state )
MCFG_ACIA6850_ADD("acia6850_1", m68k_acia_if) MCFG_ACIA6850_ADD("acia6850_1", m68k_acia_if)
// for the video timing // for the video timing
MCFG_TIMER_ADD_SCANLINE("scan_timer", scanline_timer_callback, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_timer", mpu4vid_state, scanline_timer_callback, "screen", 0, 1)
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( crmaze, mpu4_vid ) static MACHINE_CONFIG_DERIVED( crmaze, mpu4_vid )

View File

@ -342,6 +342,9 @@ public:
DECLARE_DRIVER_INIT(xevi3dg); DECLARE_DRIVER_INIT(xevi3dg);
DECLARE_DRIVER_INIT(tekken2); DECLARE_DRIVER_INIT(tekken2);
DECLARE_MACHINE_RESET(namcos11); DECLARE_MACHINE_RESET(namcos11);
TIMER_DEVICE_CALLBACK_MEMBER(mcu_irq0_cb);
TIMER_DEVICE_CALLBACK_MEMBER(mcu_irq2_cb);
TIMER_DEVICE_CALLBACK_MEMBER(mcu_adc_cb);
}; };
INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... ) INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... )
@ -1000,25 +1003,22 @@ MACHINE_RESET_MEMBER(namcos11_state,namcos11)
} }
static TIMER_DEVICE_CALLBACK( mcu_irq0_cb ) TIMER_DEVICE_CALLBACK_MEMBER(namcos11_state::mcu_irq0_cb)
{ {
namcos11_state *state = timer.machine().driver_data<namcos11_state>();
state->m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE); m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
} }
static TIMER_DEVICE_CALLBACK( mcu_irq2_cb ) TIMER_DEVICE_CALLBACK_MEMBER(namcos11_state::mcu_irq2_cb)
{ {
namcos11_state *state = timer.machine().driver_data<namcos11_state>();
state->m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE); m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
} }
static TIMER_DEVICE_CALLBACK( mcu_adc_cb ) TIMER_DEVICE_CALLBACK_MEMBER(namcos11_state::mcu_adc_cb)
{ {
namcos11_state *state = timer.machine().driver_data<namcos11_state>();
state->m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE); m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
} }
static MACHINE_CONFIG_START( coh100, namcos11_state ) static MACHINE_CONFIG_START( coh100, namcos11_state )
@ -1030,9 +1030,9 @@ static MACHINE_CONFIG_START( coh100, namcos11_state )
MCFG_CPU_PROGRAM_MAP(c76_map) MCFG_CPU_PROGRAM_MAP(c76_map)
MCFG_CPU_IO_MAP(c76_io_map) MCFG_CPU_IO_MAP(c76_io_map)
/* TODO: irq generation for these */ /* TODO: irq generation for these */
MCFG_TIMER_ADD_PERIODIC("mcu_irq0", mcu_irq0_cb, attotime::from_hz(60)) MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_irq0", namcos11_state, mcu_irq0_cb, attotime::from_hz(60))
MCFG_TIMER_ADD_PERIODIC("mcu_irq2", mcu_irq2_cb, attotime::from_hz(60)) MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_irq2", namcos11_state, mcu_irq2_cb, attotime::from_hz(60))
MCFG_TIMER_ADD_PERIODIC("mcu_adc", mcu_adc_cb, attotime::from_hz(60)) MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_adc", namcos11_state, mcu_adc_cb, attotime::from_hz(60))
MCFG_MACHINE_RESET_OVERRIDE(namcos11_state, namcos11 ) MCFG_MACHINE_RESET_OVERRIDE(namcos11_state, namcos11 )

View File

@ -87,6 +87,7 @@ public:
virtual void video_start(); virtual void video_start();
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_olibochu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_olibochu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(olibochu_scanline);
}; };
@ -432,15 +433,15 @@ void olibochu_state::machine_reset()
m_cmd = 0; m_cmd = 0;
} }
static TIMER_DEVICE_CALLBACK( olibochu_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(olibochu_state::olibochu_scanline)
{ {
int scanline = param; int scanline = param;
if(scanline == 248) // vblank-out irq if(scanline == 248) // vblank-out irq
timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h - vblank */ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h - vblank */
if(scanline == 0) // sprite buffer irq if(scanline == 0) // sprite buffer irq
timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */
} }
static MACHINE_CONFIG_START( olibochu, olibochu_state ) static MACHINE_CONFIG_START( olibochu, olibochu_state )
@ -448,7 +449,7 @@ static MACHINE_CONFIG_START( olibochu, olibochu_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 4000000) /* 4 MHz ?? */ MCFG_CPU_ADD("maincpu", Z80, 4000000) /* 4 MHz ?? */
MCFG_CPU_PROGRAM_MAP(olibochu_map) MCFG_CPU_PROGRAM_MAP(olibochu_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", olibochu_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", olibochu_state, olibochu_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* 4 MHz ?? */ MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* 4 MHz ?? */
MCFG_CPU_PROGRAM_MAP(olibochu_sound_map) MCFG_CPU_PROGRAM_MAP(olibochu_sound_map)

View File

@ -99,6 +99,7 @@ public:
virtual void video_start(); virtual void video_start();
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_panicr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_panicr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(panicr_scanline);
}; };
@ -490,21 +491,21 @@ static GFXDECODE_START( panicr )
GFXDECODE_END GFXDECODE_END
static TIMER_DEVICE_CALLBACK( panicr_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(panicr_state::panicr_scanline)
{ {
int scanline = param; int scanline = param;
if(scanline == 240) // vblank-out irq if(scanline == 240) // vblank-out irq
timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xc4/4); machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xc4/4);
if(scanline == 0) // <unknown> if(scanline == 0) // <unknown>
timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xc8/4); machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xc8/4);
} }
static MACHINE_CONFIG_START( panicr, panicr_state ) static MACHINE_CONFIG_START( panicr, panicr_state )
MCFG_CPU_ADD("maincpu", V20,MASTER_CLOCK/2) /* Sony 8623h9 CXQ70116D-8 (V20 compatible) */ MCFG_CPU_ADD("maincpu", V20,MASTER_CLOCK/2) /* Sony 8623h9 CXQ70116D-8 (V20 compatible) */
MCFG_CPU_PROGRAM_MAP(panicr_map) MCFG_CPU_PROGRAM_MAP(panicr_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", panicr_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", panicr_state, panicr_scanline, "screen", 0, 1)
MCFG_CPU_ADD(CPUTAG_T5182,Z80,SOUND_CLOCK/4) /* 3.579545 MHz */ MCFG_CPU_ADD(CPUTAG_T5182,Z80,SOUND_CLOCK/4) /* 3.579545 MHz */
MCFG_CPU_PROGRAM_MAP(t5182_map) MCFG_CPU_PROGRAM_MAP(t5182_map)

View File

@ -37,6 +37,7 @@ public:
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_spectrum(screen_device &screen, bool state); void screen_eof_spectrum(screen_device &screen, bool state);
TIMER_DEVICE_CALLBACK_MEMBER(spec_interrupt_hack);
}; };
@ -294,20 +295,19 @@ INPUT_PORTS_END
* *
*************************************/ *************************************/
static TIMER_DEVICE_CALLBACK( spec_interrupt_hack ) TIMER_DEVICE_CALLBACK_MEMBER(photon2_state::spec_interrupt_hack)
{ {
photon2_state *state = timer.machine().driver_data<photon2_state>();
int scanline = param; int scanline = param;
if (scanline == SPEC_SCREEN_HEIGHT/2) if (scanline == SPEC_SCREEN_HEIGHT/2)
{ {
state->m_maincpu->set_input_line(0, HOLD_LINE); m_maincpu->set_input_line(0, HOLD_LINE);
} }
else if(scanline == 0) else if(scanline == 0)
{ {
if ( state->m_nmi_enable ) if ( m_nmi_enable )
{ {
state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
} }
} }
} }
@ -322,7 +322,7 @@ static MACHINE_CONFIG_START( photon2, photon2_state )
MCFG_CPU_ADD("maincpu", Z80, 3500000) /* 3.5 MHz */ MCFG_CPU_ADD("maincpu", Z80, 3500000) /* 3.5 MHz */
MCFG_CPU_PROGRAM_MAP(spectrum_mem) MCFG_CPU_PROGRAM_MAP(spectrum_mem)
MCFG_CPU_IO_MAP(spectrum_io) MCFG_CPU_IO_MAP(spectrum_io)
MCFG_TIMER_ADD_SCANLINE("scantimer", spec_interrupt_hack, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", photon2_state, spec_interrupt_hack, "screen", 0, 1)
/* video hardware */ /* video hardware */

View File

@ -45,6 +45,7 @@ public:
virtual void machine_reset(); virtual void machine_reset();
virtual void video_start(); virtual void video_start();
UINT32 screen_update_pkscramble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_pkscramble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(scanline_callback);
}; };
@ -215,22 +216,21 @@ TILE_GET_INFO_MEMBER(pkscram_state::get_fg_tile_info)
SET_TILE_INFO_MEMBER(0,tile,color,0); SET_TILE_INFO_MEMBER(0,tile,color,0);
} }
static TIMER_DEVICE_CALLBACK( scanline_callback ) TIMER_DEVICE_CALLBACK_MEMBER(pkscram_state::scanline_callback)
{ {
pkscram_state *state = timer.machine().driver_data<pkscram_state>();
if (param == interrupt_scanline) if (param == interrupt_scanline)
{ {
if (state->m_out & 0x2000) if (m_out & 0x2000)
timer.machine().device("maincpu")->execute().set_input_line(1, ASSERT_LINE); machine().device("maincpu")->execute().set_input_line(1, ASSERT_LINE);
timer.adjust(timer.machine().primary_screen->time_until_pos(param + 1), param+1); timer.adjust(machine().primary_screen->time_until_pos(param + 1), param+1);
state->m_interrupt_line_active = 1; m_interrupt_line_active = 1;
} }
else else
{ {
if (state->m_interrupt_line_active) if (m_interrupt_line_active)
timer.machine().device("maincpu")->execute().set_input_line(1, CLEAR_LINE); machine().device("maincpu")->execute().set_input_line(1, CLEAR_LINE);
timer.adjust(timer.machine().primary_screen->time_until_pos(interrupt_scanline), interrupt_scanline); timer.adjust(machine().primary_screen->time_until_pos(interrupt_scanline), interrupt_scanline);
state->m_interrupt_line_active = 0; m_interrupt_line_active = 0;
} }
} }
@ -308,7 +308,7 @@ static MACHINE_CONFIG_START( pkscramble, pkscram_state )
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_TIMER_ADD("scan_timer", scanline_callback) MCFG_TIMER_DRIVER_ADD("scan_timer", pkscram_state, scanline_callback)
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -96,6 +96,7 @@ public:
DECLARE_WRITE8_MEMBER(popobear_irq_ack_w); DECLARE_WRITE8_MEMBER(popobear_irq_ack_w);
virtual void video_start(); virtual void video_start();
UINT32 screen_update_popobear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_popobear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(popobear_irq);
}; };
void popobear_state::video_start() void popobear_state::video_start()
@ -437,21 +438,20 @@ static INPUT_PORTS_START( popobear )
INPUT_PORTS_END INPUT_PORTS_END
static TIMER_DEVICE_CALLBACK( popobear_irq ) TIMER_DEVICE_CALLBACK_MEMBER(popobear_state::popobear_irq)
{ {
popobear_state *state = timer.machine().driver_data<popobear_state>();
int scanline = param; int scanline = param;
/* Order is trusted (5 as vblank-out makes the title screen logo spinning to behave wrongly) */ /* Order is trusted (5 as vblank-out makes the title screen logo spinning to behave wrongly) */
if(scanline == 240) if(scanline == 240)
state->m_maincpu->set_input_line(3, ASSERT_LINE); m_maincpu->set_input_line(3, ASSERT_LINE);
if(scanline == 0) if(scanline == 0)
state->m_maincpu->set_input_line(5, ASSERT_LINE); m_maincpu->set_input_line(5, ASSERT_LINE);
/* TODO: actually a timer irq, tied with YM2413 sound chip (controls BGM tempo) */ /* TODO: actually a timer irq, tied with YM2413 sound chip (controls BGM tempo) */
if(scanline == 64 || scanline == 192) if(scanline == 64 || scanline == 192)
state->m_maincpu->set_input_line(2, ASSERT_LINE); m_maincpu->set_input_line(2, ASSERT_LINE);
} }
static MACHINE_CONFIG_START( popobear, popobear_state ) static MACHINE_CONFIG_START( popobear, popobear_state )
@ -460,7 +460,7 @@ static MACHINE_CONFIG_START( popobear, popobear_state )
// levels 2,3,5 look interesting // levels 2,3,5 look interesting
//MCFG_CPU_VBLANK_INT_DRIVER("screen", popobear_state, irq5_line_assert) //MCFG_CPU_VBLANK_INT_DRIVER("screen", popobear_state, irq5_line_assert)
//MCFG_CPU_PERIODIC_INT_DRIVER(popobear_state, irq2_line_assert, 120) //MCFG_CPU_PERIODIC_INT_DRIVER(popobear_state, irq2_line_assert, 120)
MCFG_TIMER_ADD_SCANLINE("scantimer", popobear_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", popobear_state, popobear_irq, "screen", 0, 1)
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_REFRESH_RATE(60)

View File

@ -64,6 +64,7 @@ public:
virtual void video_start(); virtual void video_start();
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_quizshow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_quizshow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(quizshow_clock_timer_cb);
}; };
@ -352,16 +353,15 @@ static GFXDECODE_START( quizshow )
GFXDECODE_END GFXDECODE_END
static TIMER_DEVICE_CALLBACK( quizshow_clock_timer_cb ) TIMER_DEVICE_CALLBACK_MEMBER(quizshow_state::quizshow_clock_timer_cb)
{ {
quizshow_state *state = timer.machine().driver_data<quizshow_state>(); m_clocks++;
state->m_clocks++;
// blink is on 4F and 8F // blink is on 4F and 8F
int blink_old = state->m_blink_state; int blink_old = m_blink_state;
state->m_blink_state = (state->m_clocks >> 2 & state->m_clocks >> 1) & 0x40; m_blink_state = (m_clocks >> 2 & m_clocks >> 1) & 0x40;
if (state->m_blink_state != blink_old) if (m_blink_state != blink_old)
state->m_tilemap->mark_all_dirty(); m_tilemap->mark_all_dirty();
} }
void quizshow_state::machine_reset() void quizshow_state::machine_reset()
@ -376,7 +376,7 @@ static MACHINE_CONFIG_START( quizshow, quizshow_state )
MCFG_CPU_ADD("maincpu", S2650, MASTER_CLOCK / 16) // divider guessed MCFG_CPU_ADD("maincpu", S2650, MASTER_CLOCK / 16) // divider guessed
MCFG_CPU_PROGRAM_MAP(quizshow_mem_map) MCFG_CPU_PROGRAM_MAP(quizshow_mem_map)
MCFG_CPU_IO_MAP(quizshow_io_map) MCFG_CPU_IO_MAP(quizshow_io_map)
MCFG_TIMER_ADD_PERIODIC("clock_timer", quizshow_clock_timer_cb, attotime::from_hz(PIXEL_CLOCK / (HTOTAL * 8))) // 8V MCFG_TIMER_DRIVER_ADD_PERIODIC("clock_timer", quizshow_state, quizshow_clock_timer_cb, attotime::from_hz(PIXEL_CLOCK / (HTOTAL * 8))) // 8V
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -27,6 +27,7 @@ public:
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_videoram;
UINT32 screen_update_rotaryf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_rotaryf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(rotaryf_interrupt);
}; };
@ -40,17 +41,16 @@ public:
* *
*************************************/ *************************************/
static TIMER_DEVICE_CALLBACK( rotaryf_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(rotaryf_state::rotaryf_interrupt)
{ {
rotaryf_state *state = timer.machine().driver_data<rotaryf_state>();
int scanline = param; int scanline = param;
if (scanline == 256) if (scanline == 256)
state->m_maincpu->set_input_line(I8085_RST55_LINE, HOLD_LINE); m_maincpu->set_input_line(I8085_RST55_LINE, HOLD_LINE);
else if((scanline % 64) == 0) else if((scanline % 64) == 0)
{ {
state->m_maincpu->set_input_line(I8085_RST75_LINE, ASSERT_LINE); m_maincpu->set_input_line(I8085_RST75_LINE, ASSERT_LINE);
state->m_maincpu->set_input_line(I8085_RST75_LINE, CLEAR_LINE); m_maincpu->set_input_line(I8085_RST75_LINE, CLEAR_LINE);
} }
} }
@ -171,7 +171,7 @@ static MACHINE_CONFIG_START( rotaryf, rotaryf_state )
MCFG_CPU_ADD("maincpu",I8085A,4000000) /* ?? MHz */ MCFG_CPU_ADD("maincpu",I8085A,4000000) /* ?? MHz */
MCFG_CPU_PROGRAM_MAP(rotaryf_map) MCFG_CPU_PROGRAM_MAP(rotaryf_map)
MCFG_CPU_IO_MAP(rotaryf_io_map) MCFG_CPU_IO_MAP(rotaryf_io_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", rotaryf_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", rotaryf_state, rotaryf_interrupt, "screen", 0, 1)
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -49,6 +49,7 @@ protected:
virtual void machine_reset(); virtual void machine_reset();
public: public:
DECLARE_DRIVER_INIT(rowamet); DECLARE_DRIVER_INIT(rowamet);
TIMER_DEVICE_CALLBACK_MEMBER(rowamet_timer);
}; };
@ -119,15 +120,14 @@ DRIVER_INIT_MEMBER(rowamet_state,rowamet)
{ {
} }
static TIMER_DEVICE_CALLBACK( rowamet_timer ) TIMER_DEVICE_CALLBACK_MEMBER(rowamet_state::rowamet_timer)
{ {
static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 }; static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 };
rowamet_state *state = timer.machine().driver_data<rowamet_state>(); m_out_offs &= 15;
state->m_out_offs &= 15;
UINT8 digit = state->m_out_offs << 1; UINT8 digit = m_out_offs << 1;
output_set_digit_value(digit, patterns[state->m_p_ram[state->m_out_offs]>>4]); output_set_digit_value(digit, patterns[m_p_ram[m_out_offs]>>4]);
output_set_digit_value(++digit, patterns[state->m_p_ram[state->m_out_offs++]&15]); output_set_digit_value(++digit, patterns[m_p_ram[m_out_offs++]&15]);
} }
static MACHINE_CONFIG_START( rowamet, rowamet_state ) static MACHINE_CONFIG_START( rowamet, rowamet_state )
@ -137,7 +137,7 @@ static MACHINE_CONFIG_START( rowamet, rowamet_state )
MCFG_CPU_ADD("cpu2", Z80, 1888888) MCFG_CPU_ADD("cpu2", Z80, 1888888)
MCFG_CPU_PROGRAM_MAP(rowamet_sub_map) MCFG_CPU_PROGRAM_MAP(rowamet_sub_map)
MCFG_CPU_IO_MAP(rowamet_sub_io) MCFG_CPU_IO_MAP(rowamet_sub_io)
MCFG_TIMER_ADD_PERIODIC("rowamet_timer", rowamet_timer, attotime::from_hz(200)) MCFG_TIMER_DRIVER_ADD_PERIODIC("rowamet_timer", rowamet_state, rowamet_timer, attotime::from_hz(200))
/* Video */ /* Video */
MCFG_DEFAULT_LAYOUT(layout_rowamet) MCFG_DEFAULT_LAYOUT(layout_rowamet)

View File

@ -199,6 +199,7 @@ public:
UINT32 screen_update_royalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_royalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(suzume_irq); INTERRUPT_GEN_MEMBER(suzume_irq);
INTERRUPT_GEN_MEMBER(mjtensin_interrupt); INTERRUPT_GEN_MEMBER(mjtensin_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(janptr96_interrupt);
}; };
@ -3291,16 +3292,15 @@ static MACHINE_CONFIG_DERIVED( mjderngr, dondenmj )
MACHINE_CONFIG_END MACHINE_CONFIG_END
/* It runs in IM 2, thus needs a vector on the data bus */ /* It runs in IM 2, thus needs a vector on the data bus */
static TIMER_DEVICE_CALLBACK( janptr96_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(royalmah_state::janptr96_interrupt)
{ {
royalmah_state *state = timer.machine().driver_data<royalmah_state>();
int scanline = param; int scanline = param;
if(scanline == 248) if(scanline == 248)
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x80); // vblank m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x80); // vblank
if(scanline == 0) if(scanline == 0)
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x84); // demo m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x84); // demo
} }
WRITE_LINE_MEMBER(royalmah_state::janptr96_rtc_irq) WRITE_LINE_MEMBER(royalmah_state::janptr96_rtc_irq)
@ -3319,7 +3319,7 @@ static MACHINE_CONFIG_DERIVED( janptr96, mjderngr )
MCFG_CPU_ADD("maincpu",Z80,XTAL_16MHz/2) /* 8 MHz? */ MCFG_CPU_ADD("maincpu",Z80,XTAL_16MHz/2) /* 8 MHz? */
MCFG_CPU_PROGRAM_MAP(janptr96_map) MCFG_CPU_PROGRAM_MAP(janptr96_map)
MCFG_CPU_IO_MAP(janptr96_iomap) MCFG_CPU_IO_MAP(janptr96_iomap)
MCFG_TIMER_ADD_SCANLINE("scantimer", janptr96_interrupt, "screen", 0, 1) /* IM 2 needs a vector on the data bus */ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", royalmah_state, janptr96_interrupt, "screen", 0, 1)
MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8) MCFG_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8)

View File

@ -67,6 +67,7 @@ public:
DECLARE_DRIVER_INIT(sangho); DECLARE_DRIVER_INIT(sangho);
DECLARE_MACHINE_RESET(pzlestar); DECLARE_MACHINE_RESET(pzlestar);
DECLARE_MACHINE_RESET(sexyboom); DECLARE_MACHINE_RESET(sexyboom);
TIMER_DEVICE_CALLBACK_MEMBER(sangho_interrupt);
}; };
@ -405,16 +406,15 @@ static void msx_vdp_interrupt(device_t *, v99x8_device &device, int i)
device.machine().device("maincpu")->execute().set_input_line(0, (i ? HOLD_LINE : CLEAR_LINE)); device.machine().device("maincpu")->execute().set_input_line(0, (i ? HOLD_LINE : CLEAR_LINE));
} }
static TIMER_DEVICE_CALLBACK( sangho_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(sangho_state::sangho_interrupt)
{ {
sangho_state *state = timer.machine().driver_data<sangho_state>();
int scanline = param; int scanline = param;
if((scanline % 2) == 0) if((scanline % 2) == 0)
{ {
state->m_v9958->set_sprite_limit(0); m_v9958->set_sprite_limit(0);
state->m_v9958->set_resolution(RENDER_HIGH); m_v9958->set_resolution(RENDER_HIGH);
state->m_v9958->interrupt(); m_v9958->interrupt();
} }
} }
@ -424,7 +424,7 @@ static MACHINE_CONFIG_START( pzlestar, sangho_state )
MCFG_CPU_ADD("maincpu", Z80,8000000) // ? MCFG_CPU_ADD("maincpu", Z80,8000000) // ?
MCFG_CPU_PROGRAM_MAP(sangho_map) MCFG_CPU_PROGRAM_MAP(sangho_map)
MCFG_CPU_IO_MAP(pzlestar_io_map) MCFG_CPU_IO_MAP(pzlestar_io_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", sangho_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sangho_state, sangho_interrupt, "screen", 0, 1)
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
@ -456,7 +456,7 @@ static MACHINE_CONFIG_START( sexyboom, sangho_state )
MCFG_CPU_ADD("maincpu", Z80,8000000) // ? MCFG_CPU_ADD("maincpu", Z80,8000000) // ?
MCFG_CPU_PROGRAM_MAP(sangho_map) MCFG_CPU_PROGRAM_MAP(sangho_map)
MCFG_CPU_IO_MAP(sexyboom_io_map) MCFG_CPU_IO_MAP(sexyboom_io_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", sangho_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sangho_state, sangho_interrupt, "screen", 0, 1)
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)

View File

@ -74,6 +74,7 @@ public:
virtual void video_start(); virtual void video_start();
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_sbowling(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_sbowling(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(sbw_interrupt);
}; };
TILE_GET_INFO_MEMBER(sbowling_state::get_sb_tile_info) TILE_GET_INFO_MEMBER(sbowling_state::get_sb_tile_info)
@ -160,16 +161,15 @@ READ8_MEMBER(sbowling_state::pix_data_r)
static TIMER_DEVICE_CALLBACK( sbw_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(sbowling_state::sbw_interrupt)
{ {
sbowling_state *state = timer.machine().driver_data<sbowling_state>();
int scanline = param; int scanline = param;
if(scanline == 256) if(scanline == 256)
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */
if(scanline == 128) if(scanline == 128)
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h */ m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h */
} }
@ -385,7 +385,7 @@ static MACHINE_CONFIG_START( sbowling, sbowling_state )
MCFG_CPU_ADD("maincpu", I8080, XTAL_19_968MHz/10) /* ? */ MCFG_CPU_ADD("maincpu", I8080, XTAL_19_968MHz/10) /* ? */
MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_IO_MAP(port_map) MCFG_CPU_IO_MAP(port_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", sbw_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sbowling_state, sbw_interrupt, "screen", 0, 1)
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -66,15 +66,15 @@ public:
DECLARE_DRIVER_INIT(rockduck); DECLARE_DRIVER_INIT(rockduck);
DECLARE_MACHINE_START(scregg); DECLARE_MACHINE_START(scregg);
DECLARE_MACHINE_RESET(scregg); DECLARE_MACHINE_RESET(scregg);
TIMER_DEVICE_CALLBACK_MEMBER(scregg_interrupt);
}; };
static TIMER_DEVICE_CALLBACK( scregg_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(scregg_state::scregg_interrupt)
{ {
// assume that the irq generator is similar to burgertime hw // assume that the irq generator is similar to burgertime hw
scregg_state *state = timer.machine().driver_data<scregg_state>(); m_maincpu->set_input_line(0, (param & 8) ? ASSERT_LINE : CLEAR_LINE);
state->m_maincpu->set_input_line(0, (param & 8) ? ASSERT_LINE : CLEAR_LINE);
} }
WRITE8_MEMBER(scregg_state::scregg_irqack_w) WRITE8_MEMBER(scregg_state::scregg_irqack_w)
@ -262,7 +262,7 @@ static MACHINE_CONFIG_START( dommy, scregg_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/8) MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/8)
MCFG_CPU_PROGRAM_MAP(dommy_map) MCFG_CPU_PROGRAM_MAP(dommy_map)
MCFG_TIMER_ADD_SCANLINE("irq", scregg_interrupt, "screen", 0, 8) MCFG_TIMER_DRIVER_ADD_SCANLINE("irq", scregg_state, scregg_interrupt, "screen", 0, 8)
MCFG_MACHINE_START_OVERRIDE(scregg_state,scregg) MCFG_MACHINE_START_OVERRIDE(scregg_state,scregg)
MCFG_MACHINE_RESET_OVERRIDE(scregg_state,scregg) MCFG_MACHINE_RESET_OVERRIDE(scregg_state,scregg)
@ -294,7 +294,7 @@ static MACHINE_CONFIG_START( scregg, scregg_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/8) MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/8)
MCFG_CPU_PROGRAM_MAP(eggs_map) MCFG_CPU_PROGRAM_MAP(eggs_map)
MCFG_TIMER_ADD_SCANLINE("irq", scregg_interrupt, "screen", 0, 8) MCFG_TIMER_DRIVER_ADD_SCANLINE("irq", scregg_state, scregg_interrupt, "screen", 0, 8)
MCFG_MACHINE_START_OVERRIDE(scregg_state,scregg) MCFG_MACHINE_START_OVERRIDE(scregg_state,scregg)
MCFG_MACHINE_RESET_OVERRIDE(scregg_state,scregg) MCFG_MACHINE_RESET_OVERRIDE(scregg_state,scregg)

View File

@ -79,6 +79,7 @@ public:
DECLARE_WRITE8_MEMBER(ppi_port_c_w); DECLARE_WRITE8_MEMBER(ppi_port_c_w);
DECLARE_DRIVER_INIT(sfkick); DECLARE_DRIVER_INIT(sfkick);
virtual void machine_reset(); virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(sfkick_interrupt);
}; };
@ -449,10 +450,9 @@ void sfkick_state::machine_reset()
sfkick_remap_banks(machine()); sfkick_remap_banks(machine());
} }
static TIMER_DEVICE_CALLBACK( sfkick_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(sfkick_state::sfkick_interrupt)
{ {
sfkick_state *state = timer.machine().driver_data<sfkick_state>(); m_v9938->interrupt();
state->m_v9938->interrupt();
} }
static void irqhandler(device_t *device, int irq) static void irqhandler(device_t *device, int irq)
@ -475,7 +475,7 @@ static MACHINE_CONFIG_START( sfkick, sfkick_state )
MCFG_CPU_ADD("maincpu",Z80,MASTER_CLOCK/6) MCFG_CPU_ADD("maincpu",Z80,MASTER_CLOCK/6)
MCFG_CPU_PROGRAM_MAP(sfkick_map) MCFG_CPU_PROGRAM_MAP(sfkick_map)
MCFG_CPU_IO_MAP(sfkick_io_map) MCFG_CPU_IO_MAP(sfkick_io_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", sfkick_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sfkick_state, sfkick_interrupt, "screen", 0, 1)
MCFG_QUANTUM_TIME(attotime::from_hz(60000)) MCFG_QUANTUM_TIME(attotime::from_hz(60000))

View File

@ -178,6 +178,7 @@ public:
UINT32 screen_update_sigmab98(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_sigmab98(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_sammymdl(screen_device &screen, bool state); void screen_eof_sammymdl(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(gegege_vblank_interrupt); INTERRUPT_GEN_MEMBER(gegege_vblank_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(sammymd1_irq);
}; };
@ -1785,26 +1786,25 @@ MACHINE_CONFIG_END
Animal Catch Animal Catch
***************************************************************************/ ***************************************************************************/
static TIMER_DEVICE_CALLBACK( sammymd1_irq ) TIMER_DEVICE_CALLBACK_MEMBER(sigmab98_state::sammymd1_irq)
{ {
sigmab98_state *state = timer.machine().driver_data<sigmab98_state>();
int scanline = param; int scanline = param;
if(scanline == 240) if(scanline == 240)
state->m_maincpu->set_input_line_and_vector(0,HOLD_LINE, state->m_vblank_vector); m_maincpu->set_input_line_and_vector(0,HOLD_LINE, m_vblank_vector);
if(scanline == 128) if(scanline == 128)
state->m_maincpu->set_input_line_and_vector(0,HOLD_LINE, state->m_timer0_vector); m_maincpu->set_input_line_and_vector(0,HOLD_LINE, m_timer0_vector);
if(scanline == 32) if(scanline == 32)
state->m_maincpu->set_input_line_and_vector(0,HOLD_LINE, state->m_timer1_vector); m_maincpu->set_input_line_and_vector(0,HOLD_LINE, m_timer1_vector);
} }
static MACHINE_CONFIG_DERIVED( animalc, sammymdl ) static MACHINE_CONFIG_DERIVED( animalc, sammymdl )
MCFG_CPU_MODIFY("maincpu") MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP( animalc_map ) MCFG_CPU_PROGRAM_MAP( animalc_map )
MCFG_CPU_IO_MAP( animalc_io ) MCFG_CPU_IO_MAP( animalc_io )
MCFG_TIMER_ADD_SCANLINE("scantimer", sammymd1_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sigmab98_state, sammymd1_irq, "screen", 0, 1)
MACHINE_CONFIG_END MACHINE_CONFIG_END
/*************************************************************************** /***************************************************************************
@ -1815,7 +1815,7 @@ static MACHINE_CONFIG_DERIVED( haekaka, sammymdl )
MCFG_CPU_MODIFY("maincpu") MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP( haekaka_map ) MCFG_CPU_PROGRAM_MAP( haekaka_map )
MCFG_CPU_IO_MAP( haekaka_io ) MCFG_CPU_IO_MAP( haekaka_io )
MCFG_TIMER_ADD_SCANLINE("scantimer", sammymd1_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sigmab98_state, sammymd1_irq, "screen", 0, 1)
MACHINE_CONFIG_END MACHINE_CONFIG_END
/*************************************************************************** /***************************************************************************
@ -1826,7 +1826,7 @@ static MACHINE_CONFIG_DERIVED( itazuram, sammymdl )
MCFG_CPU_MODIFY("maincpu") MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP( itazuram_map ) MCFG_CPU_PROGRAM_MAP( itazuram_map )
MCFG_CPU_IO_MAP( itazuram_io ) MCFG_CPU_IO_MAP( itazuram_io )
MCFG_TIMER_ADD_SCANLINE("scantimer", sammymd1_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sigmab98_state, sammymd1_irq, "screen", 0, 1)
MACHINE_CONFIG_END MACHINE_CONFIG_END
/*************************************************************************** /***************************************************************************
@ -1837,7 +1837,7 @@ static MACHINE_CONFIG_DERIVED( pyenaget, sammymdl )
MCFG_CPU_MODIFY("maincpu") MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP( haekaka_map ) MCFG_CPU_PROGRAM_MAP( haekaka_map )
MCFG_CPU_IO_MAP( pyenaget_io ) MCFG_CPU_IO_MAP( pyenaget_io )
MCFG_TIMER_ADD_SCANLINE("scantimer", sammymd1_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sigmab98_state, sammymd1_irq, "screen", 0, 1)
MACHINE_CONFIG_END MACHINE_CONFIG_END
/*************************************************************************** /***************************************************************************
@ -1848,7 +1848,7 @@ static MACHINE_CONFIG_DERIVED( tdoboon, sammymdl )
MCFG_CPU_MODIFY("maincpu") MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP( tdoboon_map ) MCFG_CPU_PROGRAM_MAP( tdoboon_map )
MCFG_CPU_IO_MAP( tdoboon_io ) MCFG_CPU_IO_MAP( tdoboon_io )
MCFG_TIMER_ADD_SCANLINE("scantimer", sammymd1_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sigmab98_state, sammymd1_irq, "screen", 0, 1)
MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0,0x140-1, 0+4,0xf0+4-1) MCFG_SCREEN_VISIBLE_AREA(0,0x140-1, 0+4,0xf0+4-1)

View File

@ -68,6 +68,7 @@ public:
virtual void machine_reset(); virtual void machine_reset();
TIMER_CALLBACK_MEMBER(subcpu_suspend); TIMER_CALLBACK_MEMBER(subcpu_suspend);
TIMER_CALLBACK_MEMBER(subcpu_resume); TIMER_CALLBACK_MEMBER(subcpu_resume);
TIMER_DEVICE_CALLBACK_MEMBER(sothello_interrupt);
}; };
@ -324,10 +325,9 @@ static void sothello_vdp_interrupt(device_t *, v99x8_device &device, int i)
device.machine().device("maincpu")->execute().set_input_line(0, (i ? HOLD_LINE : CLEAR_LINE)); device.machine().device("maincpu")->execute().set_input_line(0, (i ? HOLD_LINE : CLEAR_LINE));
} }
static TIMER_DEVICE_CALLBACK( sothello_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(sothello_state::sothello_interrupt)
{ {
sothello_state *state = timer.machine().driver_data<sothello_state>(); m_v9938->interrupt();
state->m_v9938->interrupt();
} }
static void adpcm_int(device_t *device) static void adpcm_int(device_t *device)
@ -369,7 +369,7 @@ static MACHINE_CONFIG_START( sothello, sothello_state )
MCFG_CPU_ADD("maincpu",Z80, MAINCPU_CLOCK) MCFG_CPU_ADD("maincpu",Z80, MAINCPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(maincpu_mem_map) MCFG_CPU_PROGRAM_MAP(maincpu_mem_map)
MCFG_CPU_IO_MAP(maincpu_io_map) MCFG_CPU_IO_MAP(maincpu_io_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", sothello_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sothello_state, sothello_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("soundcpu",Z80, SOUNDCPU_CLOCK) MCFG_CPU_ADD("soundcpu",Z80, SOUNDCPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(soundcpu_mem_map) MCFG_CPU_PROGRAM_MAP(soundcpu_mem_map)

View File

@ -167,6 +167,8 @@ public:
DECLARE_VIDEO_START(xtrain); DECLARE_VIDEO_START(xtrain);
UINT32 screen_update_subsino2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_subsino2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(am188em_int0_irq); INTERRUPT_GEN_MEMBER(am188em_int0_irq);
TIMER_DEVICE_CALLBACK_MEMBER(am188em_timer2_irq);
TIMER_DEVICE_CALLBACK_MEMBER(h8_timer_irq);
}; };
@ -870,11 +872,10 @@ INTERRUPT_GEN_MEMBER(subsino2_state::am188em_int0_irq)
device.execute().set_input_line_and_vector(0, HOLD_LINE, 0x0c); // INT0 (background scrolling in xplan) device.execute().set_input_line_and_vector(0, HOLD_LINE, 0x0c); // INT0 (background scrolling in xplan)
} }
static TIMER_DEVICE_CALLBACK( am188em_timer2_irq ) TIMER_DEVICE_CALLBACK_MEMBER(subsino2_state::am188em_timer2_irq)
{ {
subsino2_state *state = timer.machine().driver_data<subsino2_state>(); if ((m_am188em_regs[AM188EM_IMASK+0] & 0x01) == 0) // TMR mask
if ((state->m_am188em_regs[AM188EM_IMASK+0] & 0x01) == 0) // TMR mask machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x4c/4);
timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x4c/4);
} }
/*************************************************************************** /***************************************************************************
@ -882,9 +883,9 @@ static TIMER_DEVICE_CALLBACK( am188em_timer2_irq )
***************************************************************************/ ***************************************************************************/
// To be removed when cpu core is updated // To be removed when cpu core is updated
static TIMER_DEVICE_CALLBACK( h8_timer_irq ) TIMER_DEVICE_CALLBACK_MEMBER(subsino2_state::h8_timer_irq)
{ {
timer.machine().device("maincpu")->execute().set_input_line(H8_METRO_TIMER_HACK, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(H8_METRO_TIMER_HACK, HOLD_LINE);
} }
@ -2178,7 +2179,7 @@ static MACHINE_CONFIG_START( bishjan, subsino2_state )
MCFG_CPU_ADD("maincpu", H83044, XTAL_44_1MHz / 3) MCFG_CPU_ADD("maincpu", H83044, XTAL_44_1MHz / 3)
MCFG_CPU_PROGRAM_MAP( bishjan_map ) MCFG_CPU_PROGRAM_MAP( bishjan_map )
MCFG_CPU_VBLANK_INT_DRIVER("screen", subsino2_state, irq0_line_hold) MCFG_CPU_VBLANK_INT_DRIVER("screen", subsino2_state, irq0_line_hold)
MCFG_TIMER_ADD_PERIODIC("timer", h8_timer_irq, attotime::from_hz(60)) // timer, ?? Hz MCFG_TIMER_DRIVER_ADD_PERIODIC("timer", subsino2_state, h8_timer_irq, attotime::from_hz(60))
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW)
@ -2238,7 +2239,7 @@ static MACHINE_CONFIG_START( saklove, subsino2_state )
MCFG_CPU_ADD("maincpu", I80188, XTAL_20MHz ) // !! AMD AM188-EM !! MCFG_CPU_ADD("maincpu", I80188, XTAL_20MHz ) // !! AMD AM188-EM !!
MCFG_CPU_PROGRAM_MAP( saklove_map ) MCFG_CPU_PROGRAM_MAP( saklove_map )
MCFG_CPU_IO_MAP( saklove_io ) MCFG_CPU_IO_MAP( saklove_io )
MCFG_TIMER_ADD_PERIODIC("timer2", am188em_timer2_irq, attotime::from_hz(60)) // timer 2, ?? Hz MCFG_TIMER_DRIVER_ADD_PERIODIC("timer2", subsino2_state, am188em_timer2_irq, attotime::from_hz(60))
MCFG_MACHINE_RESET_OVERRIDE(subsino2_state,am188em) MCFG_MACHINE_RESET_OVERRIDE(subsino2_state,am188em)
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")
@ -2275,7 +2276,7 @@ static MACHINE_CONFIG_START( xplan, subsino2_state )
MCFG_CPU_PROGRAM_MAP( xplan_map ) MCFG_CPU_PROGRAM_MAP( xplan_map )
MCFG_CPU_IO_MAP( xplan_io ) MCFG_CPU_IO_MAP( xplan_io )
MCFG_CPU_VBLANK_INT_DRIVER("screen", subsino2_state, am188em_int0_irq) MCFG_CPU_VBLANK_INT_DRIVER("screen", subsino2_state, am188em_int0_irq)
MCFG_TIMER_ADD_PERIODIC("timer2", am188em_timer2_irq, attotime::from_hz(60)) // timer 2, ?? Hz MCFG_TIMER_DRIVER_ADD_PERIODIC("timer2", subsino2_state, am188em_timer2_irq, attotime::from_hz(60))
MCFG_MACHINE_RESET_OVERRIDE(subsino2_state,am188em) MCFG_MACHINE_RESET_OVERRIDE(subsino2_state,am188em)
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")

View File

@ -37,6 +37,7 @@ public:
DECLARE_DRIVER_INIT(kingtut); DECLARE_DRIVER_INIT(kingtut);
DECLARE_VIDEO_START(kongambl); DECLARE_VIDEO_START(kongambl);
UINT32 screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(kongambl_vblank);
}; };
@ -579,22 +580,21 @@ static const k053247_interface k053247_intf =
kongambl_sprite_callback kongambl_sprite_callback
}; };
static TIMER_DEVICE_CALLBACK( kongambl_vblank ) TIMER_DEVICE_CALLBACK_MEMBER(kongambl_state::kongambl_vblank)
{ {
kongambl_state *state = timer.machine().driver_data<kongambl_state>();
int scanline = param; int scanline = param;
if(scanline == 512) if(scanline == 512)
state->m_maincpu->set_input_line(1, HOLD_LINE); // vblank? m_maincpu->set_input_line(1, HOLD_LINE); // vblank?
if(scanline == 0) if(scanline == 0)
state->m_maincpu->set_input_line(3, HOLD_LINE); // sprite irq? m_maincpu->set_input_line(3, HOLD_LINE); // sprite irq?
} }
static MACHINE_CONFIG_START( kongambl, kongambl_state ) static MACHINE_CONFIG_START( kongambl, kongambl_state )
MCFG_CPU_ADD("maincpu", M68EC020, 25000000) MCFG_CPU_ADD("maincpu", M68EC020, 25000000)
MCFG_CPU_PROGRAM_MAP(kongambl_map) MCFG_CPU_PROGRAM_MAP(kongambl_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", kongambl_vblank, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kongambl_state, kongambl_vblank, "screen", 0, 1)
MCFG_CPU_ADD("sndcpu", M68000, 16000000) MCFG_CPU_ADD("sndcpu", M68000, 16000000)
MCFG_CPU_PROGRAM_MAP(kongamaud_map) MCFG_CPU_PROGRAM_MAP(kongamaud_map)

View File

@ -184,6 +184,7 @@ public:
DECLARE_MACHINE_RESET(galgames); DECLARE_MACHINE_RESET(galgames);
DECLARE_VIDEO_START(galgames); DECLARE_VIDEO_START(galgames);
UINT32 screen_update_tmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_tmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(tm3k_interrupt);
}; };
@ -902,15 +903,14 @@ MACHINE_RESET_MEMBER(tmaster_state,tmaster)
m_duart68681 = machine().device( "duart68681" ); m_duart68681 = machine().device( "duart68681" );
} }
static TIMER_DEVICE_CALLBACK( tm3k_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(tmaster_state::tm3k_interrupt)
{ {
tmaster_state *state = timer.machine().driver_data<tmaster_state>();
int scanline = param; int scanline = param;
if(scanline == 0) // vblank, FIXME if(scanline == 0) // vblank, FIXME
state->m_maincpu->set_input_line(3, HOLD_LINE); m_maincpu->set_input_line(3, HOLD_LINE);
else if((scanline % 16) == 0) else if((scanline % 16) == 0)
state->m_maincpu->set_input_line(1, HOLD_LINE); m_maincpu->set_input_line(1, HOLD_LINE);
// lev 2 triggered at the end of the blit // lev 2 triggered at the end of the blit
} }
@ -927,7 +927,7 @@ static const duart68681_config tmaster_duart68681_config =
static MACHINE_CONFIG_START( tm3k, tmaster_state ) static MACHINE_CONFIG_START( tm3k, tmaster_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2) /* 12MHz */ MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2) /* 12MHz */
MCFG_CPU_PROGRAM_MAP(tmaster_map) MCFG_CPU_PROGRAM_MAP(tmaster_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", tm3k_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", tmaster_state, tm3k_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(tmaster_state,tmaster) MCFG_MACHINE_RESET_OVERRIDE(tmaster_state,tmaster)
@ -981,7 +981,7 @@ MACHINE_RESET_MEMBER(tmaster_state,galgames)
static MACHINE_CONFIG_START( galgames, tmaster_state ) static MACHINE_CONFIG_START( galgames, tmaster_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2) MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2)
MCFG_CPU_PROGRAM_MAP(galgames_map) MCFG_CPU_PROGRAM_MAP(galgames_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", tm3k_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", tmaster_state, tm3k_interrupt, "screen", 0, 1)
// 5 EEPROMs on the motherboard (for BIOS + 4 Carts) // 5 EEPROMs on the motherboard (for BIOS + 4 Carts)
MCFG_EEPROM_ADD(GALGAMES_EEPROM_BIOS, galgames_eeprom_interface) MCFG_EEPROM_ADD(GALGAMES_EEPROM_BIOS, galgames_eeprom_interface)

View File

@ -70,6 +70,7 @@ public:
UINT32 screen_update_tmmjprd_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_tmmjprd_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_tmmjprd_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_tmmjprd_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(tmmjprd_blit_done); TIMER_CALLBACK_MEMBER(tmmjprd_blit_done);
TIMER_DEVICE_CALLBACK_MEMBER(tmmjprd_scanline);
}; };
@ -732,23 +733,22 @@ static GFXDECODE_START( tmmjprd )
GFXDECODE_END GFXDECODE_END
static TIMER_DEVICE_CALLBACK( tmmjprd_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(tmmjprd_state::tmmjprd_scanline)
{ {
//tmmjprd_state *state = timer.machine().driver_data<tmmjprd_state>();
int scanline = param; int scanline = param;
if(scanline == 224) // vblank-out irq if(scanline == 224) // vblank-out irq
timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
if(scanline == 736) // blitter irq? if(scanline == 736) // blitter irq?
timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
} }
static MACHINE_CONFIG_START( tmmjprd, tmmjprd_state ) static MACHINE_CONFIG_START( tmmjprd, tmmjprd_state )
MCFG_CPU_ADD("maincpu",M68EC020,24000000) /* 24 MHz */ MCFG_CPU_ADD("maincpu",M68EC020,24000000) /* 24 MHz */
MCFG_CPU_PROGRAM_MAP(tmmjprd_map) MCFG_CPU_PROGRAM_MAP(tmmjprd_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", tmmjprd_scanline, "lscreen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", tmmjprd_state, tmmjprd_scanline, "lscreen", 0, 1)
MCFG_EEPROM_93C46_ADD("eeprom") MCFG_EEPROM_93C46_ADD("eeprom")

View File

@ -43,6 +43,7 @@ public:
DECLARE_WRITE8_MEMBER(ay_bout_w); DECLARE_WRITE8_MEMBER(ay_bout_w);
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(tonton_interrupt);
}; };
#define MAIN_CLOCK XTAL_21_4772MHz #define MAIN_CLOCK XTAL_21_4772MHz
@ -202,12 +203,11 @@ void tonton_state::machine_reset()
* R/W Handlers and Interrupt Routines * * R/W Handlers and Interrupt Routines *
*************************************************/ *************************************************/
static TIMER_DEVICE_CALLBACK( tonton_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(tonton_state::tonton_interrupt)
{ {
tonton_state *state = timer.machine().driver_data<tonton_state>(); m_v9938->set_sprite_limit(0);
state->m_v9938->set_sprite_limit(0); m_v9938->set_resolution(0);
state->m_v9938->set_resolution(0); m_v9938->interrupt();
state->m_v9938->interrupt();
} }
@ -255,7 +255,7 @@ static MACHINE_CONFIG_START( tonton, tonton_state )
MCFG_CPU_ADD("maincpu",Z80,MAIN_CLOCK/6) /* Guess. According to other MSX2 based gambling games */ MCFG_CPU_ADD("maincpu",Z80,MAIN_CLOCK/6) /* Guess. According to other MSX2 based gambling games */
MCFG_CPU_PROGRAM_MAP(tonton_map) MCFG_CPU_PROGRAM_MAP(tonton_map)
MCFG_CPU_IO_MAP(tonton_io) MCFG_CPU_IO_MAP(tonton_io)
MCFG_TIMER_ADD_SCANLINE("scantimer", tonton_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", tonton_state, tonton_interrupt, "screen", 0, 1)
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")

View File

@ -364,6 +364,7 @@ public:
DECLARE_PALETTE_INIT(babypkr); DECLARE_PALETTE_INIT(babypkr);
DECLARE_PALETTE_INIT(fortune1); DECLARE_PALETTE_INIT(fortune1);
UINT32 screen_update_videopkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_videopkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(sound_t1_callback);
}; };
@ -930,16 +931,15 @@ WRITE8_MEMBER(videopkr_state::baby_sound_p3_w)
} }
static TIMER_DEVICE_CALLBACK(sound_t1_callback) TIMER_DEVICE_CALLBACK_MEMBER(videopkr_state::sound_t1_callback)
{ {
videopkr_state *state = timer.machine().driver_data<videopkr_state>(); if (m_te_40103 == 1)
if (state->m_te_40103 == 1)
{ {
state->m_dc_40103++; m_dc_40103++;
if (state->m_dc_40103 == 0) if (m_dc_40103 == 0)
{ {
timer.machine().device("soundcpu")->execute().set_input_line(0, ASSERT_LINE); machine().device("soundcpu")->execute().set_input_line(0, ASSERT_LINE);
} }
} }
} }
@ -1244,7 +1244,7 @@ static MACHINE_CONFIG_START( videopkr, videopkr_state )
MCFG_CPU_IO_MAP(i8039_sound_port) MCFG_CPU_IO_MAP(i8039_sound_port)
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_TIMER_ADD_PERIODIC("t1_timer", sound_t1_callback, attotime::from_hz(50)) MCFG_TIMER_DRIVER_ADD_PERIODIC("t1_timer", videopkr_state, sound_t1_callback, attotime::from_hz(50))
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -286,6 +286,7 @@ public:
virtual void video_start(); virtual void video_start();
UINT32 screen_update_wheelfir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_wheelfir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_wheelfir(screen_device &screen, bool state); void screen_eof_wheelfir(screen_device &screen, bool state);
TIMER_DEVICE_CALLBACK_MEMBER(scanline_timer_callback);
}; };
@ -727,40 +728,39 @@ static INPUT_PORTS_START( wheelfir )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END INPUT_PORTS_END
static TIMER_DEVICE_CALLBACK( scanline_timer_callback ) TIMER_DEVICE_CALLBACK_MEMBER(wheelfir_state::scanline_timer_callback)
{ {
wheelfir_state *state = timer.machine().driver_data<wheelfir_state>(); machine().scheduler().synchronize();
timer.machine().scheduler().synchronize(); m_current_scanline=param;
state->m_current_scanline=param;
if(state->m_current_scanline<NUM_SCANLINES) if(m_current_scanline<NUM_SCANLINES)
{ {
//visible scanline //visible scanline
state->m_toggle_bit = 0x0000; m_toggle_bit = 0x0000;
--state->m_scanline_cnt; --m_scanline_cnt;
if(state->m_current_scanline>0) if(m_current_scanline>0)
{ {
//copy scanline offset //copy scanline offset
state->m_scanlines[state->m_current_scanline].x=(state->m_scanlines[state->m_current_scanline-1].x); m_scanlines[m_current_scanline].x=(m_scanlines[m_current_scanline-1].x);
state->m_scanlines[state->m_current_scanline].y=(state->m_scanlines[state->m_current_scanline-1].y+1); m_scanlines[m_current_scanline].y=(m_scanlines[m_current_scanline-1].y+1);
state->m_scanlines[state->m_current_scanline].unkbits=state->m_scanlines[state->m_current_scanline-1].unkbits; m_scanlines[m_current_scanline].unkbits=m_scanlines[m_current_scanline-1].unkbits;
} }
if(state->m_scanline_cnt==0) //<=0 ? if(m_scanline_cnt==0) //<=0 ?
{ {
timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); // raster IRQ, changes scroll values for road machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); // raster IRQ, changes scroll values for road
} }
} }
else else
{ {
if(state->m_current_scanline==NUM_SCANLINES) /* vblank */ if(m_current_scanline==NUM_SCANLINES) /* vblank */
{ {
state->m_toggle_bit = 0x8000; m_toggle_bit = 0x8000;
timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
} }
} }
} }
@ -822,7 +822,7 @@ static MACHINE_CONFIG_START( wheelfir, wheelfir_state )
MCFG_QUANTUM_TIME(attotime::from_hz(12000)) MCFG_QUANTUM_TIME(attotime::from_hz(12000))
MCFG_TIMER_ADD_SCANLINE("scan_timer", scanline_timer_callback, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_timer", wheelfir_state, scanline_timer_callback, "screen", 0, 1)
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_REFRESH_RATE(60)

View File

@ -53,6 +53,8 @@ public:
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_shared_ptr<UINT8> m_p_ram; required_shared_ptr<UINT8> m_p_ram;
required_device<samples_device> m_samples; required_device<samples_device> m_samples;
TIMER_DEVICE_CALLBACK_MEMBER(zac_1_inttimer);
TIMER_DEVICE_CALLBACK_MEMBER(zac_1_outtimer);
protected: protected:
// devices // devices
@ -201,44 +203,42 @@ void zac_1_state::machine_reset()
} }
} }
static TIMER_DEVICE_CALLBACK( zac_1_inttimer ) TIMER_DEVICE_CALLBACK_MEMBER(zac_1_state::zac_1_inttimer)
{ {
zac_1_state *state = timer.machine().driver_data<zac_1_state>(); if (m_t_c > 0x40)
if (state->m_t_c > 0x40)
{ {
UINT8 vector = (state->ioport("TEST")->read() ) ? 0x10 : 0x18; UINT8 vector = (ioport("TEST")->read() ) ? 0x10 : 0x18;
state->m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, vector); m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, vector);
} }
else else
state->m_t_c++; m_t_c++;
} }
/* scores = 1800-182D; solenoids = 1840-1853; /* scores = 1800-182D; solenoids = 1840-1853;
lamps = 1880-18BF; bookkeeping=18C0-18FF. 4-tone osc=1854-1857. lamps = 1880-18BF; bookkeeping=18C0-18FF. 4-tone osc=1854-1857.
182E-183F is a storage area for inputs. */ 182E-183F is a storage area for inputs. */
static TIMER_DEVICE_CALLBACK( zac_1_outtimer ) TIMER_DEVICE_CALLBACK_MEMBER(zac_1_state::zac_1_outtimer)
{ {
static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 }; static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 };
zac_1_state *state = timer.machine().driver_data<zac_1_state>(); m_out_offs++;
state->m_out_offs++;
if (state->m_out_offs < 0x40) if (m_out_offs < 0x40)
{ {
UINT8 display = (state->m_out_offs >> 3) & 7; UINT8 display = (m_out_offs >> 3) & 7;
UINT8 digit = state->m_out_offs & 7; UINT8 digit = m_out_offs & 7;
output_set_digit_value(display * 10 + digit, patterns[state->m_p_ram[state->m_out_offs]&15]); output_set_digit_value(display * 10 + digit, patterns[m_p_ram[m_out_offs]&15]);
} }
else else
if (state->m_out_offs == 0x4a) // outhole if (m_out_offs == 0x4a) // outhole
{ {
if (BIT(state->m_p_ram[state->m_out_offs], 0)) if (BIT(m_p_ram[m_out_offs], 0))
state->m_samples->start(0, 5); m_samples->start(0, 5);
} }
else else
if (state->m_out_offs == 0x4b) // knocker (not strapids) if (m_out_offs == 0x4b) // knocker (not strapids)
{ {
if (BIT(state->m_p_ram[state->m_out_offs], 0)) if (BIT(m_p_ram[m_out_offs], 0))
state->m_samples->start(0, 6); m_samples->start(0, 6);
} }
} }
@ -249,8 +249,8 @@ static MACHINE_CONFIG_START( zac_1, zac_1_state )
MCFG_CPU_IO_MAP(zac_1_io) MCFG_CPU_IO_MAP(zac_1_io)
MCFG_NVRAM_ADD_0FILL("ram") MCFG_NVRAM_ADD_0FILL("ram")
MCFG_TIMER_ADD_PERIODIC("zac_1_inttimer", zac_1_inttimer, attotime::from_hz(200)) MCFG_TIMER_DRIVER_ADD_PERIODIC("zac_1_inttimer", zac_1_state, zac_1_inttimer, attotime::from_hz(200))
MCFG_TIMER_ADD_PERIODIC("zac_1_outtimer", zac_1_outtimer, attotime::from_hz(187500)) MCFG_TIMER_DRIVER_ADD_PERIODIC("zac_1_outtimer", zac_1_state, zac_1_outtimer, attotime::from_hz(187500))
/* Video */ /* Video */
MCFG_DEFAULT_LAYOUT(layout_zac_1) MCFG_DEFAULT_LAYOUT(layout_zac_1)

View File

@ -27,6 +27,8 @@ public:
UINT8 m_out_offs; UINT8 m_out_offs;
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_shared_ptr<UINT8> m_p_ram; required_shared_ptr<UINT8> m_p_ram;
TIMER_DEVICE_CALLBACK_MEMBER(zac_2_inttimer);
TIMER_DEVICE_CALLBACK_MEMBER(zac_2_outtimer);
protected: protected:
// devices // devices
@ -173,28 +175,26 @@ void zac_2_state::machine_reset()
m_t_c = 0; m_t_c = 0;
} }
static TIMER_DEVICE_CALLBACK( zac_2_inttimer ) TIMER_DEVICE_CALLBACK_MEMBER(zac_2_state::zac_2_inttimer)
{ {
// a pulse is sent via a capacitor (similar to what one finds at a reset pin) // a pulse is sent via a capacitor (similar to what one finds at a reset pin)
zac_2_state *state = timer.machine().driver_data<zac_2_state>(); if (m_t_c > 0x80)
if (state->m_t_c > 0x80) generic_pulse_irq_line_and_vector(m_maincpu, INPUT_LINE_IRQ0, 0xbf, 2);
generic_pulse_irq_line_and_vector(state->m_maincpu, INPUT_LINE_IRQ0, 0xbf, 2);
else else
state->m_t_c++; m_t_c++;
} }
static TIMER_DEVICE_CALLBACK( zac_2_outtimer ) TIMER_DEVICE_CALLBACK_MEMBER(zac_2_state::zac_2_outtimer)
{ {
static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 }; static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 };
zac_2_state *state = timer.machine().driver_data<zac_2_state>(); m_out_offs++;
state->m_out_offs++;
// displays, solenoids, lamps // displays, solenoids, lamps
if (state->m_out_offs < 0x40) if (m_out_offs < 0x40)
{ {
UINT8 display = (state->m_out_offs >> 3) & 7; UINT8 display = (m_out_offs >> 3) & 7;
UINT8 digit = state->m_out_offs & 7; UINT8 digit = m_out_offs & 7;
output_set_digit_value(display * 10 + digit, patterns[state->m_p_ram[state->m_out_offs]&15]); output_set_digit_value(display * 10 + digit, patterns[m_p_ram[m_out_offs]&15]);
} }
} }
@ -205,8 +205,8 @@ static MACHINE_CONFIG_START( zac_2, zac_2_state )
MCFG_CPU_IO_MAP(zac_2_io) MCFG_CPU_IO_MAP(zac_2_io)
MCFG_NVRAM_ADD_0FILL("ram") MCFG_NVRAM_ADD_0FILL("ram")
MCFG_TIMER_ADD_PERIODIC("zac_2_inttimer", zac_2_inttimer, attotime::from_hz(200)) MCFG_TIMER_DRIVER_ADD_PERIODIC("zac_2_inttimer", zac_2_state, zac_2_inttimer, attotime::from_hz(200))
MCFG_TIMER_ADD_PERIODIC("zac_2_outtimer", zac_2_outtimer, attotime::from_hz(187500)) MCFG_TIMER_DRIVER_ADD_PERIODIC("zac_2_outtimer", zac_2_state, zac_2_outtimer, attotime::from_hz(187500))
/* Video */ /* Video */
MCFG_DEFAULT_LAYOUT(layout_zac_2) MCFG_DEFAULT_LAYOUT(layout_zac_2)

View File

@ -29,6 +29,7 @@ public:
UINT16 m_nixie[16]; UINT16 m_nixie[16];
UINT8 m_timer; UINT8 m_timer;
virtual void machine_start(); virtual void machine_start();
TIMER_DEVICE_CALLBACK_MEMBER(timer_callback);
}; };
READ8_MEMBER(nixieclock_state::data_r) READ8_MEMBER(nixieclock_state::data_r)
@ -124,11 +125,10 @@ INPUT_PORTS_END
*/ */
static TIMER_DEVICE_CALLBACK(timer_callback) TIMER_DEVICE_CALLBACK_MEMBER(nixieclock_state::timer_callback)
{ {
nixieclock_state *state = timer.machine().driver_data<nixieclock_state>(); i4004_set_test(machine().device("maincpu"),m_timer);
i4004_set_test(timer.machine().device("maincpu"),state->m_timer); m_timer^=1;
state->m_timer^=1;
} }
void nixieclock_state::machine_start() void nixieclock_state::machine_start()
@ -157,7 +157,7 @@ static MACHINE_CONFIG_START( 4004clk, nixieclock_state )
MCFG_SOUND_ADD("dac", DAC, 0) MCFG_SOUND_ADD("dac", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_TIMER_ADD_PERIODIC("4004clk_timer", timer_callback, attotime::from_hz(120)) MCFG_TIMER_DRIVER_ADD_PERIODIC("4004clk_timer", nixieclock_state, timer_callback, attotime::from_hz(120))
MACHINE_CONFIG_END MACHINE_CONFIG_END
/* ROM definition */ /* ROM definition */

View File

@ -56,6 +56,7 @@ public:
bool m_step; bool m_step;
virtual void machine_reset(); virtual void machine_reset();
virtual void machine_start(); virtual void machine_start();
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
}; };
@ -220,9 +221,8 @@ static const z80_daisy_config babbage_daisy_chain[] =
{ NULL } { NULL }
}; };
static TIMER_DEVICE_CALLBACK( keyboard_callback ) TIMER_DEVICE_CALLBACK_MEMBER(babbage_state::keyboard_callback)
{ {
babbage_state *state = timer.machine().driver_data<babbage_state>();
UINT8 i, j, inp; UINT8 i, j, inp;
char kbdrow[6]; char kbdrow[6];
@ -231,7 +231,7 @@ static TIMER_DEVICE_CALLBACK( keyboard_callback )
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
sprintf(kbdrow,"X%X",i); sprintf(kbdrow,"X%X",i);
inp = timer.machine().root_device().ioport(kbdrow)->read(); inp = machine().root_device().ioport(kbdrow)->read();
for (j = 0; j < 5; j++) for (j = 0; j < 5; j++)
if (BIT(inp, j)) if (BIT(inp, j))
@ -239,19 +239,19 @@ static TIMER_DEVICE_CALLBACK( keyboard_callback )
} }
/* make sure only one keystroke */ /* make sure only one keystroke */
if (data != state->m_prev_key) if (data != m_prev_key)
state->m_prev_key = data; m_prev_key = data;
else else
data = 0xff; data = 0xff;
/* while key is down, activate strobe. When key released, deactivate strobe which causes an interrupt */ /* while key is down, activate strobe. When key released, deactivate strobe which causes an interrupt */
if (data < 0xff) if (data < 0xff)
{ {
state->m_key = data; m_key = data;
state->m_pio_2->strobe(0, 0); m_pio_2->strobe(0, 0);
} }
else else
state->m_pio_2->strobe(0, 1); m_pio_2->strobe(0, 1);
} }
@ -276,7 +276,7 @@ static MACHINE_CONFIG_START( babbage, babbage_state )
MCFG_Z80PIO_ADD( "z80pio_1", MAIN_CLOCK, babbage_z80pio1_intf ) MCFG_Z80PIO_ADD( "z80pio_1", MAIN_CLOCK, babbage_z80pio1_intf )
MCFG_Z80PIO_ADD( "z80pio_2", MAIN_CLOCK, babbage_z80pio2_intf ) MCFG_Z80PIO_ADD( "z80pio_2", MAIN_CLOCK, babbage_z80pio2_intf )
MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(30)) MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", babbage_state, keyboard_callback, attotime::from_hz(30))
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -145,6 +145,7 @@ public:
required_device<device_t> m_floppy3; required_device<device_t> m_floppy3;
required_device<device_t> m_beeper; required_device<device_t> m_beeper;
DECLARE_DRIVER_INIT(bigbord2); DECLARE_DRIVER_INIT(bigbord2);
TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
}; };
/* Status port /* Status port
@ -405,14 +406,13 @@ const z80sio_interface sio_intf =
/* Z80 CTC */ /* Z80 CTC */
static TIMER_DEVICE_CALLBACK( ctc_tick ) TIMER_DEVICE_CALLBACK_MEMBER(bigbord2_state::ctc_tick)
{ {
bigbord2_state *state = timer.machine().driver_data<bigbord2_state>();
state->m_ctcb->trg0(1); m_ctcb->trg0(1);
state->m_ctcb->trg1(1); m_ctcb->trg1(1);
state->m_ctcb->trg0(0); m_ctcb->trg0(0);
state->m_ctcb->trg1(0); m_ctcb->trg1(0);
} }
WRITE_LINE_MEMBER( bigbord2_state::frame ) WRITE_LINE_MEMBER( bigbord2_state::frame )
@ -696,7 +696,7 @@ static MACHINE_CONFIG_START( bigbord2, bigbord2_state )
MCFG_PALETTE_INIT(black_and_white) MCFG_PALETTE_INIT(black_and_white)
/* keyboard */ /* keyboard */
MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(MAIN_CLOCK)) MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", bigbord2_state, ctc_tick, attotime::from_hz(MAIN_CLOCK))
/* devices */ /* devices */
MCFG_Z80DMA_ADD(Z80DMA_TAG, MAIN_CLOCK, dma_intf) MCFG_Z80DMA_ADD(Z80DMA_TAG, MAIN_CLOCK, dma_intf)

View File

@ -115,6 +115,7 @@ public:
UINT32 screen_update_bml3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_bml3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(bml3_irq); INTERRUPT_GEN_MEMBER(bml3_irq);
INTERRUPT_GEN_MEMBER(bml3_timer_firq); INTERRUPT_GEN_MEMBER(bml3_timer_firq);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
}; };
#define mc6845_h_char_total (m_crtc_vreg[0]) #define mc6845_h_char_total (m_crtc_vreg[0])
@ -575,9 +576,8 @@ static const mc6845_interface mc6845_intf =
NULL /* update address callback */ NULL /* update address callback */
}; };
static TIMER_DEVICE_CALLBACK( keyboard_callback ) TIMER_DEVICE_CALLBACK_MEMBER(bml3_state::keyboard_callback)
{ {
bml3_state *state = timer.machine().driver_data<bml3_state>();
static const char *const portnames[3] = { "key1","key2","key3" }; static const char *const portnames[3] = { "key1","key2","key3" };
int i,port_i,scancode; int i,port_i,scancode;
scancode = 0; scancode = 0;
@ -586,12 +586,12 @@ static TIMER_DEVICE_CALLBACK( keyboard_callback )
{ {
for(i=0;i<32;i++) for(i=0;i<32;i++)
{ {
if((timer.machine().root_device().ioport(portnames[port_i])->read()>>i) & 1) if((machine().root_device().ioport(portnames[port_i])->read()>>i) & 1)
{ {
{ {
state->m_keyb_press = scancode; m_keyb_press = scancode;
state->m_keyb_press_flag = 1; m_keyb_press_flag = 1;
timer.machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, HOLD_LINE);
return; return;
} }
} }
@ -907,7 +907,7 @@ static MACHINE_CONFIG_START( bml3, bml3_state )
/* Devices */ /* Devices */
MCFG_MC6845_ADD("crtc", H46505, XTAL_1MHz, mc6845_intf) MCFG_MC6845_ADD("crtc", H46505, XTAL_1MHz, mc6845_intf)
MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/8)) MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", bml3_state, keyboard_callback, attotime::from_hz(240/8))
MCFG_MC6843_ADD( "mc6843", bml3_6843_if ) MCFG_MC6843_ADD( "mc6843", bml3_6843_if )
MCFG_PIA6821_ADD("pia6821", bml3_pia_config) MCFG_PIA6821_ADD("pia6821", bml3_pia_config)
MCFG_ACIA6850_ADD("acia6850", bml3_acia_if) MCFG_ACIA6850_ADD("acia6850", bml3_acia_if)

View File

@ -34,6 +34,7 @@ public:
UINT8 m_ram_addr; UINT8 m_ram_addr;
UINT8 *m_ram; UINT8 *m_ram;
UINT8 m_matrix; UINT8 m_matrix;
//TIMER_DEVICE_CALLBACK_MEMBER(borisdpl_timer_interrupt);
}; };
WRITE8_MEMBER( chesstrv_state::ram_addr_w ) WRITE8_MEMBER( chesstrv_state::ram_addr_w )
@ -194,9 +195,9 @@ static INPUT_PORTS_START( borisdpl )
INPUT_PORTS_END INPUT_PORTS_END
/* /*
static TIMER_DEVICE_CALLBACK( borisdpl_timer_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(chesstrv_state::borisdpl_timer_interrupt)
{ {
timer.machine().device("maincpu")->execute().set_input_line_and_vector(F8_INPUT_LINE_INT_REQ, HOLD_LINE, 0x20); machine().device("maincpu")->execute().set_input_line_and_vector(F8_INPUT_LINE_INT_REQ, HOLD_LINE, 0x20);
} }
*/ */
@ -227,7 +228,7 @@ static MACHINE_CONFIG_START( borisdpl, chesstrv_state )
/* video hardware */ /* video hardware */
MCFG_DEFAULT_LAYOUT( layout_borisdpl ) MCFG_DEFAULT_LAYOUT( layout_borisdpl )
//MCFG_TIMER_ADD_PERIODIC("timer_interrupt", borisdpl_timer_interrupt, attotime::from_hz(40)) //MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_interrupt", chesstrv_state, borisdpl_timer_interrupt, attotime::from_hz(40))
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -46,6 +46,7 @@ public:
DECLARE_READ_LINE_MEMBER( pia1_cb1_r ); DECLARE_READ_LINE_MEMBER( pia1_cb1_r );
UINT8 m_selector; UINT8 m_selector;
TIMER_DEVICE_CALLBACK_MEMBER(irq_timer);
}; };
@ -173,10 +174,10 @@ READ_LINE_MEMBER( csc_state::pia1_cb1_r )
} }
static TIMER_DEVICE_CALLBACK( irq_timer ) TIMER_DEVICE_CALLBACK_MEMBER(csc_state::irq_timer)
{ {
timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE);
} }
/* Address maps */ /* Address maps */
@ -315,7 +316,7 @@ static MACHINE_CONFIG_START( csc, csc_state )
MCFG_DEFAULT_LAYOUT(layout_vsc) MCFG_DEFAULT_LAYOUT(layout_vsc)
MCFG_TIMER_ADD_PERIODIC("irq_timer", irq_timer, attotime::from_hz(38400/64)) MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", csc_state, irq_timer, attotime::from_hz(38400/64))
MCFG_PIA6821_ADD("pia0", pia0_config) MCFG_PIA6821_ADD("pia0", pia0_config)
MCFG_PIA6821_ADD("pia1", pia1_config) MCFG_PIA6821_ADD("pia1", pia1_config)

View File

@ -80,6 +80,7 @@ private:
virtual void machine_reset(); virtual void machine_reset();
public: public:
UINT32 screen_update_d6800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_d6800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(d6800_p);
}; };
@ -182,11 +183,10 @@ UINT32 d6800_state::screen_update_d6800(screen_device &screen, bitmap_ind16 &bit
/* PIA6821 Interface */ /* PIA6821 Interface */
static TIMER_DEVICE_CALLBACK( d6800_p ) TIMER_DEVICE_CALLBACK_MEMBER(d6800_state::d6800_p)
{ {
d6800_state *state = timer.machine().driver_data<d6800_state>(); m_rtc++;
state->m_rtc++; m_maincpu->set_input_line(M6800_IRQ_LINE, (m_rtc > 0xf8) ? ASSERT_LINE : CLEAR_LINE);
state->m_maincpu->set_input_line(M6800_IRQ_LINE, (state->m_rtc > 0xf8) ? ASSERT_LINE : CLEAR_LINE);
} }
@ -383,7 +383,7 @@ static MACHINE_CONFIG_START( d6800, d6800_state )
/* devices */ /* devices */
MCFG_PIA6821_ADD("pia", d6800_mc6821_intf) MCFG_PIA6821_ADD("pia", d6800_mc6821_intf)
MCFG_CASSETTE_ADD(CASSETTE_TAG, d6800_cassette_interface) MCFG_CASSETTE_ADD(CASSETTE_TAG, d6800_cassette_interface)
MCFG_TIMER_ADD_PERIODIC("d6800_p", d6800_p, attotime::from_hz(40000) ) MCFG_TIMER_DRIVER_ADD_PERIODIC("d6800_p", d6800_state, d6800_p, attotime::from_hz(40000))
/* quickload */ /* quickload */
MCFG_QUICKLOAD_ADD("quickload", d6800, "ch8", 1) MCFG_QUICKLOAD_ADD("quickload", d6800, "ch8", 1)

View File

@ -76,6 +76,8 @@ public:
required_device<device_t> m_pia; required_device<device_t> m_pia;
required_shared_ptr<UINT8> m_p_nvram; required_shared_ptr<UINT8> m_p_nvram;
virtual void machine_reset(); virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(eacc_cb1);
TIMER_DEVICE_CALLBACK_MEMBER(eacc_nmi);
private: private:
UINT8 m_digit; UINT8 m_digit;
}; };
@ -132,22 +134,20 @@ void eacc_state::machine_reset()
m_cb2 = 0; m_cb2 = 0;
} }
static TIMER_DEVICE_CALLBACK( eacc_cb1 ) TIMER_DEVICE_CALLBACK_MEMBER(eacc_state::eacc_cb1)
{ {
eacc_state *state = timer.machine().driver_data<eacc_state>(); m_cb1 ^= 1; // 15hz
state->m_cb1 ^= 1; // 15hz if (m_cb2)
if (state->m_cb2) m_maincpu->set_input_line(M6800_IRQ_LINE, ASSERT_LINE);
state->m_maincpu->set_input_line(M6800_IRQ_LINE, ASSERT_LINE);
} }
static TIMER_DEVICE_CALLBACK( eacc_nmi ) TIMER_DEVICE_CALLBACK_MEMBER(eacc_state::eacc_nmi)
{ {
eacc_state *state = timer.machine().driver_data<eacc_state>();
if (state->m_cb2) if (m_cb2)
{ {
state->m_nmi = true; m_nmi = true;
state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
} }
} }
@ -261,8 +261,8 @@ static MACHINE_CONFIG_START( eacc, eacc_state )
MCFG_PIA6821_ADD("pia", eacc_mc6821_intf) MCFG_PIA6821_ADD("pia", eacc_mc6821_intf)
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_TIMER_ADD_PERIODIC("eacc_nmi", eacc_nmi, attotime::from_hz(600) ) MCFG_TIMER_DRIVER_ADD_PERIODIC("eacc_nmi", eacc_state, eacc_nmi, attotime::from_hz(600))
MCFG_TIMER_ADD_PERIODIC("eacc_cb1", eacc_cb1, attotime::from_hz(30) ) MCFG_TIMER_DRIVER_ADD_PERIODIC("eacc_cb1", eacc_state, eacc_cb1, attotime::from_hz(30))
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -105,13 +105,13 @@ public:
UINT8 m_wx318; /* data of 74ls374 labeled wx318 */ UINT8 m_wx318; /* data of 74ls374 labeled wx318 */
UINT8 m_wx319; /* data of 74sl374 labeled wx319 */ UINT8 m_wx319; /* data of 74sl374 labeled wx319 */
virtual void palette_init(); virtual void palette_init();
TIMER_DEVICE_CALLBACK_MEMBER(exelv_hblank_interrupt);
}; };
static TIMER_DEVICE_CALLBACK( exelv_hblank_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(exelv_state::exelv_hblank_interrupt)
{ {
exelv_state *exelv = timer.machine().driver_data<exelv_state>(); m_tms3556->interrupt(machine());
exelv->m_tms3556->interrupt(timer.machine());
} }
#ifdef UNUSED_FUNCTION #ifdef UNUSED_FUNCTION
@ -530,7 +530,7 @@ static MACHINE_CONFIG_START( exl100, exelv_state )
MCFG_CPU_ADD("maincpu", TMS7000_EXL, XTAL_4_9152MHz) /* TMS7020 */ MCFG_CPU_ADD("maincpu", TMS7000_EXL, XTAL_4_9152MHz) /* TMS7020 */
MCFG_CPU_PROGRAM_MAP(tms7020_mem) MCFG_CPU_PROGRAM_MAP(tms7020_mem)
MCFG_CPU_IO_MAP(tms7020_port) MCFG_CPU_IO_MAP(tms7020_port)
MCFG_TIMER_ADD_SCANLINE("scantimer", exelv_hblank_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("tms7041", TMS7000, XTAL_4_9152MHz) MCFG_CPU_ADD("tms7041", TMS7000, XTAL_4_9152MHz)
MCFG_CPU_PROGRAM_MAP(tms7041_map) MCFG_CPU_PROGRAM_MAP(tms7041_map)
@ -570,7 +570,7 @@ static MACHINE_CONFIG_START( exeltel, exelv_state )
MCFG_CPU_ADD("maincpu", TMS7000_EXL, XTAL_4_9152MHz) /* TMS7040 */ MCFG_CPU_ADD("maincpu", TMS7000_EXL, XTAL_4_9152MHz) /* TMS7040 */
MCFG_CPU_PROGRAM_MAP(tms7040_mem) MCFG_CPU_PROGRAM_MAP(tms7040_mem)
MCFG_CPU_IO_MAP(tms7020_port) MCFG_CPU_IO_MAP(tms7020_port)
MCFG_TIMER_ADD_SCANLINE("scantimer", exelv_hblank_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("tms7042", TMS7000, XTAL_4_9152MHz) MCFG_CPU_ADD("tms7042", TMS7000, XTAL_4_9152MHz)
MCFG_CPU_PROGRAM_MAP(tms7042_map) MCFG_CPU_PROGRAM_MAP(tms7042_map)

View File

@ -52,6 +52,8 @@ public:
UINT8 m_int_vector; UINT8 m_int_vector;
virtual void machine_reset(); virtual void machine_reset();
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
TIMER_DEVICE_CALLBACK_MEMBER(vsync_callback);
}; };
@ -382,14 +384,13 @@ static INPUT_PORTS_START( fk1 )
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
INPUT_PORTS_END INPUT_PORTS_END
static TIMER_DEVICE_CALLBACK(keyboard_callback) TIMER_DEVICE_CALLBACK_MEMBER(fk1_state::keyboard_callback)
{ {
fk1_state *state = timer.machine().driver_data<fk1_state>();
if (timer.machine().root_device().ioport("LINE0")->read()) if (machine().root_device().ioport("LINE0")->read())
{ {
state->m_int_vector = 6; m_int_vector = 6;
timer.machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
} }
} }
@ -412,12 +413,11 @@ static IRQ_CALLBACK (fk1_irq_callback)
return state->m_int_vector * 2; return state->m_int_vector * 2;
} }
static TIMER_DEVICE_CALLBACK( vsync_callback ) TIMER_DEVICE_CALLBACK_MEMBER(fk1_state::vsync_callback)
{ {
fk1_state *state = timer.machine().driver_data<fk1_state>();
state->m_int_vector = 3; m_int_vector = 3;
timer.machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
} }
@ -482,8 +482,8 @@ static MACHINE_CONFIG_START( fk1, fk1_state )
MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("80K") // 64 + 16 MCFG_RAM_DEFAULT_SIZE("80K") // 64 + 16
MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(24000)) MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", fk1_state, keyboard_callback, attotime::from_hz(24000))
MCFG_TIMER_ADD_PERIODIC("vsync_timer", vsync_callback, attotime::from_hz(50)) MCFG_TIMER_DRIVER_ADD_PERIODIC("vsync_timer", fk1_state, vsync_callback, attotime::from_hz(50))
MACHINE_CONFIG_END MACHINE_CONFIG_END
/* ROM definition */ /* ROM definition */

View File

@ -85,6 +85,8 @@ public:
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
DECLARE_MACHINE_START(dallas32); DECLARE_MACHINE_START(dallas32);
TIMER_DEVICE_CALLBACK_MEMBER(update_nmi);
TIMER_DEVICE_CALLBACK_MEMBER(update_nmi32);
}; };
@ -273,14 +275,14 @@ WRITE32_MEMBER( glasgow_state::write_beeper32 )
m_beeper = data; m_beeper = data;
} }
static TIMER_DEVICE_CALLBACK( update_nmi ) TIMER_DEVICE_CALLBACK_MEMBER(glasgow_state::update_nmi)
{ {
timer.machine().device("maincpu")->execute().set_input_line(7, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(7, HOLD_LINE);
} }
static TIMER_DEVICE_CALLBACK( update_nmi32 ) TIMER_DEVICE_CALLBACK_MEMBER(glasgow_state::update_nmi32)
{ {
timer.machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE);
} }
void glasgow_state::machine_start() void glasgow_state::machine_start()
@ -514,7 +516,7 @@ static MACHINE_CONFIG_START( glasgow, glasgow_state )
MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_TIMER_ADD_PERIODIC("nmi_timer", update_nmi, attotime::from_hz(50)) MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", glasgow_state, update_nmi, attotime::from_hz(50))
MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -531,7 +533,7 @@ static MACHINE_CONFIG_DERIVED( dallas32, glasgow )
MCFG_MACHINE_START_OVERRIDE(glasgow_state, dallas32 ) MCFG_MACHINE_START_OVERRIDE(glasgow_state, dallas32 )
MCFG_DEVICE_REMOVE("nmi_timer") MCFG_DEVICE_REMOVE("nmi_timer")
MCFG_TIMER_ADD_PERIODIC("nmi_timer", update_nmi32, attotime::from_hz(50)) MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", glasgow_state, update_nmi32, attotime::from_hz(50))
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -44,6 +44,7 @@ public:
UINT8 m_irq_ctl; UINT8 m_irq_ctl;
UINT8 m_ff_b; UINT8 m_ff_b;
virtual void machine_reset(); virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(h8_irq_pulse);
}; };
@ -52,11 +53,10 @@ public:
#define H8_IRQ_PULSE (H8_BEEP_FRQ / 2) #define H8_IRQ_PULSE (H8_BEEP_FRQ / 2)
static TIMER_DEVICE_CALLBACK( h8_irq_pulse ) TIMER_DEVICE_CALLBACK_MEMBER(h8_state::h8_irq_pulse)
{ {
h8_state *state = timer.machine().driver_data<h8_state>(); if (m_irq_ctl & 1)
if (state->m_irq_ctl & 1) machine().device("maincpu")->execute().set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xcf);
timer.machine().device("maincpu")->execute().set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xcf);
} }
READ8_MEMBER( h8_state::h8_f0_r ) READ8_MEMBER( h8_state::h8_f0_r )
@ -225,7 +225,7 @@ static MACHINE_CONFIG_START( h8, h8_state )
MCFG_CPU_IO_MAP(h8_io) MCFG_CPU_IO_MAP(h8_io)
MCFG_CPU_CONFIG(h8_cpu_config) MCFG_CPU_CONFIG(h8_cpu_config)
MCFG_TIMER_ADD_PERIODIC("h8_timer", h8_irq_pulse, attotime::from_hz(H8_IRQ_PULSE) ) MCFG_TIMER_DRIVER_ADD_PERIODIC("h8_timer", h8_state, h8_irq_pulse, attotime::from_hz(H8_IRQ_PULSE))
/* video hardware */ /* video hardware */
MCFG_DEFAULT_LAYOUT(layout_h8) MCFG_DEFAULT_LAYOUT(layout_h8)

View File

@ -41,6 +41,7 @@ public:
UINT8 m_port_f2; UINT8 m_port_f2;
virtual void machine_reset(); virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(h89_irq_timer);
}; };
@ -97,12 +98,11 @@ void h89_state::machine_reset()
{ {
} }
static TIMER_DEVICE_CALLBACK( h89_irq_timer ) TIMER_DEVICE_CALLBACK_MEMBER(h89_state::h89_irq_timer)
{ {
h89_state *state = timer.machine().driver_data<h89_state>();
if (state->m_port_f2 & 0x02) if (m_port_f2 & 0x02)
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xcf); m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xcf);
} }
WRITE8_MEMBER( h89_state::port_f2_w ) WRITE8_MEMBER( h89_state::port_f2_w )
@ -149,7 +149,7 @@ static MACHINE_CONFIG_START( h89, h89_state )
MCFG_SERIAL_TERMINAL_ADD(TERMINAL_TAG, terminal_intf, 9600) MCFG_SERIAL_TERMINAL_ADD(TERMINAL_TAG, terminal_intf, 9600)
MCFG_TIMER_ADD_PERIODIC("irq_timer", h89_irq_timer, attotime::from_hz(100)) MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", h89_state, h89_irq_timer, attotime::from_hz(100))
MACHINE_CONFIG_END MACHINE_CONFIG_END
/* ROM definition */ /* ROM definition */

View File

@ -97,6 +97,7 @@ public:
DECLARE_DRIVER_INIT(iq151); DECLARE_DRIVER_INIT(iq151);
INTERRUPT_GEN_MEMBER(iq151_vblank_interrupt); INTERRUPT_GEN_MEMBER(iq151_vblank_interrupt);
DECLARE_INPUT_CHANGED_MEMBER(iq151_break); DECLARE_INPUT_CHANGED_MEMBER(iq151_break);
TIMER_DEVICE_CALLBACK_MEMBER(cassette_timer);
}; };
READ8_MEMBER(iq151_state::keyboard_row_r) READ8_MEMBER(iq151_state::keyboard_row_r)
@ -334,13 +335,12 @@ static IRQ_CALLBACK(iq151_irq_callback)
return pic8259_acknowledge(state->m_pic); return pic8259_acknowledge(state->m_pic);
} }
static TIMER_DEVICE_CALLBACK( cassette_timer ) TIMER_DEVICE_CALLBACK_MEMBER(iq151_state::cassette_timer)
{ {
iq151_state *state = timer.machine().driver_data<iq151_state>();
state->m_cassette_clk ^= 1; m_cassette_clk ^= 1;
state->m_cassette->output((state->m_cassette_data & 1) ^ (state->m_cassette_clk & 1) ? +1 : -1); m_cassette->output((m_cassette_data & 1) ^ (m_cassette_clk & 1) ? +1 : -1);
} }
DRIVER_INIT_MEMBER(iq151_state,iq151) DRIVER_INIT_MEMBER(iq151_state,iq151)
@ -457,7 +457,7 @@ static MACHINE_CONFIG_START( iq151, iq151_state )
MCFG_I8255_ADD("ppi8255", iq151_ppi8255_intf) MCFG_I8255_ADD("ppi8255", iq151_ppi8255_intf)
MCFG_CASSETTE_ADD( CASSETTE_TAG, iq151_cassette_interface ) MCFG_CASSETTE_ADD( CASSETTE_TAG, iq151_cassette_interface )
MCFG_TIMER_ADD_PERIODIC("cassette_timer", cassette_timer, attotime::from_hz(2000)) MCFG_TIMER_DRIVER_ADD_PERIODIC("cassette_timer", iq151_state, cassette_timer, attotime::from_hz(2000))
/* cartridge */ /* cartridge */
MCFG_IQ151_CARTRIDGE_ADD("slot1", iq151_cart_interface, iq151_cart, NULL, NULL) MCFG_IQ151_CARTRIDGE_ADD("slot1", iq151_cart_interface, iq151_cart, NULL, NULL)

View File

@ -43,6 +43,7 @@ public:
virtual void machine_reset(); virtual void machine_reset();
virtual void video_start(); virtual void video_start();
UINT32 screen_update_jr100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_jr100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(sound_tick);
}; };
@ -279,15 +280,14 @@ static const cassette_interface jr100_cassette_interface =
NULL NULL
}; };
static TIMER_DEVICE_CALLBACK( sound_tick ) TIMER_DEVICE_CALLBACK_MEMBER(jr100_state::sound_tick)
{ {
jr100_state *state = timer.machine().driver_data<jr100_state>(); device_t *speaker = machine().device(SPEAKER_TAG);
device_t *speaker = timer.machine().device(SPEAKER_TAG); speaker_level_w(speaker,m_speaker);
speaker_level_w(speaker,state->m_speaker); m_speaker = 0;
state->m_speaker = 0;
via6522_device *via = timer.machine().device<via6522_device>("via"); via6522_device *via = machine().device<via6522_device>("via");
double level = (timer.machine().device<cassette_image_device>(CASSETTE_TAG)->input()); double level = (machine().device<cassette_image_device>(CASSETTE_TAG)->input());
if (level > 0.0) { if (level > 0.0) {
via->write_ca1(0); via->write_ca1(0);
via->write_cb1(0); via->write_cb1(0);
@ -385,7 +385,7 @@ static MACHINE_CONFIG_START( jr100, jr100_state )
MCFG_CASSETTE_ADD( CASSETTE_TAG, jr100_cassette_interface ) MCFG_CASSETTE_ADD( CASSETTE_TAG, jr100_cassette_interface )
MCFG_TIMER_ADD_PERIODIC("sound_tick", sound_tick, attotime::from_hz(XTAL_14_31818MHz / 16)) MCFG_TIMER_DRIVER_ADD_PERIODIC("sound_tick", jr100_state, sound_tick, attotime::from_hz(XTAL_14_31818MHz / 16))
/* quickload */ /* quickload */
MCFG_QUICKLOAD_ADD("quickload", jr100, "prg", 2) MCFG_QUICKLOAD_ADD("quickload", jr100, "prg", 2)

View File

@ -48,6 +48,7 @@ public:
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
DECLARE_INPUT_CHANGED_MEMBER(junior_reset); DECLARE_INPUT_CHANGED_MEMBER(junior_reset);
TIMER_DEVICE_CALLBACK_MEMBER(junior_update_leds);
}; };
@ -192,15 +193,14 @@ static const riot6532_interface junior_riot_interface =
}; };
static TIMER_DEVICE_CALLBACK( junior_update_leds ) TIMER_DEVICE_CALLBACK_MEMBER(junior_state::junior_update_leds)
{ {
junior_state *state = timer.machine().driver_data<junior_state>();
int i; int i;
for ( i = 0; i < 6; i++ ) for ( i = 0; i < 6; i++ )
{ {
if ( state->m_led_time[i] ) if ( m_led_time[i] )
state->m_led_time[i]--; m_led_time[i]--;
else else
output_set_digit_value( i, 0 ); output_set_digit_value( i, 0 );
} }
@ -235,7 +235,7 @@ static MACHINE_CONFIG_START( junior, junior_state )
/* Devices */ /* Devices */
MCFG_RIOT6532_ADD("riot", XTAL_1MHz, junior_riot_interface) MCFG_RIOT6532_ADD("riot", XTAL_1MHz, junior_riot_interface)
MCFG_TIMER_ADD_PERIODIC("led_timer", junior_update_leds, attotime::from_hz(50)) MCFG_TIMER_DRIVER_ADD_PERIODIC("led_timer", junior_state, junior_update_leds, attotime::from_hz(50))
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -124,6 +124,8 @@ public:
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
DECLARE_INPUT_CHANGED_MEMBER(kim1_reset); DECLARE_INPUT_CHANGED_MEMBER(kim1_reset);
TIMER_DEVICE_CALLBACK_MEMBER(kim1_cassette_input);
TIMER_DEVICE_CALLBACK_MEMBER(kim1_update_leds);
}; };
@ -265,34 +267,32 @@ static MOS6530_INTERFACE( kim1_u3_mos6530_interface )
}; };
static TIMER_DEVICE_CALLBACK( kim1_cassette_input ) TIMER_DEVICE_CALLBACK_MEMBER(kim1_state::kim1_cassette_input)
{ {
kim1_state *state = timer.machine().driver_data<kim1_state>(); double tap_val = m_cass->input();
double tap_val = state->m_cass->input();
if ( tap_val <= 0 ) if ( tap_val <= 0 )
{ {
if ( state->m_cassette_high_count ) if ( m_cassette_high_count )
{ {
state->m_311_output = ( state->m_cassette_high_count < 8 ) ? 0x80 : 0; m_311_output = ( m_cassette_high_count < 8 ) ? 0x80 : 0;
state->m_cassette_high_count = 0; m_cassette_high_count = 0;
} }
} }
if ( tap_val > 0 ) if ( tap_val > 0 )
state->m_cassette_high_count++; m_cassette_high_count++;
} }
static TIMER_DEVICE_CALLBACK( kim1_update_leds ) TIMER_DEVICE_CALLBACK_MEMBER(kim1_state::kim1_update_leds)
{ {
kim1_state *state = timer.machine().driver_data<kim1_state>();
UINT8 i; UINT8 i;
for ( i = 0; i < 6; i++ ) for ( i = 0; i < 6; i++ )
{ {
if ( state->m_led_time[i] ) if ( m_led_time[i] )
state->m_led_time[i]--; m_led_time[i]--;
else else
output_set_digit_value( i, 0 ); output_set_digit_value( i, 0 );
} }
@ -348,8 +348,8 @@ static MACHINE_CONFIG_START( kim1, kim1_state )
MCFG_MOS6530_ADD( "miot_u2", 1000000, kim1_u2_mos6530_interface ) MCFG_MOS6530_ADD( "miot_u2", 1000000, kim1_u2_mos6530_interface )
MCFG_MOS6530_ADD( "miot_u3", 1000000, kim1_u3_mos6530_interface ) MCFG_MOS6530_ADD( "miot_u3", 1000000, kim1_u3_mos6530_interface )
MCFG_CASSETTE_ADD( CASSETTE_TAG, kim1_cassette_interface ) MCFG_CASSETTE_ADD( CASSETTE_TAG, kim1_cassette_interface )
MCFG_TIMER_ADD_PERIODIC("led_timer", kim1_update_leds, attotime::from_hz(60)) MCFG_TIMER_DRIVER_ADD_PERIODIC("led_timer", kim1_state, kim1_update_leds, attotime::from_hz(60))
MCFG_TIMER_ADD_PERIODIC("cassette_timer", kim1_cassette_input, attotime::from_hz(44100)) MCFG_TIMER_DRIVER_ADD_PERIODIC("cassette_timer", kim1_state, kim1_cassette_input, attotime::from_hz(44100))
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -75,6 +75,7 @@ public:
DECLARE_WRITE8_MEMBER( mc10_port2_w ); DECLARE_WRITE8_MEMBER( mc10_port2_w );
DECLARE_READ8_MEMBER( mc10_mc6847_videoram_r ); DECLARE_READ8_MEMBER( mc10_mc6847_videoram_r );
DECLARE_DRIVER_INIT(mc10); DECLARE_DRIVER_INIT(mc10);
TIMER_DEVICE_CALLBACK_MEMBER(alice32_scanline);
}; };
@ -223,11 +224,10 @@ READ8_MEMBER( mc10_state::mc10_mc6847_videoram_r )
return m_ram_base[offset]; return m_ram_base[offset];
} }
static TIMER_DEVICE_CALLBACK( alice32_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(mc10_state::alice32_scanline)
{ {
mc10_state *state = timer.machine().driver_data<mc10_state>();
state->m_ef9345->update_scanline((UINT16)param); m_ef9345->update_scanline((UINT16)param);
} }
/*************************************************************************** /***************************************************************************
@ -551,7 +551,7 @@ static MACHINE_CONFIG_START( alice32, mc10_state )
MCFG_PALETTE_LENGTH(8) MCFG_PALETTE_LENGTH(8)
MCFG_EF9345_ADD("ef9345", alice32_ef9345_config) MCFG_EF9345_ADD("ef9345", alice32_ef9345_config)
MCFG_TIMER_ADD_SCANLINE("alice32_sl", alice32_scanline, "screen", 0, 10) MCFG_TIMER_DRIVER_ADD_SCANLINE("alice32_sl", mc10_state, alice32_scanline, "screen", 0, 10)
/* sound hardware */ /* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SPEAKER_STANDARD_MONO("mono")

View File

@ -93,6 +93,9 @@ public:
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
DECLARE_MACHINE_START(mm2); DECLARE_MACHINE_START(mm2);
TIMER_DEVICE_CALLBACK_MEMBER(update_nmi);
TIMER_DEVICE_CALLBACK_MEMBER(update_nmi_r5);
TIMER_DEVICE_CALLBACK_MEMBER(update_irq);
}; };
@ -330,31 +333,28 @@ static INPUT_PORTS_START( mephisto )
INPUT_PORTS_END INPUT_PORTS_END
static TIMER_DEVICE_CALLBACK( update_nmi ) TIMER_DEVICE_CALLBACK_MEMBER(mephisto_state::update_nmi)
{ {
mephisto_state *state = timer.machine().driver_data<mephisto_state>(); if (m_allowNMI)
if (state->m_allowNMI)
{ {
state->m_allowNMI = 0; m_allowNMI = 0;
timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE); machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE);
} }
beep_set_state(state->m_beep, state->m_led_status&64?1:0); beep_set_state(m_beep, m_led_status&64?1:0);
} }
static TIMER_DEVICE_CALLBACK( update_nmi_r5 ) TIMER_DEVICE_CALLBACK_MEMBER(mephisto_state::update_nmi_r5)
{ {
mephisto_state *state = timer.machine().driver_data<mephisto_state>(); machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE);
timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE); beep_set_state(m_beep, m_led_status&64?1:0);
beep_set_state(state->m_beep, state->m_led_status&64?1:0);
} }
static TIMER_DEVICE_CALLBACK( update_irq ) //only mm2 TIMER_DEVICE_CALLBACK_MEMBER(mephisto_state::update_irq)//only mm2
{ {
mephisto_state *state = timer.machine().driver_data<mephisto_state>(); machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE);
timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE);
beep_set_state(state->m_beep, state->m_led_status&64?1:0); beep_set_state(m_beep, m_led_status&64?1:0);
} }
void mephisto_state::machine_start() void mephisto_state::machine_start()
@ -410,7 +410,7 @@ static MACHINE_CONFIG_START( mephisto, mephisto_state )
MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_TIMER_ADD_PERIODIC("nmi_timer", update_nmi, attotime::from_hz(600)) MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", mephisto_state, update_nmi, attotime::from_hz(600))
MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -419,7 +419,7 @@ static MACHINE_CONFIG_DERIVED( rebel5, mephisto )
MCFG_CPU_MODIFY("maincpu") MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(rebel5_mem) MCFG_CPU_PROGRAM_MAP(rebel5_mem)
MCFG_DEVICE_REMOVE("nmi_timer") MCFG_DEVICE_REMOVE("nmi_timer")
MCFG_TIMER_ADD_PERIODIC("nmi_timer_r5", update_nmi_r5, attotime::from_hz(600)) MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer_r5", mephisto_state, update_nmi_r5, attotime::from_hz(600))
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -429,7 +429,7 @@ static MACHINE_CONFIG_DERIVED( mm2, mephisto )
MCFG_MACHINE_START_OVERRIDE(mephisto_state, mm2 ) MCFG_MACHINE_START_OVERRIDE(mephisto_state, mm2 )
MCFG_DEVICE_REMOVE("nmi_timer") MCFG_DEVICE_REMOVE("nmi_timer")
MCFG_TIMER_ADD_PERIODIC("irq_timer", update_irq, attotime::from_hz(450)) MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", mephisto_state, update_irq, attotime::from_hz(450))
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mm4tk, mephisto ) static MACHINE_CONFIG_DERIVED( mm4tk, mephisto )

View File

@ -56,6 +56,7 @@ public:
UINT8 m_f8[2]; UINT8 m_f8[2];
UINT8 m_led[4]; UINT8 m_led[4];
virtual void machine_start(); virtual void machine_start();
TIMER_DEVICE_CALLBACK_MEMBER(mk1_update_leds);
}; };
@ -146,16 +147,15 @@ static INPUT_PORTS_START( mk1 )
INPUT_PORTS_END INPUT_PORTS_END
static TIMER_DEVICE_CALLBACK( mk1_update_leds ) TIMER_DEVICE_CALLBACK_MEMBER(mk1_state::mk1_update_leds)
{ {
mk1_state *state = timer.machine().driver_data<mk1_state>();
UINT8 i; UINT8 i;
for ( i = 0; i < 4; i++ ) for ( i = 0; i < 4; i++ )
{ {
output_set_digit_value( i, state->m_led[i] >> 1 ); output_set_digit_value( i, m_led[i] >> 1 );
output_set_led_value( i, state->m_led[i] & 0x01 ); output_set_led_value( i, m_led[i] & 0x01 );
state->m_led[i] = 0; m_led[i] = 0;
} }
} }
@ -192,7 +192,7 @@ static MACHINE_CONFIG_START( mk1, mk1_state )
/* video hardware */ /* video hardware */
MCFG_DEFAULT_LAYOUT( layout_mk1 ) MCFG_DEFAULT_LAYOUT( layout_mk1 )
MCFG_TIMER_ADD_PERIODIC("led_timer", mk1_update_leds, attotime::from_hz(30)) MCFG_TIMER_DRIVER_ADD_PERIODIC("led_timer", mk1_state, mk1_update_leds, attotime::from_hz(30))
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -73,6 +73,7 @@ public:
DECLARE_WRITE8_MEMBER(mk2_write_b); DECLARE_WRITE8_MEMBER(mk2_write_b);
UINT8 m_led[5]; UINT8 m_led[5];
virtual void machine_start(); virtual void machine_start();
TIMER_DEVICE_CALLBACK_MEMBER(update_leds);
}; };
@ -112,20 +113,19 @@ static INPUT_PORTS_START( mk2 )
INPUT_PORTS_END INPUT_PORTS_END
static TIMER_DEVICE_CALLBACK( update_leds ) TIMER_DEVICE_CALLBACK_MEMBER(mk2_state::update_leds)
{ {
mk2_state *state = timer.machine().driver_data<mk2_state>();
int i; int i;
for (i=0; i<4; i++) for (i=0; i<4; i++)
output_set_digit_value(i, state->m_led[i]); output_set_digit_value(i, m_led[i]);
output_set_led_value(0, BIT(state->m_led[4], 3)); output_set_led_value(0, BIT(m_led[4], 3));
output_set_led_value(1, BIT(state->m_led[4], 5)); output_set_led_value(1, BIT(m_led[4], 5));
output_set_led_value(2, BIT(state->m_led[4], 4)); output_set_led_value(2, BIT(m_led[4], 4));
output_set_led_value(3, BIT(state->m_led[4], 4) ? 0 : 1); output_set_led_value(3, BIT(m_led[4], 4) ? 0 : 1);
state->m_led[0]= state->m_led[1]= state->m_led[2]= state->m_led[3]= state->m_led[4]= 0; m_led[0]= m_led[1]= m_led[2]= m_led[3]= m_led[4]= 0;
} }
void mk2_state::machine_start() void mk2_state::machine_start()
@ -207,7 +207,7 @@ static MACHINE_CONFIG_START( mk2, mk2_state )
MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_TIMER_ADD_PERIODIC("led_timer", update_leds, attotime::from_hz(60)) MCFG_TIMER_DRIVER_ADD_PERIODIC("led_timer", mk2_state, update_leds, attotime::from_hz(60))
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -195,6 +195,11 @@ public:
DECLARE_MACHINE_START(risc); DECLARE_MACHINE_START(risc);
DECLARE_MACHINE_RESET(academy); DECLARE_MACHINE_RESET(academy);
DECLARE_PALETTE_INIT(chess_lcd); DECLARE_PALETTE_INIT(chess_lcd);
TIMER_DEVICE_CALLBACK_MEMBER(cause_nmi);
TIMER_DEVICE_CALLBACK_MEMBER(cause_M6502_irq);
TIMER_DEVICE_CALLBACK_MEMBER(timer_update_irq6);
TIMER_DEVICE_CALLBACK_MEMBER(timer_update_irq2);
TIMER_DEVICE_CALLBACK_MEMBER(timer_update_irq_academy);
}; };
static HD44780_INTERFACE( chess_display ) static HD44780_INTERFACE( chess_display )
@ -811,15 +816,15 @@ READ8_MEMBER(polgar_state::read_keys_board_academy)
return data; return data;
} }
static TIMER_DEVICE_CALLBACK( cause_nmi ) TIMER_DEVICE_CALLBACK_MEMBER(polgar_state::cause_nmi)
{ {
timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE); machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE);
} }
static TIMER_DEVICE_CALLBACK( cause_M6502_irq ) TIMER_DEVICE_CALLBACK_MEMBER(polgar_state::cause_M6502_irq)
{ {
timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE);
} }
@ -981,21 +986,21 @@ WRITE32_MEMBER(polgar_state::write_1000000)
logerror("Write to RISC2500 1000000\n"); logerror("Write to RISC2500 1000000\n");
} }
static TIMER_DEVICE_CALLBACK( timer_update_irq6 ) TIMER_DEVICE_CALLBACK_MEMBER(polgar_state::timer_update_irq6)
{ {
timer.machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE);
} }
static TIMER_DEVICE_CALLBACK( timer_update_irq2 ) TIMER_DEVICE_CALLBACK_MEMBER(polgar_state::timer_update_irq2)
{ {
timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
} }
static TIMER_DEVICE_CALLBACK( timer_update_irq_academy ) TIMER_DEVICE_CALLBACK_MEMBER(polgar_state::timer_update_irq_academy)
{ {
if (academyallowNMI) { if (academyallowNMI) {
timer.machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE); machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE);
} }
} }
@ -1560,7 +1565,7 @@ static MACHINE_CONFIG_START( polgar, polgar_state )
MCFG_MACHINE_RESET_OVERRIDE(polgar_state, polgar ) MCFG_MACHINE_RESET_OVERRIDE(polgar_state, polgar )
MCFG_FRAGMENT_ADD( chess_common ) MCFG_FRAGMENT_ADD( chess_common )
MCFG_TIMER_ADD_PERIODIC("irq_timer", cause_nmi, attotime::from_hz(600)) MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", polgar_state, cause_nmi, attotime::from_hz(600))
MCFG_TIMER_START_DELAY(attotime::from_hz(60)) MCFG_TIMER_START_DELAY(attotime::from_hz(60))
MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
@ -1577,7 +1582,7 @@ static MACHINE_CONFIG_START( sfortea, polgar_state )
/* acia */ /* acia */
// MCFG_ACIA6551_ADD("acia65c51") // MCFG_ACIA6551_ADD("acia65c51")
MCFG_TIMER_ADD_PERIODIC("irq_timer", cause_M6502_irq, attotime::from_hz(600)) MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", polgar_state, cause_M6502_irq, attotime::from_hz(600))
MCFG_TIMER_START_DELAY(attotime::from_hz(60)) MCFG_TIMER_START_DELAY(attotime::from_hz(60))
MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -1587,7 +1592,7 @@ static MACHINE_CONFIG_START( alm32, polgar_state )
MCFG_CPU_PROGRAM_MAP(alm32_mem) MCFG_CPU_PROGRAM_MAP(alm32_mem)
MCFG_MACHINE_START_OVERRIDE(polgar_state,van32) MCFG_MACHINE_START_OVERRIDE(polgar_state,van32)
MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16) MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16)
MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(750)) MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(750))
MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120)) MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120))
MCFG_FRAGMENT_ADD( chess_common ) MCFG_FRAGMENT_ADD( chess_common )
@ -1600,7 +1605,7 @@ static MACHINE_CONFIG_DERIVED( academy, polgar )
MCFG_CPU_PROGRAM_MAP(academy_mem) MCFG_CPU_PROGRAM_MAP(academy_mem)
MCFG_MACHINE_RESET_OVERRIDE(polgar_state, academy ) MCFG_MACHINE_RESET_OVERRIDE(polgar_state, academy )
//MCFG_DEVICE_REMOVE("int_timer") //MCFG_DEVICE_REMOVE("int_timer")
MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq_academy, attotime::from_hz(600)) MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq_academy, attotime::from_hz(600))
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -1620,7 +1625,7 @@ static MACHINE_CONFIG_START( monteciv, polgar_state )
MCFG_SOUND_ADD("beep", BEEP, 0) MCFG_SOUND_ADD("beep", BEEP, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_TIMER_ADD_PERIODIC("irq_timer", cause_nmi, attotime::from_hz(600)) MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", polgar_state, cause_nmi, attotime::from_hz(600))
MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -1640,7 +1645,7 @@ static MACHINE_CONFIG_START( diablo68, polgar_state )
/* acia */ /* acia */
// MCFG_ACIA6551_ADD("acia65c51") // MCFG_ACIA6551_ADD("acia65c51")
MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq2, attotime::from_hz(60)) MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq2, attotime::from_hz(60))
MCFG_TIMER_START_DELAY(attotime::from_hz(30)) MCFG_TIMER_START_DELAY(attotime::from_hz(30))
MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120)) MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120))
@ -1652,8 +1657,8 @@ static MACHINE_CONFIG_START( van16, polgar_state )
MCFG_CPU_PROGRAM_MAP(van16_mem) MCFG_CPU_PROGRAM_MAP(van16_mem)
MCFG_MACHINE_START_OVERRIDE(polgar_state,van16) MCFG_MACHINE_START_OVERRIDE(polgar_state,van16)
MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16) MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16)
MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(600)) // chess clock right, diags wrong MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(600))
// MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(587)) // vv MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(587))
MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120)) MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120))
MCFG_FRAGMENT_ADD( chess_common ) MCFG_FRAGMENT_ADD( chess_common )
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")
@ -1670,7 +1675,7 @@ static MACHINE_CONFIG_START( van32, polgar_state )
MCFG_CPU_PROGRAM_MAP(van32_mem) MCFG_CPU_PROGRAM_MAP(van32_mem)
MCFG_MACHINE_START_OVERRIDE(polgar_state,van32) MCFG_MACHINE_START_OVERRIDE(polgar_state,van32)
MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16) MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16)
MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(750)) MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(750))
MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120)) MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120))
MCFG_FRAGMENT_ADD( chess_common ) MCFG_FRAGMENT_ADD( chess_common )
@ -1695,8 +1700,8 @@ static MACHINE_CONFIG_START( gen32, polgar_state )
MCFG_CPU_PROGRAM_MAP(gen32_mem) MCFG_CPU_PROGRAM_MAP(gen32_mem)
MCFG_MACHINE_START_OVERRIDE(polgar_state,van32) MCFG_MACHINE_START_OVERRIDE(polgar_state,van32)
MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16) MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16)
MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(375)) MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(375))
// MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(368.64)) MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(368.64))
MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120)) MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120))
MCFG_FRAGMENT_ADD( chess_common ) MCFG_FRAGMENT_ADD( chess_common )
@ -1709,7 +1714,7 @@ static MACHINE_CONFIG_DERIVED( gen32_oc, gen32 )
MCFG_CPU_MODIFY("maincpu") MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_CLOCK( XTAL_33_333MHz * 2 ) MCFG_CPU_CLOCK( XTAL_33_333MHz * 2 )
MCFG_DEVICE_REMOVE("int_timer") MCFG_DEVICE_REMOVE("int_timer")
MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(500)) MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(500))
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -1719,7 +1724,7 @@ static MACHINE_CONFIG_START( bpl32, polgar_state )
MCFG_CPU_PROGRAM_MAP(bpl32_mem) MCFG_CPU_PROGRAM_MAP(bpl32_mem)
MCFG_MACHINE_START_OVERRIDE(polgar_state,van32) MCFG_MACHINE_START_OVERRIDE(polgar_state,van32)
MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16) MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16)
MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(750)) MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(750))
MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
MCFG_FRAGMENT_ADD( chess_common ) MCFG_FRAGMENT_ADD( chess_common )

View File

@ -88,6 +88,8 @@ public:
virtual void machine_reset(); virtual void machine_reset();
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
virtual void palette_init(); virtual void palette_init();
TIMER_DEVICE_CALLBACK_MEMBER(mstation_1hz_timer);
TIMER_DEVICE_CALLBACK_MEMBER(mstation_kb_timer);
}; };
READ8_MEMBER( mstation_state::flash_0x0000_read_handler ) READ8_MEMBER( mstation_state::flash_0x0000_read_handler )
@ -469,22 +471,20 @@ WRITE_LINE_MEMBER( mstation_state::rtc_irq )
refresh_ints(); refresh_ints();
} }
static TIMER_DEVICE_CALLBACK( mstation_1hz_timer ) TIMER_DEVICE_CALLBACK_MEMBER(mstation_state::mstation_1hz_timer)
{ {
mstation_state *state = timer.machine().driver_data<mstation_state>();
state->m_irq |= (1<<4); m_irq |= (1<<4);
state->refresh_ints(); refresh_ints();
} }
static TIMER_DEVICE_CALLBACK( mstation_kb_timer ) TIMER_DEVICE_CALLBACK_MEMBER(mstation_state::mstation_kb_timer)
{ {
mstation_state *state = timer.machine().driver_data<mstation_state>();
state->m_irq |= (1<<1); m_irq |= (1<<1);
state->refresh_ints(); refresh_ints();
} }
void mstation_state::palette_init() void mstation_state::palette_init()
@ -519,10 +519,10 @@ static MACHINE_CONFIG_START( mstation, mstation_state )
MCFG_AMD_29F080_ADD("flash1") //SST-28SF040 MCFG_AMD_29F080_ADD("flash1") //SST-28SF040
// IRQ 4 is generated every second, used for auto power off // IRQ 4 is generated every second, used for auto power off
MCFG_TIMER_ADD_PERIODIC("1hz_timer", mstation_1hz_timer, attotime::from_hz(1)) MCFG_TIMER_DRIVER_ADD_PERIODIC("1hz_timer", mstation_state, mstation_1hz_timer, attotime::from_hz(1))
// IRQ 1 is used for scan the kb and for cursor blinking // IRQ 1 is used for scan the kb and for cursor blinking
MCFG_TIMER_ADD_PERIODIC("kb_timer", mstation_kb_timer, attotime::from_hz(50)) MCFG_TIMER_DRIVER_ADD_PERIODIC("kb_timer", mstation_state, mstation_kb_timer, attotime::from_hz(50))
MCFG_RP5C01_ADD("rtc", XTAL_32_768kHz, rtc_intf) MCFG_RP5C01_ADD("rtc", XTAL_32_768kHz, rtc_intf)

View File

@ -69,6 +69,7 @@ public:
virtual void video_start(); virtual void video_start();
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_multi8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_multi8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
}; };
#define mc6845_h_char_total (m_crtc_vreg[0]) #define mc6845_h_char_total (m_crtc_vreg[0])
@ -482,24 +483,23 @@ static INPUT_PORTS_START( multi8 )
PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("GRPH") PORT_CODE(KEYCODE_LALT) PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("GRPH") PORT_CODE(KEYCODE_LALT)
INPUT_PORTS_END INPUT_PORTS_END
static TIMER_DEVICE_CALLBACK( keyboard_callback ) TIMER_DEVICE_CALLBACK_MEMBER(multi8_state::keyboard_callback)
{ {
multi8_state *state = timer.machine().driver_data<multi8_state>();
static const char *const portnames[3] = { "key1","key2","key3" }; static const char *const portnames[3] = { "key1","key2","key3" };
int i,port_i,scancode; int i,port_i,scancode;
UINT8 keymod = timer.machine().root_device().ioport("key_modifiers")->read() & 0x1f; UINT8 keymod = machine().root_device().ioport("key_modifiers")->read() & 0x1f;
scancode = 0; scancode = 0;
state->m_shift_press_flag = ((keymod & 0x02) >> 1); m_shift_press_flag = ((keymod & 0x02) >> 1);
for(port_i=0;port_i<3;port_i++) for(port_i=0;port_i<3;port_i++)
{ {
for(i=0;i<32;i++) for(i=0;i<32;i++)
{ {
if((timer.machine().root_device().ioport(portnames[port_i])->read()>>i) & 1) if((machine().root_device().ioport(portnames[port_i])->read()>>i) & 1)
{ {
//key_flag = 1; //key_flag = 1;
if(!state->m_shift_press_flag) // shift not pressed if(!m_shift_press_flag) // shift not pressed
{ {
if(scancode >= 0x41 && scancode < 0x5b) if(scancode >= 0x41 && scancode < 0x5b)
scancode += 0x20; // lowercase scancode += 0x20; // lowercase
@ -521,8 +521,8 @@ static TIMER_DEVICE_CALLBACK( keyboard_callback )
if(scancode == 0x3c) if(scancode == 0x3c)
scancode = 0x3e; scancode = 0x3e;
} }
state->m_keyb_press = scancode; m_keyb_press = scancode;
state->m_keyb_press_flag = 1; m_keyb_press_flag = 1;
return; return;
} }
scancode++; scancode++;
@ -684,7 +684,7 @@ static MACHINE_CONFIG_START( multi8, multi8_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50)
/* Devices */ /* Devices */
MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32)) MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", multi8_state, keyboard_callback, attotime::from_hz(240/32))
MCFG_MC6845_ADD("crtc", H46505, XTAL_3_579545MHz/2, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ MCFG_MC6845_ADD("crtc", H46505, XTAL_3_579545MHz/2, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
MCFG_I8255_ADD( "ppi8255_0", ppi8255_intf_0 ) MCFG_I8255_ADD( "ppi8255_0", ppi8255_intf_0 )
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -110,6 +110,7 @@ public:
virtual void machine_start(); virtual void machine_start();
virtual void video_start(); virtual void video_start();
DECLARE_DRIVER_INIT(mycom); DECLARE_DRIVER_INIT(mycom);
TIMER_DEVICE_CALLBACK_MEMBER(mycom_kbd);
}; };
@ -472,21 +473,20 @@ static const UINT8 mycom_keyval[] = { 0,
0x0d,0x0d,0x38,0x28,0x49,0x69,0x4b,0x6b,0x2c,0x3c,0x39,0x39,0x36,0x36,0x33,0x33,0x12,0x12, 0x0d,0x0d,0x38,0x28,0x49,0x69,0x4b,0x6b,0x2c,0x3c,0x39,0x39,0x36,0x36,0x33,0x33,0x12,0x12,
0x07,0x07,0x39,0x29,0x4f,0x6f,0x4c,0x6c,0x2e,0x3e,0x63,0x63,0x66,0x66,0x61,0x61,0x2f,0x3f }; 0x07,0x07,0x39,0x29,0x4f,0x6f,0x4c,0x6c,0x2e,0x3e,0x63,0x63,0x66,0x66,0x61,0x61,0x2f,0x3f };
static TIMER_DEVICE_CALLBACK( mycom_kbd ) TIMER_DEVICE_CALLBACK_MEMBER(mycom_state::mycom_kbd)
{ {
mycom_state *state = timer.machine().driver_data<mycom_state>();
UINT8 x, y, scancode = 0; UINT8 x, y, scancode = 0;
UINT16 pressed[9]; UINT16 pressed[9];
char kbdrow[3]; char kbdrow[3];
UINT8 modifiers = timer.machine().root_device().ioport("XX")->read(); UINT8 modifiers = machine().root_device().ioport("XX")->read();
UINT8 shift_pressed = (modifiers & 2) >> 1; UINT8 shift_pressed = (modifiers & 2) >> 1;
state->m_keyb_press_flag = 0; m_keyb_press_flag = 0;
/* see what is pressed */ /* see what is pressed */
for (x = 0; x < 9; x++) for (x = 0; x < 9; x++)
{ {
sprintf(kbdrow,"X%d",x); sprintf(kbdrow,"X%d",x);
pressed[x] = (timer.machine().root_device().ioport(kbdrow)->read()); pressed[x] = (machine().root_device().ioport(kbdrow)->read());
} }
/* find what has changed */ /* find what has changed */
@ -500,17 +500,17 @@ static TIMER_DEVICE_CALLBACK( mycom_kbd )
if (BIT(pressed[x], y)) if (BIT(pressed[x], y))
{ {
scancode = ((x + y * 9) << 1) + shift_pressed + 1; scancode = ((x + y * 9) << 1) + shift_pressed + 1;
state->m_keyb_press_flag = 1; m_keyb_press_flag = 1;
state->m_keyb_press = mycom_keyval[scancode]; m_keyb_press = mycom_keyval[scancode];
} }
} }
} }
} }
if (state->m_keyb_press_flag) if (m_keyb_press_flag)
{ {
if (modifiers & 1) state->m_keyb_press &= 0xbf; if (modifiers & 1) m_keyb_press &= 0xbf;
if (modifiers & 4) state->m_keyb_press |= 0x80; if (modifiers & 4) m_keyb_press |= 0x80;
} }
} }
@ -619,7 +619,7 @@ static MACHINE_CONFIG_START( mycom, mycom_state )
MCFG_FD1771_ADD("fdc", wd1771_intf) MCFG_FD1771_ADD("fdc", wd1771_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(mycom_floppy_interface) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(mycom_floppy_interface)
MCFG_TIMER_ADD_PERIODIC("keyboard_timer", mycom_kbd, attotime::from_hz(20)) MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", mycom_state, mycom_kbd, attotime::from_hz(20))
MACHINE_CONFIG_END MACHINE_CONFIG_END
/* ROM definition */ /* ROM definition */

View File

@ -335,6 +335,7 @@ public:
UINT8 *m_bank_base[8]; UINT8 *m_bank_base[8];
virtual void palette_init(); virtual void palette_init();
DECLARE_INPUT_CHANGED_MEMBER(trigger_irq); DECLARE_INPUT_CHANGED_MEMBER(trigger_irq);
TIMER_DEVICE_CALLBACK_MEMBER(kb_timer);
}; };
@ -674,24 +675,23 @@ UINT32 nakajies_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
} }
static TIMER_DEVICE_CALLBACK( kb_timer ) TIMER_DEVICE_CALLBACK_MEMBER(nakajies_state::kb_timer)
{ {
nakajies_state *state = timer.machine().driver_data<nakajies_state>();
if (state->m_matrix > 0x09) if (m_matrix > 0x09)
{ {
// reset the keyboard scan // reset the keyboard scan
state->m_matrix = 0; m_matrix = 0;
state->m_irq_active |= 0x20; m_irq_active |= 0x20;
} }
else else
{ {
// next row // next row
state->m_matrix++; m_matrix++;
state->m_irq_active |= 0x10; m_irq_active |= 0x10;
} }
state->nakajies_update_irqs(timer.machine()); nakajies_update_irqs(machine());
} }
@ -759,7 +759,7 @@ static MACHINE_CONFIG_START( nakajies210, nakajies_state )
/* rtc */ /* rtc */
MCFG_RP5C01_ADD("rtc", XTAL_32_768kHz, rtc_intf) MCFG_RP5C01_ADD("rtc", XTAL_32_768kHz, rtc_intf)
MCFG_TIMER_ADD_PERIODIC("kb_timer", kb_timer, attotime::from_hz(250)) MCFG_TIMER_DRIVER_ADD_PERIODIC("kb_timer", nakajies_state, kb_timer, attotime::from_hz(250))
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( dator3k, nakajies210 ) static MACHINE_CONFIG_DERIVED( dator3k, nakajies210 )

View File

@ -57,6 +57,7 @@ public:
virtual void machine_start(); virtual void machine_start();
virtual void video_start(); virtual void video_start();
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
}; };
@ -348,21 +349,20 @@ static UINT8 row_number(UINT8 code) {
return 0; return 0;
} }
static TIMER_DEVICE_CALLBACK(keyboard_callback) TIMER_DEVICE_CALLBACK_MEMBER(nanos_state::keyboard_callback)
{ {
nanos_state *state = timer.machine().driver_data<nanos_state>();
static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6" }; static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6" };
int i; int i;
UINT8 code; UINT8 code;
UINT8 key_code = 0; UINT8 key_code = 0;
UINT8 shift = timer.machine().root_device().ioport("LINEC")->read() & 0x02 ? 1 : 0; UINT8 shift = machine().root_device().ioport("LINEC")->read() & 0x02 ? 1 : 0;
UINT8 ctrl = timer.machine().root_device().ioport("LINEC")->read() & 0x01 ? 1 : 0; UINT8 ctrl = machine().root_device().ioport("LINEC")->read() & 0x01 ? 1 : 0;
state->m_key_pressed = 0xff; m_key_pressed = 0xff;
for(i = 0; i < 7; i++) for(i = 0; i < 7; i++)
{ {
code = timer.machine().root_device().ioport(keynames[i])->read(); code = machine().root_device().ioport(keynames[i])->read();
if (code != 0) if (code != 0)
{ {
if (i==0 && shift==0) { if (i==0 && shift==0) {
@ -424,11 +424,11 @@ static TIMER_DEVICE_CALLBACK(keyboard_callback)
case 7: key_code = 0x0A; break; // LF case 7: key_code = 0x0A; break; // LF
} }
} }
state->m_last_code = key_code; m_last_code = key_code;
} }
} }
if (key_code==0){ if (key_code==0){
state->m_key_pressed = 0xf7; m_key_pressed = 0xf7;
} }
} }
@ -548,7 +548,7 @@ static MACHINE_CONFIG_START( nanos, nanos_state )
MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("64K") MCFG_RAM_DEFAULT_SIZE("64K")
MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(24000)) MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", nanos_state, keyboard_callback, attotime::from_hz(24000))
MACHINE_CONFIG_END MACHINE_CONFIG_END
/* ROM definition */ /* ROM definition */

View File

@ -71,13 +71,13 @@ public:
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_pasogo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_pasogo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(pasogo_interrupt); INTERRUPT_GEN_MEMBER(pasogo_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(vg230_timer);
}; };
static TIMER_DEVICE_CALLBACK( vg230_timer ) TIMER_DEVICE_CALLBACK_MEMBER(pasogo_state::vg230_timer)
{ {
pasogo_state *state = timer.machine().driver_data<pasogo_state>(); vg230_t *vg230 = &m_vg230;
vg230_t *vg230 = &state->m_vg230;
vg230->rtc.seconds+=1; vg230->rtc.seconds+=1;
if (vg230->rtc.seconds>=60) if (vg230->rtc.seconds>=60)
@ -532,7 +532,7 @@ static MACHINE_CONFIG_START( pasogo, pasogo_state )
MCFG_CARTSLOT_INTERFACE("pasogo_cart") MCFG_CARTSLOT_INTERFACE("pasogo_cart")
MCFG_SOFTWARE_LIST_ADD("cart_list","pasogo") MCFG_SOFTWARE_LIST_ADD("cart_list","pasogo")
MCFG_TIMER_ADD_PERIODIC("vg230_timer", vg230_timer, attotime::from_hz(1)) MCFG_TIMER_DRIVER_ADD_PERIODIC("vg230_timer", pasogo_state, vg230_timer, attotime::from_hz(1))
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -65,6 +65,10 @@ public:
virtual void video_start(); virtual void video_start();
UINT32 screen_update_pc100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_pc100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(pc100_vblank_irq); INTERRUPT_GEN_MEMBER(pc100_vblank_irq);
TIMER_DEVICE_CALLBACK_MEMBER(pc100_600hz_irq);
TIMER_DEVICE_CALLBACK_MEMBER(pc100_100hz_irq);
TIMER_DEVICE_CALLBACK_MEMBER(pc100_50hz_irq);
TIMER_DEVICE_CALLBACK_MEMBER(pc100_10hz_irq);
}; };
void pc100_state::video_start() void pc100_state::video_start()
@ -348,36 +352,32 @@ INTERRUPT_GEN_MEMBER(pc100_state::pc100_vblank_irq)
pic8259_ir4_w(machine().device("pic8259"), 1); pic8259_ir4_w(machine().device("pic8259"), 1);
} }
static TIMER_DEVICE_CALLBACK( pc100_600hz_irq ) TIMER_DEVICE_CALLBACK_MEMBER(pc100_state::pc100_600hz_irq)
{ {
pc100_state *state = timer.machine().driver_data<pc100_state>();
if(state->m_timer_mode == 0) if(m_timer_mode == 0)
pic8259_ir2_w(timer.machine().device("pic8259"), 1); pic8259_ir2_w(machine().device("pic8259"), 1);
} }
static TIMER_DEVICE_CALLBACK( pc100_100hz_irq ) TIMER_DEVICE_CALLBACK_MEMBER(pc100_state::pc100_100hz_irq)
{ {
pc100_state *state = timer.machine().driver_data<pc100_state>();
if(state->m_timer_mode == 1) if(m_timer_mode == 1)
pic8259_ir2_w(timer.machine().device("pic8259"), 1); pic8259_ir2_w(machine().device("pic8259"), 1);
} }
static TIMER_DEVICE_CALLBACK( pc100_50hz_irq ) TIMER_DEVICE_CALLBACK_MEMBER(pc100_state::pc100_50hz_irq)
{ {
pc100_state *state = timer.machine().driver_data<pc100_state>();
if(state->m_timer_mode == 2) if(m_timer_mode == 2)
pic8259_ir2_w(timer.machine().device("pic8259"), 1); pic8259_ir2_w(machine().device("pic8259"), 1);
} }
static TIMER_DEVICE_CALLBACK( pc100_10hz_irq ) TIMER_DEVICE_CALLBACK_MEMBER(pc100_state::pc100_10hz_irq)
{ {
pc100_state *state = timer.machine().driver_data<pc100_state>();
if(state->m_timer_mode == 3) if(m_timer_mode == 3)
pic8259_ir2_w(timer.machine().device("pic8259"), 1); pic8259_ir2_w(machine().device("pic8259"), 1);
} }
#define MASTER_CLOCK 6988800 #define MASTER_CLOCK 6988800
@ -401,10 +401,10 @@ static MACHINE_CONFIG_START( pc100, pc100_state )
MCFG_PALETTE_LENGTH(16) MCFG_PALETTE_LENGTH(16)
// MCFG_PALETTE_INIT(black_and_white) // MCFG_PALETTE_INIT(black_and_white)
MCFG_TIMER_ADD_PERIODIC("600hz", pc100_600hz_irq, attotime::from_hz(MASTER_CLOCK/600)) MCFG_TIMER_DRIVER_ADD_PERIODIC("600hz", pc100_state, pc100_600hz_irq, attotime::from_hz(MASTER_CLOCK/600))
MCFG_TIMER_ADD_PERIODIC("100hz", pc100_100hz_irq, attotime::from_hz(MASTER_CLOCK/100)) MCFG_TIMER_DRIVER_ADD_PERIODIC("100hz", pc100_state, pc100_100hz_irq, attotime::from_hz(MASTER_CLOCK/100))
MCFG_TIMER_ADD_PERIODIC("50hz", pc100_50hz_irq, attotime::from_hz(MASTER_CLOCK/50)) MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", pc100_state, pc100_50hz_irq, attotime::from_hz(MASTER_CLOCK/50))
MCFG_TIMER_ADD_PERIODIC("10hz", pc100_10hz_irq, attotime::from_hz(MASTER_CLOCK/10)) MCFG_TIMER_DRIVER_ADD_PERIODIC("10hz", pc100_state, pc100_10hz_irq, attotime::from_hz(MASTER_CLOCK/10))
MCFG_I8255_ADD( "ppi8255_2", pc100_ppi8255_interface_2 ) MCFG_I8255_ADD( "ppi8255_2", pc100_ppi8255_interface_2 )
MCFG_PIC8259_ADD( "pic8259", pc100_pic8259_config ) MCFG_PIC8259_ADD( "pic8259", pc100_pic8259_config )
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -236,6 +236,8 @@ public:
INTERRUPT_GEN_MEMBER(pc6001_interrupt); INTERRUPT_GEN_MEMBER(pc6001_interrupt);
INTERRUPT_GEN_MEMBER(pc6001sr_interrupt); INTERRUPT_GEN_MEMBER(pc6001sr_interrupt);
TIMER_CALLBACK_MEMBER(audio_callback); TIMER_CALLBACK_MEMBER(audio_callback);
TIMER_DEVICE_CALLBACK_MEMBER(cassette_callback);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
}; };
@ -2021,80 +2023,78 @@ static UINT8 check_joy_press(running_machine &machine)
return joy_press; return joy_press;
} }
static TIMER_DEVICE_CALLBACK(cassette_callback) TIMER_DEVICE_CALLBACK_MEMBER(pc6001_state::cassette_callback)
{ {
pc6001_state *state = timer.machine().driver_data<pc6001_state>(); if(m_cas_switch == 1)
if(state->m_cas_switch == 1)
{ {
#if 0 #if 0
static UINT8 cas_data_i = 0x80,cas_data_poll; static UINT8 cas_data_i = 0x80,cas_data_poll;
//state->m_cur_keycode = gfx_data[state->m_cas_offset++]; //m_cur_keycode = gfx_data[m_cas_offset++];
if((timer.machine().device<cassette_image_device>(CASSETTE_TAG))->input() > 0.03) if((machine().device<cassette_image_device>(CASSETTE_TAG))->input() > 0.03)
cas_data_poll|= cas_data_i; cas_data_poll|= cas_data_i;
else else
cas_data_poll&=~cas_data_i; cas_data_poll&=~cas_data_i;
if(cas_data_i == 1) if(cas_data_i == 1)
{ {
state->m_cur_keycode = cas_data_poll; m_cur_keycode = cas_data_poll;
cas_data_i = 0x80; cas_data_i = 0x80;
/* data ready, poll irq */ /* data ready, poll irq */
state->m_irq_vector = 0x08; m_irq_vector = 0x08;
timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
} }
else else
cas_data_i>>=1; cas_data_i>>=1;
#else #else
UINT8 *cas_data = timer.machine().root_device().memregion("cas")->base(); UINT8 *cas_data = machine().root_device().memregion("cas")->base();
state->m_cur_keycode = cas_data[state->m_cas_offset++]; m_cur_keycode = cas_data[m_cas_offset++];
popmessage("%04x %04x",state->m_cas_offset,state->m_cas_maxsize); popmessage("%04x %04x",m_cas_offset,m_cas_maxsize);
if(state->m_cas_offset > state->m_cas_maxsize) if(m_cas_offset > m_cas_maxsize)
{ {
state->m_cas_offset = 0; m_cas_offset = 0;
state->m_cas_switch = 0; m_cas_switch = 0;
if(IRQ_LOG) printf("Tape-E IRQ 0x12\n"); if(IRQ_LOG) printf("Tape-E IRQ 0x12\n");
state->m_irq_vector = 0x12; m_irq_vector = 0x12;
timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
} }
else else
{ {
if(IRQ_LOG) printf("Tape-D IRQ 0x08\n"); if(IRQ_LOG) printf("Tape-D IRQ 0x08\n");
state->m_irq_vector = 0x08; m_irq_vector = 0x08;
timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
} }
#endif #endif
} }
} }
static TIMER_DEVICE_CALLBACK(keyboard_callback) TIMER_DEVICE_CALLBACK_MEMBER(pc6001_state::keyboard_callback)
{ {
pc6001_state *state = timer.machine().driver_data<pc6001_state>(); address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
address_space &space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM); UINT32 key1 = machine().root_device().ioport("key1")->read();
UINT32 key1 = timer.machine().root_device().ioport("key1")->read(); UINT32 key2 = machine().root_device().ioport("key2")->read();
UINT32 key2 = timer.machine().root_device().ioport("key2")->read(); UINT32 key3 = machine().root_device().ioport("key3")->read();
UINT32 key3 = timer.machine().root_device().ioport("key3")->read(); // UINT8 p1_key = machine().root_device().ioport("P1")->read();
// UINT8 p1_key = timer.machine().root_device().ioport("P1")->read();
if(state->m_cas_switch == 0) if(m_cas_switch == 0)
{ {
if((key1 != state->m_old_key1) || (key2 != state->m_old_key2) || (key3 != state->m_old_key3)) if((key1 != m_old_key1) || (key2 != m_old_key2) || (key3 != m_old_key3))
{ {
state->m_cur_keycode = check_keyboard_press(space.machine()); m_cur_keycode = check_keyboard_press(space.machine());
if(IRQ_LOG) printf("KEY IRQ 0x02\n"); if(IRQ_LOG) printf("KEY IRQ 0x02\n");
state->m_irq_vector = 0x02; m_irq_vector = 0x02;
timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
state->m_old_key1 = key1; m_old_key1 = key1;
state->m_old_key2 = key2; m_old_key2 = key2;
state->m_old_key3 = key3; m_old_key3 = key3;
} }
#if 0 #if 0
else /* joypad polling */ else /* joypad polling */
{ {
state->m_cur_keycode = check_joy_press(space.machine()); m_cur_keycode = check_joy_press(space.machine());
if(state->m_cur_keycode) if(m_cur_keycode)
{ {
state->m_irq_vector = 0x16; m_irq_vector = 0x16;
timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
} }
} }
#endif #endif
@ -2368,8 +2368,8 @@ static MACHINE_CONFIG_START( pc6001, pc6001_state )
// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) // MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
/* TODO: accurate timing on this */ /* TODO: accurate timing on this */
MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(250)) MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", pc6001_state, keyboard_callback, attotime::from_hz(250))
MCFG_TIMER_ADD_PERIODIC("cassette_timer", cassette_callback, attotime::from_hz(1200/12)) //1200 bauds / (1 start bit -> 8 data bits -> 3 stop bits) MCFG_TIMER_DRIVER_ADD_PERIODIC("cassette_timer", pc6001_state, cassette_callback, attotime::from_hz(1200/12))
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -453,6 +453,7 @@ public:
DECLARE_MACHINE_RESET(pc8801_cdrom); DECLARE_MACHINE_RESET(pc8801_cdrom);
INTERRUPT_GEN_MEMBER(pc8801_vrtc_irq); INTERRUPT_GEN_MEMBER(pc8801_vrtc_irq);
TIMER_CALLBACK_MEMBER(pc8801fd_upd765_tc_to_zero); TIMER_CALLBACK_MEMBER(pc8801fd_upd765_tc_to_zero);
TIMER_DEVICE_CALLBACK_MEMBER(pc8801_rtc_irq);
}; };
@ -2338,12 +2339,13 @@ static void pc8801_sound_irq( device_t *device, int irq )
pc8801_raise_irq(device->machine(),1<<(4),1); pc8801_raise_irq(device->machine(),1<<(4),1);
} }
static TIMER_DEVICE_CALLBACK( pc8801_rtc_irq ) /*
TIMER_DEVICE_CALLBACK_MEMBER(pc8801_state::pc8801_rtc_irq)
{ {
pc8801_state *state = timer.machine().driver_data<pc8801_state>(); if(m_timer_irq_mask)
if(state->m_timer_irq_mask) pc8801_raise_irq(machine(),1<<(2),1);
pc8801_raise_irq(timer.machine(),1<<(2),1);
} }
*/
INTERRUPT_GEN_MEMBER(pc8801_state::pc8801_vrtc_irq) INTERRUPT_GEN_MEMBER(pc8801_state::pc8801_vrtc_irq)
{ {
@ -2400,14 +2402,13 @@ static void pc8801_sound_irq( device_t *device, int irq )
} }
} }
static TIMER_DEVICE_CALLBACK( pc8801_rtc_irq ) TIMER_DEVICE_CALLBACK_MEMBER(pc8801_state::pc8801_rtc_irq)
{ {
pc8801_state *state = timer.machine().driver_data<pc8801_state>(); if(m_timer_irq_mask && m_i8214_irq_level >= 3)
if(state->m_timer_irq_mask && state->m_i8214_irq_level >= 3)
{ {
state->m_timer_irq_latch = 1; m_timer_irq_latch = 1;
//IRQ_LOG(("timer\n")); //IRQ_LOG(("timer\n"));
timer.machine().device("maincpu")->execute().set_input_line(0,HOLD_LINE); machine().device("maincpu")->execute().set_input_line(0,HOLD_LINE);
} }
} }
@ -2713,7 +2714,7 @@ static MACHINE_CONFIG_START( pc8801, pc8801_state )
MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
MCFG_TIMER_ADD_PERIODIC("rtc_timer", pc8801_rtc_irq, attotime::from_hz(600)) MCFG_TIMER_DRIVER_ADD_PERIODIC("rtc_timer", pc8801_state, pc8801_rtc_irq, attotime::from_hz(600))
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( pc8801fh, pc8801 ) static MACHINE_CONFIG_DERIVED( pc8801fh, pc8801 )

View File

@ -94,6 +94,7 @@ public:
DECLARE_PALETTE_INIT(pce220); DECLARE_PALETTE_INIT(pce220);
DECLARE_INPUT_CHANGED_MEMBER(kb_irq); DECLARE_INPUT_CHANGED_MEMBER(kb_irq);
DECLARE_INPUT_CHANGED_MEMBER(on_irq); DECLARE_INPUT_CHANGED_MEMBER(on_irq);
TIMER_DEVICE_CALLBACK_MEMBER(pce220_timer_callback);
}; };
class pcg850v_state : public pce220_state class pcg850v_state : public pce220_state
@ -900,17 +901,16 @@ void pcg850v_state::machine_reset()
m_lcd_read_mode = 0; m_lcd_read_mode = 0;
} }
static TIMER_DEVICE_CALLBACK(pce220_timer_callback) TIMER_DEVICE_CALLBACK_MEMBER(pce220_state::pce220_timer_callback)
{ {
pce220_state *state = timer.machine().driver_data<pce220_state>();
state->m_timer_status = !state->m_timer_status; m_timer_status = !m_timer_status;
if (state->m_irq_mask & IRQ_FLAG_TIMER) if (m_irq_mask & IRQ_FLAG_TIMER)
{ {
state->m_maincpu->set_input_line(0, HOLD_LINE ); m_maincpu->set_input_line(0, HOLD_LINE );
state->m_irq_flag = (state->m_irq_flag & 0xfb) | (state->m_timer_status<<2); m_irq_flag = (m_irq_flag & 0xfb) | (m_timer_status<<2);
} }
} }
@ -945,7 +945,7 @@ static MACHINE_CONFIG_START( pce220, pce220_state )
MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_TIMER_ADD_PERIODIC("pce220_timer", pce220_timer_callback, attotime::from_msec(468)) MCFG_TIMER_DRIVER_ADD_PERIODIC("pce220_timer", pce220_state, pce220_timer_callback, attotime::from_msec(468))
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")
@ -980,7 +980,7 @@ static MACHINE_CONFIG_START( pcg850v, pcg850v_state )
MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_TIMER_ADD_PERIODIC("pce220_timer", pce220_timer_callback, attotime::from_msec(468)) MCFG_TIMER_DRIVER_ADD_PERIODIC("pce220_timer", pce220_state, pce220_timer_callback, attotime::from_msec(468))
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")

View File

@ -81,11 +81,12 @@ public:
virtual void video_start(); virtual void video_start();
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_DRIVER_INIT(pegasus); DECLARE_DRIVER_INIT(pegasus);
TIMER_DEVICE_CALLBACK_MEMBER(pegasus_firq);
}; };
static TIMER_DEVICE_CALLBACK( pegasus_firq ) TIMER_DEVICE_CALLBACK_MEMBER(pegasus_state::pegasus_firq)
{ {
device_t *cpu = timer.machine().device( "maincpu" ); device_t *cpu = machine().device( "maincpu" );
cpu->execute().set_input_line(M6809_FIRQ_LINE, HOLD_LINE); cpu->execute().set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
} }
@ -494,7 +495,7 @@ static MACHINE_CONFIG_START( pegasus, pegasus_state )
MCFG_CPU_ADD("maincpu", M6809E, XTAL_4MHz) // actually a 6809C - 4MHZ clock coming in, 1MHZ internally MCFG_CPU_ADD("maincpu", M6809E, XTAL_4MHz) // actually a 6809C - 4MHZ clock coming in, 1MHZ internally
MCFG_CPU_PROGRAM_MAP(pegasus_mem) MCFG_CPU_PROGRAM_MAP(pegasus_mem)
MCFG_TIMER_ADD_PERIODIC("pegasus_firq", pegasus_firq, attotime::from_hz(400)) // controls accuracy of the clock (ctrl-P) MCFG_TIMER_DRIVER_ADD_PERIODIC("pegasus_firq", pegasus_state, pegasus_firq, attotime::from_hz(400))
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -111,6 +111,7 @@ public:
DECLARE_READ8_MEMBER( mouse_r ); DECLARE_READ8_MEMBER( mouse_r );
DECLARE_WRITE8_MEMBER( mouse_w ); DECLARE_WRITE8_MEMBER( mouse_w );
virtual void palette_init(); virtual void palette_init();
TIMER_DEVICE_CALLBACK_MEMBER(irq_timer);
}; };
@ -469,9 +470,9 @@ UINT32 prestige_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
return 0; return 0;
} }
static TIMER_DEVICE_CALLBACK( irq_timer ) TIMER_DEVICE_CALLBACK_MEMBER(prestige_state::irq_timer)
{ {
timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
} }
static MACHINE_CONFIG_START( prestige, prestige_state ) static MACHINE_CONFIG_START( prestige, prestige_state )
@ -480,7 +481,7 @@ static MACHINE_CONFIG_START( prestige, prestige_state )
MCFG_CPU_PROGRAM_MAP(prestige_mem) MCFG_CPU_PROGRAM_MAP(prestige_mem)
MCFG_CPU_IO_MAP(prestige_io) MCFG_CPU_IO_MAP(prestige_io)
MCFG_TIMER_ADD_PERIODIC("irq_timer", irq_timer, attotime::from_msec(10)) MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", prestige_state, irq_timer, attotime::from_msec(10))
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", LCD) MCFG_SCREEN_ADD("screen", LCD)

View File

@ -170,6 +170,8 @@ public:
TIMER_CALLBACK_MEMBER(ext_cassette_read); TIMER_CALLBACK_MEMBER(ext_cassette_read);
TIMER_CALLBACK_MEMBER(transmit_data); TIMER_CALLBACK_MEMBER(transmit_data);
TIMER_CALLBACK_MEMBER(receive_data); TIMER_CALLBACK_MEMBER(receive_data);
TIMER_DEVICE_CALLBACK_MEMBER(frc_tick);
TIMER_DEVICE_CALLBACK_MEMBER(upd7508_1sec_callback);
}; };
@ -344,16 +346,15 @@ TIMER_CALLBACK_MEMBER(px4_state::ext_cassette_read)
} }
/* free running counter */ /* free running counter */
static TIMER_DEVICE_CALLBACK( frc_tick ) TIMER_DEVICE_CALLBACK_MEMBER(px4_state::frc_tick)
{ {
px4_state *px4 = timer.machine().driver_data<px4_state>();
px4->m_frc_value++; m_frc_value++;
if (px4->m_frc_value == 0) if (m_frc_value == 0)
{ {
px4->m_isr |= INT3_OVF; m_isr |= INT3_OVF;
gapnit_interrupt(timer.machine()); gapnit_interrupt(machine());
} }
} }
@ -919,18 +920,17 @@ WRITE8_MEMBER(px4_state::px4_ioctlr_w)
7508 RELATED 7508 RELATED
***************************************************************************/ ***************************************************************************/
static TIMER_DEVICE_CALLBACK( upd7508_1sec_callback ) TIMER_DEVICE_CALLBACK_MEMBER(px4_state::upd7508_1sec_callback)
{ {
px4_state *px4 = timer.machine().driver_data<px4_state>();
/* adjust interrupt status */ /* adjust interrupt status */
px4->m_interrupt_status |= UPD7508_INT_ONE_SECOND; m_interrupt_status |= UPD7508_INT_ONE_SECOND;
/* are interrupts enabled? */ /* are interrupts enabled? */
if (px4->m_one_sec_int_enabled) if (m_one_sec_int_enabled)
{ {
px4->m_isr |= INT0_7508; m_isr |= INT0_7508;
gapnit_interrupt(timer.machine()); gapnit_interrupt(machine());
} }
} }
@ -1376,8 +1376,8 @@ static MACHINE_CONFIG_START( px4, px4_state )
MCFG_PALETTE_LENGTH(2) MCFG_PALETTE_LENGTH(2)
MCFG_TIMER_ADD_PERIODIC("one_sec", upd7508_1sec_callback, attotime::from_seconds(1)) MCFG_TIMER_DRIVER_ADD_PERIODIC("one_sec", px4_state, upd7508_1sec_callback, attotime::from_seconds(1))
MCFG_TIMER_ADD_PERIODIC("frc", frc_tick, attotime::from_hz(XTAL_7_3728MHz / 2 / 6)) MCFG_TIMER_DRIVER_ADD_PERIODIC("frc", px4_state, frc_tick, attotime::from_hz(XTAL_7_3728MHz / 2 / 6))
/* internal ram */ /* internal ram */
MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_ADD(RAM_TAG)

View File

@ -133,6 +133,7 @@ private:
public: public:
UINT32 screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_irq); INTERRUPT_GEN_MEMBER(vblank_irq);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
}; };
void rainbow_state::machine_start() void rainbow_state::machine_start()
@ -390,12 +391,11 @@ WRITE_LINE_MEMBER(rainbow_state::kbd_txready_w)
update_kbd_irq(); update_kbd_irq();
} }
static TIMER_DEVICE_CALLBACK( keyboard_tick ) TIMER_DEVICE_CALLBACK_MEMBER(rainbow_state::keyboard_tick)
{ {
rainbow_state *state = timer.machine().driver_data<rainbow_state>();
state->m_kbd8251->transmit_clock(); m_kbd8251->transmit_clock();
state->m_kbd8251->receive_clock(); m_kbd8251->receive_clock();
} }
static const vt_video_interface video_interface = static const vt_video_interface video_interface =
@ -488,7 +488,7 @@ static MACHINE_CONFIG_START( rainbow, rainbow_state )
MCFG_SOFTWARE_LIST_ADD("flop_list","rainbow") MCFG_SOFTWARE_LIST_ADD("flop_list","rainbow")
MCFG_I8251_ADD("kbdser", i8251_intf) MCFG_I8251_ADD("kbdser", i8251_intf)
MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, attotime::from_hz(4800)) MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", rainbow_state, keyboard_tick, attotime::from_hz(4800))
MCFG_LK201_ADD() MCFG_LK201_ADD()
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -116,6 +116,9 @@ public:
UINT8 identify_bank_type(UINT32 bank); UINT8 identify_bank_type(UINT32 bank);
virtual void palette_init(); virtual void palette_init();
DECLARE_INPUT_CHANGED_MEMBER(trigger_irq); DECLARE_INPUT_CHANGED_MEMBER(trigger_irq);
TIMER_DEVICE_CALLBACK_MEMBER(irq_timer1);
TIMER_DEVICE_CALLBACK_MEMBER(irq_timer2);
TIMER_DEVICE_CALLBACK_MEMBER(sec_timer);
}; };
@ -512,40 +515,37 @@ UINT32 rex6000_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
return 0; return 0;
} }
static TIMER_DEVICE_CALLBACK( irq_timer1 ) TIMER_DEVICE_CALLBACK_MEMBER(rex6000_state::irq_timer1)
{ {
rex6000_state *state = timer.machine().driver_data<rex6000_state>();
if (!(state->m_irq_mask & IRQ_FLAG_IRQ2)) if (!(m_irq_mask & IRQ_FLAG_IRQ2))
{ {
state->m_irq_flag |= IRQ_FLAG_IRQ2; m_irq_flag |= IRQ_FLAG_IRQ2;
state->m_maincpu->set_input_line(0, HOLD_LINE); m_maincpu->set_input_line(0, HOLD_LINE);
} }
} }
static TIMER_DEVICE_CALLBACK( irq_timer2 ) TIMER_DEVICE_CALLBACK_MEMBER(rex6000_state::irq_timer2)
{ {
rex6000_state *state = timer.machine().driver_data<rex6000_state>();
if (!(state->m_irq_mask & IRQ_FLAG_IRQ1)) if (!(m_irq_mask & IRQ_FLAG_IRQ1))
{ {
state->m_irq_flag |= IRQ_FLAG_IRQ1; m_irq_flag |= IRQ_FLAG_IRQ1;
state->m_maincpu->set_input_line(0, HOLD_LINE); m_maincpu->set_input_line(0, HOLD_LINE);
} }
} }
static TIMER_DEVICE_CALLBACK( sec_timer ) TIMER_DEVICE_CALLBACK_MEMBER(rex6000_state::sec_timer)
{ {
rex6000_state *state = timer.machine().driver_data<rex6000_state>();
if (!(state->m_irq_mask & IRQ_FLAG_1HZ)) if (!(m_irq_mask & IRQ_FLAG_1HZ))
{ {
state->m_irq_flag |= IRQ_FLAG_1HZ; m_irq_flag |= IRQ_FLAG_1HZ;
state->m_maincpu->set_input_line(0, HOLD_LINE); m_maincpu->set_input_line(0, HOLD_LINE);
} }
} }
@ -650,9 +650,9 @@ static MACHINE_CONFIG_START( rex6000, rex6000_state )
MCFG_CPU_PROGRAM_MAP(rex6000_mem) MCFG_CPU_PROGRAM_MAP(rex6000_mem)
MCFG_CPU_IO_MAP(rex6000_io) MCFG_CPU_IO_MAP(rex6000_io)
MCFG_TIMER_ADD_PERIODIC("sec_timer", sec_timer, attotime::from_hz(1)) MCFG_TIMER_DRIVER_ADD_PERIODIC("sec_timer", rex6000_state, sec_timer, attotime::from_hz(1))
MCFG_TIMER_ADD_PERIODIC("irq_timer1", irq_timer1, attotime::from_hz(32)) MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer1", rex6000_state, irq_timer1, attotime::from_hz(32))
MCFG_TIMER_ADD_PERIODIC("irq_timer2", irq_timer2, attotime::from_hz(4096)) MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer2", rex6000_state, irq_timer2, attotime::from_hz(4096))
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", LCD) MCFG_SCREEN_ADD("screen", LCD)

View File

@ -167,6 +167,7 @@ public:
DECLARE_WRITE8_MEMBER(scorpion_port_1ffd_w); DECLARE_WRITE8_MEMBER(scorpion_port_1ffd_w);
DECLARE_MACHINE_START(scorpion); DECLARE_MACHINE_START(scorpion);
DECLARE_MACHINE_RESET(scorpion); DECLARE_MACHINE_RESET(scorpion);
TIMER_DEVICE_CALLBACK_MEMBER(nmi_check_callback);
}; };
/****************************************************************************************************/ /****************************************************************************************************/
@ -272,15 +273,14 @@ DIRECT_UPDATE_MEMBER(scorpion_state::scorpion_direct)
return address; return address;
} }
static TIMER_DEVICE_CALLBACK(nmi_check_callback) TIMER_DEVICE_CALLBACK_MEMBER(scorpion_state::nmi_check_callback)
{ {
spectrum_state *state = timer.machine().driver_data<spectrum_state>();
if ((timer.machine().root_device().ioport("NMI")->read() & 1)==1) if ((machine().root_device().ioport("NMI")->read() & 1)==1)
{ {
state->m_port_1ffd_data |= 0x02; m_port_1ffd_data |= 0x02;
scorpion_update_memory(timer.machine()); scorpion_update_memory(machine());
timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
} }
} }
@ -421,7 +421,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( scorpion, spectrum_128, scorpion_state )
MCFG_RAM_MODIFY(RAM_TAG) MCFG_RAM_MODIFY(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("256K") MCFG_RAM_DEFAULT_SIZE("256K")
MCFG_TIMER_ADD_PERIODIC("nmi_timer", nmi_check_callback, attotime::from_hz(50)) MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", scorpion_state, nmi_check_callback, attotime::from_hz(50))
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( profi, scorpion ) static MACHINE_CONFIG_DERIVED( profi, scorpion )

View File

@ -88,6 +88,7 @@ public:
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(smc777_vblank_irq); INTERRUPT_GEN_MEMBER(smc777_vblank_irq);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
}; };
@ -930,25 +931,24 @@ static const UINT8 smc777_keytable[2][0xa0] =
} }
}; };
static TIMER_DEVICE_CALLBACK( keyboard_callback ) TIMER_DEVICE_CALLBACK_MEMBER(smc777_state::keyboard_callback)
{ {
smc777_state *state = timer.machine().driver_data<smc777_state>();
static const char *const portnames[11] = { "key0","key1","key2","key3","key4","key5","key6","key7", "key8", "key9", "keya" }; static const char *const portnames[11] = { "key0","key1","key2","key3","key4","key5","key6","key7", "key8", "key9", "keya" };
int i,port_i,scancode; int i,port_i,scancode;
UINT8 shift_mod = timer.machine().root_device().ioport("key_mod")->read() & 1; UINT8 shift_mod = machine().root_device().ioport("key_mod")->read() & 1;
UINT8 kana_mod = timer.machine().root_device().ioport("key_mod")->read() & 0x10; UINT8 kana_mod = machine().root_device().ioport("key_mod")->read() & 0x10;
scancode = 0; scancode = 0;
for(port_i=0;port_i<11;port_i++) for(port_i=0;port_i<11;port_i++)
{ {
for(i=0;i<8;i++) for(i=0;i<8;i++)
{ {
if((timer.machine().root_device().ioport(portnames[port_i])->read()>>i) & 1) if((machine().root_device().ioport(portnames[port_i])->read()>>i) & 1)
{ {
state->m_keyb_press = smc777_keytable[shift_mod & 1][scancode]; m_keyb_press = smc777_keytable[shift_mod & 1][scancode];
if(kana_mod) { state->m_keyb_press|=0x80; } if(kana_mod) { m_keyb_press|=0x80; }
state->m_keyb_press_flag = 1; m_keyb_press_flag = 1;
state->m_shift_press_flag = shift_mod & 1; m_shift_press_flag = shift_mod & 1;
return; return;
} }
scancode++; scancode++;
@ -1109,7 +1109,7 @@ static MACHINE_CONFIG_START( smc777, smc777_state )
MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50)
MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32)) MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", smc777_state, keyboard_callback, attotime::from_hz(240/32))
MACHINE_CONFIG_END MACHINE_CONFIG_END
/* ROM definition */ /* ROM definition */

Some files were not shown because too many files have changed in this diff Show More