Commit 6689a203 authored by Erik Faye-Lund's avatar Erik Faye-Lund
Browse files

a bit more cleanups

git-svn-id: https://pimpmobile.svn.sourceforge.net/svnroot/pimpmobile/trunk@128 3d5ecaf0-f903-0410-b953-c2c1a4d75763
parent 60a86c57
...@@ -69,8 +69,8 @@ debug: ...@@ -69,8 +69,8 @@ debug:
bin/converter: bin/converter:
make -C converter make -C converter
bin/lut_gen: lut_gen.cpp src/math.cpp src/config.h bin/lut_gen: lut_gen.cpp src/pimp_math.cpp src/pimp_config.h
g++ lut_gen.cpp src/math.cpp -o bin/lut_gen g++ $^ -o $@
lib/libpimpmobile.a: $(OBJS) lib/libpimpmobile.a: $(OBJS)
......
...@@ -12,15 +12,8 @@ ...@@ -12,15 +12,8 @@
#include <math.h> #include <math.h>
#include <typeinfo> #include <typeinfo>
#include "src/config.h" // get the current config #include "src/pimp_config.h" // get the current config
#include "src/pimp_math.h"
typedef unsigned char u8;
typedef signed char s8;
typedef unsigned short u16;
typedef signed short s16;
typedef unsigned int u32;
typedef signed int s32;
#include "src/math.h"
void error(const char *reason) void error(const char *reason)
{ {
...@@ -66,21 +59,23 @@ void print_lut(FILE *fp, T *lut, size_t size) ...@@ -66,21 +59,23 @@ void print_lut(FILE *fp, T *lut, size_t size)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#if 0
/* generate */
for (unsigned o = 0; o < 1; ++o) for (unsigned o = 0; o < 1; ++o)
{ {
for (unsigned n = 0; n < 2; ++n) for (unsigned n = 0; n < 2; ++n)
{ {
for (int fine_tune = -8; fine_tune < 8; ++fine_tune) for (int fine_tune = -8; fine_tune < 8; ++fine_tune)
{ {
printf("%d, ", get_amiga_period(n + o * 12, fine_tune) / 4); printf("%d, ", __pimp_get_amiga_period(n + o * 12, fine_tune) / 4);
// printf("%f\n", delta1);
} }
} }
printf("\n"); printf("\n");
} }
return 0; return 0;
#endif
/* todo: use some flags and stuff to decide what to dump and to what filename */ /* TODO: use some flags and stuff to decide what to dump and to what filename */
if (1) if (1)
{ {
// generate a lut for linear frequencies // generate a lut for linear frequencies
...@@ -110,7 +105,6 @@ int main(int argc, char *argv[]) ...@@ -110,7 +105,6 @@ int main(int argc, char *argv[])
// now dump it // now dump it
FILE *fp = fopen("src/amiga_delta_lut.h", "wb"); FILE *fp = fopen("src/amiga_delta_lut.h", "wb");
if (!fp) error("failed to open out-file"); if (!fp) error("failed to open out-file");
fprintf(fp, "const u16 amiga_delta_lut[%d] =\n{\n\t", ARRAY_SIZE(amiga_freq_lut)); fprintf(fp, "const u16 amiga_delta_lut[%d] =\n{\n\t", ARRAY_SIZE(amiga_freq_lut));
PRINT_LUT(fp, amiga_freq_lut); PRINT_LUT(fp, amiga_freq_lut);
fprintf(fp, "\n};\n\n"); fprintf(fp, "\n};\n\n");
......
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
#define AMIGA_DELTA_LUT_FRAC_BITS (15 - AMIGA_DELTA_LUT_LOG_SIZE) #define AMIGA_DELTA_LUT_FRAC_BITS (15 - AMIGA_DELTA_LUT_LOG_SIZE)
/* enable / disable assert */ /* enable / disable assert */
#ifndef NDEBUG /*
#define DEBUG_PRINTF_ENABLED #define DEBUG_PRINTF_ENABLED
#define ASSERT_ENABLED #define ASSERT_ENABLED
#endif */
#define DEBUG_PRINTF_ENABLED #define DEBUG_PRINTF_ENABLED
// #define ASSERT_ENABLED // #define ASSERT_ENABLED
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define PIMP_MATH_H #define PIMP_MATH_H
#include "pimp_config.h" #include "pimp_config.h"
#include "pimp_types.h"
extern const unsigned char __pimp_clz_lut[256]; extern const unsigned char __pimp_clz_lut[256];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment