From 7b263115a563100418f845b12ff30122a20f9b96 Mon Sep 17 00:00:00 2001 From: sanni Date: Sun, 12 Apr 2020 11:11:10 +0200 Subject: [PATCH] V4.8: Add Reset Option to sub menues --- Cart_Reader/Cart_Reader.ino | 10 +++++----- Cart_Reader/FLASH.ino | 11 ++++++++--- Cart_Reader/GB.ino | 13 +++++++++---- Cart_Reader/N64.ino | 6 +++--- Cart_Reader/PCE.ino | 11 ++++++++--- Cart_Reader/SMS.ino | 2 +- Cart_Reader/SNES.ino | 13 +++++++++---- 7 files changed, 43 insertions(+), 23 deletions(-) diff --git a/Cart_Reader/Cart_Reader.ino b/Cart_Reader/Cart_Reader.ino index d0ff0c8..2498b7c 100644 --- a/Cart_Reader/Cart_Reader.ino +++ b/Cart_Reader/Cart_Reader.ino @@ -2,8 +2,8 @@ Cartridge Reader for Arduino Mega2560 Author: sanni - Date: 19.03.2020 - Version: 4.7 + Date: 12.04.2020 + Version: 4.8 SD lib: https://github.com/greiman/SdFat LCD lib: https://github.com/adafruit/Adafruit_SSD1306 @@ -43,7 +43,7 @@ **********************************************************************************/ #include -char ver[5] = "4.7"; +char ver[5] = "4.8"; /****************************************** Options @@ -393,7 +393,7 @@ void aboutScreen() { display.drawBitmap(0, 0, sig, 128, 64, 1); println_Msg(F("Cartridge Reader")); println_Msg(F("github.com/sanni")); - print_Msg(F("2019 Version ")); + print_Msg(F("2020 Version ")); println_Msg(ver); println_Msg(F("")); println_Msg(F("")); @@ -621,7 +621,7 @@ void setup() { // Serial Begin Serial.begin(9600); Serial.println(F("Cartridge Reader")); - Serial.println(F("2019 sanni")); + Serial.println(F("2020 sanni")); Serial.println(""); // LED Error rgb.setColor(0, 0, 255); diff --git a/Cart_Reader/FLASH.ino b/Cart_Reader/FLASH.ino index 4af769a..c3325fa 100644 --- a/Cart_Reader/FLASH.ino +++ b/Cart_Reader/FLASH.ino @@ -22,7 +22,8 @@ boolean hiROM = 1; static const char flashMenuItem1[] PROGMEM = "8bit Flash adapter"; static const char flashMenuItem2[] PROGMEM = "Eprom adapter"; static const char flashMenuItem3[] PROGMEM = "MX26L6420 adapter"; -static const char* const menuOptionsFlash[] PROGMEM = {flashMenuItem1, flashMenuItem2, flashMenuItem3}; +static const char flashMenuItem4[] PROGMEM = "Reset"; +static const char* const menuOptionsFlash[] PROGMEM = {flashMenuItem1, flashMenuItem2, flashMenuItem3, flashMenuItem4}; // 8bit Flash menu items static const char flash8MenuItem1[] PROGMEM = "Blankcheck"; @@ -57,8 +58,8 @@ void flashMenu() { // create menu with title and 3 options to choose from unsigned char flashSlot; // Copy menuOptions out of progmem - convertPgm(menuOptionsFlash, 3); - flashSlot = question_box(F("Select adapter PCB"), menuOptions, 3, 0); + convertPgm(menuOptionsFlash, 4); + flashSlot = question_box(F("Select adapter PCB"), menuOptions, 4, 0); // wait for user choice to come back from the question box menu switch (flashSlot) @@ -88,6 +89,10 @@ void flashMenu() { wait(); mode = mode_FLASH16; break; + + case 3: + resetArduino(); + break; } } diff --git a/Cart_Reader/GB.ino b/Cart_Reader/GB.ino index 2204a16..dd6009d 100644 --- a/Cart_Reader/GB.ino +++ b/Cart_Reader/GB.ino @@ -18,7 +18,8 @@ static const char gbxMenuItem1[] PROGMEM = "Game Boy (Color)"; static const char gbxMenuItem2[] PROGMEM = "Game Boy Advance"; static const char gbxMenuItem3[] PROGMEM = "NPower GB Memory"; static const char gbxMenuItem4[] PROGMEM = "GB Smart"; -static const char* const menuOptionsGBx[] PROGMEM = {gbxMenuItem1, gbxMenuItem2, gbxMenuItem3, gbxMenuItem4}; +static const char gbxMenuItem5[] PROGMEM = "Reset"; +static const char* const menuOptionsGBx[] PROGMEM = {gbxMenuItem1, gbxMenuItem2, gbxMenuItem3, gbxMenuItem4, gbxMenuItem5}; // GB menu items static const char GBMenuItem1[] PROGMEM = "Read Rom"; @@ -31,11 +32,11 @@ static const char* const menuOptionsGB[] PROGMEM = {GBMenuItem1, GBMenuItem2, GB // Start menu for both GB and GBA void gbxMenu() { - // create menu with title and 3 options to choose from + // create menu with title and 5 options to choose from unsigned char gbType; // Copy menuOptions out of progmem - convertPgm(menuOptionsGBx, 4); - gbType = question_box(F("Select Game Boy"), menuOptions, 4, 0); + convertPgm(menuOptionsGBx, 5); + gbType = question_box(F("Select Game Boy"), menuOptions, 5, 0); // wait for user choice to come back from the question box menu switch (gbType) @@ -67,6 +68,10 @@ void gbxMenu() { setup_GBSmart(); mode = mode_GB_GBSmart; break; + + case 4: + resetArduino(); + break; } } diff --git a/Cart_Reader/N64.ino b/Cart_Reader/N64.ino index 7e17939..41d14ff 100644 --- a/Cart_Reader/N64.ino +++ b/Cart_Reader/N64.ino @@ -96,11 +96,11 @@ static const char* const saveOptionsN64[] PROGMEM = {N64SaveItem1, N64SaveItem2, // N64 start menu void n64Menu() { - // create menu with title and 3 options to choose from + // create menu with title and 5 options to choose from unsigned char n64Dev; // Copy menuOptions out of progmem - convertPgm(menuOptionsN64, 4); - n64Dev = question_box(F("Select N64 device"), menuOptions, 4, 0); + convertPgm(menuOptionsN64, 5); + n64Dev = question_box(F("Select N64 device"), menuOptions, 5, 0); // wait for user choice to come back from the question box menu switch (n64Dev) diff --git a/Cart_Reader/PCE.ino b/Cart_Reader/PCE.ino index 0ce544a..4bf1306 100644 --- a/Cart_Reader/PCE.ino +++ b/Cart_Reader/PCE.ino @@ -47,7 +47,8 @@ uint8_t pce_internal_mode; //0 - HuCARD, 1 - TurboChip // PCE start menu static const char pceMenuItem1[] PROGMEM = "HuCARD"; static const char pceMenuItem2[] PROGMEM = "Turbochip"; -static const char* const menuOptionspce[] PROGMEM = {pceMenuItem1, pceMenuItem2}; +static const char pceMenuItem3[] PROGMEM = "Reset"; +static const char* const menuOptionspce[] PROGMEM = {pceMenuItem1, pceMenuItem2, pceMenuItem3}; // PCE card menu items static const char pceCartMenuItem1[] PROGMEM = "Read Rom"; @@ -66,8 +67,8 @@ void pcsMenu(void) { // create menu with title and 3 options to choose from unsigned char pceDev; // Copy menuOptions out of progmem - convertPgm(menuOptionspce, 2); - pceDev = question_box(F("Select device"), menuOptions, 2, 0); + convertPgm(menuOptionspce, 3); + pceDev = question_box(F("Select device"), menuOptions, 3, 0); // wait for user choice to come back from the question box menu switch (pceDev) @@ -89,6 +90,10 @@ void pcsMenu(void) { setup_cart_PCE(); mode = mode_PCE; break; + + case 2: + resetArduino(); + break; } } diff --git a/Cart_Reader/SMS.ino b/Cart_Reader/SMS.ino index da43ad0..a8b8b3c 100644 --- a/Cart_Reader/SMS.ino +++ b/Cart_Reader/SMS.ino @@ -35,7 +35,7 @@ void smsMenu() { case 1: // Reset - asm volatile (" jmp 0"); + resetArduino(); break; } println_Msg(F("")); diff --git a/Cart_Reader/SNES.ino b/Cart_Reader/SNES.ino index 88b3c6c..cf1afac 100644 --- a/Cart_Reader/SNES.ino +++ b/Cart_Reader/SNES.ino @@ -32,7 +32,8 @@ static const char snsMenuItem2[] PROGMEM = "NPower SF Memory"; static const char snsMenuItem3[] PROGMEM = "Satellaview BS-X"; static const char snsMenuItem4[] PROGMEM = "HiROM repro"; static const char snsMenuItem5[] PROGMEM = "LoROM repro"; -static const char* const menuOptionsSNS[] PROGMEM = {snsMenuItem1, snsMenuItem2, snsMenuItem3, snsMenuItem4, snsMenuItem5}; +static const char snsMenuItem6[] PROGMEM = "Reset"; +static const char* const menuOptionsSNS[] PROGMEM = {snsMenuItem1, snsMenuItem2, snsMenuItem3, snsMenuItem4, snsMenuItem5, snsMenuItem6}; // SNES menu items static const char SnesMenuItem1[] PROGMEM = "Read Rom"; @@ -53,11 +54,11 @@ static const char* const menuOptionsConfManual[] PROGMEM = {confMenuItem1, confM // SNES start menu void snsMenu() { - // create menu with title and 4 options to choose from + // create menu with title and 6 options to choose from unsigned char snsCart; // Copy menuOptions out of progmem - convertPgm(menuOptionsSNS, 5); - snsCart = question_box(F("Select Cart Type"), menuOptions, 5, 0); + convertPgm(menuOptionsSNS, 6); + snsCart = question_box(F("Select Cart Type"), menuOptions, 6, 0); // wait for user choice to come back from the question box menu switch (snsCart) @@ -102,6 +103,10 @@ void snsMenu() { wait(); mode = mode_FLASH8; break; + + case 5: + resetArduino(); + break; } }