mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-26 14:34:15 +01:00
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:
parent
3468703a51
commit
e61ac414d8
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// ATARI 2600 MODULE
|
||||
//******************************************
|
||||
#if defined(enable_2600)
|
||||
#if defined(ENABLE_2600)
|
||||
// Atari 2600
|
||||
// Cartridge Pinout
|
||||
// 24P 2.54mm pitch connector
|
||||
@ -56,10 +56,8 @@ byte e7size;
|
||||
// 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* 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() {
|
||||
// Request 5V
|
||||
@ -99,7 +97,7 @@ void setup_2600() {
|
||||
checkStatus_2600();
|
||||
strcpy(romName, "ATARI");
|
||||
|
||||
mode = mode_2600;
|
||||
mode = CORE_2600;
|
||||
}
|
||||
|
||||
void a2600Menu() {
|
||||
@ -565,7 +563,7 @@ void readROM_2600() {
|
||||
}
|
||||
calcCRC(fileName, crcsize, NULL, 0);
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
@ -583,11 +581,11 @@ void checkStatus_2600() {
|
||||
EEPROM_writeAnything(8, a2600size);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("ATARI 2600 READER"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("MAPPER: "));
|
||||
if (a2600mapper == 0x20)
|
||||
println_Msg(F("2K"));
|
||||
@ -633,7 +631,7 @@ void checkStatus_2600() {
|
||||
else
|
||||
Serial.print(a2600[a2600size]);
|
||||
Serial.println(F("K"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -642,21 +640,21 @@ void checkStatus_2600() {
|
||||
//******************************************
|
||||
|
||||
void setMapper_2600() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
int b = 0;
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
uint8_t b = 0;
|
||||
int i = 0;
|
||||
// Check Button Status
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
|
||||
if (buttonVal1 == LOW) { // Button Pressed
|
||||
while (1) { // Scroll Mapper List
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) { // Button Released
|
||||
@ -712,11 +710,11 @@ void setMapper_2600() {
|
||||
println_Msg(F("TP"));
|
||||
else
|
||||
println_Msg(a2600mapselect, HEX);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -749,11 +747,11 @@ void setMapper_2600() {
|
||||
println_Msg(F("TP"));
|
||||
else
|
||||
println_Msg(a2600mapselect, HEX);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -784,11 +782,11 @@ void setMapper_2600() {
|
||||
println_Msg(F("TP"));
|
||||
else
|
||||
println_Msg(a2600mapselect, HEX);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -900,7 +898,7 @@ bool readVals_ATARI(char* a2600game, char* a2600mm, char* a2600ll) {
|
||||
bool getCartListInfo_2600() {
|
||||
bool buttonreleased = 0;
|
||||
bool cartselected = 0;
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F(" HOLD TO FAST CYCLE"));
|
||||
display_Update();
|
||||
@ -908,9 +906,9 @@ bool getCartListInfo_2600() {
|
||||
Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
|
||||
#endif
|
||||
delay(2000);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Held - Fast Cycle
|
||||
@ -919,19 +917,19 @@ bool getCartListInfo_2600() {
|
||||
if (strcmp(a2600csvEND, a2600game) == 0) {
|
||||
a2600csvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(a2600game);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.print(F("CART TITLE:"));
|
||||
Serial.println(a2600game);
|
||||
#endif
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
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
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) // Button Released
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("FAST CYCLE OFF"));
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("FAST CYCLE OFF"));
|
||||
Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
|
||||
Serial.println(F("DOUBLE CLICK TO STEP BACK"));
|
||||
Serial.println(F("HOLD TO SELECT"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
while (readVals_ATARI(a2600game, a2600mm, a2600ll)) {
|
||||
if (strcmp(a2600csvEND, a2600game) == 0) {
|
||||
a2600csvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(a2600game);
|
||||
display.setCursor(0, 48);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -988,7 +986,7 @@ bool getCartListInfo_2600() {
|
||||
Serial.println(a2600game);
|
||||
#endif
|
||||
while (1) { // Single Step
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
if (b == 1) { // Continue (press)
|
||||
break;
|
||||
}
|
||||
@ -1002,7 +1000,7 @@ bool getCartListInfo_2600() {
|
||||
new2600mapper = strtol(a2600mm, NULL, 10);
|
||||
EEPROM_writeAnything(7, new2600mapper);
|
||||
cartselected = 1; // SELECTION MADE
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(F("SELECTION MADE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -1017,8 +1015,8 @@ bool getCartListInfo_2600() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
println_Msg(F(""));
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("END OF FILE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -1030,10 +1028,10 @@ bool getCartListInfo_2600() {
|
||||
|
||||
void checkCSV_2600() {
|
||||
if (getCartListInfo_2600()) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART SELECTED"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(a2600game);
|
||||
display_Update();
|
||||
// Display Settings
|
||||
@ -1042,16 +1040,16 @@ void checkCSV_2600() {
|
||||
println_Msg(new2600mapper, HEX);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("CART SELECTED"));
|
||||
Serial.println(a2600game);
|
||||
// Display Settings
|
||||
Serial.print(F("CODE: "));
|
||||
Serial.println(new2600mapper, HEX);
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("NO SELECTION"));
|
||||
display_Update();
|
||||
@ -1074,7 +1072,7 @@ void checkSize_2600() {
|
||||
}
|
||||
|
||||
void setCart_2600() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(a2600cartCSV);
|
||||
display_Update();
|
||||
@ -1084,7 +1082,7 @@ void setCart_2600() {
|
||||
sd.chdir(folder); // Switch Folder
|
||||
a2600csvFile = sd.open(a2600cartCSV, O_READ);
|
||||
if (!a2600csvFile) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CSV FILE NOT FOUND!"));
|
||||
display_Update();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// ATARI 5200 MODULE
|
||||
//******************************************
|
||||
#ifdef enable_5200
|
||||
#ifdef ENABLE_5200
|
||||
// Atari 5200
|
||||
// Cartridge Pinout
|
||||
// 36P 2.54mm pitch connector
|
||||
@ -85,10 +85,7 @@ byte new5200size;
|
||||
// Menu
|
||||
//******************************************
|
||||
// Base Menu
|
||||
static const char a5200MenuItem1[] PROGMEM = "Select Cart";
|
||||
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 };
|
||||
static const char* const menuOptions5200[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
|
||||
|
||||
void setup_5200() {
|
||||
// Request 5V
|
||||
@ -128,7 +125,7 @@ void setup_5200() {
|
||||
checkStatus_5200();
|
||||
strcpy(romName, "ATARI");
|
||||
|
||||
mode = mode_5200;
|
||||
mode = CORE_5200;
|
||||
}
|
||||
|
||||
void a5200Menu() {
|
||||
@ -334,7 +331,7 @@ void readROM_5200() {
|
||||
unsigned long crcsize = a5200[a5200size] * 0x400;
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -358,22 +355,22 @@ void checkMapperSize_5200() {
|
||||
}
|
||||
|
||||
void setROMSize_5200() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (a5200lo == a5200hi)
|
||||
new5200size = a5200lo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = a5200lo;
|
||||
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(a5200[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -391,11 +388,11 @@ void setROMSize_5200() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(a5200[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -411,11 +408,11 @@ void setROMSize_5200() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(a5200[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -453,7 +450,7 @@ setrom:
|
||||
new5200size = sizeROM.toInt() + a5200lo;
|
||||
if (new5200size > a5200hi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
@ -477,11 +474,11 @@ void checkStatus_5200() {
|
||||
EEPROM_writeAnything(8, a5200size);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("ATARI 5200 READER"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("MAPPER: "));
|
||||
println_Msg(a5200mapper);
|
||||
if (a5200mapper == 0)
|
||||
@ -507,7 +504,7 @@ void checkStatus_5200() {
|
||||
Serial.print(F("ROM SIZE: "));
|
||||
Serial.print(a5200[a5200size]);
|
||||
Serial.println(F("K"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -516,20 +513,20 @@ void checkStatus_5200() {
|
||||
//******************************************
|
||||
|
||||
void setMapper_5200() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
int b = 0;
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
uint8_t b = 0;
|
||||
int i = 0;
|
||||
// Check Button Status
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Pressed
|
||||
while (1) { // Scroll Mapper List
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) { // Button Released
|
||||
@ -571,11 +568,11 @@ void setMapper_5200() {
|
||||
println_Msg(F("TWO CHIP"));
|
||||
else if (a5200mapselect == 2)
|
||||
println_Msg(F("BOUNTY BOB"));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -601,11 +598,11 @@ void setMapper_5200() {
|
||||
println_Msg(F("TWO CHIP"));
|
||||
else if (a5200mapselect == 2)
|
||||
println_Msg(F("BOUNTY BOB"));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -629,11 +626,11 @@ void setMapper_5200() {
|
||||
println_Msg(F("TWO CHIP"));
|
||||
else if (a5200mapselect == 2)
|
||||
println_Msg(F("BOUNTY BOB"));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -721,7 +718,7 @@ bool readVals_5200(char* a5200game, char* a5200mm, char* a5200rr, char* a5200ll)
|
||||
bool getCartListInfo_5200() {
|
||||
bool buttonreleased = 0;
|
||||
bool cartselected = 0;
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F(" HOLD TO FAST CYCLE"));
|
||||
display_Update();
|
||||
@ -729,9 +726,9 @@ bool getCartListInfo_5200() {
|
||||
Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
|
||||
#endif
|
||||
delay(2000);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Held - Fast Cycle
|
||||
@ -740,19 +737,19 @@ bool getCartListInfo_5200() {
|
||||
if (strcmp(a5200csvEND, a5200game) == 0) {
|
||||
a5200csvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(a5200game);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.print(F("CART TITLE:"));
|
||||
Serial.println(a5200game);
|
||||
#endif
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
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
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) // Button Released
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("FAST CYCLE OFF"));
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("FAST CYCLE OFF"));
|
||||
Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
|
||||
Serial.println(F("DOUBLE CLICK TO STEP BACK"));
|
||||
Serial.println(F("HOLD TO SELECT"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
while (readVals_5200(a5200game, a5200mm, a5200rr, a5200ll)) {
|
||||
if (strcmp(a5200csvEND, a5200game) == 0) {
|
||||
a5200csvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(a5200game);
|
||||
display.setCursor(0, 48);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -809,7 +806,7 @@ bool getCartListInfo_5200() {
|
||||
Serial.println(a5200game);
|
||||
#endif
|
||||
while (1) { // Single Step
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
if (b == 1) { // Continue (press)
|
||||
break;
|
||||
}
|
||||
@ -825,7 +822,7 @@ bool getCartListInfo_5200() {
|
||||
EEPROM_writeAnything(7, new5200mapper);
|
||||
EEPROM_writeAnything(8, new5200size);
|
||||
cartselected = 1; // SELECTION MADE
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(F("SELECTION MADE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -840,8 +837,8 @@ bool getCartListInfo_5200() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
println_Msg(F(""));
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("END OF FILE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -853,10 +850,10 @@ bool getCartListInfo_5200() {
|
||||
|
||||
void checkCSV_5200() {
|
||||
if (getCartListInfo_5200()) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART SELECTED"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(a5200game);
|
||||
display_Update();
|
||||
// Display Settings
|
||||
@ -867,7 +864,7 @@ void checkCSV_5200() {
|
||||
println_Msg(new5200size);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("CART SELECTED"));
|
||||
Serial.println(a5200game);
|
||||
// Display Settings
|
||||
@ -875,10 +872,10 @@ void checkCSV_5200() {
|
||||
Serial.print(new5200mapper);
|
||||
Serial.print(F("/R"));
|
||||
Serial.println(new5200size);
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("NO SELECTION"));
|
||||
display_Update();
|
||||
@ -901,7 +898,7 @@ void checkSize_5200() {
|
||||
}
|
||||
|
||||
void setCart_5200() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(a5200cartCSV);
|
||||
display_Update();
|
||||
@ -911,7 +908,7 @@ void setCart_5200() {
|
||||
sd.chdir(folder); // Switch Folder
|
||||
a5200csvFile = sd.open(a5200cartCSV, O_READ);
|
||||
if (!a5200csvFile) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CSV FILE NOT FOUND!"));
|
||||
display_Update();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// ATARI 7800 MODULE
|
||||
//******************************************
|
||||
#ifdef enable_7800
|
||||
#ifdef ENABLE_7800
|
||||
// Atari 7800
|
||||
// Cartridge Pinout
|
||||
// 32P 2.54mm pitch (USE 36P CONNECTOR)
|
||||
@ -80,10 +80,7 @@ byte new7800size;
|
||||
// Menu
|
||||
//******************************************
|
||||
// Base Menu
|
||||
static const char a7800MenuItem1[] PROGMEM = "Select Cart";
|
||||
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 };
|
||||
static const char* const menuOptions7800[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
|
||||
|
||||
void setup_7800() {
|
||||
// Request 5V
|
||||
@ -120,7 +117,7 @@ void setup_7800() {
|
||||
PORTL = 0xFF; // A16-A23
|
||||
PORTJ |= (1 << 0); // TIME(PJ0)
|
||||
|
||||
#ifdef clockgen_installed
|
||||
#ifdef ENABLE_CLOCKGEN
|
||||
// Adafruit Clock Generator
|
||||
|
||||
initializeClockOffset();
|
||||
@ -149,7 +146,7 @@ void setup_7800() {
|
||||
checkStatus_7800();
|
||||
strcpy(romName, "ATARI");
|
||||
|
||||
mode = mode_7800;
|
||||
mode = CORE_7800;
|
||||
}
|
||||
|
||||
void a7800Menu() {
|
||||
@ -401,7 +398,7 @@ void readROM_7800() {
|
||||
unsigned long crcsize = a7800[a7800size] * 0x400;
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -425,22 +422,22 @@ void checkMapperSize_7800() {
|
||||
}
|
||||
|
||||
void setROMSize_7800() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (a7800lo == a7800hi)
|
||||
new7800size = a7800lo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = a7800lo;
|
||||
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(a7800[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -457,11 +454,11 @@ void setROMSize_7800() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(a7800[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -476,11 +473,11 @@ void setROMSize_7800() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(a7800[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -518,7 +515,7 @@ setrom:
|
||||
new7800size = sizeROM.toInt() + a7800lo;
|
||||
if (new7800size > a7800hi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
@ -542,11 +539,11 @@ void checkStatus_7800() {
|
||||
EEPROM_writeAnything(8, a7800size);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("ATARI 7800 READER"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("MAPPER: "));
|
||||
println_Msg(a7800mapper);
|
||||
if (a7800mapper == 0)
|
||||
@ -588,7 +585,7 @@ void checkStatus_7800() {
|
||||
Serial.print(F("ROM SIZE: "));
|
||||
Serial.print(A7800[a7800size]);
|
||||
Serial.println(F("K"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -597,20 +594,20 @@ void checkStatus_7800() {
|
||||
//******************************************
|
||||
|
||||
void setMapper_7800() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
int b = 0;
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
uint8_t b = 0;
|
||||
int i = 0;
|
||||
// Check Button Status
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Pressed
|
||||
while (1) { // Scroll Mapper List
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) { // Button Released
|
||||
@ -668,11 +665,11 @@ void setMapper_7800() {
|
||||
println_Msg(F("BASEBALL/ETC [78S4]"));
|
||||
else if (a7800mapselect == 6)
|
||||
println_Msg(F("KARATEKA(PAL) [78S4]"));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -705,11 +702,11 @@ void setMapper_7800() {
|
||||
println_Msg(F("BASEBALL/ETC [78S4]"));
|
||||
else if (a7800mapselect == 6)
|
||||
println_Msg(F("KARATEKA(PAL) [78S4]"));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -741,11 +738,11 @@ void setMapper_7800() {
|
||||
println_Msg(F("BASEBALL/ETC [78S4]"));
|
||||
else if (a7800mapselect == 6)
|
||||
println_Msg(F("KARATEKA(PAL) [78S4]"));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -839,7 +836,7 @@ bool readVals_7800(char* a7800game, char* a7800mm, char* a7800rr, char* a7800ll)
|
||||
bool getCartListInfo_7800() {
|
||||
bool buttonreleased = 0;
|
||||
bool cartselected = 0;
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F(" HOLD TO FAST CYCLE"));
|
||||
display_Update();
|
||||
@ -847,9 +844,9 @@ bool getCartListInfo_7800() {
|
||||
Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
|
||||
#endif
|
||||
delay(2000);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Held - Fast Cycle
|
||||
@ -858,19 +855,19 @@ bool getCartListInfo_7800() {
|
||||
if (strcmp(a7800csvEND, a7800game) == 0) {
|
||||
a7800csvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(a7800game);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.print(F("CART TITLE:"));
|
||||
Serial.println(a7800game);
|
||||
#endif
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
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
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) // Button Released
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("FAST CYCLE OFF"));
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("FAST CYCLE OFF"));
|
||||
Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
|
||||
Serial.println(F("DOUBLE CLICK TO STEP BACK"));
|
||||
Serial.println(F("HOLD TO SELECT"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
while (readVals_7800(a7800game, a7800mm, a7800rr, a7800ll)) {
|
||||
if (strcmp(a7800csvEND, a7800game) == 0) {
|
||||
a7800csvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(a7800game);
|
||||
display.setCursor(0, 48);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -927,7 +924,7 @@ bool getCartListInfo_7800() {
|
||||
Serial.println(a7800game);
|
||||
#endif
|
||||
while (1) { // Single Step
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
if (b == 1) { // Continue (press)
|
||||
break;
|
||||
}
|
||||
@ -943,7 +940,7 @@ bool getCartListInfo_7800() {
|
||||
EEPROM_writeAnything(7, new7800mapper);
|
||||
EEPROM_writeAnything(8, new7800size);
|
||||
cartselected = 1; // SELECTION MADE
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(F("SELECTION MADE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -958,8 +955,8 @@ bool getCartListInfo_7800() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
println_Msg(F(""));
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("END OF FILE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -971,10 +968,10 @@ bool getCartListInfo_7800() {
|
||||
|
||||
void checkCSV_7800() {
|
||||
if (getCartListInfo_7800()) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART SELECTED"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(a7800game);
|
||||
display_Update();
|
||||
// Display Settings
|
||||
@ -985,7 +982,7 @@ void checkCSV_7800() {
|
||||
println_Msg(new7800size);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("CART SELECTED"));
|
||||
Serial.println(a7800game);
|
||||
// Display Settings
|
||||
@ -993,10 +990,10 @@ void checkCSV_7800() {
|
||||
Serial.print(new7800mapper);
|
||||
Serial.print(F("/R"));
|
||||
Serial.println(new7800size);
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("NO SELECTION"));
|
||||
display_Update();
|
||||
@ -1019,7 +1016,7 @@ void checkSize_7800() {
|
||||
}
|
||||
|
||||
void setCart_7800() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(a7800cartCSV);
|
||||
display_Update();
|
||||
@ -1029,7 +1026,7 @@ void setCart_7800() {
|
||||
sd.chdir(folder); // Switch Folder
|
||||
a7800csvFile = sd.open(a7800cartCSV, O_READ);
|
||||
if (!a7800csvFile) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CSV FILE NOT FOUND!"));
|
||||
display_Update();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// EMERSON ARCADIA 2001 MODULE
|
||||
//******************************************
|
||||
#if defined(enable_ARC)
|
||||
#if defined(ENABLE_ARC)
|
||||
// Emerson Arcadia 2001
|
||||
// Cartridge Pinout
|
||||
// 30P 2.54mm pitch connector
|
||||
@ -49,11 +49,7 @@ byte newarcsize;
|
||||
// Menu
|
||||
//******************************************
|
||||
// Base Menu
|
||||
static const char arcMenuItem1[] PROGMEM = "Select Cart";
|
||||
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 };
|
||||
static const char* const menuOptionsARC[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
|
||||
|
||||
void setup_ARC() {
|
||||
// Request 5V
|
||||
@ -93,7 +89,7 @@ void setup_ARC() {
|
||||
checkStatus_ARC();
|
||||
strcpy(romName, "ARCADIA");
|
||||
|
||||
mode = mode_ARC;
|
||||
mode = CORE_ARC;
|
||||
}
|
||||
|
||||
void arcMenu() {
|
||||
@ -194,7 +190,7 @@ void readROM_ARC() {
|
||||
unsigned long crcsize = ARC[arcsize] * 0x400;
|
||||
calcCRC(fileName, crcsize, NULL, 0);
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
@ -205,22 +201,22 @@ void readROM_ARC() {
|
||||
//******************************************
|
||||
|
||||
void setROMSize_ARC() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (arclo == archi)
|
||||
newarcsize = arclo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = arclo;
|
||||
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(ARC[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -238,11 +234,11 @@ void setROMSize_ARC() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(ARC[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -258,11 +254,11 @@ void setROMSize_ARC() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(ARC[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -300,7 +296,7 @@ setrom:
|
||||
newarcsize = sizeROM.toInt() + arclo;
|
||||
if (newarcsize > archi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
@ -319,11 +315,11 @@ void checkStatus_ARC() {
|
||||
EEPROM_writeAnything(8, arcsize);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("ARCADIA 2001 READER"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("ROM SIZE: "));
|
||||
print_Msg(ARC[arcsize]);
|
||||
println_Msg(F("K"));
|
||||
@ -333,7 +329,7 @@ void checkStatus_ARC() {
|
||||
Serial.print(F("CURRENT ROM SIZE: "));
|
||||
Serial.print(ARC[arcsize]);
|
||||
Serial.println(F("K"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -386,7 +382,7 @@ bool readVals_ARC(char* arcgame, char* arcrr, char* arcll) {
|
||||
bool getCartListInfo_ARC() {
|
||||
bool buttonreleased = 0;
|
||||
bool cartselected = 0;
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F(" HOLD TO FAST CYCLE"));
|
||||
display_Update();
|
||||
@ -394,9 +390,9 @@ bool getCartListInfo_ARC() {
|
||||
Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
|
||||
#endif
|
||||
delay(2000);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Held - Fast Cycle
|
||||
@ -405,19 +401,19 @@ bool getCartListInfo_ARC() {
|
||||
if (strcmp(arccsvEND, arcgame) == 0) {
|
||||
arccsvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(arcgame);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.print(F("CART TITLE:"));
|
||||
Serial.println(arcgame);
|
||||
#endif
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
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
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) // Button Released
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("FAST CYCLE OFF"));
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("FAST CYCLE OFF"));
|
||||
Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
|
||||
Serial.println(F("DOUBLE CLICK TO STEP BACK"));
|
||||
Serial.println(F("HOLD TO SELECT"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
while (readVals_ARC(arcgame, arcrr, arcll)) {
|
||||
if (strcmp(arccsvEND, arcgame) == 0) {
|
||||
arccsvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(arcgame);
|
||||
display.setCursor(0, 48);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -474,7 +470,7 @@ bool getCartListInfo_ARC() {
|
||||
Serial.println(arcgame);
|
||||
#endif
|
||||
while (1) { // Single Step
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
if (b == 1) { // Continue (press)
|
||||
break;
|
||||
}
|
||||
@ -488,7 +484,7 @@ bool getCartListInfo_ARC() {
|
||||
newarcsize = strtol(arcrr, NULL, 10);
|
||||
EEPROM_writeAnything(8, newarcsize);
|
||||
cartselected = 1; // SELECTION MADE
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(F("SELECTION MADE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -503,8 +499,8 @@ bool getCartListInfo_ARC() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
println_Msg(F(""));
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("END OF FILE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -516,10 +512,10 @@ bool getCartListInfo_ARC() {
|
||||
|
||||
void checkCSV_ARC() {
|
||||
if (getCartListInfo_ARC()) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART SELECTED"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(arcgame);
|
||||
display_Update();
|
||||
// Display Settings
|
||||
@ -528,16 +524,16 @@ void checkCSV_ARC() {
|
||||
println_Msg(newarcsize);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("CART SELECTED"));
|
||||
Serial.println(arcgame);
|
||||
// Display Settings
|
||||
Serial.print(F("CODE: R"));
|
||||
Serial.println(newarcsize);
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("NO SELECTION"));
|
||||
display_Update();
|
||||
@ -548,7 +544,7 @@ void checkCSV_ARC() {
|
||||
}
|
||||
|
||||
void setCart_ARC() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(arccartCSV);
|
||||
display_Update();
|
||||
@ -558,7 +554,7 @@ void setCart_ARC() {
|
||||
sd.chdir(folder); // Switch Folder
|
||||
arccsvFile = sd.open(arccartCSV, O_READ);
|
||||
if (!arccsvFile) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CSV FILE NOT FOUND!"));
|
||||
display_Update();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// COMMODORE 64 MODULE
|
||||
//******************************************
|
||||
#ifdef enable_C64
|
||||
#ifdef ENABLE_C64
|
||||
// Commodore 64
|
||||
// Cartridge Pinout
|
||||
// 44P 2.54mm pitch connector
|
||||
@ -126,10 +126,7 @@ byte newc64port;
|
||||
// MENU
|
||||
//******************************************
|
||||
// Base Menu
|
||||
static const char c64MenuItem1[] PROGMEM = "Select Cart";
|
||||
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 };
|
||||
static const char* const menuOptionsC64[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
|
||||
|
||||
void c64Menu() {
|
||||
convertPgm(menuOptionsC64, 4);
|
||||
@ -211,7 +208,7 @@ void setup_C64() {
|
||||
checkStatus_C64();
|
||||
strcpy(romName, "C64");
|
||||
|
||||
mode = mode_C64;
|
||||
mode = CORE_C64;
|
||||
}
|
||||
|
||||
//******************************************
|
||||
@ -709,7 +706,7 @@ void readROM_C64() {
|
||||
unsigned long crcsize = C64[c64size] * 0x400;
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -720,20 +717,20 @@ void readROM_C64() {
|
||||
// MAPPER CODE
|
||||
//******************************************
|
||||
void setMapper_C64() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
int b = 0;
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
uint8_t b = 0;
|
||||
int i = 0;
|
||||
// Check Button Status
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Pressed
|
||||
while (1) { // Scroll Mapper List
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) { // Button Released
|
||||
@ -765,11 +762,11 @@ void setMapper_C64() {
|
||||
c64mapselect = pgm_read_byte(c64mapsize + c64index);
|
||||
println_Msg(c64mapselect);
|
||||
printMapper_C64(c64mapselect);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -789,11 +786,11 @@ void setMapper_C64() {
|
||||
c64mapselect = pgm_read_byte(c64mapsize + c64index);
|
||||
println_Msg(c64mapselect);
|
||||
printMapper_C64(c64mapselect);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -812,11 +809,11 @@ void setMapper_C64() {
|
||||
c64mapselect = pgm_read_byte(c64mapsize + c64index);
|
||||
println_Msg(c64mapselect);
|
||||
printMapper_C64(c64mapselect);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -852,7 +849,7 @@ setmapper:
|
||||
}
|
||||
if (c64mapfound == false) {
|
||||
Serial.println(F("MAPPER NOT SUPPORTED!"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
newc64mapper = 0;
|
||||
goto setmapper;
|
||||
}
|
||||
@ -877,22 +874,22 @@ void checkMapperSize_C64() {
|
||||
// SET ROM SIZE
|
||||
//******************************************
|
||||
void setROMSize_C64() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (c64lo == c64hi)
|
||||
newc64size = c64lo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = c64lo;
|
||||
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(C64[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -909,11 +906,11 @@ void setROMSize_C64() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(C64[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -928,11 +925,11 @@ void setROMSize_C64() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(C64[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -970,7 +967,7 @@ setrom:
|
||||
newc64size = sizeROM.toInt() + c64lo;
|
||||
if (newc64size > c64hi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
@ -987,8 +984,8 @@ setrom:
|
||||
//******************************************
|
||||
void setPorts_C64()
|
||||
{
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
int b = 0;
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
uint8_t b = 0;
|
||||
int i = 0;
|
||||
|
||||
display_Clear();
|
||||
@ -1006,7 +1003,7 @@ void setPorts_C64()
|
||||
else if (i == 3) {
|
||||
println_Msg(F("EXROM HIGH/GAME HIGH"));
|
||||
}
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Press to Change"));
|
||||
println_Msg(F("Hold to Select"));
|
||||
display_Update();
|
||||
@ -1034,7 +1031,7 @@ void setPorts_C64()
|
||||
else if (i == 3) {
|
||||
println_Msg(F("EXROM HIGH/GAME HIGH"));
|
||||
}
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Press to Change"));
|
||||
println_Msg(F("Hold to Select"));
|
||||
display_Update();
|
||||
@ -1061,7 +1058,7 @@ void setPorts_C64()
|
||||
else if (i == 3) {
|
||||
println_Msg(F("EXROM HIGH/GAME HIGH"));
|
||||
}
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Press to Change"));
|
||||
println_Msg(F("Hold to Select"));
|
||||
display_Update();
|
||||
@ -1092,7 +1089,7 @@ setrom:
|
||||
newc64port = sizeROM.toInt();
|
||||
if (newc64port > 3) {
|
||||
Serial.println(F("INVALID STATE"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
Serial.print(F("Port State = "));
|
||||
@ -1122,11 +1119,11 @@ void checkStatus_C64() {
|
||||
EEPROM_writeAnything(12, c64port);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("C64 READER"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("MAPPER: "));
|
||||
println_Msg(c64mapper);
|
||||
printMapper_C64(c64mapper);
|
||||
@ -1145,12 +1142,12 @@ void checkStatus_C64() {
|
||||
Serial.println(F("K"));
|
||||
Serial.print(F("CURRENT PORT STATE: "));
|
||||
Setial.println(c64port);
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void printMapper_C64(byte c64maplabel) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
switch (c64maplabel) {
|
||||
case 0:
|
||||
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 buttonreleased = 0;
|
||||
bool cartselected = 0;
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F(" HOLD TO FAST CYCLE"));
|
||||
display_Update();
|
||||
@ -1307,9 +1304,9 @@ bool getCartListInfo_C64() {
|
||||
Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
|
||||
#endif
|
||||
delay(2000);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Held - Fast Cycle
|
||||
@ -1318,19 +1315,19 @@ bool getCartListInfo_C64() {
|
||||
if (strcmp(c64csvEND, c64game) == 0) {
|
||||
c64csvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(c64game);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.print(F("CART TITLE:"));
|
||||
Serial.println(c64game);
|
||||
#endif
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
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
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) // Button Released
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("FAST CYCLE OFF"));
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("FAST CYCLE OFF"));
|
||||
Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
|
||||
Serial.println(F("DOUBLE CLICK TO STEP BACK"));
|
||||
Serial.println(F("HOLD TO SELECT"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
while (readVals_C64(c64game, c64mm, c64rr, c64pp, c64ll)) {
|
||||
if (strcmp(c64csvEND, c64game) == 0) {
|
||||
c64csvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(c64game);
|
||||
display.setCursor(0, 48);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1387,7 +1384,7 @@ bool getCartListInfo_C64() {
|
||||
Serial.println(c64game);
|
||||
#endif
|
||||
while (1) { // Single Step
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
if (b == 1) { // Continue (press)
|
||||
break;
|
||||
}
|
||||
@ -1405,7 +1402,7 @@ bool getCartListInfo_C64() {
|
||||
EEPROM_writeAnything(8, newc64size);
|
||||
EEPROM_writeAnything(12, newc64port);
|
||||
cartselected = 1; // SELECTION MADE
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(F("SELECTION MADE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -1420,8 +1417,8 @@ bool getCartListInfo_C64() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
println_Msg(F(""));
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("END OF FILE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -1433,10 +1430,10 @@ bool getCartListInfo_C64() {
|
||||
|
||||
void checkCSV_C64() {
|
||||
if (getCartListInfo_C64()) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART SELECTED"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(c64game);
|
||||
display_Update();
|
||||
// Display Settings
|
||||
@ -1449,7 +1446,7 @@ void checkCSV_C64() {
|
||||
print_Msg(newc64port);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("CART SELECTED"));
|
||||
Serial.println(c64game);
|
||||
// Display Settings
|
||||
@ -1459,10 +1456,10 @@ void checkCSV_C64() {
|
||||
Serial.print(newc64size);
|
||||
Serial.print(F("/P"));
|
||||
Serial.print(newc64port);
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("NO SELECTION"));
|
||||
display_Update();
|
||||
@ -1473,7 +1470,7 @@ void checkCSV_C64() {
|
||||
}
|
||||
|
||||
void setCart_C64() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(c64cartCSV);
|
||||
display_Update();
|
||||
@ -1483,7 +1480,7 @@ void setCart_C64() {
|
||||
sd.chdir(folder); // Switch Folder
|
||||
c64csvFile = sd.open(c64cartCSV, O_READ);
|
||||
if (!c64csvFile) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CSV FILE NOT FOUND!"));
|
||||
display_Update();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// COLECOVISION MODULE
|
||||
//******************************************
|
||||
#ifdef enable_COLV
|
||||
#ifdef ENABLE_COLV
|
||||
|
||||
// Coleco Colecovision
|
||||
// Cartridge Pinout
|
||||
@ -48,11 +48,7 @@ byte newcolsize;
|
||||
// Menu
|
||||
//******************************************
|
||||
// Base Menu
|
||||
static const char colMenuItem1[] PROGMEM = "Select Cart";
|
||||
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 };
|
||||
static const char* const menuOptionsCOL[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
|
||||
|
||||
void setup_COL() {
|
||||
// Request 5V
|
||||
@ -92,7 +88,7 @@ void setup_COL() {
|
||||
checkStatus_COL();
|
||||
strcpy(romName, "COLECO");
|
||||
|
||||
mode = mode_COL;
|
||||
mode = CORE_COL;
|
||||
}
|
||||
|
||||
void colMenu() {
|
||||
@ -218,7 +214,7 @@ void readROM_COL() {
|
||||
// Compare CRC32 to database and rename ROM if found
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -230,22 +226,22 @@ void readROM_COL() {
|
||||
//******************************************
|
||||
|
||||
void setROMSize_COL() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (collo == colhi)
|
||||
newcolsize = collo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = collo;
|
||||
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(pgm_read_byte(&(COL[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -263,11 +259,11 @@ void setROMSize_COL() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(pgm_read_byte(&(COL[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -283,11 +279,11 @@ void setROMSize_COL() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(pgm_read_byte(&(COL[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -325,7 +321,7 @@ setrom:
|
||||
newcolsize = sizeROM.toInt() + collo;
|
||||
if (newcolsize > colhi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
@ -344,15 +340,15 @@ void checkStatus_COL() {
|
||||
EEPROM_writeAnything(8, colsize);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("COLECOVISION READER"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("ROM SIZE: "));
|
||||
print_Msg(pgm_read_byte(&(COL[colsize])));
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -361,7 +357,7 @@ void checkStatus_COL() {
|
||||
Serial.print(F("CURRENT ROM SIZE: "));
|
||||
Serial.print(pgm_read_byte(&(COL[colsize])));
|
||||
Serial.println(F("K"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -445,16 +441,16 @@ void setCart_COL() {
|
||||
skip_line(&myFile);
|
||||
|
||||
println_Msg(F("Select your cartridge"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(gamename);
|
||||
print_Msg(F("Size: "));
|
||||
print_Msg(cartSize);
|
||||
println_Msg(F("KB"));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#elif defined(SERIAL_MONITOR)
|
||||
@ -463,7 +459,7 @@ void setCart_COL() {
|
||||
#endif
|
||||
display_Update();
|
||||
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
while (1) {
|
||||
// Check button input
|
||||
b = checkButton();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -77,7 +77,7 @@ void DynamicClockSerial::begin(unsigned long baud, byte config, unsigned long sc
|
||||
}
|
||||
|
||||
// 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)
|
||||
DynamicClockSerial ClockedSerial(&UBRRH, &UBRRL, &UCSRA, &UCSRB, &UCSRC, &UDR);
|
||||
#else
|
||||
|
@ -53,7 +53,7 @@
|
||||
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.
|
||||
*/
|
||||
|
||||
//#define RTC_installed
|
||||
//#define ENABLE_RTC
|
||||
|
||||
/****/
|
||||
|
||||
@ -71,218 +71,218 @@
|
||||
/* [ Atari 2600 --------------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_2600
|
||||
//#define ENABLE_2600
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Atari 5200 --------------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_5200
|
||||
//#define ENABLE_5200
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Atari 7800 --------------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_7800
|
||||
//#define ENABLE_7800
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Benesse Pocket Challenge W ----------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_PCW
|
||||
//#define ENABLE_PCW
|
||||
|
||||
/****/
|
||||
|
||||
/* [ C64 --------------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_C64
|
||||
//#define ENABLE_C64
|
||||
|
||||
/****/
|
||||
|
||||
/* [ ColecoVision ------------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_COLV
|
||||
//#define ENABLE_COLV
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Emerson Arcadia 2001 ----------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_ARC
|
||||
//#define ENABLE_ARC
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Fairchild Channel F ------------------------------------------ ]
|
||||
*/
|
||||
|
||||
//#define enable_FAIRCHILD
|
||||
//#define ENABLE_FAIRCHILD
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Flashrom Programmer for SNES repros -------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_FLASH
|
||||
//#define enable_FLASH16
|
||||
//#define ENABLE_FLASH
|
||||
//#define ENABLE_FLASH16
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Game Boy (Color) and Advance --------------------------------- ]
|
||||
*/
|
||||
|
||||
#define enable_GBX
|
||||
#define ENABLE_GBX
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Intellivision ------------------------------------------------ ]
|
||||
*/
|
||||
|
||||
//#define enable_INTV
|
||||
//#define ENABLE_INTV
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Neo Geo Pocket ----------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_NGP
|
||||
//#define ENABLE_NGP
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Nintendo 64 -------------------------------------------------- ]
|
||||
*/
|
||||
|
||||
#define enable_N64
|
||||
#define ENABLE_N64
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Nintendo Entertainment System/Family Computer ---------------- ]
|
||||
*/
|
||||
|
||||
#define enable_NES
|
||||
#define ENABLE_NES
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Magnavox Odyssey 2 ------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_ODY2
|
||||
//#define ENABLE_ODY2
|
||||
|
||||
/****/
|
||||
|
||||
/* [ MSX ------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_MSX
|
||||
//#define ENABLE_MSX
|
||||
|
||||
/****/
|
||||
|
||||
/* [ PC Engine/TurboGrafx 16 -------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_PCE
|
||||
//#define ENABLE_PCE
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Pokemon Mini -------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_POKE
|
||||
//#define ENABLE_POKE
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Sega Master System/Mark III/Game Gear/SG-1000 ---------------- ]
|
||||
*/
|
||||
|
||||
#define enable_SMS
|
||||
#define ENABLE_SMS
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Sega Mega Drive/Genesis -------------------------------------- ]
|
||||
*/
|
||||
|
||||
#define enable_MD
|
||||
#define ENABLE_MD
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Super Famicom SF Memory Cassette ----------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_SFM
|
||||
//#define ENABLE_SFM
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Super Famicom Satellaview ------------------------------------ ]
|
||||
*/
|
||||
|
||||
//#define enable_SV
|
||||
//#define ENABLE_SV
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Super Famicom Sufami Turbo ----------------------------------- ]
|
||||
*/
|
||||
|
||||
// #define enable_ST
|
||||
// #define ENABLE_ST
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Super Famicom Game Processor RAM Cassette -------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_GPC
|
||||
//#define ENABLE_GPC
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Super Nintendo ----------------------------------------------- ]
|
||||
*/
|
||||
|
||||
#define enable_SNES
|
||||
#define ENABLE_SNES
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Vectrex --------------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_VECTREX
|
||||
//#define ENABLE_VECTREX
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Virtual Boy -------------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_VBOY
|
||||
//#define ENABLE_VBOY
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Watara Supervision ------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_WSV
|
||||
//#define ENABLE_WSV
|
||||
|
||||
/****/
|
||||
|
||||
/* [ WonderSwan and Benesse Pocket Challenge v2 ------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_WS
|
||||
//#define ENABLE_WS
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Super A'can -------------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_SUPRACAN
|
||||
//#define ENABLE_SUPRACAN
|
||||
|
||||
/****/
|
||||
|
||||
/* [ Casio Loopy -------------------------------------------------- ]
|
||||
*/
|
||||
|
||||
//#define enable_LOOPY
|
||||
//#define ENABLE_LOOPY
|
||||
|
||||
/****/
|
||||
|
||||
@ -316,7 +316,7 @@
|
||||
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.
|
||||
*/
|
||||
|
||||
#define enable_selftest
|
||||
#define ENABLE_SELFTEST
|
||||
|
||||
/****/
|
||||
|
||||
@ -358,7 +358,7 @@
|
||||
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
|
||||
*/
|
||||
|
||||
//#define clockgen_calibration
|
||||
//#define use_clockgen_calibration
|
||||
//#define OPTION_CLOCKGEN_CALIBRATION
|
||||
//#define OPTION_CLOCKGEN_USE_CALIBRATION
|
||||
|
||||
/****/
|
||||
|
||||
@ -403,7 +403,7 @@
|
||||
Configure how the MD core saves are formatted.
|
||||
|
||||
Can be set using config:
|
||||
md.sramType=0
|
||||
md.saveType=0
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
//#define DEFAULT_VALUE_segaSram16bit 0
|
||||
//#define OPTION_MD_DEFAULT_SAVE_TYPE 0
|
||||
|
||||
/****/
|
||||
|
||||
@ -423,7 +423,7 @@
|
||||
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
|
||||
*/
|
||||
|
||||
//#define savesummarytotxt
|
||||
//#define OPTION_N64_SAVESUMMARY
|
||||
|
||||
/****/
|
||||
|
||||
@ -450,33 +450,33 @@
|
||||
#endif
|
||||
|
||||
#if (defined(HW4) || defined(HW5))
|
||||
# define enable_LCD
|
||||
# define enable_neopixel
|
||||
# define enable_rotary
|
||||
# define ENABLE_LCD
|
||||
# define ENABLE_NEOPIXEL
|
||||
# define ENABLE_ROTARY
|
||||
//# define rotate_counter_clockwise
|
||||
# define clockgen_installed
|
||||
# define fastcrc
|
||||
# define ws_adapter_v2
|
||||
# define ENABLE_CLOCKGEN
|
||||
# define OPTION_N64_FASTCRC
|
||||
# define OPTION_WS_ADAPTER_V2
|
||||
#endif
|
||||
|
||||
#if (defined(HW2) || defined(HW3))
|
||||
# define enable_OLED
|
||||
# define enable_Button2
|
||||
# define clockgen_installed
|
||||
# define CA_LED
|
||||
# define fastcrc
|
||||
# define ENABLE_OLED
|
||||
# define ENABLE_BUTTON2
|
||||
# define ENABLE_CLOCKGEN
|
||||
# define ENABLE_CA_LED
|
||||
# define OPTION_N64_FASTCRC
|
||||
#endif
|
||||
|
||||
#if defined(HW1)
|
||||
# define enable_OLED
|
||||
//#define clockgen_installed
|
||||
//#define fastcrc
|
||||
# define ENABLE_OLED
|
||||
//#define ENABLE_CLOCKGEN
|
||||
//#define OPTION_N64_FASTCRC
|
||||
#endif
|
||||
|
||||
#if defined(SERIAL_MONITOR)
|
||||
# define enable_serial
|
||||
//#define clockgen_installed
|
||||
//#define fastcrc
|
||||
# define ENABLE_SERIAL
|
||||
//#define ENABLE_CLOCKGEN
|
||||
//#define OPTION_N64_FASTCRC
|
||||
#endif
|
||||
|
||||
/* Firmware updater only works with HW3 and HW5 */
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// FAIRCHILD CHANNEL F MODULE
|
||||
//******************************************
|
||||
#if defined(enable_FAIRCHILD)
|
||||
#if defined(ENABLE_FAIRCHILD)
|
||||
// Fairchild Channel F
|
||||
// Cartridge Pinout
|
||||
// 22P (27P Width) 2.54mm pitch connector
|
||||
@ -79,12 +79,8 @@ byte newfairchildsize;
|
||||
// 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 fairchildMenuItem5[] PROGMEM = "Reset";
|
||||
static const char* const menuOptionsFAIRCHILD[] PROGMEM = { fairchildMenuItem1, fairchildMenuItem2, fairchildMenuItem3, fairchildMenuItem4, fairchildMenuItem5 };
|
||||
static const char* const menuOptionsFAIRCHILD[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, fairchildMenuItem4, FSTRING_RESET };
|
||||
|
||||
void setup_FAIRCHILD() {
|
||||
// Request 5V
|
||||
@ -125,7 +121,7 @@ void setup_FAIRCHILD() {
|
||||
checkStatus_FAIRCHILD();
|
||||
strcpy(romName, "FAIRCHILD");
|
||||
|
||||
mode = mode_FAIRCHILD;
|
||||
mode = CORE_FAIRCHILD;
|
||||
}
|
||||
|
||||
void fairchildMenu() {
|
||||
@ -478,7 +474,7 @@ void readROM_FAIRCHILD() {
|
||||
|
||||
calcCRC(fileName, cartsize, NULL, 0);
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
@ -533,7 +529,7 @@ void read16K_FAIRCHILD() // Read 16K Bytes
|
||||
|
||||
calcCRC(fileName, 0x4000, NULL, 0);
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
@ -544,21 +540,21 @@ void read16K_FAIRCHILD() // Read 16K Bytes
|
||||
//******************************************
|
||||
|
||||
void setROMSize_FAIRCHILD() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (fairchildlo == fairchildhi)
|
||||
newfairchildsize = fairchildlo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = fairchildlo;
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(FAIRCHILD[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -575,11 +571,11 @@ void setROMSize_FAIRCHILD() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(FAIRCHILD[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -594,11 +590,11 @@ void setROMSize_FAIRCHILD() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(FAIRCHILD[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -636,7 +632,7 @@ setrom:
|
||||
newfairchildsize = sizeROM.toInt() + fairchildlo;
|
||||
if (newfairchildsize > fairchildhi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
@ -655,11 +651,11 @@ void checkStatus_FAIRCHILD() {
|
||||
EEPROM_writeAnything(8, fairchildsize);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CHANNEL F READER"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("ROM SIZE: "));
|
||||
print_Msg(FAIRCHILD[fairchildsize]);
|
||||
println_Msg(F("K"));
|
||||
@ -669,7 +665,7 @@ void checkStatus_FAIRCHILD() {
|
||||
Serial.print(F("CURRENT ROM SIZE: "));
|
||||
Serial.print(FAIRCHILD[fairchildsize]);
|
||||
Serial.println(F("K"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -722,7 +718,7 @@ bool readVals_FAIRCHILD(char* fairchildgame, char* fairchildrr, char* fairchildl
|
||||
bool getCartListInfo_FAIRCHILD() {
|
||||
bool buttonreleased = 0;
|
||||
bool cartselected = 0;
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F(" HOLD TO FAST CYCLE"));
|
||||
display_Update();
|
||||
@ -730,9 +726,9 @@ bool getCartListInfo_FAIRCHILD() {
|
||||
Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
|
||||
#endif
|
||||
delay(2000);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Held - Fast Cycle
|
||||
@ -741,19 +737,19 @@ bool getCartListInfo_FAIRCHILD() {
|
||||
if (strcmp(fairchildcsvEND, fairchildgame) == 0) {
|
||||
fairchildcsvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(fairchildgame);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.print(F("CART TITLE:"));
|
||||
Serial.println(fairchildgame);
|
||||
#endif
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
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
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) // Button Released
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("FAST CYCLE OFF"));
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("FAST CYCLE OFF"));
|
||||
Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
|
||||
Serial.println(F("DOUBLE CLICK TO STEP BACK"));
|
||||
Serial.println(F("HOLD TO SELECT"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
while (readVals_FAIRCHILD(fairchildgame, fairchildrr, fairchildll)) {
|
||||
if (strcmp(fairchildcsvEND, fairchildgame) == 0) {
|
||||
fairchildcsvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(fairchildgame);
|
||||
display.setCursor(0, 48);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -810,7 +806,7 @@ bool getCartListInfo_FAIRCHILD() {
|
||||
Serial.println(fairchildgame);
|
||||
#endif
|
||||
while (1) { // Single Step
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
if (b == 1) { // Continue (press)
|
||||
break;
|
||||
}
|
||||
@ -824,7 +820,7 @@ bool getCartListInfo_FAIRCHILD() {
|
||||
newfairchildsize = strtol(fairchildrr, NULL, 10);
|
||||
EEPROM_writeAnything(8, newfairchildsize);
|
||||
cartselected = 1; // SELECTION MADE
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(F("SELECTION MADE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -839,8 +835,8 @@ bool getCartListInfo_FAIRCHILD() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
println_Msg(F(""));
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("END OF FILE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -852,10 +848,10 @@ bool getCartListInfo_FAIRCHILD() {
|
||||
|
||||
void checkCSV_FAIRCHILD() {
|
||||
if (getCartListInfo_FAIRCHILD()) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART SELECTED"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(fairchildgame);
|
||||
display_Update();
|
||||
// Display Settings
|
||||
@ -864,16 +860,16 @@ void checkCSV_FAIRCHILD() {
|
||||
println_Msg(newfairchildsize);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("CART SELECTED"));
|
||||
Serial.println(fairchildgame);
|
||||
// Display Settings
|
||||
Serial.print(F("CODE: R"));
|
||||
Serial.println(newfairchildsize);
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("NO SELECTION"));
|
||||
display_Update();
|
||||
@ -884,7 +880,7 @@ void checkCSV_FAIRCHILD() {
|
||||
}
|
||||
|
||||
void setCart_FAIRCHILD() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(fairchildcartCSV);
|
||||
display_Update();
|
||||
@ -894,7 +890,7 @@ void setCart_FAIRCHILD() {
|
||||
sd.chdir(folder); // Switch Folder
|
||||
fairchildcsvFile = sd.open(fairchildcartCSV, O_READ);
|
||||
if (!fairchildcsvFile) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CSV FILE NOT FOUND!"));
|
||||
display_Update();
|
||||
|
@ -2,7 +2,7 @@
|
||||
// FLASHROM MODULE
|
||||
// (also includes SNES repro functions)
|
||||
//******************************************
|
||||
#ifdef enable_FLASH
|
||||
#ifdef ENABLE_FLASH
|
||||
|
||||
/******************************************
|
||||
Variables
|
||||
@ -27,16 +27,14 @@ static const char flash8MenuItem3[] PROGMEM = "Read";
|
||||
static const char flash8MenuItem4[] PROGMEM = "Write";
|
||||
static const char flash8MenuItem5[] PROGMEM = "ID";
|
||||
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, string_reset2 };
|
||||
static const char* const menuOptionsFLASH8[] PROGMEM = { flash8MenuItem1, flash8MenuItem2, flash8MenuItem3, flash8MenuItem4, flash8MenuItem5, flash8MenuItem6, FSTRING_RESET };
|
||||
|
||||
#ifdef enable_FLASH16
|
||||
#ifdef ENABLE_FLASH16
|
||||
// Flash start menu
|
||||
static const char flashMenuItem1[] PROGMEM = "8bit Flash adapter";
|
||||
static const char flashMenuItem2[] PROGMEM = "Eprom 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, string_reset2 };
|
||||
static const char* const menuOptionsFlash[] PROGMEM = { flashMenuItem1, flashMenuItem2, flashMenuItem3, FSTRING_RESET };
|
||||
|
||||
// 16bit Flash menu items
|
||||
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 flash16MenuItem5[] PROGMEM = "ID";
|
||||
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, string_reset2 };
|
||||
static const char* const menuOptionsFLASH16[] PROGMEM = { flash16MenuItem1, flash16MenuItem2, flash16MenuItem3, flash16MenuItem4, flash16MenuItem5, flash16MenuItem6, FSTRING_RESET };
|
||||
|
||||
// Eprom menu items
|
||||
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 epromMenuItem4[] PROGMEM = "Verify";
|
||||
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, string_reset2 };
|
||||
static const char* const menuOptionsEprom[] PROGMEM = { epromMenuItem1, epromMenuItem2, epromMenuItem3, epromMenuItem4, epromMenuItem5, FSTRING_RESET };
|
||||
|
||||
void flashMenu() {
|
||||
// create menu with title and 3 options to choose from
|
||||
@ -73,14 +69,14 @@ void flashMenu() {
|
||||
setup_Flash8();
|
||||
id_Flash8();
|
||||
wait();
|
||||
mode = mode_FLASH8;
|
||||
mode = CORE_FLASH8;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_Eprom();
|
||||
mode = mode_EPROM;
|
||||
mode = CORE_EPROM;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@ -89,7 +85,7 @@ void flashMenu() {
|
||||
setup_Flash16();
|
||||
id_Flash16();
|
||||
wait();
|
||||
mode = mode_FLASH16;
|
||||
mode = CORE_FLASH16;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
@ -108,7 +104,7 @@ void flashMenu() {
|
||||
setup_Flash8();
|
||||
id_Flash8();
|
||||
wait();
|
||||
mode = mode_FLASH8;
|
||||
mode = CORE_FLASH8;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -204,9 +200,9 @@ void flashromMenu8() {
|
||||
case 3: idFlash28FXXX(); break;
|
||||
}
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
printFlash(40);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Update();
|
||||
|
||||
resetFlash8();
|
||||
@ -241,7 +237,7 @@ void flashromMenu8() {
|
||||
wait();
|
||||
}
|
||||
|
||||
#ifdef enable_FLASH16
|
||||
#ifdef ENABLE_FLASH16
|
||||
void flashromMenu16() {
|
||||
// create menu with title "Flashrom Writer 16" and 7 options to choose from
|
||||
unsigned char mainMenu;
|
||||
@ -302,9 +298,9 @@ void flashromMenu16() {
|
||||
display_Clear();
|
||||
println_Msg(F("ID Flashrom"));
|
||||
idFlash16();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
printFlash16(40);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Update();
|
||||
resetFlash16();
|
||||
break;
|
||||
@ -592,9 +588,9 @@ idtheflash:
|
||||
// print first 40 bytes of flash
|
||||
display_Clear();
|
||||
println_Msg(F("First 40 bytes:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
printFlash(40);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Update();
|
||||
resetFlash8();
|
||||
print_FatalError(F("Press Button to reset"));
|
||||
@ -607,7 +603,7 @@ idtheflash:
|
||||
resetFlash8();
|
||||
}
|
||||
|
||||
#ifdef enable_FLASH16
|
||||
#ifdef ENABLE_FLASH16
|
||||
void id_Flash16() {
|
||||
// ID flash
|
||||
idFlash16();
|
||||
@ -683,8 +679,7 @@ void id_Flash16() {
|
||||
#if defined(ENABLE_VSELECT) || defined(ENABLE_3V3FIX)
|
||||
static const char flashvoltItem1[] PROGMEM = "3.3V";
|
||||
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, string_reset2 };
|
||||
static const char* const flashvoltOptions[] PROGMEM = { flashvoltItem1, flashvoltItem2, FSTRING_RESET };
|
||||
|
||||
void setup_FlashVoltage() {
|
||||
// create menu with title and 3 options to choose from
|
||||
@ -737,7 +732,7 @@ void setup_Flash8() {
|
||||
PORTC = 0x00;
|
||||
}
|
||||
|
||||
#ifdef enable_FLASH16
|
||||
#ifdef ENABLE_FLASH16
|
||||
void setup_Flash16() {
|
||||
// Set Address Pins to Output
|
||||
//A0-A7
|
||||
@ -803,7 +798,7 @@ void dataIn8() {
|
||||
DDRC = 0x00;
|
||||
}
|
||||
|
||||
#ifdef enable_FLASH16
|
||||
#ifdef ENABLE_FLASH16
|
||||
// Switch data pins to write
|
||||
void dataOut16() {
|
||||
DDRC = 0xFF;
|
||||
@ -986,7 +981,7 @@ byte readByte_Flash(unsigned long myAddress) {
|
||||
return tempByte;
|
||||
}
|
||||
|
||||
#ifdef enable_FLASH16
|
||||
#ifdef ENABLE_FLASH16
|
||||
void writeWord_Flash(unsigned long myAddress, word myData) {
|
||||
PORTF = myAddress & 0xFF;
|
||||
PORTK = (myAddress >> 8) & 0xFF;
|
||||
@ -1144,9 +1139,9 @@ void writeFlash29F032() {
|
||||
for (unsigned long currByte = 0; currByte < fileSize; currByte += 512) {
|
||||
// if (currByte >= 0) {
|
||||
// print_Msg(currByte);
|
||||
// print_Msg(F(" "));
|
||||
// print_Msg(FS(FSTRING_SPACE));
|
||||
// print_Msg(dq5failcnt);
|
||||
// println_Msg(F(""));
|
||||
// println_Msg(FS(FSTRING_EMPTY));
|
||||
// }
|
||||
if (!noread) {
|
||||
myFile.read(sdBuffer, 512);
|
||||
@ -1182,7 +1177,7 @@ void writeFlash29F032() {
|
||||
print_Msg(currByte);
|
||||
print_Msg(F(": "));
|
||||
print_Msg(blockfailcnt);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
dq5failcnt -= blockfailcnt;
|
||||
currByte -= 512;
|
||||
delay(100);
|
||||
@ -1900,7 +1895,7 @@ void resetFlash8() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef enable_FLASH16
|
||||
#ifdef ENABLE_FLASH16
|
||||
/******************************************
|
||||
29L3211 16bit flashrom functions
|
||||
*****************************************/
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// GAME BOY MODULE
|
||||
//******************************************
|
||||
#ifdef enable_GBX
|
||||
#ifdef ENABLE_GBX
|
||||
|
||||
/******************************************
|
||||
Variables
|
||||
@ -22,31 +22,24 @@ static const char gbxMenuItem3[] PROGMEM = "Flash GBC Cart";
|
||||
static const char gbxMenuItem4[] PROGMEM = "NPower GB Memory";
|
||||
static const char gbxMenuItem5[] PROGMEM = "Flash Codebreaker";
|
||||
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, string_reset2 };
|
||||
static const char* const menuOptionsGBx[] PROGMEM = { gbxMenuItem1, gbxMenuItem2, gbxMenuItem3, gbxMenuItem4, gbxMenuItem5, gbxMenuItem6, FSTRING_RESET };
|
||||
|
||||
// GB menu items
|
||||
static const char GBMenuItem1[] PROGMEM = "Read ROM";
|
||||
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 };
|
||||
static const char* const menuOptionsGB[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, FSTRING_RESET };
|
||||
|
||||
// GB Flash items
|
||||
static const char GBFlashItem1[] PROGMEM = "29F016/32/33 Cart";
|
||||
static const char GBFlashItem2[] PROGMEM = "CFI Cart";
|
||||
static const char GBFlashItem3[] PROGMEM = "CFI Cart and Save";
|
||||
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, string_reset2 };
|
||||
static const char* const menuOptionsGBFlash[] PROGMEM = { GBFlashItem1, GBFlashItem2, GBFlashItem3, GBFlashItem4, FSTRING_RESET };
|
||||
|
||||
// 29F Flash items
|
||||
static const char GBFlash29Item1[] PROGMEM = "DIY MBC3 (WR)";
|
||||
static const char GBFlash29Item2[] PROGMEM = "DIY MBC5 (WR)";
|
||||
static const char GBFlash29Item3[] PROGMEM = "HDR MBC30 (Audio)";
|
||||
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, string_reset2 };
|
||||
static const char* const menuOptionsGBFlash29[] PROGMEM = { GBFlash29Item1, GBFlash29Item2, GBFlash29Item3, GBFlash29Item4, FSTRING_RESET };
|
||||
|
||||
// Pelican Codebreaker, Brainboy, and Monster Brain Operation Menu
|
||||
static const char PelicanRead[] PROGMEM = "Read Device";
|
||||
@ -74,14 +67,14 @@ void gbxMenu() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_GB();
|
||||
mode = mode_GB;
|
||||
mode = CORE_GB;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_GBA();
|
||||
mode = mode_GBA;
|
||||
mode = CORE_GBA;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@ -108,7 +101,7 @@ void gbxMenu() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_GB();
|
||||
mode = mode_GB;
|
||||
mode = CORE_GB;
|
||||
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
@ -127,7 +120,7 @@ void gbxMenu() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_GB();
|
||||
mode = mode_GB;
|
||||
mode = CORE_GB;
|
||||
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
@ -146,7 +139,7 @@ void gbxMenu() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_GB();
|
||||
mode = mode_GB;
|
||||
mode = CORE_GB;
|
||||
|
||||
//Setup Audio-In(PH4) as Output
|
||||
DDRH |= (1 << 4);
|
||||
@ -172,7 +165,7 @@ void gbxMenu() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_GB();
|
||||
mode = mode_GB;
|
||||
mode = CORE_GB;
|
||||
|
||||
//Flash first bank with erase
|
||||
// Change working dir to root
|
||||
@ -190,7 +183,7 @@ void gbxMenu() {
|
||||
println_Msg(F("to B2 (Bank 2)"));
|
||||
println_Msg(F("if you want to flash"));
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -203,7 +196,7 @@ void gbxMenu() {
|
||||
writeFlash29F_GB(3, 0);
|
||||
|
||||
// Reset
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -222,7 +215,7 @@ void gbxMenu() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_GB();
|
||||
mode = mode_GB;
|
||||
mode = CORE_GB;
|
||||
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
@ -250,7 +243,7 @@ void gbxMenu() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_GB();
|
||||
mode = mode_GB;
|
||||
mode = CORE_GB;
|
||||
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
@ -325,7 +318,7 @@ void gbxMenu() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_GBSmart();
|
||||
mode = mode_GB_GBSmart;
|
||||
mode = CORE_GB_GBSMART;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
@ -339,7 +332,7 @@ void gbxMenu() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_GBM();
|
||||
mode = mode_GBM;
|
||||
mode = CORE_GBM;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
@ -367,7 +360,7 @@ void gbxMenu() {
|
||||
|
||||
// RST(PH0) to H
|
||||
PORTH |= (1 << 0);
|
||||
mode = mode_GB;
|
||||
mode = CORE_GB;
|
||||
display_Clear();
|
||||
display_Update();
|
||||
unsigned char gbPelican;
|
||||
@ -424,7 +417,7 @@ void gbxMenu() {
|
||||
|
||||
// RST(PH0) to H
|
||||
PORTH |= (1 << 0);
|
||||
mode = mode_GB;
|
||||
mode = CORE_GB;
|
||||
display_Clear();
|
||||
display_Update();
|
||||
unsigned char gbDatel;
|
||||
@ -497,7 +490,7 @@ void gbMenu() {
|
||||
sd.chdir("/");
|
||||
readROM_GB();
|
||||
compare_checksums_GB();
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
save_log();
|
||||
#endif
|
||||
break;
|
||||
@ -517,7 +510,7 @@ void gbMenu() {
|
||||
} else {
|
||||
print_Error(F("No save or unsupported type"));
|
||||
}
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@ -550,7 +543,7 @@ void gbMenu() {
|
||||
} else {
|
||||
print_Error(F("No save or unsupported type"));
|
||||
}
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
@ -657,7 +650,7 @@ void showCartInfo_GB() {
|
||||
else if (romType == 0x104)
|
||||
print_Msg(F("M161"));
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("ROM Size: "));
|
||||
switch (romSize) {
|
||||
case 0:
|
||||
@ -697,7 +690,7 @@ void showCartInfo_GB() {
|
||||
break;
|
||||
}
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
//print_Msg(F("Banks: "));
|
||||
//println_Msg(romBanks);
|
||||
|
||||
@ -741,13 +734,13 @@ void showCartInfo_GB() {
|
||||
|
||||
default: print_Msg(F("None"));
|
||||
}
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
//print_Msg(F("Checksum: "));
|
||||
//println_Msg(checksumStr);
|
||||
//display_Update();
|
||||
|
||||
// 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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -964,9 +957,9 @@ void getCartInfo_GB() {
|
||||
|
||||
if (logoChecksum != 0x1546) {
|
||||
print_Error(F("STARTUP LOGO ERROR"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(F(""));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Press Button to"));
|
||||
println_Msg(F("ignore or powercycle"));
|
||||
println_Msg(F("to try again"));
|
||||
@ -995,9 +988,9 @@ void getCartInfo_GB() {
|
||||
|
||||
if (headerChecksum != sdBuffer[0x14D]) {
|
||||
print_Error(F("HEADER CHECKSUM ERROR"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(F(""));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Press Button to"));
|
||||
println_Msg(F("ignore or clean"));
|
||||
println_Msg(F("cart and try again"));
|
||||
@ -1611,7 +1604,7 @@ void readSRAMFLASH_MBC6_GB() {
|
||||
myFile.close();
|
||||
|
||||
// Signal end of process
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
}
|
||||
|
||||
@ -2282,7 +2275,7 @@ void writeFlash29F_GB(byte MBC, boolean flashErase) {
|
||||
myFile.close();
|
||||
|
||||
if (writeErrors == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
println_Msg(F("Error"));
|
||||
@ -2642,7 +2635,7 @@ bool writeCFI_GB() {
|
||||
myFile.close();
|
||||
|
||||
if (writeErrors == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
print_STR(error_STR, 0);
|
||||
@ -3096,7 +3089,7 @@ void writePelican_GB() {
|
||||
myFile.close();
|
||||
|
||||
if (writeErrors == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
println_Msg(F("Please turn off the power."));
|
||||
display_Update();
|
||||
} else {
|
||||
@ -3428,7 +3421,7 @@ void writeMegaMem_GB() {
|
||||
myFile.close();
|
||||
|
||||
if (writeErrors == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
println_Msg(F("Please turn off the power."));
|
||||
display_Update();
|
||||
} else {
|
||||
@ -3736,7 +3729,7 @@ void writeGameshark_GB() {
|
||||
myFile.close();
|
||||
|
||||
if (writeErrors == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
println_Msg(F("Please turn off the power."));
|
||||
display_Update();
|
||||
} else {
|
||||
|
@ -1,19 +1,15 @@
|
||||
//******************************************
|
||||
// GAME BOY ADVANCE MODULE
|
||||
//******************************************
|
||||
#ifdef enable_GBX
|
||||
#ifdef ENABLE_GBX
|
||||
|
||||
/******************************************
|
||||
Menu
|
||||
*****************************************/
|
||||
// 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 GBAMenuItem5[] PROGMEM = "Flash Repro";
|
||||
//static const char GBAMenuItem6[] PROGMEM = "Reset"; (stored in common strings array)
|
||||
static const char* const menuOptionsGBA[] PROGMEM = { GBAMenuItem1, GBAMenuItem2, GBAMenuItem3, GBAMenuItem4, GBAMenuItem5, string_reset2 };
|
||||
static const char* const menuOptionsGBA[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, GBAMenuItem4, GBAMenuItem5, FSTRING_RESET };
|
||||
|
||||
// Rom menu
|
||||
static const char GBARomItem1[] PROGMEM = "1 MB";
|
||||
@ -66,7 +62,7 @@ void gbaMenu() {
|
||||
compare_checksum_GBA();
|
||||
// CRC32
|
||||
compareCRC("gba.txt", 0, 1, 0);
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
save_log();
|
||||
#endif
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
@ -116,7 +112,7 @@ void gbaMenu() {
|
||||
break;
|
||||
}
|
||||
setROM_GBA();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -162,7 +158,7 @@ void gbaMenu() {
|
||||
printFlashTypeAndWait(F("Panasonic MN63F805MNP"));
|
||||
} else {
|
||||
printFlashTypeAndWait(F("Unknown"));
|
||||
//print_FatalError(F(""));
|
||||
//print_FatalError(FSTRING_EMPTY);
|
||||
}
|
||||
|
||||
if (flashid == 0x1F3D) { // Atmel
|
||||
@ -188,7 +184,7 @@ void gbaMenu() {
|
||||
printFlashTypeAndWait(F("SANYO LE26FV10N1TS"));
|
||||
} else {
|
||||
printFlashTypeAndWait(F("Unknown"));
|
||||
//print_FatalError(F(""));
|
||||
//print_FatalError(FSTRING_EMPTY);
|
||||
}
|
||||
|
||||
eraseFLASH_GBA();
|
||||
@ -211,7 +207,7 @@ void gbaMenu() {
|
||||
break;
|
||||
}
|
||||
setROM_GBA();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -228,7 +224,7 @@ void gbaMenu() {
|
||||
case 4:
|
||||
display_Clear();
|
||||
flashRepro_GBA();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -326,10 +322,10 @@ static byte getSaveType() {
|
||||
static void printFlashTypeAndWait(const __FlashStringHelper* caption) {
|
||||
print_Msg(F("FLASH ID: "));
|
||||
println_Msg(flashid_str);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("FLASH Type: "));
|
||||
println_Msg(caption);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -599,9 +595,9 @@ void getCartInfo_GBA() {
|
||||
display_Clear();
|
||||
print_Error(F("CARTRIDGE ERROR"));
|
||||
strcpy(romName, "ERROR");
|
||||
println_Msg(F(""));
|
||||
println_Msg(F(""));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Press Button to"));
|
||||
println_Msg(F("ignore or powercycle"));
|
||||
println_Msg(F("to try again"));
|
||||
@ -630,7 +626,7 @@ void getCartInfo_GBA() {
|
||||
if (myFile.open("gba.txt", O_READ)) {
|
||||
char gamename[100];
|
||||
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Disable log to prevent unnecessary logging
|
||||
dont_log = true;
|
||||
#endif
|
||||
@ -703,21 +699,21 @@ void getCartInfo_GBA() {
|
||||
print_Msg(F("Save Lib: "));
|
||||
println_Msg(saveTypeStr);
|
||||
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_STR, 1);
|
||||
print_STR(right_to_select_STR, 1);
|
||||
#elif defined(enable_LCD)
|
||||
println_Msg(F(""));
|
||||
#elif defined(ENABLE_LCD)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
#elif defined(SERIAL_MONITOR)
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("U/D to Change"));
|
||||
println_Msg(F("Space to Select"));
|
||||
#endif
|
||||
display_Update();
|
||||
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
while (1) {
|
||||
// Check button input
|
||||
b = checkButton();
|
||||
@ -754,7 +750,7 @@ void getCartInfo_GBA() {
|
||||
// Close the file:
|
||||
myFile.close();
|
||||
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Enable log again
|
||||
dont_log = false;
|
||||
#endif
|
||||
@ -785,7 +781,7 @@ void getCartInfo_GBA() {
|
||||
sprintf(calcChecksumStr, "%02X", calcChecksum);
|
||||
println_Msg(calcChecksumStr);
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -1723,7 +1719,7 @@ unsigned long verifyFLASH_GBA(unsigned long flashSize, uint32_t pos) {
|
||||
PORTH |= (1 << 0);
|
||||
|
||||
if (wrError == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
} else {
|
||||
print_Msg(wrError);
|
||||
print_Error(F(" Errors"));
|
||||
@ -2145,11 +2141,11 @@ void idFlashrom_GBA() {
|
||||
resetMX29GL128E_GBA();
|
||||
} else {
|
||||
println_Msg(F("Error"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Unknown Flash"));
|
||||
print_Msg(F("Flash ID: "));
|
||||
println_Msg(flashid_str);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_FatalError(F("Check voltage"));
|
||||
}
|
||||
}
|
||||
@ -2591,7 +2587,7 @@ void flashRepro_GBA() {
|
||||
println_Msg("");
|
||||
println_Msg(F("This will erase your"));
|
||||
println_Msg(F("Repro Cartridge."));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg("");
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
@ -2649,7 +2645,7 @@ void flashRepro_GBA() {
|
||||
print_Msg(F("Blankcheck..."));
|
||||
display_Update();
|
||||
if (blankcheckFlashrom_GBA()) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
*/
|
||||
|
||||
//Write flashrom
|
||||
@ -2693,7 +2689,7 @@ void flashRepro_GBA() {
|
||||
delay(1000);
|
||||
}
|
||||
if (verifyFlashrom_GBA() == 1) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
print_FatalError(F("ERROR"));
|
||||
@ -2709,11 +2705,11 @@ void flashRepro_GBA() {
|
||||
}
|
||||
} else {
|
||||
println_Msg(F("Error"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Unknown Flash"));
|
||||
print_Msg(F("Flash ID: "));
|
||||
println_Msg(flashid_str);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_FatalError(F("Check voltage"));
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// GB MEMORY MODULE
|
||||
//******************************************
|
||||
#ifdef enable_GBX
|
||||
#ifdef ENABLE_GBX
|
||||
|
||||
/******************************************
|
||||
Menu
|
||||
@ -86,7 +86,7 @@ void gbmMenu() {
|
||||
// Clear screen
|
||||
display_Clear();
|
||||
if (blankcheckFlash_GBM()) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
println_Msg(F("ERROR"));
|
||||
@ -162,7 +162,7 @@ void gbmMenu() {
|
||||
// Erase mapping
|
||||
eraseMapping_GBM();
|
||||
if (blankcheckMapping_GBM()) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
print_Error(F("Erasing failed"));
|
||||
@ -173,7 +173,7 @@ void gbmMenu() {
|
||||
writeMapping_GBM();
|
||||
break;
|
||||
}
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
|
@ -2,7 +2,7 @@
|
||||
// GB SMART MODULE
|
||||
// Supports 32M cart with LH28F016SUT flash
|
||||
//******************************************
|
||||
#ifdef enable_GBX
|
||||
#ifdef ENABLE_GBX
|
||||
#define GB_SMART_GAMES_PER_PAGE 6
|
||||
|
||||
/******************************************
|
||||
@ -11,8 +11,7 @@
|
||||
// GB Smart menu items
|
||||
static const char gbSmartMenuItem1[] PROGMEM = "Game 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, string_reset2 };
|
||||
static const char *const menuOptionsGBSmart[] PROGMEM = { gbSmartMenuItem1, gbSmartMenuItem2, FSTRING_RESET };
|
||||
|
||||
static const char gbSmartFlashMenuItem1[] PROGMEM = "Read 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 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 gbSmartGameMenuItem5[] PROGMEM = "Reset"; (stored in common strings array)
|
||||
static const char *const menuOptionsGBSmartGame[] PROGMEM = { gbSmartGameMenuItem1, gbSmartGameMenuItem2, gbSmartGameMenuItem3, gbSmartGameMenuItem4, string_reset2 };
|
||||
static const char *const menuOptionsGBSmartGame[] PROGMEM = { gbSmartGameMenuItem1, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, gbSmartGameMenuItem4, FSTRING_RESET };
|
||||
|
||||
struct GBSmartGameInfo {
|
||||
uint8_t start_bank;
|
||||
@ -163,7 +159,7 @@ void gbSmartMenu() {
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
mode = mode_GB_GBSmart_Flash;
|
||||
mode = CORE_GB_GBSMART_FLASH;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -227,7 +223,7 @@ void gbSmartGameOptions() {
|
||||
}
|
||||
|
||||
if (gameSubMenu != 3) {
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -269,7 +265,7 @@ gb_smart_load_more_games:
|
||||
getCartInfo_GB();
|
||||
showCartInfo_GB();
|
||||
|
||||
mode = mode_GB_GBSmart_Game;
|
||||
mode = CORE_GB_GBSMART_GAME;
|
||||
}
|
||||
|
||||
void gbSmartFlashMenu() {
|
||||
@ -303,7 +299,7 @@ void gbSmartFlashMenu() {
|
||||
println_Msg(F("Attention"));
|
||||
println_Msg(F("This will erase your"));
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -320,12 +316,12 @@ void gbSmartFlashMenu() {
|
||||
}
|
||||
default:
|
||||
{
|
||||
mode = mode_GB_GBSmart;
|
||||
mode = CORE_GB_GBSMART;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -476,7 +472,7 @@ void gbSmartWriteFlash() {
|
||||
|
||||
writeErrors = gbSmartVerifyFlash();
|
||||
if (writeErrors == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
print_STR(error_STR, 0);
|
||||
|
@ -2,7 +2,7 @@
|
||||
// SNES Game Processor RAM Cassette code by LuigiBlood
|
||||
// Revision 1.0.0 February 2024
|
||||
//******************************************
|
||||
#ifdef enable_GPC
|
||||
#ifdef ENABLE_GPC
|
||||
|
||||
/******************************************
|
||||
Game Processor RAM Cassette
|
||||
@ -29,8 +29,7 @@ void writeRAM_GPC(void);
|
||||
// GPC flash menu items
|
||||
static const char gpcFlashMenuItem1[] PROGMEM = "Read RAM";
|
||||
static const char gpcFlashMenuItem2[] PROGMEM = "Write RAM";
|
||||
static const char gpcFlashMenuItem3[] PROGMEM = "Back";
|
||||
static const char* const menuOptionsGPCFlash[] PROGMEM = { gpcFlashMenuItem1, gpcFlashMenuItem2, gpcFlashMenuItem3 };
|
||||
static const char* const menuOptionsGPCFlash[] PROGMEM = { gpcFlashMenuItem1, gpcFlashMenuItem2, FSTRING_RESET };
|
||||
|
||||
|
||||
void gpcMenu() {
|
||||
@ -100,7 +99,7 @@ void setup_GPC() {
|
||||
clockgen.output_enable(SI5351_CLK1, 0);
|
||||
clockgen.output_enable(SI5351_CLK2, 1);
|
||||
}
|
||||
#ifdef clockgen_installed
|
||||
#ifdef ENABLE_CLOCKGEN
|
||||
else {
|
||||
display_Clear();
|
||||
print_FatalError(F("Clock Generator not found"));
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// INTELLIVISION MODULE
|
||||
//******************************************
|
||||
#ifdef enable_INTV
|
||||
#ifdef ENABLE_INTV
|
||||
|
||||
// Mattel Intellivision
|
||||
// Cartridge Pinout
|
||||
@ -92,11 +92,7 @@ byte newintvsize;
|
||||
// Menu
|
||||
//******************************************
|
||||
// Base Menu
|
||||
static const char intvMenuItem1[] PROGMEM = "Select Cart";
|
||||
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 };
|
||||
static const char* const menuOptionsINTV[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
|
||||
|
||||
void setup_INTV() {
|
||||
// Request 5V
|
||||
@ -134,7 +130,7 @@ void setup_INTV() {
|
||||
checkStatus_INTV();
|
||||
strcpy(romName, "INTV");
|
||||
|
||||
mode = mode_INTV;
|
||||
mode = CORE_INTV;
|
||||
}
|
||||
|
||||
void intvMenu() {
|
||||
@ -428,7 +424,7 @@ void readROM_INTV() {
|
||||
// Compare CRC32 to database and rename ROM if found
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -490,20 +486,20 @@ void ecsBank(uint32_t addr, uint8_t bank) {
|
||||
//******************************************
|
||||
|
||||
void setMapper_INTV() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
int b = 0;
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
uint8_t b = 0;
|
||||
int i = 0;
|
||||
// Check Button Status
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); // PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Pressed
|
||||
while (1) { // Scroll Mapper List
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); // PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) { // Button Released
|
||||
@ -533,11 +529,11 @@ void setMapper_INTV() {
|
||||
intvindex = i * 4;
|
||||
intvmapselect = pgm_read_byte(intvmapsize + intvindex);
|
||||
println_Msg(intvmapselect);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -558,11 +554,11 @@ void setMapper_INTV() {
|
||||
intvindex = i * 4;
|
||||
intvmapselect = pgm_read_byte(intvmapsize + intvindex);
|
||||
println_Msg(intvmapselect);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -580,11 +576,11 @@ void setMapper_INTV() {
|
||||
intvindex = i * 4;
|
||||
intvmapselect = pgm_read_byte(intvmapsize + intvindex);
|
||||
println_Msg(intvmapselect);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -618,7 +614,7 @@ setmapper:
|
||||
}
|
||||
if (intvmapfound == false) {
|
||||
Serial.println(F("MAPPER NOT SUPPORTED!"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
newintvmapper = 0;
|
||||
goto setmapper;
|
||||
}
|
||||
@ -640,23 +636,23 @@ void checkMapperSize_INTV() {
|
||||
}
|
||||
|
||||
void setROMSize_INTV() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (intvlo == intvhi)
|
||||
newintvsize = intvlo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = intvlo;
|
||||
|
||||
// Only update display after input because of slow LCD library
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(pgm_read_byte(&(INTV[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -674,11 +670,11 @@ void setROMSize_INTV() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(pgm_read_byte(&(INTV[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -693,11 +689,11 @@ void setROMSize_INTV() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(pgm_read_byte(&(INTV[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -735,7 +731,7 @@ setrom:
|
||||
newintvsize = sizeROM.toInt() + intvlo;
|
||||
if (newintvsize > intvhi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
@ -759,11 +755,11 @@ void checkStatus_INTV() {
|
||||
EEPROM_writeAnything(8, intvsize);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("INTELLIVISION READER"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("MAPPER: "));
|
||||
println_Msg(intvmapper);
|
||||
print_Msg(F("ROM SIZE: "));
|
||||
@ -777,7 +773,7 @@ void checkStatus_INTV() {
|
||||
Serial.print(F("CURRENT ROM SIZE: "));
|
||||
Serial.print(pgm_read_byte(&(INTV[intvsize])));
|
||||
Serial.println(F("K"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -873,17 +869,17 @@ void setCart_INTV() {
|
||||
skip_line(&myFile);
|
||||
|
||||
println_Msg(F("Select your cartridge"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(gamename);
|
||||
print_Msg(F("Size: "));
|
||||
print_Msg(cartSize);
|
||||
println_Msg(F("KB"));
|
||||
print_Msg(F("Mapper: "));
|
||||
println_Msg(intvmapper);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#elif defined(SERIAL_MONITOR)
|
||||
@ -892,7 +888,7 @@ void setCart_INTV() {
|
||||
#endif
|
||||
display_Update();
|
||||
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
while (1) {
|
||||
// Check button input
|
||||
b = checkButton();
|
||||
|
@ -59,7 +59,7 @@
|
||||
//
|
||||
// By @partlyhuman
|
||||
// Special thanks to @kasamikona
|
||||
#ifdef enable_LOOPY
|
||||
#ifdef ENABLE_LOOPY
|
||||
|
||||
// SH-1 memory map locations, ROM starts here
|
||||
const uint32_t LOOPY_MAP_ROM_ZERO = 0x0E000000;
|
||||
@ -109,7 +109,7 @@ void setup_LOOPY() {
|
||||
|
||||
getCartInfo_LOOPY();
|
||||
|
||||
mode = mode_LOOPY;
|
||||
mode = CORE_LOOPY;
|
||||
}
|
||||
|
||||
//******************************************
|
||||
@ -117,12 +117,8 @@ void setup_LOOPY() {
|
||||
//******************************************
|
||||
|
||||
// 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* 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() {
|
||||
convertPgm(menuOptionsLOOPY, 5);
|
||||
@ -188,10 +184,10 @@ void loopyMenu() {
|
||||
break;
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
if (waitForInput) {
|
||||
// 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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -497,7 +493,7 @@ void getCartInfo_LOOPY() {
|
||||
setRomName_LOOPY("loopy.txt", checksumStr);
|
||||
|
||||
println_Msg(F("Cart Info"));
|
||||
println_Msg(F(" "));
|
||||
println_Msg(FS(FSTRING_SPACE));
|
||||
print_Msg(F("Name: "));
|
||||
println_Msg(loopyRomNameLong);
|
||||
print_Msg(F("Checksum: "));
|
||||
@ -508,9 +504,9 @@ void getCartInfo_LOOPY() {
|
||||
print_Msg(F("Sram: "));
|
||||
print_Msg(sramSize * 8 / 1024);
|
||||
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
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
|
@ -2,7 +2,7 @@
|
||||
// SEGA MEGA DRIVE MODULE
|
||||
//******************************************
|
||||
// Writes to Sega CD Backup RAM Cart require an extra wire from MRES (B02) to VRES (B27)
|
||||
#ifdef enable_MD
|
||||
#ifdef ENABLE_MD
|
||||
|
||||
/******************************************
|
||||
Variables
|
||||
@ -93,11 +93,11 @@ int segaSram16bit = 0;
|
||||
|
||||
#else /* !ENABLED_CONFIG */
|
||||
|
||||
# ifndef DEFAULT_VALUE_segaSram16bit
|
||||
# define DEFAULT_VALUE_segaSram16bit 0
|
||||
# endif /* !DEFAULT_VALUE_segaSram16bit */
|
||||
# ifndef OPTION_MD_DEFAULT_SAVE_TYPE
|
||||
# define OPTION_MD_DEFAULT_SAVE_TYPE 0
|
||||
# endif /* !OPTION_MD_DEFAULT_SAVE_TYPE */
|
||||
|
||||
int segaSram16bit = DEFAULT_VALUE_segaSram16bit;
|
||||
int segaSram16bit = OPTION_MD_DEFAULT_SAVE_TYPE;
|
||||
|
||||
#endif /* ENABLED_CONFIG */
|
||||
|
||||
@ -185,7 +185,7 @@ void mdLoadConf() {
|
||||
// 2: Duplicate each byte. Pad with 0xFF so that the file size is 64KB.
|
||||
segaSram16bit = atoi(value);
|
||||
if (segaSram16bit != 0 && segaSram16bit != 1 && segaSram16bit != 2) {
|
||||
segaSram16bit = DEFAULT_VALUE_segaSram16bit;
|
||||
segaSram16bit = DEFAULT_VALUE_SAVE_TYPE;
|
||||
}
|
||||
print_Msg(F("segaSram16bit: "));
|
||||
println_Msg(segaSram16bit);
|
||||
@ -209,24 +209,17 @@ void pulse_clock(int n) {
|
||||
static const char MDMenuItem1[] PROGMEM = "Game Cartridge";
|
||||
static const char MDMenuItem2[] PROGMEM = "SegaCD RamCart";
|
||||
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, string_reset2 };
|
||||
static const char* const menuOptionsMD[] PROGMEM = { MDMenuItem1, MDMenuItem2, MDMenuItem3, FSTRING_RESET };
|
||||
|
||||
// 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 MDCartMenuItem5[] PROGMEM = "Write EEPROM";
|
||||
static const char MDCartMenuItem6[] PROGMEM = "Cycle cart";
|
||||
//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 };
|
||||
static const char* const menuOptionsMDCart[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, MDCartMenuItem4, MDCartMenuItem5, FSTRING_REFRESH_CART, FSTRING_RESET };
|
||||
|
||||
// Sega CD Ram Backup Cartridge menu items
|
||||
static const char SCDMenuItem1[] PROGMEM = "Read 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, string_reset2 };
|
||||
static const char* const menuOptionsSCD[] PROGMEM = { SCDMenuItem1, SCDMenuItem2, FSTRING_RESET };
|
||||
|
||||
// Sega start menu
|
||||
void mdMenu() {
|
||||
@ -242,22 +235,22 @@ void mdMenu() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_MD();
|
||||
mode = mode_MD_Cart;
|
||||
mode = CORE_MD_CART;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_MD();
|
||||
mode = mode_SEGA_CD;
|
||||
mode = CORE_SEGA_CD;
|
||||
break;
|
||||
|
||||
#ifdef enable_FLASH
|
||||
#ifdef ENABLE_FLASH
|
||||
case 2:
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_MD();
|
||||
mode = mode_MD_Cart;
|
||||
mode = CORE_MD_CART;
|
||||
// Change working dir to root
|
||||
filePath[0] = '\0';
|
||||
sd.chdir("/");
|
||||
@ -291,7 +284,7 @@ void mdMenu() {
|
||||
verifyFlash_MD();
|
||||
// Set CS(PH3) HIGH
|
||||
PORTH |= (1 << 3);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -336,7 +329,7 @@ void mdCartMenu() {
|
||||
} else {
|
||||
print_Error(F("Cart has no ROM"));
|
||||
}
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
save_log();
|
||||
#endif
|
||||
break;
|
||||
@ -465,7 +458,7 @@ void segaCDMenu() {
|
||||
asm volatile(" jmp 0");
|
||||
break;
|
||||
}
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -480,7 +473,7 @@ void setup_MD() {
|
||||
setVoltage(VOLTS_SET_5V);
|
||||
|
||||
#if defined(ENABLE_CONFIG)
|
||||
segaSram16bit = configGetLong(F("md.sramType"));
|
||||
segaSram16bit = configGetLong(F("md.saveType"));
|
||||
#elif defined(use_md_conf)
|
||||
mdLoadConf();
|
||||
#endif /*ENABLE_CONFIG*/
|
||||
@ -1111,13 +1104,13 @@ void getCartInfo_MD() {
|
||||
} else {
|
||||
print_Msg(("sramType: "));
|
||||
print_Msg_PaddedHex16(sramType);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(("sramBase: "));
|
||||
print_Msg_PaddedHex32(sramBase);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(("sramEnd: "));
|
||||
print_Msg_PaddedHex32(sramEnd);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_FatalError(F("Unknown Sram Base"));
|
||||
}
|
||||
} else if (sramType == 0xE020) { // SRAM BOTH BYTES
|
||||
@ -1139,13 +1132,13 @@ void getCartInfo_MD() {
|
||||
}else {
|
||||
print_Msg(("sramType: "));
|
||||
print_Msg_PaddedHex16(sramType);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(("sramBase: "));
|
||||
print_Msg_PaddedHex32(sramBase);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(("sramEnd: "));
|
||||
print_Msg_PaddedHex32(sramEnd);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_FatalError(F("Unknown Sram Base"));
|
||||
}
|
||||
}
|
||||
@ -1263,13 +1256,13 @@ void getCartInfo_MD() {
|
||||
|
||||
display_Clear();
|
||||
println_Msg(F("Cart Info"));
|
||||
println_Msg(F(" "));
|
||||
println_Msg(FS(FSTRING_SPACE));
|
||||
print_Msg(F("Name: "));
|
||||
println_Msg(romName);
|
||||
if (bramCheck != 0x00FF) {
|
||||
print_Msg(F("bramCheck: "));
|
||||
print_Msg_PaddedHex16(bramCheck);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
}
|
||||
if (bramSize > 0) {
|
||||
print_Msg(F("bramSize(KB): "));
|
||||
@ -1312,7 +1305,7 @@ void getCartInfo_MD() {
|
||||
print_Msg_PaddedHexByte((chksumSonic2 & 0x00ff));
|
||||
break;
|
||||
}
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
if (saveType == 4) {
|
||||
print_Msg(F("Serial EEPROM: "));
|
||||
print_Msg(eepSize * 8 / 1024);
|
||||
@ -1325,10 +1318,10 @@ void getCartInfo_MD() {
|
||||
} else
|
||||
println_Msg(F("None"));
|
||||
}
|
||||
println_Msg(F(" "));
|
||||
println_Msg(FS(FSTRING_SPACE));
|
||||
|
||||
// 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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -1691,14 +1684,14 @@ void readROM_MD() {
|
||||
print_Msg(F("Internal checksum..."));
|
||||
display_Update();
|
||||
if (chksum == calcCKS) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
println_Msg(F("Error"));
|
||||
char calcsumStr[5];
|
||||
sprintf(calcsumStr, "%04X", calcCKS);
|
||||
println_Msg(calcsumStr);
|
||||
print_Error(F(""));
|
||||
print_Error(FS(FSTRING_EMPTY));
|
||||
display_Update();
|
||||
}
|
||||
|
||||
@ -1706,28 +1699,28 @@ void readROM_MD() {
|
||||
if (SnKmode >= 2) {
|
||||
print_Msg(F("Lock-on checksum..."));
|
||||
if (chksumLockon == calcCKSLockon) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
print_Msg(F("Error"));
|
||||
char calcsumStr[5];
|
||||
sprintf(calcsumStr, "%04X", calcCKSLockon);
|
||||
println_Msg(calcsumStr);
|
||||
print_Error(F(""));
|
||||
print_Error(FS(FSTRING_EMPTY));
|
||||
display_Update();
|
||||
}
|
||||
}
|
||||
if (SnKmode == 3) {
|
||||
print_Msg(F("Adittional checksum..."));
|
||||
if (chksumSonic2 == calcCKSSonic2) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
print_Msg(F("Error"));
|
||||
char calcsumStr[5];
|
||||
sprintf(calcsumStr, "%04X", calcCKSSonic2);
|
||||
println_Msg(calcsumStr);
|
||||
print_Error(F(""));
|
||||
print_Error(FS(FSTRING_EMPTY));
|
||||
display_Update();
|
||||
}
|
||||
}
|
||||
@ -1937,7 +1930,7 @@ unsigned long verifySram_MD() {
|
||||
return writeErrors;
|
||||
}
|
||||
|
||||
#ifdef enable_FLASH
|
||||
#ifdef ENABLE_FLASH
|
||||
//******************************************
|
||||
// Flashrom Functions
|
||||
//******************************************
|
||||
@ -2725,7 +2718,7 @@ void readEEP_MD() {
|
||||
}
|
||||
// Close the file:
|
||||
myFile.close();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Clear();
|
||||
print_Msg(F("Saved to "));
|
||||
print_Msg(folder);
|
||||
@ -2760,13 +2753,13 @@ void writeEEP_MD() {
|
||||
writeEepromByte(currByte);
|
||||
print_Msg(F("."));
|
||||
if ((currByte != 0) && ((currByte + 1) % 64 == 0))
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Update(); // ON SERIAL = delay(100)
|
||||
}
|
||||
}
|
||||
// Close the file:
|
||||
myFile.close();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Clear();
|
||||
print_STR(done_STR, 1);
|
||||
display_Update();
|
||||
@ -2813,7 +2806,7 @@ void readBram_MD() {
|
||||
|
||||
// Close the file:
|
||||
myFile.close();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Clear();
|
||||
print_Msg(F("Saved to "));
|
||||
print_Msg(folder);
|
||||
@ -2845,7 +2838,7 @@ void writeBram_MD() {
|
||||
writeWord_MD(0x380000, 0); // Disable BRAM Writes
|
||||
// Close the file:
|
||||
myFile.close();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Clear();
|
||||
print_STR(done_STR, 1);
|
||||
display_Update();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// MSX COMPUTER MODULE
|
||||
//******************************************
|
||||
#ifdef enable_MSX
|
||||
#ifdef ENABLE_MSX
|
||||
// MSX
|
||||
// Cartridge Pinout
|
||||
// 50P 2.54mm pitch connector
|
||||
@ -126,11 +126,10 @@ boolean srambit7 = false;
|
||||
// MENU
|
||||
//******************************************
|
||||
// Base Menu
|
||||
static const char msxMenuItem1[] PROGMEM = "Select Cart";
|
||||
static const char msxMenuItem2[] PROGMEM = "Read Cart";
|
||||
static const char msxMenuItem3[] PROGMEM = "Set Mapper + Size";
|
||||
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() {
|
||||
convertPgm(menuOptionsMSX, 5);
|
||||
@ -163,7 +162,7 @@ void msxMenu() {
|
||||
case 3:
|
||||
// Write RAM
|
||||
writeRAM_MSX();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -223,7 +222,7 @@ void setup_MSX() {
|
||||
checkStatus_MSX();
|
||||
strcpy(romName, "MSX");
|
||||
|
||||
mode = mode_MSX;
|
||||
mode = CORE_MSX;
|
||||
}
|
||||
|
||||
//******************************************
|
||||
@ -298,7 +297,7 @@ void writeData_MSX(uint16_t addr, uint8_t data) {
|
||||
//******************************************
|
||||
// POWER
|
||||
//******************************************
|
||||
#ifndef enable_NES
|
||||
#ifndef ENABLE_NES
|
||||
int int_pow(int base, int exp) // Power for int
|
||||
{
|
||||
int result = 1;
|
||||
@ -563,7 +562,7 @@ void readROM_MSX() {
|
||||
unsigned long crcsize = MSX[msxsize] * 0x400;
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -723,7 +722,7 @@ void readRAM_MSX() {
|
||||
unsigned long crcsize = MSX[msxramsize] * 0x400;
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -847,7 +846,7 @@ void writeRAM_MSX() {
|
||||
}
|
||||
myFile.close();
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("RAM FILE WRITTEN!"));
|
||||
display_Update();
|
||||
|
||||
@ -863,20 +862,20 @@ void writeRAM_MSX() {
|
||||
// MAPPER CODE
|
||||
//******************************************
|
||||
void setMapper_MSX() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
int b = 0;
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
uint8_t b = 0;
|
||||
int i = 0;
|
||||
// Check Button Status
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Pressed
|
||||
while (1) { // Scroll Mapper List
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) { // Button Released
|
||||
@ -908,11 +907,11 @@ void setMapper_MSX() {
|
||||
msxmapselect = pgm_read_byte(msxmapsize + msxindex);
|
||||
println_Msg(msxmapselect);
|
||||
printMapper(msxmapselect);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -933,11 +932,11 @@ void setMapper_MSX() {
|
||||
msxmapselect = pgm_read_byte(msxmapsize + msxindex);
|
||||
println_Msg(msxmapselect);
|
||||
printMapper(msxmapselect);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -956,11 +955,11 @@ void setMapper_MSX() {
|
||||
msxmapselect = pgm_read_byte(msxmapsize + msxindex);
|
||||
println_Msg(msxmapselect);
|
||||
printMapper(msxmapselect);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -995,7 +994,7 @@ setmapper:
|
||||
}
|
||||
if (msxmapfound == false) {
|
||||
Serial.println(F("MAPPER NOT SUPPORTED!"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
newmsxmapper = 0;
|
||||
goto setmapper;
|
||||
}
|
||||
@ -1022,22 +1021,22 @@ void checkMapperSize_MSX() {
|
||||
// SET ROM SIZE
|
||||
//******************************************
|
||||
void setROMSize_MSX() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (msxlo == msxhi)
|
||||
newmsxsize = msxlo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = msxlo;
|
||||
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(MSX[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1061,11 +1060,11 @@ void setROMSize_MSX() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(MSX[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1088,11 +1087,11 @@ void setROMSize_MSX() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(MSX[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1138,13 +1137,13 @@ setrom:
|
||||
if (msxmapper == 11) { // PAC/FM-PAC 0K/64K
|
||||
if ((newmsxromsize > 0) && (newmsxromsize < 4)) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
if (newmsxsize > msxhi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
@ -1163,22 +1162,22 @@ setrom:
|
||||
// SET RAM SIZE
|
||||
//******************************************
|
||||
void setRAMSize_MSX() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (msxramlo == msxramhi)
|
||||
newmsxramsize = msxramlo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = msxramlo;
|
||||
|
||||
display_Clear();
|
||||
print_Msg(F("RAM Size: "));
|
||||
println_Msg(MSXRAM[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1202,11 +1201,11 @@ void setRAMSize_MSX() {
|
||||
display_Clear();
|
||||
print_Msg(F("RAM Size: "));
|
||||
println_Msg(MSXRAM[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1229,11 +1228,11 @@ void setRAMSize_MSX() {
|
||||
display_Clear();
|
||||
print_Msg(F("RAM Size: "));
|
||||
println_Msg(MSXRAM[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1273,13 +1272,13 @@ setram:
|
||||
if (msxmapper == 7) { // Koei 8K/32K
|
||||
if (newmsxramsize == 3) { // 16K
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setram;
|
||||
}
|
||||
}
|
||||
if (newmsxramsize > msxramhi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setram;
|
||||
}
|
||||
}
|
||||
@ -1311,11 +1310,11 @@ void checkStatus_MSX() {
|
||||
EEPROM_writeAnything(10, msxramsize);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("MSX READER"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("MAPPER: "));
|
||||
println_Msg(msxmapper);
|
||||
printMapper(msxmapper);
|
||||
@ -1342,12 +1341,12 @@ void checkStatus_MSX() {
|
||||
Serial.print(F("CURRENT RAM SIZE: "));
|
||||
Serial.print(MSXRAM[msxramsize]);
|
||||
Serial.println(F("K"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void printMapper(byte msxmaplabel) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
switch (msxmaplabel) {
|
||||
case 0:
|
||||
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 buttonreleased = 0;
|
||||
bool cartselected = 0;
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F(" HOLD TO FAST CYCLE"));
|
||||
display_Update();
|
||||
@ -1472,9 +1471,9 @@ bool getCartListInfo_MSX() {
|
||||
Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
|
||||
#endif
|
||||
delay(2000);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Held - Fast Cycle
|
||||
@ -1483,19 +1482,19 @@ bool getCartListInfo_MSX() {
|
||||
if (strcmp(msxcsvEND, msxgame) == 0) {
|
||||
msxcsvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(msxgame);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.print(F("CART TITLE:"));
|
||||
Serial.println(msxgame);
|
||||
#endif
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
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
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) // Button Released
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("FAST CYCLE OFF"));
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("FAST CYCLE OFF"));
|
||||
Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
|
||||
Serial.println(F("DOUBLE CLICK TO STEP BACK"));
|
||||
Serial.println(F("HOLD TO SELECT"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
while (readVals_MSX(msxgame, msxmm, msxrr, msxss, msxll)) {
|
||||
if (strcmp(msxcsvEND, msxgame) == 0) {
|
||||
msxcsvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(msxgame);
|
||||
display.setCursor(0, 48);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1552,7 +1551,7 @@ bool getCartListInfo_MSX() {
|
||||
Serial.println(msxgame);
|
||||
#endif
|
||||
while (1) { // Single Step
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
if (b == 1) { // Continue (press)
|
||||
break;
|
||||
}
|
||||
@ -1570,7 +1569,7 @@ bool getCartListInfo_MSX() {
|
||||
EEPROM_writeAnything(8, newmsxsize);
|
||||
EEPROM_writeAnything(10, newmsxramsize);
|
||||
cartselected = 1; // SELECTION MADE
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(F("SELECTION MADE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -1585,8 +1584,8 @@ bool getCartListInfo_MSX() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
println_Msg(F(""));
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("END OF FILE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -1598,10 +1597,10 @@ bool getCartListInfo_MSX() {
|
||||
|
||||
void checkCSV_MSX() {
|
||||
if (getCartListInfo_MSX()) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART SELECTED"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(msxgame);
|
||||
display_Update();
|
||||
// Display Settings
|
||||
@ -1614,7 +1613,7 @@ void checkCSV_MSX() {
|
||||
println_Msg(newmsxramsize);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("CART SELECTED"));
|
||||
Serial.println(msxgame);
|
||||
// Display Settings
|
||||
@ -1624,10 +1623,10 @@ void checkCSV_MSX() {
|
||||
Serial.print(newmsxsize);
|
||||
Serial.print(F("/S"));
|
||||
Serial.println(newmsxramsize);
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("NO SELECTION"));
|
||||
display_Update();
|
||||
@ -1638,7 +1637,7 @@ void checkCSV_MSX() {
|
||||
}
|
||||
|
||||
void setCart_MSX() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(msxcartCSV);
|
||||
display_Update();
|
||||
@ -1648,7 +1647,7 @@ void setCart_MSX() {
|
||||
sd.chdir(folder); // Switch Folder
|
||||
msxcsvFile = sd.open(msxcartCSV, O_READ);
|
||||
if (!msxcsvFile) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CSV FILE NOT FOUND!"));
|
||||
display_Update();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// NINTENDO 64 MODULE
|
||||
//******************************************
|
||||
#ifdef enable_N64
|
||||
#ifdef ENABLE_N64
|
||||
|
||||
/******************************************
|
||||
Defines
|
||||
@ -39,12 +39,12 @@ boolean MN63F81MPN = false;
|
||||
//ControllerTest
|
||||
bool quit = 1;
|
||||
|
||||
#ifdef savesummarytotxt
|
||||
#ifdef OPTION_N64_SAVESUMMARY
|
||||
String CRC1 = "";
|
||||
String CRC2 = "";
|
||||
#endif
|
||||
|
||||
#if !defined(enable_FLASH)
|
||||
#if !defined(ENABLE_FLASH)
|
||||
unsigned long flashSize;
|
||||
#endif
|
||||
|
||||
@ -60,30 +60,23 @@ static const char n64MenuItem2[] PROGMEM = "Controller";
|
||||
static const char n64MenuItem3[] PROGMEM = "Flash Repro";
|
||||
static const char n64MenuItem4[] PROGMEM = "Flash Gameshark";
|
||||
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, string_reset2 };
|
||||
static const char* const menuOptionsN64[] PROGMEM = { n64MenuItem1, n64MenuItem2, n64MenuItem3, n64MenuItem4, n64MenuItem5, FSTRING_RESET };
|
||||
|
||||
// N64 controller menu items
|
||||
static const char N64ContMenuItem1[] PROGMEM = "Test Controller";
|
||||
static const char N64ContMenuItem2[] PROGMEM = "Read 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, string_reset2 };
|
||||
static const char* const menuOptionsN64Controller[] PROGMEM = { N64ContMenuItem1, N64ContMenuItem2, N64ContMenuItem3, FSTRING_RESET };
|
||||
|
||||
// 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 N64CartMenuItem5[] PROGMEM = "Reset"; (stored in common strings array)
|
||||
static const char* const menuOptionsN64Cart[] PROGMEM = { N64CartMenuItem1, N64CartMenuItem2, N64CartMenuItem3, N64CartMenuItem4, string_reset2 };
|
||||
static const char* const menuOptionsN64Cart[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, N64CartMenuItem4, FSTRING_RESET };
|
||||
|
||||
// N64 CRC32 error menu items
|
||||
static const char N64CRCMenuItem1[] PROGMEM = "No";
|
||||
static const char N64CRCMenuItem2[] PROGMEM = "Yes and keep 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, string_reset2 };
|
||||
static const char* const menuOptionsN64CRC[] PROGMEM = { N64CRCMenuItem1, N64CRCMenuItem2, N64CRCMenuItem3, FSTRING_RESET };
|
||||
|
||||
// Rom menu
|
||||
static const char N64RomItem1[] PROGMEM = "4 MB";
|
||||
@ -132,14 +125,14 @@ void n64Menu() {
|
||||
display_Update();
|
||||
setup_N64_Cart();
|
||||
printCartInfo_N64();
|
||||
mode = mode_N64_Cart;
|
||||
mode = CORE_N64_CART;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_N64_Controller();
|
||||
mode = mode_N64_Controller;
|
||||
mode = CORE_N64_CONTROLLER;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@ -148,7 +141,7 @@ void n64Menu() {
|
||||
setup_N64_Cart();
|
||||
flashRepro_N64();
|
||||
printCartInfo_N64();
|
||||
mode = mode_N64_Cart;
|
||||
mode = CORE_N64_CART;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
@ -157,7 +150,7 @@ void n64Menu() {
|
||||
setup_N64_Cart();
|
||||
flashGameshark_N64();
|
||||
printCartInfo_N64();
|
||||
mode = mode_N64_Cart;
|
||||
mode = CORE_N64_CART;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
@ -165,7 +158,7 @@ void n64Menu() {
|
||||
display_Update();
|
||||
setup_N64_Cart();
|
||||
flashXplorer_N64();
|
||||
mode = mode_N64_Cart;
|
||||
mode = CORE_N64_CART;
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
@ -192,9 +185,9 @@ void n64ControllerMenu() {
|
||||
resetController();
|
||||
display_Clear();
|
||||
display_Update();
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
controllerTest_Display();
|
||||
#elif defined(enable_serial)
|
||||
#elif defined(ENABLE_SERIAL)
|
||||
controllerTest_Serial();
|
||||
#endif
|
||||
quit = 1;
|
||||
@ -208,7 +201,7 @@ void n64ControllerMenu() {
|
||||
readMPK();
|
||||
verifyCRC();
|
||||
validateMPK();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -230,7 +223,7 @@ void n64ControllerMenu() {
|
||||
writeMPK();
|
||||
delay(500);
|
||||
verifyMPK();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -256,7 +249,7 @@ void n64CartMenu() {
|
||||
case 0:
|
||||
display_Clear();
|
||||
sd.chdir("/");
|
||||
#ifndef fastcrc
|
||||
#ifndef OPTION_N64_FASTCRC
|
||||
// Dumping ROM slow
|
||||
readRom_N64();
|
||||
sd.chdir("/");
|
||||
@ -266,7 +259,7 @@ void n64CartMenu() {
|
||||
compareCRC("n64.txt", readRom_N64(), 1, 0);
|
||||
#endif
|
||||
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
save_log();
|
||||
#endif
|
||||
|
||||
@ -296,7 +289,7 @@ void n64CartMenu() {
|
||||
} else {
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -332,7 +325,7 @@ void n64CartMenu() {
|
||||
display_Update();
|
||||
writeErrors = verifyFram(flashramType);
|
||||
if (writeErrors == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
println_Msg("");
|
||||
@ -448,7 +441,7 @@ void setup_N64_Cart() {
|
||||
PORTC &= ~(1 << 0);
|
||||
PORTC |= (1 << 1);
|
||||
|
||||
#ifdef clockgen_installed
|
||||
#ifdef ENABLE_CLOCKGEN
|
||||
// Adafruit Clock Generator
|
||||
|
||||
initializeClockOffset();
|
||||
@ -479,7 +472,7 @@ void setup_N64_Cart() {
|
||||
// Set sram base address
|
||||
sramBase = 0x08000000;
|
||||
|
||||
#ifdef clockgen_installed
|
||||
#ifdef ENABLE_CLOCKGEN
|
||||
// Wait for clock generator
|
||||
clockgen.update_status();
|
||||
#endif
|
||||
@ -1011,7 +1004,7 @@ void get_button() {
|
||||
/******************************************
|
||||
N64 Controller Test
|
||||
*****************************************/
|
||||
#ifdef enable_serial
|
||||
#ifdef ENABLE_SERIAL
|
||||
void controllerTest_Serial() {
|
||||
while (quit) {
|
||||
// Get Button and analog stick
|
||||
@ -1038,7 +1031,7 @@ void controllerTest_Serial() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(enable_LCD) || defined(enable_OLED))
|
||||
#if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
|
||||
#define CENTER 64
|
||||
// on which screens do we start
|
||||
int startscreen = 1;
|
||||
@ -1967,7 +1960,7 @@ void printCartInfo_N64() {
|
||||
println_Msg(checksumStr);
|
||||
|
||||
// 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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -2189,7 +2182,7 @@ void idCart() {
|
||||
strcpy(romName, cartID);
|
||||
}
|
||||
|
||||
#ifdef savesummarytotxt
|
||||
#ifdef OPTION_N64_SAVESUMMARY
|
||||
// Get CRC1
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (sdBuffer[0x10 + i] < 0x10) {
|
||||
@ -2308,10 +2301,10 @@ void readEeprom() {
|
||||
for (int i = 0; i < eepPages; i += sizeof(sdBuffer) / 8) {
|
||||
// If any missing bytes error out
|
||||
if (readEepromPageList(sdBuffer, i, sizeof(sdBuffer) / 8) == 0) {
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(error_STR, 0);
|
||||
println_Msg(F("no data received"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
break;
|
||||
}
|
||||
// Write 64 pages at once to the SD card
|
||||
@ -2546,7 +2539,7 @@ void writeFram(byte flashramType) {
|
||||
|
||||
// Check if empty
|
||||
if (blankcheck_N64(flashramType) == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
println_Msg(F("FAIL"));
|
||||
@ -2568,7 +2561,7 @@ void writeFram(byte flashramType) {
|
||||
print_Msg(F("Bank "));
|
||||
for (byte bank = 0; bank < 8; bank++) {
|
||||
print_Msg(bank);
|
||||
print_Msg(F(" "));
|
||||
print_Msg(FS(FSTRING_SPACE));
|
||||
display_Update();
|
||||
|
||||
// Write one bank of 128*128 bytes
|
||||
@ -2824,7 +2817,7 @@ void getFramType() {
|
||||
Rom functions
|
||||
*****************************************/
|
||||
// Read rom and save to the SD card
|
||||
#ifndef fastcrc
|
||||
#ifndef OPTION_N64_FASTCRC
|
||||
// dumping rom slow
|
||||
void readRom_N64() {
|
||||
// Get name, add extension and convert to char array for sd lib
|
||||
@ -2993,7 +2986,7 @@ uint32_t readRom_N64() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef savesummarytotxt
|
||||
#ifdef OPTION_N64_SAVESUMMARY
|
||||
// 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) {
|
||||
// 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.println(folder);
|
||||
|
||||
#ifdef RTC_installed
|
||||
#ifdef ENABLE_RTC
|
||||
myFile.print(F("Dumped\t: "));
|
||||
myFile.println(RTCStamp());
|
||||
#endif
|
||||
@ -3064,7 +3057,7 @@ void savesummary_N64(boolean checkfound, char crcStr[9], unsigned long timeElaps
|
||||
myFile.print(F("Time\t: "));
|
||||
myFile.println(timeElapsed);
|
||||
|
||||
myFile.println(F(" "));
|
||||
myFile.println(FSTRING_SPACE);
|
||||
|
||||
// Close the file:
|
||||
myFile.close();
|
||||
@ -3127,11 +3120,11 @@ void flashRepro_N64() {
|
||||
println_Msg(F("Unknown flashrom"));
|
||||
print_Msg(F("ID: "));
|
||||
print_Msg(vendorID);
|
||||
print_Msg(F(" "));
|
||||
print_Msg(FS(FSTRING_SPACE));
|
||||
print_Msg(flashid_str);
|
||||
print_Msg(F(" "));
|
||||
print_Msg(FS(FSTRING_SPACE));
|
||||
println_Msg(cartID);
|
||||
println_Msg(F(" "));
|
||||
println_Msg(FS(FSTRING_SPACE));
|
||||
println_Msg(F("Press button for"));
|
||||
println_Msg(F("manual config"));
|
||||
println_Msg(F("This will erase your"));
|
||||
@ -3294,7 +3287,7 @@ void flashRepro_N64() {
|
||||
// Check if erase was successful
|
||||
if (blankcheckFlashrom_N64()) {
|
||||
// Write flashrom
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
print_Msg(F("Writing "));
|
||||
println_Msg(filePath);
|
||||
display_Update();
|
||||
@ -3336,7 +3329,7 @@ void flashRepro_N64() {
|
||||
display_Update();
|
||||
writeErrors = verifyFlashrom_N64();
|
||||
if (writeErrors == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
print_Msg(writeErrors);
|
||||
@ -4141,7 +4134,7 @@ void flashGameshark_N64() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
println_Msg(F("Verfied OK"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Turn Cart Reader off now"));
|
||||
display_Update();
|
||||
while (1)
|
||||
@ -4451,7 +4444,7 @@ void writeGameshark_N64() {
|
||||
unsigned long verifyGameshark_N64() {
|
||||
uint32_t processedProgressBar = 0;
|
||||
uint32_t totalProgressBar = (uint32_t)(fileSize);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
draw_progressbar(0, totalProgressBar);
|
||||
// Open file on sd card
|
||||
if (myFile.open(filePath, O_READ)) {
|
||||
@ -4552,7 +4545,7 @@ void flashXplorer_N64() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
println_Msg(F("Verfied OK"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Turn Cart Reader off now"));
|
||||
display_Update();
|
||||
while (1);
|
||||
@ -4794,7 +4787,7 @@ void writeXplorer_N64() {
|
||||
unsigned long verifyXplorer_N64() {
|
||||
uint32_t processedProgressBar = 0;
|
||||
uint32_t totalProgressBar = (uint32_t)(262144);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
draw_progressbar(0, totalProgressBar);
|
||||
// Open file on sd card
|
||||
if (myFile.open(filePath, O_READ)) {
|
||||
|
@ -5,7 +5,7 @@
|
||||
// also based on "CoolArduino" by HardWareMan
|
||||
// Pinout changes: LED and CIRAM_A10
|
||||
|
||||
#ifdef enable_NES
|
||||
#ifdef ENABLE_NES
|
||||
|
||||
//Line Content
|
||||
//28 Supported Mappers
|
||||
@ -253,12 +253,9 @@ uint8_t newramsize;
|
||||
// NES start menu
|
||||
static const char nesMenuItem1[] PROGMEM = "Read iNES Rom";
|
||||
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 nesMenuItem6[] PROGMEM = "Flash NESMaker";
|
||||
//static const char nesMenuItem7[] PROGMEM = "Reset"; (stored in common strings array)
|
||||
static const char* const menuOptionsNES[] PROGMEM = { nesMenuItem1, nesMenuItem2, nesMenuItem3, nesMenuItem4, nesMenuItem5, nesMenuItem6, string_reset2 };
|
||||
static const char* const menuOptionsNES[] PROGMEM = { nesMenuItem1, nesMenuItem2, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, nesMenuItem5, nesMenuItem6, FSTRING_RESET };
|
||||
|
||||
// NES chips menu
|
||||
static const char nesChipsMenuItem1[] PROGMEM = "Combined PRG+CHR";
|
||||
@ -283,10 +280,10 @@ void nesMenu() {
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
readRom_NES();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
save_log();
|
||||
#endif
|
||||
display_Update();
|
||||
@ -306,7 +303,7 @@ void nesMenu() {
|
||||
sd.chdir(folder);
|
||||
readRAM();
|
||||
resetROM();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -317,7 +314,7 @@ void nesMenu() {
|
||||
case 3:
|
||||
writeRAM();
|
||||
resetROM();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -344,7 +341,7 @@ void nesMenu() {
|
||||
display_Clear();
|
||||
println_Msg(F("Error:"));
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -372,10 +369,10 @@ void nesChipMenu() {
|
||||
// Change working dir to root
|
||||
sd.chdir("/");
|
||||
readRaw_NES();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
save_log();
|
||||
#endif
|
||||
display_Update();
|
||||
@ -387,7 +384,7 @@ void nesChipMenu() {
|
||||
CreateROMFolderInSD();
|
||||
readPRG(false);
|
||||
resetROM();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -399,7 +396,7 @@ void nesChipMenu() {
|
||||
CreateROMFolderInSD();
|
||||
readCHR(false);
|
||||
resetROM();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -578,7 +575,7 @@ void getMapping() {
|
||||
browseDatabase = true;
|
||||
} else {
|
||||
// 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("Using manual selection"));
|
||||
display_Update();
|
||||
@ -597,7 +594,7 @@ void getMapping() {
|
||||
|
||||
// Display database
|
||||
while (database.available()) {
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Disable log to prevent unnecessary logging
|
||||
dont_log = true;
|
||||
#endif
|
||||
@ -668,14 +665,14 @@ void getMapping() {
|
||||
|
||||
println_Msg(entry.filename);
|
||||
printNESSettings();
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_STR, 0);
|
||||
if (fastScrolling > 1)
|
||||
println_Msg(F(" (fast)"));
|
||||
else
|
||||
println_Msg("");
|
||||
print_STR(right_to_select_STR, 1);
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
print_STR(rotate_to_change_STR, 0);
|
||||
if (fastScrolling > 1)
|
||||
println_Msg(F(" (fast)"));
|
||||
@ -688,11 +685,11 @@ void getMapping() {
|
||||
#endif
|
||||
display_Update();
|
||||
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Enable log again
|
||||
dont_log = false;
|
||||
#endif
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
do {
|
||||
b = checkButton();
|
||||
} while (b == 0);
|
||||
@ -769,7 +766,7 @@ bool selectMapping(FsFile& database) {
|
||||
setRAMSize();
|
||||
return 0;
|
||||
} else {
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Disable log to prevent unnecessary logging
|
||||
println_Log(F("Select Mapping from List"));
|
||||
dont_log = true;
|
||||
@ -785,7 +782,7 @@ bool selectMapping(FsFile& database) {
|
||||
} while (database.available() && entry.filename[0] != myLetter);
|
||||
rewind_line(database, 3);
|
||||
}
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Enable log again
|
||||
dont_log = false;
|
||||
#endif
|
||||
@ -1184,14 +1181,14 @@ void CreateRAMFileInSD() {
|
||||
*****************************************/
|
||||
void setMapper() {
|
||||
uint8_t newmapper;
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Disable log to prevent unnecessary logging
|
||||
println_Log(F("Set Mapper manually"));
|
||||
dont_log = true;
|
||||
#endif
|
||||
|
||||
// OLED
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
chooseMapper:
|
||||
// Read stored mapper
|
||||
EEPROM_readAnything(7, newmapper);
|
||||
@ -1249,7 +1246,7 @@ chooseMapper:
|
||||
2 doubleClick
|
||||
3 hold
|
||||
4 longHold */
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
|
||||
if (b == 1) {
|
||||
if (digit == 0) {
|
||||
@ -1328,20 +1325,20 @@ chooseMapper:
|
||||
}
|
||||
|
||||
// LCD
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
int i = 0;
|
||||
|
||||
display_Clear();
|
||||
mapselect = pgm_read_byte(mapsize + i * 7);
|
||||
print_Msg(F("Mapper: "));
|
||||
println_Msg(mapselect);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
display_Update();
|
||||
|
||||
while (1) {
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
|
||||
if (b == 2) { // Previous Mapper
|
||||
if (i == 0)
|
||||
@ -1353,7 +1350,7 @@ chooseMapper:
|
||||
mapselect = pgm_read_byte(mapsize + i * 7);
|
||||
print_Msg(F("Mapper: "));
|
||||
println_Msg(mapselect);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
display_Update();
|
||||
@ -1369,7 +1366,7 @@ chooseMapper:
|
||||
mapselect = pgm_read_byte(mapsize + i * 7);
|
||||
print_Msg(F("Mapper: "));
|
||||
println_Msg(mapselect);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
display_Update();
|
||||
@ -1389,7 +1386,7 @@ chooseMapper:
|
||||
delay(500);
|
||||
|
||||
// Serial Monitor
|
||||
#elif defined(enable_serial)
|
||||
#elif defined(ENABLE_SERIAL)
|
||||
setmapper:
|
||||
String newmap;
|
||||
bool mapfound = false;
|
||||
@ -1402,11 +1399,11 @@ setmapper:
|
||||
Serial.print("]");
|
||||
if (i < mapcount - 1) {
|
||||
if ((i != 0) && ((i + 1) % 10 == 0))
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
else
|
||||
Serial.print(F("\t"));
|
||||
} else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
}
|
||||
Serial.print(F("Enter Mapper: "));
|
||||
while (Serial.available() == 0) {}
|
||||
@ -1421,7 +1418,7 @@ setmapper:
|
||||
}
|
||||
if (mapfound == false) {
|
||||
Serial.println(F("MAPPER NOT SUPPORTED!"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
newmapper = 0;
|
||||
goto setmapper;
|
||||
}
|
||||
@ -1430,7 +1427,7 @@ setmapper:
|
||||
EEPROM_writeAnything(7, newmapper);
|
||||
mapper = newmapper;
|
||||
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Enable log again
|
||||
dont_log = false;
|
||||
#endif
|
||||
@ -1453,13 +1450,13 @@ void checkMapperSize() {
|
||||
}
|
||||
|
||||
void setPRGSize() {
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Disable log to prevent unnecessary logging
|
||||
println_Log(F("Set PRG Size"));
|
||||
dont_log = true;
|
||||
#endif
|
||||
|
||||
#if (defined(enable_LCD) || defined(enable_OLED))
|
||||
#if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
|
||||
display_Clear();
|
||||
if (prglo == prghi)
|
||||
newprgsize = prglo;
|
||||
@ -1469,18 +1466,18 @@ void setPRGSize() {
|
||||
display_Clear();
|
||||
print_Msg(F("PRG Size: "));
|
||||
println_Msg(pgm_read_word(&(PRG[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_STR, 1);
|
||||
println_Msg(F("Press right to select"));
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
#endif
|
||||
display_Update();
|
||||
|
||||
while (1) {
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
|
||||
if (b == doubleclick) { // Previous
|
||||
if (i == prglo)
|
||||
@ -1491,11 +1488,11 @@ void setPRGSize() {
|
||||
display_Clear();
|
||||
print_Msg(F("PRG Size: "));
|
||||
println_Msg(pgm_read_word(&(PRG[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_STR, 1);
|
||||
println_Msg(F("Press right to select"));
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1510,11 +1507,11 @@ void setPRGSize() {
|
||||
display_Clear();
|
||||
print_Msg(F("PRG Size: "));
|
||||
println_Msg(pgm_read_word(&(PRG[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_STR, 1);
|
||||
println_Msg(F("Press right to select"));
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1534,7 +1531,7 @@ void setPRGSize() {
|
||||
display_Update();
|
||||
delay(500);
|
||||
|
||||
#elif defined(enable_serial)
|
||||
#elif defined(ENABLE_SERIAL)
|
||||
if (prglo == prghi)
|
||||
newprgsize = prglo;
|
||||
else {
|
||||
@ -1554,7 +1551,7 @@ setprg:
|
||||
newprgsize = sizePRG.toInt() + prglo;
|
||||
if (newprgsize > prghi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setprg;
|
||||
}
|
||||
}
|
||||
@ -1565,20 +1562,20 @@ setprg:
|
||||
EEPROM_writeAnything(8, newprgsize);
|
||||
prgsize = newprgsize;
|
||||
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Enable log again
|
||||
dont_log = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void setCHRSize() {
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Disable log to prevent unnecessary logging
|
||||
println_Log(F("Set CHR Size"));
|
||||
dont_log = true;
|
||||
#endif
|
||||
|
||||
#if (defined(enable_LCD) || defined(enable_OLED))
|
||||
#if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
|
||||
display_Clear();
|
||||
if (chrlo == chrhi)
|
||||
newchrsize = chrlo;
|
||||
@ -1588,18 +1585,18 @@ void setCHRSize() {
|
||||
display_Clear();
|
||||
print_Msg(F("CHR Size: "));
|
||||
println_Msg(pgm_read_word(&(CHR[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_STR, 1);
|
||||
println_Msg(F("Press right to select"));
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
#endif
|
||||
display_Update();
|
||||
|
||||
while (1) {
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
|
||||
if (b == doubleclick) { // Previous
|
||||
if (i == chrlo)
|
||||
@ -1610,11 +1607,11 @@ void setCHRSize() {
|
||||
display_Clear();
|
||||
print_Msg(F("CHR Size: "));
|
||||
println_Msg(pgm_read_word(&(CHR[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_STR, 1);
|
||||
println_Msg(F("Press right to select"));
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1630,11 +1627,11 @@ void setCHRSize() {
|
||||
display_Clear();
|
||||
print_Msg(F("CHR Size: "));
|
||||
println_Msg(pgm_read_word(&(CHR[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_STR, 1);
|
||||
println_Msg(F("Press right to select"));
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1654,7 +1651,7 @@ void setCHRSize() {
|
||||
display_Update();
|
||||
delay(500);
|
||||
|
||||
#elif defined(enable_serial)
|
||||
#elif defined(ENABLE_SERIAL)
|
||||
if (chrlo == chrhi)
|
||||
newchrsize = chrlo;
|
||||
else {
|
||||
@ -1674,7 +1671,7 @@ setchr:
|
||||
newchrsize = sizeCHR.toInt() + chrlo;
|
||||
if (newchrsize > chrhi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setchr;
|
||||
}
|
||||
}
|
||||
@ -1685,20 +1682,20 @@ setchr:
|
||||
EEPROM_writeAnything(9, newchrsize);
|
||||
chrsize = newchrsize;
|
||||
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Enable log again
|
||||
dont_log = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void setRAMSize() {
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Disable log to prevent unnecessary logging
|
||||
println_Log(F("Set RAM Size"));
|
||||
dont_log = true;
|
||||
#endif
|
||||
|
||||
#if (defined(enable_LCD) || defined(enable_OLED))
|
||||
#if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
|
||||
display_Clear();
|
||||
if (ramlo == ramhi)
|
||||
newramsize = ramlo;
|
||||
@ -1722,18 +1719,18 @@ void setRAMSize() {
|
||||
println_Msg(i * 5);
|
||||
else
|
||||
println_Msg(pgm_read_byte(&(RAM[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_STR, 1);
|
||||
println_Msg(F("Press right to select"));
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
#endif
|
||||
display_Update();
|
||||
|
||||
while (1) {
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
|
||||
if (b == doubleclick) { // Previous Mapper
|
||||
if (i == 0)
|
||||
@ -1758,11 +1755,11 @@ void setRAMSize() {
|
||||
println_Msg(i * 5);
|
||||
else
|
||||
println_Msg(pgm_read_byte(&(RAM[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_STR, 1);
|
||||
println_Msg(F("Press right to select"));
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1792,11 +1789,11 @@ void setRAMSize() {
|
||||
println_Msg(i * 5);
|
||||
else
|
||||
println_Msg(pgm_read_byte(&(RAM[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_STR, 1);
|
||||
println_Msg(F("Press right to select"));
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
print_STR(rotate_to_change_STR, 1);
|
||||
print_STR(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -1845,7 +1842,7 @@ void setRAMSize() {
|
||||
display_Update();
|
||||
delay(500);
|
||||
|
||||
#elif defined(enable_serial)
|
||||
#elif defined(ENABLE_SERIAL)
|
||||
if (ramlo == ramhi)
|
||||
newramsize = ramlo;
|
||||
else {
|
||||
@ -1883,7 +1880,7 @@ setram:
|
||||
newramsize = sizeRAM.toInt() + ramlo;
|
||||
if (newramsize > ramhi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setram;
|
||||
}
|
||||
}
|
||||
@ -1896,7 +1893,7 @@ setram:
|
||||
sizeEEP = pgm_read_byte(&(RAM[newramsize])) * 16;
|
||||
Serial.print(sizeEEP);
|
||||
Serial.println(F("B"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
} else if (mapper == 19) {
|
||||
Serial.print(F("RAM Size = "));
|
||||
if (newramsize == 2)
|
||||
@ -1905,12 +1902,12 @@ setram:
|
||||
Serial.print(pgm_read_byte(&(RAM[newramsize])));
|
||||
Serial.println(F("K"));
|
||||
}
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
} else if (mapper == 80) {
|
||||
Serial.print(F("RAM Size = "));
|
||||
Serial.print(pgm_read_byte(&(RAM[newramsize])) * 16);
|
||||
Serial.println(F("B"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
} else {
|
||||
Serial.print(F("RAM Size = "));
|
||||
if (mapper == 0)
|
||||
@ -1920,13 +1917,13 @@ setram:
|
||||
else
|
||||
Serial.print(pgm_read_byte(&(RAM[newramsize])));
|
||||
Serial.println(F("K"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
}
|
||||
#endif
|
||||
EEPROM_writeAnything(10, newramsize);
|
||||
ramsize = newramsize;
|
||||
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
// Enable log again
|
||||
dont_log = false;
|
||||
#endif
|
||||
@ -1974,11 +1971,11 @@ void checkStatus_NES() {
|
||||
|
||||
display_Clear();
|
||||
println_Msg(F("NES CART READER"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
printNESSettings();
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -3284,7 +3281,7 @@ void readPRG(bool readrom) {
|
||||
myFile.close();
|
||||
|
||||
println_Msg(F("PRG FILE DUMPED!"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Update();
|
||||
}
|
||||
}
|
||||
@ -4263,7 +4260,7 @@ void readCHR(bool readrom) {
|
||||
myFile.close();
|
||||
|
||||
println_Msg(F("CHR FILE DUMPED!"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Update();
|
||||
}
|
||||
}
|
||||
@ -4448,7 +4445,7 @@ void readRAM() {
|
||||
myFile.close();
|
||||
|
||||
println_Msg(F("RAM FILE DUMPED!"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Update();
|
||||
|
||||
if ((mapper == 16) || (mapper == 159))
|
||||
@ -4679,7 +4676,7 @@ void writeRAM() {
|
||||
myFile.close();
|
||||
LED_GREEN_ON;
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("RAM FILE WRITTEN!"));
|
||||
display_Update();
|
||||
|
||||
@ -4966,9 +4963,9 @@ void writeFLASH() {
|
||||
} else {
|
||||
print_Msg(F("Flash ID: "));
|
||||
println_Msg(flashid_str);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("NESmaker Flash Found"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Update();
|
||||
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.updateDisplay();
|
||||
#else
|
||||
Serial.print(F("*"));
|
||||
if ((i != 0) && ((i + 1) % 16 == 0))
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
myFile.close();
|
||||
LED_GREEN_ON;
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("FLASH FILE WRITTEN!"));
|
||||
display_Update();
|
||||
} else {
|
||||
|
@ -1,13 +1,10 @@
|
||||
//******************************************
|
||||
// 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 ngpMenuItem3[] PROGMEM = "Change ROM size";
|
||||
//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* const menuOptionsNGP[] PROGMEM = { FSTRING_READ_ROM, ngpMenuItem2, FSTRING_SET_SIZE, FSTRING_RESET };
|
||||
|
||||
static const char ngpRomItem1[] PROGMEM = "4 Mbits / 512 KB";
|
||||
static const char ngpRomItem2[] PROGMEM = "8 Mbits / 1 MB";
|
||||
@ -80,7 +77,7 @@ void ngpMenu() {
|
||||
break;
|
||||
}
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// MAGNAVOX ODYSSEY 2 MODULE
|
||||
//******************************************
|
||||
#if defined(enable_ODY2)
|
||||
#if defined(ENABLE_ODY2)
|
||||
// Magnavox Odyssey 2
|
||||
// Philips Videopac/Videopac+
|
||||
// Cartridge Pinout
|
||||
@ -62,11 +62,7 @@ byte newody2size;
|
||||
// Menu
|
||||
//******************************************
|
||||
// Base Menu
|
||||
static const char ody2MenuItem1[] PROGMEM = "Select Cart";
|
||||
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 };
|
||||
static const char* const menuOptionsODY2[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
|
||||
|
||||
void setup_ODY2() {
|
||||
// Request 5V
|
||||
@ -109,7 +105,7 @@ void setup_ODY2() {
|
||||
checkStatus_ODY2();
|
||||
strcpy(romName, "ODYSSEY2");
|
||||
|
||||
mode = mode_ODY2;
|
||||
mode = CORE_ODY2;
|
||||
}
|
||||
|
||||
void ody2Menu() {
|
||||
@ -274,7 +270,7 @@ void readROM_ODY2() {
|
||||
unsigned long crcsize = ODY2[ody2size] * 0x400;
|
||||
calcCRC(fileName, crcsize, NULL, 0);
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
@ -285,22 +281,22 @@ void readROM_ODY2() {
|
||||
//******************************************
|
||||
|
||||
void setROMSize_ODY2() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (ody2lo == ody2hi)
|
||||
newody2size = ody2lo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = ody2lo;
|
||||
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(ODY2[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -318,11 +314,11 @@ void setROMSize_ODY2() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(ODY2[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -338,11 +334,11 @@ void setROMSize_ODY2() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(ODY2[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -380,7 +376,7 @@ setrom:
|
||||
newody2size = sizeROM.toInt() + ody2lo;
|
||||
if (newody2size > ody2hi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
@ -404,11 +400,11 @@ void checkStatus_ODY2() {
|
||||
EEPROM_writeAnything(8, ody2size);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("ODYSSEY 2 READER"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("MAPPER: "));
|
||||
println_Msg(ody2mapper);
|
||||
print_Msg(F("ROM SIZE: "));
|
||||
@ -422,7 +418,7 @@ void checkStatus_ODY2() {
|
||||
Serial.print(F("CURRENT ROM SIZE: "));
|
||||
Serial.print(ODY2[ody2size]);
|
||||
Serial.println(F("K"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -478,7 +474,7 @@ bool readVals_ODY2(char* ody2game, char* ody2mm, char* ody2rr, char* ody2ll) {
|
||||
bool getCartListInfo_ODY2() {
|
||||
bool buttonreleased = 0;
|
||||
bool cartselected = 0;
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F(" HOLD TO FAST CYCLE"));
|
||||
display_Update();
|
||||
@ -486,9 +482,9 @@ bool getCartListInfo_ODY2() {
|
||||
Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
|
||||
#endif
|
||||
delay(2000);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Held - Fast Cycle
|
||||
@ -497,19 +493,19 @@ bool getCartListInfo_ODY2() {
|
||||
if (strcmp(ody2csvEND, ody2game) == 0) {
|
||||
ody2csvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(ody2game);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.print(F("CART TITLE:"));
|
||||
Serial.println(ody2game);
|
||||
#endif
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
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
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) // Button Released
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("FAST CYCLE OFF"));
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("FAST CYCLE OFF"));
|
||||
Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
|
||||
Serial.println(F("DOUBLE CLICK TO STEP BACK"));
|
||||
Serial.println(F("HOLD TO SELECT"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
while (readVals_ODY2(ody2game, ody2mm, ody2rr, ody2ll)) {
|
||||
if (strcmp(ody2csvEND, ody2game) == 0) {
|
||||
ody2csvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(ody2game);
|
||||
display.setCursor(0, 48);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -566,7 +562,7 @@ bool getCartListInfo_ODY2() {
|
||||
Serial.println(ody2game);
|
||||
#endif
|
||||
while (1) { // Single Step
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
if (b == 1) { // Continue (press)
|
||||
break;
|
||||
}
|
||||
@ -582,7 +578,7 @@ bool getCartListInfo_ODY2() {
|
||||
EEPROM_writeAnything(7, newody2mapper);
|
||||
EEPROM_writeAnything(8, newody2size);
|
||||
cartselected = 1; // SELECTION MADE
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(F("SELECTION MADE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -597,8 +593,8 @@ bool getCartListInfo_ODY2() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
println_Msg(F(""));
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("END OF FILE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -610,10 +606,10 @@ bool getCartListInfo_ODY2() {
|
||||
|
||||
void checkCSV_ODY2() {
|
||||
if (getCartListInfo_ODY2()) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART SELECTED"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(ody2game);
|
||||
display_Update();
|
||||
// Display Settings
|
||||
@ -624,7 +620,7 @@ void checkCSV_ODY2() {
|
||||
println_Msg(newody2size);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("CART SELECTED"));
|
||||
Serial.println(ody2game);
|
||||
// Display Settings
|
||||
@ -632,10 +628,10 @@ void checkCSV_ODY2() {
|
||||
Serial.print(newody2mapper);
|
||||
Serial.print(F("/R"));
|
||||
Serial.println(newody2size);
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("NO SELECTION"));
|
||||
display_Update();
|
||||
@ -646,7 +642,7 @@ void checkCSV_ODY2() {
|
||||
}
|
||||
|
||||
void setCart_ODY2() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(ody2cartCSV);
|
||||
display_Update();
|
||||
@ -656,7 +652,7 @@ void setCart_ODY2() {
|
||||
sd.chdir(folder); // Switch Folder
|
||||
ody2csvFile = sd.open(ody2cartCSV, O_READ);
|
||||
if (!ody2csvFile) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CSV FILE NOT FOUND!"));
|
||||
display_Update();
|
||||
|
@ -35,6 +35,7 @@
|
||||
* CHANGES :
|
||||
*
|
||||
* REF NO VERSION DATE WHO DETAIL
|
||||
* 13.2 2024-03-02 Ancyker Add string constants
|
||||
* 13.2 2024-02-29 Ancyker Add config support
|
||||
* 12.5 2023-03-29 Ancyker Initial version
|
||||
*
|
||||
@ -42,10 +43,36 @@
|
||||
|
||||
#include "OSCR.h"
|
||||
|
||||
/*==== VARIABLES ==================================================*/
|
||||
/*==== CONSTANTS ==================================================*/
|
||||
|
||||
/**
|
||||
* String Constants
|
||||
**/
|
||||
// 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
|
||||
unsigned long clock = CS_16MHZ;
|
||||
@ -56,17 +83,12 @@ VOLTS voltage = VOLTS_SET_5V;
|
||||
#if defined(ENABLE_CONFIG)
|
||||
|
||||
FsFile configFile;
|
||||
bool useConfig = false;
|
||||
bool useConfig;
|
||||
|
||||
# if defined(global_log)
|
||||
# if defined(ENABLE_GLOBAL_LOG)
|
||||
// Logging
|
||||
bool loggingEnabled = true;
|
||||
# endif /* 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_GLOBAL_LOG */
|
||||
#endif /* ENABLE_CONFIG */
|
||||
|
||||
/*==== /VARIABLES =================================================*/
|
||||
@ -77,11 +99,11 @@ const bool loggingEnabled = true;
|
||||
* DESCRIPTION : Prints the version & feature string to serial
|
||||
*
|
||||
*F*/
|
||||
#if !defined(enable_serial) && defined(ENABLE_UPDATER)
|
||||
#if !defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
|
||||
void printVersionToSerial() {
|
||||
ClockedSerial.print(F("OSCR"));
|
||||
ClockedSerial.print(FS(FSTRING_OSCR));
|
||||
ClockedSerial.print(F("::"));
|
||||
ClockedSerial.print(ver);
|
||||
ClockedSerial.print(FS(FSTRING_VERSION));
|
||||
ClockedSerial.print(F("//"));
|
||||
#if defined(HW1)
|
||||
ClockedSerial.print(F("HW1"));
|
||||
@ -101,20 +123,20 @@ void printVersionToSerial() {
|
||||
#if defined (ENABLE_VSELECT)
|
||||
ClockedSerial.print(F("|VSELECT"));
|
||||
#endif
|
||||
#if defined (RTC_installed)
|
||||
#if defined (ENABLE_RTC)
|
||||
ClockedSerial.print(F("|RTC"));
|
||||
#endif
|
||||
#if defined (clockgen_installed)
|
||||
#if defined (ENABLE_CLOCKGEN)
|
||||
ClockedSerial.print(F("|CLOCKGEN"));
|
||||
#endif
|
||||
#if defined (fastcrc)
|
||||
#if defined (OPTION_N64_FASTCRC)
|
||||
ClockedSerial.print(F("|FASTCRC"));
|
||||
#endif
|
||||
#if defined (ENABLE_3V3FIX)
|
||||
ClockedSerial.print(F("|3V3FIX"));
|
||||
#endif
|
||||
|
||||
ClockedSerial.println(F(""));
|
||||
ClockedSerial.println(FS(FSTRING_EMPTY));
|
||||
}
|
||||
#else
|
||||
void printVersionToSerial() {}
|
||||
@ -236,14 +258,14 @@ VOLTS setVoltage(VOLTS newVoltage) {
|
||||
// Adjust clock speed when 3V3FIX is enabled
|
||||
#if defined(ENABLE_3V3FIX)
|
||||
// Stop serial if running
|
||||
#if !defined(enable_serial) && defined(ENABLE_UPDATER)
|
||||
#if !defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
|
||||
ClockedSerial.end();
|
||||
#endif
|
||||
// Set clock speed
|
||||
clock = CS_16MHZ;
|
||||
setClockScale(newVoltage); /*[2]*/
|
||||
// Restart serial
|
||||
#if !defined(enable_serial) && defined(ENABLE_UPDATER)
|
||||
#if !defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
|
||||
ClockedSerial.begin(UPD_BAUD);
|
||||
#endif
|
||||
#else
|
||||
@ -269,13 +291,13 @@ VOLTS setVoltage(VOLTS newVoltage) {
|
||||
|
||||
// Adjust clock speed when 3V3FIX is enabled
|
||||
#if defined(ENABLE_3V3FIX)
|
||||
#if !defined(enable_serial) && defined(ENABLE_UPDATER)
|
||||
#if !defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
|
||||
ClockedSerial.end();
|
||||
#endif
|
||||
// Set clock speed
|
||||
clock = CS_8MHZ;
|
||||
setClockScale(newVoltage); /*[2]*/
|
||||
#if !defined(enable_serial) && defined(ENABLE_UPDATER)
|
||||
#if !defined(ENABLE_SERIAL) && defined(ENABLE_UPDATER)
|
||||
ClockedSerial.begin(UPD_BAUD);
|
||||
#endif
|
||||
#endif
|
||||
|
@ -24,11 +24,246 @@
|
||||
# endif
|
||||
|
||||
/*==== 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
|
||||
const uint16_t UPD_BAUD = 9600;
|
||||
constexpr uint16_t UPD_BAUD = 9600;
|
||||
// Clock speeds
|
||||
const unsigned long CS_16MHZ = 16000000UL;
|
||||
const unsigned long CS_8MHZ = 8000000UL;
|
||||
constexpr unsigned long CS_16MHZ = 16000000UL;
|
||||
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 CLKSCALE: uint8_t {
|
||||
@ -50,9 +285,11 @@ enum VOLTS: uint8_t {
|
||||
VOLTS_UNKNOWN // Return value for all other states
|
||||
};
|
||||
|
||||
/*==== /CONSTANTS =================================================*/
|
||||
|
||||
/*==== VARIABLES ==================================================*/
|
||||
extern unsigned long clock;
|
||||
extern char ver[5];
|
||||
//extern char ver[5];
|
||||
extern VOLTS voltage;
|
||||
|
||||
# if defined(ENABLE_CONFIG)
|
||||
@ -64,16 +301,19 @@ extern VOLTS voltage;
|
||||
**/
|
||||
|
||||
extern bool useConfig;
|
||||
# ifdef global_log
|
||||
# ifdef ENABLE_GLOBAL_LOG
|
||||
extern bool loggingEnabled;
|
||||
# endif /* global_log */
|
||||
# endif /* ENABLE_GLOBAL_LOG */
|
||||
# else /* !ENABLE_CONFIG */
|
||||
# ifdef global_log
|
||||
extern const bool loggingEnabled;
|
||||
# endif /* global_log */
|
||||
# ifdef ENABLE_GLOBAL_LOG
|
||||
constexpr bool loggingEnabled = true;
|
||||
# endif /* ENABLE_GLOBAL_LOG */
|
||||
# endif /* ENABLE_CONFIG */
|
||||
|
||||
/*==== /VARIABLES =================================================*/
|
||||
|
||||
/*==== FUNCTIONS ==================================================*/
|
||||
|
||||
extern void printVersionToSerial();
|
||||
extern void setClockScale(VOLTS __x);
|
||||
extern void setClockScale(CLKSCALE __x);
|
||||
@ -86,6 +326,8 @@ extern String configGetStr(const __FlashStringHelper* key);
|
||||
extern long configGetLong(const __FlashStringHelper* key, int onFail = 0);
|
||||
# endif /* ENABLE_CONFIG */
|
||||
|
||||
/*==== /FUNCTIONS =================================================*/
|
||||
|
||||
#include "ClockedSerial.h"
|
||||
|
||||
#endif /* OSCR_H_ */
|
||||
|
@ -10,7 +10,7 @@
|
||||
// Chris Covell - Tennokoe bank support
|
||||
//
|
||||
//******************************************
|
||||
#ifdef enable_PCE
|
||||
#ifdef ENABLE_PCE
|
||||
|
||||
/******************************************
|
||||
Defines
|
||||
@ -53,10 +53,9 @@ uint8_t tennokoe_bank_index = 0;
|
||||
static const char pceMenuItem1[] PROGMEM = "HuCARD (swapped)";
|
||||
static const char pceMenuItem2[] PROGMEM = "HuCARD(not swapped)";
|
||||
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
|
||||
static const char menuOptionspceCart_0[] PROGMEM = "Read ROM";
|
||||
static const char menuOptionspceCart_1[] PROGMEM = "Read RAM Bank %d";
|
||||
static const char menuOptionspceCart_2[] PROGMEM = "Write RAM Bank %d";
|
||||
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";
|
||||
|
||||
// Turbochip menu items
|
||||
static const char pceTCMenuItem1[] PROGMEM = "Read ROM";
|
||||
static const char *const menuOptionspceTC[] PROGMEM = { pceTCMenuItem1, string_reset2 };
|
||||
static const char *const menuOptionspceTC[] PROGMEM = { FSTRING_READ_ROM, FSTRING_RESET };
|
||||
|
||||
// PCE start menu
|
||||
void pcsMenu(void) {
|
||||
@ -84,7 +82,7 @@ void pcsMenu(void) {
|
||||
display_Update();
|
||||
pce_internal_mode = HUCARD;
|
||||
setup_cart_PCE();
|
||||
mode = mode_PCE;
|
||||
mode = CORE_PCE;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
@ -93,7 +91,7 @@ void pcsMenu(void) {
|
||||
display_Update();
|
||||
pce_internal_mode = HUCARD_NOSWAP;
|
||||
setup_cart_PCE();
|
||||
mode = mode_PCE;
|
||||
mode = CORE_PCE;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@ -102,7 +100,7 @@ void pcsMenu(void) {
|
||||
display_Update();
|
||||
pce_internal_mode = TURBOCHIP;
|
||||
setup_cart_PCE();
|
||||
mode = mode_PCE;
|
||||
mode = CORE_PCE;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
@ -600,9 +598,9 @@ void read_tennokoe_bank_PCE(int bank_index) {
|
||||
// for (int i = 0; i < 16; i++) {
|
||||
// uint8_t b = sdBuffer[c + i];
|
||||
// print_Msg_PaddedHexByte(b);
|
||||
// //print_Msg(F(" "));
|
||||
// //print_Msg(FS(FSTRING_SPACE));
|
||||
// }
|
||||
// println_Msg(F(""));
|
||||
// println_Msg(FS(FSTRING_EMPTY));
|
||||
// }
|
||||
|
||||
if (block_index == 0) {
|
||||
@ -611,7 +609,7 @@ void read_tennokoe_bank_PCE(int bank_index) {
|
||||
uint8_t b = sdBuffer[i];
|
||||
print_Msg_PaddedHexByte(b);
|
||||
}
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
}
|
||||
if (block_index == 0 && sdBuffer[2] == 0x42 && sdBuffer[3] == 0x4D) {
|
||||
if (sdBuffer[0] != 0x48 || sdBuffer[1] != 0x55) {
|
||||
@ -630,7 +628,7 @@ void read_tennokoe_bank_PCE(int bank_index) {
|
||||
//Close the file:
|
||||
myFile.close();
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
@ -730,7 +728,7 @@ void write_tennokoe_bank_PCE(int bank_index) {
|
||||
print_Error(F("File doesn't exist"));
|
||||
}
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
@ -820,7 +818,7 @@ void read_rom_PCE(void) {
|
||||
//CRC search and rename ROM
|
||||
crc_search(fileName, folder, rom_size, crc);
|
||||
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
@ -832,7 +830,7 @@ void pceMenu() {
|
||||
unsigned char mainMenu;
|
||||
|
||||
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[2], menuOptionspceCart_2, tennokoe_bank_index + 1);
|
||||
strcpy_P(menuOptions[3], menuOptionspceCart_3);
|
||||
@ -842,7 +840,7 @@ void pceMenu() {
|
||||
} else {
|
||||
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);
|
||||
|
||||
// wait for user choice to come back from the question box menu
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// BENESSE POCKET CHALLENGE W MODULE
|
||||
//******************************************
|
||||
#ifdef enable_PCW
|
||||
#ifdef ENABLE_PCW
|
||||
|
||||
// Benesse Pocket Challenge W
|
||||
// Cartridge Pinout
|
||||
@ -130,16 +130,13 @@ void setup_PCW() {
|
||||
|
||||
strcpy(romName, "PCW");
|
||||
|
||||
mode = mode_PCW;
|
||||
mode = CORE_PCW;
|
||||
}
|
||||
|
||||
//******************************************
|
||||
// MENU
|
||||
//******************************************
|
||||
static const char pcwmenuItem1[] PROGMEM = "Read ROM";
|
||||
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 };
|
||||
static const char* const menuOptionsPCW[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, FSTRING_RESET };
|
||||
|
||||
void pcwMenu() {
|
||||
convertPgm(menuOptionsPCW, 4);
|
||||
@ -425,7 +422,7 @@ void readSingleROM_PCW() {
|
||||
print_Msg(F("READING "));
|
||||
print_Msg(rom_size / 1024 / 1024);
|
||||
print_Msg("MB SINGLE-PACK");
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
|
||||
// Create file
|
||||
strcpy(fileName, romName);
|
||||
@ -467,7 +464,7 @@ void readSingleROM_PCW() {
|
||||
compareCRC("pcw.txt", 0, 1, 0);
|
||||
|
||||
// Wait for user input
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
@ -564,7 +561,7 @@ void readMultiROM_PCW() {
|
||||
print_Msg(F("READING "));
|
||||
print_Msg(rom_size / 1024 / 1024);
|
||||
print_Msg("MB MULTI-PACK");
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
|
||||
// Create file
|
||||
strcpy(fileName, romName);
|
||||
@ -625,7 +622,7 @@ void readMultiROM_PCW() {
|
||||
compareCRC("pcw.txt", 0, 1, 0);
|
||||
|
||||
// Wait for user input
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// POKEMON MINI MODULE
|
||||
//******************************************
|
||||
#ifdef enable_POKE
|
||||
#ifdef ENABLE_POKE
|
||||
// Pokemon Mini
|
||||
// Cartridge Pinout
|
||||
// 32P 0.5mm pitch
|
||||
@ -79,8 +79,7 @@
|
||||
// Menu
|
||||
//******************************************
|
||||
// Base Menu
|
||||
static const char pokeMenuItem1[] PROGMEM = "Read ROM";
|
||||
static const char* const menuOptionsPOKE[] PROGMEM = { pokeMenuItem1, string_reset2 };
|
||||
static const char* const menuOptionsPOKE[] PROGMEM = { FSTRING_READ_ROM, FSTRING_RESET };
|
||||
|
||||
void pokeMenu() {
|
||||
convertPgm(menuOptionsPOKE, 2);
|
||||
@ -145,7 +144,7 @@ void setup_POKE() {
|
||||
|
||||
strcpy(romName, "POKEMINI");
|
||||
|
||||
mode = mode_POKE;
|
||||
mode = CORE_POKE;
|
||||
}
|
||||
|
||||
//******************************************
|
||||
@ -279,7 +278,7 @@ void readROM_POKE() {
|
||||
|
||||
// compare dump CRC with db values
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
|
@ -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 N64ContMenuItem2[] PROGMEM = "Read ControllerPak";
|
||||
const char N64ContMenuItem3[] PROGMEM = "Write ControllerPak";
|
||||
const char N64ContMenuItem4[] PROGMEM = "Reset";
|
||||
const char* const menuOptionsN64Controller[] PROGMEM = {N64ContMenuItem1, N64ContMenuItem2, N64ContMenuItem3, N64ContMenuItem4};
|
||||
const char* const menuOptionsN64Controller[] PROGMEM = {N64ContMenuItem1, N64ContMenuItem2, N64ContMenuItem3, FSTRING_RESET};
|
||||
```
|
||||
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) {
|
||||
if (enable_OLED)
|
||||
if (ENABLE_OLED)
|
||||
display.print(message);
|
||||
if (enable_Serial)
|
||||
if (ENABLE_SERIAL)
|
||||
Serial.print(message);
|
||||
}
|
||||
```
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// SF MEMORY MODULE
|
||||
//******************************************
|
||||
#ifdef enable_SFM
|
||||
#ifdef ENABLE_SFM
|
||||
|
||||
/******************************************
|
||||
SF Memory Clock Source
|
||||
@ -29,8 +29,7 @@ byte gameAddress[8];
|
||||
// SFM menu items
|
||||
static const char sfmMenuItem1[] PROGMEM = "Game 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, string_reset2 };
|
||||
static const char* const menuOptionsSFM[] PROGMEM = { sfmMenuItem1, sfmMenuItem2, FSTRING_RESET };
|
||||
|
||||
// SFM flash menu items
|
||||
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 };
|
||||
|
||||
// SFM game menu items
|
||||
static const char sfmGameMenuItem1[] PROGMEM = "Read Sram";
|
||||
static const char sfmGameMenuItem2[] PROGMEM = "Read Game";
|
||||
static const char sfmGameMenuItem3[] PROGMEM = "Write Sram";
|
||||
static const char sfmGameMenuItem4[] PROGMEM = "Switch Game";
|
||||
//static const char sfmGameMenuItem5[] PROGMEM = "Reset"; (stored in common strings array)
|
||||
static const char* const menuOptionsSFMGame[] PROGMEM = { sfmGameMenuItem1, sfmGameMenuItem2, sfmGameMenuItem3, sfmGameMenuItem4, string_reset2 };
|
||||
static const char* const menuOptionsSFMGame[] PROGMEM = { FSTRING_READ_SAVE, sfmGameMenuItem2, FSTRING_WRITE_SAVE, sfmGameMenuItem4, FSTRING_RESET };
|
||||
|
||||
void sfmMenu() {
|
||||
// create menu with title and 3 options to choose from
|
||||
@ -64,7 +60,7 @@ void sfmMenu() {
|
||||
break;
|
||||
// Flash menu
|
||||
case 1:
|
||||
mode = mode_SFM_Flash;
|
||||
mode = CORE_SFM_FLASH;
|
||||
break;
|
||||
// Reset
|
||||
case 2:
|
||||
@ -108,7 +104,7 @@ void sfmGameMenu() {
|
||||
print_Msg(gameSubMenu + 0x80, HEX);
|
||||
println_Msg(F(" Timeout"));
|
||||
println_Msg(readBank_SFM(0, 0x2400), HEX);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_FatalError(F("Powercycle SFM cart"));
|
||||
}
|
||||
}
|
||||
@ -117,7 +113,7 @@ void sfmGameMenu() {
|
||||
|
||||
// Print info
|
||||
getCartInfo_SFM();
|
||||
mode = mode_SFM_Game;
|
||||
mode = CORE_SFM_GAME;
|
||||
} else {
|
||||
// No menu so switch to only game
|
||||
// Switch to game
|
||||
@ -129,7 +125,7 @@ void sfmGameMenu() {
|
||||
|
||||
// Print info
|
||||
getCartInfo_SFM();
|
||||
mode = mode_SFM_Game;
|
||||
mode = CORE_SFM_GAME;
|
||||
}
|
||||
} else {
|
||||
print_Error(F("Switch to HiRom failed"));
|
||||
@ -193,7 +189,7 @@ void sfmGameOptions() {
|
||||
break;
|
||||
}
|
||||
if (gameSubMenu != 3) {
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -201,7 +197,7 @@ void sfmGameOptions() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef enable_FLASH
|
||||
#ifdef ENABLE_FLASH
|
||||
void sfmFlashMenu() {
|
||||
// create menu with title and 6 options to choose from
|
||||
unsigned char flashSubMenu;
|
||||
@ -224,7 +220,7 @@ void sfmFlashMenu() {
|
||||
print_Msg(F("Switch to HiRom..."));
|
||||
display_Update();
|
||||
if (send_SFM(0x04) == 0x2A) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
|
||||
// Reset flash
|
||||
@ -301,7 +297,7 @@ void sfmFlashMenu() {
|
||||
print_Msg(F("Switch to HiRom..."));
|
||||
display_Update();
|
||||
if (send_SFM(0x04) == 0x2A) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
idFlash_SFM(0xC0);
|
||||
if (flashid == 0xc2f3) {
|
||||
@ -340,7 +336,7 @@ void sfmFlashMenu() {
|
||||
print_Msg(F("Switch to HiRom..."));
|
||||
display_Update();
|
||||
if (send_SFM(0x04) == 0x2A) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
idFlash_SFM(0xC0);
|
||||
if (flashid == 0xc2f3) {
|
||||
@ -391,7 +387,7 @@ void sfmFlashMenu() {
|
||||
print_Msg(F("Blankcheck..."));
|
||||
display_Update();
|
||||
if (blankcheckMapping_SFM()) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
println_Msg(F("Nope"));
|
||||
@ -420,11 +416,11 @@ void sfmFlashMenu() {
|
||||
|
||||
// Go back
|
||||
case 5:
|
||||
mode = mode_SFM;
|
||||
mode = CORE_SFM;
|
||||
break;
|
||||
}
|
||||
if (flashSubMenu != 5) {
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -577,7 +573,7 @@ void setup_SFM() {
|
||||
clockgen.output_enable(SI5351_CLK2, 0);
|
||||
clockgen.output_enable(SI5351_CLK0, 1);
|
||||
}
|
||||
#ifdef clockgen_installed
|
||||
#ifdef ENABLE_CLOCKGEN
|
||||
else {
|
||||
display_Clear();
|
||||
print_FatalError(F("Clock Generator not found"));
|
||||
@ -600,8 +596,8 @@ void setup_SFM() {
|
||||
// Abort, something is wrong
|
||||
if (timeout == 5) {
|
||||
println_Msg(F("Hirom All Timeout"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_FatalError(F("Powercycle SFM cart"));
|
||||
}
|
||||
}
|
||||
@ -741,7 +737,7 @@ void getCartInfo_SFM() {
|
||||
display_Clear();
|
||||
print_Msg(F("Name: "));
|
||||
println_Msg(romName);
|
||||
println_Msg(F(" "));
|
||||
println_Msg(FS(FSTRING_SPACE));
|
||||
|
||||
print_Msg(F("Version: 1."));
|
||||
println_Msg(romVersion);
|
||||
@ -1641,14 +1637,14 @@ boolean unlockHirom() {
|
||||
print_Msg(F("Switch to HiRom..."));
|
||||
display_Update();
|
||||
if (send_SFM(0x04) == 0x2A) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
// Unlock Write Protection
|
||||
print_Msg(F("Enable Write..."));
|
||||
display_Update();
|
||||
send_SFM(0x02);
|
||||
if (readBank_SFM(0, 0x2401) == 0x4) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
return 1;
|
||||
} else {
|
||||
@ -1720,7 +1716,7 @@ void write_SFM(int startBank, uint32_t pos) {
|
||||
print_Msg(F("Blankcheck..."));
|
||||
display_Update();
|
||||
if (blankcheck_SFM(startBank)) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
println_Msg(F("Nope"));
|
||||
@ -1733,7 +1729,7 @@ void write_SFM(int startBank, uint32_t pos) {
|
||||
print_Msg(F("Blankcheck..."));
|
||||
display_Update();
|
||||
if (blankcheck_SFM(startBank)) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
print_FatalError(F("Could not erase flash"));
|
||||
@ -1750,7 +1746,7 @@ void write_SFM(int startBank, uint32_t pos) {
|
||||
display_Update();
|
||||
writeErrors = verifyFlash_SFM(startBank, pos);
|
||||
if (writeErrors == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
display_Update();
|
||||
} else {
|
||||
print_STR(error_STR, 0);
|
||||
|
@ -1,7 +1,7 @@
|
||||
//***********************************************************
|
||||
// SEGA MASTER SYSTEM / MARK III / GAME GEAR / SG-1000 MODULE
|
||||
//***********************************************************
|
||||
#ifdef enable_SMS
|
||||
#ifdef ENABLE_SMS
|
||||
|
||||
//******************************************
|
||||
// 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 };
|
||||
|
||||
// Operations menu
|
||||
static const char SMSOperationItem1[] PROGMEM = "Read Rom";
|
||||
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 };
|
||||
static const char* const SMSOperationMenu[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, FSTRING_RESET };
|
||||
|
||||
// Rom sizes menu
|
||||
static const char SMSRomSizeItem1[] PROGMEM = "8 KB";
|
||||
@ -122,21 +119,21 @@ void smsOperations() {
|
||||
switch (SMSOperation) {
|
||||
case 0:
|
||||
// Read ROM
|
||||
mode = mode_SMS;
|
||||
mode = CORE_SMS;
|
||||
setup_SMS();
|
||||
readROM_SMS();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// Read SRAM
|
||||
mode = mode_SMS;
|
||||
mode = CORE_SMS;
|
||||
setup_SMS();
|
||||
readSRAM_SMS();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// Write SRAM
|
||||
mode = mode_SMS;
|
||||
mode = CORE_SMS;
|
||||
setup_SMS();
|
||||
writeSRAM_SMS();
|
||||
break;
|
||||
@ -421,7 +418,7 @@ void getCartInfo_SMS() {
|
||||
// print_Msg(bank);
|
||||
// print_Msg(F(" offset "));
|
||||
// print_Msg_PaddedHex32(mirror_offset + 0x7FF0);
|
||||
// println_Msg(F(""));
|
||||
// println_Msg(FS(FSTRING_EMPTY));
|
||||
|
||||
if (strcmp(romName2, romName) == 0) {
|
||||
break;
|
||||
@ -509,13 +506,13 @@ void getCartInfo_SMS() {
|
||||
// Display cart info
|
||||
display_Clear();
|
||||
println_Msg(F("SMS/GG header not found"));
|
||||
println_Msg(F(" "));
|
||||
println_Msg(FS(FSTRING_SPACE));
|
||||
print_Msg(F("Name: "));
|
||||
println_Msg(romName);
|
||||
print_Msg(F("Selected Size: "));
|
||||
print_Msg(cartSize / 1024);
|
||||
println_Msg(F("KB"));
|
||||
println_Msg(F(" "));
|
||||
println_Msg(FS(FSTRING_SPACE));
|
||||
sprintf(romName, "UNKNOWN");
|
||||
}
|
||||
|
||||
@ -527,17 +524,17 @@ void getCartInfo_SMS() {
|
||||
} else {
|
||||
println_Msg(F("GG header info"));
|
||||
}
|
||||
println_Msg(F(" "));
|
||||
println_Msg(FS(FSTRING_SPACE));
|
||||
print_Msg(F("Name: "));
|
||||
println_Msg(romName);
|
||||
print_Msg(F("Size: "));
|
||||
print_Msg(cartSize / 1024);
|
||||
println_Msg(F("KB"));
|
||||
println_Msg(F(" "));
|
||||
println_Msg(FS(FSTRING_SPACE));
|
||||
}
|
||||
|
||||
// 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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -619,13 +616,13 @@ void readROM_SMS() {
|
||||
// for (word xi = 0; xi < 0x100; xi++) {
|
||||
// if (xi%16==0) {
|
||||
// print_Msg_PaddedHex16(xi);
|
||||
// print_Msg(F(" "));
|
||||
// print_Msg(FS(FSTRING_SPACE));
|
||||
// }
|
||||
// print_Msg_PaddedHexByte(sdBuffer[xi]);
|
||||
// if (xi>0&&((xi+1)%16)==0) {
|
||||
// println_Msg(F(""));
|
||||
// println_Msg(FS(FSTRING_EMPTY));
|
||||
// } else {
|
||||
// print_Msg(F(" "));
|
||||
// print_Msg(FS(FSTRING_SPACE));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@ -649,7 +646,7 @@ void readROM_SMS() {
|
||||
compareCRC("sg1000.txt", 0, 1, 0);
|
||||
}
|
||||
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
save_log();
|
||||
#endif
|
||||
|
||||
@ -740,7 +737,7 @@ void writeSRAM_SMS() {
|
||||
}
|
||||
print_Msg(F("sramSize: "));
|
||||
print_Msg(sramSize);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
word bankSize = 16 * 1024;
|
||||
for (word address = 0x0; address < sramSize; address += 512) {
|
||||
byte currBank = address >= bankSize ? 1 : 0;
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// SUPER NINTENDO MODULE
|
||||
//******************************************
|
||||
#ifdef enable_SNES
|
||||
#ifdef ENABLE_SNES
|
||||
|
||||
/******************************************
|
||||
Defines
|
||||
@ -35,40 +35,31 @@ static const char snsMenuItem3[] PROGMEM = "Satellaview BS-X";
|
||||
static const char snsMenuItem4[] PROGMEM = "Sufami Turbo";
|
||||
static const char snsMenuItem5[] PROGMEM = "Game Processor RAM";
|
||||
static const char snsMenuItem6[] PROGMEM = "Flash repro";
|
||||
#ifdef clockgen_calibration
|
||||
#ifdef OPTION_CLOCKGEN_CALIBRATION
|
||||
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, string_reset2 };
|
||||
static const char* const menuOptionsSNS[] PROGMEM = { snsMenuItem1, snsMenuItem2, snsMenuItem3, snsMenuItem4, snsMenuItem5, snsMenuItem6, snsMenuItem7, FSTRING_RESET };
|
||||
#else
|
||||
//static const char snsMenuItem6[] PROGMEM = "Reset"; (stored in common strings array)
|
||||
static const char* const menuOptionsSNS[] PROGMEM = { snsMenuItem1, snsMenuItem2, snsMenuItem3, snsMenuItem4, snsMenuItem5, snsMenuItem6, string_reset2 };
|
||||
static const char* const menuOptionsSNS[] PROGMEM = { snsMenuItem1, snsMenuItem2, snsMenuItem3, snsMenuItem4, snsMenuItem5, snsMenuItem6, FSTRING_RESET };
|
||||
#endif
|
||||
|
||||
// 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 SnesMenuItem5[] PROGMEM = "Cycle cart";
|
||||
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 = { SnesMenuItem1, SnesMenuItem2, SnesMenuItem3, SnesMenuItem4, SnesMenuItem5, SnesMenuItem6, string_reset2 };
|
||||
static const char* const menuOptionsSNES[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, SnesMenuItem4, FSTRING_REFRESH_CART, SnesMenuItem6, FSTRING_RESET };
|
||||
|
||||
// Manual config menu items
|
||||
static const char confMenuItem1[] PROGMEM = "Use header info";
|
||||
static const char confMenuItem2[] PROGMEM = "4MB LoROM 256K SRAM";
|
||||
static const char confMenuItem3[] PROGMEM = "4MB HiROM 64K 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, string_reset2 };
|
||||
static const char* const menuOptionsConfManual[] PROGMEM = { confMenuItem1, confMenuItem2, confMenuItem3, confMenuItem4, FSTRING_RESET };
|
||||
|
||||
// Repro menu items
|
||||
static const char reproMenuItem1[] PROGMEM = "LoROM (P0)";
|
||||
static const char reproMenuItem2[] PROGMEM = "HiROM (P0)";
|
||||
static const char reproMenuItem3[] PROGMEM = "ExLoROM (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, string_reset2 };
|
||||
static const char* const menuOptionsRepro[] PROGMEM = { reproMenuItem1, reproMenuItem2, reproMenuItem3, reproMenuItem4, FSTRING_RESET };
|
||||
|
||||
// SNES repro menu
|
||||
void reproMenu() {
|
||||
@ -80,7 +71,7 @@ void reproMenu() {
|
||||
|
||||
// wait for user choice to come back from the question box menu
|
||||
switch (snsRepro) {
|
||||
#ifdef enable_FLASH
|
||||
#ifdef ENABLE_FLASH
|
||||
case 0:
|
||||
// LoRom
|
||||
display_Clear();
|
||||
@ -89,7 +80,7 @@ void reproMenu() {
|
||||
setup_Flash8();
|
||||
id_Flash8();
|
||||
wait();
|
||||
mode = mode_FLASH8;
|
||||
mode = CORE_FLASH8;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
@ -100,7 +91,7 @@ void reproMenu() {
|
||||
setup_Flash8();
|
||||
id_Flash8();
|
||||
wait();
|
||||
mode = mode_FLASH8;
|
||||
mode = CORE_FLASH8;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@ -111,7 +102,7 @@ void reproMenu() {
|
||||
setup_Flash8();
|
||||
id_Flash8();
|
||||
wait();
|
||||
mode = mode_FLASH8;
|
||||
mode = CORE_FLASH8;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
@ -122,7 +113,7 @@ void reproMenu() {
|
||||
setup_Flash8();
|
||||
id_Flash8();
|
||||
wait();
|
||||
mode = mode_FLASH8;
|
||||
mode = CORE_FLASH8;
|
||||
break;
|
||||
#endif
|
||||
|
||||
@ -137,12 +128,12 @@ void snsMenu() {
|
||||
// create menu with title and 7 options to choose from
|
||||
unsigned char snsCart;
|
||||
// Copy menuOptions out of progmem
|
||||
#ifdef clockgen_calibration
|
||||
#ifdef OPTION_CLOCKGEN_CALIBRATION
|
||||
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
|
||||
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
|
||||
|
||||
// wait for user choice to come back from the question box menu
|
||||
@ -151,46 +142,46 @@ void snsMenu() {
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_Snes();
|
||||
mode = mode_SNES;
|
||||
mode = CORE_SNES;
|
||||
break;
|
||||
|
||||
#ifdef enable_SFM
|
||||
#ifdef ENABLE_SFM
|
||||
case 1:
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_SFM();
|
||||
mode = mode_SFM;
|
||||
mode = CORE_SFM;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef enable_SV
|
||||
#ifdef ENABLE_SV
|
||||
case 2:
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_SV();
|
||||
mode = mode_SV;
|
||||
mode = CORE_SV;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef enable_ST
|
||||
#ifdef ENABLE_ST
|
||||
case 3:
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_ST();
|
||||
mode = mode_ST;
|
||||
mode = CORE_ST;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef enable_GPC
|
||||
#ifdef ENABLE_GPC
|
||||
case 4:
|
||||
display_Clear();
|
||||
display_Update();
|
||||
setup_GPC();
|
||||
mode = mode_GPC;
|
||||
mode = CORE_GPC;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef enable_FLASH
|
||||
#ifdef ENABLE_FLASH
|
||||
case 5:
|
||||
setup_FlashVoltage();
|
||||
reproMenu();
|
||||
@ -198,7 +189,7 @@ void snsMenu() {
|
||||
#endif
|
||||
|
||||
case 6:
|
||||
#ifdef clockgen_calibration
|
||||
#ifdef OPTION_CLOCKGEN_CALIBRATION
|
||||
clkcal();
|
||||
break;
|
||||
|
||||
@ -234,7 +225,7 @@ void snesMenu() {
|
||||
compare_checksum();
|
||||
// CRC32
|
||||
compareCRC("snes.txt", 0, 1, 0);
|
||||
#ifdef global_log
|
||||
#ifdef ENABLE_GLOBAL_LOG
|
||||
save_log();
|
||||
#endif
|
||||
display_Update();
|
||||
@ -286,8 +277,8 @@ void snesMenu() {
|
||||
println_Msg(F("Warning:"));
|
||||
println_Msg(F("This can erase"));
|
||||
println_Msg(F("your save games"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Press any button to"));
|
||||
println_Msg(F("start sram testing"));
|
||||
display_Update();
|
||||
@ -344,7 +335,7 @@ void snesMenu() {
|
||||
resetArduino();
|
||||
break;
|
||||
}
|
||||
//println_Msg(F(""));
|
||||
//println_Msg(FS(FSTRING_EMPTY));
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -489,7 +480,7 @@ void setup_Snes() {
|
||||
clockgen.update_status();
|
||||
delay(500);
|
||||
}
|
||||
#ifdef clockgen_installed
|
||||
#ifdef ENABLE_CLOCKGEN
|
||||
else {
|
||||
display_Clear();
|
||||
print_FatalError(F("Clock Generator not found"));
|
||||
@ -755,8 +746,8 @@ void getCartInfo_SNES() {
|
||||
println_Msg(F("ERROR"));
|
||||
println_Msg(F("Rom header corrupt"));
|
||||
println_Msg(F("or missing"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Press button for"));
|
||||
println_Msg(F("manual configuration"));
|
||||
println_Msg(F("or powercycle if SA1"));
|
||||
@ -782,7 +773,7 @@ void getCartInfo_SNES() {
|
||||
print_Msg(F("ExHiRom"));
|
||||
else
|
||||
print_Msg(romType);
|
||||
print_Msg(F(" "));
|
||||
print_Msg(FS(FSTRING_SPACE));
|
||||
if (romSpeed == 0)
|
||||
println_Msg(F("SlowROM"));
|
||||
else if (romSpeed == 2)
|
||||
@ -830,7 +821,7 @@ void getCartInfo_SNES() {
|
||||
else if (romChips == 249)
|
||||
println_Msg(F("SPC RAM RTC"));
|
||||
else
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
|
||||
|
||||
if (altconf)
|
||||
@ -860,14 +851,14 @@ void getCartInfo_SNES() {
|
||||
display_Update();
|
||||
|
||||
// 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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
wait();
|
||||
#endif
|
||||
#ifdef enable_serial
|
||||
println_Msg(F(" "));
|
||||
#ifdef ENABLE_SERIAL
|
||||
println_Msg(FS(FSTRING_SPACE));
|
||||
#endif
|
||||
|
||||
// Start manual config
|
||||
@ -1456,7 +1447,7 @@ void readROM_SNES() {
|
||||
display_Update();
|
||||
readHiRomBanks(240, 256, &myFile);
|
||||
}
|
||||
//println_Msg(F(""));
|
||||
//println_Msg(FS(FSTRING_EMPTY));
|
||||
display_Clear(); // need more space due to the 4 progress bars
|
||||
|
||||
// Return mapping registers to initial settings...
|
||||
@ -2256,7 +2247,7 @@ boolean eraseSRAM(byte b) {
|
||||
}
|
||||
}
|
||||
if (writeErrors == 0) {
|
||||
println_Msg(F("OK"));
|
||||
println_Msg(FS(FSTRING_OK));
|
||||
return 1;
|
||||
} else {
|
||||
println_Msg(F("ERROR"));
|
||||
|
@ -1,7 +1,7 @@
|
||||
/******************************************
|
||||
SUPER FAMICOM SUFAMI TURBO MODULE
|
||||
******************************************/
|
||||
#ifdef enable_ST
|
||||
#ifdef ENABLE_ST
|
||||
|
||||
/******************************************
|
||||
Menu
|
||||
@ -9,7 +9,7 @@
|
||||
// Sufami Turbo menu items
|
||||
static const char stMenuItem1[] PROGMEM = "Read cart in Slot A";
|
||||
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() {
|
||||
// Create ST menu with title and 3 options to choose from
|
||||
|
@ -2,19 +2,16 @@
|
||||
// Super A'can MODULE
|
||||
// Only tested with HW3 and HW5
|
||||
//******************************************
|
||||
#ifdef enable_SUPRACAN
|
||||
#ifdef ENABLE_SUPRACAN
|
||||
|
||||
/******************************************
|
||||
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 acanMenuItem5[] PROGMEM = "Write UM6650";
|
||||
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() {
|
||||
// Request 5V
|
||||
@ -82,7 +79,7 @@ void setup_SuprAcan() {
|
||||
clockgen.update_status();
|
||||
delay(500);
|
||||
}
|
||||
#ifdef clockgen_installed
|
||||
#ifdef ENABLE_CLOCKGEN
|
||||
else {
|
||||
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);
|
||||
display_Update();
|
||||
wait();
|
||||
@ -190,7 +187,7 @@ static void readROM_Acan() {
|
||||
|
||||
print_Msg(F("CRC32: "));
|
||||
print_Msg_PaddedHex32(crc32);
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_STR(done_STR, 1);
|
||||
}
|
||||
|
||||
@ -482,7 +479,7 @@ static void checkRomExist_Acan() {
|
||||
|
||||
cartSize = getRomSize_Acan();
|
||||
romSize = cartSize >> 17;
|
||||
mode = mode_SUPRACAN;
|
||||
mode = CORE_SUPRACAN;
|
||||
|
||||
if (cartSize == 0)
|
||||
print_Error(F("Unable to find rom signature..."));
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Revision 1.0.0 October 22nd 2018
|
||||
// Added BSX Sram, copied from skamans enhanced sketch //sanni
|
||||
//******************************************
|
||||
#ifdef enable_SV
|
||||
#ifdef ENABLE_SV
|
||||
|
||||
/******************************************
|
||||
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 svFlashMenuItem3[] PROGMEM = "Read 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, svFlashMenuItem5 };
|
||||
static const char* const menuOptionsSVFlash[] PROGMEM = { svFlashMenuItem1, svFlashMenuItem2, svFlashMenuItem3, svFlashMenuItem4, FSTRING_RESET };
|
||||
|
||||
|
||||
void svMenu() {
|
||||
@ -122,7 +121,7 @@ void setup_SV() {
|
||||
clockgen.output_enable(SI5351_CLK1, 0);
|
||||
clockgen.output_enable(SI5351_CLK2, 1);
|
||||
}
|
||||
#ifdef clockgen_installed
|
||||
#ifdef ENABLE_CLOCKGEN
|
||||
else {
|
||||
display_Clear();
|
||||
print_FatalError(F("Clock Generator not found"));
|
||||
@ -517,7 +516,7 @@ void writeROM_SV(void) {
|
||||
draw_progressbar(((currBank - 0xC0) * 0x10000), 0x100000);
|
||||
for (long currByte = 0; currByte < 65536; currByte++) {
|
||||
if (0xFF != readBank_SV(currBank, currByte)) {
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Erase failed"));
|
||||
display_Update();
|
||||
myFile.close();
|
||||
@ -560,7 +559,7 @@ void writeROM_SV(void) {
|
||||
draw_progressbar(((currBank - 0xC0) * 0x10000), 0x100000);
|
||||
for (long currByte = 0; currByte < 65536; currByte++) {
|
||||
if (myFile.read() != readBank_SV(currBank, currByte)) {
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("Verify failed"));
|
||||
display_Update();
|
||||
myFile.close();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// VIRTUALBOY MODULE
|
||||
//******************************************
|
||||
#ifdef enable_VBOY
|
||||
#ifdef ENABLE_VBOY
|
||||
// Nintendo VirtualBoy
|
||||
// Cartridge Pinout
|
||||
// 60P 2.00mm pitch connector
|
||||
@ -89,7 +89,7 @@ void setup_VBOY() {
|
||||
|
||||
getCartInfo_VB();
|
||||
|
||||
mode = mode_VBOY;
|
||||
mode = CORE_VBOY;
|
||||
}
|
||||
|
||||
//******************************************
|
||||
@ -97,11 +97,7 @@ void setup_VBOY() {
|
||||
//******************************************
|
||||
|
||||
// Base Menu
|
||||
static const char vboyMenuItem1[] PROGMEM = "Read ROM";
|
||||
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 };
|
||||
static const char* const menuOptionsVBOY[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, FSTRING_RESET };
|
||||
|
||||
void vboyMenu() {
|
||||
convertPgm(menuOptionsVBOY, 4);
|
||||
@ -127,7 +123,7 @@ void vboyMenu() {
|
||||
} else {
|
||||
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
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
@ -157,7 +153,7 @@ void vboyMenu() {
|
||||
} else {
|
||||
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
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
print_STR(press_button_STR, 1);
|
||||
@ -384,7 +380,7 @@ void getCartInfo_VB() {
|
||||
|
||||
display_Clear();
|
||||
println_Msg(F("Cart Info"));
|
||||
println_Msg(F(" "));
|
||||
println_Msg(FS(FSTRING_SPACE));
|
||||
print_Msg(F("Name: "));
|
||||
println_Msg(romName);
|
||||
print_Msg(F("Size: "));
|
||||
@ -396,9 +392,9 @@ void getCartInfo_VB() {
|
||||
println_Msg(F(" KBit"));
|
||||
} else
|
||||
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
|
||||
// Prints string out of the common strings array either with or without newline
|
||||
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
|
||||
compareCRC("vb.txt", 0, 1, 0);
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
// 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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// VECTREX MODULE
|
||||
//******************************************
|
||||
#ifdef enable_VECTREX
|
||||
#ifdef ENABLE_VECTREX
|
||||
// Vectrex
|
||||
// Cartridge Pinout
|
||||
// 36P 2.54mm pitch connector
|
||||
@ -68,10 +68,7 @@ byte newvectrexsize;
|
||||
// Menu
|
||||
//******************************************
|
||||
// Base Menu
|
||||
static const char vectrexMenuItem1[] PROGMEM = "Select Cart";
|
||||
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 };
|
||||
static const char* const menuOptionsVECTREX[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
|
||||
|
||||
void setup_VECTREX() {
|
||||
// Request 5V
|
||||
@ -116,7 +113,7 @@ void setup_VECTREX() {
|
||||
checkStatus_VECTREX();
|
||||
strcpy(romName, "VECTREX");
|
||||
|
||||
mode = mode_VECTREX;
|
||||
mode = CORE_VECTREX;
|
||||
}
|
||||
|
||||
void vectrexMenu() {
|
||||
@ -251,7 +248,7 @@ void readROM_VECTREX() {
|
||||
unsigned long crcsize = VECTREX[vectrexsize] * 0x400;
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -263,22 +260,22 @@ void readROM_VECTREX() {
|
||||
//******************************************
|
||||
|
||||
void setROMSize_VECTREX() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (vectrexlo == vectrexhi)
|
||||
newvectrexsize = vectrexlo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = vectrexlo;
|
||||
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(VECTREX[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -295,11 +292,11 @@ void setROMSize_VECTREX() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(VECTREX[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -314,11 +311,11 @@ void setROMSize_VECTREX() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(VECTREX[i]);
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -356,7 +353,7 @@ setrom:
|
||||
newvectrexsize = sizeROM.toInt() + vectrexlo;
|
||||
if (newvectrexsize > vectrexhi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
@ -375,11 +372,11 @@ void checkStatus_VECTREX() {
|
||||
EEPROM_writeAnything(8, vectrexsize);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("VECTREX READER"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("ROM SIZE: "));
|
||||
print_Msg(VECTREX[vectrexsize]);
|
||||
println_Msg(F("KB"));
|
||||
@ -389,7 +386,7 @@ void checkStatus_VECTREX() {
|
||||
Serial.print(F("ROM SIZE: "));
|
||||
Serial.print(VECTREX[vectrexsize]);
|
||||
Serial.println(F("KB"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -442,7 +439,7 @@ bool readVals_VECTREX(char* vectrexgame, char* vectrexrr, char* vectrexll) {
|
||||
bool getCartListInfo_VECTREX() {
|
||||
bool buttonreleased = 0;
|
||||
bool cartselected = 0;
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F(" HOLD TO FAST CYCLE"));
|
||||
display_Update();
|
||||
@ -450,9 +447,9 @@ bool getCartListInfo_VECTREX() {
|
||||
Serial.println(F("HOLD BUTTON TO FAST CYCLE"));
|
||||
#endif
|
||||
delay(2000);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == LOW) { // Button Held - Fast Cycle
|
||||
@ -461,19 +458,19 @@ bool getCartListInfo_VECTREX() {
|
||||
if (strcmp(vectrexcsvEND, vectrexgame) == 0) {
|
||||
vectrexcsvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(vectrexgame);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.print(F("CART TITLE:"));
|
||||
Serial.println(vectrexgame);
|
||||
#endif
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
buttonVal1 = (PIND & (1 << 7)); // PD7
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
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
|
||||
#elif defined(enable_LCD)
|
||||
#elif defined(ENABLE_LCD)
|
||||
boolean buttonVal1 = (PING & (1 << 2)); //PG2
|
||||
#endif
|
||||
if (buttonVal1 == HIGH) // Button Released
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("FAST CYCLE OFF"));
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("FAST CYCLE OFF"));
|
||||
Serial.println(F("PRESS BUTTON TO STEP FORWARD"));
|
||||
Serial.println(F("DOUBLE CLICK TO STEP BACK"));
|
||||
Serial.println(F("HOLD TO SELECT"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
while (readVals_VECTREX(vectrexgame, vectrexrr, vectrexll)) {
|
||||
if (strcmp(vectrexcsvEND, vectrexgame) == 0) {
|
||||
vectrexcsvFile.seek(0); // Restart
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART TITLE:"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(vectrexgame);
|
||||
display.setCursor(0, 48);
|
||||
#if defined(enable_OLED)
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -530,7 +527,7 @@ bool getCartListInfo_VECTREX() {
|
||||
Serial.println(vectrexgame);
|
||||
#endif
|
||||
while (1) { // Single Step
|
||||
int b = checkButton();
|
||||
uint8_t b = checkButton();
|
||||
if (b == 1) { // Continue (press)
|
||||
break;
|
||||
}
|
||||
@ -544,7 +541,7 @@ bool getCartListInfo_VECTREX() {
|
||||
newvectrexsize = strtol(vectrexrr, NULL, 10);
|
||||
EEPROM_writeAnything(8, newvectrexsize);
|
||||
cartselected = 1; // SELECTION MADE
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(F("SELECTION MADE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -559,8 +556,8 @@ bool getCartListInfo_VECTREX() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
println_Msg(F(""));
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(F("END OF FILE"));
|
||||
display_Update();
|
||||
#else
|
||||
@ -572,10 +569,10 @@ bool getCartListInfo_VECTREX() {
|
||||
|
||||
void checkCSV_VECTREX() {
|
||||
if (getCartListInfo_VECTREX()) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CART SELECTED"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(vectrexgame);
|
||||
display_Update();
|
||||
// Display Settings
|
||||
@ -584,16 +581,16 @@ void checkCSV_VECTREX() {
|
||||
println_Msg(newvectrexsize);
|
||||
display_Update();
|
||||
#else
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
Serial.println(F("CART SELECTED"));
|
||||
Serial.println(vectrexgame);
|
||||
// Display Settings
|
||||
Serial.print(F("CODE: R"));
|
||||
Serial.println(newvectrexsize);
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
} else {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display.setCursor(0, 56);
|
||||
println_Msg(F("NO SELECTION"));
|
||||
display_Update();
|
||||
@ -604,7 +601,7 @@ void checkCSV_VECTREX() {
|
||||
}
|
||||
|
||||
void setCart_VECTREX() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(vectrexcartCSV);
|
||||
display_Update();
|
||||
@ -614,7 +611,7 @@ void setCart_VECTREX() {
|
||||
sd.chdir(folder); // Switch Folder
|
||||
vectrexcsvFile = sd.open(vectrexcartCSV, O_READ);
|
||||
if (!vectrexcsvFile) {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("CSV FILE NOT FOUND!"));
|
||||
display_Update();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//*********************************************************
|
||||
// BANDAI WONDERSWAN & BENESSE POCKET CHALLENGE V2 MODULE
|
||||
//*********************************************************
|
||||
#ifdef enable_WS
|
||||
#ifdef ENABLE_WS
|
||||
// Cartridge pinout
|
||||
// 48P 1.25mm pitch connector
|
||||
// C1, C48 : GND
|
||||
@ -23,7 +23,7 @@
|
||||
// C46 : INT (for RTC alarm interrupt)
|
||||
// C47 : CLK (384KHz on WS)
|
||||
|
||||
#ifdef ws_adapter_v2
|
||||
#ifdef OPTION_WS_ADAPTER_V2
|
||||
#define WS_CLK_BIT 5 // USE PE5 as CLK
|
||||
#else
|
||||
#define WS_CLK_BIT 3 // USE PE3 as CLK
|
||||
@ -32,12 +32,8 @@
|
||||
/******************************************
|
||||
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 *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 uint8_t wsGameOrientation = 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
|
||||
print_STR(press_button_STR, 1);
|
||||
|
||||
@ -1003,7 +999,7 @@ static boolean compareChecksum_WS(uint16_t checksum) {
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Error(F("Checksum Error"));
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
//******************************************
|
||||
// WSV MODULE
|
||||
//******************************************
|
||||
#ifdef enable_WSV
|
||||
#ifdef ENABLE_WSV
|
||||
// Watara Supervision
|
||||
// Cartridge Pinout
|
||||
// 40P 2.5mm pitch connector
|
||||
@ -94,7 +94,7 @@ void setup_WSV() {
|
||||
checkStatus_WSV();
|
||||
strcpy(romName, "SUPERVISION");
|
||||
|
||||
mode = mode_WSV;
|
||||
mode = CORE_WSV;
|
||||
}
|
||||
|
||||
//******************************************
|
||||
@ -102,11 +102,7 @@ void setup_WSV() {
|
||||
//******************************************
|
||||
|
||||
// Base Menu
|
||||
static const char wsvMenuItem1[] PROGMEM = "Select Cart";
|
||||
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 };
|
||||
static const char* const menuOptionsSV[] PROGMEM = { FSTRING_SELECT_CART, FSTRING_READ_ROM, FSTRING_SET_SIZE, FSTRING_RESET };
|
||||
|
||||
void wsvMenu() {
|
||||
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
|
||||
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
|
||||
print_STR(press_button_STR, 1);
|
||||
display_Update();
|
||||
@ -247,22 +243,22 @@ void readROM_WSV() {
|
||||
//******************************************
|
||||
|
||||
void setROMSize_WSV() {
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
if (wsvlo == wsvhi)
|
||||
newwsvsize = wsvlo;
|
||||
else {
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
int i = wsvlo;
|
||||
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(pgm_read_word(&(WSV[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -280,11 +276,11 @@ void setROMSize_WSV() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(pgm_read_word(&(WSV[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -300,11 +296,11 @@ void setROMSize_WSV() {
|
||||
display_Clear();
|
||||
print_Msg(F("ROM Size: "));
|
||||
println_Msg(pgm_read_word(&(WSV[i])));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#endif
|
||||
@ -342,7 +338,7 @@ setrom:
|
||||
newwsvsize = sizeROM.toInt() + wsvlo;
|
||||
if (newwsvsize > wsvhi) {
|
||||
Serial.println(F("SIZE NOT SUPPORTED"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
goto setrom;
|
||||
}
|
||||
}
|
||||
@ -361,11 +357,11 @@ void checkStatus_WSV() {
|
||||
EEPROM_writeAnything(8, wsvsize);
|
||||
}
|
||||
|
||||
#if (defined(enable_OLED) || defined(enable_LCD))
|
||||
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
|
||||
display_Clear();
|
||||
println_Msg(F("WATARA SUPERVISION"));
|
||||
println_Msg(F("CURRENT SETTINGS"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
print_Msg(F("ROM SIZE: "));
|
||||
print_Msg(pgm_read_word(&(WSV[wsvsize])));
|
||||
println_Msg(F("K"));
|
||||
@ -375,7 +371,7 @@ void checkStatus_WSV() {
|
||||
Serial.print(F("CURRENT ROM SIZE: "));
|
||||
Serial.print(pgm_read_word(&(WSV[wsvsize])));
|
||||
Serial.println(F("K"));
|
||||
Serial.println(F(""));
|
||||
Serial.println(FSTRING_EMPTY);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -459,7 +455,7 @@ void setCart_WSV() {
|
||||
skip_line(&myFile);
|
||||
|
||||
println_Msg(F("Select your cartridge"));
|
||||
println_Msg(F(""));
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
println_Msg(gamename);
|
||||
print_Msg(F("Size: "));
|
||||
if (cartSize == 51)
|
||||
@ -467,11 +463,11 @@ void setCart_WSV() {
|
||||
else
|
||||
print_Msg(cartSize);
|
||||
println_Msg(F("KB"));
|
||||
println_Msg(F(""));
|
||||
#if defined(enable_OLED)
|
||||
println_Msg(FS(FSTRING_EMPTY));
|
||||
#if defined(ENABLE_OLED)
|
||||
print_STR(press_to_change_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(press_to_select_STR, 1);
|
||||
#elif defined(SERIAL_MONITOR)
|
||||
@ -480,7 +476,7 @@ void setCart_WSV() {
|
||||
#endif
|
||||
display_Update();
|
||||
|
||||
int b = 0;
|
||||
uint8_t b = 0;
|
||||
while (1) {
|
||||
// Check button input
|
||||
b = checkButton();
|
||||
|
@ -3,4 +3,4 @@ lcd.confColor=0
|
||||
lcd.red=0
|
||||
lcd.green=100
|
||||
lcd.blue=0
|
||||
md.sramType=0
|
||||
md.saveType=0
|
||||
|
Loading…
Reference in New Issue
Block a user