Seite 240 von 340 ErsteErste ... 140 190 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 290 ... LetzteLetzte
Zeige Ergebnis 7.171 bis 7.200 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; I'm trying to make a Slim friendly app, testing in 1.50 kernel isn't the best idea, thats why I asked ...

  
  1. #7171
    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 trying to make a Slim friendly app, testing in 1.50 kernel isn't the best idea, thats why I asked specifically about 3.XX, plus I want to use the reset vsh command, which just crashes in 1.50.

    -Aura


    Last.fm | Deviant Art | First working OS picture

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

  2. #7172
    QJ Gamer Blue
    Points: 5.871, Level: 49
    Level completed: 61%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Beiträge
    432
    Points
    5.871
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Raphael
    Are you serious about what you just said? Dude.... read the exact code that yaustar has given you, then look at what you really used. Now think about why your code will produce double output. Really think about it.
    If you don't get it, read up on what the += operator does on strings here: http://www.cplusplus.com/reference/s...perator+=.html

    If you still don't get it.... I'm sorry but then you are beyond help.


    thanx it did take a little thinking, this is what i came up with.


    Code:
            {
                ifstream OpenFile("name.conn");
    
                if( !OpenFile )
                {
                    cerr << "Error opening file" << endl;
                    return -1;
                }
    
                string loadname= "";
    
                while ( OpenFile >> loadname)
                {
                    name += loadname;
                }
    
            }
    -= Double Post =-
    is there a way to check if a string is equal to a textual value,

    like to check if the person typed in a valid gender or not.
    -= Double Post =-
    i no how to use the

    if (#==#)
    Geändert von Blackbelttcon (12-19-2007 um 12:57 PM Uhr) Grund: Automerged Doublepost

  3. #7173
    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 can use the string compair function I believe...

    http://www.cplusplus.com/reference/c...g/strncmp.html

    That should help a little.
    -Aura
    Last.fm | Deviant Art | First working OS picture

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

  4. #7174
    QJ Gamer Blue
    Points: 5.871, Level: 49
    Level completed: 61%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Beiträge
    432
    Points
    5.871
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    alright thanx, and thanx yaustar for helping me before, u did give me the right code, i just mess is up, by adding the wrong stuff.

  5. #7175
    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

    Code:
    string gender = "Male";
    if( "Male" == gender )
    {
    	cout << "Hey, this guy is Male" << endl;
    }
    Don't forget that this is case sensitive.

    PS: Pick up a book on C++ programming. You really shouldn't be needing to ask questions like this if you are learning properly.

    Read: http://parabellumgames.wordpress.com...c-programming/

  6. #7176
    QJ Gamer Blue
    Points: 5.871, Level: 49
    Level completed: 61%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Beiträge
    432
    Points
    5.871
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    alright thanx

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

    How exactly does a psar work? And how could I make my own containing everything that needs to be installed to flash? Just to make things easier.

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

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

  8. #7178
    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've made an error check for Project4, it reads the arguments that are normally passed to vshmain.prx, and from there reads what the error code should be, I had it working fine the other day and I somehow managed to mess it up big time today, so I was wondering if anyone could help me out as I think I just fluked it the first time.

    Code:
        pspDebugScreenInit();
        SceCtrlData pad;
        
        unsigned int* errorCode;
        
        errorCode = (unsigned int*) malloc(sizeof(unsigned int));
        
        *errorCode = *argp[0x14/4];
    
        
    
        _printf("0x%X - ", *errorCode);
        if(*errorCode==0x80020148) _printf("File loaded in incorrect kernel.");
        if(*errorCode==0x0AE1BCE4) _printf("Project4 Internal Error.");
    
        if(*errorCode==0xDADADADA) _printf("Sony updater blocked.");
        if(*errorCode==0x80020321) _printf("Device not found, using wrong NoUMD mode?");
        if(*errorCode<0)           _printf("Error unknown, please post error code on forums.");
    When it loads, it does nothing, it doesn't even print the error code, just hangs. That is the entire code for the start, nothing comes before it, and the error definatly comes at that point.

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

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

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

    Why are you allocating memory for something you can do easily on the stack?

    Code:
        pspDebugScreenInit();
        SceCtrlData pad;
        
        unsigned int errorCode = *argp[0x14/4];
    
        _printf("0x%X - ", errorCode);
        switch(errorCode) {
            case 0x80020148: _printf("File loaded in incorrect kernel."); break; //Note: this error isn't strictly true; it should be that the PRX type isn't supported by the current kernel
            case 0x0AE1BCE4: _printf("Project4 Internal Error."); break; //Also, this error code is non-negative, so it may be passed on something successful happening and non necessarily on an error
            case 0xDADADADA: _printf("Sony updater blocked."); break;
            case 0x80020321: _printf("Device not found, using wrong NoUMD mode?"); break;
            default:
                if(errorCode < 0) _printf("Error unknown, please post error code on forums.");
            break;
        }
    Also, are you sure that argp is a pointer to a pointer?
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

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

    To be honest I have no idea, I'm just working from the warnings I've got when compiling, it says argument 2 should be **char. As for allocating memory, I assumed I had an error somewhere with a pointer and using a guide I found online, I allocated the memory as it showed, just to make sure that the error wasn't occuring there.

    The final thing, 0x80020148 normally only occurs when the user is running something in the wrong kernel, Project4 is aimed at users not programmers so this is generally the reason, although if you think I should change it still then I will do so.

    I've just tested the code you supplied, same problem, so I'll have another crack at it. Thanks for the help.

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

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

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

    There's your problem. You're dereferencing a char** into an int. You can't do that (3/4 of the time), and even when you can, you probably don't want to.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  12. #7182
    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, Iv been trying to figure out a way to get around my problem for the past 1-2 hours and i just cant get it. Iv got my function for an enemy to walk left and another one to walk right along with animation. If you use one of the functions it will return 1. The thing is i have another bit of code to reset the sprite to a normal standing position but it wont work properly. It simply works by the functions
    Code:
    enemy_walkL
    and
    Code:
    enemy_walkR
    both returning 0. To begin with, it works fine because enemy_walkL and enemy_walkR return 0, but the moment you use one of the function one will return 1. My question is, how would i define what a function returns when its not being used like:
    Code:
    }else{
    return0;
    }
    Any help would be great, thanks

  13. #7183
    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 Archaemic
    There's your problem. You're dereferencing a char** into an int. You can't do that (3/4 of the time), and even when you can, you probably don't want to.
    That probably explains it. I got access to my old backup and it appears that it always gives the same code, so it never was working unfortunatly. Have you got any idea how I can check the errors and keep warnings out of the compliation?

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

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

  14. #7184
    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

    Can I see more code? What you've given is valid except for the dereferencing of a char** into an int. You can't exactly store an error code in a char because it's way too short.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  15. #7185
    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 deleted the code, but what I had shown before was the code used.

    Code:
    int main(int args, char** argp)
    {
        pspDebugScreenInit();
        SceCtrlData pad;
        
        unsigned int errorCode = *argp[0x14/4];
    
        _printf("0x%X - ", errorCode);
        switch(errorCode) {
            case 0x80020148: _printf("File loaded in incorrect kernel."); break;
            case 0x0AE1BCE4: _printf("Project4 Internal Error."); break;
            case 0xDADADADA: _printf("Sony updater blocked."); break;
            case 0x80020321: _printf("Device not found, using wrong NoUMD mode?"); break;
            default:
                if(errorCode < 0) _printf("Error unknown, please post error code on forums.");
            break;
        }
    __main();
    }
    Thats pretty much what I had last. Could I copy the content of argp into a new variable, u32 errorCode[0x20/4] ? That should hold all the values, and I can then access a signle section right?

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

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

  16. #7186
    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

    Code:
    unsigned int errorCode = ((unsigned int*)*argp)[0x14/4];
    If the error code is really submitted starting at offset 0x14 in the argument string. A check for the args (>=0x18) would be good too, to avoid reading from memory that doesn't belong to the argument string anymore. Also a check for argp and *argp to be non-NULL would be good.
    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.

  17. #7187
    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 Raphael
    Code:
    unsigned int errorCode = ((unsigned int*)*argp)[0x14/4];
    If the error code is really submitted starting at offset 0x14 in the argument string. A check for the args (>=0x18) would be good too, to avoid reading from memory that doesn't belong to the argument string anymore. Also a check for argp and *argp to be non-NULL would be good.
    I had tried this in the past, but that actually caused another error, although that may have been linked to the fact it was never working in the first place. I'll have another go at getting it working tonight maybe.

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

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

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

    Code:
    
    psp-gcc: : No such file or directory
    cc1: error: to generate dependencies you must specify either -M or -MM
     psp-gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -O20 -G0 -ffast-math
     -fsigned-char -g -O2 -MT bitwise.lo -MD -MP -MF .deps/bitwise.Tpo -c bitwise.c
    -o bitwise.o
    make[2]: *** [framing.lo] Error 1
    make[2]: *** Waiting for unfinished jobs....
    mv -f .deps/bitwise.Tpo .deps/bitwise.Plo
    make[2]: Leaving directory `/home/G.Ninja/psplibraries/build/libogg/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/G.Ninja/psplibraries/build/libogg'
    make: *** [all] Error 2
    ../scripts/008-libogg.sh: Failed.
    I have never seen anything like it.

  19. #7189
    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 need help quickly so I can get this release out on the 24th, my code un-assigns and re-assigns flash0 into read/write mode so I can install Project4 into it, the code is exactly the same on the 3 installers but on the 3.7X installer it returns 0x8001000D, I have no idea what this error means, but it appears to happen when trying to un-assign flash0.

    I've also tested the 3.5X installer, that works fine, and as I said the code is exactly the same, so I'm not sure what the error is, so any information about the error is a major help at the moment.

    Thanks.
    -Aura
    -= Double Post =-
    Solved... I changed the code from 0x0 (user) to 0x800 (VSH).
    Geändert von Auraomega (12-21-2007 um 03:42 PM Uhr) Grund: Automerged Doublepost
    Last.fm | Deviant Art | First working OS picture

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

  20. #7190
    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 Xsjado7
    Hey guys, Iv been trying to figure out a way to get around my problem for the past 1-2 hours and i just cant get it. Iv got my function for an enemy to walk left and another one to walk right along with animation. If you use one of the functions it will return 1. The thing is i have another bit of code to reset the sprite to a normal standing position but it wont work properly. It simply works by the functions
    Code:
    enemy_walkL
    and
    Code:
    enemy_walkR
    both returning 0. To begin with, it works fine because enemy_walkL and enemy_walkR return 0, but the moment you use one of the function one will return 1. My question is, how would i define what a function returns when its not being used like:
    Code:
    }else{
    return0;
    }
    Any help would be great, thanks

    Could anyone help me with this?
    It was late and i kind of rambled on bit the jist of it is i wanna know how to return a different variable from a function when its not being used. Thanks

  21. #7191
    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

    How do you make your program check if two buttons were pressed at once?

    Code:
    if(pad.Buttons & PSP_CTRL_CIRCLE)
    is for one button (that was off the top of my head) but what is it for two?:o
    WHA!?

  22. #7192
    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 BigSanFrey
    How do you make your program check if two buttons were pressed at once?

    Code:
    if(pad.Buttons & PSP_CTRL_CIRCLE)
    is for one button (that was off the top of my head) but what is it for two?:o
    Code:
    if(pad.Buttons & (PSP_CTRL_CIRCLE | PSP_CTRL_CROSS))
    It's called boolean logic.
    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. #7193
    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

    Code:
    if(pad.Buttons & PSP_CTRL_CIRCLE && pad.Buttons & PSP_CTRL_CROSS)
    For circle and cross

  24. #7194
    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 Raphael
    Code:
    if(pad.Buttons & (PSP_CTRL_CIRCLE | PSP_CTRL_CROSS))
    It's called boolean logic.
    Is this not like a double if statement in one? In this case it is used like that anyway:o
    edit: just noticed the title has something to do with ISOs but i can't read that language so, sorry! I was just using the code as an example ;)

    Zitat Zitat von Xsjado7
    Code:
    if(pad.Buttons & PSP_CTRL_CIRCLE && pad.Buttons & PSP_CTRL_CROSS)
    For circle and cross
    Ahh, brilliant thank you :)
    WHA!?

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

    Any time

  26. #7196
    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 Raphael
    Code:
    if(pad.Buttons & (PSP_CTRL_CIRCLE | PSP_CTRL_CROSS))
    It's called boolean logic.
    Pssst: that will do if either button is pressed, not only if both buttons are pressed.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  27. #7197
    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 BigSanFrey
    Is this not like a double if statement in one? In this case it is used like that anyway:o
    edit: just noticed the title has something to do with ISOs but i can't read that language so, sorry! I was just using the code as an example ;)
    If you're referring to the following:
    Code:
    if(pad.Buttons & PSP_CTRL_CIRCLE || PSP_CTRL_CROSS || PSP_CTRL_TRIANGLE || PSP_CTRL_SQUARE)
    That code is bull****, as it will always evaluate to true.

    Zitat Zitat von Archaemic
    Pssst: that will do if either button is pressed, not only if both buttons are pressed.
    Ahh... I always forget about the important thing in that case...
    Code:
    if((pad.Buttons & (PSP_CTRL_CIRCLE | PSP_CTRL_CROSS)) == (PSP_CTRL_CIRCLE | PSP_CTRL_CROSS))
    That actually makes the other solution shorter now, but only if you don't alias the ORed button masks.
    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.

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

    Surely
    Code:
    if(pad.Buttons & (PSP_CTRL_CIRCLE & PSP_CTRL_CROSS))
    will only work if both buttons are pressed, which makes the code smaller again.

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

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

  29. #7199
    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 Auraomega
    Surely
    Code:
    if(pad.Buttons & (PSP_CTRL_CIRCLE & PSP_CTRL_CROSS))
    will only work if both buttons are pressed, which makes the code smaller again.

    -Aura
    Does it really matter if the code is longer or something?
    Code:
    if(pad.Buttons & PSP_CTRL_CIRCLE && pad.Buttons & PSP_CTRL_CROSS)
    works fine ;)
    WHA!?

  30. #7200
    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 BigSanFrey
    Does it really matter if the code is longer or something?
    Code:
    if(pad.Buttons & PSP_CTRL_CIRCLE && pad.Buttons & PSP_CTRL_CROSS)
    works fine ;)
    Nope, but I normally code from memory, and the shorter to code the easier to remember

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

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


 

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

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