- [PSP] Fix for issue 768 : PSP cannot read zipped images from zipped files. This was a lowercase/uppercase issue
- [PSP] added last log message in exception log
This commit is contained in:
+3
-1
@@ -169,7 +169,9 @@ void ExceptionHandler(PspDebugRegBlock * regs)
|
|||||||
FILE *log = fopen("exception.log", "w");
|
FILE *log = fopen("exception.log", "w");
|
||||||
if (log != NULL)
|
if (log != NULL)
|
||||||
{
|
{
|
||||||
char testo[512];
|
char testo[1024];
|
||||||
|
pspDebugScreenPrintf("Last Log Message: \n%s\n\n", JLogger::lastLog.c_str());
|
||||||
|
fwrite(testo, 1, strlen(testo), log);
|
||||||
sprintf(testo, "Exception details:\n\n");
|
sprintf(testo, "Exception details:\n\n");
|
||||||
fwrite(testo, 1, strlen(testo), log);
|
fwrite(testo, 1, strlen(testo), log);
|
||||||
sprintf(testo, "Exception - %s\n", codeTxt[(regs->cause >> 2) & 31]);
|
sprintf(testo, "Exception - %s\n", codeTxt[(regs->cause >> 2) & 31]);
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ inline search_iterator & search_iterator::begin(const char * FileSpec) {
|
|||||||
DirectoryName.assign(FileSpec + 0, FileSpec + i++);
|
DirectoryName.assign(FileSpec + 0, FileSpec + i++);
|
||||||
|
|
||||||
m_Extension = FileSpec + i + 1;
|
m_Extension = FileSpec + i + 1;
|
||||||
|
std::transform(m_Extension.begin(), m_Extension.end(), m_Extension.begin(), ::tolower);
|
||||||
m_Valid = ((m_Directory = opendir(DirectoryName.c_str())) != NULL);
|
m_Valid = ((m_Directory = opendir(DirectoryName.c_str())) != NULL);
|
||||||
|
|
||||||
if (! m_Valid)
|
if (! m_Valid)
|
||||||
@@ -225,8 +226,11 @@ inline search_iterator & search_iterator::next() {
|
|||||||
Found = false;
|
Found = false;
|
||||||
else if (FileName.size() <= m_Extension.size())
|
else if (FileName.size() <= m_Extension.size())
|
||||||
Found = false;
|
Found = false;
|
||||||
else if (std::equal(m_Extension.rbegin(), m_Extension.rend(), FileName.rbegin()))
|
else {
|
||||||
Found = true;
|
std::transform(FileName.begin(), FileName.end(), FileName.begin(), ::tolower);
|
||||||
|
if (std::equal(m_Extension.rbegin(), m_Extension.rend(), FileName.rbegin()))
|
||||||
|
Found = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -12,6 +12,9 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "zfsystem.h"
|
#include "zfsystem.h"
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
#include "../../include/JLogger.h"
|
||||||
|
|
||||||
#include "fileio.h" // I/O facilities
|
#include "fileio.h" // I/O facilities
|
||||||
|
|
||||||
|
|
||||||
@@ -58,6 +61,9 @@ filesystem::filesystem(const char * BasePath, const char * FileExt, bool Default
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Search all *.zip files (or whatever the ZipExt specify as the file extension)
|
// Search all *.zip files (or whatever the ZipExt specify as the file extension)
|
||||||
|
// Search is case insensitive (see fileio.h for details)
|
||||||
|
// The case insensitive state is mostly because some of the filesystems we support such as FAT32 are case insensitive
|
||||||
|
// Being case sensitive would lead to weird bugs on these systems.
|
||||||
vector<string> ZipFiles;
|
vector<string> ZipFiles;
|
||||||
|
|
||||||
for (search_iterator ZSrch = (m_BasePath + "*." + m_FileExt).c_str(); ZSrch != ZSrch.end(); ++ZSrch)
|
for (search_iterator ZSrch = (m_BasePath + "*." + m_FileExt).c_str(); ZSrch != ZSrch.end(); ++ZSrch)
|
||||||
@@ -285,12 +291,16 @@ void filesystem::InsertZip(const char * Filename, const size_t PackID)
|
|||||||
// Open zip
|
// Open zip
|
||||||
ifstream File(ZipPath.c_str(), ios::binary);
|
ifstream File(ZipPath.c_str(), ios::binary);
|
||||||
|
|
||||||
|
LOG(("opening zip:" + ZipPath).c_str());
|
||||||
|
|
||||||
if (! File)
|
if (! File)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Find the start of the central directory
|
// Find the start of the central directory
|
||||||
if (! File.seekg(CentralDir(File))) return;
|
if (! File.seekg(CentralDir(File))) return;
|
||||||
|
|
||||||
|
LOG("open zip ok");
|
||||||
|
|
||||||
// Check every headers within the zip file
|
// Check every headers within the zip file
|
||||||
file_header FileHdr;
|
file_header FileHdr;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user