From 9dd8d53ebad391ea40bcde76474b81b78a83e6a5 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 2 Nov 2022 15:18:42 -0400 Subject: Check for Start key in vblank only. --- dla.s | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/dla.s b/dla.s index 849bb23..927acb8 100644 --- a/dla.s +++ b/dla.s @@ -84,6 +84,12 @@ init: lda #>DEFAULTPART sta maxparticles+1 + ; init our immediate vblank handler + lda #6 + ldy #consol_isr + jsr SETVBV + ; "New" option jumps here, restore GR.0 screen getargs: jsr restore_gr0 @@ -162,6 +168,7 @@ wl: lda #1 ; ...turn off shadow reg updates (tiny speed boost) sta CRITIC lda #0 + sta DMACTL sta particles sta particles+1 sta RTCLOK @@ -532,17 +539,6 @@ checkbounds: beq oob sta cursor_y - ldx #0 - lda CONSOL - cmp #6 - bne dontplot - jsr plot - jsr unplot - ldx #DMA_ON -dontplot: - ;stx SDMCTL ; nope, shadow updates are off... - stx DMACTL - ; check neighbors. used to be a subroutine, inlined it. ; also inlined plotsetup here. ldx cursor_y @@ -563,7 +559,6 @@ dontplot: beq check_y slow_x: ; (-1,0) - ldx cursor_x ldy xoffsets-1,x lda xmasks-1,x and (pixptr),y @@ -725,6 +720,28 @@ close1: sta ICCOM,x jmp CIOV +;;; Interrupt handler: consol_isr +;;; Called via immediate IRC. Enables/disables ANTIC DMA based +;;; on the status of the Start key, but only while CRITIC is set. +consol_isr: + ;pha + ;txa + ;pha + lda CRITIC + beq ci_done + ldx #0 + lda CONSOL + cmp #6 + bne ci_nopress + ldx #DMA_ON +ci_nopress: + stx DMACTL +ci_done: + ;pla + ;tax + ;pla + jmp SYSVBV + ;;;;; end of executable code, data tables from here on out. ; prompts. -- cgit v1.2.3