home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / fmouse_437.lzh / FMouse / FMC.ass < prev    next >
Text File  |  1991-01-16  |  27KB  |  1,245 lines

  1.  
  2. ; Source 17
  3. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  4. ; ­­                   FMouse Menu Creator V1.00                     ­­ 
  5. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  6. ; ­­                                                                 ­­ 
  7. ; ­­                     ©  Roger Fischlin                           ­­ 
  8. ; ­­                        Steigerwaldweg 6                         ­­ 
  9. ; ­­                        6450 Hanau 7                             ­­ 
  10. ; ­­                        (West) Germany                           ­­ 
  11. ; ­­                                                                 ­­ 
  12. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  13. ; ­­ This program may be freely distributed if you do NOT  gain any  ­­ 
  14. ; ­­       any profit by using or/and distributing it.               ­­ 
  15. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  16.  
  17.  
  18.  
  19.     incdir    "ram:include/"
  20.     include    "exec/interrupts.i"
  21.     include    "devices/inputevent.i"
  22.     include    "devices/input.i"
  23.     include    "exec/devices.i"
  24.     include    "exec/exec_lib.i"
  25.     include    "exec/exec.i"
  26.     include    "exec/ports.i"
  27.  
  28.     include    "intuition/intuition_lib.i"
  29.     include    "intuition/intuition.i"
  30.     include    "graphics/graphics_lib.i"
  31.     include    "libraries/dos_lib.i"
  32.     include    "libraries/dos.i"
  33.     include    "libraries/dosextens.i"
  34.  
  35. FM_PORTNAME    macro
  36.     dc.b    "FMouse.Port",0
  37.     even
  38.     endm
  39.  
  40. FM_NewNames    equ    4
  41. FM_Done    equ    -1
  42.  
  43. FM_Message    rsreset
  44. FMM_Message    rs.b    MN_SIZE
  45. FMM_Command    rs.b    1
  46. FMM_Data    rs.l    1
  47. FMM_SIZEOF    rs.b    0
  48.  
  49.  
  50. CALL_INT    macro
  51.     move.l    _IntuitionBase(pc),a6
  52.     jsr    _LVO\1(a6)
  53.     endm
  54. CALL_GRAF    macro
  55.     move.l    _GfxBase(pc),a6
  56.     jsr    _LVO\1(a6)
  57.     endm
  58. CALL_DOS    macro
  59.     move.l    _DOSBase(pc),a6
  60.     jsr    _LVO\1(a6)
  61.     endm
  62.  
  63. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  64. ; ­­                     startup code                       ­­
  65. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  66.  
  67.     sub.l    a1,a1
  68.     CALLEXEC     FindTask
  69.     move.l    d0,a4
  70.     tst.l    pr_CLI(a4)
  71.     bne.s    end_startup
  72. fromWorkbench    lea    pr_MsgPort(a4),a0
  73.     CALLEXEC     WaitPort
  74.     lea    pr_MsgPort(a4),a0
  75.     CALLEXEC     GetMsg
  76.     move.l    d0,returnMsg
  77. end_startup    bsr.s    MAIN
  78.     tst.l    returnMsg
  79.     beq.s    exitToDOS
  80.     CALLEXEC     Forbid
  81.     move.l    returnMsg(pc),a1
  82.     CALLEXEC     ReplyMsg
  83. exitToDOS    moveq.l    #0,d0
  84.     rts
  85.  
  86. returnMsg    dc.l    0
  87.  
  88.  
  89.  
  90. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  91. ; ­­                       MAIN                             ­­
  92. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  93.  
  94. MAIN    jsr    GetLibs        ; open libs
  95.     tst.l    d0
  96.     beq    .NoLibs
  97.     bsr    FMouseMenu
  98. .NoLibs    jsr    CloseLibs        ; close libs
  99.     rts
  100.  
  101.  
  102. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  103. ; ­­                         WINDOW                         ­­
  104. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  105.  
  106. ID_ABOUT    equ    0
  107. ID_LOAD    equ    1
  108. ID_SAVE    equ    2
  109. ID_USE    equ    3
  110. ID_RESET    equ    4
  111. ID_QUIT    equ    5
  112.  
  113.  
  114. FMouseMenu    lea.l    WindowData(pc),a0    ; open window
  115.     CALL_INT    OpenWindow
  116.     move.l    d0,WindowPointer
  117.     beq    Error
  118.     
  119.     move.l    d0,a1        ; set pen #2
  120.     move.l    wd_RPort(a1),a1
  121.     move.l    a1,a2
  122.     moveq.l    #2,d0
  123.     CALL_GRAF    SetAPen
  124.  
  125.     lea.l    FONT(pc),a0        ; open TOPAZ-80
  126.     CALL_GRAF    OpenFont
  127.     move.l    d0,TOPAZ_80        ; ????
  128.     beq    NoFont
  129.     move.l    d0,a0
  130.     move.l    a2,a1
  131.     CALL_GRAF    SetFont        ; use font
  132.  
  133.     move.l    a2,a1        ; draw rectangle
  134.     move.l    WindowPointer(pc),a0            
  135.     moveq.l    #0,d0
  136.     moveq.l    #0,d1
  137.     move.w    wd_Width(a0),d2
  138.     move.w    wd_Height(a0),d3
  139.     subq.l    #1,d2
  140.     subq.l    #1,d3
  141.     add.b    wd_BorderLeft(a0),d0
  142.     add.b    wd_BorderTop(a0),d1
  143.     sub.b    wd_BorderRight(a0),d2
  144.     sub.b    wd_BorderBottom(a0),d3
  145.     CALL_GRAF    RectFill
  146.     bsr    Write
  147.     lea.l    Gadget1(pc),a0
  148.     move.l    WindowPointer(pc),a1
  149.     sub.l    a2,a2
  150.     CALL_INT    RefreshGadgets
  151.     bsr    WriteText
  152.  
  153.     bsr    GetMenu        ; read FMouse menu entries
  154.  
  155. WAIT    move.l    WindowPointer(pc),a0
  156.     move.l    wd_UserPort(a0),a0
  157.     CALLEXEC    WaitPort
  158.     move.l    WindowPointer(pc),a0    ; wait for message 
  159.     move.l    wd_UserPort(a0),a0
  160.     CALLEXEC    GetMsg        ; get it !
  161.     move.l    d0,a1
  162.     move.w    im_Code(a1),d2
  163.     move.l    im_Class(a1),d3
  164.     move.l    im_IAddress(a1),a2
  165.     CALLEXEC    ReplyMsg        ; reply it !
  166.  
  167.     cmp.l    #CLOSEWINDOW,d3    ; close window
  168.     beq.s    Exit
  169.     move.b    gg_GadgetID+1(a2),d2    ; get GadgetID
  170.     cmp.b    #ID_ABOUT,d2
  171.     beq    ABOUT
  172.     cmp.b    #ID_LOAD,d2
  173.     beq    LOAD
  174.     cmp.b    #ID_SAVE,d2
  175.     beq    SAVE
  176.     cmp.b    #ID_USE,d2
  177.     beq    USE
  178.     cmp.b    #ID_RESET,d2
  179.     beq    Reset
  180. Exit    move.l    WindowPointer(pc),a0    ; close window
  181.     CALL_INT    CloseWindow
  182.     move.l    TOPAZ_80(pc),a1
  183.     CALL_GRAF    CloseFont
  184. Error    rts
  185. NoFont    move.l    WindowPointer(pc),a0    ; close window
  186.     CALL_INT    CloseWindow
  187.     rts
  188.  
  189.     
  190.  
  191. WindowData    dc.w    0,0
  192.     dc.w    640,200
  193.     dc.b    -1,-1
  194.     dc.l    CLOSEWINDOW!GADGETUP
  195.     dc.l    WINDOWCLOSE!SMART_REFRESH!ACTIVATE!RMBTRAP!WINDOWDRAG!WINDOWDEPTH
  196.     dc.l    Gadget1
  197.     dc.l    0
  198.     dc.l    .Name
  199.     dc.l    0
  200.     dc.l    0
  201.     dc.w    160,100+11+1
  202.     dc.w    160,100+11+1
  203.     dc.w    WBENCHSCREEN
  204. .Name    dc.b    "FMouse Menu Creator V1.00      © 1990 by  Roger Fischlin",0
  205.     even
  206. WindowPointer    dc.l    0
  207.  
  208. TOPAZ_80    dc.l    0
  209. FONT    dc.l    fontname
  210.     dc.w    TOPAZ_EIGHTY
  211.     dc.b    FS_NORMAL
  212.     dc.b    FPF_ROMFONT
  213.     even
  214. fontname    dc.b    "topaz.font",0
  215.     even
  216.  
  217. FONT_BOLD    dc.l    fontname
  218.     dc.w    TOPAZ_EIGHTY
  219.     dc.b    FSF_BOLD
  220.     dc.b    FPF_ROMFONT
  221.     even
  222. FONT_ITALICS    dc.l    fontname
  223.     dc.w    TOPAZ_EIGHTY
  224.     dc.b    FSF_ITALIC
  225.     dc.b    FPF_ROMFONT
  226.     even
  227.  
  228. FMC_GADGETS    macro            ; marco for Name and Exec Gadget
  229.     dc.l    .Exec\@
  230.     dc.w    10,(\2*12)+40
  231.     dc.w    32*8,10
  232.     dc.w    GADGHCOMP,0,STRGADGET
  233.     dc.l    0,0,0,0,.Info1\@
  234.     dc.w    0
  235.     dc.l    0
  236. .Info1\@    dc.l    LISTE+\2*(32+64)
  237.     dc.l    .Buffer1\@
  238.     dc.w    0,32
  239.     dcb.b    si_SIZEOF-12
  240. .Buffer1\@    dcb.b    32
  241.  
  242. .Exec\@    dc.l    \1
  243.     dc.w    280,(\2*12)+40
  244.     dc.w    640-280-10,10
  245.     dc.w    GADGHCOMP,0,STRGADGET
  246.     dc.l    0,0,0,0,.Info2\@
  247.     dc.w    0
  248.     dc.l    0
  249. .Info2\@    dc.l    LISTE+\2*(32+64)+32
  250.     dc.l    .Buffer2\@
  251.     dc.w    0,64
  252.     dcb.b    si_SIZEOF-12
  253. .Buffer2\@    dcb.b    64
  254.     endm
  255.  
  256. Gadget1    FMC_GADGETS    Gadget2,0        ; gadgets (part 1)
  257. Gadget2    FMC_GADGETS    Gadget3,1
  258. Gadget3    FMC_GADGETS    Gadget4,2
  259. Gadget4    FMC_GADGETS    Gadget5,3
  260. Gadget5    FMC_GADGETS    Gadget6,4
  261. Gadget6    FMC_GADGETS    Gadget7,5
  262. Gadget7    FMC_GADGETS    Gadget8,6
  263. Gadget8    FMC_GADGETS    Gadget9,7
  264. Gadget9    FMC_GADGETS    Gadget10,8
  265.  
  266. FMC_GADGET2    macro            ; marco for gadgets
  267.     dc.l    \1
  268.     dc.w    \2,-20
  269.     dc.w    60,15
  270.     dc.w    GADGIMAGE!GADGHCOMP!GRELBOTTOM,RELVERIFY,BOOLGADGET
  271.     dc.l    .Image1,0,.Text1,0,0
  272.     dc.w    \3
  273.     dc.l    0
  274. .Image1    dc.w    0,0,60,15,2
  275.     dc.l    0
  276.     dc.b    0,1
  277.     dc.l    .Image2
  278. .Image2    dc.w    2,1,60-4,15-2,2
  279.     dc.l    0
  280.     dc.b    0,3
  281.     dc.l    0
  282. .Text1    dc.b    2,0,RP_JAM1,0
  283.     dc.w    (60-(\5*8))/2,((15-8)/2)
  284.     dc.l    FONT,.String,0
  285. .String    dc.b    \4,0
  286.     even
  287.     endm
  288.  
  289.  
  290. Gadget10    FMC_GADGET2    Gadget11,10+0*(60+52),ID_ABOUT,<"About">,5
  291.  
  292. Gadget11    FMC_GADGET2    Gadget12,10+1*(60+52),ID_LOAD,<"Load">,4
  293. Gadget12    FMC_GADGET2    Gadget13,10+2*(60+52),ID_SAVE,<"Save">,4
  294. Gadget13    FMC_GADGET2    Gadget14,10+3*(60+52),ID_USE,<"Use">,3
  295. Gadget14    FMC_GADGET2    Gadget15,10+4*(60+52),ID_RESET,<"Reset">,5
  296. Gadget15    FMC_GADGET2    Gadget16,10+5*(60+52),ID_QUIT,<"Quit">,4
  297.  
  298. Gadget16    dc.l    Gadget17
  299.     dc.w    10+((32-8)*8),-45
  300.     dc.w    8*8,10
  301.     dc.w    GADGHCOMP!GRELBOTTOM,LONGINT,STRGADGET
  302.     dc.l    0,0,0,0,.Info
  303.     dc.w    0
  304.     dc.l    0
  305. .Info    dc.l    SpeedText
  306.     dc.l    .Buffer
  307.     dc.w    0,8
  308.     dcb.b    si_SIZEOF-12
  309. .Buffer    dcb.b    10
  310. SpeedText    dcb.b    10
  311. Gadget17    dc.l    0
  312.     dc.w    640-10-(8*8),-45
  313.     dc.w    8*8,10
  314.     dc.w    GADGHCOMP!GRELBOTTOM,LONGINT,STRGADGET
  315.     dc.l    0,0,0,0,.Info
  316.     dc.w    0
  317.     dc.l    0
  318. .Info    dc.l    BlankText
  319.     dc.l    .Buffer
  320.     dc.w    0,8
  321.     dcb.b    si_SIZEOF-12
  322. .Buffer    dcb.b    10
  323. BlankText    dcb.b    10
  324.     
  325.  
  326. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  327. ; ­­                     data section                       ­­
  328. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  329.  
  330.  
  331. Text_32    Macro
  332. .label1\@    dc.b    \1
  333. .label2\@    ds.b    32-(.label2\@-.label1\@)
  334.     endm
  335. Text_64    Macro
  336. .label1\@    dc.b    \1
  337. .label2\@    ds.b    64-(.label2\@-.label1\@)
  338.     endm
  339.  
  340.     even
  341.  
  342. Version    dc.b    "1.00"
  343.     dc.l    0
  344. SPEED    dc.w    4
  345. Time    dc.l    4*50
  346. LISTE    Text_32    <"1. NewShell">
  347.     Text_64    <"run ",62,"NIL: NewShell">
  348.     Text_32    <"2. NewShell">
  349.     Text_64    <"run ",62,"NIL: NewShell">
  350.     Text_32    <"3. NewShell">
  351.     Text_64    <"run ",62,"NIL: NewShell">
  352.     Text_32    <"4. NewShell">
  353.     Text_64    <"run ",62,"NIL: NewShell">
  354.     Text_32    <"5. NewShell">
  355.     Text_64    <"run ",62,"NIL: NewShell">
  356.     Text_32    <"6. NewShell">
  357.     Text_64    <"run ",62,"NIL: NewShell">
  358.     Text_32    <"7. NewShell">
  359.     Text_64    <"run ",62,"NIL: NewShell">
  360.     Text_32    <"8. NewShell">
  361.     Text_64    <"run ",62,"NIL: NewShell">
  362.     Text_32    <"9. NewShell">
  363.     Text_64    <"run ",62,"NIL: NewShell">
  364. ENDE    Text_32    <"0. Exit">
  365.  
  366.  
  367. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  368. ; ­­                     get libraries                      ­­
  369. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  370.  
  371. GetLibs    lea.l    IntName(pc),a1        ; open libraries
  372.     moveq.l    #33,d0
  373.     CALLEXEC    OpenLibrary
  374.     move.l    d0,_IntuitionBase
  375.     beq.s    .Error
  376.     lea.l    DosName(pc),a1
  377.     moveq.l    #33,d0
  378.     CALLEXEC    OpenLibrary
  379.     move.l    d0,_DOSBase
  380.     beq.s    .Error
  381.     lea.l    GfxName(pc),a1
  382.     moveq.l    #33,d0
  383.     CALLEXEC    OpenLibrary
  384.     move.l    d0,_GfxBase
  385. .Error    rts
  386.  
  387. _IntuitionBase    dc.l    0
  388. _GfxBase    dc.l    0
  389. _DOSBase    dc.l    0
  390.  
  391. IntName    INTNAME
  392. DosName    DOSNAME
  393. GfxName    GRAFNAME
  394.  
  395. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  396. ; ­­                   close libraries                      ­­
  397. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  398.  
  399. CloseLibs    moveq.l    #0,d5        ; close Libraries
  400.     move.l    _IntuitionBase(pc),a1
  401.     cmp.l    a0,d5
  402.     beq.s    .Skip1
  403.     CALLEXEC    CloseLibrary
  404. .Skip1    move.l    _DOSBase(pc),a1
  405.     cmp.l    a0,d5
  406.     beq.s    .Skip2
  407.     CALLEXEC    CloseLibrary
  408. .Skip2    move.l    _GfxBase(pc),a1
  409.     cmp.l    a0,d5
  410.     beq.s    .Skip3
  411.     CALLEXEC    CloseLibrary
  412. .Skip3    rts
  413.     
  414.  
  415. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  416. ; ­­                    get menu entries                    ­­
  417. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  418.  
  419. GetMenu    CALLEXEC    Forbid
  420.     lea.l    PortName(pc),a1
  421.     CALLEXEC    FindPort        ; look for FMouse port
  422.     tst.l    d0
  423.     beq.s    .NotFound
  424.     move.l    d0,a0
  425.     lea.l    Version(pc),a1
  426.     lea.l    MP_SIZE(a0),a0    
  427.     move.w    #ENDE-Version-1,d0    ; copy data
  428. .Loop    move.b    (a0)+,(a1)+
  429.     dbra    d0,.Loop
  430.     CALLEXEC    Permit
  431.     bsr    Write
  432.     lea.l    Gadget1(pc),a0        ; refresh gadgets
  433.     move.l    WindowPointer(pc),a1
  434.     sub.l    a2,a2
  435.     CALL_INT    RefreshGadgets
  436.     moveq.l    #0,d0
  437.     rts
  438. .NotFound    CALLEXEC    Permit
  439.     moveq.l    #-1,d0
  440.     rts
  441.  
  442. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  443. ; ­­                    set menu entries                    ­­
  444. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  445.  
  446. USE    bsr    Read
  447.     CALLEXEC    Forbid
  448.     lea.l    PortName(pc),a1
  449.     CALLEXEC    FindPort        ; look for FMouse port
  450.     tst.l    d0
  451.     beq.s    .NotFound
  452.     move.l    d0,a0
  453.     move.l    d0,a3
  454.     lea.l    Version(pc),a1
  455.     lea.l    MP_SIZE(a0),a0    
  456.     move.w    #ENDE-Version-1,d0    ; copy data
  457. .Loop    move.b    (a1)+,(a0)+
  458.     dbra    d0,.Loop
  459.     tst.l    d0
  460.     bne.s    .Error
  461.     lea.l    Message(pc),a0
  462.     moveq.l    #FMM_SIZEOF-1,d0    ; init structure
  463. .Label2    clr.b    (a0)+
  464.     dbra    d0,.Label2
  465.     
  466.     bsr    InitPort        ; get reply port
  467.     tst.l    d0
  468.     bmi.s    .Error
  469.     lea.l    ReplyPort(pc),a0
  470.     lea.l    Message(pc),a1
  471.     move.b    #NT_MESSAGE,LN_TYPE(a1)
  472.     move.w    #FMM_SIZEOF,MN_LENGTH(a1)
  473.     move.l    a0,MN_REPLYPORT(a1)
  474.     move.b    #FM_NewNames,FMM_Command(a1)
  475.     move.l    a3,a0
  476.     CALLEXEC    PutMsg        ; tell FMouse that menu entries have been changed...
  477.     lea.l    ReplyPort(pc),a0    ; wait for reply
  478.     CALLEXEC    WaitPort
  479.     lea.l    ReplyPort(pc),a0    ; get reply
  480.     CALLEXEC    GetMsg
  481.     bsr    FreePort
  482. .Error    CALLEXEC    Permit
  483.     bra    WAIT
  484.  
  485.  
  486. .NotFound    CALLEXEC    Permit        ; you must run FMouse ....
  487.     lea.l    .Req(pc),a0
  488.     move.l    WindowPointer(pc),a1
  489.     move.w    wd_Width(a1),d0    ; put requester into
  490.     sub.w    #340,d0        ; window centre
  491.     lsr.w    #1,d0
  492.     move.w    d0,rq_LeftEdge(a0)
  493.     move.w    wd_Height(a1),d0
  494.     sub.w    #50,d0
  495.     lsr.w    #1,d0
  496.     move.w    d0,rq_TopEdge(a0)
  497.     move.w    #340,rq_Width(a0)
  498.     move.w    #50,rq_Height(a0)
  499.     move.b    #1,rq_BackFill(a0)
  500.     lea.l    .Gadget(pc),a2
  501.     move.l    a2,rq_ReqGadget(a0)
  502.     lea.l    .Text1(pc),a2
  503.     move.l    a2,rq_ReqText(a0)
  504.     CALL_INT    Request
  505.     move.l    WindowPointer(pc),a0    ; wait for user reply
  506.     move.l    wd_UserPort(a0),a0
  507.     CALLEXEC    WaitPort
  508.     move.l    WindowPointer(pc),a0
  509.     move.l    wd_UserPort(a0),a0
  510.     CALLEXEC    GetMsg
  511.     move.l    d0,a1
  512.     CALLEXEC    ReplyMsg
  513.     bra    WAIT
  514.  
  515. .Req    dcb.b    rq_SIZEOF,0
  516.     even
  517. .Gadget    dc.l    0
  518.     dc.w    (340-60)/2,-20
  519.     dc.w    60,15
  520.     dc.w    GADGHCOMP!GRELBOTTOM,RELVERIFY!ENDGADGET,BOOLGADGET
  521.     dc.l    .Border,0,.GText,0,0
  522.     dc.w    0
  523.     dc.l    0
  524. .Border    dc.w    0,0
  525.     dc.b    3,0,RP_JAM1,5
  526.     dc.l    .XY,0
  527. .XY    dc.w    0,0,59,0,59,14,0,14,0,0    
  528. .GText    dc.b    2,0,RP_JAM1,0
  529.     dc.w    (60-(2*8))/2,((15-8)/2)
  530.     dc.l    FONT,.String,0
  531. .String    dc.b    "OK",0
  532.     even
  533. .Text1    dc.b    2,0,RP_JAM1,0
  534.     dc.w    (340-(20*8))/2,10
  535.     dc.l    FONT_BOLD,.String1,0
  536. .String1    dc.b    "FMouse not running !",0
  537.     even    
  538.     rts
  539.  
  540. Message    dcb.b    FMM_SIZEOF,0
  541.     even
  542. PortName    FM_PORTNAME
  543.  
  544.  
  545. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  546. ; ­­                         About                          ­­
  547. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  548.  
  549. ABOUT    lea.l    .Req(pc),a0
  550.     move.l    WindowPointer(pc),a1
  551.     move.w    wd_Width(a1),d0    ; put requester into
  552.     sub.w    #340,d0        ; window centre
  553.     lsr.w    #1,d0
  554.     move.w    d0,rq_LeftEdge(a0)
  555.     move.w    wd_Height(a1),d0
  556.     sub.w    #125,d0
  557.     lsr.w    #1,d0
  558.     move.w    d0,rq_TopEdge(a0)
  559.     move.w    #340,rq_Width(a0)
  560.     move.w    #125,rq_Height(a0)
  561.     move.b    #1,rq_BackFill(a0)
  562.     lea.l    .Gadget(pc),a2
  563.     move.l    a2,rq_ReqGadget(a0)
  564.     lea.l    .Text1(pc),a2
  565.     move.l    a2,rq_ReqText(a0)
  566.     CALL_INT    Request
  567.     move.l    WindowPointer(pc),a0    ; wait for user reply
  568.     move.l    wd_UserPort(a0),a0
  569.     CALLEXEC    WaitPort
  570.     move.l    WindowPointer(pc),a0
  571.     move.l    wd_UserPort(a0),a0
  572.     CALLEXEC    GetMsg
  573.     move.l    d0,a1
  574.     CALLEXEC    ReplyMsg
  575.     bra    WAIT
  576.  
  577. .Req    dcb.b    rq_SIZEOF,0
  578. .Gadget    dc.l    0
  579.     dc.w    (340-60)/2,-20
  580.     dc.w    60,15
  581.     dc.w    GADGHCOMP!GRELBOTTOM,RELVERIFY!ENDGADGET,BOOLGADGET
  582.     dc.l    .Border,0,.GText,0,0
  583.     dc.w    0
  584.     dc.l    0
  585. .Border    dc.w    0,0
  586.     dc.b    3,0,RP_JAM1,5
  587.     dc.l    .XY,0
  588. .XY    dc.w    0,0,59,0,59,14,0,14,0,0    
  589. .GText    dc.b    2,0,RP_JAM1,0
  590.     dc.w    (60-(2*8))/2,((15-8)/2)
  591.     dc.l    FONT,.String,0
  592. .String    dc.b    "OK",0
  593.     even
  594. .Text1    dc.b    2,0,RP_JAM1,0
  595.     dc.w    (340-(28*8))/2,5
  596.     dc.l    FONT_BOLD,.String1,.Text2
  597. .String1    dc.b    "FMouse & FMouse Menu Creator",0
  598.     even
  599. .Text2    dc.b    0,0,RP_JAM1,0
  600.     dc.w    (340-(28*8))/2,20
  601.     dc.l    FONT,.String2,.Text3
  602. .String2    dc.b    "© 1990 by   Roger Fischlin",0
  603.     even
  604. .Text3    dc.b    0,0,RP_JAM1,0
  605.     dc.w    (340-(28*8))/2,30
  606.     dc.l    FONT,.String3,.Text4
  607. .String3    dc.b    "            Steigerwaldweg 6",0
  608.     even
  609. .Text4    dc.b    0,0,RP_JAM1,0
  610.     dc.w    (340-(28*8))/2,40
  611.     dc.l    FONT,.String4,.Text5
  612. .String4    dc.b    "            D-6450 Hanau 7",0
  613.     even
  614. .Text5    dc.b    0,0,RP_JAM1,0
  615.     dc.w    (340-(28*8))/2,50
  616.     dc.l    FONT,.String5,.Text6
  617. .String5    dc.b    "            West Germany",0
  618.     even
  619. .Text6    dc.b    3,0,RP_JAM1,0
  620.     dc.w    (340-(41*8))/2,70
  621.     dc.l    FONT_ITALICS,.String6,.Text7
  622. .String6    dc.b    "It may be freely distributed if you don't",0
  623.     even
  624. .Text7    dc.b    3,0,RP_JAM1,0
  625.     dc.w    (340-(41*8))/2,80
  626.     dc.l    FONT_ITALICS,.String7,0
  627. .String7    dc.b    "gain any profit by using/distributing it!",0
  628.     even 
  629.  
  630.  
  631. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  632. ; ­­                          Load                          ­­
  633. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  634.  
  635. LOAD    lea    .arpname(pc),a1    ; try to open arp
  636.     moveq.l    #0,d0
  637.     CALLEXEC     OpenLibrary
  638.     tst.l    d0
  639.     beq    .NoArp
  640.     move.l    d0,a6
  641.  
  642.     lea.l    .FR(pc),a0
  643.     move.l    WindowPointer(pc),12(a0)
  644.     jsr    -294(a6)        ; file requester
  645.     move.l    d0,d5
  646.     move.l    a6,a1
  647.     CALLEXEC    CloseLibrary
  648.     tst.l    d5
  649.     beq    WAIT
  650.     lea.l    .Dir(pc),a0
  651.     move.l    a0,d1
  652.     moveq.l    #ACCESS_READ,d2
  653.     CALL_DOS    Lock
  654.     move.l    d0,d1
  655.     beq    .Error
  656.     CALL_DOS    CurrentDir        ; set current dir
  657.     move.l    d0,d6
  658.     lea.l    .File(pc),a0
  659.     move.l    a0,d1
  660.     move.l    #MODE_OLDFILE,d2
  661.     CALL_DOS    Open        ; open file
  662.     move.l    d0,d5
  663.     beq.s    .Error2
  664.     move.l    d0,d1
  665.     move.l    #SPEED,d2
  666.     move.l    #ENDE-SPEED,d3
  667.     CALL_DOS    Read        ; read file
  668.     move.l    d5,d1
  669.     CALL_DOS    Close
  670.     move.l    d6,d0        ; restore dir
  671.     CALL_DOS    CurrentDir
  672.     CALL_DOS    UnLock        ; free lock
  673.     bsr    Write
  674.     lea.l    Gadget1(pc),a0
  675.     move.l    WindowPointer(pc),a1
  676.     sub.l    a2,a2
  677.     CALL_INT    RefreshGadgets
  678.     bra    WAIT
  679.  
  680. .Error2    move.l    d6,d0        ; restore dir
  681.     CALL_DOS    CurrentDir
  682.     CALL_DOS    UnLock        ; free lock
  683. .Error    lea.l    .Req(pc),a0
  684.     move.l    WindowPointer(pc),a1
  685.     move.w    wd_Width(a1),d0    ; put requester into
  686.     sub.w    #340,d0        ; window centre
  687.     lsr.w    #1,d0
  688.     move.w    d0,rq_LeftEdge(a0)
  689.     move.w    wd_Height(a1),d0
  690.     sub.w    #50,d0
  691.     lsr.w    #1,d0
  692.     move.w    d0,rq_TopEdge(a0)
  693.     move.w    #340,rq_Width(a0)
  694.     move.w    #50,rq_Height(a0)
  695.     move.b    #1,rq_BackFill(a0)
  696.     lea.l    .Gadget(pc),a2
  697.     move.l    a2,rq_ReqGadget(a0)
  698.     lea.l    .Text1(pc),a2
  699.     move.l    a2,rq_ReqText(a0)
  700.     CALL_INT    Request
  701.     move.l    WindowPointer(pc),a0    ; wait for user reply
  702.     move.l    wd_UserPort(a0),a0
  703.     CALLEXEC    WaitPort
  704.     move.l    WindowPointer(pc),a0
  705.     move.l    wd_UserPort(a0),a0
  706.     CALLEXEC    GetMsg
  707.     move.l    d0,a1
  708.     CALLEXEC    ReplyMsg
  709.     bra    WAIT
  710.  
  711. .Req    dcb.b    rq_SIZEOF,0
  712.     even
  713. .Gadget    dc.l    0
  714.     dc.w    (340-60)/2,-20
  715.     dc.w    60,15
  716.     dc.w    GADGHCOMP!GRELBOTTOM,RELVERIFY!ENDGADGET,BOOLGADGET
  717.     dc.l    .Border,0,.GText,0,0
  718.     dc.w    0
  719.     dc.l    0
  720. .Border    dc.w    0,0
  721.     dc.b    3,0,RP_JAM1,5
  722.     dc.l    .XY,0
  723. .XY    dc.w    0,0,59,0,59,14,0,14,0,0    
  724. .GText    dc.b    2,0,RP_JAM1,0
  725.     dc.w    (60-(2*8))/2,((15-8)/2)
  726.     dc.l    FONT,.String,0
  727. .String    dc.b    "OK",0
  728.     even
  729. .Text1    dc.b    2,0,RP_JAM1,0
  730.     dc.w    (340-(28*8))/2,10
  731.     dc.l    FONT_BOLD,.String1,0
  732. .String1    dc.b    "DOS error : file not found !",0
  733.     even
  734.  
  735. .arpname    dc.b    "arp.library",0
  736.     even
  737.  
  738. .FR    dc.l    .Title,.File,.Dir,0
  739.     dc.b    0,0
  740.     dc.l    0,0
  741.     
  742. .Title    dc.b    "Load FMouse data file :                      ",0
  743.     even
  744. .Dir    dcb.b    34,0
  745.     even
  746. .File    dcb.b    34,0
  747.     even
  748.  
  749. .NoArp    lea.l    .Req2(pc),a0
  750.     move.l    WindowPointer(pc),a1
  751.     move.w    wd_Width(a1),d0    ; put requester into
  752.     sub.w    #340,d0        ; window centre
  753.     lsr.w    #1,d0
  754.     move.w    d0,rq_LeftEdge(a0)
  755.     move.w    wd_Height(a1),d0
  756.     sub.w    #70,d0
  757.     lsr.w    #1,d0
  758.     move.w    d0,rq_TopEdge(a0)
  759.     move.w    #340,rq_Width(a0)
  760.     move.w    #70,rq_Height(a0)
  761.     move.b    #1,rq_BackFill(a0)
  762.     lea.l    .GadgetOK(pc),a2
  763.     move.l    a2,rq_ReqGadget(a0)
  764.     lea.l    .Text2(pc),a2
  765.     move.l    a2,rq_ReqText(a0)
  766.     CALL_INT    Request
  767.     move.l    WindowPointer(pc),a0    ; wait for user reply
  768.     move.l    wd_UserPort(a0),a0
  769.     CALLEXEC    WaitPort
  770.     move.l    WindowPointer(pc),a0
  771.     move.l    wd_UserPort(a0),a0
  772.     CALLEXEC    GetMsg
  773.     move.l    d0,a1
  774.     move.l    im_IAddress(a1),a2
  775.     CALLEXEC    ReplyMsg
  776.     move.w    gg_GadgetID(a2),d0
  777.     bne    WAIT
  778.     lea.l    .FILE(pc),a0
  779.     move.l    a0,d1
  780.     move.l    #MODE_OLDFILE,d2
  781.     CALL_DOS    Open        ; open file
  782.     move.l    d0,d5
  783.     beq    .Error
  784.     move.l    d0,d1
  785.     move.l    #SPEED,d2
  786.     move.l    #ENDE-SPEED,d3
  787.     CALL_DOS    Read        ; read file
  788.     move.l    d5,d1
  789.     CALL_DOS    Close
  790.     bsr    Write
  791.     lea.l    Gadget1(pc),a0
  792.     move.l    WindowPointer(pc),a1
  793.     sub.l    a2,a2
  794.     CALL_INT    RefreshGadgets
  795.     bra    WAIT    
  796.  
  797. .Req2    dcb.b    rq_SIZEOF,0
  798.     even
  799. .GadgetOK    dc.l    .GadgetCancel
  800.     dc.w    20,-20
  801.     dc.w    60,15
  802.     dc.w    GADGHCOMP!GRELBOTTOM,RELVERIFY!ENDGADGET,BOOLGADGET
  803.     dc.l    .Border,0,.GTextOK,0,0
  804.     dc.w    0
  805.     dc.l    0
  806. .GTextOK    dc.b    2,0,RP_JAM1,0
  807.     dc.w    (60-(2*8))/2,((15-8)/2)
  808.     dc.l    FONT,.StringOK,0
  809. .StringOK    dc.b    "OK",0
  810.     even
  811. .GadgetCancel    dc.l    .STGadget
  812.     dc.w    -60-20,-20
  813.     dc.w    60,15
  814.     dc.w    GADGHCOMP!GRELBOTTOM!GRELRIGHT,RELVERIFY!ENDGADGET,BOOLGADGET
  815.     dc.l    .Border,0,.GTextCancel,0,0
  816.     dc.w    1
  817.     dc.l    0
  818. .GTextCancel    dc.b    2,0,RP_JAM1,0
  819.     dc.w    (60-(6*8))/2,((15-8)/2)
  820.     dc.l    FONT,.StringCancel,0
  821. .StringCancel    dc.b    "Cancel",0
  822.     even
  823. .STGadget    dc.l    0
  824.     dc.w    10,30
  825.     dc.w    320,10
  826.     dc.w    GADGHCOMP,RELVERIFY!STRINGCENTER!ENDGADGET,STRGADGET
  827.     dc.l    0,0,0,0,.Info
  828.     dc.w    0
  829.     dc.l    0
  830. .Info    dc.l    .FILE
  831.     dc.l    .Buffer
  832.     dc.w    0,78
  833.     dcb.b    si_SIZEOF-12
  834. .Buffer    dcb.b    80
  835. .FILE    dcb.b    80
  836.  
  837. .Text2    dc.b    2,0,RP_JAM1,0
  838.     dc.w    (340-(21*8))/2,10
  839.     dc.l    FONT_BOLD,.String2,0
  840. .String2    dc.b    "Load FMouse Data file",0
  841.     even
  842. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  843. ; ­­                          Save                          ­­
  844. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  845.  
  846. SAVE    bsr    Read
  847.     lea    .arpname(pc),a1    ; try to open arp
  848.     moveq.l    #0,d0
  849.     CALLEXEC     OpenLibrary
  850.     tst.l    d0
  851.     beq    .NoArp
  852.     move.l    d0,a6
  853.  
  854.     lea.l    .FR(pc),a0
  855.     move.l    WindowPointer(pc),12(a0)
  856.     jsr    -294(a6)        ; file requester
  857.     move.l    d0,d5
  858.     move.l    a6,a1
  859.     CALLEXEC    CloseLibrary
  860.     tst.l    d5
  861.     beq    WAIT
  862.     lea.l    .Dir(pc),a0
  863.     move.l    a0,d1
  864.     moveq.l    #ACCESS_READ,d2
  865.     CALL_DOS    Lock
  866.     move.l    d0,d1
  867.     beq.s    .Error
  868.     CALL_DOS    CurrentDir        ; set current dir
  869.     move.l    d0,d6
  870.     lea.l    .File(pc),a0
  871.     move.l    a0,d1
  872.     move.l    #MODE_NEWFILE,d2
  873.     CALL_DOS    Open        ; open file
  874.     move.l    d0,d5
  875.     beq.s    .Error2
  876.     move.l    d0,d1
  877.     move.l    #SPEED,d2
  878.     move.l    #ENDE-SPEED,d3
  879.     CALL_DOS    Write        ; write file
  880.     move.l    d5,d1
  881.     CALL_DOS    Close
  882.     move.l    d6,d0        ; restore dir
  883.     CALL_DOS    CurrentDir
  884.     CALL_DOS    UnLock        ; free lock
  885.     bra    WAIT
  886.  
  887. .Error2    move.l    d6,d0        ; restore dir
  888.     CALL_DOS    CurrentDir
  889.     CALL_DOS    UnLock        ; free lock
  890. .Error    lea.l    .Req(pc),a0
  891.     move.l    WindowPointer(pc),a1
  892.     move.w    wd_Width(a1),d0    ; put requester into
  893.     sub.w    #340,d0        ; window centre
  894.     lsr.w    #1,d0
  895.     move.w    d0,rq_LeftEdge(a0)
  896.     move.w    wd_Height(a1),d0
  897.     sub.w    #50,d0
  898.     lsr.w    #1,d0
  899.     move.w    d0,rq_TopEdge(a0)
  900.     move.w    #340,rq_Width(a0)
  901.     move.w    #50,rq_Height(a0)
  902.     move.b    #1,rq_BackFill(a0)
  903.     lea.l    .Gadget(pc),a2
  904.     move.l    a2,rq_ReqGadget(a0)
  905.     lea.l    .Text1(pc),a2
  906.     move.l    a2,rq_ReqText(a0)
  907.     CALL_INT    Request
  908.     move.l    WindowPointer(pc),a0    ; wait for user reply
  909.     move.l    wd_UserPort(a0),a0
  910.     CALLEXEC    WaitPort
  911.     move.l    WindowPointer(pc),a0
  912.     move.l    wd_UserPort(a0),a0
  913.     CALLEXEC    GetMsg
  914.     move.l    d0,a1
  915.     CALLEXEC    ReplyMsg
  916.     bra    WAIT
  917.  
  918. .Req    dcb.b    rq_SIZEOF,0
  919.     even
  920. .Gadget    dc.l    0
  921.     dc.w    (340-60)/2,-20
  922.     dc.w    60,15
  923.     dc.w    GADGHCOMP!GRELBOTTOM,RELVERIFY!ENDGADGET,BOOLGADGET
  924.     dc.l    .Border,0,.GText,0,0
  925.     dc.w    0
  926.     dc.l    0
  927. .Border    dc.w    0,0
  928.     dc.b    3,0,RP_JAM1,5
  929.     dc.l    .XY,0
  930. .XY    dc.w    0,0,59,0,59,14,0,14,0,0    
  931. .GText    dc.b    2,0,RP_JAM1,0
  932.     dc.w    (60-(2*8))/2,((15-8)/2)
  933.     dc.l    FONT,.String,0
  934. .String    dc.b    "OK",0
  935.     even
  936. .Text1    dc.b    2,0,RP_JAM1,0
  937.     dc.w    (340-(25*8))/2,10
  938.     dc.l    FONT_BOLD,.String1,0
  939. .String1    dc.b    "DOS error : open failed !",0
  940.     even
  941.  
  942. .arpname    dc.b    "arp.library",0
  943.     even
  944.  
  945. .FR    dc.l    .Title,.File,.Dir,0
  946.     dc.b    0,0
  947.     dc.l    0,0
  948.     
  949. .Title    dc.b    "Save FMouse data file :                      ",0
  950.     even
  951. .Dir    dcb.b    34,0
  952.     even
  953. .File    dcb.b    34,0
  954.     even
  955.  
  956. .NoArp    lea.l    .Req2(pc),a0
  957.     move.l    WindowPointer(pc),a1
  958.     move.w    wd_Width(a1),d0    ; put requester into
  959.     sub.w    #340,d0        ; window centre
  960.     lsr.w    #1,d0
  961.     move.w    d0,rq_LeftEdge(a0)
  962.     move.w    wd_Height(a1),d0
  963.     sub.w    #70,d0
  964.     lsr.w    #1,d0
  965.     move.w    d0,rq_TopEdge(a0)
  966.     move.w    #340,rq_Width(a0)
  967.     move.w    #70,rq_Height(a0)
  968.     move.b    #1,rq_BackFill(a0)
  969.     lea.l    .GadgetOK(pc),a2
  970.     move.l    a2,rq_ReqGadget(a0)
  971.     lea.l    .Text2(pc),a2
  972.     move.l    a2,rq_ReqText(a0)
  973.     CALL_INT    Request
  974.     move.l    WindowPointer(pc),a0    ; wait for user reply
  975.     move.l    wd_UserPort(a0),a0
  976.     CALLEXEC    WaitPort
  977.     move.l    WindowPointer(pc),a0
  978.     move.l    wd_UserPort(a0),a0
  979.     CALLEXEC    GetMsg
  980.     move.l    d0,a1
  981.     move.l    im_IAddress(a1),a2
  982.     CALLEXEC    ReplyMsg
  983.     move.w    gg_GadgetID(a2),d0
  984.     bne    WAIT
  985.     lea.l    .FILE(pc),a0
  986.     move.l    a0,d1
  987.     move.l    #MODE_NEWFILE,d2
  988.     CALL_DOS    Open        ; open file
  989.     move.l    d0,d5
  990.     beq    .Error
  991.     move.l    d0,d1
  992.     move.l    #SPEED,d2
  993.     move.l    #ENDE-SPEED,d3
  994.     CALL_DOS    Write        ; write data
  995.     move.l    d5,d1
  996.     CALL_DOS    Close
  997.     bra    WAIT    
  998.  
  999. .Req2    dcb.b    rq_SIZEOF,0
  1000.     even
  1001. .GadgetOK    dc.l    .GadgetCancel
  1002.     dc.w    20,-20
  1003.     dc.w    60,15
  1004.     dc.w    GADGHCOMP!GRELBOTTOM,RELVERIFY!ENDGADGET,BOOLGADGET
  1005.     dc.l    .Border,0,.GTextOK,0,0
  1006.     dc.w    0
  1007.     dc.l    0
  1008. .GTextOK    dc.b    2,0,RP_JAM1,0
  1009.     dc.w    (60-(2*8))/2,((15-8)/2)
  1010.     dc.l    FONT,.StringOK,0
  1011. .StringOK    dc.b    "OK",0
  1012.     even
  1013. .GadgetCancel    dc.l    .STGadget
  1014.     dc.w    -60-20,-20
  1015.     dc.w    60,15
  1016.     dc.w    GADGHCOMP!GRELBOTTOM!GRELRIGHT,RELVERIFY!ENDGADGET,BOOLGADGET
  1017.     dc.l    .Border,0,.GTextCancel,0,0
  1018.     dc.w    1
  1019.     dc.l    0
  1020. .GTextCancel    dc.b    2,0,RP_JAM1,0
  1021.     dc.w    (60-(6*8))/2,((15-8)/2)
  1022.     dc.l    FONT,.StringCancel,0
  1023. .StringCancel    dc.b    "Cancel",0
  1024.     even
  1025. .STGadget    dc.l    0
  1026.     dc.w    10,30
  1027.     dc.w    320,10
  1028.     dc.w    GADGHCOMP,RELVERIFY!STRINGCENTER!ENDGADGET,STRGADGET
  1029.     dc.l    0,0,0,0,.Info
  1030.     dc.w    0
  1031.     dc.l    0
  1032. .Info    dc.l    .FILE
  1033.     dc.l    .Buffer
  1034.     dc.w    0,78
  1035.     dcb.b    si_SIZEOF-12
  1036. .Buffer    dcb.b    80
  1037. .FILE    dcb.b    80
  1038.  
  1039. .Text2    dc.b    2,0,RP_JAM1,0
  1040.     dc.w    (340-(21*8))/2,10
  1041.     dc.l    FONT_BOLD,.String2,0
  1042. .String2    dc.b    "Save FMouse Data file",0
  1043.     even
  1044.  
  1045.  
  1046. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1047. ; ­­                        reset                           ­­ 
  1048. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1049.  
  1050. Reset    bsr    GetMenu        ; try to get FMouse menu
  1051.     tst.l    d0
  1052.     beq.s    .FMouse
  1053.     lea.l    Version(pc),a1
  1054.     lea.l    .Version(pc),a0    
  1055.     move.w    #ENDE-Version-1,d0    ; copy data
  1056. .Loop    move.b    (a0)+,(a1)+
  1057.     dbra    d0,.Loop
  1058.     bsr    Write
  1059. .FMouse    lea.l    Gadget1(pc),a0        ; refresh gadgets
  1060.     move.l    WindowPointer(pc),a1
  1061.     sub.l    a2,a2
  1062.     CALL_INT    RefreshGadgets
  1063.     bra    WAIT
  1064.  
  1065.  
  1066. .Version    dc.b    "1.00"
  1067.     dc.l    0
  1068. .SPEED    dc.w    4
  1069. .Time    dc.l    4*50
  1070. .LISTE    Text_32    <"1. NewShell">
  1071.     Text_64    <"run ",62,"NIL: NewShell">
  1072.     Text_32    <"2. NewShell">
  1073.     Text_64    <"run ",62,"NIL: NewShell">
  1074.     Text_32    <"3. NewShell">
  1075.     Text_64    <"run ",62,"NIL: NewShell">
  1076.     Text_32    <"4. NewShell">
  1077.     Text_64    <"run ",62,"NIL: NewShell">
  1078.     Text_32    <"5. NewShell">
  1079.     Text_64    <"run ",62,"NIL: NewShell">
  1080.     Text_32    <"6. NewShell">
  1081.     Text_64    <"run ",62,"NIL: NewShell">
  1082.     Text_32    <"7. NewShell">
  1083.     Text_64    <"run ",62,"NIL: NewShell">
  1084.     Text_32    <"8. NewShell">
  1085.     Text_64    <"run ",62,"NIL: NewShell">
  1086.     Text_32    <"9. NewShell">
  1087.     Text_64    <"run ",62,"NIL: NewShell">
  1088. .ENDE    Text_32    <"0. Exit">
  1089.  
  1090. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1091. ; ­­              write Speed & Blank delay                 ­­ 
  1092. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1093.  
  1094. Write    moveq.l    #0,d0
  1095.     move.w    SPEED(pc),d0
  1096.     lea.l    SpeedText(pc),a0
  1097.     bsr    MakeZahl
  1098.     move.l    Time(pc),d0
  1099.     lea.l    BlankText(pc),a0
  1100.  
  1101. MakeZahl    moveq.l    #6,d2
  1102.     moveq.l    #0,d3
  1103.     lea.l    .Potenzen(pc),a1
  1104. .MZ1    move.b    #"0"-1,d1
  1105. .MZ2    addq    #1,d1
  1106.     sub.l    (a1),d0
  1107.     bcc.s    .MZ2
  1108.     add.l    (a1)+,d0
  1109.     tst.b    d2
  1110.     beq.s    .MZ3
  1111.     cmp.b    #"0",d1
  1112.     beq.s    .MZ4
  1113.     moveq.l    #1,d3
  1114.     bra.s    .MZ3
  1115. .MZ4    tst.b    d3
  1116.     beq.s    .MZ5
  1117. .MZ3    move.b    d1,(a0)+
  1118. .MZ5    dbra    d2,.MZ1
  1119.     clr.b    (a0)
  1120.     rts
  1121. .Potenzen    dc.l    1000000
  1122.     dc.l    100000
  1123.     dc.l    10000
  1124.     dc.l    1000
  1125.     dc.l    100
  1126.     dc.l    10
  1127.     dc.l    1
  1128.  
  1129.  
  1130. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1131. ; ­­              write Speed & Blank delay                 ­­ 
  1132. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1133.  
  1134.  
  1135.  
  1136. Read    lea.l    SpeedText(pc),a0
  1137.     bsr    GetZahl
  1138.     tst.w    d0
  1139.     bne.s    .Label1
  1140.     moveq.l    #1,d0
  1141. .Label1    move.w    d0,SPEED
  1142.     lea.l    BlankText(pc),a0
  1143.     bsr    GetZahl
  1144.     move.l    d0,Time
  1145.     rts
  1146.  
  1147. GetZahl    move.l    a0,a1
  1148.     lea.l    .Potenzen-8(pc),a2
  1149.     moveq.l    #0,d0
  1150. .label7    addq.l    #4,a2
  1151.     tst.b    (a0)+
  1152.     bne.s    .label7
  1153.     subq.l    #1,a0
  1154. .label8    move.b    -(a0),d1
  1155.     cmp.l    a1,a0
  1156.     bge.s    .label9
  1157.     rts
  1158. .label9    sub.b    #"0",d1
  1159.     tst.b    d1
  1160.     beq.s    .label8
  1161.     subq    #1,d1
  1162.     and.l    #15,d1
  1163. .label11    add.l    (a2),d0
  1164.     dbra    d1,.label11
  1165.     bra.s    .label8
  1166.             
  1167. .Potenzen    dc.l    1
  1168.     dc.l    10
  1169.     dc.l    100
  1170.     dc.l    1000
  1171.     dc.l    10000
  1172.     dc.l    100000
  1173.     dc.l    1000000
  1174.     dc.l    10000000
  1175.     dc.l    100000000
  1176.     dc.l    1000000000
  1177.  
  1178.     
  1179. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1180. ; ­­                      Init Port                         ­­
  1181. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1182.  
  1183. InitPort    sub.l    a1,a1        ; get task
  1184.     CALLEXEC    FindTask
  1185.     move.l    d0,d2
  1186.     moveq.l    #-1,d0        ; get signal
  1187.     CALLEXEC    AllocSignal
  1188.     tst.l    d0
  1189.     bmi.s    .Error
  1190.     lea.l    ReplyPort(pc),a1    ; init port
  1191.     move.b    #PA_SIGNAL,MP_FLAGS(a1)
  1192.     move.l    d2,MP_SIGTASK(a1)
  1193.     move.b    d0,MP_SIGBIT(a1)
  1194.     move.b    #NT_MSGPORT,LN_TYPE(a1)
  1195.     moveq.l    #0,d0
  1196. .Error    rts
  1197.  
  1198. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1199. ; ­­                       Free Port                        ­­
  1200. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1201.  
  1202. FreePort    lea.l    ReplyPort(pc),a1    ; free signal
  1203.     moveq.l    #0,d0
  1204.     move.b    MP_SIGBIT(a1),d0
  1205.     CALLEXEC    FreeSignal
  1206.     rts
  1207.  
  1208. ReplyPort    dcb.b    MP_SIZE,0
  1209.     even
  1210.  
  1211.  
  1212. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1213. ; ­­                       write text                       ­­
  1214. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1215.  
  1216. WriteText    move.l    WindowPointer(pc),a0
  1217.     move.l    wd_RPort(a0),a0
  1218.     lea.l    .Text1(pc),a1
  1219.     moveq.l    #0,d0
  1220.     moveq.l    #0,d1
  1221.     CALL_INT    PrintIText
  1222.     rts
  1223.  
  1224. .Text1    dc.b    3,0,RP_JAM1,0
  1225.     dc.w    10,25
  1226.     dc.l    FONT,.String1,.Text2
  1227. .String1    dc.b    "Menu Entry :",0
  1228.     even
  1229. .Text2    dc.b    3,0,RP_JAM1,0
  1230.     dc.w    280,25
  1231.     dc.l    FONT,.String2,.Text3
  1232. .String2    dc.b    "Execute :",0
  1233.     even
  1234. .Text3    dc.b    3,0,RP_JAM1,0
  1235.     dc.w    10,200-45
  1236.     dc.l    FONT,.String3,.Text4
  1237. .String3    dc.b    "Mouse Acceleration :",0
  1238.     even
  1239. .Text4    dc.b    3,0,RP_JAM1,0
  1240.     dc.w    280,200-45
  1241.     dc.l    FONT,.String4,0
  1242. .String4    dc.b    "Screen Blanker (50 = 1 sec) :",0
  1243.     even
  1244.  
  1245.