Seite 271 von 340 ErsteErste ... 171 221 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 321 ... LetzteLetzte
Zeige Ergebnis 8.101 bis 8.130 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; is it possible at all to stop the psp from shutting down after some1 holds the power button up, i'd ...

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

    is it possible at all to stop the psp from shutting down after some1 holds the power button up, i'd imagine it's hardware wired in, but i still wanna check to see if it's remotly possible


    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. #8102
    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 slicer4ever
    is it possible at all to stop the psp from shutting down after some1 holds the power button up, i'd imagine it's hardware wired in, but i still wanna check to see if it's remotly possible
    No. Its the hardware.

  3. #8103
    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

    i figured as much, thanks for confirming it
    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

  4. #8104
    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 slicer4ever
    is it possible at all to stop the psp from shutting down after some1 holds the power button up, i'd imagine it's hardware wired in, but i still wanna check to see if it's remotly possible
    You CAN disable this, its not hardware at all. The function you require is in psppower.h and is:

    /**
    * Lock power switch
    *
    * Note: if the power switch is toggled while locked
    * it will fire immediately after being unlocked.
    *
    * @param unknown - pass 0
    */
    int scePowerLock(int unknown);
    -Aura
    Last.fm | Deviant Art | First working OS picture

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

  5. #8105
    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 guys, im looking at doing some effects (transition like) for a game. I want to try and have a fade effect so first i need a function to return the colour of every pixel on the screen into an array. Would something like this work?

    Code:
    int count;
    int pixely;
    int pixelx
    u32 pixelcol[130560];//130560 is amount of pixels on screen
    
    while(pixelx <= 480)
        {
                    pixely ++;
                    count ++;
                    if(pixely > 272)
                    {
                              pixelx ++;
                              pixely = 0;
                    }
                    pixelcol[count] = getPixelScreen(pixelx, pixely);
        }

  6. #8106
    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

    You're thinking about it the wrong way.

    Draw a quad over the screen last thing in your drawing loop.

    Set the alpha of the quad based on if you're fading out or fading in.

    Fading out, then you want to increment the alpha value from 0-255. Fading in you want to decrement it from 255-0.

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

    oh, nice. Man thats a good idea(its not that amazing but just a nice way of doing it) i never thought of doing it like that. Thanks man
    -= Double Post =-
    just for future reference, if for some reason i need it, would my code still work?
    Geändert von Xsjado7 (03-08-2008 um 06:29 PM Uhr) Grund: Automerged Doublepost

  8. #8108
    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

    Yes, as IWN said use a quad with a varying opacity. On the PSP (probably on soem PCs as well) avoid huge loops like that. I've done motion blur in LUA and the frame rate is awful.

    Even after narrowing down the blurring zone to be 480x10 i still was getting like 3 fps...

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


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

    dang, thats some seriously choppy stuff. Thanks for the help guys. The transitions/effects add that extra bit of professional-ism to a game/app

  10. #8110
    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

    Zitat Zitat von Auraomega
    You CAN disable this, its not hardware at all. The function you require is in psppower.h and is:



    -Aura
    All that does is disable sleep mode, actually.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

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

    Xsjado - Heh...

    You'd be surprised at the very simple arithmetic used to make some of the most amusing transitions ;) I'm using a neat transition system in my current project. Transitions are fun to make, then actually being able to make use of them really sets your game apart from others.

    Here's one that makes the scene underneath (the next state hint hint) kinda "pop" out of no where (well, depends on the transition speed)
    Code:
    // Declare these where ever they can be accesible
    bool bEntering;        // Flag to tell if were entering a game state
    Vector2D vTransition;   // 2D Vector class or structure used for transitioning game states
    const int TRANSITION_X_SPEED = 10; // The transitions speed x-coordinate wise
    const int TRANSITION_Y_SPEED = 6;  // " y-coordinate wise
    
    // Initialize (call this when initializing the next state)
    bEntering = true;
    vTransition.x = 0.0f;
    vTransition.y = 0.0f;
    
    // Think (call this during the thinking part of the game states, out of any switch statement or w/e)
    if (bEntering)
    {
      if (vTransition.x >= SCREEN_WIDTH / 2)
      {
         bEntering = false;
      }
      else  
      {
        vTransition.x += TRANSITION_X_SPEED;
        vTransition.y += TRANSITION_Y_SPEED;
      }
    }
    
    // Draw (call this in the drawing part of the game states, out of any switch statements or w/e)
    if (bEntering) // Replace oslDrawFillRect(x,y,x2,y2,color) with whatever your graphics library supports
    {              // Draw our neat transition GFX (a square expands - it's 4 points are then used to draw black rectangles everywhere BUT inside of it, the stuff inside it is the next state being drawn below it)
      oslDrawFillRect(0, 0,
                      int (SCREEN_WIDTH / 2 - vTransition.x), SCREEN_HEIGHT, RGB(0,0,0))
    
      oslDrawFillRect(int (SCREEN_WIDTH / 2 + vTransition.x), 0,
                      SCREEN_WIDTH, SCREEN_HEIGHT, RGB(0,0,0));
    
      oslDrawFillRect(int (SCREEN_WIDTH / 2 - vTransition.x), 0,
                      int (SCREEN_WIDTH / 2 + vTransition.x), int(SCREEN_HEIGHT / 2 - vTransition.y), RGB(0,0,0));
    
      oslDrawFillRect(int (SCREEN_WIDTH / 2 - vTransition.x), int(SCREEN_HEIGHT / 2 + vTransition.y),
                      int (SCREEN_WIDTH / 2 + vTransition.x), SCREEN_HEIGHT, RGB(0,0,0));
    }
    Not the best, nothing crazy, etc. but hey it's one ;)

    P.S. it'd be nice to have a huge collection of transitions. Sure some will be more render-engine specific but hey it'd be a good developer resource
    Geändert von SG57 (03-09-2008 um 12:20 AM Uhr)

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


  12. #8112
    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 SG57
    P.S. it'd be nice to have a huge collection of transitions. Sure some will be more render-engine specific but hey it'd be a good developer resource
    I was thinking about that earlier. Just gather a load together into a library and port it to work with a few different graphics libs like OSL/TriEngine/Graphics.h

  13. #8113
    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

    Is there any way to get EBOOTs to be loadexec'ed from flash0-3? Loading PRX files works fine, but trying to use the loadExec calls I get an error (SCE_KERNEL_ERROR_ILLEGAL _PERM_CALL I believe). I'm not sure if there is any work around from this?

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

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

  14. #8114
    Ænima
    Points: 6.447, Level: 52
    Level completed: 49%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Sep 2007
    Beiträge
    587
    Points
    6.447
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Auraomega
    Is there any way to get EBOOTs to be loadexec'ed from flash0-3? Loading PRX files works fine, but trying to use the loadExec calls I get an error (SCE_KERNEL_ERROR_ILLEGAL _PERM_CALL I believe). I'm not sure if there is any work around from this?

    -Aura
    You can't just use sceKernelLoadExec for EBOOTs. If I recall correctly, you have to first decompress the .ELF from the EBOOT. Check out this thread.

    http://forums.qj.net/f-psp-developme...eps-64080.html
    [IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]

    Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.

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

    OMG, I could kiss you right now :humped: I've been trying to get this working for a while and have been reduced to using the new ms versions of the loadexec (which work with EBOOT.PBP natively without any messing around). All I can say is thank you deeply, and I can't believe it was something that simple

    -Aura

    EDIT I:
    Hmm, no wait, seems to not work flash - flash. Ms0 - flash works fine, but flash - flash just fails, oh well, back to the drawing board...

    EDIT II:
    It works flash - flash in 1.50, but not in 3.XX, which is where this app is targeted.
    Geändert von Auraomega (03-10-2008 um 04:08 PM Uhr) Grund: Automerged Doublepost
    Last.fm | Deviant Art | First working OS picture

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

  16. #8116
    Ænima
    Points: 6.447, Level: 52
    Level completed: 49%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Sep 2007
    Beiträge
    587
    Points
    6.447
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Auraomega
    OMG, I could kiss you right now :humped: I've been trying to get this working for a while and have been reduced to using the new ms versions of the loadexec (which work with EBOOT.PBP natively without any messing around). All I can say is thank you deeply, and I can't believe it was something that simple

    -Aura

    EDIT I:
    Hmm, no wait, seems to not work flash - flash. Ms0 - flash works fine, but flash - flash just fails, oh well, back to the drawing board...

    EDIT II:
    It works flash - flash in 1.50, but not in 3.XX, which is where this app is targeted.
    Yes, I remember hearing something about not being able to run EBOOTs from the flash in 3.xx, but I didn't know if it was true or not. Do they still run from the memory stick? Maybe copy it to the memory stick before booting? Is this an EBOOT that you coded? Maybe you could recompile it into a PRX.
    [IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]

    Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.

  17. #8117
    QJ Gamer Blue
    Points: 3.734, Level: 38
    Level completed: 56%, Points required for next Level: 66
    Overall activity: 14,0%

    Registriert seit
    Oct 2007
    Ort
    Illinois
    Beiträge
    158
    Points
    3.734
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    I need some help. Im trying to get a program to recognize the motherboard of the PSP, so I did this:

    Code:
    if ((tachyon = 0x00300000 && baryon = 0x00040600))
    	{
    	printf("Motherboard = TA-081 1g\n");
    	}
    I get error
    error: invalid lvalue in assignment
    I know it has to do with the (( and the &&, how would I code that part so the program would 'use' both tachyon and baryon?

  18. #8118
    QJ Gamer Silver
    Points: 6.763, Level: 54
    Level completed: 7%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    413
    Points
    6.763
    Level
    54
    Downloads
    0
    Uploads
    0

    Standard

    If statements use two ='s instead of one. Change it to:
    if ((tachyon == 0x00300000 && baryon == 0x00040600))

    Hope that helps.
    Atheist, because I just won't believe in what doesn't show itself to me.

  19. #8119
    QJ Gamer Blue
    Points: 3.734, Level: 38
    Level completed: 56%, Points required for next Level: 66
    Overall activity: 14,0%

    Registriert seit
    Oct 2007
    Ort
    Illinois
    Beiträge
    158
    Points
    3.734
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Durka Durka Mahn
    If statements use two ='s instead of one. Change it to:
    if ((tachyon == 0x00300000 && baryon == 0x00040600))

    Hope that helps.
    Aha, thanks! I appreciate the help and it works now.

  20. #8120
    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 Judas
    Yes, I remember hearing something about not being able to run EBOOTs from the flash in 3.xx, but I didn't know if it was true or not. Do they still run from the memory stick? Maybe copy it to the memory stick before booting? Is this an EBOOT that you coded? Maybe you could recompile it into a PRX.
    Yeah, I've not actually read it anywhere but I assumed this would likely be the case. It is an app I made, and compiling in prx format is possible, but it physically needs to be loadExec'ed from flash, not just loaded as another module, I'm not actually being rejected as such, its attempting to load it from flash, and not giving any errors, but then it just returns me to the XMB (Project4 in my case), I'll do some more research into it, as I also want to be able to do this with code that is not my own.

    The only other thing I can think of is if I write my own driver like that of DevHook and somehow trick the PSP into believing that its loading from ms0:/, but so far I've had no luck in that department either.

    If you can think of any other options I'm all ears, the more ideas I have the more likely I am to find a work around to my problem.

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

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

  21. #8121
    Ænima
    Points: 6.447, Level: 52
    Level completed: 49%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Sep 2007
    Beiträge
    587
    Points
    6.447
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Auraomega
    Yeah, I've not actually read it anywhere but I assumed this would likely be the case. It is an app I made, and compiling in prx format is possible, but it physically needs to be loadExec'ed from flash, not just loaded as another module, I'm not actually being rejected as such, its attempting to load it from flash, and not giving any errors, but then it just returns me to the XMB (Project4 in my case), I'll do some more research into it, as I also want to be able to do this with code that is not my own.

    The only other thing I can think of is if I write my own driver like that of DevHook and somehow trick the PSP into believing that its loading from ms0:/, but so far I've had no luck in that department either.

    If you can think of any other options I'm all ears, the more ideas I have the more likely I am to find a work around to my problem.

    -Aura
    I think you're right, where you could probably re-assign the flash so that the PSP thinks it's the memory stick. Or maybe pack the EBOOT into an ISO structure, and mount the ISO. I haven't used Project4 yet, but doesn't it run ISOs?

    Or maybe the restriction for sceKernelLoadExec is in a 3.xx PRX, and you can maybe load the 1.5 PRX and use that function instead.

    I'm not really an expert in the way the PSP handles files and executables, so I can't offer that much help.
    [IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]

    Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.

  22. #8122
    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 Judas
    I think you're right, where you could probably re-assign the flash so that the PSP thinks it's the memory stick. Or maybe pack the EBOOT into an ISO structure, and mount the ISO. I haven't used Project4 yet, but doesn't it run ISOs?

    Or maybe the restriction for sceKernelLoadExec is in a 3.xx PRX, and you can maybe load the 1.5 PRX and use that function instead.

    I'm not really an expert in the way the PSP handles files and executables, so I can't offer that much help.
    Well I just tried the re-assigning idea, and I got an error with that, so thats yet another idea gone. Project4 can run the I word yep, I will definatly try that as I hadn't thought of that previously, only question is, how do I actually do so? I'll also have a dabble in a little while at trying to load 1.50 stuff instead of 3.XX, if that works its a start, but it still won't be very Slim friendly (still, a start is a start and it may set me on the right path).

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

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

  23. #8123
    Ænima
    Points: 6.447, Level: 52
    Level completed: 49%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Sep 2007
    Beiträge
    587
    Points
    6.447
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Auraomega
    Well I just tried the re-assigning idea, and I got an error with that, so thats yet another idea gone. Project4 can run the I word yep, I will definatly try that as I hadn't thought of that previously, only question is, how do I actually do so? I'll also have a dabble in a little while at trying to load 1.50 stuff instead of 3.XX, if that works its a start, but it still won't be very Slim friendly (still, a start is a start and it may set me on the right path).

    Thanks again.
    -Aura
    http://forums.qj.net/f-psp-homebrew-...mat-46926.html

    That's how to convert a PSP to an ISO. The ISO will be at least double the size using that method. Unless you have Project4 set to run either BOOT.BIN or EBOOT.BIN. Because if it always runs the same one, you don't need the other.
    [IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]

    Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.

  24. #8124
    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

    Well I just tested the ISO idea, and again, nothing, I get error 0x8001087, the ISO works fine though because I launched it from the memory stick without issue. Next on the list, 1.50 loading

    -Aura

    EDIT: 1.50 doesn't work either, returns 0x80020149.
    Geändert von Auraomega (03-11-2008 um 01:25 PM Uhr)
    Last.fm | Deviant Art | First working OS picture

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

  25. #8125
    QJ Gamer Green
    Points: 5.646, Level: 48
    Level completed: 48%, Points required for next Level: 104
    Overall activity: 54,0%

    Registriert seit
    Sep 2007
    Beiträge
    743
    Points
    5.646
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Sorry to interrupt Auraomega. :o

    I just have quick question as far as a fake security.

    I know that there are different snippets of code for if you want to check what firmware is running, or what motherboard is being used.

    I tried googling, but to no avail. Would it be possible to create something like what Sony has, where it says, "Firmware X.YZ in use, Firmware X.YZ required."

    That way, I could set up my application to only be started if the user is running M33 3.90 or something like that.
    [QUOTE=Archaemic]
    [size=1]My manwich![/size][/QUOTE]
    [QUOTE=mohaas05]lol i can't say d*ck?[/QUOTE]

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

    Yep, if you make something to sniff out the arguments passed to vshmain.prx you should be able to find out where this information is kept, then its a simple case of restarting the vsh with those arguments.

    The specific function you'll need is sceKernelExitVSHVSH(struc t SceKernelLoadExecVSHParam *param);

    Find info for it in psploadexec_kernel.h

    -Aura

    EDIT: That method is if you want the 100% offical look, if not, you could easily find the version of the firmware with either flash0:/vsh/resource/version.txt or by checking it using a certain function (can't remember which), and just displaying the error in the app itself, this of course looks less professional but is significantly easier.
    Last.fm | Deviant Art | First working OS picture

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

  27. #8127
    QJ Gamer Silver
    Points: 6.763, Level: 54
    Level completed: 7%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    413
    Points
    6.763
    Level
    54
    Downloads
    0
    Uploads
    0

    Standard

    This is kinda ticking me off..
    I can't get my C++ image viewer working (I made this using the tutorial at pspprogramming.com)

    The error:
    Code:
    psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I. -I/usr/local/p
    spdev/psp/sdk/include -O2 -G0 -Wall -fno-exceptions -fno-rtti -D_PSP_FW_VERSION=
    150   -c -o main.o main.cpp
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=
    150  -L. -L/usr/local/pspdev/psp/sdk/lib   main.o graphics.o framebuffer.o -lpsp
    gu -lpng -lz -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet
     -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkern
    el -o hello.elf
    /usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/bin/ld:graphics.o: file form
    at not recognized; treating as linker script
    /usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/bin/ld:graphics.o:1: parse e
    rror
    collect2: ld returned 1 exit status
    make: *** [hello.elf] Error 1
    The main.cpp file:
    Code:
    //First app
    
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspgu.h>
    #include <png.h>
    #include <stdio.h>
    #include "graphics.h"
    
    PSP_MODULE_INFO("Image Displayer", 0, 1, 1); //This names the eboot in the XMB
    
    #define printf pspDebugScreenPrintf //Defines that huge printf function to just 'printf'
    #define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
    
    /* 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(){
    	char buffer[200];
        Image* ourImage; //Sets up an image class
    	pspDebugScreenInit();
        SetupCallbacks();
        initGraphics();
    	sprintf(buffer, "ourImage.png");
        ourImage = loadImage(buffer);
    	if (!ourImage) {
    		//Image load failed
    		printf("Image load failed!\n");
    	} else {
    			int x = 0;
    			int y = 0;
    			sceDisplayWaitVblankStart(); //Allows home button to work
    			while (x < 480){
    				while(y < 272){
    					blitAlphaImageToScreen(0, 0, 32, 32, ourImage, x, y); //Prints the image to the screen at X, Y
    					y += 32;
    				}
    				x+= 32;
    				y = 0;
    			}
    			flipScreen();
    	}
    	sceKernelSleepThread();
    	return 0;
    }
    The Makefile:
    Code:
    TARGET = hello
    OBJS = main.o graphics.o framebuffer.o
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    LIBDIR =
    LIBS = -lpspgu -lpng -lz -lm
    LDFLAGS =
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = Image Example
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    All help greatly appreciated.
    Atheist, because I just won't believe in what doesn't show itself to me.

  28. #8128
    QJ Gamer Green
    Points: 5.646, Level: 48
    Level completed: 48%, Points required for next Level: 104
    Overall activity: 54,0%

    Registriert seit
    Sep 2007
    Beiträge
    743
    Points
    5.646
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Auraomega
    Yep, if you make something to sniff out the arguments passed to vshmain.prx you should be able to find out where this information is kept, then its a simple case of restarting the vsh with those arguments.

    The specific function you'll need is sceKernelExitVSHVSH(struc t SceKernelLoadExecVSHParam *param);

    Find info for it in psploadexec_kernel.h

    -Aura

    EDIT: That method is if you want the 100% offical look, if not, you could easily find the version of the firmware with either flash0:/vsh/resource/version.txt or by checking it using a certain function (can't remember which), and just displaying the error in the app itself, this of course looks less professional but is significantly easier.

    Thanks Aura, I will try first with the official way. The function that you mentioned is

    codeint sceKernelExitVSHVSH(struc t SceKernelLoadExecVSHParam *param);

    #if _PSP_FW_VERSION >= 200


    If I were to change that to:

    codeint sceKernelExitVSHVSH(struc t SceKernelLoadExecVSHParam *param);

    #if _PSP_FW_VERSION >= 390 M33


    Would that work for checking for M33? Or should I be more specific?
    [QUOTE=Archaemic]
    [size=1]My manwich![/size][/QUOTE]
    [QUOTE=mohaas05]lol i can't say d*ck?[/QUOTE]

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

    You need to compile differently for C++, your makefile should have an extra bit at the bottom:

    Code:
    ./main.o: ./main.cpp 
    	$(CXX) $(CXXFLAGS) -c ./main.cpp -o ./main.o
    -Aura
    Last.fm | Deviant Art | First working OS picture

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

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

    Aura - No you don't.

    Simply add -lstdc++ to the libs line at the very end and your golden.

    Try using this makefile:
    Code:
    TARGET = hello
    OBJS = main.o graphics.o framebuffer.o
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    LIBDIR =
    LIBS = -lpspgu -lpng -lz -lm -lstdc++
    LDFLAGS =
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = Image Example
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak

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



 

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

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