UI improvements for GB, GBA, N64, SNES

This commit is contained in:
Lesserkuma 2022-09-25 16:40:21 +02:00
parent ff758768df
commit 140401161b
4 changed files with 177 additions and 143 deletions

View File

@ -23,7 +23,7 @@ static const char gbxMenuItem5[] PROGMEM = "Reset";
static const char* const menuOptionsGBx[] PROGMEM = {gbxMenuItem1, gbxMenuItem2, gbxMenuItem3, gbxMenuItem4, gbxMenuItem5}; static const char* const menuOptionsGBx[] PROGMEM = {gbxMenuItem1, gbxMenuItem2, gbxMenuItem3, gbxMenuItem4, gbxMenuItem5};
// GB menu items // GB menu items
static const char GBMenuItem1[] PROGMEM = "Read Rom"; static const char GBMenuItem1[] PROGMEM = "Read ROM";
static const char GBMenuItem2[] PROGMEM = "Read Save"; static const char GBMenuItem2[] PROGMEM = "Read Save";
static const char GBMenuItem3[] PROGMEM = "Write Save"; static const char GBMenuItem3[] PROGMEM = "Write Save";
static const char GBMenuItem4[] PROGMEM = "Reset"; static const char GBMenuItem4[] PROGMEM = "Reset";
@ -312,7 +312,7 @@ void gbMenu() {
readSRAM_GB(); readSRAM_GB();
} }
else { else {
print_Error(F("Cart has no Sram"), false); print_Error(F("No save or unsupported type"), false);
} }
println_Msg(F("")); println_Msg(F(""));
break; break;
@ -340,7 +340,7 @@ void gbMenu() {
} }
} }
else { else {
print_Error(F("Cart has no Sram"), false); print_Error(F("No save or unsupported type"), false);
} }
println_Msg(F("")); println_Msg(F(""));
break; break;
@ -399,11 +399,13 @@ void setup_GB() {
void showCartInfo_GB() { void showCartInfo_GB() {
display_Clear(); display_Clear();
if (strcmp(checksumStr, "00") != 0) { if (strcmp(checksumStr, "00") != 0) {
println_Msg(F("GB Cart Info")); print_Msg(F("Title: "));
print_Msg(F("Name: "));
println_Msg(romName); println_Msg(romName);
print_Msg(F("Mapper: "));
print_Msg(F("Revision: "));
println_Msg(romVersion);
print_Msg(F("Mapper: "));
if ((romType == 0) || (romType == 8) || (romType == 9)) if ((romType == 0) || (romType == 8) || (romType == 9))
print_Msg(F("none")); print_Msg(F("none"));
else if ((romType == 1) || (romType == 2) || (romType == 3)) else if ((romType == 1) || (romType == 2) || (romType == 3))
@ -418,10 +420,14 @@ void showCartInfo_GB() {
print_Msg(F("MBC4")); print_Msg(F("MBC4"));
else if ((romType == 25) || (romType == 26) || (romType == 27) || (romType == 28) || (romType == 29) || (romType == 309)) else if ((romType == 25) || (romType == 26) || (romType == 27) || (romType == 28) || (romType == 29) || (romType == 309))
print_Msg(F("MBC5")); print_Msg(F("MBC5"));
else if (romType == 32)
print_Msg(F("MBC6 (no support)"));
else if (romType == 34) else if (romType == 34)
print_Msg(F("MBC7")); print_Msg(F("MBC7"));
else if (romType == 252) else if (romType == 252)
print_Msg(F("Camera")); print_Msg(F("Camera"));
else if (romType == 253)
print_Msg(F("TAMA5 (no support)"));
else if (romType == 254) else if (romType == 254)
print_Msg(F("HuC-3")); print_Msg(F("HuC-3"));
else if (romType == 255) else if (romType == 255)
@ -430,7 +436,7 @@ void showCartInfo_GB() {
print_Msg(F("M161")); print_Msg(F("M161"));
println_Msg(F("")); println_Msg(F(""));
print_Msg(F("Rom Size: ")); print_Msg(F("ROM Size: "));
switch (romSize) { switch (romSize) {
case 0: case 0:
print_Msg(F("32 KB")); print_Msg(F("32 KB"));
@ -470,17 +476,28 @@ void showCartInfo_GB() {
} }
println_Msg(F("")); println_Msg(F(""));
print_Msg(F("Banks: ")); //print_Msg(F("Banks: "));
println_Msg(romBanks); //println_Msg(romBanks);
print_Msg(F("Sram Size: ")); print_Msg(F("Save Size: "));
switch (sramSize) { switch (sramSize) {
case 0: case 0:
if (romType == 6) { if (romType == 6) {
print_Msg(F("512B")); print_Msg(F("512 Byte"));
}
else if (romType == 0x22) {
if (strncmp(romName, "CMASTER_KCEJ", 12) == 0) {
print_Msg(F("512 Byte"));
} }
else { else {
print_Msg(F("none")); print_Msg(F("256 Byte"));
}
}
else if (romType == 0xFD) {
print_Msg(F("32 Byte"));
}
else {
print_Msg(F("None"));
} }
break; break;
case 1: case 1:
@ -492,14 +509,22 @@ void showCartInfo_GB() {
break; break;
case 3: case 3:
if (romType == 0x20) {
print_Msg(F("1.03 MB"));
} else {
print_Msg(F("32 KB")); print_Msg(F("32 KB"));
}
break; break;
case 4: case 4:
print_Msg(F("128 KB")); print_Msg(F("128 KB"));
break; break;
default: print_Msg(F("none")); case 5:
print_Msg(F("64 KB"));
break;
default: print_Msg(F("None"));
} }
println_Msg(F("")); println_Msg(F(""));
print_Msg(F("Checksum: ")); print_Msg(F("Checksum: "));
@ -507,6 +532,7 @@ void showCartInfo_GB() {
display_Update(); display_Update();
// Wait for user input // Wait for user input
println_Msg(F(""));
println_Msg(F("Press Button...")); println_Msg(F("Press Button..."));
display_Update(); display_Update();
wait(); wait();
@ -838,6 +864,9 @@ void getCartInfo_GB() {
(strncmp(romName, "RTYPE 2 SET", 11) == 0) && (sdBuffer[0x14D] == 0x32)) { (strncmp(romName, "RTYPE 2 SET", 11) == 0) && (sdBuffer[0x14D] == 0x32)) {
romType = 0x0B; romType = 0x0B;
} }
// ROM revision
romVersion = sdBuffer[0x14C];
} }
/****************************************** /******************************************
@ -1002,15 +1031,15 @@ void compare_checksums_GB() {
char calcsumStr[5]; char calcsumStr[5];
sprintf(calcsumStr, "%04X", calc_checksum_GB(fileName, folder)); sprintf(calcsumStr, "%04X", calc_checksum_GB(fileName, folder));
if (strcmp(calcsumStr, checksumStr) == 0) { print_Msg(F("Checksum: "));
print_Msg(F("Internal: "));
print_Msg(calcsumStr); print_Msg(calcsumStr);
if (strcmp(calcsumStr, checksumStr) == 0) {
println_Msg(F(" -> OK")); println_Msg(F(" -> OK"));
} }
else { else {
print_Msg(F("Internal: ")); print_Msg(F(" != "));
println_Msg(calcsumStr); println_Msg(checksumStr);
print_Error(F("Checksum Error"), false); print_Error(F("Invalid Checksum"), false);
} }
compareCRC("gb.txt", 0, 1, 0); compareCRC("gb.txt", 0, 1, 0);
display_Update(); display_Update();

View File

@ -13,7 +13,7 @@ boolean readType;
Menu Menu
*****************************************/ *****************************************/
// GBA menu items // GBA menu items
static const char GBAMenuItem1[] PROGMEM = "Read Rom"; static const char GBAMenuItem1[] PROGMEM = "Read ROM";
static const char GBAMenuItem2[] PROGMEM = "Read Save"; static const char GBAMenuItem2[] PROGMEM = "Read Save";
static const char GBAMenuItem3[] PROGMEM = "Write Save"; static const char GBAMenuItem3[] PROGMEM = "Write Save";
static const char GBAMenuItem4[] PROGMEM = "Force Savetype"; static const char GBAMenuItem4[] PROGMEM = "Force Savetype";
@ -35,8 +35,8 @@ static const char GBASaveItem1[] PROGMEM = "4K EEPROM";
static const char GBASaveItem2[] PROGMEM = "64K EEPROM"; static const char GBASaveItem2[] PROGMEM = "64K EEPROM";
static const char GBASaveItem3[] PROGMEM = "256K SRAM/FRAM"; static const char GBASaveItem3[] PROGMEM = "256K SRAM/FRAM";
static const char GBASaveItem4[] PROGMEM = "512K SRAM/FRAM"; static const char GBASaveItem4[] PROGMEM = "512K SRAM/FRAM";
static const char GBASaveItem5[] PROGMEM = "512K FLASHROM"; static const char GBASaveItem5[] PROGMEM = "512K FLASH";
static const char GBASaveItem6[] PROGMEM = "1M FLASHROM"; static const char GBASaveItem6[] PROGMEM = "1M FLASH";
static const char* const saveOptionsGBA[] PROGMEM = {GBASaveItem1, GBASaveItem2, GBASaveItem3, GBASaveItem4, GBASaveItem5, GBASaveItem6}; static const char* const saveOptionsGBA[] PROGMEM = {GBASaveItem1, GBASaveItem2, GBASaveItem3, GBASaveItem4, GBASaveItem5, GBASaveItem6};
void gbaMenu() { void gbaMenu() {
@ -175,7 +175,7 @@ void gbaMenu() {
break; break;
case 5: case 5:
// 1024K FLASH // 1M FLASH
saveType = 5; saveType = 5;
break; break;
} }
@ -217,7 +217,7 @@ void gbaMenu() {
case 5: case 5:
display_Clear(); display_Clear();
sd.chdir("/"); sd.chdir("/");
// 1024K FLASH (divided into two banks) // 1M FLASH (divided into two banks)
switchBank_GBA(0x0); switchBank_GBA(0x0);
setROM_GBA(); setROM_GBA();
readFLASH_GBA(1, 65536, 0); readFLASH_GBA(1, 65536, 0);
@ -278,7 +278,7 @@ void gbaMenu() {
break; break;
case 5: case 5:
// 1024K FLASH // 1M FLASH
saveType = 5; saveType = 5;
break; break;
} }
@ -351,10 +351,10 @@ void gbaMenu() {
idFlash_GBA(); idFlash_GBA();
resetFLASH_GBA(); resetFLASH_GBA();
print_Msg(F("Flashrom ID: ")); print_Msg(F("FLASH ID: "));
println_Msg(flashid); println_Msg(flashid);
println_Msg(F("")); println_Msg(F(""));
println_Msg(F("Flashrom Type: ")); println_Msg(F("FLASH Type: "));
if (strcmp(flashid, "1F3D") == 0) { if (strcmp(flashid, "1F3D") == 0) {
println_Msg(F("Atmel AT29LV512")); println_Msg(F("Atmel AT29LV512"));
} }
@ -508,7 +508,7 @@ void gbaMenu() {
break; break;
case 5: case 5:
// 1024K FLASH // 1M FLASH
saveType = 5; saveType = 5;
break; break;
} }
@ -543,49 +543,49 @@ void setup_GBA() {
display_Clear(); display_Clear();
// Print start page // Print start page
print_Msg(F("Name: ")); print_Msg(F("Title: "));
println_Msg(romName); println_Msg(romName);
print_Msg(F("Cart ID: ")); print_Msg(F("Code: "));
println_Msg(cartID); println_Msg(cartID);
print_Msg(F("Rom Size: ")); print_Msg(F("Revision: "));
println_Msg(romVersion);
print_Msg(F("ROM Size: "));
if (cartSize == 0) if (cartSize == 0)
println_Msg(F("Unknown")); println_Msg(F("Unknown"));
else { else {
print_Msg(cartSize); print_Msg(cartSize);
println_Msg(F(" MB")); println_Msg(F(" MB"));
} }
print_Msg(F("Save: ")); print_Msg(F("Save Type: "));
switch (saveType) switch (saveType)
{ {
case 0: case 0:
println_Msg(F("Unknown")); println_Msg(F("None/Unknown"));
break; break;
case 1: case 1:
println_Msg(F("4K Eeprom")); println_Msg(F("4K EEPROM"));
break; break;
case 2: case 2:
println_Msg(F("64K Eeprom")); println_Msg(F("64K EEPROM"));
break; break;
case 3: case 3:
println_Msg(F("256K Sram")); println_Msg(F("256K SRAM"));
break; break;
case 4: case 4:
println_Msg(F("512K Flash")); println_Msg(F("512K FLASH"));
break; break;
case 5: case 5:
println_Msg(F("1024K Flash")); println_Msg(F("1M FLASH"));
break; break;
} }
print_Msg(F("Checksum: ")); print_Msg(F("Header Checksum: "));
println_Msg(checksumStr); println_Msg(checksumStr);
print_Msg(F("Version: 1."));
println_Msg(romVersion);
// Wait for user input // Wait for user input
println_Msg(""); println_Msg("");
@ -997,7 +997,7 @@ void readROM_GBA() {
// Calculate the checksum of the dumped rom // Calculate the checksum of the dumped rom
boolean compare_checksum_GBA () { boolean compare_checksum_GBA () {
print_Msg(F("Internal Checksum...")); print_Msg(F("Checksum: "));
display_Update(); display_Update();
strcpy(fileName, romName); strcpy(fileName, romName);
@ -1023,17 +1023,17 @@ boolean compare_checksum_GBA () {
// Turn into string // Turn into string
sprintf(calcChecksumStr, "%02X", calcChecksum); sprintf(calcChecksumStr, "%02X", calcChecksum);
print_Msg(calcChecksumStr);
if (strcmp(calcChecksumStr, checksumStr) == 0) { if (strcmp(calcChecksumStr, checksumStr) == 0) {
println_Msg(F("OK")); println_Msg(F(" -> OK"));
display_Update(); display_Update();
return 1; return 1;
} }
else { else {
println_Msg(""); print_Msg(F(" != "));
print_Msg(F("Result: ")); println_Msg(checksumStr);
println_Msg(calcChecksumStr); print_Error(F("Invalid Checksum"), false);
print_Error(F("Checksum Error"), false);
return 0; return 0;
} }
} }
@ -1799,7 +1799,7 @@ void writeEeprom_GBA(word eepSize) {
sprintf(filePath, "%s/%s", filePath, fileName); sprintf(filePath, "%s/%s", filePath, fileName);
display_Clear(); display_Clear();
print_Msg(F("Writing eeprom...")); print_Msg(F("Writing EEPROM..."));
display_Update(); display_Update();
//open file on sd card //open file on sd card

View File

@ -70,7 +70,7 @@ static const char N64ContMenuItem4[] PROGMEM = "Reset";
static const char* const menuOptionsN64Controller[] PROGMEM = {N64ContMenuItem1, N64ContMenuItem2, N64ContMenuItem3, N64ContMenuItem4}; static const char* const menuOptionsN64Controller[] PROGMEM = {N64ContMenuItem1, N64ContMenuItem2, N64ContMenuItem3, N64ContMenuItem4};
// N64 cart menu items // N64 cart menu items
static const char N64CartMenuItem1[] PROGMEM = "Read Rom"; static const char N64CartMenuItem1[] PROGMEM = "Read ROM";
static const char N64CartMenuItem2[] PROGMEM = "Read Save"; static const char N64CartMenuItem2[] PROGMEM = "Read Save";
static const char N64CartMenuItem3[] PROGMEM = "Write Save"; static const char N64CartMenuItem3[] PROGMEM = "Write Save";
static const char N64CartMenuItem4[] PROGMEM = "Force Savetype"; static const char N64CartMenuItem4[] PROGMEM = "Force Savetype";
@ -98,21 +98,21 @@ static const char N64SaveItem1[] PROGMEM = "None";
static const char N64SaveItem2[] PROGMEM = "4K EEPROM"; static const char N64SaveItem2[] PROGMEM = "4K EEPROM";
static const char N64SaveItem3[] PROGMEM = "16K EEPROM"; static const char N64SaveItem3[] PROGMEM = "16K EEPROM";
static const char N64SaveItem4[] PROGMEM = "SRAM"; static const char N64SaveItem4[] PROGMEM = "SRAM";
static const char N64SaveItem5[] PROGMEM = "FLASHRAM"; static const char N64SaveItem5[] PROGMEM = "FLASH";
static const char* const saveOptionsN64[] PROGMEM = {N64SaveItem1, N64SaveItem2, N64SaveItem3, N64SaveItem4, N64SaveItem5}; static const char* const saveOptionsN64[] PROGMEM = {N64SaveItem1, N64SaveItem2, N64SaveItem3, N64SaveItem4, N64SaveItem5};
// Repro write buffer menu // Repro write buffer menu
static const char N64BufferItem1[] PROGMEM = "no buffer"; static const char N64BufferItem1[] PROGMEM = "No buffer";
static const char N64BufferItem2[] PROGMEM = "32 Byte"; static const char N64BufferItem2[] PROGMEM = "32 Byte";
static const char N64BufferItem3[] PROGMEM = "64 Byte"; static const char N64BufferItem3[] PROGMEM = "64 Byte";
static const char N64BufferItem4[] PROGMEM = "128 Byte"; static const char N64BufferItem4[] PROGMEM = "128 Byte";
static const char* const bufferOptionsN64[] PROGMEM = {N64BufferItem1, N64BufferItem2, N64BufferItem3, N64BufferItem4}; static const char* const bufferOptionsN64[] PROGMEM = {N64BufferItem1, N64BufferItem2, N64BufferItem3, N64BufferItem4};
// Repro sector size menu // Repro sector size menu
static const char N64SectorItem1[] PROGMEM = "8 KByte"; static const char N64SectorItem1[] PROGMEM = "8 KB";
static const char N64SectorItem2[] PROGMEM = "32 KByte"; static const char N64SectorItem2[] PROGMEM = "32 KB";
static const char N64SectorItem3[] PROGMEM = "64 KByte"; static const char N64SectorItem3[] PROGMEM = "64 KB";
static const char N64SectorItem4[] PROGMEM = "128 KByte"; static const char N64SectorItem4[] PROGMEM = "128 KB";
static const char* const sectorOptionsN64[] PROGMEM = {N64SectorItem1, N64SectorItem2, N64SectorItem3, N64SectorItem4}; static const char* const sectorOptionsN64[] PROGMEM = {N64SectorItem1, N64SectorItem2, N64SectorItem3, N64SectorItem4};
// N64 start menu // N64 start menu
@ -252,18 +252,18 @@ void n64CartMenu() {
display_Clear(); display_Clear();
if (saveType == 1) { if (saveType == 1) {
println_Msg(F("Reading Sram...")); println_Msg(F("Reading SRAM..."));
display_Update(); display_Update();
readSram(32768, 1); readSram(32768, 1);
} }
else if (saveType == 4) { else if (saveType == 4) {
getFramType(); getFramType();
println_Msg(F("Reading Flashram...")); println_Msg(F("Reading FLASH..."));
display_Update(); display_Update();
readFram(flashramType); readFram(flashramType);
} }
else if ((saveType == 5) || (saveType == 6)) { else if ((saveType == 5) || (saveType == 6)) {
println_Msg(F("Reading Eep...")); println_Msg(F("Reading EEPROM..."));
display_Update(); display_Update();
#ifdef clockgen_installed #ifdef clockgen_installed
readEeprom(); readEeprom();
@ -291,7 +291,7 @@ void n64CartMenu() {
writeSram(32768); writeSram(32768);
writeErrors = verifySram(32768, 1); writeErrors = verifySram(32768, 1);
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("Sram verified OK")); println_Msg(F("SRAM verified OK"));
display_Update(); display_Update();
} }
else { else {
@ -336,7 +336,7 @@ void n64CartMenu() {
#endif #endif
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("Eeprom verified OK")); println_Msg(F("EEPROM verified OK"));
display_Update(); display_Update();
} }
else { else {
@ -348,7 +348,7 @@ void n64CartMenu() {
} }
else { else {
display_Clear(); display_Clear();
print_Error(F("Savetype Error"), false); print_Error(F("Save Type Error"), false);
} }
println_Msg(F("Press Button...")); println_Msg(F("Press Button..."));
display_Update(); display_Update();
@ -2445,37 +2445,38 @@ void printCartInfo_N64() {
// Print start page // Print start page
if (cartSize != 0) { if (cartSize != 0) {
display_Clear(); display_Clear();
println_Msg(F("N64 Cartridge Info")); print_Msg(F("Title: "));
println_Msg(F(""));
print_Msg(F("Name: "));
println_Msg(romName); println_Msg(romName);
print_Msg(F("ID: ")); print_Msg(F("Code: "));
print_Msg(cartID); println_Msg(cartID);
print_Msg(F(" Size: ")); print_Msg(F("Revision: "));
println_Msg(romVersion);
print_Msg(F("ROM Size: "));
print_Msg(cartSize); print_Msg(cartSize);
println_Msg(F(" MB")); println_Msg(F(" MB"));
print_Msg(F("Save: ")); print_Msg(F("Save Type: "));
switch (saveType) { switch (saveType) {
case 1: case 1:
println_Msg(F("Sram")); println_Msg(F("SRAM"));
break; break;
case 4: case 4:
println_Msg(F("Flashram")); println_Msg(F("FLASH"));
break; break;
case 5: case 5:
println_Msg(F("4K Eeprom")); println_Msg(F("4K EEPROM"));
eepPages = 64; eepPages = 64;
break; break;
case 6: case 6:
println_Msg(F("16K Eeprom")); println_Msg(F("16K EEPROM"));
eepPages = 256; eepPages = 256;
break; break;
default: default:
println_Msg(F("unknown")); println_Msg(F("None/Unknown"));
break; break;
} }
print_Msg(F("Version: 1."));
println_Msg(romVersion); print_Msg(F("CRC1: "));
println_Msg(checksumStr);
// Wait for user input // Wait for user input
println_Msg(F(" ")); println_Msg(F(" "));
@ -2488,9 +2489,9 @@ void printCartInfo_N64() {
display_Clear(); display_Clear();
println_Msg(F("GAMEPAK ERROR")); println_Msg(F("GAMEPAK ERROR"));
println_Msg(""); println_Msg("");
print_Msg(F("Name: ")); print_Msg(F("Title: "));
println_Msg(romName); println_Msg(romName);
print_Msg(F("ID: ")); print_Msg(F("Code: "));
println_Msg(cartID); println_Msg(cartID);
print_Msg(F("CRC1: ")); print_Msg(F("CRC1: "));
println_Msg(checksumStr); println_Msg(checksumStr);
@ -3989,19 +3990,19 @@ void savesummary_N64(boolean checkfound, char crcStr[9], unsigned long timeElaps
switch (saveType) { switch (saveType) {
case 1: case 1:
myFile.println(F("Sram")); myFile.println(F("SRAM"));
break; break;
case 4: case 4:
myFile.println(F("Flashram")); myFile.println(F("FLASH"));
break; break;
case 5: case 5:
myFile.println(F("4K Eeprom")); myFile.println(F("4K EEPROM"));
break; break;
case 6: case 6:
myFile.println(F("16K Eeprom")); myFile.println(F("16K EEPROM"));
break; break;
default: default:
myFile.println(F("unknown")); myFile.println(F("None/Unknown"));
break; break;
} }

View File

@ -43,7 +43,7 @@ static const char* const menuOptionsSNS[] PROGMEM = {snsMenuItem1, snsMenuItem2,
#endif #endif
// SNES menu items // SNES menu items
static const char SnesMenuItem1[] PROGMEM = "Read Rom"; static const char SnesMenuItem1[] PROGMEM = "Read ROM";
static const char SnesMenuItem2[] PROGMEM = "Read Save"; static const char SnesMenuItem2[] PROGMEM = "Read Save";
static const char SnesMenuItem3[] PROGMEM = "Write Save"; static const char SnesMenuItem3[] PROGMEM = "Write Save";
static const char SnesMenuItem4[] PROGMEM = "Test SRAM"; static const char SnesMenuItem4[] PROGMEM = "Test SRAM";
@ -54,17 +54,17 @@ static const char* const menuOptionsSNES[] PROGMEM = {SnesMenuItem1, SnesMenuIte
// Manual config menu items // Manual config menu items
static const char confMenuItem1[] PROGMEM = "Use header info"; static const char confMenuItem1[] PROGMEM = "Use header info";
static const char confMenuItem2[] PROGMEM = "4MB LoRom 256K Sram"; static const char confMenuItem2[] PROGMEM = "4MB LoROM 256K SRAM";
static const char confMenuItem3[] PROGMEM = "4MB HiRom 64K Sram"; static const char confMenuItem3[] PROGMEM = "4MB HiROM 64K SRAM";
static const char confMenuItem4[] PROGMEM = "6MB ExRom 256K Sram"; static const char confMenuItem4[] PROGMEM = "6MB ExROM 256K SRAM";
static const char confMenuItem5[] PROGMEM = "Reset"; static const char confMenuItem5[] PROGMEM = "Reset";
static const char* const menuOptionsConfManual[] PROGMEM = {confMenuItem1, confMenuItem2, confMenuItem3, confMenuItem4, confMenuItem5}; static const char* const menuOptionsConfManual[] PROGMEM = {confMenuItem1, confMenuItem2, confMenuItem3, confMenuItem4, confMenuItem5};
// Repro menu items // Repro menu items
static const char reproMenuItem1[] PROGMEM = "LoRom (P0)"; static const char reproMenuItem1[] PROGMEM = "LoROM (P0)";
static const char reproMenuItem2[] PROGMEM = "HiRom (P0)"; static const char reproMenuItem2[] PROGMEM = "HiROM (P0)";
static const char reproMenuItem3[] PROGMEM = "ExLoRom (P1)"; static const char reproMenuItem3[] PROGMEM = "ExLoROM (P1)";
static const char reproMenuItem4[] PROGMEM = "ExHiRom (P1)"; static const char reproMenuItem4[] PROGMEM = "ExHiROM (P1)";
static const char reproMenuItem5[] PROGMEM = "Reset"; static const char reproMenuItem5[] PROGMEM = "Reset";
static const char* const menuOptionsRepro[] PROGMEM = {reproMenuItem1, reproMenuItem2, reproMenuItem3, reproMenuItem4, reproMenuItem5}; static const char* const menuOptionsRepro[] PROGMEM = {reproMenuItem1, reproMenuItem2, reproMenuItem3, reproMenuItem4, reproMenuItem5};
@ -355,21 +355,21 @@ void confMenuManual() {
romType = LO; romType = LO;
numBanks = 128; numBanks = 128;
sramSize = 256; sramSize = 256;
strcpy(romName, "LOROM"); strcpy(romName, "LoROM");
break; break;
case 2: case 2:
romType = HI; romType = HI;
numBanks = 64; numBanks = 64;
sramSize = 64; sramSize = 64;
strcpy(romName, "HIROM"); strcpy(romName, "HiROM");
break; break;
case 3: case 3:
romType = EX; romType = EX;
numBanks = 96; numBanks = 96;
sramSize = 256; sramSize = 256;
strcpy(romName, "EXROM"); strcpy(romName, "ExROM");
break; break;
case 4: case 4:
@ -703,9 +703,12 @@ void getCartInfo_SNES() {
} }
display_Clear(); display_Clear();
print_Msg(F("Name: ")); print_Msg(F("Title: "));
println_Msg(romName); println_Msg(romName);
print_Msg(F("Revision: "));
println_Msg(romVersion);
print_Msg(F("Type: ")); print_Msg(F("Type: "));
if (romType == HI) if (romType == HI)
print_Msg(F("HiROM")); print_Msg(F("HiROM"));
@ -772,20 +775,23 @@ void getCartInfo_SNES() {
print_Msg(F("Rom Size: ")); print_Msg(F("Rom Size: "));
else else
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
print_Msg(romSize); if ((romSize >> 3) < 1) {
println_Msg(F("Mbit")); print_Msg(1024 * romSize >> 3);
print_Msg(F(" KB"));
print_Msg(F("Banks: ")); } else {
print_Msg(romSize >> 3);
print_Msg(F(" MB"));
}
print_Msg(F(" ("));
print_Msg(numBanks); print_Msg(numBanks);
print_Msg(F(" Chips: ")); println_Msg(F(" banks)"));
println_Msg(romChips);
print_Msg(F("Sram Size: ")); //print_Msg(F("Chips: "));
print_Msg(sramSize); //println_Msg(romChips);
println_Msg(F("Kbit"));
print_Msg(F("ROM Version: 1.")); print_Msg(F("Save Size: "));
println_Msg(romVersion); print_Msg(sramSize >> 3);
println_Msg(F(" KB"));
print_Msg(F("Checksum: ")); print_Msg(F("Checksum: "));
println_Msg(checksumStr); println_Msg(checksumStr);
@ -793,8 +799,6 @@ void getCartInfo_SNES() {
// Wait for user input // Wait for user input
#if (defined(enable_LCD) || defined(enable_OLED)) #if (defined(enable_LCD) || defined(enable_OLED))
println_Msg(F(" "));
println_Msg(F(" "));
println_Msg(F("Press Button...")); println_Msg(F("Press Button..."));
display_Update(); display_Update();
wait(); wait();
@ -1248,17 +1252,17 @@ boolean compare_checksum() {
char calcsumStr[5]; char calcsumStr[5];
sprintf(calcsumStr, "%04X", calc_checksum(fileName, folder)); sprintf(calcsumStr, "%04X", calc_checksum(fileName, folder));
print_Msg(calcsumStr);
if (strcmp(calcsumStr, checksumStr) == 0) { if (strcmp(calcsumStr, checksumStr) == 0) {
println_Msg(F("OK")); println_Msg(F(" -> OK"));
//println_Msg(calcsumStr);
display_Update(); display_Update();
return 1; return 1;
} }
else { else {
print_Msg(F("Error ")); print_Msg(F(" != "));
print_Msg(calcsumStr); println_Msg(checksumStr);
print_Error(F(" "), false); print_Error(F("Invalid Checksum"), false);
display_Update(); display_Update();
return 0; return 0;
} }