lsnes rr0-β2
[lsnes.git] / controller.hpp
blobeb3137bde3838d976ba4823dbe699f803dc5a8e1
1 #ifndef _controller__hpp__included__
2 #define _controller__hpp__included__
4 #include "controllerdata.hpp"
6 /**
7 * Look up physcial controller ID by logical controller ID.
8 *
9 * parameter lid: Logical ID (0-7).
10 * returns: Physical ID. -1 if there is no such logical controller.
12 int controller_index_by_logical(unsigned lid) throw();
13 /**
14 * Look up physcial controller ID by analog controller ID.
16 * parameter aid: Analog ID (0-2).
17 * returns: Physical ID. -1 if there is no such controller.
19 int controller_index_by_analog(unsigned aid) throw();
20 /**
21 * Look up if controller is mouse by analog controller ID.
23 * parameter aid: Analog ID (0-2).
24 * returns: True if ID points to mouse, otherwise false.
26 bool controller_ismouse_by_analog(unsigned aid) throw();
27 /**
28 * Look up type of controller by logical controller ID.
30 * parameter lid: Logical ID (0-7).
31 * returns: The type of controller (not port!).
33 devicetype_t controller_type_by_logical(unsigned lid) throw();
34 /**
35 * Set port type.
37 * Parameter port: The port to set.
38 * Parameter ptype: New port type.
39 * Parameter set_core: If true, set port type in bsnes core, otherwise skip this step.
41 void controller_set_port_type(unsigned port, porttype_t ptype, bool set_core = true) throw();
43 #endif