(***************************************************************************
*  Programme : Vibrator.mod                                                *
*  Usage     : Vibrator                                                    *
*  Version   : V2.30                                                       *
*  Date      : 29.03.1989                                                  *
*  Author    : Jörg Sixt                                                   *
*  Purpose   : start it and you'll see there's none                        *
*  Language  : Modula-2,AMSoft  PD-Version from Fish 113                   *
*  Bugs      : none known                                                  *
***************************************************************************)

MODULE Vibrator ;

FROM SYSTEM    IMPORT ADR ;
FROM Exec      IMPORT GetMsg,ReplyMsg;
FROM Intuition IMPORT NewWindow,WindowPtr,OpenWindow,CloseWindow,ScreenFlags,
                      ScreenFlagSet,IDCMPFlags,IDCMPFlagSet,WindowFlags,
                      WindowFlagSet,IntuiMessagePtr,RemakeDisplay,ViewAddress,
                      CurrentTime,DisplayAlert ;
FROM Graphics  IMPORT ViewPtr ;
FROM Dos       IMPORT Delay ;

CONST
    DeltaTime           =  1 ; (* Time in ticks between two movements *)
    DeltaX              =  5 ; (* X-deflection *)
    DeltaY              =  5 ; (* Y-deflection *)

VAR
    NewWin              : NewWindow ;
    GagWinPtr           : WindowPtr ;
    WhatPtr             : IntuiMessagePtr ;
    GagView             : ViewPtr ;
    oldX,oldY,help      : INTEGER ;
    secPtr,micPtr       : POINTER TO LONGCARD ;
    PowerLED [12574721] : CHAR ;
    Guru : RECORD
       Xpos : CARDINAL ;
       Text : ARRAY [0..59] OF CHAR ;
    END ;

BEGIN
   WITH Guru DO
      Text := "?Vibration over and over again by  sick amiga softwäre !!!" ;
      Xpos := 84 ; Text[0] := CHR(20) ; Text[59] := CHR(0) ;
   END ;
   WITH NewWin DO
      leftEdge    :=   0 ; topEdge   :=   0 ;
      width       := 500 ; height    :=  10 ;
      detailPen   := 255 ; blockPen  := 255 ;
      idcmpFlags  := IDCMPFlagSet  {closeWindow} ;
      flags       := WindowFlagSet {windowClose,activate,windowRefresh} ;
      firstGadget := NIL ; checkMark := NIL ;
      title       := ADR("Shiverbench release 2.3.     0000000 free memory") ;
      screen      := NIL ; bitMap    := NIL ;
      type        := ScreenFlagSet {wbenchScreen} ;
   END ;
   GagWinPtr := OpenWindow (NewWin) ; IF (GagWinPtr = NIL) THEN HALT ; END ;
   GagView   := ViewAddress() ;
   oldX      := GagView^.dxOffset ;
   oldY      := GagView^.dyOffset ;
   LOOP
      WhatPtr := GetMsg (GagWinPtr^.userPort) ;
      IF (WhatPtr <> NIL) THEN EXIT ; END ;
      CurrentTime (secPtr,micPtr) ;
      IF ODD(micPtr^) THEN
         IF (GagView^.dyOffset = oldY) THEN
             GagView^.dyOffset:= oldY + DeltaY ;
         ELSE
             GagView^.dyOffset:= oldY ;
         END ;
      ELSE
         IF (GagView^.dxOffset = oldX) THEN
             GagView^.dxOffset:= oldX +DeltaX ;
         ELSE
             GagView^.dxOffset:= oldX ;
         END ;
      END ;
      RemakeDisplay ;
      Delay (DeltaTime) ;
      IF (PowerLED = 374C) THEN
          PowerLED:= 376C ;
      ELSE
          PowerLED:= 374C ;
      END ;
   END ;
   ReplyMsg (WhatPtr) ;
   GagView^.dxOffset := oldX ;
   GagView^.dyOffset := oldY ;
   RemakeDisplay ;
   IF DisplayAlert (0,ADR(Guru),35) THEN END ; (* trick to avoid a variable *)
   PowerLED := 374C ;
   CloseWindow (GagWinPtr) ;
END Vibrator .

