From: Brett Gordon Date: Sat, 31 Dec 2016 19:08:31 +0000 (-0500) Subject: Add a timeout to dw-over-becker, simplify. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a07f799368c6686cea5e3e009f04d98b3801a92a;p=FUZIX.git Add a timeout to dw-over-becker, simplify. --- diff --git a/Kernel/platform-coco3/dwread.s b/Kernel/platform-coco3/dwread.s index 1b4c587b..da93a469 100644 --- a/Kernel/platform-coco3/dwread.s +++ b/Kernel/platform-coco3/dwread.s @@ -78,32 +78,35 @@ BCKSTAT equ $FF41 BCKPORT equ $FF42 ENDC * NOTE: There is no timeout currently on here... -DWRead clra ; clear Carry (no framing error) - deca ; clear Z flag, A = timeout msb ($ff) - tfr cc,b - pshs u,x,dp,b,a ; preserve registers, push timeout msb - leau ,x - ldx #$0000 +DWRead pshs dp,x,u ; preserve registers, push timeout msb + ldd #(60*256)+$ff ; A = timeout of 1+ sec, B = new DP + tfr b,dp ; set DP + tfr x,u ; U = data pointer + ldx #$0000 ; X = chksum IFEQ NOINTMASK orcc #IntMasks ENDC -loop@ ldb BCKSTAT +loop@ tst <$ff03 ; test for vsync + bpl a@ ; no vsync continue + tst <$ff02 ; clear vsync flag + deca ; dec timeout + bne a@ ; not timeout continue + ;; return w/ timeout! + inca ; A was zero so inc to clear Z (timeout) + puls dp,x,u,pc ; restore return + ;; no timeout continue checking for data +a@ ldb