refactor(core): remove unused C display_icon and display_loader functions

[no changelog]
pull/2983/head
tychovrahe 1 year ago committed by TychoVrahe
parent 69be9b1edf
commit e578f7f0f8

@ -50,7 +50,6 @@ CPPDEFINES_MOD += [
'USE_KECCAK',
'ED25519_NO_PRECOMP',
'TREZOR_UI2',
'USE_RUST_LOADER',
'FANCY_FATAL_ERROR',
]

@ -49,7 +49,6 @@ CPPDEFINES_MOD += [
'USE_KECCAK',
'ED25519_NO_PRECOMP',
'TREZOR_UI2',
'USE_RUST_LOADER',
'FANCY_FATAL_ERROR'
]
SOURCE_MOD += [

@ -185,7 +185,6 @@ SOURCE_MOD += [
CPPDEFINES_MOD += [
'TREZOR_UI2',
'USE_RUST_LOADER'
]
if TREZOR_MODEL not in ('1', ):

@ -182,7 +182,6 @@ SOURCE_MOD += [
]
CPPDEFINES_MOD += [
'TREZOR_UI2',
'USE_RUST_LOADER'
]
if TREZOR_MODEL not in ('1', ):
CPPDEFINES_MOD += [

@ -50,9 +50,6 @@
void ui_screen_welcome_third(void) {
display_bar(0, 0, DISPLAY_RESX, DISPLAY_RESY, COLOR_WELCOME_BG);
display_icon((DISPLAY_RESX - 180) / 2, (DISPLAY_RESY - 30) / 2 - 5, 180, 30,
toi_icon_welcome + 12, sizeof(toi_icon_welcome) - 12,
COLOR_WELCOME_FG, COLOR_WELCOME_BG);
display_text_center(120, 220, "Go to trezor.io/start", -1, FONT_NORMAL,
COLOR_WELCOME_FG, COLOR_WELCOME_BG);
}
@ -61,37 +58,24 @@ void ui_screen_welcome_third(void) {
void ui_screen_install_start(void) {
display_bar(0, 0, DISPLAY_RESX, DISPLAY_RESY, COLOR_BL_BG);
display_loader(0, false, -20, COLOR_BL_PROCESS, COLOR_BL_BG, toi_icon_install,
sizeof(toi_icon_install), COLOR_BL_FG);
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 24,
"Installing firmware", -1, FONT_NORMAL, COLOR_BL_FG,
COLOR_BL_BG);
}
void ui_screen_install_progress_erase(int pos, int len) {
display_loader(250 * pos / len, false, -20, COLOR_BL_PROCESS, COLOR_BL_BG,
toi_icon_install, sizeof(toi_icon_install), COLOR_BL_FG);
}
void ui_screen_install_progress_erase(int pos, int len) {}
void ui_screen_install_progress_upload(int pos) {
display_loader(pos, false, -20, COLOR_BL_PROCESS, COLOR_BL_BG,
toi_icon_install, sizeof(toi_icon_install), COLOR_BL_FG);
}
void ui_screen_install_progress_upload(int pos) {}
// wipe UI
void ui_screen_wipe(void) {
display_bar(0, 0, DISPLAY_RESX, DISPLAY_RESY, COLOR_BL_BG);
display_loader(0, false, -20, COLOR_BL_PROCESS, COLOR_BL_BG, toi_icon_wipe,
sizeof(toi_icon_wipe), COLOR_BL_FG);
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 24, "Wiping device", -1,
FONT_NORMAL, COLOR_BL_FG, COLOR_BL_BG);
}
void ui_screen_wipe_progress(int pos, int len) {
display_loader(1000 * pos / len, false, -20, COLOR_BL_PROCESS, COLOR_BL_BG,
toi_icon_wipe, sizeof(toi_icon_wipe), COLOR_BL_FG);
}
void ui_screen_wipe_progress(int pos, int len) {}
// done UI
@ -108,8 +92,6 @@ void ui_screen_done(int restart_seconds, secbool full_redraw) {
if (sectrue == full_redraw) {
display_bar(0, 0, DISPLAY_RESX, DISPLAY_RESY, COLOR_BL_BG);
}
display_loader(1000, false, -20, COLOR_BL_DONE, COLOR_BL_BG, toi_icon_done,
sizeof(toi_icon_done), COLOR_BL_FG);
if (secfalse == full_redraw) {
display_bar(0, DISPLAY_RESY - 24 - 18, 240, 23, COLOR_BL_BG);
}
@ -121,8 +103,6 @@ void ui_screen_done(int restart_seconds, secbool full_redraw) {
void ui_screen_fail(void) {
display_bar(0, 0, DISPLAY_RESX, DISPLAY_RESY, COLOR_BL_BG);
display_loader(1000, false, -20, COLOR_BL_FAIL, COLOR_BL_BG, toi_icon_fail,
sizeof(toi_icon_fail), COLOR_BL_FG);
display_text_center(DISPLAY_RESX / 2, DISPLAY_RESY - 24,
"Failed! Please, reconnect.", -1, FONT_NORMAL,
COLOR_BL_FG, COLOR_BL_BG);

@ -340,99 +340,6 @@ void display_image(int x, int y, int w, int h, const void *data,
}
#endif
#ifndef USE_DMA2D
void display_icon(int x, int y, int w, int h, const void *data,
uint32_t datalen, uint16_t fgcolor, uint16_t bgcolor) {
x += DISPLAY_OFFSET.x;
y += DISPLAY_OFFSET.y;
x &= ~1; // cannot draw at odd coordinate
int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
clamp_coords(x, y, w, h, &x0, &y0, &x1, &y1);
display_set_window(x0, y0, x1, y1);
x0 -= x;
x1 -= x;
y0 -= y;
y1 -= y;
uint16_t colortable[16] = {0};
set_color_table(colortable, fgcolor, bgcolor);
struct uzlib_uncomp decomp = {0};
uint8_t decomp_window[UZLIB_WINDOW_SIZE] = {0};
uint8_t decomp_out = 0;
uzlib_prepare(&decomp, decomp_window, data, datalen, &decomp_out,
sizeof(decomp_out));
for (uint32_t pos = 0; pos < w * h / 2; pos++) {
int st = uzlib_uncompress(&decomp);
if (st == TINF_DONE) break; // all OK
if (st < 0) break; // error
const int px = (pos * 2) % w;
const int py = (pos * 2) / w;
if (px >= x0 && px <= x1 && py >= y0 && py <= y1) {
PIXELDATA(colortable[decomp_out & 0x0F]);
PIXELDATA(colortable[decomp_out >> 4]);
}
decomp.dest = (uint8_t *)&decomp_out;
}
PIXELDATA_DIRTY();
}
#else
void display_icon(int x, int y, int w, int h, const void *data,
uint32_t datalen, uint16_t fgcolor, uint16_t bgcolor) {
x += DISPLAY_OFFSET.x;
y += DISPLAY_OFFSET.y;
x &= ~1; // cannot draw at odd coordinate
w &= ~1; // cannot draw odd-wide icons
int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
clamp_coords(x, y, w, h, &x0, &y0, &x1, &y1);
display_set_window(x0, y0, x1, y1);
x0 -= x;
x1 -= x;
y0 -= y;
y1 -= y;
int width = x1 - x0 + 1;
if (width <= 0) {
return;
}
uint8_t b[DISPLAY_RESX / 2];
buffer_line_4bpp_t *b1 = buffers_get_line_4bpp(false);
if (b1 == NULL) return;
buffer_line_4bpp_t *b2 = buffers_get_line_4bpp(false);
if (b2 == NULL) {
buffers_free_line_4bpp(b1);
return;
}
struct uzlib_uncomp decomp = {0};
uint8_t decomp_window[UZLIB_WINDOW_SIZE] = {0};
uzlib_prepare(&decomp, decomp_window, data, datalen, b, w / 2);
dma2d_setup_4bpp(fgcolor, bgcolor);
int off_x = x < 0 ? -x : 0;
for (uint32_t pos = 0; pos < h; pos++) {
buffer_line_4bpp_t *next_buf = (pos % 2 == 0) ? b1 : b2;
decomp.dest = b;
decomp.dest_limit = b + w / 2;
int st = uzlib_uncompress(&decomp);
if (st < 0) break; // error
if (pos >= y0 && pos <= y1) {
memcpy(next_buf->buffer, &b[off_x / 2], width / 2);
dma2d_wait_for_transfer();
dma2d_start(next_buf->buffer, (uint8_t *)DISPLAY_DATA_ADDRESS, width);
}
}
dma2d_wait_for_transfer();
buffers_free_line_4bpp(b1);
buffers_free_line_4bpp(b2);
}
#endif
// see docs/misc/toif.md for definition of the TOIF format
bool display_toif_info(const uint8_t *data, uint32_t len, uint16_t *out_w,
uint16_t *out_h, toif_format_t *out_format) {
@ -468,105 +375,6 @@ bool display_toif_info(const uint8_t *data, uint32_t len, uint16_t *out_w,
return true;
}
#ifndef USE_RUST_LOADER
#if defined TREZOR_MODEL_T
#include "loader_T.h"
#elif defined TREZOR_MODEL_R
#include "loader_R.h"
#endif
void display_loader(uint16_t progress, bool indeterminate, int yoffset,
uint16_t fgcolor, uint16_t bgcolor, const uint8_t *icon,
uint32_t iconlen, uint16_t iconfgcolor) {
#if defined TREZOR_MODEL_T || defined TREZOR_MODEL_R
uint16_t colortable[16] = {0}, iconcolortable[16] = {0};
set_color_table(colortable, fgcolor, bgcolor);
if (icon) {
set_color_table(iconcolortable, iconfgcolor, bgcolor);
}
if ((DISPLAY_RESY / 2 - img_loader_size + yoffset < 0) ||
(DISPLAY_RESY / 2 + img_loader_size - 1 + yoffset >= DISPLAY_RESY)) {
return;
}
display_set_window(DISPLAY_RESX / 2 - img_loader_size,
DISPLAY_RESY / 2 - img_loader_size + yoffset,
DISPLAY_RESX / 2 + img_loader_size - 1,
DISPLAY_RESY / 2 + img_loader_size - 1 + yoffset);
uint8_t icondata[(LOADER_ICON_SIZE * LOADER_ICON_SIZE) / 2] = {0};
if (icon && memcmp(icon, "TOIG", 4) == 0 &&
LOADER_ICON_SIZE == *(uint16_t *)(icon + 4) &&
LOADER_ICON_SIZE == *(uint16_t *)(icon + 6) &&
iconlen == 12 + *(uint32_t *)(icon + 8)) {
memzero(&icondata, sizeof(icondata));
struct uzlib_uncomp decomp = {0};
uzlib_prepare(&decomp, NULL, icon + 12, iconlen - 12, icondata,
sizeof(icondata));
uzlib_uncompress(&decomp);
icon = icondata;
} else {
icon = NULL;
}
for (int y = 0; y < img_loader_size * 2; y++) {
for (int x = 0; x < img_loader_size * 2; x++) {
int mx = x, my = y;
uint16_t a = 0;
if ((mx >= img_loader_size) && (my >= img_loader_size)) {
mx = img_loader_size * 2 - 1 - x;
my = img_loader_size * 2 - 1 - y;
a = 499 - (img_loader[my][mx] >> 8);
} else if (mx >= img_loader_size) {
mx = img_loader_size * 2 - 1 - x;
a = img_loader[my][mx] >> 8;
} else if (my >= img_loader_size) {
my = img_loader_size * 2 - 1 - y;
a = 500 + (img_loader[my][mx] >> 8);
} else {
a = 999 - (img_loader[my][mx] >> 8);
}
// inside of circle - draw glyph
#define LOADER_ICON_CORNER_CUT 2
#define LOADER_INDETERMINATE_WIDTH 100
if (icon &&
mx + my > (((LOADER_ICON_SIZE / 2) + LOADER_ICON_CORNER_CUT) * 2) &&
mx >= img_loader_size - (LOADER_ICON_SIZE / 2) &&
my >= img_loader_size - (LOADER_ICON_SIZE / 2)) {
int i =
(x - (img_loader_size - (LOADER_ICON_SIZE / 2))) +
(y - (img_loader_size - (LOADER_ICON_SIZE / 2))) * LOADER_ICON_SIZE;
uint8_t c = 0;
if (i % 2) {
c = (icon[i / 2] & 0xF0) >> 4;
} else {
c = icon[i / 2] & 0x0F;
}
PIXELDATA(iconcolortable[c]);
} else {
uint8_t c = 0;
if (indeterminate) {
uint16_t diff =
(progress > a) ? (progress - a) : (1000 + progress - a);
if (diff < LOADER_INDETERMINATE_WIDTH ||
diff > 1000 - LOADER_INDETERMINATE_WIDTH) {
c = (img_loader[my][mx] & 0x00F0) >> 4;
} else {
c = img_loader[my][mx] & 0x000F;
}
} else {
if (progress > a) {
c = (img_loader[my][mx] & 0x00F0) >> 4;
} else {
c = img_loader[my][mx] & 0x000F;
}
}
PIXELDATA(colortable[c]);
}
}
}
PIXELDATA_DIRTY();
#endif
}
#endif
#ifndef TREZOR_PRINT_DISABLE
#define DISPLAY_PRINT_COLS (DISPLAY_RESX / 6)

@ -30,15 +30,6 @@
#include "display_interface.h"
#include "fonts/fonts.h"
#define AVATAR_IMAGE_SIZE 144
#if defined TREZOR_MODEL_T || defined TREZOR_MODEL_1
#define LOADER_ICON_SIZE 64
#elif defined TREZOR_MODEL_R
#define LOADER_ICON_SIZE 24
#else
#error Unknown Trezor model
#endif
typedef enum {
TOIF_FULL_COLOR_BE = 0, // big endian
TOIF_GRAYSCALE_OH = 1, // odd hi
@ -68,13 +59,6 @@ bool display_toif_info(const uint8_t *buf, uint32_t len, uint16_t *out_w,
uint16_t *out_h, toif_format_t *out_format);
void display_image(int x, int y, int w, int h, const void *data,
uint32_t datalen);
void display_avatar(int x, int y, const void *data, uint32_t datalen,
uint16_t fgcolor, uint16_t bgcolor);
void display_icon(int x, int y, int w, int h, const void *data,
uint32_t datalen, uint16_t fgcolor, uint16_t bgcolor);
void display_loader(uint16_t progress, bool indeterminate, int yoffset,
uint16_t fgcolor, uint16_t bgcolor, const uint8_t *icon,
uint32_t iconlen, uint16_t iconfgcolor);
#ifndef TREZOR_PRINT_DISABLE
void display_print_color(uint16_t fgcolor, uint16_t bgcolor);

@ -1,24 +0,0 @@
// clang-format off
static const int img_loader_size = 20;
static const uint16_t img_loader[20][20] = {
{31744,30720,29440,28160,26880,25600,24320,22784,21248,19456,17920,16128,14080,12288,10240,8208,6193,4177,2162,114,},
{32768,31744,30464,29440,28160,26624,25344,23808,22016,20480,18688,16896,14880,13170,10948,8949,6901,4597,2293,245,},
{34048,33024,31744,30464,29184,27904,26368,24832,23296,21504,19761,17827,15861,13813,11765,9461,7157,4853,2549,245,},
{35328,34048,33024,31744,30464,28928,27648,26112,24336,22675,20981,18933,16885,14581,12533,9973,7671,5112,2553,250,},
{36608,35328,34304,33024,31744,30464,28928,27201,25812,24053,22005,19957,17909,15608,13307,10750,8191,5631,2815,255,},
{37888,36864,35584,34560,33024,31744,30289,28917,27125,25333,23285,21240,18941,16639,14079,11519,8652,5785,2952,119,},
{39168,38144,37120,35840,34560,33361,31989,30453,28661,26613,24571,22527,20223,17612,14950,12049,8960,6144,3072,0,},
{40704,39680,38656,37376,36417,35061,33525,31989,30199,28413,26367,24029,21333,18688,15872,13056,9728,6656,3328,0,},
{42240,41472,40192,39184,38100,36853,35317,33783,31998,29951,27818,25361,22784,20224,17152,14080,10752,7168,3584,0,},
{44032,43008,41984,41107,39925,38645,37365,35581,34047,31897,29696,27136,24576,21760,18688,15360,11776,7936,3840,0,},
{45568,44800,43825,42997,41973,40693,39419,37631,36010,33792,31744,29440,26624,23808,20480,16896,13056,8704,4352,0,},
{47360,46592,45987,45045,44021,42744,41471,39901,38161,36352,34048,31744,28928,26112,22528,18688,14336,9728,4864,0,},
{49408,48672,48117,47093,46069,45053,43775,42325,40704,38912,36864,34560,31744,28672,25088,20992,16384,11264,5632,0,},
{51200,50546,50165,49397,48376,47359,46284,44800,43264,41728,39680,37376,34816,31744,28160,23808,18688,13056,6656,0,},
{53248,52932,52213,51445,50683,49919,48742,47616,46336,44800,43008,40960,38400,35328,31744,27136,21760,15360,7936,0,},
{55312,55029,54517,54005,53246,52479,51473,50432,49408,48128,46592,44800,42496,39680,36352,31744,26112,18688,9728,0,},
{57393,57077,56821,56311,55807,55244,54528,53760,52736,51712,50432,49152,47104,44800,41728,37376,31744,23808,13056,0,},
{59473,59381,59125,58872,58367,58009,57344,56832,56320,55552,54784,53760,52224,50432,48128,44800,39680,31744,18688,0,},
{61554,61685,61429,61433,61183,60808,60416,60160,59904,59648,59136,58624,57856,56832,55552,53760,50432,44800,31744,0,},
{63858,63989,63989,63994,63999,63863,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,0,},
};

@ -1,64 +0,0 @@
// clang-format off
static const int img_loader_size = 60;
static const uint16_t img_loader[60][60] = {
{31744,31488,30976,30720,30208,29952,29696,29184,28672,28416,27904,27648,27136,26624,26368,25856,25344,25088,24576,24064,23552,23040,22528,22016,21504,20992,20480,19968,19456,18944,18432,17920,17408,16640,16128,15616,14848,14336,13824,13056,12544,11776,11264,10496,9984,9216,8704,7936,7424,6656,5888,5376,4624,4128,3393,2641,2146,1378,626,114,},
{32000,31744,31488,30976,30720,30208,29952,29440,29184,28672,28416,27904,27392,27136,26624,26112,25856,25344,24832,24320,23808,23296,23040,22528,22016,21504,20736,20224,19712,19200,18688,18176,17664,16896,16384,15872,15104,14592,14080,13312,12800,12032,11520,10752,10240,9472,8704,8257,7522,7059,6340,5604,5109,4341,3573,2805,2293,1525,757,245,},
{32512,32000,31744,31488,30976,30720,30208,29952,29440,29184,28672,28160,27904,27392,26880,26624,26112,25600,25088,24576,24320,23808,23296,22784,22272,21760,21248,20736,19968,19456,18944,18432,17920,17152,16640,16128,15360,14848,14080,13568,13056,12288,11520,11073,10370,9924,9205,8437,7925,7157,6389,5877,5109,4341,3573,3061,2293,1525,757,245,},
{32768,32512,32000,31744,31488,30976,30720,30208,29952,29440,28928,28672,28160,27904,27392,26880,26368,26112,25600,25088,24576,24064,23552,23040,22528,22016,21504,20992,20480,19712,19200,18688,18176,17408,16896,16384,15616,15104,14336,13824,13137,12707,12004,11509,10741,9973,9461,8693,7925,7413,6645,5877,5109,4341,3829,3061,2293,1525,757,245,},
{33280,32768,32512,32000,31744,31488,30976,30720,30208,29696,29440,28928,28672,28160,27648,27136,26880,26368,25856,25344,24832,24320,23808,23296,22784,22272,21760,21248,20736,20224,19456,18944,18432,17920,17152,16640,15872,15409,14739,14308,13557,13045,12277,11509,10997,10229,9461,8949,8181,7413,6645,5877,5365,4597,3829,3061,2293,1525,757,245,},
{33536,33280,32768,32512,32000,31744,31488,30976,30464,30208,29696,29440,28928,28416,28160,27648,27136,26624,26112,25856,25344,24832,24320,23808,23296,22784,22016,21504,20992,20480,19968,19200,18688,18176,17408,16994,16324,15861,15093,14581,13813,13301,12533,11765,10997,10485,9717,8949,8181,7669,6901,6133,5365,4597,3829,3061,2293,1525,757,245,},
{33792,33536,33280,32768,32512,32000,31744,31232,30976,30464,30208,29696,29440,28928,28416,27904,27648,27136,26624,26112,25600,25088,24576,24064,23552,23040,22528,22016,21248,20736,20224,19712,18944,18530,17876,17397,16629,16117,15349,14837,14069,13301,12789,12021,11253,10485,9973,9205,8437,7669,6901,6133,5365,4597,3829,3061,2293,1525,757,245,},
{34304,34048,33536,33280,32768,32512,32256,31744,31232,30976,30464,30208,29696,29184,28928,28416,27904,27392,26880,26368,26112,25600,25088,24320,23808,23296,22784,22272,21760,20992,20480,20066,19412,18933,18421,17653,17141,16373,15605,15093,14325,13557,13045,12277,11509,10741,9973,9205,8693,7925,7157,6389,5621,4853,4085,3317,2549,1781,1013,245,},
{34816,34304,34048,33536,33280,33024,32512,32256,31744,31232,30976,30464,30208,29696,29184,28672,28416,27904,27392,26880,26368,25856,25344,24832,24320,23808,23296,22528,22016,21569,20932,20469,19957,19189,18677,17909,17397,16629,15861,15349,14581,13813,13301,12533,11765,10997,10229,9461,8693,7925,7157,6389,5621,4853,4085,3317,2549,1781,1013,245,},
{35072,34816,34304,34048,33792,33280,33024,32512,32256,31744,31232,30976,30464,29952,29696,29184,28672,28160,27648,27136,26880,26368,25600,25088,24576,24064,23552,23072,22435,22005,21493,20725,20213,19701,18933,18165,17653,16885,16373,15605,14837,14069,13301,12789,12021,11253,10485,9717,8949,8181,7413,6645,5877,4853,4085,3317,2549,1781,1013,245,},
{35584,35072,34816,34560,34048,33792,33280,33024,32512,32256,31744,31232,30976,30464,29952,29440,29184,28672,28160,27648,27136,26624,26112,25600,25088,24576,23906,23524,23029,22517,21749,21237,20469,19957,19189,18677,17909,17141,16629,15861,15093,14325,13557,13045,12277,11509,10741,9973,9205,8181,7413,6645,5877,5109,4341,3317,2549,1781,1013,245,},
{35840,35584,35328,34816,34560,34048,33792,33280,33024,32512,32256,31744,31232,30976,30464,29952,29440,28928,28672,28160,27648,27136,26624,26112,25360,24995,24565,24053,23285,22773,22261,21493,20981,20213,19701,18933,18165,17653,16885,16117,15349,14581,13813,13301,12533,11509,10741,9973,9205,8437,7669,6901,5877,5109,4341,3573,2549,1781,1013,245,},
{36352,36096,35584,35328,34816,34560,34048,33792,33280,33024,32512,32256,31744,31232,30976,30464,29952,29440,28928,28416,27904,27392,26880,26433,26068,25589,25077,24309,23797,23285,22517,22005,21237,20725,19957,19189,18677,17909,17141,16373,15605,14837,14325,13557,12533,11765,10997,10229,9461,8693,7669,6901,6133,5365,4341,3573,2805,1781,1013,245,},
{36864,36352,36096,35584,35328,35072,34560,34304,33792,33536,33024,32512,32256,31744,31232,30720,30464,29952,29440,28928,28416,27904,27490,27125,26613,25845,25333,24821,24309,23541,23029,22261,21749,20981,20213,19701,18933,18165,17397,16885,16117,15349,14581,13813,12789,12021,11253,10485,9717,8693,7925,7157,6133,5365,4597,3573,2805,1781,1013,245,},
{37120,36864,36608,36096,35840,35328,35072,34560,34304,33792,33536,33024,32512,32256,31744,31232,30720,30464,29952,29440,28928,28563,28149,27381,26869,26357,25845,25077,24565,24053,23285,22773,22005,21493,20725,19957,19189,18677,17909,17141,16373,15605,14837,14069,13301,12277,11509,10741,9973,8949,8181,7157,6389,5621,4597,3829,2805,2037,1013,245,},
{37632,37376,36864,36608,36352,35840,35584,35072,34816,34304,34048,33536,33024,32768,32256,31744,31232,30720,30208,29696,29347,28917,28405,27893,27381,26869,26357,25589,25077,24309,23797,23029,22517,21749,20981,20469,19701,18933,18165,17397,16629,15861,15093,14325,13557,12533,11765,10997,9973,9205,8181,7413,6645,5621,4599,3832,2808,2041,1017,250,},
{38144,37632,37376,37120,36608,36352,35840,35584,35072,34816,34304,34048,33536,33024,32768,32256,31744,31232,30736,30387,29941,29429,28917,28405,27893,27381,26613,26101,25589,24821,24309,23541,22773,22261,21493,20725,19957,19189,18677,17909,16885,16117,15349,14581,13813,12789,12021,11253,10230,9464,8442,7676,6654,5631,4863,3839,3071,2047,1023,255,},
{38400,38144,37888,37376,37120,36864,36352,36096,35584,35328,34816,34560,34048,33536,33024,32768,32256,31760,31428,30965,30453,29941,29429,28917,28405,27637,27125,26613,25845,25333,24565,24053,23285,22517,22005,21237,20469,19701,18933,18165,17397,16629,15605,14837,14069,13303,12282,11517,10495,9727,8703,7679,6911,5853,4795,4010,2969,1928,887,119,},
{38912,38656,38400,37888,37632,37376,36864,36608,36096,35840,35328,34816,34560,34048,33536,33280,32784,32452,31989,31477,30965,30453,29941,29429,28917,28149,27637,27125,26357,25845,25077,24309,23797,23029,22261,21493,20981,20213,19445,18421,17653,16885,16118,15097,14333,13567,12543,11775,10734,9642,8823,7748,6673,5888,4864,3840,2816,1792,768,0,},
{39424,39168,38912,38400,38144,37632,37376,37120,36608,36352,35840,35328,35072,34560,34048,33792,33459,33013,32501,31989,31477,30965,30453,29941,29173,28661,28149,27381,26869,26357,25589,24821,24309,23541,22773,22005,21237,20469,19701,18933,18167,17403,16383,15615,14591,13789,12680,11827,10752,9728,8960,7936,6912,5888,4864,3840,2816,1792,768,0,},
{39936,39680,39168,38912,38656,38144,37888,37376,37120,36608,36352,35840,35584,35072,34560,34467,34037,33525,33013,32501,31989,31477,30965,30453,29685,29173,28661,27893,27381,26613,26101,25333,24565,24053,23285,22517,21749,20981,20215,19451,18431,17663,16895,15769,14916,13824,13056,12032,11008,9984,8960,8192,7168,6144,5120,4096,3072,2048,1024,0,},
{40448,40192,39680,39424,39168,38656,38400,37888,37632,37120,36864,36352,36096,35584,35219,35061,34549,34037,33525,33013,32501,31989,31477,30965,30197,29685,29173,28405,27893,27125,26613,25845,25077,24565,23797,23029,22261,21498,20735,19711,18926,18056,16913,16128,15104,14080,13312,12288,11264,10240,9216,8192,7168,6144,5120,4096,3072,2048,1024,0,},
{40960,40448,40192,39936,39680,39168,38912,38400,38144,37888,37376,36864,36608,36194,35829,35573,35061,34549,34037,33525,33013,32501,31989,31477,30965,30197,29685,29173,28405,27637,27125,26357,25589,25077,24309,23544,22782,22015,20991,20104,19217,18176,17408,16384,15616,14592,13568,12544,11520,10496,9472,8448,7424,6400,5376,4352,3072,2048,1024,0,},
{41472,40960,40704,40448,40192,39680,39424,39168,38656,38400,37888,37376,37185,36853,36597,36085,35573,35061,34549,34037,33525,33013,32501,31989,31477,30709,30197,29685,28917,28405,27637,26869,26357,25589,24827,24063,23295,22186,21282,20480,19456,18688,17664,16896,15872,14848,13824,13056,12032,10752,9728,8704,7680,6656,5376,4352,3328,2048,1024,0,},
{41984,41472,41216,40960,40704,40192,39936,39680,39168,38912,38400,38160,37844,37365,37109,36597,36085,35573,35061,34805,34293,33781,33013,32501,31989,31477,30709,30197,29429,28917,28149,27381,26871,26109,25343,24558,23637,22528,21760,20992,19968,19200,18176,17152,16384,15360,14336,13312,12288,11264,9984,8960,7936,6656,5632,4608,3328,2304,1024,0,},
{42496,41984,41728,41472,41216,40704,40448,40192,39680,39424,38912,38819,38389,38133,37621,37109,36597,36341,35829,35317,34805,34293,33781,33269,32501,31989,31477,30709,30197,29429,28661,28153,27391,26623,25770,24849,24064,23296,22272,21504,20480,19712,18688,17664,16640,15616,14592,13568,12544,11520,10496,9216,8192,6912,5888,4608,3328,2304,1024,0,},
{43008,42752,42240,41984,41728,41472,40960,40704,40192,39936,39778,39413,38901,38645,38133,37621,37365,36853,36341,35829,35317,34805,34293,33781,33269,32501,31989,31477,30709,29941,29434,28671,27903,26999,26112,25344,24576,23808,22784,22016,20992,20224,19200,18176,17152,16128,15104,14080,13056,11776,10752,9472,8448,7168,5888,4864,3584,2304,1024,0,},
{43520,43264,42752,42496,42240,41984,41472,41216,40960,40480,40420,39925,39669,39157,38901,38389,37877,37365,36853,36597,36085,35573,34805,34293,33781,33269,32501,31989,31221,30715,29951,29183,28501,27648,26880,26112,25088,24320,23552,22528,21504,20736,19712,18688,17664,16640,15616,14336,13312,12288,11008,9728,8704,7424,6144,4864,3584,2304,1024,0,},
{44032,43776,43520,43008,42752,42496,42240,41728,41472,41379,40949,40693,40181,39669,39413,38901,38389,38133,37621,37109,36597,36085,35573,35061,34549,33781,33269,32757,31995,31231,30702,29764,28928,28160,27392,26624,25856,24832,24064,23040,22272,21248,20224,19200,18176,17152,15872,14848,13824,12544,11264,10240,8960,7680,6400,5120,3840,2560,1280,0,},
{44544,44288,44032,43776,43264,43008,42752,42496,42049,41973,41461,41205,40693,40437,39925,39669,39157,38645,38133,37621,37365,36853,36341,35573,35061,34549,34037,33275,32767,31965,31027,30464,29696,28928,28160,27136,26368,25600,24576,23808,22784,21760,20736,19712,18688,17664,16384,15360,14080,13056,11776,10496,9216,7936,6656,5376,3840,2560,1280,0,},
{45056,44800,44544,44288,44032,43520,43264,43008,42948,42485,42229,41717,41461,40949,40693,40181,39669,39413,38901,38389,37877,37365,36853,36341,35829,35317,34554,34047,33262,32563,31744,30976,30208,29440,28672,27904,27136,26112,25344,24320,23296,22528,21504,20224,19200,18176,16896,15872,14592,13312,12032,10752,9472,8192,6912,5376,4096,2560,1280,0,},
{45568,45312,45056,44800,44544,44288,43776,43618,43509,43253,42741,42485,41973,41717,41205,40949,40437,39925,39669,39157,38645,38133,37621,37109,36597,35833,35327,34815,33860,33024,32512,31744,30976,30208,29440,28672,27904,26880,26112,25088,24064,23040,22016,20992,19712,18688,17408,16384,15104,13824,12544,11264,9728,8448,7168,5632,4096,2816,1280,0,},
{46080,45824,45568,45312,45056,44800,44544,44500,44021,43765,43509,42997,42741,42229,41973,41461,41205,40693,40181,39669,39413,38901,38389,37621,37111,36607,36095,35157,34560,33792,33280,32512,31744,30976,30208,29440,28416,27648,26624,25856,24832,23808,22784,21504,20480,19200,18176,16896,15616,14336,13056,11520,10240,8704,7424,5888,4352,2816,1280,0,},
{46848,46592,46336,46080,45568,45312,45154,45045,44789,44277,44021,43765,43253,42997,42485,42229,41717,41461,40949,40437,39925,39413,38901,38389,37885,37375,36727,35840,35328,34560,34048,33280,32512,31744,30976,30208,29184,28416,27392,26368,25600,24320,23296,22272,20992,19968,18688,17408,16128,14848,13312,12032,10496,8960,7680,6144,4608,3072,1536,0,},
{47360,47104,46848,46592,46336,46080,46036,45557,45301,45045,44789,44277,44021,43765,43253,42997,42485,41973,41717,41205,40693,40181,39669,39163,38655,38058,37376,36608,36096,35328,34816,34048,33280,32512,31744,30976,29952,29184,28160,27136,26368,25088,24064,23040,21760,20480,19456,17920,16640,15360,13824,12544,11008,9472,7936,6400,4608,3072,1536,0,},
{47872,47616,47360,47104,46848,46690,46581,46325,46069,45813,45301,45045,44789,44277,44021,43509,43253,42741,42485,41973,41461,40949,40440,39935,39406,38673,38144,37376,36864,36352,35584,34816,34048,33280,32512,31744,30976,29952,28928,28160,27136,26112,24832,23808,22528,21248,19968,18688,17408,15872,14336,13056,11264,9728,8192,6656,4864,3328,1536,0,},
{48640,48384,48128,47872,47616,47556,47349,46837,46581,46325,46069,45813,45301,45045,44789,44277,44021,43509,42997,42741,42229,41717,41214,40703,40021,39424,38912,38400,37632,37120,36352,35584,35072,34304,33536,32512,31744,30720,29952,28928,27904,26880,25600,24576,23296,22016,20736,19456,17920,16640,15104,13568,11776,10240,8448,6912,5120,3328,1536,0,},
{49152,48896,48640,48384,48177,48117,47861,47605,47349,47093,46837,46325,46069,45813,45301,45045,44789,44277,43765,43509,42997,42490,41983,41642,40960,40192,39680,39168,38656,37888,37376,36608,35840,35072,34304,33536,32768,31744,30720,29696,28672,27648,26624,25344,24064,22784,21504,20224,18688,17152,15616,14080,12288,10752,8960,7168,5376,3584,1792,0,},
{49664,49408,49408,49152,49043,48885,48629,48373,48117,47605,47349,47093,46837,46581,46069,45813,45301,45045,44533,44277,43767,43263,43007,42274,41728,41216,40704,39936,39424,38912,38144,37376,36864,36096,35328,34560,33536,32768,31744,30720,29696,28672,27392,26368,25088,23808,22272,20992,19456,17920,16384,14592,13056,11264,9472,7424,5632,3840,1792,0,},
{50432,50176,49920,49664,49636,49397,49141,48885,48629,48373,48117,47861,47605,47093,46837,46581,46069,45813,45557,45045,44539,44287,43656,43008,42496,41984,41472,40960,40448,39680,39168,38400,37632,37120,36352,35328,34560,33792,32768,31744,30720,29696,28416,27136,26112,24576,23296,21760,20224,18688,17152,15360,13568,11776,9728,7936,5888,3840,1792,0,},
{50944,50688,50432,50513,50421,50165,49909,49653,49397,49141,48885,48629,48373,47861,47605,47349,47093,46581,46325,45815,45567,45038,44305,44032,43520,43008,42496,41984,41216,40704,40192,39424,38656,37888,37120,36352,35584,34816,33792,32768,31744,30720,29440,28160,26880,25600,24320,22784,21248,19456,17920,16128,14080,12288,10240,8192,6144,4096,2048,0,},
{51712,51456,51200,51107,50933,50677,50677,50421,50165,49909,49653,49397,49141,48629,48373,48117,47861,47349,47093,46587,46335,45704,45312,44800,44288,43776,43264,42752,42240,41728,40960,40448,39680,39168,38400,37376,36608,35840,34816,33792,32768,31744,30464,29440,28160,26624,25344,23808,22016,20480,18688,16896,14848,13056,10752,8704,6656,4352,2048,0,},
{52224,51968,51968,51940,51701,51445,51189,50933,50677,50677,50421,50165,49653,49397,49141,48885,48629,48373,47862,47615,47103,46609,46080,45824,45312,44800,44288,43776,43264,42752,41984,41472,40704,40192,39424,38656,37888,36864,36096,35072,34048,33024,31744,30464,29184,27904,26368,24832,23296,21504,19712,17664,15616,13568,11520,9216,6912,4608,2304,0,},
{52992,52736,52545,52469,52469,52213,51957,51701,51445,51189,50933,50677,50421,50165,49909,49653,49397,49141,48889,48383,48025,47360,47104,46592,46336,45824,45312,44800,44288,43776,43264,42496,41984,41216,40448,39680,38912,38144,37120,36352,35328,34048,33024,31744,30464,28928,27648,26112,24320,22528,20736,18688,16640,14336,12288,9728,7424,4864,2304,0,},
{53504,53248,53378,53237,52981,52981,52725,52469,52213,51957,51701,51445,51445,51189,50677,50421,50165,49909,49661,49407,48708,48384,47872,47616,47104,46848,46336,45824,45312,44800,44288,43776,43008,42496,41728,40960,40192,39424,38400,37376,36608,35328,34304,33024,31744,30464,28928,27136,25600,23808,21760,19712,17664,15360,13056,10496,7936,5376,2560,0,},
{54272,54016,53956,54005,53749,53493,53493,53237,52981,52725,52469,52469,52213,51957,51701,51445,51189,50679,50431,50141,49664,49408,48896,48640,48128,47872,47360,46848,46336,45824,45312,44800,44288,43520,43008,42240,41472,40704,39680,38912,37888,36864,35584,34560,33024,31744,30208,28672,26880,25088,23040,20992,18688,16384,13824,11264,8448,5632,2816,0,},
{54784,54784,54773,54517,54517,54261,54005,54005,53749,53493,53237,53237,52981,52725,52469,52213,51957,51706,51455,51080,50432,50176,49920,49664,49152,48896,48384,47872,47616,47104,46592,46080,45312,44800,44032,43520,42752,41984,41216,40192,39168,38144,37120,35840,34560,33280,31744,30208,28416,26368,24320,22272,19968,17408,14848,12032,8960,6144,3072,0,},
{55552,55361,55541,55285,55029,55029,54773,54773,54517,54261,54005,54005,53749,53493,53237,52981,52725,52477,52223,51763,51456,51200,50944,50432,50176,49920,49408,49152,48640,48128,47616,47104,46592,46080,45568,44800,44032,43264,42496,41728,40704,39680,38656,37376,36352,34816,33280,31744,29952,28160,26112,23808,21248,18688,15872,13056,9728,6656,3328,0,},
{56064,56162,56053,56053,55797,55797,55541,55285,55285,55029,54773,54773,54517,54261,54005,54005,53750,53503,53230,52736,52480,52224,51968,51456,51200,50944,50432,50176,49664,49408,48896,48384,47872,47360,46848,46080,45568,44800,44032,43264,42240,41472,40192,39168,37888,36608,35072,33536,31744,29696,27648,25344,22784,20224,17152,14080,10752,7168,3584,0,},
{56832,56723,56821,56565,56565,56309,56309,56053,56053,55797,55797,55541,55285,55285,55029,54773,54520,54271,54186,53760,53504,53248,52992,52736,52224,51968,51712,51200,50944,50432,50176,49664,49152,48640,48128,47616,46848,46336,45568,44800,44032,43008,41984,40960,39680,38400,37120,35328,33792,31744,29696,27136,24576,21760,18688,15360,11776,7936,3840,0,},
{57600,57540,57589,57333,57333,57077,57077,56821,56821,56565,56565,56309,56309,56053,55797,55797,55546,55295,54903,54528,54528,54272,54016,53760,53504,52992,52736,52480,52224,51712,51456,50944,50432,50176,49664,49152,48384,47872,47104,46336,45568,44800,43776,42752,41728,40448,39168,37376,35840,33792,31744,29440,26624,23808,20480,16896,13056,8704,4352,0,},
{58112,58340,58101,58101,58101,57845,57845,57589,57589,57333,57333,57077,57077,56821,56821,56565,56316,56319,55876,55552,55296,55296,55040,54784,54528,54272,54016,53760,53248,52992,52736,52224,51968,51456,50944,50432,49920,49408,48896,48128,47360,46592,45824,44800,43776,42496,41216,39680,38144,36352,34048,31744,28928,26112,22528,18688,14336,9728,4864,0,},
{58896,58869,58869,58869,58613,58613,58613,58357,58357,58101,58101,58101,57845,57845,57589,57333,57342,57087,56849,56576,56320,56320,56064,55808,55552,55296,55040,54784,54528,54272,54016,53760,53248,52992,52480,52224,51712,51200,50432,49920,49408,48640,47872,46848,45824,44800,43520,42240,40704,38912,36864,34560,31744,28672,25088,20992,16384,11264,5632,0,},
{59424,59637,59637,59637,59381,59381,59381,59125,59125,59125,58869,58869,58613,58613,58357,58357,58367,58077,57600,57600,57344,57344,57088,56832,56832,56576,56320,56064,55808,55552,55296,55040,54784,54528,54016,53760,53248,52736,52224,51712,51200,50432,49920,49152,48128,47104,46080,44800,43264,41728,39680,37376,34816,31744,28160,23808,18688,13056,6656,0,},
{60225,60405,60405,60149,60149,60149,60149,59893,59893,59893,59637,59637,59637,59381,59381,59383,59135,59067,58624,58624,58368,58368,58112,58112,57856,57600,57600,57344,57088,56832,56576,56320,56064,55808,55552,55296,55040,54528,54016,53760,53248,52736,51968,51200,50432,49664,48640,47616,46336,44800,43008,40960,38400,35328,31744,27136,21760,15360,7936,0,},
{61009,61173,60917,60917,60917,60917,60917,60661,60661,60661,60661,60405,60405,60405,60149,60152,60159,59818,59648,59648,59392,59392,59136,59136,58880,58880,58624,58624,58368,58112,58112,57856,57600,57344,57088,56832,56576,56320,56064,55552,55296,54784,54272,53760,52992,52224,51456,50432,49408,48128,46592,44800,42496,39680,36352,31744,26112,18688,9728,0,},
{61538,61685,61685,61685,61685,61685,61685,61429,61429,61429,61429,61429,61173,61173,61173,61176,60927,60825,60672,60672,60416,60416,60416,60160,60160,60160,59904,59904,59648,59648,59392,59392,59136,58880,58880,58624,58368,58112,57856,57600,57344,56832,56576,56064,55552,55040,54528,53760,52736,51712,50432,49152,47104,44800,41728,37376,31744,23808,13056,0,},
{62306,62453,62453,62453,62453,62453,62453,62197,62197,62197,62197,62197,62197,62197,61941,61945,61951,61832,61696,61696,61440,61440,61440,61440,61184,61184,61184,61184,60928,60928,60928,60672,60672,60416,60416,60160,60160,59904,59648,59648,59392,59136,58880,58624,58112,57856,57344,56832,56320,55552,54784,53760,52224,50432,48128,44800,39680,31744,18688,0,},
{63090,63221,63221,63221,63221,63221,63221,62965,62965,62965,62965,62965,62965,62965,62965,62969,62975,62839,62720,62720,62464,62464,62464,62464,62464,62464,62464,62464,62208,62208,62208,62208,62208,61952,61952,61952,61952,61696,61696,61696,61440,61440,61184,61184,60928,60672,60416,60160,59904,59648,59136,58624,57856,56832,55552,53760,50432,44800,31744,0,},
{63858,63989,63989,63989,63989,63989,63989,63989,63989,63989,63989,63989,63989,63989,63989,63994,63999,63863,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,63744,0,},
};

@ -290,7 +290,6 @@ fn generate_trezorhal_bindings() {
.allowlist_function("display_bar_radius")
.allowlist_function("display_bar_radius_buffer")
.allowlist_function("display_image")
.allowlist_function("display_loader")
.allowlist_function("display_pixeldata")
.allowlist_function("display_pixeldata_dirty")
.allowlist_function("display_set_window")

@ -116,29 +116,6 @@ pub fn image(x: i16, y: i16, w: i16, h: i16, data: &[u8]) {
}
}
pub fn loader(
progress: u16,
indeterminate: bool,
yoffset: i16,
fgcolor: u16,
bgcolor: u16,
icon: Option<&[u8]>,
iconfgcolor: u16,
) {
unsafe {
ffi::display_loader(
progress,
indeterminate,
yoffset.into(),
fgcolor,
bgcolor,
icon.map(|i| i.as_ptr()).unwrap_or(ptr::null()),
icon.map(|i| i.len()).unwrap_or(0) as _,
iconfgcolor,
);
}
}
#[inline(always)]
#[cfg(all(feature = "model_tt", target_arch = "arm"))]
pub fn pixeldata(c: u16) {

Loading…
Cancel
Save