Mercurial > repos > blastem
diff 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 |
line wrap: on
line diff
--- a/io.c Wed Jul 17 00:23:45 2013 -0700 +++ b/io.c Wed Jul 17 22:26:11 2013 -0700 @@ -12,7 +12,8 @@ typedef enum { UI_DEBUG_MODE_INC, UI_DEBUG_PAL_INC, - UI_ENTER_DEBUGGER + UI_ENTER_DEBUGGER, + UI_EXIT } ui_action; typedef struct { @@ -209,6 +210,8 @@ case UI_ENTER_DEBUGGER: break_on_sync = 1; break; + case UI_EXIT: + exit(0); } break; } @@ -280,6 +283,8 @@ *ui_out = UI_DEBUG_PAL_INC; } else if(!strcmp(target + 3, "enter_debugger")) { *ui_out = UI_ENTER_DEBUGGER; + } else if(!strcmp(target + 3, "exit")) { + *ui_out = UI_EXIT; } else { fprintf(stderr, "Unreconized UI binding type %s\n", target); return 0; @@ -339,6 +344,7 @@ special = tern_insert_int(special, "left", RENDERKEY_LEFT); special = tern_insert_int(special, "right", RENDERKEY_RIGHT); special = tern_insert_int(special, "enter", '\r'); + special = tern_insert_int(special, "esc", RENDERKEY_ESC); tern_node * padbuttons = tern_insert_int(NULL, ".up", DPAD_UP); padbuttons = tern_insert_int(padbuttons, ".down", DPAD_DOWN);