mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-11-01 08:25:18 +01:00
small bugfixes
This commit is contained in:
parent
a0202eca85
commit
e36d4f5db0
@ -30,10 +30,9 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
u64 offset; // DVD offset
|
size_t length; // file length
|
||||||
unsigned int length; // file length
|
|
||||||
time_t mtime; // file modified time
|
time_t mtime; // file modified time
|
||||||
char isdir; // 0 - file, 1 - directory
|
int isdir; // 0 - file, 1 - directory
|
||||||
char filename[MAXJOLIET + 1]; // full filename
|
char filename[MAXJOLIET + 1]; // full filename
|
||||||
char displayname[MAXJOLIET + 1]; // name for browser display
|
char displayname[MAXJOLIET + 1]; // name for browser display
|
||||||
int icon; // icon to display
|
int icon; // icon to display
|
||||||
|
@ -599,6 +599,7 @@ ParseDirectory(bool waitParse)
|
|||||||
browserList[0].length = 0;
|
browserList[0].length = 0;
|
||||||
browserList[0].mtime = 0;
|
browserList[0].mtime = 0;
|
||||||
browserList[0].isdir = 1; // flag this as a dir
|
browserList[0].isdir = 1; // flag this as a dir
|
||||||
|
browserList[0].icon = ICON_FOLDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
parseHalt = false;
|
parseHalt = false;
|
||||||
@ -664,7 +665,7 @@ LoadSzFile(char * filepath, unsigned char * rbuffer)
|
|||||||
file = fopen (filepath, "rb");
|
file = fopen (filepath, "rb");
|
||||||
if (file > 0)
|
if (file > 0)
|
||||||
{
|
{
|
||||||
size = SzExtractFile(browserList[browser.selIndex].offset, rbuffer);
|
size = SzExtractFile(atoi(browserList[browser.selIndex].filename), rbuffer);
|
||||||
fclose (file);
|
fclose (file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -372,7 +372,6 @@ int SzParse(char * filepath)
|
|||||||
|
|
||||||
// save the length/offset of this file
|
// save the length/offset of this file
|
||||||
unsigned int filelen = browserList[browser.selIndex].length;
|
unsigned int filelen = browserList[browser.selIndex].length;
|
||||||
u64 fileoff = browserList[browser.selIndex].offset;
|
|
||||||
|
|
||||||
// setup archive stream
|
// setup archive stream
|
||||||
SzArchiveStream.offset = 0;
|
SzArchiveStream.offset = 0;
|
||||||
@ -423,7 +422,6 @@ int SzParse(char * filepath)
|
|||||||
// add '..' folder in case the user wants exit the 7z
|
// add '..' folder in case the user wants exit the 7z
|
||||||
sprintf(browserList[0].displayname, "Up One Level");
|
sprintf(browserList[0].displayname, "Up One Level");
|
||||||
browserList[0].isdir = 1;
|
browserList[0].isdir = 1;
|
||||||
browserList[0].offset = fileoff;
|
|
||||||
browserList[0].length = filelen;
|
browserList[0].length = filelen;
|
||||||
|
|
||||||
// get contents and parse them into file list structure
|
// get contents and parse them into file list structure
|
||||||
@ -453,10 +451,9 @@ int SzParse(char * filepath)
|
|||||||
memset(&(browserList[SzJ]), 0, sizeof(BROWSERENTRY)); // clear the new entry
|
memset(&(browserList[SzJ]), 0, sizeof(BROWSERENTRY)); // clear the new entry
|
||||||
|
|
||||||
// parse information about this file to the file list structure
|
// parse information about this file to the file list structure
|
||||||
strncpy(browserList[SzJ].filename, SzF->Name, MAXJOLIET);
|
sprintf(browserList[SzJ].filename, "%d", SzI); // the extraction function identifies the file with this number
|
||||||
StripExt(browserList[SzJ].displayname, browserList[SzJ].filename);
|
StripExt(browserList[SzJ].displayname, SzF->Name);
|
||||||
browserList[SzJ].length = SzF->Size; // filesize
|
browserList[SzJ].length = SzF->Size; // filesize
|
||||||
browserList[SzJ].offset = SzI; // the extraction function identifies the file with this number
|
|
||||||
browserList[SzJ].isdir = 0; // only files will be displayed (-> no flags)
|
browserList[SzJ].isdir = 0; // only files will be displayed (-> no flags)
|
||||||
SzJ++;
|
SzJ++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user