src/emu/ioport.c
| r15160 | r15161 | |
| 1660 | 1660 | // reset sequences and chars |
| 1661 | 1661 | for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) |
| 1662 | 1662 | m_seq[seqtype].set_default(); |
| 1663 | | m_chars[0] = m_chars[1] = m_chars[2] = unicode_char(0); |
| 1663 | m_chars[0] = m_chars[1] = m_chars[2] = m_chars[3] = unicode_char(0); |
| 1664 | 1664 | |
| 1665 | 1665 | // for DIP switches and configs, look for a default value from the owner |
| 1666 | 1666 | if (type == IPT_DIPSWITCH || type == IPT_CONFIG) |
| r15160 | r15161 | |
| 1832 | 1832 | |
| 1833 | 1833 | unicode_char ioport_field::keyboard_code(int which) const |
| 1834 | 1834 | { |
| 1835 | | unicode_char ch = m_chars[which]; |
| 1835 | unicode_char ch; |
| 1836 | |
| 1837 | if (which >= ARRAY_LENGTH(m_chars)) |
| 1838 | throw emu_fatalerror("Tried to access keyboard_code with out-of-range index %d\n", which); |
| 1839 | |
| 1840 | ch = m_chars[which]; |
| 1836 | 1841 | |
| 1837 | 1842 | // special hack to allow for PORT_CODE('\xA3') |
| 1838 | 1843 | if (ch >= 0xffffff80 && ch <= 0xffffffff) |
| r15160 | r15161 | |
| 3842 | 3847 | if (m_curfield->m_chars[index] == 0) |
| 3843 | 3848 | { |
| 3844 | 3849 | m_curfield->m_chars[index] = ch; |
| 3845 | | break; |
| 3850 | return; |
| 3846 | 3851 | } |
| 3852 | |
| 3853 | throw emu_fatalerror("PORT_CHAR(%d) could not be added - maximum amount exceeded\n", ch); |
| 3847 | 3854 | } |
| 3848 | 3855 | |
| 3849 | 3856 | |