gba-trycatch

diff src/fixed.h @ 4:78d1664c2443

- fixed sin_x16/cos_x16 - added fixed point header
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 14 Jun 2014 03:04:56 +0300
parents
children 158d23956801
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/fixed.h	Sat Jun 14 03:04:56 2014 +0300
     1.3 @@ -0,0 +1,11 @@
     1.4 +#ifndef FIXED_H_
     1.5 +#define FIXED_H_
     1.6 +
     1.7 +#include <stdint.h>
     1.8 +
     1.9 +#define x16mul(a, b)	(int32_t)(((int32_t)(a) >> 8) * ((int32_t)(b) >> 8))
    1.10 +/*int32_t x16div(register int32_t num, register int32_t denom);*/
    1.11 +
    1.12 +#define x16div(a, b)	(int32_t)(((int64_t)(a) << 16) / (b))
    1.13 +
    1.14 +#endif	/* FIXED_H_ */