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
1 changed files with 7 additions and 23 deletions

View File

@ -6,36 +6,20 @@ myDRefNum equ ~myUnitNum
move.l #'DRVR',-(SP)
move.w #128,-(SP)
dc.w $A81F ; _Get1Resource
move.l (SP)+,A3
move.l (SP)+,A4
move.l A3,D0
move.l A4,D0
bne.s noGetResErr
dc.w $A9FF ; _Debugger
noGetResErr
; Size it for the copy
move.l A3,A0
dc.w $A025 ; _GetHandleSize
move.l D0,D4
move.l A4,-(SP)
dc.w $A992 ; _DetachResource
; Create a nonrelocatable block in the system heap
dc.w $A51E ; _NewPtrSys
move.l A0,A4
move.l A4,A0
dc.w $A029 ; _HLock
move.l A4,D0
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
move.l (A4),A4
; Install the driver in the unit table
move.l A4,A0