
     IFND EXEC_TYPES_I
     INCLUDE "exec/types.i"
     ENDC

* signed 32-bit fixed point, scaled by 2^29 (range -4 .. 4)
FIXED MACRO
      LONG  \1
      ENDM

   STRUCTURE   mbrot,0

* Rastport image will be drawn to
      APTR  mb_RastPort

* These define z = x0 + y0 i that will be mapped to upper lefthand
* corner of Rastport (that is (0,0) NOT (x1,y1))
      FIXED mb_x0
      FIXED mb_y0

* Deltas in both directions, i.e. how much to increment z for each pixel
      FIXED mb_dx
      FIXED mb_dy

* If this is actually a Julia set, this is the c = jx + jy i
      FIXED mb_jx
      FIXED mb_jy

* (x1,y1)-(x2,y2) rectangle within rastport to fill with mandelbrot
      UWORD mb_x1
      UWORD mb_y1
      UWORD mb_x2
      UWORD mb_y2

* Pointer to a call-back procedure (or NULL) that should return
* with Z clear (result nonzero) if some kind of break condition is met
      APTR  mb_break

      UWORD mb_i           ; max. number of iterations, 0<= i <=65533
      UWORD mb_colors      ; number of colors used in colouring OUTSIDE
      UBYTE mb_flags       ; see below
      BYTE  mb_pad
   LABEL mb_SIZEOF

* Flags for mb_flags
      BITDEF   MB,HIGH,0   ; 32 bit precision enabled
      BITDEF   MB,CRAWL,1  ; crawling enabled
      BITDEF   MB,JULIA,2  ; this is actually a Julia set
      BITDEF   MB,AUTOPREC,3 ; automatic precision (16/32 bits, ignore HIGH)
      BITDEF   MB,AUTOCRAWL,4 ; automatic crawling when adequate, ign. CRAWL

* Limit for AUTOPREC
DELTALIMIT  EQU   $40000

* PIXEL color defines
CLEAR    EQU   0  ; the color (x1,y1)-(x2,y2) is cleared to
INTERIOR EQU   1  ; inside the set
FIRST    EQU   2  ; outside the set

