1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-31 01:41:18 +00:00

embed/unix: save screenshot on "P" press in emulator

This commit is contained in:
Pavol Rusnak 2018-07-02 16:24:42 +02:00
parent 6e13a1475b
commit 35dcd917dd
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 5 additions and 0 deletions

View File

@ -163,6 +163,7 @@ void display_save(const char *prefix)
char fname[256];
snprintf(fname, sizeof(fname), "%s%08d.png", prefix, cnt);
IMG_SavePNG(BUFFER, fname);
fprintf(stderr, "Saved display buffer to %s\n", fname);
cnt++;
#endif
}

View File

@ -28,6 +28,7 @@ extern int sdl_display_res_x, sdl_display_res_y;
extern int sdl_touch_offset_x, sdl_touch_offset_y;
extern void __shutdown(void);
extern void display_save(const char *prefix);
uint32_t touch_read(void)
{
@ -69,6 +70,9 @@ uint32_t touch_read(void)
if (event.key.keysym.sym == SDLK_ESCAPE) {
__shutdown();
}
if (event.key.keysym.sym == SDLK_p) {
display_save("emu");
}
break;
case SDL_QUIT:
__shutdown();