From 3d6abe38d72347d6b254070edb50cf56f236f5d7 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 8 Nov 2022 03:07:04 -0500 Subject: Add/fix comments, profiling for initscreen and render. Runtime ~3:05 now. --- dla.s | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'dla.s') 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 @@ -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 @@ -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 -- cgit v1.2.3