{ "disable-audio", 'a', POPT_ARG_NONE, 0, 1,
"disable emulation and output of audio", 0 },
{ "display-framerate", 'r', POPT_ARG_NONE, 0, 2,
- "Show frames per second counter in lower left corner", 0 },
+ "show frames per second counter in lower left corner", 0 },
{ "skip-frames", 's', POPT_ARG_INT, 0, 3,
- "Render only 1 in every N frames", "NUM" },
+ "render only 1 in every N frames", "NUM" },
{ "fullscreen", 'f', POPT_ARG_NONE, 0, 4,
- "Start in fullscreen mode", 0 },
+ "start in fullscreen mode", 0 },
{ "transparency", 'y', POPT_ARG_NONE, 0, 5,
- "Enable transparency effects (slower)", 0 },
- { "hacks", 'h', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, 0, 6,
- "Enable hacks (yes, speed-only, no)", "option" },
+ "enable transparency effects (slower)", 0 },
+ { "scaler", 'S', POPT_ARG_STRING, 0, 6,
+ "select scaler to use", 0 },
{ "pal", 'p', POPT_ARG_NONE, 0, 7,
- "Run in PAL mode", 0 },
+ "run in PAL mode", 0 },
{ "ntsc", 'n', POPT_ARG_NONE, 0, 8,
- "Run in NTSC mode", 0 },
+ "run in NTSC mode", 0 },
{ "turbo", 't', POPT_ARG_NONE, 0, 9,
- "Turbo mode (do not try to sleep between frames)", 0 },
+ "turbo mode (do not try to sleep between frames)", 0 },
{ "conf", 'c', POPT_ARG_STRING, 0, 10,
- "Extra configuration file to load", "FILE" },
+ "extra configuration file to load", "FILE" },
{ "mouse", 'm', POPT_ARG_INT | POPT_ARGFLAG_OPTIONAL, 0, 11,
- "Enable mouse on controller NUM", "NUM"},
+ "enable mouse on controller NUM", "NUM"},
{ "superscope", 'e', POPT_ARG_NONE, 0, 12,
- "Enable SuperScope", 0},
+ "enable SuperScope", 0},
{ "snapshot", 'o', POPT_ARG_NONE, 0, 13,
- "Unfreeze previous game on start and freeze game on exit", 0 },
+ "unfreeze previous game on start and freeze game on exit", 0 },
{ "audio-rate", 'u', POPT_ARG_INT, 0, 14,
- "Audio output rate", "HZ" },
+ "audio output rate", "HZ" },
{ "audio-buffer-size", 'b', POPT_ARG_INT, 0, 15,
- "Audio output buffer size", "SAMPLES" },
+ "audio output buffer size", "SAMPLES" },
+ { "touchscreen", 'd', POPT_ARG_NONE, 0, 16,
+ "enable touchscreen controls", 0 },
+ { "touchscreen-grid", 'D', POPT_ARG_NONE, 0, 17,
+ "enable touchscreen controls and show grid", 0 },
+ { "hacks", 'h', POPT_ARG_NONE, 0, 18,
+ "enable safe subset of speedhacks", 0 },
+ { "all-hacks", 'H', POPT_ARG_NONE, 0, 19,
+ "enable all speedhacks (may break sound)", 0 },
POPT_TABLEEND
};
static struct poptOption configOptionsTable[] = {
{ "scancode", '\0', POPT_ARG_INT, 0, 100,
- "Scancode to map", "CODE" },
+ "scancode to map", "CODE" },
{ "button", '\0', POPT_ARG_STRING, 0, 101,
"SNES Button to press (A, B, X, Y, L, R, Up, Down, Left, Right)", "name" },
{ "action", '\0', POPT_ARG_STRING, 0, 102,
- "Emulator action to do (fullscreen, quit, ...)", "action" },
+ "emulator action to do (fullscreen, quit, ...)", "action" },
{ "hacks-file", '\0', POPT_ARG_STRING, 0, 200,
- "Path to snesadvance.dat file", "FILE" },
+ "path to snesadvance.dat file", "FILE" },
POPT_TABLEEND
};
return kActionQuit;
} else if (strcasecmp(s, "fullscreen") == 0) {
return kActionToggleFullscreen;
+ } else if (strcasecmp(s, "quickload1") == 0) {
+ return kActionQuickLoad1;
+ } else if (strcasecmp(s, "quicksave1") == 0) {
+ return kActionQuickSave1;
+ } else if (strcasecmp(s, "quickload2") == 0) {
+ return kActionQuickLoad2;
+ } else if (strcasecmp(s, "quicksave2") == 0) {
+ return kActionQuickSave2;
} else {
DIE("Bad action name: %s\n", s);
}
const char * S9xGetFilename(FileTypes file)
{
- static char filename [PATH_MAX + 1];
+ static char filename[PATH_MAX + 1];
const char * ext;
switch (file) {
case FILE_ROM:
return filename;
}
+const char * S9xGetQuickSaveFilename(unsigned int slot)
+{
+ static char filename[PATH_MAX + 1];
+ snprintf(filename, PATH_MAX, "%s.frz.%u.gz", basePath, slot);
+ return filename;
+}
+
static void loadDefaults()
{
ZeroMemory(&Settings, sizeof(Settings));
Config.quitting = false;
Config.enableAudio = true;
Config.fullscreen = false;
- Config.xsp = false;
+ Config.scaler = 0;
Config.hacksFile = 0;
+ Config.touchscreenInput = false;
+ Config.touchscreenShow = false;
Settings.JoystickEnabled = FALSE;
Settings.SoundPlaybackRate = 22050;
// Truncate base path at the last '.' char
char * c = strrchr(basePath, '.');
if (c) {
- *c = '\0';
+ if (strcasecmp(c, ".gz") == 0) {
+ // Ignore the .gz part when truncating
+ *c = '\0';
+ c = strrchr(basePath, '.');
+ if (c) {
+ *c = '\0';
+ }
+ } else {
+ *c = '\0';
+ }
}
}
return romFile ? true : false;
}
-static void setHacks(const char * value)
-{
- // Unconditionally enable hacks even if no argument passed
- Settings.HacksEnabled = TRUE;
-
- if (!value) return;
-
- if (strcasecmp(value, "speed-only") == 0 ||
- strcasecmp(value, "speed") == 0 ||
- strcasecmp(value, "s") == 0) {
- Settings.HacksFilter = TRUE;
- } else if (strcasecmp(value, "yes") == 0 ||
- strcasecmp(value, "y") == 0) {
- // Do nothing
- } else if (strcasecmp(value, "no") == 0 ||
- strcasecmp(value, "n") == 0) {
- Settings.HacksEnabled = FALSE;
- } else {
- // Hack: the user probably wants to enable hacks
- // and use this argument as the ROM file.
- // Wonder why popt does not support this or if there's a better way.
- S9xSetRomFile(value);
- }
-}
-
static void loadConfig(poptContext optCon, const char * file)
{
char * out;
Settings.Transparency = TRUE;
break;
case 6:
- Settings.HacksEnabled = TRUE;
- setHacks(poptGetOptArg(optCon));
+ free(Config.scaler);
+ Config.scaler = strdup(poptGetOptArg(optCon));
break;
case 7:
Settings.ForcePAL = TRUE;
case 15:
Settings.SoundBufferSize = atoi(poptGetOptArg(optCon));
break;
+ case 16:
+ Config.touchscreenInput = true;
+ break;
+ case 17:
+ Config.touchscreenInput = true;
+ Config.touchscreenShow = true;
+ break;
+ case 18:
+ Settings.HacksEnabled = TRUE;
+ Settings.HacksFilter = TRUE;
+ break;
+ case 19:
+ Settings.HacksEnabled = TRUE;
+ Settings.HacksFilter = FALSE;
+ break;
case 100:
scancode = atoi(poptGetOptArg(optCon));
break;