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 in VSH: Button input disabled.

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



Joined: 22 Jan 2007
Posts: 23

PostPosted: Wed Feb 21, 2007 5:30 am    Post subject: PRX in VSH: Button input disabled. Reply with quote

Hey

I've built a PRX that simply renames a file with a button combination in the XMB (made from the SDK sample).
The XMB boots fine with the module loading, but the XMB's button input no longer works. (ie, I can't move around). However, all the file renaming works like a charm (I checked with USB).

What I've changed from the sample is the main function, added a library or two (for button input) and I've put "USE_PSPSDK_LIBC" as "0" (which I assume lets the app use the kernel's LIBC), which reduced the file size by 50% but made no difference to the operation of the module (still works, but the XMB's button input doesn't).


So, here's my question:
How can I re-enable the XMB's button input?
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Wed Feb 21, 2007 6:09 am    Post subject: Reply with quote

If you're using sceCtrlRead*, it will stop the normal keypress events in the VSH.

The trick is to use sceCtrlPeek* instead.
Back to top
View user's profile Send private message
pj1115



Joined: 22 Jan 2007
Posts: 23

PostPosted: Wed Feb 21, 2007 6:12 am    Post subject: Reply with quote

I haven't got that code.

I've only got

Code:

SceCtrlData pad; sceCtrlReadBufferPositive(&pad, 1);
if ((pad.Buttons & PSP_CTRL_HOME) && (pad.Buttons & PSP_CTRL_RTRIGGER)){
//code

}


EDIT: I see, sceCtrlReadBufferPositive should change to sceCtrlPeekBufferPositive?
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Feb 21, 2007 6:17 am    Post subject: Reply with quote

As pointed out already, replace sceCtrlReadBufferPositive with sceCtrlPeekBufferPositive, geez.
Back to top
View user's profile Send private message
pj1115



Joined: 22 Jan 2007
Posts: 23

PostPosted: Wed Feb 21, 2007 6:32 am    Post subject: Reply with quote

I noticed that, sorry if I peeved you off...

Oh, and it doesn't work. Well, it does, but the XMB will only work if one of the button combinations I'm using is being pressed.
For example, when the PSP boots, all I see is a black screen, but when I hold down [Home]+[R] or [Home]+[L] (both are the button inputs I've specified), the memory stick light constantly flashes, and the XMB boots. When I stop holding the buttons, it freezes until I hold them down again.

Can I rectify this?
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Feb 21, 2007 6:58 am    Post subject: Reply with quote

Urm how are you actually reading the key presses ? Are you just doing basically:
Code:
while(1) { /* Check Key Press */ }

If so then probably your are preventing other threads from running.
Back to top
View user's profile Send private message
pj1115



Joined: 22 Jan 2007
Posts: 23

PostPosted: Wed Feb 21, 2007 7:08 am    Post subject: Reply with quote

Yep, that's basicly what I'm doing.

How would be a better way?
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Feb 21, 2007 7:10 am    Post subject: Reply with quote

Either add some delay element to the loop, so do sceKernelDelayThread(100000) which will delay for a 10th of a second and give other threads a chance to do something, or implement the keypresses using the controller callback functions, which I dont fancy explaining ;)
Back to top
View user's profile Send private message
pj1115



Joined: 22 Jan 2007
Posts: 23

PostPosted: Wed Feb 21, 2007 7:14 am    Post subject: Reply with quote

Heh, I'll give the delay a go. Where should I put it in the loop? Before the key-press bit?

BTW, well done, 500 posts. :)

Finished, works good. Cheers, TyRaNiD and Insert_witty_name.
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