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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix HOME button (show xmb exit menu instead of leaving instantly)
antim0118 committed Mar 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d17152150b2eed85c0e5b2a3f5c67704b6ba6784
30 changes: 27 additions & 3 deletions platform/psp/os_psp.cpp
Original file line number Diff line number Diff line change
@@ -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() {
@@ -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;
@@ -379,6 +402,7 @@ void OS_PSP::run() {
return;

main_loop->init();
SetupCallbacks();

while (!force_quit) {