Page 1 of 1

Win32 PS2SDK problems?

Posted: Sun Feb 05, 2006 2:12 pm
by cnlohr3
I'm a bit of a noob here, but I seem to have gotten a lot of what I wanted to work, compile and everything but a little bit to link.

I am currently using the win32 version of the PS2SDK found on the main PS2DEV.org homepage under "tools."

I cannot seem to fix the following two problems I keep running into.

1: I can't seem to find any way of linking in gettimeofday. Is it in the SDK? Or just in the .h's and not in the libaries?

I even tried manually externing' a definition to "C" and it still couldn't link it.

2: I cannot seem to get strings to work ... at all. Any time I use them I keep getting the following bunch of errors:

In file included from /cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/cwchar:51,
from /cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/bits/fpos.h:45
,
from /cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/bits/char_trai
ts.h:46,
from /cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/string:47,
from src/StdString.h:95,
from src/global.h:9,
from src/MercuryINI.h:4,
from src/MercuryINI.cpp:1:
/cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/ctime(71) : `difftime' not declared
/cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/ctime(72) : `mktime' not declared
/cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/ctime(73) : `time' not declared
/cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/ctime(74) : `asctime' not declared
/cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/ctime(75) : `ctime' not declared
/cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/ctime(76) : `gmtime' not declared
/cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/ctime(77) : `localtime' not
declared
/cygdrive/c/ps2dev/IDE/ee/include/c++/3.2.2/ctime(78) : `strftime' not declared

Any ideas what I could be doing wrong?

Posted: Mon Feb 06, 2006 10:33 am
by cnlohr3
(double post)

I am still curious about the windows problem... But I have since switched to the linux PS2 toolchain.

I am curious still as to how to get gettimeofday() to work. It doesn't seem to be in the normal <sys/time.h> file, and when I forcefully give it the definition, I cannot get it to find gettimeofday in any of the libaries provided. Is it necessiary to set a flag, or is there another way of getting detailed time on the PS2?

Posted: Mon Feb 06, 2006 8:55 pm
by Drakonite
gettimeofday doesn't work on PS2

You can use cdReadClock, however keep in mind it's a very expensive call.

Posted: Tue Feb 07, 2006 3:53 am
by cnlohr3
Thank you very much! That is very helpful.

Actually, with the way the engine works, we only have to do one time call every game cycle, with VSync on, I can't imagine it taking that much of a toll.

Or do you mean very expensive on very large scale? >0.01s?

Posted: Tue Feb 07, 2006 7:25 am
by cheriff
Its definately not worth doing every frame. You are MUCH better off doing only once during init and from then on in incrementing by 1/60* sec every frame, or maybe even using the performance timers to interrupt every so often so you can update the time.
Keep in mind that interrupts can suck on performance on PS2 (cache, etc) so if 1/60 sec is good enough, your best bet is to keep time on the vsync.

*or 1/50 depending on NTSC/PAL of course :)