diff --git a/plugin/kernel/main.c b/plugin/kernel/main.c index 32a30a1..9b684af 100644 --- a/plugin/kernel/main.c +++ b/plugin/kernel/main.c @@ -148,7 +148,7 @@ static int livebanimthread(SceSize args, void *argp) { ksceIoRead(fd, flags, sizeof(flags)); uid = ksceKernelAllocMemBlock("SceDisplay", 0x6020D006, 0x200000, &optp); ksceKernelGetMemBlockBase(uid, (void**)&fb_addr); - ksceKernelCpuDcacheAndL2WritebackInvalidateRange(fb_addr, 0x1FE000); + memset(fb_addr, 0, 0x1FE000); yid = ksceKernelAllocMemBlock("temp_anim", SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW, 0x200000, NULL); ksceKernelGetMemBlockBase(yid, (void**)&gz_addr); ksceIoLseek(fd, 0, 0); @@ -246,6 +246,7 @@ static int LoadBootlogoSingle(void) { ksceIoGetstat("ur0:tai/boot_splash.img", &stat); uid = ksceKernelAllocMemBlock("SceDisplay", 0x6020D006, 0x200000, &optp); ksceKernelGetMemBlockBase(uid, (void**)&fb_addr); + memset(fb_addr, 0, 0x1FE000); if (stat.st_size < 0x1FE000) { yid = ksceKernelAllocMemBlock("gz", SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW, 0x200000, NULL); ksceKernelGetMemBlockBase(yid, (void**)&gz_addr); @@ -256,7 +257,6 @@ static int LoadBootlogoSingle(void) { ksceIoRead(fd, (void *)fb_addr, 0x1FE000); } ksceIoClose(fd); - ksceKernelCpuDcacheAndL2WritebackInvalidateRange(fb_addr, 0x1FE000); fb.size = sizeof(fb); fb.base = fb_addr; fb.pitch = 960; @@ -295,7 +295,7 @@ static int banimthread(SceSize args, void *argp) { ksceIoRead(fd, flags, sizeof(flags)); uid = ksceKernelAllocMemBlock("SceDisplay", 0x6020D006, 0x200000, &optp); ksceKernelGetMemBlockBase(uid, (void**)&fb_addr); - ksceKernelCpuDcacheAndL2WritebackInvalidateRange(fb_addr, 0x1FE000); + memset(fb_addr, 0, 0x1FE000); fb.base = fb_addr; ksceDisplaySetFrameBuf(&fb, 1); if (stat.st_size < 0x200000 && flags[2] == 0) { // optimized for small anims, copy to mem, then loop @@ -319,7 +319,10 @@ static int banimthread(SceSize args, void *argp) { curpos = curpos + sizeof(rsz); ksceGzipDecompress((void *)fb_addr, 0x1FE000, (void *)(gz_addr + curpos), NULL); curpos = curpos + csz; - if (flags[3] > 0) ksceKernelCpuDcacheAndL2WritebackInvalidateRange(fb_addr, 0x1FE000); + if (flags[3] > 0) { + ksceKernelCpuDcacheAndL2WritebackInvalidateRange(fb_addr, 0x1FE000); + memset(fb_addr, 0, 0x1FE000); + } ksceDisplayWaitVblankStart(); cur++; } @@ -351,7 +354,10 @@ static int banimthread(SceSize args, void *argp) { } else { ksceIoRead(fd, fb_addr, csz); } - if (flags[3] > 0) ksceKernelCpuDcacheAndL2WritebackInvalidateRange(fb_addr, 0x1FE000); + if (flags[3] > 0) { + ksceKernelCpuDcacheAndL2WritebackInvalidateRange(fb_addr, 0x1FE000); + memset(fb_addr, 0, 0x1FE000); + } ksceDisplayWaitVblankStart(); cur++; } @@ -361,21 +367,19 @@ static int banimthread(SceSize args, void *argp) { ksceKernelExitDeleteThread(0); return 1; } - + void _start() __attribute__ ((weak, alias ("module_start"))); int module_start(SceSize argc, const void *args){ - - static char uwu[4] = {0x30, 0x30, 0x30, 0}; // IMGTYPE, ION, DELAY, DELAYTIMESEC + static char uwu[4] = {0x30, 0x30, 0x30, 0x30}; // IMGTYPE, MAGIC1, MAGIC2, VER SceUID fd = ksceIoOpen("ur0:tai/cbs_cfg.bin", SCE_O_RDONLY, 0); if (fd < 0) return SCE_KERNEL_START_FAILED; ksceIoRead(fd, uwu, 4); ksceIoClose(fd); - if (uwu[1] != 0x31) - return SCE_KERNEL_START_FAILED; - - if (uwu[0] == 0x31 && ex("ur0:tai/boot_splash.img") == 1) { + if (uwu[0] == 0x30 || uwu[1] != 0x3C || uwu[2] != 0x3B || uwu[3] != 0x33) { + return SCE_KERNEL_START_SUCCESS; + } else if (uwu[0] == 0x31 && ex("ur0:tai/boot_splash.img") == 1) { LoadBootlogoSingle(); } else if (uwu[0] == 0x32 && ex("ur0:tai/boot_animation.img") == 1) { SceUID athid = ksceKernelCreateThread("b", banimthread, 0x00, 0x1000, 0, 0, 0); @@ -384,8 +388,6 @@ int module_start(SceSize argc, const void *args){ SceUID bthid = ksceKernelCreateThread("l", livebanimthread, 0x00, 0x1000, 0, 0, 0); ksceKernelStartThread(bthid, 0, NULL); } - - if (uwu[2] == 0x31) ksceKernelDelayThread(uwu[3] * 1000 * 1000); return SCE_KERNEL_START_SUCCESS; } diff --git a/plugin/user/theme_settings.xml b/plugin/user/theme_settings.xml index 8e2bf81..cfb77c0 100644 --- a/plugin/user/theme_settings.xml +++ b/plugin/user/theme_settings.xml @@ -9,32 +9,14 @@ - - - - - - - - - - - - - - - + + + + + + diff --git a/plugin/user/user.c b/plugin/user/user.c index 72c735c..f05bd68 100644 --- a/plugin/user/user.c +++ b/plugin/user/user.c @@ -10,21 +10,7 @@ #define CONFIG_PATH "ur0:tai/cbs_cfg.bin" -#define LOG(...) \ - do { \ - char buffer[256]; \ - sceClibSnprintf(buffer, sizeof(buffer), ##__VA_ARGS__); \ - logg(buffer, sceClibStrnlen(buffer, sizeof(buffer)), "ur0:temp/xmldmp.raw", 2); \ -} while (0) - -#define LOG_START(...) \ - do { \ - char buffer[256]; \ - sceClibSnprintf(buffer, sizeof(buffer), ##__VA_ARGS__); \ - logg(buffer, sceClibStrnlen(buffer, sizeof(buffer)), "ur0:temp/xmldmp.raw", 1); \ -} while (0) - -static char cfg[4] = {0x30, 0x30, 0x30, 0}; // IMGTYPE, ION, DELAY, DELAYTIMESEC +static char cfg[4] = {0x30, 0x3C, 0x3B, 0x33}; // IMGTYPE, ION, DELAY, DELAYTIMESEC extern unsigned char _binary_theme_settings_xml_start; extern unsigned char _binary_theme_settings_xml_size; @@ -64,6 +50,10 @@ static int load_config_user(void) { if (fd >= 0) { sceIoRead(fd, &cfg, sizeof(cfg)); sceIoClose(fd); + if (cfg[3] != 0x33) { + cfg[0] = 0x30, cfg[1] = 0x3C, cfg[2] = 0x3B, cfg[3] = 0x33; + save_config_user(); + } return 0; } save_config_user(); @@ -75,15 +65,8 @@ static int sceRegMgrGetKeyInt_SceSystemSettingsCore_patched(const char *category if (sceClibStrncmp(category, "/CONFIG/CBSM", 12) == 0) { if (value) { load_config_user(); - if (sceClibStrncmp(name, "imgt", 4) == 0) { + if (sceClibStrncmp(name, "imgt", 4) == 0) *value = (cfg[0] - 0x30); - } else if (sceClibStrncmp(name, "ion", 3) == 0) { - *value = (cfg[1] - 0x30); - } else if (sceClibStrncmp(name, "dfl", 3) == 0) { - *value = (cfg[2] - 0x30); - } else if (sceClibStrncmp(name, "deltime", 7) == 0) { - *value = cfg[3]; - } } return 0; } @@ -93,15 +76,8 @@ static int sceRegMgrGetKeyInt_SceSystemSettingsCore_patched(const char *category static tai_hook_ref_t g_sceRegMgrSetKeyInt_SceSystemSettingsCore_hook; static int sceRegMgrSetKeyInt_SceSystemSettingsCore_patched(const char *category, const char *name, int value) { if (sceClibStrncmp(category, "/CONFIG/CBSM", 12) == 0) { - if (sceClibStrncmp(name, "imgt", 4) == 0) { + if (sceClibStrncmp(name, "imgt", 4) == 0) cfg[0] = (value + 0x30); - } else if (sceClibStrncmp(name, "ion", 3) == 0) { - cfg[1] = (value + 0x30); - } else if (sceClibStrncmp(name, "dfl", 3) == 0) { - cfg[2] = (value + 0x30); - } else if (sceClibStrncmp(name, "deltime", 7) == 0) { - cfg[3] = value; - } save_config_user(); return 0; } @@ -179,7 +155,6 @@ static int sceKernelStopUnloadModule_SceSettings_patched(SceUID modid, SceSize a void _start() __attribute__ ((weak, alias ("module_start"))); int module_start(SceSize argc, const void *args) { - LOG_START("started"); sceClibMemset(&cfg, 0, sizeof(cfg)); load_config_user(); g_hooks[0] = taiHookFunctionImport(&g_sceKernelLoadStartModule_SceSettings_hook,