forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[PRX] Hooking button action ingame - Help needed.

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Maku



Joined: 16 Jun 2009
Posts: 2

PostPosted: Tue Jun 16, 2009 5:46 pm    Post subject: [PRX] Hooking button action ingame - Help needed. Reply with quote

Hey,

Yesterday my Home button stopped working, and i had to disable it by plugin out the plug of the front panel, so I'm stuck with only standard buttons and SCREEN, NOTE, START and SELECT (this ones I were able to save ;).

Because it's kinda hard to do anything without the Home button, I've decided to write a small plugin which will hook into sceController_Service, and redirect RTRIGGER & LTRIGGER & SQUARE to Home button.

I've managed to get it working in VSH (by using: sceVshBridge_Driver), but I have problems getting this ingame. Basically, the only problem I have is that I can not use any of the special buttons (IE. i can redirect square to cross, but can not redirect square to volume up).

I've did some research and I found this:


Code:

/**
 * Enumeration for the digital controller buttons.
 *
 * @note PSP_CTRL_HOME, PSP_CTRL_NOTE, PSP_CTRL_SCREEN, PSP_CTRL_VOLUP, PSP_CTRL_VOLDOWN, PSP_CTRL_DISC, PSP_CTRL_WLAN_UP, PSP_CTRL_REMOTE, PSP_CTRL_MS can only be read in kernel mode
 */


It's possible that my plugin runs in user mode?

You can check the sources here:
http://pastebin.com/me40f019

BTW, please also take a look at the mydisplay thread, it doesn't print any data on the screen :s
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Tue Jun 16, 2009 11:30 pm    Post subject: Reply with quote

vshCtrlReadBufferPositive has privileges to read some of the the kernel mode buttons (Home etc). sceCtrl* cannot read these buttons.

Therefore you can send a fake Home press to VSH but not in games. For games you must patch the kernel version of sceCtrl* stuff and somewhere in the middle of that perform your button swaps. Actually the checking of special buttons is not done by games, but is done by other kernel mode firmware modules, so hooking the sceCtrl* syscalls is useless anyway.

Since only your Home button is not working, there is another thing you can do for games. You can patch the import of sceCtrlPeekBufferPositive in impose.prx using MAKE_CALL and send a fake Home button for some other button combination. Thus the Home screen can be made to show for another button.

The easier way is to use sceSysconSetDebugHandlers to hook the buttons. Here you can modify the pad_data similar to normal hook for any button. Look for Booster's syscon hook sample on how to do this.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group