diff options
author | B. Watson <urchlay@slackware.uk> | 2022-11-03 15:16:19 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2022-11-03 15:16:19 -0400 |
commit | 8d7e5662f08dada2f88fa03b6129fb0eb3119de0 (patch) | |
tree | 209d9bef7adbbda1e299ee3877281aec341b08d2 | |
parent | 9dd8d53ebad391ea40bcde76474b81b78a83e6a5 (diff) | |
download | dla-asm-8d7e5662f08dada2f88fa03b6129fb0eb3119de0.tar.gz |
Micro-optimizations.
-rw-r--r-- | dla.s | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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 |