home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / DOpus4-GPL / Library / dopuslib.a < prev    next >
Text File  |  2000-01-27  |  10KB  |  539 lines

  1. ; Directory Opus 4
  2. ; Original GPL release version 4.12
  3. ; Copyright 1993-2000 Jonathan Potter
  4. ; This program is free software; you can redistribute it and/or
  5. ; modify it under the terms of the GNU General Public License
  6. ; as published by the Free Software Foundation; either version 2
  7. ; of the License, or (at your option) any later version.
  8. ; This program is distributed in the hope that it will be useful,
  9. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. ; GNU General Public License for more details.
  12. ; You should have received a copy of the GNU General Public License
  13. ; along with this program; if not, write to the Free Software
  14. ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  15. ; All users of Directory Opus 4 (including versions distributed
  16. ; under the GPL) are entitled to upgrade to the latest version of
  17. ; Directory Opus version 5 at a reduced price. Please see
  18. ; http://www.gpsoft.com.au for more information.
  19. ; The release of Directory Opus 4 under the GPL in NO WAY affects
  20. ; the existing commercial status of Directory Opus 5.
  21.  
  22.  
  23.     SECTION    code
  24.  
  25.     INCLUDE "exec/types.i"
  26.     INCLUDE "exec/initializers.i"
  27.     INCLUDE "exec/libraries.i"
  28.     INCLUDE "exec/lists.i"
  29.     INCLUDE "exec/alerts.i"
  30.     INCLUDE "exec/resident.i"
  31.     INCLUDE "exec/ports.i"
  32.     INCLUDE "exec/io.i"
  33.     INCLUDE "libraries/dos.i"
  34.     INCLUDE "graphics/rastport.i"
  35.  
  36.     INCLUDE "asmsupp.i"
  37.     INCLUDE "dopusbase.i"
  38.  
  39. * Functions.a
  40.  
  41.     XREF endcode
  42.     XREF GetWBScreen
  43.     XREF Seed
  44.     XREF Random
  45.     XREF StrToUpper
  46.     XREF StrToLower
  47.     XREF DisableGadget
  48.     XREF EnableGadget
  49.     XREF GhostGadget
  50.     XREF _SwapMem
  51.     XREF _LSprintf
  52.     XREF LSprintf
  53.     XREF LCreateExtIO
  54.     XREF LCreatePort
  55.     XREF LDeleteExtIO
  56.     XREF LDeletePort
  57.     XREF LToUpper
  58.     XREF LToLower
  59.     XREF LStrCat
  60.     XREF LStrnCat
  61.     XREF LStrCpy
  62.     XREF LStrnCpy
  63.     XREF LStrCmpI
  64.     XREF LStrnCmpI
  65.     XREF LStrCmp
  66.     XREF LStrnCmp
  67.  
  68. * Functions2.a
  69.  
  70.     XREF BtoCStr
  71.     XREF ActivateStrGad
  72.     XREF RefreshStrGad
  73.  
  74. * Graphics.a
  75.  
  76.     XREF Do3DBox
  77.     XREF Do3DStringBox
  78.     XREF Do3DCycleBox
  79.     XREF DrawCheckMark
  80.     XREF HiliteGad
  81.  
  82. * Filereq.c
  83.  
  84.     XREF _DoFileRequest
  85.     XREF _DoSetBusyPointer
  86.  
  87. * Wildcard.c
  88.  
  89.     XREF _DoParsePattern
  90.     XREF _DoMatchPattern
  91.  
  92. * Dosstuff.c
  93.  
  94.     XREF _DoAssign
  95.     XREF _DoBaseName
  96.     XREF _DoCompareLock
  97.     XREF _DoPathName
  98.     XREF _DoSendPacket
  99.     XREF _DoTackOn
  100.     XREF _DoStampToStr
  101.     XREF _DoStrToStamp
  102.     XREF _DoAllocRemember
  103.     XREF _DoFreeRemember
  104.     XREF _DoFreeRemEntry
  105.     XREF _DoCompareDate
  106.     XREF _DoDoArrow
  107.     XREF _DoStrCombine
  108.     XREF _DoStrConcat
  109.     XREF _DoDecode_RLE
  110.  
  111. * Dosstuff2.c
  112.  
  113.     XREF _DoSearchPathList
  114.     XREF _DoCheckExist
  115.     XREF _DoRawkeyToStr
  116.     XREF _DoDoRMBGadget
  117.     XREF _DoAddGadgets
  118.     XREF _DoCheckNumGad
  119.     XREF _DoCheckHexGad
  120.     XREF _DoAtoh
  121.     XREF _DoDoSimpleRequest
  122.     XREF _DoDoCycleGadget
  123.     XREF _DoDrawRadioButton
  124.     XREF _DoGetButtonImage
  125.     XREF _DoGetCheckImage
  126.     XREF _DoUScoreText
  127.     XREF _DoDo3DFrame
  128.     XREF _DoDoGlassImage
  129.  
  130. * Dosstuff3.c
  131.  
  132.     XREF _DoReadConfig
  133.     XREF _DoSaveConfig
  134.     XREF _DoDefaultConfig
  135.     XREF _DoGetDevices
  136.     XREF _DoAssignGadget
  137.     XREF _DoAssignMenu
  138.     XREF _DoFreeConfig
  139.     XREF _DoCheckConfig
  140.     XREF _DoFindSystemFile
  141.  
  142. * Listview.c
  143.  
  144.     XREF _DoAddListView
  145.     XREF _DoListViewIDCMP
  146.     XREF _DoRemoveListView
  147.     XREF _DoRefreshListView
  148.     XREF _DoFixSliderBody
  149.     XREF _DoFixSliderPot
  150.     XREF _DoGetSliderPos
  151.     XREF _DoShowSlider
  152.  
  153. * Requesters.c
  154.  
  155.     XREF _R_OpenRequester
  156.     XREF _R_CloseRequester
  157.     XREF _R_AddRequesterObject
  158.     XREF _R_RefreshRequesterObject
  159.     XREF _R_ObjectText
  160.  
  161. * Language.c
  162.  
  163.     XREF _DoReadStringFile
  164.     XREF _DoFreeStringFile
  165.  
  166. * Borders.c
  167.  
  168.     XREF _DoAddGadgetBorders
  169.     XREF _DoCreateGadgetBorders
  170.     XREF _DoSelectGadget
  171.  
  172. * Menus.c
  173.  
  174.     XREF _DoFSSetMenuStrip
  175.  
  176. * Chip data
  177.  
  178.     XREF _pdb_cycletop
  179.     XREF _pdb_cyclebot
  180.     XREF _pdb_check
  181.  
  182. * Objects
  183.  
  184.     XREF _SysBase
  185.     XREF _DOpusBase
  186.     XREF _IntuitionBase
  187.     XREF _GfxBase
  188.     XREF _DOSBase
  189.     XREF _LayersBase
  190.  
  191. start:
  192.     moveq #0,d0
  193.     rts
  194.  
  195. romtag:
  196.     dc.w RTC_MATCHWORD
  197.     dc.l romtag
  198.     dc.l endcode
  199.     dc.b RTF_AUTOINIT
  200.     dc.b VERSION
  201.     dc.b NT_LIBRARY
  202.     dc.b 0
  203.     dc.l dopusname
  204.     dc.l idstring
  205.     dc.l init
  206.  
  207. VERSION  equ 22
  208. REVISION equ 6
  209.  
  210. dopusname:
  211.     DOPUSNAME
  212.  
  213. idstring:
  214.     dc.b 'dopus.library 22.6 (30 Jul 93) Copyright © 1993 Jonathan Potter',13,10,0
  215.  
  216. dosname:
  217.     dc.b 'dos.library',0
  218. intuitionname:
  219.     dc.b 'intuition.library',0
  220. graphicsname:
  221.     dc.b 'graphics.library',0
  222. layersname:
  223.     dc.b 'layers.library',0
  224.  
  225.     ds.w 0
  226.  
  227. init:
  228.     dc.l DOpusBase_SIZEOF
  229.     dc.l functable
  230.     dc.l datatable
  231.     dc.l initroutine
  232.  
  233. functable:
  234.     dc.l Open
  235.     dc.l Close
  236.     dc.l Expunge
  237.     dc.l Null
  238.     dc.l _DoFileRequest
  239.     dc.l Do3DBox
  240.     dc.l Do3DStringBox
  241.     dc.l Do3DCycleBox
  242.     dc.l _DoDoArrow
  243.     dc.l LSprintf
  244.     dc.l LCreateExtIO
  245.     dc.l LCreatePort
  246.     dc.l LDeleteExtIO
  247.     dc.l LDeletePort
  248.     dc.l LToUpper
  249.     dc.l LToLower
  250.     dc.l LStrCat
  251.     dc.l LStrnCat
  252.     dc.l LStrCpy
  253.     dc.l LStrnCpy
  254.     dc.l LStrCmp
  255.     dc.l LStrnCmp
  256.     dc.l LStrCmpI
  257.     dc.l LStrnCmpI
  258.     dc.l _DoStrCombine
  259.     dc.l _DoStrConcat
  260.     dc.l LParsePattern
  261.     dc.l LMatchPattern
  262.     dc.l LParsePatternI
  263.     dc.l LMatchPatternI
  264.     dc.l BtoCStr
  265.     dc.l _DoAssign
  266.     dc.l _DoBaseName
  267.     dc.l _DoCompareLock
  268.     dc.l _DoPathName
  269.     dc.l _DoSendPacket
  270.     dc.l _DoTackOn
  271.     dc.l _DoStampToStr
  272.     dc.l _DoStrToStamp
  273.     dc.l _DoAddListView
  274.     dc.l _DoListViewIDCMP
  275.     dc.l _DoRefreshListView
  276.     dc.l _DoRemoveListView
  277.     dc.l DrawCheckMark
  278.     dc.l FixSliderBody
  279.     dc.l FixSliderPot
  280.     dc.l GetSliderPos
  281.     dc.l _DoAllocRemember
  282.     dc.l _DoFreeRemember
  283.     dc.l _DoSetBusyPointer
  284.     dc.l GetWBScreen
  285.     dc.l _DoSearchPathList
  286.     dc.l _DoCheckExist
  287.     dc.l _DoCompareDate
  288.     dc.l Seed
  289.     dc.l Random
  290.     dc.l StrToUpper
  291.     dc.l StrToLower
  292.     dc.l _DoRawkeyToStr
  293.     dc.l _DoDoRMBGadget
  294.     dc.l _DoAddGadgets
  295.     dc.l ActivateStrGad
  296.     dc.l RefreshStrGad
  297.     dc.l _DoCheckNumGad
  298.     dc.l _DoCheckHexGad
  299.     dc.l _DoAtoh
  300.     dc.l HiliteGad
  301.     dc.l _DoDoSimpleRequest
  302.     dc.l _DoReadConfig
  303.     dc.l _DoSaveConfig
  304.     dc.l _DoDefaultConfig
  305.     dc.l _DoGetDevices
  306.     dc.l _DoAssignGadget
  307.     dc.l _DoAssignMenu
  308.     dc.l _DoFindSystemFile
  309.     dc.l _DoDo3DFrame
  310.     dc.l _DoFreeConfig
  311.     dc.l _DoDoCycleGadget
  312.     dc.l _DoUScoreText
  313.     dc.l DisableGadget
  314.     dc.l EnableGadget
  315.     dc.l GhostGadget
  316.     dc.l _DoDrawRadioButton
  317.     dc.l _DoGetButtonImage
  318.     dc.l _DoShowSlider
  319.     dc.l _DoCheckConfig
  320.     dc.l _DoGetCheckImage
  321.     dc.l _R_OpenRequester
  322.     dc.l _R_CloseRequester
  323.     dc.l _R_AddRequesterObject
  324.     dc.l _R_RefreshRequesterObject
  325.     dc.l DoObjectText
  326.     dc.l _DoDoGlassImage
  327.     dc.l _DoDecode_RLE
  328.     dc.l _DoReadStringFile
  329.     dc.l _DoFreeStringFile
  330.     dc.l _DoFreeRemEntry
  331.     dc.l _DoAddGadgetBorders
  332.     dc.l _DoCreateGadgetBorders
  333.     dc.l _DoSelectGadget
  334.     dc.l _DoFSSetMenuStrip
  335.     dc.l -1
  336.  
  337. datatable:
  338.     INITBYTE LN_TYPE,NT_LIBRARY
  339.     INITLONG LN_NAME,dopusname
  340.     INITBYTE LIB_FLAGS,LIBF_SUMUSED!LIBF_CHANGED
  341.     INITWORD LIB_VERSION,VERSION
  342.     INITWORD LIB_REVISION,REVISION
  343.     INITLONG LIB_IDSTRING,idstring
  344.     dc.l 0
  345.  
  346. initroutine:
  347.     move.l a5,-(sp)
  348.     move.l d0,a5
  349.     move.l a6,db_ExecBase(a5)
  350.     move.l a6,_SysBase
  351.     move.l a0,db_SegList(a5)
  352.  
  353.     move.l a5,_DOpusBase
  354.  
  355.     lea    dosname(pc),a1
  356.     moveq.l #0,d0
  357.     move.l 4,a6
  358.     jsr _LVOOpenLibrary(a6)
  359.     move.l d0,db_DOSBase(a5)
  360.     move.l d0,_DOSBase
  361.  
  362.     lea intuitionname(pc),a1
  363.     moveq.l #0,d0
  364.     jsr _LVOOpenLibrary(a6)
  365.     move.l d0,db_IntuitionBase(a5)
  366.     move.l d0,_IntuitionBase
  367.  
  368.     lea graphicsname(pc),a1
  369.     moveq.l #0,d0
  370.     jsr _LVOOpenLibrary(a6)
  371.     move.l d0,db_GfxBase(a5)
  372.     move.l d0,_GfxBase
  373.  
  374.     lea layersname(pc),a1
  375.     moveq.l #0,d0
  376.     jsr _LVOOpenLibrary(a6)
  377.     move.l d0,db_LayersBase(a5)
  378.     move.l d0,_LayersBase
  379.  
  380. ;    jsr _init_dopus_library
  381.  
  382.     lea.l _pdb_cycletop,a0
  383.     move.l a0,pdb_cycletop(a5)
  384.  
  385.     lea.l _pdb_cyclebot,a0
  386.     move.l a0,pdb_cyclebot(a5)
  387.  
  388.     lea.l _pdb_check,a0
  389.     move.l a0,pdb_check(a5)
  390.  
  391.     move.l #0,pdb_Flags(a5)
  392.  
  393.     move.l 4,a6
  394.     move.l a5,d0
  395.     move.l (sp)+,a5
  396.     rts
  397.  
  398. Open:
  399.     addq.w #1,LIB_OPENCNT(a6)
  400.     bclr #LIBB_DELEXP,db_Flags(a6)
  401.     move.l a6,d0
  402.     rts
  403.  
  404. Close:
  405.     moveq.l #0,d0
  406.     subq.w #1,LIB_OPENCNT(a6)
  407.     bne.s    stillopen
  408.     btst #LIBB_DELEXP,db_Flags(a6)
  409.     beq.s    stillopen
  410.     bsr    Expunge
  411. stillopen:
  412.     rts
  413.  
  414. Expunge:
  415.     movem.l    d2/a5/a6,-(sp)
  416.     move.l a6,a5
  417.     tst.w    LIB_OPENCNT(a5)
  418.     beq.s    notopen
  419.     bset #LIBB_DELEXP,db_Flags(a5)
  420.     moveq.l #0,d0
  421.     bra expungeend
  422. notopen:
  423.     move.l db_SegList(a5),d2
  424.     move.l a5,a1
  425.     move.l 4,a6
  426.     jsr _LVORemove(a6)
  427.  
  428.     move.l db_DOSBase(a5),a1
  429.     jsr _LVOCloseLibrary(a6)
  430.     move.l db_IntuitionBase(a5),a1
  431.     jsr _LVOCloseLibrary(a6)
  432.     move.l db_GfxBase(a5),a1
  433.     jsr _LVOCloseLibrary(a6)
  434.     move.l db_LayersBase(a5),a1
  435.     jsr _LVOCloseLibrary(a6)
  436.  
  437.     moveq.l #0,d0
  438.     move.l a5,a1
  439.     move.w LIB_NEGSIZE(a5),d0
  440.     sub.l d0,a1
  441.     add.w LIB_POSSIZE(a5),d0
  442.     move.l 4,a6
  443.     jsr _LVOFreeMem(a6)
  444.     move.l d2,d0
  445.  
  446. expungeend:
  447.     movem.l (sp)+,d2/a5/a6
  448.     rts
  449.  
  450. Null:
  451.     moveq.l #0,d0
  452.     rts
  453.  
  454. LParsePattern:
  455.     moveq.l #0,d0
  456.     bra doparse
  457. LParsePatternI:
  458.     moveq.l #1,d0
  459. doparse:
  460.     movem.l a2-a6/d2-d7,-(sp)
  461.     move.l d0,-(sp)
  462.     move.l a1,-(sp)
  463.     move.l a0,-(sp)
  464.     jsr _DoParsePattern
  465.     add.l #12,sp
  466.     movem.l (sp)+,a2-a6/d2-d7
  467.     rts
  468.  
  469. LMatchPattern:
  470.     moveq.l #0,d0
  471.     bra domatch
  472. LMatchPatternI:
  473.     moveq.l #1,d0
  474. domatch:
  475.     movem.l a2-a6/d2-d7,-(sp)
  476.     move.l d0,-(sp)
  477.     move.l a1,-(sp)
  478.     move.l a0,-(sp)
  479.     jsr _DoMatchPattern
  480.     add.l #12,sp
  481.     movem.l (sp)+,a2-a6/d2-d7
  482.     rts
  483.  
  484. DoObjectText:
  485.     movem.l a2-a6/d2-d7,-(sp)
  486.     move.l d4,-(sp)
  487.     move.l a1,-(sp)
  488.     move.l d3,-(sp)
  489.     move.l d2,-(sp)
  490.     move.l d1,-(sp)
  491.     move.l d0,-(sp)
  492.     move.l a0,-(sp)
  493.     jsr _R_ObjectText
  494.     add.l #28,sp
  495.     movem.l (sp)+,a2-a6/d2-d7
  496.     rts
  497.  
  498. FixSliderBody:
  499.     movem.l a2-a6/d2-d7,-(sp)
  500.     move.l d2,-(sp)
  501.     move.l d1,-(sp)
  502.     move.l d0,-(sp)
  503.     move.l a1,-(sp)
  504.     move.l a0,-(sp)
  505.     jsr _DoFixSliderBody
  506.     add.l #20,sp
  507.     movem.l (sp)+,a2-a6/d2-d7
  508.     rts
  509.  
  510. FixSliderPot:
  511.     movem.l a2-a6/d2-d7,-(sp)
  512.     move.l d3,-(sp)
  513.     move.l d2,-(sp)
  514.     move.l d1,-(sp)
  515.     move.l d0,-(sp)
  516.     move.l a1,-(sp)
  517.     move.l a0,-(sp)
  518.     jsr _DoFixSliderPot
  519.     add.l #24,sp
  520.     movem.l (sp)+,a2-a6/d2-d7
  521.     rts
  522.  
  523. GetSliderPos:
  524.     movem.l a2-a6/d2-d7,-(sp)
  525.     move.l d1,-(sp)
  526.     move.l d0,-(sp)
  527.     move.l a0,-(sp)
  528.     jsr _DoGetSliderPos
  529.     add.l #12,sp
  530.     movem.l (sp)+,a2-a6/d2-d7
  531.     rts
  532.  
  533.     END
  534.