[Logos] Optimize logos and save ~7KB

Additionally stop unneeded frees of menu logo to increase redrwaing performance.
This commit is contained in:
Kostas Missos 2019-03-08 00:08:39 +02:00
parent 72a81e7c2a
commit 4e7c39d6a0
6 changed files with 449 additions and 947 deletions

View file

@ -372,9 +372,6 @@ out2:;
return; return;
} }
#pragma GCC push_options
#pragma GCC optimize ("Os")
void config_bootdelay() void config_bootdelay()
{ {
gfx_clear_grey(&gfx_ctxt, 0x1B); gfx_clear_grey(&gfx_ctxt, 0x1B);
@ -652,5 +649,3 @@ void config_nogc()
return; return;
btn_wait(); btn_wait();
} }
#pragma GCC pop_options

View file

@ -46,9 +46,6 @@ extern void sd_unmount();
extern int sd_save_to_file(void *buf, u32 size, const char *filename); extern int sd_save_to_file(void *buf, u32 size, const char *filename);
extern void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage); extern void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage);
#pragma GCC push_options
#pragma GCC optimize ("Os")
void print_fuseinfo() void print_fuseinfo()
{ {
gfx_clear_partial_grey(&gfx_ctxt, 0x1B, 0, 1256); gfx_clear_partial_grey(&gfx_ctxt, 0x1B, 0, 1256);
@ -683,5 +680,3 @@ void bootrom_ipatches_info()
btn_wait(); btn_wait();
} }
} }
#pragma GCC pop_options

File diff suppressed because it is too large Load diff

View file

@ -26,9 +26,6 @@
#include "../gfx/gfx.h" #include "../gfx/gfx.h"
#pragma GCC push_options
#pragma GCC optimize ("Os")
/*#include "util.h" /*#include "util.h"
#define DPRINTF(...) gfx_printf(&gfx_con, __VA_ARGS__) #define DPRINTF(...) gfx_printf(&gfx_con, __VA_ARGS__)
#define DEBUG_PRINTING*/ #define DEBUG_PRINTING*/
@ -980,5 +977,3 @@ DPRINTF("INI1 encrypted\n");
memset(hdr->ctr, 0 , 0x10); memset(hdr->ctr, 0 , 0x10);
*(u32 *)hdr->ctr = 0x100 + sizeof(pkg2_hdr_t) + kernel_size + ini1_size; *(u32 *)hdr->ctr = 0x100 + sizeof(pkg2_hdr_t) + kernel_size + ini1_size;
} }
#pragma GCC pop_options

View file

@ -23,10 +23,8 @@
#include "ff.h" /* Declarations of FatFs API */ #include "ff.h" /* Declarations of FatFs API */
#include "diskio.h" /* Declarations of device I/O functions */ #include "diskio.h" /* Declarations of device I/O functions */
#include "../../gfx/gfx.h" #include "../../gfx/gfx.h"
extern gfx_ctxt_t gfx_ctxt;
extern gfx_con_t gfx_con;
#define EFSPRINTF(text, ...) print_error(); gfx_printf(&gfx_con, "%k"text"%k\n", 0xFFFFFF00, 0xFFFFFFFF); #define EFSPRINTF(text, ...) print_error(); gfx_printf(&gfx_con, "%k"text"%k\n", 0xFFFFFF00, 0xFFFFFFFF);
//#define EFSPRINTF(...) //#define EFSPRINTF(...)

View file

@ -383,7 +383,10 @@ int launch_payload(char *path, bool update)
if (!update) if (!update)
(*ext_payload_ptr)(); (*ext_payload_ptr)();
else else
{
EMC(EMC_SCRATCH0) |= EMC_HEKA_UPD;
(*update_ptr)(); (*update_ptr)();
}
} }
return 1; return 1;
@ -419,7 +422,7 @@ void launch_tools(u8 type)
if (!type) if (!type)
memcpy(dir, "bootloader/payloads", 20); memcpy(dir, "bootloader/payloads", 20);
else else
memcpy(dir, "bootloader/libtools", 20); memcpy(dir, "bootloader/modules", 19);
filelist = dirlist(dir, NULL, false); filelist = dirlist(dir, NULL, false);
@ -464,7 +467,7 @@ void launch_tools(u8 type)
} }
} }
else else
EPRINTF("No payloads or libraries found."); EPRINTF("No payloads or modules found.");
free(ments); free(ments);
free(filelist); free(filelist);
@ -478,9 +481,6 @@ void launch_tools(u8 type)
if (file_sec) if (file_sec)
{ {
#ifdef MENU_LOGO_ENABLE
free(Kc_MENU_LOGO);
#endif //MENU_LOGO_ENABLE
memcpy(dir + strlen(dir), "/", 2); memcpy(dir + strlen(dir), "/", 2);
memcpy(dir + strlen(dir), file_sec, strlen(file_sec) + 1); memcpy(dir + strlen(dir), file_sec, strlen(file_sec) + 1);
@ -494,10 +494,6 @@ void launch_tools(u8 type)
} }
else else
ianos_loader(true, dir, DRAM_LIB, NULL); ianos_loader(true, dir, DRAM_LIB, NULL);
#ifdef MENU_LOGO_ENABLE
Kc_MENU_LOGO = (u8 *)malloc(0x6000);
blz_uncompress_srcdest(Kc_MENU_LOGO_blz, SZ_MENU_LOGO_BLZ, Kc_MENU_LOGO, SZ_MENU_LOGO);
#endif //MENU_LOGO_ENABLE
} }
out: out:
@ -508,7 +504,7 @@ out:
} }
void launch_tools_payload() { launch_tools(0); } void launch_tools_payload() { launch_tools(0); }
void launch_tools_library() { launch_tools(1); } void launch_tools_module() { launch_tools(1); }
void ini_list_launcher() void ini_list_launcher()
{ {
@ -592,7 +588,7 @@ void ini_list_launcher()
} }
} }
else else
EPRINTF("No ini configs found."); EPRINTF("No extra configs found.");
free(ments); free(ments);
ini_free(&ini_list_sections); ini_free(&ini_list_sections);
} }
@ -603,10 +599,6 @@ void ini_list_launcher()
if (!cfg_sec) if (!cfg_sec)
goto out; goto out;
#ifdef MENU_LOGO_ENABLE
free(Kc_MENU_LOGO);
#endif //MENU_LOGO_ENABLE
if (payload_path) if (payload_path)
{ {
ini_free_section(cfg_sec); ini_free_section(cfg_sec);
@ -622,11 +614,6 @@ void ini_list_launcher()
btn_wait(); btn_wait();
} }
#ifdef MENU_LOGO_ENABLE
Kc_MENU_LOGO = (u8 *)malloc(0x6000);
blz_uncompress_srcdest(Kc_MENU_LOGO_blz, SZ_MENU_LOGO_BLZ, Kc_MENU_LOGO, SZ_MENU_LOGO);
#endif //MENU_LOGO_ENABLE
out: out:
ini_free_section(cfg_sec); ini_free_section(cfg_sec);
@ -683,7 +670,7 @@ void launch_firmware()
if (i < 6) if (i < 6)
{ {
ments[i].type = MENT_CAPTION; ments[i].type = MENT_CAPTION;
ments[i].caption = "No main configurations found..."; ments[i].caption = "No main configs found...";
ments[i].color = 0xFFFFDD00; ments[i].color = 0xFFFFDD00;
i++; i++;
} }
@ -742,9 +729,6 @@ void launch_firmware()
if (!(btn & BTN_POWER)) if (!(btn & BTN_POWER))
goto out; goto out;
} }
#ifdef MENU_LOGO_ENABLE
free(Kc_MENU_LOGO);
#endif //MENU_LOGO_ENABLE
if (payload_path) if (payload_path)
{ {
@ -758,11 +742,6 @@ void launch_firmware()
else if (!hos_launch(cfg_sec)) else if (!hos_launch(cfg_sec))
EPRINTF("Failed to launch firmware."); EPRINTF("Failed to launch firmware.");
#ifdef MENU_LOGO_ENABLE
Kc_MENU_LOGO = (u8 *)malloc(0x6000);
blz_uncompress_srcdest(Kc_MENU_LOGO_blz, SZ_MENU_LOGO_BLZ, Kc_MENU_LOGO, SZ_MENU_LOGO);
#endif //MENU_LOGO_ENABLE
out: out:
ini_free_section(cfg_sec); ini_free_section(cfg_sec);
sd_unmount(); sd_unmount();
@ -997,10 +976,6 @@ void auto_launch_firmware()
if (h_cfg.autoboot_list) if (h_cfg.autoboot_list)
ini_free(&ini_list_sections); ini_free(&ini_list_sections);
#ifdef MENU_LOGO_ENABLE
free(Kc_MENU_LOGO);
#endif //MENU_LOGO_ENABLE
if (b_cfg.boot_cfg & BOOT_CFG_FROM_LAUNCH) if (b_cfg.boot_cfg & BOOT_CFG_FROM_LAUNCH)
display_backlight_brightness(h_cfg.backlight, 0); display_backlight_brightness(h_cfg.backlight, 0);
else if (h_cfg.bootwait) else if (h_cfg.bootwait)
@ -1024,11 +999,6 @@ void auto_launch_firmware()
else else
hos_launch(cfg_sec); hos_launch(cfg_sec);
#ifdef MENU_LOGO_ENABLE
Kc_MENU_LOGO = (u8 *)malloc(ALIGN(SZ_MENU_LOGO, 0x10));
blz_uncompress_srcdest(Kc_MENU_LOGO_blz, SZ_MENU_LOGO_BLZ, Kc_MENU_LOGO, SZ_MENU_LOGO);
#endif //MENU_LOGO_ENABLE
out: out:
ini_free(&ini_sections); ini_free(&ini_sections);
if (h_cfg.autoboot_list) if (h_cfg.autoboot_list)
@ -1244,9 +1214,9 @@ void ipl_main()
gfx_init_ctxt(&gfx_ctxt, fb, 720, 1280, 720); gfx_init_ctxt(&gfx_ctxt, fb, 720, 1280, 720);
#ifdef MENU_LOGO_ENABLE #ifdef MENU_LOGO_ENABLE
Kc_MENU_LOGO = (u8 *)malloc(0x6000); Kc_MENU_LOGO = (u8 *)malloc(ALIGN(SZ_MENU_LOGO, 0x1000));
blz_uncompress_srcdest(Kc_MENU_LOGO_blz, SZ_MENU_LOGO_BLZ, Kc_MENU_LOGO, SZ_MENU_LOGO); blz_uncompress_srcdest(Kc_MENU_LOGO_blz, SZ_MENU_LOGO_BLZ, Kc_MENU_LOGO, SZ_MENU_LOGO);
#endif //MENU_LOGO_ENABLE #endif
gfx_con_init(&gfx_con, &gfx_ctxt); gfx_con_init(&gfx_con, &gfx_ctxt);