home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d981 / huntwindows.lha / HuntWindows / Huntwindows.s < prev    next >
Text File  |  1994-04-04  |  51KB  |  2,470 lines

  1.              output    work:huntwindows
  2.             OPT o+,ow-
  3.  
  4. DEBUG            equ    0
  5.             ;0=Debugging off, 1=Debugging on
  6.             ;no includes - i use them all preassembled!
  7.  
  8.             ;.... nearly all ....
  9.  
  10.             incdir    "asminc:"
  11.             include "workbench/startup.i"
  12.             include "workbench/workbench.i"
  13.             include    "workbench/icon_lib.i"
  14.             include    "libraries/commodities.i"
  15.             include    "graphics/view.i"
  16.  
  17.             ;Some helpful macros
  18. CALL            macro
  19.             jsr    _LVO\1(a6)
  20.             endm
  21. Push            macro
  22.             movem.l    \1,-(sp)
  23.             endm
  24. Pull            macro
  25.             movem.l    (sp)+,\1
  26.             endm
  27. RSave            macro
  28.             movem.l    a0-a6/d0-d7,-(sp)
  29.             endm
  30. RLoad            macro
  31.             movem.l    (sp)+,a0-a6/d0-d7
  32.             endm
  33.  
  34. MaxScreens        equ    64    ;Maximum of 64 Screens - who has more?
  35. ScreenMemSize        equ    MaxScreens*8    
  36.  
  37.         ;Bits for Communication
  38. SignalWindow        equ    0
  39. SignalScreen        equ    1
  40. SignalButton        equ    2
  41. SignalSmooth        equ    3
  42.  
  43.  
  44.  
  45. MyHotkeyID    =    1
  46. MyActionID    =    2
  47. MyCustomID    =    3
  48. MyLWinID    =    4
  49. MyNWinID    =    5
  50.  
  51.             RSave
  52.  
  53.             move.l    $04,a6
  54.             move.l    #AllocLength,d0
  55.             move.l    #MEMF_CLEAR,d1
  56.             CALL    AllocMem
  57.             move.l    d0,a4
  58.             tst.l    d0
  59.             beq    EndeRaus
  60.  
  61.             move.l    d0,RememberA4
  62.             move.l    a7,RememberStack
  63.  
  64.             lea    intuition(pc),a1
  65.             moveq.l    #37,d0
  66.             CALL    OpenLibrary
  67.             move.l    d0,IntBase(a4)
  68.             beq    Error2
  69.  
  70.             lea    DosName(pc),a1
  71.             moveq.l    #37,d0
  72.             CALL    OpenLibrary    
  73.             move.l    d0,DosBase(a4)
  74.             beq    Error2
  75.  
  76.             lea    GadName(pc),a1
  77.             moveq.l    #37,d0
  78.             CALL    OpenLibrary
  79.             move.l    d0,GadBase(a4)
  80.             beq    Error2
  81.  
  82.             lea    CommName(pc),a1
  83.             moveq.l    #37,d0
  84.             CALL    OpenLibrary
  85.             move.l    d0,CommBase(a4)
  86.             beq    Error2
  87.  
  88.             CALL    CreateMsgPort
  89.             move.l    d0,MouseMsgPort(a4)
  90.             beq    Error2
  91.  
  92.             move.l    #SIGBREAKF_CTRL_C,SignalMask(a4)
  93.  
  94.             move.l    d0,a0
  95.             move.l    #IOSTD_SIZE,d0
  96.             CALL    CreateIORequest
  97.             move.l    d0,MyIORequest(a4)
  98.             beq    Error2
  99.  
  100.             lea    InputName(pc),a0
  101.             moveq.l    #0,d0
  102.             move.l    MyIORequest(a4),a1
  103.             moveq.l    #0,d1
  104.             CALL    OpenDevice
  105.             tst.l    d0
  106.             bne    Error2
  107.  
  108.             lea    IconName(pc),a1
  109.             moveq.l    #33,d0
  110.             CALL    OpenLibrary
  111.             move.l    d0,IconBase(a4)
  112.             beq    Error2
  113.  
  114.             move.l    ThisTask(a6),a1
  115.             move.l    a1,OwnTask(a4)
  116.             tst.l    pr_CLI(a1)
  117.             bne    CliStart
  118.             lea    pr_MsgPort(a1),a2
  119.             move.l    a2,a0
  120.             CALL    WaitPort
  121.             move.l    a2,a0
  122.             CALL    GetMsg
  123.             move.l    d0,WBMessage(a4)
  124.             move.l    d0,a3
  125.         
  126.             move.l    sm_ArgList(a3),d7
  127.             beq    DisableSave
  128.             move.l    d7,a0
  129.             move.l    wa_Lock(a0),d1
  130.             move.l    DosBase(a4),a6
  131.             CALL    CurrentDir
  132.  
  133.             move.l    IconBase(a4),a6
  134.             move.l    d7,a0
  135.             move.l    wa_Name(a0),a0
  136.             CALL    GetDiskObject
  137.             move.l    d0,DObject(a4)
  138.             beq    Error2
  139.  
  140.             lea    WBTemplate(pc),a3
  141.  
  142.             move.l    d0,a0
  143.             move.l    do_ToolTypes(a0),a0
  144.             
  145. GetEmLoop        tst.l    (a3)
  146.             beq.s    FreeDobj
  147.             move.l    TemplateText(a3),a1
  148.             beq.s    FreeDobj
  149.             move.l    a0,-(sp)
  150.             CALL    FindToolType
  151.             move.l    (sp)+,a0
  152.             sub.l    a2,a2
  153.             move.w    TemplateA4(a3),a2
  154.             add.l    a4,a2
  155.             move.l    d0,(a2)
  156.             add.l    #TemplateSize,a3
  157.             bra.s    GetEmLoop
  158.  
  159. FreeDobj        bsr    BuildPatterns
  160.  
  161.             bra.s    SkipReadArgs
  162.  
  163. CliStart        move.l    DosBase(a4),a6
  164.  
  165.             move.l    #Template,d1
  166.             lea    TemplateArray(a4),a0
  167.             move.l    a0,d2
  168.             moveq.l    #0,d3
  169.             CALL    ReadArgs    ;Get options
  170.             tst.l    d0
  171.             beq    Error2
  172.             move.l    d0,Args(a4)
  173.     
  174.             bsr    BuildPatterns
  175.  
  176. DisableSave        move.l    #1,TempSave(a4)
  177.  
  178. SkipReadArgs        move.l    $04,a6
  179.             lea    GraphicsName(pc),a1
  180.             moveq.l    #36,d0
  181.             CALL    OpenLibrary
  182.             move.l    d0,GraphicsBase(a4)
  183.             beq    Error2
  184.  
  185.             tst.l    TempHADJ(a4)
  186.             beq    GotIt1
  187.             move.l    TempHADJ(a4),a0
  188.             bsr    GetNexta0
  189.             clr.l    TempHADJ(a4)
  190.             cmp.b    #"l",d0
  191.             beq.s    GotIt1
  192.             add.l    #1,TempHADJ(a4)
  193.             cmp.b    #"r",d0
  194.             beq.s    GotIt1
  195.             add.l    #1,TempHADJ(a4)
  196.             cmp.b    #"c",d0
  197.             beq.s    GotIt1
  198.             add.l    #1,TempHADJ(a4)
  199.  
  200. GotIt1            tst.l    TempVADJ(a4)
  201.             beq    GotIt2
  202.             move.l    TempVADJ(a4),a0
  203.             bsr    GetNexta0
  204.             clr.l    TempVADJ(a4)
  205.             cmp.b    #"t",d0
  206.             beq.s    GotIt2
  207.             add.l    #1,TempVADJ(a4)
  208.             cmp.b    #"b",d0
  209.             beq.s    GotIt2
  210.             add.l    #1,TempVADJ(a4)
  211.             cmp.b    #"c",d0
  212.             beq.s    GotIt2
  213.             add.l    #1,TempVADJ(a4)
  214.  
  215. GotIt2            tst.l    TempAction(a4)
  216.             beq    GotIt3
  217.             move.l    TempAction(a4),a0
  218.             bsr    GetNexta0
  219.             clr.l    TempAction(a4)
  220.             cmp.b    #"n",d0
  221.             beq.s    GotIt3
  222.             add.l    #1,TempAction(a4)
  223.             cmp.b    #"h",d0
  224.             beq.s    GotIt3
  225.             add.l    #1,TempAction(a4)
  226.  
  227. GotIt3            tst.l    TempCXPRI(a4)
  228.             beq.s    GotIt3_1
  229.             move.l    TempCXPRI(a4),a0
  230.             bsr    GetNexta0
  231.             bsr    GetInteger
  232.             move.l    d0,TempCXPRI(a4)
  233.             move.b    d0,MyPri
  234.  
  235. GotIt3_1        tst.l    TempDelay(a4)
  236.             beq.s    GotIt3_2
  237.             move.l    TempDelay(a4),a0
  238.             bsr    GetNexta0
  239.             bsr    GetInteger
  240.             tst.l    d0
  241.             bmi.s    GotIt3_2
  242.             cmp.l    #100,d0
  243.             bge.s    GotIt4
  244.             move.l    d0,TempDelay(a4)
  245.  
  246. GotIt3_2        tst.l    TempSmooth(a4)
  247.             beq.s    GotIt4
  248.             move.l    TempSmooth(a4),a0
  249.             bsr    GetNexta0
  250.             bsr    GetInteger
  251.             tst.l    d0
  252.             bmi.s    GotIt4
  253.             cmp.l    #500,d0
  254.             bgt.s    GotIt4
  255.             move.l    d0,TempSmooth(a4)
  256.  
  257. GotIt4            move.l    $04,a6
  258.             CALL    CreateMsgPort
  259.             move.l    d0,BrokerPort
  260.             move.l    d0,MyPort(a4)
  261.             move.l    d0,a0
  262.             move.b    MP_SIGBIT(a0),d0
  263.             move.l    SignalMask(a4),d1    ;Enter signal into
  264.             bset    d0,d1            ;mask for waiting
  265.             move.l    d1,SignalMask(a4)
  266.  
  267.             move.l    CommBase(a4),a6
  268.             lea    MyNewBroker(pc),a0
  269.             clr.l    d0
  270.             CALL    CxBroker
  271.             tst.l    d0
  272.             beq    QuitPrg
  273.             move.l    d0,Broker(a4)
  274.  
  275.             move.l    d0,a0
  276.             moveq.l    #1,d0
  277.             CALL    ActivateCxObj
  278.             
  279.             ;Install Handler for Mouse_Button_test
  280.  
  281.             move.l    #CX_CUSTOM,d0
  282.             lea    TestButton(pc),a0    ;My Program
  283.             move.l    #MyCustomID,a1        ;ID
  284.             CALL    CreateCxObj
  285.             move.l    d0,a1
  286.             tst.l    d0
  287.             beq    QuitPrg
  288.             move.l    Broker(a4),a0
  289.             CALL    AttachCxObj
  290.  
  291.             bsr    InstallHotKey
  292.  
  293.             move.l    $04,a6
  294.                     moveq   #-1,d0            ;A Signal for telling
  295.                     jsr     _LVOAllocSignal(a6)    ;our task that sth happened
  296.                     tst.l   d0
  297.                     bmi     Error2
  298.                     move.l  d0,Signal(a4)
  299.             move.l    SignalMask(a4),d1
  300.                     bset    d0,d1
  301.                     move.l    d1,SignalMask(a4)
  302.  
  303.             lea    MyInterrupt(a4),a1
  304.             move.l    #Interrupt3,IS_CODE(a1)
  305.             clr.l    IS_DATA(a1)
  306.             move.b    #NT_INTERRUPT,LN_TYPE(a1)
  307.             move.b    #0,LN_PRI(a1)
  308.             move.l    #HandlerName,LN_NAME(a1)
  309.             move.l    #5,d0            ;INTB_VERTB
  310.             jsr    _LVOAddIntServer(a6)
  311.  
  312.             tst.l    TempCXPOPUP(a4)
  313.             beq.s    WaitOn
  314.             bsr    OpenGUI
  315.  
  316. WaitOn            tst.w    QuitMe(a4)
  317.             bne    QuitPrg
  318.             move.l    $04,a6
  319.             move.l    SignalMask(a4),d0    ;Wait for Port and Break
  320.             CALL    Wait
  321.             btst    #SIGBREAKB_CTRL_C,d0    ;This means quit
  322.             bne    QuitPrg
  323.             move.l    Signal(a4),d1
  324.             btst    d1,d0            ;Signal from Interrupt?
  325.             beq.s    TryNextMsg
  326.  
  327.             tst.w    DisableHW(a4)
  328.             bne.s    TryNextMsg        ;Do nothing
  329.  
  330.             tst.l    TempDelay(a4)
  331.             beq.s    NoDelay
  332.             tst.w    GUIOpened(a4)
  333.             bne    NoDelay    ;Not with GUI opened
  334.  
  335. ReDelay            clr.w    DelayDo(a4)
  336.             move.l    DosBase(a4),a6
  337.             move.l    TempDelay(a4),d1    ;Microseconds
  338.             CALL    Delay
  339.             tst.w    DelayDo(a4)    ;Something happened again
  340.             bne.s    ReDelay        ;so wait till things calmed down
  341.             move.l    $04,a6
  342.  
  343. NoDelay            tst.w    ButtonPressed(a4)
  344.             bne.s    TryNextMsg        ;Omit that stuff for now
  345.             bclr    #SignalButton,What(a4)    ;We will get a signal when
  346.                             ;the button will be released
  347.  
  348.             cmp.l    #1,TempAction(a4)    ;Only do it on Hotkey
  349.             beq.s    TryNextMsg
  350.  
  351. OnHotKey        btst    #SignalWindow,What(a4)
  352.             beq.s    NoWindowStuff
  353.             bsr    DoYourJob
  354.             bclr    #SignalWindow,What(a4)
  355.  
  356. NoWindowStuff        btst    #SignalScreen,What(a4)
  357.             beq.s    TryNextMsg
  358.             bsr    AdjustScreen
  359.             bclr    #SignalScreen,What(a4)
  360.  
  361. TryNextMsg        move.l    $04,a6
  362.             move.l    MyPort(a4),a0        ;Get the message awaiting
  363.             CALL    GetMsg
  364.             tst.l    d0
  365.             bne.s    GotMsg
  366.             bsr    CheckGUI
  367.             bra    WaitOn
  368.  
  369. GotMsg            move.l    d0,a3
  370.             move.l    d0,a0
  371.             move.l    CommBase(a4),a6
  372.             CALL    CxMsgType
  373.             move.l    d0,d6
  374.             move.l    a3,a0
  375.             CALL    CxMsgID
  376.             move.l    d0,d5
  377.             move.l    a3,a1
  378.             move.l    $04,a6
  379.             CALL    ReplyMsg
  380.             cmp.w    #CXM_IEVENT,d6
  381.             bne    OtherCommand
  382.             cmp.l    #MyActionID,d5
  383.             beq.s    NotGUIKey
  384.             cmp.l    #MyLWinID,d5
  385.             beq.s    ActivateLWIN
  386.             cmp.l    #MyNWinID,d5
  387.             beq.s    ActivateNWIN
  388.             bsr    OpenGUI
  389.             bra    OtherCommand
  390. NotGUIKey        bset    #SignalWindow,What(a4)
  391.             bset    #SignalScreen,What(a4)
  392.             bra    OnHotKey
  393.  
  394. ActivateLWIN        move.l    IntBase(a4),a6
  395.             clr.l    d0
  396.             CALL    LockIBase
  397.             move.l    d0,IBaseLock(a4)
  398.  
  399.             move.l    LastActive(a4),a3
  400.             move.l    a3,d0
  401.             beq.s    SkipLWin
  402.  
  403. LikeLWin        bsr    TestWindowPattern
  404.             bmi.s    OkiPattern
  405.  
  406.             tst.l    d7
  407.             bne.s    RepeatDo
  408.             move.l    a3,d7    ;Remember startwindow to prevent loop!
  409.             bra.s    NoRepeat
  410.  
  411. RepeatDo        cmp.l    a3,d7
  412.             beq    SkipLWin    ;Repeat! All windows used!
  413. NoRepeat        move.l    a3,a0
  414.             cmp.l    #MyNWinID,d5
  415.             beq.s    ActivateNWIN2
  416.             bra.s    SkipLWin
  417.             
  418. OkiPattern        move.l    wd_WScreen(a3),a0
  419.             bsr    TestWindowOnScreen
  420.             tst.l    d0
  421.             beq    SkipLWin
  422.  
  423.             move.l    a3,a0
  424.             CALL    ActivateWindow
  425.  
  426. SkipLWin        move.l    IBaseLock(a4),a0
  427.             CALL    UnlockIBase
  428.             bra    OnHotKey
  429.  
  430. ActivateNWIN        move.l    IntBase(a4),a6
  431.             clr.l    d0
  432.             CALL    LockIBase
  433.             move.l    d0,IBaseLock(a4)
  434.  
  435.             move.l    Active(a4),a0
  436.             move.l    a0,d0
  437.             beq    SkipLWin
  438.             clr.l    d7
  439. ActivateNWIN2        move.l    wd_NextWindow(a0),a3
  440.             move.l    a3,d0
  441.             bne.s    LikeLWin
  442.             move.l    ib_FirstScreen(a6),a0
  443.             move.l    a0,d0
  444.             beq    SkipLWin
  445.             move.l    sc_FirstWindow(a0),a3
  446.             move.l    a3,d0
  447.             bne.s    LikeLWin
  448.             bra.s    SkipLWin
  449.  
  450. OtherCommand        cmp.w    #CXM_COMMAND,d6
  451.             bne    WaitOn
  452.  
  453.             cmp.w    #CXCMD_DISABLE,d5
  454.             bne.s    OtherI1
  455.             move.w    #1,DisableHW(a4)
  456.  
  457. OtherI1            cmp.w    #CXCMD_ENABLE,d5
  458.             bne.s    OtherI2
  459.             clr.w    DisableHW(a4)
  460.  
  461. OtherI2            cmp.w    #CXCMD_UNIQUE,d5
  462.             beq.s    OtherII
  463.             cmp.w    #CXCMD_APPEAR,d5
  464.             bne.s    OtherI3
  465. OtherII            bsr    OpenGUI
  466.  
  467. OtherI3            cmp.w    #CXCMD_DISAPPEAR,d5
  468.             bne.s    OtherI4
  469.             bsr    CloseGUI
  470.  
  471. OtherI4            cmp.w    #CXCMD_KILL,d5
  472.             beq    QuitPrg
  473.  
  474.             bra    TryNextMsg
  475.  
  476. Error2            lea    Text1(pc),a0        ;Seems there is an error
  477.             bsr    OpenRequester        ;in the given arguments
  478.             bra.s    QuitPrg
  479.  
  480. EndeRaus2        lea    Text2(pc),a0        ;Wrong Kickstart
  481.             bsr    PrintText
  482.  
  483. QuitPrg            move.l    RememberStack,a7
  484.             bsr    CloseGUI
  485.             move.l    $04,a6    
  486.             move.l    #5,d0
  487.             lea    MyInterrupt(a4),a1
  488.             tst.l    IS_CODE(a1)
  489.             beq.s    NoHandler
  490.             CALL    RemIntServer        ;Remove the Interrupt-Server
  491.  
  492. NoHandler        tst.l    MyIORequest(a4)
  493.             beq.s    NoDevIO
  494.             move.l    MyIORequest(a4),a1
  495.             CALL    CloseDevice
  496.             move.l    MyIORequest(a4),a0
  497.             CALL    DeleteIORequest    
  498. NoDevIO            tst.l    MouseMsgPort(a4)
  499.             beq.s    NoMouseMsg
  500.  
  501.             move.l    MouseMsgPort(a4),a0
  502.             bsr    CloseMsgPort
  503.  
  504. NoMouseMsg        move.l    IconBase(a4),a6
  505.             tst.l    DObject(a4)
  506.             beq.s    SkipFreeDobj
  507.             move.l    DObject(a4),a0
  508.             CALL    FreeDiskObject
  509.  
  510. SkipFreeDobj        move.l    $04,a6
  511.             move.l    Signal(a4),d0        ;Free the signal
  512.             beq.s    DontFreeS
  513.                     CALL    FreeSignal
  514.  
  515. DontFreeS        tst.l    Args(a4)
  516.             beq.s    HmmNoArgs
  517.             move.l    DosBase(a4),a6
  518.             move.l    Args(a4),d1
  519.             CALL    FreeArgs
  520.  
  521. HmmNoArgs        move.l    #Filter,d5
  522.             bsr    RemovePopKey
  523.             move.l    #Filter2,d5
  524.             bsr    RemovePopKey
  525.  
  526.             tst.l    Broker(a4)
  527.             beq.s    NoCX
  528.             move.l    CommBase(a4),a6
  529.             move.l    Broker(a4),a0
  530.             CALL    DeleteCxObjAll
  531.  
  532. NoCX            move.l    $04,a6
  533.             tst.l    MyPort(a4)
  534.             beq.s    NoPort
  535.             move.l    MyPort(a4),a0
  536.             bsr    CloseMsgPort
  537.  
  538. NoPort            move.l    IntBase(a4),d0        ;Close librarys
  539.             beq.s    ErrorX2
  540.             move.l    d0,a1
  541.             CALL    CloseLibrary
  542.  
  543. ErrorX2            move.l    GraphicsBase(a4),d0
  544.             beq.s    ErrorX1
  545.             move.l    d0,a1
  546.             CALL    CloseLibrary
  547.  
  548. ErrorX1            move.l    IconBase(a4),d0
  549.             beq.s    NoIconLib
  550.             move.l    d0,a1
  551.             CALL    CloseLibrary
  552.             
  553. NoIconLib        move.l    CommBase(a4),d0
  554.             beq.s    NoCommLib
  555.             move.l    d0,a1
  556.             CALL    CloseLibrary
  557.  
  558. NoCommLib        move.l    GadBase(a4),d0
  559.             beq.s    OnlyDOS
  560.             move.l    d0,a1
  561.             CALL    CloseLibrary
  562.  
  563. OnlyDOS            move.l    DosBase(a4),d0
  564.             beq.s    FreeOnly
  565.             move.l    d0,a1
  566.             CALL    CloseLibrary
  567.  
  568. FreeOnly        move.l    ScreenPatLen(a4),d0
  569.             beq.s    NoScreenPat
  570.             move.l    ScreenPattern(a4),a1
  571.             CALL    FreeMem
  572.  
  573. NoScreenPat        move.l    WindowPatLen(a4),d0
  574.             beq.s    NoWindowPat
  575.             move.l    WindowPattern(a4),a1
  576.             CALL    FreeMem
  577.  
  578. NoWindowPat        move.l    WBMessage(a4),d7
  579.             move.l    a4,a1
  580.             move.l    #AllocLength,d0
  581.             CALL    FreeMem            
  582.  
  583.             move.l    d7,a1
  584.             tst.l    d7
  585.             beq.s    EndeRaus
  586.             CALL    Forbid
  587.             CALL    ReplyMsg
  588.  
  589. EndeRaus        RLoad
  590.             moveq.l    #0,d0
  591.             rts
  592.  
  593. CloseMsgPort        move.l    a0,a3
  594. ClosePortRout        move.l    a3,a0
  595.             CALL    GetMsg
  596.             tst.l    d0
  597.             beq.s    NoMsgLeft
  598.             move.l    d0,a1
  599.             CALL    ReplyMsg
  600.             bra.s    ClosePortRout
  601. NoMsgLeft        move.l    a3,a0
  602.             CALL    DeleteMsgPort        ;and free it
  603.             rts
  604.  
  605.  
  606.             ;Subroutine to print a text to stdout
  607. PrintText        Push    d0-d4/a0-a1/a6
  608.             move.l    a0,a1
  609.             moveq.l    #0,d0
  610. TestLen            tst.b    (a1)+
  611.             beq.s    LaengeOk
  612.             addq    #1,d0
  613.             bra.s    TestLen
  614. LaengeOk        move.l    $04,a6
  615.             lea    DosName(pc),a1
  616.             moveq.l    #0,d0
  617.             CALL    OpenLibrary    
  618.             move.l    d0,DosBase(a4)
  619.             beq    SkipWrite
  620.             move.l    d0,a6
  621.             move.l    a0,d2
  622.             move.l    d0,d3
  623.             CALL    Output
  624.             move.l    d0,d1
  625.             beq.s    SkipWrite
  626.             CALL    Write
  627. SkipWrite        Pull    d0-d4/a0-a1/a6
  628.             rts
  629.  
  630.             ;MainPart: does the scrolling if necessary
  631. DoYourJob        RSave
  632.             move.l    IntBase(a4),a6
  633.             clr.l    d0
  634.             CALL    LockIBase
  635.             move.l    d0,IBaseLock(a4)
  636.  
  637.             move.l    ib_ActiveWindow(a6),d0
  638.             beq    LeaveIt
  639.             move.l    d0,a5
  640.  
  641.             move.l    wd_WScreen(a5),d0
  642.             beq    LeaveIt
  643.             move.l    d0,a3
  644.             
  645.             move.l    DosBase(a4),a6
  646.  
  647.             tst.l    TempRestrict(a4)
  648.             bne.s    NoMatter2
  649.  
  650.             tst.b    ScreenPatternMem(a4)
  651.             beq.s    NoMatter2
  652.             move.l    ScreenPattern(a4),d1
  653.             move.l    sc_DefaultTitle(a3),d2
  654.             beq.s    NoMatter2
  655.             CALL    MatchPatternNoCase
  656.             beq    LeaveIt
  657.  
  658. NoMatter2        move.l    a5,d0
  659.             bsr    TestWindowPattern
  660.             beq    LeaveIt
  661.  
  662. NoMatter3        bsr    RememberWindow
  663.  
  664.             move.l    GraphicsBase(a4),a6    ;Get the visible size
  665.             lea    sc_ViewPort(a3),a0    ;of the screen to
  666.             move.l    vp_ColorMap(a0),a0
  667.  
  668.             ;Taglist on Stack (because it gets changed)
  669.             move.l    #TAG_DONE,-(sp)
  670.             clr.l    -(sp)
  671.             move.l    #VTAG_VIEWPORTEXTRA_GET,-(sp)
  672.             move.l    a7,a1
  673.  
  674.             CALL    VideoControl
  675.             tst.l    d0
  676.             bne    LeaveIt
  677.             movem.l    (sp)+,d0-d2    ;Get Taglist from Stack
  678.             move.l    d1,a0        ;In the middle is our data
  679.             lea    vpe_DisplayClip(a0),a0 ;extra
  680.  
  681.             move.w    ra_MaxX(a0),d0
  682.             sub.w    ra_MinX(a0),d0
  683.             addq    #1,d0
  684.             move.w    d0,VisualX(a4)
  685.             move.w    sc_LeftEdge(a3),d0
  686.             sub.w    ra_MinX(a0),d0
  687.             move.w    d0,PositionX(a4)
  688.  
  689.             move.w    ra_MaxY(a0),d0
  690.             sub.w    ra_MinY(a0),d0
  691.             addq    #1,d0
  692.             move.w    d0,VisualY(a4)
  693.             move.w    sc_TopEdge(a3),d0
  694.             sub.w    ra_MinY(a0),d0
  695.             move.w    d0,PositionY(a4)
  696.  
  697.             move.l    IntBase(a4),a6
  698.             tst.l    TempSFront(a4)        ;do we want screentofront?
  699.             beq.s    NoFront
  700.             cmp.l    ib_FirstScreen(a6),a3
  701.             beq.s    NoFront            ;Not necessary (optimize!)
  702.             btst    #SignalSmooth,What(a4)
  703.             bne.s    NoFront
  704.  
  705.             bsr    UnlockIt
  706.             move.l    a3,a0
  707.             CALL    ScreenToFront
  708.             bset    #SignalScreen,What(a4)    ;ScreenChange!
  709.             bsr    RelockAndTest
  710.  
  711. NoFront            move.l    wd_Flags(a5),d0
  712.             and.l    #WFLG_BACKDROP,d0
  713.             bne    LeaveIt            ;Not with backdrops!
  714.  
  715.             tst.l    TempWFront(a4)        ;do we WindowToFront() ?
  716.             beq.s    NoFront2
  717.             btst    #SignalSmooth,What(a4)
  718.             bne.s    NoFront2
  719.             
  720.             bsr    UnlockIt
  721.             move.l    a5,a0
  722.             CALL    WindowToFront
  723.             bsr    RelockAndTest
  724.  
  725. NoFront2        tst.l    TempMove(a4)
  726.             beq    LeaveIt
  727.  
  728.             move.l    wd_WScreen(a5),a0    
  729.  
  730.             ;Calculate how the window is located towards the view
  731.             
  732.             move.w    wd_LeftEdge(a5),d0
  733.             add.w    PositionX(a4),d0
  734.             move.w    wd_LeftEdge(a5),d1
  735.             add.w    wd_Width(a5),d1
  736.             move.w    PositionX(a4),d7
  737.             sub.w    VisualX(a4),d7
  738.             add.w    d7,d1
  739.             move.w    wd_TopEdge(a5),d2
  740.             add.w    PositionY(a4),d2
  741.             move.w    wd_TopEdge(a5),d3
  742.             add.w    wd_Height(a5),d3
  743.             move.w    PositionY(a4),d7
  744.             sub.w    VisualY(a4),d7
  745.             add.w    d7,d3
  746.             
  747.             ;d0: Pixels out left border (out = negative)
  748.             ;d1: Pixels out right border (out = positive)
  749.             ;d2: Pixels out top border (out = negative)
  750.             ;d3: Pixels out bottom border (out = positive)
  751.             ;For scrolling all these Values have to be negated
  752.  
  753.             ;Horizontal Section
  754.             
  755.  
  756.             cmp.l    #2,TempAction(a4)    ;Always
  757.             beq.s    HScrollNeeded
  758.  
  759.             tst.w    d0
  760.             bmi.s    HScrollNeeded
  761.             tst.w    d1
  762.             bmi.s    NoHScrollNeeded
  763.  
  764. HScrollNeeded        cmp.l    #2,TempHADJ(a4)
  765.             bne.s    HNoCenter
  766.  
  767.             ;Center Window
  768.  
  769.             move.w    d0,d4
  770.             add.w    d1,d4
  771.             asr.w    #1,d4    ;CenterScrollValue
  772.             bra.s    HDone
  773.  
  774. HNoCenter        cmp.l    #1,TempHADJ(a4)
  775.             bne.s    HNoRight
  776.  
  777.             ;Adjust Window to Right Border
  778.  
  779.             move.w    d1,d4
  780.             bra.s    HDone
  781.  
  782. HNoRight        tst.l    TempHADJ(a4)
  783.             bne.s    HNoLeft
  784.  
  785.             ;Adjust Window to Left Border
  786.  
  787.             move.w    d0,d4
  788.             bra.s    HDone
  789.  
  790. HNoLeft            ;Optimized Adjustment
  791.             ;When coming here it is shure that at least ONE scroll
  792.             ;is necessary!!!
  793.             tst.w    d0
  794.             beq.s    THScroll
  795.             bpl.s    NoHScroll1
  796.             move.w    d0,d4
  797.  
  798. THScroll        tst.w    d1
  799.             bmi.s    HDone        ;Has to be for normal windows
  800.             ;This means the window leaps out BOTH borders!
  801.             ;Then we do NOTHING
  802.             bra.s    NoHScrollNeeded
  803.  
  804. NoHScroll1        move.w    d1,d4
  805.             bra.s    HDone
  806.  
  807. NoHScrollNeeded        moveq.l    #0,d4
  808.  
  809. HDone            ext.l    d4
  810.             neg.l    d4
  811.  
  812.             ;The Vertical section works almost equally
  813.  
  814.             cmp.l    #2,TempAction(a4)    ;Always
  815.             beq.s    VScrollNeeded
  816.  
  817.             tst.w    d2
  818.             bmi.s    VScrollNeeded
  819.             tst.w    d3
  820.             bmi.s    NoVScrollNeeded
  821.  
  822. VScrollNeeded        cmp.l    #2,TempVADJ(a4)
  823.             bne.s    VNoCenter
  824.  
  825.             ;Center Window
  826.  
  827.             move.w    d2,d5
  828.             add.w    d3,d5
  829.             asr.w    #1,d5    ;CenterScrollValue
  830.             bra.s    VDone
  831.  
  832. VNoCenter        cmp.l    #1,TempVADJ(a4)
  833.             bne.s    VNoBottom
  834.  
  835.             ;Adjust Window to Bottom Border
  836.  
  837.             move.w    d3,d5
  838.             bra.s    VDone
  839.  
  840. VNoBottom        tst.l    TempVADJ(a4)
  841.             bne.s    VNoTop
  842.  
  843.             ;Adjust Window to Top Border
  844.  
  845.             move.w    d2,d5
  846.             bra.s    VDone
  847.  
  848. VNoTop            ;Optimized Adjustment
  849.             ;When coming here it is shure that at least ONE scroll
  850.             ;is necessary!!!
  851.             tst.w    d2
  852.             beq    TVScroll
  853.             bpl.s    NoVScroll1
  854.             move.w    d2,d5
  855.  
  856. TVScroll        tst.w    d3
  857.             bmi.s    VDone        ;Has to be for normal windows
  858.             ;This means the window leaps out BOTH borders!
  859.             ;Then we do NOTHING
  860.             bra.s    NoVScrollNeeded
  861.  
  862. NoVScroll1        move.w    d3,d5
  863.             bra.s    VDone
  864.  
  865. NoVScrollNeeded        moveq.l    #0,d5
  866.  
  867. VDone            ext.l    d5
  868.             neg.l    d5
  869.  
  870.             move.l    d4,d0
  871.             move.l    d5,d1
  872.  
  873.             move.w    PositionY(a4),d4    ;Prevent dragging a screen
  874.             neg.w    d4            ;further down than at Pos 0
  875.             sub.w    d1,d4
  876.             bpl.s    NoOutRange
  877.             tst.w    d1            ;Screen already down a bit:
  878.             bmi.s    NoOutRange        ;If move up, then ok,
  879.             move.w    PositionY(a4),d4
  880.             neg.w    d4            ;If screen up, then pull
  881.             move.w    d4,d1            ;down to Pos 0
  882.             bpl.s    NoOutRange
  883.             clr.l    d1            ;otherwise no move at all
  884.             ;move.w    PositionY(a4),d1    ;was: pull to top, if pulled
  885.             ;neg.w    d1            ;down at all.
  886.  
  887. NoOutRange        move.w    sc_TopEdge(a0),d5
  888.             move.w    sc_LeftEdge(a0),d6
  889.  
  890.             tst.l    TempSmooth(a4)
  891.             beq.s    NoSmoothing
  892.  
  893.             move.l    TempSmooth(a4),d3
  894.             tst.l    d0
  895.             beq.s    d0Zero
  896.             bpl.s    d0Pos
  897.             neg.l    d3
  898.             cmp.l    d3,d0
  899.             ble.s    Testd1
  900.             move.l    d0,d3
  901.             bra.s    Testd1
  902. d0Zero            clr.l    d3
  903. d0Pos            cmp.l    d3,d0
  904.             bge.s    Testd1
  905.             move.l    d0,d3
  906. Testd1            move.l    TempSmooth(a4),d4
  907.             tst.l    d1
  908.             beq.s    d1Zero
  909.             bpl.s    d1Pos
  910.             neg.l    d4
  911.             cmp.l    d4,d1
  912.             ble.s    Testover
  913.             move.l    d1,d4
  914.             bra.s    Testover
  915. d1Zero            clr.l    d4
  916. d1Pos            cmp.l    d4,d1
  917.             bge.s    Testover
  918.             move.l    d1,d4
  919. Testover        bset    #SignalSmooth,What(a4)
  920.  
  921.             move.l    d3,d0
  922.             move.l    d4,d1
  923.  
  924. NoSmoothing        bsr    UnlockIt
  925.             Push    a0-a1/d0-d4
  926.             CALL    MoveScreen
  927.             clr.l    d0
  928.             CALL    LockIBase        ;relock - no test window!
  929.             move.l    d0,IBaseLock(a4)
  930.             Pull    a0-a1/d0-d4
  931.  
  932.             sub.w    sc_TopEdge(a0),d5    ;Find out how far the
  933.             sub.w    sc_LeftEdge(a0),d6    ;screen really moves
  934.             move.l    d6,d0
  935.             bne.s    OkMove
  936.             tst.l    d5
  937.             bne.s    OkMove
  938.             bclr    #SignalSmooth,What(a4)
  939.             bra.s    LeaveIt
  940.  
  941. OkMove            move.l    d5,d1
  942.             neg.l    d0
  943.             neg.l    d1
  944.  
  945.             tst.l    TempMoveMouse(a4)
  946.             beq.s    LeaveIt
  947.  
  948.             ;If a window becomes active without clicking, the Mouse
  949.             ;can be out of range, and moving it would scroll the
  950.             ;Screen back, so we check this here and disable movement
  951.             ;if "dangerous"
  952.             move.w    sc_MouseX(a0),d2
  953.             add.w    sc_LeftEdge(a0),d2
  954.             add.w    d0,d2            ;Movement in X
  955.             bmi.s    ClearXMovement
  956.             cmp.w    VisualX(a4),d2
  957.             bcs.s    LeaveXMovement
  958. ClearXMovement        moveq.l    #0,d0
  959. LeaveXMovement        move.w    sc_MouseY(a0),d2
  960.             add.w    sc_TopEdge(a0),d2
  961.             add.w    d1,d2            ;Movement in Y
  962.             bmi.s    ClearYMovement
  963.             cmp.w    VisualY(a4),d2
  964.             bcs.s    LeaveYMoveMent
  965. ClearYMovement        moveq.l    #0,d1
  966. LeaveYMoveMent        bsr    UnlockIt
  967.             tst.w    d0
  968.             bne.s    SetIt
  969.             tst.w    d1
  970.             beq.s    LeaveItReal
  971. SetIt            bsr    SetPointer
  972. LeaveItReal        RLoad
  973.             rts
  974.  
  975. LeaveIt            move.l    IntBase(a4),a6
  976.             move.l    IBaseLock(a4),a0
  977.             CALL    UnlockIBase
  978.             bra.s    LeaveItReal
  979.  
  980. UnlockIt        Push    a0-a1/d0-d1
  981.             move.l    IBaseLock(a4),a0
  982.             CALL    UnlockIBase
  983.             Pull    a0-a1/d0-d1
  984.             rts
  985.  
  986. RelockAndTest        Push    a0-a1/d0-d1
  987.             move.l    IntBase(a4),a6
  988.             clr.l    d0
  989.             CALL    LockIBase
  990.             move.l    d0,IBaseLock(a4)
  991.  
  992.             move.l    ib_ActiveWindow(a6),d0
  993.             beq.s    TestFailed
  994.             cmp.l    d0,a5
  995.             bne.s    TestFailed
  996.  
  997.             move.l    wd_WScreen(a5),d0
  998.             beq.s    TestFailed
  999.             cmp.l    d0,a3
  1000.             bne.s    TestFailed
  1001.             Pull    a0-a1/d0-d1
  1002.             rts
  1003.  
  1004. TestFailed        Pull    a0-a1/d0-d1
  1005.             tst.l    (sp)+    ;rts
  1006.             ;Window or Screen changed while we had Ibase unlocked
  1007.             ;=> leave
  1008.             bra.s    LeaveIt
  1009.  
  1010. AdjustScreen        RSave                
  1011.             move.l    IntBase(a4),a6
  1012.             clr.l    d0
  1013.             CALL    LockIBase
  1014.             move.l    d0,d7
  1015.             move.l    ib_FirstScreen(a6),d0
  1016.             beq    SkipActive
  1017.  
  1018.             move.l    d0,a3
  1019.             tst.b    ScreenPatternMem(a4)
  1020.             beq.s    NoMatter5
  1021.             move.l    ScreenPattern(a4),d1
  1022.             move.l    sc_DefaultTitle(a3),d2
  1023.             beq.s    NoMatter5
  1024.             move.l    DosBase(a4),a6
  1025.             CALL    MatchPatternNoCase
  1026.             bne.s    NoMatter5
  1027.  
  1028.             tst.l    TempRestrict(a4)
  1029.             bne.s    Skip_NoPub2
  1030.  
  1031.             bra    SkipActive
  1032.  
  1033. NoMatter5        tst.l    TempPDef(a4)    ;Enter FirstScreen as Default
  1034.                         ;PublicScreen ?
  1035.             beq.s    Skip_NoPub2
  1036.             move.l    d7,a0
  1037.             move.l    IntBase(a4),a6
  1038.             CALL    UnlockIBase
  1039.  
  1040.             CALL    LockPubScreenList
  1041.  
  1042. CarryListOn        move.l    d0,a0
  1043.             cmp.l    psn_Screen(a0),a3
  1044.             beq.s    ScreenFound
  1045.             move.l    LN_SUCC(a0),d0
  1046.             bne.s    CarryListOn
  1047.             CALL    UnlockPubScreenList
  1048.             bra.s    Skip_NoPub
  1049.  
  1050. ScreenFound        move.l    LN_NAME(a0),d5
  1051.             CALL    UnlockPubScreenList
  1052.  
  1053.             move.l    d5,a0
  1054.             CALL    SetDefaultPubScreen
  1055.  
  1056. Skip_NoPub        clr.l    d0
  1057.             CALL    LockIBase
  1058.             move.l    d0,d7
  1059.             move.l    ib_FirstScreen(a6),d0
  1060.             beq    SkipActive
  1061.             move.l    d0,a3
  1062.  
  1063. Skip_NoPub2        move.l    a3,a0
  1064.             tst.l    TempRemWin(a4)    ;Activate a Window on the new
  1065.                         ;Screen?
  1066.             beq.s    SkipActive
  1067.             bsr    GetScreenWindow
  1068.             tst.l    d0
  1069.             bne.s    FoundActive
  1070.  
  1071.             tst.w    StartupFlag(a4)        ;Prevent activation of
  1072.             bne.s    NormalService        ;FirstWindow on Startup
  1073.             move.w    #1,StartupFlag(a4)
  1074.             bra.s    SkipActive
  1075. NormalService        move.l    sc_FirstWindow(a0),d0    ;Take Firstwindow if none
  1076.             beq.s    SkipActive        ;known
  1077.  
  1078. FoundActive        move.l    d0,a5
  1079.             bsr    TestWindowPattern
  1080.             beq    SkipActive
  1081. NoMatter4        move.l    IntBase(a4),a6
  1082.             move.l    d7,a0
  1083.             CALL    UnlockIBase
  1084.             move.l    a5,a0
  1085.             CALL    ActivateWindow
  1086. SkipOut            RLoad    
  1087.             rts
  1088. SkipActive        move.l    IntBase(a4),a6
  1089.             move.l    d7,a0
  1090.             CALL    UnlockIBase
  1091.             bra.s    SkipOut
  1092.  
  1093.  
  1094. ;d0: Pointer to Window        ;BEQ = Use Window Not!, BMI = USE!, BNE = Empty Title
  1095. TestWindowPattern    Push    d0-d2/a0-a1/a5-a6
  1096.             move.l    d0,a5
  1097.             move.l    wd_WScreen(a5),a0
  1098.             bsr    TestWindowOnScreen
  1099.             beq    PatternNoMatch        ;Window inexistant!
  1100.             tst.b    WindowPatternMem(a4)
  1101.             beq.s    NoPatternThere
  1102.             move.l    WindowPattern(a4),d1
  1103.             move.l    wd_Title(a5),d2
  1104.             beq.s    PatternNoMatchE
  1105.             move.l    DosBase(a4),a6
  1106.             CALL    MatchPatternNoCase
  1107.             beq    PatternNoMatch
  1108.  
  1109. NoPatternThere        tst.l    TempWBWin(a4)
  1110.             beq.s    PatternMatch2
  1111.             move.l    wd_Flags(a5),d0
  1112.             and.l    #WFLG_WBENCHWINDOW,d0
  1113.             bne    PatternNoMatch
  1114.  
  1115. PatternMatch2        moveq.l    #-1,d0
  1116.             bra.s    PatternMatch
  1117. PatternNoMatchE        moveq.l    #1,d0
  1118.             bra.s    PatternMatch
  1119. PatternNoMatch        clr.l    d0
  1120. PatternMatch        Pull    d0-d2/a0-a1/a5-a6
  1121.             rts
  1122.  
  1123.  
  1124.         ;a0=Screen         Back:d0=Window
  1125. GetScreenWindow        Push    a1/d1
  1126.             lea    ScreenMem(a4),a1
  1127.             move.w    #MaxScreens-1,d1
  1128. ScreenFindLoop        cmp.l    (a1),a0
  1129.             beq.s    FoundScreen
  1130.             lea    8(a1),a1
  1131.             dbf    d1,ScreenFindLoop
  1132.             clr.l    d0
  1133.             bra.s    NoScreenF
  1134. FoundScreen        move.l    4(a1),d0
  1135.             bsr    TestWindowOnScreen
  1136. NoScreenF        Pull    a1/d1
  1137.             rts
  1138.  
  1139.         ;a3=Screen a5=Window
  1140. RememberWindow        Push    a0-a3/a6/d1
  1141.             move.l    IntBase(a4),a6
  1142.             lea    ScreenMem(a4),a1
  1143.             move.w    #MaxScreens-1,d1
  1144. ScreenFindLoop2        tst.l    (a1)
  1145.             beq.s    FoundEmpty
  1146.             cmp.l    (a1),a3
  1147.             beq.s    FoundEmpty
  1148.             move.l    (a1),a2
  1149.             move.l    ib_FirstScreen(a6),d0
  1150.             beq.s    IgnoreOver    ;No FirstScreen!
  1151. CheckAllScreens        move.l    d0,a0
  1152.             cmp.l    a0,a2
  1153.             beq    ScreenValid
  1154.             move.l    sc_NextScreen(a0),d0
  1155.             bne.s    CheckAllScreens
  1156.             bra.s    FoundEmpty    ;because Entry is invalid
  1157.  
  1158. ScreenValid        lea    8(a1),a1
  1159.             dbf    d1,ScreenFindLoop2
  1160.             ;Reaching this Point our List is full of valid
  1161.             ;Screens - not the best thing, but we simply ignore...
  1162.             bra.s    IgnoreOver
  1163. FoundEmpty        move.l    a3,(a1)
  1164.             move.l    a5,4(a1)
  1165. IgnoreOver        Pull    a0-a3/a6/d1
  1166.             rts
  1167.  
  1168.         ;d0=Window , a0=Screen    =Back: d0=0 no window
  1169. TestWindowOnScreen    tst.l    d0
  1170.             beq.s    NotWindow
  1171.             move.l    sc_FirstWindow(a0),d1
  1172.             beq.s    NotWindow
  1173. WindowListOn        move.l    d1,a1
  1174.             cmp.l    d0,a1
  1175.             beq.s    WindowIsOK
  1176.             move.l    wd_NextWindow(a1),d1
  1177.             bne.s    WindowListOn
  1178. WindowIsOK        move.l    d1,d0
  1179.             rts
  1180. NotWindow        clr.l    d0
  1181.             rts
  1182.  
  1183.  
  1184. Interrupt3        Push    d1-d4/a0-a1/a3/a4/a6
  1185.             move.l    RememberA4,a4
  1186.             move.l    IntBase(a4),a3
  1187.             move.l    ib_ActiveWindow(a3),d0
  1188.             beq.s    DoScreen
  1189.             move.l    Active(a4),a0
  1190.             cmp.l    a0,d0            ;New ActiveWindow?
  1191.             beq.s    CheckSize
  1192.             move.l    Active(a4),LastActive(a4)
  1193.             move.l    d0,Active(a4)
  1194.             move.l    d0,a0
  1195. ChangedPosOrSize    move.l    wd_LeftEdge(a0),WindPosRem(a4)
  1196.             move.l    wd_Width(a0),WindSizeRem(a4)
  1197.  
  1198.             bsr    SignalMyself
  1199.  
  1200.             bclr    #SignalSmooth,What(a4)
  1201.             bset    #SignalWindow,What(a4)
  1202.             
  1203.             bra.s    DoScreen
  1204.  
  1205. CheckSize        move.l    wd_LeftEdge(a0),d0    ;A Check on .l is faster
  1206.             cmp.l    WindPosRem(a4),d0    ;because I only wanna know
  1207.             bne.s    ChangedPosOrSize    ;if Position or Size changed
  1208.             move.l    wd_Width(a0),d0        ;and not how
  1209.             cmp.l    WindSizeRem(a4),d0
  1210.             bne.s    ChangedPosOrSize
  1211.             
  1212. DoScreen        move.l    FirstSc(a4),d0
  1213.             cmp.l    ib_FirstScreen(a3),d0        ;New FirstScreen?
  1214.             beq.s    DoNothing
  1215.             move.l    ib_FirstScreen(a3),FirstSc(a4)
  1216.  
  1217.             bsr    SignalMyself
  1218.  
  1219.             bclr    #SignalSmooth,What(a4)
  1220.             bset    #SignalScreen,What(a4)
  1221.  
  1222. DoNothing        btst    #SignalSmooth,What(a4)
  1223.             beq.s    DoNothingAtAll
  1224.             
  1225.             bsr    SignalMyself
  1226.  
  1227.             bset    #SignalWindow,What(a4)
  1228.  
  1229. DoNothingAtAll        Pull    d1-d4/a0-a1/a3/a4/a6
  1230.             moveq.l    #0,d0
  1231.             rts
  1232.  
  1233. SignalMyself        move.l  $04,a6
  1234.             move.w    #1,DelayDo(a4)
  1235.             move.l  OwnTask(a4),a1
  1236.             move.l  Signal(a4),d1        ;send a signal to move Screen
  1237.             moveq.l    #0,d0
  1238.             bset    d1,d0
  1239.             jmp    _LVOSignal(a6)
  1240.  
  1241. OpenGUI            RSave
  1242.             tst.w    GUIOpened(a4)
  1243.             bne    OpenNoGUI
  1244.             move.l    IntBase(a4),a6
  1245.             sub.l    a0,a0
  1246.             CALL    LockPubScreen
  1247.             move.l    d0,PublicScreen(a4)
  1248.             move.l    d0,StorePublicScreen
  1249.  
  1250.             move.l    d0,a0
  1251.             lea    sc_RastPort(a0),a1
  1252.             move.l    a1,PublicRastport(a4)
  1253.             lea    TagListDone(pc),a1
  1254.             move.l    GadBase(a4),a6
  1255.             CALL    GetVisualInfoA
  1256.             move.l    d0,MyVisual(a4)
  1257.             lea    MyNewGadget(a4),a3
  1258.             move.l    d0,gng_VisualInfo(a3)
  1259.  
  1260.             lea    GadgetList(a4),a0
  1261.             CALL    CreateContext
  1262.             move.l    d0,Gadget0(a4)
  1263.  
  1264.             move.l    GraphicsBase(a4),a6
  1265.             move.l    PublicRastport(a4),a1
  1266.             lea    GUI_Text5(pc),a0
  1267.             moveq.l    #GUI_Text6-GUI_Text5-1,d0
  1268.             CALL    TextLength
  1269.             add.w    #40,d0        ;CheckBox
  1270.             ;lsr.w    #1,d0
  1271.             move.w    d0,RemLen(a4)
  1272.  
  1273.             moveq.l    #1,d0
  1274.             add.w    RemLen(a4),d0
  1275.             mulu    #NumberOfCols,d0
  1276.             move.l    d0,StoreInnerWidth
  1277.  
  1278.             move.l    PublicScreen(a4),a0
  1279.             moveq.l    #6,d0
  1280.             add.b    sc_WBorLeft(a0),d0
  1281.             move.w    d0,RemLeft(a4)
  1282.  
  1283.             move.l    sc_Font(a0),a1
  1284.             move.l    a1,gng_TextAttr(a3)
  1285.             moveq.l    #1,d0
  1286.             add.b    sc_WBorTop(a0),d0    ;Base (Top)
  1287.             move.w    d0,RemTop(a4)
  1288.  
  1289.             move.w    ta_YSize(a1),d6
  1290.             add.w    #4,d6            ;Height of One Line
  1291.             move.w    d6,RemHeight(a4)
  1292.  
  1293.             add.w    #2,d6
  1294.             mulu    #NumberOfLines,d6
  1295.             add.w    #8,d6
  1296.             move.l    d6,StoreInnerHeight
  1297.  
  1298.             move.l    Gadget0(a4),d7
  1299.  
  1300.             bsr    DoAllGadgets
  1301.  
  1302.             move.l    d7,LastGadget(a4)
  1303.  
  1304.             sub.l    a0,a0
  1305.             lea    WindowTagList(pc),a1
  1306.             move.l    IntBase(a4),a6
  1307.             CALL    OpenWindowTagList
  1308.             move.l    d0,MyWindow(a4)
  1309.             beq    FailWindow
  1310.  
  1311.             move.l    d0,a0
  1312.             bsr    EnterSignal
  1313.             ;move.l    d0,a0
  1314.             move.l    GadgetList(a4),a1
  1315.             moveq.l    #-1,d0
  1316.             moveq.l    #-1,d1
  1317.             sub.l    a2,a2
  1318.             CALL    AddGList
  1319.  
  1320.             move.l    GadgetList(a4),a0
  1321.             move.l    MyWindow(a4),a1
  1322.             moveq.l    #-1,d0
  1323.             sub.l    a2,a2
  1324.             CALL    RefreshGList
  1325.             
  1326.             move.l    GadBase(a4),a6
  1327.             move.l    MyWindow(a4),a0
  1328.             sub.l    a1,a1
  1329.             CALL    GT_RefreshWindow
  1330.  
  1331.             move.w    #1,GUIOpened(a4)
  1332.             RLoad
  1333.             rts
  1334. OpenNoGUI        move.l    IntBase(a4),a6
  1335.             move.l    MyWindow(a4),a0
  1336.             CALL    ActivateWindow
  1337.             RLoad
  1338.             rts
  1339.  
  1340.             rsreset
  1341. MyGadgetText        rs.l    1
  1342. MyGadgetList        rs.l    1
  1343. MyGadgetRowNr        rs.b    1
  1344. MyGadgetXPos        rs.b    1
  1345. MyGadgetWidth        rs.b    1
  1346. MyGadgetFlags        rs.b    1
  1347. MyGadgetStore        rs.w    1
  1348. MyGadgetKind        rs.w    1
  1349. MyGadgetSize        rs.w    1
  1350.             
  1351.             ;    gng_Flags      ,gng_Text ,CreateKind   ,CreateTags
  1352.             ;    gng_TopEdge    ,gng_LeftEdge
  1353. AllGadgets        dc.l    GUI_Text8,CycleTagList
  1354.             dc.b    1,1,1,PLACETEXT_LEFT
  1355.             dc.w    TempHADJ,CYCLE_KIND
  1356.  
  1357.             dc.l    GUI_Text9,CycleTagList2
  1358.             dc.b    2,1,1,PLACETEXT_LEFT
  1359.             dc.w    TempVADJ,CYCLE_KIND
  1360.  
  1361.             dc.l    GUI_Text12,StringTagList
  1362.             dc.b    3,1,1,PLACETEXT_LEFT
  1363.             dc.w    TempScreen,STRING_KIND
  1364.  
  1365.             dc.l    GUI_Text13,StringTagList
  1366.             dc.b    4,1,1,PLACETEXT_LEFT
  1367.             dc.w    TempWindow,STRING_KIND
  1368.  
  1369.             dc.l    0,SlideTagList
  1370.             dc.b    5,1,1,0
  1371.             dc.w    TempDelay,SLIDER_KIND
  1372.  
  1373.             dc.l    GUI_Text18,CycleTagList3
  1374.             dc.b    6,1,1,PLACETEXT_LEFT
  1375.             dc.w    TempAction,CYCLE_KIND
  1376.  
  1377.             dc.l    GUI_Text17,StringTagList
  1378.             dc.b    7,1,1,PLACETEXT_LEFT
  1379.             dc.w    TempActionKey,STRING_KIND
  1380.  
  1381.             dc.l    GUI_Text16,StringTagList
  1382.             dc.b    8,1,1,PLACETEXT_LEFT
  1383.             dc.w    TempCXPOPKEY,STRING_KIND
  1384.  
  1385.             dc.l    0,SlideTagList2
  1386.             dc.b    9,1,1,0
  1387.             dc.w    TempSmooth,SLIDER_KIND
  1388.  
  1389.             dc.l    GUI_Text19,StringTagList
  1390.             dc.b    10,1,1,PLACETEXT_LEFT
  1391.             dc.w    TempLWindow,STRING_KIND
  1392.  
  1393.             dc.l    GUI_Text19_2,StringTagList
  1394.             dc.b    10,2,1,PLACETEXT_LEFT
  1395.             dc.w    TempNWindow,STRING_KIND
  1396.  
  1397.             dc.l    GUI_Text1,GadgetTagList
  1398.             dc.b    1,2,1,PLACETEXT_RIGHT
  1399.             dc.w    TempMove,CHECKBOX_KIND
  1400.  
  1401.             dc.l    GUI_Text3,GadgetTagList
  1402.             dc.b    2,2,1,PLACETEXT_RIGHT
  1403.             dc.w    TempWFront,CHECKBOX_KIND
  1404.  
  1405.             dc.l    GUI_Text6,GadgetTagList
  1406.             dc.b    3,2,1,PLACETEXT_RIGHT
  1407.             dc.w    TempRestrict,CHECKBOX_KIND
  1408.  
  1409.             dc.l    GUI_Text20,GadgetTagList
  1410.             dc.b    4,2,1,PLACETEXT_RIGHT
  1411.             dc.w    TempWBWin,CHECKBOX_KIND
  1412.  
  1413.             dc.l    GUI_Text2,GadgetTagList
  1414.             dc.b    5,2,1,PLACETEXT_RIGHT
  1415.             dc.w    TempSFront,CHECKBOX_KIND
  1416.  
  1417.             dc.l    GUI_Text5,GadgetTagList
  1418.             dc.b    6,2,1,PLACETEXT_RIGHT
  1419.             dc.w    TempPDef,CHECKBOX_KIND
  1420.  
  1421.             dc.l    GUI_Text7,GadgetTagList
  1422.             dc.b    7,2,1,PLACETEXT_RIGHT
  1423.             dc.w    TempRemWin,CHECKBOX_KIND
  1424.  
  1425.             dc.l    GUI_Text7_1,GadgetTagList
  1426.             dc.b    8,2,1,PLACETEXT_RIGHT
  1427.             dc.w    TempMoveMouse,CHECKBOX_KIND
  1428.  
  1429.             dc.l    GUI_Text7_2,GadgetTagList
  1430.             dc.b    9,2,1,PLACETEXT_RIGHT
  1431.             dc.w    TempCXPOPUP,CHECKBOX_KIND
  1432.  
  1433.  
  1434.             dc.l    GUI_Text10,TagList
  1435.             dc.b    11,0,1,PLACETEXT_IN
  1436.             dc.w    TempZero,BUTTON_KIND
  1437.             dc.l    GUI_Text11,TagList
  1438.             dc.b    11,2,1,PLACETEXT_IN
  1439.             dc.w    TempZero,BUTTON_KIND
  1440. SaveGadgData        dc.l    GUI_Text14,TagList
  1441.             dc.b    11,1,1,PLACETEXT_IN
  1442.             dc.w    TempSave,BUTTON_KIND
  1443.  
  1444.             dc.l    -1
  1445.  
  1446. NumberOfLines        =    11
  1447. NumberOfCols        =    3
  1448.  
  1449.  
  1450. ;a3:Pointer to the GadgetStructure
  1451. ;d7:Previous Gadget
  1452.  
  1453. DoAllGadgets        lea    AllGadgets(pc),a5
  1454.             move.l    GadBase(a4),a6
  1455.             moveq.l    #1,d6
  1456.  
  1457. DoAllGadgets2        tst.l    (a5)
  1458.             bmi.s    WasLastGadget
  1459.  
  1460.             moveq.l    #0,d0
  1461.             move.b    MyGadgetRowNr(a5),d0
  1462.             move.w    RemHeight(a4),d1
  1463.             addq.w    #2,d1
  1464.             mulu    d1,d0
  1465.             add.w    RemTop(a4),d0        ;Top
  1466.             move.w    d0,gng_TopEdge(a3)
  1467.  
  1468.             moveq.l    #0,d0
  1469.             move.b    MyGadgetXPos(a5),d0
  1470.             mulu    RemLen(a4),d0
  1471.             add.w    RemLeft(a4),d0
  1472.             move.w    d0,gng_LeftEdge(a3)
  1473.  
  1474.             moveq.l    #0,d0
  1475.             move.b    MyGadgetWidth(a5),d0
  1476.             mulu    RemLen(a4),d0
  1477.             sub.w    #8,d0
  1478.             move.w    d0,gng_Width(a3)
  1479.  
  1480.             move.w    RemHeight(a4),gng_Height(a3)
  1481.  
  1482.             moveq.l    #0,d0
  1483.             move.b    MyGadgetFlags(a5),d0
  1484.             move.l    d0,gng_Flags(a3)
  1485.             add.w    #1,gng_GadgetID(a3)
  1486.  
  1487.             move.l    MyGadgetText(a5),gng_GadgetText(a3)
  1488.  
  1489.             move.w    d6,gng_GadgetID(a3)
  1490.  
  1491.             sub.l    a2,a2
  1492.             move.w    MyGadgetStore(a5),a2
  1493.             add.l    a4,a2
  1494.             move.l    (a2),d4
  1495.  
  1496.             moveq.l    #0,d0
  1497.             move.w    MyGadgetKind(a5),d0
  1498.             move.l    d7,a0        ;Previous Gadget
  1499.             move.l    a3,a1
  1500.             move.l    MyGadgetList(a5),a2
  1501.             move.l    d4,4(a2)
  1502.             CALL    CreateGadgetA
  1503.             move.l    d0,d7        ;Remember Previous Gadget
  1504.             add.l    #MyGadgetSize,a5
  1505.             addq.l    #1,d6
  1506.             bra.s    DoAllGadgets2
  1507. WasLastGadget        rts
  1508.  
  1509. CheckGUI        RSave
  1510.  
  1511.             tst.w    GUIOpened(a4)
  1512.             beq    NoGUI
  1513.  
  1514.             move.l    GadBase(a4),a6
  1515.             move.l    MyWindow(a4),a0
  1516.             move.l  wd_UserPort(a0),a0
  1517.             CALL    GT_GetIMsg
  1518.             tst.l   d0         
  1519.             beq     NoGUI
  1520.             move.l  d0,a1
  1521.             moveq.l    #0,d6
  1522.             move.w    im_Code(a1),d6    ;Value of Gadget
  1523.             move.l  im_IAddress(a1),a2
  1524.  
  1525.             move.l    im_Class(a1),d7
  1526.             CALL    GT_ReplyIMsg
  1527.  
  1528.             cmp.l    #GADGETUP,d7
  1529.             bne    Others
  1530.  
  1531.             move.w    gg_GadgetID(a2),d0
  1532.             move.l    gg_SpecialInfo(a2),a3
  1533.             cmp.w    #21,d0
  1534.             beq    HideGad
  1535.             cmp.w    #22,d0
  1536.             beq    QuitGad
  1537.             cmp.w    #23,d0
  1538.             beq    SaveGad
  1539.  
  1540.             subq.l    #1,d0
  1541.  
  1542.             lea    AllGadgets(pc),a5
  1543.             mulu    #MyGadgetSize,d0
  1544.             sub.l    a2,a2
  1545.             move.w    MyGadgetStore(a5,d0.w),a2
  1546.             add.l    a4,a2
  1547.  
  1548. StringTest        cmp.w    #STRING_KIND,MyGadgetKind(a5,d0.w)
  1549.             bne.s    CheckBoxTest
  1550.             move.l    si_Buffer(a3),a0
  1551.             move.l    (a2),a1
  1552.             bsr    CopyPattern
  1553.             bsr    BuildPatterns
  1554.             bsr    InstallHotKey
  1555.             bra.s    NoGUI
  1556.  
  1557. CheckBoxTest        cmp.w    #CHECKBOX_KIND,MyGadgetKind(a5,d0.w)
  1558.             bne.s    StandardGUI
  1559.             ;using im_Code works only since V39, so:
  1560.             moveq.l    #1,d6
  1561.             tst.l    (a2)
  1562.             beq.s    StandardGUI
  1563.             moveq.l    #0,d6
  1564.  
  1565. StandardGUI        move.l    d6,(a2)
  1566.             bra.s    NoGUI
  1567.  
  1568. SaveGad            bsr    SaveConfig
  1569.             bra.s    NoGUI
  1570.  
  1571. QuitGad            bsr    CloseGUI
  1572.             move.w    #1,QuitMe(a4)
  1573.             bra.s    HideGad
  1574.  
  1575. Others                    cmp.l   #CLOSEWINDOW,d7
  1576.                     bne.s    NoClose
  1577. HideGad            bsr    CloseGUI
  1578.             bra.s    NoGUI
  1579. NoClose            cmp.l    #IDCMP_VANILLAKEY,d7
  1580.             bne.s    NoGUI
  1581.             cmp.b    #"q",d6
  1582.             beq.s    QuitGad
  1583.             cmp.b    #"s",d6
  1584.             beq.s    SaveGad
  1585.             cmp.b    #"h",d6
  1586.             beq.s    HideGad
  1587.  
  1588. NoGUI            RLoad
  1589.             rts
  1590.  
  1591. CloseGUI        RSave
  1592.             tst.w    GUIOpened(a4)
  1593.             beq.s    NotOpened
  1594.  
  1595.             bsr    RefreshStrings
  1596.  
  1597.             move.l    IntBase(a4),a6
  1598.             move.l    MyWindow(a4),a0
  1599.             bsr    RemoveSignal
  1600.             ;move.l    MyWindow(a4),a0
  1601.             move.l    GadgetList(a4),a1
  1602.             moveq.l    #-1,d0
  1603.             CALL    RemoveGList
  1604.  
  1605.             move.l    MyWindow(a4),a0
  1606.             clr.l    d0
  1607.             move.w    wd_TopEdge(a0),d0
  1608.             move.l    d0,RemWindowY
  1609.             move.w    wd_LeftEdge(a0),d0
  1610.             move.l    d0,RemWindowX
  1611.             CALL    CloseWindow
  1612.             
  1613. FailWindow        move.l    GadgetList(a4),a0
  1614.             move.l    GadBase(a4),a6
  1615.             CALL    FreeGadgets
  1616.  
  1617.             move.l    MyVisual(a4),a0
  1618.             CALL    FreeVisualInfo
  1619.  
  1620.             move.l    IntBase(a4),a6
  1621.             sub.l    a0,a0
  1622.             move.l    PublicScreen(a4),a1
  1623.             CALL    UnlockPubScreen
  1624.  
  1625. NotOpened        clr.w    GUIOpened(a4)
  1626.  
  1627.             RLoad
  1628.             rts
  1629.  
  1630. EnterSignal        Push    d0-d1/a0          
  1631.             move.l  wd_UserPort(a0),a0
  1632.             move.b  MP_SIGBIT(a0),d0  
  1633.             move.l    SignalMask(a4),d1
  1634.             bset    d0,d1             
  1635.             move.l  d1,SignalMask(a4) 
  1636.             Pull    d0-d1/a0          
  1637.             rts                       
  1638.                                           
  1639. RemoveSignal        Push    d0-d1/a0          
  1640.             move.l  wd_UserPort(a0),a0
  1641.             move.b  MP_SIGBIT(a0),d0
  1642.             move.l    SignalMask(a4),d1
  1643.             bclr    d0,d1             
  1644.             move.l    d1,SignalMask(a4) 
  1645.             Pull    d0-d1/a0          
  1646.             rts
  1647.  
  1648. GetNexta0.1        tst.b    (a0)+
  1649. GetNexta0        move.b    (a0),d0
  1650.             cmp.b    #"=",d0
  1651.             beq.s    GetNexta0.1
  1652.             cmp.b    #" ",d0
  1653.             beq.s    GetNexta0.1
  1654.             or.w    #$20,d0
  1655.             rts
  1656.  
  1657. RefreshStrings        RSave
  1658.             move.l    GadgetList(a4),a3
  1659.  
  1660. ThruAll            move.w    gg_GadgetID(a3),d0
  1661.             subq.l    #1,d0
  1662.             lea    AllGadgets(pc),a5
  1663.             mulu    #MyGadgetSize,d0
  1664.             sub.l    a2,a2
  1665.             move.w    MyGadgetStore(a5,d0.w),a2
  1666.             add.l    a4,a2    ;TempXXX
  1667.  
  1668.             cmp.w    #STRING_KIND,MyGadgetKind(a5,d0.w)
  1669.             bne.s    NextGaddie
  1670.             move.l    gg_SpecialInfo(a3),a0
  1671.             move.l    si_Buffer(a0),a0
  1672.             move.l    (a2),a1
  1673.             bsr    CopyPattern
  1674.             bsr    BuildPatterns
  1675.             bsr    InstallHotKey
  1676.  
  1677. NextGaddie        move.l    gg_NextGadget(a3),a3
  1678.             move.l    a3,d0
  1679.             bne.s    ThruAll
  1680.             RLoad
  1681.             rts
  1682.  
  1683.  
  1684. ;Screen in a0, X-Coord(rel) in d0, Y-Coord(rel) in d1
  1685. SetPointer        Push    a0-a2/d0-d1/a6
  1686.             lea    PointerPixEvent(a4),a2
  1687.             move.l    a0,iepp_Screen(a2)
  1688.             move.w    sc_MouseX(a0),d2
  1689.             move.w    sc_MouseY(a0),d3
  1690.  
  1691.             move.l    MyIORequest(a4),a1
  1692.             move.w    #IND_WRITEEVENT,io_Command(a1)
  1693.             lea    MyInputEvent(a4),a0
  1694.             move.l    #0,ie_NextEvent(a0)
  1695.             move.b    #IECLASS_NEWPOINTERPOS,ie_Class(a0)
  1696.             move.w    #0,ie_Qualifier(a0)
  1697.             add.w    d0,d2
  1698.             add.w    d1,d3
  1699.             move.w    d2,iepp_PositionX(a2)
  1700.             move.w    d3,iepp_PositionY(a2)
  1701.             move.l    a2,ie_EventAddress(a0)
  1702.  
  1703.             move.b    #IESUBCLASS_PIXEL,ie_SubClass(a0)
  1704.             move.w    #IECODE_NOBUTTON,ie_Code(a0)
  1705.             move.l    a0,io_Data(a1)
  1706.             move.l    #ie_SIZEOF,io_Length(a1)
  1707.             move.l    $04,a6
  1708.             CALL    DoIO
  1709.             Pull    a0-a2/a6/d0-d1
  1710.             rts
  1711.  
  1712. BuildPatterns        RSave
  1713.             tst.l    TempScreen(a4)
  1714.             beq.s    NoScreenPattern
  1715.             move.l    TempScreen(a4),a0
  1716.             bsr    GetNexta0
  1717.             lea    ScreenPatternMem(a4),a1
  1718.             bsr    CopyPattern
  1719.  
  1720.             lea    ScreenPatternMem(a4),a0
  1721.             lea    ScreenPatLen(a4),a2
  1722.             lea    ScreenPattern(a4),a3
  1723.             bsr    GetLen
  1724.             bpl    NoScreenPattern
  1725.             bsr    PatternError
  1726.  
  1727. NoScreenPattern        lea    ScreenPatternMem(a4),a0
  1728.             move.l    a0,TempScreen(a4)
  1729.             tst.l    TempWindow(a4)
  1730.             beq.s    NoWindowPattern
  1731.             move.l    TempWindow(a4),a0
  1732.             bsr    GetNexta0
  1733.             lea    WindowPatternMem(a4),a1
  1734.             bsr    CopyPattern
  1735.  
  1736.             lea    WindowPatternMem(a4),a0
  1737.             lea    WindowPatLen(a4),a2
  1738.             lea    WindowPattern(a4),a3
  1739.             bsr    GetLen
  1740.             bpl.s    NoWindowPattern
  1741.             bsr    PatternError
  1742.     
  1743. NoWindowPattern        lea    WindowPatternMem(a4),a0
  1744.             move.l    a0,TempWindow(a4)
  1745.             RLoad
  1746.             rts        
  1747.  
  1748. PatternError        lea    Text3(pc),a0
  1749.             bra    OpenRequester
  1750.  
  1751. ;a0:Source, a1:Dest
  1752. CopyPattern        move.w    #511,d0
  1753. CopyPattern2        move.b    (a0)+,(a1)+
  1754.             beq.s    EndCopy
  1755.             dbf    d0,CopyPattern2
  1756.             bsr    PatternError
  1757. EndCopy            rts
  1758.  
  1759.  
  1760. ;In: (a2): LEN - (a3): MEMORY - a0: Source-Pattern    :back: d0=pattern ok?
  1761. GetLen            move.l    a0,d6
  1762.             clr.l    d3
  1763. GetLen2            tst.b    (a0)+
  1764.             beq.s    EndOfString
  1765.             addq.l    #1,d3
  1766.             bra.s    GetLen2
  1767. EndOfString        lsl.w    #1,d3    ;StandardLen Of Pattern
  1768.             addq    #2,d3
  1769.             move.l    $04,a6
  1770.             tst.l    (a3)
  1771.             beq    AllocNew
  1772.             move.l    (a3),a1
  1773.             move.l    (a2),d0
  1774.             CALL    FreeMem
  1775.             clr.l    (a3)
  1776. AllocNew        move.l    d3,(a2)
  1777.             move.l    d3,d0
  1778.             move.l    #MEMF_CLEAR,d1
  1779.             CALL    AllocMem
  1780.             move.l    d0,d2
  1781.             beq    QuitPrg        ;No Memory? Good bye !
  1782.             move.l    d0,(a3)
  1783.             move.l    d6,d1
  1784.             move.l    DosBase(a4),a6
  1785.             CALL    ParsePatternNoCase
  1786.             rts
  1787.  
  1788.             
  1789. ;a0: Requester-Text
  1790. OpenRequester        Push    a0-a3
  1791.             lea    EasyReqStruct(a4),a1
  1792.             lea    PortName(pc),a2
  1793.             move.l    a2,es_Title(a1)
  1794.             move.l    a0,es_TextFormat(a1)
  1795.             lea    GadgetText(pc),a2
  1796.             move.l    a2,es_GadgetFormat(a1)
  1797.             move.l    IntBase(a4),a6
  1798.             sub.l    a0,a0
  1799.             ;a1: EasyReq
  1800.             sub.l    a2,a2
  1801.             sub.l    a3,a3
  1802.             CALL    EasyRequestArgs
  1803.             Pull    a0-a3
  1804.             rts
  1805.  
  1806. SaveConfig        RSave
  1807.             tst.l    WBMessage(a4)
  1808.             beq    SkipConfig
  1809.             move.l    WBMessage(a4),a3
  1810.             move.l    sm_ArgList(a3),d0
  1811.             beq    SkipConfig
  1812.             move.l    d0,a0
  1813.             move.l    wa_Name(a0),a0
  1814.             move.l    a0,d5
  1815.  
  1816.             move.l    DObject(a4),d0
  1817.             beq    SkipConfig
  1818.  
  1819.             move.l    d0,a0
  1820.             move.l    do_ToolTypes(a0),a5    ;Remember Old
  1821.             move.l    #1,TempDummy(a4)
  1822.  
  1823.             bsr    RefreshStrings
  1824.  
  1825.             Push    a0/a6
  1826.             move.l    $04,a6
  1827.             move.l    #NumberOfTemps*10+2*512+2*8,d0    ;Memory for tool arrays
  1828.             move.l    #MEMF_CLEAR,d1
  1829.             CALL    AllocMem
  1830.             move.l    d0,a3
  1831.             beq    MemErrTool
  1832.             move.l    DObject(a4),a0
  1833.             move.l    d0,do_ToolTypes(a0)
  1834.  
  1835.             move.l    d0,a1
  1836.             add.l    #(NumberOfTemps+1)*4,a1    ;Maximum Number of Pointers
  1837.  
  1838.             clr.l    d7
  1839.             lea    WBTemplate(pc),a2
  1840. LoopAllTemps        sub.l    a0,a0
  1841.             move.w    TemplateA4(a2),a0
  1842.             add.l    a4,a0
  1843.             move.l    (a0),d6
  1844.             beq.s    IsDefault
  1845.             move.l    a1,(a3,d7)
  1846.             move.l    TemplateText(a2),a0
  1847.             bsr    CopyPattern
  1848.             move.w    TemplateType(a2),d1
  1849.             beq    ThatsAllTemp
  1850.             move.b    #"=",-1(a1)
  1851.             
  1852.             cmp.w    #T_CYCLE,d1
  1853.             bne.s    ThatsString
  1854.             move.l    TemplateSpecial(a2),a0
  1855.             lsl.l    #2,d6
  1856.             move.l    (a0,d6.w),a0
  1857.             bsr    CopyPattern
  1858.             bra.s    ThatsAllTemp
  1859.  
  1860. ThatsString        cmp.w    #T_STRING,d1
  1861.             bne.s    ThatsInteger
  1862.             move.l    d6,a0
  1863.             bsr    CopyPattern
  1864.             bra.s    ThatsAllTemp
  1865.  
  1866. ThatsInteger        move.l    d6,d0
  1867.             bsr    PrintInteger
  1868.  
  1869. ThatsAllTemp        addq.l    #4,d7
  1870.             move.l    a1,d0
  1871.             and.l    #$ffffffc,d0
  1872.             move.l    d0,a1
  1873.             lea    4(a1),a1    ;Align on Longwords
  1874. IsDefault        add.l    #TemplateSize,a2
  1875.             tst.l    TemplateText(a2)
  1876.             bne    LoopAllTemps
  1877.  
  1878.             move.l    d5,a0
  1879.             move.l    DObject(a4),a1
  1880.             move.l    IconBase(a4),a6
  1881.             CALL    PutDiskObject
  1882.             bne.s    Done
  1883.             lea    Text4(pc),a0
  1884.             bsr    OpenRequester
  1885.  
  1886. Done            move.l    $04,a6
  1887.             move.l    #NumberOfTemps*10+2*512+2*8,d0
  1888.             move.l    a3,a1
  1889.             CALL    FreeMem
  1890. MemErrTool        Pull    a0/a6
  1891.  
  1892.             move.l    a5,do_ToolTypes(a0)
  1893.                 
  1894.             bra.s    DoneConfig
  1895.  
  1896. SkipConfig        lea    Text4(pc),a0
  1897.             bsr    OpenRequester
  1898. DoneConfig        RLoad
  1899.             rts
  1900.  
  1901.  
  1902. ;Where in hell has this damned OS a atoi and itoa function???
  1903.  
  1904. ;Quick implementation of word-only functions:
  1905.  
  1906. ;a0:String    Back: d0: Integer
  1907. GetInteger        Push    d1-d2/a0
  1908.             moveq.l    #0,d0
  1909.             moveq.l    #0,d1
  1910.             moveq.l    #1,d2
  1911.             cmp.b    #"-",(a0)
  1912.             bne.s    GetDezNr
  1913.             tst.b    (a0)+
  1914.             moveq.l    #-1,d2
  1915. GetDezNr        move.b    (a0)+,d1
  1916.             cmp.b    #"0",d1
  1917.             bcs    StringOver
  1918.             cmp.b    #"9"+1,d1
  1919.             bcc    StringOver
  1920.             sub.w    #$30,d1
  1921.             mulu    #$0a,d0
  1922.             add.l    d1,d0
  1923.             bra.s    GetDezNr
  1924. StringOver        muls    d2,d0
  1925.             Pull    d1-d2/a0
  1926.             rts    
  1927.  
  1928. ;d0: Integer        a1:String
  1929. PrintInteger        tst.l    d0
  1930.             bpl.s    PrDez0
  1931.             move.b    #"-",(a1)+
  1932.             neg.l    d0
  1933. PrDez0            move.w    #-1,-(sp)
  1934. PrDez            divu    #$0a,d0
  1935.             swap    d0
  1936.             move.w    d0,-(sp)
  1937.             clr.w    d0
  1938.             swap    d0
  1939.             bne.s    PrDez
  1940. PrDez1            move.w    (sp)+,d0
  1941.             bmi.s    CloseUp
  1942.             add.w    #"0",d0
  1943.             move.b    d0,(a1)+
  1944.             bra.s    PrDez1
  1945. CloseUp            clr.b    (a1)+
  1946.             rts
  1947.  
  1948.             rsreset
  1949. HK_Default        rs.l    1
  1950. HK_Description        rs.l    1
  1951. HK_Store        rs.l    1
  1952. HK_ID            rs.l    1
  1953. HK_Filter        rs.l    1
  1954. HK_SIZEOF        rs.l    0
  1955.  
  1956. HotKeyTable        dc.l    DefaultDescr4,Description4,TempNWindow,MyNWinID,Filter4
  1957.             dc.l    DefaultDescr3,Description3,TempLWindow,MyLWinID,Filter3
  1958.             dc.l    DefaultDescr2,Description2,TempActionKey,MyActionID,Filter2
  1959.             dc.l    DefaultDescr,Description,TempCXPOPKEY,MyHotkeyID,Filter
  1960.             dc.l    0
  1961.  
  1962. InstallHotKey        Push    a0-a1/a5-a6/d4-d5
  1963.             lea    HotKeyTable(pc),a5
  1964. InstallHotKey2        move.l    HK_Default(a5),a0
  1965.             move.l    HK_Description(a5),d0
  1966.             lea    (a4,d0),a1
  1967.             move.l    HK_Store(a5),d4
  1968.             tst.l    (a4,d4)
  1969.             beq.s    NoPOPKEY
  1970.             move.l    (a4,d4),a0
  1971.             bsr    GetNexta0
  1972. NoPOPKEY        move.l    a1,(a4,d4)
  1973.             bsr    CopyKey
  1974.             bmi.s    HotKeyError
  1975.  
  1976.             move.l    HK_Filter(a5),d5
  1977.             bsr    RemovePopKey
  1978.  
  1979.             move.l    HK_Description(a5),d0
  1980.             lea    (a4,d0),a0
  1981.             move.l    MyPort(a4),a1
  1982.             move.l    HK_ID(a5),d0
  1983.             bsr    HotKey
  1984.             bmi.s    HotKeyError
  1985.             move.l    a0,(a4,d5)
  1986.             CALL    CxObjError
  1987.             tst.l    d0
  1988.             bne.s    DeleteAndErr
  1989.             move.l    (a4,d5),a1
  1990.             move.l    Broker(a4),a0
  1991.             CALL    AttachCxObj
  1992.  
  1993.             lea    HK_SIZEOF(a5),a5
  1994.             tst.l    (a5)
  1995.             bne.s    InstallHotKey2
  1996.             Pull    a0-a1/a5-a6/d4-d5
  1997.             rts
  1998.  
  1999. DeleteAndErr        bsr    DeletePopKey
  2000. HotKeyError        lea    HotKeyErrorT(pc),a0
  2001.             bsr    OpenRequester
  2002.             clr.l    (a4,d4)
  2003.             bra    InstallHotKey2
  2004.  
  2005. CopyKey            move.w    #63,d0
  2006. CopyString        move.b    (a0)+,(a1)+
  2007.             beq.s    EndString
  2008.             dbf    d0,CopyString
  2009.             moveq.l    #-1,d0
  2010. EndString        rts
  2011.  
  2012. RemovePopKey        move.l    CommBase(a4),a6
  2013.             tst.l    (a4,d5)
  2014.             beq.s    NoFilter
  2015.             move.l    (a4,d5),a0
  2016.             CALL    RemoveCxObj
  2017. DeletePopKey        move.l    (a4,d5),a0
  2018.             CALL    DeleteCxObjAll
  2019.             clr.l    (a4,d5)
  2020. NoFilter        rts                
  2021.  
  2022.  
  2023. ;Implementation of the cx.lib function
  2024. ;HotKey(char *Description,MsgPort *CxPort,long Event)
  2025.  
  2026. ;a0=Description, a1=CxPort, d0=Event    ;Back: d0:Error, a0:Filter
  2027. HotKey            Push    d1-d7/a1-a2/a6
  2028.             move.l    a1,a2        ;Rem Port
  2029.             move.l    d0,d6        ;Rem Event
  2030.             move.l    CommBase(a4),a6
  2031.             move.l    #CX_FILTER,d0
  2032.             ;Description is in a0
  2033.             sub.l    a1,a1
  2034.             CALL    CreateCxObj
  2035.             move.l    d0,d7        ;Remember Filter
  2036.             beq.s    HKErr2
  2037.             move.l    #CX_SEND,d0
  2038.             move.l    a2,a0        ;Given Port
  2039.             move.l    d6,a1        ;Event
  2040.             CALL    CreateCxObj
  2041.             move.l    d0,d6        ;Remember Sender
  2042.             beq.s    HKErr
  2043.             move.l    d7,a0        ;Filter
  2044.             move.l    d6,a1        ;Sender
  2045.             CALL    AttachCxObj
  2046.             move.l    #CX_TRANSLATE,d0
  2047.             sub.l    a0,a0
  2048.             move.l    a0,a1
  2049.             CALL    CreateCxObj
  2050.             move.l    d0,a1
  2051.             tst.l    d0
  2052.             beq.s    HKErr
  2053.             move.l    d7,a0            ;Filter 
  2054.             ;Translate is in a1
  2055.             CALL    AttachCxObj
  2056.             move.l    d7,a0        ;Return Filter in a0
  2057.             moveq.l    #0,d0
  2058.             bra.s    HKOut
  2059. HKErr            move.l    d7,a0
  2060.             CALL    DeleteCxObjAll
  2061. HKErr2            moveq.l    #-1,d0
  2062. HKOut            Pull    d1-d7/a1-a2/a6
  2063.             rts
  2064.  
  2065. TestButton        RSave
  2066.             cmp.l    #0,a0
  2067.             beq.s    SkipTestButton
  2068.             move.l    RememberA4,a4
  2069.             move.l    CommBase(a4),a6
  2070.             CALL    CxMsgData
  2071.             tst.l    d0
  2072.             beq    SkipTestButton
  2073.             move.l    d0,a0
  2074.             cmp.b    #IECLASS_RAWMOUSE,ie_Class(a0)
  2075.             bne.s    SkipTestButton
  2076.             cmp.w    #IECODE_UP_PREFIX!IECODE_LBUTTON,ie_Code(a0)
  2077.             beq.s    RelButton
  2078.             cmp.w    #IECODE_LBUTTON,ie_Code(a0)
  2079.             bne.s    SkipTestButton
  2080.             move.w    #1,ButtonPressed(a4)
  2081.             bra.s    SkipTestButton
  2082. RelButton        clr.w    ButtonPressed(a4)
  2083.             bsr    SignalMyself
  2084.  
  2085.             bset    #SignalButton,What(a4)
  2086.  
  2087. SkipTestButton        RLoad
  2088.             rts
  2089.  
  2090.             IFNE    DEBUG
  2091. BLINK            RSave
  2092.             move.w    #$10,d1
  2093. blink2            move.w    #$7fff,d0
  2094. blink1            move.w    d0,$dff180
  2095.             dbf    d0,blink1
  2096.             dbf    d1,blink2
  2097.             RLoad
  2098.             rts
  2099.             ENDC
  2100.  
  2101. StringTagList        dc.l    GTST_String
  2102.             dc.l    0
  2103.             dc.l    GTST_MaxChars
  2104.             dc.l    511
  2105.             dc.l    TAG_DONE
  2106.  
  2107. CycleTagList        dc.l    GTCY_Active
  2108.             dc.l    0
  2109.             dc.l    GTCY_Labels
  2110.             dc.l    CycleList
  2111.             dc.l    TAG_DONE
  2112.  
  2113. CycleTagList2        dc.l    GTCY_Active
  2114.             dc.l    0
  2115.             dc.l    GTCY_Labels
  2116.             dc.l    CycleList2
  2117.             dc.l    TAG_DONE
  2118.  
  2119. CycleTagList3        dc.l    GTCY_Active
  2120.             dc.l    0
  2121.             dc.l    GTCY_Labels
  2122.             dc.l    CycleList3
  2123.             dc.l    TAG_DONE
  2124.  
  2125. GadgetTagList        dc.l    GTCB_Checked
  2126.             dc.l    0
  2127.             dc.l    TAG_DONE
  2128.  
  2129. SlideTagList        dc.l    GTSL_Level
  2130.             dc.l    0
  2131.             dc.l    GTSL_Min
  2132.             dc.l    0
  2133.             dc.l    GTSL_Max
  2134.             dc.l    99
  2135.             dc.l    GTSL_LevelFormat
  2136.             dc.l    SliderText
  2137.             dc.l    GTSL_LevelPlace
  2138.             dc.l    PLACETEXT_LEFT
  2139.             dc.l    GTSL_MaxLevelLen
  2140.             dc.l    50
  2141.             dc.l    GA_RelVerify
  2142.             dc.l    1
  2143.             dc.l    TAG_DONE
  2144.  
  2145. SlideTagList2        dc.l    GTSL_Level
  2146.             dc.l    0
  2147.             dc.l    GTSL_Min
  2148.             dc.l    0
  2149.             dc.l    GTSL_Max
  2150.             dc.l    500
  2151.             dc.l    GTSL_LevelFormat
  2152.             dc.l    SliderText2
  2153.             dc.l    GTSL_LevelPlace
  2154.             dc.l    PLACETEXT_LEFT
  2155.             dc.l    GTSL_MaxLevelLen
  2156.             dc.l    50
  2157.             dc.l    GA_RelVerify
  2158.             dc.l    1
  2159.             dc.l    TAG_DONE
  2160.  
  2161. TagList            dc.l    GA_Disabled
  2162.             dc.l    0
  2163.             dc.l    GT_Underscore
  2164.             dc.l    '_'
  2165. TagListDone        dc.l    TAG_DONE
  2166.  
  2167. WindowTagList        dc.l    WA_InnerWidth
  2168. StoreInnerWidth            dc.l    0
  2169.             dc.l    WA_InnerHeight
  2170. StoreInnerHeight        dc.l    0
  2171.             dc.l    WA_IDCMP
  2172.                 dc.l    BUTTONIDCMP!CLOSEWINDOW!IDCMP_VANILLAKEY
  2173.             dc.l    WA_Flags
  2174.                 dc.l    WINDOWCLOSE!WINDOWDRAG!WINDOWDEPTH!ACTIVATE    
  2175.             dc.l    WA_PubScreen
  2176. StorePublicScreen        dc.l    0
  2177.             dc.l    WA_Title
  2178.                 dc.l    Texth
  2179.             dc.l    WA_AutoAdjust
  2180.                 dc.l    1
  2181.             dc.l    WA_Left
  2182. RemWindowX            dc.l    -1
  2183.             dc.l    WA_Top
  2184. RemWindowY            dc.l    -1
  2185.             dc.l    TAG_DONE
  2186.  
  2187. RememberA4        dc.l    0
  2188. RememberStack        dc.l    0
  2189.  
  2190.             rsreset
  2191. ScreenPatLen        rs.l    1
  2192. ScreenPattern        rs.l    1
  2193. WindowPatLen        rs.l    1
  2194. WindowPattern        rs.l    1
  2195. GadgetList        rs.l    1
  2196. WindPosRem        rs.l    1
  2197. WindSizeRem        rs.l    1
  2198. StartupFlag        rs.w    1
  2199. PositionX        rs.w    1
  2200. PositionY        rs.w    1
  2201. What            rs.w    1
  2202. DisableHW        rs.w    1
  2203. GUIOpened        rs.w    1
  2204. QuitMe            rs.w    1
  2205. RemFontSize        rs.w    1
  2206. ButtonPressed        rs.w    1
  2207. GadgetInside        rs.w    11
  2208. MyPort            rs.l    1
  2209. MyVisual        rs.l    1
  2210. Broker            rs.l    1
  2211. LastActive        rs.l    1
  2212. ScreenMem        rs.b    ScreenMemSize
  2213. IntBase            rs.l    1
  2214. IBaseLock        rs.l    1
  2215. RemLen            rs.w    1
  2216. RemHeight        rs.w    1
  2217. RemTop            rs.w    1
  2218. RemLeft            rs.w    1
  2219. DelayDo            rs.w    1
  2220. GadBase            rs.l    1
  2221. DosBase            rs.l    1
  2222. CommBase        rs.l    1
  2223. IconBase        rs.l    1
  2224. DObject            rs.l    1
  2225. Active            rs.l    1
  2226. FirstSc            rs.l    1
  2227. GraphicsBase        rs.l    1
  2228. PublicScreen        rs.l    1
  2229. PublicRastport        rs.l    1
  2230. Gadget0            rs.l    1
  2231. Filter            rs.l    1
  2232. Filter2            rs.l    1
  2233. Filter3            rs.l    1
  2234. Filter4            rs.l    1
  2235. Filter5            rs.l    1
  2236. VisualX            rs.w    1
  2237. VisualY            rs.w    1
  2238. TemplateArray        rs.l    0    ;Do not change order!
  2239. TempMove        rs.l    1
  2240. TempSFront        rs.l    1
  2241. TempWFront        rs.l    1
  2242. TempPDef        rs.l    1
  2243. TempRemWin        rs.l    1
  2244. TempMoveMouse        rs.l    1
  2245. TempCXPOPUP        rs.l    1
  2246. TempRestrict        rs.l    1
  2247. TempWBWin        rs.l    1
  2248. TempCXPRI        rs.l    1
  2249. TempCXPOPKEY        rs.l    1
  2250. TempHADJ        rs.l    1
  2251. TempVADJ        rs.l    1
  2252. TempScreen        rs.l    1
  2253. TempWindow        rs.l    1
  2254. TempActionKey        rs.l    1
  2255. TempAction        rs.l    1
  2256. TempDelay        rs.l    1
  2257. TempLWindow        rs.l    1
  2258. TempNWindow        rs.l    1
  2259. TempSmooth        rs.l    1
  2260. TempDummy        rs.l    1
  2261. TempZero        rs.l    1
  2262. TempSave        rs.l    1
  2263.  
  2264. OwnTask            rs.l    1
  2265. Signal            rs.l    1
  2266. Args            rs.l    1
  2267. WBMessage        rs.l    1
  2268. SignalMask        rs.l    1
  2269. MyWindow        rs.l    1
  2270. LastGadget        rs.l    1
  2271. MyIORequest        rs.l    1
  2272. MouseMsgPort        rs.l    1
  2273. MyNewGadget        rs.b    gng_SIZEOF
  2274. MyInterrupt        rs.b    IS_SIZE
  2275. MyInputEvent        rs.b    ie_SIZEOF
  2276. PointerPixEvent        rs.b    IEPointerPixel_SIZEOF
  2277. EasyReqStruct        rs.b    es_SIZEOF
  2278. Description        rs.b    64
  2279. Description2        rs.b    64
  2280. Description3        rs.b    64
  2281. Description4        rs.b    64
  2282. Description5        rs.b    64
  2283. ScreenPatternMem    rs.b    512    ;sufficient I think
  2284. WindowPatternMem    rs.b    512
  2285. AllocLength        rs.w    1
  2286.  
  2287. intuition        dc.b    "intuition.library",0
  2288. DosName            dc.b    "dos.library",0
  2289. InputName        dc.b    "input.device",0
  2290. GraphicsName        dc.b    "graphics.library",0
  2291. IconName        dc.b    "icon.library",0
  2292. GadName            dc.b    "gadtools.library",0
  2293. CommName        dc.b    "commodities.library",0
  2294.             even
  2295.  
  2296. MyNewBroker        dc.b    NB_VERSION    ;Version
  2297.             dc.b    0        ;Reserve1
  2298.             dc.l    HandlerName    ;Name
  2299.             dc.l    PortName    ;Title
  2300.             dc.l    DescText    ;Description
  2301.             dc.w    NBU_NOTIFY!NBU_UNIQUE        ;Unique
  2302.             dc.w    COF_SHOW_HIDE    ;Flags
  2303. MyPri            dc.b    0        ;Pri
  2304.             dc.b    0        ;Reserve2
  2305. BrokerPort        dc.l    0        ;Port
  2306.             dc.w    0        ;ReservedChannel
  2307.  
  2308. CycleList    dc.l    GUI_Choose1.1,GUI_Choose1.2,GUI_Choose1.3,GUI_Choose1.4,0
  2309. CycleList2    dc.l    GUI_Choose2.1,GUI_Choose2.2,GUI_Choose2.3,GUI_Choose2.4,0
  2310. CycleList3    dc.l    GUI_Choose3.1,GUI_Choose3.2,GUI_Choose3.3,0
  2311.  
  2312.         rsreset
  2313. TemplateText    rs.l    1
  2314. TemplateSpecial    rs.l    1
  2315. TemplateA4    rs.w    1
  2316. TemplateType    rs.w    1
  2317. TemplateSize    rs.w    0
  2318.  
  2319. T_CHECK        =    0
  2320. T_CYCLE        =    1
  2321. T_STRING    =    2
  2322. T_INTEGER    =    3
  2323.  
  2324. NumberOfTemps    =    21
  2325.  
  2326. WBTemplate    dc.l    TextDNW,0
  2327.         dc.w    TempDummy,T_CHECK
  2328.  
  2329.         dc.l    TextMove,0
  2330.         dc.w    TempMove,T_CHECK
  2331.  
  2332.         dc.l    TextSFront,0
  2333.         dc.w    TempSFront,T_CHECK
  2334.  
  2335.         dc.l    TextWFront,0
  2336.         dc.w    TempWFront,T_CHECK
  2337.  
  2338.         dc.l    TextPDef,0
  2339.         dc.w    TempPDef,T_CHECK
  2340.  
  2341.         dc.l    TextRestrict,0
  2342.         dc.w    TempRestrict,T_CHECK
  2343.  
  2344.         dc.l    TextDelay,0
  2345.         dc.w    TempDelay,T_INTEGER
  2346.  
  2347.         dc.l    TextAction,CycleList3
  2348.         dc.w    TempAction,T_CYCLE
  2349.  
  2350.         dc.l    TextRemWin,0
  2351.         dc.w    TempRemWin,T_CHECK
  2352.  
  2353.         dc.l    TextMoveMouse,0
  2354.         dc.w    TempMoveMouse,T_CHECK
  2355.  
  2356.         dc.l    TextCXPOPUP,0
  2357.         dc.w    TempCXPOPUP,T_CHECK
  2358.  
  2359.         dc.l    TextWBWin,0
  2360.         dc.w    TempWBWin,T_CHECK
  2361.  
  2362.         dc.l    TextScreen,0
  2363.         dc.w    TempScreen,T_STRING
  2364.  
  2365.         dc.l    TextWindow,0
  2366.         dc.w    TempWindow,T_STRING
  2367.  
  2368.         dc.l    TextCXPOPKEY,0
  2369.         dc.w    TempCXPOPKEY,T_STRING
  2370.  
  2371.         dc.l    TextCXPRI,0
  2372.         dc.w    TempCXPRI,T_INTEGER
  2373.  
  2374.         dc.l    TextHADJ,CycleList
  2375.         dc.w    TempHADJ,T_CYCLE
  2376.  
  2377.         dc.l    TextVADJ,CycleList2
  2378.         dc.w    TempVADJ,T_CYCLE
  2379.  
  2380.         dc.l    TextActionKey,0
  2381.         dc.w    TempActionKey,T_STRING
  2382.  
  2383.         dc.l    TextLastWindow,0
  2384.         dc.w    TempLWindow,T_STRING
  2385.  
  2386.         dc.l    TextNextWindow,0
  2387.         dc.w    TempNWindow,T_STRING
  2388.  
  2389.         dc.l    TextSmooth,0
  2390.         dc.w    TempSmooth,T_INTEGER
  2391.  
  2392.         dc.l    0
  2393.  
  2394.  
  2395. TextDNW        dc.b    "DONOTWAIT",0
  2396. TextMove    dc.b    "MOVE",0
  2397. TextSFront    dc.b    "SFRONT",0
  2398. TextWFront    dc.b    "WFRONT",0
  2399. TextPDef    dc.b    "DEFPUB",0
  2400. TextCXPOPUP    dc.b    "CX_POPUP",0
  2401. TextRestrict    dc.b    "RESTRICT",0
  2402. TextCXPRI    dc.b    "CX_PRIORITY",0
  2403. TextCXPOPKEY    dc.b    "CX_POPKEY",0
  2404. TextRemWin    dc.b    "REMWIN",0
  2405. TextMoveMouse    dc.b    "MOVEMOUSE",0
  2406. TextHADJ    dc.b    "HADJ",0
  2407. TextVADJ    dc.b    "VADJ",0
  2408. TextScreen    dc.b    "SCREEN",0
  2409. TextWindow    dc.b    "WINDOW",0
  2410. TextActionKey    dc.b    "ACTIONKEY",0
  2411. TextAction    dc.b    "ACTION",0
  2412. TextDelay    dc.b    "DELAY",0
  2413. TextLastWindow    dc.b    "LWINDOW",0
  2414. TextNextWindow    dc.b    "NWINDOW",0
  2415. TextSmooth    dc.b    "SMOOTH",0
  2416. TextWBWin    dc.b    "WBWIN",0
  2417. Template    dc.b    "MOVE/S,SFRONT/S,WFRONT/S,DEFPUB/S,REMWIN/S,MOVEMOUSE/S,CX_POPUP/S,RESTRICT/S,WBWIN/S,CX_PRIORITY/K,CX_POPKEY/K,HADJ/K,VADJ/K,SCREEN/K,WINDOW/K,ACTIONKEY/K,ACTION/K,DELAY/K,LWINDOW/K,NWINDOW/K,SMOOTH/K",0
  2418. PortName    dc.b    "Huntwindows 3.3",0
  2419. HandlerName    dc.b    "Huntwindows",0
  2420. GadgetText    dc.b    "Ok",0
  2421. DefaultDescr    dc.b    "control alt h",0
  2422. DefaultDescr2    dc.b    "control help",0
  2423. DefaultDescr3    dc.b    "lcommand left",0
  2424. DefaultDescr4    dc.b    "lcommand right",0
  2425. DefaultDescr5    dc.b    "lcommand help",0
  2426. HotKeyErrorT    dc.b    "Wrong hotkey description!",$0a,0
  2427. Text1        dc.b    "Error in arguments or libraries!",$0a,0
  2428. Text2        dc.b    "I need V37+ !",$0a,0
  2429. Text3        dc.b    "Error in given patterns!",$0a,0
  2430. Text4        dc.b    "Cannot Save!",$0a,0
  2431.         dc.b    "$VER: "    ;for version information
  2432. Texth        dc.b    "Huntwindows 3.3 (13.1.94) by Jörg Bublath 1992-1994",0
  2433. DescText    dc.b    "Moves screen to show windows",0
  2434. GUI_Text1    dc.b    "Move Screen",0
  2435. GUI_Text2    dc.b    "ScreenToFront",0
  2436. GUI_Text3    dc.b    "WindowToFront",0
  2437. GUI_Text5    dc.b    "Set Default PubScreen",0
  2438. GUI_Text6    dc.b    "Restrict on DefPub",0
  2439. GUI_Text7    dc.b    "Remember Window",0
  2440. GUI_Text7_1    dc.b    "Move Mouse",0
  2441. GUI_Text7_2    dc.b    "GUI Popup",0
  2442. GUI_Text8    dc.b    "Horizontal Adjustment",0
  2443. GUI_Text9    dc.b    "Vertical Adjustment",0
  2444. GUI_Text10    dc.b    "_Hide",0
  2445. GUI_Text11    dc.b    "_Quit",0
  2446. GUI_Text12    dc.b    "Screen Pattern",0
  2447. GUI_Text13    dc.b    "Window Pattern",0
  2448. GUI_Text14    dc.b    "_Save",0
  2449. GUI_Text16    dc.b    "Popup Hotkey",0
  2450. GUI_Text17    dc.b    "Action Hotkey",0
  2451. GUI_Text18    dc.b    "Action Condition",0
  2452. GUI_Text19    dc.b    "'Last/Next' Window' Hotkey"
  2453. GUI_Text19_2    dc.b    0
  2454. GUI_Text20    dc.b    "Exclude WB-Windows",0
  2455. SliderText    dc.b    "Delay in 1/50 seconds:%ld  ",0
  2456. SliderText2    dc.b    "Move Rate:%ld  ",0
  2457. GUI_TextEnd    ;
  2458. GUI_Choose1.1    dc.b    "left",0
  2459. GUI_Choose1.2    dc.b    "right",0
  2460. GUI_Choose1.3    dc.b    "center",0
  2461. GUI_Choose1.4    dc.b    "off",0
  2462. GUI_Choose2.1    dc.b    "top",0
  2463. GUI_Choose2.2    dc.b    "bottom",0
  2464. GUI_Choose2.3    dc.b    "center",0
  2465. GUI_Choose2.4    dc.b    "off",0
  2466. GUI_Choose3.1    dc.b    "necessary",0
  2467. GUI_Choose3.2    dc.b    "hotkey",0
  2468. GUI_Choose3.3    dc.b    "always",0
  2469.         even
  2470.