Skip to content

Commit eaf0095

Browse files
committed
Tue 25 Feb 2020 17:10:04 EST
1 parent 796dc20 commit eaf0095

File tree

9 files changed

+167
-113
lines changed

9 files changed

+167
-113
lines changed

.DS_Store

0 Bytes
Binary file not shown.

Assets/retro-esp32/systems/fav.gif

1.16 KB
Loading
1.2 KB
Loading

Components/odroid-go-spectrum-emulator/main/main.c

Lines changed: 74 additions & 74 deletions
Large diffs are not rendered by default.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ void sort_files(char** files);
9595
void draw_files();
9696
void has_save_file(char *save_name);
9797

98+
/*
99+
Favorites
100+
*/
101+
void has_fav_file();
102+
103+
98104
/*
99105
Cover
100106
*/

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

Lines changed: 44 additions & 36 deletions
Large diffs are not rendered by default.

Launchers/retro-esp32/main/main.c

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130

131131
// SD
132132
odroid_sdcard_open("/sd");
133+
has_fav_file();
133134

134135
// Theme
135136
get_theme();
@@ -930,7 +931,7 @@
930931
}}
931932
ili9341_write_frame_rectangleLE(x, y, w, h, buffer);
932933
draw_text(x+10,y,"Restart",false,OPTION == 1?true:false, false);
933-
// restart
934+
// delete
934935
i = 0;
935936
y+=20;
936937
offset = 20;
@@ -1223,6 +1224,43 @@
12231224
}
12241225
//}#pragma endregion Files
12251226

1227+
//{#pragma region Favorites
1228+
void handle_line(char *line) {
1229+
printf("\n%s\n", line);
1230+
}
1231+
1232+
void has_fav_file() {
1233+
printf("\n----- %s -----\n", __func__);
1234+
char file[256] = "/sd/odroid/data";
1235+
sprintf(file, "%s/%s", file, "retro_esp32.txt");
1236+
1237+
FILE *f;
1238+
f = fopen(file, "rb");
1239+
if(f == NULL) {
1240+
f = fopen(file, "wb");
1241+
fprintf(f, "Favorites List");
1242+
} else {
1243+
int size = 1024, pos;
1244+
int c;
1245+
char *buffer = (char *)malloc(size);
1246+
do { // read all lines in file
1247+
pos = 0;
1248+
do{ // read one line
1249+
c = fgetc(f);
1250+
if(c != EOF) buffer[pos++] = (char)c;
1251+
if(pos >= size - 1) { // increase buffer length - leave room for 0
1252+
size *=2;
1253+
buffer = (char*)realloc(buffer, size);
1254+
}
1255+
} while(c != EOF && c != '\n');
1256+
buffer[pos] = 0;
1257+
handle_line(buffer);
1258+
} while(c != EOF);
1259+
}
1260+
fclose(f);
1261+
}
1262+
//}#pragma endregion Favorites
1263+
12261264
//{#pragma region Cover
12271265
void get_cover() {
12281266
preview_cover(false);

Launchers/retro-esp32/main/sprites/media.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ const uint16_t media_color[32][176] = {
5050
{0,33808,29582,29582,29582,29582,33808,33808,33808,33808,33808,33808,33808,33808,33808,0,29614,33808,46486,30720,30720,30720,30720,30720,30720,30720,30720,30720,30720,46486,33808,29614,0,35953,9225,11351,11351,11351,11351,11351,11351,11351,11351,11351,11351,11351,9225,35953,6339,6339,6339,6339,6339,4194,4194,4194,4194,4194,4194,6339,6339,6339,6339,6339,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6339,6339,62658,62658,62658,62658,62658,62658,62658,62658,62658,62658,62658,62658,6339,6339,6339,40147,40147,40147,40147,40147,40147,40147,40147,40147,40147,40147,40147,40147,40147,6339,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,0,59196,59196,59196,59196,59196,54938,54938,54938,54938,59196,59196,59196,59196,59196,0},
5151
{0,33808,25388,25388,25388,25388,33808,33808,33808,33808,33808,33808,33808,33808,33808,0,29614,33808,33808,33808,33808,33808,33808,29582,29582,33808,33808,33808,33808,33808,33808,29614,0,35953,9225,11351,11351,11351,11351,11351,11351,11351,11351,11351,11351,11351,9225,35953,6339,6339,6339,6339,6339,4194,4194,4194,4194,4194,4194,6339,6339,6339,6339,6339,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,40147,40147,40147,40147,40147,40147,40147,40147,40147,40147,40147,40147,40147,40147,6339,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,0,59196,59196,59196,59196,59196,54938,54938,54938,54938,59196,59196,59196,59196,59196,0},
5252
{0,33808,29582,29582,29582,29582,33808,33808,33808,33808,33808,33808,33808,33808,33808,0,29614,33808,33808,33808,33808,33808,33808,29582,29582,33808,33808,33808,33808,33808,33808,29614,0,35953,9225,9225,9225,9225,9225,9225,9225,9225,9225,9225,9225,9225,9225,35953,6339,6339,6339,6339,6339,4194,4194,4194,4194,4194,4194,6339,6339,6339,6339,6339,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,10533,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,6339,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,41993,4226,0,0,59196,59196,59196,59196,59196,59196,59196,59196,59196,59196,59196,59196,0,0},
53-
};
53+
};

Launchers/retro-esp32/main/sprites/systems.h

Lines changed: 3 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)