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:
parent
6e13a1475b
commit
35dcd917dd
@ -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
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user