X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=cart.c;h=909506abf34ecd28a708337b895eceda07b75964;hp=e1cd5dae4208d4e314374d555f892d574d94f7fa;hb=0d6a66c2a80f50ae51327cd406f9df14d99ad02e;hpb=b8da43fbb954ca62228ecae24761b3ab6793d74e diff --git a/cart.c b/cart.c index e1cd5da..909506a 100644 --- a/cart.c +++ b/cart.c @@ -22,9 +22,14 @@ #include #include +#ifdef GP2X +#include // for sync() +#endif + #include "types.h" #include "fce.h" #include "ppu.h" +#include "ppu098.h" #include "cart.h" #include "memory.h" @@ -35,8 +40,6 @@ #include "svga.h" #include "file.h" -#define FCEUPPU_LineUpdate(...) - /* This file contains all code for coordinating the mapping in of the address space external to the NES. @@ -304,7 +307,7 @@ void FASTAPASS(2) setchr8r(int r, unsigned int V) if(CHRram[r]) PPUCHRRAM|=(255); else - PPUCHRRAM&=~(255); + PPUCHRRAM&=0; } void FASTAPASS(2) setchr1(unsigned int A, unsigned int V) @@ -683,6 +686,10 @@ void FCEU_SaveGameSave(CartInfo *LocalHWInfo) fwrite(LocalHWInfo->SaveGame[x],1, LocalHWInfo->SaveGameLen[x],sp); } + fclose(sp); +#ifdef GP2X + sync(); +#endif } free(soot); } @@ -706,9 +713,28 @@ void FCEU_LoadGameSave(CartInfo *LocalHWInfo) for(x=0;x<4;x++) if(LocalHWInfo->SaveGame[x]) fread(LocalHWInfo->SaveGame[x],1,LocalHWInfo->SaveGameLen[x],sp); + fclose(sp); } free(soot); } } +void DumpEmptyCartMapping(void) +{ + int x, st=0, end=-1; + + for(x=8;x<32;x++) + { + if (Page[x] == (nothing-x*2048) || Page[x] == 0) + { + if (end != x) st=x; + end=x+1; + } + if (end == x) + printf("DumpEmptyCartMapping: %04x-%04x\n", st*2048, end*2048-1); + } + if (end==32) + printf("DumpEmptyCartMapping: %04x-%04x\n", st*2048, end*2048-1); +} +