|
|
|
@ -1,10 +1,15 @@ |
|
|
|
|
( |
|
|
|
|
(sc-init 1024 768) |
|
|
|
|
(sc-opt SCREEN_AUTOBLIT 0) |
|
|
|
|
(def W 1024) |
|
|
|
|
(def H 768) |
|
|
|
|
(sym MAXITER g0) |
|
|
|
|
(ld MAXITER 50) |
|
|
|
|
(def DEF_MAXITER 50) |
|
|
|
|
|
|
|
|
|
; --- |
|
|
|
|
|
|
|
|
|
(sc-init W H) |
|
|
|
|
(sc-opt SCREEN_AUTOBLIT 0) |
|
|
|
|
(sym maxiter g0) |
|
|
|
|
|
|
|
|
|
(ld maxiter DEF_MAXITER) |
|
|
|
|
|
|
|
|
|
(lds @cout "Interactive Mandelbrot\n") |
|
|
|
|
(lds @cout "----------------------\n") |
|
|
|
@ -86,7 +91,7 @@ |
|
|
|
|
(ld x col) |
|
|
|
|
(:col) |
|
|
|
|
(call pixel x y px py scale) |
|
|
|
|
(sub r0 MAXITER 1) |
|
|
|
|
(sub r0 maxiter 1) |
|
|
|
|
(rcmp res0 1 r0 |
|
|
|
|
(eq? |
|
|
|
|
(mod r0 res0 16) |
|
|
|
@ -166,16 +171,16 @@ |
|
|
|
|
|
|
|
|
|
; R iter+ |
|
|
|
|
(sc-key r0 KEY_R (nz? |
|
|
|
|
(add MAXITER 50) |
|
|
|
|
(lds @cout "ITER=") (call printnum MAXITER) (ld @cout '\n') |
|
|
|
|
(add maxiter 50) |
|
|
|
|
(lds @cout "ITER=") (call printnum maxiter) (ld @cout '\n') |
|
|
|
|
(mslp 200) ; Avoid unexpected rapid change |
|
|
|
|
)) |
|
|
|
|
|
|
|
|
|
; F iter- |
|
|
|
|
(sc-key r0 KEY_F (nz? |
|
|
|
|
(cmp MAXITER 50) |
|
|
|
|
(sub.gt MAXITER 50) |
|
|
|
|
(lds @cout "ITER=") (call printnum MAXITER) (ld @cout '\n') |
|
|
|
|
(cmp maxiter 50) |
|
|
|
|
(sub.gt maxiter 50) |
|
|
|
|
(lds @cout "ITER=") (call printnum maxiter) (ld @cout '\n') |
|
|
|
|
(mslp 200) ; Avoid unexpected rapid change |
|
|
|
|
)) |
|
|
|
|
|
|
|
|
@ -258,7 +263,7 @@ |
|
|
|
|
(sym iter r4) |
|
|
|
|
|
|
|
|
|
(:iter) |
|
|
|
|
(cmp iter MAXITER) |
|
|
|
|
(cmp iter maxiter) |
|
|
|
|
(j.eq :end) |
|
|
|
|
(fmul r0 x x) |
|
|
|
|
(fmul r1 y y) |
|
|
|
|