What's that * doing there?
Also, these forums don't seem to have any structure. (all C related stuff goes in the same place). Is there a subsection for noob stuff like this?[/code][/i]
Google "C pointer tutorial". I strongly encourage you to find a good tutorial on C before programming it. C is kinda a high level assembler in some aspects. The pointer through "*" is one of those aspects.
Any variables or functions has an address and they can be accessed through a pointer :
int count1; <--- defines an integer variable
count1 = 10; <--- set the value of this variable to 10
int *count2; <--- defines a pointer on an integer value
count2 = &count1; <--- set the pointer to the address of count1 where 10 was set
*count2 = 20; <--- set the new value of count1 through the pointer count2 to 20
printf("%d", count1); <--- displays teh value of count1, that is, 20 !
Now you should really find a good C tutorial to continue.
Good advise. I will do that after this is de-mystified:
I thought I'd edit the timer program to use a proper timer instead of Vblanks to set the value of the counter (now timer)
I looked through the source and found pspsystimer.h in the kernel dir.
I used the functions inside that file.
This is the code:
The compiler didn't complain but when running the eboot from irShell I got a 8002013C error. Google says that's a 'library not found' error. Supposedly caused by the pspsystimer.h.
But the file is in the same directory as pspkernel.h so why shouldn't it be able to find it?
Unfortunately SysTimer is only for kernel application, you cannot use it in this fashion. What you probably want is the RTC stuff (psprtc.h) and use something like sceRtcGetCurrentTick to get a high resolution timer (you can find how many ticks per second are used with sceRtcGetTickResolution).
Of course that being said you really should know how to code C before doing anything as complex as this :)
The issue is if it is a user application those libraries don't exist to be linked to, hence the error. The real issue is with the SDK and in part to the way it developed. Really we need a user only flag (we already have a kernel only flag) which ensures that you can only link in user mode libraries and this issue would go away :)