Fix MBC3+TIMER + handle lack of BATTERY

`TIMER & BATTERY` is 0, but even `|` would only be checking if
*either* is set; instead, imply BATTERY as soon as TIMER is given,
printing a warning if it was not given.
This commit is contained in:
ISSOtm
2021-08-12 09:19:32 +02:00
committed by Eldred Habert
parent b51e1c7c2c
commit 94d07c78d8

View File

@@ -494,7 +494,9 @@ do { \
case MBC3:
// Handle timer, which also requires battery
if (features & (TIMER & BATTERY)) {
if (features & TIMER) {
if (!(features & BATTERY))
fprintf(stderr, "warning: MBC3+TIMER implies BATTERY\n");
features &= ~(TIMER | BATTERY); // Reset those bits
mbc = MBC3_TIMER_BATTERY;
// RAM is handled below