home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Emulatoren / frodo_14.lha / src / FrodoPrefs.s < prev    next >
Encoding:
Text File  |  1995-02-18  |  18.5 KB  |  858 lines

  1.     XDEF    PrefsNGads
  2. *
  3. *  Source machine generated by GadToolsBox V2.0b
  4. *  which is (c) Copyright 1991-1993 Jaba Development
  5. *
  6. *  GUI Designed by : Christian Bauer
  7. *
  8.  
  9.     include 'exec/types.i'
  10.     include 'intuition/intuition.i'
  11.     include 'intuition/classes.i'
  12.     include 'intuition/classusr.i'
  13.     include 'intuition/imageclass.i'
  14.     include 'intuition/gadgetclass.i'
  15.     include 'libraries/gadtools.i'
  16.     include 'graphics/displayinfo.i'
  17.     include 'graphics/gfxbase.i'
  18.  
  19.     XREF    _GadToolsBase
  20.     XREF    _IntuitionBase
  21.     XREF    _GfxBase
  22.     XREF    _SysBase
  23.     XREF    _UtilityBase
  24.  
  25.     XREF    _LVOOpenScreenTagList
  26.     XREF    _LVOOpenWindowTagList
  27.     XREF    _LVOCloseScreen
  28.     XREF    _LVOCloseWindow
  29.     XREF    _LVOPrintIText
  30.     XREF    _LVOLockPubScreen
  31.     XREF    _LVOUnlockPubScreen
  32.     XREF    _LVOSetMenuStrip
  33.     XREF    _LVOClearMenuStrip
  34.     XREF    _LVOGetVisualInfoA
  35.     XREF    _LVOFreeVisualInfo
  36.     XREF    _LVOCreateContext
  37.     XREF    _LVOCreateGadgetA
  38.     XREF    _LVOGT_RefreshWindow
  39.     XREF    _LVOFreeGadgets
  40.     XREF    _LVOCreateMenusA
  41.     XREF    _LVOLayoutMenusA
  42.     XREF    _LVOFreeMenus
  43.     XREF    _LVOOpenDiskFont
  44.     XREF    _LVOCloseFont
  45.     XREF    _LVODrawBevelBoxA
  46.     XREF    _LVOFreeClass
  47.     XREF    _LVONewObjectA
  48.     XREF    _LVODisposeObject
  49.     XREF    _LVOTextLength
  50.     XREF    _LVOCopyMem
  51.     XREF    _LVOFindTagItem
  52.     XREF    _LVOIntuiTextLength
  53.     XREF    _LVOForbid
  54.     XREF    _LVOPermit
  55.  
  56. GD_OK                                  EQU    0
  57. GD_Cancel                              EQU    1
  58. GD_Save                                EQU    2
  59. GD_Joystick1On                         EQU    3
  60. GD_Joystick2On                         EQU    4
  61. GD_JoystickSwap                        EQU    5
  62. GD_GetDisplayID                        EQU    6
  63. GD_DisplayID                           EQU    7
  64. GD_ScreenType                          EQU    8
  65. GD_NormalCycles                        EQU    9
  66. GD_BadLineCycles                       EQU    10
  67. GD_CIACycles                           EQU    11
  68. GD_Dir8                                EQU    12
  69. GD_Dir9                                EQU    13
  70. GD_Dir10                               EQU    14
  71. GD_Dir11                               EQU    15
  72. GD_UseSIDCard                          EQU    16
  73. GD_Drv8IsIEC                           EQU    17
  74. GD_Drv9IsIEC                           EQU    18
  75. GD_Drv10IsIEC                          EQU    19
  76. GD_Drv11IsIEC                          EQU    20
  77. GD_GetDir8                             EQU    21
  78. GD_GetDir9                             EQU    22
  79. GD_GetDir10                            EQU    23
  80. GD_GetDir11                            EQU    24
  81. GD_OtherIEC                            EQU    25
  82. GD_KeyboardYZ                          EQU    26
  83. GD_Collisions                          EQU    27
  84. GD_MapSlash                            EQU    28
  85. GD_FastReset                           EQU    29
  86. GD_SkipLatch                           EQU    30
  87.  
  88. Prefs_CNT    EQU    31
  89.  
  90.     XDEF    Scr
  91.     XDEF    VisualInfo
  92.     XDEF    PubScreenName
  93.     XDEF    PrefsWnd
  94.     XDEF    PrefsGList
  95.     XDEF    PrefsGadgets
  96.     XDEF    getClass
  97.     XDEF    getImage
  98.     XREF    initGet
  99.     XDEF    PrefsLeft
  100.     XDEF    PrefsTop
  101.     XDEF    PrefsWidth
  102.     XDEF    PrefsHeight
  103.     XDEF    Font
  104.     XDEF    Attr
  105.     XDEF    FontX
  106.     XDEF    FontY
  107.     XDEF    OffX
  108.     XDEF    OffY
  109.  
  110. Scr:
  111.     DC.L    0
  112. VisualInfo:
  113.     DC.L    0
  114. PubScreenName:
  115.     DC.L    WBName
  116. WBName:
  117.     DC.B    'Workbench',0
  118.     CNOP  0,2
  119. PrefsWnd:
  120.     DC.L    0
  121. PrefsGList:
  122.     DC.L    0
  123. PrefsGadgets:
  124.     DCB.L    31,0
  125. BufNewGad:
  126.     DC.W    0,0,0,0
  127.     DC.L    0,0
  128.     DC.W    0
  129.     DC.L    0,0,0
  130. TD:
  131.     DC.L    TAG_DONE
  132. getClass:
  133.     DC.L    0
  134. getImage:
  135.     DC.L    0
  136. CL:
  137.     DC.L    GT_VisualInfo,0,TAG_DONE
  138. PrefsLeft:
  139.     DC.W    0
  140. PrefsTop:
  141.     DC.W    11
  142. PrefsWidth:
  143.     DC.W    632
  144. PrefsHeight:
  145.     DC.W    193
  146. Font:
  147.     DC.L    0
  148. FontX:
  149.     DC.W    0
  150. FontY:
  151.     DC.W    0
  152. OffX:
  153.     DC.W    0
  154. OffY:
  155.     DC.W    0
  156. Attr:
  157.     DC.L    0
  158.     DC.W    0
  159.     DC.B    0,0
  160. TopazName:
  161.     DC.B    'topaz.font',0
  162.     CNOP    0,2
  163.  
  164. PrefsGTypes:
  165.     DC.W    BUTTON_KIND
  166.     DC.W    BUTTON_KIND
  167.     DC.W    BUTTON_KIND
  168.     DC.W    CHECKBOX_KIND
  169.     DC.W    CHECKBOX_KIND
  170.     DC.W    CHECKBOX_KIND
  171.     DC.W    BUTTON_KIND
  172.     DC.W    TEXT_KIND
  173.     DC.W    CYCLE_KIND
  174.     DC.W    INTEGER_KIND
  175.     DC.W    INTEGER_KIND
  176.     DC.W    INTEGER_KIND
  177.     DC.W    STRING_KIND
  178.     DC.W    STRING_KIND
  179.     DC.W    STRING_KIND
  180.     DC.W    STRING_KIND
  181.     DC.W    CHECKBOX_KIND
  182.     DC.W    CHECKBOX_KIND
  183.     DC.W    CHECKBOX_KIND
  184.     DC.W    CHECKBOX_KIND
  185.     DC.W    CHECKBOX_KIND
  186.     DC.W    GENERIC_KIND
  187.     DC.W    GENERIC_KIND
  188.     DC.W    GENERIC_KIND
  189.     DC.W    GENERIC_KIND
  190.     DC.W    CHECKBOX_KIND
  191.     DC.W    CHECKBOX_KIND
  192.     DC.W    CHECKBOX_KIND
  193.     DC.W    CHECKBOX_KIND
  194.     DC.W    CHECKBOX_KIND
  195.     DC.W    INTEGER_KIND
  196.  
  197. PrefsNGads:
  198.     DC.W    84,171,101,16
  199.     DC.L    OKText,0
  200.     DC.W    GD_OK
  201.     DC.L    PLACETEXT_IN,0,0
  202.     DC.W    443,171,101,16
  203.     DC.L    CancelText,0
  204.     DC.W    GD_Cancel
  205.     DC.L    PLACETEXT_IN,0,0
  206.     DC.W    263,171,101,16
  207.     DC.L    SaveText,0
  208.     DC.W    GD_Save
  209.     DC.L    PLACETEXT_IN,0,0
  210.     DC.W    188,71,26,11
  211.     DC.L    Joystick1OnText,0
  212.     DC.W    GD_Joystick1On
  213.     DC.L    PLACETEXT_LEFT,0,0
  214.     DC.W    188,84,26,11
  215.     DC.L    Joystick2OnText,0
  216.     DC.W    GD_Joystick2On
  217.     DC.L    PLACETEXT_LEFT,0,0
  218.     DC.W    188,97,26,11
  219.     DC.L    JoystickSwapText,0
  220.     DC.W    GD_JoystickSwap
  221.     DC.L    PLACETEXT_LEFT,0,0
  222.     DC.W    377,117,193,14
  223.     DC.L    GetDisplayIDText,0
  224.     DC.W    GD_GetDisplayID
  225.     DC.L    0,0,0
  226.     DC.W    377,131,193,14
  227.     DC.L    DisplayIDText,0
  228.     DC.W    GD_DisplayID
  229.     DC.L    PLACETEXT_LEFT,0,0
  230.     DC.W    377,147,143,14
  231.     DC.L    ScreenTypeText,0
  232.     DC.W    GD_ScreenType
  233.     DC.L    PLACETEXT_LEFT,0,0
  234.     DC.W    188,6,81,14
  235.     DC.L    NormalCyclesText,0
  236.     DC.W    GD_NormalCycles
  237.     DC.L    PLACETEXT_LEFT,0,0
  238.     DC.W    188,22,81,14
  239.     DC.L    BadLineCyclesText,0
  240.     DC.W    GD_BadLineCycles
  241.     DC.L    PLACETEXT_LEFT,0,0
  242.     DC.W    188,38,81,14
  243.     DC.L    CIACyclesText,0
  244.     DC.W    GD_CIACycles
  245.     DC.L    PLACETEXT_LEFT,0,0
  246.     DC.W    377,18,193,14
  247.     DC.L    Dir8Text,0
  248.     DC.W    GD_Dir8
  249.     DC.L    PLACETEXT_LEFT,0,0
  250.     DC.W    377,34,193,14
  251.     DC.L    Dir9Text,0
  252.     DC.W    GD_Dir9
  253.     DC.L    PLACETEXT_LEFT,0,0
  254.     DC.W    377,50,193,14
  255.     DC.L    Dir10Text,0
  256.     DC.W    GD_Dir10
  257.     DC.L    PLACETEXT_LEFT,0,0
  258.     DC.W    377,66,193,14
  259.     DC.L    Dir11Text,0
  260.     DC.W    GD_Dir11
  261.     DC.L    PLACETEXT_LEFT,0,0
  262.     DC.W    188,111,26,11
  263.     DC.L    UseSIDCardText,0
  264.     DC.W    GD_UseSIDCard
  265.     DC.L    PLACETEXT_LEFT,0,0
  266.     DC.W    594,18,26,11
  267.     DC.L    Drv8IsIECText,0
  268.     DC.W    GD_Drv8IsIEC
  269.     DC.L    PLACETEXT_ABOVE,0,0
  270.     DC.W    594,34,26,11
  271.     DC.L    Drv9IsIECText,0
  272.     DC.W    GD_Drv9IsIEC
  273.     DC.L    0,0,0
  274.     DC.W    594,50,26,11
  275.     DC.L    Drv10IsIECText,0
  276.     DC.W    GD_Drv10IsIEC
  277.     DC.L    0,0,0
  278.     DC.W    594,66,26,11
  279.     DC.L    Drv11IsIECText,0
  280.     DC.W    GD_Drv11IsIEC
  281.     DC.L    0,0,0
  282.     DC.W    570,18,20,14
  283.     DC.L    GetDir8Text,0
  284.     DC.W    GD_GetDir8
  285.     DC.L    0,0,0
  286.     DC.W    570,34,20,14
  287.     DC.L    GetDir9Text,0
  288.     DC.W    GD_GetDir9
  289.     DC.L    0,0,0
  290.     DC.W    570,50,20,14
  291.     DC.L    GetDir10Text,0
  292.     DC.W    GD_GetDir10
  293.     DC.L    0,0,0
  294.     DC.W    570,66,20,14
  295.     DC.L    GetDir11Text,0
  296.     DC.W    GD_GetDir11
  297.     DC.L    0,0,0
  298.     DC.W    594,86,26,11
  299.     DC.L    OtherIECText,0
  300.     DC.W    GD_OtherIEC
  301.     DC.L    PLACETEXT_LEFT,0,0
  302.     DC.W    188,125,26,11
  303.     DC.L    KeyboardYZText,0
  304.     DC.W    GD_KeyboardYZ
  305.     DC.L    PLACETEXT_LEFT,0,0
  306.     DC.W    188,139,26,11
  307.     DC.L    CollisionsText,0
  308.     DC.W    GD_Collisions
  309.     DC.L    PLACETEXT_LEFT,0,0
  310.     DC.W    594,99,26,11
  311.     DC.L    MapSlashText,0
  312.     DC.W    GD_MapSlash
  313.     DC.L    PLACETEXT_LEFT,0,0
  314.     DC.W    188,153,26,11
  315.     DC.L    FastResetText,0
  316.     DC.W    GD_FastReset
  317.     DC.L    PLACETEXT_LEFT,0,0
  318.     DC.W    188,54,81,14
  319.     DC.L    SkipLatchText,0
  320.     DC.W    GD_SkipLatch
  321.     DC.L    PLACETEXT_LEFT,0,0
  322.  
  323. PrefsGTags:
  324.     DC.L    GT_Underscore,'_'
  325.     DC.L    TAG_DONE
  326.     DC.L    GT_Underscore,'_'
  327.     DC.L    TAG_DONE
  328.     DC.L    GT_Underscore,'_'
  329.     DC.L    TAG_DONE
  330.     DC.L    TAG_DONE
  331.     DC.L    TAG_DONE
  332.     DC.L    TAG_DONE
  333.     DC.L    TAG_DONE
  334.     DC.L    GTTX_Border,1
  335.     DC.L    TAG_DONE
  336.     DC.L    GTCY_Labels,ScreenTypeLabels
  337.     DC.L    TAG_DONE
  338.     DC.L    GTIN_Number,0
  339.     DC.L    GTIN_MaxChars,10
  340.     DC.L    TAG_DONE
  341.     DC.L    GTIN_Number,0
  342.     DC.L    GTIN_MaxChars,10
  343.     DC.L    TAG_DONE
  344.     DC.L    GTIN_Number,0
  345.     DC.L    GTIN_MaxChars,10
  346.     DC.L    TAG_DONE
  347.     DC.L    GTST_MaxChars,256
  348.     DC.L    TAG_DONE
  349.     DC.L    GTST_MaxChars,256
  350.     DC.L    TAG_DONE
  351.     DC.L    GTST_MaxChars,256
  352.     DC.L    TAG_DONE
  353.     DC.L    GTST_MaxChars,256
  354.     DC.L    TAG_DONE
  355.     DC.L    TAG_DONE
  356.     DC.L    TAG_DONE
  357.     DC.L    TAG_DONE
  358.     DC.L    TAG_DONE
  359.     DC.L    TAG_DONE
  360.     DC.L    TAG_DONE
  361.     DC.L    TAG_DONE
  362.     DC.L    TAG_DONE
  363.     DC.L    TAG_DONE
  364.     DC.L    TAG_DONE
  365.     DC.L    TAG_DONE
  366.     DC.L    TAG_DONE
  367.     DC.L    TAG_DONE
  368.     DC.L    TAG_DONE
  369.     DC.L    GTIN_Number,0
  370.     DC.L    GTIN_MaxChars,10
  371.     DC.L    TAG_DONE
  372.  
  373.  
  374. OKText:
  375.     DC.B    '_O',0
  376.  
  377. CancelText:
  378.     DC.B    '_C',0
  379.  
  380. SaveText:
  381.     DC.B    '_S',0
  382.  
  383. Joystick1OnText:
  384.     DC.B    'Joystick an Port 1',0
  385.  
  386. Joystick2OnText:
  387.     DC.B    'Joystick an Port 2',0
  388.  
  389. JoystickSwapText:
  390.     DC.B    'Joysticks vertauschen',0
  391.  
  392. GetDisplayIDText:
  393.     DC.B    '',0
  394.  
  395. DisplayIDText:
  396.     DC.B    'Bildschirmmodus',0
  397.  
  398. ScreenTypeText:
  399.     DC.B    'Bildschirmtyp',0
  400.  
  401. NormalCyclesText:
  402.     DC.B    'Zyklen/Zeile (CPU)',0
  403.  
  404. BadLineCyclesText:
  405.     DC.B    'Zyklen/Bad Line (CPU)',0
  406.  
  407. CIACyclesText:
  408.     DC.B    'Zyklen/Zeile (CIA)',0
  409.  
  410. Dir8Text:
  411.     DC.B    'Laufwerk 8',0
  412.  
  413. Dir9Text:
  414.     DC.B    'Laufwerk 9',0
  415.  
  416. Dir10Text:
  417.     DC.B    'Laufwerk 10',0
  418.  
  419. Dir11Text:
  420.     DC.B    'Laufwerk 11',0
  421.  
  422. UseSIDCardText:
  423.     DC.B    'SID-Karte benutzen',0
  424.  
  425. Drv8IsIECText:
  426.     DC.B    'IEC',0
  427.  
  428. Drv9IsIECText:
  429.     DC.B    '',0
  430.  
  431. Drv10IsIECText:
  432.     DC.B    '',0
  433.  
  434. Drv11IsIECText:
  435.     DC.B    '',0
  436.  
  437. GetDir8Text:
  438.     DC.B    '',0
  439.  
  440. GetDir9Text:
  441.     DC.B    '',0
  442.  
  443. GetDir10Text:
  444.     DC.B    '',0
  445.  
  446. GetDir11Text:
  447.     DC.B    '',0
  448.  
  449. OtherIECText:
  450.     DC.B    'IEC für andere Geräte verwenden',0
  451.  
  452. KeyboardYZText:
  453.     DC.B    'Amerik. Tastatur',0
  454.  
  455. CollisionsText:
  456.     DC.B    'Sprite-Kollisionen',0
  457.  
  458. MapSlashText:
  459.     DC.B    '"/" -> "\" in Dateinamen',0
  460.  
  461. FastResetText:
  462.     DC.B    'Schneller Reset',0
  463.  
  464. SkipLatchText:
  465.     DC.B    'Jedes (n)te Bild',0
  466.  
  467.     CNOP    0,2
  468.  
  469.     XDEF    ScreenTypeLabels
  470.  
  471. ScreenTypeLabels:
  472.     DC.L    ScreenTypeLab0
  473.     DC.L    ScreenTypeLab1
  474.     DC.L    ScreenTypeLab2
  475.     DC.L    ScreenTypeLab3
  476.     DC.L    ScreenTypeLab4
  477.     DC.L    0
  478.  
  479. ScreenTypeLab0:    DC.B    'EGS',0
  480. ScreenTypeLab1:    DC.B    'Picasso',0
  481. ScreenTypeLab2:    DC.B    'Amiga',0
  482. ScreenTypeLab3:    DC.B    'Amiga Mono',0
  483. ScreenTypeLab4:    DC.B    'CyBERgraphics',0
  484.  
  485.     CNOP    0,2
  486.  
  487.     XDEF    PrefsWindowTags
  488.  
  489. PrefsWindowTags:
  490. PrefsL:
  491.     DC.L    WA_Left,0
  492. PrefsT:
  493.     DC.L    WA_Top,0
  494. PrefsW:
  495.     DC.L    WA_Width,0
  496. PrefsH:
  497.     DC.L    WA_Height,0
  498.     DC.L    WA_IDCMP,BUTTONIDCMP!CHECKBOXIDCMP!TEXTIDCMP!CYCLEIDCMP!INTEGERIDCMP!STRINGIDCMP!IDCMP_GADGETUP!IDCMP_VANILLAKEY!IDCMP_REFRESHWINDOW
  499.     DC.L    WA_Flags,WFLG_DRAGBAR!WFLG_DEPTHGADGET!WFLG_SMART_REFRESH!WFLG_SIMPLE_REFRESH!WFLG_ACTIVATE
  500. PrefsWG:
  501.     DC.L    WA_Gadgets,0
  502.     DC.L    WA_Title,PrefsWTitle
  503.     DC.L    WA_ScreenTitle,PrefsSTitle
  504.     DC.L    WA_AutoAdjust,1
  505.     DC.L    TAG_DONE
  506.  
  507. PrefsWTitle:
  508.     DC.B    ' ',0
  509.     CNOP    0,2
  510.  
  511. PrefsSTitle:
  512.     DC.B    ' ',0
  513.     CNOP    0,2
  514.  
  515. ComputeX:
  516.     move.l  d1,-(sp)
  517.     move.w  FontX,d1
  518.     bra.s   ComputeItX
  519. ComputeY:
  520.     move.l  d1,-(sp)
  521.     move.w  FontY,d1
  522.     mulu    d1,d0
  523.     addq.w  #4,d0
  524.     divu    #8,d0
  525.     move.l  (sp)+,d1
  526.     rts
  527.  
  528. ComputeItX:
  529.     mulu    d1,d0
  530.     addq.w  #4,d0
  531.     divu    #8,d0
  532.     move.l  (sp)+,d1
  533.     rts
  534.  
  535. ComputeFont:
  536.     lea.l   Attr,a0
  537.     move.l  a0,Font
  538.     move.l  Scr,a1
  539.     lea.l   sc_RastPort(a1),a1
  540.     move.l  rp_Font(a1),a1
  541.     move.l  LN_NAME(a1),ta_Name(a0)
  542.     move.w  tf_YSize(a1),ta_YSize(a0)
  543.     move.w  tf_XSize(a1),FontX
  544.     move.w  tf_YSize(a1),FontY
  545.     move.l  Scr,a0
  546.     move.b  sc_WBorLeft(a0),d0
  547.     ext.w   d0
  548.     move.w  d0,OffX
  549.     move.l  sc_Font(a0),a1
  550.     move.w  ta_YSize(a1),d0
  551.     addq.w  #1,d0
  552.     move.b  sc_WBorTop(a0),d1
  553.     ext.w   d1
  554.     add.w   d1,d0
  555.     move.w  d0,OffY
  556.     tst.w   d2
  557.     beq.s   CompDone
  558.     tst.w   d3
  559.     beq.s   CompDone
  560.     move.w  d2,d0
  561.     jsr     ComputeX
  562.     add.w   OffX,d0
  563.     move.b  sc_WBorRight(a0),d1
  564.     ext.w   d1
  565.     add.w   d1,d0
  566.     cmp.w   sc_Width(a0),d0
  567.     bhi.s   UseTopaz
  568.     move.w  d3,d0
  569.     jsr     ComputeY
  570.     add.w   OffY,d0
  571.     move.b  sc_WBorBottom(a0),d1
  572.     ext.w   d1
  573.     add.w   d1,d0
  574.     cmp.w   sc_Height(a0),d0
  575.     bhi.s   UseTopaz
  576. CompDone:
  577.     rts
  578. UseTopaz:
  579.     move.l  Font,a0
  580.     move.l  #TopazName,ta_Name(a0)
  581.     move.w  #8,FontY
  582.     move.w  #8,FontX
  583.     move.w  #8,ta_YSize(a0)
  584.     rts
  585.  
  586.     XDEF    SetupScreen
  587.  
  588. SetupScreen
  589.     movem.l d1-d3/a0-a2/a6,-(sp)
  590.     move.l  _IntuitionBase,a6
  591.     move.l  PubScreenName,a0
  592.     jsr     _LVOLockPubScreen(a6)
  593.     move.l  d0,Scr
  594.     tst.l   d0
  595.     beq     SError
  596.     moveq   #0,d2
  597.     moveq   #0,d3
  598.     jsr     ComputeFont
  599.     move.l  Scr,a0
  600.     move.l  _GadToolsBase,a6
  601.     lea.l   TD,a1
  602.     jsr     _LVOGetVisualInfoA(a6)
  603.     move.l  d0,VisualInfo
  604.     move.l  d0,CL+4
  605.     tst.l   d0
  606.     beq     VError
  607.     jsr     initGet
  608.     move.l  d0,getClass
  609.     tst.l   d0
  610.     beq     CError
  611.     move.l  _IntuitionBase,a6
  612.     move.l  d0,a0
  613.     suba.l  a1,a1
  614.     lea.l   CL,a2
  615.     jsr     _LVONewObjectA(a6)
  616.     move.l  d0,getImage
  617.     tst.l   d0
  618.     beq     OError
  619.     moveq   #0,d0
  620. SDone:
  621.     movem.l (sp)+,d1-d3/a0-a2/a6
  622.     rts
  623. SError:
  624.     moveq   #1,d0
  625.     bra.s   SDone
  626. VError:
  627.     moveq   #2,d0
  628.     bra.s   SDone
  629. CError:
  630.     moveq   #4,d0
  631.     bra.s   SDone
  632. OError:
  633.     moveq   #5,d0
  634.     bra.s   SDone
  635.  
  636.     XDEF    CloseDownScreen
  637.  
  638. CloseDownScreen:
  639.     movem.l d0-d1/a0-a1/a6,-(sp)
  640.     move.l  _IntuitionBase,a6
  641.     move.l  getImage,a0
  642.     cmpa.l  #0,a0
  643.     beq.s   NoObj
  644.     jsr     _LVODisposeObject(a6)
  645. NoObj:
  646.     move.l  getClass,a0
  647.     cmpa.l  #0,a0
  648.     beq.s   NoCls
  649.     jsr     _LVOFreeClass(a6)
  650. NoCls:
  651.     move.l  _GadToolsBase,a6
  652.     move.l  VisualInfo,a0
  653.     cmpa.l  #0,a0
  654.     beq.s   NoVis
  655.     jsr     _LVOFreeVisualInfo(a6)
  656.     move.l  #0,VisualInfo
  657. NoVis:
  658.     move.l  _IntuitionBase,a6
  659.     suba.l  a0,a0
  660.     move.l  Scr,a1
  661.     cmpa.l  #0,a1
  662.     beq.s   NoScr
  663.     jsr     _LVOUnlockPubScreen(a6)
  664.     move.l  #0,Scr
  665. NoScr:
  666.     movem.l (sp)+,d0-d1/a0-a1/a6
  667.     rts
  668.  
  669.     XDEF    OpenPrefsWindow
  670.  
  671. OpenPrefsWindow:
  672.     movem.l d1-d4/a0-a4/a6,-(sp)
  673.     move.l  Scr,a0
  674.     moveq   #0,d3
  675.     moveq   #0,d2
  676.     move.w  PrefsWidth,d2
  677.     move.w  PrefsHeight,d3
  678.     jsr     ComputeFont
  679.     move.l  Scr,a0
  680.     move.l  d2,d0
  681.     jsr     ComputeX
  682.     move.l  d0,d4
  683.     move.w  PrefsLeft,d2
  684.     add.w   d2,d0
  685.     add.w   OffX,d0
  686.     move.b  sc_WBorRight(a0),d1
  687.     ext.w   d1
  688.     add.w   d1,d0
  689.     cmp.w   sc_Width(a0),d0
  690.     bls.s   PrefsWOk
  691.     move.w  sc_Width(a0),d0
  692.     sub.w   d4,d0
  693.     move.w  d0,d2
  694. PrefsWOk:
  695.     move.l  d3,d0
  696.     jsr     ComputeY
  697.     move.l  d0,d4
  698.     move.w  PrefsTop,d3
  699.     add.w   d3,d0
  700.     add.w   OffY,d0
  701.     move.b  sc_WBorBottom(a0),d1
  702.     ext.w   d1
  703.     add.w   d1,d0
  704.     cmp.w   sc_Height(a0),d0
  705.     bls.s   PrefsHOk
  706.     move.w  sc_Height(a0),d0
  707.     sub.w   d4,d0
  708.     move.w  d0,d3
  709. PrefsHOk:
  710.     move.l  _GadToolsBase,a6
  711.     lea.l   PrefsGList,a0
  712.     jsr     _LVOCreateContext(a6)
  713.     move.l  d0,a3
  714.     tst.l   d0
  715.     beq     PrefsCError
  716.     movem.w d2-d3,-(sp)
  717.     moveq   #0,d3
  718.     lea.l   PrefsGTags,a4
  719. PrefsGL:
  720.     move.l  _SysBase,a6
  721.     lea.l   PrefsNGads,a0
  722.     move.l  d3,d0
  723.     mulu    #gng_SIZEOF,d0
  724.     add.l   d0,a0
  725.     lea.l   BufNewGad,a1
  726.     moveq   #gng_SIZEOF,d0
  727.     jsr     _LVOCopyMem(a6)
  728.     lea.l   BufNewGad,a0
  729.     move.l  VisualInfo,gng_VisualInfo(a0)
  730.     move.l  Font,gng_TextAttr(a0)
  731.     move.w  gng_LeftEdge(a0),d0
  732.     jsr     ComputeX
  733.     add.w   OffX,d0
  734.     move.w  d0,gng_LeftEdge(a0)
  735.     move.w  gng_TopEdge(a0),d0
  736.     jsr     ComputeY
  737.     add.w   OffY,d0
  738.     move.w  d0,gng_TopEdge(a0)
  739.     move.w  gng_Width(a0),d0
  740.     jsr     ComputeX
  741.     move.w  d0,gng_Width(a0)
  742.     move.w  gng_Height(a0),d0
  743.     jsr     ComputeY
  744.     move.w  d0,gng_Height(a0)
  745.     move.l  _GadToolsBase,a6
  746.     lea.l   PrefsGTypes,a0
  747.     moveq   #0,d0
  748.     move.l  d3,d1
  749.     asl.l   #1,d1
  750.     add.l   d1,a0
  751.     move.w  (a0),d0
  752.     move.l  a3,a0
  753.     lea.l   BufNewGad,a1
  754.     move.l  a4,a2
  755.     jsr     _LVOCreateGadgetA(a6)
  756.     tst.l   d0
  757.     bne.s    PrefsCOK
  758.     movem.w (sp)+,d2-d3
  759.     bra     PrefsGError
  760. PrefsCOK:
  761.     move.l  d0,a3
  762.     move.l  d3,d0
  763.     asl.l   #2,d0
  764.     lea.l   PrefsGadgets,a0
  765.     add.l   d0,a0
  766.     move.l  a3,(a0)
  767.     move.l  a3,a0
  768.     move.l  d3,d0
  769.     asl.l   #1,d0
  770.     lea.l   PrefsGTypes,a1
  771.     add.l   d0,a1
  772.     cmp.w   #GENERIC_KIND,(a1)
  773.     bne.s   PrefsNoGen1
  774.     or.w    #GFLG_GADGIMAGE!GFLG_GADGHIMAGE,gg_Flags(a0)
  775.     or.w    #GACT_RELVERIFY,gg_Activation(a0)
  776.     move.l  getImage,gg_GadgetRender(a0)
  777.     move.l  getImage,gg_SelectRender(a0)
  778. PrefsNoGen1:
  779. PrefsTL:
  780.     tst.l   (a4)
  781.     beq.s   PrefsDN
  782.     addq.w  #8,a4
  783.     bra.s   PrefsTL
  784. PrefsDN:
  785.     addq.w  #4,a4
  786.     addq.w  #1,d3
  787.     cmp.w   #Prefs_CNT,d3
  788.     bmi     PrefsGL
  789.     movem.w (sp)+,d2-d3
  790.     move.l  PrefsGList,PrefsWG+4
  791.     ext.l   d2
  792.     ext.l   d3
  793.     move.l  d2,PrefsL+4
  794.     move.l  d3,PrefsT+4
  795.     move.l  Scr,a0
  796.     move.w  PrefsWidth,d0
  797.     jsr     ComputeX
  798.     add.w   OffX,d0
  799.     move.b  sc_WBorRight(a0),d1
  800.     ext.w   d1
  801.     add.w   d1,d0
  802.     move.l  d0,PrefsW+4
  803.     move.w  PrefsHeight,d0
  804.     jsr     ComputeY
  805.     add.w   OffY,d0
  806.     move.b  sc_WBorBottom(a0),d1
  807.     ext.w   d1
  808.     add.w   d1,d0
  809.     move.l  d0,PrefsH+4
  810.     move.l  _IntuitionBase,a6
  811.     suba.l  a0,a0
  812.     lea.l   PrefsWindowTags,a1
  813.     jsr     _LVOOpenWindowTagList(a6)
  814.     move.l  d0,PrefsWnd
  815.     tst.l   d0
  816.     beq     PrefsWError
  817.     move.l  _GadToolsBase,a6
  818.     move.l  PrefsWnd,a0
  819.     suba.l  a1,a1
  820.     jsr     _LVOGT_RefreshWindow(a6)
  821.     moveq   #0,d0
  822. PrefsDone:
  823.     movem.l (sp)+,d1-d4/a0-a4/a6
  824.     rts
  825. PrefsCError:
  826.     moveq   #1,d0
  827.     bra.s   PrefsDone
  828. PrefsGError:
  829.     moveq   #2,d0
  830.     bra.s   PrefsDone
  831. PrefsWError:
  832.     moveq   #4,d0
  833.     bra.s   PrefsDone
  834.  
  835.     XDEF    ClosePrefsWindow
  836.  
  837. ClosePrefsWindow:
  838.     movem.l d0-d1/a0-a2/a6,-(sp)
  839.     move.l  _IntuitionBase,a6
  840.     move.l  PrefsWnd,a0
  841.     cmpa.l  #0,a0
  842.     beq     PrefsNWnd
  843.     jsr     _LVOCloseWindow(a6)
  844.     move.l  #0,PrefsWnd
  845. PrefsNWnd:
  846.     move.l  _GadToolsBase,a6
  847.     move.l  PrefsGList,a0
  848.     cmpa.l  #0,a0
  849.     beq     PrefsNGad
  850.     jsr     _LVOFreeGadgets(a6)
  851.     move.l  #0,PrefsGList
  852. PrefsNGad:
  853.     movem.l (sp)+,d0-d1/a0-a2/a6
  854.     rts
  855.  
  856.  
  857.     end
  858.