From fad90e3c58d88f96c966209db12e010320fa9c87 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 4 Nov 2022 02:32:46 -0400 Subject: Save 3 more cycles in drunkwalk. --- dla.s | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'dla.s') 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. -- cgit v1.2.3