From b3ad5f80e49d9a1eccac7065af3f7a82decfbe1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 10:15:27 -0300 Subject: [PATCH 01/15] (retroarch) Use argv[0] as command name in print_help() --- retroarch.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/retroarch.c b/retroarch.c index 16c6ac823f..55268d36ae 100644 --- a/retroarch.c +++ b/retroarch.c @@ -115,7 +115,7 @@ static void print_features(void) * * Prints help message explaining RetroArch's commandline switches. **/ -static void print_help(void) +static void print_help(const char *arg0) { char str[PATH_MAX_LENGTH] = {0}; @@ -129,7 +129,7 @@ static void print_help(void) fprintf(stdout, "%s", str); fprintf(stdout, "Built: %s\n", __DATE__); puts("==================================================================="); - puts("Usage: retroarch [content file] [options...]"); + printf("Usage: %s [OPTIONS]... [FILE]\n", arg0); puts("\t-h/--help: Show this help message."); puts("\t--menu: Do not require content or libretro core to be loaded, starts directly in menu."); puts("\t\tIf no arguments are passed to " RETRO_FRONTEND ", it is equivalent to using --menu as only argument."); @@ -476,7 +476,7 @@ static void parse_input(int argc, char *argv[]) switch (c) { case 'h': - print_help(); + print_help(argv[0]); exit(0); case 'Z': @@ -500,7 +500,7 @@ static void parse_input(int argc, char *argv[]) if (port < 1 || port > MAX_USERS) { RARCH_ERR("Connect device to a valid port.\n"); - print_help(); + print_help(argv[0]); rarch_fail(1, "parse_input()"); } settings->input.libretro_device[port - 1] = id; @@ -513,7 +513,7 @@ static void parse_input(int argc, char *argv[]) if (port < 1 || port > MAX_USERS) { RARCH_ERR("Connect dualanalog to a valid port.\n"); - print_help(); + print_help(argv[0]); rarch_fail(1, "parse_input()"); } settings->input.libretro_device[port - 1] = RETRO_DEVICE_ANALOG; @@ -546,7 +546,7 @@ static void parse_input(int argc, char *argv[]) if (port < 1 || port > MAX_USERS) { RARCH_ERR("Disconnect device from a valid port.\n"); - print_help(); + print_help(argv[0]); rarch_fail(1, "parse_input()"); } settings->input.libretro_device[port - 1] = RETRO_DEVICE_NONE; @@ -604,7 +604,7 @@ static void parse_input(int argc, char *argv[]) else if (strcmp(optarg, "load-save") != 0) { RARCH_ERR("Invalid argument in --sram-mode.\n"); - print_help(); + print_help(argv[0]); rarch_fail(1, "parse_input()"); } break; @@ -709,7 +709,7 @@ static void parse_input(int argc, char *argv[]) &global->record.height) != 2) { RARCH_ERR("Wrong format for --size.\n"); - print_help(); + print_help(argv[0]); rarch_fail(1, "parse_input()"); } break; @@ -733,7 +733,7 @@ static void parse_input(int argc, char *argv[]) break; case '?': - print_help(); + print_help(argv[0]); rarch_fail(1, "parse_input()"); default: From 1cacb66d395da46ba7ebe5e0e7059b1e773d8488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 10:16:57 -0300 Subject: [PATCH 02/15] (retroarch.c) Make print_help() use less terminal columns --- retroarch.c | 92 ++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/retroarch.c b/retroarch.c index 55268d36ae..ebf79631c2 100644 --- a/retroarch.c +++ b/retroarch.c @@ -55,7 +55,7 @@ #include "config.features.h" -#define _PSUPP(var, name, desc) printf("\t%s:\n\t\t%s: %s\n", name, desc, _##var##_supp ? "yes" : "no") +#define _PSUPP(var, name, desc) printf(" %s:\n\t\t%s: %s\n", name, desc, _##var##_supp ? "yes" : "no") static void print_features(void) { puts(""); @@ -130,61 +130,61 @@ static void print_help(const char *arg0) fprintf(stdout, "Built: %s\n", __DATE__); puts("==================================================================="); printf("Usage: %s [OPTIONS]... [FILE]\n", arg0); - puts("\t-h/--help: Show this help message."); - puts("\t--menu: Do not require content or libretro core to be loaded, starts directly in menu."); - puts("\t\tIf no arguments are passed to " RETRO_FRONTEND ", it is equivalent to using --menu as only argument."); - puts("\t--features: Prints available features compiled into " RETRO_FRONTEND "."); - puts("\t-s/--save: Path for save file (*.srm)."); - puts("\t-f/--fullscreen: Start " RETRO_FRONTEND " in fullscreen regardless of config settings."); - puts("\t-S/--savestate: Path to use for save states. If not selected, *.state will be assumed."); - puts("\t-c/--config: Path for config file." RARCH_DEFAULT_CONF_PATH_STR); - puts("\t--appendconfig: Extra config files are loaded in, and take priority over config selected in -c (or default)."); - puts("\t\tMultiple configs are delimited by '|'."); + puts(" -h/--help: Show this help message."); + puts(" --menu: Do not require content or libretro core to be loaded, starts directly in menu."); + puts(" \tIf no arguments are passed to " RETRO_FRONTEND ", it is equivalent to using --menu as only argument."); + puts(" --features: Prints available features compiled into " RETRO_FRONTEND "."); + puts(" -s/--save: Path for save file (*.srm)."); + puts(" -f/--fullscreen: Start " RETRO_FRONTEND " in fullscreen regardless of config settings."); + puts(" -S/--savestate: Path to use for save states. If not selected, *.state will be assumed."); + puts(" -c/--config: Path for config file." RARCH_DEFAULT_CONF_PATH_STR); + puts(" --appendconfig: Extra config files are loaded in, and take priority over config selected in -c (or default)."); + puts(" \tMultiple configs are delimited by '|'."); #ifdef HAVE_DYNAMIC - puts("\t-L/--libretro: Path to libretro implementation. Overrides any config setting."); + puts(" -L/--libretro: Path to libretro implementation. Overrides any config setting."); #endif - puts("\t--subsystem: Use a subsystem of the libretro core. Multiple content files are loaded as multiple arguments."); - puts("\t\tIf a content file is skipped, use a blank (\"\") command line argument"); - puts("\t\tContent must be loaded in an order which depends on the particular subsystem used."); - puts("\t\tSee verbose log output to learn how a particular subsystem wants content to be loaded."); + puts(" --subsystem: Use a subsystem of the libretro core. Multiple content files are loaded as multiple arguments."); + puts(" \tIf a content file is skipped, use a blank (\"\") command line argument"); + puts(" \tContent must be loaded in an order which depends on the particular subsystem used."); + puts(" \tSee verbose log output to learn how a particular subsystem wants content to be loaded."); - printf("\t-N/--nodevice: Disconnects controller device connected to port (1 to %d).\n", MAX_USERS); - printf("\t-A/--dualanalog: Connect a DualAnalog controller to port (1 to %d).\n", MAX_USERS); - printf("\t-d/--device: Connect a generic device into port of the device (1 to %d).\n", MAX_USERS); - puts("\t\tFormat is port:ID, where ID is an unsigned number corresponding to the particular device.\n"); + printf(" -N/--nodevice: Disconnects controller device connected to port (1 to %d).\n", MAX_USERS); + printf(" -A/--dualanalog: Connect a DualAnalog controller to port (1 to %d).\n", MAX_USERS); + printf(" -d/--device: Connect a generic device into port of the device (1 to %d).\n", MAX_USERS); + puts(" \tFormat is port:ID, where ID is an unsigned number corresponding to the particular device.\n"); - puts("\t-P/--bsvplay: Playback a BSV movie file."); - puts("\t-R/--bsvrecord: Start recording a BSV movie file from the beginning."); - puts("\t--eof-exit: Exit upon reaching the end of the BSV movie file."); - puts("\t-M/--sram-mode: Takes an argument telling how SRAM should be handled in the session."); - puts("\t\t{no,}load-{no,}save describes if SRAM should be loaded, and if SRAM should be saved."); - puts("\t\tDo note that noload-save implies that save files will be deleted and overwritten."); + puts(" -P/--bsvplay: Playback a BSV movie file."); + puts(" -R/--bsvrecord: Start recording a BSV movie file from the beginning."); + puts(" --eof-exit: Exit upon reaching the end of the BSV movie file."); + puts(" -M/--sram-mode: Takes an argument telling how SRAM should be handled in the session."); + puts(" \t{no,}load-{no,}save describes if SRAM should be loaded, and if SRAM should be saved."); + puts(" \tDo note that noload-save implies that save files will be deleted and overwritten."); #ifdef HAVE_NETPLAY - puts("\t-H/--host: Host netplay as user 1."); - puts("\t-C/--connect: Connect to netplay as user 2."); - puts("\t--port: Port used to netplay. Default is 55435."); - puts("\t-F/--frames: Sync frames when using netplay."); - puts("\t--spectate: Netplay will become spectating mode."); - puts("\t\tHost can live stream the game content to users that connect."); - puts("\t\tHowever, the client will not be able to play. Multiple clients can connect to the host."); + puts(" -H/--host: Host netplay as user 1."); + puts(" -C/--connect: Connect to netplay as user 2."); + puts(" --port: Port used to netplay. Default is 55435."); + puts(" -F/--frames: Sync frames when using netplay."); + puts(" --spectate: Netplay will become spectating mode."); + puts(" \tHost can live stream the game content to users that connect."); + puts(" \tHowever, the client will not be able to play. Multiple clients can connect to the host."); #endif - puts("\t--nick: Picks a username (for use with netplay). Not mandatory."); + puts(" --nick: Picks a username (for use with netplay). Not mandatory."); #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY) - puts("\t--command: Sends a command over UDP to an already running " RETRO_FRONTEND " process."); - puts("\t\tAvailable commands are listed if command is invalid."); + puts(" --command: Sends a command over UDP to an already running " RETRO_FRONTEND " process."); + puts(" \tAvailable commands are listed if command is invalid."); #endif - puts("\t-r/--record: Path to record video file.\n\t\tUsing .mkv extension is recommended."); - puts("\t--recordconfig: Path to settings used during recording."); - puts("\t--size: Overrides output video size when recording (format: WIDTHxHEIGHT)."); - puts("\t-v/--verbose: Verbose logging."); - puts("\t-U/--ups: Specifies path for UPS patch that will be applied to content."); - puts("\t--bps: Specifies path for BPS patch that will be applied to content."); - puts("\t--ips: Specifies path for IPS patch that will be applied to content."); - puts("\t--no-patch: Disables all forms of content patching."); - puts("\t-D/--detach: Detach " RETRO_FRONTEND " from the running console. Not relevant for all platforms."); - puts("\t--max-frames: Runs for the specified number of frames, then exits.\n"); + puts(" -r/--record: Path to record video file.\n\t\tUsing .mkv extension is recommended."); + puts(" --recordconfig: Path to settings used during recording."); + puts(" --size: Overrides output video size when recording (format: WIDTHxHEIGHT)."); + puts(" -v/--verbose: Verbose logging."); + puts(" -U/--ups: Specifies path for UPS patch that will be applied to content."); + puts(" --bps: Specifies path for BPS patch that will be applied to content."); + puts(" --ips: Specifies path for IPS patch that will be applied to content."); + puts(" --no-patch: Disables all forms of content patching."); + puts(" -D/--detach: Detach " RETRO_FRONTEND " from the running console. Not relevant for all platforms."); + puts(" --max-frames: Runs for the specified number of frames, then exits.\n"); } static void set_basename(const char *path) From 8057e2654eaf544abfbf5aacabb5f3b2a5941337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 10:23:07 -0300 Subject: [PATCH 03/15] (retroarch.c) Align long options in print_help() --- retroarch.c | 68 ++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/retroarch.c b/retroarch.c index ebf79631c2..16fc023a70 100644 --- a/retroarch.c +++ b/retroarch.c @@ -130,61 +130,61 @@ static void print_help(const char *arg0) fprintf(stdout, "Built: %s\n", __DATE__); puts("==================================================================="); printf("Usage: %s [OPTIONS]... [FILE]\n", arg0); - puts(" -h/--help: Show this help message."); - puts(" --menu: Do not require content or libretro core to be loaded, starts directly in menu."); + puts(" -h, --help Show this help message."); + puts(" --menu: Do not require content or libretro core to be loaded, starts directly in menu."); puts(" \tIf no arguments are passed to " RETRO_FRONTEND ", it is equivalent to using --menu as only argument."); - puts(" --features: Prints available features compiled into " RETRO_FRONTEND "."); - puts(" -s/--save: Path for save file (*.srm)."); - puts(" -f/--fullscreen: Start " RETRO_FRONTEND " in fullscreen regardless of config settings."); - puts(" -S/--savestate: Path to use for save states. If not selected, *.state will be assumed."); - puts(" -c/--config: Path for config file." RARCH_DEFAULT_CONF_PATH_STR); - puts(" --appendconfig: Extra config files are loaded in, and take priority over config selected in -c (or default)."); + puts(" --features: Prints available features compiled into " RETRO_FRONTEND "."); + puts(" -s, --save: Path for save file (*.srm)."); + puts(" -f, --fullscreen: Start " RETRO_FRONTEND " in fullscreen regardless of config settings."); + puts(" -S, --savestate: Path to use for save states. If not selected, *.state will be assumed."); + puts(" -c, --config: Path for config file." RARCH_DEFAULT_CONF_PATH_STR); + puts(" --appendconfig: Extra config files are loaded in, and take priority over config selected in -c (or default)."); puts(" \tMultiple configs are delimited by '|'."); #ifdef HAVE_DYNAMIC - puts(" -L/--libretro: Path to libretro implementation. Overrides any config setting."); + puts(" -L, --libretro: Path to libretro implementation. Overrides any config setting."); #endif - puts(" --subsystem: Use a subsystem of the libretro core. Multiple content files are loaded as multiple arguments."); + puts(" --subsystem: Use a subsystem of the libretro core. Multiple content files are loaded as multiple arguments."); puts(" \tIf a content file is skipped, use a blank (\"\") command line argument"); puts(" \tContent must be loaded in an order which depends on the particular subsystem used."); puts(" \tSee verbose log output to learn how a particular subsystem wants content to be loaded."); - printf(" -N/--nodevice: Disconnects controller device connected to port (1 to %d).\n", MAX_USERS); - printf(" -A/--dualanalog: Connect a DualAnalog controller to port (1 to %d).\n", MAX_USERS); - printf(" -d/--device: Connect a generic device into port of the device (1 to %d).\n", MAX_USERS); + printf(" -N, --nodevice: Disconnects controller device connected to port (1 to %d).\n", MAX_USERS); + printf(" -A, --dualanalog: Connect a DualAnalog controller to port (1 to %d).\n", MAX_USERS); + printf(" -d, --device: Connect a generic device into port of the device (1 to %d).\n", MAX_USERS); puts(" \tFormat is port:ID, where ID is an unsigned number corresponding to the particular device.\n"); - puts(" -P/--bsvplay: Playback a BSV movie file."); - puts(" -R/--bsvrecord: Start recording a BSV movie file from the beginning."); - puts(" --eof-exit: Exit upon reaching the end of the BSV movie file."); - puts(" -M/--sram-mode: Takes an argument telling how SRAM should be handled in the session."); + puts(" -P, --bsvplay: Playback a BSV movie file."); + puts(" -R, --bsvrecord: Start recording a BSV movie file from the beginning."); + puts(" --eof-exit: Exit upon reaching the end of the BSV movie file."); + puts(" -M, --sram-mode: Takes an argument telling how SRAM should be handled in the session."); puts(" \t{no,}load-{no,}save describes if SRAM should be loaded, and if SRAM should be saved."); puts(" \tDo note that noload-save implies that save files will be deleted and overwritten."); #ifdef HAVE_NETPLAY - puts(" -H/--host: Host netplay as user 1."); - puts(" -C/--connect: Connect to netplay as user 2."); - puts(" --port: Port used to netplay. Default is 55435."); - puts(" -F/--frames: Sync frames when using netplay."); - puts(" --spectate: Netplay will become spectating mode."); + puts(" -H, --host: Host netplay as user 1."); + puts(" -C, --connect: Connect to netplay as user 2."); + puts(" --port: Port used to netplay. Default is 55435."); + puts(" -F, --frames: Sync frames when using netplay."); + puts(" --spectate: Netplay will become spectating mode."); puts(" \tHost can live stream the game content to users that connect."); puts(" \tHowever, the client will not be able to play. Multiple clients can connect to the host."); #endif - puts(" --nick: Picks a username (for use with netplay). Not mandatory."); + puts(" --nick: Picks a username (for use with netplay). Not mandatory."); #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY) - puts(" --command: Sends a command over UDP to an already running " RETRO_FRONTEND " process."); + puts(" --command: Sends a command over UDP to an already running " RETRO_FRONTEND " process."); puts(" \tAvailable commands are listed if command is invalid."); #endif - puts(" -r/--record: Path to record video file.\n\t\tUsing .mkv extension is recommended."); - puts(" --recordconfig: Path to settings used during recording."); - puts(" --size: Overrides output video size when recording (format: WIDTHxHEIGHT)."); - puts(" -v/--verbose: Verbose logging."); - puts(" -U/--ups: Specifies path for UPS patch that will be applied to content."); - puts(" --bps: Specifies path for BPS patch that will be applied to content."); - puts(" --ips: Specifies path for IPS patch that will be applied to content."); - puts(" --no-patch: Disables all forms of content patching."); - puts(" -D/--detach: Detach " RETRO_FRONTEND " from the running console. Not relevant for all platforms."); - puts(" --max-frames: Runs for the specified number of frames, then exits.\n"); + puts(" -r, --record: Path to record video file.\n\t\tUsing .mkv extension is recommended."); + puts(" --recordconfig: Path to settings used during recording."); + puts(" --size: Overrides output video size when recording (format: WIDTHxHEIGHT)."); + puts(" -v, --verbose: Verbose logging."); + puts(" -U, --ups: Specifies path for UPS patch that will be applied to content."); + puts(" --bps: Specifies path for BPS patch that will be applied to content."); + puts(" --ips: Specifies path for IPS patch that will be applied to content."); + puts(" --no-patch: Disables all forms of content patching."); + puts(" -D, --detach: Detach " RETRO_FRONTEND " from the running console. Not relevant for all platforms."); + puts(" --max-frames: Runs for the specified number of frames, then exits.\n"); } static void set_basename(const char *path) From 552d6abb7fd5774f98b822b1e36c13fa94885e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 11:18:36 -0300 Subject: [PATCH 04/15] (retroarch.c) Reformat help text --- retroarch.c | 99 +++++++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 45 deletions(-) diff --git a/retroarch.c b/retroarch.c index 16fc023a70..13ab039123 100644 --- a/retroarch.c +++ b/retroarch.c @@ -130,61 +130,70 @@ static void print_help(const char *arg0) fprintf(stdout, "Built: %s\n", __DATE__); puts("==================================================================="); printf("Usage: %s [OPTIONS]... [FILE]\n", arg0); - puts(" -h, --help Show this help message."); - puts(" --menu: Do not require content or libretro core to be loaded, starts directly in menu."); - puts(" \tIf no arguments are passed to " RETRO_FRONTEND ", it is equivalent to using --menu as only argument."); - puts(" --features: Prints available features compiled into " RETRO_FRONTEND "."); - puts(" -s, --save: Path for save file (*.srm)."); - puts(" -f, --fullscreen: Start " RETRO_FRONTEND " in fullscreen regardless of config settings."); - puts(" -S, --savestate: Path to use for save states. If not selected, *.state will be assumed."); - puts(" -c, --config: Path for config file." RARCH_DEFAULT_CONF_PATH_STR); - puts(" --appendconfig: Extra config files are loaded in, and take priority over config selected in -c (or default)."); - puts(" \tMultiple configs are delimited by '|'."); + + puts(" -h, --help Show this help message."); + puts(" --menu Do not require content or libretro core to be loaded,\n" + " starts directly in menu. If no arguments are passed to\n" + " " RETRO_FRONTEND ", it is equivalent to using --menu as only argument."); + puts(" --features Prints available features compiled into " RETRO_FRONTEND "."); + puts(" -s, --save=FILE Path for save file (*.srm)."); + puts(" -f, --fullscreen Start " RETRO_FRONTEND " in fullscreen regardless of config settings."); + puts(" -S, --savestate=FILE Path to use for save states. If not selected, *.state will be assumed."); + puts(" -c, --config=FILE Path for config file." RARCH_DEFAULT_CONF_PATH_STR); + puts(" --appendconfig=FILE\n" + " Extra config files are loaded in, and take priority over\n" + " config selected in -c (or default). Multiple configs are\n" + " delimited by '|'."); #ifdef HAVE_DYNAMIC - puts(" -L, --libretro: Path to libretro implementation. Overrides any config setting."); + puts(" -L, --libretro=FILE Path to libretro implementation. Overrides any config setting."); #endif - puts(" --subsystem: Use a subsystem of the libretro core. Multiple content files are loaded as multiple arguments."); - puts(" \tIf a content file is skipped, use a blank (\"\") command line argument"); - puts(" \tContent must be loaded in an order which depends on the particular subsystem used."); - puts(" \tSee verbose log output to learn how a particular subsystem wants content to be loaded."); + puts(" --subsystem=NAME Use a subsystem of the libretro core. Multiple content\n" + " files are loaded as multiple arguments. If a content\n" + " file is skipped, use a blank (\"\") command line argument.\n" + " Content must be loaded in an order which depends on the\n" + " particular subsystem used. See verbose log output to learn\n" + " how a particular subsystem wants content to be loaded.\n"); - printf(" -N, --nodevice: Disconnects controller device connected to port (1 to %d).\n", MAX_USERS); - printf(" -A, --dualanalog: Connect a DualAnalog controller to port (1 to %d).\n", MAX_USERS); - printf(" -d, --device: Connect a generic device into port of the device (1 to %d).\n", MAX_USERS); - puts(" \tFormat is port:ID, where ID is an unsigned number corresponding to the particular device.\n"); + printf(" -N, --nodevice=PORT\n" + " Disconnects controller device connected to PORT (1 to %d).\n", MAX_USERS); + printf(" -A, --dualanalog=PORT\n" + " Connect a DualAnalog controller to PORT (1 to %d).\n", MAX_USERS); + printf(" -d, --device=PORT:ID\n" + " Connect a generic device into PORT of the device (1 to %d).\n", MAX_USERS); + puts(" Format is PORT:ID, where ID is a number corresponding to the particular device."); - puts(" -P, --bsvplay: Playback a BSV movie file."); - puts(" -R, --bsvrecord: Start recording a BSV movie file from the beginning."); - puts(" --eof-exit: Exit upon reaching the end of the BSV movie file."); - puts(" -M, --sram-mode: Takes an argument telling how SRAM should be handled in the session."); - puts(" \t{no,}load-{no,}save describes if SRAM should be loaded, and if SRAM should be saved."); - puts(" \tDo note that noload-save implies that save files will be deleted and overwritten."); + puts(" -P, --bsvplay=FILE Playback a BSV movie file."); + puts(" -R, --bsvrecord=FILE Start recording a BSV movie file from the beginning."); + puts(" --eof-exit Exit upon reaching the end of the BSV movie file."); + puts(" -M, --sram-mode=MODE SRAM handling mode. MODE can be 'noload-nosave',\n" + " 'noload-save', 'load-nosave' or 'load-save'.\n" + " Note: 'noload-save' implies that save files *WILL BE OVERWRITTEN*."); #ifdef HAVE_NETPLAY - puts(" -H, --host: Host netplay as user 1."); - puts(" -C, --connect: Connect to netplay as user 2."); - puts(" --port: Port used to netplay. Default is 55435."); - puts(" -F, --frames: Sync frames when using netplay."); - puts(" --spectate: Netplay will become spectating mode."); - puts(" \tHost can live stream the game content to users that connect."); - puts(" \tHowever, the client will not be able to play. Multiple clients can connect to the host."); + puts(" -H, --host Host netplay as user 1."); + puts(" -C, --connect=HOST Connect to netplay server as user 2."); + puts(" --port=PORT Port used to netplay. Default is 55435."); + puts(" -F, --frames=NUMBER Sync frames when using netplay."); + puts(" --spectate Connect to netplay server as spectator."); #endif - puts(" --nick: Picks a username (for use with netplay). Not mandatory."); + puts(" --nick=NICK Picks a username (for use with netplay). Not mandatory."); #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY) - puts(" --command: Sends a command over UDP to an already running " RETRO_FRONTEND " process."); - puts(" \tAvailable commands are listed if command is invalid."); + puts(" --command Sends a command over UDP to an already running " RETRO_FRONTEND " process."); + puts(" Available commands are listed if command is invalid."); #endif - puts(" -r, --record: Path to record video file.\n\t\tUsing .mkv extension is recommended."); - puts(" --recordconfig: Path to settings used during recording."); - puts(" --size: Overrides output video size when recording (format: WIDTHxHEIGHT)."); - puts(" -v, --verbose: Verbose logging."); - puts(" -U, --ups: Specifies path for UPS patch that will be applied to content."); - puts(" --bps: Specifies path for BPS patch that will be applied to content."); - puts(" --ips: Specifies path for IPS patch that will be applied to content."); - puts(" --no-patch: Disables all forms of content patching."); - puts(" -D, --detach: Detach " RETRO_FRONTEND " from the running console. Not relevant for all platforms."); - puts(" --max-frames: Runs for the specified number of frames, then exits.\n"); + puts(" -r, --record=FILE Path to record video file.\n Using .mkv extension is recommended."); + puts(" --recordconfig Path to settings used during recording."); + puts(" --size=WIDTHxHEIGHT\n" + " Overrides output video size when recording."); + puts(" -v, --verbose Verbose logging."); + puts(" -U, --ups=FILE Specifies path for UPS patch that will be applied to content."); + puts(" --bps=FILE Specifies path for BPS patch that will be applied to content."); + puts(" --ips=FILE Specifies path for IPS patch that will be applied to content."); + puts(" --no-patch Disables all forms of content patching."); + puts(" -D, --detach Detach " RETRO_FRONTEND " from the running console. Not relevant for all platforms."); + puts(" --max-frames=NUMBER\n" + " Runs for the specified number of frames, then exits.\n"); } static void set_basename(const char *path) From 164110d04dd5050145083d458074b5c6e7c605e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 11:27:39 -0300 Subject: [PATCH 05/15] (retroarch.c) Align opts definition --- retroarch.c | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/retroarch.c b/retroarch.c index 13ab039123..9f303b595d 100644 --- a/retroarch.c +++ b/retroarch.c @@ -411,45 +411,45 @@ static void parse_input(int argc, char *argv[]) const struct option opts[] = { #ifdef HAVE_DYNAMIC - { "libretro", 1, NULL, 'L' }, + { "libretro", 1, NULL, 'L' }, #endif - { "menu", 0, &val, 'M' }, - { "help", 0, NULL, 'h' }, - { "save", 1, NULL, 's' }, - { "fullscreen", 0, NULL, 'f' }, - { "record", 1, NULL, 'r' }, + { "menu", 0, &val, 'M' }, + { "help", 0, NULL, 'h' }, + { "save", 1, NULL, 's' }, + { "fullscreen", 0, NULL, 'f' }, + { "record", 1, NULL, 'r' }, { "recordconfig", 1, &val, 'R' }, - { "size", 1, &val, 's' }, - { "verbose", 0, NULL, 'v' }, - { "config", 1, NULL, 'c' }, + { "size", 1, &val, 's' }, + { "verbose", 0, NULL, 'v' }, + { "config", 1, NULL, 'c' }, { "appendconfig", 1, &val, 'C' }, - { "nodevice", 1, NULL, 'N' }, - { "dualanalog", 1, NULL, 'A' }, - { "device", 1, NULL, 'd' }, - { "savestate", 1, NULL, 'S' }, - { "bsvplay", 1, NULL, 'P' }, - { "bsvrecord", 1, NULL, 'R' }, - { "sram-mode", 1, NULL, 'M' }, + { "nodevice", 1, NULL, 'N' }, + { "dualanalog", 1, NULL, 'A' }, + { "device", 1, NULL, 'd' }, + { "savestate", 1, NULL, 'S' }, + { "bsvplay", 1, NULL, 'P' }, + { "bsvrecord", 1, NULL, 'R' }, + { "sram-mode", 1, NULL, 'M' }, #ifdef HAVE_NETPLAY - { "host", 0, NULL, 'H' }, - { "connect", 1, NULL, 'C' }, - { "frames", 1, NULL, 'F' }, - { "port", 1, &val, 'p' }, - { "spectate", 0, &val, 'S' }, + { "host", 0, NULL, 'H' }, + { "connect", 1, NULL, 'C' }, + { "frames", 1, NULL, 'F' }, + { "port", 1, &val, 'p' }, + { "spectate", 0, &val, 'S' }, #endif - { "nick", 1, &val, 'N' }, + { "nick", 1, &val, 'N' }, #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY) - { "command", 1, &val, 'c' }, + { "command", 1, &val, 'c' }, #endif - { "ups", 1, NULL, 'U' }, - { "bps", 1, &val, 'B' }, - { "ips", 1, &val, 'I' }, - { "no-patch", 0, &val, 'n' }, - { "detach", 0, NULL, 'D' }, - { "features", 0, &val, 'f' }, - { "subsystem", 1, NULL, 'Z' }, - { "max-frames", 1, NULL, 'm' }, - { "eof-exit", 0, &val, 'e' }, + { "ups", 1, NULL, 'U' }, + { "bps", 1, &val, 'B' }, + { "ips", 1, &val, 'I' }, + { "no-patch", 0, &val, 'n' }, + { "detach", 0, NULL, 'D' }, + { "features", 0, &val, 'f' }, + { "subsystem", 1, NULL, 'Z' }, + { "max-frames", 1, NULL, 'm' }, + { "eof-exit", 0, &val, 'e' }, { NULL, 0, NULL, 0 } }; From 4e595b34c1cd3a8bb33e626becd28829ed28649b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 11:42:29 -0300 Subject: [PATCH 06/15] (retroarch.c) Add print_version() --- retroarch.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/retroarch.c b/retroarch.c index 9f303b595d..7b8c1e8201 100644 --- a/retroarch.c +++ b/retroarch.c @@ -110,12 +110,7 @@ static void print_features(void) } #undef _PSUPP -/** - * print_help: - * - * Prints help message explaining RetroArch's commandline switches. - **/ -static void print_help(const char *arg0) +static void print_version(void) { char str[PATH_MAX_LENGTH] = {0}; @@ -129,13 +124,26 @@ static void print_help(const char *arg0) fprintf(stdout, "%s", str); fprintf(stdout, "Built: %s\n", __DATE__); puts("==================================================================="); +} + +/** + * print_help: + * + * Prints help message explaining RetroArch's commandline switches. + **/ +static void print_help(const char *arg0) +{ + print_version(); printf("Usage: %s [OPTIONS]... [FILE]\n", arg0); puts(" -h, --help Show this help message."); + puts(" -v, --verbose Verbose logging."); + puts(" --log-file=FILE Log " RETRO_FRONTEND " messages to FILE."); + puts(" --version Show " RETRO_FRONTEND " version."); + puts(" --features Prints available features compiled into " RETRO_FRONTEND "."); puts(" --menu Do not require content or libretro core to be loaded,\n" " starts directly in menu. If no arguments are passed to\n" " " RETRO_FRONTEND ", it is equivalent to using --menu as only argument."); - puts(" --features Prints available features compiled into " RETRO_FRONTEND "."); puts(" -s, --save=FILE Path for save file (*.srm)."); puts(" -f, --fullscreen Start " RETRO_FRONTEND " in fullscreen regardless of config settings."); puts(" -S, --savestate=FILE Path to use for save states. If not selected, *.state will be assumed."); @@ -186,7 +194,6 @@ static void print_help(const char *arg0) puts(" --recordconfig Path to settings used during recording."); puts(" --size=WIDTHxHEIGHT\n" " Overrides output video size when recording."); - puts(" -v, --verbose Verbose logging."); puts(" -U, --ups=FILE Specifies path for UPS patch that will be applied to content."); puts(" --bps=FILE Specifies path for BPS patch that will be applied to content."); puts(" --ips=FILE Specifies path for IPS patch that will be applied to content."); From ecede41cb21b95924de15e3dcdca8ea7bbb5992d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 12:31:28 -0300 Subject: [PATCH 07/15] (retroarch.c) Add --log-file and --version --- Makefile | 2 ++ Makefile.common | 4 ++++ retroarch.c | 20 +++++++++++++++++++- retroarch_logger.h | 3 ++- tools/retroarch-joyconfig-griffin.c | 2 ++ 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7fc22768a8..c27edef6ed 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +HAVE_FILE_LOGGER=1 + include config.mk TARGET = retroarch diff --git a/Makefile.common b/Makefile.common index 88ba717c9f..7f6b5ff3db 100644 --- a/Makefile.common +++ b/Makefile.common @@ -37,6 +37,10 @@ ifeq ($(TDM_GCC),) LDCXXFLAGS += -static-libstdc++ endif +ifeq ($(HAVE_FILE_LOGGER), 1) + CFLAGS += -DHAVE_FILE_LOGGER -Ilogger/netlogger +endif + CFLAGS += -I./libretro-common/include # Switches diff --git a/retroarch.c b/retroarch.c index 7b8c1e8201..dea16ef8fb 100644 --- a/retroarch.c +++ b/retroarch.c @@ -457,6 +457,10 @@ static void parse_input(int argc, char *argv[]) { "subsystem", 1, NULL, 'Z' }, { "max-frames", 1, NULL, 'm' }, { "eof-exit", 0, &val, 'e' }, + { "version", 0, &val, 'V' }, +#ifdef HAVE_FILE_LOGGER + { "log-file", 1, &val, 'L' }, +#endif { NULL, 0, NULL, 0 } }; @@ -662,7 +666,7 @@ static void parse_input(int argc, char *argv[]) runloop->frames.video.max = strtoul(optarg, NULL, 10); break; - case 0: + case 0: /* options without short variant */ switch (val) { case 'M': @@ -743,6 +747,16 @@ static void parse_input(int argc, char *argv[]) global->bsv.eof_exit = true; break; + case 'V': + print_version(); + exit(0); + +#ifdef HAVE_FILE_LOGGER + case 'L': + global->log_file = fopen(optarg, "wb"); + break; +#endif + default: break; } @@ -1169,6 +1183,10 @@ error: void rarch_main_init_wrap(const struct rarch_main_wrap *args, int *argc, char **argv) { +#ifdef HAVE_FILE_LOGGER + int i; +#endif + *argc = 0; argv[(*argc)++] = strdup("retroarch"); diff --git a/retroarch_logger.h b/retroarch_logger.h index aa5aa3a314..098816db45 100644 --- a/retroarch_logger.h +++ b/retroarch_logger.h @@ -20,7 +20,8 @@ #include #include -#if defined(HAVE_FILE_LOGGER) && defined(RARCH_INTERNAL) +#if defined(HAVE_FILE_LOGGER) && defined(RARCH_INTERNAL) && !defined(IS_JOYCONFIG) +FILE *rarch_main_log_file(void); #define LOG_FILE (rarch_main_log_file()) #else #define LOG_FILE (stderr) diff --git a/tools/retroarch-joyconfig-griffin.c b/tools/retroarch-joyconfig-griffin.c index 89a13fd033..4a63722fb4 100644 --- a/tools/retroarch-joyconfig-griffin.c +++ b/tools/retroarch-joyconfig-griffin.c @@ -14,6 +14,8 @@ * If not, see . */ +#define IS_JOYCONFIG + #include "retroarch-joyconfig.c" #include "../libretro-common/dynamic/dylib.c" From badf586e1a537febffa50a7f399c4747bfe65ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 12:31:56 -0300 Subject: [PATCH 08/15] (retroarch.c) Fix segfault --- retroarch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroarch.c b/retroarch.c index dea16ef8fb..fead6b9a9d 100644 --- a/retroarch.c +++ b/retroarch.c @@ -981,8 +981,8 @@ void rarch_main_new(void) void rarch_main_free(void) { event_command(EVENT_CMD_MSG_QUEUE_DEINIT); - event_command(EVENT_CMD_LOG_FILE_DEINIT); event_command(EVENT_CMD_DRIVERS_DEINIT); + event_command(EVENT_CMD_LOG_FILE_DEINIT); rarch_main_state_free(); rarch_main_global_free(); From f9d6cab4456ed1ca42c153bc644b980a047b6859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 12:42:44 -0300 Subject: [PATCH 09/15] (retroarch.c) Use descriptive name for the long-only options --- retroarch.c | 75 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/retroarch.c b/retroarch.c index fead6b9a9d..248e3c4f73 100644 --- a/retroarch.c +++ b/retroarch.c @@ -53,6 +53,26 @@ #endif #endif +/* Descriptive names for options without short variant. Please keep the name in + sync with the option name. Order does not matter. */ +enum { + RA_OPT_MENU, + RA_OPT_PORT, + RA_OPT_SPECTATE, + RA_OPT_NICK, + RA_OPT_COMMAND, + RA_OPT_APPENDCONFIG, + RA_OPT_BPS, + RA_OPT_IPS, + RA_OPT_NO_PATCH, + RA_OPT_RECORDCONFIG, + RA_OPT_SIZE, + RA_OPT_FEATURES, + RA_OPT_VERSION, + RA_OPT_EOF_EXIT, + RA_OPT_LOG_FILE, +}; + #include "config.features.h" #define _PSUPP(var, name, desc) printf(" %s:\n\t\t%s: %s\n", name, desc, _##var##_supp ? "yes" : "no") @@ -420,13 +440,13 @@ static void parse_input(int argc, char *argv[]) #ifdef HAVE_DYNAMIC { "libretro", 1, NULL, 'L' }, #endif - { "menu", 0, &val, 'M' }, + { "menu", 0, &val, RA_OPT_MENU }, { "help", 0, NULL, 'h' }, { "save", 1, NULL, 's' }, { "fullscreen", 0, NULL, 'f' }, { "record", 1, NULL, 'r' }, { "recordconfig", 1, &val, 'R' }, - { "size", 1, &val, 's' }, + { "size", 1, &val, RA_OPT_SIZE }, { "verbose", 0, NULL, 'v' }, { "config", 1, NULL, 'c' }, { "appendconfig", 1, &val, 'C' }, @@ -441,25 +461,25 @@ static void parse_input(int argc, char *argv[]) { "host", 0, NULL, 'H' }, { "connect", 1, NULL, 'C' }, { "frames", 1, NULL, 'F' }, - { "port", 1, &val, 'p' }, - { "spectate", 0, &val, 'S' }, + { "port", 1, &val, RA_OPT_PORT }, + { "spectate", 0, &val, RA_OPT_SPECTATE }, #endif { "nick", 1, &val, 'N' }, #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY) - { "command", 1, &val, 'c' }, + { "command", 1, &val, RA_OPT_COMMAND }, #endif { "ups", 1, NULL, 'U' }, - { "bps", 1, &val, 'B' }, - { "ips", 1, &val, 'I' }, - { "no-patch", 0, &val, 'n' }, + { "bps", 1, &val, RA_OPT_BPS }, + { "ips", 1, &val, RA_OPT_IPS }, + { "no-patch", 0, &val, RA_OPT_NO_PATCH }, { "detach", 0, NULL, 'D' }, - { "features", 0, &val, 'f' }, + { "features", 0, &val, RA_OPT_FEATURES }, { "subsystem", 1, NULL, 'Z' }, { "max-frames", 1, NULL, 'm' }, - { "eof-exit", 0, &val, 'e' }, - { "version", 0, &val, 'V' }, + { "eof-exit", 0, &val, RA_OPT_EOF_EXIT }, + { "version", 0, &val, RA_OPT_VERSION }, #ifdef HAVE_FILE_LOGGER - { "log-file", 1, &val, 'L' }, + { "log-file", 1, &val, RA_OPT_LOG_FILE }, #endif { NULL, 0, NULL, 0 } }; @@ -669,30 +689,30 @@ static void parse_input(int argc, char *argv[]) case 0: /* options without short variant */ switch (val) { - case 'M': + case RA_OPT_MENU: global->libretro_dummy = true; break; #ifdef HAVE_NETPLAY - case 'p': + case RA_OPT_PORT: global->has_set_netplay_ip_port = true; global->netplay_port = strtoul(optarg, NULL, 0); break; - case 'S': + case RA_OPT_SPECTATE: global->has_set_netplay_mode = true; global->netplay_is_spectate = true; break; #endif - case 'N': + case RA_OPT_NICK: global->has_set_username = true; strlcpy(settings->username, optarg, sizeof(settings->username)); break; #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY) - case 'c': + case RA_OPT_COMMAND: if (network_cmd_send(optarg)) exit(0); else @@ -700,30 +720,30 @@ static void parse_input(int argc, char *argv[]) break; #endif - case 'C': + case RA_OPT_APPENDCONFIG: strlcpy(global->append_config_path, optarg, sizeof(global->append_config_path)); break; - case 'B': + case RA_OPT_BPS: strlcpy(global->bps_name, optarg, sizeof(global->bps_name)); global->bps_pref = true; global->has_set_bps_pref = true; break; - case 'I': + case RA_OPT_IPS: strlcpy(global->ips_name, optarg, sizeof(global->ips_name)); global->ips_pref = true; global->has_set_ips_pref = true; break; - case 'n': + case RA_OPT_NO_PATCH: global->block_patch = true; break; - case 's': + case RA_OPT_SIZE: { if (sscanf(optarg, "%ux%u", &global->record.width, &global->record.height) != 2) @@ -735,28 +755,27 @@ static void parse_input(int argc, char *argv[]) break; } - case 'R': + case RA_OPT_RECORDCONFIG: strlcpy(global->record.config, optarg, sizeof(global->record.config)); break; - case 'f': + case RA_OPT_FEATURES: print_features(); exit(0); - case 'e': + case RA_OPT_EOF_EXIT: global->bsv.eof_exit = true; break; - case 'V': + case RA_OPT_VERSION: print_version(); exit(0); #ifdef HAVE_FILE_LOGGER - case 'L': + case RA_OPT_LOG_FILE: global->log_file = fopen(optarg, "wb"); break; #endif - default: break; } From b08847abdd47e09c64971c673735dade4bc1d37e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 12:43:38 -0300 Subject: [PATCH 10/15] (retroarch.c) Move print_version() ascii art to print_help() --- retroarch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/retroarch.c b/retroarch.c index 248e3c4f73..e635d8d10e 100644 --- a/retroarch.c +++ b/retroarch.c @@ -134,7 +134,6 @@ static void print_version(void) { char str[PATH_MAX_LENGTH] = {0}; - puts("==================================================================="); #ifdef HAVE_GIT_VERSION printf(RETRO_FRONTEND ": Frontend for libretro -- v" PACKAGE_VERSION " -- %s --\n", rarch_git_version); #else @@ -143,7 +142,6 @@ static void print_version(void) rarch_info_get_capabilities(RARCH_CAPABILITIES_COMPILER, str, sizeof(str)); fprintf(stdout, "%s", str); fprintf(stdout, "Built: %s\n", __DATE__); - puts("==================================================================="); } /** @@ -153,7 +151,10 @@ static void print_version(void) **/ static void print_help(const char *arg0) { + puts("==================================================================="); print_version(); + puts("==================================================================="); + printf("Usage: %s [OPTIONS]... [FILE]\n", arg0); puts(" -h, --help Show this help message."); From 805ac369c0083792168193207eee841b53b938a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 12:52:51 -0300 Subject: [PATCH 11/15] (retroarch.c) Clear confusion about -s and -S --- retroarch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroarch.c b/retroarch.c index e635d8d10e..d5e933a784 100644 --- a/retroarch.c +++ b/retroarch.c @@ -166,8 +166,8 @@ static void print_help(const char *arg0) " starts directly in menu. If no arguments are passed to\n" " " RETRO_FRONTEND ", it is equivalent to using --menu as only argument."); puts(" -s, --save=FILE Path for save file (*.srm)."); + puts(" -S, --savestate=FILE Path for the save state file (*.state)."); puts(" -f, --fullscreen Start " RETRO_FRONTEND " in fullscreen regardless of config settings."); - puts(" -S, --savestate=FILE Path to use for save states. If not selected, *.state will be assumed."); puts(" -c, --config=FILE Path for config file." RARCH_DEFAULT_CONF_PATH_STR); puts(" --appendconfig=FILE\n" " Extra config files are loaded in, and take priority over\n" From a264720bb6803c3f9f320717b80e6b9cb10dc73d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 13:01:38 -0300 Subject: [PATCH 12/15] (retroarch.c) Use stderr as log file by default --- command_event.c | 2 +- retroarch.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/command_event.c b/command_event.c index 12a754d019..97f725d5fe 100644 --- a/command_event.c +++ b/command_event.c @@ -1550,7 +1550,7 @@ bool event_command(enum event_command cmd) if (!global) break; - if (global->log_file) + if (global->log_file && global->log_file != stderr) fclose(global->log_file); global->log_file = NULL; break; diff --git a/retroarch.c b/retroarch.c index d5e933a784..4d50e756c4 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1131,6 +1131,7 @@ int rarch_main_init(int argc, char *argv[]) return sjlj_ret; } global->error_in_init = true; + global->log_file = stderr; parse_input(argc, argv); if (global->verbosity) From f9d01a079aa025f53457f295a62bb7c41a758dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 13:09:00 -0300 Subject: [PATCH 13/15] (retroarch.c) Replace FILE with PATH for -s and -S options --- retroarch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retroarch.c b/retroarch.c index 4d50e756c4..a01ed3f88a 100644 --- a/retroarch.c +++ b/retroarch.c @@ -165,8 +165,8 @@ static void print_help(const char *arg0) puts(" --menu Do not require content or libretro core to be loaded,\n" " starts directly in menu. If no arguments are passed to\n" " " RETRO_FRONTEND ", it is equivalent to using --menu as only argument."); - puts(" -s, --save=FILE Path for save file (*.srm)."); - puts(" -S, --savestate=FILE Path for the save state file (*.state)."); + puts(" -s, --save=PATH Path for save files (*.srm)."); + puts(" -S, --savestate=PATH Path for the save state files (*.state)."); puts(" -f, --fullscreen Start " RETRO_FRONTEND " in fullscreen regardless of config settings."); puts(" -c, --config=FILE Path for config file." RARCH_DEFAULT_CONF_PATH_STR); puts(" --appendconfig=FILE\n" From 34af0aa9563e3236140bf161c3dc81d521c5de45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 13:19:48 -0300 Subject: [PATCH 14/15] (retroarch.c) Default to --menu behavior --- retroarch.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/retroarch.c b/retroarch.c index a01ed3f88a..a98f89524f 100644 --- a/retroarch.c +++ b/retroarch.c @@ -399,7 +399,11 @@ static void parse_input(int argc, char *argv[]) global_t *global = global_get_ptr(); global->libretro_no_content = false; +#ifdef HAVE_DYNAMIC + global->libretro_dummy = true; +#else global->libretro_dummy = false; +#endif global->has_set_save_path = false; global->has_set_state_path = false; global->has_set_libretro = false; @@ -426,12 +430,6 @@ static void parse_input(int argc, char *argv[]) global->overrides_active = false; - if (argc < 2) - { - global->libretro_dummy = true; - return; - } - /* Make sure we can call parse_input several times ... */ optind = 0; @@ -622,6 +620,7 @@ static void parse_input(int argc, char *argv[]) sizeof(settings->libretro)); global->has_set_libretro = true; } + global->libretro_dummy = false; break; #endif case 'P': From beb383ff455ae93aacc5126902376f80c1ecd4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 12 Jun 2015 13:36:07 -0300 Subject: [PATCH 15/15] (retroarch_logger.c) Add extern "C" to forward declaration --- retroarch_logger.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/retroarch_logger.h b/retroarch_logger.h index 098816db45..11d2a1c512 100644 --- a/retroarch_logger.h +++ b/retroarch_logger.h @@ -21,6 +21,9 @@ #include #if defined(HAVE_FILE_LOGGER) && defined(RARCH_INTERNAL) && !defined(IS_JOYCONFIG) +#ifdef __cplusplus +extern "C" +#endif FILE *rarch_main_log_file(void); #define LOG_FILE (rarch_main_log_file()) #else