Update FLASH.ino

This commit is contained in:
sanni 2024-08-09 15:35:30 +02:00
parent c96c27c521
commit cf820cfbbd
2 changed files with 18 additions and 9 deletions

View File

@ -178,6 +178,7 @@ void flashromMenu8() {
print_STR(press_button_STR, 1);
display_Update();
wait();
rgbLed(black_color);
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Please wait..."));
display_Update();
@ -2883,7 +2884,8 @@ void adjustFileSizeOffset(byte currChip, byte totalChips, boolean reversed) {
} else if (fileSize > flashSize / 2) {
fileSize = fileSize - flashSize / 2;
myFile.seekSet(flashSize / 2);
}
} else
fileSize = 0;
}
// 4*2MB
@ -2951,6 +2953,12 @@ void writeCFI_Flash(byte currChip, byte totalChips, boolean reversed) {
print_STR(flashing_file_STR, 0);
print_Msg(filePath);
println_Msg(F("..."));
// Check size
if ((flashSize == 8388608) && (fileSize < 6291456) && reversed) {
println_Msg(FS(FSTRING_EMPTY));
print_STR(error_STR, 0);
print_FatalError(F("ROM file not ExROM"));
}
display_Update();
// Reset flash
@ -2991,7 +2999,7 @@ void writeCFI_Flash(byte currChip, byte totalChips, boolean reversed) {
print_Msg(F("Writing flash"));
// For file offset indicator SNES repros with multiple chips
// File offset indicator for SNES repros with multiple chips
if ((totalChips > 1) || reversed) {
print_Msg(FS(FSTRING_SPACE));
print_Msg(currChip);

View File

@ -71,10 +71,11 @@ static const char reproCFIItem5[] PROGMEM = "4x 2MB";
static const char reproCFIItem6[] PROGMEM = "1x 8MB";
static const char* const menuOptionsReproCFI[] PROGMEM = { reproCFIItem1, reproCFIItem2, reproCFIItem3, reproCFIItem4, reproCFIItem5, reproCFIItem6, FSTRING_RESET };
// ROM file order
/* ROM file order
static const char reproEXItem1[] PROGMEM = "ExROM (CDAB)";
static const char reproEXItem2[] PROGMEM = "standard (ABCD)";
static const char* const menuOptionsReproEX[] PROGMEM = { reproEXItem1, reproEXItem2, FSTRING_RESET };
*/
void setupCFI() {
#ifdef ENABLE_FLASH
@ -91,7 +92,7 @@ void setupCFI() {
#endif
}
boolean reproEXMenu() {
/*boolean reproEXMenu() {
boolean fileOrder = 0;
#ifdef ENABLE_FLASH
// create menu with title and 3 options to choose from
@ -114,11 +115,11 @@ boolean reproEXMenu() {
}
#endif
return fileOrder;
}
}*/
// Setup number of flashroms
void reproCFIMenu() {
boolean reversed = 0;
boolean reversed = 1;
// create menu with title and 7 options to choose from
unsigned char snsReproCFI;
// Copy menuOptions out of progmem
@ -165,7 +166,7 @@ void reproCFIMenu() {
break;
case 3:
reversed = reproEXMenu();
//reversed = reproEXMenu();
setupCFI();
flashSize = 8388608;
// Write first rom chip
@ -188,7 +189,7 @@ void reproCFIMenu() {
break;
case 4:
reversed = reproEXMenu();
//reversed = reproEXMenu();
setupCFI();
flashSize = 8388608;
// Write first rom chip
@ -237,7 +238,7 @@ void reproCFIMenu() {
break;
case 5:
reversed = reproEXMenu();
//reversed = reproEXMenu();
setupCFI();
flashSize = 8388608;
writeCFI_Flash(1, 1, reversed);