diff options
author | 2023-06-17 01:10:05 +1000 | |
---|---|---|
committer | 2023-06-17 01:10:05 +1000 | |
commit | e9c1f4a42a6758a6fb75403e28c7dc6cf869081c (patch) | |
tree | 8e0b6d960bed4baec2408c9ab950218592ef33ec /src/devices/video/vic4567.cpp | |
parent | c1ceb6e016763537c5109cc76fe5d1b4ae72fdb3 (diff) |
emu/devcb.h: Eliminated the need to call resolve() on callbacks. (#11333)
Read callbacks now need a default return value supplied at construction.
Replaced isnull() with isunset() which tells you if the callback wasn't
configured rather than whether it isn't safe to call.
Enabled validation of device callbacks (it seems it was disabled at some
point, probably accidentally).
Device callbacks and object finders now implement the same interface for
resolution.
Diffstat (limited to 'src/devices/video/vic4567.cpp')
-rw-r--r-- | src/devices/video/vic4567.cpp | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/devices/video/vic4567.cpp b/src/devices/video/vic4567.cpp index ead044f387c..1208bd243f9 100644 --- a/src/devices/video/vic4567.cpp +++ b/src/devices/video/vic4567.cpp @@ -155,14 +155,14 @@ vic3_device::vic3_device(const machine_config &mconfig, const char *tag, device_ , device_video_interface(mconfig, *this) , m_type(vic3_type::NTSC) , m_cpu(*this, finder_base::DUMMY_TAG) - , m_dma_read_cb(*this) - , m_dma_read_color_cb(*this) + , m_dma_read_cb(*this, 0) + , m_dma_read_color_cb(*this, 0) , m_interrupt_cb(*this) , m_port_changed_cb(*this) - , m_lightpen_button_cb(*this) - , m_lightpen_x_cb(*this) - , m_lightpen_y_cb(*this) - , m_c64_mem_r_cb(*this) + , m_lightpen_button_cb(*this, 0) + , m_lightpen_x_cb(*this, 0) + , m_lightpen_y_cb(*this, 0) + , m_c64_mem_r_cb(*this, 0) { } @@ -177,18 +177,6 @@ void vic3_device::device_start() m_bitmap = std::make_unique<bitmap_ind16>(width, height); - m_dma_read_cb.resolve_safe(0); - m_dma_read_color_cb.resolve_safe(0); - m_interrupt_cb.resolve_safe(); - - m_port_changed_cb.resolve(); - - m_c64_mem_r_cb.resolve_safe(0); - - m_lightpen_button_cb.resolve_safe(0); - m_lightpen_x_cb.resolve_safe(0); - m_lightpen_y_cb.resolve_safe(0); - m_screendata = std::make_unique<uint8_t []>(216 * 656 / 8); m_screenptr[0] = m_screendata.get(); @@ -1456,12 +1444,9 @@ void vic3_device::port_w(offs_t offset, uint8_t data) m_reg[offset] = data; break; case 0x30: + DBG_LOG(2, "vic write", ("%.2x:%.2x\n", offset, data)); m_reg[offset] = data; - if (!m_port_changed_cb.isnull()) - { - DBG_LOG(2, "vic write", ("%.2x:%.2x\n", offset, data)); - m_port_changed_cb((offs_t)0,data); - } + m_port_changed_cb(offs_t(0), data); break; case 0x31: m_reg[offset] = data; |