supermario/base/SuperMarioProj.1994-02-09/Libs/InterfaceSrcs/WINDOWS.a
2019-06-29 23:17:50 +08:00

188 lines
7.1 KiB
Plaintext

;
; File: WINDOWS.a
;
; Copyright: © 1984-1990 by Apple Computer, Inc., all rights reserved.
;
; This file is used in these builds: ROM System
;
; Change History (most recent first):
;
; <4> 8/8/91 JL Fixed trackbox call. The result is a boolean but the glue was
; clearing a long on the stack to reserve space and then moving a
; long off the stack into d0 for the result. The result was always
; False.
; <3> 10/2/90 JAL added one useless comment about the need to save d2
; so we wouldn't forget to strip it out later.
; <2> 9/27/90 dba check in new version from Jim Lord (with TrackBox)
;
include 'macintosh.a'
; Modifications:
; 12 Jun 87 KLH added newcwindow.
; *** MPW 3.0d2 ***
newwindow proc EXPORT
import c2pstr ; c2pstr(s) char *s;
import p2cstr ; p2cstr(s) char *s;
move.l d2,-(sp) ; save register d2 **** NEEDED FOR GREEN HILLS C
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
move.l 28(sp),-(sp) ; push copy of third parameter
jsr c2pstr ; convert to Pascal string
move.b 39(sp),-(sp) ; push copy of fourth parameter
move.w 44(sp),-(sp) ; push copy of fifth parameter
move.l 48(sp),-(sp) ; push copy of sixth parameter
move.b 59(sp),-(sp) ; push copy of seventh parameter
move.l 62(sp),-(sp) ; push copy of eighth parameter
dc.w $A913 ; trap to newwindow
move.l 20(sp),-(sp) ; push copy of third 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
newcwindow 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
move.l 28(sp),-(sp) ; push copy of third parameter
jsr c2pstr ; convert to Pascal string
move.b 39(sp),-(sp) ; push copy of fourth parameter
move.w 44(sp),-(sp) ; push copy of fifth parameter
move.l 48(sp),-(sp) ; push copy of sixth parameter
move.b 59(sp),-(sp) ; push copy of seventh parameter
move.l 62(sp),-(sp) ; push copy of eighth parameter
dc.w $AA45 ; trap to newcwindow
move.l 20(sp),-(sp) ; push copy of third 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
setwtitle 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
jsr c2pstr ; convert to Pascal string
dc.w $A91A ; trap to setwtitle
move.l 12(sp),-(sp) ; push copy of second paramter
jsr p2cstr ; convert back to C string
add.w #4,sp ; balance stack
move.l (sp)+,d2 ; restore register d2
rts
getwtitle 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
dc.w $A919 ; trap to getwtitle
move.l 12(sp),-(sp) ; push copy of second paramter
jsr p2cstr ; convert back to C string
add.w #4,sp ; balance stack
move.l (sp)+,d2 ; restore register d2
rts
findwindow proc EXPORT
move.l d2,-(sp) ; save register d2
clr.w -(sp) ; reserve space for result
move.l 10(sp),a0 ; load address of first parameter
move.l (a0),-(sp) ; push value of first parameter
move.l 18(sp),-(sp) ; push copy of second parameter
dc.w $A92C ; trap to findwindow
move.w (sp)+,d0 ; load result
ext.l d0 ; extend result to long
move.l (sp)+,d2 ; restore register d2
rts
trackgoaway proc EXPORT
move.l d2,-(sp) ; save register d2
clr.b -(sp) ; reserve space for result
move.l 10(sp),-(sp) ; push copy of first parameter
move.l 18(sp),a0 ; load address of second parameter
move.l (a0),-(sp) ; push value of second parameter
dc.w $A91E ; trap to trackgoaway
move.b (sp)+,d0 ; load result
ext.w d0 ; extend result to word
ext.l d0 ; extend result to long
move.l (sp)+,d2 ; restore register d2
rts
dragwindow proc EXPORT
move.l d2,-(sp) ; save register d2
move.l 8(sp),-(sp) ; push copy of first parameter
move.l 16(sp),a0 ; load address of second parameter
move.l (a0),-(sp) ; push value of second parameter
move.l 24(sp),-(sp) ; push copy of third parameter
dc.w $A925 ; trap to dragwindow
move.l (sp)+,d2 ; restore register d2
rts
growwindow proc EXPORT
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),a0 ; load address of second parameter
move.l (a0),-(sp) ; push value of second parameter
move.l 28(sp),-(sp) ; push copy of third parameter
dc.w $A92B ; trap to growwindow
move.l (sp)+,d0 ; load result
move.l (sp)+,d2 ; restore register d2
rts
pinrect proc EXPORT
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),a0 ; load address of second parameter
move.l (a0),-(sp) ; push value of second parameter
dc.w $A94E ; trap to pinrect
move.l (sp)+,d0 ; load result
move.l (sp)+,d2 ; restore register d2
rts
draggrayrgn proc EXPORT
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),a0 ; load address of second parameter
move.l (a0),-(sp) ; push value of second parameter
move.l 28(sp),-(sp) ; push copy of third parameter
move.l 36(sp),-(sp) ; push copy of fourth parameter
move.w 46(sp),-(sp) ; push copy of fifth parameter
move.l 50(sp),-(sp) ; push copy of sixth parameter
dc.w $A905 ; trap to draggrayrgn
move.l (sp)+,d0 ; load result
move.l (sp)+,d2 ; restore register d2
rts
; Do code for trackbox glue here!
;int trackbox(w, pptr, pc)
;WindowPtr w;
;Point *pptr;
;short pc;
trackbox proc EXPORT
move.l d2,-(sp) ; save register d2
clr.b -(sp) ; reserve space for result <4>
move.l 12(sp),-(sp) ; push copy of first parameter
move.l 20(sp),a0 ; load address of second parameter
move.l (a0),-(sp) ; push value of second parameter
move.w 30(sp),-(sp) ; push copy of third parameter
dc.w $A83B ; trap to TrackBox
move.b (sp)+,d0 ; load result <4>
move.l (sp)+,d2 ; restore register d2
rts
END