Seite 309 von 340 ErsteErste ... 209 259 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 ... LetzteLetzte
Zeige Ergebnis 9.241 bis 9.270 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; If you have the SDK downloaded, you can look in the samples folder for samples of most of the functions ...

  
  1. #9241
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    If you have the SDK downloaded, you can look in the samples folder for samples of most of the functions in use. There is also extensive documentation here: http://psp.jim.sh/pspsdk-doc/

    But do listen to dysfunctional and get acquainted with the language. If you only know two psp-specific functions, you have a long ways to go and should go back to the PC first.


    [size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]

  2. #9242
    QJ Gamer Bronze
    Points: 5.594, Level: 48
    Level completed: 22%, Points required for next Level: 156
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    thugz mansion
    Beiträge
    875
    Points
    5.594
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von _dysfunctional Beitrag anzeigen
    You obviously have no knowledge of C or C++, so before you even touch the PSP, I would suggest you go buy a nice book on C++ and download the Visual C++ Express. Get used to it, program on the PC for a while. Once you actually understand C++, you'll understand that you can just look in the SDK headers to find the function you want. Of course, without any knowledge of C++, it won't make any sense now. So, get to it, get reading.
    i actually know some c programming language and own 4 books and 2 ebooks on the subject i tried doing void function(void) like that but it doesnt compile correctly for me so i usually use #include "function.c" and then call the function from the app but i think it would be more easy to use subs instead. (im used to old school. I still use basic alot )

    anyways i was speaking about what exactly they do if i just look at the header files they usually dont say what they do in lamens terms.
    Zitat Zitat von SuperBatXS
    I use my psp all the time in the plane. I was masturbating once while watching some lesbian videos when a fat lady beside me was sleeping and her really hot daughter next to her was getting ready for my dong to shove up her ding. Then, her daughter and I were about to go to the bathroom together but, the air hostess came to tell me i should stop right now. I swear this happened. I am never taking my psp to the plane again. Always got my iPod though...hehe. ;)

  3. #9243
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Like I said, you don't know the language. Go read those books.

  4. #9244
    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

    Zitat Zitat von BlackBurd Beitrag anzeigen
    i actually know some c programming language and own 4 books and 2 ebooks on the subject i tried doing void function(void) like that but it doesnt compile correctly for me so i usually use #include "function.c" and then call the function from the app but i think it would be more easy to use subs instead. (im used to old school. I still use basic alot )

    anyways i was speaking about what exactly they do if i just look at the header files they usually dont say what they do in lamens terms.
    Looking at the code snippet you posted, subs are functions, not separate 'apps'. Have a read of this article:

    http://www.gamedev.net/reference/art...rticle1798.asp

    Here is the C++ equivalent of your Basic code
    Code:
    #include <iostream>
    #include <string>
    
    void thq()
    {
    	std::cout << "noobs are cool =}" << std::endl;
    }
    
    int main()
    {
    	std::cout << "hello qj.net this is an example" << std::endl;
    	string input; 
    	 
    	std::cout << "are you a noob? YES or NO" << std::endl;
    	cin >> input;
    	if( "YES" == input )
    	{
    		thq();
    	}
    	else if( "NO" == input )
    	{
    		std::cout << "thats good for you" << std::endl;
    	}
    }
    Geändert von yaustar (11-27-2008 um 07:02 AM Uhr)

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

    Does anyone know how to fill the screen with a color in a PRX? I'm freezing the game with my hex editor and it causes "sticky printing" because the screen doesn't refresh.
    Geändert von Durka Durka Mahn (11-28-2008 um 07:26 AM Uhr)
    Atheist, because I just won't believe in what doesn't show itself to me.

  6. #9246
    QJ Gamer Bronze
    Points: 5.594, Level: 48
    Level completed: 22%, Points required for next Level: 156
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    thugz mansion
    Beiträge
    875
    Points
    5.594
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yaustar Beitrag anzeigen
    Looking at the code snippet you posted, subs are functions, not separate 'apps'. Have a read of this article:

    http://www.gamedev.net/reference/art...rticle1798.asp

    Here is the C++ equivalent of your Basic code
    Code:
    #include <iostream>
    #include <string>
    
    void thq()
    {
    	std::cout << "noobs are cool =}" << std::endl;
    }
    
    int main()
    {
    	std::cout << "hello qj.net this is an example" << std::endl;
    	string input; 
    	 
    	std::cout << "are you a noob? YES or NO" << std::endl;
    	cin >> input;
    	if( "YES" == input )
    	{
    		thq();
    	}
    	else if( "NO" == input )
    	{
    		std::cout << "thats good for you" << std::endl;
    	}
    }
    I know but i was asking if there was a work around because it wont compile it only lets me use the main function.

    ive been using #include "random.c"
    and calling the function from the main function.
    i dunno why it wont compile.
    Zitat Zitat von SuperBatXS
    I use my psp all the time in the plane. I was masturbating once while watching some lesbian videos when a fat lady beside me was sleeping and her really hot daughter next to her was getting ready for my dong to shove up her ding. Then, her daughter and I were about to go to the bathroom together but, the air hostess came to tell me i should stop right now. I swear this happened. I am never taking my psp to the plane again. Always got my iPod though...hehe. ;)

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

    Zitat Zitat von BlackBurd Beitrag anzeigen
    I know but i was asking if there was a work around because it wont compile it only lets me use the main function.

    ive been using #include "random.c"
    and calling the function from the main function.
    i dunno why it wont compile.
    There is no 'workaround'. That is the actual code for one source file.

    If you are going to use multiple files for organisation purposes, then read the previous article I linked to from GameDev.

    It is important that you understand the build process of the executable.
    http://www.tenouk.com/ModuleW.html

    What IDE are you using?

  8. #9248
    QJ Gamer Bronze
    Points: 5.594, Level: 48
    Level completed: 22%, Points required for next Level: 156
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    thugz mansion
    Beiträge
    875
    Points
    5.594
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yaustar Beitrag anzeigen
    Put all the source in one file. If you are going to use multiple files for organisation purposes, then read the previous article I linked to from GameDev.

    It is important that you understand the build process of the executable.
    http://www.tenouk.com/ModuleW.html

    What IDE are you using?
    im using notepad and cygwin.
    No ide but should i be using one i have visuall c++ but i dont use it for psp related things.

    I also have notepad ++
    again i dont use that for psp either.
    Zitat Zitat von SuperBatXS
    I use my psp all the time in the plane. I was masturbating once while watching some lesbian videos when a fat lady beside me was sleeping and her really hot daughter next to her was getting ready for my dong to shove up her ding. Then, her daughter and I were about to go to the bathroom together but, the air hostess came to tell me i should stop right now. I swear this happened. I am never taking my psp to the plane again. Always got my iPod though...hehe. ;)

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

    Zitat Zitat von BlackBurd Beitrag anzeigen
    im using notepad and cygwin.
    No ide but should i be using one i have visuall c++ but i dont use it for psp related things.

    I also have notepad ++
    again i dont use that for psp either.
    Then if is even more important to understand the build process and have some knowledge on makefiles.

    Also, learn what #include actually does: http://gcc.gnu.org/onlinedocs/cpp/In...lude-Operation

    I don't understand why at this stage of learning that you are splitting your source files. As I said, the code I have shown you is for one source file. If you are going to start using multiple files, read the article I linked to.

  10. #9250
    QJ Gamer Bronze
    Points: 5.594, Level: 48
    Level completed: 22%, Points required for next Level: 156
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    thugz mansion
    Beiträge
    875
    Points
    5.594
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yaustar Beitrag anzeigen
    Then if is even more important to understand the build process and have some knowledge on makefiles.

    Also, learn what #include actually does: http://gcc.gnu.org/onlinedocs/cpp/In...lude-Operation

    I don't understand why at this stage of learning that you are splitting your source files. As I said, the code I have shown you is for one source file. If you are going to start using multiple files, read the article I linked to.
    I know what include does i know it takes the code and adds it to the first source file but cygwin wont compile it when i stick it all in one file i tried putting it in a different order and things like that but it wont work.

    i dont know if its just cygwin because ive done it alright with windows pspsdk but i cant install the librarys i use with cygwin on it.
    Zitat Zitat von SuperBatXS
    I use my psp all the time in the plane. I was masturbating once while watching some lesbian videos when a fat lady beside me was sleeping and her really hot daughter next to her was getting ready for my dong to shove up her ding. Then, her daughter and I were about to go to the bathroom together but, the air hostess came to tell me i should stop right now. I swear this happened. I am never taking my psp to the plane again. Always got my iPod though...hehe. ;)

  11. #9251
    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 you're coding in C/C++ on the computer and not the PSP first, you shouldn't be using Cygwin to compile your programs. Try using something like Dev-C++ or MS VC++.
    -=Double Post Merge =-
    Zitat Zitat von Durka Durka Mahn Beitrag anzeigen
    Does anyone know how to fill the screen with a color in a PRX? I'm freezing the game with my hex editor and it causes "sticky printing" because the screen doesn't refresh.
    Anyone...?
    Geändert von Durka Durka Mahn (11-28-2008 um 03:30 PM Uhr) Grund: Automerged Doublepost
    Atheist, because I just won't believe in what doesn't show itself to me.

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

    Zitat Zitat von BlackBurd Beitrag anzeigen
    I know what include does i know it takes the code and adds it to the first source file but cygwin wont compile it when i stick it all in one file i tried putting it in a different order and things like that but it wont work.

    i dont know if its just cygwin because ive done it alright with windows pspsdk but i cant install the librarys i use with cygwin on it.
    Telling us cygwin won't compile doesn't help. How did you compile it? What was the exact error message(s)?

    If we just talking about developing on the PC for the PC, then download Code::Blocks with mingw. It make your life much easier:
    http://www.codeblocks.org/

  13. #9253
    QJ Gamer Green
    Points: 3.567, Level: 37
    Level completed: 45%, Points required for next Level: 83
    Overall activity: 0%

    Registriert seit
    May 2008
    Ort
    The Netherlands
    Beiträge
    330
    Points
    3.567
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    I have a menu code but it doesn't work. Can someone help me out with fixing the problem? This is my code:

    Code:
    int menu()                                             //                     
    {                                                          //                     
                                                               //                         
        pspDebugScreenClear();                                 // Clear the Screen
                                                               //
        pspDebugScreenSetXY(0 , 0);                            //Set current pixel to 0,0
                                //
                                                               //
         int currentSelection = 0;
         SceCtrlData pad;
         int selecting = true;
        int loop;
         char *menuOption[3] = {  "START" ,
                                   "EXIT"
                                   };
         while(selecting)
         {
                 pspDebugScreenClear();
                 for(loop=0; loop<2; loop++)
                 {
                             pspDebugScreenSetXY(16 , 15+loop);
                             if(loop != currentSelection) printf("   %s" , menuOption[loop]);
                             else  printf("=> %s" , menuOption[loop]);
                             }
                 while(selecting)
                 {
                         sceCtrlPeekBufferPositive(&pad, 1);
                         if(pad.Buttons & PSP_CTRL_UP)
                         {
                                         if(!pressed)
                                         {
                                                           (currentSelection == 0) ? currentSelection = 1 : currentSelection--; 
                                                           buttonPressed = true;
                                                           break;
                                                           }
                                          }
                         else if(pad.Buttons & PSP_CTRL_DOWN)
                          {
                                         if(!pressed)
                                         {
                                                           (currentSelection == 1) ? currentSelection = 0 : currentSelection++; 
                                                           buttonPressed = true;
                                                           break;
                                                           }
                                         }
                         else if(pad.Buttons & PSP_CTRL_CROSS)
                         {
                              if(currentSelection == 0)
                              {
                                                 start();
                                                  }
                              else if(currentSelection == 1)  
                              {
                                  exit();
                                   }
                              }
                         else
                         {
                              pressed = false;
                              }
                         }//end while
                 }//end while
        return 0;                                              //
    }                                                          //By bY

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

    What exactly doesn't work..?
    Atheist, because I just won't believe in what doesn't show itself to me.

  15. #9255
    QJ Gamer Green
    Points: 3.567, Level: 37
    Level completed: 45%, Points required for next Level: 83
    Overall activity: 0%

    Registriert seit
    May 2008
    Ort
    The Netherlands
    Beiträge
    330
    Points
    3.567
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Durka Durka Mahn Beitrag anzeigen
    What exactly doesn't work..?
    I doesn't want to compile to a eboot. I gives me this error:


  16. #9256
    QJ Gamer Silver
    Points: 8.475, Level: 62
    Level completed: 9%, Points required for next Level: 275
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Perth, Scotland
    Beiträge
    1.094
    Points
    8.475
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    #include <pspctrl.h>

  17. #9257
    QJ Gamer Green
    Points: 3.567, Level: 37
    Level completed: 45%, Points required for next Level: 83
    Overall activity: 0%

    Registriert seit
    May 2008
    Ort
    The Netherlands
    Beiträge
    330
    Points
    3.567
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Davee Beitrag anzeigen
    #include <pspctrl.h>
    Still doesn't work:

    Code:
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    
    
    int menu()                                             //                     
    {                                                          //                     
                                                               //                         
        pspDebugScreenClear();                                 // Clear the Screen
                                                               //
        pspDebugScreenSetXY(0 , 0);                            //Set current pixel to 0,0
                                //
                                                               //
         int currentSelection = 0;
         SceCtrlData pad;
         int selecting = true;
        int loop;
         char *menuOption[3] = {  "START" ,
                                   "EXIT"
                                   };
         while(selecting)
         {
                 pspDebugScreenClear();
                 for(loop=0; loop<2; loop++)
                 {
                             pspDebugScreenSetXY(16 , 15+loop);
                             if(loop != currentSelection) printf("   %s" , menuOption[loop]);
                             else  printf("=> %s" , menuOption[loop]);
                             }
                 while(selecting)
                 {
                         sceCtrlPeekBufferPositive(&pad, 1);
                         if(pad.Buttons & PSP_CTRL_UP)
                         {
                                         if(!pressed)
                                         {
                                                           (currentSelection == 0) ? currentSelection = 1 : currentSelection--; 
                                                           buttonPressed = true;
                                                           break;
                                                           }
                                          }
                         else if(pad.Buttons & PSP_CTRL_DOWN)
                          {
                                         if(!pressed)
                                         {
                                                           (currentSelection == 1) ? currentSelection = 0 : currentSelection++; 
                                                           buttonPressed = true;
                                                           break;
                                                           }
                                         }
                         else if(pad.Buttons & PSP_CTRL_CROSS)
                         {
                              if(currentSelection == 0)
                              {
                                                 start();
                                                  }
                              else if(currentSelection == 1)  
                              {
                                  exit();
                                   }
                              }
                         else
                         {
                              pressed = false;
                              }
                         }//end while
                 }//end while
        return 0;                                              //
    }                                                          //By bY
    Here's the error:



    Can someone just post a new menu that works?

  18. #9258
    QJ Gamer Bronze
    Points: 5.594, Level: 48
    Level completed: 22%, Points required for next Level: 156
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    thugz mansion
    Beiträge
    875
    Points
    5.594
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    can someone post a menu that works.
    Here ( a project i gave up on.)
    Code:
    #include <pspkernel.h>
    #include <pspcallbacks.h>
    #include <pspctrl.h>
    #include "graphics.h"
    #include "game.c"
    
    
    #define printf printTextScreen
    
    #define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
    
    PSP_MODULE_INFO("Menu Example",0,1,1);
    Color white = RGB(255,255,255), red = RGB(255,0,0), black = RGB(0,0,0);
    
    enum {START, CONTROLS, CREDITS, EXTRAS, CONTACT, STORY, MEDALS, EXIT};
    
    char menuItems[8][25] = {
    {"START"},
    {"CONTROLS"},
    {"CREDITS"},
    {"EXTRAS"},
    {"CONTACT"},
    {"STORY"},
    {"MEDALS"},
    {"EXIT"},
    };
    int timer,select,foo;
    SceCtrlData pad;
    
    void executeMenu(int select)
    {
    	switch(select)
    	{
    		case START:
                            game();
    			break;
    		case CONTROLS:
    			break;
    		case CREDITS:
    			break;
    		case EXTRAS:
    			break;
    		case CONTACT:
    			break;
    		case STORY:
    			break;
    		case MEDALS:
    			break;
    		case EXIT:
    			sceKernelExitGame();
    			break;
    		default:
    			return;
    	}
    	return; // suppress compiler warning
    }
    
    int main() {
    	Image* background = loadImage("Background.png");
    	initGraphics();
    	SetupCallbacks();
    	while(1) {
    		sceCtrlReadBufferPositive(&pad,1);
    		blitAlphaImageToScreen(0,0,480,272,background,0,0);
    		fillScreenRect(white,0,0,480,272);
    		blitAlphaImageToScreen(0,0,480,272,background,0,0);
    		timer++;
    		for(foo=0;foo<10;foo++) {printf(200,foo*8+70,menuItems[foo],black);}
    
    		printf(201,select*8+70,menuItems[select],red);
    
    		if((pad.Buttons & PSP_CTRL_UP) && (timer > 6) && (select > 0)) {select--;timer = 0;}
    
    		else if ((pad.Buttons & PSP_CTRL_DOWN) && (timer > 6) && (select < 7)) {select++;timer = 0;}
    
    		else if (pad.Buttons & PSP_CTRL_CROSS){executeMenu(select);}
    
    		flipScreen();
    	}
    	return 0;
    }
    Ohh and thanks yauster i got it working correctly now.
    Zitat Zitat von SuperBatXS
    I use my psp all the time in the plane. I was masturbating once while watching some lesbian videos when a fat lady beside me was sleeping and her really hot daughter next to her was getting ready for my dong to shove up her ding. Then, her daughter and I were about to go to the bathroom together but, the air hostess came to tell me i should stop right now. I swear this happened. I am never taking my psp to the plane again. Always got my iPod though...hehe. ;)

  19. #9259
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Can someone stop copying code and try to learn how to program for themselves?

  20. #9260
    QJ Gamer Green
    Points: 3.567, Level: 37
    Level completed: 45%, Points required for next Level: 83
    Overall activity: 0%

    Registriert seit
    May 2008
    Ort
    The Netherlands
    Beiträge
    330
    Points
    3.567
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    Thanks Blackburd

  21. #9261
    QJ Gamer Bronze
    Points: 5.594, Level: 48
    Level completed: 22%, Points required for next Level: 156
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    thugz mansion
    Beiträge
    875
    Points
    5.594
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von malliet Beitrag anzeigen
    Thanks Blackburd
    Also if you want all the stuff i used with this menu fully compilable you can download it here.
    http://www.megaupload.com/?d=NWPJX4ZF

    thats the icon0 icon1 and snd0
    and the main.c and game.c
    Zitat Zitat von SuperBatXS
    I use my psp all the time in the plane. I was masturbating once while watching some lesbian videos when a fat lady beside me was sleeping and her really hot daughter next to her was getting ready for my dong to shove up her ding. Then, her daughter and I were about to go to the bathroom together but, the air hostess came to tell me i should stop right now. I swear this happened. I am never taking my psp to the plane again. Always got my iPod though...hehe. ;)

  22. #9262
    QJ Gamer Green
    Points: 3.567, Level: 37
    Level completed: 45%, Points required for next Level: 83
    Overall activity: 0%

    Registriert seit
    May 2008
    Ort
    The Netherlands
    Beiträge
    330
    Points
    3.567
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    I'll take a look at it.

  23. #9263
    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

    Zitat Zitat von malliet Beitrag anzeigen
    Still doesn't work:

    Code:
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    
    
    int menu()                                             //                     
    {                                                          //                     
                                                               //                         
        pspDebugScreenClear();                                 // Clear the Screen
                                                               //
        pspDebugScreenSetXY(0 , 0);                            //Set current pixel to 0,0
                                //
                                                               //
         int currentSelection = 0;
         SceCtrlData pad;
         int selecting = true;
        int loop;
         char *menuOption[3] = {  "START" ,
                                   "EXIT"
                                   };
         while(selecting)
         {
                 pspDebugScreenClear();
                 for(loop=0; loop<2; loop++)
                 {
                             pspDebugScreenSetXY(16 , 15+loop);
                             if(loop != currentSelection) printf("   %s" , menuOption[loop]);
                             else  printf("=> %s" , menuOption[loop]);
                             }
                 while(selecting)
                 {
                         sceCtrlPeekBufferPositive(&pad, 1);
                         if(pad.Buttons & PSP_CTRL_UP)
                         {
                                         if(!pressed)
                                         {
                                                           (currentSelection == 0) ? currentSelection = 1 : currentSelection--; 
                                                           buttonPressed = true;
                                                           break;
                                                           }
                                          }
                         else if(pad.Buttons & PSP_CTRL_DOWN)
                          {
                                         if(!pressed)
                                         {
                                                           (currentSelection == 1) ? currentSelection = 0 : currentSelection++; 
                                                           buttonPressed = true;
                                                           break;
                                                           }
                                         }
                         else if(pad.Buttons & PSP_CTRL_CROSS)
                         {
                              if(currentSelection == 0)
                              {
                                                 start();
                                                  }
                              else if(currentSelection == 1)  
                              {
                                  exit();
                                   }
                              }
                         else
                         {
                              pressed = false;
                              }
                         }//end while
                 }//end while
        return 0;                                              //
    }                                                          //By bY
    Here's the error:



    Can someone just post a new menu that works?
    The compiler tells you exactly what is wrong. Apparently you didn't declare most of the variables you have..And C doesn't have boolean variables (true/false) like C++ does. You have to either define it or use unsigned char and switch it between 0 (false) and a non zero (true).
    Atheist, because I just won't believe in what doesn't show itself to me.

  24. #9264
    QJ Gamer Green
    Points: 4.092, Level: 40
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    508
    Points
    4.092
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von _dysfunctional Beitrag anzeigen
    Can someone stop copying code and try to learn how to program for themselves?
    Can you be of assistance rather than constantly ***** about the obvious?
    I gone and made that one power spoofer and that gay cheat device.

  25. #9265
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Honestly? No.

    I've been in this seen far longer than you have and I understand that being nice to people doesn't get anything done. The average noob will rather take code of another noob, instead of listening to my advice.

    So, why don't you stop posting obvious trolls just to make it look like you are a badass on QJ. No one cares.

    The reason I don't baby people on the internet is because if you do, you will get ignored. If you have such a problem with that, why don't you just work it out in a place i don't have to see it?

    The kid above obviously has no knowledge of C, or else he would have at least known to read the errors so gracefully given by the compiler. Giving him code does not solve the problem of him not knowing how to code.

  26. #9266
    QJ Gamer Bronze
    Points: 5.594, Level: 48
    Level completed: 22%, Points required for next Level: 156
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    thugz mansion
    Beiträge
    875
    Points
    5.594
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Excuse me sorry to interupt a fight but im trying to put my psp into sleep mode from a app im making does anyone know if theres a premade function that will do that and if not how would i go about implementing this into my code in (c).
    Zitat Zitat von SuperBatXS
    I use my psp all the time in the plane. I was masturbating once while watching some lesbian videos when a fat lady beside me was sleeping and her really hot daughter next to her was getting ready for my dong to shove up her ding. Then, her daughter and I were about to go to the bathroom together but, the air hostess came to tell me i should stop right now. I swear this happened. I am never taking my psp to the plane again. Always got my iPod though...hehe. ;)

  27. #9267
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von NoEffex Beitrag anzeigen
    Can you be of assistance rather than constantly ***** about the obvious?
    No, because he's absolutely right. People need to quit asking for people to write code for them, and get off their ass and do some searching and coding of their own. Programmers are getting lazier every damn day.

    Zitat Zitat von BlackBurd Beitrag anzeigen
    Excuse me sorry to interupt a fight but im trying to put my psp into sleep mode from a app im making does anyone know if theres a premade function that will do that and if not how would i go about implementing this into my code in (c).
    The above goes for you. It's really not that hard to find.

    http://psp.jim.sh/pspsdk-doc/psppower_8h.html

  28. #9268
    QJ Gamer Bronze
    Points: 5.594, Level: 48
    Level completed: 22%, Points required for next Level: 156
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    thugz mansion
    Beiträge
    875
    Points
    5.594
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied Beitrag anzeigen
    No, because he's absolutely right. People need to quit asking for people to write code for them, and get off their ass and do some searching and coding of their own. Programmers are getting lazier every damn day.



    The above goes for you. It's really not that hard to find.

    http://psp.jim.sh/pspsdk-doc/psppower_8h.html
    i havent asked any one to write anything for me at all i was just asking because i looked through pages of google and maybe i didnt search for it correctly but i couldnt find alot of sites with alot of the usable functions that have sce meaning its from sony. Im sorry if i didnt portray that correctly And thanks that link did help a lilbit.

    besides i actually tried this function scePowerRequestStandby(); and including pspkerneltypes.h and it dint work.
    it said no such function on cygwin and minimalist pspsdk.
    Zitat Zitat von SuperBatXS
    I use my psp all the time in the plane. I was masturbating once while watching some lesbian videos when a fat lady beside me was sleeping and her really hot daughter next to her was getting ready for my dong to shove up her ding. Then, her daughter and I were about to go to the bathroom together but, the air hostess came to tell me i should stop right now. I swear this happened. I am never taking my psp to the plane again. Always got my iPod though...hehe. ;)

  29. #9269
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    This is what we are talking about. You can't just expect us to write and fix code for you.

    Did you even bother to open up pspkerneltypes.h so you could find for yourself that you were including the wrong header? I guess not.

    Try psppower.h.

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

    Zitat Zitat von _dysfunctional Beitrag anzeigen
    This is what we are talking about. You can't just expect us to write and fix code for you.

    Did you even bother to open up pspkerneltypes.h so you could find for yourself that you were including the wrong header? I guess not.

    Try psppower.h.
    Most new PSP programmers don't know about looking into the header files, or even where they are for that matter.. (I didn't until a friend of mine showed me)
    Atheist, because I just won't believe in what doesn't show itself to me.


 

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

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