home *** CD-ROM | disk | FTP | other *** search
- * 07.02.90: a6 wurde in der Library verändert, dadurch Absturz, wenn
- * der Compiler annahm, daß a6 noch unverändert war. Bis auf
- * Create/DeleteExt/StdIO beseitigt. Alles andere mit -ml
- * compiliert. Stof.c so angepaßt, daß mit -O compiliert werden
- * kann. Abfrage der einzelnen Funktionen wurde auf switch um-
- * geschrieben.
- * 23.03.90: NewRequest angefügt.
- * 28.03.90: Neuer Parser (a-e x und pi durch switch erreicht
- * 07.04.90: Alle Konstanten werden erkannt.
- * 30.05.90: left/right/mid/Umwftos umgewandelt, jetzt mit Zielangabe.
- * Neue Funktionen. RastPort jetzt immer in A1
- * 10.06.90: left/right etc. auf VOID abgeändert, Calc_P auf LONG.
- * 11.07.90: IntuitionBase etc. über ToolBase erreichbar. SimpleMenu angefügt.
- * 03.08.90: -fi, SetDrMd in Print beseitigt
-
- include "exec/types.i"
- include "exec/initializers.i"
- include "exec/libraries.i"
- include "exec/lists.i"
- include "exec/resident.i"
- include "exec/strings.i"
- include "libraries/dos.i"
- include "exec/io.i"
-
- _LVOCloseLibrary equ -414
- _LVOOpenLibrary equ -552
- _LVORemove equ -252
- _LVOFreeMem equ -210
-
- callsys macro
- jsr _LVO\1(a6)
- endm
-
- xlib macro
- xref _LVO\1
- endm
-
- * Die vorhandenen Funktionen
-
- xref _berechnen
- xref _request
- xref _copy
- xref _check
- xref _checkback
- xref _AnzahlKlammern
- xref _left
- xref _right
- xref _mid
- xref _UmwStoF
- xref _Fak
- xref _NuK
- xref _EventAbfrage
- xref _CreatePort
- xref _DeletePort
- xref _CreateExtIO
- xref _DeleteExtIO
- xref _CreateStdIO
- xref _DeleteStdIO
- xref _UmwFtoS
- xref _Print
- xref _Free_Konst
- xref _Init_Konst
- xref _Set_Konst_P
- xref _Init_Mem
- xref _Free_Block
- xref _Init_Block
- xref _PreCalc
- xref _GetKonst_P
- xref _Calc_P
- xref _NewRequest
- xref _Box
- xref _Center
- xref _Gadget_On
- xref _Gadget_Off
- xref _GetPropPosH
- xref _GetPropPosV
- xref _SetPropPosH
- xref _SetPropPosV
- xref _PrepareTmpRas
- xref _ClearTmpRas
- xref _PrepareArea
- xref _ClearArea
- xref _LastMenu
- xref _LastItem
- xref _LastSub
- xref _AddMenu
- xref _AddItem
- xref _AddSub
- xref _GetItem
- xref _ClearMenu
- xref _FreeItem
- xref _FreeMenu
- xref _NewSetMenuStrip
-
- xlib FreeMem
- xlib Remove
- xlib OpenLibrary
- xlib CloseLibrary
-
- xdef _SysBase
- xdef _IntuitionBase
- xdef _GfxBase
- xdef _MathIeeeDoubBasBase
- xdef _MathIeeeDoubTransBase
-
-
- VERSION equ 14
- REVISION equ 3
-
-
- STRUCTURE TestBase,LIB_SIZE
- BPTR extin_SegList
- APTR extin_SysBase
- APTR extin_GfxBase
- APTR extin_IntuitionBase
- APTR extin_MathIeeeDoubBasBase
- APTR extin_MathIeeeDoubTransBase
- Label extin_SIZEOF
-
- TESTLIBNAME macro
- dc.b 'tool.library',0
- endm
-
-
- SECTION "Code",CODE
-
- moveq #RETURN_FAIL,d0
- rts
- ROMTag:
- dc.w RTC_MATCHWORD
- dc.l ROMTag
- dc.l EndCode
- dc.b RTF_AUTOINIT
- dc.b VERSION
- dc.b NT_LIBRARY
- dc.b 0
- dc.l libraryName
- dc.l idString
- dc.l Init
-
- libraryName:
- TESTLIBNAME
-
- cnop 0,2
-
- idString:
- dc.b 'ToolLibrary 2.06 03-Aug-1990',CR,LF,0
-
- cnop 0,2
-
- gfxName:
- dc.b 'graphics.library',0
-
- cnop 0,2
-
- intName:
- dc.b 'intuition.library',0
-
- mabName:
- dc.b 'mathieeedoubbas.library',0
-
- matName:
- dc.b 'mathieeedoubtrans.library',0
-
- cnop 0,2
- Init:
- dc.l extin_SIZEOF
- dc.l funcTable
- dc.l dataTable
- dc.l .InitLib
-
- funcTable:
- dc.l .OpenLib
- dc.l .CloseLib
- dc.l .ExpungeLib
- dc.l .ExtFuncLib
- dc.l _left
- dc.l _right
- dc.l _mid
- dc.l _UmwFtoS
- dc.l _copy
- dc.l _check
- dc.l _checkback
- dc.l _AnzahlKlammern
- dc.l _request
- dc.l _NewRequest
- dc.l _EventAbfrage
- dc.l _Print
- dc.l _Box
- dc.l _Center
- dc.l _Gadget_On
- dc.l _Gadget_Off
- dc.l _GetPropPosH
- dc.l _GetPropPosV
- dc.l _SetPropPosH
- dc.l _SetPropPosV
- dc.l _PrepareTmpRas
- dc.l _ClearTmpRas
- dc.l _PrepareArea
- dc.l _ClearArea
- dc.l _UmwStoF
- dc.l _Fak
- dc.l _NuK
- dc.l _berechnen
- dc.l _Init_Konst
- dc.l _Init_Mem
- dc.l _Init_Block
- dc.l _Set_Konst_P
- dc.l _GetKonst_P
- dc.l _PreCalc
- dc.l _Calc_P
- dc.l _Free_Konst
- dc.l _Free_Block
- dc.l .CreatePort
- dc.l .DeletePort
- dc.l .CreateExtIO
- dc.l .DeleteExtIO
- dc.l .CreateStdIO
- dc.l .DeleteStdIO
- dc.l _LastMenu
- dc.l _LastItem
- dc.l _LastSub
- dc.l _AddMenu
- dc.l _AddItem
- dc.l _AddSub
- dc.l _GetItem
- dc.l _ClearMenu
- dc.l _FreeItem
- dc.l _FreeMenu
- dc.l _NewSetMenuStrip
- dc.l -1
-
-
- dataTable:
- INITBYTE LH_TYPE,NT_LIBRARY
- INITLONG LN_NAME,libraryName
- INITBYTE LIB_FLAGS,LIBF_SUMUSED!LIBF_CHANGED
- INITWORD LIB_VERSION,VERSION
- INITWORD LIB_REVISION,REVISION
- INITLONG LIB_IDSTRING,idString
- dc.l 0
-
-
- .InitLib:
- move.l a5,-(sp)
- movea.l d0,a5
- move.l a0,extin_SegList(a5)
- lea gfxName(pc),a1
- moveq #LIBRARY_VERSION,d0
- callsys OpenLibrary
- tst d0
- beq.s 1$
- move.l d0,_GfxBase
- move.l d0,extin_GfxBase(a5)
-
- lea intName(pc),a1
- moveq #LIBRARY_VERSION,d0
- callsys OpenLibrary
- tst d0
- beq.s 1$
- move.l d0,_IntuitionBase
- move.l d0,extin_IntuitionBase(a5)
-
- lea mabName(pc),a1
- moveq #LIBRARY_VERSION,d0
- callsys OpenLibrary
- tst d0
- beq.s 1$
- move.l d0,_MathIeeeDoubBasBase
- move.l d0,extin_MathIeeeDoubBasBase(a5)
-
- lea matName(pc),a1
- moveq #LIBRARY_VERSION,d0
- callsys OpenLibrary
- tst d0
- beq.s 1$
- move.l d0,_MathIeeeDoubTransBase
- move.l d0,extin_MathIeeeDoubTransBase(a5)
-
- move.l a6,extin_SysBase(a5)
- move.l a6,_SysBase
- move.l a5,d0
- 1$ movea.l (sp)+,a5
- rts
-
- .OpenLib:
- addq.w #1,LIB_OPENCNT(a6)
- bclr #LIBB_DELEXP,LIB_FLAGS(a6)
- move.l a6,d0
- rts
-
- .CloseLib:
- moveq #0,d0
- subq.w #1,LIB_OPENCNT(a6)
- bne.s 1$
- btst #LIBB_DELEXP,LIB_FLAGS(a6)
- beq.s 1$
- bsr.s .ExpungeLib
- 1$ rts
-
- .ExpungeLib:
- movem.l d2/a5/a6,-(sp)
- tst.w LIB_OPENCNT(a6)
- beq.s 1$
- bset #LIBB_DELEXP,LIB_FLAGS(a6)
- moveq #0,d0
- bra.s 2$
- 1$ move.l a6,a5
-
- move.l extin_SysBase(a5),a6
- movea.l extin_GfxBase(a5),a1
- callsys CloseLibrary
- movea.l extin_IntuitionBase(a5),a1
- callsys CloseLibrary
- movea.l extin_MathIeeeDoubBasBase(a5),a1
- callsys CloseLibrary
- movea.l extin_MathIeeeDoubTransBase(a5),a1
- callsys CloseLibrary
-
- move.l a5,a1
- callsys Remove
- move.l extin_SegList(a5),d2
- movea.l a5,a1
- moveq #0,d0
- move.w LIB_NEGSIZE(a5),d0
- suba.l d0,a1
- add.w LIB_POSSIZE(a5),d0
- callsys FreeMem
- move.l d2,d0
- 2$ movem.l (sp)+,d2/a5/a6
- rts
-
-
- .ExtFuncLib:
- moveq #0,d0
- rts
-
-
- * Konvertierungsroutinen (Parameter aus den Registern auf den Stack)
-
- .CreatePort
- move.l a6,-(sp)
- move.l d0,-(a7)
- move.l a0,-(a7)
- jsr _CreatePort
- add.l #8,sp
- move.l (sp)+,a6
- rts
-
- .DeletePort
- move.l a6,-(sp)
- move.l a0,-(a7)
- jsr _DeletePort
- addq.l #4,sp
- move.l (sp)+,a6
- rts
-
- * Die Funktionen sind gleich, StdIO benutzt feste Speichergröße
- .CreateStdIO
- moveq #IOSTD_SIZE,d0
- .CreateExtIO
- move.l d0,-(a7)
- move.l a0,-(a7)
- jsr _CreateExtIO
- add.l #8,sp
- rts
-
- * Die Funktionen sind gleich, StdIO benutzt feste Speichergröße
-
- .DeleteStdIO
- moveq #IOSTD_SIZE,d0
- .DeleteExtIO
- move.l a0,-(a7)
- jsr _DeleteExtIO
- addq.l #4,sp
- rts
-
-
-
-
-
- EndCode:
-
-
- section "data2",bss
-
- * Die öffentlichen Symbole
-
- _SysBase ds.l 1
- _GfxBase ds.l 1
- _IntuitionBase ds.l 1
- _MathIeeeDoubBasBase ds.l 1
- _MathIeeeDoubTransBase ds.l 1
-
-
- end
-
-