From 094d9fcdd363a4c31457bc0037d70c2083b35ebb Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Mon, 28 Jan 2019 18:23:37 +0100 Subject: [PATCH] Update GB.ino --- Cart_Reader/GB.ino | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/Cart_Reader/GB.ino b/Cart_Reader/GB.ino index 3c4705d..03161b3 100644 --- a/Cart_Reader/GB.ino +++ b/Cart_Reader/GB.ino @@ -221,20 +221,10 @@ void setup_GB() { case 3: print_Msg(F("256KB")); break; case 4: print_Msg(F("512KB")); break; case 5: - if (romType == 1 || romType == 2 || romType == 3) { - print_Msg(F("1MB")); - } - else { - print_Msg(F("1MB")); - } + print_Msg(F("1MB")); break; case 6: - if (romType == 1 || romType == 2 || romType == 3) { - print_Msg(F("2MB")); - } - else { - print_Msg(F("2MB")); - } + print_Msg(F("2MB")); break; case 7: print_Msg(F("4MB")); break; case 82: print_Msg(F("1.1MB")); break; @@ -354,17 +344,19 @@ void getCartInfo_GB() { if (romType == 6) { sramBanks = 1; } - if (sramSize == 2) { - sramBanks = 1; - } - if (sramSize == 3) { - sramBanks = 4; - } - if (sramSize == 4) { - sramBanks = 16; - } - if (sramSize == 5) { - sramBanks = 8; + switch (sramSize) { + case 2: + sramBanks = 1; + break; + case 3: + sramBanks = 4; + break; + case 4: + sramBanks = 16; + break; + case 5: + sramBanks = 8; + break; } // RAM end address