[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;
}
#pragma GCC push_options
#pragma GCC optimize ("Os")
void config_bootdelay()
{
gfx_clear_grey(&gfx_ctxt, 0x1B);
@ -652,5 +649,3 @@ void config_nogc()
return;
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 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()
{
gfx_clear_partial_grey(&gfx_ctxt, 0x1B, 0, 1256);
@ -683,5 +680,3 @@ void bootrom_ipatches_info()
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"
#pragma GCC push_options
#pragma GCC optimize ("Os")
/*#include "util.h"
#define DPRINTF(...) gfx_printf(&gfx_con, __VA_ARGS__)
#define DEBUG_PRINTING*/
@ -980,5 +977,3 @@ DPRINTF("INI1 encrypted\n");
memset(hdr->ctr, 0 , 0x10);
*(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 "diskio.h" /* Declarations of device I/O functions */
#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(...)

View file

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