diff options
Diffstat (limited to 'fixsingen')
| -rw-r--r-- | fixsingen/fixsingen.cbp | 48 | ||||
| -rw-r--r-- | fixsingen/fixsingen.depend | 22 | ||||
| -rw-r--r-- | fixsingen/main.c | 35 |
3 files changed, 105 insertions, 0 deletions
diff --git a/fixsingen/fixsingen.cbp b/fixsingen/fixsingen.cbp new file mode 100644 index 0000000..7282665 --- /dev/null +++ b/fixsingen/fixsingen.cbp @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="fixsingen" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="dbg"> + <Option output="bin\dbg\fixsingen" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\dbg\" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-g" /> + </Compiler> + </Target> + <Target title="rel"> + <Option output="bin\rel\fixsingen" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj\rel\" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-O2" /> + </Compiler> + <Linker> + <Add option="-s" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wall" /> + <Add directory="..\" /> + </Compiler> + <Linker> + <Add library="..\libfixmath\libfixmath.a" /> + </Linker> + <Unit filename="main.c"> + <Option compilerVar="CC" /> + </Unit> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + <lib_finder disable_auto="1" /> + </Extensions> + </Project> +</CodeBlocks_project_file> diff --git a/fixsingen/fixsingen.depend b/fixsingen/fixsingen.depend new file mode 100644 index 0000000..c4ab73e --- /dev/null +++ b/fixsingen/fixsingen.depend @@ -0,0 +1,22 @@ +# depslib dependency file v1.0
+1298645188 source:g:\vrfx\libfixmath\fixsingen\main.c
+ <stdio.h>
+ <stdlib.h>
+ <inttypes.h>
+ <math.h>
+ <libfixmath/fixmath.h>
+
+1298453688 g:\vrfx\libfixmath\\libfixmath\fixmath.h
+ "uint32.h"
+ "fract32.h"
+ "fix16.h"
+
+1298453688 g:\vrfx\libfixmath\\libfixmath\uint32.h
+ <stdint.h>
+
+1298453688 g:\vrfx\libfixmath\\libfixmath\fract32.h
+ <stdint.h>
+
+1298634082 g:\vrfx\libfixmath\\libfixmath\fix16.h
+ <stdint.h>
+
diff --git a/fixsingen/main.c b/fixsingen/main.c new file mode 100644 index 0000000..ce71647 --- /dev/null +++ b/fixsingen/main.c @@ -0,0 +1,35 @@ +#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <math.h>
+#include <libfixmath/fixmath.h>
+
+int main(int argc, char** argv) {
+ FILE* fp = fopen("fix16_trig_sin_lut.h", "wb");
+ if(fp == NULL) {
+ fprintf(stderr, "Error: Unable to open file for writing.\n");
+ return EXIT_FAILURE;
+ }
+
+ fprintf(fp, "#ifndef __fix16_trig_sin_lut_h__\n");
+ fprintf(fp, "#define __fix16_trig_sin_lut_h__\n");
+ fprintf(fp, "\n");
+
+ fprintf(fp, "static fix16_t _fix16_sin_lut[%"PRIi32"] = {", (fix16_pi >> 1));
+
+ uintptr_t i;
+ for(i = 0; i < (fix16_pi >> 1); i++) {
+ if((i & 7) == 0)
+ fprintf(fp, "\n\t");
+ fix16_t fix16_sin_lut = fix16_from_dbl(sin(fix16_to_dbl(i)));
+ fprintf(fp, "%"PRIi32", ", fix16_sin_lut);
+ }
+ fprintf(fp, "\n\t};\n");
+
+ fprintf(fp, "\n");
+ fprintf(fp, "#endif\n");
+
+ fclose(fp);
+
+ return EXIT_SUCCESS;
+}
|
