3d cube and dirty drawing
[dos_low3d] / tools / genlut.c
index cbd629c..45be022 100644 (file)
@@ -1,37 +1,37 @@
-#include <stdio.h>\r
-#include <math.h>\r
-\r
-#define SINTAB_SIZE            512\r
-#define SINTAB_SCALE   8192\r
-\r
-int main(void)\r
-{\r
-       int i, len;\r
-\r
-       printf("\tbits 32\n");\r
-       printf("\tsection .rodata\n\n");\r
-\r
-       printf("\tglobal _sintab\n");\r
-       printf("_sintab:\n");\r
-\r
-       fputs("\tdw", stdout);\r
-       len = 10;\r
-       for(i=0; i<SINTAB_SIZE; i++) {\r
-               double theta = (double)i / (double)SINTAB_SIZE * 6.28318530718;\r
-               double sf = sin(theta);\r
-               int sx = (int)(sf * SINTAB_SCALE);\r
-               len += printf(" %d", sx);\r
-               if(len >= 72) {\r
-                       putchar('\n');\r
-                       if(i < SINTAB_SIZE - 1) {\r
-                               fputs("\tdw", stdout);\r
-                               len = 10;\r
-                       }\r
-               } else {\r
-                       putchar(',');\r
-                       len++;\r
-               }\r
-       }\r
-       printf("\n\n; vi:ft=nasm ts=8 sts=8 sw=8:\n");\r
-       return 0;\r
-}\r
+#include <stdio.h>
+#include <math.h>
+
+#define SINTAB_SIZE            512
+#define SINTAB_SCALE   8192
+
+int main(void)
+{
+       int i, len;
+
+       printf("\tbits 32\n");
+       printf("\tsection .rodata\n\n");
+
+       printf("\tglobal _sintab\n");
+       printf("_sintab:\n");
+
+       fputs("\tdw", stdout);
+       len = 10;
+       for(i=0; i<SINTAB_SIZE; i++) {
+               double theta = (double)i / (double)SINTAB_SIZE * 6.28318530718;
+               double sf = sin(theta);
+               int sx = (int)(sf * SINTAB_SCALE);
+               len += printf(" %d", sx);
+               if(len >= 72) {
+                       putchar('\n');
+                       if(i < SINTAB_SIZE - 1) {
+                               fputs("\tdw", stdout);
+                               len = 10;
+                       }
+               } else {
+                       putchar(',');
+                       len++;
+               }
+       }
+       printf("\n\n; vi:ft=nasm ts=8 sts=8 sw=8:\n");
+       return 0;
+}