Seite 121 von 340 ErsteErste ... 21 71 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 171 221 ... LetzteLetzte
Zeige Ergebnis 3.601 bis 3.630 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; or you can use about.com or just google the command and it comes up with plenty of stuff...

  
  1. #3601
    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

    or you can use about.com or just google the command and it comes up with plenty of stuff


    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

  2. #3602
    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

    Sometimes pertaining to different languages...
    I just use cppreference.com (C89/C++), cplusplus.com (C89/C++; more in-depth) or opengroup.org (C99) for my reference.

  3. #3603
    QJ Gamer Green
    Points: 5.712, Level: 48
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    USA SC/NC
    Beiträge
    699
    Points
    5.712
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von superbatxs
    So would you happen to know what to do? I have been testing and patiently waiting for someone to help for hours, and i want to finish this before i do any other optimizations to my shell.
    Code:
    #include <stdio.h>
    
    int main()
    {
    	FILE* pFile;                  // :|
    	pFile = fopen("test.txt","r+b");// Open the file in reading and writing modes :|
    	fseek(pFile,5,SEEK_SET); // Goes to 5 bytes after the beginning of the file.
    	fprintf(pFile,"0");            // Writes 0 to the 6th byte...
    	fclose(pFile);                // :|
    	return 0;                     // :|
    }
    /*
     Before:
    		123456789
     After:
    		123450789
    */
    -_-
    [CODE]Random Facts:
    irc://irc.malloc.us #wtf #**********
    [/CODE]

    [SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]

  4. #3604
    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

    what is "r+b"? i only know of "r+"
    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

  5. #3605
    QJ Gamer Green
    Points: 5.712, Level: 48
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    USA SC/NC
    Beiträge
    699
    Points
    5.712
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von slicer4ever
    what is "r+b"? i only know of "r+"
    Open it in binary mode instead of text mode. If you dont specify b, it will likely open a file in text mode.
    [CODE]Random Facts:
    irc://irc.malloc.us #wtf #**********
    [/CODE]

    [SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]

  6. #3606
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Moca
    Open it in binary mode instead of text mode. If you dont specify b, it will likely open a file in text mode.
    I think you're just supposed to use "rb", not "r+b". But they probably do the same thing.

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

    No, they don't. r+b is read/write binary mode. You can't use write functions with rb as your mode.

  8. #3608
    QJ Gamer Green
    Points: 5.712, Level: 48
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    USA SC/NC
    Beiträge
    699
    Points
    5.712
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied
    I think you're just supposed to use "rb", not "r+b". But they probably do the same thing.
    As the Archaemic said...

    r and r+ are different.
    r means read only
    r+ means read and write

    b means binary mode

    rb means read in binary mode
    r+b means read and write in binary mode
    [CODE]Random Facts:
    irc://irc.malloc.us #wtf #**********
    [/CODE]

    [SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]

  9. #3609
    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

    r+b was the only one i hadn't seen and i didn't put one and 2 together
    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

  10. #3610
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Oh, i didn't know you could do read and write and binary mode all together....thanks Moca, now it makes sense.
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  11. #3611
    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

    edit: nvm
    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

  12. #3612
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Hey guys, thanks for helping me learn file i/o writing x to y bytes. Thanks to you guys, my project is going great. Btw, i made a guide for people who would have trouble with this:

    Post some C samples
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  13. #3613
    QJ Gamer Green
    Points: 5.712, Level: 48
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    USA SC/NC
    Beiträge
    699
    Points
    5.712
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von superbatxs
    Hey guys, thanks for helping me learn file i/o writing x to y bytes. Thanks to you guys, my project is going great. Btw, i made a guide for people who would have trouble with this:

    Post some C samples
    Dammnit i wish i had developer status :|
    [CODE]Random Facts:
    irc://irc.malloc.us #wtf #**********
    [/CODE]

    [SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]

  14. #3614
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Moca
    The first thing that comes to mind is fread + strcmp
    fseek(file,-4,SEEK_END); // Seeks -4 bytes from the end of the file

    Then read the four bytes with fread and store it in a string. Compare the string with "mp3" and if strcmp returns 0, they are equal.

    btw, i guess you could read the header of every file in a directory then work from there.
    IC, so what I would do is

    Code:
    if (fseek(gameEntry[current_selection].name,-4,SEEK_END) == ".mp3") {
                                       MP3_Init();
                                       MP3_Load(gameEntry[current_selection].path);
                                       MP3_Play();
                         }
                    }
    Correct?
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  15. #3615
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Moca
    Dammnit i wish i had developer status :|
    Remember one thing: developer status is what you need to strive for. I personally don't know you, but my advice to you is that releasing a good app doesn't always earn you dev status- you have to be smart in a lot of coding fields. I personally think you should be a dev, but just some advice for you. ;)
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  16. #3616
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    There's one problem with your example Superbatxs. What if you don't know exactly where the 5 is? Here's an example that will replace the first 5 in the file with a 0. And it doesn't matter where it is in the file.

    Code:
    #include <stdio.h>
    
    int main() {
         FILE* foo = fopen("foo.txt","r+b");
         for(;;) {
              int get = fgetc(foo);
              if(get == 53) {
                   fprintf(foo,"0");
                   break;
              }
              if(get == EOF) {
                      printf("There is no 5 in the file.");
                      sceKernelDelayThread(5*1000*1000);
                      sceKernelExitGame();
              }
         }
         fclose(foo);
         sceKernelExitGame();
    }
    EDIT: Turns out that particular code doesn't work, but you get the idea.

  17. #3617
    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

    Remember one thing: developer status is what you need to strive for. I personally don't know you, but my advice to you is that releasing a good app doesn't always earn you dev status- you have to be smart in a lot of coding fields. I personally think you should be a dev, but just some advice for you.
    No, not really. Dev status is more a random title than anything strived for, or measuring your smartness in "a lot of coding fields". Actually, it doesn't mean anything on these forums, but that the person has released any two or three end-user titles, be it a LUA pixel unstucking script or a full-blown Shell in C. It's as giving the title scientist to anyone that ever wrote an essay in school, while at the same time real scientists that do mainly background work don't get the title, for the plain reason that some newspaper columnists didn't recognize that work.

    BTW: Quoting yourself in your sig is the same as masturbating to your own picture.
    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.

  18. #3618
    QJ Gamer Silver
    Points: 7.385, Level: 57
    Level completed: 18%, Points required for next Level: 165
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Finland
    Beiträge
    752
    Points
    7.385
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Raphael
    BTW: Quoting yourself in your sig is the same as masturbating to your own picture.
    If it wasn't 2:39AM in here, I would've bursted to a very loud laugh
    wheeee =:D

  19. #3619
    QJ Gamer Green
    Points: 5.712, Level: 48
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    USA SC/NC
    Beiträge
    699
    Points
    5.712
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von BlackShark
    IC, so what I would do is

    Code:
    if (fseek(gameEntry[current_selection].name,-4,SEEK_END) == ".mp3") {
                                       MP3_Init();
                                       MP3_Load(gameEntry[current_selection].path);
                                       MP3_Play();
                         }
                    }
    Correct?
    Incorrect. You dont compare strings with ==.

    You use strcmp(string1,string2);
    Code:
    if(strcmp(string1,string2) == 0)
    {
        printf("The strings %s and %s are equal \n",string1,string2);
    }
    [CODE]Random Facts:
    irc://irc.malloc.us #wtf #**********
    [/CODE]

    [SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]

  20. #3620
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von superbatxs
    Remember one thing: developer status is what you need to strive for. I personally don't know you, but my advice to you is that releasing a good app doesn't always earn you dev status- you have to be smart in a lot of coding fields. I personally think you should be a dev, but just some advice for you. ;)
    Honestly, there are only about 15 people on this entire forum that should have dev status. Me, not being one of them.

  21. #3621
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied
    There's one problem with your example Superbatxs. What if you don't know exactly where the 5 is? Here's an example that will replace the first 5 in the file with a 0. And it doesn't matter where it is in the file.

    Code:
    #include <stdio.h>
    
    int main() {
         FILE* foo = fopen("foo.txt","r+b");
         for(;;) {
              int get = fgetc(foo);
              if(get == 53) {
                   fprintf(foo,"0");
                   break;
              }
              if(get == EOF) {
                      printf("There is no 5 in the file.");
                      sceKernelDelayThread(5*1000*1000);
                      sceKernelExitGame();
              }
         }
         fclose(foo);
         sceKernelExitGame();
    }
    EDIT: Turns out that particular code doesn't work, but you get the idea.
    The purpose of my tutorial wasn't really to find a five and replace it with something. It was to write X to Y bytes in a file. Yea, you may be thinking that it's the same thing.....but let me put it in a different way (sorry i am bad at wording). It was also to find any number without knowing it, yet if you know its position in the file, then you replace it....um......well i don't know how else to put it. I had to use it for my G-Pack config file though, let's just say that.

    Zitat Zitat von Raphael
    No, not really. Dev status is more a random title than anything strived for, or measuring your smartness in "a lot of coding fields". Actually, it doesn't mean anything on these forums, but that the person has released any two or three end-user titles, be it a LUA pixel unstucking script or a full-blown Shell in C. It's as giving the title scientist to anyone that ever wrote an essay in school, while at the same time real scientists that do mainly background work don't get the title, for the plain reason that some newspaper columnists didn't recognize that work.

    BTW: Quoting yourself in your sig is the same as masturbating to your own picture.
    I definitely agree with your first paragraph. However, i must say that saying that "Quoting yourself in your sig is the same as masturbating to your own picture" is just RUDE. I don't even know you, and why the hell are you being so mean??? Just keep your comments to yourself.......and btw, i can say some pretty mean things about you by just looking at your posts and your personality. I can keep that quote if i want, and i need to express myself by quoting myself, and showing kindness and love to other developers, then masturbation isn't exactly the situation

    Zitat Zitat von Access_Denied
    Honestly, there are only about 15 people on this entire forum that should have dev status. Me, not being one of them.
    I definitely agree....with most of it. I agree that there are many people without dev status, however, i think you deserve it too. ;)
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  22. #3622
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    this isnt really psp related but its C++. is anyone familiar with allegro? if so then can you plz help me out here.
    if not then i will just go to the allegro board but im making a game. and all goes well compiled and everything then upon running the game i get that stupid error report from windows asking if i want to send an error report. the last time i got this with a game i was making was when one of the pics was wrongly named and thus couldnt be loaded. if anyone knows what my problem is that would be nice but if not then thats ok becaues i realize this isnt really psp related.
    Spoiler for Spoiler for code:
    Code:
    //lets begin with the header
    #include <allegro.h>
    
    //declare our pics
    //these are pics for our charactor
    BITMAP *charupSprite;
    BITMAP *chardownSprite;
    BITMAP *charleftSprite;
    BITMAP *charrightSprite;
    
    //our player coordinates on the screen
    int playerx = 10;
    int playery = 10;
    
    //players direction to correspond with the sprite
    int dir = 1;
    
    //main function
    int main()
    {
        //initiate the usual allegro stuff
        allegro_init();
        install_keyboard();
        set_color_depth(16);
        set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);
        
        //lets get a loop going so when the person presses
        // esc he/she can quit the game
            while ( !key[KEY_ESC])
        {
        //charactor pics
    charupSprite = load_bitmap("charup.bmp", NULL);
    chardownSprite = load_bitmap("chardown.bmp", NULL);
    charleftSprite = load_bitmap("charleft.bmp", NULL);
    charrightSprite = load_bitmap("charright.bmp", NULL);
        //clear the key buffer so its free of memory
        clear_keybuf();
        //acquire the screen
        acquire_screen();
        
        //lets set up the movement for the player
        if (key[KEY_UP]) dir = 1, --playery;
        else if (key[KEY_DOWN]) dir = 2, ++playery;
        else if (key[KEY_RIGHT]) dir = 3, ++playerx;
        else if (key[KEY_LEFT]) dir = 4, --playerx;
        
        //now the actual blitting of the picture to the screen
        //all the statements are for directions
        if (dir == 1)
        {
            draw_sprite( screen, charupSprite, playerx, playery);
        }
        else if (dir == 2)
        {
            draw_sprite( screen, chardownSprite, playerx, playery);
        }
        else if (dir == 3)
        {
            draw_sprite( screen, charrightSprite, playerx, playery);
        }
        else if (dir == 4)
        {
            draw_sprite( screen, charleftSprite, playerx, playery);
        }
        
        //end the while
        }
        
        //finish it off
        release_screen();
        return 0;
    }
    
    //end the main
    END_OF_MAIN();


    its not even that far into developement. and i still get this error.
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  23. #3623
    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 superbatxs
    I definitely agree with your first paragraph. However, i must say that saying that "Quoting yourself in your sig is the same as masturbating to your own picture" is just RUDE. I don't even know you, and why the hell are you being so mean??? Just keep your comments to yourself.......and btw, i can say some pretty mean things about you by just looking at your posts and your personality. I can keep that quote if i want, and i need to express myself by quoting myself, and showing kindness and love to other developers, then masturbation isn't exactly the situation
    Sorry, I wasn't trying to be rude or sth. but that's just my opinion. Quoting yourself is an act of egomania (independent of the context), hence the (meant to be more funny than offensive) analogy to masturbation.
    Anyway, you're free to express your own opinion about me if you feel fit for it.
    And yes, you're also totally free to keep that quote in your sig. I'm not god telling you you'll get to hell if you don't remove it or sth, I'm just a random person on the net telling you that I find it [InsertMeanWord] without any further consequences for you if you don't fit my opinion.
    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.

  24. #3624
    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:
    strcat ( temp , filename );
    strcat ( temp , "/" );
    sceIoMkdir(temp, 0777);
    let's say filename is "ms0:/PSP/test" for example
    why doesnt this work? (it doesnt make the folder test)

  25. #3625
    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 don't think you're supposed to end the filename with a slash.

    Check the return value of sceIoMkdir.

  26. #3626
    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

    aargh,oke that was stupid of me thnx

  27. #3627
    QJ Gamer Blue
    Points: 4.022, Level: 40
    Level completed: 36%, Points required for next Level: 128
    Overall activity: 0%

    Registriert seit
    Mar 2007
    Ort
    Holland..
    Beiträge
    154
    Points
    4.022
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    i am busy creating a nice menu; and now i want it to give it some nice color's i know how but it's a hell of job..
    it's
    pspDebugScreenSetTextColo r(0000CD); for the
    printf(" ->");
    pspDebugScreenSetTextColo r(FF0000);
    printf(" menu option 1\n");
    pspDebugScreenSetTextColo r(7FFF00);
    printf(" menu option 2\n");
    printf(" menu option 3\n");
    printf(" menu option 4\n");

    just for this with color's of:
    -> menu option 1
    menu option 2
    menu option 3
    menu option 4
    is there any way i can make this easyier?
    like printf("menu option 2",blue);?
    and printf(" ->",geen);
    could somehelp me with this?

  28. #3628
    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

    Code:
    #define GREEN 0x00ff00
    #define BLUE 0x0000ff
    /*et cetera*/
    int menuPrintf(char *string, u32 color) {
        pspDebugSetTextColor(color);
        return printf("%s",string);
    }
    Yes, it's that easy.

  29. #3629
    QJ Gamer Blue
    Points: 4.022, Level: 40
    Level completed: 36%, Points required for next Level: 128
    Overall activity: 0%

    Registriert seit
    Mar 2007
    Ort
    Holland..
    Beiträge
    154
    Points
    4.022
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Thanks allot
    -= Double Post =-
    and if got 2 more question's
    -I alsow want to print nickname, what is the most easy way to this?
    -and how do I halt a script.. first the user has to push X continue
    example:
    The creating of this program is not resposible for any damage to your psp.
    if you agree press START
    if you don't agree press X
    if (pad.Buttons & PSP_CTRL_START) {
    menu();
    }
    else if (pad.Buttons & PSP_CTRL_CROSS) {
    sceKernelExitGame();
    }
    else {
    sceKernelSleepTread();
    }
    something like this, i am not sure about else if
    Geändert von Kwastie (04-01-2007 um 07:34 AM Uhr) Grund: Automerged Doublepost

  30. #3630
    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

    -check the sdk samples!!!!!!!

    -sceKernelDelayThread(1000 000);
    1000000= one second

    -use code tags , thank you!


 

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 .