sys7.1-doc-wip/Libs/InterfaceSrcs/RESOURCES.a
2019-07-27 22:37:48 +08:00

141 lines
5.2 KiB
Plaintext

include 'macintosh.a'
; resources.a
;
; Copyright Apple Computer, Inc. 1984-87
; All rights reserved.
BLANKS ON
STRING ASIS
createresfile proc EXPORT
import c2pstr ; c2pstr(s) char *s;
import p2cstr ; p2cstr(s) char *s;
move.l d2,-(sp) ; save register d2
move.l 8(sp),-(sp) ; push copy of first parameter
jsr c2pstr ; convert to Pascal string
dc.w $A9B1 ; trap to createresfile
move.l 8(sp),-(sp) ; push copy of first paramter
jsr p2cstr ; convert back to C string
add.w #4,sp ; balance stack
move.l (sp)+,d2 ; restore register d2
rts
openresfile proc EXPORT
import c2pstr ; c2pstr(s) char *s;
import p2cstr ; p2cstr(s) char *s;
move.l d2,-(sp) ; save register d2
clr.w -(sp) ; reserve space for result
move.l 10(sp),-(sp) ; push copy of first parameter
jsr c2pstr ; convert to Pascal string
dc.w $A997 ; trap to openresfile
move.l 10(sp),-(sp) ; push copy of first paramter
jsr p2cstr ; convert back to C string
add.w #4,sp ; balance stack
move.w (sp)+,d0 ; load result
ext.l d0 ; extend result to long
move.l (sp)+,d2 ; restore register d2
rts
; Michael Shannon Feb 21,1986 - added openrfperm
; KLH 4Feb87 changed 3rd param from 2Byte to SignedByte to work with ROM
; (Inside Mac, Vol IV had wrong interface for permission byte)
;
openrfperm proc EXPORT
import c2pstr ; c2pstr(s) char *s;
import p2cstr ; p2cstr(s) char *s;
move.l d2,-(sp) ; save register d2
clr.w -(sp) ; reserve space for result
move.l 10(sp),-(sp) ; push copy of first parameter
jsr c2pstr ; convert to Pascal string
move.w 20(sp),-(sp) ; second param, cvt int to 2Bytes
move.b 27(sp),-(sp) ; 3rd param, cvt int to 1 SignedByte
_OpenRFPerm
move.l 10(sp),-(sp) ; push copy of first paramter
jsr p2cstr ; convert back to C string
add.w #4,sp ; balance stack
move.w (sp)+,d0 ; load result
ext.l d0 ; extend result to long
move.l (sp)+,d2 ; restore register d2
rts
getnamedresource proc EXPORT
import c2pstr ; c2pstr(s) char *s;
import p2cstr ; p2cstr(s) char *s;
move.l d2,-(sp) ; save register d2
clr.l -(sp) ; reserve space for result
move.l 12(sp),-(sp) ; push copy of first parameter
move.l 20(sp),-(sp) ; push copy of second parameter
jsr c2pstr ; convert to Pascal string
dc.w $A9A1 ; trap to getnamedresource
move.l 16(sp),-(sp) ; push copy of second paramter
jsr p2cstr ; convert back to C string
add.w #4,sp ; balance stack
move.l (sp)+,d0 ; load result
move.l (sp)+,d2 ; restore register d2
rts
get1namedresource proc EXPORT
import c2pstr ; c2pstr(s) char *s;
import p2cstr ; p2cstr(s) char *s;
move.l d2,-(sp) ; save register d2
clr.l -(sp) ; reserve space for result
move.l 12(sp),-(sp) ; push copy of first parameter
move.l 20(sp),-(sp) ; push copy of second parameter
jsr c2pstr ; convert to Pascal string
dc.w $A820 ; trap to get1namedresource
move.l 16(sp),-(sp) ; push copy of second paramter
jsr p2cstr ; convert back to C string
add.w #4,sp ; balance stack
move.l (sp)+,d0 ; load result
move.l (sp)+,d2 ; restore register d2
rts
getresinfo proc EXPORT
import c2pstr ; c2pstr(s) char *s;
import p2cstr ; p2cstr(s) char *s;
move.l d2,-(sp) ; save register d2
move.l 8(sp),-(sp) ; push copy of first parameter
move.l 16(sp),-(sp) ; push copy of second parameter
move.l 24(sp),-(sp) ; push copy of third parameter
move.l 32(sp),-(sp) ; push copy of fourth parameter
dc.w $A9A8 ; trap to getresinfo
move.l 20(sp),-(sp) ; push copy of fourth paramter
jsr p2cstr ; convert back to C string
add.w #4,sp ; balance stack
move.l (sp)+,d2 ; restore register d2
rts
setresinfo proc EXPORT
import c2pstr ; c2pstr(s) char *s;
import p2cstr ; p2cstr(s) char *s;
move.l d2,-(sp) ; save register d2
move.l 8(sp),-(sp) ; push copy of first parameter
move.w 18(sp),-(sp) ; push copy of second parameter
move.l 22(sp),-(sp) ; push copy of third parameter
jsr c2pstr ; convert to Pascal string
dc.w $A9A9 ; trap to setresinfo
move.l 16(sp),-(sp) ; push copy of third paramter
jsr p2cstr ; convert back to C string
add.w #4,sp ; balance stack
move.l (sp)+,d2 ; restore register d2
rts
addresource proc EXPORT
import c2pstr ; c2pstr(s) char *s;
import p2cstr ; p2cstr(s) char *s;
move.l d2,-(sp) ; save register d2
move.l 8(sp),-(sp) ; push copy of first parameter
move.l 16(sp),-(sp) ; push copy of second parameter
move.w 26(sp),-(sp) ; push copy of third parameter
move.l 30(sp),-(sp) ; push copy of fourth parameter
jsr c2pstr ; convert to Pascal string
dc.w $A9AB ; trap to addresource
move.l 20(sp),-(sp) ; push copy of fourth paramter
jsr p2cstr ; convert back to C string
add.w #4,sp ; balance stack
move.l (sp)+,d2 ; restore register d2
rts
END