Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
input.c
Go to the documentation of this file.
1 /* Xep128: Minimalistic Enterprise-128 emulator with focus on "exotic" hardware
2  Copyright (C)2015,2016 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
3  http://xep128.lgb.hu/
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
18 
19 #include "xep128.h"
20 #include "input.h"
21 #include "dave.h"
22 #include "keyboard_mapping.h"
23 #include "screen.h"
24 #include "joystick.h"
25 
26 #include <SDL.h>
27 
28 
29 static int move_dx, move_dy, nibble_counter;
30 int mouse_grab = 0;
31 static int wheel_dx, wheel_dy;
32 static Uint8 nibble;
33 static int mouse_button1, mouse_button2;
34 static int rts_old_level = -1;
35 static int mouse_pulse = 0;
36 //static int _mouse_wait_warn = 1;
37 extern Uint32 raster_time; // we use Nick's raster_time "timing source" because it's kinda free without introducing another timer source
38 static Uint32 watchdog_mouse; // watchdog value (raster_time related) used by the mouse nibble-reset protocol
39 static Uint32 watchdog_xep128; // watchdog value (raster_time related) used by Xep128 to decide between joy-1 and j-column mouse
40 
41 int show_keys = 0;
42 static int control_port_emu_mode = -1;
43 
44 /* The mouse buffer. nibble_counter shows which nibble is to read (thus "nibble_counter >> 1" is the byte pointer actually.
45  mouse_protocol_nibbles limits the max nibbles to read, ie it's 4 (= 2 bytes) for boxsoft protocol for the default setting */
46 static Uint8 mouse_buffer[] = {
47  0x00, // BOXSOFT: delta X as signed, positive-left, updated from mouse_dx
48  0x00, // BOXSOFT: delta Y as signed, positive-up, updates from mouse_dy
49  0x10, // EXTENDED MSX: proto ID + extra buttons on lower nibble (I update those - lower nibble - on mouse SDL events)
50  0x00, // EXTENDED MSX: horizontal wheel (it's splitted for horizontal/Z, but according to entermice it's handled as a 8 bit singed now for a single wheel, so I do this as well)
51  0x44, // ENTERMICE: extra bytes to read (incl this: 4 now) + PS/2 Mouse ID [it's 4 now ...]
52  0x14, // ENTERMICE: hardware version major.minor
53  0x19, // ENTERMICE: firmware version major.minor
54  0x5D // ENTERMICE: Device ID, should be 5D for Entermice
55 };
56 
57 #define WATCHDOG_USEC(n) (n / 64)
58 
59 /* Values can be used in mouse modes, buttons[] array to map PC mouse buttons to EP related mouse buttons
60  The first two are mapped then according to the button*_mask of the mode struct.
61  The EX buttons instructs setting the button status in mouse buffer directly at byte 3, lower nibble
62 */
63 #define BUTTON_MAIN 1
64 #define BUTTON_OTHER 2
65 #define BUTTON_EX3 3
66 #define BUTTON_EX4 4
67 #define BUTTON_EX5 5
68 
69 /* Values can be used in *_mask options in mouse modes struct */
70 #define J_COLUMN 1
71 #define K_COLUMN 2
72 
73 struct mouse_modes_st {
74  const char *name; // some name for the given mouse protocol/mode ...
75  int buttons[5]; // button map: indexed by emulator given PC left/middle/right/x1/x2 (in this order), with values of the BUTTON_* macros above to map to protcol values
76  int nibbles; // nibbles in the protocol (before the constant zero answer or warping around if warp is non-zero)
77  int wrap; // wraps around nibble counter automatically or not (not = constant zero nibble answer, watchdog can only reset the counter)
78  int watchdog; // watchdog time-out, or -1, for not using watchdog, times are Xep128 specific use the WATCHDOG_USEC macro to convert from usec!
79  int data_mask; // bit mask for mouse data read (J/K/L = 1 / 2 / 4), you can use *_COLUMN macros
80 };
81 
82 /* Definition of mouse modes follows :) */
83 static const struct mouse_modes_st mouse_modes[] = {
84  { // MODE - 0: NOT USED POSITION
85  }, { // MODE - 1:
86  .name = "BoxSoft J-col",
87  .buttons = { BUTTON_MAIN, BUTTON_EX3, BUTTON_OTHER, BUTTON_EX4, BUTTON_EX5 }, // mapping for SDL left/middle/right/X1/X2 events to EP
88  .nibbles = 4,
89  .wrap = 0,
90  .watchdog = WATCHDOG_USEC(1500),
91  .data_mask = J_COLUMN
92  }, { // MODE - 2:
93  .name = "ExtMSX J-col",
94  .buttons = { BUTTON_MAIN, BUTTON_EX3, BUTTON_OTHER, BUTTON_EX4, BUTTON_EX5 }, // mapping for SDL left/middle/right/X1/X2 events to EP
95  .nibbles = 8,
96  .wrap = 0,
97  .watchdog = WATCHDOG_USEC(1500),
98  .data_mask = J_COLUMN
99  }, { // MODE - 3:
100  .name = "EnterMice J-col",
101  .buttons = { BUTTON_MAIN, BUTTON_EX3, BUTTON_OTHER, BUTTON_EX4, BUTTON_EX5 }, // mapping for SDL left/middle/right/X1/X2 events to EP
102  .nibbles = 16,
103  .wrap = 0,
104  .watchdog = WATCHDOG_USEC(1500),
105  .data_mask = J_COLUMN
106  }, { // MODE - 4:
107  .name = "BoxSoft K-col",
108  .buttons = { BUTTON_MAIN, BUTTON_EX3, BUTTON_OTHER, BUTTON_EX4, BUTTON_EX5 }, // mapping for SDL left/middle/right/X1/X2 events to EP
109  .nibbles = 4,
110  .wrap = 0,
111  .watchdog = WATCHDOG_USEC(1500),
112  .data_mask = K_COLUMN
113  }, { // MODE - 5:
114  .name = "ExtMSX K-col",
115  .buttons = { BUTTON_MAIN, BUTTON_EX3, BUTTON_OTHER, BUTTON_EX4, BUTTON_EX5 }, // mapping for SDL left/middle/right/X1/X2 events to EP
116  .nibbles = 8,
117  .wrap = 0,
118  .watchdog = WATCHDOG_USEC(1500),
119  .data_mask = K_COLUMN
120  }, { // MODE - 6:
121  .name = "EnterMice K-col",
122  .buttons = { BUTTON_MAIN, BUTTON_EX3, BUTTON_OTHER, BUTTON_EX4, BUTTON_EX5 }, // mapping for SDL left/middle/right/X1/X2 events to EP
123  .nibbles = 16,
124  .wrap = 0,
125  .watchdog = WATCHDOG_USEC(1500),
126  .data_mask = K_COLUMN
127  }
128 };
129 
130 #define LAST_MOUSE_MODE ((sizeof(mouse_modes) / sizeof(const struct mouse_modes_st)) - 1)
131 
132 static const struct mouse_modes_st *mode; // current mode mode, pointer to the selected mouse_modes
133 int mouse_mode; // current mode, with an integer
134 
135 #define JOYSTICK_SCAN(num, dir) joystick_scan(num, dir)
136 
137 
138 
139 int mouse_mode_description ( int cfg, char *buffer )
140 {
141  if (cfg == 0)
142  cfg = mouse_mode;
143  if (cfg < 1 || cfg > LAST_MOUSE_MODE) {
144  sprintf(buffer, "#%d *** Invalid mouse mode ***", cfg);
145  return 1;
146  } else {
147  sprintf(
148  buffer,
149  "#%d (%s) nibbles=%d wrap=%d watchdog=%d mask=%d",
150  cfg,
151  mouse_modes[cfg].name,
152  mouse_modes[cfg].nibbles,
153  mouse_modes[cfg].wrap,
154  mouse_modes[cfg].watchdog,
155  mouse_modes[cfg].data_mask
156  );
157  return 0;
158  }
159 }
160 
161 
162 
163 void mouse_reset_button ( void )
164 {
165  mouse_button1 = 0;
166  mouse_button2 = 0;
167  mouse_buffer[2] &= 0xF0; // extra buttons for MSX extended protocol should be cleared as well
168 }
169 
170 
171 
172 static inline void set_button ( Uint8 *storage, int mask, int pressed )
173 {
174  if (pressed)
175  *storage |= mask;
176  else
177  *storage &= 255 - mask;
178 }
179 
180 
181 
182 void emu_mouse_button ( Uint8 sdl_button, int press )
183 {
184  const char *name;
185  int id;
186  switch (sdl_button) {
187  case SDL_BUTTON_LEFT:
188  name = "left";
189  id = 0;
190  break;
191  case SDL_BUTTON_MIDDLE:
192  name = "middle";
193  id = 1;
194  break;
195  case SDL_BUTTON_RIGHT:
196  name = "right";
197  id = 2;
198  break;
199  case SDL_BUTTON_X1:
200  name = "x1";
201  id = 3;
202  break;
203  case SDL_BUTTON_X2:
204  name = "x2";
205  id = 4;
206  break;
207  default:
208  name = "UNKNOWN";
209  id = -1;
210  break;
211  }
212  DEBUG("MOUSE: BUTTON: event: SDL#%d XEP#%d (%s) %s" NL, sdl_button, id, name, press ? "pressed" : "released");
213  if (id == -1) {
214  DEBUG("MOUSE: BUTTON: unknown button on SDL level (see previous MOUSE: line)!!" NL);
215  return; // unknown mouse button??
216  }
217  if (sdl_button == SDL_BUTTON_LEFT && press && mouse_grab == 0) {
218  //emu_osd_msg("Mouse grab. Press ESC to exit.");
219  screen_grab(SDL_TRUE);
220  mouse_grab = 1;
222  }
223  if (!mouse_grab) {
224  DEBUG("MOUSE: BUTTON: not in grab mode, do not forward event" NL);
225  return; // not in mouse grab mode
226  }
227  switch (mode->buttons[id]) {
228  case BUTTON_MAIN:
229  mouse_button1 = press;
230  break;
231  case BUTTON_OTHER:
232  mouse_button2 = press;
233  break;
234  case BUTTON_EX3:
235  set_button(&mouse_buffer[2], 1, press);
236  break;
237  case BUTTON_EX4:
238  set_button(&mouse_buffer[2], 2, press);
239  break;
240  case BUTTON_EX5:
241  set_button(&mouse_buffer[2], 4, press);
242  break;
243  default:
244  DEBUG("MOUSE: used mouse button cannot be mapped for the given mouse mode (map=%d), ignored" NL, mode->buttons[id]);
245  break;
246  }
247 }
248 
249 
250 
251 void emu_mouse_motion ( int dx, int dy )
252 {
253  DEBUG("MOUSE: MOTION: event: dx = %d, dy = %d" NL, dx, dy);
254  if (!mouse_grab) {
255  DEBUG("MOUSE: MOTION: not in grab mode, do not forward event" NL);
256  return; // not in mouse grab mode
257  }
258  move_dx -= dx;
259  if (move_dx > 127) move_dx = 127;
260  else if (move_dx < -128) move_dx = -128;
261  move_dy -= dy;
262  if (move_dy > 127) move_dy = 127;
263  else if (move_dy < -128) move_dy = -128;
264 }
265 
266 
267 
268 void emu_mouse_wheel ( int x, int y, int flipped )
269 {
270  DEBUG("MOUSE: WHEEL: event: x = %d, y = %d, flipped = %d" NL, x, y, flipped);
271  if (!mouse_grab) {
272  DEBUG("MOUSE: WHEEL: not in grab mode, do not forward event" NL);
273  return; // not in mouse grab mode
274  }
275  flipped = flipped ? -1 : 1;
276  wheel_dx -= x * flipped;
277  if (wheel_dx > 127) wheel_dx = 127;
278  else if (wheel_dx < -128) wheel_dx = -128;
279  wheel_dy -= y * flipped;
280  if (wheel_dy > 127) wheel_dy = 127;
281  else if (wheel_dy < -128) wheel_dy = -128;
282 }
283 
284 
285 
286 void mouse_reset ( void )
287 {
288  // mouse_grab = 0; // commented out to fix the issue: emu reset hotkey is pressed with grabbed mouse ...
289  nibble_counter = 0;
290  //if (rts_old_level == -1)
291  rts_old_level = 0;
292  nibble = 0;
293  move_dx = 0;
294  move_dy = 0;
295  wheel_dx = 0;
296  wheel_dy = 0;
297  watchdog_mouse = raster_time;
298  watchdog_xep128 = raster_time;
300  mouse_buffer[0] = mouse_buffer[1] = mouse_buffer[3] = 0;
301 }
302 
303 
304 
305 static inline void check_mouse_watchdog ( void )
306 {
307  int time = raster_time - watchdog_mouse;
308  watchdog_mouse = raster_time;
309  if (mode->watchdog >= 0 && (time > mode->watchdog || time < 0)) // negative case in case of raster_time counter warp-around (integer overflow)
310  nibble_counter = 0; // in case of timeout, nibble counter resets to zero
311 }
312 
313 
314 
315 // Called from cpu.c in case of read port 0xB6, this function MUST only give back bits 0-2, ie control ports ones, higher bits
316 // bits should be zero as they are used for other purposes (ie: tape, printer ...) and OR'ed by cpu.c at port reading func ...
318 {
319  int mouse_ok, joy1_ok;
320  int time = raster_time - watchdog_xep128;
321  // Note: unlike watchdog_mouse, watchdog_xep128 is set in check data shift only but queried here
322  if (time < 0)
323  watchdog_xep128 = raster_time; // integer overflow
324  if (mode->data_mask == K_COLUMN) { // mouse on K-column, joy-1 is always enabled
325  mouse_ok = 2;
326  joy1_ok = 1;
327  } else if (mouse_pulse && (time < WATCHDOG_USEC(100000) || time < 0)) { // mouse on J-column, joy-1 is disabled on mouse usage
328  mouse_ok = 2;
329  joy1_ok = 0;
330  } else { // mouse on J-column, joy-1 is enabled because no mouse usage
331  mouse_ok = 0;
332  joy1_ok = 1;
333  mouse_pulse = 0;
334  }
335  if (control_port_emu_mode != mouse_ok + joy1_ok) {
336  static const char *m[] = { "joystick", "Mouse", "dual (K-col)" };
337  control_port_emu_mode = mouse_ok + joy1_ok;
338  OSD("Control port: %s mode", m[control_port_emu_mode - 1 ]);
339  }
340  switch (kbd_selector) {
341  /* joystick-1 or mouse related */
342  case 0: // The Entermice wiki mentioned priority of mouse buttons are not so much implemented ... TODO
343  return
344  (mouse_ok ? ((mouse_button1 ? 0 : mode->data_mask) | (7 - mode->data_mask - 4) | (mouse_button2 ? 0 : 4)) : 7) &
345  (joy1_ok ? ((JOYSTICK_SCAN(0, JOY_SCAN_FIRE1) ? 0 : 1) | (JOYSTICK_SCAN(0, JOY_SCAN_FIRE2) ? 0 : 2) | (JOYSTICK_SCAN(0, JOY_SCAN_FIRE3) ? 0 : 4)) : 7);
346  case 1: return (mouse_ok ? (((nibble & 1) ? mode->data_mask : 0) | (7 - mode->data_mask)) : 7) & ((joy1_ok && JOYSTICK_SCAN(0, JOY_SCAN_UP )) ? 6 : 7);
347  case 2: return (mouse_ok ? (((nibble & 2) ? mode->data_mask : 0) | (7 - mode->data_mask)) : 7) & ((joy1_ok && JOYSTICK_SCAN(0, JOY_SCAN_DOWN )) ? 6 : 7);
348  case 3: return (mouse_ok ? (((nibble & 4) ? mode->data_mask : 0) | (7 - mode->data_mask)) : 7) & ((joy1_ok && JOYSTICK_SCAN(0, JOY_SCAN_LEFT )) ? 6 : 7);
349  case 4: return (mouse_ok ? (((nibble & 8) ? mode->data_mask : 0) | (7 - mode->data_mask)) : 7) & ((joy1_ok && JOYSTICK_SCAN(0, JOY_SCAN_RIGHT)) ? 6 : 7);
350  /* always joystick#2 on J-column (bit 0), other bits are spare */
351  case 5: return (JOYSTICK_SCAN(1, JOY_SCAN_FIRE1) ? 0 : 1) | (JOYSTICK_SCAN(1, JOY_SCAN_FIRE2) ? 0 : 2) | (JOYSTICK_SCAN(1, JOY_SCAN_FIRE3) ? 0 : 4);
352  case 6: return JOYSTICK_SCAN(1, JOY_SCAN_UP ) ? 6 : 7;
353  case 7: return JOYSTICK_SCAN(1, JOY_SCAN_DOWN ) ? 6 : 7;
354  case 8: return JOYSTICK_SCAN(1, JOY_SCAN_LEFT ) ? 6 : 7;
355  case 9: return JOYSTICK_SCAN(1, JOY_SCAN_RIGHT) ? 6 : 7;
356  /* and if not ... */
357  default: return 7; // it shouldn't happen too much (only if no valid scan row is selected?)
358  }
359 }
360 
361 
362 
363 // Called from cpu.c in case of write of port 0xB7
365 {
366  if ((val & 2) == rts_old_level) // check of change on the RTS signal change
367  return; // if no change, we're not interested in at all, mouse "nibble shifting" in RTS _edge_ triggered (both of the edges!) not level
368  rts_old_level = val & 2;
369  mouse_pulse = 1; // this variable is only for the emulator to keep track of mouse reading tries and display OSD, etc
370  watchdog_xep128 = raster_time; // this watchdog is used to control auto-switch of Xep128 between J-column mouse and joy-1 emulation
371  check_mouse_watchdog(); // this is the mouse watchdog to reset nibble counter in a given timeout
372  if (nibble_counter >= mode->nibbles && mode->wrap) // support nibble counter wrap-around mode, if the current mouse mode directs that
373  nibble_counter = 0;
374  // note: information larger than one nibble shouldn't updated by the mouse SDL events directly in mouse_buffer, because it's possible
375  // that between the reading of two nibbles that is modified. To avoid this, these things are updated here at a well defined counter state only:
376  if (nibble_counter == 0) {
377  // update mouse buffer byte 0 with delta X
378  //mouse_buffer[0] = ((unsigned int)move_dx) & 0xFF; // signed will be converted to unsigned
379  mouse_buffer[0] = move_dx;
380  move_dx = 0;
381  } else if (nibble_counter == 2) {
382  // update mouse buffer byte 1 with delta Y
383  //mouse_buffer[1] = ((unsigned int)move_dy) & 0xFF; // signed will be converted to unsigned
384  mouse_buffer[1] = move_dy;
385  move_dy = 0;
386  } else if (nibble_counter == 6) { // this may not be used at all, if mouse_protocol_nibbles limits the available nibbles to read, boxsoft will not read this ever!
387  mouse_buffer[3] = wheel_dy;
388  wheel_dy = 0;
389  }
390  if (nibble_counter < mode->nibbles) {
391  // if nibble counter is below the constraint of the used mouse protocol, provide the upper or lower nibble of the buffer
392  // based on the counter's lowest bit (ie, odd or even)
393  nibble = ((nibble_counter & 1) ? (mouse_buffer[nibble_counter >> 1] & 15) : (mouse_buffer[nibble_counter >> 1] >> 4));
394  nibble_counter++;
395  } else
396  nibble = 0; // if we hit the max number of nibbles, we constantly provide zero as the nibble, until watchdog resets
397 }
398 
399 
400 
401 int mouse_setup ( int cfg )
402 {
403  char buffer[128];
404  if (cfg < 0)
405  return mouse_mode;
406  if (cfg < 1 || cfg > LAST_MOUSE_MODE)
407  cfg = 1;
408  mouse_mode = cfg;
409  mode = &mouse_modes[cfg];
410  mouse_mode_description(cfg, buffer);
411  DEBUG("MOUSE: SETUP: %s" NL, buffer);
412  mouse_reset();
413  return cfg;
414 }
415 
416 
417 /* ------------------- KEYBOARD ----------------------- */
418 
419 
420 int emu_kbd(SDL_Keysym sym, int press)
421 {
422  if (show_keys && press)
423  OSD("SDL scancode is \"%s\" (%d)", SDL_GetScancodeName(sym.scancode), sym.scancode);
424  if (mouse_grab && sym.scancode == SDL_SCANCODE_ESCAPE && press) {
425  mouse_grab = 0;
426  screen_grab(SDL_FALSE);
427  } else {
428  const struct keyMappingTable_st *ke = keymap_resolve_event(sym);
429  if (ke) {
430  int sel = ke->posep >> 4;
431  int mask = 1 << (ke->posep & 15);
432  if (mask < 0x100) {
433  if (press)
434  kbd_matrix[sel] &= 255 - mask;
435  else
436  kbd_matrix[sel] |= mask;
437  } else
438  return ke->posep; // give special code back to be handled by the caller!
439  }
440  }
441  return 0; // no kbd should be handled by the caller ...
442 }
mouse_modes_st::wrap
int wrap
Definition: input_devices.c:169
kbd_selector
int kbd_selector
Definition: dave.c:35
BUTTON_EX3
#define BUTTON_EX3
Definition: input.c:65
mouse_reset_button
void mouse_reset_button(void)
Definition: input.c:163
emu_mouse_wheel
void emu_mouse_wheel(int x, int y, int flipped)
Definition: input.c:268
read_control_port_bits
Uint8 read_control_port_bits(void)
Definition: input.c:317
emu_kbd
int emu_kbd(SDL_Keysym sym, int press)
Definition: input.c:420
mouse_mode
int mouse_mode
Definition: input.c:133
screen.h
JOY_SCAN_RIGHT
#define JOY_SCAN_RIGHT
Definition: input_devices.h:28
emu_mouse_motion
void emu_mouse_motion(int dx, int dy)
Definition: input.c:251
keyboard_mapping.h
JOYSTICK_SCAN
#define JOYSTICK_SCAN(num, dir)
Definition: input.c:135
keyMappingTable_st
Definition: keyboard_mapping.h:24
LAST_MOUSE_MODE
#define LAST_MOUSE_MODE
Definition: input.c:130
JOY_SCAN_UP
#define JOY_SCAN_UP
Definition: input_devices.h:25
dave.h
id
int id
Definition: joystick.c:52
mouse_setup
int mouse_setup(int cfg)
Definition: input.c:401
Uint32
uint32_t Uint32
Definition: fat32.c:49
WATCHDOG_USEC
#define WATCHDOG_USEC(n)
Definition: input.c:57
Uint8
uint8_t Uint8
Definition: fat32.c:51
joystick.h
screen_grab
void screen_grab(SDL_bool state)
Definition: screen.c:156
JOY_SCAN_FIRE2
#define JOY_SCAN_FIRE2
Definition: input_devices.h:29
JOY_SCAN_LEFT
#define JOY_SCAN_LEFT
Definition: input_devices.h:27
mouse_modes_st::nibbles
int nibbles
Definition: input_devices.c:168
x
int x
Definition: console.c:27
keyMappingTable_st::posep
Uint8 posep
Definition: keyboard_mapping.h:26
show_keys
int show_keys
Definition: input.c:41
mouse_modes_st
Definition: input_devices.c:165
K_COLUMN
#define K_COLUMN
Definition: input.c:71
mouse_modes_st::name
const char * name
Definition: input_devices.c:166
emu_mouse_button
void emu_mouse_button(Uint8 sdl_button, int press)
Definition: input.c:182
mode
int mode
Definition: vera.c:61
NL
#define NL
Definition: fat32.c:37
J_COLUMN
#define J_COLUMN
Definition: input.c:70
BUTTON_OTHER
#define BUTTON_OTHER
Definition: input.c:64
BUTTON_EX5
#define BUTTON_EX5
Definition: input.c:67
mouse_modes_st::data_mask
int data_mask
Definition: input_devices.c:171
xep128.h
JOY_SCAN_FIRE3
#define JOY_SCAN_FIRE3
Definition: input_devices.h:30
JOY_SCAN_DOWN
#define JOY_SCAN_DOWN
Definition: input_devices.h:26
kbd_matrix
Uint8 kbd_matrix[16]
Definition: dave.c:30
mouse_reset
void mouse_reset(void)
Definition: input.c:286
mouse_modes_st::buttons
int buttons[5]
Definition: input_devices.c:167
OSD
#define OSD(...)
Definition: xep128.h:100
JOY_SCAN_FIRE1
#define JOY_SCAN_FIRE1
Definition: input_devices.h:24
y
int y
Definition: console.c:27
mouse_mode_description
int mouse_mode_description(int cfg, char *buffer)
Definition: input.c:139
mask
int mask
Definition: dma65.c:83
mouse_modes_st::watchdog
int watchdog
Definition: input_devices.c:170
keymap_resolve_event
const struct keyMappingTable_st * keymap_resolve_event(SDL_Keysym sym)
Definition: keyboard_mapping.c:207
name
const char * name
Definition: joystick.c:46
raster_time
Uint32 raster_time
Definition: nick.c:56
BUTTON_EX4
#define BUTTON_EX4
Definition: input.c:66
mouse_grab
int mouse_grab
Definition: input.c:30
DEBUG
#define DEBUG(...)
Definition: emutools_basicdefs.h:167
mouse_check_data_shift
void mouse_check_data_shift(Uint8 val)
Definition: input.c:364
input.h
BUTTON_MAIN
#define BUTTON_MAIN
Definition: input.c:63