mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-23 21:19:16 +01:00
V19A: Minor bugfixes
This commit is contained in:
parent
a8c03520c8
commit
b0e2d5b6c2
@ -2,8 +2,8 @@
|
||||
Cartridge Reader for Arduino Mega2560
|
||||
|
||||
Author: sanni
|
||||
Date: 2016-09-12
|
||||
Version: V19
|
||||
Date: 2016-09-14
|
||||
Version: V19A
|
||||
|
||||
SD lib: https://github.com/greiman/SdFat
|
||||
LCD lib: https://github.com/adafruit/Adafruit_SSD1306
|
||||
@ -33,7 +33,7 @@
|
||||
lukeskaff - Nintendo DS GBA slot timing
|
||||
|
||||
**********************************************************************************/
|
||||
char ver[5] = "V19";
|
||||
char ver[5] = "V19A";
|
||||
|
||||
/******************************************
|
||||
Define Output
|
||||
@ -47,7 +47,7 @@ char ver[5] = "V19";
|
||||
Define Input
|
||||
******************************************/
|
||||
// If you have two buttons on your cart reader you can remove the //
|
||||
//#define enable_Button2
|
||||
#define enable_Button2
|
||||
|
||||
/******************************************
|
||||
Pinout
|
||||
@ -921,7 +921,7 @@ unsigned char questionBox_OLED(const char* question, char answers[7][20], int nu
|
||||
display.setCursor(0, 0);
|
||||
|
||||
// change the rgb led to the start menu color
|
||||
rgbLed(blue_color);
|
||||
rgbLed(default_choice);
|
||||
|
||||
// print menu
|
||||
display.println(question);
|
||||
|
@ -64,8 +64,8 @@ const char N64CartMenuItem4[] PROGMEM = "Reset";
|
||||
const char* const menuOptionsN64Cart[] PROGMEM = {N64CartMenuItem1, N64CartMenuItem2, N64CartMenuItem3, N64CartMenuItem4};
|
||||
|
||||
// N64 CRC32 error menu items
|
||||
const char N64CRCMenuItem1[] PROGMEM = "Redump";
|
||||
const char N64CRCMenuItem2[] PROGMEM = "Recalc CRC";
|
||||
const char N64CRCMenuItem1[] PROGMEM = "Recalc CRC";
|
||||
const char N64CRCMenuItem2[] PROGMEM = "Redump";
|
||||
const char N64CRCMenuItem3[] PROGMEM = "Ignore";
|
||||
const char N64CRCMenuItem4[] PROGMEM = "Reset";
|
||||
const char* const menuOptionsN64CRC[] PROGMEM = {N64CRCMenuItem1, N64CRCMenuItem2, N64CRCMenuItem3, N64CRCMenuItem4};
|
||||
@ -2015,12 +2015,21 @@ calcn64crc:
|
||||
strcpy(tempStr3, "CRC ERROR ");
|
||||
strcat(tempStr3, crcStr);
|
||||
|
||||
CRCMenu = question_box(tempStr3, menuOptions, 4, 0);
|
||||
CRCMenu = question_box(tempStr3, menuOptions, 4, 1);
|
||||
|
||||
// wait for user choice to come back from the question box menu
|
||||
switch (CRCMenu)
|
||||
{
|
||||
case 0:
|
||||
// Change to last directory
|
||||
sd.chdir(folder);
|
||||
display_Clear();
|
||||
// Calculate CRC again
|
||||
rgb.setColor(0, 0, 0);
|
||||
goto calcn64crc;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// Change to last directory
|
||||
sd.chdir(folder);
|
||||
// Delete old file
|
||||
@ -2038,15 +2047,6 @@ calcn64crc:
|
||||
goto readn64rom;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// Change to last directory
|
||||
sd.chdir(folder);
|
||||
display_Clear();
|
||||
// Calculate CRC again
|
||||
rgb.setColor(0, 0, 0);
|
||||
goto calcn64crc;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// Return to N64 menu
|
||||
break;
|
||||
|
@ -62,49 +62,67 @@ void snesMenu() {
|
||||
break;
|
||||
|
||||
case 1:
|
||||
display_Clear();
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
readSRAM();
|
||||
if (sramSize > 0) {
|
||||
display_Clear();
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
readSRAM();
|
||||
}
|
||||
else {
|
||||
display_Clear();
|
||||
print_Error(F("Does not have SRAM"), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
display_Clear();
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
writeSRAM(1);
|
||||
unsigned long wrErrors;
|
||||
wrErrors = verifySRAM();
|
||||
if (wrErrors == 0) {
|
||||
println_Msg(F("Verified OK"));
|
||||
display_Update();
|
||||
if (sramSize > 0) {
|
||||
display_Clear();
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
writeSRAM(1);
|
||||
unsigned long wrErrors;
|
||||
wrErrors = verifySRAM();
|
||||
if (wrErrors == 0) {
|
||||
println_Msg(F("Verified OK"));
|
||||
display_Update();
|
||||
}
|
||||
else {
|
||||
print_Msg(F("Error: "));
|
||||
print_Msg(wrErrors);
|
||||
println_Msg(F(" bytes "));
|
||||
print_Error(F("did not verify."), false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
print_Msg(F("Error: "));
|
||||
print_Msg(wrErrors);
|
||||
println_Msg(F(" bytes "));
|
||||
print_Error(F("did not verify."), false);
|
||||
display_Clear();
|
||||
print_Error(F("Does not have SRAM"), false);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
display_Clear();
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
readSRAM();
|
||||
eraseSRAM(0x00);
|
||||
eraseSRAM(0xFF);
|
||||
writeSRAM(0);
|
||||
wrErrors = verifySRAM();
|
||||
if (wrErrors == 0) {
|
||||
println_Msg(F("Verified OK"));
|
||||
display_Update();
|
||||
if (sramSize > 0) {
|
||||
display_Clear();
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
readSRAM();
|
||||
eraseSRAM(0x00);
|
||||
eraseSRAM(0xFF);
|
||||
writeSRAM(0);
|
||||
unsigned long wrErrors = verifySRAM();
|
||||
if (wrErrors == 0) {
|
||||
println_Msg(F("Verified OK"));
|
||||
display_Update();
|
||||
}
|
||||
else {
|
||||
print_Msg(F("Error: "));
|
||||
print_Msg(wrErrors);
|
||||
println_Msg(F(" bytes "));
|
||||
print_Error(F("did not verify."), false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
print_Msg(F("Error: "));
|
||||
print_Msg(wrErrors);
|
||||
println_Msg(F(" bytes "));
|
||||
print_Error(F("did not verify."), false);
|
||||
display_Clear();
|
||||
print_Error(F("Does not have SRAM"), false);
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user