-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmandelhelp.a
70 lines (64 loc) · 1.93 KB
/
mandelhelp.a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
; --------------------------------------------------
; This routine resets the top left corner to use in the complex
; plane and the stepping offsets in x and y direction to the default
; values for the iconic mandelset picture in hires mode
;
; resetParameters has no return value.
; --------------------------------------------------
resetParametersHires
+callFunc move32Bit, DEFAULT_STEP_X, STEP_X
+callFunc move32Bit, DEFAULT_STEP_Y, STEP_Y
+callFunc move32Bit, DEFAULT_INIT_REAL, INIT_REAL
+callFunc move32Bit, DEFAULT_INIT_IMAG, INIT_IMAG
stz ZOOM_LEVEL
rts
; --------------------------------------------------
; This routine halves the stepping width in x and y direction and thereby "zooms"
; into the Mandelbrot set
;
; increaseZoomLevel has no return value.
; --------------------------------------------------
increaseZoomLevel
lda ZOOM_LEVEL
cmp #MAX_ZOOM_LEVEL
bcs .zoomDone
inc ZOOM_LEVEL
+callFuncMono halve32Bit, STEP_X
+callFuncMono halve32Bit, STEP_Y
.zoomDone
rts
.TEMP_X
!byte 0,0
.TEMP_Y
!byte 0
; --------------------------------------------------
; This routine determines the point in the complex plane for which the pixel
; at COUNT_X and COUNT_Y stands
;
; deriveParametersFromPixel has no return value. As a side effect it changes
; INIT_REAL and INIT_IMAG
; --------------------------------------------------
deriveParametersFromPixel
+callFunc move32Bit, INIT_IMAG, IMAG
+callFunc move32Bit, INIT_REAL, REAL
+load16BitImmediate 0, .TEMP_X
.loopDeriveX
+cmp16Bit COUNT_X, .TEMP_X
beq .procYCoord
+callFunc add32Bit, STEP_X, REAL
+inc16Bit .TEMP_X
jmp .loopDeriveX
.procYCoord
lda #0
sta .TEMP_Y
.loopDeriveY
lda .TEMP_Y
cmp COUNT_Y
beq .deriveDone
+callFunc add32Bit, STEP_Y, IMAG
inc .TEMP_Y
jmp .loopDeriveY
.deriveDone
+callFunc move32Bit, IMAG, INIT_IMAG
+callFunc move32Bit, REAL, INIT_REAL
rts