mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
:)
This commit is contained in:
parent
e5d54fe7f5
commit
d8b09c8d00
30
ssnes.c
30
ssnes.c
@ -319,6 +319,17 @@ static int16_t input_state(bool port, unsigned device, unsigned index, unsigned
|
|||||||
return driver.input->input_state(driver.input_data, snes_keybinds, port, device, index, id);
|
return driver.input->input_state(driver.input_data, snes_keybinds, port, device, index, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void fill_pathname(char *out_path, char *in_path, const char *replace)
|
||||||
|
{
|
||||||
|
char tmp_path[strlen(in_path) + 1];
|
||||||
|
strcpy(tmp_path, in_path);
|
||||||
|
char *tok = NULL;
|
||||||
|
tok = strrchr(tmp_path, '.');
|
||||||
|
if (tok != NULL)
|
||||||
|
*tok = '\0';
|
||||||
|
strcpy(out_path, tmp_path);
|
||||||
|
strcat(out_path, replace);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -336,20 +347,13 @@ int main(int argc, char *argv[])
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *statefile_tok = NULL;
|
char statefile_name[strlen(argv[1])+strlen(".state")+1];
|
||||||
char statefile_name[strlen(argv[1])+strlen("state")+1];
|
char savefile_name_rtc[strlen(argv[1])+strlen(".rtc")+1];
|
||||||
char savefile_name_rtc[strlen(argv[1])+strlen("rtc")+1];
|
char savefile_name_srm[strlen(argv[1])+strlen(".srm")+1];
|
||||||
char savefile_name_srm[strlen(argv[1])+strlen("srm")+1];
|
|
||||||
|
|
||||||
statefile_tok = strtok(argv[1], ".");
|
fill_pathname(statefile_name, argv[1], ".state");
|
||||||
strcpy(statefile_name, statefile_tok);
|
fill_pathname(savefile_name_rtc, argv[1], ".rtc");
|
||||||
strcat(statefile_name, ".state");
|
fill_pathname(savefile_name_srm, argv[1], ".srm");
|
||||||
|
|
||||||
|
|
||||||
strcpy(savefile_name_rtc, statefile_tok);
|
|
||||||
strcat(savefile_name_rtc, ".rtc");
|
|
||||||
strcpy(savefile_name_srm, statefile_tok);
|
|
||||||
strcat(savefile_name_srm, ".srm");
|
|
||||||
|
|
||||||
init_drivers();
|
init_drivers();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user