{{  '=========================================================================== LICENSINFO
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Autor: Tim Hennig (PIC18F2550)                                                                                               │
│ Copyright (c) 2012 Tim Hennig                                                                                                │
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│                                                   TERMS OF USE: MIT License                                                  │
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation    │
│files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,    │
│modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│
│is furnished to do so, subject to the following conditions:                                                                   │
│                                                                                                                              │
│The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│
│                                                                                                                              │
│THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE          │
│WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR         │
│COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,   │
│ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                         │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Informationen       :
Kontakt             :
System              : Zerberus / HIVE r48*
Name                : Mandelbrot.spin
Chip                : G1 / Bellatrix
Typ                 :
Version             : 00
Subversion          : 01
Funktion            :
Komponenten         : VGA-Treiber 640x480@60Hz Pixel 80x60 Zeichen (8X8) characters (0...256)
Beschreibung        :

COG's               : Treiber       1 COG
                      -------------------
                                    1 COG's

Logbuch             :
2012.06.09 PIC      : 1. Test

Quelle______________________________________________________________________________________________________________________________
QBasic
SCREEN 13
WINDOW (-2, 1.5)-(2, -1.5)
FOR x0 = -2 TO 2 STEP .01
    FOR y0 = -1.5 TO 1.5 STEP .01
        x = 0
        y = 0
 
        iteration = 0
        maxIteration = 223
 
        WHILE (x * x + y * y <= (2 * 2) AND iteration < maxIteration)
            xtemp = x * x - y * y + x0
            y = 2 * x * y + y0
 
            x = xtemp
 
            iteration = iteration + 1
        WEND
 
        IF iteration <> maxIteration THEN
            c = iteration
        ELSE
            c = 0
        END IF
 
        PSET (x0, y0), c + 32
    NEXT
NEXT
}}
    _CLKMODE    = XTAL1 + PLL16X
    _XINFREQ    = 5_000_000

PUB main | x, y, x0, y0, i, mi, xt, c
    repeat x0 from -200 to 200 step 10
        repeat y0 from -150 to 150  step 10
            x   :=  0
            y   :=  0
            i   :=  0
            mi  :=  223
'            wihle x * x + y * y <= 4 AND i < mi
                xt  := x * x - y * y + x0
                y   := 2 * x * y + y0
                i++
'            wend
            if i <> mi
                c   :=  i
            else
                c   :=  0
            pset (x0 + 200, y0 + 150 ,c)   ' 0-400, 0-300

PRI pset(x, y, c) | sx, sy, sc  ' 0-79, 0-59, 0-15
' Werteanpassung an Monitor Treiber.

