more timer_pulse removal (nw)

This commit is contained in:
Ivan Vangelista 2017-05-13 14:20:07 +02:00
parent a983f396b4
commit 23d75af6e7
27 changed files with 78 additions and 38 deletions

View File

@ -184,7 +184,10 @@ void namco_52xx_device::device_start()
/* start the external clock */
if (m_extclock != 0)
machine().scheduler().timer_pulse(attotime(0, m_extclock), timer_expired_delegate(FUNC(namco_52xx_device::external_clock_pulse),this), 0);
{
m_extclock_pulse_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namco_52xx_device::external_clock_pulse), this));
m_extclock_pulse_timer->adjust(attotime(0, m_extclock), 0, attotime(0, m_extclock));
}
}
//-------------------------------------------------

View File

@ -63,6 +63,7 @@ private:
int m_basenode;
attoseconds_t m_extclock;
emu_timer *m_extclock_pulse_timer;
devcb_read8 m_romread;
devcb_read8 m_si;

View File

@ -62,6 +62,7 @@ private:
uint8_t m_mux_data;
bool m_video_wl;
bool m_ram_bank;
emu_timer *m_pio_timer;
virtual void machine_start() override;
virtual void machine_reset() override;
required_device<cpu_device> m_maincpu;
@ -272,7 +273,8 @@ We preset all banks here, so that bankswitching will incur no speed penalty.
membank("bank1")->configure_entries(0, 2, &ram[0x00000], 0x10000);
membank("bank2")->configure_entry(0, &ram[0x10000]);
machine().scheduler().timer_pulse(attotime::from_hz(50), timer_expired_delegate(FUNC(pasopia_state::pio_timer),this));
m_pio_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pasopia_state::pio_timer), this));
m_pio_timer->adjust(attotime::from_hz(50), 0, attotime::from_hz(50));
}
static MACHINE_CONFIG_START( pasopia, pasopia_state )

View File

@ -114,6 +114,7 @@ private:
int m_addr_latch;
void pasopia_nmi_trap();
uint8_t m_mux_data;
emu_timer *m_pio_timer;
virtual void machine_reset() override;
void fdc_irq(bool state);
void draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int width);
@ -1048,13 +1049,15 @@ ROM_END
DRIVER_INIT_MEMBER(pasopia7_state,p7_raster)
{
m_screen_type = 1;
machine().scheduler().timer_pulse(attotime::from_hz(50), timer_expired_delegate(FUNC(pasopia7_state::pio_timer),this));
m_pio_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pasopia7_state::pio_timer), this));
m_pio_timer->adjust(attotime::from_hz(50), 0, attotime::from_hz(50));
}
DRIVER_INIT_MEMBER(pasopia7_state,p7_lcd)
{
m_screen_type = 0;
machine().scheduler().timer_pulse(attotime::from_hz(50), timer_expired_delegate(FUNC(pasopia7_state::pio_timer),this));
m_pio_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pasopia7_state::pio_timer), this));
m_pio_timer->adjust(attotime::from_hz(50), 0, attotime::from_hz(50));
}

View File

@ -2,7 +2,7 @@
// copyright-holders:Kevin Thacker
/******************************************************************************
pcw.c
pcw.cpp
system driver
Kevin Thacker [MESS driver]
@ -165,7 +165,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(pcw_state::pcw_timer_interrupt)
m_timer_irq_flag = 1;
pcw_update_irqs();
machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(pcw_state::pcw_timer_pulse),this));
m_pulse_timer->adjust(attotime::from_usec(100), 0, attotime::from_usec(100));
}
/* PCW uses UPD765 in NON-DMA mode. FDC Ints are connected to /INT or
@ -1038,10 +1038,12 @@ DRIVER_INIT_MEMBER(pcw_state,pcw)
m_roller_ram_offset = 0;
/* timer interrupt */
machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(pcw_state::setup_beep),this));
m_beep_setup_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pcw_state::setup_beep), this));
m_beep_setup_timer->adjust(attotime::zero);
m_prn_stepper = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pcw_state::pcw_stepper_callback),this));
m_prn_pins = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pcw_state::pcw_pins_callback),this));
m_prn_stepper = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pcw_state::pcw_stepper_callback), this));
m_prn_pins = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pcw_state::pcw_pins_callback), this));
m_pulse_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pcw_state::pcw_timer_pulse), this));
}

View File

@ -554,7 +554,8 @@ MACHINE_START_MEMBER(qdrmfgp_state,qdrmfgp)
MACHINE_START_MEMBER(qdrmfgp_state,qdrmfgp2)
{
/* sound irq (CCU? 240Hz) */
machine().scheduler().timer_pulse(attotime::from_hz(XTAL_18_432MHz/76800), timer_expired_delegate(FUNC(qdrmfgp_state::gp2_timer_callback),this));
m_gp2_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(qdrmfgp_state::gp2_timer_callback), this));
m_gp2_timer->adjust(attotime::from_hz(XTAL_18_432MHz/76800), 0, attotime::from_hz(XTAL_18_432MHz/76800));
MACHINE_START_CALL_MEMBER( qdrmfgp );
}

View File

@ -26,6 +26,7 @@ public:
uint16_t m_key_pressed;
uint16_t m_key_irq_vector;
uint16_t m_drive;
emu_timer *m_kbd_timer;
DECLARE_READ16_MEMBER(bk_key_state_r);
DECLARE_READ16_MEMBER(bk_key_code_r);
DECLARE_READ16_MEMBER(bk_vid_scrool_r);

View File

@ -79,6 +79,9 @@ public:
uint8_t m_screens[ HP48_NB_SCREENS ][ 64 ][ 144 ];
int m_cur_screen;
uint8_t* m_rom;
emu_timer *m_1st_timer;
emu_timer *m_2nd_timer;
emu_timer *m_kbd_timer;
DECLARE_DRIVER_INIT(hp48);
virtual void machine_reset() override;

View File

@ -181,6 +181,7 @@ public:
int m_mouse_data_offset;
int m_COPS_force_unplug;
emu_timer *m_mouse_timer;
emu_timer *m_cops_ready_timer;
int m_hold_COPS_data;
int m_NMIcode;
clock_regs_t m_clock_regs;

View File

@ -71,8 +71,10 @@ public:
uint32_t m_paper_feed; // amount of paper fed through printer, by n/360 inches. One line feed is 61/360in (from the linefeed command in CP/M;s ptr menu)
std::unique_ptr<bitmap_ind16> m_prn_output;
uint8_t m_printer_p2_prev;
emu_timer* m_prn_stepper;
emu_timer* m_prn_pins;
emu_timer *m_prn_stepper;
emu_timer *m_prn_pins;
emu_timer *m_pulse_timer;
emu_timer *m_beep_setup_timer;
DECLARE_READ8_MEMBER(pcw_keyboard_r);
DECLARE_READ8_MEMBER(pcw_keyboard_data_r);
DECLARE_READ8_MEMBER(pcw_interrupt_counter_r);

View File

@ -39,6 +39,7 @@ public:
uint16_t m_control;
int32_t m_gp2_irq_control;
int32_t m_pal;
emu_timer *m_gp2_timer;
DECLARE_WRITE16_MEMBER(gp_control_w);
DECLARE_WRITE16_MEMBER(gp2_control_w);

View File

@ -36,6 +36,7 @@ public:
std::unique_ptr<uint8_t[]> m_CRAM[8];
int m_extra_version;
uint8_t m_current_bank;
emu_timer *m_cchip_timer;
/* devices */
required_device<cpu_device> m_maincpu;

View File

@ -85,6 +85,8 @@ private:
int m_videomode;
int m_old_videomode;
emu_timer *m_static_vblank_timer;
required_device<cpu_device> m_maincpu;
optional_device<cassette_image_device> m_cassette;
optional_device<ram_device> m_messram;

View File

@ -112,6 +112,9 @@ public:
int m_ti_number_of_frames;
std::unique_ptr<uint8_t[]> m_frames;
uint8_t * m_bios;
emu_timer *m_ti85_timer;
emu_timer *m_ti83_1st_timer;
emu_timer *m_ti83_2nd_timer;
DECLARE_READ8_MEMBER(ti85_port_0000_r);
DECLARE_READ8_MEMBER(ti8x_keypad_r);
DECLARE_READ8_MEMBER(ti85_port_0006_r);

View File

@ -116,6 +116,7 @@ private:
uint8_t m_aylatch;
bool m_stack_state;
bool m_romen;
emu_timer *m_reset_check_timer;
void update_mem();
};

View File

@ -114,6 +114,7 @@ public:
int m_lx383_downsampler;
uint8_t m_lx385_ctrl;
emu_timer *m_cassette_timer;
emu_timer *m_kbd_timer;
z80ne_cass_data_t m_cass_data;
wd17xx_state_t m_wd17xx_state;
DECLARE_READ8_MEMBER(lx383_r);

View File

@ -69,7 +69,8 @@ TIMER_CALLBACK_MEMBER(bk_state::keyboard_callback)
void bk_state::machine_start()
{
machine().scheduler().timer_pulse(attotime::from_hz(2400), timer_expired_delegate(FUNC(bk_state::keyboard_callback),this));
m_kbd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bk_state::keyboard_callback), this));
m_kbd_timer->adjust(attotime::from_hz(2400), 0, attotime::from_hz(2400));
}
IRQ_CALLBACK_MEMBER(bk_state::bk0010_irq_callback)

View File

@ -1110,11 +1110,15 @@ void hp48_state::hp48_machine_start( hp48_models model )
}
/* timers */
machine().scheduler().timer_pulse(attotime::from_hz( 16 ), timer_expired_delegate(FUNC(hp48_state::hp48_timer1_cb),this));
machine().scheduler().timer_pulse(attotime::from_hz( 8192 ), timer_expired_delegate(FUNC(hp48_state::hp48_timer2_cb),this));
m_1st_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hp48_state::hp48_timer1_cb), this));
m_1st_timer->adjust(attotime::from_hz( 16 ), 0, attotime::from_hz( 16 ));
m_2nd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hp48_state::hp48_timer2_cb), this));
m_2nd_timer->adjust(attotime::from_hz( 8192 ), 0, attotime::from_hz( 8192 ));
/* 1ms keyboard polling */
machine().scheduler().timer_pulse(attotime::from_msec( 1 ), timer_expired_delegate(FUNC(hp48_state::hp48_kbd_cb),this));
m_kbd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hp48_state::hp48_kbd_cb), this));
m_kbd_timer->adjust(attotime::from_msec( 1 ), 0, attotime::from_msec( 1 ));
/* save state */
save_item(NAME(m_out) );

View File

@ -945,7 +945,8 @@ void lisa_state::machine_start()
m_mouse_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(lisa_state::handle_mouse),this));
/* read command every ms (don't know the real value) */
machine().scheduler().timer_pulse(attotime::from_msec(1), timer_expired_delegate(FUNC(lisa_state::set_COPS_ready),this));
m_cops_ready_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(lisa_state::set_COPS_ready), this));
m_cops_ready_timer->adjust(attotime::from_msec(1), 0, attotime::from_msec(1));
m_nvram->set_base(m_fdc_ram, 1024);
}

View File

@ -2,7 +2,7 @@
// copyright-holders:Krzysztof Strzecha
/***************************************************************************
machine.c
lviv.cpp
Functions to emulate general aspects of PK-01 Lviv (RAM, ROM, interrupts,
I/O ports)
@ -208,8 +208,6 @@ void lviv_state::machine_reset()
membank("bank3")->set_base(mem + 0x010000);
membank("bank4")->set_base(mem + 0x010000);
/*machine().scheduler().timer_pulse(TIME_IN_NSEC(200), FUNC(lviv_draw_pixel));*/
/*memset(m_ram->pointer(), 0, sizeof(unsigned char)*0xffff);*/
}

View File

@ -815,11 +815,9 @@ READ16_MEMBER(rbisland_state::rbisland_cchip_ram_r)
void rbisland_state::rbisland_cchip_init( int version )
{
int i;
m_extra_version = version;
for (i = 0; i < 8; i++)
for (int i = 0; i < 8; i++)
{
m_CRAM[i] = std::make_unique<uint8_t[]>(0x400);
@ -828,5 +826,6 @@ void rbisland_state::rbisland_cchip_init( int version )
save_item(m_current_bank, "cchip/m_current_bank");
machine().scheduler().timer_pulse(attotime::from_hz(60), timer_expired_delegate(FUNC(rbisland_state::cchip_timer),this));
m_cchip_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rbisland_state::cchip_timer), this));
m_cchip_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60));
}

View File

@ -238,7 +238,8 @@ WRITE8_MEMBER( rm380z_state::disk_0_control )
void rm380z_state::machine_start()
{
machine().scheduler().timer_pulse(attotime::from_hz(TIMER_SPEED), timer_expired_delegate(FUNC(rm380z_state::static_vblank_timer),this));
m_static_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rm380z_state::static_vblank_timer), this));
m_static_vblank_timer->adjust(attotime::from_hz(TIMER_SPEED), 0, attotime::from_hz(TIMER_SPEED));
}
DRIVER_INIT_MEMBER( rm380z_state, rm380z )

View File

@ -2,7 +2,7 @@
// copyright-holders:Krzysztof Strzecha,Jon Sturm
/***************************************************************************
TI-85 driver by Krzysztof Strzecha
TI-83 Plus, TI-84 Plus, and Siliver Edition support by Jon Sturm
TI-83 Plus, TI-84 Plus, and Silver Edition support by Jon Sturm
Functions to emulate general aspects of the machine (RAM, ROM, interrupts,
I/O ports)
@ -255,7 +255,8 @@ void ti85_state::machine_start()
m_port4_bit0 = 0;
m_ti81_port_7_data = 0;
machine().scheduler().timer_pulse(attotime::from_hz(256), timer_expired_delegate(FUNC(ti85_state::ti85_timer_callback),this));
m_ti85_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti85_timer_callback), this));
m_ti85_timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256));
space.unmap_write(0x0000, 0x3fff);
space.unmap_write(0x4000, 0x7fff);
@ -316,10 +317,10 @@ MACHINE_START_MEMBER(ti85_state,ti83p)
ti85_state::update_ti83p_memory();
machine().scheduler().timer_pulse(attotime::from_hz(256), timer_expired_delegate(FUNC(ti85_state::ti83_timer1_callback),this));
machine().scheduler().timer_pulse(attotime::from_hz(512), timer_expired_delegate(FUNC(ti85_state::ti83_timer2_callback),this));
m_ti83_1st_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti83_timer1_callback), this));
m_ti83_1st_timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256));
m_ti83_2nd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti83_timer2_callback), this));
m_ti83_2nd_timer->adjust(attotime::from_hz(512), 0, attotime::from_hz(512));
/* save states and debugging */
save_item(NAME(m_timer_interrupt_status));
@ -357,8 +358,10 @@ void ti85_state::ti8xpse_init_common()
ti85_state::update_ti83pse_memory();
machine().scheduler().timer_pulse(attotime::from_hz(256), timer_expired_delegate(FUNC(ti85_state::ti83_timer1_callback),this));
machine().scheduler().timer_pulse(attotime::from_hz(512), timer_expired_delegate(FUNC(ti85_state::ti83_timer2_callback),this));
m_ti83_1st_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti83_timer1_callback), this));
m_ti83_1st_timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256));
m_ti83_2nd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti83_timer2_callback), this));
m_ti83_2nd_timer->adjust(attotime::from_hz(512), 0, attotime::from_hz(512));
m_crystal_timer1 = timer_alloc(CRYSTAL_TIMER1);
m_crystal_timer2 = timer_alloc(CRYSTAL_TIMER2);
@ -427,7 +430,8 @@ MACHINE_START_MEMBER(ti85_state,ti86)
membank("bank4")->set_base(m_ti8x_ram.get());
machine().device<nvram_device>("nvram")->set_base(m_ti8x_ram.get(), sizeof(uint8_t)*128*1024);
machine().scheduler().timer_pulse(attotime::from_hz(256), timer_expired_delegate(FUNC(ti85_state::ti85_timer_callback),this));
m_ti85_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti85_timer_callback), this));
m_ti85_timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256));
}

View File

@ -218,7 +218,8 @@ READ8_MEMBER(vector06_state::pit8253_r)
void vector06_state::machine_start()
{
machine().scheduler().timer_pulse(attotime::from_hz(50), timer_expired_delegate(FUNC(vector06_state::reset_check_callback),this));
m_reset_check_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vector06_state::reset_check_callback), this));
m_reset_check_timer->adjust(attotime::from_hz(50), 0, attotime::from_hz(50));
}
void vector06_state::machine_reset()

View File

@ -351,8 +351,9 @@ MACHINE_START_MEMBER(z80ne_state,z80ne)
save_item(NAME(m_lx383_scan_counter));
save_item(NAME(m_lx383_downsampler));
save_item(NAME(m_lx383_key));
m_cassette_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z80ne_state::z80ne_cassette_tc),this));
machine().scheduler().timer_pulse( attotime::from_hz(1000), timer_expired_delegate(FUNC(z80ne_state::z80ne_kbd_scan),this));
m_cassette_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z80ne_state::z80ne_cassette_tc), this));
m_kbd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z80ne_state::z80ne_kbd_scan), this));
m_kbd_timer->adjust(attotime::from_hz(1000), 0, attotime::from_hz(1000));
}
MACHINE_START_MEMBER(z80ne_state,z80net)

View File

@ -108,7 +108,8 @@ void vt100_video_device::device_start()
m_write_clear_video_interrupt.resolve_safe();
// LBA7 is scan line frequency update
machine().scheduler().timer_pulse(attotime::from_nsec(31778), timer_expired_delegate(FUNC(vt100_video_device::lba7_change), this));
m_lba7_change_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vt100_video_device::lba7_change), this));
m_lba7_change_timer->adjust(attotime::from_nsec(31778), 0, attotime::from_nsec(31778));
save_item(NAME(m_lba7));
save_item(NAME(m_scroll_latch));

View File

@ -64,6 +64,7 @@ protected:
uint8_t m_fill_lines;
uint8_t m_frequency;
uint8_t m_interlaced;
emu_timer * m_lba7_change_timer;
required_region_ptr<uint8_t> m_char_rom; /* character rom region */
required_device<palette_device> m_palette;