I wanted to share some code that I worked on in January about implementing some advanced math routines for the SNES C SDK using pure C. I imagine that these algorithms could be coded in pure assembly for faster execution, but I wanted to see how the SNES C compiler fared for development on a Windows 8 64-bit machine. A bunch of older assemblers are 16-bit and won't run on 64-bit machines without some sort of virtual machine so having a 32-bit development environment is nice.
I successfully implemented sine, cosine, tangent, secant, cosecant, cotangent and square root using approximations. I took a class while in school about approximating values to functions. This included approximating trig functions using Taylor series expansions and approximating square roots using various methods such as Newton's method and the Babylonian method. Due to limitations of the SNES hardware, I was only able to expand the Taylor series for the trig functions to a certain point. There were problems with buffer overflows once the factorial function results became too large to fit in the SNES memory.
Full details about what I've coded are on my blog: http://www.cameronjtinker.com/post/2013 ... S-SDK.aspx
Feedback on the code is appreciated.
I successfully implemented sine, cosine, tangent, secant, cosecant, cotangent and square root using approximations. I took a class while in school about approximating values to functions. This included approximating trig functions using Taylor series expansions and approximating square roots using various methods such as Newton's method and the Babylonian method. Due to limitations of the SNES hardware, I was only able to expand the Taylor series for the trig functions to a certain point. There were problems with buffer overflows once the factorial function results became too large to fit in the SNES memory.
Full details about what I've coded are on my blog: http://www.cameronjtinker.com/post/2013 ... S-SDK.aspx
Feedback on the code is appreciated.