just some clean up

too tired to do more
This commit is contained in:
Shaun Inman 2023-03-06 22:17:20 -05:00
parent e914446328
commit ee5ef3a64d
3 changed files with 26 additions and 30 deletions

View file

@ -98,6 +98,8 @@ int GetBrightness(void) { // 0-10
return settings->brightness;
}
void SetBrightness(int value) {
if (settings->hdmi) return;
int raw;
switch (value) {
case 0: raw=16; break; // 0
@ -130,15 +132,14 @@ void SetVolume(int value) {
}
void SetRawBrightness(int val) { // 0 - 1024
if (settings->hdmi) return;
// printf("SetRawBrightness(%i)\n", val); fflush(stdout);
int fd = open(BRIGHTNESS_PATH, O_WRONLY);
if (fd>=0) {
dprintf(fd,"%d",val);
close(fd);
}
// this prevents exiting/launching from turning the screen back on
// SetHDMI(GetHDMI()); // TODO: isn't working
}
void SetRawVolume(int val) { // 0 - 40
int fd = open(VOLUME_PATH, O_WRONLY);
@ -157,18 +158,9 @@ void SetJack(int value) {
settings->jack = value;
SetVolume(GetVolume());
// TODO: tmp, testing hdmi without an hdmi output
// int fd = open(BACKLIGHT_PATH, O_WRONLY);
// if (fd>=0) {
// dprintf(fd,"%d",value ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK);
// close(fd);
// }
}
int GetHDMI(void) {
// TODO: tmp, testing hdmi without an hdmi output
// return settings->jack;
// printf("GetHDMI() %i\n", settings->hdmi); fflush(stdout);
return settings->hdmi;
}

View file

@ -594,22 +594,6 @@ enum {
#define LOCAL_BUTTON_COUNT 14
#define RETRO_BUTTON_COUNT 16 // allow L3/R3 to be remapped by user if desired, eg. Virtual Boy uses extra buttons for right d-pad
static const char* device_button_names[LOCAL_BUTTON_COUNT] = {
[BTN_ID_UP] = "UP",
[BTN_ID_DOWN] = "DOWN",
[BTN_ID_LEFT] = "LEFT",
[BTN_ID_RIGHT] = "RIGHT",
[BTN_ID_SELECT] = "SELECT",
[BTN_ID_START] = "START",
[BTN_ID_Y] = "Y",
[BTN_ID_X] = "X",
[BTN_ID_B] = "B",
[BTN_ID_A] = "A",
[BTN_ID_L1] = "L1",
[BTN_ID_R1] = "R1",
[BTN_ID_L2] = "L2",
[BTN_ID_R2] = "R2",
};
typedef struct ButtonMapping {
char* name;
@ -661,6 +645,24 @@ static ButtonMapping button_label_mapping[] = { // used to lookup the retro_id a
};
static ButtonMapping core_button_mapping[RETRO_BUTTON_COUNT+1] = {0};
static const char* device_button_names[LOCAL_BUTTON_COUNT] = {
[BTN_ID_UP] = "UP",
[BTN_ID_DOWN] = "DOWN",
[BTN_ID_LEFT] = "LEFT",
[BTN_ID_RIGHT] = "RIGHT",
[BTN_ID_SELECT] = "SELECT",
[BTN_ID_START] = "START",
[BTN_ID_Y] = "Y",
[BTN_ID_X] = "X",
[BTN_ID_B] = "B",
[BTN_ID_A] = "A",
[BTN_ID_L1] = "L1",
[BTN_ID_R1] = "R1",
[BTN_ID_L2] = "L2",
[BTN_ID_R2] = "R2",
};
// NOTE: these must be in BTN_ID_ order also off by 1 because of NONE (which is -1 in BTN_ID_ land)
static char* button_labels[] = {
"NONE", // displayed by default