From e46f54d4e684b61552d9bc8c7e2ada559f8da838 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Sun, 2 Jun 2024 07:38:07 +0300 Subject: [PATCH] hekate/nyx: use static/const where it should --- bootloader/hos/hos.c | 4 +- bootloader/hos/pkg1.c | 6 +- bootloader/hos/pkg1.h | 6 +- bootloader/hos/pkg2.c | 4 +- bootloader/hos/pkg2.h | 12 +- bootloader/hos/pkg2_patches.inl | 174 +++++++++--------- loader/loader.c | 2 +- nyx/nyx_gui/frontend/fe_emmc_tools.c | 8 +- nyx/nyx_gui/frontend/gui_options.c | 6 +- .../frontend/gui_tools_partition_manager.c | 4 +- nyx/nyx_gui/gfx/logos-gui.h | 24 ++- 11 files changed, 133 insertions(+), 117 deletions(-) diff --git a/bootloader/hos/hos.c b/bootloader/hos/hos.c index b3fa251..cb92f4a 100644 --- a/bootloader/hos/hos.c +++ b/bootloader/hos/hos.c @@ -672,7 +672,7 @@ DPRINTF("Parsed GPT\n"); goto out; // Read in package2 header and get package2 real size. - const u32 BCT_SIZE = SZ_16K; + static const u32 BCT_SIZE = SZ_16K; bctBuf = (u8 *)malloc(BCT_SIZE); emmc_part_read(pkg2_part, BCT_SIZE / EMMC_BLOCKSIZE, 1, bctBuf); u32 *hdr = (u32 *)(bctBuf + 0x100); @@ -1017,7 +1017,7 @@ int hos_launch(ini_sec_t *cfg) } // In case a kernel patch option is set; allows to disable SVC verification or/and enable debug mode. - kernel_patch_t *kernel_patchset = ctxt.pkg2_kernel_id->kernel_patchset; + const kernel_patch_t *kernel_patchset = ctxt.pkg2_kernel_id->kernel_patchset; if (kernel_patchset != NULL) { gfx_printf("%kPatching kernel%k\n", TXT_CLR_ORANGE, TXT_CLR_DEFAULT); diff --git a/bootloader/hos/pkg1.c b/bootloader/hos/pkg1.c index d96b0f7..89b92a1 100644 --- a/bootloader/hos/pkg1.c +++ b/bootloader/hos/pkg1.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2018 naehrwert * Copyright (c) 2018 st4rk - * Copyright (c) 2018-2023 CTCaer + * Copyright (c) 2018-2024 CTCaer * Copyright (c) 2018 balika011 * * This program is free software; you can redistribute it and/or modify it @@ -267,7 +267,7 @@ const u8 *pkg1_unpack(void *wm_dst, u32 *wb_sz, void *sm_dst, void *ldr_dst, con void pkg1_secmon_patch(void *hos_ctxt, u32 secmon_base, bool t210b01) { - patch_t *secmon_patchset; + const patch_t *secmon_patchset; launch_ctxt_t *ctxt = (launch_ctxt_t *)hos_ctxt; // Patch Secmon to allow for an unsigned package2 and patched kernel. @@ -320,7 +320,7 @@ void pkg1_secmon_patch(void *hos_ctxt, u32 secmon_base, bool t210b01) void pkg1_warmboot_patch(void *hos_ctxt) { launch_ctxt_t *ctxt = (launch_ctxt_t *)hos_ctxt; - patch_t *warmboot_patchset; + const patch_t *warmboot_patchset; // Patch warmboot on T210 to allow downgrading. switch (ctxt->pkg1_id->kb) diff --git a/bootloader/hos/pkg1.h b/bootloader/hos/pkg1.h index c70ffa5..c0dab9a 100644 --- a/bootloader/hos/pkg1.h +++ b/bootloader/hos/pkg1.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2018 naehrwert - * Copyright (c) 2022-2023 CTCaer + * Copyright (c) 2022-2024 CTCaer * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -41,7 +41,7 @@ typedef struct _patch_t } patch_t; #define PATCHSET_DEF(name, ...) \ - patch_t name[] = { \ + const patch_t name[] = { \ __VA_ARGS__, \ { 0xFFFFFFFF, 0xFFFFFFFF } \ } @@ -79,7 +79,7 @@ typedef struct _pkg1_id_t u16 pkg11_off; u32 secmon_base; u32 warmboot_base; - patch_t *secmon_patchset; + const patch_t *secmon_patchset; } pkg1_id_t; typedef struct _pk11_hdr_t diff --git a/bootloader/hos/pkg2.c b/bootloader/hos/pkg2.c index 8be5439..290b6b6 100644 --- a/bootloader/hos/pkg2.c +++ b/bootloader/hos/pkg2.c @@ -57,7 +57,7 @@ enum kip_offset_section #include "pkg2_patches.inl" -static kip1_id_t *_kip_id_sets = _kip_ids; +static kip1_id_t *_kip_id_sets = (kip1_id_t *)_kip_ids; static u32 _kip_id_sets_cnt = ARRAY_SIZE(_kip_ids); void pkg2_get_ids(kip1_id_t **ids, u32 *entries) @@ -531,7 +531,7 @@ const char *pkg2_patch_kips(link_t *info, char *patch_names) // Check if there are patches to apply. bool patches_found = false; - kip1_patchset_t *patchset = _kip_id_sets[kip_id_idx].patchset; + const kip1_patchset_t *patchset = _kip_id_sets[kip_id_idx].patchset; while (patchset != NULL && patchset->name != NULL && !patches_found) { for (u32 i = 0; i < patches_num; i++) diff --git a/bootloader/hos/pkg2.h b/bootloader/hos/pkg2.h index a32355a..7bd2449 100644 --- a/bootloader/hos/pkg2.h +++ b/bootloader/hos/pkg2.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2018 naehrwert - * Copyright (c) 2018-2023 CTCaer + * Copyright (c) 2018-2024 CTCaer * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -43,11 +43,11 @@ typedef struct _kernel_patch_t u32 id; u32 off; u32 val; - u32 *ptr; + const u32 *ptr; } kernel_patch_t; #define KERNEL_PATCHSET_DEF(name, ...) \ - kernel_patch_t name[] = { \ + static const kernel_patch_t name[] = { \ __VA_ARGS__, \ {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, (u32 *)0xFFFFFFFF} \ } @@ -124,7 +124,7 @@ typedef struct _pkg2_kip1_info_t typedef struct _pkg2_kernel_id_t { u8 hash[8]; - kernel_patch_t *kernel_patchset; + const kernel_patch_t *kernel_patchset; } pkg2_kernel_id_t; #define KIP1_PATCH_SRC_NO_CHECK (char *)(-1) @@ -140,14 +140,14 @@ typedef struct _kip1_patch_t typedef struct _kip1_patchset_t { char *name; // NULL means end. - kip1_patch_t *patches; // NULL means not necessary. + const kip1_patch_t *patches; // NULL means not necessary. } kip1_patchset_t; typedef struct _kip1_id_t { const char *name; u8 hash[8]; - kip1_patchset_t *patchset; + const kip1_patchset_t *patchset; } kip1_id_t; void pkg2_get_newkern_info(u8 *kern_data); diff --git a/bootloader/hos/pkg2_patches.inl b/bootloader/hos/pkg2_patches.inl index a7ed3c3..8637051 100644 --- a/bootloader/hos/pkg2_patches.inl +++ b/bootloader/hos/pkg2_patches.inl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023 CTCaer + * Copyright (c) 2018-2024 CTCaer * Copyright (c) 2018 Atmosphère-NX * * This program is free software; you can redistribute it and/or modify it @@ -63,37 +63,37 @@ #define ID_RCV_OFF_1101 0x22B28 #define ID_RCV_OFF_1200 0x23424 -static u32 PRC_ID_SND_100[] = +static const u32 PRC_ID_SND_100[] = { 0xA9BF2FEA, 0x2A0E03EB, 0xD37EF56B, 0xF86B6B8B, 0x92FFFFE9, 0x8A090168, 0xD2FFFFE9, 0x8A09016B, 0xD2FFFFC9, 0xEB09017F, 0x54000040, 0xF9412948, 0xA8C12FEA }; #define CODE_OFF_2ND_100 (CODE_OFF_1ST_100 + sizeof(PRC_ID_SND_100) + sizeof(u32)) -static u32 PRC_ID_RCV_100[] = +static const u32 PRC_ID_RCV_100[] = { 0xA9BF2FEA, 0x2A1C03EA, 0xD37EF54A, 0xF86A69AA, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000040, 0xF9412968, 0xA8C12FEA }; -static u32 PRC_ID_SND_200[] = +static const u32 PRC_ID_SND_200[] = { 0xA9BF2FEA, 0x2A1803EB, 0xD37EF56B, 0xF86B6B8B, 0x92FFFFE9, 0x8A090168, 0xD2FFFFE9, 0x8A09016B, 0xD2FFFFC9, 0xEB09017F, 0x54000040, 0xF9413148, 0xA8C12FEA }; #define CODE_OFF_2ND_200 (CODE_OFF_1ST_200 + sizeof(PRC_ID_SND_200) + sizeof(u32)) -static u32 PRC_ID_RCV_200[] = +static const u32 PRC_ID_RCV_200[] = { 0xA9BF2FEA, 0x2A0F03EA, 0xD37EF54A, 0xF9405FEB, 0xF86A696A, 0xF9407BEB, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000040, 0xF9413168, 0xA8C12FEA }; -static u32 PRC_ID_SND_300[] = +static const u32 PRC_ID_SND_300[] = { 0xA9BF2FEA, 0x2A1803EB, 0xD37EF56B, 0xF86B6B8B, 0x92FFFFE9, 0x8A090168, 0xD2FFFFE9, 0x8A09016B, 0xD2FFFFC9, 0xEB09017F, 0x54000040, 0xF9415548, 0xA8C12FEA }; #define CODE_OFF_2ND_300 (CODE_OFF_1ST_300 + sizeof(PRC_ID_SND_300) + sizeof(u32)) -static u32 PRC_ID_RCV_300[] = +static const u32 PRC_ID_RCV_300[] = { 0xA9BF2FEA, 0x2A0F03EA, 0xD37EF54A, 0xF9405FEB, 0xF86A696A, 0xF9407BEB, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000040, 0xF9415568, 0xA8C12FEA @@ -101,52 +101,52 @@ static u32 PRC_ID_RCV_300[] = #define CODE_OFF_2ND_302 (CODE_OFF_1ST_302 + sizeof(PRC_ID_SND_300) + sizeof(u32)) -static u32 PRC_ID_SND_400[] = +static const u32 PRC_ID_SND_400[] = { 0x2A1703EA, 0xD37EF54A, 0xF86A6B8A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000060, 0xF94053EA, 0xF9415948, 0xF94053EA }; #define CODE_OFF_2ND_400 (CODE_OFF_1ST_400 + sizeof(PRC_ID_SND_400) + sizeof(u32)) -static u32 PRC_ID_RCV_400[] = +static const u32 PRC_ID_RCV_400[] = { 0xF9403BED, 0x2A0E03EA, 0xD37EF54A, 0xF86A69AA, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000040, 0xF9415B28, 0xD503201F }; -static u32 PRC_ID_SND_500[] = +static const u32 PRC_ID_SND_500[] = { 0x2A1703EA, 0xD37EF54A, 0xF86A6B6A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000060, 0xF94043EA, 0xF9415948, 0xF94043EA }; #define CODE_OFF_2ND_500 (CODE_OFF_1ST_500 + sizeof(PRC_ID_SND_500) + sizeof(u32)) -static u32 PRC_ID_RCV_500[] = +static const u32 PRC_ID_RCV_500[] = { 0xF9403BED, 0x2A1503EA, 0xD37EF54A, 0xF86A69AA, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000040, 0xF9415B08, 0xF9406FEA }; -static u32 PRC_ID_SND_600[] = +static const u32 PRC_ID_SND_600[] = { 0xA9BF2FEA, 0xF94037EB, 0x2A1503EA, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF9400308, 0xF9401D08, 0xAA1803E0, 0xD63F0100, 0xA8C127E8, 0xAA0003E8, 0xA8C12FEA, 0xAA0803E0 }; #define CODE_OFF_2ND_600 (CODE_OFF_1ST_600 + sizeof(PRC_ID_SND_600) + sizeof(u32)) -static u32 PRC_ID_RCV_600[] = +static const u32 PRC_ID_RCV_600[] = { 0xA9BF2FEA, 0xF94043EB, 0x2A1503EA, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF9400308, 0xF9401D08, 0xAA1803E0, 0xD63F0100, 0xA8C127E8, 0xAA0003E8, 0xA8C12FEA, 0xAA0803E0 }; -static u32 PRC_ID_SND_700[] = +static const u32 PRC_ID_SND_700[] = { 0xA9BF2FEA, 0xF9403BEB, 0x2A1903EA, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF94002A8, 0xF9401D08, 0xAA1503E0, 0xD63F0100, 0xA8C127E8, 0xAA0003E8, 0xA8C12FEA, 0xAA0803E0 }; #define CODE_OFF_2ND_700 (CODE_OFF_1ST_700 + sizeof(PRC_ID_SND_700) + sizeof(u32)) -static u32 PRC_ID_RCV_700[] = +static const u32 PRC_ID_RCV_700[] = { 0xA9BF2FEA, 0xF9404FEB, 0x2A1603EA, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF9400368, 0xF9401D08, 0xAA1B03E0, @@ -155,56 +155,56 @@ static u32 PRC_ID_RCV_700[] = #define CODE_OFF_2ND_800 (CODE_OFF_1ST_800 + sizeof(PRC_ID_SND_700) + sizeof(u32)) -static u32 PRC_ID_SND_900[] = +static const u32 PRC_ID_SND_900[] = { 0xA9BF2FEA, 0xF94037EB, 0x2A1603EA, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF94002E8, 0xF9401D08, 0xAA1703E0, 0xD63F0100, 0xA8C127E8, 0xAA0003E8, 0xA8C12FEA, 0xAA0803E0 }; #define CODE_OFF_2ND_900 (CODE_OFF_1ST_900 + sizeof(PRC_ID_SND_900) + sizeof(u32)) -static u32 PRC_ID_RCV_900[] = +static const u32 PRC_ID_RCV_900[] = { 0xA9BF2FEA, 0xF9404BEB, 0x2A1703EA, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF9400368, 0xF9401D08, 0xAA1B03E0, 0xD63F0100, 0xA8C127E8, 0xAA0003E8, 0xA8C12FEA, 0xAA0803E0 }; -static u32 PRC_ID_SND_1000[] = +static const u32 PRC_ID_SND_1000[] = { 0xA9BF2FEA, 0xF94063EB, 0x2A1603EA, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF94002E8, 0xF9401D08, 0xAA1703E0, 0xD63F0100, 0xA8C127E8, 0xAA0003E8, 0xA8C12FEA, 0xAA0803E0 }; #define CODE_OFF_2ND_1000 (CODE_OFF_1ST_1000 + sizeof(PRC_ID_SND_1000) + sizeof(u32)) -static u32 PRC_ID_RCV_1000[] = +static const u32 PRC_ID_RCV_1000[] = { 0xA9BF2FEA, 0xF94067EB, 0x2A1A03EA, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF9400388, 0xF9401D08, 0xAA1C03E0, 0xD63F0100, 0xA8C127E8, 0xAA0003E8, 0xA8C12FEA, 0xAA0803E0 }; -static u32 PRC_ID_SND_1100[] = +static const u32 PRC_ID_SND_1100[] = { 0xA9BF2FEA, 0xF94043EB, 0x5280006A, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF94002A8, 0xF9401D08, 0xAA1503E0, 0xD63F0100, 0xA8C127E8, 0xAA0003E8, 0xA8C12FEA, 0xAA0803E0 }; #define CODE_OFF_2ND_1100 (CODE_OFF_1ST_1100 + sizeof(PRC_ID_SND_1100) + sizeof(u32)) -static u32 PRC_ID_RCV_1100[] = +static const u32 PRC_ID_RCV_1100[] = { 0xA9BF2FEA, 0xF94073EB, 0x5280006A, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF9400308, 0xF9401D08, 0xAA1803E0, 0xD63F0100, 0xA8C127E8, 0xAA0003E8, 0xA8C12FEA, 0xAA0803E0 }; -static u32 PRC_ID_SND_1200[] = +static const u32 PRC_ID_SND_1200[] = { 0xA9BF2FEA, 0xF9404FEB, 0x5280006A, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF94002C8, 0xF9401D08, 0xAA1603E0, 0xD63F0100, 0xA8C127E8, 0xAA0003E8, 0xA8C12FEA, 0xAA0803E0 }; #define CODE_OFF_2ND_1200 (CODE_OFF_1ST_1200 + sizeof(PRC_ID_SND_1200) + sizeof(u32)) -static u32 PRC_ID_RCV_1200[] = +static const u32 PRC_ID_RCV_1200[] = { 0xA9BF2FEA, 0xF94073EB, 0x5280006A, 0xD37EF54A, 0xF86A696A, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000100, 0xA9BF27E8, 0xF9400388, 0xF9401D08, 0xAA1C03E0, @@ -448,354 +448,354 @@ static const pkg2_kernel_id_t _pkg2_kernel_ids[] = }; // All kip patch offsets are without the 0x100-sized header. -static kip1_patchset_t _fs_patches_100[] = { +static const kip1_patchset_t _fs_patches_100[] = { { "nogc", NULL }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_40x[] = { +static const kip1_patch_t _fs_nogc_40x[] = { { KPS(KIP_TEXT) | 0xA3458, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x72" }, { KPS(KIP_TEXT) | 0xAAB44, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_40x[] = { +static const kip1_patchset_t _fs_patches_40x[] = { { "nogc", _fs_nogc_40x }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_410[] = { +static const kip1_patch_t _fs_nogc_410[] = { { KPS(KIP_TEXT) | 0xA34BC, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x72" }, { KPS(KIP_TEXT) | 0xAABA8, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_410[] = { +static const kip1_patchset_t _fs_patches_410[] = { { "nogc", _fs_nogc_410 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_50x[] = { +static const kip1_patch_t _fs_nogc_50x[] = { { KPS(KIP_TEXT) | 0xCF3C4, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { KPS(KIP_TEXT) | 0xD73A0, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_50x[] = { +static const kip1_patchset_t _fs_patches_50x[] = { { "nogc", _fs_nogc_50x }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_510[] = { +static const kip1_patch_t _fs_nogc_510[] = { { KPS(KIP_TEXT) | 0xCF794, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { KPS(KIP_TEXT) | 0xD7770, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_510[] = { +static const kip1_patchset_t _fs_patches_510[] = { { "nogc", _fs_nogc_510 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_600[] = { +static const kip1_patch_t _fs_nogc_600[] = { { KPS(KIP_TEXT) | 0x12CC20, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x1538F4, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patch_t _fs_nogc_600_exfat[] = { +static const kip1_patch_t _fs_nogc_600_exfat[] = { { KPS(KIP_TEXT) | 0x138320, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x15EFF4, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_600[] = { +static const kip1_patchset_t _fs_patches_600[] = { { "nogc", _fs_nogc_600 }, { NULL, NULL } }; -static kip1_patchset_t _fs_patches_600_exfat[] = { +static const kip1_patchset_t _fs_patches_600_exfat[] = { { "nogc", _fs_nogc_600_exfat }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_700[] = { +static const kip1_patch_t _fs_nogc_700[] = { { KPS(KIP_TEXT) | 0x134160, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x15BF04, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patch_t _fs_nogc_700_exfat[] = { +static const kip1_patch_t _fs_nogc_700_exfat[] = { { KPS(KIP_TEXT) | 0x13F710, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x1674B4, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_700[] = { +static const kip1_patchset_t _fs_patches_700[] = { { "nogc", _fs_nogc_700 }, { NULL, NULL } }; -static kip1_patchset_t _fs_patches_700_exfat[] = { +static const kip1_patchset_t _fs_patches_700_exfat[] = { { "nogc", _fs_nogc_700_exfat }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_800[] = { +static const kip1_patch_t _fs_nogc_800[] = { { KPS(KIP_TEXT) | 0x136800, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x15EB94, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patch_t _fs_nogc_800_exfat[] = { +static const kip1_patch_t _fs_nogc_800_exfat[] = { { KPS(KIP_TEXT) | 0x141DB0, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x16A144, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_800[] = { +static const kip1_patchset_t _fs_patches_800[] = { { "nogc", _fs_nogc_800 }, { NULL, NULL } }; -static kip1_patchset_t _fs_patches_800_exfat[] = { +static const kip1_patchset_t _fs_patches_800_exfat[] = { { "nogc", _fs_nogc_800_exfat }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_900[] = { +static const kip1_patch_t _fs_nogc_900[] = { { KPS(KIP_TEXT) | 0x129420, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x143268, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_900[] = { +static const kip1_patchset_t _fs_patches_900[] = { { "nogc", _fs_nogc_900 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_910[] = { +static const kip1_patch_t _fs_nogc_910[] = { { KPS(KIP_TEXT) | 0x129430, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x143278, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_910[] = { +static const kip1_patchset_t _fs_patches_910[] = { { "nogc", _fs_nogc_910 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1000[] = { +static const kip1_patch_t _fs_nogc_1000[] = { { KPS(KIP_TEXT) | 0x13BE90, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x14DE08, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1000[] = { +static const kip1_patchset_t _fs_patches_1000[] = { { "nogc", _fs_nogc_1000 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1020[] = { +static const kip1_patch_t _fs_nogc_1020[] = { { KPS(KIP_TEXT) | 0x13C2F0, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x14E268, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1020[] = { +static const kip1_patchset_t _fs_patches_1020[] = { { "nogc", _fs_nogc_1020 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1100[] = { +static const kip1_patch_t _fs_nogc_1100[] = { { KPS(KIP_TEXT) | 0x1398B4, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x156EB8, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1100[] = { +static const kip1_patchset_t _fs_patches_1100[] = { { "nogc", _fs_nogc_1100 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1200[] = { +static const kip1_patch_t _fs_nogc_1200[] = { { KPS(KIP_TEXT) | 0x13EA24, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x155368, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1200[] = { +static const kip1_patchset_t _fs_patches_1200[] = { { "nogc", _fs_nogc_1200 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1203[] = { +static const kip1_patch_t _fs_nogc_1203[] = { { KPS(KIP_TEXT) | 0x13EB34, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x155478, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1203[] = { +static const kip1_patchset_t _fs_patches_1203[] = { { "nogc", _fs_nogc_1203 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1300[] = { +static const kip1_patch_t _fs_nogc_1300[] = { { KPS(KIP_TEXT) | 0x1425D0, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x159018, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1300[] = { +static const kip1_patchset_t _fs_patches_1300[] = { { "nogc", _fs_nogc_1300 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1310[] = { +static const kip1_patch_t _fs_nogc_1310[] = { { KPS(KIP_TEXT) | 0x142570, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x158FB8, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1310[] = { +static const kip1_patchset_t _fs_patches_1310[] = { { "nogc", _fs_nogc_1310 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1400[] = { +static const kip1_patch_t _fs_nogc_1400[] = { { KPS(KIP_TEXT) | 0x164230, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x18A2E8, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1400[] = { +static const kip1_patchset_t _fs_patches_1400[] = { { "nogc", _fs_nogc_1400 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1400_exfat[] = { +static const kip1_patch_t _fs_nogc_1400_exfat[] = { { KPS(KIP_TEXT) | 0x16F5B0, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x195668, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1400_exfat[] = { +static const kip1_patchset_t _fs_patches_1400_exfat[] = { { "nogc", _fs_nogc_1400_exfat }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1500[] = { +static const kip1_patch_t _fs_nogc_1500[] = { { KPS(KIP_TEXT) | 0x15ECE4, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x184158, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1500[] = { +static const kip1_patchset_t _fs_patches_1500[] = { { "nogc", _fs_nogc_1500 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1500_exfat[] = { +static const kip1_patch_t _fs_nogc_1500_exfat[] = { { KPS(KIP_TEXT) | 0x169C74, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x18F0E8, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1500_exfat[] = { +static const kip1_patchset_t _fs_patches_1500_exfat[] = { { "nogc", _fs_nogc_1500_exfat }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1600[] = { +static const kip1_patch_t _fs_nogc_1600[] = { { KPS(KIP_TEXT) | 0x160B70, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x1865D8, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1600[] = { +static const kip1_patchset_t _fs_patches_1600[] = { { "nogc", _fs_nogc_1600 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1600_exfat[] = { +static const kip1_patch_t _fs_nogc_1600_exfat[] = { { KPS(KIP_TEXT) | 0x16B850, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x1912B8, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1600_exfat[] = { +static const kip1_patchset_t _fs_patches_1600_exfat[] = { { "nogc", _fs_nogc_1600_exfat }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1603[] = { +static const kip1_patch_t _fs_nogc_1603[] = { { KPS(KIP_TEXT) | 0x160BC0, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x186628, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1603[] = { +static const kip1_patchset_t _fs_patches_1603[] = { { "nogc", _fs_nogc_1603 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1603_exfat[] = { +static const kip1_patch_t _fs_nogc_1603_exfat[] = { { KPS(KIP_TEXT) | 0x16B8A0, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x191308, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1603_exfat[] = { +static const kip1_patchset_t _fs_patches_1603_exfat[] = { { "nogc", _fs_nogc_1603_exfat }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1700[] = { +static const kip1_patch_t _fs_nogc_1700[] = { { KPS(KIP_TEXT) | 0x165100, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x18B048, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1700[] = { +static const kip1_patchset_t _fs_patches_1700[] = { { "nogc", _fs_nogc_1700 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1700_exfat[] = { +static const kip1_patch_t _fs_nogc_1700_exfat[] = { { KPS(KIP_TEXT) | 0x16FF60, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x195EA8, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1700_exfat[] = { +static const kip1_patchset_t _fs_patches_1700_exfat[] = { { "nogc", _fs_nogc_1700_exfat }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1800[] = { +static const kip1_patch_t _fs_nogc_1800[] = { { KPS(KIP_TEXT) | 0x164A50, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x18AE48, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1800[] = { +static const kip1_patchset_t _fs_patches_1800[] = { { "nogc", _fs_nogc_1800 }, { NULL, NULL } }; -static kip1_patch_t _fs_nogc_1800_exfat[] = { +static const kip1_patch_t _fs_nogc_1800_exfat[] = { { KPS(KIP_TEXT) | 0x16FAE0, 8, KIP1_PATCH_SRC_NO_CHECK, "\xE0\x03\x1F\x2A\xC0\x03\x5F\xD6" }, { KPS(KIP_TEXT) | 0x195ED8, 4, KIP1_PATCH_SRC_NO_CHECK, "\x14\x80\x80\x52" }, { 0, 0, NULL, NULL } }; -static kip1_patchset_t _fs_patches_1800_exfat[] = { +static const kip1_patchset_t _fs_patches_1800_exfat[] = { { "nogc", _fs_nogc_1800_exfat }, { NULL, NULL } }; // SHA256 hashes. -static kip1_id_t _kip_ids[] = +static const kip1_id_t _kip_ids[] = { { "FS", "\xde\x9f\xdd\xa4\x08\x5d\xd5\xfe", _fs_patches_100 }, // FS 1.0.0 { "FS", "\xfc\x3e\x80\x99\x1d\xca\x17\x96", _fs_patches_100 }, // FS 1.0.0 exFAT diff --git a/loader/loader.c b/loader/loader.c index 322a13d..2f8a148 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -37,7 +37,7 @@ const volatile ipl_ver_meta_t __attribute__((section ("._ipl_version"))) ipl_ver .rsvd1 = 0 }; -const volatile char __attribute__((section ("._octopus"))) octopus[] = +const char __attribute__((section ("._octopus"))) octopus[] = "\n" " ___\n" " .-' `'.\n" diff --git a/nyx/nyx_gui/frontend/fe_emmc_tools.c b/nyx/nyx_gui/frontend/fe_emmc_tools.c index c38d147..3562594 100644 --- a/nyx/nyx_gui/frontend/fe_emmc_tools.c +++ b/nyx/nyx_gui/frontend/fe_emmc_tools.c @@ -145,7 +145,7 @@ static int _dump_emmc_verify(emmc_tool_gui_t *gui, sdmmc_storage_t *storage, u32 u32 prevPct = 200; u32 sdFileSector = 0; int res = 0; - const char hexa[] = "0123456789abcdef"; + static const char hexa[] = "0123456789abcdef"; DWORD *clmt = NULL; u8 hashEm[SE_SHA_256_SIZE]; @@ -340,8 +340,8 @@ bool partial_sd_full_unmount = false; static int _dump_emmc_part(emmc_tool_gui_t *gui, char *sd_path, int active_part, sdmmc_storage_t *storage, emmc_part_t *part) { - const u32 FAT32_FILESIZE_LIMIT = 0xFFFFFFFF; - const u32 SECTORS_TO_MIB_COEFF = 11; + static const u32 FAT32_FILESIZE_LIMIT = 0xFFFFFFFF; + static const u32 SECTORS_TO_MIB_COEFF = 11; partial_sd_full_unmount = false; @@ -942,7 +942,7 @@ out: static int _restore_emmc_part(emmc_tool_gui_t *gui, char *sd_path, int active_part, sdmmc_storage_t *storage, emmc_part_t *part, bool allow_multi_part) { - const u32 SECTORS_TO_MIB_COEFF = 11; + static const u32 SECTORS_TO_MIB_COEFF = 11; u32 lba_end = part->lba_end; u32 totalSectors = part->lba_end - part->lba_start + 1; diff --git a/nyx/nyx_gui/frontend/gui_options.c b/nyx/nyx_gui/frontend/gui_options.c index 401704a..3d78007 100644 --- a/nyx/nyx_gui/frontend/gui_options.c +++ b/nyx/nyx_gui/frontend/gui_options.c @@ -545,7 +545,7 @@ static lv_res_t _preset_hue_action(lv_obj_t *btn) return LV_RES_OK; } -const u16 theme_colors[17] = { +static const u16 theme_colors[17] = { 4, 13, 23, 33, 43, 54, 66, 89, 124, 167, 187, 200, 208, 231, 261, 291, 341 }; @@ -740,7 +740,7 @@ static lv_res_t _create_mbox_clock_edit(lv_obj_t *btn) lv_obj_set_style(dark_bg, &mbox_darken); lv_obj_set_size(dark_bg, LV_HOR_RES, LV_VER_RES); - static const char * mbox_btn_map[] = { "\251", "\222Done", "\222Cancel", "\251", "" }; + static const char *mbox_btn_map[] = { "\251", "\222Done", "\222Cancel", "\251", "" }; lv_obj_t *mbox = lv_mbox_create(dark_bg, NULL); lv_mbox_set_recolor_text(mbox, true); lv_obj_set_width(mbox, LV_HOR_RES / 9 * 6); @@ -1032,7 +1032,7 @@ disabled_or_cal0_issue:; lv_obj_set_style(dark_bg, &mbox_darken); lv_obj_set_size(dark_bg, LV_HOR_RES, LV_VER_RES); - static const char * mbox_btn_map[] = { "\251", "\222OK", "\251", "" }; + static const char *mbox_btn_map[] = { "\251", "\222OK", "\251", "" }; lv_obj_t * mbox = lv_mbox_create(dark_bg, NULL); lv_mbox_set_recolor_text(mbox, true); lv_obj_set_width(mbox, LV_HOR_RES / 9 * 5); diff --git a/nyx/nyx_gui/frontend/gui_tools_partition_manager.c b/nyx/nyx_gui/frontend/gui_tools_partition_manager.c index 33fa0fa..2f8a05c 100644 --- a/nyx/nyx_gui/frontend/gui_tools_partition_manager.c +++ b/nyx/nyx_gui/frontend/gui_tools_partition_manager.c @@ -267,7 +267,7 @@ out: static void _create_gpt_partition(gpt_t *gpt, u8 *gpt_idx, u32 *curr_part_lba, u32 size_lba, char *name, int name_size) { - const u8 linux_part_guid[] = { 0xAF, 0x3D, 0xC6, 0x0F, 0x83, 0x84, 0x72, 0x47, 0x8E, 0x79, 0x3D, 0x69, 0xD8, 0x47, 0x7D, 0xE4 }; + static const u8 linux_part_guid[] = { 0xAF, 0x3D, 0xC6, 0x0F, 0x83, 0x84, 0x72, 0x47, 0x8E, 0x79, 0x3D, 0x69, 0xD8, 0x47, 0x7D, 0xE4 }; u8 random_number[16]; // Create GPT partition. @@ -1844,7 +1844,7 @@ static lv_res_t _action_slider_emu(lv_obj_t *slider) #define EMUMMC_32GB_FULL 29856 #define EMUMMC_64GB_FULL (59664 + 1) // 1MB extra for backup GPT. - const u32 rsvd_mb = 4 + 4 + 16 + 8; // BOOT0 + BOOT1 + 16MB offset + 8MB alignment. + static const u32 rsvd_mb = 4 + 4 + 16 + 8; // BOOT0 + BOOT1 + 16MB offset + 8MB alignment. u32 size; char lbl_text[64]; bool prev_emu_double = part_info.emu_double; diff --git a/nyx/nyx_gui/gfx/logos-gui.h b/nyx/nyx_gui/gfx/logos-gui.h index 00de294..de65974 100644 --- a/nyx/nyx_gui/gfx/logos-gui.h +++ b/nyx/nyx_gui/gfx/logos-gui.h @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2018-2024 CTCaer + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef _LOGOS_GUI_H_ #define _LOGOS_GUI_H_ @@ -374,7 +390,7 @@ const u8 touch_cursor_map[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -lv_img_dsc_t touch_cursor = { +const lv_img_dsc_t touch_cursor = { .header.always_zero = 0, .header.w = 33, .header.h = 33, @@ -385,7 +401,7 @@ lv_img_dsc_t touch_cursor = { #ifdef HEKATE_LOGO -lv_img_dsc_t hekate_logo = { +const lv_img_dsc_t hekate_logo = { .header.always_zero = 0, .header.w = 193, .header.h = 76, @@ -394,7 +410,7 @@ lv_img_dsc_t hekate_logo = { .data = (const uint8_t *)(NYX_RES_ADDR + 0x1D900), }; -lv_img_dsc_t ctcaer_logo = { +const lv_img_dsc_t ctcaer_logo = { .header.always_zero = 0, .header.w = 147, .header.h = 76, @@ -405,4 +421,4 @@ lv_img_dsc_t ctcaer_logo = { #endif -#endif \ No newline at end of file +#endif