Seite 189 von 340 ErsteErste ... 89 139 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 239 289 ... LetzteLetzte
Zeige Ergebnis 5.641 bis 5.670 von 10174

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 ...

  
  1. #5641
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von slicer4ever
    you have to create your own trace function i believe as i haven't seen any function on the psp that does this, although it's fairly simple just create a function that well write text to a file
    yeh but what text...?


    ...Just Returned To The Scene...

  2. #5642
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    printf usually outputs to TTY over PSPLink. This is why I keep saying that printf should NOT be #defined to something else.

  3. #5643
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    yaustar: why does the program on the previous page make my PSP freeze when ran?
    ...Just Returned To The Scene...

  4. #5644
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von JaSo PsP
    yaustar: why does the program on the previous page make my PSP freeze when ran?
    No idea. Wild guess (depending on the size of the struct) stack overflow?
    Code:
        SceIoDirent directoryEntry[MAX_DIRS];
    Reduce the number and see if it still runs?

    As Archaemic said, add traces to your code to PSPLink and narrow down the line that is causing the crash.

  5. #5645
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    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;
    }
    sceIdStorageReadLeaf(idke y, dump);

    it crashes at getting the first key:s

  6. #5646
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    I am on the verge of crying. 8 hours for the toolchain. now sdl refuses to install. please tell me what's wrong somebody.
    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
    Also when running ./autogen.sh i get this:
    Code:
    [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
    This may be relevant to the problem

  7. #5647
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Did you run the ./configure script? If so, with which parameters?
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  8. #5648
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    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)

  9. #5649
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    What's the full path to the SDL folder?
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  10. #5650
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    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 ?

  11. #5651
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    i think i found my problem, i was supposed to add 'memset' to the code... Me thinks...
    -= Double Post =-
    Zitat Zitat von eldiablov
    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 ?
    WANT_AUTOMAKE="1.9" before you type make.
    Geändert von JaSo PsP (07-25-2007 um 10:33 AM Uhr) Grund: Automerged Doublepost
    ...Just Returned To The Scene...

  12. #5652
    QJ Gamer Gold
    Points: 14.678, Level: 78
    Level completed: 57%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    1.523
    Points
    14.678
    Level
    78
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eldiablov
    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 ?
    I remember what was in your sig

  13. #5653
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    erm. About popups ?

    Cant you help me with my SDL problem ?

  14. #5654
    QJ Gamer Gold
    Points: 14.678, Level: 78
    Level completed: 57%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    1.523
    Points
    14.678
    Level
    78
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eldiablov
    erm. About popups ?

    Cant you help me with my SDL problem ?
    I would never recommend nor TRY SDL myself. But why would u need it?

    BTW , your Sig was: "I drink a lot. I'm immature. I love myself. Sue me" Put it back.

  15. #5655
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    no. I refuse . I want to port something which requires SDL. I normally wouldnt touch it with a barge pole.

  16. #5656
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    how do you get the "main thread's stack size"????

  17. #5657
    QJ Gamer Green
    Points: 8.459, Level: 62
    Level completed: 3%, Points required for next Level: 291
    Overall activity: 32,0%

    Registriert seit
    Apr 2007
    Beiträge
    886
    Points
    8.459
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    how do you make a simple printf clock hh:mm:ss.

  18. #5658
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    void CurrentTime( char * timeText) {
          pspTime rtime;
          sceRtcGetCurrentClockLocalTime(&rtime);
          snprintf(timeText, 8, "%i:%02i" , rtime.hour , rtime.minutes);
    }
    Fanjita's code in the Post your C examples Thread

  19. #5659
    QJ Gamer Green
    Points: 8.459, Level: 62
    Level completed: 3%, Points required for next Level: 291
    Overall activity: 32,0%

    Registriert seit
    Apr 2007
    Beiträge
    886
    Points
    8.459
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    ^^ thank you

    edit: what include do i need for the function sceRtcGetCurruentClockLoc alTime
    Geändert von vodkkaa (07-26-2007 um 02:47 AM Uhr)

  20. #5660
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    psprtc.h
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  21. #5661
    QJ Gamer Green
    Points: 8.459, Level: 62
    Level completed: 3%, Points required for next Level: 291
    Overall activity: 32,0%

    Registriert seit
    Apr 2007
    Beiträge
    886
    Points
    8.459
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    why wont this work. all it writes is a ' and thats it

    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;
    }
    and makefile:

    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

  22. #5662
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    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 əʞɒʇ

  23. #5663
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    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:

    Code:
    char* CurrentTime() {
               pspTime rtime;
               char* timeText;
               sceRtcGetCurrentClockLocalTime(&rtime);
               snprintf( timeText, 8, "%i:%02i" , rtime.hour , rtime.minutes);
               return timeText;
    }
    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...
    ...Just Returned To The Scene...

  24. #5664
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    JaSo, that will cause nothing but trouble. You need to initialize timeText with some memory first.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  25. #5665
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Archaemic
    JaSo, that will cause nothing but trouble. You need to initialize timeText with some memory first.
    that must be why i always get freezage when i use pointers with sprintf.... thanx :) ill use malloc more often.
    ...Just Returned To The Scene...

  26. #5666
    QJ Gamer Green
    Points: 8.459, Level: 62
    Level completed: 3%, Points required for next Level: 291
    Overall activity: 32,0%

    Registriert seit
    Apr 2007
    Beiträge
    886
    Points
    8.459
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Archaemic
    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;
    }
    this code returns the same results as the code i was using. just a ' on screen
    Geändert von vodkkaa (07-26-2007 um 04:36 AM Uhr)

  27. #5667
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    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 əʞɒʇ

  28. #5668
    QJ Gamer Green
    Points: 8.459, Level: 62
    Level completed: 3%, Points required for next Level: 291
    Overall activity: 32,0%

    Registriert seit
    Apr 2007
    Beiträge
    886
    Points
    8.459
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Archaemic
    Try changing
    dsxDrawFontDefault(0, 100, GU_RGBA(0, 0, 0, 255), time);
    to
    dsxDrawFontDefault(0, 100, GU_RGBA(255, 255, 255, 255), time);
    im getting a warning from cygwin saying "passing arguement 4 of dsxDrawFontDefault from incompatible pointer type"

  29. #5669
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Then you don't have the code exactly as I have it.

    Well, here's a better way anyway:

    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;
    }
    If that still doesn't work, then it's because I know nothing about DSX.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  30. #5670
    QJ Gamer Green
    Points: 8.459, Level: 62
    Level completed: 3%, Points required for next Level: 291
    Overall activity: 32,0%

    Registriert seit
    Apr 2007
    Beiträge
    886
    Points
    8.459
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Archaemic
    Then you don't have the code exactly as I have it.

    Well, here's a better way anyway:

    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;
    }

    If that still doesn't work, then it's because I know nothing about DSX.
    it works!! thank you so so much


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 09:28 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .