summaryrefslogtreecommitdiffstats
path: root/hacks/images/m6502/dragon-fractal.asm
blob: ce05ad4cce4bc7ce969d0ee75f4fabcc3189745c (plain) (blame)
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
;; dmsc
;; 	
;; PostPosted: Thu Dec 13, 2007 11:57 pm Post subject: Dragon curve
;; fractal 
;;
;; 
;; Hi!
;; 
;; This draws the dragon curve fractal (really a "twin dragon"):

lda #0
 sta $0

lop:
 lda $0
 sta $1
 lda #3
 sta $6
 lda #232
 sta $5

 ldx #0
lpN:
 lsr $1
 bcc nos
 lda $5
 clc
 adc tL,x
 sta $5
 lda $6
 adc tH,x
 sta $6
nos:
 inx
 lda $1
 bne lpN
 inx
 txa
 ldy #0
 sta ($5),y

 inc $0
 bne lop
 rts

tL:
 dcb 32, 31, 254, 190, 128, 132, 8, 8
tH:
 dcb 0, 0, 255, 255, 255, 255, 0, 1