Advertising (This ad goes away for registered users. You can Login or Register)

PSP_CTRL_SCREEN, _HOME and kernel mode

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Jukki
Posts: 55
Joined: Fri Feb 04, 2011 7:28 pm

PSP_CTRL_SCREEN, _HOME and kernel mode

Post by Jukki » Thu Mar 06, 2014 10:04 pm

Long time no see everyone, sorry to bug you but i have been trying to search for info regarding this but cant seem to find it.

I would like to take use of the PSP_CTRL_SCREEN, PSP_CTRL_NOTE or PSP_CTRL_HOME buttons in my game since i am running out of buttons. What i have been able to conclude from the research is that i need to run the program in kernel mode in order to access those buttons. How ever I haven't been able to find how to actually do this.

Now here are my questions.

1. Is there any negative side effects on running the program on kernel mode?
2. Does anyone know any programs that take use of these buttons or any examples how to utilize them?

Thanks in advance :)
Advertising

User avatar
DS_Marine
Developer
Posts: 276
Joined: Wed Oct 10, 2012 1:32 pm
Location: Argentina
Contact:

Re: PSP_CTRL_SCREEN, _HOME and kernel mode

Post by DS_Marine » Fri Mar 07, 2014 12:01 am

This little prx by codestation can read the note button.(Well at least in VSH, haven't tried inside a game)
It's a plug-in, but it may give you some idea.

[HELP] Disable volume down button
Advertising
ImagePSP-Controlled drone
"Hackers don't have superpowers. Just a hackable PSP and a brain (ships by default on most humans models)" - A famous guy
Image

Jukki
Posts: 55
Joined: Fri Feb 04, 2011 7:28 pm

Re: PSP_CTRL_SCREEN, _HOME and kernel mode

Post by Jukki » Fri Mar 07, 2014 10:48 am

Thank you, however i have run in to a problem

I set the kernel mode as it was seemed to be done in the plugin by having the PSP_MODULE_INFO("imposeblk", PSP_MODULE_KERNEL, 0, 1);

and setting the

USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1

in makefile.


However now the game doesn't launch and either just freezes on the psp logo or returned and error message which doesn't seem to pop up anymore so cant tell which one it is.

Any idea whats going on?

User avatar
Infinite Chalupas
Posts: 92
Joined: Thu Feb 20, 2014 9:00 pm

Re: PSP_CTRL_SCREEN, _HOME and kernel mode

Post by Infinite Chalupas » Fri Mar 07, 2014 10:54 am

Jukki wrote:However now the game doesn't launch and either just freezes on the psp logo or returned and error message which doesn't seem to pop up anymore so cant tell which one it is.

Any idea whats going on?

You're not the only one. I've never been able to get a kernel mode game or module to load on my PSP. I kinda assumed it might have been a limitation of the 3001 series.

User avatar
DS_Marine
Developer
Posts: 276
Joined: Wed Oct 10, 2012 1:32 pm
Location: Argentina
Contact:

Re: PSP_CTRL_SCREEN, _HOME and kernel mode

Post by DS_Marine » Fri Mar 07, 2014 3:14 pm

I believe that what you have to do is start your game in user mode, put kernel stuff in a separate prx and load it.
ImagePSP-Controlled drone
"Hackers don't have superpowers. Just a hackable PSP and a brain (ships by default on most humans models)" - A famous guy
Image

Jukki
Posts: 55
Joined: Fri Feb 04, 2011 7:28 pm

Re: PSP_CTRL_SCREEN, _HOME and kernel mode

Post by Jukki » Fri Mar 07, 2014 6:32 pm

So i would need to create a plugin to enable the other buttons?

User avatar
hgoel0974
Retired Mod
Posts: 2155
Joined: Mon Jul 23, 2012 11:42 pm
Location: New York

Re: PSP_CTRL_SCREEN, _HOME and kernel mode

Post by hgoel0974 » Tue Mar 11, 2014 8:25 pm

more like use a plugin to actually interface them.
"If the truth is a cruel mistress, then a lie must be a nice girl"

Jukki
Posts: 55
Joined: Fri Feb 04, 2011 7:28 pm

Re: PSP_CTRL_SCREEN, _HOME and kernel mode

Post by Jukki » Tue Mar 11, 2014 10:26 pm

Hmm. Ok. Well now i have 2 more questions

1. Is there any way to run to plugin with the game?

2. How could i pass the button presses from the plugin to game?

User avatar
qwikrazor87
Guru
Posts: 2874
Joined: Sat Apr 21, 2012 1:23 pm
Location: The North Pole

Re: PSP_CTRL_SCREEN, _HOME and kernel mode

Post by qwikrazor87 » Tue Mar 11, 2014 11:41 pm

1. Is there any way to run to plugin with the game?
Add it to game.txt in ms0:/seplugins/.
2. How could i pass the button presses from the plugin to game?
You can hook the sceCtrlRead/PeekBufferPositive function for the game, you can use either kernel or user but it's better to use kernel so it won't interfere with the game's resources.
I'd give you more help but my laptop isn't in good condition right now, I'm on my Vita.
PSP 2001 - TA-085 - 6.61 PRO-C2
PS Vita 3G - PCH-1101 - 3.65 HENkaku Ensō
Alcatel phone - Android 8.1.0
Laptop - Toshiba Satellite L305D-S5974 - Ubuntu 16.04 LTS

Jukki
Posts: 55
Joined: Fri Feb 04, 2011 7:28 pm

Re: PSP_CTRL_SCREEN, _HOME and kernel mode

Post by Jukki » Wed Mar 12, 2014 4:34 pm

I was abe to get the home button to work with the plugin above and simply adding a check for the PSP_CTRL_HOME in my game. However the same way didnt work for note and screen buttons. I was aple to disaple their use in the plugin by adding:

Code: Select all

    if(!(curr_but & PSP_CTRL_HOME) && !(curr_but & PSP_CTRL_SCREEN)  && !(curr_but & PSP_CTRL_NOTE) ) {
        callback(curr_but, last_but, arg);
    }


I was think i would need to create the hook as you said, but I have never done plugin programing and I lack the knowledge how to create a hook to the PeekBufferPositive. Can someone point me to right dirrection?

Post Reply

Return to “Programming and Security”