diff options
author | Vas Crabb <vas@vastheman.com> | 2021-09-16 03:14:26 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2021-09-16 03:14:26 +1000 |
commit | 263e1af894fae8ac752a52637d555952d8a2d3af (patch) | |
tree | c9870de630704f6535af9e4c56e3d7e645048c9f | |
parent | d334586156dabf0db220b843c81f2a54cc3a2ece (diff) |
Fixed some delegate use issues.
-rw-r--r-- | src/lib/util/delegate.h | 9 | ||||
-rw-r--r-- | src/mame/drivers/tomy_princ.cpp | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/util/delegate.h b/src/lib/util/delegate.h index 169a48e2195..6f2c1feb0a6 100644 --- a/src/lib/util/delegate.h +++ b/src/lib/util/delegate.h @@ -585,7 +585,7 @@ private: static functoid_setter make_functoid_setter() { using unwrapped_type = std::remove_cv_t<std::remove_reference_t<T> >; - if constexpr (matching_non_const_call(&T::operator())) + if constexpr (matching_non_const_call(&unwrapped_type::operator())) { return [] (delegate &obj) @@ -596,7 +596,7 @@ private: std::any_cast<unwrapped_type>(&obj.m_functoid))); }; } - else if constexpr (matching_const_call(&T::operator())) + else if constexpr (matching_const_call(&unwrapped_type::operator())) { return [] (delegate &obj) @@ -643,6 +643,11 @@ public: m_set_functoid(*this); } + delegate(delegate &src) + : delegate(const_cast<delegate const &>(src)) + { + } + delegate(delegate &&src) : basetype(src.m_functoid.has_value() ? basetype() : std::move(src)) , m_functoid(std::move(src.m_functoid)) diff --git a/src/mame/drivers/tomy_princ.cpp b/src/mame/drivers/tomy_princ.cpp index 7723dcfcf17..c8ab9273097 100644 --- a/src/mame/drivers/tomy_princ.cpp +++ b/src/mame/drivers/tomy_princ.cpp @@ -124,10 +124,10 @@ uint32_t tomy_princ_state::screen_update_tomy_princ(screen_device &screen, bitma // fe2d25 void tomy_princ_state::princ_map(address_map &map) { - map(0x000001, 0x000001).lw8([](u8 data) { return 0xff; }, "free2"); + map(0x000001, 0x000001).lw8([] (u8 data) { }, "free2"); map(0x000008, 0x000008).r(FUNC(tomy_princ_state::read_gpu_status)); - map(0x68ff00, 0x68ff00).lw8([this](u8 data) { bFirstPort8Read = true; }, "free1"); - map(0x68ff44, 0x68ff44).lr8([this]() -> u8 { return m_screen->vblank() ? 0x11 : 0x10; }, "free0"); + map(0x68ff00, 0x68ff00).lw8([this] (u8 data) { bFirstPort8Read = true; }, "free1"); + map(0x68ff44, 0x68ff44).lr8([this] () -> u8 { return m_screen->vblank() ? 0x11 : 0x10; }, "free0"); map(0xe00000, 0xe07fff).ram(); // stacks are placed here map(0xf00000, 0xffffff).rom().region("maincpu", 0x00000); } |