From 233b89fc91ebcfbeeb1e44d830c854b60b911613 Mon Sep 17 00:00:00 2001 From: Dakkaron Date: Fri, 2 Jul 2021 14:18:56 +0200 Subject: [PATCH] Now reports when no save has been found on "Flash ROM and save" (cherry picked from commit 9cf556d981b218c1bd7f56b30cc6afada593a0cf) --- Cart_Reader/GB.ino | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Cart_Reader/GB.ino b/Cart_Reader/GB.ino index 26b05db..b212506 100644 --- a/Cart_Reader/GB.ino +++ b/Cart_Reader/GB.ino @@ -173,15 +173,16 @@ void gbMenu() { } } sprintf(filePath, "/GB/SAVE/%s/", fileName); + bool saveFound=false; if (sd.exists(filePath)) { - println_Msg(F("Save folder found")); EEPROM_readAnything(0, foldern); for (int i=foldern;i>=0;i--) { sprintf(filePath, "/GB/SAVE/%s/%d/%s.SAV", fileName, i, fileName); if (sd.exists(filePath)) { - print_Msg(F("Save slot ")); + print_Msg(F("Save number ")); print_Msg(i); println_Msg(F(" found.")); + saveFound=true; sprintf(filePath, "/GB/SAVE/%s/%d", fileName, i); sprintf(fileName, "%s.SAV", fileName); writeSRAM_GB(); @@ -197,9 +198,13 @@ void gbMenu() { println_Msg(F(" bytes ")); print_Error(F("did not verify."), false); } + break; } } } + if (!saveFound) { + println_Msg(F("Error: No save found.")); + } } else { print_Error(F("Cart has no Sram"), false);