
	xdef	_DLL_LoadLibrary
	xdef	_DLL_FreeLibrary
	xdef	_DLL_GetProcAddress
	xdef	_DLL_Exec
	xdef	_DLL_GetMemoryOffset
        xdef    _DLL_GetChipOffset

	xref	_uae_rombase
	xref	_dll_calltrap

	section text,code

; input  A0 dllname
; output D0 dllhandle
_DLL_LoadLibrary
;	move.l	A6,-(SP)
	moveq	#100,D0
	move.l	_dll_calltrap,-(SP)
	rts
;	move.l	_dll_calltrap,A6
;	jsr	(A6)
;	move.l	(SP)+,A6
	rts

; input  D1 dllhandle 
;        A0 function or variable name
; output D0 function or variable address
_DLL_GetProcAddress
	moveq	#101,D0
	move.l	_dll_calltrap,-(SP)
	rts
	rts

; input  A0 function address
; output D0 return
_DLL_Exec
	moveq	#102,D0
	move.l	_dll_calltrap,-(SP)
	rts
	rts

; input  D1 dllhandle
_DLL_FreeLibrary
	moveq	#103,D0
	move.l	_dll_calltrap,-(SP)
	rts
	rts

; input  void
; output D0 return memory offset for chip memory (area starting with 0)
_DLL_GetMemoryOffset
_DLL_GetChipOffset
	moveq	#105,D0
	move.l	_dll_calltrap,-(SP)
	rts
	rts
	
	end
