diff options
| author | 2018-04-29 19:48:38 -0400 | |
|---|---|---|
| committer | 2018-04-29 19:48:38 -0400 | |
| commit | 1185fb25f3342ea08072fd79f2ccaf0e5aea6a47 (patch) | |
| tree | ae211b7c83f066c071e267346336640ae6535959 /src/emu/output.cpp | |
| parent | 9927ef444061fdd3410fda71a79717558d4a0daa (diff) | |
devcb updates (nw)
- Write callbacks can now be configured as `OUTPUT("item_name")`. This behaves equivalently to a zero-dimensional `output_finder`, while eliminating the need to instantiate and resolve this in driver classes separately from the callback itself.
- The width of a callback's default mask now properly depends on its type (as was half-implemented before), instead of always being reset to 0xffffffffffffffff when actually configured. This allows MCFG_DEVCB_INVERT to work with line write callbacks as one might logically expect.
Diffstat (limited to 'src/emu/output.cpp')
| -rw-r--r-- | src/emu/output.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/emu/output.cpp b/src/emu/output.cpp index f31bb0a8e52..5969d1dbfc5 100644 --- a/src/emu/output.cpp +++ b/src/emu/output.cpp @@ -58,9 +58,7 @@ void output_manager::output_item::notify(s32 value) void output_manager::item_proxy::resolve(device_t &device, std::string const &name) { assert(!m_item); - m_item = device.machine().output().find_item(name.c_str()); - if (!m_item) - m_item = &device.machine().output().create_new_item(name.c_str(), 0); + m_item = &device.machine().output().find_or_create_item(name.c_str(), 0); } @@ -110,6 +108,12 @@ output_manager::output_item &output_manager::create_new_item(const char *outname return ins.first->second; } +output_manager::output_item &output_manager::find_or_create_item(const char *outname, s32 value) +{ + output_item *const item = find_item(outname); + return item ? *item : create_new_item(outname, value); +} + /*------------------------------------------------- output_pause - send pause message -------------------------------------------------*/ |
