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; hi hope someone can help this is the error i get when using sceKernelLoadModule Code: block.c: -allocSysMemory:Low: no more space, ...
-
12-24-2007, 12:27 PM #7231Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
hi hope someone can help this is the error i get when using sceKernelLoadModule
Code:block.c: -allocSysMemory:Low: no more space, can not alloc block.c: -allocSysMemory:Low: request nblocks 26133 (max 1853) block.c: sceKernelAllocPartitionMemory: failed, mpid 0x00000002, name modulemgr.c: exe_thread: LoadModule failed: 0x800200d9 modulemgr.c: sceKernelLoadModuleWithApiType: sceKernelLoadModule failed 0x800200d9
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
12-25-2007, 12:59 PM #7232
What are you trying to compile or which program/application created that Debug output?
Zitat von FaT3oYCG
-
12-25-2007, 04:53 PM #7233QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
clearly it says that there is not enough memory to allocate oO. PS: posting on my new iPod touch
much better browser than the PSP one :P
...Just Returned To The Scene...
-
12-25-2007, 07:06 PM #7234It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Looks like kprintf output, if you ask me.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-26-2007, 01:35 AM #7235QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
Hey guys, i was just wondering if anyone knew or could direct me to where i find where the pic1.png is stored in an eboot as its location in bytes from the start and stuff. Im sure iv read this somewhere and iv been searching but i cant seem to find it. any help would be great
-
12-26-2007, 02:13 AM #7236Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
i think it is a problem wit my code i know that i need to use memset but with sceKernelLoadExec it is confusing because it requires SCEuid
Zitat von Mr305
oh and im adding it into luaplayer0.16 cools mod 4
i have already added in sceKernelLoadExec tans to aura and tommydanger but i now want sceKernelLoadExec - so i can load umd's
if that isnt the right command could you point the right one out please------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
12-26-2007, 02:18 AM #7237QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
what do you mean its confusing because of SCEuid? Thats just a pointer to a file
-
12-26-2007, 02:25 AM #7238Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
exactly but i can get it to send the righ value i would show you my code but im on the wrong computer and i changed the code and i know that the code is definatley wrong no
basically i have added two functions System.LoadModule("path") and System.StartModule(Module ) but it says that there is not enough memorywhich i think is because all of the memory is reserved sobasically how would i reserve memory for my function
as i said i think it involves something using memset------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
12-26-2007, 02:37 AM #7239QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
dont you have to use malloc or something to free up memory
-
12-26-2007, 06:36 AM #7240Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
thanks ill hve a look around on the web for how to use malloc
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
12-26-2007, 07:21 AM #7241
http://hitmen.c02.at/files/yapspd/ps...6.html#sec26.3
Zitat von Xsjado7
robot mafia
-
12-26-2007, 08:39 AM #7242QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
Thankyou!
-
12-26-2007, 12:53 PM #7243QJ Gamer Blue
- Registriert seit
- Nov 2007
- Beiträge
- 29
- Points
- 2.981
- Level
- 33
- Downloads
- 0
- Uploads
- 0
So, i have some questions...
1:
1a: About saving and loading a game save - > so, well, i want to make a save game feature for my next project. In my Asteroids game (as seen im the source code), save/load feature works by manually writing all the variables into txt file. But, is there a way to , for example, dump all the memory allocated by the game and then just force it back into position? Or another way how to do it?
1b: How do i save game using the psp/savedata/ folder? I've checked the samples in pspsdk, but not only i don't understand the whole encrypt/decrypt thing, but those app just don't work on my psp, so i don't have any chance to understand what they do.
2:
2a: How do i use the psp built-in virtual keyboard? Any samples?
2b: the same, but change "keyboard" to "messages" (somewhat like those in psptube, where both features are present).
-
12-26-2007, 03:32 PM #7244I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Has anyone got any good code out there for loading PSX games? I think I have what should be working, but I can't actually get it working, I'm going to hazard a guess and say the param.key is set wrong, so if anyone can help me out I would be really greatful.
Also, how would I got about unassigning and re-assigning flash2 or flash3?
Code so far:
but this always returns the nodev error when un-assigning. Oh, and those functions are my own, they work, and they are running in kernel, so thats not the cause.Code:status = devUnassign("flash2:"); if(status<0) { _printf("Error 0x%X in unassigning flash2", status); sceKernelSleepThread(); } status = devAssign("flash2:", "lflash0:0,2", "flashfat2:"); if(status<0) { _printf("Error 0x%X in assigning flash2 in read/write mode", status); sceKernelSleepThread(); }
1a - I believe there is a function for dumping blocks of memory, I can't find it right now, but I guess you can just write another function to recur the function dumping all the memory.
Zitat von Netaro
1b - I can't see why they won't work unless you don't have a PSP capable of running homebrew (which I highly doubt), or you have a slim, in which case if you can't get it working you probably need to go and do some more reading.
2a - I don't have any examples with me currently (not got around to adding OSK yet) but I believe you will find the functions in the psputility_osk.h file.
2b - As I said I've not added it yet, but I guess that in the above file there will be a way of doing this, just have a play around.
-AuraGeändert von Auraomega (12-26-2007 um 03:52 PM Uhr)
-
12-26-2007, 07:02 PM #7245QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
for message dialogs, check out the samples in utility/msgdialogs
-
12-26-2007, 07:59 PM #7246It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Don't dump the block of memory--it's a really bad idea. But if you really want to, you can use fwrite/sceIoWrite, depending on if you're using libc or pspuser
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-27-2007, 02:45 AM #7247QJ Gamer Blue
- Registriert seit
- Nov 2007
- Beiträge
- 29
- Points
- 2.981
- Level
- 33
- Downloads
- 0
- Uploads
- 0
Nope. I've checked both encrypt and decrypt on slim (3.71 ) and fat (3.17 and 1.50 kernels). In both examples psp just crashed.
Zitat von Auraomega
Also, i've checked the savegame utility. Theoretically, it works, but does nothing (well, looks like it tries to read something from memstick, but no save.bin appears in savedata folder, and the rest just doesn't work) and i don't understand it either (almost nothing is documented, and i have no idea for what are those two files, Databuf and sfodata). Checking the pspsdk doc's makes it even more un-understandable
. So, anybody have some working examples with source code? Or can explain in using layman's therms? Any help will be greatly appreciated :P
About messaging: Messaging works, thank you :). Now i'll have to find how to run the psp's virtual keyboard, so, do you have any code snippets that you would like to share?Geändert von Netaro (12-27-2007 um 03:58 AM Uhr)
-
12-27-2007, 04:41 AM #7248It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Yeah, the decrypt example doesn't work on 3.71 due to the fact that it needs kernel mode. I hacked it up to make it load, but it just spits out garbage, for some reason.
Anyway, you probably don't even want to use what those examples provide. They are for decrypting and encrypting savedata for already existing games.
I think the proper way to do it is to create a SceUtilitySavedataParam struct, pass a pointer to it to sceUtilitySavedataInitSta rt, perform a busywait (using sceKernelDelayThread appropriately so it's not TOO busy) on sceUtilitySavedataGetStat us until it's 3 or negative, call sceUtilitySavedataShutdow nStart, and then busywait on sceUtilitySavedataGetStat us until it's 4 or negative. Done. Saved or loaded, depending on what you passed as the struct.pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-27-2007, 08:52 AM #7249
Makefile trouble
I just need the EBOOT to be packed for a "release" package not for regular testing.
I'm doing this at the end of makefile:
Code:release: EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = Undisclosa PSP_EBOOT_ICON=icon0.png PSP_EBOOT_PIC1=pic1.pnggives:make release
Any alteranatives?PHP-Code:EXTRA_TARGETS = EBOOT.PBP
make: EXTRA_TARGETS: Command not found
make: *** [release] Error 127
-
12-27-2007, 08:57 AM #7250I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Someones bound to nag at me for saying this, but meh, try using pack-pbp, its old but I still use it and have no problems.
I don't think what you've done is incorrect as such, but maybe take away the indents as I know my makefiles go funny when I use indents sometimes, might solve your problem.
-Aura
-
12-27-2007, 09:02 AM #7251
Yep... Using
Zitat von Auraomega
mksfo "hell0worllP" PARAM.SFO
pack-pbp EBOOT.PBP PARAM.SFO icon0.png NULL NULL pic1.png NULL hello.prx NULL
:ROFL:
-
12-27-2007, 12:14 PM #7252QJ Gamer Blue
- Registriert seit
- Nov 2007
- Beiträge
- 29
- Points
- 2.981
- Level
- 33
- Downloads
- 0
- Uploads
- 0
Ok, thanks for explaining the encrypt/decrypt, but well...
Zitat von Archaemic
About the saving/loading - your explanation is exactly the same as the sample in pspsk, except without delaying. But, with sceDelayThread or without, it still does nothing. Nothing happens, at all. No new savestate appears, not even a single file.
And another problem arises, my c++ compiler (my ide is Visual c++ 2005) just doesn't recognize the new operator!
even simple int *x = new int; yields nothing, but errors. What is that, and how can i make it work?>
-
12-27-2007, 12:17 PM #7253It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
What are the errors? It's probably not linking with the proper library.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-27-2007, 12:19 PM #7254QJ Gamer Blue
- Registriert seit
- Nov 2007
- Beiträge
- 29
- Points
- 2.981
- Level
- 33
- Downloads
- 0
- Uploads
- 0
main.c:162: error: 'new' undeclared (first use in this function)
Zitat von Archaemic
main.c:162: error: (Each undeclared identifier is reported only once
main.c:162: error: for each function it appears in.)
main.c:162: error: expected ',' or ';' before 'int'
main.c:162: warning: unused variable 'x'
-
12-27-2007, 12:35 PM #7255It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Here's your problem.
Zitat von Netaro
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-27-2007, 12:44 PM #7256Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
add -lstdc++ to your LIBS in your makefile, and change the extensions to cpp.
--------------------------------------------------------------------------------------
-
12-27-2007, 06:09 PM #7257I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Can someone explain to me the difference between an int and a float, and how one relates to the other please? Starting using GU functions and the whole float thing has me a tad confused.
-Aura
-
12-27-2007, 06:20 PM #7258It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
int is an integer that has the width of one word (which, on the PSP, is 32 bits), and therefore can store numbers from -2^31 to 2^31-1 if it's signed (see Two's Complement for more information on signing) and 0 to 2^32-1 if it's unsigned. However, a float (or, more accurately, an single precision IEEE 754 floating-point type) is a special format that stores values as fractions multiplied by an exponent. It can store decimals to a few places of accuracy. floats are also 32 bits wide (doubles are double precision and are more accurate, but take up 64 bits and are not handled directly on the FPU in the PSP, and are therefore slower on the PSP). Basically, use floats for fractions/decimals and ints for integers, unless you really know what you're doing. (I've done some simple fixed point fractions once. It was pretty messy, but it got the job done.)
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-27-2007, 06:21 PM #7259
Float takes more bytes than integers; so when doing tight GU calculation you should stick to int;
Zitat von Auraomega
float is 32bit & int 16 bit. i.e. better fps.
-
12-27-2007, 06:30 PM #7260It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Uh, wrong. int is defined as one word. On the PSP, a word is 32 bits. Hence, an int is 32 bits.
E] Err, sorry, a long is one word. However, with gcc, on 32 bit systems, an int is still 32 bits.
E2] Wait, still wrong. It depends on the model the compiler uses for 64 bit systems, which doesn't seem to be very standardized. However, it's not really relevant because the PSP is 32-bit.pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ


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