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; when i add that lib Code: c:/psp/pspsdk/bin/../lib/gcc/psp/4.3.2/../../../../psp/bin/ld.exe: cannot find -lpspidstorage thx for your help anyway... Any more suggestions??? :Argh: --EDIT-- ...
-
12-18-2008, 12:55 AM #9331xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
thx for 1
when i add that lib
thx for your help anyway...Code:c:/psp/pspsdk/bin/../lib/gcc/psp/4.3.2/../../../../psp/bin/ld.exe: cannot find -lpspidstorage
Any more suggestions??? :Argh:
--EDIT--
Current MakeFile:
Code:TARGET = hello OBJS = main.o CFLAGS = -O2 -G0 -Wall -lpsppower CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LIBS = -lpsppower -lpspwlan -lpspnand_driver -lpspgu -lpng -lz -lm -lpspidstorage BUILD_PRX=1 PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build_prx.mak
Geändert von slasher101 (12-18-2008 um 01:06 AM Uhr) Grund: added makefile
-
12-18-2008, 04:20 AM #9332I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
libpspidstorage.a doesn't come with freshly compiled toolchains (at least, my freshly compiled toolchain doesn't have it), not sure where you can get it from, check svn.ps2dev.org and see if you can get it there.
I'm trying to load vshmain_real.prx in PSPLock but when I do I get the SCE boot, I had the same problem before but I thought I fixed it, anyway I'm not sure how to pass the arguments to stop it happening:
I'm wondering if address of argp should be sent as the second argument, instead of the only argument but have no way of testing right now, and I can't find any example code of sending the recieved argc and argp to another module.Code:int main(int argc, char** argp) ... sceKernelStartModule(mod, argc, argp, 0, NULL);
-Aura
-
12-18-2008, 05:46 AM #9333QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- Germany
- Beiträge
- 216
- Points
- 4.511
- Level
- 42
- Downloads
- 0
- Uploads
- 0
Iterating through a list of pointers
Hi
I'm having troubles when iterating through a list of pointers and trying to call a method of each of the referenced objects.
In my class «Renderer» I have a static list of pointers to GuiObjects, basically a list of objects that will be rendered.
In the static method render_screen() in «Renderer» I try to iterate through that list and call the method render_to_screen() from each of the objectsCode:static std::list<GuiObject*> gui_objects;
and I get the errorCode:void Renderer::render_screen() { std::list<GuiObject*>::iterator i; for(i=gui_objects.begin(); i != gui_objects.end(); ++i) i->render_to_screen(); }
I think it is because I don't dereference the GuiObject*, but I'm not sure how to do it syntactically. I triedrequest for member 'render_to_screen' in '* i.std::_List_iterator<_Tp >::operator-> [with _Tp = GuiObject*]()', which is of non-class type 'GuiObject*'
but I get the same errror...Code:*i->render_to_screen();
-
12-18-2008, 07:24 AM #9334QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Try:
Code:(*i)->functionname()
[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]
-
12-18-2008, 08:34 AM #9335QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- Germany
- Beiträge
- 216
- Points
- 4.511
- Level
- 42
- Downloads
- 0
- Uploads
- 0
-
12-18-2008, 10:15 PM #9336xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
libpspstorage.a
thx i tried looking on ps2dev for libpspstorage.a but couldn't find it if any1 could pm me or post a link to one i would be much appreciated!
~!SlasheR!~
-
12-19-2008, 02:23 PM #9337
You have to compile it I think, slasher. If it's a no-go in finding it, try running the psplibraries script in the psplibraries directory in the ps2dev's psp trunk, it should do it then as I don't know which one it's stored in.
Also, does anyone know how in the world would I detect if it's a 3.71 psp? I have a system set up to where if it detects 3.71, it will run the 3.71 functions, else the regular functions. It works so far(in 3.71 anyhow, and since the other functions are normal functions, they should work too. I had to set up a stub and what not of the right ones). I've spent a few hours digging with no avail, and I remember Anti-QuickJay had a method, but I can't seem to find it anywhere.I gone and made that one power spoofer and that gay cheat device.
-
12-19-2008, 03:57 PM #9338xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
libpspidstorage.a
Thx i tried to run the psplibraries script but i couldnt find it,
could someone who has it please attach it to a post,
Kind Regards !~SlasheR!~
-
12-19-2008, 04:42 PM #9339I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
2 options:
1) read the version.txt in the flash (I believe the location is flash0:/vsh/etc/version.txt, but check to be 100% certain).
2) Theres a function somewhere (I can't find it now, but if I do I'll edit this post to state its location) that retuns a long int, from there you can easily work out which version it is.
The first option is easier, but can be edited by the user. The second option is more acurate and safer to use, but can take a little more work to get up and running. I'd say for ease sake go with option 1 unless you are flashing in which case use option 2 for safety.
Or, to avoid version checking, you could check if the function exists, if it doesn't use the other functions:
-AuraCode:... int r = 0; r = someFunction(); if(r != exists) { //other versions code } else { // 3.71 versions code }
-
12-19-2008, 04:55 PM #9340
Thanks, I completely forgot about that.
I gone and made that one power spoofer and that gay cheat device.
-
12-19-2008, 05:02 PM #9341xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
guys
guys plz i really need those idstorage files!!!


-
12-19-2008, 05:16 PM #9342QJ Gamer Silver
- Registriert seit
- Sep 2006
- Ort
- Perth, Scotland
- Beiträge
- 1.094
- Points
- 8.475
- Level
- 62
- Downloads
- 0
- Uploads
- 0
sceKernelDevkitVersion();
Use that. Returns the firmware devkit. 5.00 = 0x05000010.
Ignore the first byte, the other 3 bytes are the main stuff.
-
12-19-2008, 06:18 PM #9343I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Taking a look at the samples in the SDK, it appears that no library is required for idstorage... go to the folder C:\cygwin\usr\local\pspde v\psp\sdk\samples\kernel\ idstorage and take a look at the makefile. All I can say is check you're including the headers, or using the correct function name. (I was just picking up from Xsjado's reply, so I missed the first post).
-Aura
-
12-19-2008, 07:04 PM #9344QJ Gamer Bronze
- Registriert seit
- Aug 2008
- Ort
- thugz mansion
- Beiträge
- 875
- Points
- 5.594
- Level
- 48
- Downloads
- 0
- Uploads
- 0
excuse me.
I just finished making a game. Its a game where your a psp and you are blasting nintendo ds's. But then i checked out dcv7 and thought man the wave xmb like thing would be cool in my game SOOooooo
Heres my question. HOW do i put that in my game and is it easy.
Zitat von SuperBatXS
-
12-19-2008, 08:28 PM #9345QJ Gamer Bronze

- Registriert seit
- Jul 2006
- Beiträge
- 550
- Points
- 5.381
- Level
- 47
- Downloads
- 1
- Uploads
- 0
EDIT: ****, wrong thread
Geändert von Nielkie (12-19-2008 um 11:34 PM Uhr)
-
12-19-2008, 10:50 PM #9346
Achievements:
- Registriert seit
- Dec 2008
- Beiträge
- 10
- Points
- 2.082
- Level
- 27
- Downloads
- 0
- Uploads
- 0
Thank you for the links. I will refer here if I ever need help, or want to learn something new.
-
12-20-2008, 01:04 AM #9347xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Your right Auraomega theres no library but when i try to compile it, this error pops up:
Im defenetaly missing a headerCode:$ make psp-gcc -I. -IC:/PSP/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o main.o main.c main.c:13:26: error: pspidstorage.h: No such file or directory main.c: In function 'main': main.c:51: warning: implicit declaration of function 'sceIdStorageLookup' make: *** [main.o] Error 1
Slasher
-
12-20-2008, 06:49 AM #9348I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
I can confirm you're missing a header, check the spoiler (although I'm by no means promising it'll work with the header alone).
Spoiler for pspidstorage.h:
Is there any "easy" way of turning a library into a prx? I'm wanting to convert lgu,lgum, ljpg and lpng into prxs to save on space, I want to keep the same function names (so theres no renaming functions) but other compiling direct from the libraries source I'm not seeing a logical way of going about it.
-Aura
-
12-20-2008, 11:56 AM #9349
It'd be a very large prx, but your best off making a dummy kernel prx template or something, as user prx's tend to be huge in comparison, pgefont in a prx was 536 kb) copy+paste it all into the files, possibly wrapping a function or two, align the main/module_start and what not, then export the functions, then use prxtool(I think -u gens the stubs), then make a header and define the function names with the function hash.
I think that's right, if not, pardon me.
But yeah, you're best off using stubs to get the libraries, else use imports(like the sdk).I gone and made that one power spoofer and that gay cheat device.
-
12-20-2008, 04:02 PM #9350xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
=]
Thanks guys ive fixed my problem! (with idstorage)
but now ive got that working ive compiled a prx successfully with all the functions of the idstorage samples.
When i try to Start it from my User Mode program it always says "Error *watevar*"
i think my exports are right...
Export:and my makefile:Code:# Define the exports for the prx PSP_BEGIN_EXPORTS # These four lines are mandatory (although you can add other functions like module_stop) # syslib is a psynonym for the single mandatory export. PSP_EXPORT_START(syslib, 0, 0x8000) PSP_EXPORT_FUNC_HASH(module_start) PSP_EXPORT_VAR_HASH(module_info) PSP_EXPORT_END PSP_EXPORT_START(IdStorage, 0, 0x4001) PSP_EXPORT_FUNC(LockFlash) PSP_EXPORT_FUNC(UnlockFlash) PSP_EXPORT_FUNC(die) PSP_EXPORT_FUNC(ReadIPLBlockTable) PSP_EXPORT_FUNC(go) PSP_EXPORT_END PSP_END_EXPORTS
plz hlp!!!Code:TARGET = testprx OBJS = main.o CFLAGS = -O2 -G0 -Wall -lpsppower CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LIBS = -lpsppower -lpspwlan -lpspnand_driver -lpspgu -lpng -lz -lm MAKE_PRX = 1 PRX_EXPORTS = export.exp PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build_prx.mak
-
12-20-2008, 04:25 PM #9351It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Why does no one realize that the numbers are important? It's a lot easier for use to help you if you tell us the numbers.
Although if I had to hazard a guess, I'd say that it's trying to run-time link to usermode libraries, which it can't because it's kernel mode.pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-20-2008, 04:29 PM #9352I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Good to see you again Archaemic!
NoEffex I've done standard exports/prxs before, but I'm at a loss what to do here and your explation confused me further. Is there any chance you could PM me details on how you did the pgefont one and/or give me an example function exported in this way?
-Aura
-
12-20-2008, 04:43 PM #9353
In all honesty, it don't work great, though I will spend a while now looking into/testing while these updates are going as I had to reinstall opensuse over fedora, because I f**ked up the kernel and xorg.
EDIT: A prime example is in 4.01 m33 sdk. Head into samples and look at the bootload and driver.Geändert von NoEffex (12-20-2008 um 06:56 PM Uhr)
I gone and made that one power spoofer and that gay cheat device.
-
12-21-2008, 07:53 AM #9354I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Hmm, I've started playing with PSPGL, but I've come across a problem, from what I can tell, you can't load textures whose length/width aren't a ^2, mipmaps, as is my understanding, allow you to bypass this. I've used mipmaps in my code but I'm getting nothing and all of the tutorials I can find use square images. Is there any way to bypass this?
-Aura
-
12-21-2008, 08:33 AM #9355QJ Gamer Blue
- Registriert seit
- Jul 2007
- Beiträge
- 296
- Points
- 3.795
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Mipmaps are just smaller versions of a texture to be used at farther distances. What you need to do is pad the texture to a power of two when you load it.
-
12-21-2008, 09:02 AM #9356I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
I read on NeHe that mipmaps removed the requirement for powers:
After reading that I followed down the code a bit more and found I had actually missed a line which was required for mipmaps, and I can confirm that it removes the limits because its working fine now.
Zitat von Nehe
-Aura
-
12-21-2008, 10:57 AM #9357QJ Gamer Blue
- Registriert seit
- Jul 2007
- Beiträge
- 296
- Points
- 3.795
- Level
- 38
- Downloads
- 0
- Uploads
- 0
The powers of two is a hardware limitation; adding a line to your code isn't going to change the hardware. Anyway, please read this article on mipmapping because you don't seem to understand it's purpose.
Also, try to stay away from NeHe's tutorials. They are pretty outdated and do not demonstrate the nicer ways to do things. The code is full of ugly globals and other nonsense.
Additionally, is there any reason you are using OpenGL over the PSP's native GU library? The OpenGL implementation on the PSP isn't complete and doesn't always comply to what you think should happen on the PC.
-
12-21-2008, 02:14 PM #9358It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Buh? Mipmaps don't remove the power of two limitation...that's only removed in OpenGL 2.0, IIRC, and that's a matter of specification, which need be implemented by the hardware. The PSP doesn't exactly have OpenGL (despite what the lecture slides at my graphics course this past semester said), at least in terms of hardware. pspGL is a compatibility layer, nothing more. Unless you're porting something, there's no real reason to use pspGL, as GU is the real library. No translation involved.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-21-2008, 07:13 PM #9359I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
I know PSPGL isn't a true OpenGL port, but it seems overkill to learn the GU libraries (for which I have no experiance what so ever with) when PSPGL does everything I require and uses a format I'm more comfortable with for a small project. If I was making a game or something that relied heavily on the 3D and rendering, or even was planning on using it more often, then I'd probably learn GU, but right now I can't justify the headaches I'll have by making dumb mistakes with the GU code for a one off.
Mipmaps also allow me to load the images, which makes me happy and does what I need. I can't see a way of padding a jpg or png image to be a square (although bmp shouldn't be too hard). I do however have concerns that mipmaps have a larger memory footprint. When I have some spare time I'll read into png and jpg specification as their format isn't as simple as bmp I believe.
-Aura
-
12-21-2008, 07:23 PM #9360QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
once in ram, their all the same thing, all png and jpg do is allow for better compress of an image, but in the end, they all appear the same inside ram
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