X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=cart.c;h=742f9b0d8a27d237e179f00a04db709e076070d3;hp=1113f3535771a8af04d55ed5555db5383b6d20f2;hb=e7f5287861e2da956537a6db8abb26f9a26255f8;hpb=13624c8f3ac5cd1b255a5078c5401b0f97037964 diff --git a/cart.c b/cart.c index 1113f35..742f9b0 100644 --- a/cart.c +++ b/cart.c @@ -642,6 +642,24 @@ void GeniePower(void) geniestage=2; } +static uint8 *real_pages[16]; + +void GenieSetPages(int restore) +{ + int page; + if (restore) + { + for (page=16; page<32; page++) + Page[page] = real_pages[page-16]; + } + else + { + for (page=16; page<32; page++) { + real_pages[page-16] = Page[page]; + Page[page]=GENIEROM - (page<<11) + ((page&1)<<11); + } + } +} void FCEU_SaveGameSave(CartInfo *LocalHWInfo) { @@ -693,4 +711,22 @@ void FCEU_LoadGameSave(CartInfo *LocalHWInfo) } } +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); +} +