mirror of
https://github.com/libretro/beetle-wswan-libretro.git
synced 2024-11-27 10:10:47 +00:00
Revert "Automatically create .cue from .iso/.img, etc."
This reverts commit df00f075c4
.
This commit is contained in:
parent
df00f075c4
commit
d3924ab7d6
45
libretro.cpp
45
libretro.cpp
@ -26,8 +26,6 @@ void retro_init()
|
||||
std::vector<MDFNGI*> ext;
|
||||
MDFNI_InitializeModules(ext);
|
||||
|
||||
// TODO: Figure out how to avoid using plain configs.
|
||||
// Will probably have to use a folder for memcards anyways, though.
|
||||
std::vector<MDFNSetting> settings;
|
||||
std::string home = getenv("HOME");
|
||||
home += "/.mednafen";
|
||||
@ -54,50 +52,9 @@ bool retro_load_game_special(unsigned, const struct retro_game_info *, size_t)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool create_cuesheet(const std::string &path)
|
||||
{
|
||||
std::string cue_path = path;
|
||||
cue_path += ".cue";
|
||||
|
||||
FILE *file = fopen(cue_path.c_str(), "w");
|
||||
if (!file)
|
||||
return false;
|
||||
|
||||
std::string ref_path = path;
|
||||
size_t pos = path.find_last_of("\\/");
|
||||
if (pos != std::string::npos)
|
||||
ref_path = ref_path.substr(pos + 1, std::string::npos);
|
||||
|
||||
// Mednafen doesn't really seem to care
|
||||
// about the details here.
|
||||
fprintf(file,
|
||||
"FILE \"%s\" BINARY\n"
|
||||
" TRACK 01 MODE1/2352\n" // TODO: Should this be MODE2?
|
||||
" INDEX 01 00:00:00\n",
|
||||
ref_path.c_str());
|
||||
|
||||
fclose(file);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool retro_load_game(const struct retro_game_info *info)
|
||||
{
|
||||
const char *ext = strrchr(info->path, '.');
|
||||
std::string path = info->path;
|
||||
|
||||
if (ext && strcmp(ext, ".cue") != 0)
|
||||
{
|
||||
if (!create_cuesheet(path))
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Failed to create cue-sheet.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
path += ".cue";
|
||||
}
|
||||
|
||||
game = MDFNI_LoadGame("psx", path.c_str());
|
||||
game = MDFNI_LoadGame("psx", info->path);
|
||||
return game;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user