Skip to content

Commit ab78956

Browse files
committed
Wed 7 Aug 2019 17:10:55 EDT
1 parent 22efd79 commit ab78956

File tree

7 files changed

+57
-34
lines changed

7 files changed

+57
-34
lines changed

.DS_Store

0 Bytes
Binary file not shown.

Assets/retro-esp32/charge.gif

1.08 KB
Loading

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
Sprites
5353
*/
5454
#include "../sprites/battery.h"
55+
#include "../sprites/charge.h"
5556
#include "../sprites/characters.h"
5657
#include "../sprites/icons.h"
5758
#include "../sprites/logo.h"

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

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,29 @@ typedef struct{
5858
int bg;
5959
int fg;
6060
char name[10];
61-
int fix;
6261
} THEME;
6362
THEME THEMES[22] = {
64-
{32768,54580,"maroon",65535},
65-
{57545,62839,"red",65535},
66-
{64143,65049,"pink",65535},
67-
{39684,56918,"brown",65535},
68-
{62470,65174,"orange",35299},
69-
{50604,61240,"apricot",25254},
70-
{33792,54932,"olive",65535},
71-
{65283,65461,"yellow",64386},
72-
{60845,63289,"beige",33446},
73-
{49000,59351,"lime",23556},
74-
{15753,48951,"green",65535},
75-
{45048,57340,"mint",22507},
76-
{17617,48858,"teal",65535},
77-
{18078,49023,"cyan",9009},
78-
{14,42297,"navy",65535},
79-
{17178,48733,"blue",65535},
80-
{37110,54652,"purple",65535},
81-
{52318,61119,"lavender",65535},
82-
{59804,62910,"magenta",32974},
83-
{0,42292,"black",65535},
84-
{16936,48631,"dark",65535},
85-
{29614,52857,"light",65535}
63+
{32768,54580,"maroon"},
64+
{57545,62839,"red"},
65+
{64143,65049,"pink"},
66+
{39684,56918,"brown"},
67+
{62470,65174,"orange"},
68+
{50604,61240,"apricot"},
69+
{33792,54932,"olive"},
70+
{65283,65461,"yellow"},
71+
{60845,63289,"beige"},
72+
{49000,59351,"lime"},
73+
{15753,48951,"green"},
74+
{45048,57340,"mint"},
75+
{17617,48858,"teal"},
76+
{18078,49023,"cyan"},
77+
{14,42297,"navy"},
78+
{17178,48733,"blue"},
79+
{37110,54652,"purple"},
80+
{52318,61119,"lavender"},
81+
{59804,62910,"magenta"},
82+
{0,42292,"black"},
83+
{16936,48631,"dark"},
84+
{29614,52857,"light"}
8685
};
8786
THEME GUI;

Launchers/retro-esp32/main/main.c

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
ili9341_prepare();
111111
ili9341_clear(0);
112112

113-
printf("==============\n%s\n==============\n", "RETRO ESP32");
113+
//printf("==============\n%s\n==============\n", "RETRO ESP32");
114114
switch(esp_reset_reason()) {
115115
case ESP_RST_POWERON:
116116
RESTART = false;
@@ -164,10 +164,10 @@
164164
STEP = 0;
165165
}
166166
nvs_close(handle);
167-
printf("\nGet nvs_get_i8:%d\n", STEP);
167+
//printf("\nGet nvs_get_i8:%d\n", STEP);
168168
}
169169
void set_step_state() {
170-
printf("\nGet nvs_set_i8:%d\n", STEP);
170+
//printf("\nGet nvs_set_i8:%d\n", STEP);
171171
nvs_handle handle;
172172
nvs_open("storage", NVS_READWRITE, &handle);
173173
nvs_set_i8(handle, "STEP", STEP);
@@ -196,10 +196,10 @@
196196
ROMS.offset = 0;
197197
}
198198
nvs_close(handle);
199-
printf("\nGet nvs_get_i16:%d\n", ROMS.offset);
199+
//printf("\nGet nvs_get_i16:%d\n", ROMS.offset);
200200
}
201201
void set_list_state() {
202-
printf("\nSet nvs_set_i16:%d", ROMS.offset);
202+
//printf("\nSet nvs_set_i16:%d", ROMS.offset);
203203
nvs_handle handle;
204204
nvs_open("storage", NVS_READWRITE, &handle);
205205
nvs_set_i16(handle, "LAST", ROMS.offset);
@@ -346,7 +346,7 @@
346346
if(x > 0 && x < 288) {
347347
for(int r = 0; r < 32; r++) {
348348
for(int c = 0; c < 32; c++) {
349-
buffer[i] = SYSTEMS[e].system[r][c] == WHITE ? WHITE : GUI.bg;
349+
buffer[i] = SYSTEMS[e].system[r][c] == WHITE ? WHITE : GUI.bg;
350350
i++;
351351
}
352352
}
@@ -390,20 +390,33 @@
390390
x += 2;
391391
y += 6;
392392
w = percentage > 0 ? percentage > 10 ? 10 : percentage : 10;
393-
printf("\nbattery_state.percentage:%d\n(percentage):%d\n", battery_state.percentage, percentage);
393+
printf("\nbattery_state.percentage:%d\n(percentage):%d\n(millivolts)%d\n", battery_state.percentage, percentage, battery_state.millivolts);
394394
h = 4;
395395
i = 0;
396396

397397
int color[11] = {24576,24576,64288,64288,65504,65504,65504,26592,26592,26592,26592};
398398

399-
399+
int fill = color[w];
400400
for(int c = 0; c < h; c++) {
401401
for(int n = 0; n <= w; n++) {
402-
buffer[i] = color[w];
402+
buffer[i] = fill;
403403
i++;
404404
}
405405
}
406406
ili9341_write_frame_rectangleLE(x, y, w, h, buffer);
407+
408+
/*
409+
if(battery_state.millivolts > 4200) {
410+
i = 0;
411+
for(h = 0; h < 5; h++) {
412+
for(w = 0; w < 3; w++) {
413+
buffer[i] = charge[h][w] == WHITE ? WHITE : fill;
414+
i++;
415+
}
416+
}
417+
ili9341_write_frame_rectangleLE(x+4, y, 3, 5, buffer);
418+
}
419+
*/
407420
#endif
408421
}
409422

@@ -578,17 +591,19 @@
578591
}
579592

580593
void draw_files() {
581-
printf("\n");
594+
//printf("\n");
582595
int x = ORIGIN.x;
583596
int y = POS.y + 48;
584597
int game = ROMS.offset ;
585598
ROMS.page = ROMS.offset/ROMS.limit;
586599

600+
/*
587601
printf("\nROMS.offset:%d", ROMS.offset);
588602
printf("\nROMS.limit:%d", ROMS.limit);
589603
printf("\nROMS.total:%d", ROMS.total);
590604
printf("\nROMS.page:%d", ROMS.page);
591605
printf("\nROMS.pages:%d", ROMS.pages);
606+
*/
592607

593608
for (int i = 0; i < 4; i++) draw_mask(0, y+(i*40)-6, 320, 40);
594609

@@ -854,7 +869,7 @@
854869
tmp[strlen(tmp)-4] = '\0';
855870
gets(tmp);
856871
if(strcmp(ROM.name, tmp) == 0) {
857-
printf("\nDIRECTORIES[STEP]:%s ROM.name:%s tmp:%s",DIRECTORIES[STEP], ROM.name, tmp);
872+
//printf("\nDIRECTORIES[STEP]:%s ROM.name:%s tmp:%s",DIRECTORIES[STEP], ROM.name, tmp);
858873
struct stat st;
859874
if (stat(file_to_delete, &st) == 0) {
860875
unlink(file_to_delete);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const uint16_t charge[5][3] = {
2+
{0,0,65535},
3+
{0,65535,0},
4+
{65535,65535,65535},
5+
{0,65535,0},
6+
{65535,0,0},
7+
8+
};

SD Card/SDCARD.zip

39.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)