| View previous topic :: View next topic |
| Author |
Message |
darksaboteur

Joined: 11 Dec 2007 Posts: 18 Location: Australia
|
Posted: Sat Sep 26, 2009 9:13 pm Post subject: Note, Vol Up, Vol Down Button Input? |
|
|
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 |
|
 |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Sat Sep 26, 2009 10:44 pm Post subject: |
|
|
You need to run your app in kernel mode. _________________
| Code: | int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
} |
|
|
| Back to top |
|
 |
darksaboteur

Joined: 11 Dec 2007 Posts: 18 Location: Australia
|
Posted: Sat Sep 26, 2009 10:50 pm Post subject: Ok |
|
|
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 |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Sat Sep 26, 2009 11:17 pm Post subject: |
|
|
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 |
|
 |
darksaboteur

Joined: 11 Dec 2007 Posts: 18 Location: Australia
|
Posted: Sat Sep 26, 2009 11:24 pm Post subject: Doesn't Work |
|
|
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 |
|
 |
sakya
Joined: 28 Apr 2006 Posts: 190
|
|
| Back to top |
|
 |
darksaboteur

Joined: 11 Dec 2007 Posts: 18 Location: Australia
|
Posted: Sun Sep 27, 2009 2:05 am Post subject: Having A Few Troubles... |
|
|
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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sun Sep 27, 2009 2:54 am Post subject: |
|
|
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 |
|
 |
darksaboteur

Joined: 11 Dec 2007 Posts: 18 Location: Australia
|
Posted: Sun Sep 27, 2009 1:10 pm Post subject: |
|
|
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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Mon Sep 28, 2009 2:14 am Post subject: |
|
|
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 |
|
 |
|