make config app not crash on launch

This commit is contained in:
olebeck 2025-07-04 01:53:06 +02:00
parent c89056c23e
commit cc897bb0fa
9 changed files with 83 additions and 157 deletions

View File

@ -733,12 +733,15 @@ if(VITA)
ScePafStdc_stub
)
set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2F00000000000101")
vita_create_self(isle-config.self isle-config
UNSAFE
STRIPPED
REL_OPTIMIZE
)
block()
set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2F00000000000101")
vita_create_self(isle-config.self isle-config
CONFIG CONFIG_vita/exports.yml
UNSAFE
STRIPPED
REL_OPTIMIZE
)
endblock()
include(${scepaf_external_SOURCE_DIR}/rco.cmake)
make_rco(CONFIG_vita/cxml/config_plugin.xml config_plugin.rco)

View File

@ -2,92 +2,23 @@
<resource version="0.1" type="normal" id="sample_plugin">
<pagetable>
<page id="page_main_bg">
<plane style="_sample_style_bg_image" id="_sample_widget_plane_bg_image">
<page id="page_main">
<plane style="style_plane_sample_black" id="plane_sample_black">
<layout_hint size="960, 544" />
<text style="_common_default_style_text" id="test_strings_id" label="msg_test_text">
<layout_hint adjust="2, 2" anchor="0, 0" align="0, 0" size="0, 0" pos="0, 0" />
</text>
</plane>
<plane style="_common_style_plane_transparent" id="_sample_widget_plane_main">
<layout_hint size="960, 544" />
<plane style="_common_style_plane_transparent" id="_sample_widget_plane_root">
<layout_hint size="960, 544" />
<list_view style="style_list_view" id="list_view">
<layout_hint align="0, 2, 0" size="960, 544, 0" pos="0, 0, 0" anchor="0, 2, 0" id="landscape" />
</list_view>
</plane>
<plane style="_common_style_plane_transparent" id="plane_sample_black_sub">
<layout_hint size="960, 544" />
<button sound="_common_sound_button_enter" style="_common_default_style_button" label="msg_test_button" id="_sample_widget_button">
<layout_hint pos="0, 0" size="200, 100" />
</button>
</plane>
<plane style="_common_style_plane_transparent" id="plane_sample_black_sub_2">
<!-- TODO: maybe create other page for this -->
<layout_hint size="960, 544" />
<box id="box">
<layout_box space="8" pos="0, 8" space_adjust="0" adjust="0, 0, 0" layout_type="2" children_align_x="2" size="780, 64, 0" />
<busyindicator style="_common_style_busyindicator_8" id="busyindicator" texture="_common_texture_busy">
<layout_hint size="32, 32, 0" />
</busyindicator>
<text style="_common_default_style_text" id="text" label="msg_wait">
<layout_hint align="1, 0, 0" adjust="2, 2, 0" size="780, 80" />
</text>
</box>
</plane>
<plane style="_common_style_plane_transparent" id="_sample_widget_system_update">
<!-- TODO: maybe create other page for this -->
<layout_hint size="960, 544" />
<progressbar style="_common_default_style_progressbar" label_pos_mode="4" id="progressbar" w_label="percentage_text" signal_anim="1">
<layout_hint pos="0, -35, 0" size="780, 44, 0" />
<text style="_common_style_text_progressbar_label" id="percentage_text">
<layout_hint adjust="2, 2" pos="0, 0" />
</text>
</progressbar>
</plane>
</plane>
<corner_button style="_common_style_corner_bottom_left" id="_sample_widget_corner_button_bottom_left" />
</page>
</pagetable>
<templatetable>
<template fast_open="1" id="_sample_template_list_item">
<list_item style="_common_style_list_item_transparent" id="list_item">
<layout_hint adjust="0, 2, 0" size="960, 70, 0" />
<button sound="_common_sound_button_enter" style="_style_button" id="button">
<layout_hint size="960, 70" />
<focus_hint focus_shape="3" />
</button>
</list_item>
</template>
</templatetable>
<styletable>
<style_plane planeobj="plane_obj1" id="_sample_style_bg_image">
<planeobj texture0="_sample_texture_bg_wave" id="plane_obj1" />
</style_plane>
<style_plane color="0, 0, 0, 0" planeobj="plane_obj1" id="style_plane_sample_black">
<style_plane color="0, 0, 0, 1" planeobj="plane_obj1" id="style_plane_sample_black">
<planeobj id="plane_obj1" />
</style_plane>
<style_list_view color="0, 0, 0, 0" id="style_list_view" sbar_v_margin="6, 6, 9" />
<style_button bg_obj="obj1" glow_obj="obj2" label_obj="txtobj" id="_style_button">
<planeobj texture0="_common_texture_list_70px" id="obj1" />
<planeobj texture0="_common_texture_list_glow_70px" id="obj2" />
<textobj font_size="24" bold="1" color="1, 1, 1, 1" word_wrap="1" align_x="1" align_y="1" ellipsis="0" emboss="0" id="txtobj" />
</style_button>
<style_text_box bottom_margin="8" color="1,1,1,1" glowobj="glowobj1" sound="_common_sound_text_box" right_margin="8" top_margin="8" left_margin="8" textobj="text_obj1" planeobj="plane_obj1" id="style_text_box_sample">
<textobj font_size="24" align_y="1" align_x="0" text_align="1" line_pitch="40" ellipsis="1" id="text_obj1" />
<planeobj texture0="_common_texture_text_box" id="plane_obj1" />
<planeobj texture0="_common_texture_checkbox_textbox_glow" blend="2" id="glowobj1" />
</style_text_box>
</styletable>
<!-- If the system language is set to a language not listed here, no text will be displayed on the button. -->

View File

@ -17,40 +17,41 @@ void operator delete(void *ptr, unsigned int n) {
int paf_main(void);
extern "C" {
typedef struct _ScePafInit { // size is 0x18
SceSize global_heap_size;
int a2;
int a3;
int cdlg_mode;
int heap_opt_param1;
int heap_opt_param2;
} ScePafInit;
typedef struct _ScePafInit { // size is 0x18
SceSize global_heap_size;
int a2;
int a3;
int cdlg_mode;
int heap_opt_param1;
int heap_opt_param2;
} ScePafInit;
int module_start(SceSize args, void *argp){
int load_res;
ScePafInit init_param;
SceSysmoduleOpt sysmodule_opt;
extern "C" int module_start(SceSize args, void *argp) {
int load_res;
ScePafInit init_param;
SceSysmoduleOpt sysmodule_opt;
init_param.global_heap_size = 0x1000000;
init_param.a2 = 0xEA60;
init_param.a3 = 0x40000;
init_param.cdlg_mode = 0;
init_param.heap_opt_param1 = 0;
init_param.heap_opt_param2 = 0;
init_param.global_heap_size = 0x1000000;
init_param.a2 = 0xEA60;
init_param.a3 = 0x40000;
init_param.cdlg_mode = 0;
init_param.heap_opt_param1 = 0;
init_param.heap_opt_param2 = 0;
load_res = 0xDEADBEEF;
sysmodule_opt.flags = 0;
sysmodule_opt.result = &load_res;
load_res = 0xDEADBEEF;
sysmodule_opt.flags = 0;
sysmodule_opt.result = &load_res;
int res = sceSysmoduleLoadModuleInternalWithArg(SCE_SYSMODULE_INTERNAL_PAF, sizeof(init_param), &init_param, &sysmodule_opt);
if((res | load_res) != 0){
sceClibPrintf("[PAF PRX Loader] Failed to load the PAF prx. (return value 0x%x, result code 0x%x )\n", res, load_res);
}
paf_main();
return SCE_KERNEL_START_SUCCESS;
int res = sceSysmoduleLoadModuleInternalWithArg(SCE_SYSMODULE_INTERNAL_PAF, sizeof(init_param), &init_param, &sysmodule_opt);
if((res | load_res) != 0){
sceClibPrintf("[PAF PRX Loader] Failed to load the PAF prx. (return value 0x%x, result code 0x%x )\n", res, load_res);
}
}
paf_main();
return SCE_KERNEL_START_SUCCESS;
}
extern "C" void _start() {
module_start(0, nullptr);
}

View File

@ -3,60 +3,43 @@
#include <paf.h>
paf::Framework *g_fw;
void *g_rootPage;
paf::Framework* g_fw;
paf::ui::Scene* g_rootPage;
void loadPluginCB(paf::Plugin *plugin){
paf::Plugin::PageOpenParam pageOpenParam;
pageOpenParam.option = paf::Plugin::PageOption_None;
{
paf::Plugin::PageOpenParam pageOpenParam;
pageOpenParam.option = paf::Plugin::PageOption_None;
paf::ui::Scene *pScene = plugin->PageOpen("page_main", pageOpenParam);
g_rootPage = pScene;
paf::ui::Scene *pScene = plugin->PageOpen("page_main", pageOpenParam);
g_rootPage = pScene;
paf::ui::Widget *pPlane = pScene->FindChild("plane_sample_black");
paf::ui::ProgressBar *pProgressbar = (paf::ui::ProgressBar *)pPlane->FindChild("progressbar");
pProgressbar->SetMinValue(0);
pProgressbar->SetMaxValue(100);
pProgressbar->SetValue(24, true);
wchar_t *msg_progressbar_text = plugin->GetString("msg_progressbar_text");
paf::ui::Text *pText = (paf::ui::Text *)pPlane->FindChild("progressbar_text");
pText->SetString(paf::wstring(msg_progressbar_text));
}
paf::ui::Widget *pText = pScene->FindChild("test_strings_id");
pText->SetString(L"Test Text");
}
int paf_main(void){
paf::Framework::InitParam fwParam;
fwParam.mode = paf::Framework::Mode_Normal;
{
paf::Framework::InitParam fwParam;
fwParam.mode = paf::Framework::Mode_Normal;
paf::Framework *paf_fw = new paf::Framework(fwParam);
if(paf_fw != NULL){
g_fw = paf_fw;
paf::Framework *paf_fw = new paf::Framework(fwParam);
if(paf_fw != NULL){
g_fw = paf_fw;
paf_fw->LoadCommonResourceSync();
paf_fw->LoadCommonResourceSync();
paf::Plugin::InitParam pluginParam;
paf::Plugin::InitParam pluginParam;
pluginParam.name = "config_plugin";
pluginParam.caller_name = "__main__";
pluginParam.resource_file = "app0:/config_plugin.rco";
pluginParam.init_func = NULL;
pluginParam.start_func = loadPluginCB;
pluginParam.stop_func = NULL;
pluginParam.exit_func = NULL;
pluginParam.name = "sample_plugin";
pluginParam.caller_name = "__main__";
pluginParam.resource_file = "app0:/sample_plugin.rco";
pluginParam.init_func = NULL;
pluginParam.start_func = loadPluginCB;
pluginParam.stop_func = NULL;
pluginParam.exit_func = NULL;
paf::Plugin::LoadSync(pluginParam);
paf_fw->Run();
}
paf::Plugin::LoadSync(pluginParam);
paf_fw->Run();
}
sceClibPrintf("[SAMPLE] Failed to run PAF instance\n");

View File

@ -275,6 +275,7 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char** argv)
char buffer[2048];
sceAppUtilAppEventParseLiveArea(&eventParam, buffer);
if (strstr(buffer, "-config")) {
sceClibPrintf("Loading Config App.\n");
sceAppMgrLoadExec("app0:/isle-config.self", NULL, NULL);
}
}

View File

@ -148,7 +148,9 @@ static void load_razor()
}
}
#else
bool load_razor() {}
bool load_razor() {
return true;
}
#endif
int gxm_library_init()

View File

@ -30,10 +30,15 @@ void main(
float isDirectional = uLights[i].direction.w;
float isPositional = uLights[i].position.w;
// TODO: make faster by removing the if statements
// directional
float3 pointLightVec = uLights[i].position.xyz - vViewPos;
float3 directionalLightVec = -uLights[i].direction.xyz;
float3 lightVec = normalize(lerp(pointLightVec, directionalLightVec, isDirectional));
float3 lightVec;
if (isDirectional) {
lightVec = -normalize(uLights[i].direction.xyz);
} else {
lightVec = uLights[i].position.xyz - vViewPos;
}
lightVec = normalize(lightVec);
// Diffuse contribution
float dotNL = max(dot(vNormal, lightVec), 0.0);