Seite 307 von 340 ErsteErste ... 207 257 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 ... LetzteLetzte
Zeige Ergebnis 9.181 bis 9.210 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; You aren't linking the source file? (Adding "objlist.o" to your OBJS line, if you are using a PSP makefile.) s/objlist.o/what_ever_source_file_is_ ...

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

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

    Standard

    You aren't linking the source file? (Adding "objlist.o" to your OBJS line, if you are using a PSP makefile.)

    s/objlist.o/what_ever_source_file_is_ including_the_blitimage_f ile.o



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

    I see two prototypes for blitImage() but only one actual function.

    Where is the function that matches the prototype?

    Code:
    void blitImage(int x, int y, SDL_Surface* source, SDL_Surface* destination);

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

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

    You are using default parameters incorrectly:

    header
    Code:
    void blitImage(int x, int y, SDL_Surface* source, SDL_Surface* destination SDL_Rect* sprite = NULL);
    Source
    Code:
    void blitImage(int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* sprite)
    {
    	SDL_Rect coord;
    	
    	coord.x = x;
    	coord.y = y;
    	
    	SDL_BlitSurface(source, sprite, destination, &coord);
    }

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

    Zitat Zitat von _dysfunctional Beitrag anzeigen
    You aren't linking the source file? (Adding "objlist.o" to your OBJS line, if you are using a PSP makefile.)

    s/objlist.o/what_ever_source_file_is_ including_the_blitimage_f ile.o
    Nope, its added.


    Zitat Zitat von yaustar
    You are using default parameters incorrectly:
    No luck there either, I'm getting an ambiguity issue:
    source/objlist.cpp:23: note: candidates are: void blitImage(int, int, SDL_Surface*, SDL_Surface*)
    note: void blitImage(int, int, SDL_Surface*, SDL_Surface*, SDL_Rect*)
    I'm going to Google default parameters and hope something comes up (I'll edit the post if it does).

    -Aura

    Durrrr, brains not functioning. I had void blitImage(int x, int y, SDL_Surface* source, SDL_Surface* destination); at the top of objlist from last night when I was trying to solve the problem, this was causing the ambiguity because I forgot to remove it. All fixed and working now.
    Geändert von Auraomega (10-23-2008 um 03:28 AM Uhr)
    Last.fm | Deviant Art | First working OS picture

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

  5. #9185
    QJ Gamer Gold
    Points: 14.678, Level: 78
    Level completed: 57%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    1.523
    Points
    14.678
    Level
    78
    Downloads
    0
    Uploads
    0

    Standard

    What are the analog offsets ? LX, LY: 0 to 255. Right? 115 - 128 Center? :)
    [I wish not to code and test that out ]

    Dont you all like using webbrowser with your right thumb? ;)

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

    It's an unsigned char type, so 0 - 255 yes.

    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. #9187
    QJ Gamer Silver
    Points: 12.501, Level: 73
    Level completed: 13%, Points required for next Level: 349
    Overall activity: 62,0%

    Registriert seit
    Sep 2007
    Ort
    AUS
    Beiträge
    284
    Points
    12.501
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Hey all,
    would some one be able to give an example of the sceIoReadAsync() function from the sdk. I have been looking all over the forums and even in PPA source code. But i can't seem to get it to work.

    Regards
    Homemister
    Wyvern. That is all

  8. #9188
    QJ Gamer Bronze
    Points: 5.826, Level: 49
    Level completed: 38%, Points required for next Level: 124
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Ort
    Everywhere
    Beiträge
    206
    Points
    5.826
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Hi, this is still the latest tool chain release, right?
    http://ps2dev.org/psp/Tools/Toolchain - 06/26/2007
    Pokemon Islands in Development : Qj Forum | Google Forum | Probords Forum

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

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

    Standard

    Zitat Zitat von chrisp6825 Beitrag anzeigen
    Hi, this is still the latest tool chain release, right?
    http://ps2dev.org/psp/Tools/Toolchain - 06/26/2007
    I'm pretty sure it's the latest toolchain, but not latest sdk from the svn.

    svn co svn://svn.ps2dev.org/psp/trunk/pspsdk
    I gone and made that one power spoofer and that gay cheat device.

  10. #9190
    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

    It's not the latest toolchain.

    Check the latest version out from the SVN.

    Code:
    svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain

    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

  11. #9191
    QJ Gamer Bronze
    Points: 5.826, Level: 49
    Level completed: 38%, Points required for next Level: 124
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Ort
    Everywhere
    Beiträge
    206
    Points
    5.826
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Well.. I updated my sdk and when I was installing it, I got this..

    Spoiler for Error:


    psp-gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/libc/include -I../../src/base -I
    ../../src/kernel -I../../src/user -I../../src/debug -g -O2 -G0 -Wall -DF_glue
    _gettimeofday libcglue.c -c -o glue_gettimeofday.o
    libcglue.c:46: error: conflicting types for 'gettimeofday'
    /usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/include/sys/time.h:73: error
    : previous declaration of 'gettimeofday' was here
    make[2]: *** [glue_gettimeofday.o] Error 1
    make[2]: Leaving directory `/home/Chris/pspsdk/src/libc'
    make[1]: *** [install-recursive] Error 1
    make[1]: Leaving directory `/home/Chris/pspsdk/src'
    make: *** [install-recursive] Error 1



    And I tried searching around about it and found a post from another site where a guy had the same problem. It was pretty recent.

    Anyone have any ideas?
    Pokemon Islands in Development : Qj Forum | Google Forum | Probords Forum

  12. #9192
    Art
    Art ist offline
    Bush Programmer
    Points: 60.149, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    3.658
    Points
    60.149
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Hi Guys,
    I have two questions,
    What do the last two values represent in this:
    Code:
    PSP_MODULE_INFO("Program_Title", 0, 1, 0);
    and more importantly,
    What is the fastest way to split a short into two bytes (u8 variables).
    Cheers, Art.

  13. #9193
    Points: 2.561, Level: 30
    Level completed: 74%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    May 2008
    Beiträge
    46
    Points
    2.561
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Art Beitrag anzeigen
    Hi Guys,
    I have two questions,
    What do the last two values represent in this:
    Code:
    PSP_MODULE_INFO("Program_Title", 0, 1, 0);
    and more importantly,
    What is the fastest way to split a short into two bytes (u8 variables).
    Cheers, Art.
    IIRC they are the version number (major and minor version). Though they can be arbitrarily set (I think they are 'char's so upto 0-255 I guess) but better check the pspsdk source for the actual macro definition.

    Fastest way to split? Well the most direct way is:

    Code:
    u16 x = 0xABCD;
    u8 a = x & 0xFF; // 0xCD
    u8 b = x >> 8; // 0xAB
    u16 y = (b<<8) | a; // to get back original 0xABCD
    Alternatively you could do:

    Code:
    u16 x = 0xABCD;
    u8 a = *((u8*)&x+0); // 0xCD
    u8 b = *((u8*)&x+1); // 0xAB
    
    // or written another way
    
    a = ((u8*)&x)[0]; // 0xCD
    b = ((u8*)&x)[1]; // 0xAB
    I think this would be quicker since it would just be 2 load instructions, no other arithmetic manipulations.
    Geändert von pspersanonymous (11-11-2008 um 08:33 PM Uhr)

  14. #9194
    Art
    Art ist offline
    Bush Programmer
    Points: 60.149, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    3.658
    Points
    60.149
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Thankyou :)
    That was fast.

  15. #9195
    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

    chrisp6825: I commited a change to the SDK last night to fix the issue you mention.

    Try re-installing and it should work now.

    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

  16. #9196
    QJ Gamer Gold
    Points: 14.678, Level: 78
    Level completed: 57%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    1.523
    Points
    14.678
    Level
    78
    Downloads
    0
    Uploads
    0

    Standard

    Wouldn't this work too?

    (0xABCD & 0x00ff) -> 0xCD; (or may be 0x00CD)
    (0xABCD & 0xff00) -> 0xAB; (or may be 0xAB00)

    Zitat Zitat von pspersanonymous Beitrag anzeigen
    IIRC they are the version number (major and minor version). Though they can be arbitrarily set (I think they are 'char's so upto 0-255 I guess) but better check the pspsdk source for the actual macro definition.

    Fastest way to split? Well the most direct way is:

    Code:
    u16 x = 0xABCD;
    u8 a = x & 0xFF; // 0xCD
    u8 b = x >> 8; // 0xAB
    u16 y = (b<<8) | a; // to get back original 0xABCD
    Alternatively you could do:

    Code:
    u16 x = 0xABCD;
    u8 a = *((u8*)&x+0); // 0xCD
    u8 b = *((u8*)&x+1); // 0xAB
    
    // or written another way
    
    a = ((u8*)&x)[0]; // 0xCD
    b = ((u8*)&x)[1]; // 0xAB
    I think this would be quicker since it would just be 2 load instructions, no other arithmetic manipulations.

  17. #9197
    QJ Gamer Bronze
    Points: 5.583, Level: 48
    Level completed: 17%, Points required for next Level: 167
    Overall activity: 0%

    Registriert seit
    May 2007
    Beiträge
    127
    Points
    5.583
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von pspersanonymous Beitrag anzeigen
    Code:
    u16 x = 0xABCD;
    u8 a = *((u8*)&x+0); // 0xCD
    u8 b = *((u8*)&x+1); // 0xAB
    
    // or written another way
    
    a = ((u8*)&x)[0]; // 0xCD
    b = ((u8*)&x)[1]; // 0xAB
    Dont do this, its not portable. Byte ordering changes between platforms.

    juse use the

    Code:
    lo = x & 0xFF;
    hi = (x>>8) & 0xFF;
    method instead.
    -- Code Monkey : Sarien, Fishguts, Cracks and Crevices --

    "Did IQ's just drop sharply while I was away?" (Ripley)

  18. #9198
    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 there a data type to hold 12 digit numbers? Best thing I've come up with so far is:

    Code:
    unsigned long int part1 = 0;
    unsigned long int part2 = 0;
    
    ...
    
    if(part1 == ulMax)
    {
         part2++;
         part1 = 0;
    }
    else
    {
         part1++;
    }
    Its untidy but its only being used for a one shot application, just looking for the quickest method as its going to take a few hours to run as it is.

    -Aura

    EDIT:

    Nevermind, I found how to use the u64 data type, for anyone wondering:
    #define u64 unsigned long long int.

    EDIT 2:

    Question is still open, u64 won't allow me to place the value in that I require.
    Geändert von Auraomega (11-12-2008 um 12:50 PM Uhr)
    Last.fm | Deviant Art | First working OS picture

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

  19. #9199
    Points: 2.561, Level: 30
    Level completed: 74%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    May 2008
    Beiträge
    46
    Points
    2.561
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Mr305 Beitrag anzeigen
    Wouldn't this work too?

    (0xABCD & 0x00ff) -> 0xCD; (or may be 0x00CD)
    (0xABCD & 0xff00) -> 0xAB; (or may be 0xAB00)
    No (0xABCD & 0xff00) gives 0xAB00, if you assigned that to a char variable it would truncate to 0x00. In fact you don't really need the & 0xFF part:

    Code:
    u8 a = 0xABCD; // would just give 0xCD, but compiler probably will warn
    
    // so while this works perfectly fine:
    u16 x = 0xABCD;
    u8 a = x; // will truncate to 0xCD
    u8 b = x>>8;
    
    // it's probably better practice to do:
    u16 x = 0xABCD;
    u8 a = x & 0xFF;
    u8 b = (x>>8) & 0xFF;
    Zitat Zitat von Auraomega Beitrag anzeigen
    Is there a data type to hold 12 digit numbers? Best thing I've come up with so far is:

    Code:
    unsigned long int part1 = 0;
    unsigned long int part2 = 0;
    
    ...
    
    if(part1 == ulMax)
    {
         part2++;
         part1 = 0;
    }
    else
    {
         part1++;
    }
    Its untidy but its only being used for a one shot application, just looking for the quickest method as its going to take a few hours to run as it is.

    -Aura

    EDIT:

    Nevermind, I found how to use the u64 data type, for anyone wondering:
    #define u64 unsigned long long int.

    EDIT 2:

    Question is still open, u64 won't allow me to place the value in that I require.
    What do you mean by "12 digits" ?? 12 digits in hex or in decimal ??

    The u64 datatype is 64bits long (ie. 8 bytes long) so it stores 8 'char' values eg. 0x1122334455667788. To use 'long long' constant values you need to append 'll' to the end of the value:

    Code:
    u64 var = 0x1122334455667788ll;
    printf("%llx", var);

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

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

    Standard

    You can also do,

    char p = *(u8 *)&x;
    char q = *(u8 *)(&x + 1);

    or, you can do,

    char p = _lb(&x);
    char q = _lb(&x + 1);

  21. #9201
    Points: 2.561, Level: 30
    Level completed: 74%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    May 2008
    Beiträge
    46
    Points
    2.561
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Davee Beitrag anzeigen
    You can also do,

    char p = *(u8 *)&x;
    char q = *(u8 *)(&x + 1);

    or, you can do,

    char p = _lb(&x);
    char q = _lb(&x + 1);
    No no, that will give you invalid results. Note that's not the same thing as what I wrote (there's a slight but extremely important difference). Here's what I wrote originally in the above post:

    Code:
    u16 x = 0xABCD;
    u8 a = *((u8*)&x+0); // 0xCD
    u8 b = *((u8*)&x+1); // 0xAB
    Notice the brackets, what you wrote:

    Code:
    char q = *(u8*)(&x+1); // dangerous, this will read out of bounds
    here, x is a u16 datatype so the +1 doesnt add 1 to the address it actually adds 2, if x was an int, +1 would add 4 (or however long the datatype is on your platform).

    So if x was stored at address 0x1000, your example would read a char from 0x1002, instead of reading from 0x1001 (ignore the real-world for a moment where stack values grow down from high-to-low addresses).

    You need to watch where you put your brackets, it can make a huge difference (a matter of running correctly or crashing !!). You can try your example out, I don't think it will crash the app, but it definitely won't give you the correct result.

    The second example, well, that is dependant on, firstly, running on a MIPS platform, and secondly, having those macro's defined in your setup. In that case, better off writing in pure asm (or inline asm).
    Geändert von pspersanonymous (11-12-2008 um 07:48 PM Uhr)

  22. #9202
    QJ Gamer Bronze
    Points: 5.826, Level: 49
    Level completed: 38%, Points required for next Level: 124
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Ort
    Everywhere
    Beiträge
    206
    Points
    5.826
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Insert_Witty_Name Beitrag anzeigen
    chrisp6825: I commited a change to the SDK last night to fix the issue you mention.

    Try re-installing and it should work now.
    Sweet thanks. Ill try it out tonight.


    -=Double Post Merge =-

    Hmm, I got the error again..

    Spoiler for error:

    psp-gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/libc/include -I../../src/base -I
    ../../src/kernel -I../../src/user -I../../src/debug -g -O2 -G0 -Wall -DF_glue
    _gettimeofday libcglue.c -c -o glue_gettimeofday.o
    libcglue.c:46: error: conflicting types for 'gettimeofday'
    /usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/include/sys/time.h:73: error
    : previous declaration of 'gettimeofday' was here
    make[3]: *** [glue_gettimeofday.o] Error 1
    make[3]: Leaving directory `/home/Chris/pspsdk/src/libc'
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/home/Chris/pspsdk/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/Chris/pspsdk'
    make: *** [all] Error 2


    If you want to see my time.h file that it's saying has the previous decleration then here it is.. (this is the one at "usr\local\pspdev\psp\inc lude\sys\"
    Spoiler for time.h:

    Code:
    /* time.h -- An implementation of the standard Unix <sys/time.h> file.
       Written by Geoffrey Noer <[email protected]>
       Public domain; no rights reserved. */
    
    #ifndef _SYS_TIME_H_
    #define _SYS_TIME_H_
    
    #include <_ansi.h>
    #include <sys/types.h>
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    #ifndef _WINSOCK_H
    struct timeval {
      time_t      tv_sec;
      suseconds_t tv_usec;
    };
    
    struct timezone {
      int tz_minuteswest;
      int tz_dsttime;
    };
    
    #ifdef __CYGWIN__
    #include <cygwin/sys_time.h>
    #endif /* __CYGWIN__ */
    
    #endif /* _WINSOCK_H */
    
    #define ITIMER_REAL     0
    #define ITIMER_VIRTUAL  1
    #define ITIMER_PROF     2
    
    struct  itimerval {
      struct  timeval it_interval;
      struct  timeval it_value;
    };
    
    /* BSD time macros used by RTEMS code */
    #if defined (__rtems__) || defined (__CYGWIN__)
    
    /* Convenience macros for operations on timevals.
       NOTE: `timercmp' does not work for >= or <=.  */
    #define	timerisset(tvp)		((tvp)->tv_sec || (tvp)->tv_usec)
    #define	timerclear(tvp)		((tvp)->tv_sec = (tvp)->tv_usec = 0)
    #define	timercmp(a, b, CMP) 						      \
      (((a)->tv_sec == (b)->tv_sec) ? 					      \
       ((a)->tv_usec CMP (b)->tv_usec) : 					      \
       ((a)->tv_sec CMP (b)->tv_sec))
    #define	timeradd(a, b, result)						      \
      do {									      \
        (result)->tv_sec = (a)->tv_sec + (b)->tv_sec;			      \
        (result)->tv_usec = (a)->tv_usec + (b)->tv_usec;			      \
        if ((result)->tv_usec >= 1000000)					      \
          {									      \
    	++(result)->tv_sec;						      \
    	(result)->tv_usec -= 1000000;					      \
          }									      \
      } while (0)
    #define	timersub(a, b, result)						      \
      do {									      \
        (result)->tv_sec = (a)->tv_sec - (b)->tv_sec;			      \
        (result)->tv_usec = (a)->tv_usec - (b)->tv_usec;			      \
        if ((result)->tv_usec < 0) {					      \
          --(result)->tv_sec;						      \
          (result)->tv_usec += 1000000;					      \
        }									      \
      } while (0)
    #endif /* defined (__rtems__) || defined (__CYGWIN__) */
    
    int _EXFUN(gettimeofday, (struct timeval *__p, struct timezone *__z));
    int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *));
    int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp));
    int _EXFUN(getitimer, (int __which, struct itimerval *__value));
    int _EXFUN(setitimer, (int __which, const struct itimerval *__value,
    					struct itimerval *__ovalue));
    
    #ifdef __cplusplus
    }
    #endif
    #endif /* _SYS_TIME_H_ */



    Thanks for the help.
    Geändert von chrisp6825 (11-12-2008 um 09:54 PM Uhr) Grund: Automerged Doublepost
    Pokemon Islands in Development : Qj Forum | Google Forum | Probords Forum

  23. #9203
    QJ Gamer Bronze
    Points: 5.583, Level: 48
    Level completed: 17%, Points required for next Level: 167
    Overall activity: 0%

    Registriert seit
    May 2007
    Beiträge
    127
    Points
    5.583
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Auraomega Beitrag anzeigen
    Is there a data type to hold 12 digit numbers? Best thing I've come up with so far is:
    Nevermind, I found how to use the u64 data type, for anyone wondering:
    #define u64 unsigned long long int.
    aurgh. dont do this. this is what

    Code:
    #include <stdint.h>
    is for.

    just use uint64_t
    -- Code Monkey : Sarien, Fishguts, Cracks and Crevices --

    "Did IQ's just drop sharply while I was away?" (Ripley)

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

    chrisp6825: Try again from scratch, the full toolchain. I made another commit after that one.

    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

  25. #9205
    Points: 2.228, Level: 28
    Level completed: 52%, Points required for next Level: 72
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Nov 2008
    Beiträge
    15
    Points
    2.228
    Level
    28
    Downloads
    0
    Uploads
    0

    Standard

    Not really C++-related, but still:

    Both when using OSlib and SDL, I get massive ghosting when moving images. It's extreme, really. I'm drawing a dark green image, and moving it, and it has a black trail after it. Anyone know what's up?

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

    your not clearing the screen it sounds like, i'd suggest doing:
    Code:
    ...
    oslStartDrawing();
    oslDrawFillRect(0,0,480,272, RGBA(0,0,0,255));
    ...
    that should clear up your problem
    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

  27. #9207
    Points: 2.228, Level: 28
    Level completed: 52%, Points required for next Level: 72
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Nov 2008
    Beiträge
    15
    Points
    2.228
    Level
    28
    Downloads
    0
    Uploads
    0

    Standard

    Nope, I am clearing it. Turns out it's the crappy screen of the PSP.

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

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

    Standard

    Zitat Zitat von pspersanonymous Beitrag anzeigen
    No no, that will give you invalid results. Note that's not the same thing as what I wrote (there's a slight but extremely important difference). Here's what I wrote originally in the above post:

    Code:
    u16 x = 0xABCD;
    u8 a = *((u8*)&x+0); // 0xCD
    u8 b = *((u8*)&x+1); // 0xAB
    Notice the brackets, what you wrote:

    Code:
    char q = *(u8*)(&x+1); // dangerous, this will read out of bounds
    here, x is a u16 datatype so the +1 doesnt add 1 to the address it actually adds 2, if x was an int, +1 would add 4 (or however long the datatype is on your platform).

    So if x was stored at address 0x1000, your example would read a char from 0x1002, instead of reading from 0x1001 (ignore the real-world for a moment where stack values grow down from high-to-low addresses).

    You need to watch where you put your brackets, it can make a huge difference (a matter of running correctly or crashing !!). You can try your example out, I don't think it will crash the app, but it definitely won't give you the correct result.

    The second example, well, that is dependant on, firstly, running on a MIPS platform, and secondly, having those macro's defined in your setup. In that case, better off writing in pure asm (or inline asm).
    Damn, what the hell was I thinking? xD

    Thanks for that.

  29. #9209
    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 Hideous Beitrag anzeigen
    Nope, I am clearing it. Turns out it's the crappy screen of the PSP.
    hmm, than i'm not sure what would cause such a huge ghosting
    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

  30. #9210
    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 Beitrag anzeigen
    hmm, than i'm not sure what would cause such a huge ghosting
    High contrast images moving across the screen. It is a hardware issue with the older PSPs.


 

Tags for this Thread

Forumregeln

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





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

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