New to coding/psp dev. Few questions.
New to coding/psp dev. Few questions.
I have compiled a hello world app in C but I'm not clear as to what my 3 blocks of callback code do. (Exit callback, callback thread, and callback id.) What do these do and how are they nessicary. I want to learn C thru the PSP. Thanks.
A word of caution: I don't know that the PSP is a very good platform to learn C on. You'll be thrown into medium to advanced topics right off the bat.
For instance your questions about the callback functions and threads. The simple answer is that they are there to enable your game/application to be ended at any time by pressing the home key.
The longer answer is that the functions set up a cooperative thread that registers a callback function (a callback function is one that will be called at a later event) and binds it the the home press button so that your main thread still continues behind the dialog shown and will allow the ending of your game / application.
Callbacks (and functors and function pointers) are not basic concepts and a firm understanding helps one understand the psp. I don't know that the converse is true; that the PSP uses them probably does not infer how they work in enough detail to be comfortable using them in general.
Threads (and to a lesser extent, semaphores and mutexes) are also used right out of the gate on the PSP. IMO debugging multithreaded code is about the most difficult task in programming.
There are other advanced topics you'll need to know to get along well on the PSP but these are the two that you'll need right out of the gate for anything but the simplest of programs.
Anyway I suggest that you get a good PC based compiler/ IDE and a few c tutorials and get comfortable, and if you want, you can compile the same code over on the PSP until you are ready to dive deeper into the SDK and graphics / 3D / audio etc. Just make sure you have a good foundation (or a lot of patience :) ). I just hate to see potential PSP developers burn out because it's not as easy as they had assumed.
Of course this is all my opinion and YMMV. Others may disagree.
Good Luck!
If you have any more questions about the callback / setup code, let us know.
For instance your questions about the callback functions and threads. The simple answer is that they are there to enable your game/application to be ended at any time by pressing the home key.
The longer answer is that the functions set up a cooperative thread that registers a callback function (a callback function is one that will be called at a later event) and binds it the the home press button so that your main thread still continues behind the dialog shown and will allow the ending of your game / application.
Callbacks (and functors and function pointers) are not basic concepts and a firm understanding helps one understand the psp. I don't know that the converse is true; that the PSP uses them probably does not infer how they work in enough detail to be comfortable using them in general.
Threads (and to a lesser extent, semaphores and mutexes) are also used right out of the gate on the PSP. IMO debugging multithreaded code is about the most difficult task in programming.
There are other advanced topics you'll need to know to get along well on the PSP but these are the two that you'll need right out of the gate for anything but the simplest of programs.
Anyway I suggest that you get a good PC based compiler/ IDE and a few c tutorials and get comfortable, and if you want, you can compile the same code over on the PSP until you are ready to dive deeper into the SDK and graphics / 3D / audio etc. Just make sure you have a good foundation (or a lot of patience :) ). I just hate to see potential PSP developers burn out because it's not as easy as they had assumed.
Of course this is all my opinion and YMMV. Others may disagree.
Good Luck!
If you have any more questions about the callback / setup code, let us know.
Thank you. That makes sense now when I look at it. My main problem with compilers is that I am based in OS X Leopard, so (short of dual-booting xp) I am stuck with what is available. Fortunately (and I don't know how true this is for most, but it is for c in this case.) C compiles well in OS X's Terminal because it's unix based and so is linux and cygwin. I have the SDK and the Toolchain, and I have compiled all the lessons from PSP-Programming.com, now that I have working source I'm going back and observing how and why everything works. So I understand basics, but I've had trouble finding guides that cater to my circumstances. I'd like to learn a lot then become a coder for all the mac PSP users.
So maybe you'll be making the first Mac Pandora tool xDDregyn wrote:Thank you. That makes sense now when I look at it. My main problem with compilers is that I am based in OS X Leopard, so (short of dual-booting xp) I am stuck with what is available. Fortunately (and I don't know how true this is for most, but it is for c in this case.) C compiles well in OS X's Terminal because it's unix based and so is linux and cygwin. I have the SDK and the Toolchain, and I have compiled all the lessons from PSP-Programming.com, now that I have working source I'm going back and observing how and why everything works. So I understand basics, but I've had trouble finding guides that cater to my circumstances. I'd like to learn a lot then become a coder for all the mac PSP users.
Wally