From e1aab2e0a37016b0a892405467697d68cdba467f Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 9 Nov 2022 22:59:11 -0500 Subject: Keep drunkwalk and lineaddrs_l/h from crossing page boundaries (3% speedup). --- dla.s | 24 ++++-------------------- nextpage.inc | 7 +++++++ 2 files changed, 11 insertions(+), 20 deletions(-) create mode 100644 nextpage.inc diff --git a/dla.s b/dla.s index 12724d7..e1429e9 100644 --- a/dla.s +++ b/dla.s @@ -9,6 +9,7 @@ .include "atari.inc" .include "xex.inc" + .include "nextpage.inc" loadaddr = $2000 screen = $4000 ; must be on a x000 (4K) boundary @@ -452,6 +453,7 @@ plot: sta (pixptr),y rts + nextpage .include "drunkwalk.s" ;;; Subroutine: drawseed @@ -632,6 +634,7 @@ seeds_h: .byte >(seed_point-1),>(seed_plus-1),>(seed_4pt-1),>(seed_long-1) ; table of addresses, for each line on the screen. bloats the ; code by 384 bytes, but compared to calculating the address, is ; twice as fast! + nextpage lineaddrs_l: laddr .set pixarray .repeat 170 @@ -639,6 +642,7 @@ lineaddrs_l: laddr .set laddr + 170 .endrep + nextpage lineaddrs_h: laddr .set pixarray .repeat 170 @@ -646,26 +650,6 @@ lineaddrs_h: laddr .set laddr + 170 .endrep - ; tables to replace X coord => mask-and-offset calculations. -xoffsets: - xoffs .set 0 - .repeat 32 - .repeat 8 - .byte xoffs - .endrep - xoffs .set xoffs + 1 - .endrep - -xmasks: - .repeat 32 - .byte $80,$40,$20,$10,$08,$04,$02,$01 - .endrep - -fastmasks: - .repeat 32 - .byte $00,$a0,$50,$28,$14,$0a,$05,$00 - .endrep - ;;; display list ; ANTIC opcodes blank8 = $70 diff --git a/nextpage.inc b/nextpage.inc new file mode 100644 index 0000000..7e13042 --- /dev/null +++ b/nextpage.inc @@ -0,0 +1,7 @@ + +; fill to the start of the next page. + .macro nextpage + .repeat ((>(*)+1)*256)-* + .byte 0 + .endrep + .endmacro -- cgit v1.2.3