summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ioport.cpp
diff options
context:
space:
mode:
author npwoods <npwoods@alumni.cmu.edu>2017-09-05 03:27:45 -0400
committer Vas Crabb <cuavas@users.noreply.github.com>2017-09-05 17:27:45 +1000
commit67ddfe302cdc18b356839797d166f7bfda4ce2af (patch)
tree93482da6674f4c198b71fcc385e026e256e27b9a /src/emu/ioport.cpp
parent37db5be46434728fb830d73ace0e6969e57aa6f5 (diff)
Added a natural keyboard validation to check for valid natural keyboard (uni)codes (#2618)
Diffstat (limited to 'src/emu/ioport.cpp')
-rw-r--r--src/emu/ioport.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp
index 85c41d56499..2ee04f28072 100644
--- a/src/emu/ioport.cpp
+++ b/src/emu/ioport.cpp
@@ -621,7 +621,7 @@ ioport_field::ioport_field(ioport_port &port, ioport_type type, ioport_value def
// reset sequences and chars
for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
m_seq[seqtype].set_default();
- m_chars[0] = m_chars[1] = m_chars[2] = m_chars[3] = char32_t(0);
+ std::fill(std::begin(m_chars), std::end(m_chars), char32_t(0));
// for DIP switches and configs, look for a default value from the owner
if (type == IPT_DIPSWITCH || type == IPT_CONFIG)
@@ -766,17 +766,10 @@ ioport_type_class ioport_field::type_class() const
char32_t ioport_field::keyboard_code(int which) const
{
- char32_t ch;
-
if (which >= ARRAY_LENGTH(m_chars))
throw emu_fatalerror("Tried to access keyboard_code with out-of-range index %d\n", which);
- ch = m_chars[which];
-
- // special hack to allow for PORT_CODE('\xA3')
- if (ch >= 0xffffff80 && ch <= 0xffffffff)
- ch &= 0xff;
- return ch;
+ return m_chars[which];
}