Seite 91 von 340 ErsteErste ... 41 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 141 191 ... LetzteLetzte
Zeige Ergebnis 2.701 bis 2.730 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; For returning alpha value, I'd do: Code: function RGBA(r,g,b,a) return a*(65535*256) + r*65536 + g*256 + b end Im going ...

  
  1. #2701
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    For returning alpha value, I'd do:
    Code:
    function RGBA(r,g,b,a) return a*(65535*256) + r*65536 + g*256 + b end
    Im going to give it a shot, but not using Lua, rather Visual Basic. Ill port it to work with my particle engine i have built for visual basic. I made a nice fireworks show ;) Really wow'd my teacher...

    Off Topic: A college counsler lady for people to help finding colleges came up to me the other day, and she asked me some questions and whatnot, and after I said I was a freshmen and had already finished all 3 courses in just my first semester, she said that with my current knowledge, and my age -> knowledge ratio, no college wouldnt want me... I guess that means with my age, given the rest of my high school years and whatnot, I should have gained enough experience, and knowledge of hte programming concept and possibly game programming theory, I can earn a scholarship... I can say I have a fairly firm grasp on both of them, but definatly has room for improvment... Tomorow my teacher is going to sit down with me and wants me to walk him through my particle engine, since in Visual Basic, he doesnt really see any thing close to it (it's more of an application creator, what with buttons, links, horribly structured picture boxes, horrible transparency, etc.).

    Raphael - Should I go talk to my counselor about the matter above? My mom says I should, that way I can get enrolled in a scholarship program, or atleast get started looking at colleges... But, I think Ive read somewhere before that you have somewhat followed this path im on, or atleast I know enough about you to respect and believe you wouldnt send me off in the wrong direction... (you wouldnt would you? I know you hate me... but i have a pretty big decisiion here )



    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  2. #2702
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    How do i load a jpeg image as a background?
    I have installed jpeglib, Is their a certain function i need?

  3. #2703
    QJ Gamer Bronze
    Points: 5.830, Level: 49
    Level completed: 40%, Points required for next Level: 120
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Beiträge
    149
    Points
    5.830
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    this has been a live for over 1 year!!
    go here to make money online http://how2makemoney.weebly.com/

  4. #2704
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von OWNED
    this has been a live for over 1 year!!
    This post is not needed in this thread. Spam.

  5. #2705
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    I am the original creator as well ;) I like this thread as it tells me exactly WHEN i started learning C. Just one week before this thread was started ;)

    Shroom - No, there is no predefined method to display jpegs using hte graphics library. Using the graphics librar,y your just loading a PNG image onto a quad as a texture, same goes forjpegs, so either transfer to using the main GU as yourgraphics API, or use Lua I guess... Or write your own data loading function for usage within the graphics library (shouldnt be too hard, i suggest this one). Also, please correct me if im wrong on graphics library and no jpeg support, since hte last time i used the graphics library was last summer. (I ditched it at the start of school, or around there, for PSPGL)

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


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

    Zitat Zitat von Anti-QJ
    How do i load a jpeg image as a background?
    I have installed jpeglib, Is their a certain function i need?
    If you have been using the graphic.c/.h from Yeldarb's tutorials, then download the latest Lua Player source (0.20) and use the graphics.cpp/.h from that (there's nothing really C++ specific in it so it shouldn't be hard to convert to straight C).

    The graphics.c/.h from Yeldarb tutorial's is from an older version of Lua Player, the current version support JPEG.

    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. #2707
    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 use I/O i normal work with arrays , but now I aint , i dont know what to do:s

    source
    Code:
    int getpsar(PBP_HEADER *tmp)
    {
    
      u32 filesize=0;
      FILE *in;
      FILE *out;
      int bytesRead;
      in = fopen("ms0:/eboot.pbp", "r");
      printf("Extracting PSAR....!\n");
      filesize = fseek(in,SEEK_END , 0);
      
      fseek(in, SEEK_SET, tmp->psar);
      out = fopen("ms0:/data.psar", "r+");
      fwrite(in, ?, ?, out);
      
      printf("Done!\n");
      fclose(in);
      return (filesize-tmp->psar);
    }
    
    int main(void)
    {
        PBP_HEADER foo;
        pspDebugScreenInit();
        getpsar(&foo);
        return 0;
    }
    normal
    char wat[200];

    fwrite(wat ,sizeof(wat[0]) , sizeof(wat)/sizeof(wat[0]) , dst);


    but now it isnt an array , i am confused , btw it's for extracting an psar out an eboot , the functions I use are correct , they come out the devhook 2.8-3.0 installer:)

  8. #2708
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    hey guys, i have a question. i just started doing C after a long time. It seems much easier than lua for me for some reason. Anyways, i finished up the first 4 tutorials in psp-programming (took around an hour). if i have a question, i will come here. this is a great thread! thanks.
    Geändert von SuperBatXS (02-10-2007 um 02:52 PM Uhr)
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

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

    Off Topic: A college counsler lady for people to help finding colleges came up to me the other day, and she asked me some questions and whatnot, and after I said I was a freshmen and had already finished all 3 courses in just my first semester, she said that with my current knowledge, and my age -> knowledge ratio, no college wouldnt want me... I guess that means with my age, given the rest of my high school years and whatnot, I should have gained enough experience, and knowledge of hte programming concept and possibly game programming theory, I can earn a scholarship... I can say I have a fairly firm grasp on both of them, but definatly has room for improvment... Tomorow my teacher is going to sit down with me and wants me to walk him through my particle engine, since in Visual Basic, he doesnt really see any thing close to it (it's more of an application creator, what with buttons, links, horribly structured picture boxes, horrible transparency, etc.).
    I don't fully understand what you asking.

    Are you asking whether you should attempt to get the scholarship or should you go out and find a job?

  10. #2710
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    arg:. i have a problem. what is wrong with this simple code???

    Code:
    /*Simple Counter with Background */
    
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspkernal.h>
    #include <pspdebug.h>
    #include <pspgu.h>
    #include <png.h>
    #include <stdio.h>
    #include "graphics.h"
    #define printf pspDebugScreenPrintf
    #define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
    PSP_MODULE_INFO("Simple Counter", 0, 1, 1);
    /* Callback */
    int exit_callback(int arg1, int arg2, void *common) {
              sceKernelExitGame();
              return 0;
    }
    int CallbackThread(SceSize args, void *argp) {
              int cbid;
              cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
              sceKernelRegisterExitCallback(cbid);
              sceKernelSleepThreadCB();
              return 0;
    }
    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 main() {
        char buffer[200];
        Image* black;
        pspDebugScreenInit();
        SetupCallbacks();
        initGraphics;
        int counter = 0;
        int i = 0;
        SceCtrlData pad;
        sprintf(buffer, "black.png");
        black = loadImage(buffer);
        if (!black) {
                    printf("Image load failed\n");
        } else {
                    printf("Press [X] to Start the Timer");
                    int x = 0;
                    int y = 0;
                    sceDisplayWaitVblankStart();
                    while (x < 480) {
                    while (y < 272) {
                    blitAlphaImageToScreen(0, 0, 480, 272, black, x, y);
                    y += 272;
                    }
                    x += 480;
                    y = 0
                    }
                    flipScreen();
        }
        while(1) {
                 sceCtrlReadBufferPositive(&pad, 1);
                 if(pad.Buttons & PSP_CTRL_CROSS) {
                                break;
                 }
        }
        while(1) {
                 sceCtrlReadBufferPositive(&pad, 1);
                 if(pad.Buttons & PSP_CTRL_CIRCLE) {
                                break;
                 }
        }
        pspDebugScreenClear();
        printf("Press [O] To Stop Timer/n");
        printf("Counter: %i", counter);
        counter++;
                  for(i=0; i<5; i++) {
                           sceDisplayWaitVblankStart();
                           }
        }
        printf("Counter finished.");
        printf("Final Count: %i", counter);
    }        
    sceKernalSleepThread();
    return 0;
    }
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  11. #2711
    QJ Gamer Green
    Points: 9.253, Level: 64
    Level completed: 68%, Points required for next Level: 97
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Australia - A.C.T.
    Beiträge
    1.517
    Points
    9.253
    Level
    64
    Downloads
    0
    Uploads
    0

    Standard

    i'm after three little bits off code; restart, turn off, standby.
    thx mafia1ft
    Geändert von mafia1ft (02-10-2007 um 09:02 PM Uhr)

  12. #2712
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    arg:. i have a problem. what is wrong with this simple code???
    Nothing, unless you tell us what you were expecting or what errors you got from the compiler.

    Oh, well, there IS something wrong:
    Code:
    sceKernalSleepThread();
    it's KernEl, not Kernal.
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  13. #2713
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    super - You lied about being better with C than Lua... you said you have prior experience with programming in C for hte PSP, yet what your showing me here is that you have little clue... You shouldnt copy and paste ya know ;) You dont learn anything, and it gives your problems, such as what your having here. I hope you know that the debug console's font DOESNT have a transparent background, rather a black one. As for your problem, what is your problem? Compilation error? Or app error itself... I can tell you right now that the nested while loops are useless as they dont accomplish anything better than a single blitting call..

    Also everyone... I have my PSP now It came as a 2.71 TA-082 unfortunatly, but i downgraded to 1.5 and now am living hte 3.10 OE-A world

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  14. #2714
    QJ Gamer Blue
    Points: 4.580, Level: 43
    Level completed: 15%, Points required for next Level: 170
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    145
    Points
    4.580
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    Whats the command line in C++ to turn on/off USB mode for PSP?

  15. #2715
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    super - You lied about being better with C than Lua... you said you have prior experience with programming in C for the PSP, yet what your showing me here is that you have little clue... You shouldnt copy and paste ya know ;) You dont learn anything, and it gives your problems, such as what your having here. I hope you know that the debug console's font DOESNT have a transparent background, rather a black one. As for your problem, what is your problem? Compilation error? Or app error itself... I can tell you right now that the nested while loops are useless as they dont accomplish anything better than a single blitting call..

    Also everyone... I have my PSP now It came as a 2.71 TA-082 unfortunatly, but i downgraded to 1.5 and now am living hte 3.10 OE-A world
    nope. i disagree. i didn't lie about programming in C "for the psp", because i never did C "for the psp". I did do C "for the pc" though a long time ago. Also, i don't know any C classes that teach C "for the psp". Now, about me lieing about not knowing C, that is indeed false. Also, stop trying your best to condemn and criticize or getting my hopes down by using various methods. I could show and give out many times you criticize me the past couple of days (i still don't know why; maybe because someone gossiped about me?). Anyways, i understand the various problems i had before. Don't worry about the problem i had earlier because i just figured it out. If i have more problems, then i will come again.
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  16. #2716
    QJ Gamer Green
    Points: 5.712, Level: 48
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    USA SC/NC
    Beiträge
    699
    Points
    5.712
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Gonrai
    Whats the command line in C++ to turn on/off USB mode for PSP?
    Its in the samples that come with the psptoolchain

    C:\cygwin\usr\local\pspde v\psp\sdk\samples\usb\sto rage

    Its quicker to go there than to use the below copy and paste from main.c from the SDK
    Spoiler for here:
    Spoiler for jk lol:
    Spoiler for 1 more:
    Spoiler for teh mouse goes click:
    Spoiler for lol click:
    Spoiler for click me:
    Spoiler for click again:
    Spoiler for click:
    Code:
    /*
     * PSP Software Development Kit - http://www.pspdev.org
     * -----------------------------------------------------------------------
     * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
     *
     * main.c - Sample to demonstrate USB Mass Storage functionality
     *
     * Copyright (c) 2005 John Kelley <[email protected]>
     *
     * Derived from code written by PspPet
     * Code flow and API usage from VSH module "sysconf_plugin.prx"
     *
     * $Id: main.c 1882 2006-04-24 00:25:11Z jim $
     */
    #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  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;
    }
    [CODE]Random Facts:
    irc://irc.malloc.us #wtf #**********
    [/CODE]

    [SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]

  17. #2717
    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

    an eboot is build like this
    Code:
    typedef struct
    {
        char header[4];
        char id[4];
        u32 off_sfo;
        u32 off_icon0;
        u32 off_icon1;
        u32 off_unknown;
        u32 off_pic1;
        u32 off_snd0;
        u32 psp;
        u32 psar;
    }PBP_HEADER;
    But how do you found out wich files there are in
    (for example an update eboot doesnt have an AT3)

    I tried
    if(ptm->off_snd0!=NULL)
    {
    }


    but dindt work
    Geändert von hallo007 (02-11-2007 um 09:22 AM Uhr)

  18. #2718
    Developer
    Points: 14.558, Level: 78
    Level completed: 27%, Points required for next Level: 292
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    166
    Points
    14.558
    Level
    78
    Downloads
    0
    Uploads
    0

    Standard

    Just jump to the offset, and check the file type identification cookie

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

    Code:
      char *checkextension;
      
      int size=0;
      SceUID in;
      in = sceIoOpen(wat, PSP_O_RDONLY, 0777);//open de geselecteerde file
      filesize = sceIoLseek(in, 0, SEEK_END);  //bereken de grootte van de eboot  
      printf("Opening EBOOT....size: %d kb\n" ,filesize/1024);
      
      sceIoLseek(in, tmp->psar, SEEK_SET); //zoeken naar data.spar in eboot 
      sceIoRead(in, checkextension , 4);
     
      if(checkextension=="PSAR")//als er een dat.spar is
      {
    checkextension=="PSAR" is false , while it has to be true:s
    when i printf it it printfs "PSAR\EBOOT , very strange:s

  20. #2720
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    You can't compare strings with the == operator (at least not in C). Use strcmp.
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  21. #2721
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    super - You specifically said you had made a game in C for the PSP sometime ago. You never stated C for the PC, and even still, PC programming would have taught you how loops work and basic number arithemtic. Ive been a snob latley, because ever since I talked to you that first time on MSN, you talked pretty high of yourself ("im going to optimize TP's code even more" as an example, where his code was as optimized as it could get, unless you wanted to spend all afternoon unwrapping for loops). I was ok with it, as I hadnt seen any of your code or your programming style, but soon after, you asked me many questions regarding simple things. such as "how do i store an image in a buffer?". Than, after answering quite alot of questions regarding g-pack's shell (such as "how do i make a mouse/cursor?"), you refered to me as a god, and when TP joined, he as well. Than when I had said Im ditching Lua for C now that I have my PSP back,you were saying something like how you hate lua and want to go back to C, which makes me think you think C is better than Lua and why all of a sudden would you chose to go back to C when Lua hasnt limited YOU yet, when really, its the programmer, not the language (although a good portion of it is the language). All of this has been bottling up inside me, and now its all slowly pouring out. Im not trying, nor am, a know it all, but alot of things coming from you contradicts what you've said to me on MSN and other means of communication. Im going to stop doing it now, as they are starting to come off as flames, but i dont feel any different...

    On Topic:

    Ok, Im just quickly getting back into my PSPGL phase, and to start, Ive made a PSP version of the stanford rabbit. Ive made the model into a display list, to help my framerate along, and am happy to say it runs 60 FPS, and sure enough, displays the rabbit. I have the rabbits normals applied to the vertex array, and when using them to light the rabbit, I result in a rabbit whose colors are all one shade, Rather than having a nice metalic look, I get this:

    meaning, one normal is affecting all of them (im guessing). Does anyone know what might be the problem? If you need to see some code (and no my normsl ARENT the same within the vertex array) than post so. Oh and yes, i can rotate the rabbit, and can definatly say one normal is affecting the entire model Oh and yes i have lighting enabled ;)

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  22. #2722
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Oh and yes i have lighting enabled
    But most likely wrongly. Only other chance would be that your vertex normals are really the same all over your mesh or you just didn't set smooth shading. Some insight into your code might help.
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  23. #2723
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Well, I now have a nice 3D world going, I move via /\, [], O and X, look around via Analog stick. Raphael - would you mind running my currnet build and seeing what it looks like? It has lighting, as iit lightens/darkens from different angles as it should, but not as it looks in screenshots of other versions. Also, you could tell me what you think of the control scheme, too fast, too slow, as Im always picky about my speed, so a second opinion would help alot (and your one of few, if any, 3d-intelligent people that is online right now.)

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  24. #2724
    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

    Zitat Zitat von Raphael
    You can't compare strings with the == operator (at least not in C). Use strcmp.
    THNX

    if (strcmp (szKey,szInput) != 0)

    Code:
      char *checkextension;
      
      int size=0;
      SceUID in;
      in = sceIoOpen(wat, PSP_O_RDONLY, 0777);//open de geselecteerde file
      filesize = sceIoLseek(in, 0, SEEK_END);  //bereken de grootte van de eboot  
      printf("Opening EBOOT....size: %d kb\n" ,filesize/1024);
      
      sceIoLseek(in, tmp->psar, SEEK_SET); //zoeken naar data.spar in eboot 
      sceIoRead(in, checkextension , 4);
     
      if( strcmp (checkextension,"PSAR") != 0)//als er een dat.spar is
      {
    that needs to be true :) first go to school now , i can test it in 8houres:)

  25. #2725
    QJ Gamer Bronze
    Points: 4.912, Level: 44
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    90
    Points
    4.912
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Just a tip- strcmp actually returns 0 when the two strings are the same. So it would be:

    Code:
    if( strcmp (checkextension,"PSAR") == 0)
    unless of course you meant it to do something when they aren't the same.

  26. #2726
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Is their a PSP emulator where i can test my EBOOTs instead of keep on transferring them to my PSP? I know PSPE is one but i think it uses an older version of the SDK/Toolchain.

  27. #2727
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Just to finish off strcmp's return values ;), it returns however many characters one string is, longer than the other. If they're the same length, then itll return 0, as strlen(str1)-strlen(str2) = 0 when they're both the same..

    Raphael - Ive ditched the bunny, it was just to refersh my memory on how display lists work. Now, Ive got the mechanics of a good 3D maze game, well... good anything really, it could be applied to a FPS, but im not that far yet and dont want to be overwhlemed :o (i can walk around, strafe, and look around via analog stick). Now, Ive created a neat little sky box function, which asks for where you want it. and autmatically centers it so I could, in theory, have the sky box 'follow' my camera. Itd look pretty bad, but itd be pretty neat to try out. Anyways, my sky box works, and works dandy i might add, but it has some nasty culling Im thinking of a way to project the sky box images, onto smalelr quads, so only the small quads are culled when 3 of their verticies arent on-screen, and if i make each one less than 1 pixel in size, it shouldnt even be visible, the culing.,.. What do you say to this idea? Any better ideas? If not, know a way to do as ive said? I have ONE theory i could try, but if it doesnt work im stuck So hopefully you can help before hand.
    -= Double Post =-
    here's some screens:

    Without culling (i had to manuever around to a corner to get a nice view without culling)


    With culling:



    The white creases you see, can easily be fixed by simple addition to width and height within the function itself, so dont worry about it if you were
    Geändert von SG57 (02-11-2007 um 11:37 PM Uhr) Grund: Automerged Doublepost

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  28. #2728
    QJ Gamer Blue
    Points: 3.642, Level: 37
    Level completed: 95%, Points required for next Level: 8
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    99
    Points
    3.642
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    Just to finish off strcmp's return values ;), it returns however many characters one string is, longer than the other. If they're the same length, then itll return 0, as strlen(str1)-strlen(str2) = 0 when they're both the same..

    Raphael - Ive ditched the bunny, it was just to refersh my memory on how display lists work. Now, Ive got the mechanics of a good 3D maze game, well... good anything really, it could be applied to a FPS, but im not that far yet and dont want to be overwhlemed :o (i can walk around, strafe, and look around via analog stick). Now, Ive created a neat little sky box function, which asks for where you want it. and autmatically centers it so I could, in theory, have the sky box 'follow' my camera. Itd look pretty bad, but itd be pretty neat to try out. Anyways, my sky box works, and works dandy i might add, but it has some nasty culling Im thinking of a way to project the sky box images, onto smalelr quads, so only the small quads are culled when 3 of their verticies arent on-screen, and if i make each one less than 1 pixel in size, it shouldnt even be visible, the culing.,.. What do you say to this idea? Any better ideas? If not, know a way to do as ive said? I have ONE theory i could try, but if it doesnt work im stuck So hopefully you can help before hand.
    -= Double Post =-
    here's some screens:

    Without culling (i had to manuever around to a corner to get a nice view without culling)


    With culling:



    The white creases you see, can easily be fixed by simple addition to width and height within the function itself, so dont worry about it if you were
    Wow, nice gfx. I looked at the first post and saw that you posted this thread. You must be very famous for it. Anyways, let me introduce myself guys, i am Xylem (i would not like to give out my real name). I signed up at QJ around 15 minutes ago, but i have coming here often to the front page and downloading things from the download section. However, i just learned today that there are forums here, so i obviously signed up! Another thing, i am a newbie in C programming, and i would like to program in lua or C for the psp. If i have any questions, i will come here to post them (hopefully you guys don't mind answering questions). Also, i searched for quite a while and learned at lua programming is easier than C, but C has more capability. I would rather like to learn C first though, and i think you guys will like having me here (hopefully!).

  29. #2729
    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

    Zitat Zitat von SG57
    Lots of text
    Use smaller triangles and more of them. Also increasing your near plane value will help the triangles to not get clipped.

    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

  30. #2730
    Developer
    Points: 12.154, Level: 72
    Level completed: 26%, Points required for next Level: 296
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Dubuque
    Beiträge
    423
    Points
    12.154
    Level
    72
    My Mood
    Lurking
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von Anti-QJ
    Is their a PSP emulator where i can test my EBOOTs instead of keep on transferring them to my PSP? I know PSPE is one but i think it uses an older version of the SDK/Toolchain.
    Anti-QJ, use psplink. It's not an emulator but you can use it to load your programs on your psp from your pc's terminal window via USB or wifi no copying over to the psp necessary.

    Code:
    svn co svn://svn.ps2dev.org/psp/trunk/psplink
    PSP Demo Videos (updated 11/29/08)
    MinerPSP Coder


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 09:14 PM Uhr.

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