Seite 33 von 340 ErsteErste ... 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 83 133 ... LetzteLetzte
Zeige Ergebnis 961 bis 990 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 PSP-Maniac does anyone now a good tut for making games on a windows PC someone?? Why did you ...

  
  1. #961
    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 PSP-Maniac
    does anyone now a good tut for making games on a windows PC

    someone??
    Why did you post this in a PSP C/C++ thread? If I were you I'd go to a C/C++ game programming forum and ask there.




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

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

    i need help. i tried a new lib, and it screwed up my makefile. now im trying to revert back to my original lib. and im there except for one thing. when i complie, it gives this error:
    Code:
    /tmp/pspdev/pspsdk/src/gum/pspgum.c:463: undefined reference to 'cosf'
    /tmp/pspdev/pspsdk/src/gum/pspgum.c:463: undefined reference to 'sinf'
    this is weird cause its referring to the ACTUAL library. and ive been using it for all this time with no errors. heres my makefile:

    Code:
    TARGET = aso
    OBJS = main.o 
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    PSPBIN = $(PSPSDK)/../bin
    LIBS += -lm -lc -lpsputility -lpspdebug -lpspgu -lpspgum -lmad -lpspaudiolib -lpspaudio -lpspdisplay -lpspctrl -lpspsdk -lpspvfpu -lpsplibc -lpspuser -lpspkernel -lpsprtc -lpsppower -lstdc++
    
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE =Test
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak

    HELP!
    --------------------------------------------------------------------------------------

  3. #963
    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

    Did you include <math.h>?


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

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

    Looks more of a linker problem with the libs.

    Shouldn't "LIBS +=" in the makefile be "LIBS =" ?

  5. #965
    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 homer
    Did you include <math.h>?

    i did.
    --------------------------------------------------------------------------------------

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

    head_54us - I think you can do LIBS+= if you already have LIBS declared (stated or w/e) with LIBS =, than again, I know nothing of makefiles compared to others.

    And ya, you might wnat to check your ordering, its improtant. Try putting -lm in the middle, if that doesnt work, try the end, etc.

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


  7. #967
    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 SG57
    head_54us - I think you can do LIBS+= if you already have LIBS declared (stated or w/e) with LIBS =, than again, I know nothing of makefiles compared to others.

    And ya, you might wnat to check your ordering, its improtant. Try putting -lm in the middle, if that doesnt work, try the end, etc.

    taht worked! i put it after pspgum, and it worked! thx!!
    --------------------------------------------------------------------------------------

  8. #968
    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 SG57
    head_54us - I think you can do LIBS+= if you already have LIBS declared (stated or w/e) with LIBS =, than again, I know nothing of makefiles compared to others.
    So you can: http://www.netbsd.org/Documentation/.../makefile.html
    Whoops.

  9. #969
    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 SG57
    head_54us - I think you can do LIBS+= if you already have LIBS declared (stated or w/e) with LIBS =, than again, I know nothing of makefiles compared to others.

    And ya, you might wnat to check your ordering, its improtant. Try putting -lm in the middle, if that doesnt work, try the end, etc.
    I always keep -lm and -lc at the end.


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

  10. #970
    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 Transparent Text and Images

    Transparent Text and Images

    Hi,
    is there a way to specify an alpha-value for displaying text and/or images?

    Thanks in advance
    Luke

  11. #971
    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 am porting my calculator to psp and started with the menu
    Code:
    #include <math.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <math.h>
    PSP_MODULE_INFO("Hello World", 250, 1, 1);
    #define printf pspDebugScreenPrintf
    
    /* 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;
    }
    
    
    double sqrt (double x);
    
    void vermenigvuldigen ();
    void optellen  ();
    void aftrekken () ;
    void delen ();
    void kwadrateren ();
    void vierkantswortel ();
    void credits ();
    
    void sluiten();
    
    
    
    int main (void) 
    {
    pspDebugScreenInit();
    SetupCallbacks();
    
        
    printf( " ______   _______   _        ______      \n");  
    printf( "|  ____| |  ___  | | |      |  ____|  \n");
    printf( "| |      |  | |  | | |      | |      \n");
    printf( "| |____  |  ---  | | |____  | |____ \n");
    printf( "|______| |__| |__| |______| |______| v0.04 Beta \n");
        int input;
         
       printf("1. Vermenigvuldig\n");
        printf("2. delen\n");
        printf("3. optellen\n");
        printf("4. aftrekken\n");
        printf("5. kwadrateren\n");
        printf("6. Vierkantswortel\n");
        printf("7. Credits , historie en To-Do\n");
        printf("8. sluiten\n");
        
        printf("selecteer:", input);
        
        switch (input) {
               case 1:
                   system("cls"); 
                
               
                    
               case 2 : 
               system("cls");          
               
               case 3 :
                system("cls");    
                
               case 4 :
                  system("cls"); 
                    
               case 5 :
               system("cls"); 
                    
             case 6 :
              system("cls");
                     
              case 7 :
              system("cls");
                  
                         
               case 8 :
              system("cls"); 
                    
                    break;     
               default:
                    system("cls");    
                    printf("error , slechte selectie , probeer opnieuw\n");
                    main();
    sceKernelSleepThread();
    return 0;
    
    }   
    }

    and i get this error
    Code:
    $ make
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o main.o mai
    n.c
    main.c: In function 'main':
    main.c:77: warning: too many arguments for format
    main.c:81: warning: implicit declaration of function 'system'
    main.c:77: warning: 'input' is used uninitialized in this function
    main.c:116: warning: control reaches end of non-void function
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -L/usr/local/
    pspdev/psp/sdk/lib   main.o -lpspgu -lpng -lz -lm -lpspdebug -lpspdisplay -lpspg
    e -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver
     -lpsputility -lpspuser -lpspkernel -o cpu
    psp-fixup-imports cpu
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -L/usr/local/
    pspdev/psp/sdk/lib   main.o -lpspgu -lpng -lz -lm -lpspdebug -lpspdisplay -lpspg
    e -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver
     -lpsputility -lpspuser -lpspkernel -o tester.elf
    psp-fixup-imports tester.elf
    mksfo 'Image Example' PARAM.SFO
    psp-strip cpu tester.elf -o cpu tester_strip.elf
    Usage: psp-strip <option(s)> in-file(s)
     Removes symbols and sections from files
     The options are:
      -I --input-target=<bfdname>      Assume input file is in format <bfdname>
      -O --output-target=<bfdname>     Create an output file in format <bfdname>
      -F --target=<bfdname>            Set both input and output format to <bfdname>
    
      -p --preserve-dates              Copy modified/access timestamps to the output
    
      -R --remove-section=<name>       Remove section <name> from the output
      -s --strip-all                   Remove all symbol and relocation information
      -g -S -d --strip-debug           Remove all debugging symbols & sections
         --strip-unneeded              Remove all symbols not needed by relocations
         --only-keep-debug             Strip everything but the debug information
      -N --strip-symbol=<name>         Do not copy symbol <name>
      -K --keep-symbol=<name>          Only copy symbol <name>
      -w --wildcard                    Permit wildcard in symbol comparison
      -x --discard-all                 Remove all non-global symbols
      -X --discard-locals              Remove any compiler-generated symbols
      -v --verbose                     List all object files modified
      -V --version                     Display this program's version number
      -h --help                        Display this output
         --info                        List object formats & architectures supported
    
      -o <file>                        Place stripped output into <file>
    psp-strip: supported targets: elf32-littlemips elf32-bigmips elf64-bigmips elf64
    -littlemips elf64-little elf64-big elf32-little elf32-big srec symbolsrec tekhex
     binary ihex
    make: *** [EBOOT.PBP] Error 1
    Geändert von hallo007 (09-24-2006 um 03:07 AM Uhr)

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

    Not related to your problem but using "cls" command in the system function is pretty much DOS specific and should not be used at all.

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

    Sorry for the doublepost, but I think that old post won't be found by anyone

    Transparent Text and Images

    Hi,
    is there a way to specify an alpha-value for displaying text and/or images?

    Thanks in advance
    Luke

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

    Well, I use this to set the alpha value of images:
    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.

  15. #975
    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:
    #include <math.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <math.h>
    PSP_MODULE_INFO("Hello World", 250, 1, 1);
    #define printf pspDebugScreenPrintf
    
    /* 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;
    }
    
    
    double sqrt (double x);
    
    void vermenigvuldigen ();
    void optellen  ();
    void aftrekken () ;
    void delen ();
    void kwadrateren ();
    void vierkantswortel ();
    void credits ();
    
    void sluiten();
    
    
    
    int main (void) 
    {
    pspDebugScreenInit();
    SetupCallbacks();
    
        
    printf( " ______   _______   _        ______      \n");  
    printf( "|  ____| |  ___  | | |      |  ____|  \n");
    printf( "| |      |  | |  | | |      | |      \n");
    printf( "| |____  |  ---  | | |____  | |____ \n");
    printf( "|______| |__| |__| |______| |______| v0.04 Beta \n");
        int input;
         
       printf("1. Vermenigvuldig\n");
        printf("2. delen\n");
        printf("3. optellen\n");
        printf("4. aftrekken\n");
        printf("5. kwadrateren\n");
        printf("6. Vierkantswortel\n");
        printf("7. Credits , historie en To-Do\n");
        printf("8. sluiten\n");
        
        printf("selecteer:", input);
        
        switch (input) {
               case 1:
               printf("test");          
                    
               case 2 : 
               printf("test");         
               
               case 3 :
               printf("test");  
                
               case 4 :
              printf("test"); 
                    
               case 5 :
              printf("test"); 
                    
             case 6 :
             printf("test");
                     
              case 7 :
             printf("test");
                  
                         
               case 8 :
             printf("test"); 
                    
                    break;     
               default:
                    printf("test\n");   
                    printf("error , slechte selectie , probeer opnieuw\n");
                    main();
    sceKernelSleepThread();
    return 0;
    
    }   
    }

    no errors , but when i start it on psp it's shows the text for 1/10 sec and then i get black screen
    when i want to go back to xmb my psp crashes, why?
    -= Double Post =-
    and where can i found a sample keyboard in c/c++ , i only found them in LUA
    Geändert von hallo007 (09-24-2006 um 06:07 AM Uhr) Grund: Automerged Doublepost

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

    I have this code:

    Code:
    int *CarPointerPos = (int*) 0x08b5e114;
    short *CurCarCol;
    char *CurCarType;
    
    *CurCarCol = (short*) CarPointerPos+0x1f0;
    *CurCarType = (char*) CarPointerPos+0x58;
                         if(*CurCarCol == 0x746F && *CurCarType == 133) {
                                       //some code
                                       }
    and get these warnings,
    main.c:126: warning: assignment makes integer from pointer without a cast
    main.c:127: warning: assignment makes integer from pointer without a cast
    main.c:128: warning: comparison is always false due to limited range of data type
    main.c:126: warning: 'CurCarCol' is used uninitialized in this function
    main.c:127: warning: 'CurCarType' is used uninitialized in this function

    what am I doing wrong? :/


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

    int curcartype;
    int curcarcol;

    i think
    -= Double Post =-
    but normal warnings arent problems , you can make the eboot perfectly
    but mayby when in game it will give some bugs
    Geändert von hallo007 (09-24-2006 um 08:23 AM Uhr) Grund: Automerged Doublepost

  18. #978
    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 hallo007
    int curcartype;
    int curcarcol;

    i think
    -= Double Post =-
    but normal warnings arent problems , you can make the eboot perfectly
    but mayby when in game it will give some bugs
    if I remove the * it won't be a pointer any more And they are supposed to be a short and a char, that's what they are in memory.
    and the warning 'main.c:128: warning: comparison is always false due to limited range of data type' I think means that the if statement never returns true so the code inside it will never be ran..

    and it's a prx btw.


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

    o prx , i know nothing about that;)
    -= Double Post =-
    where can i find a exemple for a keyboard?
    -= Double Post =-
    but did you try it like this

    int *CarPointerPos = (int*) 0x08b5e114;
    short *CurCarCol;
    char *CurCarType;

    int *CurCarCol = (short*) CarPointerPos+0x1f0;
    int *CurCarType = (char*) CarPointerPos+0x58;
    if(*CurCarCol == 0x746F && *CurCarType == 133) {
    //some code
    }



    then are it still pointers
    Geändert von hallo007 (09-24-2006 um 09:13 AM Uhr) Grund: Automerged Doublepost

  20. #980
    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

    I suggest going back and read up on pointers since from that code, you don't fully understand the use of *.

    I can't even tell what you are trying to do. Are you trying to point to a specific memory address? Or are you trying to pass actual values? Are the hex values (0xXXXXX) represent values or memory addresses?

  21. #981
    QJ Gamer Green
    Points: 13.013, Level: 74
    Level completed: 41%, Points required for next Level: 237
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Beiträge
    0
    Points
    13.013
    Level
    74
    Downloads
    0
    Uploads
    0

    Standard

    Ok, so im a complete n00b to c++ programming, and I just installed visual c++ express edition. I made a new source file, which is a simple hello world program. I was trying to add the iostream header file to the header folder, and when I compile it, it tells me that there is no such thing as this header file.

  22. #982
    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 head_54us
    I suggest going back and read up on pointers since from that code, you don't fully understand the use of *.

    I can't even tell what you are trying to do. Are you trying to point to a specific memory address? Or are you trying to pass actual values?
    I'll try and explain what I'm trying to do.

    first I want to get the value of the memory address 0x08b5e114

    so I do

    int *CarPointerPos = (int*) 0x08b5e114;

    then 0x08b5e114 is a pointer (so the value it contains is another memory address).

    and I want edit 2 memory addresses according to what 0x08b5e114 is.
    so if forexample 0x08b5e114 stores the value 0x08e41210 then I would want to read the value of 0x08e41200 and 0x08e41268.

    Hope that's understandable (I'm not very good at explaining :/ ).
    Any help would be appriciated.


  23. #983
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    // If 0x08b5e114 is a memory address then this is all you need to do.
    int *CarPointerPos = 0x08b5e114;
    
    // Always NULL pointers if they are not given a value on creation
    // This saves ALOT of trouble during debugging
    short *CurCarCol = NULL;
    char *CurCarType = NULL;
    
    // I have no clue what the hell you are trying to do from this point on.
    /*  
     What is 0x1F0? What is 0x58? A value? A memory address? 
     Are you trying to jump memory addresses?
     Why are you trying to jump memory addresses? 
     What is so special about the value/memory address of 0x1f0 or 0x58? 
     How many bits/bytes do you want to jump? 
     Do you understand pointer arithmetic?
    */
    *CurCarCol = (short*) CarPointerPos+0x1f0;
    *CurCarType = (char*) CarPointerPos+0x58;
    if(*CurCarCol == 0x746F && *CurCarType == 133) 
    {
    	//some code
    }
    skfhaklsfhaklsfhsafashfls af
    -= Double Post =-
    Zitat Zitat von Frenchb0yenius
    Ok, so im a complete n00b to c++ programming, and I just installed visual c++ express edition. I made a new source file, which is a simple hello world program. I was trying to add the iostream header file to the header folder, and when I compile it, it tells me that there is no such thing as this header file.
    Did you install the compiler? http://msdn.microsoft.com/vstudio/ex...alc/usingpsdk/

    If you just want to get an easy to use IDE and compiler, I recommend DevCpp
    Geändert von yaustar (09-24-2006 um 01:14 PM Uhr) Grund: Automerged Doublepost

  24. #984
    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 head_54us
    Code:
    // If 0x08b5e114 is a memory address then this is all you need to do.
    int *CarPointerPos = 0x08b5e114;
    
    // Always NULL pointers if they are not given a value on creation
    // This saves ALOT of trouble during debugging
    short *CurCarCol = NULL;
    char *CurCarType = NULL;
    
    // I have no clue what the hell you are trying to do from this point on.
    /*  
     What is 0x1F0? What is 0x58? A value? A memory address? 
     Are you trying to jump memory addresses?
     Why are you trying to jump memory addresses? 
     What is so special about the value/memory address of 0x1f0 or 0x58? 
     How many bits/bytes do you want to jump? 
     Do you understand pointer arithmetic?
    */
    *CurCarCol = (short*) CarPointerPos+0x1f0;
    *CurCarType = (char*) CarPointerPos+0x58;
    if(*CurCarCol == 0x746F && *CurCarType == 133) 
    {
    	//some code
    }
    skfhaklsfhaklsfhsafashfls af
    ok, I'm trying to create a simple custom mission for gta.
    the value that CarPointerPos gets points to the start of the memory for the car you are in.
    and I want to read some info about the car which is located in memory at CarPointerPos+0x1f0 and CarPointerPos+0x58. so 0x58 and 0x1f0 are how far into the car memory the info is located. so I want to read from the memory address the value of CarPointerPos is +0x58.


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

    FrenchOyenious - iostream is the standard in/out library for windows, meaning the psptoolchain shouldnt have it in there unless it was ported (?)

    hallo007 - Making a PRX has nothing to do with whether or not his pointer's are being un-initalized, or anything on that matter...

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


  26. #986
    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

    I'll try and make my question simlper. (disregard the code I posted)

    I first make CarPointerPos point to 0x08b5e114 so I can read it's value.
    int *CarPointerPos = (int*) 0x08b5e114;

    Now the int that is stored in 0x08b5e114 is a memory address. How could I get a pointer to point to the memory address that value of 0x08b5e114 is?

    here's an example picture of what the memory might look like.


    there you can see that 0x08b5e114 = 0x0998B580 (reversed order of the hex).

    so then I want the second pointer to point to the memory address 0x0998B580. How would I do that?

    I don't think I'll be able to explain it any better than this. hoping for an answer.


  27. #987
    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

    i need help. how can i save a image in C?? (like screen:save in lua) i know the function, but it wont work since im using the GU/GUM. any other way?
    --------------------------------------------------------------------------------------

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

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

    Standard

    Zitat Zitat von waterbottle
    I'll try and make my question simlper. (disregard the code I posted)

    I first make CarPointerPos point to 0x08b5e114 so I can read it's value.
    int *CarPointerPos = (int*) 0x08b5e114;

    Now the int that is stored in 0x08b5e114 is a memory address. How could I get a pointer to point to the memory address that value of 0x08b5e114 is?
    int *CarPointer = (int*)((int)*CarPointerPo s);

    should work (inner cast probably is unneccesary).

    Also, regarding something like
    *CurCarCol = (short*) CarPointerPos+0x1f0;
    *CurCarType = (char*) CarPointerPos+0x58;
    Read up on pointer arithmetic unless you already know, since (short*)x + 1 != (char*)x + 1.
    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.

  29. #989
    QJ Gamer Blue
    Points: 4.073, Level: 40
    Level completed: 62%, Points required for next Level: 77
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Canada
    Beiträge
    70
    Points
    4.073
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Grimfate I used the saveImage(); function in graphics.h it works great for my pong game. Im not sure how it will turn out when you are using GU.

  30. #990
    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 Twin891
    Grimfate I used the saveImage(); function in graphics.h it works great for my pong game. Im not sure how it will turn out when you are using GU.

    tahts why it wont work. :)
    --------------------------------------------------------------------------------------


 

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 .