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 brethren i'm using psplink for the first time and i'm wondering if theres a command that you type ...
-
08-11-2007, 06:02 PM #6001I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
If you download the PSPLink that included in the RemoteJoy package (I know its definatly on Maxconsole, not sure about here) it includes a script that can reboot to the XMB, as far as I'm aware, PCterm is for the old version of PSPLink, PSPSH is the one included in RemoteJoy.
Zitat von brethren
-Aura
-
08-12-2007, 02:16 AM #6002QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
when i remove
Zitat von Raphael
USE_KERNEL_LIBC = 1
line then i get this error:
Code:/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(_sbrk.o): In func tion `_sbrk': ../../../../../../newlib/libc/sys/psp/libcglue.c:524: undefined reference to `sc eKernelMaxFreeMemSize'
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
08-12-2007, 02:44 AM #6003QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
Because Kernel Libc needs -lpspkernel. Just add it to the last position of the LIBS line in the makefile
Zitat von myschoo
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-12-2007, 02:59 AM #6004QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
im getting same error

also tried build_prx.mak...same error
Zitat von Makefile
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
08-12-2007, 10:30 AM #6005QJ Gamer Blue
- Registriert seit
- Feb 2007
- Ort
- Florida
- Beiträge
- 214
- Points
- 4.031
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Ugh..I'm still working on my sidescroller. The animation WAS working, but Idk what happened to it.
Whenever you get to the game part (the code I will post below), you can move 2 pixels, then the game will freeze.
Don't ask why I repeat blitting the same image 5 times...it makes it run smoother.Code:#include <pspkernel.h> #include <pspdisplay.h> #include <pspctrl.h> #include <stdio.h> //ADDITION FOR SPRINTF #include </usr/include/sys/stat.h> //ADDITION FOR TIME #include "graphics.h" #define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16)) void Game() { SceCtrlData pad; // NOTE! LinkWalking1.png is a stand-still motion. Image* Link[35]; Link[0] = loadImage("./Images/Link/LinkWalking1.png"); Link[1] = loadImage("./Images/Link/LinkWalking1.png"); Link[2] = loadImage("./Images/Link/LinkWalking1.png"); Link[2] = loadImage("./Images/Link/LinkWalking1.png"); Link[4] = loadImage("./Images/Link/LinkWalking1.png"); Link[5] = loadImage("./Images/Link/LinkWalking2.png"); Link[6] = loadImage("./Images/Link/LinkWalking2.png"); Link[7] = loadImage("./Images/Link/LinkWalking2.png"); Link[8] = loadImage("./Images/Link/LinkWalking2.png"); Link[9] = loadImage("./Images/Link/LinkWalking2.png"); Link[10] = loadImage("./Images/Link/LinkWalking3.png"); Link[11] = loadImage("./Images/Link/LinkWalking3.png"); Link[12] = loadImage("./Images/Link/LinkWalking3.png"); Link[13] = loadImage("./Images/Link/LinkWalking3.png"); Link[14] = loadImage("./Images/Link/LinkWalking3.png"); Link[15] = loadImage("./Images/Link/LinkWalking4.png"); Link[16] = loadImage("./Images/Link/LinkWalking4.png"); Link[17] = loadImage("./Images/Link/LinkWalking4.png"); Link[18] = loadImage("./Images/Link/LinkWalking4.png"); Link[19] = loadImage("./Images/Link/LinkWalking4.png"); Link[20] = loadImage("./Images/Link/LinkWalking5.png"); Link[21] = loadImage("./Images/Link/LinkWalking5.png"); Link[22] = loadImage("./Images/Link/LinkWalking5.png"); Link[23] = loadImage("./Images/Link/LinkWalking5.png"); Link[24] = loadImage("./Images/Link/LinkWalking5.png"); Link[25] = loadImage("./Images/Link/LinkWalking6.png"); Link[26] = loadImage("./Images/Link/LinkWalking6.png"); Link[27] = loadImage("./Images/Link/LinkWalking6.png"); Link[28] = loadImage("./Images/Link/LinkWalking6.png"); Link[29] = loadImage("./Images/Link/LinkWalking6.png"); Link[30] = loadImage("./Images/Link/LinkWalking7.png"); Link[31] = loadImage("./Images/Link/LinkWalking7.png"); Link[32] = loadImage("./Images/Link/LinkWalking7.png"); Link[33] = loadImage("./Images/Link/LinkWalking7.png"); Link[34] = loadImage("./Images/Link/LinkWalking7.png"); Image* Level1; Level1 = loadImage("./Images/Level1/1-1.png"); int FrameCounter = 0; int MenuOne = 0; int LinkPosX = 0; int LinkFrameCounter = 0; while(1) { sceCtrlReadBufferPositive(&pad, 1); if (pad.Buttons & PSP_CTRL_RIGHT) { LinkPosX += 2; LinkFrameCounter ++; if (LinkFrameCounter > 34) { LinkFrameCounter = 1; } } if (pad.Buttons & PSP_CTRL_LEFT) { LinkFrameCounter++; LinkPosX -= 2; if (LinkFrameCounter > 34) { LinkFrameCounter = 1; } } blitAlphaImageToScreen(0, 0, 480, 272, Level1, 0, 0); blitAlphaImageToScreen(0, 0, 50, 55, Link[LinkFrameCounter], LinkPosX, 195); sceDisplayWaitVblankStart(); flipScreen(); } }
And it doesn't freeze because I'm blitting the same image 5 times, becuase it worked before..
Anyone see the problem?Geändert von MrChaos (08-12-2007 um 10:46 AM Uhr)
-
08-12-2007, 10:36 AM #6006
Insteading of loading the same image 5 times in array and playing that back, you should instead Use loops and do the manipulation.
Zitat von MrChaos
NEVER do:
Somedatatype var[1]; instead Somedatatype var;
Image* Level1[1]; -> Image* Level1;
-
08-12-2007, 10:39 AM #6007QJ Gamer Blue
- Registriert seit
- Feb 2007
- Ort
- Florida
- Beiträge
- 214
- Points
- 4.031
- Level
- 40
- Downloads
- 0
- Uploads
- 0
But would that be the reason it's freezing? Because it worked before.
Zitat von Mr305
EDIT: Nope, that's not fixing the problem.
Ok, I fixed the Level1 thing.
So..Can anyone help me..?Geändert von MrChaos (08-12-2007 um 10:51 AM Uhr)
-
08-12-2007, 11:10 AM #6008QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
can anyone help? :/
Zitat von myschoo
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
08-12-2007, 11:40 AM #6009
its probably freezin cuz u are taking up a bunch of pointless memory loading the same image over again. You could change what u had to this (just changin to point to it):
Zitat von MrChaos
just make sure when u do freeImage() that u free only the actual ones that loaded themCode:Link[0] = loadImage("./Images/Link/LinkWalking1.png"); Link[1] = Link[0]; Link[2] = Link[0]; Link[2] = Link[0]; Link[4] = Link[0]; Link[5] = loadImage("./Images/Link/LinkWalking2.png"); Link[6] = Link[5]; Link[7] = Link[5]; Link[8] = Link[5]; Link[9] = Link[5]; Link[10] = loadImage("./Images/Link/LinkWalking3.png"); Link[11] = Link[10]; Link[12] = Link[10]; Link[13] = Link[10]; Link[14] = Link[10]; Link[15] = loadImage("./Images/Link/LinkWalking4.png"); Link[16] = Link[15]; Link[17] = Link[15]; Link[18] = Link[15]; Link[19] = Link[15]; //do that to all of it //and so on.....Current releases:
Icon Action Replacer v1.5- latest release
Current projects:
PSP C++ IDE - Currently v1.6
RPG Paradise - Latest version at my website
-
08-12-2007, 11:47 AM #6010QJ Gamer Blue
- Registriert seit
- Feb 2007
- Ort
- Florida
- Beiträge
- 214
- Points
- 4.031
- Level
- 40
- Downloads
- 0
- Uploads
- 0
I changed it and it still freezes..
Zitat von pspballer07
Wait a min...freeImage()? I never had that in there..Where should I put it..out of or in the loop?
-
08-12-2007, 11:49 AM #6011QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
out of the loop
and little tip:
this:
is same asif (LinkFrameCounter > 34)
{
LinkFrameCounter = 1;
}
if (LinkFrameCounter > 34) LinkFrameCounter = 1;[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
08-12-2007, 11:58 AM #6012Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
I want some info about encrypted prx'en
are this statements correct
1 We can decrypt prx with ever time the same code , if the prx is of the X.XX kernel that you are using ( where you run the decrypter) , but it wont work with a dump of another firmware
for example , you are on 150 firmware and decrypt the firmware with the code , then you tried it with a dump of 3.0 but it wont work , but when you launch the same code on 3.0 it will work
2 eu , let's start with statement one:)
-
08-12-2007, 11:59 AM #6013QJ Gamer Blue
- Registriert seit
- Feb 2007
- Ort
- Florida
- Beiträge
- 214
- Points
- 4.031
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Ok, Ive done everything you guys told me to, but it still doesn't work...
Maybe my RAM is full, because I was never clearing it or something?
-
08-12-2007, 12:08 PM #6014QJ Gamer Silver
- Registriert seit
- Sep 2006
- Ort
- Finland
- Beiträge
- 752
- Points
- 7.385
- Level
- 57
- Downloads
- 0
- Uploads
- 0
1. It depends on the module, if it's different in the other firmware, it won't most likely work as it's missing an export or something. The decryption keys change in most firmware versions.
Zitat von hallo007
I quite didn't understand the example, maybe someone esle does...wheeee =:D
-
08-12-2007, 12:11 PM #6015Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
nvm , you gave the answer:)
-
08-12-2007, 02:16 PM #6016I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Zitat von pspballer07
Surely that also is taking up pointless space, surely you could either just do this with pointers, or better yet, with loops.
using this, you can remove most of those link[] bits, it will keep moving exactly how you want, you add an extra variable, but you are freeing up a lot more space.Code:u8 sprite = 0; //takes less memory than int while(1) { sceCtrlReadBufferPositive(&pad, 1); if (pad.Buttons & PSP_CTRL_RIGHT) { LinkPosX += 2; //LinkFrameCounter ++; //remove sprite++; //add to sprite if (LinkFrameCounter > 34) LinkFrameCounter = 1; //much nicer code } if (pad.Buttons & PSP_CTRL_LEFT) { //LinkFrameCounter++; //remove LinkPosX -= 2; spirte++; //add to sprite if (LinkFrameCounter > 34) LinkFrameCounter = 1; //much nicer code } if(sprite==5){ //if sprite = 5, move to next Link, then reset spirte to 0 LinkFrameCounter++; sprite=0; } blitAlphaImageToScreen(0, 0, 480, 272, Level1, 0, 0); blitAlphaImageToScreen(0, 0, 50, 55, Link[LinkFrameCounter], LinkPosX, 195); sceDisplayWaitVblankStart(); flipScreen(); } }
Hope that of at least some help.
-Aura
-
08-12-2007, 03:15 PM #6017QJ Gamer Blue
- Registriert seit
- Feb 2007
- Ort
- Florida
- Beiträge
- 214
- Points
- 4.031
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Well, Idk what I did, but I slowly re-made the code and it worked. Thanks for you help, though.
Zitat von Auraomega
-
08-12-2007, 03:29 PM #6018I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Can anyone point me in the direction of an AI tutorial? The one on QJ has been removed by the looks of things, and I couldn't find another.
Thanks.
-Aura
-
08-12-2007, 03:39 PM #6019
gamedev.net
Zitat von Auraomega
flipcode.comCurrent releases:
Icon Action Replacer v1.5- latest release
Current projects:
PSP C++ IDE - Currently v1.6
RPG Paradise - Latest version at my website
-
08-12-2007, 03:49 PM #6020I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Thanks, I'll take a look at them both
Zitat von pspballer07
-Aura
-
08-12-2007, 07:45 PM #6021
yup
Zitat von Auraomega
they're good for overall game developmentCurrent releases:
Icon Action Replacer v1.5- latest release
Current projects:
PSP C++ IDE - Currently v1.6
RPG Paradise - Latest version at my website
-
08-13-2007, 05:12 AM #6022I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
I'm still having problems with using GU in the XMB, I've also noticed that using
has no effect unless I'm using PSPLink, when I do this without PSPLink it has no effect at all.Code:SceUID vsh_graphics; pspSdkReferThreadStatusByName("SCE_VSH_GRAPHICS",&vsh_graphics,0); sceKernelSuspendThread(vsh_graphics);
Does anyone know anything I specifically need to do to solve either problem?
-AuraGeändert von Auraomega (08-13-2007 um 05:48 AM Uhr)
-
08-13-2007, 06:35 AM #6023
For smoothness, Is it recommended to use float or ints ?
in things involving X & y pos / width /height like in blit functions? [Becz, In smooth scrolling, Decimal values are used]
What happens when we try to use not integer decimal values like 0.5 [that's half of a pixel]
-
08-13-2007, 06:46 AM #6024I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Some of this is only a guess so it may not be correct... Seeing as a pixal is the smallest individual part of a picture you can't have a fraction of that pixal, so the value would do 1 of 4 things:
Zitat von Mr305
- Crash
- Always round up
- Always round down
- Round up or down depending on number...
From past experiance (working with my map algorithms) I'd say its most likely to round down, no matter what the value, so 0.5 would become 0, 0.8 would become 0, and 2.2 would become 2. If you tried moved by 0.5 pixals, you wouldn't move anywhere, as you'd technically be moving by 0 pixals.
Of course, I don't know how much of this is true, its just what I observed when making the maps for RoadBlocks.
-Aura
-
08-13-2007, 06:54 AM #6025QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
5. Use subpixel accuracy and filter the pixel accordingly
Zitat von Auraomega
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-13-2007, 07:06 AM #6026
That means?...
Zitat von Raphael
-
08-13-2007, 07:54 AM #6027QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
A pixel placed at 0.5 will be drawn at position 0 but only get half intensity (plus half intensity of following pixel).
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-13-2007, 09:08 AM #6028QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
pls can anyone help? i cant compile prx in kernel mode, i get error undefined reference to sceKernelMaxFreeMemSize
Zitat von myschoo
Code:/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(_sbrk.o): In func tion `_sbrk': ../../../../../../newlib/libc/sys/psp/libcglue.c:524: undefined reference to `sc eKernelMaxFreeMemSize'
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
08-13-2007, 09:34 AM #6029
get rid of pspDebug* and see if it compiles
Zitat von myschoo
-
08-13-2007, 09:58 AM #6030QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
im not using pspdebug altogether
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspgu.h>
#include <stdio.h>
#include <pspctrl.h>
#include <string.h>
#include <pspiofilemgr.h>
#include "blit.h"
am i missing something? :/[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]


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