aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2022-10-25 05:28:20 -0400
committerB. Watson <urchlay@slackware.uk>2022-10-25 05:28:20 -0400
commitdc6e3ae419dfefaceee57592525c7d1bf9f4ca4c (patch)
tree0c076e25ab3b8516ccc05be48278171c071336c7
parent145a059c48725c70304c0e91ef4e0441e214205c (diff)
downloaddla-asm-dc6e3ae419dfefaceee57592525c7d1bf9f4ca4c.tar.gz
Micro-optimization: inline spawn subroutine.
-rw-r--r--dla.s35
1 files changed, 18 insertions, 17 deletions
diff --git a/dla.s b/dla.s
index 0c4b452..89c466a 100644
--- a/dla.s
+++ b/dla.s
@@ -173,7 +173,11 @@ wl:
jsr plot
next_particle:
- jsr spawn ; spawn a new particle
+ ldy RANDOM ; spawn a new particle
+ lda (spawn_x),y
+ sta part_x
+ lda (spawn_y),y
+ sta part_y
jsr drunkwalk ; walk it around
beq next_particle ; if it went out of bounds, try again
@@ -478,22 +482,22 @@ unplot:
;;; check the pixel at (cursor_x, cursor_y)
;;; if set, return with Z=0
;;; otherwise, return with Z=1
-locate:
- jsr plotsetup
- and (pixptr),y
- rts
-
-masks: .byte $80,$40,$20,$10,$08,$04,$02,$01
+;;;; Inlined (keep for reference)
+;locate:
+; jsr plotsetup
+; and (pixptr),y
+; rts
;;; Subroutine: spawn
;;; Pick a random point on the edge of a circle
-spawn:
- ldy RANDOM
- lda (spawn_x),y
- sta part_x
- lda (spawn_y),y
- sta part_y
- rts
+;;;; Inlined (keep for reference)
+; spawn:
+; ldy RANDOM
+; lda (spawn_x),y
+; sta part_x
+; lda (spawn_y),y
+; sta part_y
+; rts
;;; Subroutine: drunkwalk
;;; Walk the point around randomly until it either is
@@ -532,7 +536,6 @@ checkbounds:
beq oob
cmp max_y
beq oob
-
sta cursor_y
ldx #0
@@ -578,8 +581,6 @@ stick:
oob:
rts
- rts
-
;;;;; end of executable code
; dlatbl.s is generated by perl script, mkdlatbl.pl