From 8132fcab781d792da069714a0a0a144a971a9aae Mon Sep 17 00:00:00 2001 From: sanni Date: Tue, 3 Aug 2021 10:16:12 +0200 Subject: [PATCH] Create n64log.txt in /N64/ROMS/ --- Cart_Reader/N64.ino | 71 +++++++++++++++++++++++++++++++++++++++++++ Cart_Reader/options.h | 30 +++++++++++------- 2 files changed, 90 insertions(+), 11 deletions(-) diff --git a/Cart_Reader/N64.ino b/Cart_Reader/N64.ino index 796086b..db81dd3 100644 --- a/Cart_Reader/N64.ino +++ b/Cart_Reader/N64.ino @@ -3033,6 +3033,10 @@ redumpsamefolder: println_Msg(F("")); println_Msg(F("Press Button...")); display_Update(); + // This saves a tt file with rom info next to the dumped rom +#ifdef savesummarytotxt + savesummary_N64(1, crcStr, timeElapsed); +#endif wait(); } else { @@ -3044,6 +3048,10 @@ redumpsamefolder: println_Msg(F("")); println_Msg(F("Press Button...")); display_Update(); + // This saves a tt file with rom info next to the dumped rom +#ifdef savesummarytotxt + savesummary_N64(0, crcStr, timeElapsed); +#endif wait(); // N64 CRC32 error Menu @@ -3095,6 +3103,69 @@ redumpsamefolder: } } +// Save an info.txt with information on the dumped rom to the SD card +void savesummary_N64(boolean checkfound, char crcStr[9], unsigned long timeElapsed) { + // Open file on sd card + if (!myFile.open("N64/ROM/n64log.txt", O_RDWR | O_CREAT | O_APPEND)) { + print_Error(F("SD Error"), true); + } + + //Write the info + myFile.print(F("Name: ")); + myFile.println(romName); + + myFile.print(F("ID: ")); + myFile.println(cartID); + + myFile.print(F("Size: ")); + myFile.print(cartSize); + + myFile.println(F("MB")); + myFile.print(F("Save: ")); + + switch (saveType) { + case 1: + myFile.println(F("Sram")); + break; + case 4: + myFile.println(F("Flashram")); + break; + case 5: + myFile.println(F("4K Eeprom")); + break; + case 6: + myFile.println(F("16K Eeprom")); + break; + default: + myFile.println(F("unknown")); + break; + } + + myFile.print(F("Version: 1.")); + myFile.println(romVersion); + + myFile.print(F("Saved To: ")); + myFile.println(folder); + myFile.print(F("CRC: ")); + myFile.println(crcStr); + + if (checkfound) { + // Dump was a known good rom + myFile.println(F("Checksum matches")); + } + else { + myFile.println(F("Checksum not found")); + } + + myFile.print(F("Time: ")); + myFile.println(timeElapsed); + + myFile.println(F(" ")); + + // Close the file: + myFile.close(); +} + /****************************************** N64 Repro Flashrom Functions *****************************************/ diff --git a/Cart_Reader/options.h b/Cart_Reader/options.h index 295c577..dbaf66a 100644 --- a/Cart_Reader/options.h +++ b/Cart_Reader/options.h @@ -1,5 +1,5 @@ //****************************************** -// OPTIONS +// GLOBAL OPTIONS //****************************************** // Change mainMenu to snsMenu, mdMenu, n64Menu, gbxMenu, pcsMenu, // flashMenu, nesMenu or smsMenu for single slot Cart Readers @@ -8,21 +8,15 @@ // Comment out to change to Serial Output // be sure to change the Arduino Serial Monitor to no line ending #define enable_OLED - // Skip OLED start-up animation //#define fast_start - // Enable the second button #define enable_Button2 -// Read N64 Eeprom with Adadruit clockgen, CLK1 switch needs to be switch to ON -#define clockgen_installed - -// Define CRC method for dumping N64 ROMs -#define fastcrc //crc will be calculated during dumping from memory -//#define slowcrc // crc will be calculated after dumping from SD card - -// define enable_XXX to enable +//****************************************** +// ENABLED MODULES +//****************************************** +// add // before #define to disable a module #define enable_FLASH #define enable_GBX #define enable_MD @@ -35,3 +29,17 @@ #define enable_SNES #define enable_SV #define enable_WS + +//****************************************** +// N64 OPTIONS +//****************************************** +// Read N64 Eeprom with Adadruit clockgen, CLK1 switch needs to be switch to ON +// add // and disable CLK1 switch if you don't have the clockgen installed or if you want to read a repros save +#define clockgen_installed + +// Define CRC method for dumping N64 ROMs, slow seems to be more compatible with some SD cards +#define fastcrc //crc will be calculated during dumping from memory +//#define slowcrc // crc will be calculated after dumping from SD card + +// saves a n64log.txt file with rom info in /N64/ROMS +#define savesummarytotxt