Page 3 of 61 FirstFirst 1 2 3 4 5 13 53 ... LastLast
Results 21 to 30 of 605

Thread: How to become a PSP Dev

  
  1. #21
    PSdonkey's Avatar
    PSdonkey is offline Senior Member -Hacks Guru
    Join Date
    Dec 2005
    Posts
    2,123
    Rep Power
    40

    Default

    ok, I played your game killaj and I see what you were talking about. It wouldn't let you input the number square that you wanted to place your X or your O because it would jump to fast the numbers if you slightly touch the up or down button or the R trigger. I fix the bugs and now your program works good. I uploaded it for you and included the modified source. Basically what I did is add this function
    sceDisplayWaitVblankStart(); after each time the button is pressed and added it inside a for loop so it would pause for a certain amount of time after the button was pushed. Everything flows smooth now.
    What that function does is it waits until the vsynch gets called to the os. Its tied into the screen refresh rate, the PSP refreshes 60 times a second.
    Overall, you did a really god job of porting that game over to the PSP. Good job.
    Here is the link:

    http://www.mediafire.com/?9nxdyyjydg3

    Obey Beaker. That is all.


    Spoiler:
    Want to become a PSP Dev the easy way? Check out my tutorial for the PSP here http://www.psp-hacks.com/forums/f141...orial-t152466/
    Want to learn how to create your own games on the PSP? Check out my tutorial here http://www.psp-hacks.com/forums/f141...-your-t153653/
    Want to learn how to program C++ ? Check out that tutorial here http://www.psp-hacks.com/forums/f124...ram-c-t122337/

  2. #22
    nobugging is offline -Hacks Newbie
    Join Date
    Jan 2007
    Posts
    36
    Rep Power
    12

    Default

    Quote Originally Posted by ZiNgABuRgA
    ^^IDK, perhaps have two loops? Eg, one to wait for the button to be pressed, then, another one to wait till it's released?
    The problem with this method is that it stops the game logic loop while the button is held. While it isn't problematic for this tye of turn based game, it will pose a problem with other types of games. This problem also exists with PSdonkey's method of using sceDisplayWaitVblankStart() to 'pause' the game logic.

    A better solution is to keep track of the previous state of the pad and compare it with the current state. Then you can simply use this pseudo code to check for a distinct button press.

    Code:
    if button is pressed down now but was not pressed down last frame then
        do some stuff
    end
    Or the actual (stripped) code
    Code:
    SceCtrlData currentPadState, previousPadState;
    while( 1 )
    {
        // At the top of the loop
        sceCtrlReadBufferPositive(&currentPadState, 1);
    
        // Check for a button press
        if( currentPadState.Buttons & PSP_CTRL_UP && 0 == previousPadState.Buttons & PSP_CTRL_UP )
        {
            // Do some stuff
        }
    
        // At the bottom of the loop
        previousPadState = currentPadState;
        sceDisplayWaitVblankStart();
    }

  3. #23
    PSdonkey's Avatar
    PSdonkey is offline Senior Member -Hacks Guru
    Join Date
    Dec 2005
    Posts
    2,123
    Rep Power
    40

    Default

    Your code does the exact same end result as my code but I kept mine a little bit simplier since this is a beginner's game and lesson. Plus with my code you can actually control how much time passes between each button press to conform to each individual program. There is nothing wrong with your code, there are just different ways to code and get the same end result.
    Obey Beaker. That is all.


    Spoiler:
    Want to become a PSP Dev the easy way? Check out my tutorial for the PSP here http://www.psp-hacks.com/forums/f141...orial-t152466/
    Want to learn how to create your own games on the PSP? Check out my tutorial here http://www.psp-hacks.com/forums/f141...-your-t153653/
    Want to learn how to program C++ ? Check out that tutorial here http://www.psp-hacks.com/forums/f124...ram-c-t122337/

  4. #24
    killaj is offline Senior Member -Hacks Titan
    Join Date
    Nov 2005
    Location
    Daytona Beach
    Posts
    10,124
    Rep Power
    23

    Default

    thanks nobugging. i'm still learning what kinds of functions the psp has built in. that's a new one.

  5. #25
    itsalldasame2me is offline -Hacks Member
    Join Date
    Mar 2006
    Location
    California
    Posts
    256
    Rep Power
    13

    Default

    Ok I'm having a bit of a problem. I downloaded the installer and installed everything correctly. then i edited the pspdev.bat like the tutorial said. but when i double click on it a box pops up that says "C:\WINDOWS\system32\cmd.com is not a valid win32 application" I don't know what im doing wrong. I followed everything correctly. Please help.

  6. #26
    killaj is offline Senior Member -Hacks Titan
    Join Date
    Nov 2005
    Location
    Daytona Beach
    Posts
    10,124
    Rep Power
    23

    Default

    take the .com off.

  7. #27
    ZiNgABuRgA's Avatar
    ZiNgABuRgA is offline Senior Member -Hacks Titan
    Join Date
    Sep 2006
    Location
    4CHIN
    Posts
    11,044
    Rep Power
    24

    Default

    O_o, that reminds me of a virus (which I installed on purpose). It makes a whole load of .com files to trick the computer into loading them (ie cmd.com, so when you specify "cmd" it launches the .com file instead of the .exe)

  8. #28
    nobugging is offline -Hacks Newbie
    Join Date
    Jan 2007
    Posts
    36
    Rep Power
    12

    Default

    Quote Originally Posted by PSdonkey
    Your code does the exact same end result as my code but I kept mine a little bit simplier since this is a beginner's game and lesson. Plus with my code you can actually control how much time passes between each button press to conform to each individual program. There is nothing wrong with your code, there are just different ways to code and get the same end result.
    I disagree, as mentioned, your code stops game logic for a sixth of a second which wrecks havok in a an action game of some sort. It will run at ~60 fps and when you shoot for example, there is a lapse/lag in game speed since you just paused the game logic for a sixth of a second. If you want you want to control how much time passes between each button press, then use an independent timer or counter that doesn't affect the frequency (number of loops per second) for the main game logic.

    Your code does work as intended without any adverse effects as it is a turn based game but there are bad side effects that were not mentioned and not visible in this program.

    Quote Originally Posted by killaj
    thanks nobugging. i'm still learning what kinds of functions the psp has built in. that's a new one.
    It really isn't a function, more of a concept or just logic. Do you actually fully understand what this line of code does?
    Code:
    currentPadState.Buttons & PSP_CTRL_UP

  9. #29
    ZiNgABuRgA's Avatar
    ZiNgABuRgA is offline Senior Member -Hacks Titan
    Join Date
    Sep 2006
    Location
    4CHIN
    Posts
    11,044
    Rep Power
    24

    Default

    @nobugging: Stopping the game is actually the purpose here. This isn't an action game, so using an independent timer is just making things overly complex, and unnecessary.

    In either case, using an independent timer, the game would still have to freeze, so it's completely pointless in this case.

  10. #30
    PSdonkey's Avatar
    PSdonkey is offline Senior Member -Hacks Guru
    Join Date
    Dec 2005
    Posts
    2,123
    Rep Power
    40

    Default

    I was just about to say the same things Zingaburga. There are a million ways of coding to end up with the same result. What Zingaburga suggested and my code are not wrong, nobugging. My code works just fine to get the desired results that killaj was looking for. IF you actually played the game, nobugging, you would see that for yourself. There are probably over a hundred different ways to display helloworld on your psp. None of them would be wrong. If you want to talk about "Correct" code, nobugging, then the "Correct" code would be the simplest and fastest code to get your desired result. If that was the case, then my code and what zingaburga suggested would be the "correct" code as you would say.



    @itsalldasame2me, yeah do what Zingaburga suggested and scan your computer for viruses. That might solve the problem. Post if it doesn't and then i'll look more into it for you.
    Obey Beaker. That is all.


    Spoiler:
    Want to become a PSP Dev the easy way? Check out my tutorial for the PSP here http://www.psp-hacks.com/forums/f141...orial-t152466/
    Want to learn how to create your own games on the PSP? Check out my tutorial here http://www.psp-hacks.com/forums/f141...-your-t153653/
    Want to learn how to program C++ ? Check out that tutorial here http://www.psp-hacks.com/forums/f124...ram-c-t122337/

Page 3 of 61 FirstFirst 1 2 3 4 5 13 53 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •