yes well i just found out it's the 0 card which only has 1 card per each set of RGBY anyways thanks yaustar for your help
Printable View
yes well i just found out it's the 0 card which only has 1 card per each set of RGBY anyways thanks yaustar for your help
I was curious what the code is for some things like displaying battery life, memory stick space, firmware version, and some other Specs. If someone can help me out it would be greatly appreciated, I am n00by.
http://psp.jim.sh/pspsdk-doc/
very good documentation ;)
Okay thanks.Zitat:
Zitat von myschoo
Alright say I want to use this code here:
How would I write that in code for it to display? I just found some simple Hello World thing I made and was planning on just having it display in that since I know that runs. Also I have to post this in psppower.h correct? How do I do that just made a new file called psppower.h using my C editing program? Thanks, sorry for the Q's bit new.Zitat:
int scePowerGetBatteryLifeTim e ( void )
Get battery life as time.
ok firstly you need to include psppower.h (not post it i have no idea where your getting that from) like so:
(at top of program)
#include <psppower.h>
now then:
the int part means that the function returns the information into another intCode:int scePowerGetBatteryLifeTim e ( void )
so to do it do:
int power;
power= scePowerGetBatteryLifeTim e();
now the information has been returned to the variable power
now all you have to do is display the variable
Thank you so much, I will try to learn how to display it!Zitat:
Zitat von seenit
Or just pspDebugScreenPrintf("%d percent battery left\n", scePowerGetBatteryLife()) ; :)
Will this display it on the screen? I am having difficulties finding out.Zitat:
Zitat von MaTiAz
Well I just put it at the bottom like this
And tried to compile and got an error.Zitat:
int main() {
pspDebugScreenInit();
SetupCallbacks();
pspDebugScreenPrintf("%d percent battery left\n", scePowerGetBatteryLife()) ;
printf("Hello there! \n");
printf("- PSDeveloper");
sceKernelSleepThread();
return 0;
}
MaTiAz: scePowerGetBatteryLifePer cent()
if your not to familiar with c i suggest learning the basics on the pc otherwise compiling and testing every other second can be a *****
here are some good sites:
http://www.cs.cf.ac.uk/Dave/C/
http://www.cplusplus.com/doc/tutorial/
http://www.cprogramming.com/tutorial.html
those are just a few it well help you very much to know the basics before getting into psp programming
That's not the road I wanted to go but I know some people have said learning on the computer is easier than trying to learn on the PSP. Is there a good compiler and everything for PC that I can use? Man I really wanted to do PSP too me forever to install that stuff and really want to make some small apps. :Argh:Zitat:
Zitat von seenit
well you can use still go with the psp but cygwin is a compiler for c scripts also it's only the psp toolchain that makes it capable of compiling eboots for the psp otherwise cygwin will compile c scripts
so you don't need to download anything else you already have it completly set up to run c scripts 2
for example create a hello world.cpp file and place the following in it:
now in cygwin navigate to the folder where you saved the file and type:Code:#include <stdio.h>
printf("hello world");
gcc -o hello "hello world.cpp"
hit enter
now type
./hello.exe
and thats it
Alright thanks man that is a lot of help. I guess since I really want to get into computer programming the PC is the better place rather than the PSP and I can always go to PSP once I learn some stuff. thanks.Zitat:
Zitat von seenit
all you need to learn are the basics(integers,floats,ch aracters,arrays,how functions work,searching,I/O,etc,etc)
before heading to the psp than begin with a simple game and expand
Theres more you need to learn than just that, such as memory management, pointers and LOOPS! And generally how a program works.Zitat:
Zitat von seenit
hence why i said etc,etc
Better to be specific rather than vague. :tup:Zitat:
Zitat von seenit
So umm, first of all, C isn't a scripting language. And that hello world is completely wrong, it's missing the entry point.Zitat:
Zitat von seenit
Matiaz, i suggest you remove that code from your signature because with noobs like Noob2PsP and Tostoo moping around these forums, they are obviously going to compile it and release it. The new version of Noob2PsP's UnBricker, it also bricks now! lal
The code wont compile:) Noob2psp and Tostoo can't code so they can't solve the problems:)Zitat:
Zitat von JaSo PsP
O rly? Ya rly.Zitat:
Zitat von Coolj
How do you check if a button is being pressed? I don't mean a specific button, but any button at all... I could just do a check for each button individually, but thats going to be a waste of time, so an easier, more effective way would be welcome.
@Raphael - I give up, its been bugging me about the text without the black bit, even though I don't need it anymore, I'd still like to learn how to hook functions. Could you give me some sort of idea how to start learning?
Thanks.
-Aura
Look at apiHook in the PSPLink source.
Psp_ctrl_buttons ?
-= Double Post =-
is it possible to read specifical line from file with sceIo functions?
i looked at sceIoLseek but i can only start from specifical offset or specifical character......
(Someone will probably shout at me for this). I use the c library for opening files, and not the pspiofilemgr.h files, and I've never had any problems.
If your not sure how to use them, its the same as normal C, just check here for how to use everything.
-Aura
-= Double Post =-
Ok, finally found the source, but I have no idea what I'm actually looking at/for, this is way more advanced than what I normally do, so I havn't really got a clue where I go from here.Zitat:
Zitat von _dysfunctional
-Aura
Aura: There are times when you can't use the stdio file functions, like when running alongside the VSH.
Ah, I knew there must be a reason why there was another way of doing it, but didn't know what it was. I've only ever opened files etc in games. (That actually comes in handy because I need to do this in a plugin I'm making).Zitat:
Zitat von MaTiAz
-Aura
yeah, i know stdio file function but i thought it was also possible with sceIo ones ... o_O
Zitat:
Zitat von Auraomega
Well, first you find the library that the function you want to hook is in using sceKernelFindLibraryByNam e() or something like that. You have to compile using the kernel libraries as well. Now that you have the UID, you can use that in apiHookByName. You pass the UID you got, the module name, the function name, and a pointer to the function you want to hook it with.
Code:// PSEUDO!!!
// DON'T EXPECT IT TO WORK!!!!
inline myFuncPatched(same, params, as, orig, function)
{
return 0;
}
int fooLibUID = sceKernelFindLibraryByName("myLib");
apiHookByName(fooLibUID, "myMod", "myFunc", myFuncPatched);
I'm pretty sure the c standard io functions are implemented with the psp specific io functions. In other words the c stdio functions are wrappers for the psp equivilents.Zitat:
I use the c library for opening files, and not the pspiofilemgr.h files, and I've never had any problems.
try this:Zitat:
Zitat von Auraomega
assuming ur SceCtrlData is pad
this might not work idkCode:if(pad.Buttons){/*any button pressed*/}
That won't work, I've tried something similar.
I'm sure...
Even.. while being Blind folded it works.
try:
Will... Will Work.Code:
main()
{
SceCtrlData glossybutts;
for (;;)
{
glossybutts.Buttons =0;
scectrl..blah;
if (glossybutts.Buttons !=0)
{
DO whatever ya wawnt here.
}
}
}
I always had one the bits set, even when no buttons were pressed.
E]
This will work:
if(pad.Buttons & ~PSP_CTRL_MS)
okay by "scectrl...blah", do u mean scectrlreadbufferpositive ?Zitat:
Zitat von Mr305
Surely if you run in user mode (and not kernel) then checking for the ms wouldn't be available? I've not tried it yet, have a few issues with my PSP at the moment :Argh:Zitat:
Zitat von Archaemic
Also, can anyone link me to the PSPLink source code? I've found it supprisingly hard to find the source code anywhere, except ps2dev's svn, which is throwing errors for me at the moment.
Thanks.
-Aura
What I gave should work in Kernel and User modes.
And the ps2dev repository is WHERE you get the PSPLink source code.
If you just want the basic buttons checked, do
if (pad.Buttons & 0xFFFF)
if you need VOLUP/DOWN, SCREEN and NOTE button too, then you need 0xF0FFFF. For HOME button too, 0xF1FFFF.
Aww... I've not used the svn commands in Cygwin before, so that could be why I'm getting problems, I found on ps2dev.org that it wasZitat:
Zitat von Archaemic
but when I entered this I was told there was no repository found, am I doing something here?Code:svn co svn://svn.pspdev.org/branch/psplinkusb
-Aura
svn co svn://svn.pspdev.org/psp/branch/psplinkusb
That should be the right directory (note the added /psp)