Previous 15994 Revisions Next

r15133 Thursday 10th May, 2012 at 14:41:20 UTC by Miodrag Milanović
Fixed natural keyboard issues in ioport (no whatsnew)
[src/emu]ioport.c ioport.h

src/emu/ioport.c
r15132r15133
992992     m_timer(NULL),
993993     m_current_rate(attotime::zero)
994994{
995     m_queue_chars = ioport_queue_chars_delegate();
996   m_accept_char = ioport_accept_char_delegate();
997   m_charqueue_empty = ioport_charqueue_empty_delegate();
998
995999   // reigster debugger commands
9961000   if (machine.debug_flags & DEBUG_FLAG_ENABLED)
9971001   {
r15132r15133
14231427
14241428const natural_keyboard::keycode_map_entry *natural_keyboard::find_code(unicode_char ch) const
14251429{
1426   for (int code = 0; m_keycode_map[code].ch != 0; code++)
1427      if (m_keycode_map[code].ch == ch)
1428         return &m_keycode_map[code];
1430   for (int index = 0; index < m_keycode_map.count(); index++)
1431   {
1432      if (m_keycode_map[index].ch == ch)
1433         return &m_keycode_map[index];
1434   }
14291435   return NULL;
14301436}
14311437
r15132r15133
25992605ioport_manager::ioport_manager(running_machine &machine)
26002606   : m_machine(machine),
26012607     m_safe_to_read(false),
2602     m_natkeyboard(machine),
2608     m_natkeyboard(NULL),
26032609     m_last_frame_time(attotime::zero),
26042610     m_last_delta_nsec(0),
26052611     m_record_file(machine.options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS),
r15132r15133
26602666               break;
26612667            }
26622668
2669   m_natkeyboard = global_alloc(natural_keyboard(machine()));
26632670   // register callbacks for when we load configurations
26642671   config_register(machine(), "input", config_saveload_delegate(FUNC(ioport_manager::load_config), this), config_saveload_delegate(FUNC(ioport_manager::save_config), this));
26652672
r15132r15133
27572764
27582765void ioport_manager::exit()
27592766{
2767   global_free(m_natkeyboard);
27602768   // close any playback or recording files
27612769   playback_end();
27622770   record_end();
src/emu/ioport.h
r15132r15133
836836   running_machine &machine() const { return m_machine; }
837837   bool empty() const { return (m_bufbegin == m_bufend); }
838838   bool full() const { return ((m_bufend + 1) % m_buffer.count()) == m_bufbegin; }
839   bool can_post() const { return (!m_queue_chars.isnull() || m_keycode_map.count() == 0); }
839   bool can_post() const { return (!m_queue_chars.isnull() || m_keycode_map.count() != 0); }
840840   bool is_posting() const { return (!empty() || (!m_charqueue_empty.isnull() && !m_charqueue_empty())); }
841841
842842   // configuration
r15132r15133
12391239   running_machine &machine() const { return m_machine; }
12401240   ioport_port *first_port() const { return m_portlist.first(); }
12411241   bool safe_to_read() const { return m_safe_to_read; }
1242   natural_keyboard &natkeyboard() { return m_natkeyboard; }
1242   natural_keyboard &natkeyboard() { return *m_natkeyboard; }
12431243
12441244   // type helpers
12451245   input_type_entry *first_type() const { return m_typelist.first(); }
r15132r15133
13081308
13091309   // specific special global input states
13101310   simple_list<digital_joystick> m_joystick_list;   // list of digital joysticks
1311   natural_keyboard      m_natkeyboard;         // natural keyboard support
1311   natural_keyboard      *m_natkeyboard;         // natural keyboard support
13121312
13131313   // frame time tracking
13141314   attotime            m_last_frame_time;      // time of the last frame callback

Previous 15994 Revisions Next


© 1998-2018 The MESS Team