Newsgroups: comp.sys.sinclair
Path: ulke.hiMolde.no!nntp-trd.UNINETT.no!sunic!sunic.sunet.se!liuida!d92perfo
From: d92perfo@ida.liu.se (Per-Erik Forssen)
Subject: Minerva capslock
X-Nntp-Posting-Host: astmatix.ida.liu.se
Message-ID: <d92perfo.808992169@news>
Sender: news@ida.liu.se
Organization: CIS Dept, Linkoping University, Sweden
X-Newsreader: NN version 6.5.0 #6 (NOV)
Date: Mon, 21 Aug 1995 08:02:49 GMT
Lines: 84

  Greetings to all:-) Minerva users out there!
I recently stumbled on a neat little PD program that changes the shape of
the cursor when in caps lock mode for all jobs. I have converted the routine
from a low priority job to a scheduler task to keep the CPU load down. However
there is still a small bug in the program, when CAPS mode is altered with the
cursor lit the old cursor will be left in place until a key is pressed.
  Does anyone know of a way to detect the cursor state cleanly from a scheduler
task? As far as I know the sv.fstat variable only indicates the time in 1/50
sec ticks 'till cursor toggle.
Here is the asm listing of the installation routine:

*
* Minvera compatiable capslock
* using facility to change shape of the cursor
*
* 14.5.91 v1.0 BASIC program used in multi-tasking basic
* 15.5.91 v1.1 Liberated basic program
* 17.5.91 v1.2 Assembler file
* 20.8.95 v1.3 Converted to a scheduler task    <Per-Erik Forssn>
*
sv.caps      equ          $88          system variable caps offset
sv.chtop     equ          $7c          minvera enhances system variables
sv.fstat     equ          $aa          cursor flash status
sx.fstat     equ          $33          minvera cursor offset
upper        equ          $53          upper case
lower        equ          $4c          lower case
mt.inf       equ          $00
mt.alres     equ          $0e          allocate resident mem
mt.lschd     equ          $1e          link scheduler task
ut.mtext     equ          $00d0        write message

             section      code

             moveq        #mt.inf,d0
             trap         #1
             lea          noinst_txt,a1
             cmpi.l       #'1.10',d2
             ble.s        wrong_ver
             cmpi.l       #'2.00',d2
             bpl.s        wrong_ver
             moveq        #mt.alres,d0
             moveq        #8,d1                     ; no of bytes req
             trap         #1
             tst.l        d0
             bne.s        err_ex
*
             moveq        #mt.lschd,d0              ;linkin scheduler task
             lea          schd,a1                   ;recall last line
             move.l       a1,4(a0)                  ;base of task
             trap         #1
             lea          install_txt,a1
wrong_ver    move.w       ut.mtext,a2
             suba.l       a0,a0
             jsr          (a2)
err_ex       rts
*
install_txt  dc.w         23
             dc.b         'CAPS cursor installed.',10,0
noinst_txt   dc.w         24
             dc.b         'Minerva OS not present.',10
*   Scheduler task
*   CAPSLOCK dependent cursor
schd         move.w       sv.fstat(a6),d1
             bne.s        schd_skip
             move.l       sv.chtop(a6),a1            start of minvera s.v.
             move.w       sv.caps(a6),d1             caps lock status
             bne.s        schd_capson
             move.b       #lower,sx.fstat(a1)        set cursor, caps off
schd_skip    rts
schd_capson  move.b       #upper,sx.fstat(a1)        set cursor, caps on
             rts
             end


  Please help me out on this, I quite like the feature!

/--------------------------------------------------------------------\
|Per-Erik Forssen        | 2:nd year 'Computer science and Technology'|
|Ryds Alle 1.211         | Linkoeping University, SWEDEN              |
|S-582 51 Linkoeping     | I've NEVER trusted a Klingon,              |
|SWEDEN                  | and I never will!                          |
|d92perfo@und.ida.liu.se |                                            |
\--------------------------------------------------------------------/

