diff options
| author | John "Lameguy" Wilbert Villamor <lameguy64@gmail.com> | 2022-11-03 10:14:22 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-03 10:14:22 +0800 |
| commit | 4139331d233b7a962e747c5564fa68a285f81cc8 (patch) | |
| tree | d4d3374afd5e36e8580cc424ab2c63ee9e7d357c /libpsn00b/psxgte/hisin.c | |
| parent | e08a3d9366f8ca14a76b3dd569dac1fb9f569748 (diff) | |
| parent | 37d963f724113e45d15aa9b8ee86baa9c4362b8f (diff) | |
| download | psn00bsdk-4139331d233b7a962e747c5564fa68a285f81cc8.tar.gz | |
Merge pull request #60 from spicyjpeg/bugfix
Bugfixes, new serial port API and sound examples
Diffstat (limited to 'libpsn00b/psxgte/hisin.c')
| -rw-r--r-- | libpsn00b/psxgte/hisin.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/libpsn00b/psxgte/hisin.c b/libpsn00b/psxgte/hisin.c deleted file mode 100644 index 68d5d28..0000000 --- a/libpsn00b/psxgte/hisin.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Based on isin_S4 implementation from coranac: - * http://www.coranac.com/2009/07/sines/ - * - */ - -#define qN 15 -#define qA 12 -#define B 19900 -#define C 3516 - -int hisin(int x) { - - int c, x2, y; - - c= x<<(30-qN); // Semi-circle info into carry. - x -= 1<<qN; // sine -> cosine calc - - x= x<<(31-qN); // Mask with PI - x= x>>(31-qN); // Note: SIGNED shift! (to qN) - x= x*x>>(2*qN-14); // x=x^2 To Q14 - - y= B - (x*C>>14); // B - x^2*C - y= (1<<qA)-(x*y>>16); // A - x^2*(B-x^2*C) - - return c>=0 ? y : -y; - -} - -int hicos(int x) { - - return hisin( x+32768 ); - -} |
