From fcebad2589c4887d6889a6da08f7aa588b226044 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 23 Apr 2011 14:47:50 +0200 Subject: [PATCH] FreeConsole() to avoid ugly console. --- docs/ssnes.1 | 4 ++++ ssnes.c | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/ssnes.1 b/docs/ssnes.1 index e68a884a8f..436d9b47af 100644 --- a/docs/ssnes.1 +++ b/docs/ssnes.1 @@ -131,5 +131,9 @@ Network port used for netplay. This defaults to 55435. This option affects both Attempts to apply an UPS patch to the current ROM image. No files are altered. If this flag is not specified, SSNES will look for a .ups file with same basename as ROM specified. +.TP +\fB-D, --detach\fR +Detach from the current console. This is currently only relevant for Microsoft Windows. + .SH "SEE ALSO" \fBssnes-joyconfig\fR(1) diff --git a/ssnes.c b/ssnes.c index 61c59f7d71..cad070f0a5 100644 --- a/ssnes.c +++ b/ssnes.c @@ -316,7 +316,8 @@ static void print_help(void) puts("\t-r/--record: Path to record video file. Settings for video/audio codecs are found in config file."); #endif puts("\t-v/--verbose: Verbose logging"); - puts("\t-U/--ups: Specifies path for UPS patch that will be applied to ROM.\n"); + puts("\t-U/--ups: Specifies path for UPS patch that will be applied to ROM."); + puts("\t-D/--detach: Detach SSNES from the running console. Not relevant for all platforms.\n"); print_features(); } @@ -368,6 +369,7 @@ static void parse_input(int argc, char *argv[]) { "frames", 1, NULL, 'F' }, { "port", 1, &val, 'p' }, { "ups", 1, NULL, 'U' }, + { "detach", 0, NULL, 'D' }, { NULL, 0, NULL, 0 } }; @@ -385,7 +387,7 @@ static void parse_input(int argc, char *argv[]) #define CONFIG_FILE_ARG #endif - char optstring[] = "hs:vS:m:p4jJg:b:B:Y:Z:P:HC:F:U:" FFMPEG_RECORD_ARG CONFIG_FILE_ARG; + char optstring[] = "hs:vS:m:p4jJg:b:B:Y:Z:P:HC:F:U:D" FFMPEG_RECORD_ARG CONFIG_FILE_ARG; for(;;) { val = 0; @@ -504,6 +506,12 @@ static void parse_input(int argc, char *argv[]) strlcpy(g_extern.ups_name, optarg, sizeof(g_extern.ups_name)); break; + case 'D': +#ifdef _WIN32 + FreeConsole(); +#endif + break; + case 0: switch (val) {