Code optimization, cleanup, and stylization

* Reduced PROGMEM / DRAM usage slightly (Using defaults w/HW5: Before -> 214,668 bytes / 5,757 bytes; After -> 213,414 bytes / 5,751 bytes)
  * Optimized some menu options and calls
  * Added more string constants and implemented them where found.
* Fixed some stylization
  * Constants should always be uppercase.
  * Features should use the `ENABLE_<feature name>` format.
  * Options for features should use the `OPTION_<feature name>_<option name>` format.
  * Added ENUMs for more clarity and better type checking.
  * Moved some defines over to `constexpr` and `const` types. These are preferred over preprocessor constants when not intended for use with `#if` and other preprocessor language.
This commit is contained in:
Ancyker 2024-03-02 11:26:35 -05:00
parent 3468703a51
commit e61ac414d8
41 changed files with 1860 additions and 2211 deletions

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// ATARI 2600 MODULE // ATARI 2600 MODULE
//****************************************** //******************************************
#if defined(enable_2600) #if defined(ENABLE_2600)
// Atari 2600 // Atari 2600
// Cartridge Pinout // Cartridge Pinout
// 24P 2.54mm pitch connector // 24P 2.54mm pitch connector
@ -56,10 +56,8 @@ byte e7size;
// Menu // Menu
//****************************************** //******************************************
// Base Menu // Base Menu
static const char a2600MenuItem1[] PROGMEM = "Select Cart";
static const char a2600MenuItem2[] PROGMEM = "Read ROM";
static const char a2600MenuItem3[] PROGMEM = "Set Mapper"; static const char a2600MenuItem3[] PROGMEM = "Set Mapper";
static const char* const menuOptions2600[] PROGMEM = { a2600MenuItem1, a2600MenuItem2, a2600MenuItem3, string_reset2 }; static const char* const menuOptions2600[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, a2600MenuItem3, FSTRING_RESET };
void setup_2600() { void setup_2600() {
// Request 5V // Request 5V
@ -99,7 +97,7 @@ void setup_2600() {
checkStatus_2600(); checkStatus_2600();
strcpy(romName, "ATARI"); strcpy(romName, "ATARI");
mode = mode_2600; mode = CORE_2600;
} }
void a2600Menu() { void a2600Menu() {
@ -565,7 +563,7 @@ void readROM_2600() {
} }
calcCRC(fileName, crcsize, NULL, 0); calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
@ -583,11 +581,11 @@ void checkStatus_2600() {
EEPROM_writeAnything(8, a2600size); EEPROM_writeAnything(8, a2600size);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("ATARI 2600 READER")); println_Msg(F("ATARI 2600 READER"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: ")); print_Msg(F("MAPPER: "));
if (a2600mapper == 0x20) if (a2600mapper == 0x20)
println_Msg(F("2K")); println_Msg(F("2K"));
@ -633,7 +631,7 @@ void checkStatus_2600() {
else else
Serial.print(a2600[a2600size]); Serial.print(a2600[a2600size]);
Serial.println(F("K")); Serial.println(F("K"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
@ -642,21 +640,21 @@ void checkStatus_2600() {
//****************************************** //******************************************
void setMapper_2600() { void setMapper_2600() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
int b = 0; uint8_t b = 0;
int i = 0; int i = 0;
// Check Button Status // Check Button Status
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Pressed if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List while (1) { // Scroll Mapper List
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -712,11 +710,11 @@ void setMapper_2600() {
println_Msg(F("TP")); println_Msg(F("TP"));
else else
println_Msg(a2600mapselect, HEX); println_Msg(a2600mapselect, HEX);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -749,11 +747,11 @@ void setMapper_2600() {
println_Msg(F("TP")); println_Msg(F("TP"));
else else
println_Msg(a2600mapselect, HEX); println_Msg(a2600mapselect, HEX);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -784,11 +782,11 @@ void setMapper_2600() {
println_Msg(F("TP")); println_Msg(F("TP"));
else else
println_Msg(a2600mapselect, HEX); println_Msg(a2600mapselect, HEX);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -900,7 +898,7 @@ bool readVals_ATARI(char* a2600game, char* a2600mm, char* a2600ll) {
bool getCartListInfo_2600() { bool getCartListInfo_2600() {
bool buttonreleased = 0; bool buttonreleased = 0;
bool cartselected = 0; bool cartselected = 0;
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F(" HOLD TO FAST CYCLE")); println_Msg(F(" HOLD TO FAST CYCLE"));
display_Update(); display_Update();
@ -908,9 +906,9 @@ bool getCartListInfo_2600() {
Serial.println(F("HOLD BUTTON TO FAST CYCLE")); Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
#endif #endif
delay(2000); delay(2000);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Held - Fast Cycle if (buttonVal1 == LOW) { // Button Held - Fast Cycle
@ -919,19 +917,19 @@ bool getCartListInfo_2600() {
if (strcmp(a2600csvEND, a2600game) == 0) { if (strcmp(a2600csvEND, a2600game) == 0) {
a2600csvFile.seek(0); // Restart a2600csvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(a2600game); println_Msg(a2600game);
display_Update(); display_Update();
#else #else
Serial.print(F("CART TITLE:")); Serial.print(F("CART TITLE:"));
Serial.println(a2600game); Serial.println(a2600game);
#endif #endif
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -944,41 +942,41 @@ bool getCartListInfo_2600() {
} }
} }
} }
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) // Button Released if (buttonVal1 == HIGH) // Button Released
break; break;
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("FAST CYCLE OFF")); println_Msg(F("FAST CYCLE OFF"));
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("FAST CYCLE OFF")); Serial.println(F("FAST CYCLE OFF"));
Serial.println(F("PRESS BUTTON TO STEP FORWARD")); Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
Serial.println(F("DOUBLE CLICK TO STEP BACK")); Serial.println(F("DOUBLE CLICK TO STEP BACK"));
Serial.println(F("HOLD TO SELECT")); Serial.println(F("HOLD TO SELECT"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
while (readVals_ATARI(a2600game, a2600mm, a2600ll)) { while (readVals_ATARI(a2600game, a2600mm, a2600ll)) {
if (strcmp(a2600csvEND, a2600game) == 0) { if (strcmp(a2600csvEND, a2600game) == 0) {
a2600csvFile.seek(0); // Restart a2600csvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(a2600game); println_Msg(a2600game);
display.setCursor(0, 48); display.setCursor(0, 48);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -988,7 +986,7 @@ bool getCartListInfo_2600() {
Serial.println(a2600game); Serial.println(a2600game);
#endif #endif
while (1) { // Single Step while (1) { // Single Step
int b = checkButton(); uint8_t b = checkButton();
if (b == 1) { // Continue (press) if (b == 1) { // Continue (press)
break; break;
} }
@ -1002,7 +1000,7 @@ bool getCartListInfo_2600() {
new2600mapper = strtol(a2600mm, NULL, 10); new2600mapper = strtol(a2600mm, NULL, 10);
EEPROM_writeAnything(7, new2600mapper); EEPROM_writeAnything(7, new2600mapper);
cartselected = 1; // SELECTION MADE cartselected = 1; // SELECTION MADE
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("SELECTION MADE")); println_Msg(F("SELECTION MADE"));
display_Update(); display_Update();
#else #else
@ -1017,8 +1015,8 @@ bool getCartListInfo_2600() {
} }
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE")); println_Msg(F("END OF FILE"));
display_Update(); display_Update();
#else #else
@ -1030,10 +1028,10 @@ bool getCartListInfo_2600() {
void checkCSV_2600() { void checkCSV_2600() {
if (getCartListInfo_2600()) { if (getCartListInfo_2600()) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART SELECTED")); println_Msg(F("CART SELECTED"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(a2600game); println_Msg(a2600game);
display_Update(); display_Update();
// Display Settings // Display Settings
@ -1042,16 +1040,16 @@ void checkCSV_2600() {
println_Msg(new2600mapper, HEX); println_Msg(new2600mapper, HEX);
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("CART SELECTED")); Serial.println(F("CART SELECTED"));
Serial.println(a2600game); Serial.println(a2600game);
// Display Settings // Display Settings
Serial.print(F("CODE: ")); Serial.print(F("CODE: "));
Serial.println(new2600mapper, HEX); Serial.println(new2600mapper, HEX);
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("NO SELECTION")); println_Msg(F("NO SELECTION"));
display_Update(); display_Update();
@ -1074,7 +1072,7 @@ void checkSize_2600() {
} }
void setCart_2600() { void setCart_2600() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(a2600cartCSV); println_Msg(a2600cartCSV);
display_Update(); display_Update();
@ -1084,7 +1082,7 @@ void setCart_2600() {
sd.chdir(folder); // Switch Folder sd.chdir(folder); // Switch Folder
a2600csvFile = sd.open(a2600cartCSV, O_READ); a2600csvFile = sd.open(a2600cartCSV, O_READ);
if (!a2600csvFile) { if (!a2600csvFile) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CSV FILE NOT FOUND!")); println_Msg(F("CSV FILE NOT FOUND!"));
display_Update(); display_Update();

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// ATARI 5200 MODULE // ATARI 5200 MODULE
//****************************************** //******************************************
#ifdef enable_5200 #ifdef ENABLE_5200
// Atari 5200 // Atari 5200
// Cartridge Pinout // Cartridge Pinout
// 36P 2.54mm pitch connector // 36P 2.54mm pitch connector
@ -85,10 +85,7 @@ byte new5200size;
// Menu // Menu
//****************************************** //******************************************
// Base Menu // Base Menu
static const char a5200MenuItem1[] PROGMEM = "Select Cart"; static const char* const menuOptions5200[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
static const char a5200MenuItem2[] PROGMEM = "Read ROM";
static const char a5200MenuItem3[] PROGMEM = "Set Mapper + Size";
static const char* const menuOptions5200[] PROGMEM = { a5200MenuItem1, a5200MenuItem2, a5200MenuItem3, string_reset2 };
void setup_5200() { void setup_5200() {
// Request 5V // Request 5V
@ -128,7 +125,7 @@ void setup_5200() {
checkStatus_5200(); checkStatus_5200();
strcpy(romName, "ATARI"); strcpy(romName, "ATARI");
mode = mode_5200; mode = CORE_5200;
} }
void a5200Menu() { void a5200Menu() {
@ -334,7 +331,7 @@ void readROM_5200() {
unsigned long crcsize = a5200[a5200size] * 0x400; unsigned long crcsize = a5200[a5200size] * 0x400;
calcCRC(fileName, crcsize, NULL, 0); calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -358,22 +355,22 @@ void checkMapperSize_5200() {
} }
void setROMSize_5200() { void setROMSize_5200() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (a5200lo == a5200hi) if (a5200lo == a5200hi)
new5200size = a5200lo; new5200size = a5200lo;
else { else {
int b = 0; uint8_t b = 0;
int i = a5200lo; int i = a5200lo;
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(a5200[i]); println_Msg(a5200[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -391,11 +388,11 @@ void setROMSize_5200() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(a5200[i]); println_Msg(a5200[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -411,11 +408,11 @@ void setROMSize_5200() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(a5200[i]); println_Msg(a5200[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -453,7 +450,7 @@ setrom:
new5200size = sizeROM.toInt() + a5200lo; new5200size = sizeROM.toInt() + a5200lo;
if (new5200size > a5200hi) { if (new5200size > a5200hi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
@ -477,11 +474,11 @@ void checkStatus_5200() {
EEPROM_writeAnything(8, a5200size); EEPROM_writeAnything(8, a5200size);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("ATARI 5200 READER")); println_Msg(F("ATARI 5200 READER"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: ")); print_Msg(F("MAPPER: "));
println_Msg(a5200mapper); println_Msg(a5200mapper);
if (a5200mapper == 0) if (a5200mapper == 0)
@ -507,7 +504,7 @@ void checkStatus_5200() {
Serial.print(F("ROM SIZE: ")); Serial.print(F("ROM SIZE: "));
Serial.print(a5200[a5200size]); Serial.print(a5200[a5200size]);
Serial.println(F("K")); Serial.println(F("K"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
@ -516,20 +513,20 @@ void checkStatus_5200() {
//****************************************** //******************************************
void setMapper_5200() { void setMapper_5200() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
int b = 0; uint8_t b = 0;
int i = 0; int i = 0;
// Check Button Status // Check Button Status
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Pressed if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List while (1) { // Scroll Mapper List
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -571,11 +568,11 @@ void setMapper_5200() {
println_Msg(F("TWO CHIP")); println_Msg(F("TWO CHIP"));
else if (a5200mapselect == 2) else if (a5200mapselect == 2)
println_Msg(F("BOUNTY BOB")); println_Msg(F("BOUNTY BOB"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -601,11 +598,11 @@ void setMapper_5200() {
println_Msg(F("TWO CHIP")); println_Msg(F("TWO CHIP"));
else if (a5200mapselect == 2) else if (a5200mapselect == 2)
println_Msg(F("BOUNTY BOB")); println_Msg(F("BOUNTY BOB"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -629,11 +626,11 @@ void setMapper_5200() {
println_Msg(F("TWO CHIP")); println_Msg(F("TWO CHIP"));
else if (a5200mapselect == 2) else if (a5200mapselect == 2)
println_Msg(F("BOUNTY BOB")); println_Msg(F("BOUNTY BOB"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -721,7 +718,7 @@ bool readVals_5200(char* a5200game, char* a5200mm, char* a5200rr, char* a5200ll)
bool getCartListInfo_5200() { bool getCartListInfo_5200() {
bool buttonreleased = 0; bool buttonreleased = 0;
bool cartselected = 0; bool cartselected = 0;
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F(" HOLD TO FAST CYCLE")); println_Msg(F(" HOLD TO FAST CYCLE"));
display_Update(); display_Update();
@ -729,9 +726,9 @@ bool getCartListInfo_5200() {
Serial.println(F("HOLD BUTTON TO FAST CYCLE")); Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
#endif #endif
delay(2000); delay(2000);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Held - Fast Cycle if (buttonVal1 == LOW) { // Button Held - Fast Cycle
@ -740,19 +737,19 @@ bool getCartListInfo_5200() {
if (strcmp(a5200csvEND, a5200game) == 0) { if (strcmp(a5200csvEND, a5200game) == 0) {
a5200csvFile.seek(0); // Restart a5200csvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(a5200game); println_Msg(a5200game);
display_Update(); display_Update();
#else #else
Serial.print(F("CART TITLE:")); Serial.print(F("CART TITLE:"));
Serial.println(a5200game); Serial.println(a5200game);
#endif #endif
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -765,41 +762,41 @@ bool getCartListInfo_5200() {
} }
} }
} }
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) // Button Released if (buttonVal1 == HIGH) // Button Released
break; break;
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("FAST CYCLE OFF")); println_Msg(F("FAST CYCLE OFF"));
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("FAST CYCLE OFF")); Serial.println(F("FAST CYCLE OFF"));
Serial.println(F("PRESS BUTTON TO STEP FORWARD")); Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
Serial.println(F("DOUBLE CLICK TO STEP BACK")); Serial.println(F("DOUBLE CLICK TO STEP BACK"));
Serial.println(F("HOLD TO SELECT")); Serial.println(F("HOLD TO SELECT"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
while (readVals_5200(a5200game, a5200mm, a5200rr, a5200ll)) { while (readVals_5200(a5200game, a5200mm, a5200rr, a5200ll)) {
if (strcmp(a5200csvEND, a5200game) == 0) { if (strcmp(a5200csvEND, a5200game) == 0) {
a5200csvFile.seek(0); // Restart a5200csvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(a5200game); println_Msg(a5200game);
display.setCursor(0, 48); display.setCursor(0, 48);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -809,7 +806,7 @@ bool getCartListInfo_5200() {
Serial.println(a5200game); Serial.println(a5200game);
#endif #endif
while (1) { // Single Step while (1) { // Single Step
int b = checkButton(); uint8_t b = checkButton();
if (b == 1) { // Continue (press) if (b == 1) { // Continue (press)
break; break;
} }
@ -825,7 +822,7 @@ bool getCartListInfo_5200() {
EEPROM_writeAnything(7, new5200mapper); EEPROM_writeAnything(7, new5200mapper);
EEPROM_writeAnything(8, new5200size); EEPROM_writeAnything(8, new5200size);
cartselected = 1; // SELECTION MADE cartselected = 1; // SELECTION MADE
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("SELECTION MADE")); println_Msg(F("SELECTION MADE"));
display_Update(); display_Update();
#else #else
@ -840,8 +837,8 @@ bool getCartListInfo_5200() {
} }
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE")); println_Msg(F("END OF FILE"));
display_Update(); display_Update();
#else #else
@ -853,10 +850,10 @@ bool getCartListInfo_5200() {
void checkCSV_5200() { void checkCSV_5200() {
if (getCartListInfo_5200()) { if (getCartListInfo_5200()) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART SELECTED")); println_Msg(F("CART SELECTED"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(a5200game); println_Msg(a5200game);
display_Update(); display_Update();
// Display Settings // Display Settings
@ -867,7 +864,7 @@ void checkCSV_5200() {
println_Msg(new5200size); println_Msg(new5200size);
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("CART SELECTED")); Serial.println(F("CART SELECTED"));
Serial.println(a5200game); Serial.println(a5200game);
// Display Settings // Display Settings
@ -875,10 +872,10 @@ void checkCSV_5200() {
Serial.print(new5200mapper); Serial.print(new5200mapper);
Serial.print(F("/R")); Serial.print(F("/R"));
Serial.println(new5200size); Serial.println(new5200size);
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("NO SELECTION")); println_Msg(F("NO SELECTION"));
display_Update(); display_Update();
@ -901,7 +898,7 @@ void checkSize_5200() {
} }
void setCart_5200() { void setCart_5200() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(a5200cartCSV); println_Msg(a5200cartCSV);
display_Update(); display_Update();
@ -911,7 +908,7 @@ void setCart_5200() {
sd.chdir(folder); // Switch Folder sd.chdir(folder); // Switch Folder
a5200csvFile = sd.open(a5200cartCSV, O_READ); a5200csvFile = sd.open(a5200cartCSV, O_READ);
if (!a5200csvFile) { if (!a5200csvFile) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CSV FILE NOT FOUND!")); println_Msg(F("CSV FILE NOT FOUND!"));
display_Update(); display_Update();

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// ATARI 7800 MODULE // ATARI 7800 MODULE
//****************************************** //******************************************
#ifdef enable_7800 #ifdef ENABLE_7800
// Atari 7800 // Atari 7800
// Cartridge Pinout // Cartridge Pinout
// 32P 2.54mm pitch (USE 36P CONNECTOR) // 32P 2.54mm pitch (USE 36P CONNECTOR)
@ -80,10 +80,7 @@ byte new7800size;
// Menu // Menu
//****************************************** //******************************************
// Base Menu // Base Menu
static const char a7800MenuItem1[] PROGMEM = "Select Cart"; static const char* const menuOptions7800[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
static const char a7800MenuItem2[] PROGMEM = "Read ROM";
static const char a7800MenuItem3[] PROGMEM = "Set Mapper + Size";
static const char* const menuOptions7800[] PROGMEM = { a7800MenuItem1, a7800MenuItem2, a7800MenuItem3, string_reset2 };
void setup_7800() { void setup_7800() {
// Request 5V // Request 5V
@ -120,7 +117,7 @@ void setup_7800() {
PORTL = 0xFF; // A16-A23 PORTL = 0xFF; // A16-A23
PORTJ |= (1 << 0); // TIME(PJ0) PORTJ |= (1 << 0); // TIME(PJ0)
#ifdef clockgen_installed #ifdef ENABLE_CLOCKGEN
// Adafruit Clock Generator // Adafruit Clock Generator
initializeClockOffset(); initializeClockOffset();
@ -149,7 +146,7 @@ void setup_7800() {
checkStatus_7800(); checkStatus_7800();
strcpy(romName, "ATARI"); strcpy(romName, "ATARI");
mode = mode_7800; mode = CORE_7800;
} }
void a7800Menu() { void a7800Menu() {
@ -401,7 +398,7 @@ void readROM_7800() {
unsigned long crcsize = a7800[a7800size] * 0x400; unsigned long crcsize = a7800[a7800size] * 0x400;
calcCRC(fileName, crcsize, NULL, 0); calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -425,22 +422,22 @@ void checkMapperSize_7800() {
} }
void setROMSize_7800() { void setROMSize_7800() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (a7800lo == a7800hi) if (a7800lo == a7800hi)
new7800size = a7800lo; new7800size = a7800lo;
else { else {
int b = 0; uint8_t b = 0;
int i = a7800lo; int i = a7800lo;
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(a7800[i]); println_Msg(a7800[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -457,11 +454,11 @@ void setROMSize_7800() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(a7800[i]); println_Msg(a7800[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -476,11 +473,11 @@ void setROMSize_7800() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(a7800[i]); println_Msg(a7800[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -518,7 +515,7 @@ setrom:
new7800size = sizeROM.toInt() + a7800lo; new7800size = sizeROM.toInt() + a7800lo;
if (new7800size > a7800hi) { if (new7800size > a7800hi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
@ -542,11 +539,11 @@ void checkStatus_7800() {
EEPROM_writeAnything(8, a7800size); EEPROM_writeAnything(8, a7800size);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("ATARI 7800 READER")); println_Msg(F("ATARI 7800 READER"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: ")); print_Msg(F("MAPPER: "));
println_Msg(a7800mapper); println_Msg(a7800mapper);
if (a7800mapper == 0) if (a7800mapper == 0)
@ -588,7 +585,7 @@ void checkStatus_7800() {
Serial.print(F("ROM SIZE: ")); Serial.print(F("ROM SIZE: "));
Serial.print(A7800[a7800size]); Serial.print(A7800[a7800size]);
Serial.println(F("K")); Serial.println(F("K"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
@ -597,20 +594,20 @@ void checkStatus_7800() {
//****************************************** //******************************************
void setMapper_7800() { void setMapper_7800() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
int b = 0; uint8_t b = 0;
int i = 0; int i = 0;
// Check Button Status // Check Button Status
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Pressed if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List while (1) { // Scroll Mapper List
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -668,11 +665,11 @@ void setMapper_7800() {
println_Msg(F("BASEBALL/ETC [78S4]")); println_Msg(F("BASEBALL/ETC [78S4]"));
else if (a7800mapselect == 6) else if (a7800mapselect == 6)
println_Msg(F("KARATEKA(PAL) [78S4]")); println_Msg(F("KARATEKA(PAL) [78S4]"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -705,11 +702,11 @@ void setMapper_7800() {
println_Msg(F("BASEBALL/ETC [78S4]")); println_Msg(F("BASEBALL/ETC [78S4]"));
else if (a7800mapselect == 6) else if (a7800mapselect == 6)
println_Msg(F("KARATEKA(PAL) [78S4]")); println_Msg(F("KARATEKA(PAL) [78S4]"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -741,11 +738,11 @@ void setMapper_7800() {
println_Msg(F("BASEBALL/ETC [78S4]")); println_Msg(F("BASEBALL/ETC [78S4]"));
else if (a7800mapselect == 6) else if (a7800mapselect == 6)
println_Msg(F("KARATEKA(PAL) [78S4]")); println_Msg(F("KARATEKA(PAL) [78S4]"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -839,7 +836,7 @@ bool readVals_7800(char* a7800game, char* a7800mm, char* a7800rr, char* a7800ll)
bool getCartListInfo_7800() { bool getCartListInfo_7800() {
bool buttonreleased = 0; bool buttonreleased = 0;
bool cartselected = 0; bool cartselected = 0;
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F(" HOLD TO FAST CYCLE")); println_Msg(F(" HOLD TO FAST CYCLE"));
display_Update(); display_Update();
@ -847,9 +844,9 @@ bool getCartListInfo_7800() {
Serial.println(F("HOLD BUTTON TO FAST CYCLE")); Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
#endif #endif
delay(2000); delay(2000);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Held - Fast Cycle if (buttonVal1 == LOW) { // Button Held - Fast Cycle
@ -858,19 +855,19 @@ bool getCartListInfo_7800() {
if (strcmp(a7800csvEND, a7800game) == 0) { if (strcmp(a7800csvEND, a7800game) == 0) {
a7800csvFile.seek(0); // Restart a7800csvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(a7800game); println_Msg(a7800game);
display_Update(); display_Update();
#else #else
Serial.print(F("CART TITLE:")); Serial.print(F("CART TITLE:"));
Serial.println(a7800game); Serial.println(a7800game);
#endif #endif
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -883,41 +880,41 @@ bool getCartListInfo_7800() {
} }
} }
} }
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) // Button Released if (buttonVal1 == HIGH) // Button Released
break; break;
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("FAST CYCLE OFF")); println_Msg(F("FAST CYCLE OFF"));
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("FAST CYCLE OFF")); Serial.println(F("FAST CYCLE OFF"));
Serial.println(F("PRESS BUTTON TO STEP FORWARD")); Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
Serial.println(F("DOUBLE CLICK TO STEP BACK")); Serial.println(F("DOUBLE CLICK TO STEP BACK"));
Serial.println(F("HOLD TO SELECT")); Serial.println(F("HOLD TO SELECT"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
while (readVals_7800(a7800game, a7800mm, a7800rr, a7800ll)) { while (readVals_7800(a7800game, a7800mm, a7800rr, a7800ll)) {
if (strcmp(a7800csvEND, a7800game) == 0) { if (strcmp(a7800csvEND, a7800game) == 0) {
a7800csvFile.seek(0); // Restart a7800csvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(a7800game); println_Msg(a7800game);
display.setCursor(0, 48); display.setCursor(0, 48);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -927,7 +924,7 @@ bool getCartListInfo_7800() {
Serial.println(a7800game); Serial.println(a7800game);
#endif #endif
while (1) { // Single Step while (1) { // Single Step
int b = checkButton(); uint8_t b = checkButton();
if (b == 1) { // Continue (press) if (b == 1) { // Continue (press)
break; break;
} }
@ -943,7 +940,7 @@ bool getCartListInfo_7800() {
EEPROM_writeAnything(7, new7800mapper); EEPROM_writeAnything(7, new7800mapper);
EEPROM_writeAnything(8, new7800size); EEPROM_writeAnything(8, new7800size);
cartselected = 1; // SELECTION MADE cartselected = 1; // SELECTION MADE
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("SELECTION MADE")); println_Msg(F("SELECTION MADE"));
display_Update(); display_Update();
#else #else
@ -958,8 +955,8 @@ bool getCartListInfo_7800() {
} }
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE")); println_Msg(F("END OF FILE"));
display_Update(); display_Update();
#else #else
@ -971,10 +968,10 @@ bool getCartListInfo_7800() {
void checkCSV_7800() { void checkCSV_7800() {
if (getCartListInfo_7800()) { if (getCartListInfo_7800()) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART SELECTED")); println_Msg(F("CART SELECTED"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(a7800game); println_Msg(a7800game);
display_Update(); display_Update();
// Display Settings // Display Settings
@ -985,7 +982,7 @@ void checkCSV_7800() {
println_Msg(new7800size); println_Msg(new7800size);
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("CART SELECTED")); Serial.println(F("CART SELECTED"));
Serial.println(a7800game); Serial.println(a7800game);
// Display Settings // Display Settings
@ -993,10 +990,10 @@ void checkCSV_7800() {
Serial.print(new7800mapper); Serial.print(new7800mapper);
Serial.print(F("/R")); Serial.print(F("/R"));
Serial.println(new7800size); Serial.println(new7800size);
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("NO SELECTION")); println_Msg(F("NO SELECTION"));
display_Update(); display_Update();
@ -1019,7 +1016,7 @@ void checkSize_7800() {
} }
void setCart_7800() { void setCart_7800() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(a7800cartCSV); println_Msg(a7800cartCSV);
display_Update(); display_Update();
@ -1029,7 +1026,7 @@ void setCart_7800() {
sd.chdir(folder); // Switch Folder sd.chdir(folder); // Switch Folder
a7800csvFile = sd.open(a7800cartCSV, O_READ); a7800csvFile = sd.open(a7800cartCSV, O_READ);
if (!a7800csvFile) { if (!a7800csvFile) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CSV FILE NOT FOUND!")); println_Msg(F("CSV FILE NOT FOUND!"));
display_Update(); display_Update();

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// EMERSON ARCADIA 2001 MODULE // EMERSON ARCADIA 2001 MODULE
//****************************************** //******************************************
#if defined(enable_ARC) #if defined(ENABLE_ARC)
// Emerson Arcadia 2001 // Emerson Arcadia 2001
// Cartridge Pinout // Cartridge Pinout
// 30P 2.54mm pitch connector // 30P 2.54mm pitch connector
@ -49,11 +49,7 @@ byte newarcsize;
// Menu // Menu
//****************************************** //******************************************
// Base Menu // Base Menu
static const char arcMenuItem1[] PROGMEM = "Select Cart"; static const char* const menuOptionsARC[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
static const char arcMenuItem2[] PROGMEM = "Read ROM";
static const char arcMenuItem3[] PROGMEM = "Set Size";
static const char arcMenuItem4[] PROGMEM = "Reset";
static const char* const menuOptionsARC[] PROGMEM = { arcMenuItem1, arcMenuItem2, arcMenuItem3, arcMenuItem4 };
void setup_ARC() { void setup_ARC() {
// Request 5V // Request 5V
@ -93,7 +89,7 @@ void setup_ARC() {
checkStatus_ARC(); checkStatus_ARC();
strcpy(romName, "ARCADIA"); strcpy(romName, "ARCADIA");
mode = mode_ARC; mode = CORE_ARC;
} }
void arcMenu() { void arcMenu() {
@ -194,7 +190,7 @@ void readROM_ARC() {
unsigned long crcsize = ARC[arcsize] * 0x400; unsigned long crcsize = ARC[arcsize] * 0x400;
calcCRC(fileName, crcsize, NULL, 0); calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
@ -205,22 +201,22 @@ void readROM_ARC() {
//****************************************** //******************************************
void setROMSize_ARC() { void setROMSize_ARC() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (arclo == archi) if (arclo == archi)
newarcsize = arclo; newarcsize = arclo;
else { else {
int b = 0; uint8_t b = 0;
int i = arclo; int i = arclo;
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(ARC[i]); println_Msg(ARC[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -238,11 +234,11 @@ void setROMSize_ARC() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(ARC[i]); println_Msg(ARC[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -258,11 +254,11 @@ void setROMSize_ARC() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(ARC[i]); println_Msg(ARC[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -300,7 +296,7 @@ setrom:
newarcsize = sizeROM.toInt() + arclo; newarcsize = sizeROM.toInt() + arclo;
if (newarcsize > archi) { if (newarcsize > archi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
@ -319,11 +315,11 @@ void checkStatus_ARC() {
EEPROM_writeAnything(8, arcsize); EEPROM_writeAnything(8, arcsize);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("ARCADIA 2001 READER")); println_Msg(F("ARCADIA 2001 READER"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: ")); print_Msg(F("ROM SIZE: "));
print_Msg(ARC[arcsize]); print_Msg(ARC[arcsize]);
println_Msg(F("K")); println_Msg(F("K"));
@ -333,7 +329,7 @@ void checkStatus_ARC() {
Serial.print(F("CURRENT ROM SIZE: ")); Serial.print(F("CURRENT ROM SIZE: "));
Serial.print(ARC[arcsize]); Serial.print(ARC[arcsize]);
Serial.println(F("K")); Serial.println(F("K"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
@ -386,7 +382,7 @@ bool readVals_ARC(char* arcgame, char* arcrr, char* arcll) {
bool getCartListInfo_ARC() { bool getCartListInfo_ARC() {
bool buttonreleased = 0; bool buttonreleased = 0;
bool cartselected = 0; bool cartselected = 0;
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F(" HOLD TO FAST CYCLE")); println_Msg(F(" HOLD TO FAST CYCLE"));
display_Update(); display_Update();
@ -394,9 +390,9 @@ bool getCartListInfo_ARC() {
Serial.println(F("HOLD BUTTON TO FAST CYCLE")); Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
#endif #endif
delay(2000); delay(2000);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Held - Fast Cycle if (buttonVal1 == LOW) { // Button Held - Fast Cycle
@ -405,19 +401,19 @@ bool getCartListInfo_ARC() {
if (strcmp(arccsvEND, arcgame) == 0) { if (strcmp(arccsvEND, arcgame) == 0) {
arccsvFile.seek(0); // Restart arccsvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(arcgame); println_Msg(arcgame);
display_Update(); display_Update();
#else #else
Serial.print(F("CART TITLE:")); Serial.print(F("CART TITLE:"));
Serial.println(arcgame); Serial.println(arcgame);
#endif #endif
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -430,41 +426,41 @@ bool getCartListInfo_ARC() {
} }
} }
} }
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) // Button Released if (buttonVal1 == HIGH) // Button Released
break; break;
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("FAST CYCLE OFF")); println_Msg(F("FAST CYCLE OFF"));
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("FAST CYCLE OFF")); Serial.println(F("FAST CYCLE OFF"));
Serial.println(F("PRESS BUTTON TO STEP FORWARD")); Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
Serial.println(F("DOUBLE CLICK TO STEP BACK")); Serial.println(F("DOUBLE CLICK TO STEP BACK"));
Serial.println(F("HOLD TO SELECT")); Serial.println(F("HOLD TO SELECT"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
while (readVals_ARC(arcgame, arcrr, arcll)) { while (readVals_ARC(arcgame, arcrr, arcll)) {
if (strcmp(arccsvEND, arcgame) == 0) { if (strcmp(arccsvEND, arcgame) == 0) {
arccsvFile.seek(0); // Restart arccsvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(arcgame); println_Msg(arcgame);
display.setCursor(0, 48); display.setCursor(0, 48);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -474,7 +470,7 @@ bool getCartListInfo_ARC() {
Serial.println(arcgame); Serial.println(arcgame);
#endif #endif
while (1) { // Single Step while (1) { // Single Step
int b = checkButton(); uint8_t b = checkButton();
if (b == 1) { // Continue (press) if (b == 1) { // Continue (press)
break; break;
} }
@ -488,7 +484,7 @@ bool getCartListInfo_ARC() {
newarcsize = strtol(arcrr, NULL, 10); newarcsize = strtol(arcrr, NULL, 10);
EEPROM_writeAnything(8, newarcsize); EEPROM_writeAnything(8, newarcsize);
cartselected = 1; // SELECTION MADE cartselected = 1; // SELECTION MADE
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("SELECTION MADE")); println_Msg(F("SELECTION MADE"));
display_Update(); display_Update();
#else #else
@ -503,8 +499,8 @@ bool getCartListInfo_ARC() {
} }
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE")); println_Msg(F("END OF FILE"));
display_Update(); display_Update();
#else #else
@ -516,10 +512,10 @@ bool getCartListInfo_ARC() {
void checkCSV_ARC() { void checkCSV_ARC() {
if (getCartListInfo_ARC()) { if (getCartListInfo_ARC()) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART SELECTED")); println_Msg(F("CART SELECTED"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(arcgame); println_Msg(arcgame);
display_Update(); display_Update();
// Display Settings // Display Settings
@ -528,16 +524,16 @@ void checkCSV_ARC() {
println_Msg(newarcsize); println_Msg(newarcsize);
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("CART SELECTED")); Serial.println(F("CART SELECTED"));
Serial.println(arcgame); Serial.println(arcgame);
// Display Settings // Display Settings
Serial.print(F("CODE: R")); Serial.print(F("CODE: R"));
Serial.println(newarcsize); Serial.println(newarcsize);
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("NO SELECTION")); println_Msg(F("NO SELECTION"));
display_Update(); display_Update();
@ -548,7 +544,7 @@ void checkCSV_ARC() {
} }
void setCart_ARC() { void setCart_ARC() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(arccartCSV); println_Msg(arccartCSV);
display_Update(); display_Update();
@ -558,7 +554,7 @@ void setCart_ARC() {
sd.chdir(folder); // Switch Folder sd.chdir(folder); // Switch Folder
arccsvFile = sd.open(arccartCSV, O_READ); arccsvFile = sd.open(arccartCSV, O_READ);
if (!arccsvFile) { if (!arccsvFile) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CSV FILE NOT FOUND!")); println_Msg(F("CSV FILE NOT FOUND!"));
display_Update(); display_Update();

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// COMMODORE 64 MODULE // COMMODORE 64 MODULE
//****************************************** //******************************************
#ifdef enable_C64 #ifdef ENABLE_C64
// Commodore 64 // Commodore 64
// Cartridge Pinout // Cartridge Pinout
// 44P 2.54mm pitch connector // 44P 2.54mm pitch connector
@ -126,10 +126,7 @@ byte newc64port;
// MENU // MENU
//****************************************** //******************************************
// Base Menu // Base Menu
static const char c64MenuItem1[] PROGMEM = "Select Cart"; static const char* const menuOptionsC64[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
static const char c64MenuItem2[] PROGMEM = "Read ROM";
static const char c64MenuItem3[] PROGMEM = "Set Mapper + Size";
static const char* const menuOptionsC64[] PROGMEM = { c64MenuItem1, c64MenuItem2, c64MenuItem3, string_reset2 };
void c64Menu() { void c64Menu() {
convertPgm(menuOptionsC64, 4); convertPgm(menuOptionsC64, 4);
@ -211,7 +208,7 @@ void setup_C64() {
checkStatus_C64(); checkStatus_C64();
strcpy(romName, "C64"); strcpy(romName, "C64");
mode = mode_C64; mode = CORE_C64;
} }
//****************************************** //******************************************
@ -709,7 +706,7 @@ void readROM_C64() {
unsigned long crcsize = C64[c64size] * 0x400; unsigned long crcsize = C64[c64size] * 0x400;
calcCRC(fileName, crcsize, NULL, 0); calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -720,20 +717,20 @@ void readROM_C64() {
// MAPPER CODE // MAPPER CODE
//****************************************** //******************************************
void setMapper_C64() { void setMapper_C64() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
int b = 0; uint8_t b = 0;
int i = 0; int i = 0;
// Check Button Status // Check Button Status
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Pressed if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List while (1) { // Scroll Mapper List
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -765,11 +762,11 @@ void setMapper_C64() {
c64mapselect = pgm_read_byte(c64mapsize + c64index); c64mapselect = pgm_read_byte(c64mapsize + c64index);
println_Msg(c64mapselect); println_Msg(c64mapselect);
printMapper_C64(c64mapselect); printMapper_C64(c64mapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -789,11 +786,11 @@ void setMapper_C64() {
c64mapselect = pgm_read_byte(c64mapsize + c64index); c64mapselect = pgm_read_byte(c64mapsize + c64index);
println_Msg(c64mapselect); println_Msg(c64mapselect);
printMapper_C64(c64mapselect); printMapper_C64(c64mapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -812,11 +809,11 @@ void setMapper_C64() {
c64mapselect = pgm_read_byte(c64mapsize + c64index); c64mapselect = pgm_read_byte(c64mapsize + c64index);
println_Msg(c64mapselect); println_Msg(c64mapselect);
printMapper_C64(c64mapselect); printMapper_C64(c64mapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -852,7 +849,7 @@ setmapper:
} }
if (c64mapfound == false) { if (c64mapfound == false) {
Serial.println(F("MAPPER NOT SUPPORTED!")); Serial.println(F("MAPPER NOT SUPPORTED!"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
newc64mapper = 0; newc64mapper = 0;
goto setmapper; goto setmapper;
} }
@ -877,22 +874,22 @@ void checkMapperSize_C64() {
// SET ROM SIZE // SET ROM SIZE
//****************************************** //******************************************
void setROMSize_C64() { void setROMSize_C64() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (c64lo == c64hi) if (c64lo == c64hi)
newc64size = c64lo; newc64size = c64lo;
else { else {
int b = 0; uint8_t b = 0;
int i = c64lo; int i = c64lo;
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(C64[i]); println_Msg(C64[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -909,11 +906,11 @@ void setROMSize_C64() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(C64[i]); println_Msg(C64[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -928,11 +925,11 @@ void setROMSize_C64() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(C64[i]); println_Msg(C64[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -970,7 +967,7 @@ setrom:
newc64size = sizeROM.toInt() + c64lo; newc64size = sizeROM.toInt() + c64lo;
if (newc64size > c64hi) { if (newc64size > c64hi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
@ -987,8 +984,8 @@ setrom:
//****************************************** //******************************************
void setPorts_C64() void setPorts_C64()
{ {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
int b = 0; uint8_t b = 0;
int i = 0; int i = 0;
display_Clear(); display_Clear();
@ -1006,7 +1003,7 @@ void setPorts_C64()
else if (i == 3) { else if (i == 3) {
println_Msg(F("EXROM HIGH/GAME HIGH")); println_Msg(F("EXROM HIGH/GAME HIGH"));
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Press to Change")); println_Msg(F("Press to Change"));
println_Msg(F("Hold to Select")); println_Msg(F("Hold to Select"));
display_Update(); display_Update();
@ -1034,7 +1031,7 @@ void setPorts_C64()
else if (i == 3) { else if (i == 3) {
println_Msg(F("EXROM HIGH/GAME HIGH")); println_Msg(F("EXROM HIGH/GAME HIGH"));
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Press to Change")); println_Msg(F("Press to Change"));
println_Msg(F("Hold to Select")); println_Msg(F("Hold to Select"));
display_Update(); display_Update();
@ -1061,7 +1058,7 @@ void setPorts_C64()
else if (i == 3) { else if (i == 3) {
println_Msg(F("EXROM HIGH/GAME HIGH")); println_Msg(F("EXROM HIGH/GAME HIGH"));
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Press to Change")); println_Msg(F("Press to Change"));
println_Msg(F("Hold to Select")); println_Msg(F("Hold to Select"));
display_Update(); display_Update();
@ -1092,7 +1089,7 @@ setrom:
newc64port = sizeROM.toInt(); newc64port = sizeROM.toInt();
if (newc64port > 3) { if (newc64port > 3) {
Serial.println(F("INVALID STATE")); Serial.println(F("INVALID STATE"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
Serial.print(F("Port State = ")); Serial.print(F("Port State = "));
@ -1122,11 +1119,11 @@ void checkStatus_C64() {
EEPROM_writeAnything(12, c64port); EEPROM_writeAnything(12, c64port);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("C64 READER")); println_Msg(F("C64 READER"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: ")); print_Msg(F("MAPPER: "));
println_Msg(c64mapper); println_Msg(c64mapper);
printMapper_C64(c64mapper); printMapper_C64(c64mapper);
@ -1145,12 +1142,12 @@ void checkStatus_C64() {
Serial.println(F("K")); Serial.println(F("K"));
Serial.print(F("CURRENT PORT STATE: ")); Serial.print(F("CURRENT PORT STATE: "));
Setial.println(c64port); Setial.println(c64port);
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
void printMapper_C64(byte c64maplabel) { void printMapper_C64(byte c64maplabel) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
switch (c64maplabel) { switch (c64maplabel) {
case 0: case 0:
println_Msg(F("NORMAL/ULTIMAX")); println_Msg(F("NORMAL/ULTIMAX"));
@ -1299,7 +1296,7 @@ bool readVals_C64(char* c64game, char* c64mm, char* c64rr, char* c64pp, char* c6
bool getCartListInfo_C64() { bool getCartListInfo_C64() {
bool buttonreleased = 0; bool buttonreleased = 0;
bool cartselected = 0; bool cartselected = 0;
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F(" HOLD TO FAST CYCLE")); println_Msg(F(" HOLD TO FAST CYCLE"));
display_Update(); display_Update();
@ -1307,9 +1304,9 @@ bool getCartListInfo_C64() {
Serial.println(F("HOLD BUTTON TO FAST CYCLE")); Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
#endif #endif
delay(2000); delay(2000);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Held - Fast Cycle if (buttonVal1 == LOW) { // Button Held - Fast Cycle
@ -1318,19 +1315,19 @@ bool getCartListInfo_C64() {
if (strcmp(c64csvEND, c64game) == 0) { if (strcmp(c64csvEND, c64game) == 0) {
c64csvFile.seek(0); // Restart c64csvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(c64game); println_Msg(c64game);
display_Update(); display_Update();
#else #else
Serial.print(F("CART TITLE:")); Serial.print(F("CART TITLE:"));
Serial.println(c64game); Serial.println(c64game);
#endif #endif
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -1343,41 +1340,41 @@ bool getCartListInfo_C64() {
} }
} }
} }
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) // Button Released if (buttonVal1 == HIGH) // Button Released
break; break;
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("FAST CYCLE OFF")); println_Msg(F("FAST CYCLE OFF"));
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("FAST CYCLE OFF")); Serial.println(F("FAST CYCLE OFF"));
Serial.println(F("PRESS BUTTON TO STEP FORWARD")); Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
Serial.println(F("DOUBLE CLICK TO STEP BACK")); Serial.println(F("DOUBLE CLICK TO STEP BACK"));
Serial.println(F("HOLD TO SELECT")); Serial.println(F("HOLD TO SELECT"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
while (readVals_C64(c64game, c64mm, c64rr, c64pp, c64ll)) { while (readVals_C64(c64game, c64mm, c64rr, c64pp, c64ll)) {
if (strcmp(c64csvEND, c64game) == 0) { if (strcmp(c64csvEND, c64game) == 0) {
c64csvFile.seek(0); // Restart c64csvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(c64game); println_Msg(c64game);
display.setCursor(0, 48); display.setCursor(0, 48);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1387,7 +1384,7 @@ bool getCartListInfo_C64() {
Serial.println(c64game); Serial.println(c64game);
#endif #endif
while (1) { // Single Step while (1) { // Single Step
int b = checkButton(); uint8_t b = checkButton();
if (b == 1) { // Continue (press) if (b == 1) { // Continue (press)
break; break;
} }
@ -1405,7 +1402,7 @@ bool getCartListInfo_C64() {
EEPROM_writeAnything(8, newc64size); EEPROM_writeAnything(8, newc64size);
EEPROM_writeAnything(12, newc64port); EEPROM_writeAnything(12, newc64port);
cartselected = 1; // SELECTION MADE cartselected = 1; // SELECTION MADE
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("SELECTION MADE")); println_Msg(F("SELECTION MADE"));
display_Update(); display_Update();
#else #else
@ -1420,8 +1417,8 @@ bool getCartListInfo_C64() {
} }
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE")); println_Msg(F("END OF FILE"));
display_Update(); display_Update();
#else #else
@ -1433,10 +1430,10 @@ bool getCartListInfo_C64() {
void checkCSV_C64() { void checkCSV_C64() {
if (getCartListInfo_C64()) { if (getCartListInfo_C64()) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART SELECTED")); println_Msg(F("CART SELECTED"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(c64game); println_Msg(c64game);
display_Update(); display_Update();
// Display Settings // Display Settings
@ -1449,7 +1446,7 @@ void checkCSV_C64() {
print_Msg(newc64port); print_Msg(newc64port);
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("CART SELECTED")); Serial.println(F("CART SELECTED"));
Serial.println(c64game); Serial.println(c64game);
// Display Settings // Display Settings
@ -1459,10 +1456,10 @@ void checkCSV_C64() {
Serial.print(newc64size); Serial.print(newc64size);
Serial.print(F("/P")); Serial.print(F("/P"));
Serial.print(newc64port); Serial.print(newc64port);
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("NO SELECTION")); println_Msg(F("NO SELECTION"));
display_Update(); display_Update();
@ -1473,7 +1470,7 @@ void checkCSV_C64() {
} }
void setCart_C64() { void setCart_C64() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(c64cartCSV); println_Msg(c64cartCSV);
display_Update(); display_Update();
@ -1483,7 +1480,7 @@ void setCart_C64() {
sd.chdir(folder); // Switch Folder sd.chdir(folder); // Switch Folder
c64csvFile = sd.open(c64cartCSV, O_READ); c64csvFile = sd.open(c64cartCSV, O_READ);
if (!c64csvFile) { if (!c64csvFile) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CSV FILE NOT FOUND!")); println_Msg(F("CSV FILE NOT FOUND!"));
display_Update(); display_Update();

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// COLECOVISION MODULE // COLECOVISION MODULE
//****************************************** //******************************************
#ifdef enable_COLV #ifdef ENABLE_COLV
// Coleco Colecovision // Coleco Colecovision
// Cartridge Pinout // Cartridge Pinout
@ -48,11 +48,7 @@ byte newcolsize;
// Menu // Menu
//****************************************** //******************************************
// Base Menu // Base Menu
static const char colMenuItem1[] PROGMEM = "Select Cart"; static const char* const menuOptionsCOL[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
static const char colMenuItem2[] PROGMEM = "Read ROM";
static const char colMenuItem3[] PROGMEM = "Set Size";
//static const char colMenuItem4[] PROGMEM = "Reset"; (stored in common strings array)
static const char* const menuOptionsCOL[] PROGMEM = { colMenuItem1, colMenuItem2, colMenuItem3, string_reset2 };
void setup_COL() { void setup_COL() {
// Request 5V // Request 5V
@ -92,7 +88,7 @@ void setup_COL() {
checkStatus_COL(); checkStatus_COL();
strcpy(romName, "COLECO"); strcpy(romName, "COLECO");
mode = mode_COL; mode = CORE_COL;
} }
void colMenu() { void colMenu() {
@ -218,7 +214,7 @@ void readROM_COL() {
// Compare CRC32 to database and rename ROM if found // Compare CRC32 to database and rename ROM if found
compareCRC("colv.txt", 0, 1, 0); compareCRC("colv.txt", 0, 1, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -230,22 +226,22 @@ void readROM_COL() {
//****************************************** //******************************************
void setROMSize_COL() { void setROMSize_COL() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (collo == colhi) if (collo == colhi)
newcolsize = collo; newcolsize = collo;
else { else {
int b = 0; uint8_t b = 0;
int i = collo; int i = collo;
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(COL[i]))); println_Msg(pgm_read_byte(&(COL[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -263,11 +259,11 @@ void setROMSize_COL() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(COL[i]))); println_Msg(pgm_read_byte(&(COL[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -283,11 +279,11 @@ void setROMSize_COL() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(COL[i]))); println_Msg(pgm_read_byte(&(COL[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -325,7 +321,7 @@ setrom:
newcolsize = sizeROM.toInt() + collo; newcolsize = sizeROM.toInt() + collo;
if (newcolsize > colhi) { if (newcolsize > colhi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
@ -344,15 +340,15 @@ void checkStatus_COL() {
EEPROM_writeAnything(8, colsize); EEPROM_writeAnything(8, colsize);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("COLECOVISION READER")); println_Msg(F("COLECOVISION READER"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: ")); print_Msg(F("ROM SIZE: "));
print_Msg(pgm_read_byte(&(COL[colsize]))); print_Msg(pgm_read_byte(&(COL[colsize])));
println_Msg(F("K")); println_Msg(F("K"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -361,7 +357,7 @@ void checkStatus_COL() {
Serial.print(F("CURRENT ROM SIZE: ")); Serial.print(F("CURRENT ROM SIZE: "));
Serial.print(pgm_read_byte(&(COL[colsize]))); Serial.print(pgm_read_byte(&(COL[colsize])));
Serial.println(F("K")); Serial.println(F("K"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
@ -445,16 +441,16 @@ void setCart_COL() {
skip_line(&myFile); skip_line(&myFile);
println_Msg(F("Select your cartridge")); println_Msg(F("Select your cartridge"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(gamename); println_Msg(gamename);
print_Msg(F("Size: ")); print_Msg(F("Size: "));
print_Msg(cartSize); print_Msg(cartSize);
println_Msg(F("KB")); println_Msg(F("KB"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#elif defined(SERIAL_MONITOR) #elif defined(SERIAL_MONITOR)
@ -463,7 +459,7 @@ void setCart_COL() {
#endif #endif
display_Update(); display_Update();
int b = 0; uint8_t b = 0;
while (1) { while (1) {
// Check button input // Check button input
b = checkButton(); b = checkButton();

File diff suppressed because it is too large Load Diff

View File

@ -77,7 +77,7 @@ void DynamicClockSerial::begin(unsigned long baud, byte config, unsigned long sc
} }
// ClockedSerial setup // ClockedSerial setup
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL) && !defined(enable_serial) && defined(ENABLE_UPDATER) #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL) && !defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
#if defined(UBRRH) && defined(UBRRL) #if defined(UBRRH) && defined(UBRRL)
DynamicClockSerial ClockedSerial(&UBRRH, &UBRRL, &UCSRA, &UCSRB, &UCSRC, &UDR); DynamicClockSerial ClockedSerial(&UBRRH, &UBRRL, &UCSRA, &UCSRB, &UCSRC, &UDR);
#else #else

View File

@ -53,7 +53,7 @@
automatically be enabled if you selected HW2 or newer above. automatically be enabled if you selected HW2 or newer above.
*/ */
//#define clockgen_installed //#define ENABLE_CLOCKGEN
/****/ /****/
@ -62,7 +62,7 @@
type later in this file. type later in this file.
*/ */
//#define RTC_installed //#define ENABLE_RTC
/****/ /****/
@ -71,218 +71,218 @@
/* [ Atari 2600 --------------------------------------------------- ] /* [ Atari 2600 --------------------------------------------------- ]
*/ */
//#define enable_2600 //#define ENABLE_2600
/****/ /****/
/* [ Atari 5200 --------------------------------------------------- ] /* [ Atari 5200 --------------------------------------------------- ]
*/ */
//#define enable_5200 //#define ENABLE_5200
/****/ /****/
/* [ Atari 7800 --------------------------------------------------- ] /* [ Atari 7800 --------------------------------------------------- ]
*/ */
//#define enable_7800 //#define ENABLE_7800
/****/ /****/
/* [ Benesse Pocket Challenge W ----------------------------------- ] /* [ Benesse Pocket Challenge W ----------------------------------- ]
*/ */
//#define enable_PCW //#define ENABLE_PCW
/****/ /****/
/* [ C64 --------------------------------------------------- ] /* [ C64 --------------------------------------------------- ]
*/ */
//#define enable_C64 //#define ENABLE_C64
/****/ /****/
/* [ ColecoVision ------------------------------------------------- ] /* [ ColecoVision ------------------------------------------------- ]
*/ */
//#define enable_COLV //#define ENABLE_COLV
/****/ /****/
/* [ Emerson Arcadia 2001 ----------------------------------------- ] /* [ Emerson Arcadia 2001 ----------------------------------------- ]
*/ */
//#define enable_ARC //#define ENABLE_ARC
/****/ /****/
/* [ Fairchild Channel F ------------------------------------------ ] /* [ Fairchild Channel F ------------------------------------------ ]
*/ */
//#define enable_FAIRCHILD //#define ENABLE_FAIRCHILD
/****/ /****/
/* [ Flashrom Programmer for SNES repros -------------------------- ] /* [ Flashrom Programmer for SNES repros -------------------------- ]
*/ */
//#define enable_FLASH //#define ENABLE_FLASH
//#define enable_FLASH16 //#define ENABLE_FLASH16
/****/ /****/
/* [ Game Boy (Color) and Advance --------------------------------- ] /* [ Game Boy (Color) and Advance --------------------------------- ]
*/ */
#define enable_GBX #define ENABLE_GBX
/****/ /****/
/* [ Intellivision ------------------------------------------------ ] /* [ Intellivision ------------------------------------------------ ]
*/ */
//#define enable_INTV //#define ENABLE_INTV
/****/ /****/
/* [ Neo Geo Pocket ----------------------------------------------- ] /* [ Neo Geo Pocket ----------------------------------------------- ]
*/ */
//#define enable_NGP //#define ENABLE_NGP
/****/ /****/
/* [ Nintendo 64 -------------------------------------------------- ] /* [ Nintendo 64 -------------------------------------------------- ]
*/ */
#define enable_N64 #define ENABLE_N64
/****/ /****/
/* [ Nintendo Entertainment System/Family Computer ---------------- ] /* [ Nintendo Entertainment System/Family Computer ---------------- ]
*/ */
#define enable_NES #define ENABLE_NES
/****/ /****/
/* [ Magnavox Odyssey 2 ------------------------------------------- ] /* [ Magnavox Odyssey 2 ------------------------------------------- ]
*/ */
//#define enable_ODY2 //#define ENABLE_ODY2
/****/ /****/
/* [ MSX ------------------------------------------- ] /* [ MSX ------------------------------------------- ]
*/ */
//#define enable_MSX //#define ENABLE_MSX
/****/ /****/
/* [ PC Engine/TurboGrafx 16 -------------------------------------- ] /* [ PC Engine/TurboGrafx 16 -------------------------------------- ]
*/ */
//#define enable_PCE //#define ENABLE_PCE
/****/ /****/
/* [ Pokemon Mini -------------------------------------- ] /* [ Pokemon Mini -------------------------------------- ]
*/ */
//#define enable_POKE //#define ENABLE_POKE
/****/ /****/
/* [ Sega Master System/Mark III/Game Gear/SG-1000 ---------------- ] /* [ Sega Master System/Mark III/Game Gear/SG-1000 ---------------- ]
*/ */
#define enable_SMS #define ENABLE_SMS
/****/ /****/
/* [ Sega Mega Drive/Genesis -------------------------------------- ] /* [ Sega Mega Drive/Genesis -------------------------------------- ]
*/ */
#define enable_MD #define ENABLE_MD
/****/ /****/
/* [ Super Famicom SF Memory Cassette ----------------------------- ] /* [ Super Famicom SF Memory Cassette ----------------------------- ]
*/ */
//#define enable_SFM //#define ENABLE_SFM
/****/ /****/
/* [ Super Famicom Satellaview ------------------------------------ ] /* [ Super Famicom Satellaview ------------------------------------ ]
*/ */
//#define enable_SV //#define ENABLE_SV
/****/ /****/
/* [ Super Famicom Sufami Turbo ----------------------------------- ] /* [ Super Famicom Sufami Turbo ----------------------------------- ]
*/ */
// #define enable_ST // #define ENABLE_ST
/****/ /****/
/* [ Super Famicom Game Processor RAM Cassette -------------------- ] /* [ Super Famicom Game Processor RAM Cassette -------------------- ]
*/ */
//#define enable_GPC //#define ENABLE_GPC
/****/ /****/
/* [ Super Nintendo ----------------------------------------------- ] /* [ Super Nintendo ----------------------------------------------- ]
*/ */
#define enable_SNES #define ENABLE_SNES
/****/ /****/
/* [ Vectrex --------------------------------------------------- ] /* [ Vectrex --------------------------------------------------- ]
*/ */
//#define enable_VECTREX //#define ENABLE_VECTREX
/****/ /****/
/* [ Virtual Boy -------------------------------------------------- ] /* [ Virtual Boy -------------------------------------------------- ]
*/ */
//#define enable_VBOY //#define ENABLE_VBOY
/****/ /****/
/* [ Watara Supervision ------------------------------------------- ] /* [ Watara Supervision ------------------------------------------- ]
*/ */
//#define enable_WSV //#define ENABLE_WSV
/****/ /****/
/* [ WonderSwan and Benesse Pocket Challenge v2 ------------------- ] /* [ WonderSwan and Benesse Pocket Challenge v2 ------------------- ]
*/ */
//#define enable_WS //#define ENABLE_WS
/****/ /****/
/* [ Super A'can -------------------------------------------------- ] /* [ Super A'can -------------------------------------------------- ]
*/ */
//#define enable_SUPRACAN //#define ENABLE_SUPRACAN
/****/ /****/
/* [ Casio Loopy -------------------------------------------------- ] /* [ Casio Loopy -------------------------------------------------- ]
*/ */
//#define enable_LOOPY //#define ENABLE_LOOPY
/****/ /****/
@ -316,7 +316,7 @@
Green, Red, Blue Green, Red, Blue
*/ */
#define background_color 100, 0, 0 #define OPTION_LCD_BG_COLOR 100, 0, 0
/****/ /****/
@ -347,7 +347,7 @@
Tests for shorts and other issues in your OSCR build. Tests for shorts and other issues in your OSCR build.
*/ */
#define enable_selftest #define ENABLE_SELFTEST
/****/ /****/
@ -358,7 +358,7 @@
oscr.logging=0 oscr.logging=0
*/ */
#define global_log #define ENABLE_GLOBAL_LOG
/****/ /****/
@ -376,8 +376,8 @@
Toggle clock calibration menu and whether or not to use calibration data from snes_clk.txt Toggle clock calibration menu and whether or not to use calibration data from snes_clk.txt
*/ */
//#define clockgen_calibration //#define OPTION_CLOCKGEN_CALIBRATION
//#define use_clockgen_calibration //#define OPTION_CLOCKGEN_USE_CALIBRATION
/****/ /****/
@ -403,7 +403,7 @@
Configure how the MD core saves are formatted. Configure how the MD core saves are formatted.
Can be set using config: Can be set using config:
md.sramType=0 md.saveType=0
If config is enabled, this option does nothing -- use the config. If config is enabled, this option does nothing -- use the config.
@ -413,7 +413,7 @@
2: Same as 1 + pad with 0xFF so that the file size is 64KB. 2: Same as 1 + pad with 0xFF so that the file size is 64KB.
*/ */
//#define DEFAULT_VALUE_segaSram16bit 0 //#define OPTION_MD_DEFAULT_SAVE_TYPE 0
/****/ /****/
@ -423,7 +423,7 @@
with all Cart Readers with all Cart Readers
*/ */
//#define fastcrc //#define OPTION_N64_FASTCRC
/****/ /****/
@ -431,7 +431,7 @@
Enable to save a n64log.txt file with rom info in /N64/ROM Enable to save a n64log.txt file with rom info in /N64/ROM
*/ */
//#define savesummarytotxt //#define OPTION_N64_SAVESUMMARY
/****/ /****/
@ -450,33 +450,33 @@
#endif #endif
#if (defined(HW4) || defined(HW5)) #if (defined(HW4) || defined(HW5))
# define enable_LCD # define ENABLE_LCD
# define enable_neopixel # define ENABLE_NEOPIXEL
# define enable_rotary # define ENABLE_ROTARY
//# define rotate_counter_clockwise //# define rotate_counter_clockwise
# define clockgen_installed # define ENABLE_CLOCKGEN
# define fastcrc # define OPTION_N64_FASTCRC
# define ws_adapter_v2 # define OPTION_WS_ADAPTER_V2
#endif #endif
#if (defined(HW2) || defined(HW3)) #if (defined(HW2) || defined(HW3))
# define enable_OLED # define ENABLE_OLED
# define enable_Button2 # define ENABLE_BUTTON2
# define clockgen_installed # define ENABLE_CLOCKGEN
# define CA_LED # define ENABLE_CA_LED
# define fastcrc # define OPTION_N64_FASTCRC
#endif #endif
#if defined(HW1) #if defined(HW1)
# define enable_OLED # define ENABLE_OLED
//#define clockgen_installed //#define ENABLE_CLOCKGEN
//#define fastcrc //#define OPTION_N64_FASTCRC
#endif #endif
#if defined(SERIAL_MONITOR) #if defined(SERIAL_MONITOR)
# define enable_serial # define ENABLE_SERIAL
//#define clockgen_installed //#define ENABLE_CLOCKGEN
//#define fastcrc //#define OPTION_N64_FASTCRC
#endif #endif
/* Firmware updater only works with HW3 and HW5 */ /* Firmware updater only works with HW3 and HW5 */

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// FAIRCHILD CHANNEL F MODULE // FAIRCHILD CHANNEL F MODULE
//****************************************** //******************************************
#if defined(enable_FAIRCHILD) #if defined(ENABLE_FAIRCHILD)
// Fairchild Channel F // Fairchild Channel F
// Cartridge Pinout // Cartridge Pinout
// 22P (27P Width) 2.54mm pitch connector // 22P (27P Width) 2.54mm pitch connector
@ -79,12 +79,8 @@ byte newfairchildsize;
// Menu // Menu
//****************************************** //******************************************
// Base Menu // Base Menu
static const char fairchildMenuItem1[] PROGMEM = "Select Cart";
static const char fairchildMenuItem2[] PROGMEM = "Read ROM";
static const char fairchildMenuItem3[] PROGMEM = "Set Size";
static const char fairchildMenuItem4[] PROGMEM = "Read 16K"; static const char fairchildMenuItem4[] PROGMEM = "Read 16K";
static const char fairchildMenuItem5[] PROGMEM = "Reset"; static const char* const menuOptionsFAIRCHILD[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, fairchildMenuItem4, FSTRING_RESET };
static const char* const menuOptionsFAIRCHILD[] PROGMEM = { fairchildMenuItem1, fairchildMenuItem2, fairchildMenuItem3, fairchildMenuItem4, fairchildMenuItem5 };
void setup_FAIRCHILD() { void setup_FAIRCHILD() {
// Request 5V // Request 5V
@ -125,7 +121,7 @@ void setup_FAIRCHILD() {
checkStatus_FAIRCHILD(); checkStatus_FAIRCHILD();
strcpy(romName, "FAIRCHILD"); strcpy(romName, "FAIRCHILD");
mode = mode_FAIRCHILD; mode = CORE_FAIRCHILD;
} }
void fairchildMenu() { void fairchildMenu() {
@ -478,7 +474,7 @@ void readROM_FAIRCHILD() {
calcCRC(fileName, cartsize, NULL, 0); calcCRC(fileName, cartsize, NULL, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
@ -533,7 +529,7 @@ void read16K_FAIRCHILD() // Read 16K Bytes
calcCRC(fileName, 0x4000, NULL, 0); calcCRC(fileName, 0x4000, NULL, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
@ -544,21 +540,21 @@ void read16K_FAIRCHILD() // Read 16K Bytes
//****************************************** //******************************************
void setROMSize_FAIRCHILD() { void setROMSize_FAIRCHILD() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (fairchildlo == fairchildhi) if (fairchildlo == fairchildhi)
newfairchildsize = fairchildlo; newfairchildsize = fairchildlo;
else { else {
int b = 0; uint8_t b = 0;
int i = fairchildlo; int i = fairchildlo;
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(FAIRCHILD[i]); println_Msg(FAIRCHILD[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -575,11 +571,11 @@ void setROMSize_FAIRCHILD() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(FAIRCHILD[i]); println_Msg(FAIRCHILD[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -594,11 +590,11 @@ void setROMSize_FAIRCHILD() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(FAIRCHILD[i]); println_Msg(FAIRCHILD[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -636,7 +632,7 @@ setrom:
newfairchildsize = sizeROM.toInt() + fairchildlo; newfairchildsize = sizeROM.toInt() + fairchildlo;
if (newfairchildsize > fairchildhi) { if (newfairchildsize > fairchildhi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
@ -655,11 +651,11 @@ void checkStatus_FAIRCHILD() {
EEPROM_writeAnything(8, fairchildsize); EEPROM_writeAnything(8, fairchildsize);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CHANNEL F READER")); println_Msg(F("CHANNEL F READER"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: ")); print_Msg(F("ROM SIZE: "));
print_Msg(FAIRCHILD[fairchildsize]); print_Msg(FAIRCHILD[fairchildsize]);
println_Msg(F("K")); println_Msg(F("K"));
@ -669,7 +665,7 @@ void checkStatus_FAIRCHILD() {
Serial.print(F("CURRENT ROM SIZE: ")); Serial.print(F("CURRENT ROM SIZE: "));
Serial.print(FAIRCHILD[fairchildsize]); Serial.print(FAIRCHILD[fairchildsize]);
Serial.println(F("K")); Serial.println(F("K"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
@ -722,7 +718,7 @@ bool readVals_FAIRCHILD(char* fairchildgame, char* fairchildrr, char* fairchildl
bool getCartListInfo_FAIRCHILD() { bool getCartListInfo_FAIRCHILD() {
bool buttonreleased = 0; bool buttonreleased = 0;
bool cartselected = 0; bool cartselected = 0;
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F(" HOLD TO FAST CYCLE")); println_Msg(F(" HOLD TO FAST CYCLE"));
display_Update(); display_Update();
@ -730,9 +726,9 @@ bool getCartListInfo_FAIRCHILD() {
Serial.println(F("HOLD BUTTON TO FAST CYCLE")); Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
#endif #endif
delay(2000); delay(2000);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Held - Fast Cycle if (buttonVal1 == LOW) { // Button Held - Fast Cycle
@ -741,19 +737,19 @@ bool getCartListInfo_FAIRCHILD() {
if (strcmp(fairchildcsvEND, fairchildgame) == 0) { if (strcmp(fairchildcsvEND, fairchildgame) == 0) {
fairchildcsvFile.seek(0); // Restart fairchildcsvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(fairchildgame); println_Msg(fairchildgame);
display_Update(); display_Update();
#else #else
Serial.print(F("CART TITLE:")); Serial.print(F("CART TITLE:"));
Serial.println(fairchildgame); Serial.println(fairchildgame);
#endif #endif
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -766,41 +762,41 @@ bool getCartListInfo_FAIRCHILD() {
} }
} }
} }
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) // Button Released if (buttonVal1 == HIGH) // Button Released
break; break;
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("FAST CYCLE OFF")); println_Msg(F("FAST CYCLE OFF"));
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("FAST CYCLE OFF")); Serial.println(F("FAST CYCLE OFF"));
Serial.println(F("PRESS BUTTON TO STEP FORWARD")); Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
Serial.println(F("DOUBLE CLICK TO STEP BACK")); Serial.println(F("DOUBLE CLICK TO STEP BACK"));
Serial.println(F("HOLD TO SELECT")); Serial.println(F("HOLD TO SELECT"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
while (readVals_FAIRCHILD(fairchildgame, fairchildrr, fairchildll)) { while (readVals_FAIRCHILD(fairchildgame, fairchildrr, fairchildll)) {
if (strcmp(fairchildcsvEND, fairchildgame) == 0) { if (strcmp(fairchildcsvEND, fairchildgame) == 0) {
fairchildcsvFile.seek(0); // Restart fairchildcsvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(fairchildgame); println_Msg(fairchildgame);
display.setCursor(0, 48); display.setCursor(0, 48);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -810,7 +806,7 @@ bool getCartListInfo_FAIRCHILD() {
Serial.println(fairchildgame); Serial.println(fairchildgame);
#endif #endif
while (1) { // Single Step while (1) { // Single Step
int b = checkButton(); uint8_t b = checkButton();
if (b == 1) { // Continue (press) if (b == 1) { // Continue (press)
break; break;
} }
@ -824,7 +820,7 @@ bool getCartListInfo_FAIRCHILD() {
newfairchildsize = strtol(fairchildrr, NULL, 10); newfairchildsize = strtol(fairchildrr, NULL, 10);
EEPROM_writeAnything(8, newfairchildsize); EEPROM_writeAnything(8, newfairchildsize);
cartselected = 1; // SELECTION MADE cartselected = 1; // SELECTION MADE
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("SELECTION MADE")); println_Msg(F("SELECTION MADE"));
display_Update(); display_Update();
#else #else
@ -839,8 +835,8 @@ bool getCartListInfo_FAIRCHILD() {
} }
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE")); println_Msg(F("END OF FILE"));
display_Update(); display_Update();
#else #else
@ -852,10 +848,10 @@ bool getCartListInfo_FAIRCHILD() {
void checkCSV_FAIRCHILD() { void checkCSV_FAIRCHILD() {
if (getCartListInfo_FAIRCHILD()) { if (getCartListInfo_FAIRCHILD()) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART SELECTED")); println_Msg(F("CART SELECTED"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(fairchildgame); println_Msg(fairchildgame);
display_Update(); display_Update();
// Display Settings // Display Settings
@ -864,16 +860,16 @@ void checkCSV_FAIRCHILD() {
println_Msg(newfairchildsize); println_Msg(newfairchildsize);
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("CART SELECTED")); Serial.println(F("CART SELECTED"));
Serial.println(fairchildgame); Serial.println(fairchildgame);
// Display Settings // Display Settings
Serial.print(F("CODE: R")); Serial.print(F("CODE: R"));
Serial.println(newfairchildsize); Serial.println(newfairchildsize);
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("NO SELECTION")); println_Msg(F("NO SELECTION"));
display_Update(); display_Update();
@ -884,7 +880,7 @@ void checkCSV_FAIRCHILD() {
} }
void setCart_FAIRCHILD() { void setCart_FAIRCHILD() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(fairchildcartCSV); println_Msg(fairchildcartCSV);
display_Update(); display_Update();
@ -894,7 +890,7 @@ void setCart_FAIRCHILD() {
sd.chdir(folder); // Switch Folder sd.chdir(folder); // Switch Folder
fairchildcsvFile = sd.open(fairchildcartCSV, O_READ); fairchildcsvFile = sd.open(fairchildcartCSV, O_READ);
if (!fairchildcsvFile) { if (!fairchildcsvFile) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CSV FILE NOT FOUND!")); println_Msg(F("CSV FILE NOT FOUND!"));
display_Update(); display_Update();

View File

@ -2,7 +2,7 @@
// FLASHROM MODULE // FLASHROM MODULE
// (also includes SNES repro functions) // (also includes SNES repro functions)
//****************************************** //******************************************
#ifdef enable_FLASH #ifdef ENABLE_FLASH
/****************************************** /******************************************
Variables Variables
@ -27,16 +27,14 @@ static const char flash8MenuItem3[] PROGMEM = "Read";
static const char flash8MenuItem4[] PROGMEM = "Write"; static const char flash8MenuItem4[] PROGMEM = "Write";
static const char flash8MenuItem5[] PROGMEM = "ID"; static const char flash8MenuItem5[] PROGMEM = "ID";
static const char flash8MenuItem6[] PROGMEM = "Print"; static const char flash8MenuItem6[] PROGMEM = "Print";
//static const char flash8MenuItem7[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsFLASH8[] PROGMEM = { flash8MenuItem1, flash8MenuItem2, flash8MenuItem3, flash8MenuItem4, flash8MenuItem5, flash8MenuItem6, FSTRING_RESET };
static const char* const menuOptionsFLASH8[] PROGMEM = { flash8MenuItem1, flash8MenuItem2, flash8MenuItem3, flash8MenuItem4, flash8MenuItem5, flash8MenuItem6, string_reset2 };
#ifdef enable_FLASH16 #ifdef ENABLE_FLASH16
// Flash start menu // Flash start menu
static const char flashMenuItem1[] PROGMEM = "8bit Flash adapter"; static const char flashMenuItem1[] PROGMEM = "8bit Flash adapter";
static const char flashMenuItem2[] PROGMEM = "Eprom adapter"; static const char flashMenuItem2[] PROGMEM = "Eprom adapter";
static const char flashMenuItem3[] PROGMEM = "16bit Flash adapter"; static const char flashMenuItem3[] PROGMEM = "16bit Flash adapter";
// static const char flashMenuItem4[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsFlash[] PROGMEM = { flashMenuItem1, flashMenuItem2, flashMenuItem3, FSTRING_RESET };
static const char* const menuOptionsFlash[] PROGMEM = { flashMenuItem1, flashMenuItem2, flashMenuItem3, string_reset2 };
// 16bit Flash menu items // 16bit Flash menu items
static const char flash16MenuItem1[] PROGMEM = "Blankcheck"; static const char flash16MenuItem1[] PROGMEM = "Blankcheck";
@ -45,8 +43,7 @@ static const char flash16MenuItem3[] PROGMEM = "Read";
static const char flash16MenuItem4[] PROGMEM = "Write"; static const char flash16MenuItem4[] PROGMEM = "Write";
static const char flash16MenuItem5[] PROGMEM = "ID"; static const char flash16MenuItem5[] PROGMEM = "ID";
static const char flash16MenuItem6[] PROGMEM = "Print"; static const char flash16MenuItem6[] PROGMEM = "Print";
//static const char flash16MenuItem7[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsFLASH16[] PROGMEM = { flash16MenuItem1, flash16MenuItem2, flash16MenuItem3, flash16MenuItem4, flash16MenuItem5, flash16MenuItem6, FSTRING_RESET };
static const char* const menuOptionsFLASH16[] PROGMEM = { flash16MenuItem1, flash16MenuItem2, flash16MenuItem3, flash16MenuItem4, flash16MenuItem5, flash16MenuItem6, string_reset2 };
// Eprom menu items // Eprom menu items
static const char epromMenuItem1[] PROGMEM = "Blankcheck"; static const char epromMenuItem1[] PROGMEM = "Blankcheck";
@ -54,8 +51,7 @@ static const char epromMenuItem2[] PROGMEM = "Read";
static const char epromMenuItem3[] PROGMEM = "Write"; static const char epromMenuItem3[] PROGMEM = "Write";
static const char epromMenuItem4[] PROGMEM = "Verify"; static const char epromMenuItem4[] PROGMEM = "Verify";
static const char epromMenuItem5[] PROGMEM = "Print"; static const char epromMenuItem5[] PROGMEM = "Print";
// static const char epromMenuItem6[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsEprom[] PROGMEM = { epromMenuItem1, epromMenuItem2, epromMenuItem3, epromMenuItem4, epromMenuItem5, FSTRING_RESET };
static const char* const menuOptionsEprom[] PROGMEM = { epromMenuItem1, epromMenuItem2, epromMenuItem3, epromMenuItem4, epromMenuItem5, string_reset2 };
void flashMenu() { void flashMenu() {
// create menu with title and 3 options to choose from // create menu with title and 3 options to choose from
@ -73,14 +69,14 @@ void flashMenu() {
setup_Flash8(); setup_Flash8();
id_Flash8(); id_Flash8();
wait(); wait();
mode = mode_FLASH8; mode = CORE_FLASH8;
break; break;
case 1: case 1:
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_Eprom(); setup_Eprom();
mode = mode_EPROM; mode = CORE_EPROM;
break; break;
case 2: case 2:
@ -89,7 +85,7 @@ void flashMenu() {
setup_Flash16(); setup_Flash16();
id_Flash16(); id_Flash16();
wait(); wait();
mode = mode_FLASH16; mode = CORE_FLASH16;
break; break;
case 3: case 3:
@ -108,7 +104,7 @@ void flashMenu() {
setup_Flash8(); setup_Flash8();
id_Flash8(); id_Flash8();
wait(); wait();
mode = mode_FLASH8; mode = CORE_FLASH8;
} }
#endif #endif
@ -204,9 +200,9 @@ void flashromMenu8() {
case 3: idFlash28FXXX(); break; case 3: idFlash28FXXX(); break;
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
printFlash(40); printFlash(40);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Update(); display_Update();
resetFlash8(); resetFlash8();
@ -241,7 +237,7 @@ void flashromMenu8() {
wait(); wait();
} }
#ifdef enable_FLASH16 #ifdef ENABLE_FLASH16
void flashromMenu16() { void flashromMenu16() {
// create menu with title "Flashrom Writer 16" and 7 options to choose from // create menu with title "Flashrom Writer 16" and 7 options to choose from
unsigned char mainMenu; unsigned char mainMenu;
@ -302,9 +298,9 @@ void flashromMenu16() {
display_Clear(); display_Clear();
println_Msg(F("ID Flashrom")); println_Msg(F("ID Flashrom"));
idFlash16(); idFlash16();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
printFlash16(40); printFlash16(40);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Update(); display_Update();
resetFlash16(); resetFlash16();
break; break;
@ -592,9 +588,9 @@ idtheflash:
// print first 40 bytes of flash // print first 40 bytes of flash
display_Clear(); display_Clear();
println_Msg(F("First 40 bytes:")); println_Msg(F("First 40 bytes:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
printFlash(40); printFlash(40);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Update(); display_Update();
resetFlash8(); resetFlash8();
print_FatalError(F("Press Button to reset")); print_FatalError(F("Press Button to reset"));
@ -607,7 +603,7 @@ idtheflash:
resetFlash8(); resetFlash8();
} }
#ifdef enable_FLASH16 #ifdef ENABLE_FLASH16
void id_Flash16() { void id_Flash16() {
// ID flash // ID flash
idFlash16(); idFlash16();
@ -683,8 +679,7 @@ void id_Flash16() {
#if defined(ENABLE_VSELECT) || defined(ENABLE_3V3FIX) #if defined(ENABLE_VSELECT) || defined(ENABLE_3V3FIX)
static const char flashvoltItem1[] PROGMEM = "3.3V"; static const char flashvoltItem1[] PROGMEM = "3.3V";
static const char flashvoltItem2[] PROGMEM = "5V"; static const char flashvoltItem2[] PROGMEM = "5V";
//static const char flashvoltItem3[] PROGMEM = "Reset"; (stored in common strings array) static const char* const flashvoltOptions[] PROGMEM = { flashvoltItem1, flashvoltItem2, FSTRING_RESET };
static const char* const flashvoltOptions[] PROGMEM = { flashvoltItem1, flashvoltItem2, string_reset2 };
void setup_FlashVoltage() { void setup_FlashVoltage() {
// create menu with title and 3 options to choose from // create menu with title and 3 options to choose from
@ -737,7 +732,7 @@ void setup_Flash8() {
PORTC = 0x00; PORTC = 0x00;
} }
#ifdef enable_FLASH16 #ifdef ENABLE_FLASH16
void setup_Flash16() { void setup_Flash16() {
// Set Address Pins to Output // Set Address Pins to Output
//A0-A7 //A0-A7
@ -803,7 +798,7 @@ void dataIn8() {
DDRC = 0x00; DDRC = 0x00;
} }
#ifdef enable_FLASH16 #ifdef ENABLE_FLASH16
// Switch data pins to write // Switch data pins to write
void dataOut16() { void dataOut16() {
DDRC = 0xFF; DDRC = 0xFF;
@ -986,7 +981,7 @@ byte readByte_Flash(unsigned long myAddress) {
return tempByte; return tempByte;
} }
#ifdef enable_FLASH16 #ifdef ENABLE_FLASH16
void writeWord_Flash(unsigned long myAddress, word myData) { void writeWord_Flash(unsigned long myAddress, word myData) {
PORTF = myAddress & 0xFF; PORTF = myAddress & 0xFF;
PORTK = (myAddress >> 8) & 0xFF; PORTK = (myAddress >> 8) & 0xFF;
@ -1144,9 +1139,9 @@ void writeFlash29F032() {
for (unsigned long currByte = 0; currByte < fileSize; currByte += 512) { for (unsigned long currByte = 0; currByte < fileSize; currByte += 512) {
// if (currByte >= 0) { // if (currByte >= 0) {
// print_Msg(currByte); // print_Msg(currByte);
// print_Msg(F(" ")); // print_Msg(FS(FSTRING_SPACE));
// print_Msg(dq5failcnt); // print_Msg(dq5failcnt);
// println_Msg(F("")); // println_Msg(FS(FSTRING_EMPTY));
// } // }
if (!noread) { if (!noread) {
myFile.read(sdBuffer, 512); myFile.read(sdBuffer, 512);
@ -1182,7 +1177,7 @@ void writeFlash29F032() {
print_Msg(currByte); print_Msg(currByte);
print_Msg(F(": ")); print_Msg(F(": "));
print_Msg(blockfailcnt); print_Msg(blockfailcnt);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
dq5failcnt -= blockfailcnt; dq5failcnt -= blockfailcnt;
currByte -= 512; currByte -= 512;
delay(100); delay(100);
@ -1900,7 +1895,7 @@ void resetFlash8() {
} }
} }
#ifdef enable_FLASH16 #ifdef ENABLE_FLASH16
/****************************************** /******************************************
29L3211 16bit flashrom functions 29L3211 16bit flashrom functions
*****************************************/ *****************************************/

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// GAME BOY MODULE // GAME BOY MODULE
//****************************************** //******************************************
#ifdef enable_GBX #ifdef ENABLE_GBX
/****************************************** /******************************************
Variables Variables
@ -22,31 +22,24 @@ static const char gbxMenuItem3[] PROGMEM = "Flash GBC Cart";
static const char gbxMenuItem4[] PROGMEM = "NPower GB Memory"; static const char gbxMenuItem4[] PROGMEM = "NPower GB Memory";
static const char gbxMenuItem5[] PROGMEM = "Flash Codebreaker"; static const char gbxMenuItem5[] PROGMEM = "Flash Codebreaker";
static const char gbxMenuItem6[] PROGMEM = "Flash Datel Device"; static const char gbxMenuItem6[] PROGMEM = "Flash Datel Device";
//static const char gbxMenuItem5[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsGBx[] PROGMEM = { gbxMenuItem1, gbxMenuItem2, gbxMenuItem3, gbxMenuItem4, gbxMenuItem5, gbxMenuItem6, FSTRING_RESET };
static const char* const menuOptionsGBx[] PROGMEM = { gbxMenuItem1, gbxMenuItem2, gbxMenuItem3, gbxMenuItem4, gbxMenuItem5, gbxMenuItem6, string_reset2 };
// GB menu items // GB menu items
static const char GBMenuItem1[] PROGMEM = "Read ROM"; static const char* const menuOptionsGB[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, FSTRING_RESET };
static const char GBMenuItem2[] PROGMEM = "Read Save";
static const char GBMenuItem3[] PROGMEM = "Write Save";
//static const char GBMenuItem4[] PROGMEM = "Reset"; (stored in common strings array)
static const char* const menuOptionsGB[] PROGMEM = { GBMenuItem1, GBMenuItem2, GBMenuItem3, string_reset2 };
// GB Flash items // GB Flash items
static const char GBFlashItem1[] PROGMEM = "29F016/32/33 Cart"; static const char GBFlashItem1[] PROGMEM = "29F016/32/33 Cart";
static const char GBFlashItem2[] PROGMEM = "CFI Cart"; static const char GBFlashItem2[] PROGMEM = "CFI Cart";
static const char GBFlashItem3[] PROGMEM = "CFI Cart and Save"; static const char GBFlashItem3[] PROGMEM = "CFI Cart and Save";
static const char GBFlashItem4[] PROGMEM = "GB Smart"; static const char GBFlashItem4[] PROGMEM = "GB Smart";
//static const char GBFlashItem5[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsGBFlash[] PROGMEM = { GBFlashItem1, GBFlashItem2, GBFlashItem3, GBFlashItem4, FSTRING_RESET };
static const char* const menuOptionsGBFlash[] PROGMEM = { GBFlashItem1, GBFlashItem2, GBFlashItem3, GBFlashItem4, string_reset2 };
// 29F Flash items // 29F Flash items
static const char GBFlash29Item1[] PROGMEM = "DIY MBC3 (WR)"; static const char GBFlash29Item1[] PROGMEM = "DIY MBC3 (WR)";
static const char GBFlash29Item2[] PROGMEM = "DIY MBC5 (WR)"; static const char GBFlash29Item2[] PROGMEM = "DIY MBC5 (WR)";
static const char GBFlash29Item3[] PROGMEM = "HDR MBC30 (Audio)"; static const char GBFlash29Item3[] PROGMEM = "HDR MBC30 (Audio)";
static const char GBFlash29Item4[] PROGMEM = "HDR GameBoy Cam"; static const char GBFlash29Item4[] PROGMEM = "HDR GameBoy Cam";
//static const char GBFlashItem5[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsGBFlash29[] PROGMEM = { GBFlash29Item1, GBFlash29Item2, GBFlash29Item3, GBFlash29Item4, FSTRING_RESET };
static const char* const menuOptionsGBFlash29[] PROGMEM = { GBFlash29Item1, GBFlash29Item2, GBFlash29Item3, GBFlash29Item4, string_reset2 };
// Pelican Codebreaker, Brainboy, and Monster Brain Operation Menu // Pelican Codebreaker, Brainboy, and Monster Brain Operation Menu
static const char PelicanRead[] PROGMEM = "Read Device"; static const char PelicanRead[] PROGMEM = "Read Device";
@ -74,14 +67,14 @@ void gbxMenu() {
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_GB(); setup_GB();
mode = mode_GB; mode = CORE_GB;
break; break;
case 1: case 1:
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_GBA(); setup_GBA();
mode = mode_GBA; mode = CORE_GBA;
break; break;
case 2: case 2:
@ -108,7 +101,7 @@ void gbxMenu() {
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_GB(); setup_GB();
mode = mode_GB; mode = CORE_GB;
// Change working dir to root // Change working dir to root
sd.chdir("/"); sd.chdir("/");
@ -127,7 +120,7 @@ void gbxMenu() {
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_GB(); setup_GB();
mode = mode_GB; mode = CORE_GB;
// Change working dir to root // Change working dir to root
sd.chdir("/"); sd.chdir("/");
@ -146,7 +139,7 @@ void gbxMenu() {
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_GB(); setup_GB();
mode = mode_GB; mode = CORE_GB;
//Setup Audio-In(PH4) as Output //Setup Audio-In(PH4) as Output
DDRH |= (1 << 4); DDRH |= (1 << 4);
@ -172,7 +165,7 @@ void gbxMenu() {
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_GB(); setup_GB();
mode = mode_GB; mode = CORE_GB;
//Flash first bank with erase //Flash first bank with erase
// Change working dir to root // Change working dir to root
@ -190,7 +183,7 @@ void gbxMenu() {
println_Msg(F("to B2 (Bank 2)")); println_Msg(F("to B2 (Bank 2)"));
println_Msg(F("if you want to flash")); println_Msg(F("if you want to flash"));
println_Msg(F("a second game")); println_Msg(F("a second game"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -203,7 +196,7 @@ void gbxMenu() {
writeFlash29F_GB(3, 0); writeFlash29F_GB(3, 0);
// Reset // Reset
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -222,7 +215,7 @@ void gbxMenu() {
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_GB(); setup_GB();
mode = mode_GB; mode = CORE_GB;
// Change working dir to root // Change working dir to root
sd.chdir("/"); sd.chdir("/");
@ -250,7 +243,7 @@ void gbxMenu() {
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_GB(); setup_GB();
mode = mode_GB; mode = CORE_GB;
// Change working dir to root // Change working dir to root
sd.chdir("/"); sd.chdir("/");
@ -325,7 +318,7 @@ void gbxMenu() {
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_GBSmart(); setup_GBSmart();
mode = mode_GB_GBSmart; mode = CORE_GB_GBSMART;
break; break;
case 4: case 4:
@ -339,7 +332,7 @@ void gbxMenu() {
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_GBM(); setup_GBM();
mode = mode_GBM; mode = CORE_GBM;
break; break;
case 4: case 4:
@ -367,7 +360,7 @@ void gbxMenu() {
// RST(PH0) to H // RST(PH0) to H
PORTH |= (1 << 0); PORTH |= (1 << 0);
mode = mode_GB; mode = CORE_GB;
display_Clear(); display_Clear();
display_Update(); display_Update();
unsigned char gbPelican; unsigned char gbPelican;
@ -424,7 +417,7 @@ void gbxMenu() {
// RST(PH0) to H // RST(PH0) to H
PORTH |= (1 << 0); PORTH |= (1 << 0);
mode = mode_GB; mode = CORE_GB;
display_Clear(); display_Clear();
display_Update(); display_Update();
unsigned char gbDatel; unsigned char gbDatel;
@ -497,7 +490,7 @@ void gbMenu() {
sd.chdir("/"); sd.chdir("/");
readROM_GB(); readROM_GB();
compare_checksums_GB(); compare_checksums_GB();
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
save_log(); save_log();
#endif #endif
break; break;
@ -517,7 +510,7 @@ void gbMenu() {
} else { } else {
print_Error(F("No save or unsupported type")); print_Error(F("No save or unsupported type"));
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
break; break;
case 2: case 2:
@ -550,7 +543,7 @@ void gbMenu() {
} else { } else {
print_Error(F("No save or unsupported type")); print_Error(F("No save or unsupported type"));
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
break; break;
case 3: case 3:
@ -657,7 +650,7 @@ void showCartInfo_GB() {
else if (romType == 0x104) else if (romType == 0x104)
print_Msg(F("M161")); print_Msg(F("M161"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
switch (romSize) { switch (romSize) {
case 0: case 0:
@ -697,7 +690,7 @@ void showCartInfo_GB() {
break; break;
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
//print_Msg(F("Banks: ")); //print_Msg(F("Banks: "));
//println_Msg(romBanks); //println_Msg(romBanks);
@ -741,13 +734,13 @@ void showCartInfo_GB() {
default: print_Msg(F("None")); default: print_Msg(F("None"));
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
//print_Msg(F("Checksum: ")); //print_Msg(F("Checksum: "));
//println_Msg(checksumStr); //println_Msg(checksumStr);
//display_Update(); //display_Update();
// Wait for user input // Wait for user input
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -964,9 +957,9 @@ void getCartInfo_GB() {
if (logoChecksum != 0x1546) { if (logoChecksum != 0x1546) {
print_Error(F("STARTUP LOGO ERROR")); print_Error(F("STARTUP LOGO ERROR"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Press Button to")); println_Msg(F("Press Button to"));
println_Msg(F("ignore or powercycle")); println_Msg(F("ignore or powercycle"));
println_Msg(F("to try again")); println_Msg(F("to try again"));
@ -995,9 +988,9 @@ void getCartInfo_GB() {
if (headerChecksum != sdBuffer[0x14D]) { if (headerChecksum != sdBuffer[0x14D]) {
print_Error(F("HEADER CHECKSUM ERROR")); print_Error(F("HEADER CHECKSUM ERROR"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Press Button to")); println_Msg(F("Press Button to"));
println_Msg(F("ignore or clean")); println_Msg(F("ignore or clean"));
println_Msg(F("cart and try again")); println_Msg(F("cart and try again"));
@ -1611,7 +1604,7 @@ void readSRAMFLASH_MBC6_GB() {
myFile.close(); myFile.close();
// Signal end of process // Signal end of process
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} }
@ -2282,7 +2275,7 @@ void writeFlash29F_GB(byte MBC, boolean flashErase) {
myFile.close(); myFile.close();
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
println_Msg(F("Error")); println_Msg(F("Error"));
@ -2642,7 +2635,7 @@ bool writeCFI_GB() {
myFile.close(); myFile.close();
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
print_STR(error_STR, 0); print_STR(error_STR, 0);
@ -3096,7 +3089,7 @@ void writePelican_GB() {
myFile.close(); myFile.close();
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
println_Msg(F("Please turn off the power.")); println_Msg(F("Please turn off the power."));
display_Update(); display_Update();
} else { } else {
@ -3428,7 +3421,7 @@ void writeMegaMem_GB() {
myFile.close(); myFile.close();
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
println_Msg(F("Please turn off the power.")); println_Msg(F("Please turn off the power."));
display_Update(); display_Update();
} else { } else {
@ -3736,7 +3729,7 @@ void writeGameshark_GB() {
myFile.close(); myFile.close();
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
println_Msg(F("Please turn off the power.")); println_Msg(F("Please turn off the power."));
display_Update(); display_Update();
} else { } else {

View File

@ -1,19 +1,15 @@
//****************************************** //******************************************
// GAME BOY ADVANCE MODULE // GAME BOY ADVANCE MODULE
//****************************************** //******************************************
#ifdef enable_GBX #ifdef ENABLE_GBX
/****************************************** /******************************************
Menu Menu
*****************************************/ *****************************************/
// GBA menu items // GBA menu items
static const char GBAMenuItem1[] PROGMEM = "Read ROM";
static const char GBAMenuItem2[] PROGMEM = "Read Save";
static const char GBAMenuItem3[] PROGMEM = "Write Save";
static const char GBAMenuItem4[] PROGMEM = "Force Savetype"; static const char GBAMenuItem4[] PROGMEM = "Force Savetype";
static const char GBAMenuItem5[] PROGMEM = "Flash Repro"; static const char GBAMenuItem5[] PROGMEM = "Flash Repro";
//static const char GBAMenuItem6[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsGBA[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, GBAMenuItem4, GBAMenuItem5, FSTRING_RESET };
static const char* const menuOptionsGBA[] PROGMEM = { GBAMenuItem1, GBAMenuItem2, GBAMenuItem3, GBAMenuItem4, GBAMenuItem5, string_reset2 };
// Rom menu // Rom menu
static const char GBARomItem1[] PROGMEM = "1 MB"; static const char GBARomItem1[] PROGMEM = "1 MB";
@ -66,7 +62,7 @@ void gbaMenu() {
compare_checksum_GBA(); compare_checksum_GBA();
// CRC32 // CRC32
compareCRC("gba.txt", 0, 1, 0); compareCRC("gba.txt", 0, 1, 0);
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
save_log(); save_log();
#endif #endif
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
@ -116,7 +112,7 @@ void gbaMenu() {
break; break;
} }
setROM_GBA(); setROM_GBA();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -162,7 +158,7 @@ void gbaMenu() {
printFlashTypeAndWait(F("Panasonic MN63F805MNP")); printFlashTypeAndWait(F("Panasonic MN63F805MNP"));
} else { } else {
printFlashTypeAndWait(F("Unknown")); printFlashTypeAndWait(F("Unknown"));
//print_FatalError(F("")); //print_FatalError(FSTRING_EMPTY);
} }
if (flashid == 0x1F3D) { // Atmel if (flashid == 0x1F3D) { // Atmel
@ -188,7 +184,7 @@ void gbaMenu() {
printFlashTypeAndWait(F("SANYO LE26FV10N1TS")); printFlashTypeAndWait(F("SANYO LE26FV10N1TS"));
} else { } else {
printFlashTypeAndWait(F("Unknown")); printFlashTypeAndWait(F("Unknown"));
//print_FatalError(F("")); //print_FatalError(FSTRING_EMPTY);
} }
eraseFLASH_GBA(); eraseFLASH_GBA();
@ -211,7 +207,7 @@ void gbaMenu() {
break; break;
} }
setROM_GBA(); setROM_GBA();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -228,7 +224,7 @@ void gbaMenu() {
case 4: case 4:
display_Clear(); display_Clear();
flashRepro_GBA(); flashRepro_GBA();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -326,10 +322,10 @@ static byte getSaveType() {
static void printFlashTypeAndWait(const __FlashStringHelper* caption) { static void printFlashTypeAndWait(const __FlashStringHelper* caption) {
print_Msg(F("FLASH ID: ")); print_Msg(F("FLASH ID: "));
println_Msg(flashid_str); println_Msg(flashid_str);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("FLASH Type: ")); println_Msg(F("FLASH Type: "));
println_Msg(caption); println_Msg(caption);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -599,9 +595,9 @@ void getCartInfo_GBA() {
display_Clear(); display_Clear();
print_Error(F("CARTRIDGE ERROR")); print_Error(F("CARTRIDGE ERROR"));
strcpy(romName, "ERROR"); strcpy(romName, "ERROR");
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Press Button to")); println_Msg(F("Press Button to"));
println_Msg(F("ignore or powercycle")); println_Msg(F("ignore or powercycle"));
println_Msg(F("to try again")); println_Msg(F("to try again"));
@ -630,7 +626,7 @@ void getCartInfo_GBA() {
if (myFile.open("gba.txt", O_READ)) { if (myFile.open("gba.txt", O_READ)) {
char gamename[100]; char gamename[100];
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Disable log to prevent unnecessary logging // Disable log to prevent unnecessary logging
dont_log = true; dont_log = true;
#endif #endif
@ -703,21 +699,21 @@ void getCartInfo_GBA() {
print_Msg(F("Save Lib: ")); print_Msg(F("Save Lib: "));
println_Msg(saveTypeStr); println_Msg(saveTypeStr);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#elif defined(SERIAL_MONITOR) #elif defined(SERIAL_MONITOR)
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("U/D to Change")); println_Msg(F("U/D to Change"));
println_Msg(F("Space to Select")); println_Msg(F("Space to Select"));
#endif #endif
display_Update(); display_Update();
int b = 0; uint8_t b = 0;
while (1) { while (1) {
// Check button input // Check button input
b = checkButton(); b = checkButton();
@ -754,7 +750,7 @@ void getCartInfo_GBA() {
// Close the file: // Close the file:
myFile.close(); myFile.close();
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Enable log again // Enable log again
dont_log = false; dont_log = false;
#endif #endif
@ -785,7 +781,7 @@ void getCartInfo_GBA() {
sprintf(calcChecksumStr, "%02X", calcChecksum); sprintf(calcChecksumStr, "%02X", calcChecksum);
println_Msg(calcChecksumStr); println_Msg(calcChecksumStr);
print_Error(F("Checksum Error")); print_Error(F("Checksum Error"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -1723,7 +1719,7 @@ unsigned long verifyFLASH_GBA(unsigned long flashSize, uint32_t pos) {
PORTH |= (1 << 0); PORTH |= (1 << 0);
if (wrError == 0) { if (wrError == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
} else { } else {
print_Msg(wrError); print_Msg(wrError);
print_Error(F(" Errors")); print_Error(F(" Errors"));
@ -2145,11 +2141,11 @@ void idFlashrom_GBA() {
resetMX29GL128E_GBA(); resetMX29GL128E_GBA();
} else { } else {
println_Msg(F("Error")); println_Msg(F("Error"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Unknown Flash")); println_Msg(F("Unknown Flash"));
print_Msg(F("Flash ID: ")); print_Msg(F("Flash ID: "));
println_Msg(flashid_str); println_Msg(flashid_str);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_FatalError(F("Check voltage")); print_FatalError(F("Check voltage"));
} }
} }
@ -2591,7 +2587,7 @@ void flashRepro_GBA() {
println_Msg(""); println_Msg("");
println_Msg(F("This will erase your")); println_Msg(F("This will erase your"));
println_Msg(F("Repro Cartridge.")); println_Msg(F("Repro Cartridge."));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(""); println_Msg("");
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
@ -2649,7 +2645,7 @@ void flashRepro_GBA() {
print_Msg(F("Blankcheck...")); print_Msg(F("Blankcheck..."));
display_Update(); display_Update();
if (blankcheckFlashrom_GBA()) { if (blankcheckFlashrom_GBA()) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
*/ */
//Write flashrom //Write flashrom
@ -2693,7 +2689,7 @@ void flashRepro_GBA() {
delay(1000); delay(1000);
} }
if (verifyFlashrom_GBA() == 1) { if (verifyFlashrom_GBA() == 1) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
print_FatalError(F("ERROR")); print_FatalError(F("ERROR"));
@ -2709,11 +2705,11 @@ void flashRepro_GBA() {
} }
} else { } else {
println_Msg(F("Error")); println_Msg(F("Error"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Unknown Flash")); println_Msg(F("Unknown Flash"));
print_Msg(F("Flash ID: ")); print_Msg(F("Flash ID: "));
println_Msg(flashid_str); println_Msg(flashid_str);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_FatalError(F("Check voltage")); print_FatalError(F("Check voltage"));
} }
} }

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// GB MEMORY MODULE // GB MEMORY MODULE
//****************************************** //******************************************
#ifdef enable_GBX #ifdef ENABLE_GBX
/****************************************** /******************************************
Menu Menu
@ -86,7 +86,7 @@ void gbmMenu() {
// Clear screen // Clear screen
display_Clear(); display_Clear();
if (blankcheckFlash_GBM()) { if (blankcheckFlash_GBM()) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
println_Msg(F("ERROR")); println_Msg(F("ERROR"));
@ -162,7 +162,7 @@ void gbmMenu() {
// Erase mapping // Erase mapping
eraseMapping_GBM(); eraseMapping_GBM();
if (blankcheckMapping_GBM()) { if (blankcheckMapping_GBM()) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
print_Error(F("Erasing failed")); print_Error(F("Erasing failed"));
@ -173,7 +173,7 @@ void gbmMenu() {
writeMapping_GBM(); writeMapping_GBM();
break; break;
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();

View File

@ -2,7 +2,7 @@
// GB SMART MODULE // GB SMART MODULE
// Supports 32M cart with LH28F016SUT flash // Supports 32M cart with LH28F016SUT flash
//****************************************** //******************************************
#ifdef enable_GBX #ifdef ENABLE_GBX
#define GB_SMART_GAMES_PER_PAGE 6 #define GB_SMART_GAMES_PER_PAGE 6
/****************************************** /******************************************
@ -11,8 +11,7 @@
// GB Smart menu items // GB Smart menu items
static const char gbSmartMenuItem1[] PROGMEM = "Game Menu"; static const char gbSmartMenuItem1[] PROGMEM = "Game Menu";
static const char gbSmartMenuItem2[] PROGMEM = "Flash Menu"; static const char gbSmartMenuItem2[] PROGMEM = "Flash Menu";
//static const char gbSmartMenuItem3[] PROGMEM = "Reset"; (stored in common strings array) static const char *const menuOptionsGBSmart[] PROGMEM = { gbSmartMenuItem1, gbSmartMenuItem2, FSTRING_RESET };
static const char *const menuOptionsGBSmart[] PROGMEM = { gbSmartMenuItem1, gbSmartMenuItem2, string_reset2 };
static const char gbSmartFlashMenuItem1[] PROGMEM = "Read Flash"; static const char gbSmartFlashMenuItem1[] PROGMEM = "Read Flash";
static const char gbSmartFlashMenuItem2[] PROGMEM = "Write Flash"; static const char gbSmartFlashMenuItem2[] PROGMEM = "Write Flash";
@ -20,11 +19,8 @@ static const char gbSmartFlashMenuItem3[] PROGMEM = "Back";
static const char *const menuOptionsGBSmartFlash[] PROGMEM = { gbSmartFlashMenuItem1, gbSmartFlashMenuItem2, gbSmartFlashMenuItem3 }; static const char *const menuOptionsGBSmartFlash[] PROGMEM = { gbSmartFlashMenuItem1, gbSmartFlashMenuItem2, gbSmartFlashMenuItem3 };
static const char gbSmartGameMenuItem1[] PROGMEM = "Read Game"; static const char gbSmartGameMenuItem1[] PROGMEM = "Read Game";
static const char gbSmartGameMenuItem2[] PROGMEM = "Read SRAM";
static const char gbSmartGameMenuItem3[] PROGMEM = "Write SRAM";
static const char gbSmartGameMenuItem4[] PROGMEM = "Switch Game"; static const char gbSmartGameMenuItem4[] PROGMEM = "Switch Game";
//static const char gbSmartGameMenuItem5[] PROGMEM = "Reset"; (stored in common strings array) static const char *const menuOptionsGBSmartGame[] PROGMEM = { gbSmartGameMenuItem1, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, gbSmartGameMenuItem4, FSTRING_RESET };
static const char *const menuOptionsGBSmartGame[] PROGMEM = { gbSmartGameMenuItem1, gbSmartGameMenuItem2, gbSmartGameMenuItem3, gbSmartGameMenuItem4, string_reset2 };
struct GBSmartGameInfo { struct GBSmartGameInfo {
uint8_t start_bank; uint8_t start_bank;
@ -163,7 +159,7 @@ void gbSmartMenu() {
} }
case 1: case 1:
{ {
mode = mode_GB_GBSmart_Flash; mode = CORE_GB_GBSMART_FLASH;
break; break;
} }
default: default:
@ -227,7 +223,7 @@ void gbSmartGameOptions() {
} }
if (gameSubMenu != 3) { if (gameSubMenu != 3) {
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -269,7 +265,7 @@ gb_smart_load_more_games:
getCartInfo_GB(); getCartInfo_GB();
showCartInfo_GB(); showCartInfo_GB();
mode = mode_GB_GBSmart_Game; mode = CORE_GB_GBSMART_GAME;
} }
void gbSmartFlashMenu() { void gbSmartFlashMenu() {
@ -303,7 +299,7 @@ void gbSmartFlashMenu() {
println_Msg(F("Attention")); println_Msg(F("Attention"));
println_Msg(F("This will erase your")); println_Msg(F("This will erase your"));
println_Msg(F("GB Smart Cartridge.")); println_Msg(F("GB Smart Cartridge."));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -320,12 +316,12 @@ void gbSmartFlashMenu() {
} }
default: default:
{ {
mode = mode_GB_GBSmart; mode = CORE_GB_GBSMART;
return; return;
} }
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -476,7 +472,7 @@ void gbSmartWriteFlash() {
writeErrors = gbSmartVerifyFlash(); writeErrors = gbSmartVerifyFlash();
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
print_STR(error_STR, 0); print_STR(error_STR, 0);

View File

@ -2,7 +2,7 @@
// SNES Game Processor RAM Cassette code by LuigiBlood // SNES Game Processor RAM Cassette code by LuigiBlood
// Revision 1.0.0 February 2024 // Revision 1.0.0 February 2024
//****************************************** //******************************************
#ifdef enable_GPC #ifdef ENABLE_GPC
/****************************************** /******************************************
Game Processor RAM Cassette Game Processor RAM Cassette
@ -29,8 +29,7 @@ void writeRAM_GPC(void);
// GPC flash menu items // GPC flash menu items
static const char gpcFlashMenuItem1[] PROGMEM = "Read RAM"; static const char gpcFlashMenuItem1[] PROGMEM = "Read RAM";
static const char gpcFlashMenuItem2[] PROGMEM = "Write RAM"; static const char gpcFlashMenuItem2[] PROGMEM = "Write RAM";
static const char gpcFlashMenuItem3[] PROGMEM = "Back"; static const char* const menuOptionsGPCFlash[] PROGMEM = { gpcFlashMenuItem1, gpcFlashMenuItem2, FSTRING_RESET };
static const char* const menuOptionsGPCFlash[] PROGMEM = { gpcFlashMenuItem1, gpcFlashMenuItem2, gpcFlashMenuItem3 };
void gpcMenu() { void gpcMenu() {
@ -100,7 +99,7 @@ void setup_GPC() {
clockgen.output_enable(SI5351_CLK1, 0); clockgen.output_enable(SI5351_CLK1, 0);
clockgen.output_enable(SI5351_CLK2, 1); clockgen.output_enable(SI5351_CLK2, 1);
} }
#ifdef clockgen_installed #ifdef ENABLE_CLOCKGEN
else { else {
display_Clear(); display_Clear();
print_FatalError(F("Clock Generator not found")); print_FatalError(F("Clock Generator not found"));

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// INTELLIVISION MODULE // INTELLIVISION MODULE
//****************************************** //******************************************
#ifdef enable_INTV #ifdef ENABLE_INTV
// Mattel Intellivision // Mattel Intellivision
// Cartridge Pinout // Cartridge Pinout
@ -92,11 +92,7 @@ byte newintvsize;
// Menu // Menu
//****************************************** //******************************************
// Base Menu // Base Menu
static const char intvMenuItem1[] PROGMEM = "Select Cart"; static const char* const menuOptionsINTV[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
static const char intvMenuItem2[] PROGMEM = "Read ROM";
static const char intvMenuItem3[] PROGMEM = "Set Mapper + Size";
//static const char intvMenuItem4[] PROGMEM = "Reset"; (stored in common strings array)
static const char* const menuOptionsINTV[] PROGMEM = { intvMenuItem1, intvMenuItem2, intvMenuItem3, string_reset2 };
void setup_INTV() { void setup_INTV() {
// Request 5V // Request 5V
@ -134,7 +130,7 @@ void setup_INTV() {
checkStatus_INTV(); checkStatus_INTV();
strcpy(romName, "INTV"); strcpy(romName, "INTV");
mode = mode_INTV; mode = CORE_INTV;
} }
void intvMenu() { void intvMenu() {
@ -428,7 +424,7 @@ void readROM_INTV() {
// Compare CRC32 to database and rename ROM if found // Compare CRC32 to database and rename ROM if found
compareCRC("intv.txt", 0, 1, 0); compareCRC("intv.txt", 0, 1, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -490,20 +486,20 @@ void ecsBank(uint32_t addr, uint8_t bank) {
//****************************************** //******************************************
void setMapper_INTV() { void setMapper_INTV() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
int b = 0; uint8_t b = 0;
int i = 0; int i = 0;
// Check Button Status // Check Button Status
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); // PG2 boolean buttonVal1 = (PING & (1 << 2)); // PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Pressed if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List while (1) { // Scroll Mapper List
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); // PG2 boolean buttonVal1 = (PING & (1 << 2)); // PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -533,11 +529,11 @@ void setMapper_INTV() {
intvindex = i * 4; intvindex = i * 4;
intvmapselect = pgm_read_byte(intvmapsize + intvindex); intvmapselect = pgm_read_byte(intvmapsize + intvindex);
println_Msg(intvmapselect); println_Msg(intvmapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -558,11 +554,11 @@ void setMapper_INTV() {
intvindex = i * 4; intvindex = i * 4;
intvmapselect = pgm_read_byte(intvmapsize + intvindex); intvmapselect = pgm_read_byte(intvmapsize + intvindex);
println_Msg(intvmapselect); println_Msg(intvmapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -580,11 +576,11 @@ void setMapper_INTV() {
intvindex = i * 4; intvindex = i * 4;
intvmapselect = pgm_read_byte(intvmapsize + intvindex); intvmapselect = pgm_read_byte(intvmapsize + intvindex);
println_Msg(intvmapselect); println_Msg(intvmapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -618,7 +614,7 @@ setmapper:
} }
if (intvmapfound == false) { if (intvmapfound == false) {
Serial.println(F("MAPPER NOT SUPPORTED!")); Serial.println(F("MAPPER NOT SUPPORTED!"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
newintvmapper = 0; newintvmapper = 0;
goto setmapper; goto setmapper;
} }
@ -640,23 +636,23 @@ void checkMapperSize_INTV() {
} }
void setROMSize_INTV() { void setROMSize_INTV() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (intvlo == intvhi) if (intvlo == intvhi)
newintvsize = intvlo; newintvsize = intvlo;
else { else {
int b = 0; uint8_t b = 0;
int i = intvlo; int i = intvlo;
// Only update display after input because of slow LCD library // Only update display after input because of slow LCD library
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(INTV[i]))); println_Msg(pgm_read_byte(&(INTV[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -674,11 +670,11 @@ void setROMSize_INTV() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(INTV[i]))); println_Msg(pgm_read_byte(&(INTV[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -693,11 +689,11 @@ void setROMSize_INTV() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(INTV[i]))); println_Msg(pgm_read_byte(&(INTV[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -735,7 +731,7 @@ setrom:
newintvsize = sizeROM.toInt() + intvlo; newintvsize = sizeROM.toInt() + intvlo;
if (newintvsize > intvhi) { if (newintvsize > intvhi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
@ -759,11 +755,11 @@ void checkStatus_INTV() {
EEPROM_writeAnything(8, intvsize); EEPROM_writeAnything(8, intvsize);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("INTELLIVISION READER")); println_Msg(F("INTELLIVISION READER"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: ")); print_Msg(F("MAPPER: "));
println_Msg(intvmapper); println_Msg(intvmapper);
print_Msg(F("ROM SIZE: ")); print_Msg(F("ROM SIZE: "));
@ -777,7 +773,7 @@ void checkStatus_INTV() {
Serial.print(F("CURRENT ROM SIZE: ")); Serial.print(F("CURRENT ROM SIZE: "));
Serial.print(pgm_read_byte(&(INTV[intvsize]))); Serial.print(pgm_read_byte(&(INTV[intvsize])));
Serial.println(F("K")); Serial.println(F("K"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
@ -873,17 +869,17 @@ void setCart_INTV() {
skip_line(&myFile); skip_line(&myFile);
println_Msg(F("Select your cartridge")); println_Msg(F("Select your cartridge"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(gamename); println_Msg(gamename);
print_Msg(F("Size: ")); print_Msg(F("Size: "));
print_Msg(cartSize); print_Msg(cartSize);
println_Msg(F("KB")); println_Msg(F("KB"));
print_Msg(F("Mapper: ")); print_Msg(F("Mapper: "));
println_Msg(intvmapper); println_Msg(intvmapper);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#elif defined(SERIAL_MONITOR) #elif defined(SERIAL_MONITOR)
@ -892,7 +888,7 @@ void setCart_INTV() {
#endif #endif
display_Update(); display_Update();
int b = 0; uint8_t b = 0;
while (1) { while (1) {
// Check button input // Check button input
b = checkButton(); b = checkButton();

View File

@ -59,7 +59,7 @@
// //
// By @partlyhuman // By @partlyhuman
// Special thanks to @kasamikona // Special thanks to @kasamikona
#ifdef enable_LOOPY #ifdef ENABLE_LOOPY
// SH-1 memory map locations, ROM starts here // SH-1 memory map locations, ROM starts here
const uint32_t LOOPY_MAP_ROM_ZERO = 0x0E000000; const uint32_t LOOPY_MAP_ROM_ZERO = 0x0E000000;
@ -109,7 +109,7 @@ void setup_LOOPY() {
getCartInfo_LOOPY(); getCartInfo_LOOPY();
mode = mode_LOOPY; mode = CORE_LOOPY;
} }
//****************************************** //******************************************
@ -117,12 +117,8 @@ void setup_LOOPY() {
//****************************************** //******************************************
// Base Menu // Base Menu
static const char loopyMenuItem0[] PROGMEM = "Refresh Cart";
static const char loopyMenuItem1[] PROGMEM = "Read ROM";
static const char loopyMenuItem2[] PROGMEM = "Backup SRAM";
static const char loopyMenuItem3[] PROGMEM = "Restore SRAM";
static const char loopyMenuItem4[] PROGMEM = "Format SRAM"; static const char loopyMenuItem4[] PROGMEM = "Format SRAM";
static const char* const menuOptionsLOOPY[] PROGMEM = { loopyMenuItem0, loopyMenuItem1, loopyMenuItem2, loopyMenuItem3, loopyMenuItem4, string_reset2 }; static const char* const menuOptionsLOOPY[] PROGMEM = { FSTRING_REFRESH_CART, FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, loopyMenuItem4, FSTRING_RESET };
void loopyMenu() { void loopyMenu() {
convertPgm(menuOptionsLOOPY, 5); convertPgm(menuOptionsLOOPY, 5);
@ -188,10 +184,10 @@ void loopyMenu() {
break; break;
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
if (waitForInput) { if (waitForInput) {
// Wait for user input // Wait for user input
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -497,7 +493,7 @@ void getCartInfo_LOOPY() {
setRomName_LOOPY("loopy.txt", checksumStr); setRomName_LOOPY("loopy.txt", checksumStr);
println_Msg(F("Cart Info")); println_Msg(F("Cart Info"));
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
print_Msg(F("Name: ")); print_Msg(F("Name: "));
println_Msg(loopyRomNameLong); println_Msg(loopyRomNameLong);
print_Msg(F("Checksum: ")); print_Msg(F("Checksum: "));
@ -508,9 +504,9 @@ void getCartInfo_LOOPY() {
print_Msg(F("Sram: ")); print_Msg(F("Sram: "));
print_Msg(sramSize * 8 / 1024); print_Msg(sramSize * 8 / 1024);
println_Msg(F(" KBit")); println_Msg(F(" KBit"));
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
// Wait for user input // Wait for user input
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);

View File

@ -2,7 +2,7 @@
// SEGA MEGA DRIVE MODULE // SEGA MEGA DRIVE MODULE
//****************************************** //******************************************
// Writes to Sega CD Backup RAM Cart require an extra wire from MRES (B02) to VRES (B27) // Writes to Sega CD Backup RAM Cart require an extra wire from MRES (B02) to VRES (B27)
#ifdef enable_MD #ifdef ENABLE_MD
/****************************************** /******************************************
Variables Variables
@ -93,11 +93,11 @@ int segaSram16bit = 0;
#else /* !ENABLED_CONFIG */ #else /* !ENABLED_CONFIG */
# ifndef DEFAULT_VALUE_segaSram16bit # ifndef OPTION_MD_DEFAULT_SAVE_TYPE
# define DEFAULT_VALUE_segaSram16bit 0 # define OPTION_MD_DEFAULT_SAVE_TYPE 0
# endif /* !DEFAULT_VALUE_segaSram16bit */ # endif /* !OPTION_MD_DEFAULT_SAVE_TYPE */
int segaSram16bit = DEFAULT_VALUE_segaSram16bit; int segaSram16bit = OPTION_MD_DEFAULT_SAVE_TYPE;
#endif /* ENABLED_CONFIG */ #endif /* ENABLED_CONFIG */
@ -185,7 +185,7 @@ void mdLoadConf() {
// 2: Duplicate each byte. Pad with 0xFF so that the file size is 64KB. // 2: Duplicate each byte. Pad with 0xFF so that the file size is 64KB.
segaSram16bit = atoi(value); segaSram16bit = atoi(value);
if (segaSram16bit != 0 && segaSram16bit != 1 && segaSram16bit != 2) { if (segaSram16bit != 0 && segaSram16bit != 1 && segaSram16bit != 2) {
segaSram16bit = DEFAULT_VALUE_segaSram16bit; segaSram16bit = DEFAULT_VALUE_SAVE_TYPE;
} }
print_Msg(F("segaSram16bit: ")); print_Msg(F("segaSram16bit: "));
println_Msg(segaSram16bit); println_Msg(segaSram16bit);
@ -209,24 +209,17 @@ void pulse_clock(int n) {
static const char MDMenuItem1[] PROGMEM = "Game Cartridge"; static const char MDMenuItem1[] PROGMEM = "Game Cartridge";
static const char MDMenuItem2[] PROGMEM = "SegaCD RamCart"; static const char MDMenuItem2[] PROGMEM = "SegaCD RamCart";
static const char MDMenuItem3[] PROGMEM = "Flash Repro"; static const char MDMenuItem3[] PROGMEM = "Flash Repro";
//static const char MDMenuItem4[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsMD[] PROGMEM = { MDMenuItem1, MDMenuItem2, MDMenuItem3, FSTRING_RESET };
static const char* const menuOptionsMD[] PROGMEM = { MDMenuItem1, MDMenuItem2, MDMenuItem3, string_reset2 };
// Cart menu items // Cart menu items
static const char MDCartMenuItem1[] PROGMEM = "Read Rom";
static const char MDCartMenuItem2[] PROGMEM = "Read Sram";
static const char MDCartMenuItem3[] PROGMEM = "Write Sram";
static const char MDCartMenuItem4[] PROGMEM = "Read EEPROM"; static const char MDCartMenuItem4[] PROGMEM = "Read EEPROM";
static const char MDCartMenuItem5[] PROGMEM = "Write EEPROM"; static const char MDCartMenuItem5[] PROGMEM = "Write EEPROM";
static const char MDCartMenuItem6[] PROGMEM = "Cycle cart"; static const char* const menuOptionsMDCart[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, MDCartMenuItem4, MDCartMenuItem5, FSTRING_REFRESH_CART, FSTRING_RESET };
//static const char MDCartMenuItem7[] PROGMEM = "Reset"; (stored in common strings array)
static const char* const menuOptionsMDCart[] PROGMEM = { MDCartMenuItem1, MDCartMenuItem2, MDCartMenuItem3, MDCartMenuItem4, MDCartMenuItem5, MDCartMenuItem6, string_reset2 };
// Sega CD Ram Backup Cartridge menu items // Sega CD Ram Backup Cartridge menu items
static const char SCDMenuItem1[] PROGMEM = "Read Backup RAM"; static const char SCDMenuItem1[] PROGMEM = "Read Backup RAM";
static const char SCDMenuItem2[] PROGMEM = "Write Backup RAM"; static const char SCDMenuItem2[] PROGMEM = "Write Backup RAM";
//static const char SCDMenuItem3[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsSCD[] PROGMEM = { SCDMenuItem1, SCDMenuItem2, FSTRING_RESET };
static const char* const menuOptionsSCD[] PROGMEM = { SCDMenuItem1, SCDMenuItem2, string_reset2 };
// Sega start menu // Sega start menu
void mdMenu() { void mdMenu() {
@ -242,22 +235,22 @@ void mdMenu() {
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_MD(); setup_MD();
mode = mode_MD_Cart; mode = CORE_MD_CART;
break; break;
case 1: case 1:
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_MD(); setup_MD();
mode = mode_SEGA_CD; mode = CORE_SEGA_CD;
break; break;
#ifdef enable_FLASH #ifdef ENABLE_FLASH
case 2: case 2:
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_MD(); setup_MD();
mode = mode_MD_Cart; mode = CORE_MD_CART;
// Change working dir to root // Change working dir to root
filePath[0] = '\0'; filePath[0] = '\0';
sd.chdir("/"); sd.chdir("/");
@ -291,7 +284,7 @@ void mdMenu() {
verifyFlash_MD(); verifyFlash_MD();
// Set CS(PH3) HIGH // Set CS(PH3) HIGH
PORTH |= (1 << 3); PORTH |= (1 << 3);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -336,7 +329,7 @@ void mdCartMenu() {
} else { } else {
print_Error(F("Cart has no ROM")); print_Error(F("Cart has no ROM"));
} }
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
save_log(); save_log();
#endif #endif
break; break;
@ -465,7 +458,7 @@ void segaCDMenu() {
asm volatile(" jmp 0"); asm volatile(" jmp 0");
break; break;
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -480,7 +473,7 @@ void setup_MD() {
setVoltage(VOLTS_SET_5V); setVoltage(VOLTS_SET_5V);
#if defined(ENABLE_CONFIG) #if defined(ENABLE_CONFIG)
segaSram16bit = configGetLong(F("md.sramType")); segaSram16bit = configGetLong(F("md.saveType"));
#elif defined(use_md_conf) #elif defined(use_md_conf)
mdLoadConf(); mdLoadConf();
#endif /*ENABLE_CONFIG*/ #endif /*ENABLE_CONFIG*/
@ -1111,13 +1104,13 @@ void getCartInfo_MD() {
} else { } else {
print_Msg(("sramType: ")); print_Msg(("sramType: "));
print_Msg_PaddedHex16(sramType); print_Msg_PaddedHex16(sramType);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(("sramBase: ")); print_Msg(("sramBase: "));
print_Msg_PaddedHex32(sramBase); print_Msg_PaddedHex32(sramBase);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(("sramEnd: ")); print_Msg(("sramEnd: "));
print_Msg_PaddedHex32(sramEnd); print_Msg_PaddedHex32(sramEnd);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_FatalError(F("Unknown Sram Base")); print_FatalError(F("Unknown Sram Base"));
} }
} else if (sramType == 0xE020) { // SRAM BOTH BYTES } else if (sramType == 0xE020) { // SRAM BOTH BYTES
@ -1139,13 +1132,13 @@ void getCartInfo_MD() {
}else { }else {
print_Msg(("sramType: ")); print_Msg(("sramType: "));
print_Msg_PaddedHex16(sramType); print_Msg_PaddedHex16(sramType);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(("sramBase: ")); print_Msg(("sramBase: "));
print_Msg_PaddedHex32(sramBase); print_Msg_PaddedHex32(sramBase);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(("sramEnd: ")); print_Msg(("sramEnd: "));
print_Msg_PaddedHex32(sramEnd); print_Msg_PaddedHex32(sramEnd);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_FatalError(F("Unknown Sram Base")); print_FatalError(F("Unknown Sram Base"));
} }
} }
@ -1263,13 +1256,13 @@ void getCartInfo_MD() {
display_Clear(); display_Clear();
println_Msg(F("Cart Info")); println_Msg(F("Cart Info"));
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
print_Msg(F("Name: ")); print_Msg(F("Name: "));
println_Msg(romName); println_Msg(romName);
if (bramCheck != 0x00FF) { if (bramCheck != 0x00FF) {
print_Msg(F("bramCheck: ")); print_Msg(F("bramCheck: "));
print_Msg_PaddedHex16(bramCheck); print_Msg_PaddedHex16(bramCheck);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
} }
if (bramSize > 0) { if (bramSize > 0) {
print_Msg(F("bramSize(KB): ")); print_Msg(F("bramSize(KB): "));
@ -1312,7 +1305,7 @@ void getCartInfo_MD() {
print_Msg_PaddedHexByte((chksumSonic2 & 0x00ff)); print_Msg_PaddedHexByte((chksumSonic2 & 0x00ff));
break; break;
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
if (saveType == 4) { if (saveType == 4) {
print_Msg(F("Serial EEPROM: ")); print_Msg(F("Serial EEPROM: "));
print_Msg(eepSize * 8 / 1024); print_Msg(eepSize * 8 / 1024);
@ -1325,10 +1318,10 @@ void getCartInfo_MD() {
} else } else
println_Msg(F("None")); println_Msg(F("None"));
} }
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
// Wait for user input // Wait for user input
#if (defined(enable_LCD) || defined(enable_OLED)) #if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -1691,14 +1684,14 @@ void readROM_MD() {
print_Msg(F("Internal checksum...")); print_Msg(F("Internal checksum..."));
display_Update(); display_Update();
if (chksum == calcCKS) { if (chksum == calcCKS) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
println_Msg(F("Error")); println_Msg(F("Error"));
char calcsumStr[5]; char calcsumStr[5];
sprintf(calcsumStr, "%04X", calcCKS); sprintf(calcsumStr, "%04X", calcCKS);
println_Msg(calcsumStr); println_Msg(calcsumStr);
print_Error(F("")); print_Error(FS(FSTRING_EMPTY));
display_Update(); display_Update();
} }
@ -1706,28 +1699,28 @@ void readROM_MD() {
if (SnKmode >= 2) { if (SnKmode >= 2) {
print_Msg(F("Lock-on checksum...")); print_Msg(F("Lock-on checksum..."));
if (chksumLockon == calcCKSLockon) { if (chksumLockon == calcCKSLockon) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
print_Msg(F("Error")); print_Msg(F("Error"));
char calcsumStr[5]; char calcsumStr[5];
sprintf(calcsumStr, "%04X", calcCKSLockon); sprintf(calcsumStr, "%04X", calcCKSLockon);
println_Msg(calcsumStr); println_Msg(calcsumStr);
print_Error(F("")); print_Error(FS(FSTRING_EMPTY));
display_Update(); display_Update();
} }
} }
if (SnKmode == 3) { if (SnKmode == 3) {
print_Msg(F("Adittional checksum...")); print_Msg(F("Adittional checksum..."));
if (chksumSonic2 == calcCKSSonic2) { if (chksumSonic2 == calcCKSSonic2) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
print_Msg(F("Error")); print_Msg(F("Error"));
char calcsumStr[5]; char calcsumStr[5];
sprintf(calcsumStr, "%04X", calcCKSSonic2); sprintf(calcsumStr, "%04X", calcCKSSonic2);
println_Msg(calcsumStr); println_Msg(calcsumStr);
print_Error(F("")); print_Error(FS(FSTRING_EMPTY));
display_Update(); display_Update();
} }
} }
@ -1937,7 +1930,7 @@ unsigned long verifySram_MD() {
return writeErrors; return writeErrors;
} }
#ifdef enable_FLASH #ifdef ENABLE_FLASH
//****************************************** //******************************************
// Flashrom Functions // Flashrom Functions
//****************************************** //******************************************
@ -2725,7 +2718,7 @@ void readEEP_MD() {
} }
// Close the file: // Close the file:
myFile.close(); myFile.close();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Clear(); display_Clear();
print_Msg(F("Saved to ")); print_Msg(F("Saved to "));
print_Msg(folder); print_Msg(folder);
@ -2760,13 +2753,13 @@ void writeEEP_MD() {
writeEepromByte(currByte); writeEepromByte(currByte);
print_Msg(F(".")); print_Msg(F("."));
if ((currByte != 0) && ((currByte + 1) % 64 == 0)) if ((currByte != 0) && ((currByte + 1) % 64 == 0))
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Update(); // ON SERIAL = delay(100) display_Update(); // ON SERIAL = delay(100)
} }
} }
// Close the file: // Close the file:
myFile.close(); myFile.close();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Clear(); display_Clear();
print_STR(done_STR, 1); print_STR(done_STR, 1);
display_Update(); display_Update();
@ -2813,7 +2806,7 @@ void readBram_MD() {
// Close the file: // Close the file:
myFile.close(); myFile.close();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Clear(); display_Clear();
print_Msg(F("Saved to ")); print_Msg(F("Saved to "));
print_Msg(folder); print_Msg(folder);
@ -2845,7 +2838,7 @@ void writeBram_MD() {
writeWord_MD(0x380000, 0); // Disable BRAM Writes writeWord_MD(0x380000, 0); // Disable BRAM Writes
// Close the file: // Close the file:
myFile.close(); myFile.close();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Clear(); display_Clear();
print_STR(done_STR, 1); print_STR(done_STR, 1);
display_Update(); display_Update();

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// MSX COMPUTER MODULE // MSX COMPUTER MODULE
//****************************************** //******************************************
#ifdef enable_MSX #ifdef ENABLE_MSX
// MSX // MSX
// Cartridge Pinout // Cartridge Pinout
// 50P 2.54mm pitch connector // 50P 2.54mm pitch connector
@ -126,11 +126,10 @@ boolean srambit7 = false;
// MENU // MENU
//****************************************** //******************************************
// Base Menu // Base Menu
static const char msxMenuItem1[] PROGMEM = "Select Cart";
static const char msxMenuItem2[] PROGMEM = "Read Cart"; static const char msxMenuItem2[] PROGMEM = "Read Cart";
static const char msxMenuItem3[] PROGMEM = "Set Mapper + Size"; static const char msxMenuItem3[] PROGMEM = "Set Mapper + Size";
static const char msxMenuItem4[] PROGMEM = "Write SRAM"; static const char msxMenuItem4[] PROGMEM = "Write SRAM";
static const char* const menuOptionsMSX[] PROGMEM = { msxMenuItem1, msxMenuItem2, msxMenuItem3, msxMenuItem4, string_reset2 }; static const char* const menuOptionsMSX[] PROGMEM = { FSTRING_SELECT_CART, msxMenuItem2, msxMenuItem3, msxMenuItem4, FSTRING_RESET };
void msxMenu() { void msxMenu() {
convertPgm(menuOptionsMSX, 5); convertPgm(menuOptionsMSX, 5);
@ -163,7 +162,7 @@ void msxMenu() {
case 3: case 3:
// Write RAM // Write RAM
writeRAM_MSX(); writeRAM_MSX();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -223,7 +222,7 @@ void setup_MSX() {
checkStatus_MSX(); checkStatus_MSX();
strcpy(romName, "MSX"); strcpy(romName, "MSX");
mode = mode_MSX; mode = CORE_MSX;
} }
//****************************************** //******************************************
@ -298,7 +297,7 @@ void writeData_MSX(uint16_t addr, uint8_t data) {
//****************************************** //******************************************
// POWER // POWER
//****************************************** //******************************************
#ifndef enable_NES #ifndef ENABLE_NES
int int_pow(int base, int exp) // Power for int int int_pow(int base, int exp) // Power for int
{ {
int result = 1; int result = 1;
@ -563,7 +562,7 @@ void readROM_MSX() {
unsigned long crcsize = MSX[msxsize] * 0x400; unsigned long crcsize = MSX[msxsize] * 0x400;
calcCRC(fileName, crcsize, NULL, 0); calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -723,7 +722,7 @@ void readRAM_MSX() {
unsigned long crcsize = MSX[msxramsize] * 0x400; unsigned long crcsize = MSX[msxramsize] * 0x400;
calcCRC(fileName, crcsize, NULL, 0); calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -847,7 +846,7 @@ void writeRAM_MSX() {
} }
myFile.close(); myFile.close();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("RAM FILE WRITTEN!")); println_Msg(F("RAM FILE WRITTEN!"));
display_Update(); display_Update();
@ -863,20 +862,20 @@ void writeRAM_MSX() {
// MAPPER CODE // MAPPER CODE
//****************************************** //******************************************
void setMapper_MSX() { void setMapper_MSX() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
int b = 0; uint8_t b = 0;
int i = 0; int i = 0;
// Check Button Status // Check Button Status
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Pressed if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List while (1) { // Scroll Mapper List
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -908,11 +907,11 @@ void setMapper_MSX() {
msxmapselect = pgm_read_byte(msxmapsize + msxindex); msxmapselect = pgm_read_byte(msxmapsize + msxindex);
println_Msg(msxmapselect); println_Msg(msxmapselect);
printMapper(msxmapselect); printMapper(msxmapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -933,11 +932,11 @@ void setMapper_MSX() {
msxmapselect = pgm_read_byte(msxmapsize + msxindex); msxmapselect = pgm_read_byte(msxmapsize + msxindex);
println_Msg(msxmapselect); println_Msg(msxmapselect);
printMapper(msxmapselect); printMapper(msxmapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -956,11 +955,11 @@ void setMapper_MSX() {
msxmapselect = pgm_read_byte(msxmapsize + msxindex); msxmapselect = pgm_read_byte(msxmapsize + msxindex);
println_Msg(msxmapselect); println_Msg(msxmapselect);
printMapper(msxmapselect); printMapper(msxmapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -995,7 +994,7 @@ setmapper:
} }
if (msxmapfound == false) { if (msxmapfound == false) {
Serial.println(F("MAPPER NOT SUPPORTED!")); Serial.println(F("MAPPER NOT SUPPORTED!"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
newmsxmapper = 0; newmsxmapper = 0;
goto setmapper; goto setmapper;
} }
@ -1022,22 +1021,22 @@ void checkMapperSize_MSX() {
// SET ROM SIZE // SET ROM SIZE
//****************************************** //******************************************
void setROMSize_MSX() { void setROMSize_MSX() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (msxlo == msxhi) if (msxlo == msxhi)
newmsxsize = msxlo; newmsxsize = msxlo;
else { else {
int b = 0; uint8_t b = 0;
int i = msxlo; int i = msxlo;
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(MSX[i]); println_Msg(MSX[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1061,11 +1060,11 @@ void setROMSize_MSX() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(MSX[i]); println_Msg(MSX[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1088,11 +1087,11 @@ void setROMSize_MSX() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(MSX[i]); println_Msg(MSX[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1138,13 +1137,13 @@ setrom:
if (msxmapper == 11) { // PAC/FM-PAC 0K/64K if (msxmapper == 11) { // PAC/FM-PAC 0K/64K
if ((newmsxromsize > 0) && (newmsxromsize < 4)) { if ((newmsxromsize > 0) && (newmsxromsize < 4)) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
if (newmsxsize > msxhi) { if (newmsxsize > msxhi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
@ -1163,22 +1162,22 @@ setrom:
// SET RAM SIZE // SET RAM SIZE
//****************************************** //******************************************
void setRAMSize_MSX() { void setRAMSize_MSX() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (msxramlo == msxramhi) if (msxramlo == msxramhi)
newmsxramsize = msxramlo; newmsxramsize = msxramlo;
else { else {
int b = 0; uint8_t b = 0;
int i = msxramlo; int i = msxramlo;
display_Clear(); display_Clear();
print_Msg(F("RAM Size: ")); print_Msg(F("RAM Size: "));
println_Msg(MSXRAM[i]); println_Msg(MSXRAM[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1202,11 +1201,11 @@ void setRAMSize_MSX() {
display_Clear(); display_Clear();
print_Msg(F("RAM Size: ")); print_Msg(F("RAM Size: "));
println_Msg(MSXRAM[i]); println_Msg(MSXRAM[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1229,11 +1228,11 @@ void setRAMSize_MSX() {
display_Clear(); display_Clear();
print_Msg(F("RAM Size: ")); print_Msg(F("RAM Size: "));
println_Msg(MSXRAM[i]); println_Msg(MSXRAM[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1273,13 +1272,13 @@ setram:
if (msxmapper == 7) { // Koei 8K/32K if (msxmapper == 7) { // Koei 8K/32K
if (newmsxramsize == 3) { // 16K if (newmsxramsize == 3) { // 16K
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setram; goto setram;
} }
} }
if (newmsxramsize > msxramhi) { if (newmsxramsize > msxramhi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setram; goto setram;
} }
} }
@ -1311,11 +1310,11 @@ void checkStatus_MSX() {
EEPROM_writeAnything(10, msxramsize); EEPROM_writeAnything(10, msxramsize);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("MSX READER")); println_Msg(F("MSX READER"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: ")); print_Msg(F("MAPPER: "));
println_Msg(msxmapper); println_Msg(msxmapper);
printMapper(msxmapper); printMapper(msxmapper);
@ -1342,12 +1341,12 @@ void checkStatus_MSX() {
Serial.print(F("CURRENT RAM SIZE: ")); Serial.print(F("CURRENT RAM SIZE: "));
Serial.print(MSXRAM[msxramsize]); Serial.print(MSXRAM[msxramsize]);
Serial.println(F("K")); Serial.println(F("K"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
void printMapper(byte msxmaplabel) { void printMapper(byte msxmaplabel) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
switch (msxmaplabel) { switch (msxmaplabel) {
case 0: case 0:
println_Msg(F("NONE")); println_Msg(F("NONE"));
@ -1464,7 +1463,7 @@ bool readVals_MSX(char* msxgame, char* msxmm, char* msxrr, char* msxss, char* ms
bool getCartListInfo_MSX() { bool getCartListInfo_MSX() {
bool buttonreleased = 0; bool buttonreleased = 0;
bool cartselected = 0; bool cartselected = 0;
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F(" HOLD TO FAST CYCLE")); println_Msg(F(" HOLD TO FAST CYCLE"));
display_Update(); display_Update();
@ -1472,9 +1471,9 @@ bool getCartListInfo_MSX() {
Serial.println(F("HOLD BUTTON TO FAST CYCLE")); Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
#endif #endif
delay(2000); delay(2000);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Held - Fast Cycle if (buttonVal1 == LOW) { // Button Held - Fast Cycle
@ -1483,19 +1482,19 @@ bool getCartListInfo_MSX() {
if (strcmp(msxcsvEND, msxgame) == 0) { if (strcmp(msxcsvEND, msxgame) == 0) {
msxcsvFile.seek(0); // Restart msxcsvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(msxgame); println_Msg(msxgame);
display_Update(); display_Update();
#else #else
Serial.print(F("CART TITLE:")); Serial.print(F("CART TITLE:"));
Serial.println(msxgame); Serial.println(msxgame);
#endif #endif
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -1508,41 +1507,41 @@ bool getCartListInfo_MSX() {
} }
} }
} }
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) // Button Released if (buttonVal1 == HIGH) // Button Released
break; break;
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("FAST CYCLE OFF")); println_Msg(F("FAST CYCLE OFF"));
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("FAST CYCLE OFF")); Serial.println(F("FAST CYCLE OFF"));
Serial.println(F("PRESS BUTTON TO STEP FORWARD")); Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
Serial.println(F("DOUBLE CLICK TO STEP BACK")); Serial.println(F("DOUBLE CLICK TO STEP BACK"));
Serial.println(F("HOLD TO SELECT")); Serial.println(F("HOLD TO SELECT"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
while (readVals_MSX(msxgame, msxmm, msxrr, msxss, msxll)) { while (readVals_MSX(msxgame, msxmm, msxrr, msxss, msxll)) {
if (strcmp(msxcsvEND, msxgame) == 0) { if (strcmp(msxcsvEND, msxgame) == 0) {
msxcsvFile.seek(0); // Restart msxcsvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(msxgame); println_Msg(msxgame);
display.setCursor(0, 48); display.setCursor(0, 48);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1552,7 +1551,7 @@ bool getCartListInfo_MSX() {
Serial.println(msxgame); Serial.println(msxgame);
#endif #endif
while (1) { // Single Step while (1) { // Single Step
int b = checkButton(); uint8_t b = checkButton();
if (b == 1) { // Continue (press) if (b == 1) { // Continue (press)
break; break;
} }
@ -1570,7 +1569,7 @@ bool getCartListInfo_MSX() {
EEPROM_writeAnything(8, newmsxsize); EEPROM_writeAnything(8, newmsxsize);
EEPROM_writeAnything(10, newmsxramsize); EEPROM_writeAnything(10, newmsxramsize);
cartselected = 1; // SELECTION MADE cartselected = 1; // SELECTION MADE
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("SELECTION MADE")); println_Msg(F("SELECTION MADE"));
display_Update(); display_Update();
#else #else
@ -1585,8 +1584,8 @@ bool getCartListInfo_MSX() {
} }
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE")); println_Msg(F("END OF FILE"));
display_Update(); display_Update();
#else #else
@ -1598,10 +1597,10 @@ bool getCartListInfo_MSX() {
void checkCSV_MSX() { void checkCSV_MSX() {
if (getCartListInfo_MSX()) { if (getCartListInfo_MSX()) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART SELECTED")); println_Msg(F("CART SELECTED"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(msxgame); println_Msg(msxgame);
display_Update(); display_Update();
// Display Settings // Display Settings
@ -1614,7 +1613,7 @@ void checkCSV_MSX() {
println_Msg(newmsxramsize); println_Msg(newmsxramsize);
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("CART SELECTED")); Serial.println(F("CART SELECTED"));
Serial.println(msxgame); Serial.println(msxgame);
// Display Settings // Display Settings
@ -1624,10 +1623,10 @@ void checkCSV_MSX() {
Serial.print(newmsxsize); Serial.print(newmsxsize);
Serial.print(F("/S")); Serial.print(F("/S"));
Serial.println(newmsxramsize); Serial.println(newmsxramsize);
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("NO SELECTION")); println_Msg(F("NO SELECTION"));
display_Update(); display_Update();
@ -1638,7 +1637,7 @@ void checkCSV_MSX() {
} }
void setCart_MSX() { void setCart_MSX() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(msxcartCSV); println_Msg(msxcartCSV);
display_Update(); display_Update();
@ -1648,7 +1647,7 @@ void setCart_MSX() {
sd.chdir(folder); // Switch Folder sd.chdir(folder); // Switch Folder
msxcsvFile = sd.open(msxcartCSV, O_READ); msxcsvFile = sd.open(msxcartCSV, O_READ);
if (!msxcsvFile) { if (!msxcsvFile) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CSV FILE NOT FOUND!")); println_Msg(F("CSV FILE NOT FOUND!"));
display_Update(); display_Update();

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// NINTENDO 64 MODULE // NINTENDO 64 MODULE
//****************************************** //******************************************
#ifdef enable_N64 #ifdef ENABLE_N64
/****************************************** /******************************************
Defines Defines
@ -39,12 +39,12 @@ boolean MN63F81MPN = false;
//ControllerTest //ControllerTest
bool quit = 1; bool quit = 1;
#ifdef savesummarytotxt #ifdef OPTION_N64_SAVESUMMARY
String CRC1 = ""; String CRC1 = "";
String CRC2 = ""; String CRC2 = "";
#endif #endif
#if !defined(enable_FLASH) #if !defined(ENABLE_FLASH)
unsigned long flashSize; unsigned long flashSize;
#endif #endif
@ -60,30 +60,23 @@ static const char n64MenuItem2[] PROGMEM = "Controller";
static const char n64MenuItem3[] PROGMEM = "Flash Repro"; static const char n64MenuItem3[] PROGMEM = "Flash Repro";
static const char n64MenuItem4[] PROGMEM = "Flash Gameshark"; static const char n64MenuItem4[] PROGMEM = "Flash Gameshark";
static const char n64MenuItem5[] PROGMEM = "Flash Xplorer 64"; static const char n64MenuItem5[] PROGMEM = "Flash Xplorer 64";
//static const char n64MenuItem6[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsN64[] PROGMEM = { n64MenuItem1, n64MenuItem2, n64MenuItem3, n64MenuItem4, n64MenuItem5, FSTRING_RESET };
static const char* const menuOptionsN64[] PROGMEM = { n64MenuItem1, n64MenuItem2, n64MenuItem3, n64MenuItem4, n64MenuItem5, string_reset2 };
// N64 controller menu items // N64 controller menu items
static const char N64ContMenuItem1[] PROGMEM = "Test Controller"; static const char N64ContMenuItem1[] PROGMEM = "Test Controller";
static const char N64ContMenuItem2[] PROGMEM = "Read ControllerPak"; static const char N64ContMenuItem2[] PROGMEM = "Read ControllerPak";
static const char N64ContMenuItem3[] PROGMEM = "Write ControllerPak"; static const char N64ContMenuItem3[] PROGMEM = "Write ControllerPak";
//static const char N64ContMenuItem4[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsN64Controller[] PROGMEM = { N64ContMenuItem1, N64ContMenuItem2, N64ContMenuItem3, FSTRING_RESET };
static const char* const menuOptionsN64Controller[] PROGMEM = { N64ContMenuItem1, N64ContMenuItem2, N64ContMenuItem3, string_reset2 };
// N64 cart menu items // N64 cart menu items
static const char N64CartMenuItem1[] PROGMEM = "Read ROM";
static const char N64CartMenuItem2[] PROGMEM = "Read Save";
static const char N64CartMenuItem3[] PROGMEM = "Write Save";
static const char N64CartMenuItem4[] PROGMEM = "Force Savetype"; static const char N64CartMenuItem4[] PROGMEM = "Force Savetype";
//static const char N64CartMenuItem5[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsN64Cart[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, N64CartMenuItem4, FSTRING_RESET };
static const char* const menuOptionsN64Cart[] PROGMEM = { N64CartMenuItem1, N64CartMenuItem2, N64CartMenuItem3, N64CartMenuItem4, string_reset2 };
// N64 CRC32 error menu items // N64 CRC32 error menu items
static const char N64CRCMenuItem1[] PROGMEM = "No"; static const char N64CRCMenuItem1[] PROGMEM = "No";
static const char N64CRCMenuItem2[] PROGMEM = "Yes and keep old"; static const char N64CRCMenuItem2[] PROGMEM = "Yes and keep old";
static const char N64CRCMenuItem3[] PROGMEM = "Yes and delete old"; static const char N64CRCMenuItem3[] PROGMEM = "Yes and delete old";
//static const char N64CRCMenuItem4[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsN64CRC[] PROGMEM = { N64CRCMenuItem1, N64CRCMenuItem2, N64CRCMenuItem3, FSTRING_RESET };
static const char* const menuOptionsN64CRC[] PROGMEM = { N64CRCMenuItem1, N64CRCMenuItem2, N64CRCMenuItem3, string_reset2 };
// Rom menu // Rom menu
static const char N64RomItem1[] PROGMEM = "4 MB"; static const char N64RomItem1[] PROGMEM = "4 MB";
@ -132,14 +125,14 @@ void n64Menu() {
display_Update(); display_Update();
setup_N64_Cart(); setup_N64_Cart();
printCartInfo_N64(); printCartInfo_N64();
mode = mode_N64_Cart; mode = CORE_N64_CART;
break; break;
case 1: case 1:
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_N64_Controller(); setup_N64_Controller();
mode = mode_N64_Controller; mode = CORE_N64_CONTROLLER;
break; break;
case 2: case 2:
@ -148,7 +141,7 @@ void n64Menu() {
setup_N64_Cart(); setup_N64_Cart();
flashRepro_N64(); flashRepro_N64();
printCartInfo_N64(); printCartInfo_N64();
mode = mode_N64_Cart; mode = CORE_N64_CART;
break; break;
case 3: case 3:
@ -157,7 +150,7 @@ void n64Menu() {
setup_N64_Cart(); setup_N64_Cart();
flashGameshark_N64(); flashGameshark_N64();
printCartInfo_N64(); printCartInfo_N64();
mode = mode_N64_Cart; mode = CORE_N64_CART;
break; break;
case 4: case 4:
@ -165,7 +158,7 @@ void n64Menu() {
display_Update(); display_Update();
setup_N64_Cart(); setup_N64_Cart();
flashXplorer_N64(); flashXplorer_N64();
mode = mode_N64_Cart; mode = CORE_N64_CART;
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
@ -192,9 +185,9 @@ void n64ControllerMenu() {
resetController(); resetController();
display_Clear(); display_Clear();
display_Update(); display_Update();
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
controllerTest_Display(); controllerTest_Display();
#elif defined(enable_serial) #elif defined(ENABLE_SERIAL)
controllerTest_Serial(); controllerTest_Serial();
#endif #endif
quit = 1; quit = 1;
@ -208,7 +201,7 @@ void n64ControllerMenu() {
readMPK(); readMPK();
verifyCRC(); verifyCRC();
validateMPK(); validateMPK();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -230,7 +223,7 @@ void n64ControllerMenu() {
writeMPK(); writeMPK();
delay(500); delay(500);
verifyMPK(); verifyMPK();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -256,7 +249,7 @@ void n64CartMenu() {
case 0: case 0:
display_Clear(); display_Clear();
sd.chdir("/"); sd.chdir("/");
#ifndef fastcrc #ifndef OPTION_N64_FASTCRC
// Dumping ROM slow // Dumping ROM slow
readRom_N64(); readRom_N64();
sd.chdir("/"); sd.chdir("/");
@ -266,7 +259,7 @@ void n64CartMenu() {
compareCRC("n64.txt", readRom_N64(), 1, 0); compareCRC("n64.txt", readRom_N64(), 1, 0);
#endif #endif
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
save_log(); save_log();
#endif #endif
@ -296,7 +289,7 @@ void n64CartMenu() {
} else { } else {
print_Error(F("Savetype Error")); print_Error(F("Savetype Error"));
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -332,7 +325,7 @@ void n64CartMenu() {
display_Update(); display_Update();
writeErrors = verifyFram(flashramType); writeErrors = verifyFram(flashramType);
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
println_Msg(""); println_Msg("");
@ -448,7 +441,7 @@ void setup_N64_Cart() {
PORTC &= ~(1 << 0); PORTC &= ~(1 << 0);
PORTC |= (1 << 1); PORTC |= (1 << 1);
#ifdef clockgen_installed #ifdef ENABLE_CLOCKGEN
// Adafruit Clock Generator // Adafruit Clock Generator
initializeClockOffset(); initializeClockOffset();
@ -479,7 +472,7 @@ void setup_N64_Cart() {
// Set sram base address // Set sram base address
sramBase = 0x08000000; sramBase = 0x08000000;
#ifdef clockgen_installed #ifdef ENABLE_CLOCKGEN
// Wait for clock generator // Wait for clock generator
clockgen.update_status(); clockgen.update_status();
#endif #endif
@ -1011,7 +1004,7 @@ void get_button() {
/****************************************** /******************************************
N64 Controller Test N64 Controller Test
*****************************************/ *****************************************/
#ifdef enable_serial #ifdef ENABLE_SERIAL
void controllerTest_Serial() { void controllerTest_Serial() {
while (quit) { while (quit) {
// Get Button and analog stick // Get Button and analog stick
@ -1038,7 +1031,7 @@ void controllerTest_Serial() {
} }
#endif #endif
#if (defined(enable_LCD) || defined(enable_OLED)) #if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
#define CENTER 64 #define CENTER 64
// on which screens do we start // on which screens do we start
int startscreen = 1; int startscreen = 1;
@ -1967,7 +1960,7 @@ void printCartInfo_N64() {
println_Msg(checksumStr); println_Msg(checksumStr);
// Wait for user input // Wait for user input
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -2189,7 +2182,7 @@ void idCart() {
strcpy(romName, cartID); strcpy(romName, cartID);
} }
#ifdef savesummarytotxt #ifdef OPTION_N64_SAVESUMMARY
// Get CRC1 // Get CRC1
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
if (sdBuffer[0x10 + i] < 0x10) { if (sdBuffer[0x10 + i] < 0x10) {
@ -2308,10 +2301,10 @@ void readEeprom() {
for (int i = 0; i < eepPages; i += sizeof(sdBuffer) / 8) { for (int i = 0; i < eepPages; i += sizeof(sdBuffer) / 8) {
// If any missing bytes error out // If any missing bytes error out
if (readEepromPageList(sdBuffer, i, sizeof(sdBuffer) / 8) == 0) { if (readEepromPageList(sdBuffer, i, sizeof(sdBuffer) / 8) == 0) {
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(error_STR, 0); print_STR(error_STR, 0);
println_Msg(F("no data received")); println_Msg(F("no data received"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
break; break;
} }
// Write 64 pages at once to the SD card // Write 64 pages at once to the SD card
@ -2546,7 +2539,7 @@ void writeFram(byte flashramType) {
// Check if empty // Check if empty
if (blankcheck_N64(flashramType) == 0) { if (blankcheck_N64(flashramType) == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
println_Msg(F("FAIL")); println_Msg(F("FAIL"));
@ -2568,7 +2561,7 @@ void writeFram(byte flashramType) {
print_Msg(F("Bank ")); print_Msg(F("Bank "));
for (byte bank = 0; bank < 8; bank++) { for (byte bank = 0; bank < 8; bank++) {
print_Msg(bank); print_Msg(bank);
print_Msg(F(" ")); print_Msg(FS(FSTRING_SPACE));
display_Update(); display_Update();
// Write one bank of 128*128 bytes // Write one bank of 128*128 bytes
@ -2824,7 +2817,7 @@ void getFramType() {
Rom functions Rom functions
*****************************************/ *****************************************/
// Read rom and save to the SD card // Read rom and save to the SD card
#ifndef fastcrc #ifndef OPTION_N64_FASTCRC
// dumping rom slow // dumping rom slow
void readRom_N64() { void readRom_N64() {
// Get name, add extension and convert to char array for sd lib // Get name, add extension and convert to char array for sd lib
@ -2993,7 +2986,7 @@ uint32_t readRom_N64() {
} }
#endif #endif
#ifdef savesummarytotxt #ifdef OPTION_N64_SAVESUMMARY
// Save an info.txt with information on the dumped rom to the SD card // Save an info.txt with information on the dumped rom to the SD card
void savesummary_N64(boolean checkfound, char crcStr[9], unsigned long timeElapsed) { void savesummary_N64(boolean checkfound, char crcStr[9], unsigned long timeElapsed) {
// Open file on sd card // Open file on sd card
@ -3044,7 +3037,7 @@ void savesummary_N64(boolean checkfound, char crcStr[9], unsigned long timeElaps
myFile.print(F("Saved To: ")); myFile.print(F("Saved To: "));
myFile.println(folder); myFile.println(folder);
#ifdef RTC_installed #ifdef ENABLE_RTC
myFile.print(F("Dumped\t: ")); myFile.print(F("Dumped\t: "));
myFile.println(RTCStamp()); myFile.println(RTCStamp());
#endif #endif
@ -3064,7 +3057,7 @@ void savesummary_N64(boolean checkfound, char crcStr[9], unsigned long timeElaps
myFile.print(F("Time\t: ")); myFile.print(F("Time\t: "));
myFile.println(timeElapsed); myFile.println(timeElapsed);
myFile.println(F(" ")); myFile.println(FSTRING_SPACE);
// Close the file: // Close the file:
myFile.close(); myFile.close();
@ -3127,11 +3120,11 @@ void flashRepro_N64() {
println_Msg(F("Unknown flashrom")); println_Msg(F("Unknown flashrom"));
print_Msg(F("ID: ")); print_Msg(F("ID: "));
print_Msg(vendorID); print_Msg(vendorID);
print_Msg(F(" ")); print_Msg(FS(FSTRING_SPACE));
print_Msg(flashid_str); print_Msg(flashid_str);
print_Msg(F(" ")); print_Msg(FS(FSTRING_SPACE));
println_Msg(cartID); println_Msg(cartID);
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
println_Msg(F("Press button for")); println_Msg(F("Press button for"));
println_Msg(F("manual config")); println_Msg(F("manual config"));
println_Msg(F("This will erase your")); println_Msg(F("This will erase your"));
@ -3294,7 +3287,7 @@ void flashRepro_N64() {
// Check if erase was successful // Check if erase was successful
if (blankcheckFlashrom_N64()) { if (blankcheckFlashrom_N64()) {
// Write flashrom // Write flashrom
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
print_Msg(F("Writing ")); print_Msg(F("Writing "));
println_Msg(filePath); println_Msg(filePath);
display_Update(); display_Update();
@ -3336,7 +3329,7 @@ void flashRepro_N64() {
display_Update(); display_Update();
writeErrors = verifyFlashrom_N64(); writeErrors = verifyFlashrom_N64();
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
print_Msg(writeErrors); print_Msg(writeErrors);
@ -4141,7 +4134,7 @@ void flashGameshark_N64() {
display_Clear(); display_Clear();
display_Update(); display_Update();
println_Msg(F("Verfied OK")); println_Msg(F("Verfied OK"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Turn Cart Reader off now")); println_Msg(F("Turn Cart Reader off now"));
display_Update(); display_Update();
while (1) while (1)
@ -4451,7 +4444,7 @@ void writeGameshark_N64() {
unsigned long verifyGameshark_N64() { unsigned long verifyGameshark_N64() {
uint32_t processedProgressBar = 0; uint32_t processedProgressBar = 0;
uint32_t totalProgressBar = (uint32_t)(fileSize); uint32_t totalProgressBar = (uint32_t)(fileSize);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
draw_progressbar(0, totalProgressBar); draw_progressbar(0, totalProgressBar);
// Open file on sd card // Open file on sd card
if (myFile.open(filePath, O_READ)) { if (myFile.open(filePath, O_READ)) {
@ -4552,7 +4545,7 @@ void flashXplorer_N64() {
display_Clear(); display_Clear();
display_Update(); display_Update();
println_Msg(F("Verfied OK")); println_Msg(F("Verfied OK"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Turn Cart Reader off now")); println_Msg(F("Turn Cart Reader off now"));
display_Update(); display_Update();
while (1); while (1);
@ -4794,7 +4787,7 @@ void writeXplorer_N64() {
unsigned long verifyXplorer_N64() { unsigned long verifyXplorer_N64() {
uint32_t processedProgressBar = 0; uint32_t processedProgressBar = 0;
uint32_t totalProgressBar = (uint32_t)(262144); uint32_t totalProgressBar = (uint32_t)(262144);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
draw_progressbar(0, totalProgressBar); draw_progressbar(0, totalProgressBar);
// Open file on sd card // Open file on sd card
if (myFile.open(filePath, O_READ)) { if (myFile.open(filePath, O_READ)) {

View File

@ -5,7 +5,7 @@
// also based on "CoolArduino" by HardWareMan // also based on "CoolArduino" by HardWareMan
// Pinout changes: LED and CIRAM_A10 // Pinout changes: LED and CIRAM_A10
#ifdef enable_NES #ifdef ENABLE_NES
//Line Content //Line Content
//28 Supported Mappers //28 Supported Mappers
@ -253,12 +253,9 @@ uint8_t newramsize;
// NES start menu // NES start menu
static const char nesMenuItem1[] PROGMEM = "Read iNES Rom"; static const char nesMenuItem1[] PROGMEM = "Read iNES Rom";
static const char nesMenuItem2[] PROGMEM = "Read PRG/CHR"; static const char nesMenuItem2[] PROGMEM = "Read PRG/CHR";
static const char nesMenuItem3[] PROGMEM = "Read Sram";
static const char nesMenuItem4[] PROGMEM = "Write Sram";
static const char nesMenuItem5[] PROGMEM = "Change Mapper"; static const char nesMenuItem5[] PROGMEM = "Change Mapper";
static const char nesMenuItem6[] PROGMEM = "Flash NESMaker"; static const char nesMenuItem6[] PROGMEM = "Flash NESMaker";
//static const char nesMenuItem7[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsNES[] PROGMEM = { nesMenuItem1, nesMenuItem2, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, nesMenuItem5, nesMenuItem6, FSTRING_RESET };
static const char* const menuOptionsNES[] PROGMEM = { nesMenuItem1, nesMenuItem2, nesMenuItem3, nesMenuItem4, nesMenuItem5, nesMenuItem6, string_reset2 };
// NES chips menu // NES chips menu
static const char nesChipsMenuItem1[] PROGMEM = "Combined PRG+CHR"; static const char nesChipsMenuItem1[] PROGMEM = "Combined PRG+CHR";
@ -283,10 +280,10 @@ void nesMenu() {
// Change working dir to root // Change working dir to root
sd.chdir("/"); sd.chdir("/");
readRom_NES(); readRom_NES();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
save_log(); save_log();
#endif #endif
display_Update(); display_Update();
@ -306,7 +303,7 @@ void nesMenu() {
sd.chdir(folder); sd.chdir(folder);
readRAM(); readRAM();
resetROM(); resetROM();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -317,7 +314,7 @@ void nesMenu() {
case 3: case 3:
writeRAM(); writeRAM();
resetROM(); resetROM();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -344,7 +341,7 @@ void nesMenu() {
display_Clear(); display_Clear();
println_Msg(F("Error:")); println_Msg(F("Error:"));
println_Msg(F("Can't write to this cartridge")); println_Msg(F("Can't write to this cartridge"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -372,10 +369,10 @@ void nesChipMenu() {
// Change working dir to root // Change working dir to root
sd.chdir("/"); sd.chdir("/");
readRaw_NES(); readRaw_NES();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
save_log(); save_log();
#endif #endif
display_Update(); display_Update();
@ -387,7 +384,7 @@ void nesChipMenu() {
CreateROMFolderInSD(); CreateROMFolderInSD();
readPRG(false); readPRG(false);
resetROM(); resetROM();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -399,7 +396,7 @@ void nesChipMenu() {
CreateROMFolderInSD(); CreateROMFolderInSD();
readCHR(false); readCHR(false);
resetROM(); resetROM();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -578,7 +575,7 @@ void getMapping() {
browseDatabase = true; browseDatabase = true;
} else { } else {
// File searched until end but nothing found // File searched until end but nothing found
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("CRC not found in database")); println_Msg(F("CRC not found in database"));
println_Msg(F("Using manual selection")); println_Msg(F("Using manual selection"));
display_Update(); display_Update();
@ -597,7 +594,7 @@ void getMapping() {
// Display database // Display database
while (database.available()) { while (database.available()) {
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Disable log to prevent unnecessary logging // Disable log to prevent unnecessary logging
dont_log = true; dont_log = true;
#endif #endif
@ -668,14 +665,14 @@ void getMapping() {
println_Msg(entry.filename); println_Msg(entry.filename);
printNESSettings(); printNESSettings();
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 0); print_STR(press_to_change_STR, 0);
if (fastScrolling > 1) if (fastScrolling > 1)
println_Msg(F(" (fast)")); println_Msg(F(" (fast)"));
else else
println_Msg(""); println_Msg("");
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 0); print_STR(rotate_to_change_STR, 0);
if (fastScrolling > 1) if (fastScrolling > 1)
println_Msg(F(" (fast)")); println_Msg(F(" (fast)"));
@ -688,11 +685,11 @@ void getMapping() {
#endif #endif
display_Update(); display_Update();
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Enable log again // Enable log again
dont_log = false; dont_log = false;
#endif #endif
int b = 0; uint8_t b = 0;
do { do {
b = checkButton(); b = checkButton();
} while (b == 0); } while (b == 0);
@ -769,7 +766,7 @@ bool selectMapping(FsFile& database) {
setRAMSize(); setRAMSize();
return 0; return 0;
} else { } else {
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Disable log to prevent unnecessary logging // Disable log to prevent unnecessary logging
println_Log(F("Select Mapping from List")); println_Log(F("Select Mapping from List"));
dont_log = true; dont_log = true;
@ -785,7 +782,7 @@ bool selectMapping(FsFile& database) {
} while (database.available() && entry.filename[0] != myLetter); } while (database.available() && entry.filename[0] != myLetter);
rewind_line(database, 3); rewind_line(database, 3);
} }
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Enable log again // Enable log again
dont_log = false; dont_log = false;
#endif #endif
@ -1184,14 +1181,14 @@ void CreateRAMFileInSD() {
*****************************************/ *****************************************/
void setMapper() { void setMapper() {
uint8_t newmapper; uint8_t newmapper;
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Disable log to prevent unnecessary logging // Disable log to prevent unnecessary logging
println_Log(F("Set Mapper manually")); println_Log(F("Set Mapper manually"));
dont_log = true; dont_log = true;
#endif #endif
// OLED // OLED
#if defined(enable_OLED) #if defined(ENABLE_OLED)
chooseMapper: chooseMapper:
// Read stored mapper // Read stored mapper
EEPROM_readAnything(7, newmapper); EEPROM_readAnything(7, newmapper);
@ -1249,7 +1246,7 @@ chooseMapper:
2 doubleClick 2 doubleClick
3 hold 3 hold
4 longHold */ 4 longHold */
int b = checkButton(); uint8_t b = checkButton();
if (b == 1) { if (b == 1) {
if (digit == 0) { if (digit == 0) {
@ -1328,20 +1325,20 @@ chooseMapper:
} }
// LCD // LCD
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
int i = 0; int i = 0;
display_Clear(); display_Clear();
mapselect = pgm_read_byte(mapsize + i * 7); mapselect = pgm_read_byte(mapsize + i * 7);
print_Msg(F("Mapper: ")); print_Msg(F("Mapper: "));
println_Msg(mapselect); println_Msg(mapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
display_Update(); display_Update();
while (1) { while (1) {
int b = checkButton(); uint8_t b = checkButton();
if (b == 2) { // Previous Mapper if (b == 2) { // Previous Mapper
if (i == 0) if (i == 0)
@ -1353,7 +1350,7 @@ chooseMapper:
mapselect = pgm_read_byte(mapsize + i * 7); mapselect = pgm_read_byte(mapsize + i * 7);
print_Msg(F("Mapper: ")); print_Msg(F("Mapper: "));
println_Msg(mapselect); println_Msg(mapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
display_Update(); display_Update();
@ -1369,7 +1366,7 @@ chooseMapper:
mapselect = pgm_read_byte(mapsize + i * 7); mapselect = pgm_read_byte(mapsize + i * 7);
print_Msg(F("Mapper: ")); print_Msg(F("Mapper: "));
println_Msg(mapselect); println_Msg(mapselect);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
display_Update(); display_Update();
@ -1389,7 +1386,7 @@ chooseMapper:
delay(500); delay(500);
// Serial Monitor // Serial Monitor
#elif defined(enable_serial) #elif defined(ENABLE_SERIAL)
setmapper: setmapper:
String newmap; String newmap;
bool mapfound = false; bool mapfound = false;
@ -1402,11 +1399,11 @@ setmapper:
Serial.print("]"); Serial.print("]");
if (i < mapcount - 1) { if (i < mapcount - 1) {
if ((i != 0) && ((i + 1) % 10 == 0)) if ((i != 0) && ((i + 1) % 10 == 0))
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
else else
Serial.print(F("\t")); Serial.print(F("\t"));
} else } else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
} }
Serial.print(F("Enter Mapper: ")); Serial.print(F("Enter Mapper: "));
while (Serial.available() == 0) {} while (Serial.available() == 0) {}
@ -1421,7 +1418,7 @@ setmapper:
} }
if (mapfound == false) { if (mapfound == false) {
Serial.println(F("MAPPER NOT SUPPORTED!")); Serial.println(F("MAPPER NOT SUPPORTED!"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
newmapper = 0; newmapper = 0;
goto setmapper; goto setmapper;
} }
@ -1430,7 +1427,7 @@ setmapper:
EEPROM_writeAnything(7, newmapper); EEPROM_writeAnything(7, newmapper);
mapper = newmapper; mapper = newmapper;
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Enable log again // Enable log again
dont_log = false; dont_log = false;
#endif #endif
@ -1453,13 +1450,13 @@ void checkMapperSize() {
} }
void setPRGSize() { void setPRGSize() {
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Disable log to prevent unnecessary logging // Disable log to prevent unnecessary logging
println_Log(F("Set PRG Size")); println_Log(F("Set PRG Size"));
dont_log = true; dont_log = true;
#endif #endif
#if (defined(enable_LCD) || defined(enable_OLED)) #if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
display_Clear(); display_Clear();
if (prglo == prghi) if (prglo == prghi)
newprgsize = prglo; newprgsize = prglo;
@ -1469,18 +1466,18 @@ void setPRGSize() {
display_Clear(); display_Clear();
print_Msg(F("PRG Size: ")); print_Msg(F("PRG Size: "));
println_Msg(pgm_read_word(&(PRG[i]))); println_Msg(pgm_read_word(&(PRG[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select")); println_Msg(F("Press right to select"));
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
display_Update(); display_Update();
while (1) { while (1) {
int b = checkButton(); uint8_t b = checkButton();
if (b == doubleclick) { // Previous if (b == doubleclick) { // Previous
if (i == prglo) if (i == prglo)
@ -1491,11 +1488,11 @@ void setPRGSize() {
display_Clear(); display_Clear();
print_Msg(F("PRG Size: ")); print_Msg(F("PRG Size: "));
println_Msg(pgm_read_word(&(PRG[i]))); println_Msg(pgm_read_word(&(PRG[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select")); println_Msg(F("Press right to select"));
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1510,11 +1507,11 @@ void setPRGSize() {
display_Clear(); display_Clear();
print_Msg(F("PRG Size: ")); print_Msg(F("PRG Size: "));
println_Msg(pgm_read_word(&(PRG[i]))); println_Msg(pgm_read_word(&(PRG[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select")); println_Msg(F("Press right to select"));
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1534,7 +1531,7 @@ void setPRGSize() {
display_Update(); display_Update();
delay(500); delay(500);
#elif defined(enable_serial) #elif defined(ENABLE_SERIAL)
if (prglo == prghi) if (prglo == prghi)
newprgsize = prglo; newprgsize = prglo;
else { else {
@ -1554,7 +1551,7 @@ setprg:
newprgsize = sizePRG.toInt() + prglo; newprgsize = sizePRG.toInt() + prglo;
if (newprgsize > prghi) { if (newprgsize > prghi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setprg; goto setprg;
} }
} }
@ -1565,20 +1562,20 @@ setprg:
EEPROM_writeAnything(8, newprgsize); EEPROM_writeAnything(8, newprgsize);
prgsize = newprgsize; prgsize = newprgsize;
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Enable log again // Enable log again
dont_log = false; dont_log = false;
#endif #endif
} }
void setCHRSize() { void setCHRSize() {
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Disable log to prevent unnecessary logging // Disable log to prevent unnecessary logging
println_Log(F("Set CHR Size")); println_Log(F("Set CHR Size"));
dont_log = true; dont_log = true;
#endif #endif
#if (defined(enable_LCD) || defined(enable_OLED)) #if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
display_Clear(); display_Clear();
if (chrlo == chrhi) if (chrlo == chrhi)
newchrsize = chrlo; newchrsize = chrlo;
@ -1588,18 +1585,18 @@ void setCHRSize() {
display_Clear(); display_Clear();
print_Msg(F("CHR Size: ")); print_Msg(F("CHR Size: "));
println_Msg(pgm_read_word(&(CHR[i]))); println_Msg(pgm_read_word(&(CHR[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select")); println_Msg(F("Press right to select"));
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
display_Update(); display_Update();
while (1) { while (1) {
int b = checkButton(); uint8_t b = checkButton();
if (b == doubleclick) { // Previous if (b == doubleclick) { // Previous
if (i == chrlo) if (i == chrlo)
@ -1610,11 +1607,11 @@ void setCHRSize() {
display_Clear(); display_Clear();
print_Msg(F("CHR Size: ")); print_Msg(F("CHR Size: "));
println_Msg(pgm_read_word(&(CHR[i]))); println_Msg(pgm_read_word(&(CHR[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select")); println_Msg(F("Press right to select"));
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1630,11 +1627,11 @@ void setCHRSize() {
display_Clear(); display_Clear();
print_Msg(F("CHR Size: ")); print_Msg(F("CHR Size: "));
println_Msg(pgm_read_word(&(CHR[i]))); println_Msg(pgm_read_word(&(CHR[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select")); println_Msg(F("Press right to select"));
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1654,7 +1651,7 @@ void setCHRSize() {
display_Update(); display_Update();
delay(500); delay(500);
#elif defined(enable_serial) #elif defined(ENABLE_SERIAL)
if (chrlo == chrhi) if (chrlo == chrhi)
newchrsize = chrlo; newchrsize = chrlo;
else { else {
@ -1674,7 +1671,7 @@ setchr:
newchrsize = sizeCHR.toInt() + chrlo; newchrsize = sizeCHR.toInt() + chrlo;
if (newchrsize > chrhi) { if (newchrsize > chrhi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setchr; goto setchr;
} }
} }
@ -1685,20 +1682,20 @@ setchr:
EEPROM_writeAnything(9, newchrsize); EEPROM_writeAnything(9, newchrsize);
chrsize = newchrsize; chrsize = newchrsize;
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Enable log again // Enable log again
dont_log = false; dont_log = false;
#endif #endif
} }
void setRAMSize() { void setRAMSize() {
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Disable log to prevent unnecessary logging // Disable log to prevent unnecessary logging
println_Log(F("Set RAM Size")); println_Log(F("Set RAM Size"));
dont_log = true; dont_log = true;
#endif #endif
#if (defined(enable_LCD) || defined(enable_OLED)) #if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
display_Clear(); display_Clear();
if (ramlo == ramhi) if (ramlo == ramhi)
newramsize = ramlo; newramsize = ramlo;
@ -1722,18 +1719,18 @@ void setRAMSize() {
println_Msg(i * 5); println_Msg(i * 5);
else else
println_Msg(pgm_read_byte(&(RAM[i]))); println_Msg(pgm_read_byte(&(RAM[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select")); println_Msg(F("Press right to select"));
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
display_Update(); display_Update();
while (1) { while (1) {
int b = checkButton(); uint8_t b = checkButton();
if (b == doubleclick) { // Previous Mapper if (b == doubleclick) { // Previous Mapper
if (i == 0) if (i == 0)
@ -1758,11 +1755,11 @@ void setRAMSize() {
println_Msg(i * 5); println_Msg(i * 5);
else else
println_Msg(pgm_read_byte(&(RAM[i]))); println_Msg(pgm_read_byte(&(RAM[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select")); println_Msg(F("Press right to select"));
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1792,11 +1789,11 @@ void setRAMSize() {
println_Msg(i * 5); println_Msg(i * 5);
else else
println_Msg(pgm_read_byte(&(RAM[i]))); println_Msg(pgm_read_byte(&(RAM[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select")); println_Msg(F("Press right to select"));
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -1845,7 +1842,7 @@ void setRAMSize() {
display_Update(); display_Update();
delay(500); delay(500);
#elif defined(enable_serial) #elif defined(ENABLE_SERIAL)
if (ramlo == ramhi) if (ramlo == ramhi)
newramsize = ramlo; newramsize = ramlo;
else { else {
@ -1883,7 +1880,7 @@ setram:
newramsize = sizeRAM.toInt() + ramlo; newramsize = sizeRAM.toInt() + ramlo;
if (newramsize > ramhi) { if (newramsize > ramhi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setram; goto setram;
} }
} }
@ -1896,7 +1893,7 @@ setram:
sizeEEP = pgm_read_byte(&(RAM[newramsize])) * 16; sizeEEP = pgm_read_byte(&(RAM[newramsize])) * 16;
Serial.print(sizeEEP); Serial.print(sizeEEP);
Serial.println(F("B")); Serial.println(F("B"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
} else if (mapper == 19) { } else if (mapper == 19) {
Serial.print(F("RAM Size = ")); Serial.print(F("RAM Size = "));
if (newramsize == 2) if (newramsize == 2)
@ -1905,12 +1902,12 @@ setram:
Serial.print(pgm_read_byte(&(RAM[newramsize]))); Serial.print(pgm_read_byte(&(RAM[newramsize])));
Serial.println(F("K")); Serial.println(F("K"));
} }
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
} else if (mapper == 80) { } else if (mapper == 80) {
Serial.print(F("RAM Size = ")); Serial.print(F("RAM Size = "));
Serial.print(pgm_read_byte(&(RAM[newramsize])) * 16); Serial.print(pgm_read_byte(&(RAM[newramsize])) * 16);
Serial.println(F("B")); Serial.println(F("B"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
} else { } else {
Serial.print(F("RAM Size = ")); Serial.print(F("RAM Size = "));
if (mapper == 0) if (mapper == 0)
@ -1920,13 +1917,13 @@ setram:
else else
Serial.print(pgm_read_byte(&(RAM[newramsize]))); Serial.print(pgm_read_byte(&(RAM[newramsize])));
Serial.println(F("K")); Serial.println(F("K"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
} }
#endif #endif
EEPROM_writeAnything(10, newramsize); EEPROM_writeAnything(10, newramsize);
ramsize = newramsize; ramsize = newramsize;
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
// Enable log again // Enable log again
dont_log = false; dont_log = false;
#endif #endif
@ -1974,11 +1971,11 @@ void checkStatus_NES() {
display_Clear(); display_Clear();
println_Msg(F("NES CART READER")); println_Msg(F("NES CART READER"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
printNESSettings(); printNESSettings();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -3284,7 +3281,7 @@ void readPRG(bool readrom) {
myFile.close(); myFile.close();
println_Msg(F("PRG FILE DUMPED!")); println_Msg(F("PRG FILE DUMPED!"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Update(); display_Update();
} }
} }
@ -4263,7 +4260,7 @@ void readCHR(bool readrom) {
myFile.close(); myFile.close();
println_Msg(F("CHR FILE DUMPED!")); println_Msg(F("CHR FILE DUMPED!"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Update(); display_Update();
} }
} }
@ -4448,7 +4445,7 @@ void readRAM() {
myFile.close(); myFile.close();
println_Msg(F("RAM FILE DUMPED!")); println_Msg(F("RAM FILE DUMPED!"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Update(); display_Update();
if ((mapper == 16) || (mapper == 159)) if ((mapper == 16) || (mapper == 159))
@ -4679,7 +4676,7 @@ void writeRAM() {
myFile.close(); myFile.close();
LED_GREEN_ON; LED_GREEN_ON;
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("RAM FILE WRITTEN!")); println_Msg(F("RAM FILE WRITTEN!"));
display_Update(); display_Update();
@ -4966,9 +4963,9 @@ void writeFLASH() {
} else { } else {
print_Msg(F("Flash ID: ")); print_Msg(F("Flash ID: "));
println_Msg(flashid_str); println_Msg(flashid_str);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("NESmaker Flash Found")); println_Msg(F("NESmaker Flash Found"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
display_Update(); display_Update();
delay(100); delay(100);
@ -5016,19 +5013,19 @@ void writeFLASH() {
} }
} }
#if (defined(enable_LCD) || defined(enable_OLED)) #if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
display.print(F("*")); display.print(F("*"));
display.updateDisplay(); display.updateDisplay();
#else #else
Serial.print(F("*")); Serial.print(F("*"));
if ((i != 0) && ((i + 1) % 16 == 0)) if ((i != 0) && ((i + 1) % 16 == 0))
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
myFile.close(); myFile.close();
LED_GREEN_ON; LED_GREEN_ON;
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("FLASH FILE WRITTEN!")); println_Msg(F("FLASH FILE WRITTEN!"));
display_Update(); display_Update();
} else { } else {

View File

@ -1,13 +1,10 @@
//****************************************** //******************************************
// NGP MODULE // NGP MODULE
//****************************************** //******************************************
#ifdef enable_NGP #ifdef ENABLE_NGP
static const char ngpMenuItem1[] PROGMEM = "Read ROM";
static const char ngpMenuItem2[] PROGMEM = "Read chip info"; static const char ngpMenuItem2[] PROGMEM = "Read chip info";
static const char ngpMenuItem3[] PROGMEM = "Change ROM size"; static const char* const menuOptionsNGP[] PROGMEM = { FSTRING_READ_ROM, ngpMenuItem2, FSTRING_SET_SIZE, FSTRING_RESET };
//static const char ngpMenuItemReset[] PROGMEM = "Reset"; (stored in common strings array)
static const char* const menuOptionsNGP[] PROGMEM = { ngpMenuItem1, ngpMenuItem2, ngpMenuItem3, string_reset2 };
static const char ngpRomItem1[] PROGMEM = "4 Mbits / 512 KB"; static const char ngpRomItem1[] PROGMEM = "4 Mbits / 512 KB";
static const char ngpRomItem2[] PROGMEM = "8 Mbits / 1 MB"; static const char ngpRomItem2[] PROGMEM = "8 Mbits / 1 MB";
@ -80,7 +77,7 @@ void ngpMenu() {
break; break;
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// MAGNAVOX ODYSSEY 2 MODULE // MAGNAVOX ODYSSEY 2 MODULE
//****************************************** //******************************************
#if defined(enable_ODY2) #if defined(ENABLE_ODY2)
// Magnavox Odyssey 2 // Magnavox Odyssey 2
// Philips Videopac/Videopac+ // Philips Videopac/Videopac+
// Cartridge Pinout // Cartridge Pinout
@ -62,11 +62,7 @@ byte newody2size;
// Menu // Menu
//****************************************** //******************************************
// Base Menu // Base Menu
static const char ody2MenuItem1[] PROGMEM = "Select Cart"; static const char* const menuOptionsODY2[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
static const char ody2MenuItem2[] PROGMEM = "Read ROM";
static const char ody2MenuItem3[] PROGMEM = "Set Size";
static const char ody2MenuItem4[] PROGMEM = "Reset";
static const char* const menuOptionsODY2[] PROGMEM = { ody2MenuItem1, ody2MenuItem2, ody2MenuItem3, ody2MenuItem4 };
void setup_ODY2() { void setup_ODY2() {
// Request 5V // Request 5V
@ -109,7 +105,7 @@ void setup_ODY2() {
checkStatus_ODY2(); checkStatus_ODY2();
strcpy(romName, "ODYSSEY2"); strcpy(romName, "ODYSSEY2");
mode = mode_ODY2; mode = CORE_ODY2;
} }
void ody2Menu() { void ody2Menu() {
@ -274,7 +270,7 @@ void readROM_ODY2() {
unsigned long crcsize = ODY2[ody2size] * 0x400; unsigned long crcsize = ODY2[ody2size] * 0x400;
calcCRC(fileName, crcsize, NULL, 0); calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
@ -285,22 +281,22 @@ void readROM_ODY2() {
//****************************************** //******************************************
void setROMSize_ODY2() { void setROMSize_ODY2() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (ody2lo == ody2hi) if (ody2lo == ody2hi)
newody2size = ody2lo; newody2size = ody2lo;
else { else {
int b = 0; uint8_t b = 0;
int i = ody2lo; int i = ody2lo;
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(ODY2[i]); println_Msg(ODY2[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -318,11 +314,11 @@ void setROMSize_ODY2() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(ODY2[i]); println_Msg(ODY2[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -338,11 +334,11 @@ void setROMSize_ODY2() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(ODY2[i]); println_Msg(ODY2[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -380,7 +376,7 @@ setrom:
newody2size = sizeROM.toInt() + ody2lo; newody2size = sizeROM.toInt() + ody2lo;
if (newody2size > ody2hi) { if (newody2size > ody2hi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
@ -404,11 +400,11 @@ void checkStatus_ODY2() {
EEPROM_writeAnything(8, ody2size); EEPROM_writeAnything(8, ody2size);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("ODYSSEY 2 READER")); println_Msg(F("ODYSSEY 2 READER"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: ")); print_Msg(F("MAPPER: "));
println_Msg(ody2mapper); println_Msg(ody2mapper);
print_Msg(F("ROM SIZE: ")); print_Msg(F("ROM SIZE: "));
@ -422,7 +418,7 @@ void checkStatus_ODY2() {
Serial.print(F("CURRENT ROM SIZE: ")); Serial.print(F("CURRENT ROM SIZE: "));
Serial.print(ODY2[ody2size]); Serial.print(ODY2[ody2size]);
Serial.println(F("K")); Serial.println(F("K"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
@ -478,7 +474,7 @@ bool readVals_ODY2(char* ody2game, char* ody2mm, char* ody2rr, char* ody2ll) {
bool getCartListInfo_ODY2() { bool getCartListInfo_ODY2() {
bool buttonreleased = 0; bool buttonreleased = 0;
bool cartselected = 0; bool cartselected = 0;
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F(" HOLD TO FAST CYCLE")); println_Msg(F(" HOLD TO FAST CYCLE"));
display_Update(); display_Update();
@ -486,9 +482,9 @@ bool getCartListInfo_ODY2() {
Serial.println(F("HOLD BUTTON TO FAST CYCLE")); Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
#endif #endif
delay(2000); delay(2000);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Held - Fast Cycle if (buttonVal1 == LOW) { // Button Held - Fast Cycle
@ -497,19 +493,19 @@ bool getCartListInfo_ODY2() {
if (strcmp(ody2csvEND, ody2game) == 0) { if (strcmp(ody2csvEND, ody2game) == 0) {
ody2csvFile.seek(0); // Restart ody2csvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(ody2game); println_Msg(ody2game);
display_Update(); display_Update();
#else #else
Serial.print(F("CART TITLE:")); Serial.print(F("CART TITLE:"));
Serial.println(ody2game); Serial.println(ody2game);
#endif #endif
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -522,41 +518,41 @@ bool getCartListInfo_ODY2() {
} }
} }
} }
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2 buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) // Button Released if (buttonVal1 == HIGH) // Button Released
break; break;
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("FAST CYCLE OFF")); println_Msg(F("FAST CYCLE OFF"));
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("FAST CYCLE OFF")); Serial.println(F("FAST CYCLE OFF"));
Serial.println(F("PRESS BUTTON TO STEP FORWARD")); Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
Serial.println(F("DOUBLE CLICK TO STEP BACK")); Serial.println(F("DOUBLE CLICK TO STEP BACK"));
Serial.println(F("HOLD TO SELECT")); Serial.println(F("HOLD TO SELECT"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
while (readVals_ODY2(ody2game, ody2mm, ody2rr, ody2ll)) { while (readVals_ODY2(ody2game, ody2mm, ody2rr, ody2ll)) {
if (strcmp(ody2csvEND, ody2game) == 0) { if (strcmp(ody2csvEND, ody2game) == 0) {
ody2csvFile.seek(0); // Restart ody2csvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(ody2game); println_Msg(ody2game);
display.setCursor(0, 48); display.setCursor(0, 48);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -566,7 +562,7 @@ bool getCartListInfo_ODY2() {
Serial.println(ody2game); Serial.println(ody2game);
#endif #endif
while (1) { // Single Step while (1) { // Single Step
int b = checkButton(); uint8_t b = checkButton();
if (b == 1) { // Continue (press) if (b == 1) { // Continue (press)
break; break;
} }
@ -582,7 +578,7 @@ bool getCartListInfo_ODY2() {
EEPROM_writeAnything(7, newody2mapper); EEPROM_writeAnything(7, newody2mapper);
EEPROM_writeAnything(8, newody2size); EEPROM_writeAnything(8, newody2size);
cartselected = 1; // SELECTION MADE cartselected = 1; // SELECTION MADE
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("SELECTION MADE")); println_Msg(F("SELECTION MADE"));
display_Update(); display_Update();
#else #else
@ -597,8 +593,8 @@ bool getCartListInfo_ODY2() {
} }
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE")); println_Msg(F("END OF FILE"));
display_Update(); display_Update();
#else #else
@ -610,10 +606,10 @@ bool getCartListInfo_ODY2() {
void checkCSV_ODY2() { void checkCSV_ODY2() {
if (getCartListInfo_ODY2()) { if (getCartListInfo_ODY2()) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART SELECTED")); println_Msg(F("CART SELECTED"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(ody2game); println_Msg(ody2game);
display_Update(); display_Update();
// Display Settings // Display Settings
@ -624,7 +620,7 @@ void checkCSV_ODY2() {
println_Msg(newody2size); println_Msg(newody2size);
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("CART SELECTED")); Serial.println(F("CART SELECTED"));
Serial.println(ody2game); Serial.println(ody2game);
// Display Settings // Display Settings
@ -632,10 +628,10 @@ void checkCSV_ODY2() {
Serial.print(newody2mapper); Serial.print(newody2mapper);
Serial.print(F("/R")); Serial.print(F("/R"));
Serial.println(newody2size); Serial.println(newody2size);
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("NO SELECTION")); println_Msg(F("NO SELECTION"));
display_Update(); display_Update();
@ -646,7 +642,7 @@ void checkCSV_ODY2() {
} }
void setCart_ODY2() { void setCart_ODY2() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(ody2cartCSV); println_Msg(ody2cartCSV);
display_Update(); display_Update();
@ -656,7 +652,7 @@ void setCart_ODY2() {
sd.chdir(folder); // Switch Folder sd.chdir(folder); // Switch Folder
ody2csvFile = sd.open(ody2cartCSV, O_READ); ody2csvFile = sd.open(ody2cartCSV, O_READ);
if (!ody2csvFile) { if (!ody2csvFile) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CSV FILE NOT FOUND!")); println_Msg(F("CSV FILE NOT FOUND!"));
display_Update(); display_Update();

View File

@ -35,6 +35,7 @@
* CHANGES : * CHANGES :
* *
* REF NO VERSION DATE WHO DETAIL * REF NO VERSION DATE WHO DETAIL
* 13.2 2024-03-02 Ancyker Add string constants
* 13.2 2024-02-29 Ancyker Add config support * 13.2 2024-02-29 Ancyker Add config support
* 12.5 2023-03-29 Ancyker Initial version * 12.5 2023-03-29 Ancyker Initial version
* *
@ -42,10 +43,36 @@
#include "OSCR.h" #include "OSCR.h"
/*==== VARIABLES ==================================================*/ /*==== CONSTANTS ==================================================*/
/**
* String Constants
**/
// Firmware Version // Firmware Version
char ver[5] = "13.2"; constexpr char PROGMEM FSTRING_VERSION[] = "V13.2";
// Universal
constexpr char PROGMEM FSTRING_RESET[] = "Reset";
constexpr char PROGMEM FSTRING_OK[] = "OK";
constexpr char PROGMEM FSTRING_EMPTY[] = "";
constexpr char PROGMEM FSTRING_SPACE[] = " ";
// Messages
constexpr char PROGMEM FSTRING_OSCR[] = "OSCR";
constexpr char PROGMEM FSTRING_MODULE_NOT_ENABLED[] = "Module is not enabled.";
// Cart
constexpr char PROGMEM FSTRING_READ_ROM[] = "Read ROM";
constexpr char PROGMEM FSTRING_READ_SAVE[] = "Read Save";
constexpr char PROGMEM FSTRING_WRITE_SAVE[] = "Write Save";
constexpr char PROGMEM FSTRING_SELECT_CART[] = "Select Cart";
constexpr char PROGMEM FSTRING_SELECT_CART_TYPE[] = "Select Cart Type";
constexpr char PROGMEM FSTRING_SET_SIZE[] = "Set Size";
constexpr char PROGMEM FSTRING_REFRESH_CART[] = "Refresh Cart";
/*==== /CONSTANTS =================================================*/
/*==== VARIABLES ==================================================*/
// Clock speed // Clock speed
unsigned long clock = CS_16MHZ; unsigned long clock = CS_16MHZ;
@ -56,17 +83,12 @@ VOLTS voltage = VOLTS_SET_5V;
#if defined(ENABLE_CONFIG) #if defined(ENABLE_CONFIG)
FsFile configFile; FsFile configFile;
bool useConfig = false; bool useConfig;
# if defined(global_log) # if defined(ENABLE_GLOBAL_LOG)
// Logging // Logging
bool loggingEnabled = true; bool loggingEnabled = true;
# endif /* global_log */ # endif /* ENABLE_GLOBAL_LOG */
#else /* !ENABLE_CONFIG */
# if defined(global_log)
// Logging: Define it as true using a const instead.
const bool loggingEnabled = true;
# endif /* global_log */
#endif /* ENABLE_CONFIG */ #endif /* ENABLE_CONFIG */
/*==== /VARIABLES =================================================*/ /*==== /VARIABLES =================================================*/
@ -77,11 +99,11 @@ const bool loggingEnabled = true;
* DESCRIPTION : Prints the version & feature string to serial * DESCRIPTION : Prints the version & feature string to serial
* *
*F*/ *F*/
#if !defined(enable_serial) && defined(ENABLE_UPDATER) #if !defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
void printVersionToSerial() { void printVersionToSerial() {
ClockedSerial.print(F("OSCR")); ClockedSerial.print(FS(FSTRING_OSCR));
ClockedSerial.print(F("::")); ClockedSerial.print(F("::"));
ClockedSerial.print(ver); ClockedSerial.print(FS(FSTRING_VERSION));
ClockedSerial.print(F("//")); ClockedSerial.print(F("//"));
#if defined(HW1) #if defined(HW1)
ClockedSerial.print(F("HW1")); ClockedSerial.print(F("HW1"));
@ -101,20 +123,20 @@ void printVersionToSerial() {
#if defined (ENABLE_VSELECT) #if defined (ENABLE_VSELECT)
ClockedSerial.print(F("|VSELECT")); ClockedSerial.print(F("|VSELECT"));
#endif #endif
#if defined (RTC_installed) #if defined (ENABLE_RTC)
ClockedSerial.print(F("|RTC")); ClockedSerial.print(F("|RTC"));
#endif #endif
#if defined (clockgen_installed) #if defined (ENABLE_CLOCKGEN)
ClockedSerial.print(F("|CLOCKGEN")); ClockedSerial.print(F("|CLOCKGEN"));
#endif #endif
#if defined (fastcrc) #if defined (OPTION_N64_FASTCRC)
ClockedSerial.print(F("|FASTCRC")); ClockedSerial.print(F("|FASTCRC"));
#endif #endif
#if defined (ENABLE_3V3FIX) #if defined (ENABLE_3V3FIX)
ClockedSerial.print(F("|3V3FIX")); ClockedSerial.print(F("|3V3FIX"));
#endif #endif
ClockedSerial.println(F("")); ClockedSerial.println(FS(FSTRING_EMPTY));
} }
#else #else
void printVersionToSerial() {} void printVersionToSerial() {}
@ -236,14 +258,14 @@ VOLTS setVoltage(VOLTS newVoltage) {
// Adjust clock speed when 3V3FIX is enabled // Adjust clock speed when 3V3FIX is enabled
#if defined(ENABLE_3V3FIX) #if defined(ENABLE_3V3FIX)
// Stop serial if running // Stop serial if running
#if !defined(enable_serial) && defined(ENABLE_UPDATER) #if !defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
ClockedSerial.end(); ClockedSerial.end();
#endif #endif
// Set clock speed // Set clock speed
clock = CS_16MHZ; clock = CS_16MHZ;
setClockScale(newVoltage); /*[2]*/ setClockScale(newVoltage); /*[2]*/
// Restart serial // Restart serial
#if !defined(enable_serial) && defined(ENABLE_UPDATER) #if !defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
ClockedSerial.begin(UPD_BAUD); ClockedSerial.begin(UPD_BAUD);
#endif #endif
#else #else
@ -269,13 +291,13 @@ VOLTS setVoltage(VOLTS newVoltage) {
// Adjust clock speed when 3V3FIX is enabled // Adjust clock speed when 3V3FIX is enabled
#if defined(ENABLE_3V3FIX) #if defined(ENABLE_3V3FIX)
#if !defined(enable_serial) && defined(ENABLE_UPDATER) #if !defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
ClockedSerial.end(); ClockedSerial.end();
#endif #endif
// Set clock speed // Set clock speed
clock = CS_8MHZ; clock = CS_8MHZ;
setClockScale(newVoltage); /*[2]*/ setClockScale(newVoltage); /*[2]*/
#if !defined(enable_serial) && defined(ENABLE_UPDATER) #if !defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
ClockedSerial.begin(UPD_BAUD); ClockedSerial.begin(UPD_BAUD);
#endif #endif
#endif #endif

View File

@ -15,20 +15,255 @@
#include "Config.h" #include "Config.h"
/*==== SANITY CHECKS ==============================================*/ /*==== SANITY CHECKS ==============================================*/
#if !(defined(HW1) || defined(HW2) || defined(HW3) || defined(HW4) || defined(HW5) || defined(SERIAL_MONITOR)) # if !(defined(HW1) || defined(HW2) || defined(HW3) || defined(HW4) || defined(HW5) || defined(SERIAL_MONITOR))
#error !!! PLEASE CHOOSE HARDWARE VERSION IN CONFIG.H !!! # error !!! PLEASE CHOOSE HARDWARE VERSION IN CONFIG.H !!!
#endif # endif
#if defined(ENABLE_3V3FIX) && !defined(ENABLE_VSELECT) # if defined(ENABLE_3V3FIX) && !defined(ENABLE_VSELECT)
#warning Using 3V3FIX is best with VSELECT. # warning Using 3V3FIX is best with VSELECT.
#endif # endif
/*==== CONSTANTS ==================================================*/ /*==== CONSTANTS ==================================================*/
/**
* String Constants
**/
// Version
extern const char PROGMEM FSTRING_VERSION[];
// Universal
extern const char PROGMEM FSTRING_OK[];
extern const char PROGMEM FSTRING_EMPTY[];
extern const char PROGMEM FSTRING_SPACE[];
extern const char PROGMEM FSTRING_RESET[];
// Messages
extern const char PROGMEM FSTRING_OSCR[];
extern const char PROGMEM FSTRING_MODULE_NOT_ENABLED[];
// Cart
extern const char PROGMEM FSTRING_READ_ROM[];
extern const char PROGMEM FSTRING_READ_SAVE[];
extern const char PROGMEM FSTRING_WRITE_SAVE[];
extern const char PROGMEM FSTRING_SELECT_CART[];
extern const char PROGMEM FSTRING_SELECT_CART_TYPE[];
extern const char PROGMEM FSTRING_SET_SIZE[];
extern const char PROGMEM FSTRING_REFRESH_CART[];
#define FS(pmem_string) (reinterpret_cast<const __FlashStringHelper *>(pmem_string))
/**
* Other Constants
**/
// Updater baud rate // Updater baud rate
const uint16_t UPD_BAUD = 9600; constexpr uint16_t UPD_BAUD = 9600;
// Clock speeds // Clock speeds
const unsigned long CS_16MHZ = 16000000UL; constexpr unsigned long CS_16MHZ = 16000000UL;
const unsigned long CS_8MHZ = 8000000UL; constexpr unsigned long CS_8MHZ = 8000000UL;
enum CORES: uint8_t {
# ifdef ENABLE_N64
CORE_N64_CART,
CORE_N64_CONTROLLER,
# endif
# ifdef ENABLE_SNES
CORE_SNES,
# endif
# ifdef ENABLE_SFM
CORE_SFM,
# ifdef ENABLE_FLASH
CORE_SFM_FLASH,
# endif
CORE_SFM_GAME,
# endif
# ifdef ENABLE_GBX
CORE_GB,
CORE_GBA,
CORE_GBM,
CORE_GB_GBSMART,
CORE_GB_GBSMART_FLASH,
CORE_GB_GBSMART_GAME,
# endif
# ifdef ENABLE_FLASH
CORE_FLASH8,
# ifdef ENABLE_FLASH16
CORE_FLASH16,
CORE_EPROM,
# endif
# endif
# ifdef ENABLE_MD
CORE_MD_CART,
CORE_SEGA_CD,
# endif
# ifdef ENABLE_PCE
CORE_PCE,
# endif
# ifdef ENABLE_SV
CORE_SV,
# endif
# ifdef ENABLE_NES
CORE_NES,
# endif
# ifdef ENABLE_SMS
CORE_SMS,
# endif
# ifdef ENABLE_WS
CORE_WS,
# endif
# ifdef ENABLE_NGP
CORE_NGP,
# endif
# ifdef ENABLE_INTV
CORE_INTV,
# endif
# ifdef ENABLE_COLV
CORE_COL,
# endif
# ifdef ENABLE_VBOY
CORE_VBOY,
# endif
# ifdef ENABLE_WSV
CORE_WSV,
# endif
# ifdef ENABLE_PCW
CORE_PCW,
# endif
# ifdef ENABLE_ODY2
CORE_ODY2,
# endif
# ifdef ENABLE_ARC
CORE_ARC,
# endif
# ifdef ENABLE_FAIRCHILD
CORE_FAIRCHILD,
# endif
# ifdef ENABLE_SUPRACAN
CORE_SUPRACAN,
# endif
# ifdef ENABLE_MSX
CORE_MSX,
# endif
# ifdef ENABLE_POKE
CORE_POKE,
# endif
# ifdef ENABLE_LOOPY
CORE_LOOPY,
# endif
# ifdef ENABLE_C64
CORE_C64,
# endif
# ifdef ENABLE_2600
CORE_2600,
# endif
# ifdef ENABLE_5200
CORE_5200,
# endif
# ifdef ENABLE_7800
CORE_7800,
# endif
# ifdef ENABLE_VECTREX
CORE_VECTREX,
# endif
# ifdef ENABLE_ST
CORE_ST,
# endif
# ifdef ENABLE_GPC
CORE_GPC,
# endif
CORE_MAX // Always last
};
enum SYSTEM_MENU: uint8_t {
# if defined(ENABLE_GBX)
SYSTEM_MENU_GBX,
# endif
# if defined(ENABLE_NES)
SYSTEM_MENU_NES,
# endif
# if defined(ENABLE_SNES)
SYSTEM_MENU_SNES,
# endif
# if defined(ENABLE_N64)
SYSTEM_MENU_N64,
# endif
# if defined(ENABLE_MD)
SYSTEM_MENU_MD,
# endif
# if defined(ENABLE_SMS)
SYSTEM_MENU_SMS,
# endif
# if defined(ENABLE_PCE)
SYSTEM_MENU_PCE,
# endif
# if defined(ENABLE_WS)
SYSTEM_MENU_WS,
# endif
# if defined(ENABLE_NGP)
SYSTEM_MENU_NGP,
# endif
# if defined(ENABLE_INTV)
SYSTEM_MENU_INTV,
# endif
# if defined(ENABLE_COLV)
SYSTEM_MENU_COLV,
# endif
# if defined(ENABLE_VBOY)
SYSTEM_MENU_VBOY,
# endif
# if defined(ENABLE_WSV)
SYSTEM_MENU_WSV,
# endif
# if defined(ENABLE_PCW)
SYSTEM_MENU_PCW,
# endif
# if defined(ENABLE_2600)
SYSTEM_MENU_2600,
# endif
# if defined(ENABLE_ODY2)
SYSTEM_MENU_ODY2,
# endif
# if defined(ENABLE_ARC)
SYSTEM_MENU_ARC,
# endif
# if defined(ENABLE_FAIRCHILD)
SYSTEM_MENU_FAIRCHILD,
# endif
# if defined(ENABLE_SUPRACAN)
SYSTEM_MENU_SUPRACAN,
# endif
# if defined(ENABLE_MSX)
SYSTEM_MENU_MSX,
# endif
# if defined(ENABLE_POKE)
SYSTEM_MENU_POKE,
# endif
# if defined(ENABLE_LOOPY)
SYSTEM_MENU_LOOPY,
# endif
# if defined(ENABLE_C64)
SYSTEM_MENU_C64,
# endif
# if defined(ENABLE_5200)
SYSTEM_MENU_5200,
# endif
# if defined(ENABLE_7800)
SYSTEM_MENU_7800,
# endif
# if defined(ENABLE_VECTREX)
SYSTEM_MENU_VECTREX,
# endif
# if defined(ENABLE_FLASH)
SYSTEM_MENU_FLASH,
# endif
# if defined(ENABLE_SELFTEST)
SYSTEM_MENU_SELFTEST,
# endif
SYSTEM_MENU_ABOUT,
SYSTEM_MENU_RESET,
// Total number of options available.
SYSTEM_MENU_TOTAL // Always immediately after last menu option
};
// ENUM for VSELECT & 3V3FIX // ENUM for VSELECT & 3V3FIX
enum CLKSCALE: uint8_t { enum CLKSCALE: uint8_t {
@ -50,12 +285,14 @@ enum VOLTS: uint8_t {
VOLTS_UNKNOWN // Return value for all other states VOLTS_UNKNOWN // Return value for all other states
}; };
/*==== /CONSTANTS =================================================*/
/*==== VARIABLES ==================================================*/ /*==== VARIABLES ==================================================*/
extern unsigned long clock; extern unsigned long clock;
extern char ver[5]; //extern char ver[5];
extern VOLTS voltage; extern VOLTS voltage;
#if defined(ENABLE_CONFIG) # if defined(ENABLE_CONFIG)
/** /**
* Config File Stuff * Config File Stuff
* *
@ -64,27 +301,32 @@ extern VOLTS voltage;
**/ **/
extern bool useConfig; extern bool useConfig;
# ifdef global_log # ifdef ENABLE_GLOBAL_LOG
extern bool loggingEnabled; extern bool loggingEnabled;
# endif /* global_log */ # endif /* ENABLE_GLOBAL_LOG */
#else /* !ENABLE_CONFIG */ # else /* !ENABLE_CONFIG */
# ifdef global_log # ifdef ENABLE_GLOBAL_LOG
extern const bool loggingEnabled; constexpr bool loggingEnabled = true;
# endif /* global_log */ # endif /* ENABLE_GLOBAL_LOG */
#endif /* ENABLE_CONFIG */ # endif /* ENABLE_CONFIG */
/*==== /VARIABLES =================================================*/
/*==== FUNCTIONS ==================================================*/ /*==== FUNCTIONS ==================================================*/
extern void printVersionToSerial(); extern void printVersionToSerial();
extern void setClockScale(VOLTS __x); extern void setClockScale(VOLTS __x);
extern void setClockScale(CLKSCALE __x); extern void setClockScale(CLKSCALE __x);
extern VOLTS setVoltage(VOLTS volts); extern VOLTS setVoltage(VOLTS volts);
#if defined(ENABLE_CONFIG) # if defined(ENABLE_CONFIG)
extern void configInit(); extern void configInit();
extern uint8_t configFindKey(const __FlashStringHelper* key, char* value); extern uint8_t configFindKey(const __FlashStringHelper* key, char* value);
extern String configGetStr(const __FlashStringHelper* key); extern String configGetStr(const __FlashStringHelper* key);
extern long configGetLong(const __FlashStringHelper* key, int onFail = 0); extern long configGetLong(const __FlashStringHelper* key, int onFail = 0);
#endif /* ENABLE_CONFIG */ # endif /* ENABLE_CONFIG */
/*==== /FUNCTIONS =================================================*/
#include "ClockedSerial.h" #include "ClockedSerial.h"

View File

@ -10,7 +10,7 @@
// Chris Covell - Tennokoe bank support // Chris Covell - Tennokoe bank support
// //
//****************************************** //******************************************
#ifdef enable_PCE #ifdef ENABLE_PCE
/****************************************** /******************************************
Defines Defines
@ -53,10 +53,9 @@ uint8_t tennokoe_bank_index = 0;
static const char pceMenuItem1[] PROGMEM = "HuCARD (swapped)"; static const char pceMenuItem1[] PROGMEM = "HuCARD (swapped)";
static const char pceMenuItem2[] PROGMEM = "HuCARD(not swapped)"; static const char pceMenuItem2[] PROGMEM = "HuCARD(not swapped)";
static const char pceMenuItem3[] PROGMEM = "Turbochip"; static const char pceMenuItem3[] PROGMEM = "Turbochip";
static const char *const menuOptionspce[] PROGMEM = { pceMenuItem1, pceMenuItem2, pceMenuItem3, string_reset2 }; static const char *const menuOptionspce[] PROGMEM = { pceMenuItem1, pceMenuItem2, pceMenuItem3, FSTRING_RESET };
// PCE card menu items // PCE card menu items
static const char menuOptionspceCart_0[] PROGMEM = "Read ROM";
static const char menuOptionspceCart_1[] PROGMEM = "Read RAM Bank %d"; static const char menuOptionspceCart_1[] PROGMEM = "Read RAM Bank %d";
static const char menuOptionspceCart_2[] PROGMEM = "Write RAM Bank %d"; static const char menuOptionspceCart_2[] PROGMEM = "Write RAM Bank %d";
static const char menuOptionspceCart_3[] PROGMEM = "Inc Bank Number"; static const char menuOptionspceCart_3[] PROGMEM = "Inc Bank Number";
@ -65,8 +64,7 @@ static const char menuOptionspceCart_5[] PROGMEM = "Set %dK ROM size";
static const char menuOptionspceCart_5_fmt[] PROGMEM = "ROM size now %dK"; static const char menuOptionspceCart_5_fmt[] PROGMEM = "ROM size now %dK";
// Turbochip menu items // Turbochip menu items
static const char pceTCMenuItem1[] PROGMEM = "Read ROM"; static const char *const menuOptionspceTC[] PROGMEM = { FSTRING_READ_ROM, FSTRING_RESET };
static const char *const menuOptionspceTC[] PROGMEM = { pceTCMenuItem1, string_reset2 };
// PCE start menu // PCE start menu
void pcsMenu(void) { void pcsMenu(void) {
@ -84,7 +82,7 @@ void pcsMenu(void) {
display_Update(); display_Update();
pce_internal_mode = HUCARD; pce_internal_mode = HUCARD;
setup_cart_PCE(); setup_cart_PCE();
mode = mode_PCE; mode = CORE_PCE;
break; break;
case 1: case 1:
@ -93,7 +91,7 @@ void pcsMenu(void) {
display_Update(); display_Update();
pce_internal_mode = HUCARD_NOSWAP; pce_internal_mode = HUCARD_NOSWAP;
setup_cart_PCE(); setup_cart_PCE();
mode = mode_PCE; mode = CORE_PCE;
break; break;
case 2: case 2:
@ -102,7 +100,7 @@ void pcsMenu(void) {
display_Update(); display_Update();
pce_internal_mode = TURBOCHIP; pce_internal_mode = TURBOCHIP;
setup_cart_PCE(); setup_cart_PCE();
mode = mode_PCE; mode = CORE_PCE;
break; break;
case 3: case 3:
@ -600,9 +598,9 @@ void read_tennokoe_bank_PCE(int bank_index) {
// for (int i = 0; i < 16; i++) { // for (int i = 0; i < 16; i++) {
// uint8_t b = sdBuffer[c + i]; // uint8_t b = sdBuffer[c + i];
// print_Msg_PaddedHexByte(b); // print_Msg_PaddedHexByte(b);
// //print_Msg(F(" ")); // //print_Msg(FS(FSTRING_SPACE));
// } // }
// println_Msg(F("")); // println_Msg(FS(FSTRING_EMPTY));
// } // }
if (block_index == 0) { if (block_index == 0) {
@ -611,7 +609,7 @@ void read_tennokoe_bank_PCE(int bank_index) {
uint8_t b = sdBuffer[i]; uint8_t b = sdBuffer[i];
print_Msg_PaddedHexByte(b); print_Msg_PaddedHexByte(b);
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
} }
if (block_index == 0 && sdBuffer[2] == 0x42 && sdBuffer[3] == 0x4D) { if (block_index == 0 && sdBuffer[2] == 0x42 && sdBuffer[3] == 0x4D) {
if (sdBuffer[0] != 0x48 || sdBuffer[1] != 0x55) { if (sdBuffer[0] != 0x48 || sdBuffer[1] != 0x55) {
@ -630,7 +628,7 @@ void read_tennokoe_bank_PCE(int bank_index) {
//Close the file: //Close the file:
myFile.close(); myFile.close();
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
@ -730,7 +728,7 @@ void write_tennokoe_bank_PCE(int bank_index) {
print_Error(F("File doesn't exist")); print_Error(F("File doesn't exist"));
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
@ -820,7 +818,7 @@ void read_rom_PCE(void) {
//CRC search and rename ROM //CRC search and rename ROM
crc_search(fileName, folder, rom_size, crc); crc_search(fileName, folder, rom_size, crc);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
@ -832,7 +830,7 @@ void pceMenu() {
unsigned char mainMenu; unsigned char mainMenu;
if (pce_internal_mode == HUCARD || pce_internal_mode == HUCARD_NOSWAP) { if (pce_internal_mode == HUCARD || pce_internal_mode == HUCARD_NOSWAP) {
strcpy_P(menuOptions[0], menuOptionspceCart_0); strcpy_P(menuOptions[0], FSTRING_READ_ROM);
sprintf_P(menuOptions[1], menuOptionspceCart_1, tennokoe_bank_index + 1); sprintf_P(menuOptions[1], menuOptionspceCart_1, tennokoe_bank_index + 1);
sprintf_P(menuOptions[2], menuOptionspceCart_2, tennokoe_bank_index + 1); sprintf_P(menuOptions[2], menuOptionspceCart_2, tennokoe_bank_index + 1);
strcpy_P(menuOptions[3], menuOptionspceCart_3); strcpy_P(menuOptions[3], menuOptionspceCart_3);
@ -842,7 +840,7 @@ void pceMenu() {
} else { } else {
sprintf_P(menuOptions[5], menuOptionspceCart_5, FORCED_SIZE); sprintf_P(menuOptions[5], menuOptionspceCart_5, FORCED_SIZE);
} }
strcpy_P(menuOptions[6], string_reset2); strcpy_P(menuOptions[6], FSTRING_RESET);
mainMenu = question_box(F("PCE HuCARD menu"), menuOptions, 7, 0); mainMenu = question_box(F("PCE HuCARD menu"), menuOptions, 7, 0);
// wait for user choice to come back from the question box menu // wait for user choice to come back from the question box menu

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// BENESSE POCKET CHALLENGE W MODULE // BENESSE POCKET CHALLENGE W MODULE
//****************************************** //******************************************
#ifdef enable_PCW #ifdef ENABLE_PCW
// Benesse Pocket Challenge W // Benesse Pocket Challenge W
// Cartridge Pinout // Cartridge Pinout
@ -130,16 +130,13 @@ void setup_PCW() {
strcpy(romName, "PCW"); strcpy(romName, "PCW");
mode = mode_PCW; mode = CORE_PCW;
} }
//****************************************** //******************************************
// MENU // MENU
//****************************************** //******************************************
static const char pcwmenuItem1[] PROGMEM = "Read ROM"; static const char* const menuOptionsPCW[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, FSTRING_RESET };
static const char pcwmenuItem2[] PROGMEM = "Read SRAM";
static const char pcwmenuItem3[] PROGMEM = "Write SRAM";
static const char* const menuOptionsPCW[] PROGMEM = { pcwmenuItem1, pcwmenuItem2, pcwmenuItem3, string_reset2 };
void pcwMenu() { void pcwMenu() {
convertPgm(menuOptionsPCW, 4); convertPgm(menuOptionsPCW, 4);
@ -425,7 +422,7 @@ void readSingleROM_PCW() {
print_Msg(F("READING ")); print_Msg(F("READING "));
print_Msg(rom_size / 1024 / 1024); print_Msg(rom_size / 1024 / 1024);
print_Msg("MB SINGLE-PACK"); print_Msg("MB SINGLE-PACK");
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Create file // Create file
strcpy(fileName, romName); strcpy(fileName, romName);
@ -467,7 +464,7 @@ void readSingleROM_PCW() {
compareCRC("pcw.txt", 0, 1, 0); compareCRC("pcw.txt", 0, 1, 0);
// Wait for user input // Wait for user input
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
@ -564,7 +561,7 @@ void readMultiROM_PCW() {
print_Msg(F("READING ")); print_Msg(F("READING "));
print_Msg(rom_size / 1024 / 1024); print_Msg(rom_size / 1024 / 1024);
print_Msg("MB MULTI-PACK"); print_Msg("MB MULTI-PACK");
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Create file // Create file
strcpy(fileName, romName); strcpy(fileName, romName);
@ -625,7 +622,7 @@ void readMultiROM_PCW() {
compareCRC("pcw.txt", 0, 1, 0); compareCRC("pcw.txt", 0, 1, 0);
// Wait for user input // Wait for user input
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// POKEMON MINI MODULE // POKEMON MINI MODULE
//****************************************** //******************************************
#ifdef enable_POKE #ifdef ENABLE_POKE
// Pokemon Mini // Pokemon Mini
// Cartridge Pinout // Cartridge Pinout
// 32P 0.5mm pitch // 32P 0.5mm pitch
@ -79,8 +79,7 @@
// Menu // Menu
//****************************************** //******************************************
// Base Menu // Base Menu
static const char pokeMenuItem1[] PROGMEM = "Read ROM"; static const char* const menuOptionsPOKE[] PROGMEM = { FSTRING_READ_ROM, FSTRING_RESET };
static const char* const menuOptionsPOKE[] PROGMEM = { pokeMenuItem1, string_reset2 };
void pokeMenu() { void pokeMenu() {
convertPgm(menuOptionsPOKE, 2); convertPgm(menuOptionsPOKE, 2);
@ -145,7 +144,7 @@ void setup_POKE() {
strcpy(romName, "POKEMINI"); strcpy(romName, "POKEMINI");
mode = mode_POKE; mode = CORE_POKE;
} }
//****************************************** //******************************************
@ -279,7 +278,7 @@ void readROM_POKE() {
// compare dump CRC with db values // compare dump CRC with db values
compareCRC("pkmn.txt", 0, 1, 0); compareCRC("pkmn.txt", 0, 1, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);

View File

@ -49,15 +49,14 @@ Also all the menus are stored in progmem and are only recalled to sram when need
const char N64ContMenuItem1[] PROGMEM = "Test Controller"; const char N64ContMenuItem1[] PROGMEM = "Test Controller";
const char N64ContMenuItem2[] PROGMEM = "Read ControllerPak"; const char N64ContMenuItem2[] PROGMEM = "Read ControllerPak";
const char N64ContMenuItem3[] PROGMEM = "Write ControllerPak"; const char N64ContMenuItem3[] PROGMEM = "Write ControllerPak";
const char N64ContMenuItem4[] PROGMEM = "Reset"; const char* const menuOptionsN64Controller[] PROGMEM = {N64ContMenuItem1, N64ContMenuItem2, N64ContMenuItem3, FSTRING_RESET};
const char* const menuOptionsN64Controller[] PROGMEM = {N64ContMenuItem1, N64ContMenuItem2, N64ContMenuItem3, N64ContMenuItem4};
``` ```
In an effort to keep the codebase as portable as possible instead of using the functions supplied by the OLED library directly to print out text, auxiliary functions like `println_Msg` are being used. So if you want to change to another display library you don't need to change all the code but only the helper functions. In an effort to keep the codebase as portable as possible instead of using the functions supplied by the OLED library directly to print out text, auxiliary functions like `println_Msg` are being used. So if you want to change to another display library you don't need to change all the code but only the helper functions.
``` ```
void print_Msg(long unsigned int message) { void print_Msg(long unsigned int message) {
if (enable_OLED) if (ENABLE_OLED)
display.print(message); display.print(message);
if (enable_Serial) if (ENABLE_SERIAL)
Serial.print(message); Serial.print(message);
} }
``` ```

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// SF MEMORY MODULE // SF MEMORY MODULE
//****************************************** //******************************************
#ifdef enable_SFM #ifdef ENABLE_SFM
/****************************************** /******************************************
SF Memory Clock Source SF Memory Clock Source
@ -29,8 +29,7 @@ byte gameAddress[8];
// SFM menu items // SFM menu items
static const char sfmMenuItem1[] PROGMEM = "Game Menu"; static const char sfmMenuItem1[] PROGMEM = "Game Menu";
static const char sfmMenuItem2[] PROGMEM = "Flash Menu"; static const char sfmMenuItem2[] PROGMEM = "Flash Menu";
//static const char sfmMenuItem3[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsSFM[] PROGMEM = { sfmMenuItem1, sfmMenuItem2, FSTRING_RESET };
static const char* const menuOptionsSFM[] PROGMEM = { sfmMenuItem1, sfmMenuItem2, string_reset2 };
// SFM flash menu items // SFM flash menu items
static const char sfmFlashMenuItem1[] PROGMEM = "Read Flash"; static const char sfmFlashMenuItem1[] PROGMEM = "Read Flash";
@ -42,12 +41,9 @@ static const char sfmFlashMenuItem6[] PROGMEM = "Back";
static const char* const menuOptionsSFMFlash[] PROGMEM = { sfmFlashMenuItem1, sfmFlashMenuItem2, sfmFlashMenuItem3, sfmFlashMenuItem4, sfmFlashMenuItem5, sfmFlashMenuItem6 }; static const char* const menuOptionsSFMFlash[] PROGMEM = { sfmFlashMenuItem1, sfmFlashMenuItem2, sfmFlashMenuItem3, sfmFlashMenuItem4, sfmFlashMenuItem5, sfmFlashMenuItem6 };
// SFM game menu items // SFM game menu items
static const char sfmGameMenuItem1[] PROGMEM = "Read Sram";
static const char sfmGameMenuItem2[] PROGMEM = "Read Game"; static const char sfmGameMenuItem2[] PROGMEM = "Read Game";
static const char sfmGameMenuItem3[] PROGMEM = "Write Sram";
static const char sfmGameMenuItem4[] PROGMEM = "Switch Game"; static const char sfmGameMenuItem4[] PROGMEM = "Switch Game";
//static const char sfmGameMenuItem5[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsSFMGame[] PROGMEM = { FSTRING_READ_SAVE, sfmGameMenuItem2, FSTRING_WRITE_SAVE, sfmGameMenuItem4, FSTRING_RESET };
static const char* const menuOptionsSFMGame[] PROGMEM = { sfmGameMenuItem1, sfmGameMenuItem2, sfmGameMenuItem3, sfmGameMenuItem4, string_reset2 };
void sfmMenu() { void sfmMenu() {
// create menu with title and 3 options to choose from // create menu with title and 3 options to choose from
@ -64,7 +60,7 @@ void sfmMenu() {
break; break;
// Flash menu // Flash menu
case 1: case 1:
mode = mode_SFM_Flash; mode = CORE_SFM_FLASH;
break; break;
// Reset // Reset
case 2: case 2:
@ -108,7 +104,7 @@ void sfmGameMenu() {
print_Msg(gameSubMenu + 0x80, HEX); print_Msg(gameSubMenu + 0x80, HEX);
println_Msg(F(" Timeout")); println_Msg(F(" Timeout"));
println_Msg(readBank_SFM(0, 0x2400), HEX); println_Msg(readBank_SFM(0, 0x2400), HEX);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_FatalError(F("Powercycle SFM cart")); print_FatalError(F("Powercycle SFM cart"));
} }
} }
@ -117,7 +113,7 @@ void sfmGameMenu() {
// Print info // Print info
getCartInfo_SFM(); getCartInfo_SFM();
mode = mode_SFM_Game; mode = CORE_SFM_GAME;
} else { } else {
// No menu so switch to only game // No menu so switch to only game
// Switch to game // Switch to game
@ -129,7 +125,7 @@ void sfmGameMenu() {
// Print info // Print info
getCartInfo_SFM(); getCartInfo_SFM();
mode = mode_SFM_Game; mode = CORE_SFM_GAME;
} }
} else { } else {
print_Error(F("Switch to HiRom failed")); print_Error(F("Switch to HiRom failed"));
@ -193,7 +189,7 @@ void sfmGameOptions() {
break; break;
} }
if (gameSubMenu != 3) { if (gameSubMenu != 3) {
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -201,7 +197,7 @@ void sfmGameOptions() {
} }
} }
#ifdef enable_FLASH #ifdef ENABLE_FLASH
void sfmFlashMenu() { void sfmFlashMenu() {
// create menu with title and 6 options to choose from // create menu with title and 6 options to choose from
unsigned char flashSubMenu; unsigned char flashSubMenu;
@ -224,7 +220,7 @@ void sfmFlashMenu() {
print_Msg(F("Switch to HiRom...")); print_Msg(F("Switch to HiRom..."));
display_Update(); display_Update();
if (send_SFM(0x04) == 0x2A) { if (send_SFM(0x04) == 0x2A) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
// Reset flash // Reset flash
@ -301,7 +297,7 @@ void sfmFlashMenu() {
print_Msg(F("Switch to HiRom...")); print_Msg(F("Switch to HiRom..."));
display_Update(); display_Update();
if (send_SFM(0x04) == 0x2A) { if (send_SFM(0x04) == 0x2A) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
idFlash_SFM(0xC0); idFlash_SFM(0xC0);
if (flashid == 0xc2f3) { if (flashid == 0xc2f3) {
@ -340,7 +336,7 @@ void sfmFlashMenu() {
print_Msg(F("Switch to HiRom...")); print_Msg(F("Switch to HiRom..."));
display_Update(); display_Update();
if (send_SFM(0x04) == 0x2A) { if (send_SFM(0x04) == 0x2A) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
idFlash_SFM(0xC0); idFlash_SFM(0xC0);
if (flashid == 0xc2f3) { if (flashid == 0xc2f3) {
@ -391,7 +387,7 @@ void sfmFlashMenu() {
print_Msg(F("Blankcheck...")); print_Msg(F("Blankcheck..."));
display_Update(); display_Update();
if (blankcheckMapping_SFM()) { if (blankcheckMapping_SFM()) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
println_Msg(F("Nope")); println_Msg(F("Nope"));
@ -420,11 +416,11 @@ void sfmFlashMenu() {
// Go back // Go back
case 5: case 5:
mode = mode_SFM; mode = CORE_SFM;
break; break;
} }
if (flashSubMenu != 5) { if (flashSubMenu != 5) {
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -577,7 +573,7 @@ void setup_SFM() {
clockgen.output_enable(SI5351_CLK2, 0); clockgen.output_enable(SI5351_CLK2, 0);
clockgen.output_enable(SI5351_CLK0, 1); clockgen.output_enable(SI5351_CLK0, 1);
} }
#ifdef clockgen_installed #ifdef ENABLE_CLOCKGEN
else { else {
display_Clear(); display_Clear();
print_FatalError(F("Clock Generator not found")); print_FatalError(F("Clock Generator not found"));
@ -600,8 +596,8 @@ void setup_SFM() {
// Abort, something is wrong // Abort, something is wrong
if (timeout == 5) { if (timeout == 5) {
println_Msg(F("Hirom All Timeout")); println_Msg(F("Hirom All Timeout"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_FatalError(F("Powercycle SFM cart")); print_FatalError(F("Powercycle SFM cart"));
} }
} }
@ -741,7 +737,7 @@ void getCartInfo_SFM() {
display_Clear(); display_Clear();
print_Msg(F("Name: ")); print_Msg(F("Name: "));
println_Msg(romName); println_Msg(romName);
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
print_Msg(F("Version: 1.")); print_Msg(F("Version: 1."));
println_Msg(romVersion); println_Msg(romVersion);
@ -1641,14 +1637,14 @@ boolean unlockHirom() {
print_Msg(F("Switch to HiRom...")); print_Msg(F("Switch to HiRom..."));
display_Update(); display_Update();
if (send_SFM(0x04) == 0x2A) { if (send_SFM(0x04) == 0x2A) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
// Unlock Write Protection // Unlock Write Protection
print_Msg(F("Enable Write...")); print_Msg(F("Enable Write..."));
display_Update(); display_Update();
send_SFM(0x02); send_SFM(0x02);
if (readBank_SFM(0, 0x2401) == 0x4) { if (readBank_SFM(0, 0x2401) == 0x4) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
return 1; return 1;
} else { } else {
@ -1720,7 +1716,7 @@ void write_SFM(int startBank, uint32_t pos) {
print_Msg(F("Blankcheck...")); print_Msg(F("Blankcheck..."));
display_Update(); display_Update();
if (blankcheck_SFM(startBank)) { if (blankcheck_SFM(startBank)) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
println_Msg(F("Nope")); println_Msg(F("Nope"));
@ -1733,7 +1729,7 @@ void write_SFM(int startBank, uint32_t pos) {
print_Msg(F("Blankcheck...")); print_Msg(F("Blankcheck..."));
display_Update(); display_Update();
if (blankcheck_SFM(startBank)) { if (blankcheck_SFM(startBank)) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
print_FatalError(F("Could not erase flash")); print_FatalError(F("Could not erase flash"));
@ -1750,7 +1746,7 @@ void write_SFM(int startBank, uint32_t pos) {
display_Update(); display_Update();
writeErrors = verifyFlash_SFM(startBank, pos); writeErrors = verifyFlash_SFM(startBank, pos);
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
display_Update(); display_Update();
} else { } else {
print_STR(error_STR, 0); print_STR(error_STR, 0);

View File

@ -1,7 +1,7 @@
//*********************************************************** //***********************************************************
// SEGA MASTER SYSTEM / MARK III / GAME GEAR / SG-1000 MODULE // SEGA MASTER SYSTEM / MARK III / GAME GEAR / SG-1000 MODULE
//*********************************************************** //***********************************************************
#ifdef enable_SMS #ifdef ENABLE_SMS
//****************************************** //******************************************
// Menus // Menus
@ -16,10 +16,7 @@ static const char SMSAdapterItem6[] PROGMEM = "SG-1000 raphnet";
static const char* const SMSAdapterMenu[] PROGMEM = { SMSAdapterItem1, SMSAdapterItem2, SMSAdapterItem3, SMSAdapterItem4, SMSAdapterItem5, SMSAdapterItem6 }; static const char* const SMSAdapterMenu[] PROGMEM = { SMSAdapterItem1, SMSAdapterItem2, SMSAdapterItem3, SMSAdapterItem4, SMSAdapterItem5, SMSAdapterItem6 };
// Operations menu // Operations menu
static const char SMSOperationItem1[] PROGMEM = "Read Rom"; static const char* const SMSOperationMenu[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, FSTRING_RESET };
static const char SMSOperationItem2[] PROGMEM = "Read from SRAM";
static const char SMSOperationItem3[] PROGMEM = "Write to SRAM";
static const char* const SMSOperationMenu[] PROGMEM = { SMSOperationItem1, SMSOperationItem2, SMSOperationItem3, string_reset2 };
// Rom sizes menu // Rom sizes menu
static const char SMSRomSizeItem1[] PROGMEM = "8 KB"; static const char SMSRomSizeItem1[] PROGMEM = "8 KB";
@ -122,21 +119,21 @@ void smsOperations() {
switch (SMSOperation) { switch (SMSOperation) {
case 0: case 0:
// Read ROM // Read ROM
mode = mode_SMS; mode = CORE_SMS;
setup_SMS(); setup_SMS();
readROM_SMS(); readROM_SMS();
break; break;
case 1: case 1:
// Read SRAM // Read SRAM
mode = mode_SMS; mode = CORE_SMS;
setup_SMS(); setup_SMS();
readSRAM_SMS(); readSRAM_SMS();
break; break;
case 2: case 2:
// Write SRAM // Write SRAM
mode = mode_SMS; mode = CORE_SMS;
setup_SMS(); setup_SMS();
writeSRAM_SMS(); writeSRAM_SMS();
break; break;
@ -421,7 +418,7 @@ void getCartInfo_SMS() {
// print_Msg(bank); // print_Msg(bank);
// print_Msg(F(" offset ")); // print_Msg(F(" offset "));
// print_Msg_PaddedHex32(mirror_offset + 0x7FF0); // print_Msg_PaddedHex32(mirror_offset + 0x7FF0);
// println_Msg(F("")); // println_Msg(FS(FSTRING_EMPTY));
if (strcmp(romName2, romName) == 0) { if (strcmp(romName2, romName) == 0) {
break; break;
@ -509,13 +506,13 @@ void getCartInfo_SMS() {
// Display cart info // Display cart info
display_Clear(); display_Clear();
println_Msg(F("SMS/GG header not found")); println_Msg(F("SMS/GG header not found"));
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
print_Msg(F("Name: ")); print_Msg(F("Name: "));
println_Msg(romName); println_Msg(romName);
print_Msg(F("Selected Size: ")); print_Msg(F("Selected Size: "));
print_Msg(cartSize / 1024); print_Msg(cartSize / 1024);
println_Msg(F("KB")); println_Msg(F("KB"));
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
sprintf(romName, "UNKNOWN"); sprintf(romName, "UNKNOWN");
} }
@ -527,17 +524,17 @@ void getCartInfo_SMS() {
} else { } else {
println_Msg(F("GG header info")); println_Msg(F("GG header info"));
} }
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
print_Msg(F("Name: ")); print_Msg(F("Name: "));
println_Msg(romName); println_Msg(romName);
print_Msg(F("Size: ")); print_Msg(F("Size: "));
print_Msg(cartSize / 1024); print_Msg(cartSize / 1024);
println_Msg(F("KB")); println_Msg(F("KB"));
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
} }
// Wait for user input // Wait for user input
#if (defined(enable_LCD) || defined(enable_OLED)) #if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -619,13 +616,13 @@ void readROM_SMS() {
// for (word xi = 0; xi < 0x100; xi++) { // for (word xi = 0; xi < 0x100; xi++) {
// if (xi%16==0) { // if (xi%16==0) {
// print_Msg_PaddedHex16(xi); // print_Msg_PaddedHex16(xi);
// print_Msg(F(" ")); // print_Msg(FS(FSTRING_SPACE));
// } // }
// print_Msg_PaddedHexByte(sdBuffer[xi]); // print_Msg_PaddedHexByte(sdBuffer[xi]);
// if (xi>0&&((xi+1)%16)==0) { // if (xi>0&&((xi+1)%16)==0) {
// println_Msg(F("")); // println_Msg(FS(FSTRING_EMPTY));
// } else { // } else {
// print_Msg(F(" ")); // print_Msg(FS(FSTRING_SPACE));
// } // }
// } // }
// } // }
@ -649,7 +646,7 @@ void readROM_SMS() {
compareCRC("sg1000.txt", 0, 1, 0); compareCRC("sg1000.txt", 0, 1, 0);
} }
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
save_log(); save_log();
#endif #endif
@ -740,7 +737,7 @@ void writeSRAM_SMS() {
} }
print_Msg(F("sramSize: ")); print_Msg(F("sramSize: "));
print_Msg(sramSize); print_Msg(sramSize);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
word bankSize = 16 * 1024; word bankSize = 16 * 1024;
for (word address = 0x0; address < sramSize; address += 512) { for (word address = 0x0; address < sramSize; address += 512) {
byte currBank = address >= bankSize ? 1 : 0; byte currBank = address >= bankSize ? 1 : 0;

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// SUPER NINTENDO MODULE // SUPER NINTENDO MODULE
//****************************************** //******************************************
#ifdef enable_SNES #ifdef ENABLE_SNES
/****************************************** /******************************************
Defines Defines
@ -35,40 +35,31 @@ static const char snsMenuItem3[] PROGMEM = "Satellaview BS-X";
static const char snsMenuItem4[] PROGMEM = "Sufami Turbo"; static const char snsMenuItem4[] PROGMEM = "Sufami Turbo";
static const char snsMenuItem5[] PROGMEM = "Game Processor RAM"; static const char snsMenuItem5[] PROGMEM = "Game Processor RAM";
static const char snsMenuItem6[] PROGMEM = "Flash repro"; static const char snsMenuItem6[] PROGMEM = "Flash repro";
#ifdef clockgen_calibration #ifdef OPTION_CLOCKGEN_CALIBRATION
static const char snsMenuItem7[] PROGMEM = "Calibrate Clock"; static const char snsMenuItem7[] PROGMEM = "Calibrate Clock";
//static const char snsMenuItem8[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsSNS[] PROGMEM = { snsMenuItem1, snsMenuItem2, snsMenuItem3, snsMenuItem4, snsMenuItem5, snsMenuItem6, snsMenuItem7, FSTRING_RESET };
static const char* const menuOptionsSNS[] PROGMEM = { snsMenuItem1, snsMenuItem2, snsMenuItem3, snsMenuItem4, snsMenuItem5, snsMenuItem6, snsMenuItem7, string_reset2 };
#else #else
//static const char snsMenuItem6[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsSNS[] PROGMEM = { snsMenuItem1, snsMenuItem2, snsMenuItem3, snsMenuItem4, snsMenuItem5, snsMenuItem6, FSTRING_RESET };
static const char* const menuOptionsSNS[] PROGMEM = { snsMenuItem1, snsMenuItem2, snsMenuItem3, snsMenuItem4, snsMenuItem5, snsMenuItem6, string_reset2 };
#endif #endif
// SNES menu items // SNES menu items
static const char SnesMenuItem1[] PROGMEM = "Read ROM";
static const char SnesMenuItem2[] PROGMEM = "Read Save";
static const char SnesMenuItem3[] PROGMEM = "Write Save";
static const char SnesMenuItem4[] PROGMEM = "Test SRAM"; static const char SnesMenuItem4[] PROGMEM = "Test SRAM";
static const char SnesMenuItem5[] PROGMEM = "Cycle cart";
static const char SnesMenuItem6[] PROGMEM = "Force cart type"; static const char SnesMenuItem6[] PROGMEM = "Force cart type";
//static const char SnesMenuItem7[] PROGMEM = "Reset"; (stored in common strings array) static const char* const menuOptionsSNES[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, SnesMenuItem4, FSTRING_REFRESH_CART, SnesMenuItem6, FSTRING_RESET };
static const char* const menuOptionsSNES[] PROGMEM = { SnesMenuItem1, SnesMenuItem2, SnesMenuItem3, SnesMenuItem4, SnesMenuItem5, SnesMenuItem6, string_reset2 };
// 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"; (stored in common strings array) static const char* const menuOptionsConfManual[] PROGMEM = { confMenuItem1, confMenuItem2, confMenuItem3, confMenuItem4, FSTRING_RESET };
static const char* const menuOptionsConfManual[] PROGMEM = { confMenuItem1, confMenuItem2, confMenuItem3, confMenuItem4, string_reset2 };
// 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"; (stored in common strings array) static const char* const menuOptionsRepro[] PROGMEM = { reproMenuItem1, reproMenuItem2, reproMenuItem3, reproMenuItem4, FSTRING_RESET };
static const char* const menuOptionsRepro[] PROGMEM = { reproMenuItem1, reproMenuItem2, reproMenuItem3, reproMenuItem4, string_reset2 };
// SNES repro menu // SNES repro menu
void reproMenu() { void reproMenu() {
@ -80,7 +71,7 @@ void reproMenu() {
// wait for user choice to come back from the question box menu // wait for user choice to come back from the question box menu
switch (snsRepro) { switch (snsRepro) {
#ifdef enable_FLASH #ifdef ENABLE_FLASH
case 0: case 0:
// LoRom // LoRom
display_Clear(); display_Clear();
@ -89,7 +80,7 @@ void reproMenu() {
setup_Flash8(); setup_Flash8();
id_Flash8(); id_Flash8();
wait(); wait();
mode = mode_FLASH8; mode = CORE_FLASH8;
break; break;
case 1: case 1:
@ -100,7 +91,7 @@ void reproMenu() {
setup_Flash8(); setup_Flash8();
id_Flash8(); id_Flash8();
wait(); wait();
mode = mode_FLASH8; mode = CORE_FLASH8;
break; break;
case 2: case 2:
@ -111,7 +102,7 @@ void reproMenu() {
setup_Flash8(); setup_Flash8();
id_Flash8(); id_Flash8();
wait(); wait();
mode = mode_FLASH8; mode = CORE_FLASH8;
break; break;
case 3: case 3:
@ -122,7 +113,7 @@ void reproMenu() {
setup_Flash8(); setup_Flash8();
id_Flash8(); id_Flash8();
wait(); wait();
mode = mode_FLASH8; mode = CORE_FLASH8;
break; break;
#endif #endif
@ -137,12 +128,12 @@ void snsMenu() {
// create menu with title and 7 options to choose from // create menu with title and 7 options to choose from
unsigned char snsCart; unsigned char snsCart;
// Copy menuOptions out of progmem // Copy menuOptions out of progmem
#ifdef clockgen_calibration #ifdef OPTION_CLOCKGEN_CALIBRATION
convertPgm(menuOptionsSNS, 8); convertPgm(menuOptionsSNS, 8);
snsCart = question_box(F("Select Cart Type"), menuOptions, 8, 0); snsCart = question_box(FS(FSTRING_SELECT_CART_TYPE), menuOptions, 8, 0);
#else #else
convertPgm(menuOptionsSNS, 7); convertPgm(menuOptionsSNS, 7);
snsCart = question_box(F("Select Cart Type"), menuOptions, 7, 0); snsCart = question_box(FS(FSTRING_SELECT_CART_TYPE), menuOptions, 7, 0);
#endif #endif
// wait for user choice to come back from the question box menu // wait for user choice to come back from the question box menu
@ -151,46 +142,46 @@ void snsMenu() {
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_Snes(); setup_Snes();
mode = mode_SNES; mode = CORE_SNES;
break; break;
#ifdef enable_SFM #ifdef ENABLE_SFM
case 1: case 1:
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_SFM(); setup_SFM();
mode = mode_SFM; mode = CORE_SFM;
break; break;
#endif #endif
#ifdef enable_SV #ifdef ENABLE_SV
case 2: case 2:
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_SV(); setup_SV();
mode = mode_SV; mode = CORE_SV;
break; break;
#endif #endif
#ifdef enable_ST #ifdef ENABLE_ST
case 3: case 3:
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_ST(); setup_ST();
mode = mode_ST; mode = CORE_ST;
break; break;
#endif #endif
#ifdef enable_GPC #ifdef ENABLE_GPC
case 4: case 4:
display_Clear(); display_Clear();
display_Update(); display_Update();
setup_GPC(); setup_GPC();
mode = mode_GPC; mode = CORE_GPC;
break; break;
#endif #endif
#ifdef enable_FLASH #ifdef ENABLE_FLASH
case 5: case 5:
setup_FlashVoltage(); setup_FlashVoltage();
reproMenu(); reproMenu();
@ -198,7 +189,7 @@ void snsMenu() {
#endif #endif
case 6: case 6:
#ifdef clockgen_calibration #ifdef OPTION_CLOCKGEN_CALIBRATION
clkcal(); clkcal();
break; break;
@ -234,7 +225,7 @@ void snesMenu() {
compare_checksum(); compare_checksum();
// CRC32 // CRC32
compareCRC("snes.txt", 0, 1, 0); compareCRC("snes.txt", 0, 1, 0);
#ifdef global_log #ifdef ENABLE_GLOBAL_LOG
save_log(); save_log();
#endif #endif
display_Update(); display_Update();
@ -286,8 +277,8 @@ void snesMenu() {
println_Msg(F("Warning:")); println_Msg(F("Warning:"));
println_Msg(F("This can erase")); println_Msg(F("This can erase"));
println_Msg(F("your save games")); println_Msg(F("your save games"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Press any button to")); println_Msg(F("Press any button to"));
println_Msg(F("start sram testing")); println_Msg(F("start sram testing"));
display_Update(); display_Update();
@ -344,7 +335,7 @@ void snesMenu() {
resetArduino(); resetArduino();
break; break;
} }
//println_Msg(F("")); //println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -489,7 +480,7 @@ void setup_Snes() {
clockgen.update_status(); clockgen.update_status();
delay(500); delay(500);
} }
#ifdef clockgen_installed #ifdef ENABLE_CLOCKGEN
else { else {
display_Clear(); display_Clear();
print_FatalError(F("Clock Generator not found")); print_FatalError(F("Clock Generator not found"));
@ -755,8 +746,8 @@ void getCartInfo_SNES() {
println_Msg(F("ERROR")); println_Msg(F("ERROR"));
println_Msg(F("Rom header corrupt")); println_Msg(F("Rom header corrupt"));
println_Msg(F("or missing")); println_Msg(F("or missing"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Press button for")); println_Msg(F("Press button for"));
println_Msg(F("manual configuration")); println_Msg(F("manual configuration"));
println_Msg(F("or powercycle if SA1")); println_Msg(F("or powercycle if SA1"));
@ -782,7 +773,7 @@ void getCartInfo_SNES() {
print_Msg(F("ExHiRom")); print_Msg(F("ExHiRom"));
else else
print_Msg(romType); print_Msg(romType);
print_Msg(F(" ")); print_Msg(FS(FSTRING_SPACE));
if (romSpeed == 0) if (romSpeed == 0)
println_Msg(F("SlowROM")); println_Msg(F("SlowROM"));
else if (romSpeed == 2) else if (romSpeed == 2)
@ -830,7 +821,7 @@ void getCartInfo_SNES() {
else if (romChips == 249) else if (romChips == 249)
println_Msg(F("SPC RAM RTC")); println_Msg(F("SPC RAM RTC"));
else else
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
if (altconf) if (altconf)
@ -860,14 +851,14 @@ void getCartInfo_SNES() {
display_Update(); display_Update();
// Wait for user input // Wait for user input
#if (defined(enable_LCD) || defined(enable_OLED)) #if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
#endif #endif
#ifdef enable_serial #ifdef ENABLE_SERIAL
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
#endif #endif
// Start manual config // Start manual config
@ -1456,7 +1447,7 @@ void readROM_SNES() {
display_Update(); display_Update();
readHiRomBanks(240, 256, &myFile); readHiRomBanks(240, 256, &myFile);
} }
//println_Msg(F("")); //println_Msg(FS(FSTRING_EMPTY));
display_Clear(); // need more space due to the 4 progress bars display_Clear(); // need more space due to the 4 progress bars
// Return mapping registers to initial settings... // Return mapping registers to initial settings...
@ -2256,7 +2247,7 @@ boolean eraseSRAM(byte b) {
} }
} }
if (writeErrors == 0) { if (writeErrors == 0) {
println_Msg(F("OK")); println_Msg(FS(FSTRING_OK));
return 1; return 1;
} else { } else {
println_Msg(F("ERROR")); println_Msg(F("ERROR"));

View File

@ -1,7 +1,7 @@
/****************************************** /******************************************
SUPER FAMICOM SUFAMI TURBO MODULE SUPER FAMICOM SUFAMI TURBO MODULE
******************************************/ ******************************************/
#ifdef enable_ST #ifdef ENABLE_ST
/****************************************** /******************************************
Menu Menu
@ -9,7 +9,7 @@
// Sufami Turbo menu items // Sufami Turbo menu items
static const char stMenuItem1[] PROGMEM = "Read cart in Slot A"; static const char stMenuItem1[] PROGMEM = "Read cart in Slot A";
static const char stMenuItem2[] PROGMEM = "Read cart in Slot B"; static const char stMenuItem2[] PROGMEM = "Read cart in Slot B";
static const char* const menuOptionsST[] PROGMEM = { stMenuItem1, stMenuItem2, string_reset2 }; static const char* const menuOptionsST[] PROGMEM = { stMenuItem1, stMenuItem2, FSTRING_RESET };
void stMenu() { void stMenu() {
// Create ST menu with title and 3 options to choose from // Create ST menu with title and 3 options to choose from

View File

@ -2,19 +2,16 @@
// Super A'can MODULE // Super A'can MODULE
// Only tested with HW3 and HW5 // Only tested with HW3 and HW5
//****************************************** //******************************************
#ifdef enable_SUPRACAN #ifdef ENABLE_SUPRACAN
/****************************************** /******************************************
Menu Menu
*****************************************/ *****************************************/
static const char acanMenuItem1[] PROGMEM = "Read Rom";
static const char acanMenuItem2[] PROGMEM = "Read Save";
static const char acanMenuItem3[] PROGMEM = "Write Save";
static const char acanMenuItem4[] PROGMEM = "Read UM6650"; static const char acanMenuItem4[] PROGMEM = "Read UM6650";
static const char acanMenuItem5[] PROGMEM = "Write UM6650"; static const char acanMenuItem5[] PROGMEM = "Write UM6650";
static const char acanMenuItem6[] PROGMEM = "Flash repro"; static const char acanMenuItem6[] PROGMEM = "Flash repro";
static const char *const menuOptionsAcan[] PROGMEM = { acanMenuItem1, acanMenuItem2, acanMenuItem3, acanMenuItem4, acanMenuItem5, string_reset2, acanMenuItem6 }; static const char *const menuOptionsAcan[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, acanMenuItem4, acanMenuItem5, FSTRING_RESET, acanMenuItem6 };
void setup_SuprAcan() { void setup_SuprAcan() {
// Request 5V // Request 5V
@ -82,7 +79,7 @@ void setup_SuprAcan() {
clockgen.update_status(); clockgen.update_status();
delay(500); delay(500);
} }
#ifdef clockgen_installed #ifdef ENABLE_CLOCKGEN
else { else {
print_FatalError(F("Clock Generator not found")); print_FatalError(F("Clock Generator not found"));
} }
@ -142,7 +139,7 @@ void suprAcanMenu() {
} }
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
wait(); wait();
@ -190,7 +187,7 @@ static void readROM_Acan() {
print_Msg(F("CRC32: ")); print_Msg(F("CRC32: "));
print_Msg_PaddedHex32(crc32); print_Msg_PaddedHex32(crc32);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_STR(done_STR, 1); print_STR(done_STR, 1);
} }
@ -482,7 +479,7 @@ static void checkRomExist_Acan() {
cartSize = getRomSize_Acan(); cartSize = getRomSize_Acan();
romSize = cartSize >> 17; romSize = cartSize >> 17;
mode = mode_SUPRACAN; mode = CORE_SUPRACAN;
if (cartSize == 0) if (cartSize == 0)
print_Error(F("Unable to find rom signature...")); print_Error(F("Unable to find rom signature..."));

View File

@ -3,7 +3,7 @@
// Revision 1.0.0 October 22nd 2018 // Revision 1.0.0 October 22nd 2018
// Added BSX Sram, copied from skamans enhanced sketch //sanni // Added BSX Sram, copied from skamans enhanced sketch //sanni
//****************************************** //******************************************
#ifdef enable_SV #ifdef ENABLE_SV
/****************************************** /******************************************
Satellaview 8M Memory Pack Satellaview 8M Memory Pack
@ -37,8 +37,7 @@ static const char svFlashMenuItem1[] PROGMEM = "Read Memory Pack";
static const char svFlashMenuItem2[] PROGMEM = "Write Memory Pack"; static const char svFlashMenuItem2[] PROGMEM = "Write Memory Pack";
static const char svFlashMenuItem3[] PROGMEM = "Read BS-X Sram"; static const char svFlashMenuItem3[] PROGMEM = "Read BS-X Sram";
static const char svFlashMenuItem4[] PROGMEM = "Write BS-X Sram"; static const char svFlashMenuItem4[] PROGMEM = "Write BS-X Sram";
static const char svFlashMenuItem5[] PROGMEM = "Back"; static const char* const menuOptionsSVFlash[] PROGMEM = { svFlashMenuItem1, svFlashMenuItem2, svFlashMenuItem3, svFlashMenuItem4, FSTRING_RESET };
static const char* const menuOptionsSVFlash[] PROGMEM = { svFlashMenuItem1, svFlashMenuItem2, svFlashMenuItem3, svFlashMenuItem4, svFlashMenuItem5 };
void svMenu() { void svMenu() {
@ -122,7 +121,7 @@ void setup_SV() {
clockgen.output_enable(SI5351_CLK1, 0); clockgen.output_enable(SI5351_CLK1, 0);
clockgen.output_enable(SI5351_CLK2, 1); clockgen.output_enable(SI5351_CLK2, 1);
} }
#ifdef clockgen_installed #ifdef ENABLE_CLOCKGEN
else { else {
display_Clear(); display_Clear();
print_FatalError(F("Clock Generator not found")); print_FatalError(F("Clock Generator not found"));
@ -517,7 +516,7 @@ void writeROM_SV(void) {
draw_progressbar(((currBank - 0xC0) * 0x10000), 0x100000); draw_progressbar(((currBank - 0xC0) * 0x10000), 0x100000);
for (long currByte = 0; currByte < 65536; currByte++) { for (long currByte = 0; currByte < 65536; currByte++) {
if (0xFF != readBank_SV(currBank, currByte)) { if (0xFF != readBank_SV(currBank, currByte)) {
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Erase failed")); println_Msg(F("Erase failed"));
display_Update(); display_Update();
myFile.close(); myFile.close();
@ -560,7 +559,7 @@ void writeROM_SV(void) {
draw_progressbar(((currBank - 0xC0) * 0x10000), 0x100000); draw_progressbar(((currBank - 0xC0) * 0x10000), 0x100000);
for (long currByte = 0; currByte < 65536; currByte++) { for (long currByte = 0; currByte < 65536; currByte++) {
if (myFile.read() != readBank_SV(currBank, currByte)) { if (myFile.read() != readBank_SV(currBank, currByte)) {
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Verify failed")); println_Msg(F("Verify failed"));
display_Update(); display_Update();
myFile.close(); myFile.close();

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// VIRTUALBOY MODULE // VIRTUALBOY MODULE
//****************************************** //******************************************
#ifdef enable_VBOY #ifdef ENABLE_VBOY
// Nintendo VirtualBoy // Nintendo VirtualBoy
// Cartridge Pinout // Cartridge Pinout
// 60P 2.00mm pitch connector // 60P 2.00mm pitch connector
@ -89,7 +89,7 @@ void setup_VBOY() {
getCartInfo_VB(); getCartInfo_VB();
mode = mode_VBOY; mode = CORE_VBOY;
} }
//****************************************** //******************************************
@ -97,11 +97,7 @@ void setup_VBOY() {
//****************************************** //******************************************
// Base Menu // Base Menu
static const char vboyMenuItem1[] PROGMEM = "Read ROM"; static const char* const menuOptionsVBOY[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, FSTRING_RESET };
static const char vboyMenuItem2[] PROGMEM = "Read SRAM";
static const char vboyMenuItem3[] PROGMEM = "Write SRAM";
//static const char vboyMenuItem4[] PROGMEM = "Reset"; (stored in common strings array)
static const char* const menuOptionsVBOY[] PROGMEM = { vboyMenuItem1, vboyMenuItem2, vboyMenuItem3, string_reset2 };
void vboyMenu() { void vboyMenu() {
convertPgm(menuOptionsVBOY, 4); convertPgm(menuOptionsVBOY, 4);
@ -127,7 +123,7 @@ void vboyMenu() {
} else { } else {
print_Error(F("Cart has no SRAM")); print_Error(F("Cart has no SRAM"));
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
// Wait for user input // Wait for user input
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
@ -157,7 +153,7 @@ void vboyMenu() {
} else { } else {
print_Error(F("Cart has no SRAM")); print_Error(F("Cart has no SRAM"));
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
// Wait for user input // Wait for user input
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
@ -384,7 +380,7 @@ void getCartInfo_VB() {
display_Clear(); display_Clear();
println_Msg(F("Cart Info")); println_Msg(F("Cart Info"));
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
print_Msg(F("Name: ")); print_Msg(F("Name: "));
println_Msg(romName); println_Msg(romName);
print_Msg(F("Size: ")); print_Msg(F("Size: "));
@ -396,9 +392,9 @@ void getCartInfo_VB() {
println_Msg(F(" KBit")); println_Msg(F(" KBit"));
} else } else
println_Msg(F("None")); println_Msg(F("None"));
println_Msg(F(" ")); println_Msg(FS(FSTRING_SPACE));
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
// Wait for user input // Wait for user input
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
@ -478,9 +474,9 @@ void readROM_VB() {
// Arguments: database name, precalculated crc string or 0 to calculate, rename rom or not, starting offset // Arguments: database name, precalculated crc string or 0 to calculate, rename rom or not, starting offset
compareCRC("vb.txt", 0, 1, 0); compareCRC("vb.txt", 0, 1, 0);
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
// Wait for user input // Wait for user input
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// VECTREX MODULE // VECTREX MODULE
//****************************************** //******************************************
#ifdef enable_VECTREX #ifdef ENABLE_VECTREX
// Vectrex // Vectrex
// Cartridge Pinout // Cartridge Pinout
// 36P 2.54mm pitch connector // 36P 2.54mm pitch connector
@ -68,10 +68,7 @@ byte newvectrexsize;
// Menu // Menu
//****************************************** //******************************************
// Base Menu // Base Menu
static const char vectrexMenuItem1[] PROGMEM = "Select Cart"; static const char* const menuOptionsVECTREX[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
static const char vectrexMenuItem2[] PROGMEM = "Read ROM";
static const char vectrexMenuItem3[] PROGMEM = "Set Size";
static const char* const menuOptionsVECTREX[] PROGMEM = { vectrexMenuItem1, vectrexMenuItem2, vectrexMenuItem3, string_reset2 };
void setup_VECTREX() { void setup_VECTREX() {
// Request 5V // Request 5V
@ -116,7 +113,7 @@ void setup_VECTREX() {
checkStatus_VECTREX(); checkStatus_VECTREX();
strcpy(romName, "VECTREX"); strcpy(romName, "VECTREX");
mode = mode_VECTREX; mode = CORE_VECTREX;
} }
void vectrexMenu() { void vectrexMenu() {
@ -251,7 +248,7 @@ void readROM_VECTREX() {
unsigned long crcsize = VECTREX[vectrexsize] * 0x400; unsigned long crcsize = VECTREX[vectrexsize] * 0x400;
calcCRC(fileName, crcsize, NULL, 0); calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -263,22 +260,22 @@ void readROM_VECTREX() {
//****************************************** //******************************************
void setROMSize_VECTREX() { void setROMSize_VECTREX() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (vectrexlo == vectrexhi) if (vectrexlo == vectrexhi)
newvectrexsize = vectrexlo; newvectrexsize = vectrexlo;
else { else {
int b = 0; uint8_t b = 0;
int i = vectrexlo; int i = vectrexlo;
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(VECTREX[i]); println_Msg(VECTREX[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -295,11 +292,11 @@ void setROMSize_VECTREX() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(VECTREX[i]); println_Msg(VECTREX[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -314,11 +311,11 @@ void setROMSize_VECTREX() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(VECTREX[i]); println_Msg(VECTREX[i]);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -356,7 +353,7 @@ setrom:
newvectrexsize = sizeROM.toInt() + vectrexlo; newvectrexsize = sizeROM.toInt() + vectrexlo;
if (newvectrexsize > vectrexhi) { if (newvectrexsize > vectrexhi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
@ -375,11 +372,11 @@ void checkStatus_VECTREX() {
EEPROM_writeAnything(8, vectrexsize); EEPROM_writeAnything(8, vectrexsize);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("VECTREX READER")); println_Msg(F("VECTREX READER"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: ")); print_Msg(F("ROM SIZE: "));
print_Msg(VECTREX[vectrexsize]); print_Msg(VECTREX[vectrexsize]);
println_Msg(F("KB")); println_Msg(F("KB"));
@ -389,7 +386,7 @@ void checkStatus_VECTREX() {
Serial.print(F("ROM SIZE: ")); Serial.print(F("ROM SIZE: "));
Serial.print(VECTREX[vectrexsize]); Serial.print(VECTREX[vectrexsize]);
Serial.println(F("KB")); Serial.println(F("KB"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
@ -442,7 +439,7 @@ bool readVals_VECTREX(char* vectrexgame, char* vectrexrr, char* vectrexll) {
bool getCartListInfo_VECTREX() { bool getCartListInfo_VECTREX() {
bool buttonreleased = 0; bool buttonreleased = 0;
bool cartselected = 0; bool cartselected = 0;
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F(" HOLD TO FAST CYCLE")); println_Msg(F(" HOLD TO FAST CYCLE"));
display_Update(); display_Update();
@ -450,9 +447,9 @@ bool getCartListInfo_VECTREX() {
Serial.println(F("HOLD BUTTON TO FAST CYCLE")); Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
#endif #endif
delay(2000); delay(2000);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == LOW) { // Button Held - Fast Cycle if (buttonVal1 == LOW) { // Button Held - Fast Cycle
@ -461,19 +458,19 @@ bool getCartListInfo_VECTREX() {
if (strcmp(vectrexcsvEND, vectrexgame) == 0) { if (strcmp(vectrexcsvEND, vectrexgame) == 0) {
vectrexcsvFile.seek(0); // Restart vectrexcsvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(vectrexgame); println_Msg(vectrexgame);
display_Update(); display_Update();
#else #else
Serial.print(F("CART TITLE:")); Serial.print(F("CART TITLE:"));
Serial.println(vectrexgame); Serial.println(vectrexgame);
#endif #endif
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) { // Button Released if (buttonVal1 == HIGH) { // Button Released
@ -486,41 +483,41 @@ bool getCartListInfo_VECTREX() {
} }
} }
} }
#if defined(enable_OLED) #if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7 buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2 boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif #endif
if (buttonVal1 == HIGH) // Button Released if (buttonVal1 == HIGH) // Button Released
break; break;
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("FAST CYCLE OFF")); println_Msg(F("FAST CYCLE OFF"));
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("FAST CYCLE OFF")); Serial.println(F("FAST CYCLE OFF"));
Serial.println(F("PRESS BUTTON TO STEP FORWARD")); Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
Serial.println(F("DOUBLE CLICK TO STEP BACK")); Serial.println(F("DOUBLE CLICK TO STEP BACK"));
Serial.println(F("HOLD TO SELECT")); Serial.println(F("HOLD TO SELECT"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
while (readVals_VECTREX(vectrexgame, vectrexrr, vectrexll)) { while (readVals_VECTREX(vectrexgame, vectrexrr, vectrexll)) {
if (strcmp(vectrexcsvEND, vectrexgame) == 0) { if (strcmp(vectrexcsvEND, vectrexgame) == 0) {
vectrexcsvFile.seek(0); // Restart vectrexcsvFile.seek(0); // Restart
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART TITLE:")); println_Msg(F("CART TITLE:"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(vectrexgame); println_Msg(vectrexgame);
display.setCursor(0, 48); display.setCursor(0, 48);
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -530,7 +527,7 @@ bool getCartListInfo_VECTREX() {
Serial.println(vectrexgame); Serial.println(vectrexgame);
#endif #endif
while (1) { // Single Step while (1) { // Single Step
int b = checkButton(); uint8_t b = checkButton();
if (b == 1) { // Continue (press) if (b == 1) { // Continue (press)
break; break;
} }
@ -544,7 +541,7 @@ bool getCartListInfo_VECTREX() {
newvectrexsize = strtol(vectrexrr, NULL, 10); newvectrexsize = strtol(vectrexrr, NULL, 10);
EEPROM_writeAnything(8, newvectrexsize); EEPROM_writeAnything(8, newvectrexsize);
cartselected = 1; // SELECTION MADE cartselected = 1; // SELECTION MADE
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("SELECTION MADE")); println_Msg(F("SELECTION MADE"));
display_Update(); display_Update();
#else #else
@ -559,8 +556,8 @@ bool getCartListInfo_VECTREX() {
} }
} }
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE")); println_Msg(F("END OF FILE"));
display_Update(); display_Update();
#else #else
@ -572,10 +569,10 @@ bool getCartListInfo_VECTREX() {
void checkCSV_VECTREX() { void checkCSV_VECTREX() {
if (getCartListInfo_VECTREX()) { if (getCartListInfo_VECTREX()) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CART SELECTED")); println_Msg(F("CART SELECTED"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(vectrexgame); println_Msg(vectrexgame);
display_Update(); display_Update();
// Display Settings // Display Settings
@ -584,16 +581,16 @@ void checkCSV_VECTREX() {
println_Msg(newvectrexsize); println_Msg(newvectrexsize);
display_Update(); display_Update();
#else #else
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
Serial.println(F("CART SELECTED")); Serial.println(F("CART SELECTED"));
Serial.println(vectrexgame); Serial.println(vectrexgame);
// Display Settings // Display Settings
Serial.print(F("CODE: R")); Serial.print(F("CODE: R"));
Serial.println(newvectrexsize); Serial.println(newvectrexsize);
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} else { } else {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56); display.setCursor(0, 56);
println_Msg(F("NO SELECTION")); println_Msg(F("NO SELECTION"));
display_Update(); display_Update();
@ -604,7 +601,7 @@ void checkCSV_VECTREX() {
} }
void setCart_VECTREX() { void setCart_VECTREX() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(vectrexcartCSV); println_Msg(vectrexcartCSV);
display_Update(); display_Update();
@ -614,7 +611,7 @@ void setCart_VECTREX() {
sd.chdir(folder); // Switch Folder sd.chdir(folder); // Switch Folder
vectrexcsvFile = sd.open(vectrexcartCSV, O_READ); vectrexcsvFile = sd.open(vectrexcartCSV, O_READ);
if (!vectrexcsvFile) { if (!vectrexcsvFile) {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("CSV FILE NOT FOUND!")); println_Msg(F("CSV FILE NOT FOUND!"));
display_Update(); display_Update();

View File

@ -1,7 +1,7 @@
//********************************************************* //*********************************************************
// BANDAI WONDERSWAN & BENESSE POCKET CHALLENGE V2 MODULE // BANDAI WONDERSWAN & BENESSE POCKET CHALLENGE V2 MODULE
//********************************************************* //*********************************************************
#ifdef enable_WS #ifdef ENABLE_WS
// Cartridge pinout // Cartridge pinout
// 48P 1.25mm pitch connector // 48P 1.25mm pitch connector
// C1, C48 : GND // C1, C48 : GND
@ -23,7 +23,7 @@
// C46 : INT (for RTC alarm interrupt) // C46 : INT (for RTC alarm interrupt)
// C47 : CLK (384KHz on WS) // C47 : CLK (384KHz on WS)
#ifdef ws_adapter_v2 #ifdef OPTION_WS_ADAPTER_V2
#define WS_CLK_BIT 5 // USE PE5 as CLK #define WS_CLK_BIT 5 // USE PE5 as CLK
#else #else
#define WS_CLK_BIT 3 // USE PE3 as CLK #define WS_CLK_BIT 3 // USE PE3 as CLK
@ -32,12 +32,8 @@
/****************************************** /******************************************
Menu Menu
*****************************************/ *****************************************/
static const char wsMenuItem1[] PROGMEM = "Read Rom";
static const char wsMenuItem2[] PROGMEM = "Read Save";
static const char wsMenuItem3[] PROGMEM = "Write Save";
//static const char wsMenuItem4[] PROGMEM = "Reset"; (stored in common strings array)
static const char wsMenuItem5[] PROGMEM = "Write WitchOS"; static const char wsMenuItem5[] PROGMEM = "Write WitchOS";
static const char *const menuOptionsWS[] PROGMEM = { wsMenuItem1, wsMenuItem2, wsMenuItem3, string_reset2, wsMenuItem5 }; static const char *const menuOptionsWS[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, FSTRING_RESET, wsMenuItem5 };
static const uint8_t wwLaunchCode[] PROGMEM = { 0xea, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xff, 0xff }; static const uint8_t wwLaunchCode[] PROGMEM = { 0xea, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xff, 0xff };
static uint8_t wsGameOrientation = 0; static uint8_t wsGameOrientation = 0;
static uint8_t wsGameHasRTC = 0; static uint8_t wsGameHasRTC = 0;
@ -183,7 +179,7 @@ void wsMenu() {
} }
} }
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
@ -1003,7 +999,7 @@ static boolean compareChecksum_WS(uint16_t checksum) {
return 1; return 1;
} else { } else {
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Error(F("Checksum Error")); print_Error(F("Checksum Error"));
return 0; return 0;
} }

View File

@ -1,7 +1,7 @@
//****************************************** //******************************************
// WSV MODULE // WSV MODULE
//****************************************** //******************************************
#ifdef enable_WSV #ifdef ENABLE_WSV
// Watara Supervision // Watara Supervision
// Cartridge Pinout // Cartridge Pinout
// 40P 2.5mm pitch connector // 40P 2.5mm pitch connector
@ -94,7 +94,7 @@ void setup_WSV() {
checkStatus_WSV(); checkStatus_WSV();
strcpy(romName, "SUPERVISION"); strcpy(romName, "SUPERVISION");
mode = mode_WSV; mode = CORE_WSV;
} }
//****************************************** //******************************************
@ -102,11 +102,7 @@ void setup_WSV() {
//****************************************** //******************************************
// Base Menu // Base Menu
static const char wsvMenuItem1[] PROGMEM = "Select Cart"; static const char* const menuOptionsSV[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
static const char wsvMenuItem2[] PROGMEM = "Read ROM";
static const char wsvMenuItem3[] PROGMEM = "Set Size";
//static const char wsvMenuItem4[] PROGMEM = "Reset"; (stored in common strings array)
static const char* const menuOptionsSV[] PROGMEM = { wsvMenuItem1, wsvMenuItem2, wsvMenuItem3, string_reset2 };
void wsvMenu() { void wsvMenu() {
convertPgm(menuOptionsSV, 4); convertPgm(menuOptionsSV, 4);
@ -235,7 +231,7 @@ void readROM_WSV() {
// Arguments: database name, precalculated crc string or 0 to calculate, rename rom or not, starting offset // Arguments: database name, precalculated crc string or 0 to calculate, rename rom or not, starting offset
compareCRC("wsv.txt", 0, 1, 0); compareCRC("wsv.txt", 0, 1, 0);
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
// Prints string out of the common strings array either with or without newline // Prints string out of the common strings array either with or without newline
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -247,22 +243,22 @@ void readROM_WSV() {
//****************************************** //******************************************
void setROMSize_WSV() { void setROMSize_WSV() {
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
if (wsvlo == wsvhi) if (wsvlo == wsvhi)
newwsvsize = wsvlo; newwsvsize = wsvlo;
else { else {
int b = 0; uint8_t b = 0;
int i = wsvlo; int i = wsvlo;
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(pgm_read_word(&(WSV[i]))); println_Msg(pgm_read_word(&(WSV[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -280,11 +276,11 @@ void setROMSize_WSV() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(pgm_read_word(&(WSV[i]))); println_Msg(pgm_read_word(&(WSV[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -300,11 +296,11 @@ void setROMSize_WSV() {
display_Clear(); display_Clear();
print_Msg(F("ROM Size: ")); print_Msg(F("ROM Size: "));
println_Msg(pgm_read_word(&(WSV[i]))); println_Msg(pgm_read_word(&(WSV[i])));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#endif #endif
@ -342,7 +338,7 @@ setrom:
newwsvsize = sizeROM.toInt() + wsvlo; newwsvsize = sizeROM.toInt() + wsvlo;
if (newwsvsize > wsvhi) { if (newwsvsize > wsvhi) {
Serial.println(F("SIZE NOT SUPPORTED")); Serial.println(F("SIZE NOT SUPPORTED"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
goto setrom; goto setrom;
} }
} }
@ -361,11 +357,11 @@ void checkStatus_WSV() {
EEPROM_writeAnything(8, wsvsize); EEPROM_writeAnything(8, wsvsize);
} }
#if (defined(enable_OLED) || defined(enable_LCD)) #if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear(); display_Clear();
println_Msg(F("WATARA SUPERVISION")); println_Msg(F("WATARA SUPERVISION"));
println_Msg(F("CURRENT SETTINGS")); println_Msg(F("CURRENT SETTINGS"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: ")); print_Msg(F("ROM SIZE: "));
print_Msg(pgm_read_word(&(WSV[wsvsize]))); print_Msg(pgm_read_word(&(WSV[wsvsize])));
println_Msg(F("K")); println_Msg(F("K"));
@ -375,7 +371,7 @@ void checkStatus_WSV() {
Serial.print(F("CURRENT ROM SIZE: ")); Serial.print(F("CURRENT ROM SIZE: "));
Serial.print(pgm_read_word(&(WSV[wsvsize]))); Serial.print(pgm_read_word(&(WSV[wsvsize])));
Serial.println(F("K")); Serial.println(F("K"));
Serial.println(F("")); Serial.println(FSTRING_EMPTY);
#endif #endif
} }
@ -459,7 +455,7 @@ void setCart_WSV() {
skip_line(&myFile); skip_line(&myFile);
println_Msg(F("Select your cartridge")); println_Msg(F("Select your cartridge"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
println_Msg(gamename); println_Msg(gamename);
print_Msg(F("Size: ")); print_Msg(F("Size: "));
if (cartSize == 51) if (cartSize == 51)
@ -467,11 +463,11 @@ void setCart_WSV() {
else else
print_Msg(cartSize); print_Msg(cartSize);
println_Msg(F("KB")); println_Msg(F("KB"));
println_Msg(F("")); println_Msg(FS(FSTRING_EMPTY));
#if defined(enable_OLED) #if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1); print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1); print_STR(right_to_select_STR, 1);
#elif defined(enable_LCD) #elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1); print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1); print_STR(press_to_select_STR, 1);
#elif defined(SERIAL_MONITOR) #elif defined(SERIAL_MONITOR)
@ -480,7 +476,7 @@ void setCart_WSV() {
#endif #endif
display_Update(); display_Update();
int b = 0; uint8_t b = 0;
while (1) { while (1) {
// Check button input // Check button input
b = checkButton(); b = checkButton();

View File

@ -3,4 +3,4 @@ lcd.confColor=0
lcd.red=0 lcd.red=0
lcd.green=100 lcd.green=100
lcd.blue=0 lcd.blue=0
md.sramType=0 md.saveType=0