png and pow

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

Moderators: cheriff, Herben

Post Reply
radad
Posts: 246
Joined: Wed May 19, 2004 4:54 pm
Location: Melbourne, Australia

png and pow

Post by radad »

I downloaded and built libpng from svn and was getting some missing references for pow and powf. I fixed the powf by adding mf to the list of libraries but I couldnt find pow anywhere in the ps2sdk. Does it exist?

As a workaround I disabled the floating point support in libpng. Is libpng still able to open all variations?
radad
Posts: 246
Joined: Wed May 19, 2004 4:54 pm
Location: Melbourne, Australia

Post by radad »

It seems the floating point unit in the ps2 only handles single precision floats. So what is a good strategy for handling double precision float functions like 'pow'. Would it be ok to just call the single precision version?

ie

Code: Select all

double pow(double x, double y)
{
    return powf(x, y);
}
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...ogg/vorbis decoder in SMS uses 'powf' from 'ps2sdk'. Alternatively you can try to use 'pow' from 'libm' which is part of the toolchain (I think it uses emulation for the doubles)...
Post Reply