aboutsummaryrefslogtreecommitdiff
path: root/dla.s
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2022-11-03 15:16:19 -0400
committerB. Watson <urchlay@slackware.uk>2022-11-03 15:16:19 -0400
commit8d7e5662f08dada2f88fa03b6129fb0eb3119de0 (patch)
tree209d9bef7adbbda1e299ee3877281aec341b08d2 /dla.s
parent9dd8d53ebad391ea40bcde76474b81b78a83e6a5 (diff)
downloaddla-asm-8d7e5662f08dada2f88fa03b6129fb0eb3119de0.tar.gz
Micro-optimizations.
Diffstat (limited to 'dla.s')
-rw-r--r--dla.s15
1 files changed, 9 insertions, 6 deletions
diff --git a/dla.s b/dla.s
index 927acb8..4b2be32 100644
--- a/dla.s
+++ b/dla.s
@@ -531,17 +531,20 @@ checkbounds:
beq oob
cmp max_x
beq oob
- sta cursor_x
+ ;sta cursor_x
lda part_y
cmp min_y
beq oob
cmp max_y
beq oob
- sta cursor_y
+ ;sta cursor_y
+ ; checkbounds is 30 cycles when the pixel is in bounds.
+ ; I think we can beat this.
+checkneigh:
; check neighbors. used to be a subroutine, inlined it.
; also inlined plotsetup here.
- ldx cursor_y
+ ldx part_y
lda lineaddrs_l,x
sta pixptr
lda lineaddrs_h,x
@@ -550,7 +553,7 @@ checkbounds:
; 3/4 of the time, we can use a faster code path, check
; (-1,0) and (1,0) at the same time. this happens only when
; both pixels lie within the same byte.
- ldx cursor_x
+ ldx part_x
lda fastmasks,x
beq slow_x
ldy xoffsets,x
@@ -570,13 +573,13 @@ slow_x:
bne stick
check_y:
; (0,-1)
- ldx cursor_y ;3
+ ldx part_y ;3
lda lineaddrs_l-1,x ;5
sta pixptr ;3
lda lineaddrs_h-1,x ;5
sta pixptr+1 ;3
;=19
- ldx cursor_x
+ ldx part_x
ldy xoffsets,x
lda xmasks,x
sta pixmask