changeset 2736:31cd1f1b4fb0 lwtools-port

Added ClrScrn and CapsLock functionality for Atari VTIO
author Boisy Pitre <boisy.pitre@nuance.com>
date Mon, 10 Dec 2012 16:27:38 -0600
parents 8a4c73c4bc8c
children bfe3de781ddf
files defs/atarivtio.d level1/atari/modules/vtio.asm
diffstat 2 files changed, 35 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/defs/atarivtio.d	Thu Oct 04 14:23:01 2012 -0500
+++ b/defs/atarivtio.d	Mon Dec 10 16:27:38 2012 -0600
@@ -15,6 +15,7 @@
 V.CurRow  RMB       1
 V.CurCol  RMB       1
 V.CurChr  RMB       1                   character under the cursor
+V.CapsLck RMB       1                   caps lock flag
 V.KySns   RMB       1                   key sense flags
 V.EscCh1  RMB       2                   escape vector handler
 V.EscVect RMB       2                   escape vector handler
--- a/level1/atari/modules/vtio.asm	Thu Oct 04 14:23:01 2012 -0500
+++ b/level1/atari/modules/vtio.asm	Mon Dec 10 16:27:38 2012 -0600
@@ -343,10 +343,25 @@
 		rts
 		
 ClrScrn
+          clr       V.CurCol,u
+          lda       #G.Rows-1
+clrloop@
+          sta       V.CurRow,u
+          pshs      a
+          bsr       DelLine
+          puls      a
+          deca
+          bpl       clrloop@
+          clr       V.CurCol,u
+          rts
+          
 ErEOScrn
 CurUp
 NoOp
-CurHome
+CurHome   clr       V.CurCol,u
+          clr       V.CurRow,u
+          rts
+          
 CurXY
 ErEOLine
 Do05
@@ -492,6 +507,23 @@
 		anda	#$5F
 		suba	#$40
 noctrl@
+* check for caps lock
+          cmpa #$82
+          bne  tst4caps@
+          tst  V.CapsLck,u
+          beq  turnon@
+          clra
+turnon@   sta  V.CapsLck,u
+          bra  KeyLeave
+tst4caps@
+          tst  V.CapsLck,u
+          beq  goon@
+          cmpa #$61
+          blt  goon@
+          cmpa #$7a
+          bgt  goon@
+          suba #$20
+goon@          
 		ldb	V.IBufH,u  get head pointer in B
 		leax	V.InBuf,u  point X to input buffer
 		abx              X now holds address of head
@@ -523,6 +555,7 @@
 
 * Update the shadow register then the real register to disable and
 * re-enable the keyboard interrupt
+KeyLeave
 		pshs cc
           orcc #IntMasks
 		lda	>D.IRQENShdw