Improve SD logfile

This commit is contained in:
sanni 2022-06-14 15:25:53 +02:00
parent c760a32c10
commit f0639e20ad
8 changed files with 50 additions and 29 deletions

View File

@ -4,7 +4,7 @@
This project represents a community-driven effort to provide
an easy to build and easy to modify cartridge dumper.
Date: 12.06.2022
Date: 14.06.2022
Version: 8.5 BETA
SD lib: https://github.com/greiman/SdFat
@ -643,7 +643,7 @@ void aboutScreen() {
println_Msg(F(""));
println_Msg(F(""));
println_Msg(F(""));
println_Msg(F("Press Button"));
println_Msg(F("Press Button..."));
display_Update();
while (1) {
@ -792,6 +792,22 @@ void setup() {
if (!myLog.open("OSCR_LOG.txt", O_RDWR | O_CREAT | O_APPEND)) {
print_Error(F("SD Error"), true);
}
println_Msg(F(""));
#if defined(HW1)
print_Msg(F("OSCR HW1"));
#elif defined(HW2)
print_Msg(F("OSCR HW2"));
#elif defined(HW3)
print_Msg(F("OSCR HW3"));
#elif defined(HW4)
print_Msg(F("OSCR HW4"));
#elif defined(HW5)
print_Msg(F("OSCR HW5"));
#elif defined(SERIAL_MONITOR)
print_Msg(F("OSCR Serial"));
#endif
print_Msg(F(" V"));
println_Msg(ver);
#endif
#ifdef RTC_installed
@ -1078,7 +1094,11 @@ void println_Msg(const __FlashStringHelper *string) {
Serial.println(string);
#endif
#ifdef global_log
char myBuffer[15];
strlcpy_P(myBuffer, (char *)string, 15);
if ((strncmp(myBuffer, "Press Button...", 14) != 0) && (strncmp(myBuffer, "Select file", 10) != 0)) {
myLog.println(string);
}
#endif
}
@ -1585,6 +1605,13 @@ unsigned char questionBox_LCD(const __FlashStringHelper * question, char answers
// pass on user choice
setColor_RGB(0, 0, 0);
#ifdef global_log
println_Msg("");
print_Msg("[+] ");
println_Msg(answers[choice]);
#endif
return choice;
}
#endif

View File

@ -171,7 +171,7 @@ void gbxMenu() {
if (!writeCFI_GB()) {
display_Clear();
println_Msg(F("Flashing failed, time out!"));
println_Msg(F("Press button..."));
println_Msg(F("Press Button..."));
display_Update();
wait();
}
@ -198,7 +198,7 @@ void gbxMenu() {
if (!writeCFI_GB()) {
display_Clear();
println_Msg(F("Flashing failed, time out!"));
println_Msg(F("Press button..."));
println_Msg(F("Press Button..."));
display_Update();
wait();
resetArduino();
@ -1695,7 +1695,7 @@ bool writeCFI_GB() {
print_Msg(F("but needs "));
print_Msg(romBanks);
println_Msg(F("."));
println_Msg(F("Press button..."));
println_Msg(F("Press Button..."));
display_Update();
wait();
resetArduino();

View File

@ -45,8 +45,7 @@ void gbmMenu() {
println_Msg(F("cartreader directly"));
println_Msg(F("before reading"));
println_Msg("");
println_Msg(F("Press Button"));
println_Msg(F("to continue"));
println_Msg(F("Press Button..."));
display_Update();
wait();
// Clear screen
@ -75,8 +74,7 @@ void gbmMenu() {
println_Msg(F("NP Cartridge."));
println_Msg("");
println_Msg("");
println_Msg(F("Press Button"));
println_Msg(F("to continue"));
println_Msg(F("Press Button..."));
display_Update();
wait();
// Clear screen
@ -137,8 +135,7 @@ void gbmMenu() {
println_Msg(F("NP Cartridge's"));
println_Msg(F("mapping data"));
println_Msg("");
println_Msg(F("Press Button"));
println_Msg(F("to continue"));
println_Msg(F("Press Button..."));
display_Update();
wait();

View File

@ -320,8 +320,7 @@ void gbSmartFlashMenu()
println_Msg(F("This will erase your"));
println_Msg(F("GB Smart Cartridge."));
println_Msg(F(""));
println_Msg(F("Press Button"));
println_Msg(F("to continue"));
println_Msg(F("Press Button..."));
display_Update();
wait();

View File

@ -197,7 +197,7 @@ void n64ControllerMenu() {
display_Update();
readMPK();
println_Msg(F(""));
println_Msg(F("Press Button."));
println_Msg(F("Press Button..."));
display_Update();
wait();
break;
@ -215,7 +215,7 @@ void n64ControllerMenu() {
writeMPK();
verifyMPK();
println_Msg(F(""));
println_Msg(F("Press Button."));
println_Msg(F("Press Button..."));
display_Update();
wait();
break;
@ -3771,7 +3771,7 @@ void flashRepro_N64() {
println_Msg(F("Repro Cartridge."));
println_Msg(F("Attention: Use 3.3V!"));
println_Msg("");
println_Msg(F("Press Button"));
println_Msg(F("Press Button..."));
display_Update();
wait();
}
@ -4742,7 +4742,7 @@ void flashGameshark_N64() {
println_Msg(F("Gameshark cartridge"));
println_Msg(F("Attention: Use 3.3V!"));
println_Msg(F("Power OFF if Unsure!"));
println_Msg(F("Press Button"));
println_Msg(F("Press Button..."));
display_Update();
wait();

View File

@ -278,7 +278,7 @@ void nesChipMenu() {
readPRG();
resetROM();
println_Msg(F(""));
println_Msg(F("Press button"));
println_Msg(F("Press Button..."));
display_Update();
wait();
break;
@ -289,7 +289,7 @@ void nesChipMenu() {
readCHR();
resetROM();
println_Msg(F(""));
println_Msg(F("Press button"));
println_Msg(F("Press Button..."));
display_Update();
wait();
break;
@ -300,7 +300,7 @@ void nesChipMenu() {
readRAM();
resetROM();
println_Msg(F(""));
println_Msg(F("Press button"));
println_Msg(F("Press Button..."));
display_Update();
wait();
break;
@ -325,7 +325,7 @@ void nesWriteMenu() {
writeRAM();
resetROM();
println_Msg(F(""));
println_Msg(F("Press button"));
println_Msg(F("Press Button..."));
display_Update();
wait();
break;
@ -341,7 +341,7 @@ void nesWriteMenu() {
println_Msg(F("Error:"));
println_Msg(F("Can't write to this cartridge"));
println_Msg(F(""));
println_Msg(F("Press button"));
println_Msg(F("Press Button..."));
display_Update();
}
wait();

View File

@ -277,8 +277,7 @@ void sfmFlashMenu() {
println_Msg(F("This will erase your"));
println_Msg(F("NP Cartridge."));
println_Msg("");
println_Msg(F("Press Button"));
println_Msg(F("to continue"));
println_Msg(F("Press Button..."));
display_Update();
wait();
@ -396,8 +395,7 @@ void sfmFlashMenu() {
println_Msg(F("This will erase your"));
println_Msg(F("NP Cartridge."));
println_Msg("");
println_Msg(F("Press Button"));
println_Msg(F("to continue"));
println_Msg(F("Press Button..."));
display_Update();
wait();
@ -756,7 +754,7 @@ void getCartInfo_SFM() {
print_Msg(F("Sram: "));
print_Msg(sramSize);
println_Msg(F("Kbit"));
println_Msg(F("Press Button"));
println_Msg(F("Press Button..."));
display_Update();
// Wait for user input
wait();

View File

@ -62,7 +62,7 @@
// Use calibration data from snes_clk.txt
// #define clockgen_calibration
// Write all info to log.txt in root dir
// Write all info to OSCR_LOG.txt in root dir
// #define global_log
// Use Adafruit Clock Generator