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 

Note, Vol Up, Vol Down Button Input?

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



Joined: 11 Dec 2007
Posts: 18
Location: Australia

PostPosted: Sat Sep 26, 2009 9:13 pm    Post subject: Note, Vol Up, Vol Down Button Input? Reply with quote

Hi,
I was wondering how to get Note, Vol Up, Vol Down input.
In pspctrl.h I noticed "@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"

I have no idea how to achieve this so I was hoping someone would take pity on me and post an example?

The code for my application can be found at svn://nicksplace.com.au/public/UniMote

Thanks,
Darky
Back to top
View user's profile Send private message Visit poster's website
jojojoris



Joined: 30 Mar 2008
Posts: 261

PostPosted: Sat Sep 26, 2009 10:44 pm    Post subject: Reply with quote

You need to run your app in kernel mode.
_________________
Code:
int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
Back to top
View user's profile Send private message
darksaboteur



Joined: 11 Dec 2007
Posts: 18
Location: Australia

PostPosted: Sat Sep 26, 2009 10:50 pm    Post subject: Ok Reply with quote

I figured that would be the case.
Is there any disadvantages to this? The application is not designed for 1.5, I use it under a 5.xx kernel. It won't affect any of the my existing code?
Would you be able to point me to some examples of how to do this?

Sorry for the all the questions

Thanks,
Darky
Back to top
View user's profile Send private message Visit poster's website
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Sat Sep 26, 2009 11:17 pm    Post subject: Reply with quote

where you define the module, which maybe 0, 1, 0 or something change the firstt number to:

0x800 for vsh mode (those buttons will work in this mode) or,
0x1000 for kernal.
Back to top
View user's profile Send private message Visit poster's website
darksaboteur



Joined: 11 Dec 2007
Posts: 18
Location: Australia

PostPosted: Sat Sep 26, 2009 11:24 pm    Post subject: Doesn't Work Reply with quote

After adding 0x800 to PSP_MODULE_INFO("UniMote", 0x800, 1, 1);
I get "The game could not be started (80020148)"

Thanks,
Darky
Back to top
View user's profile Send private message Visit poster's website
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Sat Sep 26, 2009 11:33 pm    Post subject: Reply with quote

Hi! :)

To use a kernel function in 3.x code you need to put the kernel calls in a prx.
See here for a sample:
http://forums.ps2dev.org/viewtopic.php?t=12441

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
darksaboteur



Joined: 11 Dec 2007
Posts: 18
Location: Australia

PostPosted: Sun Sep 27, 2009 2:05 am    Post subject: Having A Few Troubles... Reply with quote

Ok, I have tried to make a prx and am failing :(
I get 'main.cpp:(.text+0x1064): undefined reference to `setSamplingCycle(int)'
setSamplingCycle(int) is the function I created the in prx.
I have followed the samples and looked around on the net to no avail.
I can post full source if anyone is interested...

Thanks again,
Darky
Back to top
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sun Sep 27, 2009 2:54 am    Post subject: Reply with quote

This is the clearest example of making a kernel mode PRX for a user mode application. If you can't figure it out from this, you aren't ready to work on this yourself.

http://forums.ps2dev.org/viewtopic.php?p=58653#58653
Back to top
View user's profile Send private message AIM Address
darksaboteur



Joined: 11 Dec 2007
Posts: 18
Location: Australia

PostPosted: Sun Sep 27, 2009 1:10 pm    Post subject: Reply with quote

I have read many samples and tutorials and they all work.
Interestingly if I rename main.c to main.cpp in the samples they get the same error my application gets during compilation. (mine is cpp).
So it seems to be related to it being a cpp application?
Does it need something different in the makefile or something along those lines?

Thanks again,
Darky
Back to top
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Sep 28, 2009 2:14 am    Post subject: Reply with quote

If you look at the main.cpp in Basilisk II PSP, you'll see that parts of the PSP init junk has to be wrapped in extern "C" { } to work correctly... like the callback setup junk. You simply cannot change the main from C to C++ and have it work.

Look at some of the PSP C++ apps out.
Back to top
View user's profile Send private message AIM Address
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