diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2016-08-03 18:01:49 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2016-08-05 19:05:01 -0400 |
commit | da754c80782425a4c63d2da0a2635ca4fbaf16a5 (patch) | |
tree | 22e55dc4ec81a097a24346d2d735ad8348315933 /src/mame/drivers/meyc8088.cpp | |
parent | 1317019974231191a0a42d732ef9b603dcd00896 (diff) |
Devfind revision phase 2 (nw)
- Eliminate read_safe as a global function and make it a method of optional_ioport (and required_ioport, for which it makes less sense).
- New constructor for optional_ioport_array and required_ioport_array using std::initializer_list to specify tag list
- Remove pointer/reference conversion operators for required_ioport and optional_ioport. Explicit getters like found() and target() are now required when dereferencing isn't wanted. Many drivers have been changed to use required_ioport_array and optional_ioport_array to make this cleaner.
- Update numerous drivers that were using read_safe to use I/O port finders generally. Port names have been kept the same as far as possible to avoid breaking saves.(Some of the optional finders should probably be required.)
- Give edfbl and monkelf their own memory maps so hacky input reading routines can be removed.
- Clean up some legacy static handlers in amiga.cpp and cubo.cpp.
Diffstat (limited to 'src/mame/drivers/meyc8088.cpp')
-rw-r--r-- | src/mame/drivers/meyc8088.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mame/drivers/meyc8088.cpp b/src/mame/drivers/meyc8088.cpp index 7e8edcf4169..59336da1d2e 100644 --- a/src/mame/drivers/meyc8088.cpp +++ b/src/mame/drivers/meyc8088.cpp @@ -43,7 +43,8 @@ public: m_maincpu(*this,"maincpu"), m_vram(*this, "vram"), m_heartbeat(*this, "heartbeat"), - m_dac(*this, "dac") + m_dac(*this, "dac"), + m_switches(*this, {"C0", "C1", "C2", "C3"}) { } required_device<cpu_device> m_maincpu; @@ -51,6 +52,8 @@ public: required_device<timer_device> m_heartbeat; required_device<dac_device> m_dac; + optional_ioport_array<4> m_switches; + UINT8 m_status; UINT8 m_common; @@ -231,10 +234,10 @@ READ8_MEMBER(meyc8088_state::meyc8088_input_r) UINT8 ret = 0xff; // multiplexed switch inputs - if (~m_common & 1) ret &= read_safe(ioport("C0"), 0); // bit switches - if (~m_common & 2) ret &= read_safe(ioport("C1"), 0); // control switches - if (~m_common & 4) ret &= read_safe(ioport("C2"), 0); // light switches - if (~m_common & 8) ret &= read_safe(ioport("C3"), 0); // light switches + if (~m_common & 1) ret &= m_switches[0].read_safe(0); // bit switches + if (~m_common & 2) ret &= m_switches[1].read_safe(0); // control switches + if (~m_common & 4) ret &= m_switches[2].read_safe(0); // light switches + if (~m_common & 8) ret &= m_switches[3].read_safe(0); // light switches return ret; } |