From 51293dc9de3fc4c271fe60266d1828bce047e8b1 Mon Sep 17 00:00:00 2001 From: Stefan Arentz Date: Thu, 5 Jan 2017 23:06:39 -0500 Subject: [PATCH] Fixes #118 Introduce a --debug option --- src/two.c | 6 ++++++ src/two.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/two.c b/src/two.c index e6bd319..9f0deef 100644 --- a/src/two.c +++ b/src/two.c @@ -537,6 +537,7 @@ static void ewm_two_update_status_bar(struct ewm_two_t *two, double mhz) { #define EWM_TWO_OPT_MEMORY (4) #define EWM_TWO_OPT_TRACE (5) #define EWM_TWO_OPT_STRICT (6) +#define EWM_TWO_OPT_DEBUG (7) static struct option one_options[] = { { "drive1", required_argument, NULL, EWM_TWO_OPT_DRIVE1 }, @@ -546,6 +547,7 @@ static struct option one_options[] = { { "memory", required_argument, NULL, EWM_TWO_OPT_MEMORY }, { "trace", optional_argument, NULL, EWM_TWO_OPT_TRACE }, { "strict", no_argument, NULL, EWM_TWO_OPT_STRICT }, + { "debug", no_argument, NULL, EWM_TWO_OPT_DEBUG }, { NULL, 0, NULL, 0 } }; @@ -559,6 +561,7 @@ int ewm_two_main(int argc, char **argv) { struct ewm_memory_option_t *extra_memory = NULL; char *trace_path = NULL; bool strict = false; + bool debug = false; int ch; while ((ch = getopt_long_only(argc, argv, "", one_options, NULL)) != -1) { @@ -590,6 +593,9 @@ int ewm_two_main(int argc, char **argv) { case EWM_TWO_OPT_STRICT: strict = true; break; + case EWM_TWO_OPT_DEBUG: + debug = true; + break; } } diff --git a/src/two.h b/src/two.h index c5c2db7..58f15db 100644 --- a/src/two.h +++ b/src/two.h @@ -97,6 +97,8 @@ struct ewm_two_t { SDL_Joystick *joystick; bool status_bar_visible; + + bool debug; }; struct ewm_two_t *ewm_two_create(int type, SDL_Renderer *renderer, SDL_Joystick *joystick);