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 slicer4ever you have to create your own trace function i believe as i haven't seen any function on ...
-
07-25-2007, 07:06 AM #5641QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
yeh but what text...?
Zitat von slicer4ever
...Just Returned To The Scene...
-
07-25-2007, 07:06 AM #5642QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
printf usually outputs to TTY over PSPLink. This is why I keep saying that printf should NOT be #defined to something else.
[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]
-
07-25-2007, 07:18 AM #5643QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
yaustar: why does the program on the previous page make my PSP freeze when ran?
...Just Returned To The Scene...
-
07-25-2007, 08:08 AM #5644QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
No idea. Wild guess (depending on the size of the struct) stack overflow?
Zitat von JaSo PsP
Reduce the number and see if it still runs?Code:SceIoDirent directoryEntry[MAX_DIRS];
As Archaemic said, add traces to your code to PSPLink and narrow down the line that is causing the crash.[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]
-
07-25-2007, 09:06 AM #5645Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
sceIdStorageReadLeaf(idke y, dump);Code:int IdDump(const char* dst) { char PrintBin[56] , dump[512]; int BinSave; u16 idkey; BinSave = sceIoOpen(dst, PSP_O_CREAT | PSP_O_TRUNC | PSP_O_WRONLY, 0777); if(BinSave<0) { return 0; } pspDebugScreenClear(); for(idkey=0x000;idkey<=0x200;idkey++) // Ampliado desde 0x000 hasta 0x200 (anterior 0x004-0x127) { pspDebugScreenPrintf("key 0x%03X\n",idkey); sprintf(PrintBin,"KEY : 0x%03X\n",idkey); sceIoWrite(BinSave, PrintBin, 512); sceIdStorageReadLeaf(idkey, dump); sceIoWrite(BinSave, dump, 512); } sceIoClose(BinSave); return 0; }
it crashes at getting the first key:s
-
07-25-2007, 09:18 AM #5646Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
I am on the verge of crying. 8 hours for the toolchain. now sdl refuses to install. please tell me what's wrong somebody.
Also when running ./autogen.sh i get this:Code:[email protected] ~/sdl $ make Making all in src make[1]: Entering directory `/home/Server2003/sdl/src' .deps/SDL_error.Plo:1: *** multiple target patterns. Stop. make[1]: Leaving directory `/home/Server2003/sdl/src' make: *** [all-recursive] Error 1
This may be relevant to the problemCode:[email protected] ~/sdl $ ./autogen.sh Generating build information using aclocal, automake and autoconf This may take a while ... /usr/share/aclocal/libsmi.m4:8: warning: underquoted definition of AM_PATH_LIBSM I run info '(automake)Extending aclocal' or see http://sources.redhat.com/automake/automake.html#Extending-aclocal /usr/share/aclocal/cppunit.m4:4: warning: underquoted definition of AM_PATH_CPPU NIT /usr/share/aclocal/libsmi.m4:8: warning: underquoted definition of AM_PATH_LIBSM I run info '(automake)Extending aclocal' or see http://sources.redhat.com/automake/automake.html#Extending-aclocal /usr/share/aclocal/cppunit.m4:4: warning: underquoted definition of AM_PATH_CPPU NIT Now you are ready to run ./configure
-
07-25-2007, 09:28 AM #5647It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Did you run the ./configure script? If so, with which parameters?
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
07-25-2007, 09:33 AM #5648Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Code:LDFLAGS="-L$(psp-config --pspsdk-path)/lib -lc -lpspuser" \ ./configure --host psp --prefix=$(psp-config --psp-prefix)
Geändert von eldiablov (07-25-2007 um 09:50 AM Uhr)
-
07-25-2007, 10:04 AM #5649It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
What's the full path to the SDL folder?
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
07-25-2007, 10:06 AM #5650Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
D:\cygwin\home\Server2003 \SDL
It may be something to do with automake. How do i force it to use automake 1.9 ? instead of 1.10 ?
-
07-25-2007, 10:31 AM #5651QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
i think i found my problem, i was supposed to add 'memset' to the code... Me thinks...
-= Double Post =-
WANT_AUTOMAKE="1.9" before you type make.
Zitat von eldiablov
Geändert von JaSo PsP (07-25-2007 um 10:33 AM Uhr) Grund: Automerged Doublepost
...Just Returned To The Scene...
-
07-25-2007, 10:52 AM #5652
I remember what was in your sig
Zitat von eldiablov
-
07-25-2007, 10:54 AM #5653Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
erm. About popups ?
Cant you help me with my SDL problem ?
-
07-25-2007, 10:58 AM #5654
I would never recommend nor TRY SDL myself. But why would u need it?
Zitat von eldiablov
BTW , your Sig was: "I drink a lot. I'm immature. I love myself. Sue me" Put it back.
-
07-25-2007, 10:59 AM #5655Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
no. I refuse
. I want to port something which requires SDL. I normally wouldnt touch it with a barge pole.
-
07-25-2007, 11:27 AM #5656Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
how do you get the "main thread's stack size"????
-
07-26-2007, 01:30 AM #5657
how do you make a simple printf clock hh:mm:ss.
-
07-26-2007, 01:39 AM #5658lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Fanjita's code in the Post your C examples ThreadCode:void CurrentTime( char * timeText) { pspTime rtime; sceRtcGetCurrentClockLocalTime(&rtime); snprintf(timeText, 8, "%i:%02i" , rtime.hour , rtime.minutes); }
-
07-26-2007, 02:11 AM #5659
^^ thank you
edit: what include do i need for the function sceRtcGetCurruentClockLoc alTimeGeändert von vodkkaa (07-26-2007 um 02:47 AM Uhr)
-
07-26-2007, 03:53 AM #5660It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
psprtc.h
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
07-26-2007, 04:00 AM #5661
why wont this work. all it writes is a ' and thats it
and makefile:Code:void CurrentTime( char * timeText) { pspTime rtime; sceRtcGetCurrentClockLocalTime(&rtime); snprintf( timeText, 8, "%i:%02i" , rtime.hour , rtime.minutes); } int main() { dsxSystemInit(); while(1) { dsxDrawingStart(); dsxDrawFontDefault(0, 100, GU_RGBA(0, 0, 0, 255), CurrentTime); dsxDrawingEnd(); } return 0; }
Code:# Target Name TARGET = battery # Source Files OBJS = ./main.o #Build as a prx BUILD_PRX = 1 # Libraries LIBS = -ldsx -lpspgum -lpspgu -lm -lpsppower -lpsprtc -lpsphprm # Misc. INCDIR = CFLAGS = -O2 -G0 -Wall CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LIBDIR = PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak
-
07-26-2007, 04:08 AM #5662It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
I'm surprised that that would even COMPILE.
Code:void CurrentTime( char * timeText) { pspTime rtime; sceRtcGetCurrentClockLocalTime(&rtime); snprintf( timeText, 8, "%i:%02i" , rtime.hour , rtime.minutes); } int main() { dsxSystemInit(); char *time = malloc(sizeof(char)*9); while(1) { CurrentTime(time); dsxDrawingStart(); dsxDrawFontDefault(0, 100, GU_RGBA(0, 0, 0, 255), time); dsxDrawingEnd(); } return 0; }pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
07-26-2007, 04:09 AM #5663QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Well, the 'CurrentTime' doesnt return anything, void CurrentTime( char * timeText). When you put it in the drawfont function, it doesnt know what to write because that function returns void... The function may work better like this:
plus, when you used the function, you didnt put brackets after it '( char* timeText )' You were supposed to full it with what you wanted to fill...Code:char* CurrentTime() { pspTime rtime; char* timeText; sceRtcGetCurrentClockLocalTime(&rtime); snprintf( timeText, 8, "%i:%02i" , rtime.hour , rtime.minutes); return timeText; }...Just Returned To The Scene...
-
07-26-2007, 04:11 AM #5664It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
JaSo, that will cause nothing but trouble. You need to initialize timeText with some memory first.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
07-26-2007, 04:12 AM #5665QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
that must be why i always get freezage when i use pointers with sprintf.... thanx :) ill use malloc more often.
Zitat von Archaemic
...Just Returned To The Scene...
-
07-26-2007, 04:24 AM #5666
this code returns the same results as the code i was using. just a ' on screen
Zitat von Archaemic
Geändert von vodkkaa (07-26-2007 um 04:36 AM Uhr)
-
07-26-2007, 04:56 AM #5667It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Try changing
dsxDrawFontDefault(0, 100, GU_RGBA(0, 0, 0, 255), time);
to
dsxDrawFontDefault(0, 100, GU_RGBA(255, 255, 255, 255), time);pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
07-26-2007, 05:15 AM #5668
im getting a warning from cygwin saying "passing arguement 4 of dsxDrawFontDefault from incompatible pointer type"
Zitat von Archaemic
-
07-26-2007, 06:24 AM #5669It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Then you don't have the code exactly as I have it.
Well, here's a better way anyway:
If that still doesn't work, then it's because I know nothing about DSX.Code:int main() { dsxSystemInit(); pspTime time; for(;;) { dsxDrawingStart(); sceRtcGetCurrentClockLocalTime(&time); dsxDrawFontDefault(0, 100, GU_RGBA(0, 0, 0, 255), "%i:%02i",time.hour,time.minutes); dsxDrawingEnd(); } return 0; }pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
07-26-2007, 06:30 AM #5670
it works!! thank you so so much
Zitat von Archaemic


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