X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=drivers%2Fgp2x%2Fmain.c;h=ac48a2d2fca57f2fccb9c207a866c88653c06ee3;hp=05724c6df52eb8f59ddfe4850824d01ff679243c;hb=0bb3fe122854be9af6c3024fef9f503d27bc63a1;hpb=6f6bc6fa47b2888c4420eeb323d96be0982150de diff --git a/drivers/gp2x/main.c b/drivers/gp2x/main.c index 05724c6..ac48a2d 100644 --- a/drivers/gp2x/main.c +++ b/drivers/gp2x/main.c @@ -39,6 +39,7 @@ #include "../common/cheat.h" #include "../../fce.h" +#include "../../cart.h" #include "dface.h" @@ -249,7 +250,7 @@ static int DoArgs(int argc, char *argv[]) {"-input1",0,&inputa[0],0x4001},{"-input2",0,&inputa[1],0x4001}, {"-fcexp",0,&fcexp,0x4001}, - {"-gg",&docheckie[1],0,0}, + {"-gg",0,&eoptions,0x8000|EO_GG}, {"-no8lim",0,&eoptions,0x8000|EO_NO8LIM}, {"-snapname",0,&eoptions,0x8000|EO_SNAPNAME}, {"-nofs",0,&eoptions,0x8000|EO_NOFOURSCORE}, @@ -274,8 +275,7 @@ static int DoArgs(int argc, char *argv[]) } if(docheckie[0]) Settings.region_force=2; - if(docheckie[1]) - FCEUI_SetGameGenie(1); + FCEUI_SetGameGenie(eoptions&EO_GG); FCEUI_DisableSpriteLimitation(eoptions&EO_NO8LIM); FCEUI_SetSnapName(eoptions&EO_SNAPNAME); @@ -388,7 +388,12 @@ int CLImain(int argc, char *argv[]) ParseGI(fceugi); InitOtherInput(); - GameInterface(GI_INFOSTRING, infostring); + if ((eoptions&EO_GG) && geniestage == 0) { + strcpy(infostring, "gg.rom is missing, GG disabled"); + eoptions&=~EO_GG; + FCEUI_SetGameGenie(0); + } else + GameInterface(GI_INFOSTRING, infostring); FCEU_DispMessage("%s", infostring); } else @@ -447,7 +452,7 @@ static int DriverInitialize(void) static void DriverKill(void) { // SaveConfig(NULL); // done explicitly in menu now - SetSignals(SIG_IGN); + SetSignals(SIG_DFL); if(cpalette) free(cpalette); cpalette=0; @@ -461,11 +466,13 @@ static void DriverKill(void) void FCEUD_Update(uint8 *xbuf, int16 *Buffer, int Count) { - if(!Count && !(eoptions&EO_NOTHROTTLE)) + if(!(eoptions&EO_NOTHROTTLE)) + { + if(Count) + WriteSound(Buffer,Count); SpeedThrottle(); + } + FCEUD_UpdateInput(); // must update input before blitting because of save confirmation stuff BlitScreen(xbuf); - if(Count && !(eoptions&EO_NOTHROTTLE)) - WriteSound(Buffer,Count); - FCEUD_UpdateInput(); }