aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2022-11-08 02:00:56 -0500
committerB. Watson <urchlay@slackware.uk>2022-11-08 02:00:56 -0500
commitc38d545b4882898faccf9db32d88ace67f4e1f05 (patch)
tree0bec8b2a7336e4b6c3747dfbf1c18817911a6fbc
parentb694d22114fc57d5c8df67853ec1657d7916fbce (diff)
downloaddla-asm-c38d545b4882898faccf9db32d88ace67f4e1f05.tar.gz
Remove part_x and part_y.
-rw-r--r--dla.s11
-rw-r--r--drunkwalk.s12
2 files changed, 9 insertions, 14 deletions
diff --git a/dla.s b/dla.s
index 24121d3..a18a23b 100644
--- a/dla.s
+++ b/dla.s
@@ -39,8 +39,6 @@ screenptr = pixptr2
circlesize: .res 1 ; 0 to 3
-part_x: .res 1 ; x/y coords of current particle
-part_y: .res 1
particles: .res 2
spawn_x: .res 2
spawn_y: .res 2
@@ -81,6 +79,7 @@ init:
sta maxparticles
lda #>DEFAULTPART
sta maxparticles+1
+ ; end of init stuff.
; "New" option jumps here, restore GR.0 screen
getargs:
@@ -184,17 +183,13 @@ wl:
next_particle:
ldy RANDOM ; spawn a new particle
lda (spawn_x),y
- sta part_x
+ sta cursor_x
lda (spawn_y),y
- sta part_y
+ sta cursor_y
jsr drunkwalk ; walk it around
beq next_particle ; if it went out of bounds, try again
; particle stuck to an existing pixel, draw it
- lda part_x
- sta cursor_x
- lda part_y
- sta cursor_y
jsr plot
inc particles
diff --git a/drunkwalk.s b/drunkwalk.s
index 6156e4a..ca017c0 100644
--- a/drunkwalk.s
+++ b/drunkwalk.s
@@ -10,8 +10,8 @@ oob:
rts
drunkwalk:
- ldy part_x ; 3
- ldx part_y ; 3
+ ldy cursor_x ; 3
+ ldx cursor_y ; 3
lda lineaddrs_l,x ; 5
sta pixptr ; 3
@@ -27,14 +27,14 @@ up:
selfmod_ymin = * + 1
cpx #0 ; 2
beq oob ; 2
- stx part_y
+ stx cursor_y
jmp check_lru
down:
inx ; 2 ; N=1 V=0 down
selfmod_ymax = * + 1
cpx #0 ; 2
beq oob ; 2
- stx part_y
+ stx cursor_y
jmp check_lrd
lr:
bvc right ; 2/3
@@ -43,7 +43,7 @@ left:
selfmod_xmin = * + 1
cpy #0 ; 2
beq oob ; 2
- sty part_x
+ sty cursor_x
; check left neighbor (we just vacated the right one)
dey
lda (pixptr),y
@@ -55,7 +55,7 @@ right:
selfmod_xmax = * + 1
cpy #0 ; 2
beq oob ; 2
- sty part_x
+ sty cursor_x
; check right neighbor (we just vacated the left one)
iny
lda (pixptr),y