Previous 15994 Revisions Next

r15134 Thursday 10th May, 2012 at 14:58:57 UTC by Miodrag Milanović
cleanup (nw)
[src/emu]ioport.c ioport.h

src/emu/ioport.c
r15133r15134
10021002      debug_console_register_command(machine, "input", CMDFLAG_NONE, 0, 1, 1, execute_input);
10031003      debug_console_register_command(machine, "dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd);
10041004   }
1005}
10051006
1007//-------------------------------------------------
1008//  initialize - initialize natural keyboard
1009//  support
1010//-------------------------------------------------
1011
1012void natural_keyboard::initialize()
1013{
10061014   // posting keys directly only makes sense for a computer
1007   if (machine.ioport().has_keyboard())
1015   if (machine().ioport().has_keyboard())
10081016   {
10091017      m_buffer.resize(KEY_BUFFER_SIZE);
1010      m_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(natural_keyboard::timer), this));
1011      build_codes(machine.ioport());
1018      m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(natural_keyboard::timer), this));
1019      build_codes(machine().ioport());
10121020   }
10131021}
1014
1015
10161022//-------------------------------------------------
10171023//  configure - configure callbacks for full-
10181024//  featured keyboard support
r15133r15134
26052611ioport_manager::ioport_manager(running_machine &machine)
26062612   : m_machine(machine),
26072613     m_safe_to_read(false),
2608     m_natkeyboard(NULL),
2614     m_natkeyboard(machine),
26092615     m_last_frame_time(attotime::zero),
26102616     m_last_delta_nsec(0),
26112617     m_record_file(machine.options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS),
r15133r15134
26662672               break;
26672673            }
26682674
2669   m_natkeyboard = global_alloc(natural_keyboard(machine()));
2675   m_natkeyboard.initialize();
26702676   // register callbacks for when we load configurations
26712677   config_register(machine(), "input", config_saveload_delegate(FUNC(ioport_manager::load_config), this), config_saveload_delegate(FUNC(ioport_manager::save_config), this));
26722678
r15133r15134
27642770
27652771void ioport_manager::exit()
27662772{
2767   global_free(m_natkeyboard);
27682773   // close any playback or recording files
27692774   playback_end();
27702775   record_end();
src/emu/ioport.h
r15133r15134
832832   // construction/destruction
833833   natural_keyboard(running_machine &machine);
834834
835   void initialize();
836   
835837   // getters and queries
836838   running_machine &machine() const { return m_machine; }
837839   bool empty() const { return (m_bufbegin == m_bufend); }
r15133r15134
12391241   running_machine &machine() const { return m_machine; }
12401242   ioport_port *first_port() const { return m_portlist.first(); }
12411243   bool safe_to_read() const { return m_safe_to_read; }
1242   natural_keyboard &natkeyboard() { return *m_natkeyboard; }
1244   natural_keyboard &natkeyboard() { return m_natkeyboard; }
12431245
12441246   // type helpers
12451247   input_type_entry *first_type() const { return m_typelist.first(); }
r15133r15134
13081310
13091311   // specific special global input states
13101312   simple_list<digital_joystick> m_joystick_list;   // list of digital joysticks
1311   natural_keyboard      *m_natkeyboard;         // natural keyboard support
1313   natural_keyboard      m_natkeyboard;         // natural keyboard support
13121314
13131315   // frame time tracking
13141316   attotime            m_last_frame_time;      // time of the last frame callback

Previous 15994 Revisions Next


© 1998-2018 The MESS Team