Seite 35 von 340 ErsteErste ... 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 85 135 ... LetzteLetzte
Zeige Ergebnis 1.021 bis 1.050 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; Zitat von Insomniac197 Looks like it affects it to me mate. Follow the function through logically - it's pretty easy ...

  
  1. #1021
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Insomniac197
    Looks like it affects it to me mate.

    Follow the function through logically - it's pretty easy to understand.

    What are you trying to achieve exactly? I feel there will be an easier and faster way to execute it. The above function will be quite slow.
    Yeah ok. I already wanted to edit my post. I used it but it turns my partially transparent PNGs into transparent squares :S. What I want to do is fade out the images of my mainmenu... .



  2. #1022
    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

    Faster way, draw a quad over the top that's black (or whatever color you want to fade out to) and covers the entire screen and then alter the alpha value of the color.

    Something like this:
    Code:
    //////////////////////////////////////////////////////////////////////
    // Name: FadeScreen
    // Purpose: Fades the screen in/out (white)
    // Returns: NONE
    // Usage: Pass a value from 0.0f increasing to 1.0f to fade in,
    //        1.0f decreasing to 0.0f to fade out
    //////////////////////////////////////////////////////////////////////
    void FadeScreen(const float FadeInAlphaValue)
    {
    guStart();
    sceGuDisable(GU_TEXTURE_2D);
    CSVertex* vertices = (CSVertex*) sceGuGetMemory(2 * sizeof(CSVertex));
              vertices[0].color = GU_COLOR(1.0f, 1.0f, 1.0f, FadeInAlphaValue);
              vertices[0].x = 0;
              vertices[0].y = 0;
              vertices[0].z = 0;
              vertices[1].color = GU_COLOR(1.0f, 1.0f, 1.0f, FadeInAlphaValue);
              vertices[1].x = 480;
              vertices[1].y = 272;
              vertices[1].z = 0;
    sceGuDrawArray(GU_SPRITES, GU_COLOR_8888 | GU_VERTEX_16BIT | GU_TRANSFORM_2D, 2, 0, vertices);
    sceGuEnable(GU_TEXTURE_2D);
    sceGuFinish();
    sceGuSync(0, 0);
    }
    Where CSVertex is:

    Code:
    typedef struct
    {
    	unsigned int color;
    	short x, y, z;
    } CSVertex;
    You can of course alter the function to take your own arguments - but this one is hard set to white.
    Geändert von Insomniac197 (09-28-2006 um 06:04 AM Uhr)

    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

  3. #1023
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Insomniac197
    Faster way, draw a quad over the top that's black (or whatever color you want to fade out to) and covers the entire screen and then alter the alpha value of the color.
    Sometimes you have to change the alpha value without making a fade effect though...

    I believe this should save the transparency that's already there:
    Code:
    void SetAlphaImage(Image * image, unsigned int alpha)
    {
    	int size;
    	Color *databuf;
    
    	if(!image->data)
    		return;
    		
    	if(alpha>255) alpha = 255;
    	if(alpha<0) alpha = 0;
    
    	size = image->textureWidth * image->textureHeight;
    	databuf = image->data;
    
    	for(i = 0; i <= size; i++)
    	{
    		*databuf = (*databuf & 0x00ffffff) | ((A(*databuf)-(A(*databuf)-alpha))<<24);
    		databuf++;
    	}
    }


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  4. #1024
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Uhm, I compared this with the old version and I don't actually see a difference.

    My recent Problem: (sorry for so many code)
    Code:
    /* ------------------------------------- ARRAY PART 1 ------------------------------------- */
    
        mainMenu[0].subMenu =(MenuItem *)malloc(5 * sizeof(MenuItem));
        mainMenu[0].subMenu[0].iconHigh = loadImage("./img/mainmenu/s_eq_high.png");
        mainMenu[0].subMenu[0].iconLow  = loadImage("./img/mainmenu/s_eq_low.png");
        mainMenu[0].subMenu[0].imgOffsetX = 5;
        mainMenu[0].subMenu[0].lblOffsetX = -3;
        sprintf(mainMenu[0].subMenu[0].label, "EQUALIZER");
        mainMenu[0].subMenu[1].iconHigh = loadImage("./img/mainmenu/s_repeat_high.png");
        mainMenu[0].subMenu[1].iconLow  = loadImage("./img/mainmenu/s_repeat_low.png");
        mainMenu[0].subMenu[1].imgOffsetX = 5;
        mainMenu[0].subMenu[1].lblOffsetX = 0;
        sprintf(mainMenu[0].subMenu[1].label, "REPEAT");
        // [other menuitems]
    
    /* ------------------------------------- ARRAY PART 2 ------------------------------------- */
    
        mainMenu[1].subMenu =(MenuItem *)malloc(1 * sizeof(MenuItem));
        mainMenu[1].subMenu[0].iconHigh = loadImage("./img/mainmenu/gen_high.png");
        mainMenu[1].subMenu[0].iconLow  = loadImage("./img/mainmenu/gen_low.png");
        mainMenu[1].subMenu[0].imgOffsetX = 5;
        mainMenu[1].subMenu[0].lblOffsetX = 0;
        sprintf(mainMenu[1].subMenu[0].label, "ARTISTS");
        mainMenu[1].activeMenuItem = 0;
    
    /* ------------------------------------------------------------------------- */
    /*                                 Functions                                               */
    /* ------------------------------------------------------------------------- */
    
    
    /* -------------------------------- Draw icon with text below it ------------------- */
    
        void drawSubMenuItem(int selMM, int selSM, int x, int y, int high)
        {
            if(high == 1) {
                if(mainMenu[selMM].subMenu[selSM].iconHigh) {
                    blitAlphaImageToScreen(0 ,0 ,32 , 32, mainMenu[selMM].subMenu[selSM].iconHigh, x+mainMenu[selMM].subMenu[selSM].imgOffsetX, y);
                }
                printTextScreen(x+mainMenu[selMM].subMenu[selSM].lblOffsetX, y+36, mainMenu[selMM].subMenu[selSM].label, highlightColor);
            } else if(high == 0) {
                if(mainMenu[selMM].subMenu[selSM].iconLow) {
                    blitAlphaImageToScreen(0 ,0 ,32 , 32, mainMenu[selMM].subMenu[selSM].iconLow, x+mainMenu[selMM].subMenu[selSM].imgOffsetX, y);
                }
                printTextScreen(x+mainMenu[selMM].subMenu[selSM].lblOffsetX, y+36, mainMenu[selMM].subMenu[selSM].label, dimmedColor);
            }
        }
    
    
    /*-------------------- Draw vertical Menu of an XMB -------------------------------*/
    
        void drawSubMenu(selComponent)
        {
            int i, y;
    
            for(i=0; i<=sizeof(mainMenu[selComponent].subMenu); i++)
            {
                if(i < mainMenu[selComponent].activeMenuItem)
                {
    
                    y = 60 - (mainMenu[selComponent].activeMenuItem-i) * subDistance;
                    drawSubMenuItem(selComponent, i, subOffsetX, y, 0);
    
                } else if(i == mainMenu[selComponent].activeMenuItem) {
    
                    drawSubMenuItem(selComponent, i, subOffsetX, 100, 1);
    
                } else if(i > mainMenu[selComponent].activeMenuItem) {
    
                    y = 100 + (i-mainMenu[selComponent].activeMenuItem) * subDistance;;
                    drawSubMenuItem(selComponent, i, subOffsetX, y, 0); 
    
                }
            }
        }
    
    
    
        // In my mainloop
        drawSubMenu(0); // using the first array works
        drawSubMenu(1); // Freezes the PSP on startup

    When I call drawSubMenu with 0 as a parameter everything works fine. Using 1, which means using the 2nd part of the Array, the PSP freezes
    -= Double Post =-
    Added Comments.
    Geändert von Lukeson (09-28-2006 um 11:19 AM Uhr) Grund: Automerged Doublepost

  5. #1025
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    when i try to use the danzeff OSK , it gives tons of erroros

    Code:
    $ make kxploit
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o main.o mai
    n.c
    In file included from danzeff.h:15,
                     from main.c:5:
    pspctrl_emu.h:4:21: error: SDL/SDL.h: No such file or directory
    In file included from danzeff.h:15,
                     from main.c:5:
    pspctrl_emu.h:23: error: nested redefinition of 'enum PspCtrlButtons'
    pspctrl_emu.h:23: error: redeclaration of 'enum PspCtrlButtons'
    pspctrl_emu.h:25: error: redeclaration of enumerator 'PSP_CTRL_SELECT'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:37: error: previous definition of 'P
    SP_CTRL_SELECT' was here
    pspctrl_emu.h:27: error: redeclaration of enumerator 'PSP_CTRL_START'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:39: error: previous definition of 'P
    SP_CTRL_START' was here
    pspctrl_emu.h:29: error: redeclaration of enumerator 'PSP_CTRL_UP'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:41: error: previous definition of 'P
    SP_CTRL_UP' was here
    pspctrl_emu.h:31: error: redeclaration of enumerator 'PSP_CTRL_RIGHT'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:43: error: previous definition of 'P
    SP_CTRL_RIGHT' was here
    pspctrl_emu.h:33: error: redeclaration of enumerator 'PSP_CTRL_DOWN'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:45: error: previous definition of 'P
    SP_CTRL_DOWN' was here
    pspctrl_emu.h:35: error: redeclaration of enumerator 'PSP_CTRL_LEFT'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:47: error: previous definition of 'P
    SP_CTRL_LEFT' was here
    pspctrl_emu.h:37: error: redeclaration of enumerator 'PSP_CTRL_LTRIGGER'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:49: error: previous definition of 'P
    SP_CTRL_LTRIGGER' was here
    pspctrl_emu.h:39: error: redeclaration of enumerator 'PSP_CTRL_RTRIGGER'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:51: error: previous definition of 'P
    SP_CTRL_RTRIGGER' was here
    pspctrl_emu.h:41: error: redeclaration of enumerator 'PSP_CTRL_TRIANGLE'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:53: error: previous definition of 'P
    SP_CTRL_TRIANGLE' was here
    pspctrl_emu.h:43: error: redeclaration of enumerator 'PSP_CTRL_CIRCLE'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:55: error: previous definition of 'P
    SP_CTRL_CIRCLE' was here
    pspctrl_emu.h:45: error: redeclaration of enumerator 'PSP_CTRL_CROSS'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:57: error: previous definition of 'P
    SP_CTRL_CROSS' was here
    pspctrl_emu.h:47: error: redeclaration of enumerator 'PSP_CTRL_SQUARE'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:59: error: previous definition of 'P
    SP_CTRL_SQUARE' was here
    pspctrl_emu.h:49: error: redeclaration of enumerator 'PSP_CTRL_HOME'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:61: error: previous definition of 'P
    SP_CTRL_HOME' was here
    pspctrl_emu.h:51: error: redeclaration of enumerator 'PSP_CTRL_HOLD'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:63: error: previous definition of 'P
    SP_CTRL_HOLD' was here
    pspctrl_emu.h:53: error: redeclaration of enumerator 'PSP_CTRL_NOTE'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:65: error: previous definition of 'P
    SP_CTRL_NOTE' was here
    pspctrl_emu.h:57: error: redefinition of 'struct SceCtrlData'
    pspctrl_emu.h:68: error: redefinition of typedef 'SceCtrlData'
    /usr/local/pspdev/psp/sdk/include/pspctrl.h:103: error: previous declaration of
    'SceCtrlData' was here
    pspctrl_emu.h:70: error: syntax error before '*' token
    In file included from main.c:5:
    danzeff.h:58:27: error: SDL/SDL_image.h: No such file or directory
    In file included from main.c:5:
    danzeff.h:60: error: syntax error before '*' token
    here is my main.c
    Code:
    #include <math.h>//rekenmachine
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspctrl.h>//controls
    #include "danzeff.h"
    
    
    #define printf pspDebugScreenPrintf
    PSP_MODULE_INFO("calculator",0,0,1);
    /* 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 y = 0;
    int x =0;
    int input;
    void vermenigvuldigen();
    void delen ();
    void optellen();
    void aftrekken();
    SceCtrlData pad;
    int main()
    {
    pspDebugScreenInit();
    SetupCallbacks();
    menu();
    }
    inline void menu()
    { 
    danzeff_load();
    danzeff_render(); 
    while(1){
                 sceCtrlReadBufferPositive(&pad,1);
                 if(pad.Buttons & PSP_CTRL_START){
                                  break;
                                  }
                 } 
           
           printf( "   ______   _______   _        ______     \n");  
           printf(  "  |  ____| |  ___  | | |      |  ____|      v0.01 Beta test   \n");
           printf(  "  | |      |  | |  | | |      | |               by roel      \n");
           printf(  "  | |____  |  ---  | | |____  | |____         (HALLO007)\n");
           printf(  "  |______| |__| |__| |______| |______|  -=[RP]=- Productions  \n\n\n");
           printf("druk start om het keyboard te openen\n");
           printf("1.vermenigvuldig\n");
           printf("2.delen\n");
           printf("3.optellen\n");
           printf("4.aftrekken\n");
           printf("selectie: %d" , input);
           printf("druk op [X] om de selectie te activeren");
    while(1){
                 sceCtrlReadBufferPositive(&pad,1);
    
              if(pad.Buttons & PSP_CTRL_CROSS) {
                           switch (input) {
                                case 1:
                                printf("test");
                                case 2: 
                                printf("test");
                                case 3:
                                 printf("test");
                                 case 4:
                                 printf("test");
                                 default:
                                 printf("error , probeer opnieuw");
                                  menu();
    }  
    }
    
                  
    }
    } 
    inline void vermenigvuldigen ()
    {
           pspDebugScreenClear();//clear de screen                                 
    
           
           printf( "   ______   _______   _        ______     \n");  
           printf(  "  |  ____| |  ___  | | |      |  ____|      v0.01 Beta test   \n");
           printf(  "  | |      |  | |  | | |      | |               by roel      \n");
           printf(  "  | |____  |  ---  | | |____  | |____         (HALLO007)\n");
           printf(  "  |______| |__| |__| |______| |______|  -=[RP]=- Productions  \n");
    
    printf("schrijf 2 getallen voor te vermenigvuldigen: \n");
    printf("de waarde van het eerste getal : %d \n" , x); 
    printf("druk[X] om te bevestigen\n");
    while(1) {
             sceCtrlReadBufferPositive(&pad, 1);
             if (pad.Buttons & PSP_CTRL_CROSS) {
                             printf("de waarde van het tweede getal : %d\n" , y);
                             printf("druk [X] om te vermenigvuldigen\n"); 
    }
    
    } 
    }
    en here is the makefile
    Code:
    TARGET = calculator
    OBJS = main.o danzeff.o
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = calculator
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    [/code]

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

    There's a readme that comes with danzeff OSK.

    Read it.

    You need to choose within danzeff whether to use GU or SDL.

    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. #1027
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    that's the point i dont understand the readme

    i want the use the SDL_Joystick

    but dont know how do change it

  8. #1028
    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 need SDL installed to be able to use it...

    I think the default for danzeff is SDL.

    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

  9. #1029
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Lukeson
    Uhm, I compared this with the old version and I don't actually see a difference.

    My recent Problem: (sorry for so many code)
    [ code ]
    When I call drawSubMenu with 0 as a parameter everything works fine. Using 1, which means using the 2nd part of the Array, the PSP freezes
    Problem solved

  10. #1030
    QJ Gamer Blue
    Points: 4.972, Level: 45
    Level completed: 11%, Points required for next Level: 178
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    246
    Points
    4.972
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Glad to hear it.

  11. #1031
    QJ Gamer Green
    Points: 7.598, Level: 58
    Level completed: 24%, Points required for next Level: 152
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    NoWhere . . . .
    Beiträge
    1.266
    Points
    7.598
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    hay i was wondering if any one can help give me a code to check if a file exists then load it and have it tell me when it exits i look all over but i couldnt find any.

  12. #1032
    Developer
    Points: 5.359, Level: 47
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Norway
    Beiträge
    384
    Points
    5.359
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von zmathue
    hay i was wondering if any one can help give me a code to check if a file exists then load it and have it tell me when it exits i look all over but i couldnt find any.
    could just do:

    file = fopen("./file.txt", "r");
    if(file==NULL) { //file dosn't exist
    } else {
    //file exists
    }


  13. #1033
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von zmathue
    hay i was wondering if any one can help give me a code to check if a file exists then load it and have it tell me when it exits i look all over but i couldnt find any.
    To check if a file exists you simply do

    Code:
    //Open the file, change file path to the file you wish to check. rb indicates that it opens in read-binary mode.
    FILE * file = fopen("file path", "rb");
    //If file==0 (same as !file) the file doesn't exist
    if(!file) { printf("file does not exist"); return 0; }
    //Close the open file
    fclose(file);
    return 1;
    Not sure what you mean by the "exit" part though.


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  14. #1034
    QJ Gamer Green
    Points: 7.598, Level: 58
    Level completed: 24%, Points required for next Level: 152
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    NoWhere . . . .
    Beiträge
    1.266
    Points
    7.598
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    what i ment was when the app i loaded exits out of itself that i want it to tell my program that it exited and do something

  15. #1035
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Oh, in that case. Just add this to your main (preferbly where you intialize the app)
    Code:
    int cbid;
    cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
    sceKernelRegisterExitCallback(cbid);
    And then add this
    Code:
    /* Exit callback */
    int exit_callback() {
    
      //Add stuff here	
    
      sceKernelExitGame();
      return 0;
    }


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  16. #1036
    QJ Gamer Green
    Points: 7.598, Level: 58
    Level completed: 24%, Points required for next Level: 152
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    NoWhere . . . .
    Beiträge
    1.266
    Points
    7.598
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von homer
    Oh, in that case. Just add this to your main (preferbly where you intialize the app)
    Code:
    int cbid;
    cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
    sceKernelRegisterExitCallback(cbid);
    And then add this
    Code:
    /* Exit callback */
    int exit_callback() {
    
      //Add stuff here	
    
      sceKernelExitGame();
      return 0;
    }
    actualy I mean when i load the app that i checked if it exists when that app exits then i want it to do something.
    Geändert von zmathue (09-30-2006 um 06:56 AM Uhr) Grund: Cuz i did

  17. #1037
    &lt;img src=&quot;images/smilies/psp.gif&quot; border=&quot;0&quot; alt=&quot;&quot; title=&quot;&quot; cl***=&quot;inlineimg&quot; /&gt; &lt;img src=&quot;images/smilies/Punk.gif&quot; border=&quot;0&quot; alt=&quot;&quot; title=&quot;&quot; cl***=&
    Points: 11.105, Level: 69
    Level completed: 64%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Canada
    Beiträge
    1.944
    Points
    11.105
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    whats the screen brightness button code
    (the one beside note)

  18. #1038
    OMFG
    Points: 19.453, Level: 88
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Toronto
    Beiträge
    2.814
    Points
    19.453
    Level
    88
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Sousanator
    whats the screen brightness button code
    (the one beside note)
    PSP_CTRL_SCREEN = 0x400000
    It can only be read in kernel mode.

  19. #1039
    QJ Gamer Green
    Points: 6.256, Level: 51
    Level completed: 53%, Points required for next Level: 94
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    London
    Beiträge
    645
    Points
    6.256
    Level
    51
    Downloads
    0
    Uploads
    0

    Standard

    Can it be modified?
    [b][center]
    [URL="http://forums.qj.net/showthread.php?t=65032"][SIZE="3"][COLOR="Blue"]Omicron[/COLOR] - [COLOR="DeepSkyBlue"]A hacking simulation game for the PSP[/COLOR][/SIZE][/URL]

    [url=http://profile.mygamercard.net/dr+nutterbutter][img]http://card.mygamercard.net/gbar/live/dr+nutterbutter.gif[/img][/url][/b][/center]

  20. #1040
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Nutterbutter
    Can it be modified?

    that depends.. what do you mean by modified?? like changing the value?? i guess.. ask slasher. ;)
    --------------------------------------------------------------------------------------

  21. #1041
    &lt;img src=&quot;images/smilies/psp.gif&quot; border=&quot;0&quot; alt=&quot;&quot; title=&quot;&quot; cl***=&quot;inlineimg&quot; /&gt; &lt;img src=&quot;images/smilies/Punk.gif&quot; border=&quot;0&quot; alt=&quot;&quot; title=&quot;&quot; cl***=&
    Points: 11.105, Level: 69
    Level completed: 64%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Canada
    Beiträge
    1.944
    Points
    11.105
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Slasher
    PSP_CTRL_SCREEN = 0x400000
    It can only be read in kernel mode.
    thanks,,

    and is there some way to control the screen brightness?
    (without touching the button, or disabling the button to change brightness)

  22. #1042
    QJ Gamer Blue
    Points: 7.538, Level: 57
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    France
    Beiträge
    239
    Points
    7.538
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    Well I installed CYGWIN & PSPTOOLCHAIN, and I tried to compil an EBOOT and her's what it said :


    Note : if i "make" again then, it creates an eboot that shuts off the PSP :S

  23. #1043
    Developer
    Points: 5.359, Level: 47
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Norway
    Beiträge
    384
    Points
    5.359
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Does there exist a cos^-1 function?

    Zitat Zitat von Maxime
    Well I installed CYGWIN & PSPTOOLCHAIN, and I tried to compil an EBOOT and her's what it said :


    Note : if i "make" again then, it creates an eboot that shuts off the PSP :S
    try adding the
    PSP_MODULE_INFO("hellowor ld", 0, 1, 1); line.


  24. #1044
    Developer
    Points: 4.318, Level: 41
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    205
    Points
    4.318
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von waterbottle
    Does there exist a cos^-1 function?
    How about acos?

    EDIT: Congrats on making the 1,000,000th post. :)

  25. #1045
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von waterbottle
    Does there exist a cos^-1 function?
    How about
    pow(cos(), -1);
    ?


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  26. #1046
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    when i tried to make a variabel x , one bigger when you pressed the up button
    it goes many numbers up i did this
    (note : ofcourse this code wont work , lol)
    if (up pressed)
    x++

    how do you do that it only goes one number up if you pressed the up button , and if you press the up button again it goes another number up

    for example
    x=1
    up button pressed
    x=2
    up button presse
    x=3


    now it does this
    up button pressed
    x=1
    x=2
    x=3
    x=4
    x=5
    ....

    thnx in advance

  27. #1047
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Thumbs up

    Zitat Zitat von hallo007
    when i tried to make a variabel x , one bigger when you pressed the up button
    it goes many numbers up i did this
    (note : ofcourse this code wont work , lol)
    if (up pressed)
    x++

    how do you do that it only goes one number up if you pressed the up button , and if you press the up button again it goes another number up

    for example
    x=1
    up button pressed
    x=2
    up button presse
    x=3


    now it does this
    up button pressed
    x=1
    x=2
    x=3
    x=4
    x=5
    ....

    thnx in advance
    basically you want to check if the button was pressed last frame. this should work:

    Code:
    // Put this outside of your loop //
    
    char upPressed = "false" // This initializes "upPressed" //
    
    // Put this in you main loop //
    
    if (up pressed) {                       // If you press up //
        if (upPressed == "false") { 
            x++;
        }
    upPressed = "true"
    } else {
        upPressed = "false"
    }
    --------------------------------------------------------------------------------------

  28. #1048
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    i will repeat it and now write the code ;)
    when i tried to make a variabel x , one bigger when you pressed the up button
    it goes many numbers up i did this

    if(pad.Buttons & PSP_CTRL_UP) {
    x++;
    }

    how do you do that it only goes one number up if you pressed the up button , and if you press the up button again it goes another number up

    for example
    x=1
    up button pressed
    x=2
    up button presse
    x=3


    now it does this
    up button pressed
    x=1
    x=2
    x=3
    x=4
    x=5
    ....

    thnx in advance
    -= Double Post =-
    so if you hold the up button ,it does only one time something
    and that's x+1

    now if you hold it , it stayes x+1,x+1,...
    Geändert von hallo007 (10-02-2006 um 11:47 AM Uhr) Grund: Automerged Doublepost

  29. #1049
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von hallo007
    i will repeat it and now write the code ;)
    when i tried to make a variabel x , one bigger when you pressed the up button
    it goes many numbers up i did this

    if(pad.Buttons & PSP_CTRL_UP) {
    x++;
    }

    how do you do that it only goes one number up if you pressed the up button , and if you press the up button again it goes another number up

    for example
    x=1
    up button pressed
    x=2
    up button presse
    x=3


    now it does this
    up button pressed
    x=1
    x=2
    x=3
    x=4
    x=5
    ....

    thnx in advance
    -= Double Post =-
    so if you hold the up button ,it does only one time something
    and that's x+1

    now if you hold it , it stayes x+1,x+1,...
    have you even TRIED my code?? just try it, it WILL work.
    --------------------------------------------------------------------------------------

  30. #1050
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    oke thnx;)
    i will tried ,but first get some sleep;)


 

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 .