Some manual cleanup (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2012-09-25 14:46:52 +00:00
parent d8bc866c4a
commit 3f89db06eb
30 changed files with 133 additions and 130 deletions

View File

@ -108,25 +108,24 @@ INLINE int scanline_to_vcount( int scanline )
return (vcount - 0x18) | 0x100; return (vcount - 0x18) | 0x100;
} }
static TIMER_DEVICE_CALLBACK( chinagat_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(ddragon_state::chinagat_scanline)
{ {
ddragon_state *state = timer.machine().driver_data<ddragon_state>();
int scanline = param; int scanline = param;
int screen_height = timer.machine().primary_screen->height(); int screen_height = machine().primary_screen->height();
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1); int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
int vcount = scanline_to_vcount(scanline); int vcount = scanline_to_vcount(scanline);
/* update to the current point */ /* update to the current point */
if (scanline > 0) if (scanline > 0)
timer.machine().primary_screen->update_partial(scanline - 1); machine().primary_screen->update_partial(scanline - 1);
/* on the rising edge of VBLK (vcount == F8), signal an NMI */ /* on the rising edge of VBLK (vcount == F8), signal an NMI */
if (vcount == 0xf8) if (vcount == 0xf8)
state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
/* set 1ms signal on rising edge of vcount & 8 */ /* set 1ms signal on rising edge of vcount & 8 */
if (!(vcount_old & 8) && (vcount & 8)) if (!(vcount_old & 8) && (vcount & 8))
state->m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
/* adjust for next scanline */ /* adjust for next scanline */
if (++scanline >= screen_height) if (++scanline >= screen_height)
@ -571,7 +570,7 @@ static MACHINE_CONFIG_START( chinagat, ddragon_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", HD6309, MAIN_CLOCK / 2) /* 1.5 MHz (12MHz oscillator / 4 internally) */ MCFG_CPU_ADD("maincpu", HD6309, MAIN_CLOCK / 2) /* 1.5 MHz (12MHz oscillator / 4 internally) */
MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", chinagat_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, chinagat_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", HD6309, MAIN_CLOCK / 2) /* 1.5 MHz (12MHz oscillator / 4 internally) */ MCFG_CPU_ADD("sub", HD6309, MAIN_CLOCK / 2) /* 1.5 MHz (12MHz oscillator / 4 internally) */
MCFG_CPU_PROGRAM_MAP(sub_map) MCFG_CPU_PROGRAM_MAP(sub_map)
@ -611,7 +610,7 @@ static MACHINE_CONFIG_START( saiyugoub1, ddragon_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6809, MAIN_CLOCK / 8) /* 68B09EP 1.5 MHz (12MHz oscillator) */ MCFG_CPU_ADD("maincpu", M6809, MAIN_CLOCK / 8) /* 68B09EP 1.5 MHz (12MHz oscillator) */
MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", chinagat_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, chinagat_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", M6809, MAIN_CLOCK / 8) /* 68B09EP 1.5 MHz (12MHz oscillator) */ MCFG_CPU_ADD("sub", M6809, MAIN_CLOCK / 8) /* 68B09EP 1.5 MHz (12MHz oscillator) */
MCFG_CPU_PROGRAM_MAP(sub_map) MCFG_CPU_PROGRAM_MAP(sub_map)
@ -656,7 +655,7 @@ static MACHINE_CONFIG_START( saiyugoub2, ddragon_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6809, MAIN_CLOCK / 8) /* 1.5 MHz (12MHz oscillator) */ MCFG_CPU_ADD("maincpu", M6809, MAIN_CLOCK / 8) /* 1.5 MHz (12MHz oscillator) */
MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", chinagat_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, chinagat_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", M6809, MAIN_CLOCK / 8) /* 1.5 MHz (12MHz oscillator) */ MCFG_CPU_ADD("sub", M6809, MAIN_CLOCK / 8) /* 1.5 MHz (12MHz oscillator) */
MCFG_CPU_PROGRAM_MAP(sub_map) MCFG_CPU_PROGRAM_MAP(sub_map)

View File

@ -621,57 +621,55 @@ Stephh's inputs notes (based on some tests on the "parent" set) :
* *
*************************************/ *************************************/
static TIMER_DEVICE_CALLBACK( cps2_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(cps_state::cps2_interrupt)
{ {
cps_state *state = timer.machine().driver_data<cps_state>();
/* 2 is vblank, 4 is some sort of scanline interrupt, 6 is both at the same time. */ /* 2 is vblank, 4 is some sort of scanline interrupt, 6 is both at the same time. */
if (param == 0) if (param == 0)
state->m_scancalls = 0; m_scancalls = 0;
if (state->m_cps_b_regs[0x10 / 2] & 0x8000) if (m_cps_b_regs[0x10 / 2] & 0x8000)
state->m_cps_b_regs[0x10 / 2] &= 0x1ff; m_cps_b_regs[0x10 / 2] &= 0x1ff;
if (state->m_cps_b_regs[0x12 / 2] & 0x8000) if (m_cps_b_regs[0x12 / 2] & 0x8000)
state->m_cps_b_regs[0x12 / 2] &= 0x1ff; m_cps_b_regs[0x12 / 2] &= 0x1ff;
// popmessage("%04x %04x - %04x %04x",state->m_scanline1,state->m_scanline2,state->m_cps_b_regs[0x10/2],state->m_cps_b_regs[0x12/2]); // popmessage("%04x %04x - %04x %04x",m_scanline1,m_scanline2,m_cps_b_regs[0x10/2],m_cps_b_regs[0x12/2]);
/* raster effects */ /* raster effects */
if (state->m_scanline1 == param || (state->m_scanline1 < param && !state->m_scancalls)) if (m_scanline1 == param || (m_scanline1 < param && !m_scancalls))
{ {
state->m_cps_b_regs[0x10/2] = 0; m_cps_b_regs[0x10/2] = 0;
state->m_maincpu->set_input_line(4, HOLD_LINE); m_maincpu->set_input_line(4, HOLD_LINE);
cps2_set_sprite_priorities(timer.machine()); cps2_set_sprite_priorities(timer.machine());
timer.machine().primary_screen->update_partial(param); timer.machine().primary_screen->update_partial(param);
state->m_scancalls++; m_scancalls++;
// popmessage("IRQ4 scancounter = %04i", param); // popmessage("IRQ4 scancounter = %04i", param);
} }
/* raster effects */ /* raster effects */
if(state->m_scanline2 == param || (state->m_scanline2 < param && !state->m_scancalls)) if(m_scanline2 == param || (m_scanline2 < param && !m_scancalls))
{ {
state->m_cps_b_regs[0x12 / 2] = 0; m_cps_b_regs[0x12 / 2] = 0;
state->m_maincpu->set_input_line(4, HOLD_LINE); m_maincpu->set_input_line(4, HOLD_LINE);
cps2_set_sprite_priorities(timer.machine()); cps2_set_sprite_priorities(timer.machine());
timer.machine().primary_screen->update_partial(param); timer.machine().primary_screen->update_partial(param);
state->m_scancalls++; m_scancalls++;
// popmessage("IRQ4 scancounter = %04i", param); // popmessage("IRQ4 scancounter = %04i", param);
} }
if (param == 240) /* VBlank */ if (param == 240) /* VBlank */
{ {
state->m_cps_b_regs[0x10 / 2] = state->m_scanline1; m_cps_b_regs[0x10 / 2] = m_scanline1;
state->m_cps_b_regs[0x12 / 2] = state->m_scanline2; m_cps_b_regs[0x12 / 2] = m_scanline2;
state->m_maincpu->set_input_line(2, HOLD_LINE); m_maincpu->set_input_line(2, HOLD_LINE);
if(state->m_scancalls) if(m_scancalls)
{ {
cps2_set_sprite_priorities(timer.machine()); cps2_set_sprite_priorities(timer.machine());
timer.machine().primary_screen->update_partial(256); timer.machine().primary_screen->update_partial(256);
} }
cps2_objram_latch(timer.machine()); cps2_objram_latch(timer.machine());
} }
// popmessage("Raster calls = %i", state->m_scancalls); // popmessage("Raster calls = %i", m_scancalls);
} }
@ -1226,7 +1224,7 @@ static MACHINE_CONFIG_START( cps2, cps_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz) MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)
MCFG_CPU_PROGRAM_MAP(cps2_map) MCFG_CPU_PROGRAM_MAP(cps2_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", cps2_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cps_state, cps2_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 8000000) MCFG_CPU_ADD("audiocpu", Z80, 8000000)
MCFG_CPU_PROGRAM_MAP(qsound_sub_map) MCFG_CPU_PROGRAM_MAP(qsound_sub_map)

View File

@ -8931,22 +8931,21 @@ MACHINE_CONFIG_END
to trigger the blitter irq every frame. to trigger the blitter irq every frame.
*/ */
static TIMER_DEVICE_CALLBACK( mjmyster_irq ) TIMER_DEVICE_CALLBACK_MEMBER(dynax_state::mjmyster_irq)
{ {
dynax_state *state = timer.machine().driver_data<dynax_state>();
int scanline = param; int scanline = param;
/* I haven't found a irq ack register, so I need this kludge to /* I haven't found a irq ack register, so I need this kludge to
make sure I don't lose any interrupt generated by the blitter, make sure I don't lose any interrupt generated by the blitter,
otherwise quizchq would lock up. */ otherwise quizchq would lock up. */
if (downcast<cpu_device *>(state->m_maincpu)->input_state(0)) if (downcast<cpu_device *>(m_maincpu)->input_state(0))
return; return;
if(scanline == 245) if(scanline == 245)
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xf8); m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xf8);
if(scanline == 0) if(scanline == 0)
state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xfa); m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xfa);
} }
static const ay8910_interface mjmyster_ay8910_interface = static const ay8910_interface mjmyster_ay8910_interface =
@ -8985,7 +8984,7 @@ static MACHINE_CONFIG_DERIVED( mjmyster, quizchq )
MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* Verified */ MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* Verified */
MCFG_CPU_PROGRAM_MAP(mjmyster_map) MCFG_CPU_PROGRAM_MAP(mjmyster_map)
MCFG_CPU_IO_MAP(mjmyster_portmap) MCFG_CPU_IO_MAP(mjmyster_portmap)
MCFG_TIMER_ADD_SCANLINE("scantimer", mjmyster_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dynax_state, mjmyster_irq, "screen", 0, 1)
MCFG_DEVICE_MODIFY("rtc") MCFG_DEVICE_MODIFY("rtc")
MCFG_DEVICE_CONFIG(mjmyster_rtc_intf) MCFG_DEVICE_CONFIG(mjmyster_rtc_intf)
@ -9108,7 +9107,7 @@ static MACHINE_CONFIG_DERIVED( mjmyuniv, quizchq )
MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* Verified */ MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* Verified */
MCFG_CPU_PROGRAM_MAP(mjmyster_map) MCFG_CPU_PROGRAM_MAP(mjmyster_map)
MCFG_CPU_IO_MAP(mjmyster_portmap) MCFG_CPU_IO_MAP(mjmyster_portmap)
MCFG_TIMER_ADD_SCANLINE("scantimer", mjmyster_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dynax_state, mjmyster_irq, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(dynax_state,mjmyster) MCFG_MACHINE_START_OVERRIDE(dynax_state,mjmyster)
@ -9128,7 +9127,7 @@ static MACHINE_CONFIG_DERIVED( mjmyornt, quizchq )
MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* Verified */ MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* Verified */
MCFG_CPU_PROGRAM_MAP(quizchq_map) MCFG_CPU_PROGRAM_MAP(quizchq_map)
MCFG_CPU_IO_MAP(mjmyster_portmap) MCFG_CPU_IO_MAP(mjmyster_portmap)
MCFG_TIMER_ADD_SCANLINE("scantimer", mjmyster_irq, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dynax_state, mjmyster_irq, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(dynax_state,mjmyster) MCFG_MACHINE_START_OVERRIDE(dynax_state,mjmyster)

View File

@ -571,7 +571,7 @@ static QS1000_INTERFACE( qs1000_intf )
static MACHINE_CONFIG_START( eolith45, eolith_state ) static MACHINE_CONFIG_START( eolith45, eolith_state )
MCFG_CPU_ADD("maincpu", E132N, 45000000) /* 45 MHz */ MCFG_CPU_ADD("maincpu", E132N, 45000000) /* 45 MHz */
MCFG_CPU_PROGRAM_MAP(eolith_map) MCFG_CPU_PROGRAM_MAP(eolith_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", eolith_speedup, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", eolith_state, eolith_speedup, "screen", 0, 1)
/* Sound CPU */ /* Sound CPU */
MCFG_CPU_ADD("soundcpu", I8032, XTAL_12MHz) MCFG_CPU_ADD("soundcpu", I8032, XTAL_12MHz)

View File

@ -179,7 +179,7 @@ PALETTE_INIT_MEMBER(eolith16_state,eolith16)
static MACHINE_CONFIG_START( eolith16, eolith16_state ) static MACHINE_CONFIG_START( eolith16, eolith16_state )
MCFG_CPU_ADD("maincpu", E116T, 60000000) /* no internal multiplier */ MCFG_CPU_ADD("maincpu", E116T, 60000000) /* no internal multiplier */
MCFG_CPU_PROGRAM_MAP(eolith16_map) MCFG_CPU_PROGRAM_MAP(eolith16_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", eolith_speedup, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", eolith16_state, eolith_speedup, "screen", 0, 1)
MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C66) MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C66)

View File

@ -87,7 +87,7 @@ void init_eolith_speedup(running_machine &machine)
} }
/* todo, use timers instead! */ /* todo, use timers instead! */
TIMER_DEVICE_CALLBACK( eolith_speedup ) TIMER_DEVICE_CALLBACK_MEMBER(eolith_state::eolith_speedup)
{ {
if (param==0) if (param==0)
{ {
@ -96,7 +96,7 @@ TIMER_DEVICE_CALLBACK( eolith_speedup )
if (param==eolith_speedup_resume_scanline) if (param==eolith_speedup_resume_scanline)
{ {
timer.machine().scheduler().trigger(1000); machine().scheduler().trigger(1000);
} }
if (param==240) if (param==240)

View File

@ -1872,7 +1872,7 @@ static MACHINE_CONFIG_DERIVED( battles, xevious )
MCFG_CPU_PROGRAM_MAP(battles_mem4) MCFG_CPU_PROGRAM_MAP(battles_mem4)
MCFG_CPU_VBLANK_INT_DRIVER("screen", xevious_state, battles_interrupt_4) MCFG_CPU_VBLANK_INT_DRIVER("screen", xevious_state, battles_interrupt_4)
MCFG_TIMER_ADD("battles_nmi", battles_nmi_generate) MCFG_TIMER_DRIVER_ADD("battles_nmi", xevious_state, battles_nmi_generate)
MCFG_MACHINE_RESET_OVERRIDE(xevious_state,battles) MCFG_MACHINE_RESET_OVERRIDE(xevious_state,battles)

View File

@ -2661,16 +2661,15 @@ DRIVER_INIT_MEMBER(mpu4_state,crystali)
} }
/* generate a 50 Hz signal (based on an RC time) */ /* generate a 50 Hz signal (based on an RC time) */
TIMER_DEVICE_CALLBACK( gen_50hz ) TIMER_DEVICE_CALLBACK_MEMBER(mpu4_state::gen_50hz)
{ {
mpu4_state *state = timer.machine().driver_data<mpu4_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<pia6821_device>("pia_ic4")->ca1_w(state->m_signal_50hz); /* signal is connected to IC4 CA1 */ machine().device<pia6821_device>("pia_ic4")->ca1_w(m_signal_50hz); /* signal is connected to IC4 CA1 */
update_meters(state);//run at 100Hz to sync with PIAs update_meters(this);//run at 100Hz to sync with PIAs
} }
static ADDRESS_MAP_START( mpu4_memmap, AS_PROGRAM, 8, mpu4_state ) static ADDRESS_MAP_START( mpu4_memmap, AS_PROGRAM, 8, mpu4_state )
@ -2699,7 +2698,7 @@ const ay8910_interface ay8910_config =
}; };
MACHINE_CONFIG_FRAGMENT( mpu4_common ) MACHINE_CONFIG_FRAGMENT( mpu4_common )
MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100)) MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", mpu4_state, gen_50hz, attotime::from_hz(100))
MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT) MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT)
/* 6840 PTM */ /* 6840 PTM */

View File

@ -1856,116 +1856,115 @@ TODO:
*/ */
static TIMER_DEVICE_CALLBACK( saturn_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(saturn_state::saturn_scanline)
{ {
saturn_state *state = timer.machine().driver_data<saturn_state>(); saturn_state *state = machine().driver_data<saturn_state>();
int scanline = param; int scanline = param;
int max_y = timer.machine().primary_screen->height(); int max_y = timer.machine().primary_screen->height();
int y_step,vblank_line; int y_step,vblank_line;
y_step = 2; y_step = 2;
if((max_y == 263 && state->m_vdp2.pal == 0) || (max_y == 313 && state->m_vdp2.pal == 1)) if((max_y == 263 && m_vdp2.pal == 0) || (max_y == 313 && m_vdp2.pal == 1))
y_step = 1; y_step = 1;
vblank_line = (state->m_vdp2.pal) ? 288 : 240; vblank_line = (m_vdp2.pal) ? 288 : 240;
//popmessage("%08x %d T0 %d T1 %d %08x",state->m_scu.ism ^ 0xffffffff,max_y,state->m_scu_regs[36],state->m_scu_regs[37],state->m_scu_regs[38]); //popmessage("%08x %d T0 %d T1 %d %08x",m_scu.ism ^ 0xffffffff,max_y,m_scu_regs[36],m_scu_regs[37],m_scu_regs[38]);
if(scanline == (0)*y_step) if(scanline == (0)*y_step)
{ {
video_update_vdp1(timer.machine()); video_update_vdp1(timer.machine());
if(STV_VDP1_VBE) if(STV_VDP1_VBE)
state->m_vdp1.framebuffer_clear_on_next_frame = 1; m_vdp1.framebuffer_clear_on_next_frame = 1;
if(!(state->m_scu.ism & IRQ_VDP1_END)) if(!(m_scu.ism & IRQ_VDP1_END))
{ {
state->m_maincpu->set_input_line_and_vector(0x2, HOLD_LINE, 0x4d); m_maincpu->set_input_line_and_vector(0x2, HOLD_LINE, 0x4d);
scu_do_transfer(timer.machine(),6); scu_do_transfer(timer.machine(),6);
} }
else else
state->m_scu.ist |= (IRQ_VDP1_END); m_scu.ist |= (IRQ_VDP1_END);
} }
if(scanline == 0*y_step) if(scanline == 0*y_step)
{ {
if(!(state->m_scu.ism & IRQ_VBLANK_OUT)) if(!(m_scu.ism & IRQ_VBLANK_OUT))
{ {
state->m_maincpu->set_input_line_and_vector(0xe, HOLD_LINE, 0x41); m_maincpu->set_input_line_and_vector(0xe, HOLD_LINE, 0x41);
scu_do_transfer(timer.machine(),1); scu_do_transfer(timer.machine(),1);
} }
else else
state->m_scu.ist |= (IRQ_VBLANK_OUT); m_scu.ist |= (IRQ_VBLANK_OUT);
} }
else if(scanline == vblank_line*y_step) else if(scanline == vblank_line*y_step)
{ {
if(!(state->m_scu.ism & IRQ_VBLANK_IN)) if(!(m_scu.ism & IRQ_VBLANK_IN))
{ {
state->m_maincpu->set_input_line_and_vector(0xf, HOLD_LINE ,0x40); m_maincpu->set_input_line_and_vector(0xf, HOLD_LINE ,0x40);
scu_do_transfer(timer.machine(),0); scu_do_transfer(timer.machine(),0);
} }
else else
state->m_scu.ist |= (IRQ_VBLANK_IN); m_scu.ist |= (IRQ_VBLANK_IN);
} }
else if((scanline % y_step) == 0 && scanline < vblank_line*y_step) else if((scanline % y_step) == 0 && scanline < vblank_line*y_step)
{ {
if(!(state->m_scu.ism & IRQ_HBLANK_IN)) if(!(m_scu.ism & IRQ_HBLANK_IN))
{ {
state->m_maincpu->set_input_line_and_vector(0xd, HOLD_LINE, 0x42); m_maincpu->set_input_line_and_vector(0xd, HOLD_LINE, 0x42);
scu_do_transfer(timer.machine(),2); scu_do_transfer(timer.machine(),2);
} }
else else
state->m_scu.ist |= (IRQ_HBLANK_IN); m_scu.ist |= (IRQ_HBLANK_IN);
} }
if(scanline == (state->m_scu_regs[36] & 0x3ff)*y_step) if(scanline == (m_scu_regs[36] & 0x3ff)*y_step)
{ {
if(!(state->m_scu.ism & IRQ_TIMER_0)) if(!(m_scu.ism & IRQ_TIMER_0))
{ {
state->m_maincpu->set_input_line_and_vector(0xc, HOLD_LINE, 0x43 ); m_maincpu->set_input_line_and_vector(0xc, HOLD_LINE, 0x43 );
scu_do_transfer(timer.machine(),3); scu_do_transfer(timer.machine(),3);
} }
else else
state->m_scu.ist |= (IRQ_TIMER_0); m_scu.ist |= (IRQ_TIMER_0);
} }
/* TODO: this isn't completely correct */ /* TODO: this isn't completely correct */
if(state->m_scu_regs[38] & 0x1) if(m_scu_regs[38] & 0x1)
{ {
if((!(state->m_scu_regs[38] & 0x100) && (scanline % y_step) == 0) || if((!(m_scu_regs[38] & 0x100) && (scanline % y_step) == 0) ||
((state->m_scu_regs[38] & 0x100) && (scanline == (state->m_scu_regs[36] & 0x3ff)*y_step))) ((m_scu_regs[38] & 0x100) && (scanline == (m_scu_regs[36] & 0x3ff)*y_step)))
{ {
if(!(state->m_scu.ism & IRQ_TIMER_1)) if(!(m_scu.ism & IRQ_TIMER_1))
{ {
state->m_maincpu->set_input_line_and_vector(0xb, HOLD_LINE, 0x44 ); m_maincpu->set_input_line_and_vector(0xb, HOLD_LINE, 0x44 );
scu_do_transfer(timer.machine(),4); scu_do_transfer(timer.machine(),4);
} }
else else
state->m_scu.ist |= (IRQ_TIMER_1); m_scu.ist |= (IRQ_TIMER_1);
} }
} }
} }
static TIMER_DEVICE_CALLBACK( saturn_slave_scanline ) TIMER_DEVICE_CALLBACK_MEMBER(saturn_state::saturn_slave_scanline )
{ {
saturn_state *state = timer.machine().driver_data<saturn_state>();
int scanline = param; int scanline = param;
int max_y = timer.machine().primary_screen->height(); int max_y = timer.machine().primary_screen->height();
int y_step,vblank_line; int y_step,vblank_line;
y_step = 2; y_step = 2;
if((max_y == 263 && state->m_vdp2.pal == 0) || (max_y == 313 && state->m_vdp2.pal == 1)) if((max_y == 263 && m_vdp2.pal == 0) || (max_y == 313 && m_vdp2.pal == 1))
y_step = 1; y_step = 1;
vblank_line = (state->m_vdp2.pal) ? 288 : 240; vblank_line = (m_vdp2.pal) ? 288 : 240;
if(scanline == vblank_line*y_step) if(scanline == vblank_line*y_step)
state->m_slave->set_input_line_and_vector(0x6, HOLD_LINE, 0x43); m_slave->set_input_line_and_vector(0x6, HOLD_LINE, 0x43);
else if((scanline % y_step) == 0 && scanline < vblank_line*y_step) else if((scanline % y_step) == 0 && scanline < vblank_line*y_step)
state->m_slave->set_input_line_and_vector(0x2, HOLD_LINE, 0x41); m_slave->set_input_line_and_vector(0x2, HOLD_LINE, 0x41);
} }
/* Die Hard Trilogy tests RAM address 0x25e7ffe bit 2 with Slave during FRT minit irq, in-development tool for breaking execution of it? */ /* Die Hard Trilogy tests RAM address 0x25e7ffe bit 2 with Slave during FRT minit irq, in-development tool for breaking execution of it? */
@ -2185,12 +2184,12 @@ static MACHINE_CONFIG_START( saturn, saturn_state )
MCFG_CPU_ADD("maincpu", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz MCFG_CPU_ADD("maincpu", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
MCFG_CPU_PROGRAM_MAP(saturn_mem) MCFG_CPU_PROGRAM_MAP(saturn_mem)
MCFG_CPU_CONFIG(sh2_conf_master) MCFG_CPU_CONFIG(sh2_conf_master)
MCFG_TIMER_ADD_SCANLINE("scantimer", saturn_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", saturn_state, saturn_scanline, "screen", 0, 1)
MCFG_CPU_ADD("slave", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz MCFG_CPU_ADD("slave", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
MCFG_CPU_PROGRAM_MAP(saturn_mem) MCFG_CPU_PROGRAM_MAP(saturn_mem)
MCFG_CPU_CONFIG(sh2_conf_slave) MCFG_CPU_CONFIG(sh2_conf_slave)
MCFG_TIMER_ADD_SCANLINE("slave_scantimer", saturn_slave_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("slave_scantimer", saturn_state, saturn_slave_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 11289600) //256 x 44100 Hz = 11.2896 MHz MCFG_CPU_ADD("audiocpu", M68000, 11289600) //256 x 44100 Hz = 11.2896 MHz
MCFG_CPU_PROGRAM_MAP(sound_mem) MCFG_CPU_PROGRAM_MAP(sound_mem)
@ -2273,12 +2272,12 @@ static MACHINE_CONFIG_START( stv, saturn_state )
MCFG_CPU_ADD("maincpu", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz MCFG_CPU_ADD("maincpu", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
MCFG_CPU_PROGRAM_MAP(stv_mem) MCFG_CPU_PROGRAM_MAP(stv_mem)
MCFG_CPU_CONFIG(sh2_conf_master) MCFG_CPU_CONFIG(sh2_conf_master)
MCFG_TIMER_ADD_SCANLINE("scantimer", saturn_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", saturn_state, saturn_scanline, "screen", 0, 1)
MCFG_CPU_ADD("slave", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz MCFG_CPU_ADD("slave", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
MCFG_CPU_PROGRAM_MAP(stv_mem) MCFG_CPU_PROGRAM_MAP(stv_mem)
MCFG_CPU_CONFIG(sh2_conf_slave) MCFG_CPU_CONFIG(sh2_conf_slave)
MCFG_TIMER_ADD_SCANLINE("slave_scantimer", saturn_slave_scanline, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("slave_scantimer", saturn_state, saturn_slave_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M68000, 11289600) //11.2896 MHz MCFG_CPU_ADD("audiocpu", M68000, 11289600) //11.2896 MHz
MCFG_CPU_PROGRAM_MAP(sound_mem) MCFG_CPU_PROGRAM_MAP(sound_mem)

View File

@ -251,7 +251,7 @@ static QS1000_INTERFACE( qs1000_intf )
static MACHINE_CONFIG_START( vega, vegaeo_state ) static MACHINE_CONFIG_START( vega, vegaeo_state )
MCFG_CPU_ADD("maincpu", GMS30C2132, XTAL_55MHz) MCFG_CPU_ADD("maincpu", GMS30C2132, XTAL_55MHz)
MCFG_CPU_PROGRAM_MAP(vega_map) MCFG_CPU_PROGRAM_MAP(vega_map)
MCFG_TIMER_ADD_SCANLINE("scantimer", eolith_speedup, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", vegaeo_state, eolith_speedup, "screen", 0, 1)
MCFG_AT28C16_ADD("at28c16", NULL) MCFG_AT28C16_ADD("at28c16", NULL)

View File

@ -215,6 +215,7 @@ public:
void screen_eof_cps1(screen_device &screen, bool state); void screen_eof_cps1(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(cps1_interrupt); INTERRUPT_GEN_MEMBER(cps1_interrupt);
INTERRUPT_GEN_MEMBER(cps1_qsound_interrupt); INTERRUPT_GEN_MEMBER(cps1_qsound_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(cps2_interrupt);
}; };
/*----------- defined in drivers/cps1.c -----------*/ /*----------- defined in drivers/cps1.c -----------*/

View File

@ -101,4 +101,5 @@ public:
DECLARE_VIDEO_START(ddragon); DECLARE_VIDEO_START(ddragon);
UINT32 screen_update_ddragon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_ddragon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(ddragon_scanline); TIMER_DEVICE_CALLBACK_MEMBER(ddragon_scanline);
TIMER_DEVICE_CALLBACK_MEMBER(chinagat_scanline);
}; };

View File

@ -486,6 +486,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(neruton_irq_scanline); TIMER_DEVICE_CALLBACK_MEMBER(neruton_irq_scanline);
TIMER_DEVICE_CALLBACK_MEMBER(majxtal7_vblank_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(majxtal7_vblank_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(tenkai_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(tenkai_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(mjmyster_irq);
}; };
//----------- defined in drivers/dynax.c ----------- //----------- defined in drivers/dynax.c -----------

View File

@ -40,4 +40,5 @@ public:
DECLARE_MACHINE_RESET(eolith); DECLARE_MACHINE_RESET(eolith);
DECLARE_VIDEO_START(eolith); DECLARE_VIDEO_START(eolith);
UINT32 screen_update_eolith(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_eolith(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(eolith_speedup);
}; };

View File

@ -2,4 +2,3 @@
void eolith_speedup_read(address_space &space); void eolith_speedup_read(address_space &space);
void init_eolith_speedup(running_machine &machine); void init_eolith_speedup(running_machine &machine);
TIMER_DEVICE_CALLBACK( eolith_speedup );

View File

@ -97,6 +97,7 @@ public:
DECLARE_MACHINE_RESET(battles); DECLARE_MACHINE_RESET(battles);
UINT32 screen_update_xevious(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_xevious(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(battles_interrupt_4); INTERRUPT_GEN_MEMBER(battles_interrupt_4);
TIMER_DEVICE_CALLBACK_MEMBER(battles_nmi_generate);
}; };
@ -192,7 +193,6 @@ DECLARE_READ8_HANDLER( xevious_bb_r );
/*----------- defined in machine/xevious.c -----------*/ /*----------- defined in machine/xevious.c -----------*/
void battles_customio_init(running_machine &machine); void battles_customio_init(running_machine &machine);
TIMER_DEVICE_CALLBACK( battles_nmi_generate );
DECLARE_READ8_HANDLER( battles_customio0_r ); DECLARE_READ8_HANDLER( battles_customio0_r );
DECLARE_READ8_HANDLER( battles_customio_data0_r ); DECLARE_READ8_HANDLER( battles_customio_data0_r );

View File

@ -255,6 +255,7 @@ public:
DECLARE_MACHINE_START(mpu4oki); DECLARE_MACHINE_START(mpu4oki);
DECLARE_MACHINE_START(mpu4bwb); DECLARE_MACHINE_START(mpu4bwb);
DECLARE_MACHINE_START(mpu4cry); DECLARE_MACHINE_START(mpu4cry);
TIMER_DEVICE_CALLBACK_MEMBER(gen_50hz);
}; };
/* mpu4.c, used by mpu4vid.c */ /* mpu4.c, used by mpu4vid.c */

View File

@ -200,6 +200,8 @@ public:
DECLARE_MACHINE_RESET(stv); DECLARE_MACHINE_RESET(stv);
UINT32 screen_update_saturn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_saturn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_stv_vdp2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_stv_vdp2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(saturn_scanline);
TIMER_DEVICE_CALLBACK_MEMBER(saturn_slave_scanline);
}; };
#define MASTER_CLOCK_352 57272720 #define MASTER_CLOCK_352 57272720

View File

@ -35,7 +35,7 @@ void battles_customio_init(running_machine &machine)
} }
TIMER_DEVICE_CALLBACK( battles_nmi_generate ) TIMER_DEVICE_CALLBACK_MEMBER(xevious_state::battles_nmi_generate)
{ {
battles_customio_prev_command = battles_customio_command; battles_customio_prev_command = battles_customio_command;
@ -44,18 +44,18 @@ TIMER_DEVICE_CALLBACK( battles_nmi_generate )
{ {
if( battles_customio_command_count == 0 ) if( battles_customio_command_count == 0 )
{ {
timer.machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
} }
else else
{ {
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);
timer.machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
} }
} }
else else
{ {
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);
timer.machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
} }
battles_customio_command_count++; battles_customio_command_count++;
} }

View File

@ -361,7 +361,7 @@ GFXDECODE_END
//------------------------------------------------- //-------------------------------------------------
// TIMER_DEVICE_CALLBACK( set_irq ) // TIMER_DEVICE_CALLBACK_MEMBER( set_irq )
//------------------------------------------------- //-------------------------------------------------
TIMER_DEVICE_CALLBACK_MEMBER(ace_state::set_irq) TIMER_DEVICE_CALLBACK_MEMBER(ace_state::set_irq)
@ -371,7 +371,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ace_state::set_irq)
//------------------------------------------------- //-------------------------------------------------
// TIMER_DEVICE_CALLBACK( clear_irq ) // TIMER_DEVICE_CALLBACK_MEMBER( clear_irq )
//------------------------------------------------- //-------------------------------------------------
TIMER_DEVICE_CALLBACK_MEMBER(ace_state::clear_irq) TIMER_DEVICE_CALLBACK_MEMBER(ace_state::clear_irq)

View File

@ -1162,7 +1162,7 @@ WRITE8_MEMBER( adam_state::fdc6801_p4_w )
//************************************************************************** //**************************************************************************
//------------------------------------------------- //-------------------------------------------------
// TIMER_DEVICE_CALLBACK( paddle_tick ) // TIMER_DEVICE_CALLBACK_MEMBER( paddle_tick )
//------------------------------------------------- //-------------------------------------------------
TIMER_DEVICE_CALLBACK_MEMBER(adam_state::paddle_tick) TIMER_DEVICE_CALLBACK_MEMBER(adam_state::paddle_tick)

View File

@ -260,6 +260,7 @@ public:
DECLARE_DRIVER_INIT(geneve); DECLARE_DRIVER_INIT(geneve);
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
TIMER_DEVICE_CALLBACK_MEMBER(geneve_hblank_interrupt);
void set_tms9901_INT2_from_v9938(v99x8_device &vdp, int state); void set_tms9901_INT2_from_v9938(v99x8_device &vdp, int state);
@ -634,12 +635,11 @@ WRITE_LINE_MEMBER( geneve::keyboard_interrupt )
/* /*
scanline interrupt scanline interrupt
*/ */
TIMER_DEVICE_CALLBACK( geneve_hblank_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(geneve::geneve_hblank_interrupt)
{ {
int scanline = param; int scanline = param;
geneve *driver = timer.machine().driver_data<geneve>();
timer.machine().device<v9938_device>(VDP_TAG)->interrupt(); machine().device<v9938_device>(VDP_TAG)->interrupt();
if (scanline == 0) // was 262 if (scanline == 0) // was 262
{ {
@ -649,7 +649,7 @@ TIMER_DEVICE_CALLBACK( geneve_hblank_interrupt )
// per vertical interrupt; however, the mouse sometimes shows jerky // per vertical interrupt; however, the mouse sometimes shows jerky
// behaviour. Maybe we should use an autonomous timer with a higher // behaviour. Maybe we should use an autonomous timer with a higher
// rate? -> to be checked // rate? -> to be checked
driver->m_mouse->poll(); m_mouse->poll();
} }
} }
@ -763,7 +763,7 @@ static MACHINE_CONFIG_START( geneve_60hz, geneve )
// painted. Accordingly, the full set of lines is refreshed at 30 Hz, // painted. Accordingly, the full set of lines is refreshed at 30 Hz,
// not 60 Hz. This should be fixed in the v9938 emulation. // not 60 Hz. This should be fixed in the v9938 emulation.
MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, DEVICE_SELF, geneve, set_tms9901_INT2_from_v9938) MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, DEVICE_SELF, geneve, set_tms9901_INT2_from_v9938)
MCFG_TIMER_ADD_SCANLINE("scantimer", geneve_hblank_interrupt, SCREEN_TAG, 0, 1) /* 262.5 in 60Hz, 312.5 in 50Hz */ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", geneve, geneve_hblank_interrupt, SCREEN_TAG, 0, 1) /* 262.5 in 60Hz, 312.5 in 50Hz */
// Main board components // Main board components
MCFG_TMS9901_ADD(TMS9901_TAG, tms9901_wiring_geneve, 3000000) MCFG_TMS9901_ADD(TMS9901_TAG, tms9901_wiring_geneve, 3000000)

View File

@ -316,7 +316,7 @@ void mm1_state::scan_keyboard()
//------------------------------------------------- //-------------------------------------------------
// TIMER_DEVICE_CALLBACK( kbclk_tick ) // TIMER_DEVICE_CALLBACK_MEMBER( kbclk_tick )
//------------------------------------------------- //-------------------------------------------------
TIMER_DEVICE_CALLBACK_MEMBER(mm1_state::kbclk_tick) TIMER_DEVICE_CALLBACK_MEMBER(mm1_state::kbclk_tick)

View File

@ -244,7 +244,7 @@ void portfolio_state::scan_keyboard()
} }
//------------------------------------------------- //-------------------------------------------------
// TIMER_DEVICE_CALLBACK( keyboard_tick ) // TIMER_DEVICE_CALLBACK_MEMBER( keyboard_tick )
//------------------------------------------------- //-------------------------------------------------
TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::keyboard_tick) TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::keyboard_tick)
@ -365,7 +365,7 @@ WRITE8_MEMBER( portfolio_state::unknown_w )
//************************************************************************** //**************************************************************************
//------------------------------------------------- //-------------------------------------------------
// TIMER_DEVICE_CALLBACK( system_tick ) // TIMER_DEVICE_CALLBACK_MEMBER( system_tick )
//------------------------------------------------- //-------------------------------------------------
TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::system_tick) TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::system_tick)
@ -374,7 +374,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::system_tick)
} }
//------------------------------------------------- //-------------------------------------------------
// TIMER_DEVICE_CALLBACK( counter_tick ) // TIMER_DEVICE_CALLBACK_MEMBER( counter_tick )
//------------------------------------------------- //-------------------------------------------------
TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::counter_tick) TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::counter_tick)

View File

@ -95,7 +95,7 @@ void tek4051_state::scan_keyboard()
//------------------------------------------------- //-------------------------------------------------
// TIMER_DEVICE_CALLBACK( keyboard_tick ) // TIMER_DEVICE_CALLBACK_MEMBER( keyboard_tick )
//------------------------------------------------- //-------------------------------------------------
TIMER_DEVICE_CALLBACK_MEMBER(tek4051_state::keyboard_tick) TIMER_DEVICE_CALLBACK_MEMBER(tek4051_state::keyboard_tick)

View File

@ -95,6 +95,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(alphaW); DECLARE_WRITE_LINE_MEMBER(alphaW);
virtual void machine_start(); virtual void machine_start();
DECLARE_MACHINE_RESET(ti99_4p); DECLARE_MACHINE_RESET(ti99_4p);
TIMER_DEVICE_CALLBACK_MEMBER(sgcpu_hblank_interrupt);
void set_tms9901_INT2_from_v9938(v99x8_device &vdp, int state); void set_tms9901_INT2_from_v9938(v99x8_device &vdp, int state);
@ -867,9 +868,9 @@ MACHINE_RESET_MEMBER(ti99_4p,ti99_4p)
m_cpu->set_hold(CLEAR_LINE); m_cpu->set_hold(CLEAR_LINE);
} }
TIMER_DEVICE_CALLBACK( sgcpu_hblank_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(ti99_4p::sgcpu_hblank_interrupt)
{ {
timer.machine().device<v9938_device>(VDP_TAG)->interrupt(); machine().device<v9938_device>(VDP_TAG)->interrupt();
} }
/* /*
@ -887,7 +888,7 @@ static MACHINE_CONFIG_START( ti99_4p_60hz, ti99_4p )
// painted. Accordingly, the full set of lines is refreshed at 30 Hz, // painted. Accordingly, the full set of lines is refreshed at 30 Hz,
// not 60 Hz. This should be fixed in the v9938 emulation. // not 60 Hz. This should be fixed in the v9938 emulation.
MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, DEVICE_SELF, ti99_4p, set_tms9901_INT2_from_v9938) MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, DEVICE_SELF, ti99_4p, set_tms9901_INT2_from_v9938)
MCFG_TIMER_ADD_SCANLINE("scantimer", sgcpu_hblank_interrupt, SCREEN_TAG, 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ti99_4p, sgcpu_hblank_interrupt, SCREEN_TAG, 0, 1)
// tms9901 // tms9901
MCFG_TMS9901_ADD(TMS9901_TAG, tms9901_wiring_sgcpu, 3000000) MCFG_TMS9901_ADD(TMS9901_TAG, tms9901_wiring_sgcpu, 3000000)

View File

@ -87,6 +87,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( clock_out ); DECLARE_WRITE_LINE_MEMBER( clock_out );
DECLARE_INPUT_CHANGED_MEMBER( load_interrupt ); DECLARE_INPUT_CHANGED_MEMBER( load_interrupt );
TIMER_DEVICE_CALLBACK_MEMBER(ti99_4ev_hblank_interrupt);
// Some values to keep // Some values to keep
tms9900_device* m_cpu; tms9900_device* m_cpu;
@ -1072,9 +1073,9 @@ static MACHINE_CONFIG_START( ti99_4a_50hz, ti99_4x )
MACHINE_CONFIG_END MACHINE_CONFIG_END
TIMER_DEVICE_CALLBACK( ti99_4ev_hblank_interrupt ) TIMER_DEVICE_CALLBACK_MEMBER(ti99_4x::ti99_4ev_hblank_interrupt)
{ {
timer.machine().device<v9938_device>(VDP_TAG)->interrupt(); machine().device<v9938_device>(VDP_TAG)->interrupt();
} }
/* /*
@ -1094,7 +1095,7 @@ static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x )
// painted. Accordingly, the full set of lines is refreshed at 30 Hz, // painted. Accordingly, the full set of lines is refreshed at 30 Hz,
// not 60 Hz. This should be fixed in the v9938 emulation. // not 60 Hz. This should be fixed in the v9938 emulation.
MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, DEVICE_SELF, ti99_4x, set_tms9901_INT2_from_v9938) MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, DEVICE_SELF, ti99_4x, set_tms9901_INT2_from_v9938)
MCFG_TIMER_ADD_SCANLINE("scantimer", ti99_4ev_hblank_interrupt, SCREEN_TAG, 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ti99_4x, ti99_4ev_hblank_interrupt, SCREEN_TAG, 0, 1)
/* Main board */ /* Main board */
MCFG_TMS9901_ADD(TMS9901_TAG, tms9901_wiring_ti99_4a, 3000000) MCFG_TMS9901_ADD(TMS9901_TAG, tms9901_wiring_ti99_4a, 3000000)

View File

@ -144,6 +144,8 @@ public:
DECLARE_MACHINE_RESET(tm990_189); DECLARE_MACHINE_RESET(tm990_189);
DECLARE_MACHINE_START(tm990_189_v); DECLARE_MACHINE_START(tm990_189_v);
DECLARE_MACHINE_RESET(tm990_189_v); DECLARE_MACHINE_RESET(tm990_189_v);
TIMER_DEVICE_CALLBACK_MEMBER(display_callback);
private: private:
void draw_digit(void); void draw_digit(void);
void led_set(int number, bool state); void led_set(int number, bool state);
@ -247,26 +249,25 @@ void tm990189::draw_digit()
} }
static TIMER_DEVICE_CALLBACK( display_callback ) TIMER_DEVICE_CALLBACK_MEMBER(tm990189::display_callback)
{ {
tm990189 *state = timer.machine().driver_data<tm990189>();
UINT8 i; UINT8 i;
char ledname[8]; char ledname[8];
// since the segment data is cleared after being used, the old_segment is there // since the segment data is cleared after being used, the old_segment is there
// in case the segment data hasn't been refreshed yet. // in case the segment data hasn't been refreshed yet.
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
{ {
state->m_old_segment_state[i] |= state->m_segment_state[i]; m_old_segment_state[i] |= m_segment_state[i];
sprintf(ledname,"digit%d",i); sprintf(ledname,"digit%d",i);
output_set_digit_value(i, state->m_old_segment_state[i]); output_set_digit_value(i, m_old_segment_state[i]);
state->m_old_segment_state[i] = state->m_segment_state[i]; m_old_segment_state[i] = m_segment_state[i];
state->m_segment_state[i] = 0; m_segment_state[i] = 0;
} }
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
{ {
sprintf(ledname,"led%d",i); sprintf(ledname,"led%d",i);
output_set_value(ledname, !BIT(state->m_LED_state, i)); output_set_value(ledname, !BIT(m_LED_state, i));
} }
} }
@ -855,7 +856,7 @@ static MACHINE_CONFIG_START( tm990_189, tm990189 )
MCFG_TMS9901_ADD("tms9901_1", sys9901reset_param, 2000000) MCFG_TMS9901_ADD("tms9901_1", sys9901reset_param, 2000000)
MCFG_TMS9902_ADD("tms9902", tms9902_params, 2000000) MCFG_TMS9902_ADD("tms9902", tms9902_params, 2000000)
MCFG_TM990_189_RS232_ADD("rs232") MCFG_TM990_189_RS232_ADD("rs232")
MCFG_TIMER_ADD_PERIODIC("display_timer", display_callback, attotime::from_hz(30)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_timer", tm990189, display_callback, attotime::from_hz(30))
// Need to delay the timer, or it will spoil the initial LOAD // Need to delay the timer, or it will spoil the initial LOAD
// TODO: Fix this, probably inside CPU // TODO: Fix this, probably inside CPU
MCFG_TIMER_START_DELAY(attotime::from_msec(150)) MCFG_TIMER_START_DELAY(attotime::from_msec(150))
@ -887,7 +888,7 @@ static MACHINE_CONFIG_START( tm990_189_v, tm990189 )
MCFG_TMS9901_ADD("tms9901_1", sys9901reset_param, 2000000) MCFG_TMS9901_ADD("tms9901_1", sys9901reset_param, 2000000)
MCFG_TMS9902_ADD("tms9902", tms9902_params, 2000000) MCFG_TMS9902_ADD("tms9902", tms9902_params, 2000000)
MCFG_TM990_189_RS232_ADD("rs232") MCFG_TM990_189_RS232_ADD("rs232")
MCFG_TIMER_ADD_PERIODIC("display_timer", display_callback, attotime::from_hz(30)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_timer", tm990189, display_callback, attotime::from_hz(30))
MCFG_TIMER_START_DELAY(attotime::from_msec(150)) MCFG_TIMER_START_DELAY(attotime::from_msec(150))
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -390,7 +390,7 @@ INPUT_PORTS_END
//************************************************************************** //**************************************************************************
//------------------------------------------------- //-------------------------------------------------
// TIMER_DEVICE_CALLBACK( vsync_tick ) // TIMER_DEVICE_CALLBACK_MEMBER( vsync_tick )
//------------------------------------------------- //-------------------------------------------------
TIMER_DEVICE_CALLBACK_MEMBER(vixen_state::vsync_tick) TIMER_DEVICE_CALLBACK_MEMBER(vixen_state::vsync_tick)

View File

@ -170,7 +170,7 @@ void cgc7900_state::draw_overlay(screen_device *screen, bitmap_rgb32 &bitmap)
} }
/*------------------------------------------------- /*-------------------------------------------------
TIMER_DEVICE_CALLBACK( blink_tick ) TIMER_DEVICE_CALLBACK_MEMBER( blink_tick )
-------------------------------------------------*/ -------------------------------------------------*/
TIMER_DEVICE_CALLBACK_MEMBER(cgc7900_state::blink_tick) TIMER_DEVICE_CALLBACK_MEMBER(cgc7900_state::blink_tick)