#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef GP2X
+#include <unistd.h>
+#endif
#include "types.h"
{
uint8 t;
t=FCEU_fgetc(fp);
- mirrortodo=t;
+ mirrortodo=t;
{
static char *stuffo[6]={"Horizontal","Vertical","$2000","$2400","\"Four-screen\"","Controlled by Mapper Hardware"};
else
puts("");
- SetupCartPRGMapping(z,malloced[z],t,0);
+ SetupCartPRGMapping(z,malloced[z],t,0);
return(1);
}
for(;;)
{
t=FCEU_fread(&uchead,1,4,fp);
- if(t<4)
+ if(t<4)
{
if(t>0)
- return 0;
+ return 0;
return 1;
}
- if(!(FCEU_read32(&uchead.info,fp)))
+ if(!(FCEU_read32(&uchead.info,fp)))
return 0;
t=0;
for(x=0;x<BMF;x++)
if(!bfunc[x].init(fp))
return 0;
t=1;
- break;
+ break;
}
if(!t)
if(FCEU_fseek(fp,uchead.info,SEEK_CUR))
if(strcmp(sboardname,bmap[x].name)) continue;
if(!malloced[16] && (bmap[x].flags&BMCFLAG_CHRROK))
{
- if((malloced[16]=UNIFchrrama=FCEU_malloc(8192)))
+ UNIFchrrama=FCEU_malloc(8192);
+ if((malloced[16]=(uint8 *)UNIFchrrama))
{
- SetupCartCHRMapping(0,UNIFchrrama,8192,1);
+ SetupCartCHRMapping(0,(uint8 *)UNIFchrrama,8192,1);
AddExState(UNIFchrrama, 8192, 0,"CHRR");
}
else
FCEU_fseek(fp,0,SEEK_SET);
FCEU_fread(&unhead,1,4,fp);
if(memcmp(&unhead,"UNIF",4))
- return 0;
+ return 0;
ResetCartMapping();
GameInterface=UNIFGI;
return 1;
-
+
aborto:
FreeUNIF();
if(fssp)
fclose(fssp);
fssp=0;
+#ifdef GP2X
+ sync();
+#endif
}