diff --git a/core/embed/unix/common.c b/core/embed/unix/common.c index 6f4c7ee358..0f2543615e 100644 --- a/core/embed/unix/common.c +++ b/core/embed/unix/common.c @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -31,6 +32,7 @@ #include "memzero.h" extern void main_clean_exit(); +extern float DISPLAY_GAMMA; void __attribute__((noreturn)) __shutdown(void) { printf("SHUTDOWN\n"); @@ -146,6 +148,14 @@ static int SDLCALL emulator_event_filter(void *userdata, SDL_Event *event) { case SDLK_p: display_save("emu"); return 0; + case SDLK_LEFT: + DISPLAY_GAMMA = fmaxf(0.0f, DISPLAY_GAMMA - 0.05f); + printf("DISPLAY_GAMMA: %0.2f\n", DISPLAY_GAMMA); + return 0; + case SDLK_RIGHT: + DISPLAY_GAMMA = fminf(8.0f, DISPLAY_GAMMA + 0.05f); + printf("DISPLAY_GAMMA: %0.2f\n", DISPLAY_GAMMA); + return 0; } break; } diff --git a/core/embed/unix/display-unix.c b/core/embed/unix/display-unix.c index 485f604398..d8e6fa0075 100644 --- a/core/embed/unix/display-unix.c +++ b/core/embed/unix/display-unix.c @@ -70,7 +70,7 @@ static SDL_Surface *PREV_SAVED; static int DISPLAY_BACKLIGHT = -1; static int DISPLAY_ORIENTATION = -1; -static float DISPLAY_GAMMA = 0.55f; +float DISPLAY_GAMMA = 0.55f; int sdl_display_res_x = DISPLAY_RESX, sdl_display_res_y = DISPLAY_RESY; int sdl_touch_offset_x, sdl_touch_offset_y;