#include <nds/jtypes.h>マクロ定義 | |
| #define | DIV_CR (*(vuint16*)(0x04000280)) |
| #define | DIV_NUMERATOR64 (*(vint64*) (0x04000290)) |
| #define | DIV_NUMERATOR32 (*(vint32*) (0x04000290)) |
| #define | DIV_DENOMINATOR64 (*(vint64*) (0x04000298)) |
| #define | DIV_DENOMINATOR32 (*(vint32*) (0x04000298)) |
| #define | DIV_RESULT64 (*(vint64*) (0x040002A0)) |
| #define | DIV_RESULT32 (*(vint32*) (0x040002A0)) |
| #define | DIV_REMAINDER64 (*(vint64*) (0x040002A8)) |
| #define | DIV_REMAINDER32 (*(vint32*) (0x040002A8)) |
| #define | SQRT_CR (*(vuint16*)(0x040002B0)) |
| #define | SQRT_PARAM64 (*(vint64*) (0x040002B8)) |
| #define | SQRT_RESULT32 (*(vint32*) (0x040002B4)) |
| #define | SQRT_PARAM32 (*(vint32*) (0x040002B8)) |
| #define | DIV_64_64 2 |
| #define | DIV_64_32 1 |
| #define | DIV_32_32 0 |
| #define | DIV_BUSY (1<<15) |
| #define | SQRT_64 1 |
| #define | SQRT_32 0 |
| #define | SQRT_BUSY (1<<15) |
関数 | |
| static int32 | divf32 (int32 num, int32 den) |
| static int32 | mulf32 (int32 a, int32 b) |
| static int32 | sqrtf32 (int32 a) |
| static int32 | div32 (int32 num, int32 den) |
| static int32 | mod32 (int32 num, int32 den) |
| static int32 | div64 (int64 num, int32 den) |
| static int32 | mod64 (int64 num, int32 den) |
| static int32 | sqrt32 (int a) |
| static void | crossf32 (int32 *a, int32 *b, int32 *result) |
| static int32 | dotf32 (int32 *a, int32 *b) |
| static void | normalizef32 (int32 *a) |
| #define DIV_32_32 0 |
| #define DIV_64_32 1 |
| #define DIV_64_64 2 |
| #define DIV_BUSY (1<<15) |
| #define DIV_CR (*(vuint16*)(0x04000280)) |
| #define DIV_DENOMINATOR32 (*(vint32*) (0x04000298)) |
| #define DIV_DENOMINATOR64 (*(vint64*) (0x04000298)) |
| #define DIV_NUMERATOR32 (*(vint32*) (0x04000290)) |
| #define DIV_NUMERATOR64 (*(vint64*) (0x04000290)) |
| #define DIV_REMAINDER32 (*(vint32*) (0x040002A8)) |
| #define DIV_REMAINDER64 (*(vint64*) (0x040002A8)) |
| #define DIV_RESULT32 (*(vint32*) (0x040002A0)) |
| #define DIV_RESULT64 (*(vint64*) (0x040002A0)) |
| #define SQRT_32 0 |
| #define SQRT_64 1 |
| #define SQRT_BUSY (1<<15) |
| #define SQRT_CR (*(vuint16*)(0x040002B0)) |
| #define SQRT_PARAM32 (*(vint32*) (0x040002B8)) |
| #define SQRT_PARAM64 (*(vint64*) (0x040002B8)) |
| #define SQRT_RESULT32 (*(vint32*) (0x040002B4)) |
00139 { 00140 DIV_CR = DIV_32_32; 00141 00142 while(DIV_CR & DIV_BUSY); 00143 00144 DIV_NUMERATOR32 = num; 00145 DIV_DENOMINATOR32 = den; 00146 00147 while(DIV_CR & DIV_BUSY); 00148 00149 return (DIV_RESULT32); 00150 }
00173 { 00174 DIV_CR = DIV_64_32; 00175 00176 while(DIV_CR & DIV_BUSY); 00177 00178 DIV_NUMERATOR64 = num; 00179 DIV_DENOMINATOR32 = den; 00180 00181 while(DIV_CR & DIV_BUSY); 00182 00183 return (DIV_RESULT32); 00184 }
00095 { 00096 DIV_CR = DIV_64_32; 00097 00098 while(DIV_CR & DIV_BUSY); 00099 00100 DIV_NUMERATOR64 = ((int64)num) << 12; 00101 DIV_DENOMINATOR32 = den; 00102 00103 while(DIV_CR & DIV_BUSY); 00104 00105 return (DIV_RESULT32); 00106 }
00156 { 00157 DIV_CR = DIV_32_32; 00158 00159 while(DIV_CR & DIV_BUSY); 00160 00161 DIV_NUMERATOR32 = num; 00162 DIV_DENOMINATOR32 = den; 00163 00164 while(DIV_CR & DIV_BUSY); 00165 00166 return (DIV_REMAINDER32); 00167 }
00190 { 00191 DIV_CR = DIV_64_32; 00192 00193 while(DIV_CR & DIV_BUSY); 00194 00195 DIV_NUMERATOR64 = num; 00196 DIV_DENOMINATOR32 = den; 00197 00198 while(DIV_CR & DIV_BUSY); 00199 00200 return (DIV_REMAINDER32); 00201 }
00112 { 00113 long long result = (long long)a*(long long)b; 00114 return (int32)(result >> 12); 00115 }
| static void normalizef32 | ( | int32 * | a | ) | [inline, static] |
| static int32 sqrt32 | ( | int | a | ) | [inline, static] |
00207 { 00208 SQRT_CR = SQRT_32; 00209 00210 while(SQRT_CR & SQRT_BUSY); 00211 00212 SQRT_PARAM32 = a; 00213 00214 while(SQRT_CR & SQRT_BUSY); 00215 00216 return SQRT_RESULT32; 00217 }
00121 { 00122 SQRT_CR = SQRT_64; 00123 00124 while(SQRT_CR & SQRT_BUSY); 00125 00126 SQRT_PARAM64 = ((int64)a) << 12; 00127 00128 while(SQRT_CR & SQRT_BUSY); 00129 00130 return SQRT_RESULT32; 00131 }
1.5.4