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.
>>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:
Anonymous2011-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!!mJCwdV5J0Xy2A212011-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?
>>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!!mJCwdV5J0Xy2A212011-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:
Anonymous2011-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.
>>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!!mJCwdV5J0Xy2A212011-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!!mJCwdV5J0Xy2A212011-11-07 12:34
>>12
Its easier when you read what they mean in >>11
Name:
Anonymous2011-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!!mJCwdV5J0Xy2A212011-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:
Anonymous2011-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!!mJCwdV5J0Xy2A212011-11-07 12:50
>>19
Anytime you like you can change 1 define and its fixed for all code.
>>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!!mJCwdV5J0Xy2A212011-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:
Anonymous2011-11-07 12:53
>>20
Or not have to change it at all because you use the normal type names.
>>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.
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:
Anonymous2011-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!!mJCwdV5J0Xy2A212011-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!!mJCwdV5J0Xy2A212011-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
>>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!!mJCwdV5J0Xy2A212011-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)
>>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!!mJCwdV5J0Xy2A212011-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:
Anonymous2011-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.
>>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!!mJCwdV5J0Xy2A212011-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:
Anonymous2011-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)?
>>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:
Anonymous2011-11-07 13:41
>>45
On my computer, half of these declarations are wrong.
Name:
FrozenVoid!!mJCwdV5J0Xy2A212011-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:
Anonymous2011-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?
Is this supposed to be optimized or obfuscated OP? I think you are mixing those.
Name:
FrozenVoid!!mJCwdV5J0Xy2A212011-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:
Anonymous2011-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!!mJCwdV5J0Xy2A212011-11-07 13:58
>>51
I use these standards which i agree with, stdint is not one of them.
>>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!!mJCwdV5J0Xy2A212011-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:
Anonymous2011-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:
Anonymous2011-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
>>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.
>>65
Still you can get more productive by changing it to
#define u8 uint64_t
Name:
Anonymous2011-11-07 14:30
>>63
there is no "short float" in C. your code works because you never used that defination
Name:
Anonymous2011-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:
Anonymous2011-11-07 14:32
>>68
FrozenVoid is a painter, an artist. You don't want to maintain his code.
>>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!!mJCwdV5J0Xy2A212011-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?
>>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!!mJCwdV5J0Xy2A212011-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:
Anonymous2011-11-07 15:09
#define v0 void
v0 is only used one and it is wrong.
Name:
Anonymous2011-11-07 15:09
Can you make an SDL or an X11 version ?
Name:
FrozenVoid!!mJCwdV5J0Xy2A212011-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:
Anonymous2011-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!!mJCwdV5J0Xy2A212011-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.
>>83
which is wrong. but anyway, I am not gonna argue. have fun with your way
Name:
FrozenVoid!!mJCwdV5J0Xy2A212011-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.
I can't even tell whether the trolling has improved, or the rest of /prog/ has gotten worse.
Name:
Anonymous2011-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!!mJCwdV5J0Xy2A212011-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.
>>83
This is not different than posting a code in java and saying "this is my preferred structure of C syntax".
Name:
Anonymous2011-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!!mJCwdV5J0Xy2A212011-11-07 15:39
>>91
void main(String[] args){ System.out.println(">>91 is a retard"); }
>>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!!mJCwdV5J0Xy2A212011-11-07 15:42
>>94
public static.., ommited because i dislike java verbosity.
Its like Java but without the verbosity and with all the cool C++ features you never dreamed to use, because of C++ syntax.
Name:
Anonymous2011-11-07 15:47
>>104
That's what Go is for. D doesn't have anything to really distinguish itself from C++.
Name:
FrozenVoid!!mJCwdV5J0Xy2A212011-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.
>>109
an external package. If you can't download one, the name is easily searchable like the language itself.
Name:
Anonymous2011-11-07 16:29
>>110
Ah, your retarded typedefs. What has that to do with Go?
Name:
FrozenVoid!!mJCwdV5J0Xy2A212011-11-07 16:33
>>111
Making your language depend on external packages is like forcing you to download "void.h"
Name:
Anonymous2011-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!!mJCwdV5J0Xy2A212011-11-07 16:42
So its like dependency hell, but now in source form.
Never going to use this.
Name:
Anonymous2011-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:
Anonymous2011-11-07 20:36
aspattack
Name:
Anonymous2011-11-07 20:43
>see FZ js code, cant really understand/care
>see c version, yay learning time
>cant tell if joke
Name:
Anonymous2011-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:
Anonymous2011-11-08 0:31
Thus, FurozenVoiden unleashed his troll bankai to defend his position as 4th captain of /prog/.
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:
Anonymous2011-11-08 6:10
ITT: SteamingShit is retarded, as usual
Name:
Anonymous2011-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.
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;
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;
>>123
Also known as "almost every desktop in existence since 1993"
Name:
Anonymous2011-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
//=======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:
Anonymous2011-11-09 7:21
wtf why are you obfuscating it you retard
#define v0 void
dumbest shit ive ever seen
Name:
FrozenAutist!BYmn6QVNCw2011-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;