mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-15 01:15:06 +01:00
#define ENABLE_FLASH now enables/disables all repro flash code
This cuts down memory usage from 90%/66% to 68%/63%. Useful for people that don't flash repros and would like to enable more systems instead.
This commit is contained in:
parent
9400330fca
commit
34e2ef2bae
@ -4,8 +4,8 @@
|
|||||||
This project represents a community-driven effort to provide
|
This project represents a community-driven effort to provide
|
||||||
an easy to build and easy to modify cartridge dumper.
|
an easy to build and easy to modify cartridge dumper.
|
||||||
|
|
||||||
Date: 2024-08-11
|
Date: 2024-08-16
|
||||||
Version: 14.2
|
Version: 14.3
|
||||||
|
|
||||||
SD lib: https://github.com/greiman/SdFat
|
SD lib: https://github.com/greiman/SdFat
|
||||||
LCD lib: https://github.com/olikraus/u8g2
|
LCD lib: https://github.com/olikraus/u8g2
|
||||||
@ -2332,6 +2332,21 @@ void setup() {
|
|||||||
if (!myLog.open("OSCR_LOG.txt", O_RDWR | O_CREAT | O_APPEND)) {
|
if (!myLog.open("OSCR_LOG.txt", O_RDWR | O_CREAT | O_APPEND)) {
|
||||||
print_FatalError(sd_error_STR);
|
print_FatalError(sd_error_STR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start new log if file is too big
|
||||||
|
if (myLog.fileSize() > 262144) {
|
||||||
|
EEPROM_readAnything(0, foldern);
|
||||||
|
sprintf(folder, "%s%d%s", "OSCR_LOG_", foldern, ".txt");
|
||||||
|
foldern = foldern + 1;
|
||||||
|
EEPROM_writeAnything(0, foldern);
|
||||||
|
myLog.rename(folder);
|
||||||
|
// Close the file:
|
||||||
|
myLog.close();
|
||||||
|
if (!myLog.open("OSCR_LOG.txt", O_RDWR | O_CREAT | O_APPEND)) {
|
||||||
|
print_FatalError(sd_error_STR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
println_Msg(FS(FSTRING_EMPTY));
|
println_Msg(FS(FSTRING_EMPTY));
|
||||||
#if defined(HW1)
|
#if defined(HW1)
|
||||||
print_Msg(F("OSCR HW1"));
|
print_Msg(F("OSCR HW1"));
|
||||||
@ -3686,10 +3701,12 @@ void loop() {
|
|||||||
case CORE_GB: return gbMenu();
|
case CORE_GB: return gbMenu();
|
||||||
case CORE_GBA: return gbaMenu();
|
case CORE_GBA: return gbaMenu();
|
||||||
case CORE_GBM: return gbmMenu();
|
case CORE_GBM: return gbmMenu();
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
case CORE_GB_GBSMART: return gbSmartMenu();
|
case CORE_GB_GBSMART: return gbSmartMenu();
|
||||||
case CORE_GB_GBSMART_FLASH: return gbSmartFlashMenu();
|
case CORE_GB_GBSMART_FLASH: return gbSmartFlashMenu();
|
||||||
case CORE_GB_GBSMART_GAME: return gbSmartGameOptions();
|
case CORE_GB_GBSMART_GAME: return gbSmartGameOptions();
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#ifdef ENABLE_FLASH
|
#ifdef ENABLE_FLASH
|
||||||
case CORE_FLASH8: return flashromMenu8();
|
case CORE_FLASH8: return flashromMenu8();
|
||||||
#ifdef ENABLE_FLASH16
|
#ifdef ENABLE_FLASH16
|
||||||
|
@ -182,7 +182,7 @@
|
|||||||
/* [ Flashrom Programmer for repro carts -------------------------- ]
|
/* [ Flashrom Programmer for repro carts -------------------------- ]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define ENABLE_FLASH
|
//#define ENABLE_FLASH
|
||||||
//#define ENABLE_FLASH16
|
//#define ENABLE_FLASH16
|
||||||
|
|
||||||
/****/
|
/****/
|
||||||
|
@ -27,6 +27,7 @@ static const char* const menuOptionsGBx[] PROGMEM = { gbxMenuItem1, gbxMenuItem2
|
|||||||
// GB menu items
|
// GB menu items
|
||||||
static const char* const menuOptionsGB[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, FSTRING_RESET };
|
static const char* const menuOptionsGB[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, FSTRING_RESET };
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
// GB Flash items
|
// GB Flash items
|
||||||
static const char GBFlashItem1[] PROGMEM = "GB 29F Repro";
|
static const char GBFlashItem1[] PROGMEM = "GB 29F Repro";
|
||||||
static const char GBFlashItem2[] PROGMEM = "GB CFI Repro";
|
static const char GBFlashItem2[] PROGMEM = "GB CFI Repro";
|
||||||
@ -42,6 +43,7 @@ static const char GBFlash29Item2[] PROGMEM = "DIY MBC5 (WR)";
|
|||||||
static const char GBFlash29Item3[] PROGMEM = "HDR MBC30 (Audio)";
|
static const char GBFlash29Item3[] PROGMEM = "HDR MBC30 (Audio)";
|
||||||
static const char GBFlash29Item4[] PROGMEM = "HDR GameBoy Cam";
|
static const char GBFlash29Item4[] PROGMEM = "HDR GameBoy Cam";
|
||||||
static const char* const menuOptionsGBFlash29[] PROGMEM = { GBFlash29Item1, GBFlash29Item2, GBFlash29Item3, GBFlash29Item4, FSTRING_RESET };
|
static const char* const menuOptionsGBFlash29[] PROGMEM = { GBFlash29Item1, GBFlash29Item2, GBFlash29Item3, GBFlash29Item4, FSTRING_RESET };
|
||||||
|
#endif
|
||||||
|
|
||||||
// Pelican Codebreaker, Brainboy, and Monster Brain Operation Menu
|
// Pelican Codebreaker, Brainboy, and Monster Brain Operation Menu
|
||||||
static const char PelicanRead[] PROGMEM = "Read Device";
|
static const char PelicanRead[] PROGMEM = "Read Device";
|
||||||
@ -55,6 +57,7 @@ static const char GameSharkRead[] PROGMEM = "Read GBC GameShark";
|
|||||||
static const char GameSharkWrite[] PROGMEM = "Write GBC GameShark";
|
static const char GameSharkWrite[] PROGMEM = "Write GBC GameShark";
|
||||||
static const char* const menuOptionsGBDatel[] PROGMEM = { MegaMemRead, MegaMemWrite, GameSharkRead, GameSharkWrite };
|
static const char* const menuOptionsGBDatel[] PROGMEM = { MegaMemRead, MegaMemWrite, GameSharkRead, GameSharkWrite };
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
bool gbxFlashCFI() {
|
bool gbxFlashCFI() {
|
||||||
// Flash CFI
|
// Flash CFI
|
||||||
display_Clear();
|
display_Clear();
|
||||||
@ -80,6 +83,7 @@ bool gbxFlashCFI() {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void feedbackPressAndReset() {
|
void feedbackPressAndReset() {
|
||||||
// Prints string out of the common strings array either with or without newline
|
// Prints string out of the common strings array either with or without newline
|
||||||
@ -113,6 +117,7 @@ void gbxMenu() {
|
|||||||
mode = CORE_GBA;
|
mode = CORE_GBA;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
case 2:
|
case 2:
|
||||||
// create submenu with title and 7 options to choose from
|
// create submenu with title and 7 options to choose from
|
||||||
unsigned char gbFlash;
|
unsigned char gbFlash;
|
||||||
@ -314,6 +319,7 @@ void gbxMenu() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
// Flash GB Memory
|
// Flash GB Memory
|
||||||
@ -430,6 +436,9 @@ void gbxMenu() {
|
|||||||
case 6:
|
case 6:
|
||||||
resetArduino();
|
resetArduino();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
print_MissingModule(); // does not return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1806,6 +1815,7 @@ void sendMBC7EEPROM_Inst_GB(uint8_t op, uint8_t addr, uint16_t data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
/******************************************
|
/******************************************
|
||||||
29F016/29F032/29F033 flashrom functions
|
29F016/29F032/29F033 flashrom functions
|
||||||
*****************************************/
|
*****************************************/
|
||||||
@ -2452,6 +2462,7 @@ bool writeCFI_GB() {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**************************************************
|
/**************************************************
|
||||||
Pelican Gameboy Device Read Function
|
Pelican Gameboy Device Read Function
|
||||||
|
@ -10,12 +10,14 @@
|
|||||||
static const char GBAMenuItem4[] PROGMEM = "Force Savetype";
|
static const char GBAMenuItem4[] PROGMEM = "Force Savetype";
|
||||||
static const char* const menuOptionsGBA[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, GBAMenuItem4, FSTRING_RESET };
|
static const char* const menuOptionsGBA[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, GBAMenuItem4, FSTRING_RESET };
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
// 369-in-1 menu items
|
// 369-in-1 menu items
|
||||||
static const char Menu369Item1[] PROGMEM = "Read 256MB";
|
static const char Menu369Item1[] PROGMEM = "Read 256MB";
|
||||||
static const char Menu369Item2[] PROGMEM = "Write 256MB";
|
static const char Menu369Item2[] PROGMEM = "Write 256MB";
|
||||||
static const char Menu369Item3[] PROGMEM = "Read Offset";
|
static const char Menu369Item3[] PROGMEM = "Read Offset";
|
||||||
static const char Menu369Item4[] PROGMEM = "Write Offset";
|
static const char Menu369Item4[] PROGMEM = "Write Offset";
|
||||||
static const char* const Options369GBA[] PROGMEM = { Menu369Item1, Menu369Item2, Menu369Item3, Menu369Item4, FSTRING_RESET };
|
static const char* const Options369GBA[] PROGMEM = { Menu369Item1, Menu369Item2, Menu369Item3, Menu369Item4, FSTRING_RESET };
|
||||||
|
#endif
|
||||||
|
|
||||||
// Rom menu
|
// Rom menu
|
||||||
static const char GBARomItem1[] PROGMEM = "1 MB";
|
static const char GBARomItem1[] PROGMEM = "1 MB";
|
||||||
@ -233,6 +235,7 @@ void gbaMenu() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
// Flash GBA Repro
|
// Flash GBA Repro
|
||||||
void GBAReproMenu() {
|
void GBAReproMenu() {
|
||||||
setup_GBA_Repro();
|
setup_GBA_Repro();
|
||||||
@ -302,6 +305,7 @@ void repro369in1Menu() {
|
|||||||
wait();
|
wait();
|
||||||
resetArduino();
|
resetArduino();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
Setup
|
Setup
|
||||||
@ -367,12 +371,14 @@ void setup_GBA() {
|
|||||||
wait();
|
wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
void setup_GBA_Repro() {
|
void setup_GBA_Repro() {
|
||||||
// Request 3.3V
|
// Request 3.3V
|
||||||
setVoltage(VOLTS_SET_3V3);
|
setVoltage(VOLTS_SET_3V3);
|
||||||
setROM_GBA();
|
setROM_GBA();
|
||||||
display_Clear();
|
display_Clear();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
Low level functions
|
Low level functions
|
||||||
@ -2002,6 +2008,7 @@ unsigned long verifyEEP_GBA(word eepSize) {
|
|||||||
return wrError;
|
return wrError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
/******************************************
|
/******************************************
|
||||||
GBA REPRO Functions (32MB Intel 4000L0YBQ0 and 16MB MX29GL128E)
|
GBA REPRO Functions (32MB Intel 4000L0YBQ0 and 16MB MX29GL128E)
|
||||||
*****************************************/
|
*****************************************/
|
||||||
@ -2920,9 +2927,8 @@ void flashRepro_GBA(boolean option) {
|
|||||||
print_FatalError(F("Check voltage"));
|
print_FatalError(F("Check voltage"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
//******************************************
|
//******************************************
|
||||||
// End of File
|
// End of File
|
||||||
//******************************************
|
//******************************************
|
@ -25,12 +25,14 @@ void gbmMenu() {
|
|||||||
|
|
||||||
// wait for user choice to come back from the question box menu
|
// wait for user choice to come back from the question box menu
|
||||||
switch (mainMenu) {
|
switch (mainMenu) {
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
// Read Flash ID
|
// Read Flash ID
|
||||||
case 0:
|
case 0:
|
||||||
// Clear screen
|
// Clear screen
|
||||||
display_Clear();
|
display_Clear();
|
||||||
readFlashID_GBM();
|
readFlashID_GBM();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Read Flash
|
// Read Flash
|
||||||
case 1:
|
case 1:
|
||||||
@ -62,6 +64,7 @@ void gbmMenu() {
|
|||||||
readROM_GBM(64);
|
readROM_GBM(64);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
// Erase Flash
|
// Erase Flash
|
||||||
case 2:
|
case 2:
|
||||||
// Clear screen
|
// Clear screen
|
||||||
@ -172,6 +175,10 @@ void gbmMenu() {
|
|||||||
// Write mapping
|
// Write mapping
|
||||||
writeMapping_GBM();
|
writeMapping_GBM();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
default:
|
||||||
|
print_MissingModule(); // does not return
|
||||||
}
|
}
|
||||||
println_Msg(FS(FSTRING_EMPTY));
|
println_Msg(FS(FSTRING_EMPTY));
|
||||||
// Prints string out of the common strings array either with or without newline
|
// Prints string out of the common strings array either with or without newline
|
||||||
@ -447,6 +454,7 @@ void send_GBM(byte myCommand) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
void send_GBM(byte myCommand, word myAddress, byte myData) {
|
void send_GBM(byte myCommand, word myAddress, byte myData) {
|
||||||
byte myAddrLow = myAddress & 0xFF;
|
byte myAddrLow = myAddress & 0xFF;
|
||||||
byte myAddrHigh = (myAddress >> 8) & 0xFF;
|
byte myAddrHigh = (myAddress >> 8) & 0xFF;
|
||||||
@ -905,7 +913,7 @@ void writeMapping_GBM() {
|
|||||||
print_Error(open_file_STR);
|
print_Error(open_file_STR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//******************************************
|
//******************************************
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// Supports 32M cart with LH28F016SUT flash
|
// Supports 32M cart with LH28F016SUT flash
|
||||||
//******************************************
|
//******************************************
|
||||||
#ifdef ENABLE_GBX
|
#ifdef ENABLE_GBX
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
#define GB_SMART_GAMES_PER_PAGE 6
|
#define GB_SMART_GAMES_PER_PAGE 6
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
@ -728,6 +729,7 @@ uint8_t gbSmartGetResizeParam(uint8_t rom_size, uint8_t sram_size) {
|
|||||||
return (sram_size | rom_size);
|
return (sram_size | rom_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
//******************************************
|
//******************************************
|
||||||
// End of File
|
// End of File
|
||||||
|
@ -296,6 +296,9 @@ void mdMenu() {
|
|||||||
case 3:
|
case 3:
|
||||||
resetArduino();
|
resetArduino();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
print_MissingModule(); // does not return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2120,7 +2123,6 @@ void verifyFlash_MD() {
|
|||||||
display_Update();
|
display_Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Delay between write operations based on status register
|
// Delay between write operations based on status register
|
||||||
void busyCheck_MD() {
|
void busyCheck_MD() {
|
||||||
@ -2137,6 +2139,7 @@ void busyCheck_MD() {
|
|||||||
// Set data pins to output
|
// Set data pins to output
|
||||||
dataOut_MD();
|
dataOut_MD();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//******************************************
|
//******************************************
|
||||||
// EEPROM Functions
|
// EEPROM Functions
|
||||||
|
@ -69,12 +69,6 @@ static const char* const menuOptionsN64Controller[] PROGMEM = { N64ContMenuItem1
|
|||||||
static const char N64CartMenuItem4[] PROGMEM = "Force Savetype";
|
static const char N64CartMenuItem4[] PROGMEM = "Force Savetype";
|
||||||
static const char* const menuOptionsN64Cart[] PROGMEM = { FSTRING_READ_ROM, FSTRING_READ_SAVE, FSTRING_WRITE_SAVE, N64CartMenuItem4, FSTRING_RESET };
|
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* const menuOptionsN64CRC[] PROGMEM = { N64CRCMenuItem1, N64CRCMenuItem2, N64CRCMenuItem3, FSTRING_RESET };
|
|
||||||
|
|
||||||
// Rom menu
|
// Rom menu
|
||||||
static const char N64RomItem1[] PROGMEM = "4 MB";
|
static const char N64RomItem1[] PROGMEM = "4 MB";
|
||||||
static const char N64RomItem2[] PROGMEM = "8 MB";
|
static const char N64RomItem2[] PROGMEM = "8 MB";
|
||||||
@ -93,6 +87,7 @@ static const char N64SaveItem4[] PROGMEM = "SRAM";
|
|||||||
static const char N64SaveItem5[] PROGMEM = "FLASH";
|
static const char N64SaveItem5[] PROGMEM = "FLASH";
|
||||||
static const char* const saveOptionsN64[] PROGMEM = { N64SaveItem1, N64SaveItem2, N64SaveItem3, N64SaveItem4, N64SaveItem5 };
|
static const char* const saveOptionsN64[] PROGMEM = { N64SaveItem1, N64SaveItem2, N64SaveItem3, N64SaveItem4, N64SaveItem5 };
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
// Repro write buffer menu
|
// Repro write buffer menu
|
||||||
static const char N64BufferItem1[] PROGMEM = "No buffer";
|
static const char N64BufferItem1[] PROGMEM = "No buffer";
|
||||||
static const char N64BufferItem2[] PROGMEM = "32 Byte";
|
static const char N64BufferItem2[] PROGMEM = "32 Byte";
|
||||||
@ -106,6 +101,7 @@ static const char N64SectorItem2[] PROGMEM = "32 KB";
|
|||||||
static const char N64SectorItem3[] PROGMEM = "64 KB";
|
static const char N64SectorItem3[] PROGMEM = "64 KB";
|
||||||
static const char N64SectorItem4[] PROGMEM = "128 KB";
|
static const char N64SectorItem4[] PROGMEM = "128 KB";
|
||||||
static const char* const sectorOptionsN64[] PROGMEM = { N64SectorItem1, N64SectorItem2, N64SectorItem3, N64SectorItem4 };
|
static const char* const sectorOptionsN64[] PROGMEM = { N64SectorItem1, N64SectorItem2, N64SectorItem3, N64SectorItem4 };
|
||||||
|
#endif
|
||||||
|
|
||||||
// N64 start menu
|
// N64 start menu
|
||||||
void n64Menu() {
|
void n64Menu() {
|
||||||
@ -132,6 +128,7 @@ void n64Menu() {
|
|||||||
mode = CORE_N64_CONTROLLER;
|
mode = CORE_N64_CONTROLLER;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
case 2:
|
case 2:
|
||||||
display_Clear();
|
display_Clear();
|
||||||
display_Update();
|
display_Update();
|
||||||
@ -140,6 +137,7 @@ void n64Menu() {
|
|||||||
printCartInfo_N64();
|
printCartInfo_N64();
|
||||||
mode = CORE_N64_CART;
|
mode = CORE_N64_CART;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
display_Clear();
|
display_Clear();
|
||||||
@ -165,6 +163,9 @@ void n64Menu() {
|
|||||||
case 5:
|
case 5:
|
||||||
resetArduino();
|
resetArduino();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
print_MissingModule(); // does not return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3039,6 +3040,7 @@ void savesummary_N64(boolean checkfound, char crcStr[9], unsigned long timeElaps
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
/******************************************
|
/******************************************
|
||||||
N64 Repro Flashrom Functions
|
N64 Repro Flashrom Functions
|
||||||
*****************************************/
|
*****************************************/
|
||||||
@ -3997,6 +3999,7 @@ unsigned long verifyFlashrom_N64() {
|
|||||||
return 9999;
|
return 9999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
N64 Gameshark Flash Functions
|
N64 Gameshark Flash Functions
|
||||||
|
@ -254,11 +254,13 @@ static const char nesChipsMenuItem3[] PROGMEM = "Read only CHR";
|
|||||||
static const char nesChipsMenuItem4[] PROGMEM = "Back";
|
static const char nesChipsMenuItem4[] PROGMEM = "Back";
|
||||||
static const char* const menuOptionsNESChips[] PROGMEM = { nesChipsMenuItem1, nesChipsMenuItem2, nesChipsMenuItem3, nesChipsMenuItem4 };
|
static const char* const menuOptionsNESChips[] PROGMEM = { nesChipsMenuItem1, nesChipsMenuItem2, nesChipsMenuItem3, nesChipsMenuItem4 };
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
// Repro Writer Menu
|
// Repro Writer Menu
|
||||||
static const char nesFlashMenuItem1[] PROGMEM = "Flash NesMaker";
|
static const char nesFlashMenuItem1[] PROGMEM = "Flash NesMaker";
|
||||||
static const char nesFlashMenuItem2[] PROGMEM = "Flash A29040B-MAPPER0";
|
static const char nesFlashMenuItem2[] PROGMEM = "Flash A29040B-MAPPER0";
|
||||||
static const char nesFlashMenuItem3[] PROGMEM = "Back";
|
static const char nesFlashMenuItem3[] PROGMEM = "Back";
|
||||||
static const char* const menuOptionsNESFlash[] PROGMEM = { nesFlashMenuItem1, nesFlashMenuItem2, nesFlashMenuItem3 };
|
static const char* const menuOptionsNESFlash[] PROGMEM = { nesFlashMenuItem1, nesFlashMenuItem2, nesFlashMenuItem3 };
|
||||||
|
#endif
|
||||||
|
|
||||||
// NES start menu
|
// NES start menu
|
||||||
void nesMenu() {
|
void nesMenu() {
|
||||||
@ -328,15 +330,20 @@ void nesMenu() {
|
|||||||
checkStatus_NES();
|
checkStatus_NES();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
// Write FLASH
|
// Write FLASH
|
||||||
case 5:
|
case 5:
|
||||||
nesFlashMenu();
|
nesFlashMenu();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Reset
|
// Reset
|
||||||
case 6:
|
case 6:
|
||||||
resetArduino();
|
resetArduino();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
print_MissingModule(); // does not return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,6 +402,7 @@ void nesChipMenu() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
void nesFlashMenu() {
|
void nesFlashMenu() {
|
||||||
// create menu with title "Select NES Flash Repro" and 3 options to choose from
|
// create menu with title "Select NES Flash Repro" and 3 options to choose from
|
||||||
convertPgm(menuOptionsNESFlash, 3);
|
convertPgm(menuOptionsNESFlash, 3);
|
||||||
@ -441,6 +449,7 @@ void nesFlashMenu() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
Setup
|
Setup
|
||||||
@ -862,8 +871,8 @@ static void write_prg_byte(unsigned int address, uint8_t data) {
|
|||||||
// _delay_us(1);
|
// _delay_us(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write_chr_byte(unsigned int address, uint8_t data)
|
#if defined(ENABLE_FLASH)
|
||||||
{
|
static void write_chr_byte(unsigned int address, uint8_t data) {
|
||||||
PHI2_LOW;
|
PHI2_LOW;
|
||||||
ROMSEL_HI;
|
ROMSEL_HI;
|
||||||
MODE_WRITE;
|
MODE_WRITE;
|
||||||
@ -885,6 +894,7 @@ static void write_chr_byte(unsigned int address, uint8_t data)
|
|||||||
|
|
||||||
//_delay_us(1);
|
//_delay_us(1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void resetROM() {
|
void resetROM() {
|
||||||
set_address(0);
|
set_address(0);
|
||||||
@ -1618,8 +1628,11 @@ void checkStatus_NES() {
|
|||||||
checkMMC6();
|
checkMMC6();
|
||||||
if (mmc6)
|
if (mmc6)
|
||||||
ram = 1; // 1K
|
ram = 1; // 1K
|
||||||
} else if (mapper == 30) // Check for Flashable/Non-Flashable
|
} else if (mapper == 30) { // Check for Flashable/Non-Flashable
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
NESmaker_ID(); // Flash ID
|
NESmaker_ID(); // Flash ID
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
display_Clear();
|
display_Clear();
|
||||||
println_Msg(F("NES CART READER"));
|
println_Msg(F("NES CART READER"));
|
||||||
@ -2722,7 +2735,8 @@ void readPRG(bool readrom) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 446: {
|
case 446:
|
||||||
|
{
|
||||||
banks = int_pow(2, prgsize) * 2;
|
banks = int_pow(2, prgsize) * 2;
|
||||||
write_prg_byte(0x5003, 0);
|
write_prg_byte(0x5003, 0);
|
||||||
write_prg_byte(0x5005, 0);
|
write_prg_byte(0x5005, 0);
|
||||||
@ -2919,7 +2933,8 @@ void readCHR(bool readrom) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 23: { // 128K
|
case 23:
|
||||||
|
{ // 128K
|
||||||
banks = int_pow(2, chrsize) * 4;
|
banks = int_pow(2, chrsize) * 4;
|
||||||
|
|
||||||
// Detect VRC4e Carts - read PRG 0x1FFF6 (DATE)
|
// Detect VRC4e Carts - read PRG 0x1FFF6 (DATE)
|
||||||
@ -3696,7 +3711,8 @@ void readRAM() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 16: // 256-byte EEPROM 24C02
|
case 16: // 256-byte EEPROM 24C02
|
||||||
case 159: {// 128-byte EEPROM 24C01 [Little Endian]
|
case 159:
|
||||||
|
{ // 128-byte EEPROM 24C01 [Little Endian]
|
||||||
size_t eepsize;
|
size_t eepsize;
|
||||||
if (mapper == 159)
|
if (mapper == 159)
|
||||||
eepsize = 128;
|
eepsize = 128;
|
||||||
@ -3895,7 +3911,8 @@ void writeRAM() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 16: // 256-byte EEPROM 24C02
|
case 16: // 256-byte EEPROM 24C02
|
||||||
case 159: {// 128-byte EEPROM 24C01 [Little Endian]
|
case 159:
|
||||||
|
{ // 128-byte EEPROM 24C01 [Little Endian]
|
||||||
size_t eepsize;
|
size_t eepsize;
|
||||||
if (mapper == 159)
|
if (mapper == 159)
|
||||||
eepsize = 128;
|
eepsize = 128;
|
||||||
@ -4195,6 +4212,7 @@ void EepromWRITE(uint8_t address) {
|
|||||||
EepromStop_NES(); // STOP
|
EepromStop_NES(); // STOP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
/******************************************
|
/******************************************
|
||||||
NESmaker Flash Cart [SST 39SF40]
|
NESmaker Flash Cart [SST 39SF40]
|
||||||
*****************************************/
|
*****************************************/
|
||||||
@ -4624,7 +4642,7 @@ void A29040B_writeFLASH() {
|
|||||||
display_Update();
|
display_Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// avoid warnings
|
// avoid warnings
|
||||||
#undef MODE_READ
|
#undef MODE_READ
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
* String Constants
|
* String Constants
|
||||||
**/
|
**/
|
||||||
// Firmware Version
|
// Firmware Version
|
||||||
constexpr char PROGMEM FSTRING_VERSION[] = "V14.2";
|
constexpr char PROGMEM FSTRING_VERSION[] = "V14.3";
|
||||||
|
|
||||||
// Universal
|
// Universal
|
||||||
constexpr char PROGMEM FSTRING_RESET[] = "Reset";
|
constexpr char PROGMEM FSTRING_RESET[] = "Reset";
|
||||||
|
@ -135,10 +135,12 @@ enum CORES: uint8_t {
|
|||||||
CORE_GB,
|
CORE_GB,
|
||||||
CORE_GBA,
|
CORE_GBA,
|
||||||
CORE_GBM,
|
CORE_GBM,
|
||||||
|
# ifdef ENABLE_FLASH
|
||||||
CORE_GB_GBSMART,
|
CORE_GB_GBSMART,
|
||||||
CORE_GB_GBSMART_FLASH,
|
CORE_GB_GBSMART_FLASH,
|
||||||
CORE_GB_GBSMART_GAME,
|
CORE_GB_GBSMART_GAME,
|
||||||
# endif
|
# endif
|
||||||
|
# endif
|
||||||
# ifdef ENABLE_FLASH
|
# ifdef ENABLE_FLASH
|
||||||
CORE_FLASH8,
|
CORE_FLASH8,
|
||||||
# ifdef ENABLE_FLASH16
|
# ifdef ENABLE_FLASH16
|
||||||
|
@ -53,6 +53,7 @@ static const char confMenuItem3[] PROGMEM = "4MB HiROM 64K SRAM";
|
|||||||
static const char confMenuItem4[] PROGMEM = "6MB ExROM 256K SRAM";
|
static const char confMenuItem4[] PROGMEM = "6MB ExROM 256K SRAM";
|
||||||
static const char* const menuOptionsConfManual[] PROGMEM = { confMenuItem1, confMenuItem2, confMenuItem3, confMenuItem4, FSTRING_RESET };
|
static const char* const menuOptionsConfManual[] PROGMEM = { confMenuItem1, confMenuItem2, confMenuItem3, confMenuItem4, FSTRING_RESET };
|
||||||
|
|
||||||
|
#if defined(ENABLE_FLASH)
|
||||||
// Repro menu items
|
// Repro menu items
|
||||||
static const char reproMenuItem1[] PROGMEM = "CFI LoROM";
|
static const char reproMenuItem1[] PROGMEM = "CFI LoROM";
|
||||||
static const char reproMenuItem2[] PROGMEM = "CFI HiROM";
|
static const char reproMenuItem2[] PROGMEM = "CFI HiROM";
|
||||||
@ -78,7 +79,6 @@ static const char* const menuOptionsReproEX[] PROGMEM = { reproEXItem1, reproEXI
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void setupCFI() {
|
void setupCFI() {
|
||||||
#ifdef ENABLE_FLASH
|
|
||||||
display_Clear();
|
display_Clear();
|
||||||
display_Update();
|
display_Update();
|
||||||
filePath[0] = '\0';
|
filePath[0] = '\0';
|
||||||
@ -89,12 +89,10 @@ void setupCFI() {
|
|||||||
identifyCFI_Flash();
|
identifyCFI_Flash();
|
||||||
sprintf(filePath, "%s/%s", filePath, fileName);
|
sprintf(filePath, "%s/%s", filePath, fileName);
|
||||||
display_Clear();
|
display_Clear();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*boolean reproEXMenu() {
|
/*boolean reproEXMenu() {
|
||||||
boolean fileOrder = 0;
|
boolean fileOrder = 0;
|
||||||
#ifdef ENABLE_FLASH
|
|
||||||
// create menu with title and 3 options to choose from
|
// create menu with title and 3 options to choose from
|
||||||
unsigned char snsReproEX;
|
unsigned char snsReproEX;
|
||||||
// Copy menuOptions out of progmem
|
// Copy menuOptions out of progmem
|
||||||
@ -113,7 +111,6 @@ void setupCFI() {
|
|||||||
resetArduino();
|
resetArduino();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return fileOrder;
|
return fileOrder;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
@ -128,7 +125,6 @@ void reproCFIMenu() {
|
|||||||
|
|
||||||
// wait for user choice to come back from the question box menu
|
// wait for user choice to come back from the question box menu
|
||||||
switch (snsReproCFI) {
|
switch (snsReproCFI) {
|
||||||
#ifdef ENABLE_FLASH
|
|
||||||
case 0:
|
case 0:
|
||||||
setupCFI();
|
setupCFI();
|
||||||
flashSize = 2097152;
|
flashSize = 2097152;
|
||||||
@ -244,20 +240,17 @@ void reproCFIMenu() {
|
|||||||
writeCFI_Flash(1, 1, reversed);
|
writeCFI_Flash(1, 1, reversed);
|
||||||
verifyFlash(1, 1, reversed);
|
verifyFlash(1, 1, reversed);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
resetArduino();
|
resetArduino();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_FLASH
|
|
||||||
// Prints string out of the common strings array either with or without newline
|
// Prints string out of the common strings array either with or without newline
|
||||||
print_STR(press_button_STR, 0);
|
print_STR(press_button_STR, 0);
|
||||||
display_Update();
|
display_Update();
|
||||||
wait();
|
wait();
|
||||||
resetArduino();
|
resetArduino();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SNES repro menu
|
// SNES repro menu
|
||||||
@ -270,7 +263,6 @@ void reproMenu() {
|
|||||||
|
|
||||||
// wait for user choice to come back from the question box menu
|
// wait for user choice to come back from the question box menu
|
||||||
switch (snsRepro) {
|
switch (snsRepro) {
|
||||||
#ifdef ENABLE_FLASH
|
|
||||||
case 0:
|
case 0:
|
||||||
// CFI LoROM
|
// CFI LoROM
|
||||||
mapping = 1;
|
mapping = 1;
|
||||||
@ -326,13 +318,13 @@ void reproMenu() {
|
|||||||
wait();
|
wait();
|
||||||
mode = CORE_FLASH8;
|
mode = CORE_FLASH8;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
resetArduino();
|
resetArduino();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// SNES start menu
|
// SNES start menu
|
||||||
void snsMenu() {
|
void snsMenu() {
|
||||||
|
Loading…
Reference in New Issue
Block a user