Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-8081-120121-

Acid ported to C

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 11:30

Speed: 151-170 million cycles per frame render.
C Version 1.0 can be downloaded here http://pastebin.com/ET72dQM7
Latest JavaScript version(Acid 8) is @ http://pastebin.com/Y3gYPdVB
Comment/critique/improve/suggest more hacks,features and tricks to improve v1.0
Its not a direct port, but a reimplementation to capitalize on C features.

Name: Anonymous 2011-11-07 11:34

Why can't you indent your code? This looks fugly.

Name: Anonymous 2011-11-07 11:36

why.jpg

Name: Anonymous 2011-11-07 11:37

#define s1 signed char
#define s4 signed int
#define v0 void
...
v0 main(s4 argc,s1**argv){//quasicrystal generator

This shit is intentionally obfuscated.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 11:54

>>2
This is not Python. You can indent it yourself with help of software like http://www.gnu.org/software/indent/

Name: Anonymous 2011-11-07 12:09

Every C I've ever seen not made by a student has been indented... this looks like BASIC code

Name: Anonymous 2011-11-07 12:13

>>5
god, he is stupid. why don't you write everything in a single line
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define u1 unsigned char
#define u2 unsigned short
#define u4 unsigned int
#define u8 unsigned long long
#define s1 signed char
#define s2 signed short
#define s4 signed int
#define s8 signed long long
#define f2 short float
#define f4 float
#define f8 double
#define f10 long double
#define v0 void inline unsigned long long rdtsc(){__asm{RDTSC}}
#define MAXFRAMES 30
#define DEFHRES 1080
#define DEFWRES 1920
#define SIZE DEFHRES*DEFWRES
#define STDOFFSET 1078
#define FILESIZE SIZE+STDOFFSET
#define PALSIZE 256
#define HEADERINFOSIZE 40
#define BITSPERPIXEL 8
#define FRAMEDIR "frames"
#define MAXCOLOR 0xff
#define magc 6755399441055744*1.6
#define mags 0x7fffffffffffffff
#define scale 0.125
#define offpi (2*M_PI/MAXFRAMES)
const f8 rangepi[]={0,0.4487989505128276,0.8975979010256552,1.3463968515384828,1.7951958020513104,2.243994752564138,2.6927937030769655}; f8 cospi[]={1,0.9009688679024191,0.6234898018587336,0.22252093395631445,-0.22252093395631434,-0.6234898018587335,-0.900968867902419}; f8 sinpi[]={0,0.4338837391175581,0.7818314824680298,0.9749279121818236,0.9749279121818236,0.7818314824680299,0.43388373911755823}; v0 main(s4 argc,s1**argv){ u8 starttime=rdtsc();u8 endtime; u1* bitmap=malloc(1078+SIZE); bitmap[0]='B'; bitmap[1]='M'; u4*crfilesize=bitmap+2; *crfilesize=FILESIZE; u4* bitmapoffset=bitmap+10; *bitmapoffset=STDOFFSET; u4* bhsize=bitmap+14; *bhsize=HEADERINFOSIZE; u4* w=bitmap+18; *w=DEFWRES; u4* h=bitmap+22; *h=DEFHRES; u2* bitplanes=bitmap+26; *bitplanes=1; u2* bitsperpixel=bitmap+28; *bitsperpixel=BITSPERPIXEL; u4* compression=bitmap+30; *compression=0; u4* imagesize=bitmap+34; *imagesize=SIZE; u4* xppm=bitmap+38; u4* yppm=bitmap+42; *xppm=40000; *yppm=40000; u4* numcolors=bitmap+46; *numcolors=256; u4* impcolors=bitmap+50; *impcolors=256; f8 off=0; u4 currframe=0; u4 i,c,m; u4 x,y,height=*h,width=*w; s4* colors=bitmap+54; s4* pixels=bitmap+STDOFFSET; s4 ic,ir,ig,ib,ia;double index,tx,ty,sn,frac; char filename[40];mkdir(FRAMEDIR); for(i=0;i<256;i++){ ic=i; ia=abs(256-(ic&0xf))<<24; ir=(ic)-31;if(ir<3 ){ir=0;} ig=(ic)-81;if(ig<9){ig=0;} ib=(ic)-0; if(ib<0 ){ib=0;} colors[i]=ia<<24|ir<<16|ig<<8|ib ; } f8 s,n2,abstrunc;s4 flt,temp,curx,cury; f8 da[2]; u4* sconv=&s; const f8 halfhscaled=height *0.5 * scale; const f8 halfwscaled=width *0.5 * scale; f8 tempadd,tempsub; f8 frameoffsets[MAXFRAMES]; for(i=0;i<MAXFRAMES;i++)frameoffsets[i]=offpi*i; f8 framecos[MAXFRAMES]; f8 framesin[MAXFRAMES]; for(i=0;i<MAXFRAMES;i++)framecos[i]=cos(frameoffsets[i]); for(i=0;i<MAXFRAMES;i++)framesin[i]=sin(frameoffsets[i]); f8 tysinpi[7]; f8 txarray[DEFWRES]; for(i=0;i<DEFWRES;i++)txarray[i]=(i* scale)-halfwscaled; f8 tyarray[DEFHRES]; for(i=0;i<DEFHRES;i++)tyarray[i]=(i* scale)-halfhscaled; f8 txcos[DEFWRES]; f8 txsin[DEFWRES]; f8 txcospi1[DEFWRES]; f8 txcospi2[DEFWRES]; f8 txcospi3[DEFWRES]; u4 framx=DEFWRES*MAXFRAMES; f8 txcosdiff[framx]; for(i=0;i<DEFWRES;i++)txcos[i]=cos(txarray[i]); for(i=0;i<DEFWRES;i++)txsin[i]=sin(txarray[i]); for(i=0;i<DEFWRES;i++)txcospi1[i]=cos(txarray[i]*cospi[1]); for(i=0;i<DEFWRES;i++)txcospi2[i]=cos(txarray[i]*cospi[2]); for(i=0;i<DEFWRES;i++)txcospi3[i]=cos(txarray[i]*cospi[3]); for(i=0,curx=0,cury=0;i<framx;i++){ txcosdiff[i]=( (txcos[curx]*framecos[cury]-txsin[curx]*framesin[cury])+7)*0.5 ; cury++; cury*=(cury<MAXFRAMES); curx+=(cury<1); } f8 ysin1,ysin2,ysin3,shaf; f8 fcurcos,fcursin; f8 curysin1sin; f8 curysin2sin; f8 curysin3sin; f8 curysin1cos; f8 curysin2cos; f8 curysin3cos; f8 tysin1[DEFHRES]; f8 tysin2[DEFHRES]; f8 tysin3[DEFHRES]; f8 tysin1cos[DEFHRES]; f8 tysin2cos[DEFHRES]; f8 tysin3cos[DEFHRES]; f8 tysin1sin[DEFHRES]; f8 tysin2sin[DEFHRES]; f8 tysin3sin[DEFHRES]; for(i=0;i<DEFHRES;i++)tysin1[i]=sinpi[1] * tyarray[i]; for(i=0;i<DEFHRES;i++)tysin2[i]=sinpi[2] * tyarray[i]; for(i=0;i<DEFHRES;i++)tysin3[i]=sinpi[3] * tyarray[i]; for(i=0;i<DEFHRES;i++)tysin1cos[i]=cos(tysin1[i]); for(i=0;i<DEFHRES;i++)tysin2cos[i]=cos(tysin2[i]); for(i=0;i<DEFHRES;i++)tysin3cos[i]=cos(tysin3[i]); for(i=0;i<DEFHRES;i++)tysin1sin[i]=sin(tysin1[i]); for(i=0;i<DEFHRES;i++)tysin2sin[i]=sin(tysin2[i]); for(i=0;i<DEFHRES;i++)tysin3sin[i]=sin(tysin3[i]); u4 globs,globa; u4 nsize=DEFHRES*DEFWRES; f8* prodadd=malloc(nsize*8); f8* prodsub=malloc(nsize*8); curx=0;cury=0; for(m=0;m<nsize;m++){ prodadd[m]=tysin1cos[cury]*txcospi1[curx]+tysin2cos[cury]*txcospi2[curx]+tysin3cos[cury]*txcospi3[curx]; curx++; curx*=(curx<DEFWRES); cury+=(curx<1); } curx=0;cury=0; for(m=0;m<nsize;m++){ prodsub[m]=tysin1sin[cury]*txcospi1[curx]+tysin2sin[cury]*txcospi2[curx]+tysin3sin[cury]*txcospi3[curx]; curx++; curx*=(curx<DEFWRES); cury+=(curx<1); } endtime=rdtsc(); printf("Precomputation in %llu cycles",endtime-starttime); for(currframe=0;currframe<MAXFRAMES;currframe++){ c=STDOFFSET;cury=0;globs=0;; fcurcos=framecos[currframe]; fcursin=framesin[currframe]; starttime=rdtsc(); for(y=0;y<height;y++){ globa=0; for(x=0;x<width;x++){ s=(prodadd[globs]*fcurcos); s-=(prodsub[globs++]*fcursin); s+=txcosdiff[globa+currframe]; shaf=s+magc; shaf-=magc; s=fabs(s-shaf); s=s>1?2-s:s; s=(s*0xff)+6755399441055744; bitmap[c++]=(u1)(*sconv); globa+=MAXFRAMES; }} endtime=rdtsc(); printf("Created frame:%d in %llu cycles ",currframe,endtime-starttime); sprintf(filename,"%s/frame%d.bmp",FRAMEDIR,currframe); FILE* cfile=fopen(filename,"wb"); if(!cfile){perror("File error");} fwrite(bitmap,1,FILESIZE,cfile);fclose(cfile);}} /* batch file used for this file: ================== @echo off ..\dmc -Jm -v2 -ff -o+all quasi.c quasi copy quasi.c archivedq\%random%%random%%random%quasi.c rem requires imageMagick installed "convert imagename" is the rem which is converting bitmap to gifs(use your own path). rem "C:\Program Files\ImageMagick-6.7.3-Q8\convert.exe" -coalesce -adjoin -delay 25 -compress LZW -quality 10 frames\fr* webanim.gif rem reference frame for correct render(!not exactly acid 8.js since it uses other cos/sin); fc/b frames\Ref.bmp frames\frame0.bmp|more */

Name: Anonymous 2011-11-07 12:19

>>5
Indentation is not even the worst thing, why the hell did you go defining stuff like s1 to signed char and not just use char? That is just retarded and obfuscated.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 12:23

signed char:12 characters to write
char : 5 characters to write and char is not a definite type(it can be both signed and unsigned)
s1 :3 characters to write, completely and unambiguously defined as signed byte.
Who is retarded now?

Name: Anonymous 2011-11-07 12:25

>>9
... seriously? you can replace everything with letters.
define w while
define f for

look, 5 less chars for while and 2 for for loops.

/prog/ I am not a very old /prog/ user. is this one a troll or just plain idiot?

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 12:26

for reference to numbers:
#define u1 unsigned char // unsigned bytes 1
#define u2 unsigned short // unsigned bytes 2
#define u4 unsigned int// unsigned bytes 4
#define u8 unsigned long long // unsigned bytes 8
#define s1 signed char// signed bytes 1
#define s2 signed short // signed bytes 2
#define s4 signed int//// signed bytes 4
#define s8 signed long long// signed bytes 8
#define f2 short float// float bytes 2
#define f4 float // float bytes 4
#define f8 double //float bytes 8
#define f10 long double// float bytes 10
#define v0 void //void 0 generic type

Name: Anonymous 2011-11-07 12:28

Who is retarded now?
You, because you have no common sense and are unable to write readable code.
If you spend 100 ms less when writing the type (once for a var, mind you), but a second more deciphering that type when you read it, your time saved is negative.
Also, I have no idea how can s1 be easier to write and remember than char to anyone.

Name: Anonymous 2011-11-07 12:30

for(i=0;i<DEFWRES;i++)txcos[i]=cos(txarray[i]);
for(i=0;i<DEFWRES;i++)txsin[i]=sin(txarray[i]);
for(i=0;i<DEFWRES;i++)txcospi1[i]=cos(txarray[i]*cospi[1]);
for(i=0;i<DEFWRES;i++)txcospi2[i]=cos(txarray[i]*cospi[2]);
for(i=0;i<DEFWRES;i++)txcospi3[i]=cos(txarray[i]*cospi[3]);

Wow.

Name: Anonymous 2011-11-07 12:30

>>10
Both, as well as autistic.
Note that the #define probably used up more chars than the use of these two in code, as well as made it unreadable.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 12:31

>>10
it could clash with one letter variables so you should use
#define wh while
#define fo for
In reality I don't need it, since i don't use 'while' that often and for->fo is only 1 char savings(and i write mostly FOR loops).

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 12:34

>>12
Its easier when you read what they mean in >>11

Name: Anonymous 2011-11-07 12:37

>>16
No.
No, it's not.
It can't be easier than the standard int, char, void and such.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 12:40

>>17
Only if your brain was destroyed by learning C that way. My way is shorter,self-descriptive and completely unambiguous.
Next time you type     'unsigned long long' into your editor of choice think about it.

Name: Anonymous 2011-11-07 12:42

>>18
unsigned long long and such might count as exceptions at times, but only if you use them a lot in the code.
Also, what happens when your code with s4 is compiled on a 64-bit platform?

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 12:50

>>19
Anytime you like you can change 1 define and its fixed for all code.

Name: Anonymous 2011-11-07 12:51

>>17
I am pretty sure if you use #define f for you will remove even more letters than using #define u8 unsigned long long. there is no reason not to use it.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 12:52

>>21
define f is
1.not self-descriptive, how many bytes it takes?
2.may clash with one letter variables
3. is only 1 char shorter to type than u8

Name: Anonymous 2011-11-07 12:53

>>20
Or not have to change it at all because you use the normal type names.

Name: Anonymous 2011-11-07 12:54

>>20
Actually, you'd have to change it to s8 in the definition and every s4 in the code also into s8.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 12:55

>>23
Normal type names don't magically make the porting easier. In fact #defines are used by all portable code.

Name: Anonymous 2011-11-07 12:57

8/10

Name: Anonymous 2011-11-07 13:03

why no recursion FrozenVoiden?
oh and the code's still a mess

Name: Anonymous 2011-11-07 13:03

>>22
not self-descriptive, how many bytes it takes?
it takes 2 less chars per for loop? what is the question?
2.may clash with one letter variables
then don't use f for any other variables.
3. is only 1 char shorter to type than u8
yeah but you typed u8 twice in your code but there are lots of for loops.

Name: Anonymous 2011-11-07 13:03

as a c newbie, and coming from other languages, "uint8" and such seems much nicer to me than "unsigned char" etc. although aren't there standard uint8_t types or no?

Name: Anonymous 2011-11-07 13:06

that has got to be the ugliest code i've ever seen.

never heard of intendation, have you, FrozenNigger?

then again, autism

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 13:12

>>28
u8 is self-descriptive: u=unsigned 8=8 bytes
f is not, you can easily confuse it with a function or a variable.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 13:15

>>28
chars saved by those 2 u8=32  chars
chars saved by hypothetically shortening all for loops to (fo) in my code =27 chars
see the difference? a measly 2 u8 save as much as 27 fo loops

Name: Anonymous 2011-11-07 13:15

http://pastebin.com/7fW7A80V

why are you trying to obfuscate it?
its shit that nobody cares

Name: Anonymous 2011-11-07 13:18

>>33
think i just went blind

Name: Anonymous 2011-11-07 13:20

>>31
Only if your brain was destroyed by learning C that way.

also size of long/int/short is not a standard in C. so u8 might describe your data wrong

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 13:22

>>35
If it describes the data wrong you can easily see it and correct to your compiler/arch preference by changing a single line of code(the #define u8)

Name: Anonymous 2011-11-07 13:24

>>32
it is your fault if you are so stupid and can't define it as "f" because you can't remember if letter "f" is already allocated or not.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 13:24

If you can handle hunting for "standard data types" and changing them one by one in "standard portable C" to port your software,
you can certainly handle the difficulty of replacing one #define

Name: Anonymous 2011-11-07 13:26

>>36
So, you change it into #define u16 (or u4), then you have to change it everywhere else in your code. Or at least use stdint.h types, such as uint64_t.

Name: sage 2011-11-07 13:27

sage

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 13:28

>>27
f is more useful as single-letter variable. Types are all 2 chars with easily to learn and remember self-descriptive notation: 
[datatype(u=unsigned,s=signed,f=float)][databytes(1,2,4,8,10)].
f does not fit in this notation.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 13:29

>>39
Nonsense: you change a single line #define u8 uint64_t
there is no need whatsoever to replace anything else.

Name: Anonymous 2011-11-07 13:31

>>42
I thought you meant change the names to reflect the changed size of int.
If you mean change it to smaller types, then why didn't you just use uint64_t (even if defined to u8, despite how retarded that is)?

Name: Captain SAGE 2011-11-07 13:32

dont worry
capitan sargetron is here

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 13:38

>>43
 "reflect the changed size of int" i have to ignore defines and manually change every declaration in the code to "reflect the changed size".
How retarded that is?
>uint64_t
I prefer to rely on native types rather than using stdint.h(which can changed to easily since its global define, that not a problem)
consider these new short type declarations the "new stdint.h"

Name: Anonymous 2011-11-07 13:41

>>45
On my computer, half of these declarations are wrong.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 13:46

>>46
Thats not a problem in the declarations. They specify a datatype and its length: your setup fails to produce the correct lengths.
to fix this you change line which you find best fit your platform datatype:length and do not mess with the code you wrote.
Isn't it much easier to change one define rather to to change datatypes in random locations all over the code?

Name: Anonymous 2011-11-07 13:47

>>47
Isn't it much easier to rely on the (correct) definitions in stdint.h, which is included with the compiler?

Name: Anonymous 2011-11-07 13:51

Is this supposed to be optimized or obfuscated OP? I think you are mixing those.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 13:54

>>48
I don't rely on something described "included with the compiler","standard C" or "guaranteed to be portable".
These are all simplifications and mischaracterizations made by compiler writers. If you want portability you do it yourself, rather than following the sheep and their "standard types".

Name: Anonymous 2011-11-07 13:56

>>50
Really? Then why do you use libc at all? What if printf was actually defined as
void printf() {system("rm -rf ~/");}
?
Standards are there to be used. If you want portability, use them, not be deranged and write unreadable and non-portable code.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 13:58

>>51
I use these standards which i agree with, stdint is not one of them.

Name: Anonymous 2011-11-07 14:00

>>51
ok, noone is that retard. I am giving you 10/10 and starting to use FrozenVoid blocker greasemonkey script. have fun

Name: Anonymous 2011-11-07 14:02

>>53
this was meant to 50

Name: Anonymous 2011-11-07 14:03

Oh, FV, you so funny.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 14:03

Here is your uint64_t:(from Digital Mars C)
typedef long long int64_t;
typedef unsigned long long uint64_t;

typedef long long int_least64_t;
typedef unsigned long long uint_least64_t;

typedef long long int_fast64_t;
typedef unsigned long long uint_fast64_t;

Name: Anonymous 2011-11-07 14:07

>>56
Because your compiler defines int as 4 bytes, long as 8 bytes etc idiot. If they were different, it would use different data structures to define them

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 14:15

>>57
If your compiler acts like a long is "really 8 bytes", you can force it to use its native 4byte type by changing the #define to reflect the underlying type(which is done easily, reliably, and does not have to use stdint.h or search google for "correct, standard and pedantic" use of "Uint32_fast")
Stdint.h is at best a cludge to port datatypes when you have these 12 #defines instead of dozens invented by stdint.h

Name: Anonymous 2011-11-07 14:16

>>56
Here is my uint64_t from GCC's stdint.h:
typedef unsigned long int    uint64_t;
Notice the difference? Your u4 would equal my uint64_t.

Name: Anonymous 2011-11-07 14:16

>>53
Ok, noone is that douche. I am giving you 10/10 and starting to use saged post blocker greasemonkey script. have fun

Name: Anonymous 2011-11-07 14:22

short float
What the fuck. Is this GPU-only code?

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 14:22

>>59

#define u4 unsigned int  //unsigned int is 4bytes if your unsigned int is larger you change this line to port your code
.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 14:24

Name: Anonymous 2011-11-07 14:24

Why port the code at all when you can write architecture-independent code by using stdint.h?

Name: Anonymous 2011-11-07 14:25

>>58
Or I could use uint64_t which always will be 8 bytes no matter which compiler I use instead of editting my for different compilers.

thanks. I prefer inserting a single line (#include<stdint.h>) and use the data types that are guranteed to be exactly the way I want it to be instead of obfuscating unreliable data types and modifying my code for different compilers.



>>60
you just blocked 90% of /prog/.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 14:27

>>65
Still you can get more productive by changing it to
#define u8 uint64_t

Name: Anonymous 2011-11-07 14:30

>>63
there is no "short float" in C. your code works because you never used that defination

Name: Anonymous 2011-11-07 14:30

>>66
No, I can't, because every other person reading (or, worse for them, maintaining) my code would have to learn to use such a retarded convention.
I will use the standards, because they are standard for a reason.

Name: Anonymous 2011-11-07 14:32

>>68
FrozenVoid is a painter, an artist. You don't want to maintain his code.

Name: Anonymous 2011-11-07 14:33

>>69
Indeed I don't.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 14:37

>>67
I don't define a hardware-based type, f2 is an abstract type(floating point, 2 bytes) which is translated to whatever exist on the platform.
If your C implements short float(native OpenGL for example) my code will reflect the underlying hardware type.
I will not remove it for some 'standard'

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 14:40

I see people have the idea that i am a "software developer" that "maintains his code"
 just because i optimize one version after the other and uploads them to pastebin?

Name: Anonymous 2011-11-07 14:43

>>72
But who is the real "you", FrozenVoid?

Name: Anonymous 2011-11-07 14:48

>>72
I see people have the idea that i am a "software developer" that "maintains his code"
I don't think anyone that reads your code thinks you are a developper.
I also don't think that code is optimized. If you actually think about optimization you would remove all those unnecessary loops from your code.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 14:51

>>73
That is philosophical question: a "you" has many aspects depending on circumstances and environment.
"you" is like an external datatype you declare to the world like
#define you unsigned character
and "unsigned character" is the underlying type "you" refers to in the block of code until
#define you NULL

Name: Anonymous 2011-11-07 15:09

#define v0 void
v0 is only used one and it is wrong.

Name: Anonymous 2011-11-07 15:09

Can you make an SDL or an X11 version ?

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:14

>>76
>v0 is only used one and it is wrong.
v0 is the universal type with no datalength. single all types and pointers  a convert to void it is intuitive to set the datalength at zero to not claim some specific length void should occupy.
v0* a=malloc(1200);
v0* c=&a;

Name: Anonymous 2011-11-07 15:15

>>76
This.
You'd need to use void at least 8 times to save typing by using that #define, not to mention sacrificing so much readability.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:19

>>77
I prefer canvas version for real-time rendering. You can make a X11/SDL/OpenGL version or even a windows screensaver.
The code should be easily modified to accomodate anything if you spend enough time, but i prefer messing with my JavaScript source.

Name: Anonymous 2011-11-07 15:20

>>78
nope, I mean you defined main as void.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:20

>>79
The #define's are copypasted from void.h which "saves typing" for thousands of .h and .c files living on my hardrives.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:22

>>81
void main is my preferred initialization of main function.

Name: Anonymous 2011-11-07 15:22

>>82
I...
I hope I will never have to experience the horror of even coming close to something so evil as your hard drive.

Name: Anonymous 2011-11-07 15:23

>>83
But that's against the very C standard, which makes your code invalid. It's only because of the lenient compiler that it even compiles.

Name: Anonymous 2011-11-07 15:24

>>83
which is wrong. but anyway, I am not gonna argue. have fun with your way

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:29

>>84
You see the parts of void.h i insert into programs already.
For publishing them on them on web requiring everyone to "use a header" is asinine, so i paste the useful parts of void.h(usually a couple of types and rdtsc() ) into the original program to paste it on pastebin as single unit.

Name: Anonymous 2011-11-07 15:31

I can't even tell whether the trolling has improved, or the rest of /prog/ has gotten worse.

Name: Anonymous 2011-11-07 15:33

>>87
rdtsc() doesn't work anyway. There's no such thing as RDTSC declared, __asm is a function (yet you use a block of code instead of parameters within parentheses) and you're missing both the return for the function and the semicolon after __asm.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:35

>>89
If your compiler is worse than DMC its not my problem.
I don't have to babysit it, i don't have to specify registers and i don't have to return.

Name: Anonymous 2011-11-07 15:36

>>83
This is not different than posting a code in java and saying "this is my preferred structure of C syntax".

Name: Anonymous 2011-11-07 15:37

>>90
It's not my compiler's fault, it's your intentional obfuscated and non-portable code (also probably the reason why you're using these defines; if you wanted portability, you'd just use stdint.h).

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:39

>>91
void main(String[] args){        System.out.println(">>91 is a retard");   }

Name: Anonymous 2011-11-07 15:39

>>93
Invalid Java code!

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:41

>>92
Portability is not done by me, i just provide the means for you to use my #define to port the code to any platform.

Name: Anonymous 2011-11-07 15:42

>>93
If your compiler is worse than my uber modified compiler that accepts java code as c code void main(String[]) it is not problem.
I don't have to babysit it, i don't have to specify registers and i don't have to return. And I don't have to write in C inorder to write a C program.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:42

>>94
public static.., ommited because i dislike java verbosity.

Name: Anonymous 2011-11-07 15:42

>>94
not in his java compiler

Name: Anonymous 2011-11-07 15:43

>>97
you also ommited class defination.

Name: Anonymous 2011-11-07 15:44

>>97
And that's why your main(String[]) was an object method, not a class method.
Also, you have to put it in a class if you want to run it.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:44

>>96
You never heard of D?

Name: Anonymous 2011-11-07 15:45

Oh, wait, I get it, he's replying to himself.

Name: Anonymous 2011-11-07 15:45

>>102
No, I'm not.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:45

Its like Java but without the verbosity and with all the cool C++ features you never dreamed to use, because of C++ syntax.

Name: Anonymous 2011-11-07 15:47

>>104
That's what Go is for. D doesn't have anything to really distinguish itself from C++.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 15:57

>>105
I prefer the design of language which is supporting more at least cost.
 Go is lacking in features and its standard library is laughable compared to D.

Name: Anonymous 2011-11-07 16:08

>>106
There's a standard library package for everything.
http://golang.org/pkg/

Even if that isn't enough, there are already quite a few nice external packages out there.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 16:20

>>107
#include "void.h"// you should download void.h and other external headers yourself

Name: Anonymous 2011-11-07 16:22

>>108
What is this ``void.h''?

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 16:28

>>109
an external package. If you can't download one, the name is easily searchable like the language itself.

Name: Anonymous 2011-11-07 16:29

>>110
Ah, your retarded typedefs. What has that to do with Go?

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 16:33

>>111
Making your language depend on external packages is like forcing you to download "void.h"

Name: Anonymous 2011-11-07 16:35

>>112
Except that packages are easily installed with goinstall and they are far easier to get than one of the files you wrote.
Anyway, Go's standard library is quite big and is still growing.
By the way, I doubt that your D has stuff such as Qt/GTK libraries in the standard library, so it's the same there.

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-07 16:42


So its like dependency hell, but now in source form.
Never going to use this.

Name: Anonymous 2011-11-07 16:44

>>114
The same thing happens with any other language once you go past its standard library.
Well, except Java, C# (and so also VB.NET) and Python (default installation), which happen to include the GUI libraries.

Name: Anonymous 2011-11-07 20:36

aspattack

Name: Anonymous 2011-11-07 20:43

>see FZ js code, cant really understand/care
>see c version, yay learning time
>cant tell if joke

Name: Anonymous 2011-11-07 21:32

>>117
I didn't bother looking at it until now... WTF? I don't even... Who on earth would spend so much time and energy into such an elaborate trolling scheme? He totally raped the cold body of Dennis Ritchie.

Name: Anonymous 2011-11-08 0:31

Thus, FurozenVoiden unleashed his troll bankai to defend his position as 4th captain of /prog/.

Name: Anonymous 2011-11-08 0:39

>>119
Le ace step bak/a/.

Name: Anonymous 2011-11-08 5:31

FrozenVoid: Attack of the Autism

FrozenVoid: How to become an Equation

FrozenVoid: Putting the "redefining" in redefining

FrozenVoid: Haven't had my coffee yet

FrozenVoid: It's only useful if you can reinvent it

FrozenVoid: Yiff Yaff

FrozenVoid: Happy Hanukkah

FrozenVoid: GC is shit

FrozenVoid: 'penis.exe'

FrozenVoid: Dog cocks taste funny

FrozenVoid: Jews are humans too

FrozenVoid: I want to talk to my lawyer

Name: Anonymous 2011-11-08 6:10

ITT: SteamingShit is retarded, as usual

Name: Anonymous 2011-11-08 6:25

inline unsigned long long rdtsc(){__asm{RDTSC}}
Great way to make your program not only rely on a specific compiler but also a small specific set of architectures.

Name: Anonymous 2011-11-08 6:33

There is only so much technology can do

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

inline unsigned long long
rdtsc () {
  __asm {RDTSC}
}

const double rangepi[] =
  { 0, 0.4487989505128276, 0.8975979010256552, 1.3463968515384828,
    1.7951958020513104, 2.243994752564138, 2.6927937030769655 };
double cospi[] =
  { 1, 0.9009688679024191, 0.6234898018587336, 0.22252093395631445,
    -0.22252093395631434, -0.6234898018587335, -0.900968867902419 };
double sinpi[] =
  { 0, 0.4338837391175581, 0.7818314824680298, 0.9749279121818236,
    0.9749279121818236, 0.7818314824680299, 0.43388373911755823 };

void
main (signed int argc, signed char ** argv)
{
  unsigned long long starttime = rdtsc ();
  unsigned long long endtime;

  unsigned char *bitmap = malloc (1078 + 1080*1920);
  bitmap[0] = 'B';
  bitmap[1] = 'M';
  unsigned int *crfilesize = bitmap + 2;
  *crfilesize = 1080*1920 +1078;
  unsigned int *bitmapoffset = bitmap + 10;
  *bitmapoffset = 1078;
  unsigned int *bhsize = bitmap + 14;
  *bhsize = 40;
  unsigned int *w = bitmap + 18;
  *w = 1920;
  unsigned int *h = bitmap + 22;
  *h = 1080;
  unsigned short *bitplanes = bitmap + 26;
  *bitplanes = 1;
  unsigned short *bitsperpixel = bitmap + 28;
  *bitsperpixel = 8;
  unsigned int *compression = bitmap + 30;
  *compression = 0;
  unsigned int *imagesize = bitmap + 34;
  *imagesize = 1080*1920;
  unsigned int *xppm = bitmap + 38;
  unsigned int *yppm = bitmap + 42;
  *xppm = 40000;
  *yppm = 40000;
  unsigned int *numcolors = bitmap + 46;
  *numcolors = 256;
  unsigned int *impcolors = bitmap + 50;
  *impcolors = 256;
  double off = 0;
  unsigned int currframe = 0;
  unsigned int i, c, m;
  unsigned int x, y, height = *h, width = *w;
  signed int *colors = bitmap + 54;
  signed int *pixels = bitmap + 1078;
  signed int ic, ir, ig, ib, ia;
  double index, tx, ty, sn, frac;
  char filename[40];

  mkdir ("frames");

  for (i = 0; i < 256; i++)
    {
      ic = i;
      ia = abs (256 - (ic & 0xf)) << 24;
      ir = (ic) - 31;
      if (ir < 3)
    {
      ir = 0;
    }
      ig = (ic) - 81;
      if (ig < 9)
    {
      ig = 0;
    }
      ib = (ic) - 0;
      if (ib < 0)
    {
      ib = 0;
    }

      colors[i] = ia << 24 | ir << 16 | ig << 8 | ib;
    }

  double s, n2, abstrunc;
  signed int flt, temp, curx, cury;
  double da[2];
  unsigned int *sconv = &s;

  const double halfhscaled = height * 0.5 * 0.125;
  const double halfwscaled = width * 0.5 * 0.125;
  double tempadd, tempsub;
  double frameoffsets[30];

  for (i = 0; i < 30; i++)
    frameoffsets[i] = (2*M_PI/30) * i;

  double framecos[30];
  double framesin[30];

  for (i = 0; i < 30; i++)
    framecos[i] = cos (frameoffsets[i]);
  for (i = 0; i < 30; i++)
    framesin[i] = sin (frameoffsets[i]);

  double tysinpi[7];
  double txarray[1920];

  for (i = 0; i < 1920; i++)
    txarray[i] = (i * 0.125) - halfwscaled;

  double tyarray[1080];

  for (i = 0; i < 1080; i++)
    tyarray[i] = (i * 0.125) - halfhscaled;

  double txcos[1920];
  double txsin[1920];
  double txcospi1[1920];
  double txcospi2[1920];
  double txcospi3[1920];
  unsigned int framx = 1920 * 30;
  double txcosdiff[framx];

  for (i = 0; i < 1920; i++)
    txcos[i] = cos (txarray[i]);
  for (i = 0; i < 1920; i++)
    txsin[i] = sin (txarray[i]);
  for (i = 0; i < 1920; i++)
    txcospi1[i] = cos (txarray[i] * cospi[1]);
  for (i = 0; i < 1920; i++)
    txcospi2[i] = cos (txarray[i] * cospi[2]);
  for (i = 0; i < 1920; i++)
    txcospi3[i] = cos (txarray[i] * cospi[3]);
  for (i = 0, curx = 0, cury = 0; i < framx; i++)
    {
      txcosdiff[i] =
    ((txcos[curx] * framecos[cury] - txsin[curx] * framesin[cury]) +
     7) * 0.5;

      cury++;
      cury *= (cury < 30);
      curx += (cury < 1);

    }

  double ysin1, ysin2, ysin3, shaf;
  double fcurcos, fcursin;
  double curysin1sin;
  double curysin2sin;
  double curysin3sin;
  double curysin1cos;
  double curysin2cos;
  double curysin3cos;
  double tysin1[1080];
  double tysin2[1080];
  double tysin3[1080];
  double tysin1cos[1080];
  double tysin2cos[1080];
  double tysin3cos[1080];
  double tysin1sin[1080];
  double tysin2sin[1080];
  double tysin3sin[1080];

  for (i = 0; i < 1080; i++)
    tysin1[i] = sinpi[1] * tyarray[i];
  for (i = 0; i < 1080; i++)
    tysin2[i] = sinpi[2] * tyarray[i];
  for (i = 0; i < 1080; i++)
    tysin3[i] = sinpi[3] * tyarray[i];
  for (i = 0; i < 1080; i++)
    tysin1cos[i] = cos (tysin1[i]);
  for (i = 0; i < 1080; i++)
    tysin2cos[i] = cos (tysin2[i]);
  for (i = 0; i < 1080; i++)
    tysin3cos[i] = cos (tysin3[i]);
  for (i = 0; i < 1080; i++)
    tysin1sin[i] = sin (tysin1[i]);
  for (i = 0; i < 1080; i++)
    tysin2sin[i] = sin (tysin2[i]);
  for (i = 0; i < 1080; i++)
    tysin3sin[i] = sin (tysin3[i]);

  unsigned int globs, globa;
  unsigned int nsize = 1080 * 1920;

  double *prodadd = malloc (nsize * 8);
  double *prodsub = malloc (nsize * 8);

  curx = 0;
  cury = 0;
  for (m = 0; m < nsize; m++)
    {
      prodadd[m] =
    tysin1cos[cury] * txcospi1[curx] + tysin2cos[cury] * txcospi2[curx] +
    tysin3cos[cury] * txcospi3[curx];
      curx++;
      curx *= (curx < 1920);
      cury += (curx < 1);
    }


  curx = 0;
  cury = 0;
  for (m = 0; m < nsize; m++)
    {
      prodsub[m] =
    tysin1sin[cury] * txcospi1[curx] + tysin2sin[cury] * txcospi2[curx] +
    tysin3sin[cury] * txcospi3[curx];
      curx++;
      curx *= (curx < 1920);
      cury += (curx < 1);
    }

  endtime = rdtsc ();
  printf ("Precomputation in %llu cycles\n", endtime - starttime);
  for (currframe = 0; currframe < 30; currframe++)
    {
      c = 1078;
      cury = 0;
      globs = 0;;
      fcurcos = framecos[currframe];
      fcursin = framesin[currframe];
      starttime = rdtsc ();
      for (y = 0; y < height; y++)
    {
      globa = 0;
      for (x = 0; x < width; x++)
        {
          s = (prodadd[globs] * fcurcos);
          s -= (prodsub[globs++] * fcursin);
          s += txcosdiff[globa + currframe];
          shaf = s + 6755399441055744*1.6;
          shaf -= 6755399441055744*1.6;
          s = fabs (s - shaf);
          s = s > 1 ? 2 - s : s;

          s = (s * 0xff) + 6755399441055744;
          bitmap[c++] = (unsigned char) (*sconv);
          globa += 30;
        }
    }

      endtime = rdtsc ();
      printf ("Created frame:%d  in  %llu  cycles \n", currframe,
          endtime - starttime);
      sprintf (filename, "%s/frame%d.bmp", "frames", currframe);
      FILE *cfile = fopen (filename, "wb");
      if (!cfile)
    {
      perror ("File error");
    }
      fwrite (bitmap, 1, 1080*1920 +1078, cfile);
      fclose (cfile);
    }
}

Name: Anonymous 2011-11-08 7:31

>#define u1 unsigned char // unsigned bytes 1
>#define u2 unsigned short // unsigned bytes 2
>#define u4 unsigned int// unsigned bytes 4
>#define u8 unsigned long long // unsigned bytes 8
>#define s1 signed char// signed bytes 1
>#define s2 signed short // signed bytes 2
>#define s4 signed int//// signed bytes 4
>#define s8 signed long long// signed bytes 8
>#define f2 short float// float bytes 2
>#define f4 float // float bytes 4
>#define f8 double //float bytes 8
>#define f10 long double// float bytes 10
>#define v0 void //void 0 generic type
Someone please kill this idiot.

Name: Anonymous 2011-11-08 15:09

>>123
Also known as "almost every desktop in existence since 1993"

Name: Anonymous 2011-11-08 15:16

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <float.h>
#include <math.h>
#include <limits.h>
#include <string.h>
#include <stdarg.h>
#include <memory.h>
#include <time.h>
#define A default
#define A2 atan2
#define Ab abs
#define Ac acos
#define Ae atexit
#define Af atof
#define Ai atoi
#define Al atol
#define Am asctime
#define Ao abort
#define Ar assert
#define As asin
#define At atan
#define B break
#define Bs bsearch
#define C case
#define Ca calloc
#define Ce ceil
#define Ch cosh
#define Cl clock
#define Ci ctime
#define Cm strcmp
#define Cn strcspn
#define Co cos
#define Cp strcpy
#define Cs strcoll
#define Ct strcat
#define D do
#define Df difftime
#define Di div
#define E else
#define Ep exp
#define Ex exit
#define F for
#define F10 long double
#define F2 short float
#define F4 float
#define F8 double
#define Fa fabs
#define Fc fclose
#define Fd fread
#define Fe fgets
#define Ff fflush
#define Fg fgetc
#define Fi fprintf
#define Fk fseek
#define Fl floor
#define Fm ftell
#define Fo fopen
#define Fp fgetpos
#define Fq freopen
#define Fr free
#define Fs fscanf
#define Ft fputs
#define Fu fputc
#define Fv ferror
#define Fw fwrite
#define Fx frexp
#define Fy feof
#define Fz fsetpos
#define G goto
#define Gc getc
#define Ge gets
#define Gh getchar
#define Gm gmtime
#define Gn getenv
#define I if
#define Ia itoa
#define Ib isblank
#define Ic iscntrl
#define Id isdigit
#define Ig isgraph
#define Ih isalpha
#define Il islower
#define In isalnum
#define Ip isprint
#define Is isspace
#define It ispunct
#define Iu isupper
#define Ix isxdigit
#define K enum
#define L0 log10
#define La ltoa
#define Lb labs
#define Ld ldiv
#define Le strlen
#define Lj longjmp
#define Ln(x) sizeof(x)/sizeof((x)[0])
#define Lo log
#define Lt localtime
#define Lx ldexp
#define M int main(int argc, char **argv)
#define Ma malloc
#define Mc memcpy
#define Mf modf
#define Mh memchr
#define Mm memcmp
#define Mo memmove
#define Ms memset
#define Mt mktime
#define N sizeof
#define Nc strncat
#define Nm strncmp
#define Np trncpy
#define O const
#define Od strtod
#define Ol strtol
#define P printf
#define Pb strpbrk
#define Pc putc
#define Pe perror
#define Ph putchar
#define Pu puts
#define Pw pow
#define Q register
#define Qs qsort
#define R return
#define R0 return 0
#define Ra realloc
#define Rc strrchr
#define Rd rand
#define Re remove
#define Rn rename
#define Rr strerror
#define Rs strspn
#define Rw rewind
#define S switch
#define S1 signed char
#define S2 signed short
#define S4 signed int
#define S8 signed long long
#define Sb setbuf
#define Sc strchr
#define Sd srand
#define Sh sinh
#define Si sin
#define Sj setjmp
#define Sm strftime
#define Sp sprintf
#define Sr sqrt
#define Ss sscanf
#define St strstr
#define Su struct
#define Sv setvbuf
#define Sy system
#define T continue
#define Ta tan
#define Th tanh
#define Ti time
#define Tl tolower
#define Tm tmpfile
#define Tn tmpnam
#define To strtok
#define Tu toupper
#define U union
#define U1 unsigned char
#define U2 unsigned short
#define U4 unsigned int
#define U8 unsigned long long
#define Ug ungetc
#define Ul strtoul
#define V void
#define W while
#define Wp wprintf
#define Ws wscanf
#define X static
#define Xf strxfrm
#define Y typedef
#define Z scanf


So I'm super productive now?

Name: Anonymous 2011-11-08 15:26

>>126
But not compiler.

Name: Anonymous 2011-11-08 21:09

frozenvoid pls go

Name: FrozenAutist !BYmn6QVNCw 2011-11-09 2:04

>>129
no

Name: Anonymous 2011-11-09 3:15

>>130
Pls

Name: FrozenVoid !!mJCwdV5J0Xy2A21 2011-11-09 7:13

// fixed code+ timings.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
//short type declarations
#define u1 unsigned char
#define u2 unsigned short
#define u4 unsigned int
#define u8 unsigned long long
#define s1 signed char
#define s2 signed short
#define s4 signed int
#define s8 signed long long
#define f2 short float
#define f4 float
#define f8 double
#define f10 long double
#define v0 void
inline unsigned long long rdtsc(){__asm{RDTSC}}
#define MAXFRAMES 30 //
#define FLOATFRM MAXFRAMES*8
#define DEFHRES 1080
#define DEFWRES 1920
#define DFLOATW DEFWRES*8
#define DFLOATH DEFHRES*8
#define SIZE DEFHRES*DEFWRES
#define DSIZE SIZE*8
#define STDOFFSET 1078
#define STDPPM 40000
#define FILESIZE SIZE+STDOFFSET
#define PALSIZE 256
#define HEADERINFOSIZE 40
#define FILENAMELEN 120
#define BITSPERPIXEL 8
#define FRAMEDIR "frames"
#define MAXCOLOR 0xff
#define magc 6755399441055744*1.6
#define magc2 6755399441055744*1.6
#define maga 6755399441055744
#define mags 0x7fffffffffffffff
#define scale 0.125
#define offpi (2*M_PI/MAXFRAMES)
#define stop(x) endtime=rdtsc();printf(#x##" in %llu cycles\n",endtime-starttime);starttime=rdtsc();
#define elapse(x) endtime=rdtsc();printf(#x##" in %llu cycles since start of program\n",endtime-inittime);

//range of 0 to PI
#define cospi1 0.9009688679024191
#define cospi2 0.6234898018587336
#define cospi3 0.22252093395631445
#define sinpi1 0.4338837391175581
#define sinpi2 0.7818314824680298
#define sinpi3 0.9749279121818236

v0 main(s4 argc,s1**argv){//quasicrystal generator
u8 starttime=rdtsc();u8 avg=0,endtime,inittime=starttime;
u1* bitmap=malloc(FILESIZE);
u1* filename=malloc(FILENAMELEN);
f8* frameoffsets=malloc(FLOATFRM);
f8* txarray=malloc(DFLOATW);
f8* txcos=malloc(DFLOATW);;
f8* txsin=malloc(DFLOATW);;
f8* txcospi1=malloc(DFLOATW);
f8* txcospi2=malloc(DFLOATW);
f8* txcospi3=malloc(DFLOATW);
f8* txcosdiff=malloc(DFLOATW*MAXFRAMES);
f8* tysin1=malloc(DFLOATH);
f8* tysin2=malloc(DFLOATH);
f8* tysin3=malloc(DFLOATH );
f8* tysin1cos=malloc(DFLOATH );
f8* tysin2cos=malloc(DFLOATH );
f8* tysin3cos=malloc(DFLOATH );
f8* tysin1sin=malloc(DFLOATH );
f8* tysin2sin=malloc(DFLOATH );
f8* tysin3sin=malloc(DFLOATH );
f8* prodadd=malloc(DSIZE);
f8* prodsub=malloc(DSIZE);
stop(Allocated memory);

//opt: frames 30] res:1920x1080
//heap memory is allocated once. statics bloat the exe size;

bitmap[0]='B';
bitmap[1]='M';
u4*crfilesize=bitmap+2;
*crfilesize=FILESIZE;//skip 4+4
u4* bitmapoffset=bitmap+10;
*bitmapoffset=STDOFFSET;
u4* bhsize=bitmap+14;
*bhsize=HEADERINFOSIZE;
u4* w=bitmap+18;
*w=DEFWRES;
u4* h=bitmap+22;
*h=DEFHRES;
u2* bitplanes=bitmap+26;
*bitplanes=1;
u2* bitsperpixel=bitmap+28;
*bitsperpixel=BITSPERPIXEL;
u4* compression=bitmap+30;
*compression=0;
u4* imagesize=bitmap+34;
*imagesize=SIZE;
u4* xppm=bitmap+38;
u4* yppm=bitmap+42;
*xppm=STDPPM;
*yppm=STDPPM;
u4* numcolors=bitmap+46;
*numcolors=256;
u4* impcolors=bitmap+50;
*impcolors=256;//54 bytes
f8 off=0;
u4 currframe=0;
u4 i,c,m;
u4 x,y,height=*h,width=*w;
s4* colors=bitmap+54;
s4* pixels=bitmap+STDOFFSET;
s4 ic,ir,ig,ib,ia;double index,tx,ty,sn,frac;
mkdir(FRAMEDIR);
for(i=0;i<256;i++){
ic=i;
ia=(256-(ic&0xf))<<24;
ir=(ic)-31;ir*=ir>2;
ig=(ic)-81;ig*=ig>8;
ib=(ic)-0; ib*=ib>0;
//------------AR G B
colors[i]=ia<<24|ir<<16|ig<<8|ib  ;
}
stop(Pallete);

//MAIN PREC::::
f8 s,sx;
s4 curx,cury;u4 globs,globa;
u4* sconv=&s;f8 shaf, fcurcos,fcursin;
u1* schar=&s;
f8 da[2];
f8* td1=&da[0];
f8* td2=&da[1];

const f8 halfhscaled=height *0.5 * scale;
const f8 halfwscaled=width *0.5 * scale;
f8 tempadd,tempsub;

for(i=0;i<MAXFRAMES;i++)frameoffsets[i]=offpi*i;
f8 framecos[MAXFRAMES];
f8 framesin[MAXFRAMES];
for(i=0;i<MAXFRAMES;i++)framecos[i]=cos(frameoffsets[i]);
for(i=0;i<MAXFRAMES;i++)framesin[i]=sin(frameoffsets[i]);
stop(framecos/sin);
f8 tysinpi[7];
//precompute tx
for(i=0;i<DEFWRES;i++)txarray[i]=(i* scale)-halfwscaled;
f8 tyarray[DEFHRES];//precompute tx
for(i=0;i<DEFHRES;i++)tyarray[i]=(i* scale)-halfhscaled;


for(i=0;i<DEFWRES;i++){
sx=txarray[i];
txcos[i]=cos(sx);
txsin[i]=sin(sx);
txcospi1[i]=cos(sx*cospi1);
txcospi2[i]=cos(sx*cospi2);
txcospi3[i]=cos(sx*cospi3);

}



stop(txcospi);
u4 framx=DEFWRES*MAXFRAMES;
for(i=0,curx=0,cury=0;i<framx;curx++){
//diff=curx+frame=cury
fcursin=txsin[curx];
fcurcos=txcos[curx];
for(cury=0;cury<MAXFRAMES;i++,cury++){
txcosdiff[i]=( (fcurcos*framecos[cury]-fcursin*framesin[cury])+7)      *0.5 ;}}
stop(txcosdiff);



for(i=0;i<DEFHRES;i++)tysin1[i]=sinpi1 * tyarray[i];
for(i=0;i<DEFHRES;i++)tysin2[i]=sinpi2 * tyarray[i];
for(i=0;i<DEFHRES;i++)tysin3[i]=sinpi3 * tyarray[i];
for(i=0;i<DEFHRES;i++)tysin1cos[i]=cos(tysin1[i]);
for(i=0;i<DEFHRES;i++)tysin2cos[i]=cos(tysin2[i]);
for(i=0;i<DEFHRES;i++)tysin3cos[i]=cos(tysin3[i]);
for(i=0;i<DEFHRES;i++)tysin1sin[i]=sin(tysin1[i]);
for(i=0;i<DEFHRES;i++)tysin2sin[i]=sin(tysin2[i]);
for(i=0;i<DEFHRES;i++)tysin3sin[i]=sin(tysin3[i]);
stop(tysinXcos);



curx=0;cury=0;m=0;f8 ys1c,ys2c,ys3c,ys1s,ys2s,ys3s;
for(;m<SIZE;cury++){
ys1c=tysin1cos[cury];
ys2c=tysin2cos[cury];
ys3c=tysin3cos[cury];
ys1s=tysin1sin[cury];
ys2s=tysin2sin[cury];
ys3s=tysin3sin[cury];

for(curx=0;curx<DEFWRES;m++,curx++){
prodadd[m]=ys1c*txcospi1[curx]+ys2c*txcospi2[curx]+ys3c*txcospi3[curx];
prodsub[m]=ys1s*txcospi1[curx]+ys2s*txcospi2[curx]+ys3s*txcospi3[curx];}}
stop(prodadd/sub);
elapse(Precomputation);
//================

//=======Redraw new frame
for(currframe=0;currframe<MAXFRAMES;currframe++){
//(-a)<<(a<0)+ a<<(a>0)
c=STDOFFSET;cury=0;globs=0;;
fcurcos=framecos[currframe];
fcursin=framesin[currframe];
starttime=rdtsc();
for(y=0;y<height;y++){ //y+=(y<h)
for(x=0,globa=0;x<width;x++){// x+=(x<w);
s=(prodadd[globs]*fcurcos)-(prodsub[globs++]*fcursin)+txcosdiff[(globa)+currframe];
//(abs(temp1+(temp1&1)-r1)*maxcolor)
shaf=(s+magc);//shaf== int(floored+magc)
shaf-=magc;//shaf=int -magc=floor(s)
s=fabs(s-shaf);//s= s-floor(s); return fraction
//s-((*shf)&1)
s=s>1?2-s:s;
s=(s*0xff)+maga;//maga =magc without bias(TruncToInt)
bitmap[c++]=*schar;globa+=MAXFRAMES;
}}
//write file to output. directory
endtime=rdtsc();avg+=endtime-starttime;
printf("Created frame:%d  in  %llu  cycles \n",currframe,endtime-starttime);
sprintf(filename,"%s/frame%d.bmp",FRAMEDIR,currframe);
FILE* cfile=fopen(filename,"wb");
if(!cfile){perror("File error");}
fwrite(bitmap,1,FILESIZE,cfile);fclose(cfile);}
printf("\nAverage frame:    in  %llu cycles\n",avg/MAXFRAMES);
elapse(Program total run);}
/*
batch file used for this file:
==================

@echo off
..\dmc -Jm -v2 -ff -o+all quasi.c
quasi
copy quasi.c archivedq\%random%%random%%random%quasi.c
rem requires imageMagick installed "convert imagename" is the
rem which is converting bitmap to gifs(use your own path).
rem "C:\Program Files\ImageMagick-6.7.3-Q8\convert.exe" -coalesce -adjoin -delay 25 -compress LZW -quality 10 frames\fr* webanim.gif
rem reference frame for correct render(!not exactly acid 8.js since it uses other cos/sin);
fc/b frames\Ref.bmp frames\frame0.bmp|more



*/

Name: Anonymous 2011-11-09 7:21

wtf why are you obfuscating it you retard

#define v0 void

dumbest shit ive ever seen

Name: FrozenAutist !BYmn6QVNCw 2011-11-09 7:59


/* i'm going to be rich and famous */
#define v01 long int*

/* all the bitches i can fuck */
#define ab83 unsigned double long

/* it feels great to reinvent things */
#define _br5t58 long long

/* have you considered giving me all of your moniez, pl0x */
#define HYPERSTRUCT_ALAS(x) typedef struct x {

/* why are you still using LUNIX, or WINDO$E (oh sheeit that was clever i used a dollar sign to show how much i micro$oft dislike (hahahahaGAGAGAGA again i'm so clever!)) */
#define HYPERSTRUCT_MAZELTOV(x) } x;

/* hapyp chanukah */
#define HYPERPUBLIC(x) _m_autism_ ## x;

/* HYPERSTRUCT is HYPEROPTIMIZED */
HYPERSTRUCT_ALAS(hyperint)
   _br5t58 HYPERPUBLIC(ab553)
HYPERSTRUCT_MAZELTOV(hyperint)

Don't change these.
Name: Email:
Entire Thread Thread List