Advertising (This ad goes away for registered users. You can Login or Register)

Looking for a C++ example of a PSPSDK/MinPSPW program

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
TheBeginner
Posts: 5
Joined: Tue Mar 01, 2011 8:40 pm

Looking for a C++ example of a PSPSDK/MinPSPW program

Post by TheBeginner » Tue Mar 01, 2011 8:48 pm

I feel very foolish in asking this, but is there an example C++ program (like a hello world) that compiles using either the PSPSDK or the MinPSPw?

I ask this question because every example I have seen that is used in various tutorials on the web has been based off of C. As a novice C++ only programmer, C code is as confusing as heck. I'm not looking to create the next Wagic or what not. I just want to learn where I can start.

So, is there a tutorial out there that shows an extremely basic C++ program for the PSP, or if not, can anyone help me on my way?

Thank you in advance.
Advertising

kidz axe
Posts: 353
Joined: Sun Oct 03, 2010 3:48 pm
Location: http://kidz-axe.co.cc/forum/
Contact:

Re: Looking for a C++ example of a PSPSDK/MinPSPW program

Post by kidz axe » Tue Mar 01, 2011 9:00 pm

TheBeginner wrote:I feel very foolish in asking this, but is there an example C++ program (like a hello world) that compiles using either the PSPSDK or the MinPSPw?

I ask this question because every example I have seen that is used in various tutorials on the web has been based off of C. As a novice C++ only programmer, C code is as confusing as heck. I'm not looking to create the next Wagic or what not. I just want to learn where I can start.

So, is there a tutorial out there that shows an extremely basic C++ program for the PSP, or if not, can anyone help me on my way?

Thank you in advance.
Ive been pondering about this for a while too, google didn't turn up good results, all on C...
Advertising
:)

ChaoticXSinZ
Posts: 48
Joined: Sat Jan 22, 2011 11:37 pm

Re: Looking for a C++ example of a PSPSDK/MinPSPW program

Post by ChaoticXSinZ » Tue Mar 01, 2011 10:20 pm

There is a tutorial here: http://www.psp-programming.com/tutorials/

Here's some more links:
http://www.psp-programming.com/forums/i ... ments;id=1
http://forums.psp-hacks.com/f141/the-ps ... d-t219475/ This one lists MANY other tutorials.

Also, minpspw is basically the pspsdk. It's just prepackaged and also provides a script to easily compile the pspsdk.

juggernaut6613
Posts: 29
Joined: Tue Jan 18, 2011 7:32 am

Re: Looking for a C++ example of a PSPSDK/MinPSPW program

Post by juggernaut6613 » Tue Mar 01, 2011 10:30 pm

You need to Study C language...

I'm like you in a way, I've learned C++ first than C, then I realized that I need C so I scratched C++ and went to C language...

Trust me the concept is just the same but C is more powerful I guess...
m0skit0 even said that C language is also known as a high level assembly language...

If you want to study C then got here:
http://cprogramming.com/

But I think you can use other language as well like C++ and LUA when programming on the psp...
PSP 3000 6.20 PRO-B5 Permanent Patch :D

User avatar
m0skit0
Guru
Posts: 3817
Joined: Mon Sep 27, 2010 6:01 pm

Re: Looking for a C++ example of a PSPSDK/MinPSPW program

Post by m0skit0 » Tue Mar 01, 2011 10:59 pm

No, C++ is more powerful than C, because it can do everything C does + OOP. That's why it's ++ :mrgreen:

Maybe you should look at Wagic's source code, it's written in C++ IIRC.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"

juggernaut6613
Posts: 29
Joined: Tue Jan 18, 2011 7:32 am

Re: Looking for a C++ example of a PSPSDK/MinPSPW program

Post by juggernaut6613 » Tue Mar 01, 2011 11:56 pm

m0skit0 wrote:No, C++ is more powerful than C, because it can do everything C does + OOP. That's why it's ++ :mrgreen:

Maybe you should look at Wagic's source code, it's written in C++ IIRC.
:lol: hehehe C++ is an enhancement of C... my bad...
But I find C language better for some reason... :oops:
And a lot of programmers always suggests to study C before C++ so I kinda thought of that the other way. :lol:
Thanks for Correcting me m0skit0 :D
PSP 3000 6.20 PRO-B5 Permanent Patch :D

TheBeginner
Posts: 5
Joined: Tue Mar 01, 2011 8:40 pm

Re: Looking for a C++ example of a PSPSDK/MinPSPW program

Post by TheBeginner » Wed Mar 02, 2011 12:07 am

I've been looking into the Cprogramming.com site, (thanks juggernaut), and the basics seem pretty similar to C++. I'm picking it up okay, but I just wish I could program in my "native tongue" :P.

So, it seems that the majority of the PSP dev community is using C, so that's going to be my focus over the next couple of weeks. I'm the kind of person who likes a physical copy of my instruction texts (like a textbook of sorts). Since most, if not all, of you are programmers, are there any books on the C language that you would recommend? I don't need a complete beginner book because I understand many topics already, but I'd still like to get the syntax down, and possibly reinforce my knowledge. Any suggestions?

juggernaut6613
Posts: 29
Joined: Tue Jan 18, 2011 7:32 am

Re: Looking for a C++ example of a PSPSDK/MinPSPW program

Post by juggernaut6613 » Wed Mar 02, 2011 1:02 am

No worries mate :D

Syntax Reference can be found at the same site I posted which is:
http://www.cprogramming.com/reference/

There are tons of Ebooks from the net... I don't know what's the best but just use google to look for them... :D
Or try asking m0skit0 :)

Have fun Coding mate! :D
PSP 3000 6.20 PRO-B5 Permanent Patch :D

JJS
Big Beholder
Posts: 1416
Joined: Mon Sep 27, 2010 2:18 pm
Contact:

Re: Looking for a C++ example of a PSPSDK/MinPSPW program

Post by JJS » Wed Mar 02, 2011 9:11 am

I am sorry, but I fail to see how you could write a simple hello world in C++ that would not be a C program with minor corrections.

The usual hello world in C++ just replaces printf("hello world") with cout << "hello world". And this would not even work on the PSP because you would have to first create your own class that can write to the debug screen. A simple #define printf pspDebugScreenPrintf doesn't cut it in that case.

I mean you can get all fancy with classes in the core of your application, but there is really no point for the low level stuff like the home button callback as they have to interface with the firmware functions that are written in C anyway (at the top of my head I cannot really tell if you can have a static member function as the callback or if it has to be a function outside a class, but I think it is the latter).


Side note: Every C++ program has at least one C style function, namely main(). Other OOP languages like Java encapsulate everything in classes while C++ shows its C roots there. Writing this I am wondering if you can have no entry point and instead declare one globally declared object that has a constructor serving as the (pseudo) entry point. I guess if that is possible depends on the underlying runtime system.

TheBeginner
Posts: 5
Joined: Tue Mar 01, 2011 8:40 pm

Re: Looking for a C++ example of a PSPSDK/MinPSPW program

Post by TheBeginner » Wed Mar 02, 2011 11:11 am

JJS wrote:I am sorry, but I fail to see how you could write a simple hello world in C++ that would not be a C program with minor corrections.
I see your point.

juggernaut6613 wrote:Syntax Reference can be found at the same site I posted which is:
http://www.cprogramming.com/reference/
Thanks again for the links and the help.

I guess learning C is not so bad of an idea after all. I still have to "unlearn" my OOP. That's going to be fun. :P

Post Reply

Return to “Programming and Security”