Seite 243 von 340 ErsteErste ... 143 193 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 293 ... LetzteLetzte
Zeige Ergebnis 7.261 bis 7.290 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; float is 32bit & int 16 bit. i.e. better fps. Erm. No, that is just wrong....

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

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

    Standard

    float is 32bit & int 16 bit. i.e. better fps.
    Erm. No, that is just wrong.



  2. #7262
    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 Archaemic
    Uh, wrong. int is defined as one word. On the PSP, a word is 32 bits. Hence, an int is 32 bits.

    E] Err, sorry, a long is one word. However, with gcc, on 32 bit systems, an int is still 32 bits.

    E2] Wait, still wrong. It depends on the model the compiler uses for 64 bit systems, which doesn't seem to be very standardized. However, it's not really relevant because the PSP is 32-bit.
    No you were right with your first statement. An 'int' is defined as an integer of the host processors word-size, which means 32bit on PSP and most nowadays PCs (or 64 for IA64) etc.
    long is just an integer datatype that is guaranteed to be at least 32bit in size. Same as short is guaranteed to be at least 16bit in size.
    Actually, a long COULD turn out smaller than an int (though it shouldn't, as long and short are only modifiers and not own datatypes in fact).
    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.

  3. #7263
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Ok thanks guys, its not that difficult to understand, so would I be right in thinking 0.5f is just 1/2?

    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

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

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

    Standard

    In our minds, yes. In C or C++, 1/2 would give you 0 (int/int). 1.f/2.f would give you 0.5f.

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

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

    Standard

    Zitat Zitat von yaustar
    Erm. No, that is just wrong.
    What about HUGE vertices array containing Floats but not INT.

    Nao tell me, Which one would be good?

  6. #7266
    QJ Gamer Silver
    Points: 8.717, Level: 62
    Level completed: 89%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Ort
    Melbourne, Australia
    Beiträge
    1.773
    Points
    8.717
    Level
    62
    My Mood
    Amused
    Downloads
    0
    Uploads
    0

    Standard

    Hello again... How do I check if a picture is any part over another one? I know
    Code:
          if ((x0 >= (StarX - 5) && x0 <= (StarX + 5)) && ((y0 >= (StarY - 5) && y0 <= (StarY + 5))) ) {
    	StarY = GetRandomNum(1, 272);
    	StarX = GetRandomNum(1, 430);
          }
    works fine, but i want to make a like a zig-zag ( \/\/\/\/\/ kinda thing)... but that would be too hard to do with the above code..
    WHA!?

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

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

    Standard

    What about HUGE vertices array containing Floats but not INT.

    Nao tell me, Which one would be good?
    Even then, still no because you pass by reference or by pointer. All you do is use less memory and even that is ONLY if the data structure is properly packed.

    Transversing through the array is still the same speed between the two.

    If you copy such a huge array of data, that is inefficiency from the programmer for not managing their data structures properly.

    Edit: This is basing on your information that ints are 16 bit on the PSP which it isn't as mentioned by others in this thread.
    -= Double Post =-
    Zitat Zitat von BigSanFrey
    Hello again... How do I check if a picture is any part over another one? I know
    Code:
          if ((x0 >= (StarX - 5) && x0 <= (StarX + 5)) && ((y0 >= (StarY - 5) && y0 <= (StarY + 5))) ) {
    	StarY = GetRandomNum(1, 272);
    	StarX = GetRandomNum(1, 430);
          }
    works fine, but i want to make a like a zig-zag ( \/\/\/\/\/ kinda thing)... but that would be too hard to do with the above code..
    Look for Box-Line collision on Google.
    Geändert von yaustar (12-27-2007 um 07:29 PM Uhr) Grund: Automerged Doublepost

  8. #7268
    QJ Gamer Silver
    Points: 8.717, Level: 62
    Level completed: 89%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Ort
    Melbourne, Australia
    Beiträge
    1.773
    Points
    8.717
    Level
    62
    My Mood
    Amused
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yaustar
    Look for Box-Line collision on Google.
    Thanks, looks confusing though...

    Anyway i have a problem. My "game" is meant to show 4 little squares with a cross in it (this is the picture ). But number four does not show, it shows if i have the
    Code:
        int StarX4 = GetRandomNum(331, 416);
        int StarY4 = GetRandomNum(1, 272);
    set to
    Code:
        int StarX4 = GetRandomNum(3, 40)
        int StarY4 = GetRandomNum(1, 272);
    Or if i collect star number 2 :Argh:...

    Here is my code (in a spoiler)
    Spoiler for Code:
    Code:
    int main(void) {
        SetupCallbacks();
        initGraphics();
        SceCtrlData pad;
        int ok = 1;
        int x0 = 100;
        int y0 = 100;
        int x0Height = 10;
        int x0Width = 10;
    
    	// Load background
        Image* Background;
        Background = loadImage("./Images/Background.png");
    	// Load face
        Image* Face;
        Face = loadImage("./Images/face.png");
    	// Load square
        Image* Square1;
        Square1 = loadImage("./Images/1.png");
    	// Load square
        Image* Square2;
        Square2 = loadImage("./Images/2.png");
    	// Load square
        Image* Square3;
        Square3 = loadImage("./Images/3.png");
    	// Load square
        Image* Square4;
        Square4 = loadImage("./Images/4.png");
    	// Load wall
        Image* Wall;
        Wall = loadImage("./Images/spr_wall.png");
    
        int StarX1 = GetRandomNum(1, 110);
        int StarY1 = GetRandomNum(1, 272);
    
        int StarX2 = GetRandomNum(111, 220);
        int StarY2 = GetRandomNum(1, 272);
    
        int StarX3 = GetRandomNum(221, 330);
        int StarY3 = GetRandomNum(1, 272);
    
        int StarX4 = GetRandomNum(331, 416);
        int StarY4 = GetRandomNum(1, 272);
    
    
        while(1) {
    
    	sceCtrlReadBufferPositive(&pad, 1);
    
    	blitAlphaImageToScreen(0, 0 , 480, 272, Background, 0, 0);
    
    
          if ((x0 >= (StarX1 - 5) && x0 <= (StarX1 + 5)) && ((y0 >= (StarY1 - 5) && y0 <= (StarY1 + 5))) ) {
    	StarX1 = GetRandomNum(1, 110);
    	StarY1 = GetRandomNum(1, 272);
          }
          else if ((x0 >= (StarX2 - 5) && x0 <= (StarX2 + 5)) && ((y0 >= (StarY2 - 5) && y0 <= (StarY2 + 5))) ) {
    	StarX2 = GetRandomNum(111, 220);
    	StarY2 = GetRandomNum(1, 272);
          }
          else if ((x0 >= (StarX3 - 5) && x0 <= (StarX3 + 5)) && ((y0 >= (StarY3 - 5) && y0 <= (StarY3 + 5))) ) {
    	StarX3 = GetRandomNum(221, 330);
    	StarY3 = GetRandomNum(1, 272);
          }
          else if ((x0 >= (StarX4 - 5) && x0 <= (StarX4 + 5)) && ((y0 >= (StarY4 - 5) && y0 <= (StarY4 + 5))) ) {
    	StarX4 = GetRandomNum(331, 416);
    	StarY4 = GetRandomNum(1, 272);
          }
    
    	// reset the square
          if(pad.Buttons & PSP_CTRL_SELECT) {
    	x0 = 100;
    	y0 = 100;
          }
    
          *Just some up down movements here*
          *Just some up down movements here*
          *Just some up down movements here*
    
    	// If the square is at the end of the screen (left side) set it to 0
          if(x0 < 0) {
    	    x0 = 0;
          }
    	// Otherwise if the square is at the end of the screen (right side) set it to 430 (screen width minus the square width)
          else if(x0 > ((480 - 64) - x0Width)) {
    	    x0 = ((480 - 64) - x0Width);
          }
    
    	// If the square is at the top of the screen set it to 0
          if(y0 < 0) {
    	    y0 = 0;
          }
    	// Otherwise if the square is at the bottom of the screen set it to 222 (screen height minus the square height)
          else if(y0 > (272 - x0Height)) {
    	    y0 = (272 - x0Height);
          }
    	// draw our little square and star!
          if(ok >= 1){
    	blitAlphaImageToScreen(0, 0, 10, 10, Face, x0, y0);
    	blitAlphaImageToScreen(0, 0, 10, 10, Square1, StarX1, StarY1);
    	blitAlphaImageToScreen(0, 0, 10, 10, Square2, StarX2, StarY2);
    	blitAlphaImageToScreen(0, 0, 10, 10, Square3, StarX3, StarY3);
    	blitAlphaImageToScreen(0, 0, 10, 10, Square4, StarX4, StarY4);
    
    	blitAlphaImageToScreen(0, 0, 64, 480, Wall, 416, 0);
    
          }
    
    	 sceDisplayWaitVblankStart();
    	 flipScreen();
        }	
    
        sceKernelSleepThread();
        return 0;
    }
    Geändert von BigSanFrey (12-28-2007 um 12:19 PM Uhr)
    WHA!?

  9. #7269
    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 Mr305
    What about HUGE vertices array containing Floats but not INT.

    Nao tell me, Which one would be good?
    Regarding graphics hardware the format of vertices doesn't really matter, only the size of each vector as that decides the number of vertices fitting into the memory bandwidth of the CPU->GPU bus.
    In fact, for most common GPUs float is the internal format, so submitting vertices in that format is avoiding the conversion step - but in reality that doesn't hit the performance at all, as that just takes a few cycles and that's only a fraction of the time that is required for the memory transfer, so the conversion is completely hidden in the mem transfer latency.
    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.

  10. #7270
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    I'm having a problem with intraFont, been working at it for over 5 hours hoping something comes to mind, or I just get lucky...

    Code:
    blitAlphaImageToScreen( 0, 0, 480, 272, setting.Background, 0, 0);
    guStart();
    print(font.f1,  0, 10, "C.U.S.T.O.M. Menu System.");
    sceGuFinish();
    sceGuSync(0,0);
    flipScreen();
    Doing this is fine the first time, but whenever I do it more than once there are a LOT of graphical glitches and the get steadily worse as you can see below.

    If anyone knows what I'm doing wrong can you show me some example code? (The example used doesn't blit an image, just makes the background grey).

    -Aura
    Miniaturansicht angehängter Grafiken Miniaturansicht angehängter Grafiken C/C++ Programming Help Thread-1st.jpg   C/C++ Programming Help Thread-2nd.jpg   C/C++ Programming Help Thread-3rd.jpg  
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

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

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

    Standard

    Zitat Zitat von Auraomega
    I'm having a problem with intraFont, been working at it for over 5 hours hoping something comes to mind, or I just get lucky...

    Code:
    blitAlphaImageToScreen( 0, 0, 480, 272, setting.Background, 0, 0);
    guStart();
    print(font.f1,  0, 10, "C.U.S.T.O.M. Menu System.");
    sceGuFinish();
    sceGuSync(0,0);
    flipScreen();
    Doing this is fine the first time, but whenever I do it more than once there are a LOT of graphical glitches and the get steadily worse as you can see below.

    If anyone knows what I'm doing wrong can you show me some example code? (The example used doesn't blit an image, just makes the background grey).

    -Aura
    You'll need to reset sceGuTexMode back to 8888 ; or atleast that was with pgeFont. Donno if its the same with intra.

  12. #7272
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Mr305
    You'll need to reset sceGuTexMode back to 8888 ; or atleast that was with pgeFont. Donno if its the same with intra.
    Nope, same problem.

    EDIT : My apologies, you were right, I forgot to add guStart so it wasn't actually setting the value. It all works now :)

    -Aura
    Geändert von Auraomega (12-28-2007 um 08:32 AM Uhr)
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  13. #7273
    QJ Gamer Silver
    Points: 8.717, Level: 62
    Level completed: 89%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Ort
    Melbourne, Australia
    Beiträge
    1.773
    Points
    8.717
    Level
    62
    My Mood
    Amused
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von BigSanFrey
    Anyway i have a problem. My "game" is meant to show 4 little squares with a cross in it (this is the picture ). But number four does not show, it shows if i have the
    Code:
        int StarX4 = GetRandomNum(331, 416);
        int StarY4 = GetRandomNum(1, 272);
    set to
    Code:
        int StarX4 = GetRandomNum(3, 40)
        int StarY4 = GetRandomNum(1, 272);
    Or if i collect star number 2 :Argh:...

    Here is my code (in a spoiler)
    Spoiler for Code:
    Code:
    int main(void) {
        SetupCallbacks();
        initGraphics();
        SceCtrlData pad;
        int ok = 1;
        int x0 = 100;
        int y0 = 100;
        int x0Height = 10;
        int x0Width = 10;
    
    	// Load background
        Image* Background;
        Background = loadImage("./Images/Background.png");
    	// Load face
        Image* Face;
        Face = loadImage("./Images/face.png");
    	// Load square
        Image* Square1;
        Square1 = loadImage("./Images/1.png");
    	// Load square
        Image* Square2;
        Square2 = loadImage("./Images/2.png");
    	// Load square
        Image* Square3;
        Square3 = loadImage("./Images/3.png");
    	// Load square
        Image* Square4;
        Square4 = loadImage("./Images/4.png");
    	// Load wall
        Image* Wall;
        Wall = loadImage("./Images/spr_wall.png");
    
        int StarX1 = GetRandomNum(1, 110);
        int StarY1 = GetRandomNum(1, 272);
    
        int StarX2 = GetRandomNum(111, 220);
        int StarY2 = GetRandomNum(1, 272);
    
        int StarX3 = GetRandomNum(221, 330);
        int StarY3 = GetRandomNum(1, 272);
    
        int StarX4 = GetRandomNum(331, 416);
        int StarY4 = GetRandomNum(1, 272);
    
    
        while(1) {
    
    	sceCtrlReadBufferPositive(&pad, 1);
    
    	blitAlphaImageToScreen(0, 0 , 480, 272, Background, 0, 0);
    
    
          if ((x0 >= (StarX1 - 5) && x0 <= (StarX1 + 5)) && ((y0 >= (StarY1 - 5) && y0 <= (StarY1 + 5))) ) {
    	StarX1 = GetRandomNum(1, 110);
    	StarY1 = GetRandomNum(1, 272);
          }
          else if ((x0 >= (StarX2 - 5) && x0 <= (StarX2 + 5)) && ((y0 >= (StarY2 - 5) && y0 <= (StarY2 + 5))) ) {
    	StarX2 = GetRandomNum(111, 220);
    	StarY2 = GetRandomNum(1, 272);
          }
          else if ((x0 >= (StarX3 - 5) && x0 <= (StarX3 + 5)) && ((y0 >= (StarY3 - 5) && y0 <= (StarY3 + 5))) ) {
    	StarX3 = GetRandomNum(221, 330);
    	StarY3 = GetRandomNum(1, 272);
          }
          else if ((x0 >= (StarX4 - 5) && x0 <= (StarX4 + 5)) && ((y0 >= (StarY4 - 5) && y0 <= (StarY4 + 5))) ) {
    	StarX4 = GetRandomNum(331, 416);
    	StarY4 = GetRandomNum(1, 272);
          }
    
    	// reset the square
          if(pad.Buttons & PSP_CTRL_SELECT) {
    	x0 = 100;
    	y0 = 100;
          }
    
          *Just some up down movements here*
          *Just some up down movements here*
          *Just some up down movements here*
    
    	// If the square is at the end of the screen (left side) set it to 0
          if(x0 < 0) {
    	    x0 = 0;
          }
    	// Otherwise if the square is at the end of the screen (right side) set it to 430 (screen width minus the square width)
          else if(x0 > ((480 - 64) - x0Width)) {
    	    x0 = ((480 - 64) - x0Width);
          }
    
    	// If the square is at the top of the screen set it to 0
          if(y0 < 0) {
    	    y0 = 0;
          }
    	// Otherwise if the square is at the bottom of the screen set it to 222 (screen height minus the square height)
          else if(y0 > (272 - x0Height)) {
    	    y0 = (272 - x0Height);
          }
    	// draw our little square and star!
          if(ok >= 1){
    	blitAlphaImageToScreen(0, 0, 10, 10, Face, x0, y0);
    	blitAlphaImageToScreen(0, 0, 10, 10, Square1, StarX1, StarY1);
    	blitAlphaImageToScreen(0, 0, 10, 10, Square2, StarX2, StarY2);
    	blitAlphaImageToScreen(0, 0, 10, 10, Square3, StarX3, StarY3);
    	blitAlphaImageToScreen(0, 0, 10, 10, Square4, StarX4, StarY4);
    
    	blitAlphaImageToScreen(0, 0, 64, 480, Wall, 416, 0);
    
          }
    
    	 sceDisplayWaitVblankStart();
    	 flipScreen();
        }	
    
        sceKernelSleepThread();
        return 0;
    }
    anyone?
    WHA!?

  14. #7274
    QJ Gamer Bronze
    Points: 8.045, Level: 60
    Level completed: 48%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Ort
    Australia
    Beiträge
    659
    Points
    8.045
    Level
    60
    Downloads
    0
    Uploads
    0

    Standard

    Hey, i was just wondering how i would go about clearing an array or, when i store data in it, does it overwrite whats currently in it? Iv tried free(); but it unallocates the memory. Anyhelp would be awesome, thanks

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

    Um, yes it overwrites the data. Use memset to clear it, though.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  16. #7276
    QJ Gamer Bronze
    Points: 8.045, Level: 60
    Level completed: 48%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Ort
    Australia
    Beiträge
    659
    Points
    8.045
    Level
    60
    Downloads
    0
    Uploads
    0

    Standard

    Awesome, thanks

  17. #7277
    QJ Gamer Platinum
    Points: 57.528, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    h0000000rj
    Beiträge
    12.867
    Points
    57.528
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    ... what would it do if not overwrite the data?
    [I fail @ life]

  18. #7278
    QJ Gamer Bronze
    Points: 8.045, Level: 60
    Level completed: 48%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Ort
    Australia
    Beiträge
    659
    Points
    8.045
    Level
    60
    Downloads
    0
    Uploads
    0

    Standard

    as in, say you had
    Code:
    char buffer[32];
    and you did
    Code:
    sceIoRead(file, buffer, 10);
    buffer would currently be holding the first 10 bytes of file.
    Then, if you did
    Code:
    sceIoRead(file2, buffer, 10);
    would it overwrite the current 10 bytes stored or would it add to it so buffer now composed of the first 10 bytes of file and file2?

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

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

    Standard

    Guys, I am attempting to port a simple sdl demo. It compiles fine with no issues but upon booting it gives me a bsod.

    Code:
    I regret to inform you your psp has just crashed
    
    Exception Details:
    Exception             - Bus Error (data)
    EPC                     - 08900668
    Cause                  - 1000001C
    Status                 - 60008613
    BadVAddr             - 00000000
    
    The offending routine may be identified with:
    
    psp-addr2line -e target.elf -f -C 0x8900668 0x0 0x8900c0c
    I just basically need to know how to read these kind of messages or what I can use to debug my programs efficiently.

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

    Do what it says, type the line into your prompt:

    psp-addr2line -e target.elf -f -C 0x8900668 0x0 0x8900c0c
    Changing target.elf to the name of your elf.

    It'll give you the file & line number that caused the error.

    You need to have compiled with the -g flag in your makefile for this to work correctly.

    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

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

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

    Standard

    Ok, the output from that is:
    Code:
    /home/G.Ninja/bouncing/bouncing.c:106
    ??
    ??:0
    rungame
    /home/G.Ninja/bouncing/bouncing.c:103
    So if i'm right in thinking that there are two offending lines of code, they would be
    Code:
    if(SDL_SetColorKey(s_surface, SDL_SRCCOLORKEY | SDL_RLEACCEL, SDL_MapRGB(s_surface->format, COLORKEY)) == -1)
    and
    Code:
    done = 1;


    EDIT: I commented out them lines of code and it seems to have done the trick. Thanks for your help IWN.
    Geändert von eldiablov (12-29-2007 um 05:12 AM Uhr)

  22. #7282
    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 Xsjado7
    as in, say you had
    Code:
    char buffer[32];
    and you did
    Code:
    sceIoRead(file, buffer, 10);
    buffer would currently be holding the first 10 bytes of file.
    Then, if you did
    Code:
    sceIoRead(file2, buffer, 10);
    would it overwrite the current 10 bytes stored or would it add to it so buffer now composed of the first 10 bytes of file and file2?
    The first answer is correct. If you want to store the second file's ten bytes after the first, you'd have to do:
    Code:
    sceIoRead(file2, buffer+10, 10);
    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.

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

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

    Standard

    How would I read a string in a file ? Im looking at pspiofilemgr.h but i'm not finding anything that makes sense to me.

  24. #7284
    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 eldiablov
    How would I read a string in a file ? Im looking at pspiofilemgr.h but i'm not finding anything that makes sense to me.
    sceIoRead? Open the file, seek to whatever offset you need, read a number of bytes that you want, close file.
    [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]

  25. #7285
    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

    I'm having problems with file i/o. I haven't had this problem before, and this code always worked fine until now:

    Code:
          FILE* options;
          options = fopen("./files/options.txt","r+b");
          fseek(options, 0, SEEK_SET);
          fprintf(options, "s");
          fclose(options);
    Instead of getting
    Code:
    s
    in my options file, i now get
    Code:
    n
    . Originally, the options file was
    Code:
    n
    . I just wanted to change the 'n' to an 's', but instead, i got something wierd. Any ideas?
    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...)

  26. #7286
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    I'm having some problems with Project4 that I can't understand, I'm just wondering if anyone here can help me.

    I've moved all the graphics handling (graphics.c intraFont.c) into an external prx that I load and link to. When I try loading it with pspSdkLoadStartModule it returns error 0x800000D1 which is SCE_KERNEL_ERROR_ILLEGAL_ PERM, I'm not sure what the error means, or what I've done wrong.

    My next question is how or what is flash2 when trying to access it? I'm trying to write a file to flash2 (and flash3) and read it back, but I keep getting the nodev error (0x80000321).

    Is there any way I can check what variables are being passed between modules, or is there any way I can check what heaps are currently allocated?

    How can I get things printed on the PSPLink shell when running in 3.XX on 3.52? I never had this problem in 3.40LE, but have done ever since moving to 3.52 (does this happen on 3.71?).

    How should I got about loading a PSX game? I've tried
    Code:
    sctrlKernelLoadExecVSHWithApitype(0x143, bpath, &param);
    Where param.key is game, pops, psx. I'm guessing the key is wrong but I can't work out what it is meant to be, so if anyone knows...?

    (Not sure if this is allowed or not, if its not let me know and I'll remove it) When using sctrlSEMountUmdFromFile for M33 or NP9660 it returns a nodev error, but works fine for ISOFs if its enabled in recovery, I've tried loading the modules from flash0, but no luck.

    Theres a lot of questions there, but any help to any of them will be helping me a great deal.

    Thanks in advance.
    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  27. #7287
    QJ Gamer Bronze
    Points: 5.402, Level: 47
    Level completed: 26%, Points required for next Level: 148
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    468
    Points
    5.402
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    you could use

    fprintf(stdout, "your output\n");

    with psplink to output text to the terminal

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

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

    Standard

    Zitat Zitat von Moca
    sceIoRead? Open the file, seek to whatever offset you need, read a number of bytes that you want, close file.
    How would I find the offset ?

  29. #7289
    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 TMNT
    I'm having problems with file i/o. I haven't had this problem before, and this code always worked fine until now:

    Code:
          FILE* options;
          options = fopen("./files/options.txt","r+b");
          fseek(options, 0, SEEK_SET);
          fprintf(options, "s");
          fclose(options);
    Instead of getting
    Code:
    s
    in my options file, i now get
    Code:
    n
    . Originally, the options file was
    Code:
    n
    . I just wanted to change the 'n' to an 's', but instead, i got something wierd. Any ideas?
    Check the mode you are opening the file in:

    http://www.cplusplus.com/reference/c...dio/fopen.html

    "r+b" doesn't seem right for what you're trying to do.

    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

  30. #7290
    QJ Gamer Bronze
    Points: 8.045, Level: 60
    Level completed: 48%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Ort
    Australia
    Beiträge
    659
    Points
    8.045
    Level
    60
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eldiablov
    How would I find the offset ?
    Use sceIoLseek(currentlyopenf ile, howfartoseek, positiontoseekfrom);

    for the last param you can use SEEK_SET to reposition the pointer from the start of the file, SEEK_CUR to reposition relative from where it is currently, and SEEK_END to set from the end of the file


 

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 .