feat(nyx): support per-tab backgrounds with shared fallback

This commit is contained in:
2025-11-11 20:41:39 +01:00
parent 5e8b01f727
commit 4c2b7d4b29
7 changed files with 155 additions and 28 deletions

View File

@@ -326,6 +326,42 @@ static void nyx_load_bg_icons()
// Load background resource if any.
hekate_bg = bmp_to_lvimg_obj("bootloader/res/background.bmp");
hekate_bg_generic = bmp_to_lvimg_obj("bootloader/res/background_etc.bmp");
memset(hekate_bg_tabs, 0, sizeof(hekate_bg_tabs));
static const struct {
const char *path;
enum nyx_bg_tab tab;
} bg_sources[] = {
{ "bootloader/res/background_about.bmp", NYX_BG_TAB_ABOUT },
{ "bootloader/res/background_home.bmp", NYX_BG_TAB_HOME },
{ "bootloader/res/background_tools.bmp", NYX_BG_TAB_TOOLS },
{ "bootloader/res/background_info.bmp", NYX_BG_TAB_INFO },
{ "bootloader/res/background_options.bmp", NYX_BG_TAB_OPTIONS },
};
for (size_t i = 0; i < sizeof(bg_sources) / sizeof(bg_sources[0]); i++)
{
lv_img_dsc_t *img = bmp_to_lvimg_obj(bg_sources[i].path);
if (img)
hekate_bg_tabs[bg_sources[i].tab] = img;
}
if (!hekate_bg && hekate_bg_generic)
hekate_bg = hekate_bg_generic;
if (!hekate_bg)
{
for (int i = 0; i < NYX_BG_TAB_MAX; i++)
{
if (hekate_bg_tabs[i])
{
hekate_bg = hekate_bg_tabs[i];
break;
}
}
}
}
#define EXCP_EN_ADDR 0x4003FFFC