Skip to content

Commit e732cb5

Browse files
committed
Rebranding
1 parent f965f64 commit e732cb5

File tree

2 files changed

+41
-31
lines changed

2 files changed

+41
-31
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ void has_save_file(char *name);
5959
*/
6060
void animate(int dir);
6161
void restore_layout();
62+
void clean_up();
6263

6364
/*
6465
Boot Screens

Launchers/retro-esp32/main/main.c

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -631,18 +631,20 @@
631631
//}#pragma endregion Files
632632

633633
//{#pragma region Animations
634-
void animate(int dir) {
634+
void animate(int dir) {
635635
int y = POS.y + 46;
636636
for (int i = 0; i < 4; i++) draw_mask(0, y+(i*40)-6, 320, 40);
637637
int sx[4][13] = {
638638
{8,8,4,4,4,3,3,3,3,2,2,2,2}, // 48
639639
{30,26,20,20,18,18,16,16,12,12,8,8,4} // 208 30+26+20+20+18+18+16+16+12+12+8+8+4
640-
};
640+
};
641641
for(int i = 0; i < 13; i++) {
642642
if(dir == -1) {
643643
// LEFT
644644
for(int e = 0; e < COUNT; e++) {
645-
SYSTEMS[e].x += STEP == (e-1) ? sx[1][i] : sx[0][i];
645+
SYSTEMS[e].x += STEP != COUNT - 1 ?
646+
STEP == (e-1) ? sx[1][i] : sx[0][i] :
647+
e == 0 ? sx[1][i] : sx[0][i] ;
646648
}
647649
} else {
648650
// RIGHT
@@ -651,11 +653,14 @@
651653
}
652654
}
653655
draw_mask(0,32,320,32);
656+
654657
draw_systems();
658+
usleep(20000);
655659
}
656660
draw_mask(0,0,SCREEN.w - 32,32);
657661
draw_text(16,16,EMULATORS[STEP], false, true);
658662
STEP == 0 ? draw_themes() : get_files();
663+
clean_up();
659664
}
660665

661666
void restore_layout() {
@@ -686,44 +691,45 @@
686691
SYSTEMS[n].x = GAP/3+NEXT+(GAP*(delta-1));
687692
}
688693
}
689-
690694
draw_systems();
691695
draw_text(16,16,EMULATORS[STEP],false,true);
692-
STEP == 0 ? draw_themes() : get_files();
696+
STEP == 0 ? draw_themes() : get_files();
697+
clean_up();
693698
}
699+
700+
void clean_up() {
701+
int inc = 0;
702+
for(int n = 0; n < COUNT; n++) {
703+
int delta = (n-STEP);
704+
if(SYSTEMS[n].x > 464) {
705+
SYSTEMS[n].x -= 736;
706+
}
707+
if(SYSTEMS[n].x <= -272) {
708+
SYSTEMS[n].x += 736;
709+
}
710+
}
711+
}
712+
694713
//}#pragma endregion Animations
695714

696715
//{#pragma region Boot Screens
697716
void splash() {
698717
draw_background();
699-
sleep(1);
700718
int w = 128;
701719
int h = 18;
702720
int x = (SCREEN.w/2)-(w/2);
703721
int y = (SCREEN.h/2)-(h/2);
704722
int i = 0;
705723
for(int r = 0; r < h; r++) {
706-
i = 0;
707724
for(int c = 0; c < w; c++) {
708725
buffer[i] = logo[r][c] == 0 ? GUI.bg : GUI.fg;
709726
i++;
710-
}
711-
ili9341_write_frame_rectangleLE(x, y+r, w, 1, buffer);
712-
usleep(10000);
727+
}
713728
}
729+
ili9341_write_frame_rectangleLE(x, y, w, h, buffer);
714730

715731
sleep(2);
716-
717-
for(int r = 0; r < h; r++) {
718-
i = 0;
719-
for(int c = 0; c < w; c++) {
720-
buffer[i] = GUI.bg;
721-
i++;
722-
}
723-
ili9341_write_frame_rectangleLE(x, y+r, w, 1, buffer);
724-
usleep(10000);
725-
}
726-
sleep(1);
732+
draw_background();
727733
}
728734

729735
void boot() {
@@ -879,11 +885,13 @@
879885
if(gamepad.values[ODROID_INPUT_LEFT]) {
880886
if(!LAUNCHER) {
881887
STEP--;
882-
if( STEP < 0 ) { STEP = 0; } else {
883-
ROMS.offset = 0;
884-
ROMS.total = 0;
885-
animate(-1);
886-
}
888+
if( STEP < 0 ) {
889+
STEP = COUNT - 1;
890+
}
891+
892+
ROMS.offset = 0;
893+
ROMS.total = 0;
894+
animate(-1);
887895
}
888896
debounce(ODROID_INPUT_LEFT);
889897
}
@@ -893,11 +901,12 @@
893901
if(gamepad.values[ODROID_INPUT_RIGHT]) {
894902
if(!LAUNCHER) {
895903
STEP++;
896-
if( STEP > COUNT-1 ) { STEP = COUNT-1; } else {
897-
ROMS.offset = 0;
898-
ROMS.total = 0;
899-
animate(1);
900-
}
904+
if( STEP > COUNT-1 ) {
905+
STEP = 0;
906+
}
907+
ROMS.offset = 0;
908+
ROMS.total = 0;
909+
animate(1);
901910
}
902911
debounce(ODROID_INPUT_RIGHT);
903912
}

0 commit comments

Comments
 (0)