Skip to content

Commit ace614a

Browse files
committed
Thu Jun 25 14:09:51 EDT 2020 - working on next features
1 parent e8f8c17 commit ace614a

File tree

5 files changed

+78
-6
lines changed

5 files changed

+78
-6
lines changed

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@
4242
path = Emulators/retro-go
4343
url = git@github.com:ducalex/retro-go.git
4444
branch = master
45+

Launchers/retro-esp32/main/includes/declarations.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ void delete_numbers();
8989
void draw_launcher();
9090
void draw_launcher_options();
9191

92+
9293
/*
9394
Files
9495
*/
@@ -99,6 +100,13 @@ void sort_files(char** files);
99100
void draw_files();
100101
void has_save_file(char *save_name);
101102

103+
/*
104+
File Manager
105+
*/
106+
void create_games_file(char *emulator);
107+
void read_games_file(char *emulator);
108+
void add_games(char *emulator, char *game);
109+
102110
/*
103111
Favorites
104112
*/

Launchers/retro-esp32/main/main.c

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,8 @@
11821182
if(extenstion || (file->d_type == 2)) {
11831183
SEEK[ROMS.total+1] = telldir(directory);
11841184
ROMS.total++;
1185+
1186+
//add_games(EXTENSIONS[STEP], file->d_name);
11851187
}
11861188
}
11871189
free(file);
@@ -1194,6 +1196,8 @@
11941196
for(int n = 0; n < ROMS.total; n++) {
11951197
// printf("\nSEEK[%d]:%d ", n, SEEK[n]);
11961198
}
1199+
1200+
11971201
}
11981202

11991203
// printf("\n---------------------\n");
@@ -1279,6 +1283,7 @@
12791283
}
12801284

12811285
void get_files() {
1286+
//create_games_file(DIRECTORIES[STEP]);
12821287
delete_numbers();
12831288
count_files();
12841289
seek_files();
@@ -1351,6 +1356,64 @@
13511356
}
13521357
//}#pragma endregion Files
13531358

1359+
//{#pragma region File Manager
1360+
char** GAMES;
1361+
void create_games_file(char *emulator) {
1362+
printf("\n----- %s(%s) START -----", __func__, emulator);
1363+
char file[256] = "/sd/odroid/data";
1364+
sprintf(file, "%s/%s", file, RETROESP_FOLDER);
1365+
sprintf(file, "%s/%s.txt", file, emulator);
1366+
1367+
struct stat st; if (stat(file, &st) == 0) {unlink(file);}
1368+
1369+
FILE *f;
1370+
f = fopen(file, "rb");
1371+
if(f == NULL) {
1372+
f = fopen(file, "w+");
1373+
// printf("\nCREATING: %s", file);
1374+
} else {
1375+
read_favorites();
1376+
}
1377+
// printf("\nCLOSING: %s", file);
1378+
fclose(f);
1379+
printf("\n----- %s END -----", __func__);
1380+
}
1381+
1382+
void read_games_file(char *emulator) {
1383+
printf("\n----- %s START -----", __func__);
1384+
char file[256] = "/sd/odroid/data";
1385+
sprintf(file, "%s/%s", file, RETROESP_FOLDER);
1386+
sprintf(file, "%s/%s.txt", file, emulator);
1387+
1388+
FILE *f;
1389+
f = fopen(file, "rb");
1390+
if(f) {
1391+
// printf("\nREADING: %s\n", file);
1392+
char line[256];
1393+
while (fgets(line, sizeof(line), f)) {
1394+
char *ep = &line[strlen(line)-1];
1395+
while (*ep == '\n' || *ep == '\r'){*ep-- = '\0';}
1396+
printf("\n%s", line);
1397+
}
1398+
}
1399+
fclose(f);
1400+
1401+
printf("\n----- %s END -----", __func__);
1402+
}
1403+
1404+
void add_games(char *emulator, char *game) {
1405+
printf("\n----- %s START -----", __func__);
1406+
1407+
char file[256] = "/sd/odroid/data";
1408+
sprintf(file, "%s/%s", file, RETROESP_FOLDER);
1409+
sprintf(file, "%s/%s.txt", file, emulator);
1410+
1411+
printf("%s\n", game);
1412+
1413+
printf("\n----- %s END -----", __func__);
1414+
}
1415+
//}#pragma endregion File Manager
1416+
13541417
//{#pragma region Favorites
13551418
void create_favorites() {
13561419
// printf("\n----- %s START -----", __func__);

Launchers/retro-esp32/sdkconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CONFIG_FLASH_ENCRYPTION_ENABLED=
3838
#
3939
# Serial flasher config
4040
#
41-
CONFIG_ESPTOOLPY_PORT="/dev/cu.usbserial-AB0JESEM"
41+
CONFIG_ESPTOOLPY_PORT="/dev/cu.SLAB_USBtoUART"
4242
CONFIG_ESPTOOLPY_BAUD_115200B=
4343
CONFIG_ESPTOOLPY_BAUD_230400B=
4444
CONFIG_ESPTOOLPY_BAUD_921600B=

Launchers/retro-esp32/sdkconfig.old

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CONFIG_FLASH_ENCRYPTION_ENABLED=
3838
#
3939
# Serial flasher config
4040
#
41-
CONFIG_ESPTOOLPY_PORT="/dev/cu.usbserial-AB0JESEM"
41+
CONFIG_ESPTOOLPY_PORT="/dev/cu.SLAB_USBtoUART "
4242
CONFIG_ESPTOOLPY_BAUD_115200B=
4343
CONFIG_ESPTOOLPY_BAUD_230400B=
4444
CONFIG_ESPTOOLPY_BAUD_921600B=
@@ -83,10 +83,10 @@ CONFIG_MONITOR_BAUD=115200
8383
#
8484
# Retro ESP32 Configuration
8585
#
86-
CONFIG_LCD_DRIVER_CHIP_ODROID_GO=
87-
CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32=y
88-
CONFIG_DEFAULT_MENU_KEY=
89-
CONFIG_COMBO_MENU_KEY=y
86+
CONFIG_LCD_DRIVER_CHIP_ODROID_GO=y
87+
CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32=
88+
CONFIG_DEFAULT_MENU_KEY=y
89+
CONFIG_COMBO_MENU_KEY=
9090

9191
#
9292
# Partition Table

0 commit comments

Comments
 (0)