mirror of https://github.com/snes9xgit/snes9x.git
Remove .msu.zip extension support in favor of .msu1
This commit is contained in:
parent
b230e50ec5
commit
698bf1a4b2
66
memmap.cpp
66
memmap.cpp
|
@ -4257,38 +4257,6 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
|
|||
}
|
||||
|
||||
#ifdef UNZIP_SUPPORT
|
||||
// Mercurial Magic (MSU-1 distribution pack)
|
||||
if (strcasecmp(ext, "msu1") && strcasecmp(ext, ".msu1"))
|
||||
{
|
||||
_makepath(fname, drive, dir, name, "msu1");
|
||||
unzFile msu1file = unzOpen(fname);
|
||||
|
||||
if (!msu1file)
|
||||
{
|
||||
_snprintf(fname, sizeof(fname), "%s" SLASH_STR "%s%s",
|
||||
S9xGetDirectory(IPS_DIR), name, ".msu1");
|
||||
msu1file = unzOpen(fname);
|
||||
}
|
||||
|
||||
if (msu1file)
|
||||
{
|
||||
int port = unzFindExtension(msu1file, "bps");
|
||||
if (port == UNZ_OK)
|
||||
{
|
||||
printf(" in %s", fname);
|
||||
|
||||
Stream *s = new unzStream(msu1file);
|
||||
ret = ReadBPSPatch(s, offset, rom_size);
|
||||
s->closeStream();
|
||||
|
||||
if (ret)
|
||||
printf("!\n");
|
||||
else
|
||||
printf(" failed!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!strcasecmp(ext, "zip") || !strcasecmp(ext, ".zip"))
|
||||
{
|
||||
unzFile file = unzOpen(rom_filename);
|
||||
|
@ -4783,4 +4751,38 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
|
|||
if (flag)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef UNZIP_SUPPORT
|
||||
// Mercurial Magic (MSU-1 distribution pack)
|
||||
if (strcasecmp(ext, "msu1") && strcasecmp(ext, ".msu1"))
|
||||
{
|
||||
_makepath(fname, drive, dir, name, "msu1");
|
||||
unzFile msu1file = unzOpen(fname);
|
||||
|
||||
if (!msu1file)
|
||||
{
|
||||
_snprintf(fname, sizeof(fname), "%s" SLASH_STR "%s%s",
|
||||
S9xGetDirectory(IPS_DIR), name, ".msu1");
|
||||
msu1file = unzOpen(fname);
|
||||
}
|
||||
|
||||
if (msu1file)
|
||||
{
|
||||
int port = unzFindExtension(msu1file, "bps");
|
||||
if (port == UNZ_OK)
|
||||
{
|
||||
printf(" in %s", fname);
|
||||
|
||||
Stream *s = new unzStream(msu1file);
|
||||
ret = ReadBPSPatch(s, offset, rom_size);
|
||||
s->closeStream();
|
||||
|
||||
if (ret)
|
||||
printf("!\n");
|
||||
else
|
||||
printf(" failed!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
10
msu1.cpp
10
msu1.cpp
|
@ -248,18 +248,12 @@ STREAM S9xMSU1OpenFile(char *msu_ext)
|
|||
printf("Using msu file %s.\n", filename);
|
||||
|
||||
#ifdef UNZIP_SUPPORT
|
||||
// look for msu file in .msu1 (Mercurial Magic pack) or .msu.zip if not found in rom dir
|
||||
// look for msu1 pack file in the rom or patch dir if msu data file not found in rom dir
|
||||
if (!file)
|
||||
{
|
||||
const char *zip_filename = S9xGetFilename(".msu.zip", ROMFILENAME_DIR);
|
||||
const char *zip_filename = S9xGetFilename(".msu1", ROMFILENAME_DIR);
|
||||
unzFile unzFile = unzOpen(zip_filename);
|
||||
|
||||
if (!unzFile)
|
||||
{
|
||||
zip_filename = S9xGetFilename(".msu1", ROMFILENAME_DIR);
|
||||
unzFile = unzOpen(zip_filename);
|
||||
}
|
||||
|
||||
if (!unzFile)
|
||||
{
|
||||
zip_filename = S9xGetFilename(".msu1", IPS_DIR);
|
||||
|
|
Loading…
Reference in New Issue