New to coding/psp dev. Few questions.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Dregyn
Posts: 3
Joined: Mon Nov 03, 2008 1:15 pm
Location: Grand Rapids, MI

New to coding/psp dev. Few questions.

Post by Dregyn »

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.
Onii
Posts: 40
Joined: Sun Oct 05, 2008 1:07 pm

Post by Onii »

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.
Dregyn
Posts: 3
Joined: Mon Nov 03, 2008 1:15 pm
Location: Grand Rapids, MI

Post by Dregyn »

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.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

Dregyn 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.
So maybe you'll be making the first Mac Pandora tool xD

Wally
Dregyn
Posts: 3
Joined: Mon Nov 03, 2008 1:15 pm
Location: Grand Rapids, MI

Post by Dregyn »

That's a goal of mine. I'm tired of having to use windows when I wanna set someone up.
Post Reply