notaz.gp2x.de
/
fceu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
undocumented opcodes added to ncpu
[fceu.git]
/
file.c
diff --git
a/file.c
b/file.c
index
d9d3a52
..
0f47c2a
100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-51,8
+51,8
@@
void *MakeZipWrap(void *tz)
if(!(tmp=FCEU_malloc(sizeof(ZIPWRAP))))
goto doret;
if(!(tmp=FCEU_malloc(sizeof(ZIPWRAP))))
goto doret;
-
- unzGetCurrentFileInfo(tz,&ufo,0,0,0,0,0,0);
+
+ unzGetCurrentFileInfo(tz,&ufo,0,0,0,0,0,0);
tmp->location=0;
tmp->size=ufo.uncompressed_size;
tmp->location=0;
tmp->size=ufo.uncompressed_size;
@@
-68,7
+68,7
@@
void *MakeZipWrap(void *tz)
unzCloseCurrentFile(tz);
unzClose(tz);
unzCloseCurrentFile(tz);
unzClose(tz);
-
+
return tmp;
}
#endif
return tmp;
}
#endif
@@
-109,13
+109,13
@@
int FASTAPASS(2) FCEU_fopen(char *path, char *mode)
break;
}
if(unzGoToNextFile(tz)!=UNZ_OK)
break;
}
if(unzGoToNextFile(tz)!=UNZ_OK)
- {
+ {
if(unzGoToFirstFile(tz)!=UNZ_OK) goto zpfail;
if(unzGoToFirstFile(tz)!=UNZ_OK) goto zpfail;
- break;
+ break;
}
}
if(unzOpenCurrentFile(tz)!=UNZ_OK)
}
}
if(unzOpenCurrentFile(tz)!=UNZ_OK)
- goto zpfail;
+ goto zpfail;
}
else
{
}
else
{
@@
-204,7
+204,7
@@
size_t FASTAPASS(3) FCEU_fread(void *ptr, size_t size, size_t nmemb, int stream)
return gzread(desctable[(stream&255)-1],ptr,size*nmemb);
}
else if(stream&0x8000)
return gzread(desctable[(stream&255)-1],ptr,size*nmemb);
}
else if(stream&0x8000)
- {
+ {
ZIPWRAP *wz;
uint32 total=size*nmemb;
ZIPWRAP *wz;
uint32 total=size*nmemb;
@@
-242,7
+242,7
@@
size_t FASTAPASS(3) FCEU_fwrite(void *ptr, size_t size, size_t nmemb, int stream
return gzwrite(desctable[(stream&255)-1],ptr,size*nmemb);
}
else if(stream&0x8000)
return gzwrite(desctable[(stream&255)-1],ptr,size*nmemb);
}
else if(stream&0x8000)
- {
+ {
return 0;
}
else
return 0;
}
else
@@
-256,7
+256,7
@@
int FASTAPASS(3) FCEU_fseek(int stream, long offset, int whence)
if(stream&0x4000)
{
return gzseek(desctable[(stream&255)-1],offset,whence);
if(stream&0x4000)
{
return gzseek(desctable[(stream&255)-1],offset,whence);
- }
+ }
else if(stream&0x8000)
{
ZIPWRAP *wz;
else if(stream&0x8000)
{
ZIPWRAP *wz;
@@
-271,7
+271,7
@@
int FASTAPASS(3) FCEU_fseek(int stream, long offset, int whence)
return (-1);
wz->location+=offset;
break;
return (-1);
wz->location+=offset;
break;
- }
+ }
return 0;
}
else
return 0;
}
else
@@
-287,8
+287,8
@@
long FASTAPASS(1) FCEU_ftell(int stream)
return gztell(desctable[(stream&255)-1]);
}
else if(stream&0x8000)
return gztell(desctable[(stream&255)-1]);
}
else if(stream&0x8000)
- {
- return (((ZIPWRAP *)desctable[(stream&255)-1])->location);
+ {
+ return (((ZIPWRAP *)desctable[(stream&255)-1])->location);
}
else
#endif
}
else
#endif
@@
-312,25
+312,25
@@
void FASTAPASS(1)FCEU_rewind(int stream)
fseek(desctable[stream-1],0,SEEK_SET);
#else
rewind(desctable[stream-1]);
fseek(desctable[stream-1],0,SEEK_SET);
#else
rewind(desctable[stream-1]);
- #endif
+ #endif
}
int FASTAPASS(2) FCEU_read32(void *Bufo, int stream)
{
#ifdef ZLIB
if(stream&0xC000)
}
int FASTAPASS(2) FCEU_read32(void *Bufo, int stream)
{
#ifdef ZLIB
if(stream&0xC000)
- {
- uint
8 t[4]
;
+ {
+ uint
32 t
;
#ifndef LSB_FIRST
uint8 x[4];
#endif
if(stream&0x8000)
#ifndef LSB_FIRST
uint8 x[4];
#endif
if(stream&0x8000)
- {
+ {
ZIPWRAP *wz;
wz=(ZIPWRAP*)desctable[(stream&255)-1];
if(wz->location+4>wz->size)
{return 0;}
ZIPWRAP *wz;
wz=(ZIPWRAP*)desctable[(stream&255)-1];
if(wz->location+4>wz->size)
{return 0;}
-
*(uint32 *)t=*(uint32 *)(wz->data+wz->location
);
+
memcpy(&t, wz->data+wz->location, 4
);
wz->location+=4;
}
else if(stream&0x4000)
wz->location+=4;
}
else if(stream&0x4000)
@@
-342,7
+342,7
@@
int FASTAPASS(2) FCEU_read32(void *Bufo, int stream)
x[3]=t[0];
*(uint32*)Bufo=*(uint32*)x;
#else
x[3]=t[0];
*(uint32*)Bufo=*(uint32*)x;
#else
-
*(uint32*)Bufo=*(uint32*)t
;
+
memcpy(Bufo, &t, 4)
;
#endif
return 1;
}
#endif
return 1;
}
@@
-357,7
+357,7
@@
int FASTAPASS(1) FCEU_fgetc(int stream)
{
#ifdef ZLIB
if(stream&0x4000)
{
#ifdef ZLIB
if(stream&0x4000)
- return gzgetc(desctable[(stream&255)-1]);
+ return gzgetc(desctable[(stream&255)-1]);
else if(stream&0x8000)
{
ZIPWRAP *wz;
else if(stream&0x8000)
{
ZIPWRAP *wz;