diff --git a/data/sce_sys/README.md b/data/sce_sys/README.md new file mode 100644 index 0000000..2e0a218 --- /dev/null +++ b/data/sce_sys/README.md @@ -0,0 +1,11 @@ +# Asset Info + +## icon0_patch.png + +### Credits + +- Models: + - "Phillips" (https://free3d.com/3d-model/-phillips--175759.html) by printable_models is licensed under Personal Use License + - "Electrical tape" (https://sketchfab.com/3d-models/electrical-tape-5b27071046ba45deace04fd5a494a859) by Hxnterr is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/). + - "Playstation 4 Pro" (https://sketchfab.com/3d-models/playstation-4-pro-b99fda6d86e2436c96d62b97a33d1120) by Sean Eisenhardt is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/). + - "PS5" (https://sketchfab.com/3d-models/ps5-d788de3735964151a3e24fd59c0f1956) by rtql8d is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/). diff --git a/data/sce_sys/icon0_patch.png b/data/sce_sys/icon0_patch.png new file mode 100644 index 0000000..e250574 --- /dev/null +++ b/data/sce_sys/icon0_patch.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7306ce6adc2cac60292f2172515ad6d80a51e8cbcb5e1cb50455e74baa58ffa3 +size 182420 diff --git a/patch-web/CMakeLists.txt b/patch-web/CMakeLists.txt index 2aed707..16bca01 100644 --- a/patch-web/CMakeLists.txt +++ b/patch-web/CMakeLists.txt @@ -21,8 +21,13 @@ embed_files(${PROJECT_NAME} assets/roboto-v51-latin-regular.woff2 assets/roboto-v51-latin-500.woff2 assets/roboto-mono-v31-latin-regular.woff2 +) +if(DEFINED PROSPERO) +embed_files(${PROJECT_NAME} ../data/sce_sys/icon0.png + ../data/sce_sys/icon0_patch.png ) +endif() include(optimization-settings) diff --git a/patch-web/install.c b/patch-web/install.c index df96202..494363c 100644 --- a/patch-web/install.c +++ b/patch-web/install.c @@ -18,6 +18,7 @@ #include "../shared/file.h" #include +#include // must be in this order #pragma comment(lib, "SceIpmi") @@ -50,7 +51,15 @@ static int install_file(const char* path, const void* data, const size_t size) return write_file(path, data, size); } -static int install_shortcut(const char* title_id, const char* url, const char* friendly_name) +typedef struct img_data +{ + const void* m_icon0; + const size_t m_icon0_len; + const void* m_pic0; + const size_t m_pic0_len; +} img_data; + +static int install_shortcut(const char* title_id, const char* url, const char* friendly_name, const img_data* pImg) { struct d { @@ -114,8 +123,15 @@ static int install_shortcut(const char* title_id, const char* url, const char* f { return -1; } - snprintf_clear(d.path, _countof_1(d.path), "/user/app/%s/sce_sys/icon0.png", title_id); - if (install_file(d.path, icon0_png_data, sizeof(icon0_png_data))) + if (pImg->m_icon0 && pImg->m_icon0_len) + { + snprintf_clear(d.path, _countof_1(d.path), "/user/app/%s/sce_sys/icon0.png", title_id); + if (install_file(d.path, pImg->m_icon0, pImg->m_icon0_len)) + { + return -1; + } + } + if (pImg->m_pic0 && pImg->m_pic0_len) { return -1; } @@ -128,5 +144,9 @@ static int install_shortcut(const char* title_id, const char* url, const char* f int install_launcher(void) { - return install_shortcut("ILNY26228", "http://127.0.0.1:" xstr(WEB_PORT), "Patch Manager"); + const img_data icon = { + .m_icon0 = icon0_patch_png_data, + .m_icon0_len = sizeof(icon0_patch_png_data), + }; + return install_shortcut("ILNY26228", "http://127.0.0.1:" xstr(WEB_PORT), "Patch Manager", &icon); }