mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
devcb.h: Revert unnecessary change from ed0202220a
(nw)
isnull() checks the list of unresolved functions along with the list of resolved ones, so resolve_safe() doesn't really need a return value as long as it is called second.
This commit is contained in:
parent
a620f24ffc
commit
f9745cdafc
@ -73,10 +73,10 @@ ALLOW_SAVE_TYPE(attotime); // m_acc
|
||||
void pwm_display_device::device_start()
|
||||
{
|
||||
// resolve handlers
|
||||
bool cb1 = m_output_x_cb.resolve_safe();
|
||||
bool cb2 = m_output_a_cb.resolve_safe();
|
||||
bool cb3 = m_output_digit_cb.resolve_safe();
|
||||
m_external_output = cb1 || cb2 || cb3;
|
||||
m_external_output = !m_output_x_cb.isnull() || !m_output_a_cb.isnull() || !m_output_digit_cb.isnull();
|
||||
m_output_x_cb.resolve_safe();
|
||||
m_output_a_cb.resolve_safe();
|
||||
m_output_digit_cb.resolve_safe();
|
||||
|
||||
if (!m_external_output)
|
||||
{
|
||||
|
@ -899,7 +899,7 @@ public:
|
||||
virtual void validity_check(validity_checker &valid) const override;
|
||||
|
||||
void resolve();
|
||||
bool resolve_safe(Result dflt);
|
||||
void resolve_safe(Result dflt);
|
||||
|
||||
Result operator()(address_space &space, offs_t offset = 0, std::make_unsigned_t<Result> mem_mask = DefaultMask);
|
||||
Result operator()(offs_t offset, std::make_unsigned_t<Result> mem_mask = DefaultMask);
|
||||
@ -958,13 +958,11 @@ void devcb_read<Result, DefaultMask>::resolve()
|
||||
}
|
||||
|
||||
template <typename Result, std::make_unsigned_t<Result> DefaultMask>
|
||||
bool devcb_read<Result, DefaultMask>::resolve_safe(Result dflt)
|
||||
void devcb_read<Result, DefaultMask>::resolve_safe(Result dflt)
|
||||
{
|
||||
resolve();
|
||||
bool resolved = !m_functions.empty();
|
||||
if (!resolved)
|
||||
if (m_functions.empty())
|
||||
m_functions.emplace_back([dflt] (address_space &space, offs_t offset, std::make_unsigned_t<Result> mem_mask) { return dflt; });
|
||||
return resolved;
|
||||
}
|
||||
|
||||
template <typename Result, std::make_unsigned_t<Result> DefaultMask>
|
||||
@ -2371,7 +2369,7 @@ public:
|
||||
virtual void validity_check(validity_checker &valid) const override;
|
||||
|
||||
void resolve();
|
||||
bool resolve_safe();
|
||||
void resolve_safe();
|
||||
|
||||
void operator()(address_space &space, offs_t offset, Input data, std::make_unsigned_t<Input> mem_mask = DefaultMask);
|
||||
void operator()(address_space &space, Input data);
|
||||
@ -2422,13 +2420,11 @@ void devcb_write<Input, DefaultMask>::resolve()
|
||||
}
|
||||
|
||||
template <typename Input, std::make_unsigned_t<Input> DefaultMask>
|
||||
bool devcb_write<Input, DefaultMask>::resolve_safe()
|
||||
void devcb_write<Input, DefaultMask>::resolve_safe()
|
||||
{
|
||||
resolve();
|
||||
bool resolved = !m_functions.empty();
|
||||
if (!resolved)
|
||||
if (m_functions.empty())
|
||||
m_functions.emplace_back([] (address_space &space, offs_t offset, Input data, std::make_unsigned_t<Input> mem_mask) { });
|
||||
return resolved;
|
||||
}
|
||||
|
||||
template <typename Input, std::make_unsigned_t<Input> DefaultMask>
|
||||
|
Loading…
Reference in New Issue
Block a user