Seite 29 von 340 ErsteErste ... 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 79 129 ... LetzteLetzte
Zeige Ergebnis 841 bis 870 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 liornetwork no way it takes a cuple of howers ant when i try to compile a diffrent program ...

  
  1. #841
    QJ Gamer Silver
    Points: 6.764, Level: 54
    Level completed: 7%, Points required for next Level: 186
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Brampton
    Beiträge
    631
    Points
    6.764
    Level
    54
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von liornetwork
    no way it takes a cuple of howers
    ant when i try to compile a diffrent program it works like a charm
    try posting at that site first.
    also that is the second tutorial of many more.
    you have to use what you learned to move forward.


    You can hyperlink quotes and the whole box will be a link:
    Zitat Zitat von ANTONIO_424
    Go for it, and remember, video tape every moment...........I gotta see this :D
    A Ultimate QJ FAQ-Topics I'm in-My qj game topic-My psp-prog topic-Old QJ Download site-Only ISO topic
    "You stayed up all night trying to make your psp crash? LOLOL!!" - my brother
    My PSN name is "icantthinkofone".

  2. #842
    QJ Gamer Blue
    Points: 4.421, Level: 42
    Level completed: 36%, Points required for next Level: 129
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    96
    Points
    4.421
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Hey guys,

    I was wondering if someone could help me out.

    I'd like to clip off a part of a text blitted with the freetype2 lib.

    IE.
    Code:
    mytext = "This is a long line of text which needs to be clipped"; 
    text_to_screen(mytext, x, y);
    I'd like it to display only the first part of the text, so:
    "This is a long li"

    Any ideas or suggestions are highly appreciated.

    Thanks in advance,
    Gh0sT

  3. #843
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Uhh... what? You can always seperate the string into an array of strings, allowing you to loop through and print them... Like a paragraph.
    Code:
    char paragraph[4][18] = {
         "Sentence #1",
         "Sentence #2",
         "Sentence #3",
         "Sentence #4"
    }
    
    ...
    
    for ( int i=0; i<4; i++ ) text_to_screen(paragraph[i], 0, i*character_height);
    That will print out the array of character arrays in a paragraph form. I dont know if the freetype library uses the top-left pixel as 0,0, so if it isnt, then youll have to modify the Y co-ordinate in the for loop differently.


    There also is another way to do what you want as well...
    Code:
    char string[] = "World Hello";
    int start_clipping=6, end_clipping=11;
    
    ...
    
    for ( int i = start_clipping; i <= end_clipping; i++ ) text_to_screen ( string[i], i*char_width, 0);
    That will print Hello, or more to the point, the charracters from 'start_clipping' and 'end_clipping'.

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  4. #844
    QJ Gamer Blue
    Points: 4.421, Level: 42
    Level completed: 36%, Points required for next Level: 129
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    96
    Points
    4.421
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Hey SG57, thanks for replying.

    I just got a different solution from someone which does the trick for me:
    Code:
    char mytext[10]; 
    strncpy(mytext,"This is a long line of text which need to be clipped",10);
    Thanks anyway,
    Gh0sT

  5. #845
    Developer
    Points: 5.359, Level: 47
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Norway
    Beiträge
    384
    Points
    5.359
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Color* vram = getVramDrawBuffer();
    for(curentco = 0; curentco < PSP_LINE_SIZE*272+480; curentco++) {
    vram[curentco] = RGB(255,255,255);
    }

    why dosn't that make the screen white?


  6. #846
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    What exactly are you trying to achieve waterbottle? If you're just trying to create a white 'background' then either use the clearScreen function, or draw a white quad using GU_SPRITES.

    That function looks like it would be slow.

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  7. #847
    Developer
    Points: 5.359, Level: 47
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Norway
    Beiträge
    384
    Points
    5.359
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Insomniac197
    What exactly are you trying to achieve waterbottle? If you're just trying to create a white 'background' then either use the clearScreen function, or draw a white quad using GU_SPRITES.

    That function looks like it would be slow.
    I were bored and got the idea to write that, arn't going to use it, just wondering why it dosn't work.. maybe I should swap the buffers?!


  8. #848
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Look at the fillScreenRect function mate, it'll answer your question.

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  9. #849
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    What engine he's using should have been asked first... PSPGL, SDL, OSlib, GU? All have there own framebuffers so maybe your using one that isn't compatible with Insomniac's advice? Since fillScreenRect is GU within the graphics library, if your using SDL, OSlib or PSPGL it wont do much good...

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  10. #850
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    It was obvious what he was using as a front end with the first line:

    Code:
    Color* vram = getVramDrawBuffer();
    Since getVramDrawBuffer() is a graphics lib function, I know he's asking about graphics lib usage.

    Do your research, then when you think about coming back with an answer that is neither informative or accurate...

    .. Don't.

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  11. #851
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von waterbottle
    Color* vram = getVramDrawBuffer();
    for(curentco = 0; curentco < PSP_LINE_SIZE*272+480; curentco++) {
    vram[curentco] = RGB(255,255,255);
    }

    why dosn't that make the screen white?
    I believe this should work:
    Code:
    Color* vram = getVramDrawBuffer();
    int x, y;
    for(x = 0; x < 480; x ++) {
      for(y = 0; y < 272; y++)
        vram[PSP_LINE_SIZE*y+x] = RGB(255,255,255);
    }


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  12. #852
    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

    help i get an error with cygwin three days ago it just works fine


  13. #853
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Copy cygwin1.dll from C:\cygwin\bin to C:\Windows\system32. That should fix the problem.


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  14. #854
    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 SG57
    What engine he's using should have been asked first... PSPGL, SDL, OSlib, GU? All have there own framebuffers so maybe your using one that isn't compatible with Insomniac's advice? Since fillScreenRect is GU within the graphics library, if your using SDL, OSlib or PSPGL it wont do much good...
    It doesn't matter anything which frontend you use. As long as you directly access the framebuffer it's just going to fill it up (the only question would be how to make that framebuffer visible on screen then, but that can be done with a flipscreen in graphics.c, or a sceGuSetFrameBuffer). You can do the same under windows with either OpenGL or DirectX or SDL or whatever you use. Only problem there is that DirectX for example locks framebuffers for access, but that doesn't matter in this case.
    Also as Insomniac stated, he used the "Color* vram = getVramDrawBuffer();" function to get the framebuffer pointer, so it's obvious he uses graphics.c.

  15. #855
    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

    rare when i compill it no errors
    but when i tried to launch it with psp it gives an error
    Code:
    //hello world v0.01b
    
    /* 
       thnx to psp-programming for their tutorials
    */
    
    #include <pspkernel.h> //alle codes voor de psp zodat schrijven gemmakelijker word
    #include <pspdebug.h> //nodig voor text op het scherm te printen
    
    PSP_MODULE_INFO("Hello World", 0, 1, 1); 
    /*
    niets belangerijk we vertellen de psp de naam van het programma maar je kan het weglaten het is niet echt de naam dat op het scherm zal verschijnen
    */
    #define printf pspDebugScreenPrintf
    /*
    we vertellen de compiller dat we screen gaan printen en om het gemmakelijk te maken zorgen we ervoor
    dat de compiller vanaf nu prontf kan lezen
    */
    /* Exit callback */
    int exit_callback(int arg1, int arg2, void *common) {
              sceKernelExitGame();
              return 0;
    }
    
    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
              int cbid;
    
              cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
              sceKernelRegisterExitCallback(cbid);
    
              sceKernelSleepThreadCB();
    
              return 0;
    }
    
    /* Sets up the callback thread and returns its thread id */
    int SetupCallbacks(void) {
              int thid = 0;
    
              thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
              if(thid >= 0) {
                        sceKernelStartThread(thid, 0, 0);
              }
    
              return thid;
    }
    //belangerijk altijd in code aanwezig zijn voor het sluiten enzovoort
    int main() { //start een functie
    pspDebugScreenInit();
    SetupCallbacks(); //zorg ervoor dat de functie start
    printf("hello world"); //print text on screen
    sceKernelSleepThread(); // dit zorgt ervoor dat de psp een pause neemt waardoor je je functie kan zien
    return 0; // het blift de functie  herhalen herhalen
    /* 
    nu zeggen we dat de functie gedaan is en kan de psp eventueel de volgende functies uitvoeren of beter gezegd de ram blift de functie niet herladen
    */
    
    //momenteel einde 
    }
    -= Double Post =-
    very rare
    i installed my 1.5 again and now it works
    -= Double Post =-
    so with the tutorials of psp-programming i made a timer
    but when stoped , you cant restart it , how do you let it restart by pressing [X]?????
    Geändert von hallo007 (09-10-2006 um 06:56 AM Uhr) Grund: Automerged Doublepost

  16. #856
    Developer
    Points: 5.359, Level: 47
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Norway
    Beiträge
    384
    Points
    5.359
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von hallo007
    so with the tutorials of psp-programming i made a timer
    but when stoped , you cant restart it , how do you let it restart by pressing [X]?????
    you could either put the entire code inside a different function or put all of it inside a loop and let that restart after the timer is finished. I would recomend you to complete and undersstand all of the tutorials before writing this though..

    but here is an example code of how you can do it..


    Code:
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspdisplay.h>
    #include <pspctrl.h>
    
    PSP_MODULE_INFO("Timer", 0,1,1);
    
    #define printf pspDebugScreenPrintf
    
    void timerfunction();//define the function so you can use it anywhere in the code.
    
    SceCtrlData pad;//make pad global so you can use it in all functions
    
    /* Exit callback */
    int exit_callback(int arg1, int arg2, void *common) {
              sceKernelExitGame();
              return 0;
    }
    
    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
              int cbid;
    
              cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
              sceKernelRegisterExitCallback(cbid);
    
              sceKernelSleepThreadCB();
    
              return 0;
    }
    
    /* Sets up the callback thread and returns its thread id */
    int SetupCallbacks(void) {
              int thid = 0;
    
              thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
              if(thid >= 0) {
                        sceKernelStartThread(thid, 0, 0);
              }
    
              return thid;
    }
    
    int main() {
    
    pspDebugScreenInit();
    SetupCallbacks();
    
    while(1) { timerfunction(); }//when ever the program gets here start the timer function
    
    return 0;
    }
    
    
    /////////////////////////////////////////////////////////77
    
    
    void timerfunction() {//start of the timer function
         
    int counter = 0;
    int i = 0;
    
    
    printf("Press [X] To Start the Timer");
    
    while(1) {
    
    sceCtrlReadBufferPositive(&pad, 1);
    
     if(pad.Buttons & PSP_CTRL_CROSS) {
                        break;
              }
    }
    
    while(1) {
              sceCtrlReadBufferPositive(&pad, 1);
              if(pad.Buttons & PSP_CTRL_CIRCLE) {
                        break;
              }
    
     pspDebugScreenClear();
     printf("Press [O] To Stop the Timer\n");
     printf("Counter: %i", counter);
    
     counter++;
      for(i=0; i<5; i++) {
                        sceDisplayWaitVblankStart();
              }
    }
    pspDebugScreenClear();
    printf("Counter Finished.");
    printf(" Final Count: %i\n", counter);
    printf("Press X to restart");
    
    while(1) {
             sceCtrlReadBufferPositive(&pad, 1);
             if(pad.Buttons & PSP_CTRL_CROSS) {//when the timer is finished wait for player to press X before returing to main() and restarting timer function
                            break;
                            }
             }
    
    }


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

    Now, if I try to flash a file, from within DevHook, it will reroute all files flashed to the "dh" folder, right? Even though, I'm only flashing name_plate.png, I'm still a little hesitant.

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

    can somone find a tutorial for loading just a background in c/c++ , or give me a code

    because i cant find it on psp-programming (it's with variables ,...)

  19. #859
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von hallo007
    can somone find a tutorial for loading just a background in c/c++ , or give me a code

    because i cant find it on psp-programming (it's with variables ,...)

    Code:
    Image* theImage;
    
    theImage = loadImage("theImage.png")
    -= Double Post =-
    help:

    ok, so i have a txt file with all my highscores. BUT, i want it so that when i compile, it will compile the text file INTO the eboot, so the player cant cheat and change the highscores. thx to anbody who helps!!
    Geändert von Grimfate126 (09-10-2006 um 12:14 PM Uhr) Grund: Automerged Doublepost
    --------------------------------------------------------------------------------------

  20. #860
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    ok, so i have a txt file with all my highscores. BUT, i want it so that when i compile, it will compile the text file INTO the eboot, so the player cant cheat and change the highscores. thx to anbody who helps!!
    That's a bit more complicated than just adding the txt to the eboot and then it's done. I have a function so you can read and create bin files which contains certain files. But I'm using that in my project, so I'm not willing to spread it around.


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  21. #861
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    ok, so i have a txt file with all my highscores. BUT, i want it so that when i compile, it will compile the text file INTO the eboot, so the player cant cheat and change the highscores. thx to anbody who helps!!
    Why bother? Just define variables that hold the information and update them as and when you need to.

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  22. #862
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Insomniac197
    Why bother? Just define variables that hold the information and update them as and when you need to.
    but, when i restart the game.. wont they be inttialized back to 0?? i want them, to be kept same...
    --------------------------------------------------------------------------------------

  23. #863
    QJ Gamer Platinum
    Points: 88.881, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%
    Awards:
    Frequent Poster

    Registriert seit
    Jul 2006
    Ort
    NorCal
    Beiträge
    24.899
    Points
    88.881
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    How do I put text in the middle of the screen?
    Can't figure it out...
    If you ever need me, you can contact me at [URL="**********.net"]**********.net.[/URL]

  24. #864
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    but, when i restart the game.. wont they be inttialized back to 0?? i want them, to be kept same...
    Then you won't be able compile the text file with the eboot then, as this would do the same thing.

    You'll need to encrypt/decrypt the high scores file somehow.

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  25. #865
    QJ Gamer Bronze
    Points: 5.650, Level: 48
    Level completed: 50%, Points required for next Level: 100
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    338
    Points
    5.650
    Level
    48
    Downloads
    0
    Uploads
    0

    Thumbs up

    Hey, does anyone know where I can find a tutorial for PSPGU well documented and explained for first time users?:Argh:

  26. #866
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TrumpeyGeek
    How do I put text in the middle of the screen?
    Can't figure it out...
    That depends on what you're using to print text. But if you're using the graphics lib you can do this:

    Code:
    printTextScreen((480/2)-((strlen("The text")*8)/2, (272/2)-(8/2), "The text", color);
    Zitat Zitat von Devun_06
    Hey, does anyone know where I can find a tutorial for PSPGU well documented and explained for first time users?
    Here: http://www.psp-programming.com/code/...id=c:tutorials


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  27. #867
    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

    What's the basic function for flashing a file to the flash? Something simple, like flashing name_plate.png. I just want the basic function, I don't want any error checks or printing to the screen, or anything else.

  28. #868
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Well.. I'm pretty sure this should work:
    Code:
    int FlashFile(char *inPath, char *outPath)
    {
    	char *inBuf;
    	long inSize = 0;
    
    	FILE * inFile = fopen(inPath, "rb");
    
    	fseek(inFile, 0, SEEK_END);
    	inSize = ftell(inFile);
    	
    	fseek(inFile, 0, SEEK_SET);
    	
    	inBuf = malloc(inSize+1);
    	
    	fread(inBuf, 1, inSize, inFile);
    	fclose(inFile);
    
    	//Flash the file
    	sceIoUnassign("flash0:"); 
    	sceIoAssign("flash0:", "lflash0:0,0", "flashfat0:", 0, NULL, 0);
    
    	FILE * outFile = fopen(outPath, "wb");
    	
    	fwrite(inBuf, 1, inSize, outFile);
      fclose(outFile);
    	return 1;
    }


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  29. #869
    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

    Now, inPath, and outPath, are the file paths, right? And what about inFile and inBuf and inSize? Do I have to replace those?

  30. #870
    OMFG
    Points: 19.453, Level: 88
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Toronto
    Beiträge
    2.814
    Points
    19.453
    Level
    88
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von ARza
    What's the basic function for flashing a file to the flash? Something simple, like flashing name_plate.png. I just want the basic function, I don't want any error checks or printing to the screen, or anything else.
    This is basically exactly what you're looking for. I have it in my own thread somewhere, but I think the link is dead until I get a reliable server.
    http://www.sendspace.com/file/ufgrtm


 

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 .