Fix unable to load some unif carts

This commit is contained in:
negativeExponent
2020-03-24 01:50:10 +08:00
parent e1bf53e80c
commit 915c2be6a8

View File

@@ -273,10 +273,10 @@ static int TVCI(FCEUFILE *fp) {
}
static int EnableBattery(FCEUFILE *fp) {
FCEU_printf(" Battery-backed.\n");
if (FCEU_fgetc(fp) == EOF)
return(0);
UNIFCart.battery = 1;
int ret = FCEU_fgetc(fp);
UNIFCart.battery = (ret > 0) ? 1 : 0;
if (UNIFCart.battery)
FCEU_printf(" Battery-backed.\n");
return(1);
}