summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2021-09-10 11:09:56 -0700
committer Aaron Giles <aaron@aarongiles.com>2021-09-10 11:09:56 -0700
commite94edaf482f4fb5644703599108ee7ce3b5ebbd1 (patch)
treee3a167691e9f55b16ca89cebfaa43ad846bfdad3
parentfedb40f712d34bb2b6904487ce88dd124e26c7f5 (diff)
Fix merge errors and update new/changed drivers to latest APIs.
-rw-r--r--src/devices/bus/a2bus/a2sd.cpp2
-rw-r--r--src/devices/bus/a2bus/a2sd.h2
-rw-r--r--src/devices/machine/clock.cpp2
-rw-r--r--src/devices/machine/upd4991a.cpp4
-rw-r--r--src/devices/machine/upd4991a.h2
-rw-r--r--src/emu/attotime.h5
-rw-r--r--src/emu/machine.cpp2
-rw-r--r--src/mame/audio/redalert.cpp4
-rw-r--r--src/mame/drivers/cchasm.cpp6
-rw-r--r--src/mame/drivers/exidy.cpp8
-rw-r--r--src/mame/drivers/gm1000.cpp2
-rw-r--r--src/mame/drivers/kinst.cpp44
-rw-r--r--src/mame/drivers/pc9801.cpp4
-rw-r--r--src/mame/drivers/pipeline.cpp4
-rw-r--r--src/mame/includes/pc9801.h2
15 files changed, 23 insertions, 70 deletions
diff --git a/src/devices/bus/a2bus/a2sd.cpp b/src/devices/bus/a2bus/a2sd.cpp
index 7a5208e473f..d17b1f133c7 100644
--- a/src/devices/bus/a2bus/a2sd.cpp
+++ b/src/devices/bus/a2bus/a2sd.cpp
@@ -119,7 +119,7 @@ void a2bus_a2sd_device::device_reset()
m_sdcard->spi_clock_w(CLEAR_LINE);
}
-void a2bus_a2sd_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+void a2bus_a2sd_device::device_timer(timer_instance const &timer)
{
LOGMASKED(LOG_SPI, ">>>>>>> SHIFT %d (%c)\n", m_shift_count, (m_shift_count & 1) ? 'L' : 'S');
if (!(m_shift_count & 1))
diff --git a/src/devices/bus/a2bus/a2sd.h b/src/devices/bus/a2bus/a2sd.h
index c4d8b4c8f02..bb19ce6ae56 100644
--- a/src/devices/bus/a2bus/a2sd.h
+++ b/src/devices/bus/a2bus/a2sd.h
@@ -36,7 +36,7 @@ protected:
virtual void device_reset() override;
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+ virtual void device_timer(timer_instance const &timer) override;
// overrides of standard a2bus slot functions
virtual u8 read_c0nx(u8 offset) override;
diff --git a/src/devices/machine/clock.cpp b/src/devices/machine/clock.cpp
index 64e937ffb29..f86033f3088 100644
--- a/src/devices/machine/clock.cpp
+++ b/src/devices/machine/clock.cpp
@@ -72,7 +72,7 @@ void clock_device::output()
void clock_device::device_timer(timer_instance const &timer)
{
- switch (id)
+ switch (timer.id())
{
case TID_CLOCK_INIT:
{
diff --git a/src/devices/machine/upd4991a.cpp b/src/devices/machine/upd4991a.cpp
index da192819024..b64e02e4ec3 100644
--- a/src/devices/machine/upd4991a.cpp
+++ b/src/devices/machine/upd4991a.cpp
@@ -69,9 +69,9 @@ void upd4991a_device::device_start()
}
-void upd4991a_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+void upd4991a_device::device_timer(timer_instance const &timer)
{
- switch (id)
+ switch (timer.id())
{
case TIMER_CLOCK:
advance_seconds();
diff --git a/src/devices/machine/upd4991a.h b/src/devices/machine/upd4991a.h
index 64746980a87..f91d5357f33 100644
--- a/src/devices/machine/upd4991a.h
+++ b/src/devices/machine/upd4991a.h
@@ -35,7 +35,7 @@ protected:
// device-level overrides
virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+ virtual void device_timer(timer_instance const &timer) override;
virtual void rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second) override;
private:
diff --git a/src/emu/attotime.h b/src/emu/attotime.h
index c4c41069a75..589098b7adf 100644
--- a/src/emu/attotime.h
+++ b/src/emu/attotime.h
@@ -1018,12 +1018,7 @@ inline constexpr bool operator>=(const attotime &left, const attotime &right) no
// string describing a subseconds value
//-------------------------------------------------
-<<<<<<< HEAD
inline const char *subseconds::as_string(int precision, bool dividers) const noexcept
-=======
-/** Create an attotime from a tick count @p ticks at the given frequency @p frequency */
-inline attotime attotime::from_ticks(u64 ticks, u32 frequency)
->>>>>>> master
{
// just leverage the full attotime logic to do this
return attotime(*this).as_string(precision, dividers);
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp
index 2c1c9eab81f..c394c553ca1 100644
--- a/src/emu/machine.cpp
+++ b/src/emu/machine.cpp
@@ -834,7 +834,7 @@ void running_machine::handle_saveload(bool load)
// open the file
emu_file file(m_saveload_searchpath ? m_saveload_searchpath : "", openflags);
auto const filerr = file.open(m_saveload_pending_file);
- if (filerr == osd_file::error::NONE)
+ if (!filerr)
{
// read/write the save state
save_error saverr = load ? m_save.read_file(file) : m_save.write_file(file);
diff --git a/src/mame/audio/redalert.cpp b/src/mame/audio/redalert.cpp
index d0197dea98a..edcf0eba567 100644
--- a/src/mame/audio/redalert.cpp
+++ b/src/mame/audio/redalert.cpp
@@ -318,8 +318,8 @@ void panther_audio_device::device_add_mconfig(machine_config &config)
void demoneye_audio_device::device_start()
{
- m_audio_irq_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(demoneye_audio_device::audio_irq_on), this));
- m_audio_irq_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(demoneye_audio_device::audio_irq_off), this));
+ m_audio_irq_on_timer = timer_alloc(*this, FUNC(demoneye_audio_device::audio_irq_on));
+ m_audio_irq_off_timer = timer_alloc(*this, FUNC(demoneye_audio_device::audio_irq_off));
m_audio_irq_on_timer->adjust(REDALERT_AUDIO_CPU_IRQ_FREQ, 0, REDALERT_AUDIO_CPU_IRQ_FREQ);
diff --git a/src/mame/drivers/cchasm.cpp b/src/mame/drivers/cchasm.cpp
index e40fa754d2e..29ec283700b 100644
--- a/src/mame/drivers/cchasm.cpp
+++ b/src/mame/drivers/cchasm.cpp
@@ -65,7 +65,7 @@ protected:
TIMER_REFRESH_END
};
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+ virtual void device_timer(timer_instance const &timer) override;
virtual void machine_start() override;
@@ -320,9 +320,9 @@ WRITE_LINE_MEMBER(cchasm_state::ctc_timer_2_w)
}
-void cchasm_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+void cchasm_state::device_timer(timer_instance const &timer)
{
- switch (id)
+ switch (timer.id())
{
case TIMER_REFRESH_END:
m_maincpu->set_input_line(2, ASSERT_LINE);
diff --git a/src/mame/drivers/exidy.cpp b/src/mame/drivers/exidy.cpp
index 2060cb19ee1..6eb97677d33 100644
--- a/src/mame/drivers/exidy.cpp
+++ b/src/mame/drivers/exidy.cpp
@@ -215,7 +215,7 @@ protected:
required_device<palette_device> m_palette;
required_shared_ptr<uint8_t> m_color_latch;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+ virtual void device_timer(timer_instance const &timer) override;
virtual void video_start() override;
void base(machine_config &config);
@@ -1297,13 +1297,13 @@ void exidy_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
***************************************************************************/
-void exidy_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+void exidy_state::device_timer(timer_instance const &timer)
{
- switch (id)
+ switch (timer.id())
{
case TIMER_COLLISION_IRQ:
/* latch the collision bits */
- latch_condition(param);
+ latch_condition(timer.param());
/* set the IRQ line */
m_maincpu->set_input_line(0, ASSERT_LINE);
diff --git a/src/mame/drivers/gm1000.cpp b/src/mame/drivers/gm1000.cpp
index a7fa3a80860..d4547dbbc3c 100644
--- a/src/mame/drivers/gm1000.cpp
+++ b/src/mame/drivers/gm1000.cpp
@@ -91,7 +91,7 @@ void gm1000_state::gm1000(machine_config &config)
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
screen.set_refresh_hz(60);
- screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_vblank_time(subseconds::from_usec(2500)); /* not accurate */
screen.set_screen_update("lcdc", FUNC(hd44780_device::screen_update));
screen.set_size(6*24, 8*2);
screen.set_visarea_full();
diff --git a/src/mame/drivers/kinst.cpp b/src/mame/drivers/kinst.cpp
index 491458855aa..ff564ed9745 100644
--- a/src/mame/drivers/kinst.cpp
+++ b/src/mame/drivers/kinst.cpp
@@ -224,14 +224,7 @@ public:
void kinst(machine_config &config);
void kinst2(machine_config &config);
-<<<<<<< HEAD
-protected:
- virtual void machine_start() override;
- virtual void machine_reset() override;
- virtual void device_timer(timer_instance const &timer) override;
-=======
DECLARE_CUSTOM_INPUT_MEMBER(sound_status_r) { return BIT(m_dcs->control_r(), 11); }
->>>>>>> master
protected:
required_device<mips3_device> m_maincpu;
@@ -397,35 +390,6 @@ uint32_t kinst_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
/*************************************
*
-<<<<<<< HEAD
- * Interrupt handling
- *
- *************************************/
-
-void kinst_state::device_timer(timer_instance const &timer)
-{
- switch (timer.id())
- {
- case TIMER_IRQ0_STOP:
- m_maincpu->set_input_line(0, CLEAR_LINE);
- break;
- default:
- throw emu_fatalerror("Unknown id in kinst_state::device_timer");
- }
-}
-
-
-INTERRUPT_GEN_MEMBER(kinst_state::irq0_start)
-{
- device.execute().set_input_line(0, ASSERT_LINE);
- m_irq0_stop_timer->adjust(attotime::from_usec(50));
-}
-
-
-/*************************************
- *
-=======
->>>>>>> master
* IDE controller access
*
*************************************/
@@ -739,16 +703,8 @@ void kinst_state::kinst(machine_config &config)
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
-<<<<<<< HEAD
- screen.set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
- screen.set_refresh_hz(60);
- screen.set_vblank_time(subseconds::from_usec(2500)); /* not accurate */
- screen.set_size(320, 240);
- screen.set_visarea(0, 319, 0, 239);
-=======
screen.set_raw(6000000, 390, 0, 320, 261, 0, 240); // preliminary
screen.screen_vblank().set_inputline(m_maincpu, 0);
->>>>>>> master
screen.set_screen_update(FUNC(kinst_state::screen_update));
PALETTE(config, m_palette, palette_device::BGR_555);
diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp
index cbe0fc87694..330e05f7a04 100644
--- a/src/mame/drivers/pc9801.cpp
+++ b/src/mame/drivers/pc9801.cpp
@@ -946,9 +946,9 @@ template <unsigned port> u8 pc9801vm_state::fdc_2hd_2dd_ctrl_r()
return res;
}
-void pc9801vm_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+void pc9801vm_state::device_timer(timer_instance const &timer)
{
- switch (id)
+ switch (timer.id())
{
case TIMER_FDC_TRIGGER:
// TODO: sorcer definitely expects this irq to be taken
diff --git a/src/mame/drivers/pipeline.cpp b/src/mame/drivers/pipeline.cpp
index 16fd62d62a0..5429d5d8998 100644
--- a/src/mame/drivers/pipeline.cpp
+++ b/src/mame/drivers/pipeline.cpp
@@ -127,6 +127,7 @@ private:
TIMER_CALLBACK_MEMBER(vidctrl_deferred_w);
TIMER_CALLBACK_MEMBER(protection_deferred_w);
+ transient_timer_factory m_vidctrl_deferred_w;
transient_timer_factory m_protection_deferred_w;
void cpu0_mem(address_map &map);
@@ -157,6 +158,7 @@ void pipeline_state::machine_start()
save_item(NAME(m_from_mcu));
save_item(NAME(m_sound_data));
+ m_vidctrl_deferred_w.init(*this, FUNC(pipeline_state::vidctrl_deferred_w));
m_protection_deferred_w.init(*this, FUNC(pipeline_state::protection_deferred_w));
}
@@ -193,7 +195,7 @@ u32 pipeline_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
void pipeline_state::vidctrl_w(u8 data)
{
// synchronization is needed to avoid spurious CTC interrupts
- machine().scheduler().synchronize(timer_expired_delegate(FUNC(pipeline_state::vidctrl_deferred_w),this), data);
+ m_vidctrl_deferred_w.synchronize(data);
}
TIMER_CALLBACK_MEMBER(pipeline_state::vidctrl_deferred_w)
diff --git a/src/mame/includes/pc9801.h b/src/mame/includes/pc9801.h
index c33282530df..b99ea74c137 100644
--- a/src/mame/includes/pc9801.h
+++ b/src/mame/includes/pc9801.h
@@ -382,7 +382,7 @@ public:
void init_pc9801vm_kanji();
protected:
- void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+ void device_timer(timer_instance const &timer) override;
void pc9801rs_io(address_map &map);
void pc9801rs_map(address_map &map);