Seite 274 von 340 ErsteErste ... 174 224 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 324 ... LetzteLetzte
Zeige Ergebnis 8.191 bis 8.220 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; Can anybody tell me how I would go on about accessing flash0 via USB? Spoiler for main.c : Code: #include ...

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

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

    Standard

    Can anybody tell me how I would go on about accessing flash0 via USB?

    Spoiler for main.c:
    Code:
    #include <pspkernel.h>
    #include <pspiofilemgr.h>
    #include <pspmodulemgr.h>
    #include <pspdisplay.h>
    #include <pspdebug.h>
    #include <pspusb.h>
    #include <pspusbstor.h>
    #include <pspthreadman.h>
    #include <pspctrl.h>
    #include <pspsdk.h>
    
    /**
     * Define the module info section
     *
     * 2nd arg must 0x1000 so __init is executed in
     * kernelmode for our loaderInit function
     */
    PSP_MODULE_INFO("USBSample", 0x1000, 1, 0);
    
    /**
     * THREAD_ATTR_USER causes the thread that the startup
     * code (ctr0.c) starts this program in to be in usermode
     * even though the module was started in kernelmode
     */
    PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
    
    /* Define printf, just to make typing easier */
    #define printf  pspDebugScreenPrintf
    
    //make this global so we can check it in the exit_callback
    u32 state;
    
    /**
     * Function that is called from _init in kernelmode before the
     * main thread is started in usermode.
     */
    __attribute__ ((constructor))
    void loaderInit()
    {
        pspKernelSetKernelPC();
        pspSdkInstallNoDeviceCheckPatch();
        pspDebugInstallKprintfHandler(NULL);
    }
    
    /* Exit callback */
    int exit_callback(int arg1, int arg2, void *common)
    {
        int retVal;
    
        //cleanup drivers
        if (state & PSP_USB_ACTIVATED) {
            retVal = sceUsbDeactivate(0);
            if (retVal != 0)
                printf("Error calling sceUsbDeactivate (0x%08X)\n", retVal);
        }
        retVal = sceUsbStop(PSP_USBSTOR_DRIVERNAME, 0, 0);
        if (retVal != 0)
            printf("Error stopping USB Mass Storage driver (0x%08X)\n",
                   retVal);
    
        retVal = sceUsbStop(PSP_USBBUS_DRIVERNAME, 0, 0);
        if (retVal != 0)
            printf("Error stopping USB BUS driver (0x%08X)\n", retVal);
    
        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;
    }
    
    //helper function to make things easier
    int LoadStartModule(char *path)
    {
        u32 loadResult;
        u32 startResult;
        int status;
    
        loadResult = sceKernelLoadModule(path, 0, NULL);
        if (loadResult & 0x80000000)
            return -1;
        else
            startResult =
                sceKernelStartModule(loadResult, 0, NULL, &status, NULL);
    
        if (loadResult != startResult)
            return -2;
    
        return 0;
    }
    
    int main(void)
    {
        SceCtrlData pad;
        u32 oldButtons = 0;
        u32 retVal;
    
        state = 0;
        pspDebugScreenInit();
        pspDebugScreenClear();
        SetupCallbacks();
    
        //setup Pad
        sceCtrlSetSamplingCycle(0);
        sceCtrlSetSamplingMode(0);
    
        //print header now in case we have any errors
        printf("USB Sample v1.0 by John_K - Based off work by PSPPet\n");
    
        //start necessary drivers
        LoadStartModule("flash0:/kd/semawm.prx");
        LoadStartModule("flash0:/kd/usbstor.prx");
        LoadStartModule("flash0:/kd/usbstormgr.prx");
        LoadStartModule("flash0:/kd/usbstorms.prx");
        LoadStartModule("flash0:/kd/usbstorboot.prx");
    
        //setup USB drivers
        retVal = sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
        if (retVal != 0) {
            printf("Error starting USB Bus driver (0x%08X)\n", retVal);
            sceKernelSleepThread();
        }
        retVal = sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);
        if (retVal != 0) {
            printf("Error starting USB Mass Storage driver (0x%08X)\n",
                   retVal);
            sceKernelSleepThread();
        }
        retVal = sceUsbstorBootSetCapacity(0x800000);
        if (retVal != 0) {
            printf
                ("Error setting capacity with USB Mass Storage driver (0x%08X)\n",
                 retVal);
            sceKernelSleepThread();
        }
        retVal = 0;
    
        //if everything worked we now enter our main loop
        for (;;) {
    
            sceCtrlReadBufferPositive(&pad, 1);
            state = sceUsbGetState();
            pspDebugScreenSetXY(0, 0);
            printf("USB Sample v1.0 by John_K - Based off work by PSPPet\n\n");
            printf("%-14s: %s\n", "USB Driver",
                   state & PSP_USB_ACTIVATED ? "activated     " :
                   "deactivated");
            printf("%-14s: %s\n", "USB Cable",
                   state & PSP_USB_CABLE_CONNECTED ? "connected    " :
                   "disconnected");
            printf("%-14s: %s\n", "USB Connection",
                   state & PSP_USB_CONNECTION_ESTABLISHED ? "established" :
                   "not present");
            printf("\nPress X to establish or destroy the USB connection\n");
    
            if (oldButtons != pad.Buttons) {
                if (pad.Buttons & PSP_CTRL_CROSS) {
                    if (state & PSP_USB_ACTIVATED)
                        retVal = sceUsbDeactivate(0x1c8);
                    else
                        retVal = sceUsbActivate(0x1c8);
                }
            }
            oldButtons = pad.Buttons;
            sceDisplayWaitVblankStart();
        }
    
    
        //Exit program
        sceKernelExitGame();
    
        return 0;
    }


    What would have to be edited so I can use flash0 on USB instead of Mem Stick? I think I might have to mount flash0, but im not sure how.



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

    Nvm
    Geändert von Slasher (03-17-2008 um 01:28 PM Uhr)

  3. #8193
    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 Xsjado7
    with OSL you declare it like:
    Code:
    OSL_COLOR*
    Why a pointer?

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

    thats just the way its declared
    Code:
    OSL_COLOR *white;

  5. #8195
    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 Xsjado7
    thats just the way its declared
    Code:
    OSL_COLOR *white;
    No it isn't, looking at the samples on his page (Super Patrick II), line 191:
    Code:
    const OSL_COLOR couleurMasque = RGB(255, 0, 255);
    It is a typedef base type so I honestly can't see a reason why it should be a pointer.

  6. #8196
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    yaustar is correct as someone who uses the oslib for a gfx's library you can take my word, colors do not require pointer's even if images, fonts, and sounds do
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  7. #8197
    QJ Gamer Platinum
    Points: 66.627, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    National Front Disco
    Beiträge
    13.057
    Points
    66.627
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Thanks guys, I decided to bin the colours and use an arrow pointer.

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

    *Grumbles at Moose*

  9. #8199
    QJ Gamer Platinum
    Points: 66.627, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    National Front Disco
    Beiträge
    13.057
    Points
    66.627
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    I might try colours again but not any time soon.

  10. #8200
    Points: 2.680, Level: 31
    Level completed: 54%, Points required for next Level: 70
    Overall activity: 0%

    Registriert seit
    Mar 2008
    Beiträge
    12
    Points
    2.680
    Level
    31
    Downloads
    0
    Uploads
    0

    Standard

    hi again,

    is it also possible to load instead of .png's .bmp's or .jpeg with a library???:o , because I can use it very well:Jump:

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

    svn co svn://svn.ps2dev.org/psp/trunk/Jpeg

    I think ...

  12. #8202
    Points: 2.680, Level: 31
    Level completed: 54%, Points required for next Level: 70
    Overall activity: 0%

    Registriert seit
    Mar 2008
    Beiträge
    12
    Points
    2.680
    Level
    31
    Downloads
    0
    Uploads
    0

    Standard

    It doesn't exist , some1 knows if it is possible??

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

    Lowercase j.
    svn co svn://svn.ps2dev.org/psp/trunk/jpeg
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  14. #8204
    Points: 2.680, Level: 31
    Level completed: 54%, Points required for next Level: 70
    Overall activity: 0%

    Registriert seit
    Mar 2008
    Beiträge
    12
    Points
    2.680
    Level
    31
    Downloads
    0
    Uploads
    0

    Standard

    great! It works:)
    I've installed the library, but which header files do I have to use (and add to my makefile)? And in the script, can I do excactly the same as with the .png's?

  15. #8205
    Points: 2.612, Level: 31
    Level completed: 8%, Points required for next Level: 138
    Overall activity: 0%

    Registriert seit
    Mar 2008
    Beiträge
    1
    Points
    2.612
    Level
    31
    Downloads
    0
    Uploads
    0

    Standard

    if youre using SDL its the same line of code.

    SDL_Surface *image;
    image = IMG_Load(file);

  16. #8206
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    hey question:

    how can i make a function with passes that are optional?

    i.e.:

    void func(int x,int y,bool starter){
    //some code
    }

    now than i don't always want to pass the starter bool, is their a way to make that an optional value?

    edit: i figured it out now
    Geändert von slicer4ever (03-17-2008 um 02:13 PM Uhr)
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  17. #8207
    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 ernos
    if youre using SDL its the same line of code.

    SDL_Surface *image;
    image = IMG_Load(file);
    You need SDL_image for that, actually.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

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

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

    Standard

    Hey guys


    Awhile back(don't remember what page) I asked for help on AIs'. I have done different things, but I haven't managed to pull of what I need to for something that I am working on...


    1) I will ask if anyone knows of a good tutorial/guide for doing the obvious.

    2)
    If all I would like to do is have an object moving vertically or horizontally to follow another object, do I really need any more than the x or y variables?
    [QUOTE=Archaemic]
    [size=1]My manwich![/size][/QUOTE]
    [QUOTE=mohaas05]lol i can't say d*ck?[/QUOTE]

  19. #8209
    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

    Mm? You mean like this thing I made three years ago? Yeah, all I used were x/y coordinates and trigonometry.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

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

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

    Standard

    Zitat Zitat von Archaemic
    Mm? You mean like this thing I made three years ago? Yeah, all I used were x/y coordinates and trigonometry.

    The question is, is it in C++ that you wrote it? That was similar to what I was originally thinking, but if you have multiple objects following around, you would have to set it up so that they don't hover over each other...

    Could you PM the code for it? If you can, I may just be able to tailor it to my needs.
    [QUOTE=Archaemic]
    [size=1]My manwich![/size][/QUOTE]
    [QUOTE=mohaas05]lol i can't say d*ck?[/QUOTE]

  21. #8211
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    k i have a problem with 2 functions that i can't seem to fix:

    Spoiler for first function:

    Code:
    Enemy SetupEnemy(Grid g){
         Enemy e;
         e.image = EnemyImages[CurrentWave];
         e.x = g.Tiles[g.ST].x+g.Tiles[g.ST].w/2;
         e.y = g.Tiles[g.ST].y+g.Tiles[g.ST].h/2;
         if(g.Tiles[g.ST].dir==0){
              e.angle=180;
         }else if(g.Tiles[g.ST].dir==1){
              e.angle=90;
         }else if(g.Tiles[g.ST].dir==2){
              e.angle=270;
         }else if(g.Tiles[g.ST].dir==3){
              e.angle=0;
         }
         e.CT = g.ST;
         e.speed=2;
         e.health=10;
         return e;
    }


    Spoiler for second function:

    Code:
    Enemy MoveEnemy(Grid g, Enemy e){
         e.x += sinf(ToRadians(e.angle))*e.speed;
         e.y -= cosf(ToRadians(e.angle))*e.speed;
         for(int x=0;x<g.GSX;x++){
              for(int y=0;y<g.GSY;y++){
                   if(e.x>=g.Tiles[y+(x*g.GSX)].x && e.x<=g.Tiles[y+(x*g.GSX)].x+g.Tiles[y+(x*g.GSX)].w){
                        if(e.y>=g.Tiles[y+(x*g.GSX)].y && e.y<=g.Tiles[y+(x*g.GSX)].y+g.Tiles[y+(x*g.GSX)].h){
                             e.CT = y + (x*g.GSX);
                        }
                   }
              }
         }
         if(e.x>g.Tiles[e.CT].x+g.Tiles[e.CT].w/2-e.speed && e.x<g.Tiles[e.CT].x+g.Tiles[e.CT].w/2+e.speed){
              if(e.y>g.Tiles[e.CT].y+g.Tiles[e.CT].h/2-e.speed && e.y<g.Tiles[e.CT].y+g.Tiles[e.CT].h/2+e.speed){
                   if(e.CT==g.ET){
                        CurrentWave++;
                        
    Spoiler for working way:
    e.image = EnemyImages[CurrentWave]; e.x = g.Tiles[g.ST].x+g.Tiles[g.ST].w/2; e.y = g.Tiles[g.ST].y+g.Tiles[g.ST].h/2; if(g.Tiles[g.ST].dir==0){ e.angle=180; }else if(g.Tiles[g.ST].dir==1){ e.angle=90; }else if(g.Tiles[g.ST].dir==2){ e.angle=270; }else if(g.Tiles[g.ST].dir==3){ e.angle=0; } e.CT = g.ST; e.speed=2; e.health=10;
    Spoiler for not working way:
    e = SetupEnemy(g);
    } if(g.Tiles[e.CT].dir==0){ e.angle=180; }else if(g.Tiles[e.CT].dir==1){ e.angle=90; }else if(g.Tiles[e.CT].dir==2){ e.angle=270; }else if(g.Tiles[e.CT].dir==3){ e.angle=0; } } } return e; }


    now than inside the second function you can see the working way...and the non working way, as you can clearly see the working way contains the exact same code as the function it is calling in the non working way

    as many of you well probably say:

    hey your re-declaring the same variables
    however i changed the variable names in the function as a test and it still crashes when that function is called and idk y so can someone help?
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  22. #8212
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Is it possible to load an EBOOT with sceKernelLoadModule or another like function? Or, how could I strip the prx/elf from the EBOOT? I don't want to be loading the EBOOT with loadExec calls as that resets the rest of the system.

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

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

  23. #8213
    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 slicer4ever
    k i have a problem with 2 functions that i can't seem to fix:
    Put up the code for both Grid struct and Enemy struct. I would like to see what member variables in both structs.

    Edit: Do you get a stack overflow exception?

  24. #8214
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    no i don't get a stck overflow exception

    structures:
    Code:
    typedef struct{
         OSL_IMAGE *image;
         float x;
         float y;
         int CT;
         int angle;
         int speed;
         int health;
    }Enemy;
    
    
    typedef struct {
         Tile Tiles[30*30];
         int ST;
         int ET;
         int GSX;
         int GSY;
    }Grid;
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

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

    What is in the Tile struct?

    Try this function:
    Code:
    Enemy SetupEnemy( const Grid * pGrid ){
         Enemy e;
         e.image = EnemyImages[CurrentWave];
         e.x = pGrid->Tiles[pGrid->ST].x+pGrid->Tiles[pGrid->ST].w/2;
         e.y = pGrid->Tiles[pGrid->ST].y+pGrid->Tiles[pGrid->ST].h/2;
         if(pGrid->Tiles[pGrid->ST].dir==0){
              e.angle=180;
         }else if(pGrid->Tiles[pGrid->ST].dir==1){
              e.angle=90;
         }else if(pGrid->Tiles[pGrid->ST].dir==2){
              e.angle=270;
         }else if(pGrid->Tiles[pGrid->ST].dir==3){
              e.angle=0;
         }
         e.CT = pGrid->ST;
         e.speed=2;
         e.health=10;
         return e;
    }
    Calling it with:
    Code:
     e = SetupEnemy(&g);
    Edit: You are using straight C and not C++ right?

  26. #8216
    QJ Gamer Gold
    Points: 13.727, Level: 76
    Level completed: 20%, Points required for next Level: 323
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    1.493
    Points
    13.727
    Level
    76
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Auraomega
    Is it possible to load an EBOOT with sceKernelLoadModule or another like function? Or, how could I strip the prx/elf from the EBOOT? I don't want to be loading the EBOOT with loadExec calls as that resets the rest of the system.

    -Aura
    Well, you could load the ELF inside a 64-alligned buffer and use sceKernelLoadModuleBuffer ;)
    sceIoLseek to 0x20 inside the PBP, and you'll find the offset of the ELF inside there as little endian. For example, if it says 56 06 00 00, take a look at 0x00000656. Now look at 0x24 for the next part of the PBP, aka the end of the ELF :)
    And there you have it, the ELF, load it into a 64-alligned buffer and use sceKernelLoadModuleBuffer and start it ;)
    Will be quite tricky to put that into reality in C code though
    Geändert von JumpR (03-18-2008 um 02:26 PM Uhr)

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

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

    Standard

    Alright, I have a quick question regarding plug-ins, what type of setup would I need to start writing some?
    [QUOTE=Archaemic]
    [size=1]My manwich![/size][/QUOTE]
    [QUOTE=mohaas05]lol i can't say d*ck?[/QUOTE]

  28. #8218
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von yaustar
    What is in the Tile struct?

    Try this function:
    Code:
    Enemy SetupEnemy( const Grid * pGrid ){
         Enemy e;
         e.image = EnemyImages[CurrentWave];
         e.x = pGrid->Tiles[pGrid->ST].x+pGrid->Tiles[pGrid->ST].w/2;
         e.y = pGrid->Tiles[pGrid->ST].y+pGrid->Tiles[pGrid->ST].h/2;
         if(pGrid->Tiles[pGrid->ST].dir==0){
              e.angle=180;
         }else if(pGrid->Tiles[pGrid->ST].dir==1){
              e.angle=90;
         }else if(pGrid->Tiles[pGrid->ST].dir==2){
              e.angle=270;
         }else if(pGrid->Tiles[pGrid->ST].dir==3){
              e.angle=0;
         }
         e.CT = pGrid->ST;
         e.speed=2;
         e.health=10;
         return e;
    }
    Calling it with:
    Code:
     e = SetupEnemy(&g);
    Edit: You are using straight C and not C++ right?
    i'm using c++ but no more worries i'm using an alternative method
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  29. #8219
    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 slicer4ever
    i'm using c++ but no more worries i'm using an alternative method
    Then please use classes and member functions. At the moment, all the code you have shown so far is C.

  30. #8220
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    bleh classes i prefer structures atm
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been


 

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 .