C/C++ Programming Help Thread
This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Zitat von zeroxorxdiexskater i am still pretty confused on my question, i think its because of the way my code ...
-
08-01-2008, 09:27 AM #8791QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
You're drawing the thing that is supposed to be "above" the other things first, which ends up in it actually being in the "back".
Either call Buttons() AFTER your oslDrawImage(videlectrix) or seperate the drawing code from the Buttons() function and put just that after the videlectrix.
Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.
-
08-01-2008, 09:29 AM #8792QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- dfgd
- Beiträge
- 66
- Points
- 4.008
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Oh, ok thankyou for informing me of that.
I'm not that bothered about free'ing memory until i need more also i can write properly in english but i've kind of picked up a bad habbit from going on msn.:Jump:
I have started just creating a basic game, text based and im going to implement loads of diffrent things like arrays etc
i learned lua fast that way so im trying it with c, lets see if it works!!!
Luke
-
08-01-2008, 10:29 AM #8793
Is there any function export that let's me change XMB time / the global time setting?

Or I do need to deal with PSP's Registry?
-
08-01-2008, 10:30 AM #8794QJ Gamer Green
- Registriert seit
- Sep 2006
- Ort
- 3.03OE-C
- Beiträge
- 1.098
- Points
- 9.134
- Level
- 64
- Downloads
- 0
- Uploads
- 0
CuRrEnT fIrMwArE [SIZE="3"][FONT="Times New Roman"][COLOR="Red"][B][I][U]3.90 M33-2 SLIM TA-085V2 with TimeMachine 0.1[/U][/I][/B][/COLOR][/FONT][/SIZE]
[WIP] Trogdor! (ON HOLD converting to LUA, but almost caught up)
-
08-01-2008, 10:36 AM #8795QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
well...i don't really know how to explain this...maybe like this:
Code:while (!osl_quit) { //To be able to draw on the screen oslStartDrawing(); //calls the Buttons() function Buttons(); //Draw the images to the screen oslDrawImage(videlectrix) ; //Ends drawing mode oslEndDrawing(); //Synchronizes the screen oslSyncFrame(); }Code:while (!osl_quit) { //To be able to draw on the screen oslStartDrawing(); //Draw the images to the screen oslDrawImage(videlectrix) ; //omg i did not just do that?!!?!!?!!?!!? //calls the Buttons() function Buttons(); //Ends drawing mode oslEndDrawing(); //Synchronizes the screen oslSyncFrame(); }1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
08-01-2008, 11:22 AM #8796QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- dfgd
- Beiträge
- 66
- Points
- 4.008
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Well im stuck again!
This is my code, it compiles with no errors at all but then when i go to start it, it loads up then i press down so then exit is highlight and i press upto go to start game it just exits!
WDF it is not ment to exit until i have pressed cross on the option exitgame but it exits while choosing an option.
anybody have idea's?
its puzzled me!
luke :Argh:
Spoiler for code:
EDIT: it dont matter now ive fixed it i swap this . .
for thisCode:else if(pad.Buttons & PSP_CTRL_CROSS || Select == 2) { sceKernelExitGame(); }
works fine now:Jump:Code:else if(pad.Buttons & PSP_CTRL_CROSS) { if (Select == 2){ sceKernelExitGame(); }}Geändert von lukespalding (08-01-2008 um 11:44 AM Uhr)
-
08-01-2008, 11:45 AM #8797QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
|| stands for or replace it with && like so:Code:}else if(pad.Buttons & PSP_CTRL_CROSS || Select == 2) {
that well now check to make sure the cross button is down AND that select is 2Code:}else if(pad.Buttons & PSP_CTRL_CROSS && Select == 2) {1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
08-01-2008, 12:05 PM #8798QJ Gamer Platinum
- Registriert seit
- Dec 2005
- Ort
- h0000000rj
- Beiträge
- 12.867
- Points
- 57.528
- Level
- 100
- Downloads
- 0
- Uploads
- 0
-
08-01-2008, 12:33 PM #8799QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- dfgd
- Beiträge
- 66
- Points
- 4.008
- Level
- 40
- Downloads
- 0
- Uploads
- 0
-
08-01-2008, 12:35 PM #8800QJ Gamer Green
- Registriert seit
- Apr 2006
- Beiträge
- 0
- Points
- 13.013
- Level
- 74
- Downloads
- 0
- Uploads
- 0
-
08-01-2008, 12:51 PM #8801QJ Gamer Green
- Registriert seit
- Sep 2006
- Ort
- 3.03OE-C
- Beiträge
- 1.098
- Points
- 9.134
- Level
- 64
- Downloads
- 0
- Uploads
- 0
CuRrEnT fIrMwArE [SIZE="3"][FONT="Times New Roman"][COLOR="Red"][B][I][U]3.90 M33-2 SLIM TA-085V2 with TimeMachine 0.1[/U][/I][/B][/COLOR][/FONT][/SIZE]
[WIP] Trogdor! (ON HOLD converting to LUA, but almost caught up)
-
08-01-2008, 01:02 PM #8802QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
my bad, i didn't mean to be so snappy just not a good day, i'll keep the attitude out of my posts, i'm sorry zero for the attitude
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
08-01-2008, 01:12 PM #8803QJ Gamer Green
- Registriert seit
- Sep 2006
- Ort
- 3.03OE-C
- Beiträge
- 1.098
- Points
- 9.134
- Level
- 64
- Downloads
- 0
- Uploads
- 0
i know how you can feel, ill admit i AM a noob at coding and ive been here for like 2 years and i know noobs ask questions that normal people answer all the time and it gets old but this IS a help thread and i think coding is a little more complicated than an installer or something lol
CuRrEnT fIrMwArE [SIZE="3"][FONT="Times New Roman"][COLOR="Red"][B][I][U]3.90 M33-2 SLIM TA-085V2 with TimeMachine 0.1[/U][/I][/B][/COLOR][/FONT][/SIZE]
[WIP] Trogdor! (ON HOLD converting to LUA, but almost caught up)
-
08-02-2008, 02:36 PM #8804QJ Gamer Blue
- Registriert seit
- Apr 2008
- Beiträge
- 497
- Points
- 4.268
- Level
- 41
- Downloads
- 0
- Uploads
- 0
alright guys, I'm really sorry for this, but I'm a complete noob at C++ decided to start pretty recently, but I am having one main problem, and thats compiling a cpp program, because I don't know how to make a makefile for the program, can someone please guide on how to do this?? thanx, I do appreciate and appoligize for the noob question.
-
08-02-2008, 03:00 PM #8805Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
See any of the 57 makefiles that ship with the SDK samples.

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
08-02-2008, 03:01 PM #8806QJ Gamer Blue
- Registriert seit
- Apr 2008
- Beiträge
- 497
- Points
- 4.268
- Level
- 41
- Downloads
- 0
- Uploads
- 0
those work with C++?? I thought that was all C(didn't know they worked for both languages), dang, sry. . . thanx for telling me .
EDIT: EDIT: I think I got it :)Geändert von PSProgramer (08-02-2008 um 04:50 PM Uhr)
-
08-03-2008, 07:19 PM #8807
- Registriert seit
- Apr 2008
- Beiträge
- 47
- Points
- 2.658
- Level
- 31
- Downloads
- 0
- Uploads
- 0
@lukespalding:
Yeah, C is all over the net. I have a textbook that I usually end up using for referencing standard lib stuff, but I also downloaded this page for when I'm too lazy to get up and find my book:
http://www.gnu.org/software/libc/man...mono/libc.html
When you use malloc/calloc to allocate memory it's really quite imperative to free it when you're done. Otherwise, if the reference loses scope you now have a 'memory leak'. That's a section of memory that's allocated and cannot be de-allocated. If you want to change the size of your array you can use realloc(). Just remember that if you make it smaller it will remove entires from the end, so if you want to delete something from the middle then you have to manually shift everything down and then realloc to remove the last entry.
Actually, Raph is right. Wait until you _really_ need to know how to allocate and then just study using malloc and free. Once you understand those two you'll understand calloc and realloc. I think there's another malloc function called memalign too, but you probably won't need that for a long time, and you'll already know what it is when you do need it.
Have you done the tutorials at psp-programming.com?
-
08-04-2008, 11:02 AM #8808
Could someone please explain how to use these two functions:
sceKernelResumeThread(Sce UID thid);
sceKernelSuspendThread(Sc eUID thid);
I know what they do but I don't understand how to find the game's thid. I need these for a PRX to freeze the game and resume whenever I call the functions.
Also, can someone tell me the location of the text string that shows the current game being played? I'm talking about the ULUSXXXX..etc string.
Thanks.Atheist, because I just won't believe in what doesn't show itself to me.
-
08-04-2008, 11:11 AM #8809Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
The thread id is returned from sceKernelCreateThread().
To do something like what you want to do you would do something like call sceKernelGetThreadmanIdLi st() to get a list of the thread ids that are running, then suspend all of them apart from your own, do whatever you need to do, then resume all the threads.
The ULUS code type is located within the PARAM.SFO.
Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
08-04-2008, 11:13 AM #8810
On the UMD?
-=Double Post Merge =-
Sorry, for some reason quick edit isn't working for me, so I have to double post:
On the UMD?
EDIT:
Ok I found the PARAM.SFO, thanks.
How can I tell how many threads are being ran?
And also, what is the actual name for the UMD drive? Like ms0:/ for the memstick..Geändert von Durka Durka Mahn (08-04-2008 um 11:24 AM Uhr) Grund: Automerged Doublepost
Atheist, because I just won't believe in what doesn't show itself to me.
-
08-04-2008, 11:57 AM #8811Oppressed by the man
- Registriert seit
- Jul 2008
- Ort
- So Cal
- Beiträge
- 323
- Points
- 5.684
- Level
- 48
- Downloads
- 0
- Uploads
- 0
What are some of the basic things I have to learn before I start learning C/C++ when I know nothing about it...?
someone please help =/
-
08-04-2008, 12:05 PM #8812
There's really nothing you have to learn before, but you can try easier programming things first, like web content.
Atheist, because I just won't believe in what doesn't show itself to me.
-
08-04-2008, 12:14 PM #8813Oppressed by the man
- Registriert seit
- Jul 2008
- Ort
- So Cal
- Beiträge
- 323
- Points
- 5.684
- Level
- 48
- Downloads
- 0
- Uploads
- 0
What would be an example of web content?
do you mean like html and css?
-
08-04-2008, 12:26 PM #8814lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
-
08-04-2008, 12:48 PM #8815
-
08-04-2008, 12:53 PM #8816Oppressed by the man
- Registriert seit
- Jul 2008
- Ort
- So Cal
- Beiträge
- 323
- Points
- 5.684
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Ok im only 15
I dont know Java or PHP how long would it take me to learn that?
-
08-04-2008, 12:56 PM #8817QJ Gamer Platinum
- Registriert seit
- Feb 2006
- Ort
- National Front Disco
- Beiträge
- 13.057
- Points
- 66.627
- Level
- 100
- Downloads
- 0
- Uploads
- 0
-
08-04-2008, 01:04 PM #8818Oppressed by the man
- Registriert seit
- Jul 2008
- Ort
- So Cal
- Beiträge
- 323
- Points
- 5.684
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Ok lets see
I am in GATE classes lots of homework
and im on the football team that means practice for three hours umm games on fridays and I might get a job over the weekend...I am very good with languages I know how to read and write in sapnish if thats what you mean...
-
08-04-2008, 01:05 PM #8819QJ Gamer Bronze
- Registriert seit
- Apr 2008
- Ort
- Ireland
- Beiträge
- 978
- Points
- 6.517
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Well then buy some books. If you want a basic website use .html if you want a complex website use .php
-
08-04-2008, 01:07 PM #8820lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0


LinkBack URL
About LinkBacks
Mit Zitat antworten

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum