Don't just copy into System heap

This commit is contained in:
Elliot Nunn 2020-10-24 07:01:07 +08:00
parent 87c6fc69d6
commit 34e139a963

View File

@ -6,36 +6,20 @@ myDRefNum equ ~myUnitNum
move.l #'DRVR',-(SP) move.l #'DRVR',-(SP)
move.w #128,-(SP) move.w #128,-(SP)
dc.w $A81F ; _Get1Resource dc.w $A81F ; _Get1Resource
move.l (SP)+,A3 move.l (SP)+,A4
move.l A3,D0 move.l A4,D0
bne.s noGetResErr bne.s noGetResErr
dc.w $A9FF ; _Debugger dc.w $A9FF ; _Debugger
noGetResErr noGetResErr
; Size it for the copy move.l A4,-(SP)
move.l A3,A0 dc.w $A992 ; _DetachResource
dc.w $A025 ; _GetHandleSize
move.l D0,D4
; Create a nonrelocatable block in the system heap move.l A4,A0
dc.w $A51E ; _NewPtrSys dc.w $A029 ; _HLock
move.l A0,A4
move.l A4,D0 move.l (A4),A4
bne.s noNewPtrErr
dc.w $A9FF ; _Debugger
noNewPtrErr
; Copy it there
move.l (A3),A0
move.l A4,A1
move.l D4,D0
dc.w $A02E ; _BlockMove (yes, of code)
; No further use for our resource
move.l A3,-(SP)
dc.w $A9A3 ; _ReleaseResource
; Install the driver in the unit table ; Install the driver in the unit table
move.l A4,A0 move.l A4,A0