Skip to content

Commit 6b24c10

Browse files
committed
Wed May 20 10:12:43 EDT 2020 - added indicator bars for volume and brightness in HUD (current NES/GB/GBC/SMS)
1 parent 80b9b66 commit 6b24c10

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

Components/retro-go/components/odroid/odroid_hud.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,43 @@ const uint16_t icons[55][5] = {
425425
}
426426
}
427427

428+
429+
void hud_bar(int x, int y, int percent, bool active) {
430+
int w, h;
431+
432+
int i = 0;
433+
for(h = 0; h < 7; h++) {
434+
for(w = 0; w < 100; w++) {
435+
buffer[i] = (w+h)%2 == 0 ? GUI.fg : GUI.bg;
436+
i++;
437+
}
438+
}
439+
ili9341_write_frame_rectangleLE(x, y, 100, 7, buffer);
440+
441+
i = 0;
442+
for(h = 0; h < 7; h++) {
443+
for(w = 0; w < percent; w++) {
444+
buffer[i] = active ? GUI.hl : GUI.fg;
445+
i++;
446+
}
447+
}
448+
ili9341_write_frame_rectangleLE(x, y, percent, 7, buffer);
449+
}
450+
451+
void hud_volume() {
452+
// y=176;
453+
int LIMIT = OPTIONS - 3;
454+
bool active = OPTION == LIMIT ? true : false;
455+
hud_bar((SCREEN.w - 120), 176, 50, active);
456+
}
457+
458+
void hud_brightness() {
459+
// y=176;
460+
int LIMIT = OPTIONS - 2;
461+
bool active = OPTION == LIMIT ? true : false;
462+
hud_bar((SCREEN.w - 120), 196, 25, active);
463+
}
464+
428465
void hud_options() {
429466
x = 16;
430467
y = 28;
@@ -475,6 +512,9 @@ const uint16_t icons[55][5] = {
475512
STATE = EXTRAS[OPTION-LIMIT];
476513
}
477514
printf("\n**********\n%s - %d:%d\n**********\n", STATE.label, OPTION, LIMIT);
515+
516+
hud_volume();
517+
hud_brightness();
478518
}
479519
//}#pragma endregion Display
480520

Components/retro-go/components/odroid/odroid_hud.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@ void hud_menu();
4848
*/
4949
void hud_logo(void);
5050
void hud_progress(char *string, bool bar);
51+
void hud_bar(int x, int y, int percent, bool active);
52+
void hud_volume();
53+
void hud_brightness();
5154
void hud_options();

0 commit comments

Comments
 (0)