small batch of anonymous timers removal (nw)

This commit is contained in:
Ivan Vangelista 2017-04-14 09:21:03 +02:00
parent 723debdba7
commit 028b0b557d
6 changed files with 14 additions and 5 deletions

View File

@ -610,7 +610,7 @@ void segaorun_state::device_timer(emu_timer &timer, device_timer_id id, int para
case 65:
case 129:
case 193:
timer_set(m_screen->time_until_pos(scanline, m_screen->visible_area().max_x + 1), TID_IRQ2_GEN);
m_irq2_gen_timer->adjust(m_screen->time_until_pos(scanline, m_screen->visible_area().max_x + 1));
next_scanline = scanline + 1;
break;
@ -2925,6 +2925,8 @@ DRIVER_INIT_MEMBER(segaorun_state,generic)
// allocate a scanline timer
m_scanline_timer = timer_alloc(TID_SCANLINE);
m_irq2_gen_timer = timer_alloc(TID_IRQ2_GEN);
// configure the NVRAM to point to our workram
if (m_nvram != nullptr)
m_nvram->set_base(m_workram, m_workram.bytes());

View File

@ -36,6 +36,7 @@ public:
std::unique_ptr<bitmap_ind16> m_dstbitmap;
emu_timer *m_blitter_timer;
emu_timer *m_signal_irq_timer;
/* misc */
uint8_t m_irq_state[5];

View File

@ -145,6 +145,7 @@ protected:
// internal state
emu_timer * m_scanline_timer;
emu_timer * m_irq2_gen_timer;
uint8_t m_irq2_state;
uint8_t m_adc_select;
uint8_t m_vblank_irq_state;

View File

@ -88,4 +88,6 @@ protected:
bool m_vck2;
bool m_adpcm_reset;
uint16_t m_adpcm_data_offs;
emu_timer *m_int1_timer;
};

View File

@ -78,6 +78,8 @@ void stfight_state::machine_start()
m_main_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000);
m_main_bank->set_entry(0);
m_int1_timer = timer_alloc(TIMER_STFIGHT_INTERRUPT_1);
save_item(NAME(m_coin_state));
save_item(NAME(m_fm_data));
@ -131,7 +133,7 @@ INTERRUPT_GEN_MEMBER(stfight_state::stfight_vb_interrupt)
{
// Do a RST10
device.execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf);
timer_set(attotime::from_hz(120), TIMER_STFIGHT_INTERRUPT_1);
m_int1_timer->adjust(attotime::from_hz(120));
}
/*

View File

@ -99,8 +99,9 @@ void dcheese_state::video_start()
/* the destination bitmap is not directly accessible to the CPU */
m_dstbitmap = std::make_unique<bitmap_ind16>(DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT);
/* create a timer */
/* create timers */
m_blitter_timer = timer_alloc(TIMER_BLITTER_SCANLINE);
m_signal_irq_timer = timer_alloc(TIMER_SIGNAL_IRQ);
/* register for saving */
save_item(NAME(m_blitter_color));
@ -151,7 +152,7 @@ void dcheese_state::do_clear( )
memset(&m_dstbitmap->pix16(y % DSTBITMAP_HEIGHT), 0, DSTBITMAP_WIDTH * 2);
/* signal an IRQ when done (timing is just a guess) */
timer_set(m_screen->scan_period(), TIMER_SIGNAL_IRQ, 1);
m_signal_irq_timer->adjust(m_screen->scan_period(), 1);
}
@ -205,7 +206,7 @@ void dcheese_state::do_blit( )
}
/* signal an IRQ when done (timing is just a guess) */
timer_set(m_screen->scan_period() / 2, TIMER_SIGNAL_IRQ, 2);
m_signal_irq_timer->adjust(m_screen->scan_period() / 2, 2);
/* these extra parameters are written but they are always zero, so I don't know what they do */
if (m_blitter_xparam[8] != 0 || m_blitter_xparam[9] != 0 || m_blitter_xparam[10] != 0 || m_blitter_xparam[11] != 0 ||