Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions data/sce_sys/README.md
Original file line number Diff line number Diff line change
@@ -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/).
3 changes: 3 additions & 0 deletions data/sce_sys/icon0_patch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions patch-web/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
28 changes: 24 additions & 4 deletions patch-web/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "../shared/file.h"

#include <generated/icon0_png.inc.h>
#include <generated/icon0_patch_png.inc.h>

// must be in this order
#pragma comment(lib, "SceIpmi")
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
}