home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff396.lha / pbar / PBarExe.asm < prev    next >
Assembly Source File  |  1990-10-29  |  2KB  |  98 lines

  1.  
  2. ;    This is the code created by PBar V1.0
  3. ;    by Preben Nielsen.
  4. ;    Assemble it as case-sensitive.
  5.     OPT O+
  6. ;    OPT O1+        ;Tells when a branch could be optimised to short
  7. ;    OPT i+        ;Tells when '#' is probably missing
  8.  
  9.     incdir    "INCLUDE:"
  10.     include "exec/exec_lib.i"
  11.     include "intuition/intuition.i"
  12.     include "intuition/intuition_lib.i"
  13.     include "libraries/dosextens.i"
  14.  
  15. LoadBase    MACRO
  16.         IFNC        '\1','ExecBase'
  17.         movea.l        \1,A6
  18.         ENDC
  19.         IFC        '\1','ExecBase'
  20.         movea.l        4.W,A6
  21.         ENDC
  22.         ENDM
  23. CallLib        MACRO
  24.         jsr        _LVO\1(A6)
  25.         ENDM
  26. Call        MACRO
  27.         bsr        \1
  28.         ENDM
  29. Push        MACRO
  30.         movem.l        \1,-(SP)
  31.         ENDM
  32. Pop        MACRO
  33.         movem.l        (SP)+,\1
  34.         ENDM
  35.  
  36. IntBase        EQUR        A5
  37. PatExe        Push        D0-D7/A0-A6
  38.         LoadBase    ExecBase
  39.         suba.l        A1,A1
  40.         CallLib        FindTask        ;Find us
  41.         movea.l        D0,A2
  42.         tst.l        pr_CLI(A2)
  43.         bne.S        WBAndCLIStartUp
  44.         lea        pr_MsgPort(A2),A0
  45.         CallLib        WaitPort        ;wait for a message
  46.         lea        pr_MsgPort(A2),A0
  47.         CallLib        GetMsg            ;then get it
  48.         move.l        D0,WBenchMsg        ;save it for later reply
  49. WBAndCLIStartUp    lea        IntName(PC),A1
  50.         CallLib        OldOpenLibrary
  51.         move.l        D0,IntBase
  52.         tst.l        D0
  53.         beq.S        Exit
  54.  
  55.         lea        790(IntBase),A1        ;Private part of IntuitionBase
  56.         lea        Pattern(PC),A0
  57.         moveq        #23,D0
  58. CopyPatLoop    move.b        (A0)+,(A1)+
  59.         dbra        D0,CopyPatLoop
  60.         LoadBase    IntBase
  61. RefreshWindows    move.l        ib_FirstScreen(IntBase),A4
  62. RSLoop        move.l        A4,D0
  63.         beq.S        EndRS
  64.         move.l        sc_FirstWindow(A4),A3
  65. RWLoop        move.l        A3,D0
  66.         beq.S        EndRW
  67.         move.l        D0,A0
  68.         CallLib        RefreshWindowFrame
  69.         move.l        wd_NextWindow(A3),A3
  70.         bra.S        RWLoop
  71. EndRW        move.l        sc_NextScreen(A4),A4
  72.         bra.S        RSLoop
  73. EndRS
  74.  
  75. Exit        LoadBase    ExecBase
  76. FreeInt        move.l        IntBase,D0
  77.         beq.S        ReplyWB
  78.         movea.l        D0,A1
  79.         CallLib        CloseLibrary
  80. ReplyWB        move.l        WBenchMsg(PC),D0
  81.         beq.S        AllDone
  82.         CallLib        Forbid
  83.         movea.l        D0,A1
  84.         CallLib        ReplyMsg        ;Reply WBenchMessage if we are started from WB
  85. AllDone        Pop        D0-D7/A0-A6
  86.         moveq        #0,D0
  87.         rts
  88.  
  89. IntName        dc.b        'intuition.library',0
  90.         EVEN
  91. WBenchMsg    dc.l        0
  92. ;This is where PBar stores the pattern 
  93. Pattern        dc.w        $0000,$0000,$ffff,$ffff,$0000,$0000,$ffff,$ffff
  94. ;This is where PBar stores the mask
  95.         dc.w        $4444,$1111,$4444,$1111
  96.         END
  97.  
  98.