Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
keyconfig.c
Go to the documentation of this file.
1 /* Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu
2  Copyright (C)2020 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17 
18 #include "xemu/emutools.h"
19 #include <errno.h>
20 
21 
22 #define SCREEN_FORMAT SDL_PIXELFORMAT_ARGB8888
23 // Do not modify this, this very program depends on it being 0.
24 #define USE_LOCKED_TEXTURE 0
25 #define RENDER_SCALE_QUALITY 1
26 #define SCREEN_WIDTH 800
27 #define SCREEN_HEIGHT 400
28 #define FRAME_DELAY 40
29 #define STATUS_COLOUR_INDEX 1
30 #define BACKGROUND_COLOUR_INDEX 6
31 // Keyboard
32 #define NORMAL_COLOUR_INDEX 1
33 #define SELECT_COLOUR_INDEX 1
34 #define OVER_COLOUR_INDEX 2
35 #define KEYTEST_COLOUR_INDEX 1
36 #define CONFLICT_COLOUR_INDEX 1
37 #define UNUSABLE_COLOUR_INDEX 1
38 #define LETTER_COLOUR_INDEX 0
39 #define STATUS(...) do { char buffer[1024]; snprintf(buffer, sizeof buffer, __VA_ARGS__); write_status(buffer); } while(0)
40 #define OSD_TRAY(...) OSD(-1,SCREEN_HEIGHT-20,__VA_ARGS__)
41 
42 extern Uint32 *sdl_pixel_buffer;
43 static const Uint8 init_vic2_palette_rgb[16 * 3] = { // VIC2 palette given by RGB components
44  0x00, 0x00, 0x00,
45  0xFF, 0xFF, 0xFF,
46  0x74, 0x43, 0x35,
47  0x7C, 0xAC, 0xBA,
48  0x7B, 0x48, 0x90,
49  0x64, 0x97, 0x4F,
50  0x40, 0x32, 0x85,
51  0xBF, 0xCD, 0x7A,
52  0x7B, 0x5B, 0x2F,
53  0x4f, 0x45, 0x00,
54  0xa3, 0x72, 0x65,
55  0x50, 0x50, 0x50,
56  0x78, 0x78, 0x78,
57  0xa4, 0xd7, 0x8e,
58  0x78, 0x6a, 0xbd,
59  0x9f, 0x9f, 0x9f
60 };
61 static Uint32 palette[256];
62 
63 
64 
65 void clear_emu_events ( void )
66 {
68 }
69 
70 static int load_keymap ( const char *fn, void (*callback)(const char*, SDL_Scancode) )
71 {
72  char line[256];
73  FILE *fp = fopen(fn, "rb");
74  if (!fp) {
75  ERROR_WINDOW("Cannot open file %s: %s", fn, strerror(errno));
76  return -1;
77  }
78  while (fgets(line, sizeof line, fp)) {
79  if (strlen(line) > 250) {
80  ERROR_WINDOW("Too long line in file %s", fn);
81  fclose(fp);
82  return -1;
83  }
84  if (*line == '\0' || *line == '#')
85  continue;
86  char *p1 = line + strlen(line) - 1;
87  while (*p1 <= 0x20 && p1 >= line)
88  p1--;
89  p1[1] = '\0';
90  printf("line=[%s]\n", line);
91  if (*line == '\0')
92  continue;
93  p1 = line;
94  while (*p1 <= 0x20 && *p1 != '\0')
95  p1++;
96  if (*p1 == '\0') {
97  printf("bad1=[%s]\n", line);
98  continue; // BAD entry, skip it ...
99  }
100  // now p1 points to the first column
101  char *p2 = p1;
102  while (*p2 > 0x20)
103  p2++;
104  if (*p2 == '\0') {
105  puts("bad2");
106  continue; // BAD entry, skip it ...
107  }
108  *p2++ = '\0'; // termination of the first field
109  while (*p2 <= 0x20 && *p2 != '\0')
110  p2++;
111  if (*p2 == '\0') {
112  puts("bad3");
113  continue; // BAD entry, skip it ...
114  }
115  /*char *p3 = p2 + strlen(p2) - 1;
116  while (*p3 <= 0x20)
117  p3--;
118  p3[1] = '\0';*/
119  printf("F1=[%s] F2=[%s] %d\n", p1,p2,SDL_GetScancodeFromName(p2));
120  callback(p1, SDL_GetScancodeFromName(p2));
121  }
122  fclose(fp);
123  return 0;
124 }
125 
126 static void clear_screen ( void )
127 {
128  for (unsigned int a = 0; a < SCREEN_WIDTH * SCREEN_HEIGHT; a++)
130 }
131 
132 static void clear_area ( int x1, int y1, int x2, int y2, Uint32 colour )
133 {
134  Uint32 *pix = sdl_pixel_buffer + y1 * SCREEN_WIDTH;
135  while (y1 <= y2) {
136  y1++;
137  for (int x = x1; x <= x2; x++)
138  pix[x] = colour;
139  pix += SCREEN_WIDTH;
140  }
141 }
142 
143 int write_char ( int x1, int y1, char chr, Uint32 colour )
144 {
145  Uint32 *pix = sdl_pixel_buffer + y1 * SCREEN_WIDTH + x1;
146  int char_width = 0;
147  int char_start = 32;
148  if ((signed char)chr < 32)
149  chr = '?';
150  for (int y = 0; y < 16; y++)
151  for (Uint32 b = font_16x16[((chr - 32) << 4) + y], x = 0; b; b <<= 1, x++)
152  if ((b & 0x8000) && (x < char_start))
153  char_start = x;
154  for (int y = 0; y < 16; y++) {
155  for (Uint32 b = font_16x16[((chr - 32) << 4) + y] << char_start, x = 0; b; b <<= 1, x++) {
156  if ((b & 0x8000)) {
157  pix[x] = colour;
158  if (x > char_width)
159  char_width = x;
160  }
161  }
162  pix += SCREEN_WIDTH;
163  }
164  return chr == ' ' ? 5 : char_width + 2;
165 }
166 
167 static int write_string_min_x = 0, write_string_min_y = 0;
168 static int write_string_max_x = 0, write_string_max_y = 0;
169 static int clear_boundary_box = 1;
170 
171 static void write_string ( int x1, int y1, const char *str, Uint32 colour )
172 {
173  int x = x1;
174  if (clear_boundary_box) {
175  write_string_min_x = x1;
176  write_string_min_y = y1;
177  write_string_max_x = 0;
178  write_string_max_y = 0;
179  }
180  while (*str) {
181  if (*str == 1 && str[1]) {
182  colour = palette[str[1] & 15];
183  str += 2;
184  } else if (*str == '\n') {
185  x = x1;
186  y1 += 16;
187  str++;
188  } else {
189  x += write_char(x, y1, *str++, colour);
190  if (clear_boundary_box) {
191  if (y1 > write_string_max_y)
192  write_string_max_y = y1;
193  if (x > write_string_max_x)
194  write_string_max_x = x;
195  }
196  }
197  }
198 }
199 
200 
201 static void write_status ( const char *str )
202 {
203  int y = SCREEN_HEIGHT - 16 - 32;
204  for (int a = 0; str[a]; a++)
205  if (str[a] == '\n' && str[a + 1])
206  y -= 16;
207  if (write_string_max_x && clear_boundary_box)
208  clear_area(write_string_min_x, write_string_min_y, write_string_max_x, write_string_max_y + 16, palette[BACKGROUND_COLOUR_INDEX]);
209  write_string(32, y, str, palette[STATUS_COLOUR_INDEX]);
210 }
211 
212 struct keyboard_st {
213  int x1, y1, x2, y2;
214  const char *title;
215  const char *name;
216  SDL_Scancode code;
217 };
218 static struct keyboard_st keyboard_storage[256], *keyboard_limit = keyboard_storage;
219 
220 
221 static struct keyboard_st *search_key_by_coord ( int x, int y )
222 {
223  struct keyboard_st *k = keyboard_storage;
224  while (k < keyboard_limit)
225  if (x >= k->x1 && x <= k->x2 && y >= k->y1 && y <= k->y2)
226  return k;
227  else
228  k++;
229  return NULL;
230 }
231 static struct keyboard_st *search_key_by_name ( const char *name )
232 {
233  struct keyboard_st *k = keyboard_storage;
234  while (k < keyboard_limit)
235  if (!strcmp(name, k->name))
236  return k;
237  else
238  k++;
239  return NULL;
240 }
241 static struct keyboard_st *search_key_by_code ( SDL_Scancode code )
242 {
243  struct keyboard_st *k = keyboard_storage;
244  while (k < keyboard_limit)
245  if (k->code == code)
246  return k;
247  else
248  k++;
249  return NULL;
250 }
251 
252 
253 
254 static void construct_key ( int x1, int y1, int x2, int y2, const char *title, const char *name, SDL_Scancode code )
255 {
256  keyboard_limit->x1 = x1;
257  keyboard_limit->y1 = y1;
258  keyboard_limit->x2 = x2;
259  keyboard_limit->y2 = y2;
260  keyboard_limit->title = xemu_strdup(title);
261  keyboard_limit->name = xemu_strdup(name);
262  keyboard_limit->code = code;
263  keyboard_limit++;
264  DEBUGPRINT("Key constructed: %s %s at %d,%d-%d,%d" NL, title, name, x1, y1, x2, y2);
265 }
266 
267 static void draw_key ( struct keyboard_st *k, int mode )
268 {
269  clear_area(k->x1, k->y1, k->x2, k->y2, palette[mode]);
270  clear_boundary_box = 0;
271  write_string(k->x1 + 1, k->y1 + 1, k->title, palette[LETTER_COLOUR_INDEX]);
272  clear_boundary_box = 1;
273  DEBUGPRINT("Drawning key title: %s" NL, k->title);
274 }
275 
276 static void assign_named_key ( const char *name, SDL_Scancode code )
277 {
278  struct keyboard_st *k = search_key_by_name(name);
279  if (!k)
280  DEBUGPRINT("WARNING: unknown referenced entity: \"%s\"" NL, name);
281  else {
282  k->code = code;
283  DEBUGPRINT("ASSIGN: assigned \"%s\"" NL, name);
284  }
285 }
286 
287 static void draw_full_keyboard ( void )
288 {
289  struct keyboard_st *k = keyboard_storage;
290  while (k < keyboard_limit)
291  draw_key(k++, NORMAL_COLOUR_INDEX);
292 }
293 
294 static double construct_keyboard_row ( double x, double y, double x_step, int width, int height, const char *desc )
295 {
296  char buffer[4096], *s = buffer;
297  strcpy(buffer, desc);
298  for (;;) {
299  char *e = strchr(s, '\1');
300  if (e)
301  *e = '\0';
302  char *p = strchr(s, '=');
303  if (p)
304  *p++ = '\0';
305  else
306  p = s;
307  construct_key(x, y, x + width, y + height, s, p, SDL_SCANCODE_UNKNOWN);
308  x += x_step;
309  if (!e)
310  break;
311  s = e + 1;
312  }
313  return x;
314 }
315 
316 
317 static void construct_mega_keyboard ( void )
318 {
319  // top row (function keys, etc)
320  construct_keyboard_row( 28 , 4, 48.5, 26, 30, "stop");
321  construct_keyboard_row( 28 + 2*48.5, 4, 48.5, 26, 30, "esc\1alt\1lock\1no.sc");
322  construct_keyboard_row( 28 + 7*48.5, 4, 48.5, 26, 30, "F1\1F3\1F5\1F7");
323  construct_keyboard_row( 28 + 12*48.5, 4, 48.5, 26, 30, "F9\1F11\1F13\1help");
324  // kind of number row
325  construct_keyboard_row( 28, 68, 48.5, 26, 30, "<-\1" "1\1" "2\1" "3\1" "4\1" "5\1" "6\1" "7\1" "8\1" "9\1" "0\1+\1-\1pnd\1clr\1DEL");
326  // Q-W-E-R-T-Y
327  construct_keyboard_row(100, 114, 48.5, 26, 26, "Q\1W\1E\1R\1T\1Y\1U\1I\1O\1P\1a\1b\1c");
328  // A-S-D-F
329  construct_keyboard_row( 15, 159, 48.5, 26, 26, "ctrl\1lck\1A\1S\1D\1F\1G\1H\1J\1K\1L\1d\1e\1f");
330  // Z-X-C
331  construct_keyboard_row(136, 202, 48.5, 26, 26, "Z\1X\1C\1V\1B\1N\1M\1<\n,\1>\n.\1?\n/");
332 }
333 
334 
335 int main ( int argc, char **argv )
336 {
337  static const char boring_warning[] = "\nThis program is not meant to be used manually.\nPlease use the menu of an Xemu emulator which supports key re-mapping.";
338  xemu_pre_init(APP_ORG, TARGET_NAME, "Xemu Keyboard Configurator");
339  if (argc != 4)
340  FATAL("Missing specifier(s) from command line.%s", boring_warning);
341  if (!strcmp(argv[3], "mega65"))
342  construct_mega_keyboard();
343  else
344  FATAL("Bad target specifier: \"%s\"%s", argv[3], boring_warning);
345  DEBUGPRINT("Loading default set: %s" NL, argv[1]);
346  if (load_keymap(argv[1], assign_named_key))
347  return 1;
348  DEBUGPRINT("Loading used set: %s" NL, argv[2]);
349  //construct_key(10,10,20,20,"t","TestKey");
350  if (xemu_post_init(
351  TARGET_DESC APP_DESC_APPEND, // window title
352  1, // resizable window
353  SCREEN_WIDTH, SCREEN_HEIGHT, // texture sizes
354  SCREEN_WIDTH, SCREEN_HEIGHT, // logical size
355  SCREEN_WIDTH, SCREEN_HEIGHT, // window size
356  SCREEN_FORMAT, // pixel format
357  16, // number of colours to init
358  init_vic2_palette_rgb, // init from this
359  palette, // .. and into this!
360  RENDER_SCALE_QUALITY, // render scaling quality
361  USE_LOCKED_TEXTURE, // 1 = locked texture access
362  NULL // no emulator specific shutdown function
363  ))
364  return 1;
365  //osd_init_with_defaults();
366  const Uint8 osd_palette[] = {
367  0xFF, 0, 0, 0x80, // with alpha channel 0x80
368  0xFF,0xFF,0x80,0xFF // letter colour
369  };
370  osd_init(
371  //OSD_TEXTURE_X_SIZE, OSD_TEXTURE_Y_SIZE,
372  SCREEN_WIDTH * 1, SCREEN_HEIGHT * 1,
373  osd_palette,
374  sizeof(osd_palette) >> 2,
377  );
378  OSD_TRAY("Welcome to Xemu's Keymap Configurator!");
379  clear_screen();
380  SDL_Surface *surf = SDL_LoadBMP("mega65-kbd.bmp");
381  if (surf) {
382  printf("Colours=%d\n", surf->format->palette->ncolors);
383  for (int a = 0; a < 128; a++)
384  palette[128 + (a & 127)] = SDL_MapRGBA(
385  sdl_pix_fmt,
386  surf->format->palette->colors[a].r,
387  surf->format->palette->colors[a].g,
388  surf->format->palette->colors[a].b,
389  0xFF
390  );
391  printf("BitsPerPixel=%d BytesPerPixel=%d\n",
392  surf->format->BitsPerPixel,
393  surf->format->BytesPerPixel
394  );
395  for (int a = 0; a < 800 * 300; a++)
396  sdl_pixel_buffer[a] = palette[128 + (((Uint8*)surf->pixels)[a] & 127)];
397  } else
398  FATAL("Cannot load keyboard image: %s", SDL_GetError());
399  draw_full_keyboard();
400  //write_char(10,10,'A', palette[1]);
401  //write_string(10, SCREEN_HEIGHT - 30, "Printout!", palette[1]);
402  //write_status("Hi!\nHow are you?\nHmm?!");
403  static const char help_msg[] = "Quick help: click on a key to assign, then press a key\non your keyboard to define it\nClose window to save or cancel your mapping.";
404  STATUS("%s", help_msg);
405  Uint32 old_ticks;
407  int frames = 0;
408  struct keyboard_st *wait_for_assignment = NULL, *mouse_on_key = NULL;
409  SDL_Scancode result_for_assignment = SDL_SCANCODE_UNKNOWN;
410  for (;;) {
411  int force_render = 0;
412  SDL_Event ev;
413  old_ticks = SDL_GetTicks();
414  while (SDL_PollEvent(&ev)) {
415  switch(ev.type) {
416  case SDL_QUIT:
418  exit(1);
419  break;
420  case SDL_KEYUP:
421  if (wait_for_assignment) {
422  if (ev.key.repeat) {
423  OSD_TRAY("ERROR: key repeats, too long press!");
424  } else if (result_for_assignment != ev.key.keysym.scancode && ev.key.keysym.scancode != SDL_SCANCODE_UNKNOWN) {
425  OSD_TRAY("ERROR: multiple keypresses are used!");
426  result_for_assignment = SDL_SCANCODE_UNKNOWN;
427  } else if (result_for_assignment == ev.key.keysym.scancode && result_for_assignment != SDL_SCANCODE_UNKNOWN) {
428  // FIXME TODO: check is key is free! And only allow to accept then!
429  //struct keyboard_st *k = search_key_by_code(ev.key.keysym.scancode);
430  //if (k != NULL)
431  // QUESTION("This pressed key \"%\" already assigned to function \"%s\"");
432  OSD_TRAY("OK: assigned key: %s", SDL_GetScancodeName(ev.key.keysym.scancode));
433  STATUS("Last operation: assigned key: %s\nDo not give up, assign a new key today! Just here and now!", SDL_GetScancodeName(ev.key.keysym.scancode));
434  wait_for_assignment->code = result_for_assignment;
435  result_for_assignment = SDL_SCANCODE_UNKNOWN;
436  wait_for_assignment = NULL;
437  }
438  } else {
439  //OSD_TRAY("No key is clicked on the map");*/
440  }
441  break;
442  case SDL_KEYDOWN:
443  if (ev.key.keysym.scancode == SDL_SCANCODE_ESCAPE)
444  exit(1);
445  if (wait_for_assignment) {
446  if (ev.key.repeat) {
447  OSD_TRAY("ERROR: key repeats, too long press!");
448  } else if (result_for_assignment != SDL_SCANCODE_UNKNOWN) {
449  OSD_TRAY("ERROR: multiple keypresses are used!");
450  //result_for_assignment = ev.key.keysym.scancode;
451  } else {
452  if (ev.key.keysym.scancode == SDL_SCANCODE_UNKNOWN)
453  OSD_TRAY("ERROR: This key has no proper SDL decode!");
454  else
455  result_for_assignment = ev.key.keysym.scancode;
456  }
457  } else {
458  //OSD_TRAY("No key is clicked on the map");*/
459  struct keyboard_st *k = search_key_by_code(ev.key.keysym.scancode);
460  const char *sname = SDL_GetScancodeName(ev.key.keysym.scancode);
461  if (k) {
462  STATUS("KEY: %s %s %s", k->title, k->name, *sname ? sname : "UNASSIGNED");
463  } else {
464  STATUS("The pressed key (%s) is not assigned to any emulated key.", sname);
465  }
466  }
467  force_render = 1;
468  break;
469  case SDL_MOUSEBUTTONDOWN:
470  if (mouse_on_key) {
471  DEBUGPRINT("X=%d, Y=%d" NL, ev.button.x, ev.button.y);
472  OSD_TRAY("Waiting your keypress to assign!!");
473  STATUS("Now please press a key on your keyboard to assign for the emulated key: %s", mouse_on_key->name);
474  wait_for_assignment = mouse_on_key;
475  force_render = 1;
476  mouse_on_key = NULL;
477  } else if (wait_for_assignment)
478  OSD_TRAY("Not possible before assigning the selected key");
479  break;
480  //case SDL_MOUSEBUTTONUP:
481  case SDL_MOUSEMOTION:
482  if (!wait_for_assignment && ev.motion.x >= 0 && ev.motion.x < SCREEN_WIDTH && ev.motion.y >= 0 && ev.motion.y < SCREEN_HEIGHT) {
483  //DEBUGPRINT("X=%d, Y=%d" NL, ev.motion.x, ev.motion.y);
484  //sdl_pixel_buffer[ev.motion.x + ev.motion.y * SCREEN_WIDTH] = palette[1];
485  struct keyboard_st *k = search_key_by_coord(ev.motion.x, ev.motion.y);
486  if (k) {
487  if (mouse_on_key != k) {
488  mouse_on_key = k;
489  draw_full_keyboard();
490  draw_key(k, OVER_COLOUR_INDEX);
491  const char *sname = SDL_GetScancodeName(k->code);
492  STATUS("KEY: %s %s %s", k->title, k->name, *sname ? sname : "UNASSIGNED");
493  force_render = 1;
494  }
495  } else if (mouse_on_key) {
496  STATUS("%s", help_msg);
497  draw_full_keyboard();
498  mouse_on_key = NULL;
499  force_render = 1;
500  }
501  }
502  break;
503  case SDL_WINDOWEVENT:
504  // it's a bit cruel, but it'll do
505  // basically I just want to avoid rendering texture to screen if not needed
506  // any window event MAY mean some reason to do it, some of them may be not
507  // but it's not fatal anyway to do so.
508  force_render = 1;
509  break;
510  default:
511  break;
512  }
513  }
514  if (force_render || osd_status || !frames) {
516  frames = 15;
517  } else
518  frames--;
519  //else
520  // DEBUGPRINT("No need to update, yeah-youh!" NL);
521  Uint32 new_ticks = SDL_GetTicks();
522  Uint32 delay = FRAME_DELAY - (new_ticks - old_ticks);
523  if (delay > 0 && delay <= FRAME_DELAY)
524  SDL_Delay(FRAME_DELAY);
525  }
526 }
SCREEN_HEIGHT
#define SCREEN_HEIGHT
Definition: keyconfig.c:27
xemu_pre_init
void xemu_pre_init(const char *app_organization, const char *app_name, const char *slogan)
Definition: emutools.c:651
TARGET_DESC
#define TARGET_DESC
Definition: xemu-target.h:2
USE_LOCKED_TEXTURE
#define USE_LOCKED_TEXTURE
Definition: keyconfig.c:24
emutools.h
colour
Uint32 colour
Definition: vera.c:67
OVER_COLOUR_INDEX
#define OVER_COLOUR_INDEX
Definition: keyconfig.c:34
BACKGROUND_COLOUR_INDEX
#define BACKGROUND_COLOUR_INDEX
Definition: keyconfig.c:30
xemu_update_screen
void xemu_update_screen(void)
Definition: emutools.c:1184
osd_init
int osd_init(int xsize, int ysize, const Uint8 *palette, int palette_entries, int fade_dec, int fade_end)
Definition: osd.c:96
OSD_FADE_END_VAL
#define OSD_FADE_END_VAL
Definition: osd.h:47
font_16x16
const Uint16 font_16x16[]
Definition: osd_font_16x16.c:1
write_char
int write_char(int x1, int y1, char chr, Uint32 colour)
Definition: keyconfig.c:143
keyboard_st::y1
int y1
Definition: keyconfig.c:213
sdl_pix_fmt
SDL_PixelFormat * sdl_pix_fmt
Definition: emutools.c:80
fn
const char * fn
Definition: roms.c:42
xemu_drop_events
#define xemu_drop_events
Definition: gui.c:19
Uint32
uint32_t Uint32
Definition: fat32.c:49
sdl_pixel_buffer
Uint32 * sdl_pixel_buffer
Definition: emutools.c:92
Uint8
uint8_t Uint8
Definition: fat32.c:51
clear_emu_events
void clear_emu_events(void)
Definition: keyconfig.c:65
TARGET_NAME
#define TARGET_NAME
Definition: xemu-target.h:1
APP_ORG
#define APP_ORG
Definition: emutools.h:50
x
int x
Definition: console.c:27
DEBUGPRINT
#define DEBUGPRINT(...)
Definition: emutools_basicdefs.h:171
keyboard_st::x2
int x2
Definition: keyconfig.c:213
osd_status
int osd_status
Definition: osd.c:23
OSD_FADE_DEC_VAL
#define OSD_FADE_DEC_VAL
Definition: osd.h:46
ERROR_WINDOW
#define ERROR_WINDOW(...)
Definition: xep128.h:116
STATUS
#define STATUS(...)
Definition: keyconfig.c:39
keyboard_st
Definition: keyconfig.c:212
keyboard_st::code
SDL_Scancode code
Definition: keyconfig.c:216
NL
#define NL
Definition: fat32.c:37
xemu_post_init
int xemu_post_init(const char *window_title, int is_resizable, int texture_x_size, int texture_y_size, int logical_x_size, int logical_y_size, int win_x_size, int win_y_size, Uint32 pixel_format, int n_colours, const Uint8 *colours, Uint32 *store_palette, int render_scale_quality, int locked_texture_update, void(*shutdown_callback)(void))
Definition: emutools.c:908
LETTER_COLOUR_INDEX
#define LETTER_COLOUR_INDEX
Definition: keyconfig.c:38
ARE_YOU_SURE_DEFAULT_YES
#define ARE_YOU_SURE_DEFAULT_YES
Definition: emutools.h:125
keyboard_st::y2
int y2
Definition: keyconfig.c:213
SCREEN_FORMAT
#define SCREEN_FORMAT
Definition: keyconfig.c:22
ARE_YOU_SURE
int ARE_YOU_SURE(const char *s, int flags)
Definition: emutools.c:1202
keyboard_st::name
const char * name
Definition: keyconfig.c:215
xemu_strdup
char * xemu_strdup(const char *s)
Definition: emutools.c:278
FRAME_DELAY
#define FRAME_DELAY
Definition: keyconfig.c:28
keyboard_st::x1
int x1
Definition: keyconfig.c:213
SCREEN_WIDTH
#define SCREEN_WIDTH
Definition: keyconfig.c:26
y
int y
Definition: console.c:27
APP_DESC_APPEND
#define APP_DESC_APPEND
Definition: emutools.h:52
keyboard_st::title
const char * title
Definition: keyconfig.c:214
OSD_TRAY
#define OSD_TRAY(...)
Definition: keyconfig.c:40
NORMAL_COLOUR_INDEX
#define NORMAL_COLOUR_INDEX
Definition: keyconfig.c:32
name
const char * name
Definition: joystick.c:46
STATUS_COLOUR_INDEX
#define STATUS_COLOUR_INDEX
Definition: keyconfig.c:29
FATAL
#define FATAL(...)
Definition: xep128.h:117
main
int main(int argc, char **argv)
Definition: keyconfig.c:335
RENDER_SCALE_QUALITY
#define RENDER_SCALE_QUALITY
Definition: keyconfig.c:25