Skip to content

Commit

Permalink
Remove more co-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni committed Aug 16, 2024
1 parent ac6e606 commit 0d60272
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 17 deletions.
6 changes: 3 additions & 3 deletions Cart_Reader/Cart_Reader.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ static const char* const modeOptions[] PROGMEM = {
#ifdef ENABLE_VSMILE
modeItem40,
#endif
#ifdef ENABLE_FLASH
#ifdef ENABLE_FLASH8
modeItem41,
#endif
#ifdef ENABLE_SELFTEST
Expand Down Expand Up @@ -1564,7 +1564,7 @@ void mainMenu() {
break;
#endif

#ifdef ENABLE_FLASH
#ifdef ENABLE_FLASH8
case SYSTEM_MENU_FLASH:
#ifdef ENABLE_VSELECT
setup_FlashVoltage();
Expand Down Expand Up @@ -3708,7 +3708,7 @@ void loop() {
case CORE_GB_GBSMART_GAME: return gbSmartGameOptions();
#endif
#endif
#ifdef ENABLE_FLASH
#ifdef ENABLE_FLASH8
case CORE_FLASH8: return flashromMenu8();
#ifdef ENABLE_FLASH16
case CORE_FLASH16: return flashromMenu16();
Expand Down
21 changes: 14 additions & 7 deletions Cart_Reader/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,18 @@

/****/

/* [ Flashrom Programmer for repro carts -------------------------- ]
/* [ Flash Repros (all systems, SNES repro also needs FLASH8)------ ]
*/

//#define ENABLE_FLASH
//#define ENABLE_FLASH16
//#define ENABLE_FLASH

/****/

/* [ Flashrom Programmer Menu & SNES Repros------------------------ ]
*/

//#define ENABLE_FLASH8
//#define ENABLE_FLASH16

/****/

Expand Down Expand Up @@ -279,28 +286,28 @@

/****/

/* [ Super Famicom SF Memory Cassette ----------------------------- ]
/* [ Super Famicom SF Memory Cassette (needs ENABLE_SNES)---------- ]
*/

//#define ENABLE_SFM

/****/

/* [ Super Famicom Satellaview ------------------------------------ ]
/* [ Super Famicom Satellaview (needs ENABLE_SNES)----------------- ]
*/

//#define ENABLE_SV

/****/

/* [ Super Famicom Sufami Turbo ----------------------------------- ]
/* [ Super Famicom Sufami Turbo (needs ENABLE_SNES)---------------- ]
*/

//#define ENABLE_ST

/****/

/* [ Super Famicom Game Processor RAM Cassette -------------------- ]
/* [ Super Famicom Game Processor RAM Cassette (needs ENABLE_SNES)- ]
*/

//#define ENABLE_GPC
Expand Down
4 changes: 2 additions & 2 deletions Cart_Reader/FLASH.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// FLASHROM MODULE
// (also includes SNES repro functions)
//******************************************
#ifdef ENABLE_FLASH
#ifdef ENABLE_FLASH8

/******************************************
Variables
Expand Down Expand Up @@ -2842,7 +2842,7 @@ void identifyCFI_Flash() {
flashSwitchLastBits = true;
} else {
// Try x16 mode next
startCFIMode(true);
startCFIMode_Flash(true);
sprintf(cfiQRYx16, "%02X%02X%02X", readByte_Flash(0x10), readByte_Flash(0x11), readByte_Flash(0x12));
if (strcmp(cfiQRYx16, "515259") == 0) { // QRY in x16 mode
println_Msg(F("Normal CFI x16 Mode"));
Expand Down
4 changes: 4 additions & 0 deletions Cart_Reader/MD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ word addrlo;
word chksum;
boolean is32x = 0;
boolean isSVP = 0;
#if (!defined(ENABLE_FLASH8) && defined(ENABLE_FLASH))
unsigned long flashSize;
unsigned long blank;
#endif

//***********************************************
// EEPROM SAVE TYPES
Expand Down
2 changes: 1 addition & 1 deletion Cart_Reader/N64.ino
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ String CRC1 = "";
String CRC2 = "";
#endif

#if !defined(ENABLE_FLASH)
#if (!defined(ENABLE_FLASH8) && !(defined(ENABLE_MD) && defined(ENABLE_FLASH)))
unsigned long flashSize;
#endif

Expand Down
4 changes: 2 additions & 2 deletions Cart_Reader/OSCR.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ enum CORES: uint8_t {
CORE_GB_GBSMART_GAME,
# endif
# endif
# ifdef ENABLE_FLASH
# ifdef ENABLE_FLASH8
CORE_FLASH8,
# ifdef ENABLE_FLASH16
CORE_FLASH16,
Expand Down Expand Up @@ -393,7 +393,7 @@ enum SYSTEM_MENU: uint8_t {
# if defined(ENABLE_VSMILE)
SYSTEM_MENU_VSMILE,
# endif
# if defined(ENABLE_FLASH)
# if defined(ENABLE_FLASH8)
SYSTEM_MENU_FLASH,
# endif
# if defined(ENABLE_SELFTEST)
Expand Down
4 changes: 2 additions & 2 deletions Cart_Reader/SNES.ino
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static const char confMenuItem3[] PROGMEM = "4MB HiROM 64K SRAM";
static const char confMenuItem4[] PROGMEM = "6MB ExROM 256K SRAM";
static const char* const menuOptionsConfManual[] PROGMEM = { confMenuItem1, confMenuItem2, confMenuItem3, confMenuItem4, FSTRING_RESET };

#if defined(ENABLE_FLASH)
#if (defined(ENABLE_FLASH) && defined(ENABLE_FLASH8))
// Repro menu items
static const char reproMenuItem1[] PROGMEM = "CFI LoROM";
static const char reproMenuItem2[] PROGMEM = "CFI HiROM";
Expand Down Expand Up @@ -371,7 +371,7 @@ void snsMenu() {
break;
#endif

#ifdef ENABLE_FLASH
#if (defined(ENABLE_FLASH) && defined(ENABLE_FLASH8))
case 5:
setup_FlashVoltage();
reproMenu();
Expand Down

0 comments on commit 0d60272

Please sign in to comment.