Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core math library missing #20

Open
barf opened this issue Jun 11, 2020 · 2 comments
Open

Core math library missing #20

barf opened this issue Jun 11, 2020 · 2 comments

Comments

@barf
Copy link

barf commented Jun 11, 2020

Hi this is my first dabble into PSX coding, sorry if I am missing something obvious

I need implementations of cos(), sqrt(), asin(), atan2(), sin() and pow() to build a project, what solutions do other people use for these basic functions?

I cannot find a core math library in here (no libm or libmath), and the other PSX SDKs seem to provide one, do I need to roll my own cos() and sin() etc?

@Lameguy64
Copy link
Owner

Floating point math functions are not implemented for the most part in PSn00bSDK as such facilities will perform poorly since the PS1 does not have hardware floating point capability whatsoever. Only math functions implemented are integer based such as isin() and icos() and some GTE accelerated operations such as Square0(), VectorNormalS() and most of the matrix related functions. If you really want floating point math functions you can probably use a math library from another SDK project, but I can't really help you on that as I've never tried or looked into them myself.

@ijacquez
Copy link

ijacquez commented Jul 5, 2020

You need to use fixed point math.

As for trig functions, it's recommended to use tables of precomputed values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants