File:Mandelbrot Set Color Cycling Animation 600px.gif

Summary

Description
English: The piece of Mandelbrot Set

Coordinates: -1.96680095, 0.00000478

Width: 0.00000014
Русский: Участок множества Мандельброта

Координаты: -1.96680095, 0.00000478

Ширина изображения: 0.00000014
Date
Source Own work
Author Aokoroko

Source code

This is the Pascal language. This code can be compiled in Delphi or Free Pascal.

{$APPTYPE CONSOLE}
{Author: https://commons.wikimedia.org/wiki/User:Aokoroko}

const
absc=-1.96680095; ordi=0.00000478; size=0.00000014;
horiz=4800; vert=4800;

var
f,g:file;
a,b,t:longint;
c,d,cc,dd,m,n,step,absc2,ordi2:extended;
s:array[0..61439]of byte;                                                                         
pal:array[0..255]of array[0..3]of byte;
h:array[0..13]of longint=($4D42,0,0,1078,40,0,0,$080001,0,0,2834,2834,0,0);
p:array[1..23041078]of byte;
o:array[1..4]of byte;
z:integer;
v,w:string;

begin
  h[5]:=horiz; h[6]:=vert;
  a:=horiz; if (a and 3<>0) then a:=(a+4) and $FFFFFFFC; h[9]:=a*vert; h[1]:=h[9]+1078;
  assign(f,'Mandelbrot0.bmp'); rewrite(f,1);
  blockwrite(f,h,2); blockwrite(f,h[1],52);
  for a:=0 to 254 do
  begin
    pal[a][0]:=round(127+127*cos(2*pi*(a+16)/255)); pal[a][1]:=round(127+127*sin(2*pi*(a+16)/255)); pal[a][2]:=Random(256); pal[a][3]:=0
  end;
  for a:=0 to 2 do pal[255][a]:=255; pal[255][3]:=0;
  blockwrite(f,pal,1024);
  step:=size/horiz;
  absc2:=absc-step*(horiz-1)/2; ordi2:=ordi-step*(vert-1)/2;
  for b:=0 to vert-1 do
  begin
    n:=ordi2+b*step;
    for a:=0 to horiz-1 do
    begin
      m:=absc2+a*step;
      c:=m; d:=n; t:=4081;
      repeat cc:=c*c; dd:=d*d; d:=(c+c)*d+n; c:=cc-dd+m; dec(t) until (t=0) or (cc+dd>1000000.0);
      if (t=0) then s[a]:=255 else s[a]:=t mod 255;
    end;
    blockwrite(f,s,h[9] div vert);
    write('We need 4800, but now: ',b+1,chr(13))
  end;
  close(f);

 for z:=1 to 254 do
 begin
  str(z,v);
  str(z-1,w);
  assign(f, 'Mandelbrot' + w + '.bmp');
  assign(g, 'Mandelbrot' + v + '.bmp');
  reset(f,1);
  rewrite(g,1);
  blockread(f,p,54);
  blockwrite(g,p,54);
  blockread(f,o,4);
  blockread(f,p,1016);
  blockwrite(g,p,1016);
  blockwrite(g,o,4);
  blockread(f,o,4);
  blockwrite(g,o,4);
  blockread(f,p,23040000);
  blockwrite(g,p,23040000);
  close(f);
  close(g);
  write('We need 254, but now: ',v,'     ',chr(13));
 end
end.

This results in 255 files. The latest ones need FFmpeg! Preferably https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n8.0-latest-win64-gpl-8.0.zip More than 8.0 is terrible in speed. However, you can always use FFmpeg https://ffmpeg.org//download.html So, ffmpeg takes a command line of 255 files and produces one "Mandelbrot Set Color Cycling Animation 600px.gif" Hooray! We did it!

ffmpeg -i Mandelbrot%%1d.bmp -vf zscale=w=600:h=600:filter=spline36 "Mandelbrot Set Color Cycling Animation 600px.gif"

And now FASM. FASM.EXE - one file! No more files needed. https://flatassembler.net/download.php For Windows. This action is extremely simple - drag the SplMandelbrot.asm file icon onto the FASM.EXE icon. This will trigger the "Open with" action. This will immediately create the SplMandelbrot.exe application in the folder. PROGRAM DESCRIPTION The SplMandelbrot application draws a full-screen section of the Mandelbrot set and displays an animation. The animation direction can be changed using the arrow keys on your computer keyboard. Two different coloring palettes can be selected using the F6 and F7 keys. Five different pre-selected points of interest on the Mandelbrot set can be selected using the F1, F2, F3, F4, and F5 keys. Left-clicking zooms in (magnifies) the image by 2x, right-clicking zooms out (zooms out) by 2x. You can save information about a favorite image to a file for later use by pressing the End key and then load it from the file by pressing the Ins key. To exit, press the Esc key. The animation is 60 frames per second. This is DwmFlush. And BitBlt for 1920 x 1080.

format PE GUI 4.0
entry start

macro invoke proc,[arg]
 { common
    if ~ arg eq
   reverse
     pushd arg
   common
    end if
    call [proc] }

macro proc [args]
 { common
    match name params, args>
    \{ define@proc name,<params \} }

prologue@proc equ prologuedef

macro prologuedef procname,flag,parmbytes,localbytes,reglist
 { if parmbytes | localbytes
    push ebp
    mov ebp,esp
    if localbytes
     sub esp,localbytes
    end if
   end if
   irps reg, reglist \{ push reg \} }

epilogue@proc equ epiloguedef

macro epiloguedef procname,flag,parmbytes,localbytes,reglist
 { irps reg, reglist \{ reverse pop reg \}
   if parmbytes | localbytes
    leave
   end if
   if flag and 10000b
    retn
   else
    retn parmbytes
   end if }

macro define@proc name,statement
 { local params,flag,regs,parmbytes,localbytes,current
   if used name
   name:
   match =stdcall args, statement \{ params equ args
				     flag = 11b \}
   match =stdcall, statement \{ params equ
				flag = 11b \}
   match =c args, statement \{ params equ args
			       flag = 10001b \}
   match =c, statement \{ params equ
			  flag = 10001b \}
   match =params, params \{ params equ statement
			    flag = 0 \}
   virtual at ebp+8
   match =uses reglist=,args, params \{ regs equ reglist
					params equ args \}
   match =regs =uses reglist, regs params \{ regs equ reglist
					     params equ \}
   match =regs, regs \{ regs equ \}
   match =,args, params \{ defargs@proc args \}
   match =args@proc args, args@proc params \{ defargs@proc args \}
   parmbytes = $ - (ebp+8)
   end virtual
   name # % = parmbytes/4
   all@vars equ
   current = 0
   match prologue:reglist, prologue@proc:<regs> \{ prologue name,flag,parmbytes,localbytes,reglist \}
   macro locals
   \{ virtual at ebp-localbytes+current
      macro label def \\{ match . type,def> \\\{ deflocal@proc .,label,<type \\\} \\}
      struc db [val] \\{ \common deflocal@proc .,db,val \\}
      struc du [val] \\{ \common deflocal@proc .,du,val \\}
      struc dw [val] \\{ \common deflocal@proc .,dw,val \\}
      struc dp [val] \\{ \common deflocal@proc .,dp,val \\}
      struc dd [val] \\{ \common deflocal@proc .,dd,val \\}
      struc dt [val] \\{ \common deflocal@proc .,dt,val \\}
      struc dq [val] \\{ \common deflocal@proc .,dq,val \\}
      struc rb cnt \\{ deflocal@proc .,rb cnt, \\}
      struc rw cnt \\{ deflocal@proc .,rw cnt, \\}
      struc rp cnt \\{ deflocal@proc .,rp cnt, \\}
      struc rd cnt \\{ deflocal@proc .,rd cnt, \\}
      struc rt cnt \\{ deflocal@proc .,rt cnt, \\}
      struc rq cnt \\{ deflocal@proc .,rq cnt, \\} \}
   macro endl
   \{ purge label
      restruc db,du,dw,dp,dd,dt,dq
      restruc rb,rw,rp,rd,rt,rq
      current = $-(ebp-localbytes)
      end virtual \}
   macro ret operand
   \{ match any, operand \\{ retn operand \\}
      match , operand \\{ match epilogue:reglist, epilogue@proc:<regs>
			  \\\{ epilogue name,flag,parmbytes,localbytes,reglist \\\} \\} \}
   macro finish@proc \{ localbytes = (((current-1) shr 2)+1) shl 2
			end if \} }

macro defargs@proc [arg]
 { common
    if ~ arg eq
   forward
     local ..arg,current@arg
     match argname:type, arg
      \{ current@arg equ argname
	 label ..arg type
	 argname equ ..arg
	 if dqword eq type
	   dd ?,?,?,?
	 else if tbyte eq type
	   dd ?,?,?
	 else if qword eq type | pword eq type
	   dd ?,?
	 else
	   dd ?
	 end if \}
     match =current@arg,current@arg
      \{ current@arg equ arg
	 arg equ ..arg
	 ..arg dd ? \}
   common
     args@proc equ current@arg
   forward
     restore current@arg
   common
    end if }

macro endp
 { purge ret,locals,endl
   finish@proc
   purge finish@proc
   restore regs@proc
   match all,args@proc \{ restore all \}
   restore args@proc
   match all,all@vars \{ restore all \} }


macro library [name,string]
 { forward
    local _label
    if defined name#.redundant
     if ~ name#.redundant
      dd RVA name#.lookup,0,0,RVA _label,RVA name#.address
     end if
    end if
    name#.referred = 1
   common
    dd 0,0,0,0,0
   forward
    if defined name#.redundant
     if ~ name#.redundant
      _label db string,0
	     rb RVA $ and 1
     end if
    end if }

macro import name,[label,string]
 { common
    if defined name#.referred
     name#.lookup:
   forward
     if used label
      if string eqtype ''
       local _label
       dd RVA _label
      else
       dd 80000000h + string
      end if
     end if
   common
     if $ > name#.lookup
      name#.redundant = 0
      dd 0
     else
      name#.redundant = 1
     end if
     name#.address:
   forward
     if used label
      if string eqtype ''
       label dd RVA _label
      else
       label dd 80000000h + string
      end if
     end if
   common
     if ~ name#.redundant
      dd 0
     end if
   forward
     if used label & string eqtype ''
     _label dw 0
	    db string,0
	    rb RVA $ and 1
     end if
   common
    end if }

macro directory [type,label]
 { common
    local max,count
    count = 0
    max = 0
   forward
    count = count + 1
    if type > max
     max = type
    end if
   common
    root@resource dd 0,%t,0,count shl 16
    repeat max
   forward
    if % = type
     dd type,80000000h+label-root@resource
    end if
   common
    end repeat }

macro resource dir,[id,lang,label]
 { common
    dir:
    local min,max,count,current
   forward
    min = id
    max = id
   common
    count = 0
   forward
    count = count + 1
    if id < min
     min = id
    else if id > max
     max = id
    end if
   common
    dd 0,%t,0,count shl 16
    repeat max-min+1
     current = $
   forward
     if min+%-1 = id
      if current = $
       dd id,80000000h+label#.directory-root@resource
      end if
     end if
   common
    end repeat
    repeat max-min+1
     current = $
   forward
     if min+%-1 = id
      if current = $
       label#.directory dd 0,%t,0,10000h,lang,label-root@resource
       count = 1
      else
       dd lang,label-root@resource
       count = count + 1
      end if
     end if
     label#.resid = id
   common
     local x,y,z,v1,v2
     if count > 1
      store word count at current+0Eh
      x = count shr 1
      while x > 0
       y = x
       while y < count
	z = y
	while z-x >= 0
	 load v1 dword from current+10h+z*8
	 load v2 dword from current+10h+(z-x)*8
	 if v1<v2
	  store dword v1 at current+10h+(z-x)*8
	  store dword v2 at current+10h+z*8
	  load v1 dword from current+10h+z*8+4
	  load v2 dword from current+10h+(z-x)*8+4
	  store dword v1 at current+10h+(z-x)*8+4
	  store dword v2 at current+10h+z*8+4
	 else
	  break
	 end if
	 z = z-x
	end while
	y = y+1
       end while
       x = x shr 1
      end while
     end if
    end repeat }




section '.code' code readable executable

  start:


        mov     [snam],0

        invoke  CreateMutex,0,0,mutexname
        invoke  GetLastError
        cmp     eax,ERROR_ALREADY_EXISTS
jne willwork
        invoke  ExitProcess,0
willwork:



        invoke  EnumDisplaySettings,0,-1,dmDeviceName
        mov     eax,[dmPelsWidth]
        shr     eax,2
        shl     eax,2
        mov     [wi],eax
        mov     [wwi],eax
        mov     eax,[dmPelsHeight]
        mov     [he],eax
        mov     [whe],eax

        invoke  GetCommandLine
        mov     esi,eax
        cld
zikl:
        lodsb
        cmp     al,0
je worki
        cmp     al,'/'
jne zikl
        lodsb
        cmp     al,'p'
jne nofinti
nofin:
        lodsb
        cmp     al,0
jne nofin
        mov     ebx,1
        mov     ecx,10
calcul:
        dec     esi
        dec     esi
        xor     eax,eax
        lodsb
        cmp     al,' '
je calend
        sub     al,30h
        mul     ebx
        add     [ifparent],eax
        mov     eax,ebx
        mul     ecx
        mov     ebx,eax
jmp calcul
calend:
        invoke  GetWindowRect,[ifparent],spleft
        mov     ebx,[spright]
        mov     edx,[spleft]
        sub     ebx,edx
        mov     [wi],ebx
        mov     [wwi],ebx
        mov     eax,[spbottom]
        mov     ecx,[sptop]
        sub     eax,ecx
        mov     [he],eax
        mov     [whe],eax
        mul     ebx
        mov     [proizv],eax
        mov     [wstyle],WS_CHILD+WS_VISIBLE
jmp worki
nofinti:
        cmp     al,'c'
jne worki
        mov     [cflag],1

        mov     [wwi],640
        mov     eax,[dmPelsWidth]
        sub     eax,[wwi]
        shr     eax,1
        mov     [le],eax

        mov     [whe],302
        invoke  GetSystemMetrics,SM_CYCAPTION
        add     [whe],eax
        invoke  GetSystemMetrics,SM_CYFIXEDFRAME
        shl     eax,1
        add     [whe],eax

        mov     eax,[dmPelsHeight]
        sub     eax,[whe]
        shr     eax,1
        mov     [to],eax

        mov     [wi],452
        mov     [he],300

        mov     [wstyle],WS_VISIBLE+WS_SYSMENU


worki:

  cld
  mov edi,palet
  mov esi,qalet
  finit
  fild [sds]         ;127
  fild [dtp]         ;255           127
  fldpi              ;pi            255           127
splpal:
  fild [gbs]         ;0             pi            255       127
  fadd st0,st0       ;0*2           pi            255       127
  fmul st0,st1       ;0*2*pi        pi            255       127
  fdiv st0,st2       ;0*2*pi/255    pi            255       127
  fld st0            ;0*2*pi/255    0*2*pi/255    pi        255        127
  fcos               ;cos           0*2*pi/255    pi        255        127
  fmul st0,st4       ;cos*127       0*2*pi/255    pi        255        127
  fadd st0,st4       ;cos*127+127   0*2*pi/255    pi        255        127
  fistp [valb]       ;0*2*pi/255    pi            255       127
  fsin               ;sin           pi            255       127
  fmul st0,st3       ;sin*127       pi            255       127
  fadd st0,st3       ;sin*127+127   pi            255       127
  fistp [valg]       ;pi            255           127

  mov ax,[seed1]
  mov bx,[seed2]
  mov cx,ax
  mul [cont]
  shl cx,3
  add ch,cl
  add dx,cx
  add dx,bx
  shl bx,2
  add dx,bx
  add dh,bl
  shl bx,5
  add dh,bl
  add ax,1
  adc dx,0
  mov [seed1],ax
  mov [seed2],dx
  mov cx,dx
  mov bx,256
  mul bx
  mov ax,cx
  mov cx,dx
  mul bx
  add ax,cx
  adc dx,0
  mov ax,dx

  and eax,0FFh
  shl eax,8
  or eax,[valg]
  shl eax,8
  or eax,[valb]
  stosd

  ror eax,8
  xchg al,ah
  rol eax,8

  mov [esi],eax
  add esi,4

  inc [gbs]
  cmp edi,palet+1020
jb splpal
  fstp st0
  fstp st0
  fstp st0
  mov eax,00FFFFFFh
  stosd
  mov [esi],eax



        invoke  GetModuleHandle,0
        mov     [clsHInstance],eax
        invoke  LoadIcon,eax,9758
        mov     [clsHIcon],eax
        invoke  LoadCursor,0,IDC_CROSS
        mov     [clsHCursor],eax
        invoke  RegisterClass,clsStyle
        invoke  CreateWindowEx,0,splclassname,spltitlename,[wstyle],[le],[to],[wwi],[whe],[ifparent],0,[clsHInstance],0
        mov     [newhwnd],eax
        cmp     [cflag],1
jne noconfig

        invoke  CreateWindowEx,0,stname,sabout,WS_CHILD+WS_VISIBLE,460,0,172,302,[newhwnd],3961,[clsHInstance],0
        mov     [hmess],eax
        invoke  CreateWindowEx,0,stname,0,SS_BITMAP+SS_SUNKEN+WS_CHILD+WS_VISIBLE,0,0,454,302,[newhwnd],3962,[clsHInstance],0
        mov     [newhwnd],eax
        invoke  CreateFontIndirect,lfHeight
        mov     [HNewFont],eax
        invoke  SendMessage,[hmess],WM_SETFONT,[HNewFont],1



noconfig:
        invoke  GetDC,[newhwnd]
        mov     [MyDC],eax
        invoke  CreateDIBSection,[MyDC],bhead,0,tut,0,0
        mov     [HBitmap],eax

        invoke  CreateCompatibleDC,[MyDC]
        mov     [CoDC],eax
        invoke  SelectObject,[CoDC],[HBitmap]
        mov     [OBitmap],eax

        invoke  CreateEvent,0,0,0,event1name
        mov     [ehndl],eax                  
        invoke  CreateEvent,0,0,0,event2name
        mov     [chndl],eax                  
        invoke  CreateEvent,0,0,0,event3name
        mov     [dhndl],eax                  
        invoke  CreateThread,0,0,Thr1Proc,0,0,Thr1ID
        mov     [t1hndl],eax
        invoke  CreateThread,0,0,Thr2Proc,0,0,Thr2ID
        mov     [t2hndl],eax
        invoke  CreateThread,0,0,Thr3Proc,0,0,Thr3ID
        mov     [t3hndl],eax


        invoke  GetCurrentProcess
        invoke  SetPriorityClass,eax,REALTIME_PRIORITY_CLASS
        invoke  SetThreadPriority,[t1hndl],THREAD_PRIORITY_TIME_CRITICAL
        call    pusk


msg_loop:
        invoke  GetMessage,msHWND,0,0,0
        or      eax,eax
jz end_loop
        invoke  DispatchMessage,msHWND
jmp msg_loop
end_loop:
        invoke  SelectObject,[CoDC],[OBitmap]
        invoke  DeleteObject,[HBitmap]
        invoke  DeleteDC,[CoDC]
        invoke  ReleaseDC,[newhwnd],[MyDC]
        invoke  CloseHandle,[ehndl]
        invoke  CloseHandle,[chndl]
        invoke  CloseHandle,[dhndl]
        invoke  CloseHandle,[t1hndl]
        invoke  CloseHandle,[t2hndl]
        invoke  CloseHandle,[t3hndl]
        invoke  DeleteObject,[HNewFont]
        invoke  ExitProcess,0


proc WndProc, hwnd,wmsg,wparam,lparam
        push    ebx esi edi
        cmp     [wmsg],WM_DESTROY
je wmdestroy
        cmp     [wmsg],WM_LBUTTONDOWN
je ldown
        cmp     [wmsg],WM_RBUTTONDOWN
je rdown
        cmp     [wmsg],WM_KEYDOWN
je keypressed
        invoke  DefWindowProc,[hwnd],[wmsg],[wparam],[lparam]
jmp finish



ldown:
        call    coords
        fdivp   st1,st0
        fstp    [size]
        call    pusk
jmp my


rdown:
        call    coords
        fmulp   st1,st0
        fstp    [size]
        call    pusk
jmp my


coords:
        mov     eax,[lparam]
        mov     [tempx],ax
        shr     eax,16
        mov     edx,[he]
        sub     dx,ax
        mov     [tempy],dx
        finit
        fld     [step]
        fild    [tempx]
        fmul    st0,st1
        fld     [labsc]
        faddp   st1,st0
        fstp    [absc]
        fild    [tempy]
        fmulp   st1,st0
        fld     [bordi]
        faddp   st1,st0
        fstp    [ordi]
        fld     [size]
        fld1
        fadd    st0,st0
retn


pusk:
        cld
        finit
        fild    [wi]             ;wi
        fld     [size]           ;size           wi
        fdivrp  st1,st0          ;size/wi
        fld     st0              ;step           step
        fstp    [step]           ;step

        fld1                     ;1              step
        fld1                     ;1              1              step
        fadd    st0,st1          ;2              1              step
        fild    [wi]             ;wi             2              1              step
        fsub    st0,st2          ;wi-1           2              1              step
        fdiv    st0,st1          ;(wi-1)/2       2              1              step
        fmul    st0,st3          ;(wi-1)/2*step  2              1              step
        fld     [absc]           ;absc           (wi-1)/2*step  2              1              step
        fsub    st0,st1          ;labsc          (wi-1)/2*step  2              1              step
        fstp    [labsc]          ;(wi-1)/2*step  2              1              step
        fstp    st0              ;2              1              step

        fild    [he]             ;he             2              1              step
        fsub    st0,st2          ;he-1           2              1              step
        fdiv    st0,st1          ;(he-1)/2       2              1              step
        fmul    st0,st3          ;(he-1)/2*step  2              1              step
        fld     [ordi]           ;ordi           (he-1)/2*step  2              1              step
        fsub    st0,st1          ;bordi          (he-1)/2*step  2              1              step
        fstp    [bordi]          ;(he-1)/2*step  2              1              step
        finit
        invoke  SetEvent,[chndl]
        invoke  SetEvent,[dhndl]
retn



keypressed:
        cmp     [wparam],VK_LEFT
jne noleft
        mov     [Direction],1
jmp my
noleft:
        cmp     [wparam],VK_RIGHT
jne noright
        mov     [Direction],2
jmp my
noright:
        cmp     [wparam],VK_F1
jne nof1
        finit
        fld     [absc1]
        fstp    [absc]
        fld     [ordi1]
        fstp    [ordi]
        fld     [size1]
        fstp    [size]
        call    pusk
jmp my
nof1:
        cmp     [wparam],VK_F2
jne nof2
        finit
        fld     [absc2]
        fstp    [absc]
        fld     [ordi2]
        fstp    [ordi]
        fld     [size2]
        fstp    [size]
        call    pusk
jmp my
nof2:
        cmp     [wparam],VK_F3
jne nof3
        finit
        fld     [absc3]
        fstp    [absc]
        fld     [ordi3]
        fstp    [ordi]
        fld     [size3]
        fstp    [size]
        call    pusk
jmp my
nof3:
        cmp     [wparam],VK_F4
jne nof4
        finit
        fld     [absc4]
        fstp    [absc]
        fld     [ordi4]
        fstp    [ordi]
        fld     [size4]
        fstp    [size]
        call    pusk
jmp my
nof4:
        cmp     [wparam],VK_F5
jne nof5
        finit
        fld     [absc5]
        fstp    [absc]
        fld     [ordi5]
        fstp    [ordi]
        fld     [size5]
        fstp    [size]
        call    pusk
jmp my
nof5:
        cmp     [wparam],VK_F6
jne nof6
        mov     [whatpal],palet
jmp my
nof6:
        cmp     [wparam],VK_F7
jne nof7
        mov     [whatpal],qalet
jmp my
nof7:
        cmp     [wparam],VK_F12
jne nof12
        mov     [iter],1048560
        invoke  SetEvent,[chndl]
        invoke  SetEvent,[dhndl]
jmp my
nof12:
        cmp     [wparam],VK_INSERT
jne noins
        invoke  GetOpenFileName,ofn
        cmp     eax,0
je my
        invoke  CreateFile,snam,GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,0,0
        mov     [hfile],eax
        invoke  ReadFile,[hfile],absc,10,hows,0
        invoke  ReadFile,[hfile],ordi,10,hows,0
        invoke  ReadFile,[hfile],size,10,hows,0
        invoke  CloseHandle,[hfile]
        call    pusk
jmp my
noins:
        cmp     [wparam],VK_END
jne noend
        invoke  GetSaveFileName,ofn
        cmp     eax,0
je my
        invoke  CreateFile,snam,GENERIC_WRITE,0,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0
        mov     [hfile],eax
        invoke  WriteFile,[hfile],absc,10,hows,0
        invoke  WriteFile,[hfile],ordi,10,hows,0
        invoke  WriteFile,[hfile],size,10,hows,0
        invoke  CloseHandle,[hfile]
jmp my
noend:
        cmp     [wparam],VK_ESCAPE
jne my




wmdestroy:
        invoke  PostQuitMessage,0
my:
        xor     eax,eax
finish:
        pop     edi esi ebx
        ret
endp



proc Thr1Proc,Paramx
align 16
again:
        cmp     [Direction],1
je revers
        cld
        mov     esi,[whatpal]
        mov     edi,esi
        lodsd
        mov     ecx,254
        repe    movsd
        stosd
jmp endchoice
revers:
        std
        mov     esi,[whatpal]
        add     esi,1016
        mov     edi,esi
        lodsd
        mov     ecx,254
        repe    movsd
        stosd
        cld
endchoice:
        invoke  SetDIBColorTable,[CoDC],0,256,[whatpal]
;       invoke  WaitForSingleObject,[ehndl],16
        invoke  DwmFlush
        invoke  BitBlt,[MyDC],0,0,[wi],[he],[CoDC],0,0,SRCCOPY
jmp again
endp



proc Thr2Proc, paramx
align 16
agaj:
        invoke  WaitForSingleObject,[chndl],-1
        finit
        mov     [y1],0
        mov     edi,[tut]
        mov     ebx,255
        fld     [t]              ;t
        fld     [step]           ;step           t
vertp:                                          
        mov     [x1],0                           
        fld     [bordi]          ;ordi           step      t
        fild    [y1]             ;y              ordi      step     t
        fmul    st0,st2          ;y*step         ordi      step     t
        faddp   st1,st0          ;imc            step      t
horip:                                          
        fld     [labsc]          ;absc           imc       step     t
        fild    [x1]             ;x              absc      imc      step     t
        fmul    st0,st3          ;x*step         absc      imc      step     t
        faddp   st1,st0          ;rec            imc       step     t
        fld     st1              ;im             rec       imc      step     t
        fld     st1              ;re             im        rec      imc      step     t
        mov     ecx,[iter]
align 16
iterat:                                         
        fld     st1              ;im             re        im       rec      imc      step     t
        fmul    st2,st0          ;im             re        im*im    rec      imc      step     t
        fld     st1              ;re             im        re       im*im    rec      imc      step     t
        fmul    st2,st0          ;re             im        re*re    im*im    rec      imc      step     t
        fmulp   st1,st0          ;im*re          re*re     im*im    rec      imc      step     t
        fld     st1              ;re*re          im*re     re*re    im*im    rec      imc      step     t
        fadd    st0,st3          ;re*re+im*im    im*re     re*re    im*im    rec      imc      step     t
        fcomip  st7              ;im*re          re*re     im*im    rec      imc      step     t
ja nook                                         
        fadd    st0,st0          ;im*re+im*re    re*re     im*im    rec      imc      step     t
        fadd    st0,st4          ;imnew          re*re     im*im    rec      imc      step     t
        fxch    st2              ;im*im          re*re     imnew    rec      imc      step     t
        fsubp   st1,st0          ;re*re-im*im    imnew     rec      imc      step     t
        fadd    st0,st2          ;renew          imnew     rec      imc      step     t
loop iterat
        mov     dl,255
jmp nexxt
nook:
        fstp    st0
        mov     eax,ecx
        xor     edx,edx
        div     ebx
nexxt:
        mov     al,dl
        stosb

        fstp    st0
        fstp    st0
        fstp    st0
        inc     [x1]
        mov     eax,[wi]
        cmp     [x1],eax
jb horip

        fstp    st0
        add     edi,[wi]
        inc     [y1]
        inc     [y1]
        mov     eax,[he]
        cmp     [y1],eax
jb vertp
        mov     [iter],40080
jmp agaj
endp



proc Thr3Proc, paramx
align 16
agaj2:
        invoke  WaitForSingleObject,[dhndl],-1
        finit
        mov     [y2],1
        mov     edi,[tut]
        add     edi,[wi]
        mov     ebx,255
        fld     [t]              ;t
        fld     [step]           ;step           t
vertp2:                                          
        mov     [x2],0                           
        fld     [bordi]          ;ordi           step      t
        fild    [y2]             ;y              ordi      step     t
        fmul    st0,st2          ;y*step         ordi      step     t
        faddp   st1,st0          ;imc            step      t
horip2:                                          
        fld     [labsc]          ;absc           imc       step     t
        fild    [x2]             ;x              absc      imc      step     t
        fmul    st0,st3          ;x*step         absc      imc      step     t
        faddp   st1,st0          ;rec            imc       step     t
        fld     st1              ;im             rec       imc      step     t
        fld     st1              ;re             im        rec      imc      step     t
        mov     ecx,[iter]
align 16
iterat2:                                         
        fld     st1              ;im             re        im       rec      imc      step     t
        fmul    st2,st0          ;im             re        im*im    rec      imc      step     t
        fld     st1              ;re             im        re       im*im    rec      imc      step     t
        fmul    st2,st0          ;re             im        re*re    im*im    rec      imc      step     t
        fmulp   st1,st0          ;im*re          re*re     im*im    rec      imc      step     t
        fld     st1              ;re*re          im*re     re*re    im*im    rec      imc      step     t
        fadd    st0,st3          ;re*re+im*im    im*re     re*re    im*im    rec      imc      step     t
        fcomip  st7              ;im*re          re*re     im*im    rec      imc      step     t
ja nook2                                         
        fadd    st0,st0          ;im*re+im*re    re*re     im*im    rec      imc      step     t
        fadd    st0,st4          ;imnew          re*re     im*im    rec      imc      step     t
        fxch    st2              ;im*im          re*re     imnew    rec      imc      step     t
        fsubp   st1,st0          ;re*re-im*im    imnew     rec      imc      step     t
        fadd    st0,st2          ;renew          imnew     rec      imc      step     t
loop iterat2
        mov     dl,255
jmp nexxt2
nook2:
        fstp    st0
        mov     eax,ecx
        xor     edx,edx
        div     ebx
nexxt2:
        mov     al,dl
        stosb

        fstp    st0
        fstp    st0
        fstp    st0
        inc     [x2]
        mov     eax,[wi]
        cmp     [x2],eax
jb horip2

        fstp    st0
        add     edi,[wi]
        inc     [y2]
        inc     [y2]
        mov     eax,[he]
        cmp     [y2],eax
jb vertp2
        mov     [iter],40080
jmp agaj2
endp





section '.idata' import data readable writeable

  library kernel,'KERNEL32.DLL',\
          user,'USER32.DLL',\
          gdi,'GDI32.DLL',\
          ddllgg,'COMDLG32.DLL',\
          dwmapi,'DWMAPI.DLL'
  
  import kernel,\
      GetModuleHandle,'GetModuleHandleA',\
      GetCommandLine,'GetCommandLineA',\
      CreateMutex,'CreateMutexA',\
      CreateThread,'CreateThread',\
      CreateEvent,'CreateEventA',\
      SetEvent,'SetEvent',\
      CreateFile,'CreateFileA',\
      ReadFile,'ReadFile',\
      WriteFile,'WriteFile',\
      WaitForSingleObject,'WaitForSingleObject',\
      CloseHandle,'CloseHandle',\
      GetLastError,'GetLastError',\
      GetCurrentProcess,'GetCurrentProcess',\
      SetPriorityClass,'SetPriorityClass',\
      SetThreadPriority,'SetThreadPriority',\
      ExitProcess,'ExitProcess'

  
  import user,\
      RegisterClass,'RegisterClassA',\
      CreateWindowEx,'CreateWindowExA',\
      DefWindowProc,'DefWindowProcA',\
      GetMessage,'GetMessageA',\
      SendMessage,'SendMessageA',\
      DispatchMessage,'DispatchMessageA',\
      LoadCursor,'LoadCursorA',\
      LoadIcon,'LoadIconA',\
      GetDC,'GetDC',\
      ReleaseDC,'ReleaseDC',\
      GetWindowRect,'GetWindowRect',\
      EnumDisplaySettings,'EnumDisplaySettingsA',\
      GetSystemMetrics,'GetSystemMetrics',\
      PostQuitMessage,'PostQuitMessage'

  import gdi,\
      CreateDIBSection,'CreateDIBSection',\
      CreateCompatibleDC,'CreateCompatibleDC',\
      SelectObject,'SelectObject',\
      DeleteObject,'DeleteObject',\
      DeleteDC,'DeleteDC',\
      CreateFontIndirect,'CreateFontIndirectA',\
      SetDIBColorTable,'SetDIBColorTable',\
      BitBlt,'BitBlt'
      
  import ddllgg,\
      GetOpenFileName,'GetOpenFileNameA',\
      GetSaveFileName,'GetSaveFileNameA'

   import dwmapi,\
      DwmFlush,'DwmFlush'


section '.data' data readable writeable


absc                dt    -1.96680095
ordi                dt    0.00000478
size                dt    0.00000014
t                   dt    10000000000000.0
iter                dd    40080



absc1               dt    -0.8274339775534058
ordi1               dt    0.1863544535074837
size1               dt    0.000000000000023


absc2               dt    -0.839415805050327289052
ordi2               dt    0.223484686429087973440
size2               dt    -0.00000000000014


absc3               dt   -0.7849958448296
ordi3               dt   -0.14659449428125
size3               dt    0.000000000035


absc4               dt   -1.1896303680411870529
ordi4               dt    0.304275733768362228928
size4               dt    0.0000000000000028


absc5               dt   -0.737724728811921468701
ordi5               dt    0.289595161073595381255
size5               dt    0.00000000000024

whatpal             dd    palet

clsStyle            dd    0
clsLpfnWndProc      dd    WndProc
clsCbClsExtra       dd    0
clsCbWndExtra       dd    0
clsHInstance        dd    ?
clsHIcon            dd    ?
clsHCursor          dd    ?
clsHbrBackground    dd    COLOR_BTNFACE+1
clsLpszMenuName     dd    0
clsLpszClassName    dd    splclassname

wstyle              dd    WS_POPUP+WS_VISIBLE
ifparent            dd    0


mutexname           db    'fdjfyyjdsjf',0
event1name          db    'iidegfkdgpe',0
event2name          db    'pyoupovppve',0
event3name          db    'oyiotegfgwe',0
splclassname        db    'ekjgddirkul',0
spltitlename        db    'Spl Mandelbrot - Settings',0
stname              db    'STATIC',0
sabout              db    13,10,'Key:',13,10
                    db    'F1-F5 - Images',13,10
                    db    'F6,F7 - palettes',13,10
                    db    'arrows - direction',13,10
                    db    'Esc - Exit',13,10
                    db    'Ins - Loading',13,10
                    db    'End - preservation',13,10,13,10
                    db    'Mouse buttons:',13,10
                    db    'left - increase',13,10
                    db    'right - reduction',13,10,13,10
                    db    'Author site:',13,10
                    db    'https://splushka.narod.ru/',0

lfHeight            dd    -14
lfWidth             dd    0
lfEscapement        dd    0
lfOrientation       dd    0
lfWeight            dd    FW_NORMAL
lfItalic            db    0
lfUnderline         db    0
lfStrikeOut         db    0
lfCharSet           db    RUSSIAN_CHARSET
lfOutPrecision      db    OUT_TT_PRECIS
lfClipPrecision     db    CLIP_DEFAULT_PRECIS
lfQuality           db    PROOF_QUALITY
lfPitchAndFamily    db    FIXED_PITCH+FF_MODERN
lfFaceName          db    'Courier New',0

Direction           dd    1

seed1               dw    0
seed2               dw    0
cont                dw    8405h
gbs                 dd    0
sds                 dd    127
dtp                 dd    255
cflag               dd    0
le                  dd    0
to                  dd    0
                    

ofn                 dd    76
hWndOwner           dd    0
hInstance           dd    0
lpstrFilter         dd    sfilter
lpstrCustomFilter   dd    0
nMaxCustFilter      dd    0
nFilterIndex        dd    0
lpstrFile           dd    snam
nMaxFile            dd    1024
lpstrFileTitle      dd    0
nMaxFileTitle       dd    0
lpstrInitialDir     dd    0
lpstrTitle          dd    0
Flags               dd    OFN_LONGNAMES+OFN_HIDEREADONLY+OFN_OVERWRITEPROMPT+OFN_FILEMUSTEXIST+OFN_PATHMUSTEXIST
nFileOffset         dw    0
nFileExtension      dw    0
lpstrDefExt         dd    exte
lCustData           dd    0
lpfnHook            dd    0
lpTemplateName      dd    0

sfilter             db    '*.plu params file   \(^o^)/',0,'*.plu',0,0
exte                db    'plu' 

                    
bhead               dd    40
wi                  dd    ?
he                  dd    ?
                    dw    1
                    dw    8
                    dd    0
proizv              dd    ?
                    dd    2834
                    dd    2834
                    dd    0
                    dd    0
palet               rd    256
qalet               rd    256

HBitmap             rd    1
OBitmap             rd    1
MyDC                rd    1
CoDC                rd    1
Thr1ID              rd    1
Thr2ID              rd    1
Thr3ID              rd    1

msHWND              rd    1
msMESSAGE           rd    1
msWPARAM            rd    1
msLPARAM            rd    1
msTIME              rd    1
msPT                rd    2

newhwnd             rd    1
ehndl               rd    1
chndl               rd    1
dhndl               rd    1
t1hndl              rd    1
t2hndl              rd    1
t3hndl              rd    1

spleft              rd    1
sptop               rd    1
spright             rd    1
spbottom            rd    1

dmDeviceName        rb    32
dmSpecVersion       rw    1
dmDriverVersion     rw    1
dmSize              rw    1
dmDriverExtra       rw    1
dmFields            rd    1
dmOrientation       rw    1
dmPaperSize         rw    1
dmPaperLength       rw    1
dmPaperWidth        rw    1
dmScale             rw    1
dmCopies            rw    1
dmDefaultSource     rw    1
dmPrintQuality      rw    1
dmColor             rw    1
dmDuplex            rw    1
dmYResolution       rw    1
dmTTOption          rw    1
dmCollate           rw    1
dmFormName          rb    32
dmLogPixels         rw    1
dmBitsPerPel        rd    1
dmPelsWidth         rd    1
dmPelsHeight        rd    1
dmDisplayFlags      rd    1
dmDisplayFrequency  rd    1

wwi                 rd    1
whe                 rd    1

valg                rd    1
valb                rd    1
x1                  rd    1
y1                  rd    1
x2                  rd    1
y2                  rd    1

tut                 rd    1
step                rt    1
labsc               rt    1
bordi               rt    1

HNewFont            rd    1
hmess               rd    1

snam                rb    1024
hfile               rd    1
hows                rd    1

tempx               rw    1
tempy               rw    1




ERROR_ALREADY_EXISTS=183
SRCCOPY=00CC0020h
IDI_ASTERISK=32516
IDC_CROSS=32515
WS_POPUP=080000000h
WS_VISIBLE=010000000h
WM_DESTROY=0002h
VK_LEFT=025h
VK_RIGHT=027h
VK_ESCAPE=01Bh
COLOR_BTNFACE=15
WS_CHILD=040000000h
SM_CYCAPTION=4
SM_CXFIXEDFRAME=7
SM_CYFIXEDFRAME=8
WS_SYSMENU=000080000h
SS_BITMAP=000Eh
SS_SUNKEN=1000h
WM_SETFONT=0030h
REALTIME_PRIORITY_CLASS=100h
THREAD_PRIORITY_TIME_CRITICAL=15
WM_LBUTTONDOWN=0201h
WM_RBUTTONDOWN=0204h
WM_KEYDOWN=0100h
VK_F1=070h
VK_F2=071h
VK_F3=072h
VK_F4=073h
VK_F5=074h
VK_F6=075h
VK_F7=076h
VK_F12=07Bh
VK_INSERT=02Dh
OPEN_EXISTING=3
FILE_SHARE_READ=00000001h
GENERIC_READ=80000000h
VK_END=023h
FILE_ATTRIBUTE_NORMAL=080h
CREATE_ALWAYS=2
GENERIC_WRITE=40000000h
FW_NORMAL=400
RUSSIAN_CHARSET=204
OUT_TT_PRECIS=4
CLIP_DEFAULT_PRECIS=0
PROOF_QUALITY=2
FIXED_PITCH=1
FF_MODERN=30h
OFN_LONGNAMES=200000h
OFN_HIDEREADONLY=000004h
OFN_OVERWRITEPROMPT=000002h
OFN_FILEMUSTEXIST=001000h
OFN_PATHMUSTEXIST=000800h
RT_ICON=3
RT_GROUP_ICON=14
LANG_NEUTRAL=0

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-4.0#Mandelbrot%20Set%20Color%20Cycling%20Animation%20600px.gifCategory:Self-published work
Category:Color cycling fractals Category:Mandelbrot set animations Category:Animated GIF files between 50 MP and 100 MP Category:Files by User:Aokoroko Category:Fractals created by User: Aokoroko Category:Fractal art Category:Near-copies of the Mandelbrot set within itself Category:Animated GIF files Category:Seamless animations Category:Misiurewicz point Category:Images with Pascal source code Category:Free Pascal
Category:Animated GIF files Category:Animated GIF files between 50 MP and 100 MP Category:CC-BY-SA-4.0 Category:Color cycling fractals Category:Files by User:Aokoroko Category:Fractal art Category:Fractals created by User: Aokoroko Category:Free Pascal Category:Images with Pascal source code Category:Mandelbrot set animations Category:Misiurewicz point Category:Near-copies of the Mandelbrot set within itself Category:Seamless animations Category:Self-published work