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 yaustar I don't have either at hand hance I asked for them. A short is 2 bytes. No ...
-
05-19-2007, 05:43 PM #4591QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von yaustar
No worries, I was referring to MrChaos.
-
05-19-2007, 05:43 PM #4592QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
I did by asking for the struct declaration. This information was not 2 pages back.
Zitat von Archaemic
[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]
-
05-19-2007, 05:43 PM #4593QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
It's part of the PSPSDK.
Zitat von MrChaos
-
05-19-2007, 05:44 PM #4594QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
It is in the bin folder of the compiler.
Zitat von MrChaos
[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]
-
05-19-2007, 05:45 PM #4595QJ Gamer Blue
- Registriert seit
- Feb 2007
- Ort
- Florida
- Beiträge
- 214
- Points
- 4.031
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Oh, ok. Got it.
Zitat von PSPJunkie_
EDIT: Ugh. Won't run. Screw it guys, I'll just make it open up the image file, but ty for all your help.
But I'll ask the second time, if I include a pic in the makefile, will it still need to be in the folder after I compile?
-
05-19-2007, 05:50 PM #4596It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Yeah, but you also asked what type logo was, and that information WAS. That's all I'm saying.
Zitat von yaustar
MrChaos: Yespəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
05-19-2007, 05:51 PM #4597QJ Gamer Blue
- Registriert seit
- Feb 2007
- Ort
- Florida
- Beiträge
- 214
- Points
- 4.031
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Ok, thanks.
Zitat von Archaemic
-
05-19-2007, 05:52 PM #4598QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Open up terminal. Type,
You need to be in to directory of the image, not bin2c. So you could do,
Zitat von bin2c
and you would refer to the image as 'logo' in your sources.bin2c logo.raw logo.h logo
-
05-19-2007, 05:53 PM #4599QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Point.
Zitat von Archaemic
[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]
-
05-19-2007, 05:54 PM #4600QJ Gamer Blue
- Registriert seit
- Feb 2007
- Ort
- Florida
- Beiträge
- 214
- Points
- 4.031
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Ah. Ok. When I try this tomorrow, where does the *.raw have to be at?
Zitat von PSPJunkie_
-
05-19-2007, 06:29 PM #4601QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Well, just cd into the directory of the .raw image and do bin2c.
-
05-20-2007, 01:28 AM #4602Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
if you want to make a look-a-like desktop , will it be good enough to work with png images and the graphics.c?
-
05-20-2007, 05:03 AM #4603QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
I wouldn't suggest it as graphics.c is slow and has many bugs, but yes, it will work.
-
05-20-2007, 05:09 AM #4604QJ Gamer Green
- Registriert seit
- Feb 2006
- Ort
- France
- Beiträge
- 753
- Points
- 5.784
- Level
- 49
- Downloads
- 0
- Uploads
- 0
What library that works like graphics would you recommend PSPJunkie_ ?
++ B.if I make mistakes in english, feel free to correct me or else i won't progress :D .
-
05-20-2007, 05:10 AM #4605Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
what do you suggest?
-
05-20-2007, 05:15 AM #4606QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
SDL is very good or, my personal choice, would be to write you own graphics functions so you can customize them to your needs.
-
05-20-2007, 05:16 AM #4607It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Has anyone here tried vLib? I'd imagine that would be good.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
05-20-2007, 05:20 AM #4608QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zetta worked really hard on vLib. I haven't seen him in a while, but just so you know, vLib is incomplete. He still needs to polish it up.
-
05-20-2007, 05:34 AM #4609Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
oslib is the best right now for 2d games/apps.
--------------------------------------------------------------------------------------
-
05-20-2007, 05:35 AM #4610It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
That's true, but I'd imagine it works much faster for what it can do than SDL because it's A) MEANT to run on an embedded device and B) not as big as SDL.
E] This is in response to PSPJunkie_pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
05-20-2007, 05:36 AM #4611QJ Gamer Green
- Registriert seit
- Feb 2006
- Ort
- France
- Beiträge
- 753
- Points
- 5.784
- Level
- 49
- Downloads
- 0
- Uploads
- 0
Okay PSPJunkie_, if SDL for psp is as powerful as the one for PC, i may start to learn how to use this lib.
++ B.
EDIt : so : OSlib or SDL ?^^if I make mistakes in english, feel free to correct me or else i won't progress :D .
-
05-20-2007, 05:40 AM #4612QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
It really is up to you. I don't like using engines like OSLib or vLib, but that is just me. I also do not like the way SDL works (Not that you shouldn't use it). I'm going to go ahead and suggest GU from scratch.
-
05-20-2007, 05:50 AM #4613Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
^^
Zitat von PSPJunkie_
hardest, but fastest way. Take a look at graphics.c, and see how it loads and displays images. then go search for other formats, and put them in.--------------------------------------------------------------------------------------
-
05-20-2007, 05:59 AM #4614Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
how do you copy an array[x] to array[x][y];
for example
char array[16]
char array[4][4]
can you it just like this?
strcpy(array , array);
or will it be like this?
strcpy(array[0] , array);
strcat(array[1] , array);
strcat(array[2] , array);
strcat(array[3] , array);
-
05-20-2007, 06:05 AM #4615words 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
Personally, I recommend using the Old School Library as, like said, it's much faster (not a sketchy port and uses the VFPU for most if not all of it's calculations) yet it can do the same as SDL (input, audio, graphics (hardware as well; rotation, scaling, etc.)) and also, you may find it to be less confusing as SDL (personal preference though).
Id say SDL and OSlib are up to par with each other, but if you will be developing strictly for the PSP, Id say go with OSlib as the PSP SDL implementation is much slower then it's PC counterpart (i believe SDL is all done in software
)
hallo - Depends what type of array.
Something like this works in just about all cases:
Code:int z = 0; for(int i=0; i<4; i++) for(int j=0; j<4; j++) { array[i][j] = array[z]; z++; }Geändert von SG57 (05-20-2007 um 06:20 AM Uhr)

...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
-
05-20-2007, 06:11 AM #4616QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
If the readme is correct, then some of it is hardware accelerated although this also may depend on whether you use a HW_Surface or SW_Surface for the screen.
Zitat von SG57
OSLib also has a PC version of the library so you should be able to easily build and debug on the PC and then do a recompile for the PSP for release.
OSLib doesn't really seem to be an engine, it is only slightly higher then SDL as an API.
What I would do is create an abstract layer for drawing (indirection) which separates all the API specific calls from the game/application engine. This means that I can use an API such as SDL to begin with and at a later stage, rip it out and replace with a GU based one without having to change a line of the engine code.[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]
-
05-20-2007, 06:28 AM #4617
Meh, Damm it! :Cry: I have been trying to get this to work since the past 1.5 hrs. Tried installing zlib.... I has got all includes.Code:psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -D_PSP_FW_VERSION=150 -c -o main.o main.c main.c: In function 'main': main.c:166: warning: control reaches end of non-void function psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -D_PSP_FW_VERSION=150 -L. -L/usr/local/pspdev/psp/sdk/lib main.o framebuffer.o graphics.o vram.o -l pspgum -lpspgu -lm -lz -lpng -lpsprtc -lpsppower -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o LessonFive.elf /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(png.o): In func tion `png_reset_crc': png.c:(.text+0x1b0): undefined reference to `crc32' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(png.o): In func tion `png_calculate_crc': png.c:(.text+0x1fc): undefined reference to `crc32' png.c:(.text+0x228): undefined reference to `crc32' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(png.o): In func tion `png_reset_zstream': png.c:(.text+0xb98): undefined reference to `inflateReset' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngread.o): In function `png_create_read_struct_2': pngread.c:(.text+0x134): undefined reference to `inflateInit_' pngread.c:(.text+0x27c): undefined reference to `inflateInit_' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngread.o): In function `png_read_init_3': pngread.c:(.text+0x4ac): undefined reference to `inflateInit_' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngread.o): In function `png_read_row': pngread.c:(.text+0xfbc): undefined reference to `inflate' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngread.o): In function `png_read_destroy': pngread.c:(.text+0x1d24): undefined reference to `inflateEnd' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngrtran.o): In function `png_build_gamma_table': pngrtran.c:(.text+0x1258): undefined reference to `pow' pngrtran.c:(.text+0x1470): undefined reference to `pow' pngrtran.c:(.text+0x1518): undefined reference to `pow' pngrtran.c:(.text+0x1630): undefined reference to `pow' pngrtran.c:(.text+0x170c): undefined reference to `pow' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngrtran.o):png rtran.c:(.text+0x17f8): more undefined references to `pow' follow /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngrutil.o): In function `png_decompress_chunk': pngrutil.c:(.text+0x334): undefined reference to `inflate' pngrutil.c:(.text+0x43c): undefined reference to `inflateReset' pngrutil.c:(.text+0x584): undefined reference to `inflateReset' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngrutil.o): In function `png_read_finish_row': pngrutil.c:(.text+0x43d4): undefined reference to `inflate' pngrutil.c:(.text+0x445c): undefined reference to `inflateReset' pngrutil.c:(.text+0x44a4): undefined reference to `inflateReset' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwrite.o): In function `png_write_flush': pngwrite.c:(.text+0x18d4): undefined reference to `deflate' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwrite.o): In function `png_write_destroy': pngwrite.c:(.text+0x1998): undefined reference to `deflateEnd' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In function `png_text_compress': pngwutil.c:(.text+0x298): undefined reference to `deflate' pngwutil.c:(.text+0x37c): undefined reference to `deflate' pngwutil.c:(.text+0x444): undefined reference to `deflate' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In function `png_write_compressed_data_out': pngwutil.c:(.text+0x5d4): undefined reference to `deflateReset' pngwutil.c:(.text+0x684): undefined reference to `deflateReset' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In function `png_write_IHDR': pngwutil.c:(.text+0x8f8): undefined reference to `deflateInit2_' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In function `png_write_finish_row': pngwutil.c:(.text+0x2cf4): undefined reference to `deflate' pngwutil.c:(.text+0x2d30): undefined reference to `deflate' pngwutil.c:(.text+0x2da0): undefined reference to `deflateReset' /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In function `png_write_filtered_row': pngwutil.c:(.text+0x3324): undefined reference to `deflate' collect2: ld returned 1 exit status make: *** [LessonFive.elf] Error 1
In lesson5, I am trying to use a png texture instead of TGA! :o Any help?
My Other hello worlds compile fine from scratch that use png's!!!
PLease help! :o
-
05-20-2007, 06:30 AM #4618Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
and what about pointers
Zitat von SG57
..
char *array[4][4];
char *array[16];
?
-
05-20-2007, 06:33 AM #4619It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
I hate to tell you this, but you're missing the psp version of zlib. How did you go about installing it
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
05-20-2007, 06:48 AM #4620
It's now fixed.
Zitat von Archaemic
Put -lz -lm after -lpng


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