Skip to: Site menu | Main content


Welcome to PSP-Programming.com, a place for developers to get together.

Welcome to the forums. Here you can find other user tutorials as well as homebrew releases and the source code repository. You can also ask for help with your code here and post your own homebrew!

PSP-Programming.com Forums
February 11, 2012, 01:32:32 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

News: Check out the Code Section!
Home Help Search Shop Login Register
Digg This!
Pages: [1]
Print
Author Topic: Button on XMB problem  (Read 550 times)
psp_holla
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 3
262.39 points

View Inventory
Send Money to psp_holla

View Profile
« on: January 10, 2010, 06:18:29 AM »

Hey! Guys,

I'm trying to write a program which would run on XMB.

I have to use PSP_CTRL_LEFT and PSP_CTRL_RIGHT. I can use them. But when I press those buttons, the menu items also changes like I'm browsing.

How do I disable those buttons for XMB, but not for my PRX?

I have search for this, but didn't find any answer yet. Please help.
Logged


U
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4
304.76 points

View Inventory
Send Money to U

View Profile
« Reply #1 on: February 06, 2010, 09:16:30 AM »

There is, as far as i know, only one way. You have to use sceCtrlPeekBufferPositive to wait for some key to "activate" your program. if it activates you start using sceCtrlReadBufferPositive. The only problem with this is that while your progam is active, your xmb stops redrawing   
this is my (simplified) code:
Code:
void show(){
 while (1){
  SceCtrlData pad;
  sceCtrlReadBufferPositive(&pad, 1);
  if(pad.Buttons & PSP_CTRL_CIRCLE) break;
 }
}
int main(void){
 SceCtrlData pad;
 while(1){
   sceCtrlPeekBufferPositive(&pad, 1);
   if (pad.Buttons & PSP_CTRL_SQUARE){
    show();
  }
    sceKernelDelayThread(2);
 }
}

Logged
Raphael
Global Moderator
Hero Member
*

Karma: +230/-10
Offline Offline

Posts: 1431
193700.11 points

View Inventory
Send Money to Raphael


View Profile WWW
« Reply #2 on: February 10, 2010, 03:08:06 AM »

That's the bruteforce "We deny the XMB to process anything because we hog the CPU" solution.
The only right solution is hooking the sceCtrl functions and masking out the buttons you wish to capture solely for your program.
Logged

Don't push the river, it flows.
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
http://www.homebrew-illuminati.co.uk - serious homebrew development for all platforms
Alexander Berl
"A good mod is a combination playground monitor, priest, big brother/sister, psychiatrist, professor and more."
Pages: [1]
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.25 seconds with 27 queries.
Sister Sites: Guitar Hero 4   BrokeniTouch.com