diff --git a/embed/extmod/modtrezorui/display-unix.h b/embed/extmod/modtrezorui/display-unix.h index c01d5f1953..649e95f6f2 100644 --- a/embed/extmod/modtrezorui/display-unix.h +++ b/embed/extmod/modtrezorui/display-unix.h @@ -22,13 +22,21 @@ #include #include -#define DISPLAY_EMULATOR_BORDER 16 +#define EMULATOR_BORDER 16 -#define DISPLAY_TOUCH_OFFSET_X 180 -#define DISPLAY_TOUCH_OFFSET_Y 120 - -#define WINDOW_WIDTH 600 -#define WINDOW_HEIGHT 800 +#if TREZOR_MODEL == T +#define WINDOW_WIDTH 400 +#define WINDOW_HEIGHT 600 +#define TOUCH_OFFSET_X 80 +#define TOUCH_OFFSET_Y 110 +#elif TREZOR_MODEL == 1 +#define WINDOW_WIDTH 200 +#define WINDOW_HEIGHT 340 +#define TOUCH_OFFSET_X 36 +#define TOUCH_OFFSET_Y 92 +#else +#error Unknown TREZOR model +#endif static SDL_Renderer *RENDERER; static SDL_Surface *BUFFER; @@ -94,12 +102,12 @@ void display_init(void) BACKGROUND = IMG_LoadTexture(RENDERER, "../embed/unix/background_" XSTR(TREZOR_MODEL) ".jpg"); if (BACKGROUND) { SDL_SetTextureBlendMode(BACKGROUND, SDL_BLENDMODE_NONE); - sdl_touch_offset_x = DISPLAY_TOUCH_OFFSET_X; - sdl_touch_offset_y = DISPLAY_TOUCH_OFFSET_Y; + sdl_touch_offset_x = TOUCH_OFFSET_X; + sdl_touch_offset_y = TOUCH_OFFSET_Y; } else { - SDL_SetWindowSize(win, DISPLAY_RESX + 2 * DISPLAY_EMULATOR_BORDER, DISPLAY_RESY + 2 * DISPLAY_EMULATOR_BORDER); - sdl_touch_offset_x = DISPLAY_EMULATOR_BORDER; - sdl_touch_offset_y = DISPLAY_EMULATOR_BORDER; + SDL_SetWindowSize(win, DISPLAY_RESX + 2 * EMULATOR_BORDER, DISPLAY_RESY + 2 * EMULATOR_BORDER); + sdl_touch_offset_x = EMULATOR_BORDER; + sdl_touch_offset_y = EMULATOR_BORDER; } DISPLAY_BACKLIGHT = 0; DISPLAY_ORIENTATION = 0; @@ -133,10 +141,10 @@ void display_refresh(void) #define BACKLIGHT_NORMAL 150 SDL_SetTextureAlphaMod(TEXTURE, MIN(255, 255 * DISPLAY_BACKLIGHT / BACKLIGHT_NORMAL)); if (BACKGROUND) { - const SDL_Rect r = {DISPLAY_TOUCH_OFFSET_X, DISPLAY_TOUCH_OFFSET_Y, DISPLAY_RESX, DISPLAY_RESY}; + const SDL_Rect r = {TOUCH_OFFSET_X, TOUCH_OFFSET_Y, DISPLAY_RESX, DISPLAY_RESY}; SDL_RenderCopyEx(RENDERER, TEXTURE, NULL, &r, DISPLAY_ORIENTATION, NULL, 0); } else { - const SDL_Rect r = {DISPLAY_EMULATOR_BORDER, DISPLAY_EMULATOR_BORDER, DISPLAY_RESX, DISPLAY_RESY}; + const SDL_Rect r = {EMULATOR_BORDER, EMULATOR_BORDER, DISPLAY_RESX, DISPLAY_RESY}; SDL_RenderCopyEx(RENDERER, TEXTURE, NULL, &r, DISPLAY_ORIENTATION, NULL, 0); } SDL_RenderPresent(RENDERER); diff --git a/embed/unix/background_1.jpg b/embed/unix/background_1.jpg new file mode 100644 index 0000000000..93f1487f17 Binary files /dev/null and b/embed/unix/background_1.jpg differ diff --git a/embed/unix/background_T.jpg b/embed/unix/background_T.jpg index e7396c355e..64a332b4b8 100644 Binary files a/embed/unix/background_T.jpg and b/embed/unix/background_T.jpg differ