Win32 PS2SDK problems?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
cnlohr3
Posts: 4
Joined: Sun Feb 05, 2006 2:05 pm

Win32 PS2SDK problems?

Post 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?
cnlohr3
Posts: 4
Joined: Sun Feb 05, 2006 2:05 pm

Post 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?
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

gettimeofday doesn't work on PS2

You can use cdReadClock, however keep in mind it's a very expensive call.
Shoot Pixels Not People!
Makeshift Development
cnlohr3
Posts: 4
Joined: Sun Feb 05, 2006 2:05 pm

Post 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?
cheriff
Regular
Posts: 258
Joined: Wed Jun 23, 2004 5:35 pm
Location: Sydney.au

Post 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 :)
Damn, I need a decent signature!
Post Reply