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; I have Tryed Programing in Visual Basic and get that quite easy ( not that its hard lol) and make ...
-
06-19-2007, 05:30 AM #5101
- Registriert seit
- Jun 2007
- Beiträge
- 2
- Points
- 3.158
- Level
- 34
- Downloads
- 0
- Uploads
- 0
I have Tryed Programing in Visual Basic and get that quite easy ( not that its hard lol) and make simple -games like pong, connect 4 and so on i just wanna step up to do some better programing
-
06-19-2007, 05:35 AM #5102QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Unless you have a specific reason to learn C++, I would recommend C# over C++. Then you can easily make games using the XNA framework for the PC and Xbox360.
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
06-19-2007, 08:40 AM #5103
What's the best method to NULL out a char array in c?
I do sprint(var,""); but it gives me a warning...
-
06-19-2007, 08:47 AM #5104QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Crude, but works.Code:char blah[] = "What the Hack?!" blah[0] = '\0';
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
06-19-2007, 09:17 AM #5105QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
blah[0] = NULL;?
...Just Returned To The Scene...
-
06-19-2007, 09:58 AM #5106words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
iirc, NULL doesn't necessarily represent the NULL character.

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
06-19-2007, 10:06 AM #5107Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
when you say NULL , it will return 0 , when you say \0 , it will return null
-
06-19-2007, 10:22 AM #5108QJ Gamer Blue
- Registriert seit
- Apr 2007
- Ort
- Relative
- Beiträge
- 135
- Points
- 3.679
- Level
- 38
- Downloads
- 0
- Uploads
- 0
So if there is a string like
Zitat von yaustar
str[10] = {'T', 'e', 'd', '\0'};
and we say
str [0] = '\0';
will the rest of the string be emptied or we just get
'\0', 'e', 'd', '\0' and all functions stop reading after the first '\0' ?
-
06-19-2007, 10:34 AM #5109Developer

- Registriert seit
- Feb 2006
- Ort
- Norway
- Beiträge
- 384
- Points
- 5.359
- Level
- 47
- Downloads
- 0
- Uploads
- 0
The first byte gets set to 0, all string functions stop after the first null byte.
Zitat von radioactive_X
-
06-19-2007, 10:38 AM #5110QJ Gamer Blue
- Registriert seit
- Apr 2007
- Ort
- Relative
- Beiträge
- 135
- Points
- 3.679
- Level
- 38
- Downloads
- 0
- Uploads
- 0
I just tried this
And it prints "e", how would you go emptying the whole string do we need a loop or is there a function. It is somewhat irritating to have leftover values like that.Code:char str[1000] = "Hello"; str[0] = '\0'; putchar(str[1]);
-
06-19-2007, 10:47 AM #5111QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
'\0' == 0
NULL == (void*)0 in most C implementations, hence == 0, but it's better to not assume it in general
memset( str, 0, 1000 );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.
-
06-19-2007, 10:59 AM #5112QJ Gamer Blue
- Registriert seit
- Apr 2007
- Ort
- Relative
- Beiträge
- 135
- Points
- 3.679
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Thank you!
-
06-20-2007, 04:22 AM #5113QJ Gamer Bronze

- Registriert seit
- Jun 2006
- Beiträge
- 144
- Points
- 7.047
- Level
- 55
- Downloads
- 0
- Uploads
- 0
The MIPS standard implementation requires r0 (register zero, or $zr in mnemonic notation) to be hardwired to zero :) So I think NULL is the register 0 value in the case of the PSP :P An absolute zero xD
Adrahil - Software architect and specialist in Reverse Engineering.
Spoiler for Guilt of a Dev:
Spoiler for me:
-
06-20-2007, 06:28 AM #5114
i know how to blit an image to the screen, but
how would i blit an image to another one?
-
06-20-2007, 06:50 AM #5115QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 103
- Points
- 3.754
- Level
- 38
- Downloads
- 0
- Uploads
- 0
If your using graphics.c/h use
blitAlphaImageToImage
or
blitImageToImage
-
06-20-2007, 08:35 AM #5116Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
or just blit the one one the back first
-
06-20-2007, 10:20 AM #5117
on this thread i've heard many times about "bad ports of graphics.c". Well if there are multiple ports out there i'd like to know which one is considered the best
-
06-20-2007, 10:47 AM #5118QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 103
- Points
- 3.754
- Level
- 38
- Downloads
- 0
- Uploads
- 0
You will need zlib and libpng installed to use it,
Zitat von brethren
I use the graphics.c obtained from lesson 4 on psp-programming,
I have never had any problems with it,
-
06-20-2007, 11:11 AM #5119QJ Cool 300th Member
- Registriert seit
- Jul 2006
- Beiträge
- 173
- Points
- 4.347
- Level
- 41
- Downloads
- 0
- Uploads
- 0
I also use the graphics.c/graphics.h from lesson 4 on psp-programming and I have never had any problems either.
-
06-20-2007, 11:13 AM #5120QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 103
- Points
- 3.754
- Level
- 38
- Downloads
- 0
- Uploads
- 0
It is very limited with what you can do with it but what it can do seems to work well,
-
06-20-2007, 11:18 AM #5121QJ Gamer Green
- Registriert seit
- Sep 2006
- Ort
- Cape Town, South Africa
- Beiträge
- 714
- Points
- 5.795
- Level
- 49
- Downloads
- 0
- Uploads
- 0
Keep an eye on Easy Accelerated Image Rendering Library; that's pretty much as easy to use as graphics.c and it's (apparently) much faster. It as image rotation and scaling too. Raphael says its got some issues right now that need to be sorted out before it's a viable use though.
-
06-20-2007, 11:21 AM #5122QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 103
- Points
- 3.754
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Yeah some of the functions should prove to be useful for people who can't do it themselfs,
-
06-20-2007, 11:57 AM #5123QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
If you want to use something good, try OSLib. It's by far the best 2D library around.
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.
-
06-20-2007, 12:13 PM #5124
Is it faster than graphics.c with all PSP-programming mods? [if u know what I am sayin']
Zitat von Raphael
-
06-20-2007, 12:18 PM #5125QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 103
- Points
- 3.754
- Level
- 38
- Downloads
- 0
- Uploads
- 0
head over to psp-hacks and try PSdonkey's tuts
-
06-20-2007, 02:35 PM #5126QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
Yes. Plus it has much more functionality.
Zitat von Mr305
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.
-
06-20-2007, 10:02 PM #5127QJ Gamer Blue
- Registriert seit
- Aug 2006
- Ort
- Missouri
- Beiträge
- 451
- Points
- 6.041
- Level
- 50
- Downloads
- 0
- Uploads
- 0
I need to know how I'm to find libraries on my own. I only learn about them by seeing them on tutorials. I've looked up psp c library reference, but I can't find anything.
I was gonna ask if there was anything better than graphics.c, but I saw that was covered. But I want a way where I can find these on my own.
-
06-20-2007, 10:55 PM #5128words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
All you'll ever need
http://svn.ps2dev.org/listing.php?re...%2F&rev=0&sc=0
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
06-20-2007, 11:02 PM #5129QJ Gamer Blue
- Registriert seit
- Aug 2006
- Ort
- Missouri
- Beiträge
- 451
- Points
- 6.041
- Level
- 50
- Downloads
- 0
- Uploads
- 0
Thank you much.
-
06-23-2007, 07:07 PM #5130QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
hello again people i'm yet again on the topic of an x loader as i really want this to work and have been trying, unsuccessfully, to get it to work so thusly i bring it here again
Spoiler for code:
this is the code i use on the computer it works perfectly fine however on the psp it just randomly breaks at different points and i'm unsure as to why
-= Double Post =-
also heres proof that it randomly breaks at different points after three runs my trace file looks like this:
Spoiler for trace file:
the first 2 break at noname and the second 1 only reads a few letters before it breaks and i'm at a complete loss i've seen other 1's go further and some only write 1 letter and idk whyGeändert von slicer4ever (06-23-2007 um 07:21 PM Uhr) Grund: Automerged Doublepost
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


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