Rev 301 | Rev 304 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 301 | Rev 302 | ||
---|---|---|---|
Line 49... | Line 49... | ||
49 | #include <stdlib.h> |
49 | #include <stdlib.h> |
50 | 50 | ||
51 | #ifndef PARSERTEST |
51 | #ifndef PARSERTEST |
52 | #include "ff.h" |
52 | #include "ff.h" |
53 | #else |
53 | #else |
54 | #define value_type int |
54 | #define uint8_t unsigned char |
55 | #define uint16_t int |
55 | #define uint16_t unsigned short |
56 | #define uint32_t int |
56 | #define uint32_t unsigned int |
57 | #define int32_t int |
57 | #define int32_t int |
58 | #endif |
58 | #endif |
59 | 59 | ||
60 | #include "funcs.h" |
60 | #include "funcs.h" |
61 | #include "y.tab.h" |
61 | #include "y.tab.h" |
Line 284... | Line 284... | ||
284 | 284 | ||
285 | double costab[COSTABSIZE]; |
285 | double costab[COSTABSIZE]; |
286 | double tantab[TANTABSIZE]; |
286 | double tantab[TANTABSIZE]; |
287 | void init_trigtab(){ |
287 | void init_trigtab(){ |
288 | #ifdef PARSERTEST |
288 | #ifdef PARSERTEST |
289 | return 0; |
289 | return; |
290 | #else |
290 | #else |
291 | int i; |
291 | int i; |
292 | for(i=0;i<COSTABSIZE;++i){ |
292 | for(i=0;i<COSTABSIZE;++i){ |
293 | costab[i] = cos(FFANGLE(i)); |
293 | costab[i] = cos(FFANGLE(i)); |
294 | } |
294 | } |
Line 613... | Line 613... | ||
613 | uint32_t seedSave; |
613 | uint32_t seedSave; |
614 | } gFactoryRngState; |
614 | } gFactoryRngState; |
615 | 615 | ||
616 | void factory_fill_rnd_lookup(uint32_t seed, struct factoryRngState* state) { |
616 | void factory_fill_rnd_lookup(uint32_t seed, struct factoryRngState* state) { |
617 | #ifdef PARSERTEST |
617 | #ifdef PARSERTEST |
618 | return 0; |
618 | return; |
619 | #else |
619 | #else |
620 | // Algorithm of Filter Factory |
620 | // Algorithm of Filter Factory |
621 | // Filter Factory uses Donald E.Knuth's subtractive |
621 | // Filter Factory uses Donald E.Knuth's subtractive |
622 | // random number generator algorithm ("ran3"), which has been published |
622 | // random number generator algorithm ("ran3"), which has been published |
623 | // in Page 283 of "The Art of Computer Programming, volume 2: Seminumerical Algorithms", |
623 | // in Page 283 of "The Art of Computer Programming, volume 2: Seminumerical Algorithms", |
Line 781... | Line 781... | ||
781 | 781 | ||
782 | // ------------------------------------------------------------------------------------------- |
782 | // ------------------------------------------------------------------------------------------- |
783 | 783 | ||
784 | void factory_initialize_rnd_variables() { |
784 | void factory_initialize_rnd_variables() { |
785 | #ifdef PARSERTEST |
785 | #ifdef PARSERTEST |
786 | return 0; |
786 | return; |
787 | #else |
787 | #else |
788 | gFactoryRngState.seed = 0; // default seed |
788 | gFactoryRngState.seed = 0; // default seed |
789 | gFactoryRngState.seedSave = gFactoryRngState.seed + 1; // force rnd() to call factory_fill_rnd_lookup() |
789 | gFactoryRngState.seedSave = gFactoryRngState.seed + 1; // force rnd() to call factory_fill_rnd_lookup() |
790 | #endif |
790 | #endif |
791 | } |
791 | } |
792 | 792 | ||
793 | void foundry_initialize_rnd_variables() { |
793 | void foundry_initialize_rnd_variables() { |
794 | #ifdef PARSERTEST |
794 | #ifdef PARSERTEST |
795 | return 0; |
795 | return; |
796 | #else |
796 | #else |
797 | foundry_rst(691204); |
797 | foundry_rst(691204); |
798 | #endif |
798 | #endif |
799 | } |
799 | } |
800 | 800 |