comparison io.c @ 444:cc754a309ead

Add fullscreen support and add a keybinding for exiting the emulator
author Mike Pavone <pavone@retrodev.com>
date Wed, 17 Jul 2013 22:26:11 -0700
parents afbea09d7fb4
children b7c3b2d22858
comparison
equal deleted inserted replaced
443:9ac3828ea560 444:cc754a309ead
10 }; 10 };
11 11
12 typedef enum { 12 typedef enum {
13 UI_DEBUG_MODE_INC, 13 UI_DEBUG_MODE_INC,
14 UI_DEBUG_PAL_INC, 14 UI_DEBUG_PAL_INC,
15 UI_ENTER_DEBUGGER 15 UI_ENTER_DEBUGGER,
16 UI_EXIT
16 } ui_action; 17 } ui_action;
17 18
18 typedef struct { 19 typedef struct {
19 uint8_t bind_type; 20 uint8_t bind_type;
20 uint8_t subtype_a; 21 uint8_t subtype_a;
207 render_debug_pal(ui_debug_pal); 208 render_debug_pal(ui_debug_pal);
208 break; 209 break;
209 case UI_ENTER_DEBUGGER: 210 case UI_ENTER_DEBUGGER:
210 break_on_sync = 1; 211 break_on_sync = 1;
211 break; 212 break;
213 case UI_EXIT:
214 exit(0);
212 } 215 }
213 break; 216 break;
214 } 217 }
215 } 218 }
216 219
278 *ui_out = UI_DEBUG_MODE_INC; 281 *ui_out = UI_DEBUG_MODE_INC;
279 } else if(!strcmp(target + 3, "vdp_debug_pal")) { 282 } else if(!strcmp(target + 3, "vdp_debug_pal")) {
280 *ui_out = UI_DEBUG_PAL_INC; 283 *ui_out = UI_DEBUG_PAL_INC;
281 } else if(!strcmp(target + 3, "enter_debugger")) { 284 } else if(!strcmp(target + 3, "enter_debugger")) {
282 *ui_out = UI_ENTER_DEBUGGER; 285 *ui_out = UI_ENTER_DEBUGGER;
286 } else if(!strcmp(target + 3, "exit")) {
287 *ui_out = UI_EXIT;
283 } else { 288 } else {
284 fprintf(stderr, "Unreconized UI binding type %s\n", target); 289 fprintf(stderr, "Unreconized UI binding type %s\n", target);
285 return 0; 290 return 0;
286 } 291 }
287 return 2; 292 return 2;
337 tern_node * special = tern_insert_int(NULL, "up", RENDERKEY_UP); 342 tern_node * special = tern_insert_int(NULL, "up", RENDERKEY_UP);
338 special = tern_insert_int(special, "down", RENDERKEY_DOWN); 343 special = tern_insert_int(special, "down", RENDERKEY_DOWN);
339 special = tern_insert_int(special, "left", RENDERKEY_LEFT); 344 special = tern_insert_int(special, "left", RENDERKEY_LEFT);
340 special = tern_insert_int(special, "right", RENDERKEY_RIGHT); 345 special = tern_insert_int(special, "right", RENDERKEY_RIGHT);
341 special = tern_insert_int(special, "enter", '\r'); 346 special = tern_insert_int(special, "enter", '\r');
347 special = tern_insert_int(special, "esc", RENDERKEY_ESC);
342 348
343 tern_node * padbuttons = tern_insert_int(NULL, ".up", DPAD_UP); 349 tern_node * padbuttons = tern_insert_int(NULL, ".up", DPAD_UP);
344 padbuttons = tern_insert_int(padbuttons, ".down", DPAD_DOWN); 350 padbuttons = tern_insert_int(padbuttons, ".down", DPAD_DOWN);
345 padbuttons = tern_insert_int(padbuttons, ".left", DPAD_LEFT); 351 padbuttons = tern_insert_int(padbuttons, ".left", DPAD_LEFT);
346 padbuttons = tern_insert_int(padbuttons, ".right", DPAD_RIGHT); 352 padbuttons = tern_insert_int(padbuttons, ".right", DPAD_RIGHT);