Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.1 | PSP] Generate PARAM.SFO / Fix HOME button #18

Open
wants to merge 5 commits into
base: main/2.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
Binary file removed PARAM.SFO
Binary file not shown.
6 changes: 5 additions & 1 deletion platform/psp/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ env.Command(
)

env.Command(
"#bin/EBOOT.PBP", "#bin/strip2.elf" ,"pack-pbp bin/EBOOT.PBP PARAM.SFO NULL NULL NULL NULL NULL bin/strip2.elf NULL"
"#bin/PARAM.SFO", "", "mksfoex -d MEMSIZE=1 Godot bin/PARAM.SFO"
)

env.Command(
"#bin/EBOOT.PBP", ["#bin/strip2.elf", "#bin/PARAM.SFO"] ,"pack-pbp bin/EBOOT.PBP bin/PARAM.SFO NULL NULL NULL NULL NULL bin/strip2.elf NULL"
)


30 changes: 27 additions & 3 deletions platform/psp/os_psp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,6 @@ void OS_PSP::process_keys() {

input->joy_axis(0, 0, 0, lx);
input->joy_axis(0, 0, 1, ly);

if(pad.Buttons & PSP_CTRL_HOME)
sceKernelExitGame();
}

void OS_PSP::delete_main_loop() {
Expand Down Expand Up @@ -371,6 +368,32 @@ void OS_PSP::set_cursor_shape(CursorShape p_shape) {
void OS_PSP::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
}

// Standard callback functions
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}

/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}

void OS_PSP::run() {

force_quit = false;
Expand All @@ -379,6 +402,7 @@ void OS_PSP::run() {
return;

main_loop->init();
SetupCallbacks();

while (!force_quit) {

Expand Down