X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=fds.c;h=501aefcc86a2ef3c8d86d2835c003b4bd7af9956;hp=a8e3d401c71750ee2e7857047d805b2eb2026f77;hb=7b356ee3dc5d7e54d9dc06c413f84380d1044441;hpb=e7f5287861e2da956537a6db8abb26f9a26255f8 diff --git a/fds.c b/fds.c index a8e3d40..501aefc 100644 --- a/fds.c +++ b/fds.c @@ -22,6 +22,10 @@ #include #include +#ifdef GP2X +#include // for sync() +#endif + #include "types.h" #include "x6502.h" #include "fce.h" @@ -85,12 +89,13 @@ static uint8 SelectDisk,InDisk; #define DC_INC 1 -void FDSGI(int h) +void FDSGI(int h, void *param) { switch(h) { case GI_CLOSE: FDSClose();break; case GI_POWER: FDSInit();break; + case GI_INFOSTRING: sprintf(param, "FDS, Sides: %d", TotalSides);break; } } @@ -910,26 +915,41 @@ void FDSClose(void) { FILE *fp; int x; - char *fn=FCEU_MakeFName(FCEUMKF_FDS,0,0); - - if(!DiskWritten) return; + char *fn; - if(!(fp=FCEUD_UTF8fopen(fn,"wb"))) + if(!DiskWritten) { - free(fn); - return; - } - free(fn); + fn=FCEU_MakeFName(FCEUMKF_FDS,0,0); - for(x=0;x