mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-23 21:19:16 +01:00
N64.ino: Build eeprom path and file name with snprintf_P
So the format string is stored in flash rather than in ram. The gain from doing just one like this is not much, to be done in more places.
This commit is contained in:
parent
a43b2553cd
commit
d9daadb1f9
@ -50,6 +50,9 @@ String CRC1 = "";
|
|||||||
String CRC2 = "";
|
String CRC2 = "";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static const char N64_EEP_FILENAME_FMT[] PROGMEM = "%s.eep";
|
||||||
|
static const char N64_SAVE_DIRNAME_FMT[] PROGMEM = "N64/SAVE/%s/%d";
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
Menu
|
Menu
|
||||||
*****************************************/
|
*****************************************/
|
||||||
@ -2687,12 +2690,11 @@ void writeEeprom() {
|
|||||||
void readEeprom() {
|
void readEeprom() {
|
||||||
if ((saveType == 5) || (saveType == 6)) {
|
if ((saveType == 5) || (saveType == 6)) {
|
||||||
// Get name, add extension and convert to char array for sd lib
|
// Get name, add extension and convert to char array for sd lib
|
||||||
strcpy(fileName, romName);
|
snprintf_P(fileName, sizeof(fileName), N64_EEP_FILENAME_FMT, romName);
|
||||||
strcat(fileName, ".eep");
|
|
||||||
|
|
||||||
// create a new folder for the save file
|
// create a new folder for the save file
|
||||||
EEPROM_readAnything(0, foldern);
|
EEPROM_readAnything(0, foldern);
|
||||||
sprintf(folder, "N64/SAVE/%s/%d", romName, foldern);
|
snprintf_P(folder, sizeof(folder), N64_SAVE_DIRNAME_FMT, romName, foldern);
|
||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user