From 766a0744d8dbc05775d1dc992db79bd707d9071f Mon Sep 17 00:00:00 2001 From: Christopher Mason Date: Tue, 3 Feb 2015 00:02:45 +0000 Subject: [PATCH] Add menu item to allow user to apply changes to emulated Imagewriter without restarting GSport. To use, make changes and then select "Apply Changes". --- src/config.c | 14 +++++++++++++- src/protos.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index 895ce94..eac3cc9 100644 --- a/src/config.c +++ b/src/config.c @@ -22,6 +22,7 @@ #include "defc.h" #include #include "config.h" +#include "imagewriter.h" #if defined(__OS2__) #include "arch\os2\src\dirport.h" #elif defined(_MSC_VER) @@ -321,6 +322,9 @@ Cfg_menu g_cfg_imagewriter_menu[] = { { "Fixed Width Font", KNMP(g_imagewriter_fixed_font), CFGTYPE_FILE }, { "", 0, 0, 0, 0 }, { "Proportional Font", KNMP(g_imagewriter_prop_font), CFGTYPE_FILE }, +{ "", 0, 0, 0, 0 }, +{ "", 0, 0, 0, 0 }, +{ "Apply Changes", (void *)cfg_iwreset, 0, 0, CFGTYPE_FUNC }, { "", 0, 0, 0, 0 }, { "Back to Main Config", g_cfg_main_menu, 0, 0, CFGTYPE_MENU }, { 0, 0, 0, 0, 0 }, @@ -604,7 +608,14 @@ cfg_text_screen_dump() } fclose(ofile); } - +void +cfg_iwreset() +{ + imagewriter_feed(); + imagewriter_close(); + imagewriter_init(g_imagewriter_dpi,612,792,g_imagewriter_output,g_imagewriter_multipage, 0); + return; +} #ifdef HAVE_TFE void cfg_get_tfe_name() @@ -3333,6 +3344,7 @@ config_control_panel() case CFGTYPE_FUNC: fn_ptr = (void (*)())ptr; (*fn_ptr)(); + adb_all_keys_up(); //Needed otherwise menu function will continue to repeat until we move selection up or down break; case CFGTYPE_FILE: g_cfg_slotdrive = 0xfff; diff --git a/src/protos.h b/src/protos.h index f648a7e..8f9a82a 100644 --- a/src/protos.h +++ b/src/protos.h @@ -160,6 +160,7 @@ void config_init(void); void cfg_exit(void); void cfg_toggle_config_panel(void); void cfg_text_screen_dump(void); +void cfg_iwreset(void); void cfg_get_tfe_name(void); void cfg_inspect_maybe_insert_file(char *filename, int should_boot); int cfg_guess_image_size(char *filename);