aboutsummaryrefslogtreecommitdiff
path: root/dla.s
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2022-11-08 03:07:04 -0500
committerB. Watson <urchlay@slackware.uk>2022-11-08 03:07:19 -0500
commit3d6abe38d72347d6b254070edb50cf56f236f5d7 (patch)
treeed204fb4b2e90caea36c102e00d0f50099fcdd45 /dla.s
parent8303d83efab1ee1135cf2396a792479966ed2303 (diff)
downloaddla-asm-3d6abe38d72347d6b254070edb50cf56f236f5d7.tar.gz
Add/fix comments, profiling for initscreen and render. Runtime ~3:05 now.
Diffstat (limited to 'dla.s')
-rw-r--r--dla.s30
1 files changed, 28 insertions, 2 deletions
diff --git a/dla.s b/dla.s
index bae1b39..4bc8559 100644
--- a/dla.s
+++ b/dla.s
@@ -355,7 +355,10 @@ jsaveimage:
jmp saveimage
;;; Subroutine: set_limits
-;;; Sets the X/Y min/max limits based on circlesize
+;;; Sets the X/Y min/max limits based on circlesize.
+;;; Preserves Y register, trashes everything else.
+; The selfmod_* addresses are operands to compare instructions,
+; found in drunkwalk.s.
set_limits:
ldx circlesize
lda xmin,x
@@ -369,9 +372,20 @@ set_limits:
rts
;;; Subroutine: initscreen
-;;; clear screen memory and point ANTIC to our display list.
+;;; Clear screen and pixarray memory, point ANTIC to our display list.
;;; no arguments. trashes all registers.
+; Take 18 jiffies (0.3 sec). Probably not worth optimizing.
+; Uncomment next line to see how long it takes (check locations
+; $0600-$0603 in atari800 debugger).
+; INITSCR_PROFILE = 1
initscreen:
+.ifdef INITSCR_PROFILE
+ lda RTCLOK+1
+ sta $0600
+ lda RTCLOK+2
+ sta $0601
+.endif
+
lda #<screen
sta pixptr
lda #>screen
@@ -405,6 +419,9 @@ isloop:
lda #>dlist
sta SDLSTH
+ ; sneaky: tell the E: driver that screen RAM starts in our buffer,
+ ; so we can use printchr and printchrx to print to the bottom text
+ ; line in graphics mode.
lda #<textbuf
sta SAVMSC
lda #>textbuf
@@ -413,10 +430,19 @@ isloop:
sta ROWCRS
sta COLCRS
sta COLCRS+1
+.ifdef INITSCR_PROFILE
+ lda RTCLOK+1
+ sta $0602
+ lda RTCLOK+2
+ sta $0603
+.endif
rts
.include "render.s"
+;;; Subroutine: plot
+;;; Turns on the pixel at (cursor_x, cursor_y), in pixarray.
+;;; Trashes all registers (and pixptr).
plot:
ldx cursor_y
lda lineaddrs_l,x