Seite 334 von 340 ErsteErste ... 234 284 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 LetzteLetzte
Zeige Ergebnis 9.991 bis 10.020 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; Does some1 knows the code ore a sample to printf the mobo of the psp, the firmware and the available ...

  
  1. #9991
    QJ Gamer Green
    Points: 2.003, Level: 27
    Level completed: 2%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Jun 2009
    Beiträge
    61
    Points
    2.003
    Level
    27
    Downloads
    0
    Uploads
    0

    Standard PSP Mobo and firmware reader and RAM

    Does some1 knows the code ore a sample to printf the mobo of the psp, the firmware and the available RAM(i got a slim if it's necessary)???And which files should I include?

    BTW Sorry for double post


    Geändert von LegendMythe (12-29-2009 um 12:08 PM Uhr)

  2. #9992
    QJ Gamer Green
    Points: 2.003, Level: 27
    Level completed: 2%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Jun 2009
    Beiträge
    61
    Points
    2.003
    Level
    27
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von mootjeuh Beitrag anzeigen
    does anyone know how to clear the ram ?
    Why do you want to clear the RAM cause if you clear it your program stops working, not?Ore do you want to clear a part of the RAM?

  3. #9993
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    Zitat Zitat von LegendMythe Beitrag anzeigen
    Does some1 knows the code ore a sample to printf the mobo of the psp, the firmware and the available RAM(i got a slim if it's necessary)???And which files should I include?
    to get the CFW version and the available RAM, you could do this:
    Code:
    #include <pspsysmem.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    char getFWversion()
    {
    	int ver = sceKernelDevkitVersion();
    	char *aStr;
    	char buffer[16];
    	sprintf(buffer, "%x", ver);
    	buffer[1]='.'; buffer[3] = buffer[4]; buffer[4] = 0;
    	aStr = buffer;
    	return aStr;
    }
    
    int getFreeRAM()
    {
    	void *buf[64];
    	int i;
    	for(i = 0; i < 64; i++) {
    		buf[i] = malloc(1024*1024);
    		if(!buf[i]) break;
    	}
    	int result = i;
    	for(; i >= 0; i--) {
    		free(buf[i]);
    	}
    	return (result*1024*1024);
    }
    
    //later on:
    
    int main(void)
    {
    	//somewhere in your code:
    	pspDebugScreenInit();
    	pspDebugScreenSetXY(0,0);
    	pspDebugScreenPrintf("Your CFW version is: %s.\n", getFWversion());
            pspDebugScreenPrintf("There's %i of available RAM.", getFreeRAM());
    }
    Zitat Zitat von LegendMythe
    BTW i replied some1 and now there are 2 of my post does this count as double post???
    yes

    Zitat Zitat von LegendMythe
    Why do you want to clear the RAM cause if you clear it your program stops working, not?Ore do you want to clear a part of the RAM?
    I want to clear the unused part of the RAM, the "junk", "grabage", etc.
    Geändert von mootjeuh (12-29-2009 um 12:12 PM Uhr)

  4. #9994
    QJ Gamer Green
    Points: 2.003, Level: 27
    Level completed: 2%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Jun 2009
    Beiträge
    61
    Points
    2.003
    Level
    27
    Downloads
    0
    Uploads
    0

    Standard

    Ty but don't i need a lib in my makefile?Cause if i compile I get some errors:
    main.c: In function 'getFWversion':
    main.c:25: warning: return makes integer from pointer without a cast
    main.c: In function 'main':
    main.c:78: warning: format '%s' expects type 'char *', but argument 2 has type '
    int'
    main.c: In function 'getFWversion':
    main.c:26: internal compiler error: Segmentation fault

    If some1 knows a way to read the mobo of the psp please pm me ore something...

  5. #9995
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    Zitat Zitat von LegendMythe Beitrag anzeigen
    Ty but don't i need a lib in my makefile?Cause if i compile I get some errors:
    main.c: In function 'getFWversion':
    main.c:25: warning: return makes integer from pointer without a cast
    main.c: In function 'main':
    main.c:78: warning: format '%s' expects type 'char *', but argument 2 has type '
    int'
    main.c: In function 'getFWversion':
    main.c:26: internal compiler error: Segmentation fault

    If some1 knows a way to read the mobo of the psp please pm me ore something...
    I've never heard of an internal compiler error, and I suppose that you 26th line is "}", so you should try compiling with another compiler, try minPSPw ;)

  6. #9996
    QJ Gamer Green
    Points: 2.003, Level: 27
    Level completed: 2%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Jun 2009
    Beiträge
    61
    Points
    2.003
    Level
    27
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von mootjeuh Beitrag anzeigen
    I've never heard of an internal compiler error, and I suppose that you 26th line is "}", so you should try compiling with another compiler, try minPSPw ;)
    I already use pspmini :)
    I found something i changed the char getFWversion()
    {...} to char* getFWversion()
    {...} and now I can compile it but the program say my firmware is 9fbfdd8 and i have 5.50GEN-3.
    I tried changing printf("Your CFW version is: %s.\n\n\n", getFWversion()); to printf("Your CFW version is: %x.\n\n\n", getFWversion()); like the char* getFWversion and now it says that my firmware is "9fbfdd8"...
    Geändert von LegendMythe (12-29-2009 um 01:23 PM Uhr)

  7. #9997
    QJ Gamer Bronze
    Points: 5.583, Level: 48
    Level completed: 17%, Points required for next Level: 167
    Overall activity: 0%

    Registriert seit
    May 2007
    Beiträge
    127
    Points
    5.583
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von LegendMythe Beitrag anzeigen
    BTW the RAM works fine but it give it in bytes i want it in mb is there a way to change it like %i : 1000000
    go learn a few C tutorials before trying to hack on the psp.

    what is the ratio between a byte, kilobyte and megabyte... just think about how you would convert one to the other..
    -- Code Monkey : Sarien, Fishguts, Cracks and Crevices --

    "Did IQ's just drop sharply while I was away?" (Ripley)

  8. #9998
    QJ Gamer Green
    Points: 2.003, Level: 27
    Level completed: 2%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Jun 2009
    Beiträge
    61
    Points
    2.003
    Level
    27
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von _df_ Beitrag anzeigen
    go learn a few C tutorials before trying to hack on the psp.

    what is the ratio between a byte, kilobyte and megabyte... just think about how you would convert one to the other..
    Yea i just found how i needed to do that sorry and wtf do you mean with "what is the ratio between a byte, kilobyte and megabyte... just think about how you would convert one to the other.." Do you mean if i know that 1kb is 1/1024 mb?

  9. #9999
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    Zitat Zitat von LegendMythe Beitrag anzeigen
    I already use pspmini :)
    I found something i changed the char getFWversion()
    {...} to char* getFWversion()
    {...} and now I can compile it but the program say my firmware is 9fbfdd8 and i have 5.50GEN-3.
    I tried changing printf("Your CFW version is: %s.\n\n\n", getFWversion()); to printf("Your CFW version is: %x.\n\n\n", getFWversion()); like the char* getFWversion and now it says that my firmware is "9fbfdd8"...
    you shouldn't use GEN for developing, the pspsdk doesn't work that well on it, try moving to M33 ;)

  10. #10000
    QJ Gamer Bronze
    Points: 5.583, Level: 48
    Level completed: 17%, Points required for next Level: 167
    Overall activity: 0%

    Registriert seit
    May 2007
    Beiträge
    127
    Points
    5.583
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von LegendMythe Beitrag anzeigen
    Yea i just found how i needed to do that sorry and wtf do you mean with "what is the ratio between a byte, kilobyte and megabyte... just think about how you would convert one to the other.." Do you mean if i know that 1kb is 1/1024 mb?
    wtf do I mean? I mean go do some tuts as you dont seem to know jack ****. and yeah if you know 1kb is 1/1024 mb... you still have not realised thats your freaking answer... isnt it nice when you figure things out on your own... :Argh:
    -- Code Monkey : Sarien, Fishguts, Cracks and Crevices --

    "Did IQ's just drop sharply while I was away?" (Ripley)

  11. #10001
    QJ Gamer Green
    Points: 2.003, Level: 27
    Level completed: 2%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Jun 2009
    Beiträge
    61
    Points
    2.003
    Level
    27
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von _df_ Beitrag anzeigen
    wtf do I mean? I mean go do some tuts as you dont seem to know jack ****. and yeah if you know 1kb is 1/1024 mb... you still have not realised thats your freaking answer... isnt it nice when you figure things out on your own... :Argh:
    Dude...Why the f*ck do you think this thread is called a freaking HELP thread.If you don't want to help people and you hate asking for help then go to the discusion(which isn't this thread!!!) thread!:Argh:
    BTW i can figure stuff out on my on, but this i couldn't thats why I came to the freaking HELP thread!

    Anayways ty for evryone that helpt...

  12. #10002
    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:
    ioFunctions/search.o: In function `searchForFile':
    search.c:(.text+0x2b8): undefined reference to `free'
    search.c:(.text+0x47c): undefined reference to `malloc'
    ioFunctions/fileBrowser.o: In function `recacheGameDir':
    fileBrowser.c:(.text+0xa0): undefined reference to `free'
    fileBrowser.c:(.text+0xdc): undefined reference to `memalign'
    ioFunctions/fileBrowser.o: In function `fileBrowser':
    fileBrowser.c:(.text+0x278): undefined reference to `free'
    fileBrowser.c:(.text+0x560): undefined reference to `malloc'
    Never seen this error before , it happens while using the 4.XX m33 SDK , anyone know the solution?

  13. #10003
    QJ Gamer Green
    Points: 2.003, Level: 27
    Level completed: 2%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Jun 2009
    Beiträge
    61
    Points
    2.003
    Level
    27
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von hallo007 Beitrag anzeigen
    Code:
    ioFunctions/search.o: In function `searchForFile':
    search.c:(.text+0x2b8): undefined reference to `free'
    search.c:(.text+0x47c): undefined reference to `malloc'
    ioFunctions/fileBrowser.o: In function `recacheGameDir':
    fileBrowser.c:(.text+0xa0): undefined reference to `free'
    fileBrowser.c:(.text+0xdc): undefined reference to `memalign'
    ioFunctions/fileBrowser.o: In function `fileBrowser':
    fileBrowser.c:(.text+0x278): undefined reference to `free'
    fileBrowser.c:(.text+0x560): undefined reference to `malloc'
    Never seen this error before , it happens while using the 4.XX m33 SDK , anyone know the solution?
    It means that the program doesn't know what"free" "memalign" "malloc"...Maybe you didn't defined a file ore included a lib in the makefile...

  14. #10004
    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

    Zitat Zitat von LegendMythe Beitrag anzeigen
    It means that the program doesn't know what"free" "memalign" "malloc"...Maybe you didn't defined a file ore included a lib in the makefile...
    Ofcourse , I understand the error...
    Just dunno which lib , never knew "malloc" needed a lib...

  15. #10005
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    Zitat Zitat von hallo007 Beitrag anzeigen
    Code:
    ioFunctions/search.o: In function `searchForFile':
    search.c:(.text+0x2b8): undefined reference to `free'
    search.c:(.text+0x47c): undefined reference to `malloc'
    ioFunctions/fileBrowser.o: In function `recacheGameDir':
    fileBrowser.c:(.text+0xa0): undefined reference to `free'
    fileBrowser.c:(.text+0xdc): undefined reference to `memalign'
    ioFunctions/fileBrowser.o: In function `fileBrowser':
    fileBrowser.c:(.text+0x278): undefined reference to `free'
    fileBrowser.c:(.text+0x560): undefined reference to `malloc'
    Never seen this error before , it happens while using the 4.XX m33 SDK , anyone know the solution?
    seems that you didn't include <stdlib.h> and <stdio.h>, try putting this at the first line of your .c :
    Code:
    #include <stdlib.h>
    #include <stdio.h>
    but I highly doubt it's coming from your .c, I'm guessing you don't have them in your Makefile but that impossible coz they're standard C files, could you post your Makefile?

    Zitat Zitat von hallo007 Beitrag anzeigen
    Ofcourse , I understand the error...
    Just dunno which lib , never knew "malloc" needed a lib...
    yeah, that's the weird part, it DOESN'T need a lib


    OR, either your compiler or/and pspsdk is/are screwed up

  16. #10006
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von mootjeuh Beitrag anzeigen
    yes

    I want to clear the unused part of the RAM, the "junk", "grabage", etc.
    good memory managment and you don't need to clear the RAM, if ur refering to the data not allocated yet(i.e. u wanna cover your tracks or something) then simply calculate the remaining ram, and create an array that size, then randomize and/or set it to 0, however anything in use should NEVER be cleared that isn't your's(plus their's protection against doing it), nothing is junk when it's in use by another program
    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

  17. #10007
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von Art Beitrag anzeigen
    I'm sure this could be simplified:
    Code:
    	lonwork = limit_left;
    	latwork = limit_top;
    	while (lonwork < displon) {lonwork = lonwork + zoom; xxx++;}
    	while (latwork > displat) {latwork = latwork - zoom; yyy++;}
    I just have a block.
    It's all about incrementing xxx and yyy the correct number of times.
    Any ideas?
    Code:
    xxx+=(displon-lonwork)/zoom
    lonwork += (displon-lonwork)*zoom;
    yyy+=(latwork-displat)/zoom
    latwork -= (latwork-displat)*zoom;
    that should work, however more of a description would help, however this can lead to problems(division by 0, or floating point->int(assuming these are int's) errors, and of course the while loop ensures negative doesn't happen, this doesn't, some some checks can take away your problems)

    edit: opps, double post my bad

    edit:
    Zitat Zitat von LegendMythe Beitrag anzeigen
    Dude...Why the f*ck do you think this thread is called a freaking HELP thread.If you don't want to help people and you hate asking for help then go to the discusion(which isn't this thread!!!) thread!:Argh:
    BTW i can figure stuff out on my on, but this i couldn't thats why I came to the freaking HELP thread!

    Anayways ty for evryone that helpt...
    Legend, if your output is in bytes, and you want it to be in mb's, than you must convert from bytes->kbytes->mb's, that is what DF is attempting to say(although he should not have acted out in anger against you), however also listen to the people here, and don't act out against them as well
    Geändert von slicer4ever (12-30-2009 um 01:22 PM Uhr)
    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

  18. #10008
    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

    Zitat Zitat von mootjeuh Beitrag anzeigen
    seems that you didn't include <stdlib.h> and <stdio.h>, try putting this at the first line of your .c :
    Code:
    #include <stdlib.h>
    #include <stdio.h>
    but I highly doubt it's coming from your .c, I'm guessing you don't have them in your Makefile but that impossible coz they're standard C files, could you post your Makefile?

    yeah, that's the weird part, it DOESN'T need a lib


    OR, either your compiler or/and pspsdk is/are screwed up
    No I dindt forget to include them, so here is my Makefile:
    Code:
    TARGET = test
    OBJS = main.o \
           menu.o \
           audio/audio.o \
           ioFunctions/search.o \
           ioFunctions/fileBrowser.o \
    	   exports.o
    	   
    INCDIR = ../../include
    CFLAGS = -O2 -Os -G0 -Wall -fshort-wchar -fno-pic -mno-check-zero-division 
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    BUILD_PRX = 1
    PRX_EXPORTS = exports.exp
    
    USE_KERNEL_LIBC = 1
    USE_KERNEL_LIBS = 1
    
    PSP_FW_VERSION = 371
    
    LIBDIR = ../../lib
    LIBS =             -lpsprtc         \
                      -lpspwlan        \
                      -lstdc++         \
                      -lpsputility     \
                      -lpsppower       \
                      -lpspgu          \
                      -lpng            \
                      -lz              \
                      -lm              \
                      -lmad            \
                      -lpspaudiolib    \
                      -lpspaudio       \
                      -lpspusb         \
                      -lpspusbstor     \				 
    				  -lpspmp3
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build_prx.mak

  19. #10009
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von hallo007 Beitrag anzeigen
    No I dindt forget to include them, so here is my Makefile:
    Code:
    TARGET = test
    OBJS = main.o \
           menu.o \
           audio/audio.o \
           ioFunctions/search.o \
           ioFunctions/fileBrowser.o \
    	   exports.o
    	   
    INCDIR = ../../include
    CFLAGS = -O2 -Os -G0 -Wall -fshort-wchar -fno-pic -mno-check-zero-division 
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    BUILD_PRX = 1
    PRX_EXPORTS = exports.exp
    
    USE_KERNEL_LIBC = 1
    USE_KERNEL_LIBS = 1
    
    PSP_FW_VERSION = 371
    
    LIBDIR = ../../lib
    LIBS =             -lpsprtc         \
                      -lpspwlan        \
                      -lstdc++         \
                      -lpsputility     \
                      -lpsppower       \
                      -lpspgu          \
                      -lpng            \
                      -lz              \
                      -lm              \
                      -lmad            \
                      -lpspaudiolib    \
                      -lpspaudio       \
                      -lpspusb         \
                      -lpspusbstor     \				 
    				  -lpspmp3
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build_prx.mak
    if your working with c++, why are u using free/malloc over new/delete?
    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

  20. #10010
    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

    mayby the second error can help you:
    Code:
    /usr/local/pspdev/psp/sdk/lib/libpspdebug.a(pspDebugScreenInit.o): In function `
    pspDebugScreenInitEx':
    /home/Roel/psptoolchain/build/pspsdk/src/debug/scr_printf.c:141: undefined refer
    ence to `sceGeEdramGetAddr'
    /usr/local/pspdev/psp/sdk/lib/libpspdebug.a(pspDebugScreenPrintf.o): In function
     `pspDebugScreenPrintf':
    /home/Roel/psptoolchain/build/pspsdk/src/debug/scr_printf.c:432: undefined refer
    ence to `vsnprintf'
    collect2: ld returned 1 exit status
    this error gives me the feeling that my sdk is screwed up

  21. #10011
    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

    Zitat Zitat von slicer4ever Beitrag anzeigen
    if your working with c++, why are u using free/malloc over new/delete?
    i'm not working in c++ at the moment , forget to delete the c++ lib , I'm just testing different things at the moment , and I'm to lazy to open a new project , so there will be things that arent needed

  22. #10012
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    yeah, your SDK is definitely screwed up ;) if you're on Windows, install minPSPw

  23. #10013
    QJ Gamer Bronze
    Points: 5.583, Level: 48
    Level completed: 17%, Points required for next Level: 167
    Overall activity: 0%

    Registriert seit
    May 2007
    Beiträge
    127
    Points
    5.583
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von LegendMythe Beitrag anzeigen
    Dude...Why the f*ck do you think this thread is called a freaking HELP thread.If you don't want to help people and you hate asking for help then go to the discusion(which isn't this thread!!!) thread!:Argh:
    BTW i can figure stuff out on my on, but this i couldn't thats why I came to the freaking HELP thread!

    Anayways ty for evryone that helpt...
    I did help you, I pointed you in the right direction, I just didn't give you a cut and paste answer that you wanted. I asked you a simple question on the ratio of bytes to kb to mb (basically telling you you need to divide one to the other) and you got all "WTF!" in my face for giving you the answer.

    Yeah, this is a help thread, remember that when you want to get all hostile and "WTF" in peoples faces.
    -- Code Monkey : Sarien, Fishguts, Cracks and Crevices --

    "Did IQ's just drop sharply while I was away?" (Ripley)

  24. #10014
    Points: 1.361, Level: 20
    Level completed: 61%, Points required for next Level: 39
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Dec 2009
    Ort
    SomeWhere
    Beiträge
    9
    Points
    1.361
    Level
    20
    My Mood
    Relaxed
    Downloads
    0
    Uploads
    0

    Standard

    This is maybe something noby but I can't make it work...
    I followed one of the tuts for making a menu with graphics.h.Now I want to add to the menu that when i press a button like cross that it makes the screen clear and print something on it.But now i tried that but i now have to hold X...

    My code:
    Code:
    int main() {
    	SetupCallbacks();
        initGraphics();
    	pspDebugScreenInit();
    
    	SceCtrlData pad;
    
    	while(1) {
    		sceCtrlReadBufferPositive(&pad,1);
    		fillScreenRect(white,0,0,480,272);
    		timer++;
                  
            for(foo=0;foo<10;foo++) {
    		if((pad.Buttons & PSP_CTRL_CROSS) && (select == 0)) {
    		printTextScreen(200,foo*10+70,menuItems[foo],black);
    		}
    		printTextScreen(200,select*10+70,menuItems[select],red);
    
    		
    		if((pad.Buttons & PSP_CTRL_UP) && (timer > 10) && (select > 0)) {
    			select--;
    			timer = 0;
    		} else if ((pad.Buttons & PSP_CTRL_DOWN) && (timer > 10) && (select < 9)) {
    			select++;
    			timer = 0;
    		}
    		if((pad.Buttons & PSP_CTRL_CROSS) && (select == 0)) {
    		pspDebugScreenClear();//if add pspdebug.h and stuff
                    printf("blablabla");//I defined printf to
            flipScreen();
            sceDisplayWaitVblankStart();
    
    	}
    	return 0;
        }

  25. #10015
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von ButMan Beitrag anzeigen
    This is maybe something noby but I can't make it work...
    I followed one of the tuts for making a menu with graphics.h.Now I want to add to the menu that when i press a button like cross that it makes the screen clear and print something on it.But now i tried that but i now have to hold X...

    My code:
    Code:
    int main() {
    	SetupCallbacks();
        initGraphics();
    	pspDebugScreenInit();
    
    	SceCtrlData pad;
    
    	while(1) {
    		sceCtrlReadBufferPositive(&pad,1);
    		fillScreenRect(white,0,0,480,272);
    		timer++;
                  
            for(foo=0;foo<10;foo++) {
    		if((pad.Buttons & PSP_CTRL_CROSS) && (select == 0)) {
    		printTextScreen(200,foo*10+70,menuItems[foo],black);
    		}
    		printTextScreen(200,select*10+70,menuItems[select],red);
    
    		
    		if((pad.Buttons & PSP_CTRL_UP) && (timer > 10) && (select > 0)) {
    			select--;
    			timer = 0;
    		} else if ((pad.Buttons & PSP_CTRL_DOWN) && (timer > 10) && (select < 9)) {
    			select++;
    			timer = 0;
    		}
    		if((pad.Buttons & PSP_CTRL_CROSS) && (select == 0)) {
    		pspDebugScreenClear();//if add pspdebug.h and stuff
                    printf("blablabla");//I defined printf to
            flipScreen();
            sceDisplayWaitVblankStart();
    
    	}
    	return 0;
        }
    it's called states, diffrent states of the game, reflect diffrent things to happen:

    Code:
    int main() {
    	SetupCallbacks();
    	initGraphics();
    	pspDebugScreenInit();
    	SceCtrlData pad;
    	int State=0;
    	while(1){
    		sceCtrlReadBufferPositive(&pad,1);
    		fillScreenRect(white,0,0,480,272);
    		if(State==0){
    			timer++;
    			for(foo=0;foo<10;foo++) {
    				if((pad.Buttons & PSP_CTRL_CROSS) && (select == 0)) {
    					printTextScreen(200,foo*10+70,menuItems[foo],black);
    				}
    				printTextScreen(200,select*10+70,menuItems[select],red);
    				if((pad.Buttons & PSP_CTRL_UP) && (timer > 10) && (select > 0)) {
    					select--;
    					timer = 0;
    				} else if ((pad.Buttons & PSP_CTRL_DOWN) && (timer > 10) && (select < 9)) {
    					select++;
    					timer = 0;
    				}
    				if((pad.Buttons & PSP_CTRL_CROSS) && (select == 0)) {
    					State=1;
    				}
    			}
    		}else if(State==1){
    			printf("blablabla");//I defined printf to
    			flipScreen();
    			if(pad.Buttons&PSP_CTRL_CIRCLE){
    				State=0;
    			}
    		}
    	}
    	return 0;
    }
    hope this helps
    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

  26. #10016
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von hallo007 Beitrag anzeigen
    No I dindt forget to include them, so here is my Makefile:
    Code:
    TARGET = test
    OBJS = main.o \
           menu.o \
           audio/audio.o \
           ioFunctions/search.o \
           ioFunctions/fileBrowser.o \
           exports.o
           
    INCDIR = ../../include
    CFLAGS = -O2 -Os -G0 -Wall -fshort-wchar -fno-pic -mno-check-zero-division 
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    BUILD_PRX = 1
    PRX_EXPORTS = exports.exp
    
    USE_KERNEL_LIBC = 1
    USE_KERNEL_LIBS = 1
    
    PSP_FW_VERSION = 371
    
    LIBDIR = ../../lib
    LIBS =             -lpsprtc         \
                      -lpspwlan        \
                      -lstdc++         \
                      -lpsputility     \
                      -lpsppower       \
                      -lpspgu          \
                      -lpng            \
                      -lz              \
                      -lm              \
                      -lmad            \
                      -lpspaudiolib    \
                      -lpspaudio       \
                      -lpspusb         \
                      -lpspusbstor     \                 
                      -lpspmp3
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build_prx.mak
    Linking KERNEL_LIBC is a bad idea if you don't know what you're doing. Remove that line, so that normal libc (newlib) is linked, then you'll have access to all libc functions as normal, including malloc and free.
    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.

  27. #10017
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von hallo007 Beitrag anzeigen
    mayby the second error can help you:
    Code:
    /usr/local/pspdev/psp/sdk/lib/libpspdebug.a(pspDebugScreenInit.o): In function `
    pspDebugScreenInitEx':
    /home/Roel/psptoolchain/build/pspsdk/src/debug/scr_printf.c:141: undefined refer
    ence to `sceGeEdramGetAddr'
    /usr/local/pspdev/psp/sdk/lib/libpspdebug.a(pspDebugScreenPrintf.o): In function
     `pspDebugScreenPrintf':
    /home/Roel/psptoolchain/build/pspsdk/src/debug/scr_printf.c:432: undefined refer
    ence to `vsnprintf'
    collect2: ld returned 1 exit status
    this error gives me the feeling that my sdk is screwed up
    The second error comes from linking KERNEL_LIBC again, the first one because you didn't #include in your source file.
    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.

  28. #10018
    Points: 1.361, Level: 20
    Level completed: 61%, Points required for next Level: 39
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Dec 2009
    Ort
    SomeWhere
    Beiträge
    9
    Points
    1.361
    Level
    20
    My Mood
    Relaxed
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von slicer4ever Beitrag anzeigen
    it's called states, diffrent states of the game, reflect diffrent things to happen:

    Code:
    if to
    			flipScreen();
    			if(pad.Buttons&PSP_CTRL_CIRCLE){
    				State=0;
    			}
    		}
    	}
    	return 0;
    }
    hope this helps
    it doesn't really work it flashes between white and black and my menu options won't show up...Is there an other way?

  29. #10019
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von ButMan Beitrag anzeigen
    it doesn't really work it flashes between white and black and my menu options won't show up...Is there an other way?
    well, look at the code, it's designed to do that, when state = 0, then show the menu, when state = 1 it'll print the words out(which is what i thought u originally wanted to happen)

    now then, if u want both menu and text, but without holding the button think about what you'd have to do:

    1. detect when x is pressed(u've already done that)
    2. set a variable saying x has been pressed
    3. check if that variable is set, if so print the string aswell as the menu

    it's not hard, bit of logic and variable handling=-), it's similar to how states work, but inside the menu code itself=-)
    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

  30. #10020
    Points: 1.361, Level: 20
    Level completed: 61%, Points required for next Level: 39
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Dec 2009
    Ort
    SomeWhere
    Beiträge
    9
    Points
    1.361
    Level
    20
    My Mood
    Relaxed
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von slicer4ever Beitrag anzeigen
    well, look at the code, it's designed to do that, when state = 0, then show the menu, when state = 1 it'll print the words out(which is what i thought u originally wanted to happen)

    now then, if u want both menu and text, but without holding the button think about what you'd have to do:

    1. detect when x is pressed(u've already done that)
    2. set a variable saying x has been pressed
    3. check if that variable is set, if so print the string aswell as the menu

    it's not hard, bit of logic and variable handling=-), it's similar to how states work, but inside the menu code itself=-)
    Yea i know and it works thanks but now when i have pressed X it works but the background keep flashing from white to black.And only the first menu item is showd, but when i go down the next buttons show but the first option is still in the select color...It's kinda weird got some suggestions?
    code:
    Code:
    int main() {
    	SetupCallbacks();
    	initGraphics();
    	pspDebugScreenInit();
    	SceCtrlData pad;
    	int State=0;
    	State=0;
    	while(1){
    		sceCtrlReadBufferPositive(&pad,1);
    		
    		if(State==0){
    			timer++;
    			for(foo=0;foo<10;foo++) {
    				if((pad.Buttons & PSP_CTRL_CROSS) && (select == 0)) {
    					printTextScreen(200,foo*10+70,menuItems[foo],black);
    				}
    				printTextScreen(200,select*10+70,menuItems[select],red);
    				if((pad.Buttons & PSP_CTRL_UP) && (timer > 10) && (select > 0)) {
    					select--;
    					timer = 0;
    				} else if ((pad.Buttons & PSP_CTRL_DOWN) && (timer > 10) && (select < 9)) {
    					select++;
    					timer = 0;
    				}
    				if((pad.Buttons & PSP_CTRL_CROSS) && (select == 0)) {
    					State=1;
    				}
    			flipScreen();
    			}
    		}else if(State==1){
    			pspDebugScreenClear();
    			printTextScreen(5,5, "blabla", red);
    			flipScreen();
    			sceDisplayWaitVblank();
    			if(pad.Buttons&PSP_CTRL_CIRCLE){
    				pspDebugScreenClear();
    				State=0;
    			}
    		}
    			if((pad.Buttons & PSP_CTRL_CROSS) && (select == 0)) {
    		State==1;
    		}
    	
    	}
    	return 0;
    }
    Geändert von ButMan (12-31-2009 um 07:09 AM Uhr)


 

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:15 PM Uhr.

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