From 94d07c78d846f1a7a2af837f563a35bce468963a Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Thu, 12 Aug 2021 09:19:32 +0200 Subject: [PATCH] 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. --- src/fix/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fix/main.c b/src/fix/main.c index ab009db5..b323dd3d 100644 --- a/src/fix/main.c +++ b/src/fix/main.c @@ -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