Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- static int n=0; // question : how could i do a static int in the main fonction cause this silly n has not to be general over 1 milion line of code
- void messagetextinit()
- {
- printf(";\n")
- printf(";\tThis code is generated\n");
- printf(";\t and can be overwriten\n");
- printf(";\t\if you want to edit, work on a copy on another folder\n");
- printf("\n);
- }
- void writedcb(short int x)
- {
- if (n==0)
- {
- printf("dc.w %d,",x);
- }
- else if (n==15)
- {
- printf("%d\n",x);
- }
- else
- {
- printf("%d,",x);
- }
- n=(n+1) & 15;
- }
- void nl()
- {
- printf("\n");
- }
- int ajoutemask(int* tab,int masque,int champvaleur)
- {
- for (int i=0;i<65536;i++)
- {
- int v=i & masque;
- tab[v]=champvaleur;
- }
- }
- int main(int argc,char** argv)
- {
- messagetextinit;
- int sinx;
- for(int i=0;i<1540;i++)
- {
- int value=32767*sin((i+0.5)*2*3.1415926/1540/4);
- if (i<(1540-1))
- {
- writedcb(value);
- } else
- {
- printf("%d\n",value);
- }
- }
- nl;
- int* tableauflag = malloc(sizeof(int)*65536);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement