---------------------------
SB: A Simple Screen Blanker
By Xavier LeClercq
Vieux Chemin d'ATH N°12
B-7548 Warchin, Belgium
---------------------------

     SB is a simple screen blanker. It is to be run as a background task by
using the RUN command from a Shell or CLI.
     The utility's priority is then very low -110. It uses little CPU time.
Even better, it waits for signals from the timer.device, for example,
--> Waiting task.
     Here are some examples of how it works:

     · Run from timer.device 'n' minutes request.
     · Run at the same time a handler from the task input.device.
     · Wait for a time's signal from timer.
     · Set background color NewScreen to 0 (black).
     · Wait for a signal from handler to wake up the task.

     If a signal advises, it means the mouse or the keyboard has been
activated. Then the screen is set to its original aspect.

run SB 3 ; wait (about..) 3 minutes

     The input.device's handler is : (<<< A68K assembler >>>)

        IECLASS_RAWKEY        EQU   $01
        ; A raw mouse report from the game port device
        IECLASS_RAWMOUSE      EQU   $02
        ; A private console event

         XREF _task
         XREF _InputSigMask
         XDEF _SBHANDLER
 
_SBHandler
   move.l a0,-(sp)

Loop
   move.b 4(a0),d1
   move.l _InputSigMask,d0
   cmp.b #IECLASS_RAWMOUSE,d1
   bne no_mouse
   bra send_signal

no_mouse
   cmp.b #IECLASS_RAWKEY,d1
   bne Next

send_signal
   move.l a0,-(sp)
   move.l _task,a1
   move.l $4,a6
   jsr -324(a6)
   move.l (sp)+,a0

Next
   move.l (a0),d0
   move.l d0,a0
   bne Loop
   move.l (sp)+,d0  
   rts

END OF TEXT
