aboutsummaryrefslogtreecommitdiff
path: root/dla.s
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2022-11-04 02:32:46 -0400
committerB. Watson <urchlay@slackware.uk>2022-11-04 02:32:46 -0400
commitfad90e3c58d88f96c966209db12e010320fa9c87 (patch)
treec3d4c934c7729f6fcbb37312592809d391e61425 /dla.s
parent542c4c433a2ca17856d3d229111dc36813f594d3 (diff)
downloaddla-asm-fad90e3c58d88f96c966209db12e010320fa9c87.tar.gz
Save 3 more cycles in drunkwalk.
Diffstat (limited to 'dla.s')
-rw-r--r--dla.s14
1 files changed, 8 insertions, 6 deletions
diff --git a/dla.s b/dla.s
index 68a13ba..5a0932b 100644
--- a/dla.s
+++ b/dla.s
@@ -551,10 +551,10 @@ checkneigh:
; check neighbors. used to be a subroutine, inlined it.
; also inlined plotsetup here.
sty part_y ; 3
- lda lineaddrs_l,y
- sta pixptr
- lda lineaddrs_h,y
- sta pixptr+1
+ lda lineaddrs_l,y ; 5
+ sta pixptr ; 3
+ lda lineaddrs_h,y ; 5
+ sta pixptr+1 ; 3
; 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
@@ -601,8 +601,10 @@ pp1ok:
tay
lda (pixptr),y
and pixmask
- bne stick
- jmp dwloop ; too far for branch. X *still* holds (maybe modified) part_x
+ beq dwloop ; ...or fall through to stick.
+ ; note that if we add much more code to drunkwalk, the beq will
+ ; have to become a jmp, which takes 3 extra cycles. so any code
+ ; added above had better save more than 3 cycles!
stick: ; we always get here with Z flag clear
stx part_x ; only update part_x at exit.