From 56ee4e784c8a30244700f25ae5cd2b3d197aa5c5 Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 22 Aug 2018 18:21:06 -0400 Subject: [PATCH] screen.h: Fix have_screen_update(), which was broken and returned false under any valid configuration, and rename the function has_screen_update(). This fixes regressions in granny and other drivers using custom update functions with CDP1861, CDP1864 and TMS992x VDPs. tms9928a: Eliminate the clock validity check, which has fulfilled its purpose (nw) --- src/devices/sound/cdp1864.cpp | 2 +- src/devices/video/cdp1861.cpp | 2 +- src/devices/video/tms9928a.cpp | 8 +------- src/devices/video/tms9928a.h | 1 - src/emu/screen.h | 2 +- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/devices/sound/cdp1864.cpp b/src/devices/sound/cdp1864.cpp index c8d13cda92c..58697352b8d 100644 --- a/src/devices/sound/cdp1864.cpp +++ b/src/devices/sound/cdp1864.cpp @@ -94,7 +94,7 @@ void cdp1864_device::device_config_complete() if (!screen().refresh_attoseconds()) screen().set_raw(clock(), SCREEN_WIDTH, HBLANK_END, HBLANK_START, TOTAL_SCANLINES, SCANLINE_VBLANK_END, SCANLINE_VBLANK_START); - if (!screen().have_screen_update()) + if (!screen().has_screen_update()) screen().set_screen_update(screen_update_rgb32_delegate(FUNC(cdp1864_device::screen_update), this)); } diff --git a/src/devices/video/cdp1861.cpp b/src/devices/video/cdp1861.cpp index 9748d5e03c1..7b4e7bb8fd6 100644 --- a/src/devices/video/cdp1861.cpp +++ b/src/devices/video/cdp1861.cpp @@ -68,7 +68,7 @@ void cdp1861_device::device_config_complete() if (!screen().refresh_attoseconds()) screen().set_raw(clock(), SCREEN_WIDTH, HBLANK_END, HBLANK_START, TOTAL_SCANLINES, SCANLINE_VBLANK_END, SCANLINE_VBLANK_START); - if (!screen().have_screen_update()) + if (!screen().has_screen_update()) screen().set_screen_update(screen_update_rgb32_delegate(FUNC(cdp1861_device::screen_update), this)); } diff --git a/src/devices/video/tms9928a.cpp b/src/devices/video/tms9928a.cpp index bf43f141d28..55fae79ef2b 100644 --- a/src/devices/video/tms9928a.cpp +++ b/src/devices/video/tms9928a.cpp @@ -75,7 +75,7 @@ void tms9928a_device::device_config_complete() if (!has_screen()) return; - if (!screen().have_screen_update()) + if (!screen().has_screen_update()) screen().set_screen_update(screen_update_rgb32_delegate(FUNC(tms9928a_device::screen_update), this)); if (!screen().refresh_attoseconds()) @@ -130,12 +130,6 @@ tms9929a_device::tms9929a_device(const machine_config &mconfig, const char *tag, { } -void tms9928a_device::device_validity_check(validity_checker &valid) const -{ - if (clock() < 6'000'000) - osd_printf_error("%d Hz clock is too slow!\n", clock()); -} - device_memory_interface::space_config_vector tms9928a_device::memory_space_config() const { return space_config_vector { diff --git a/src/devices/video/tms9928a.h b/src/devices/video/tms9928a.h index fe87b2672bf..b69a61d870d 100644 --- a/src/devices/video/tms9928a.h +++ b/src/devices/video/tms9928a.h @@ -97,7 +97,6 @@ protected: // device-level overrides virtual void device_config_complete() override; - virtual void device_validity_check(validity_checker &valid) const override; virtual void device_start() override; virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/emu/screen.h b/src/emu/screen.h index 2b72a2691ac..3215fc6cd7e 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -195,7 +195,7 @@ public: float yoffset() const { return m_yoffset; } float xscale() const { return m_xscale; } float yscale() const { return m_yscale; } - bool have_screen_update() const { return !m_screen_update_ind16.isnull() && !m_screen_update_rgb32.isnull(); } + bool has_screen_update() const { return !m_screen_update_ind16.isnull() || !m_screen_update_rgb32.isnull(); } // inline configuration helpers void set_type(screen_type_enum type) { assert(!configured()); m_type = type; }