1 line
7.3 KiB
ArmAsm
1 line
7.3 KiB
ArmAsm
|
load 'macros.dump'
include 'driver.equ'
include 'pl.equ'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT D_Deref
IMPORT P_AddObjRgn
IMPORT P_AddThreadRgn
IMPORT P_BoundsRect
IMPORT P_BuildUndo
IMPORT P_Constrain
IMPORT P_DrawFigure
IMPORT P_DrawHandles
IMPORT P_DrawRgn
IMPORT P_FixRect
IMPORT P_FixSpecRect
IMPORT P_ListOp
IMPORT P_Local2PL
IMPORT P_MagMove
IMPORT P_MagPt
IMPORT P_ObjList
IMPORT P_TrackCursor
IMPORT D_Set4Pat
IMPORT T_ReThread
IMPORT P_PrintHand
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY P_WaitMouse
;------------------------------------------------------------------------------
;
; P_MoveObject (ObjHdl:l, AnchorPt:l)
;
P_MoveObject PROC EXPORT
;Using P_Data
;Using P_ObjData
INPUT ObjHdl:l,AnchorPt:l
LOCAL ObjPtr:l,NewPt:l,ObjType:w,ObjCount:w
LOCAL Q_Rect:r,MultRect:r,TRect:r,TMultRect:r
LOCAL HDiff:w,VDiff:w,UpdateRgn:l,RealPt:l
BEGIN
call P_WaitMouse,in=(AnchorPt:l),out=(a:w)
jeq Exit
rcall D_Deref,in=(ObjHdl:ax),out=(ObjPtr:ax)
moveword [ObjPtr]:#P_Type,ObjType
moverect [ObjPtr]:#P_ObjRect,Q_Rect
call P_BoundsRect,in=(P_ObjList:l,!MultRect:l),out=(ObjCount:w)
tool _SetPenMode,in=(#notXOR:w)
tool _SetPenSize,in=(#2:w,#1:w)
call D_Set4Pat,in=(#LeftGray:w)
WhileLoop
tool _GetMouse,in=(!NewPt:l)
call P_TrackCursor,in=(!NewPt:l)
rcall P_Local2PL,in=(NewPt:ax),out=(NewPt:ax)
movelong NewPt,RealPt
in #P_MOVEMENT:w,AnchorPt:l,!NewPt:l,P_PrintHand:l
xcall P_Constrain
subword NewPt,AnchorPt,VDiff
subword NewPt+2,AnchorPt+2,HDiff
; Change Q_Rect
addword VDiff,Q_Rect,TRect
addword VDiff,Q_Rect+4,TRect+4
addword HDiff,Q_Rect+2,TRect+2
addword HDiff,Q_Rect+6,TRect+6
call P_MagMove,in=(!TRect:l)
subword TRect,Q_Rect,VDiff
subword TRect+2,Q_Rect+2,HDiff
call P_DrawFigure,in=(ObjType:w,TRect:l,TRect+4:l)
cmpw ObjCount,#2
blt NoMultDraw
; Change MultRect
addword VDiff,MultRect,TMultRect
addword VDiff,MultRect+4,TMultRect+4
addword HDiff,MultRect+2,TMultRect+2
addword HDiff,MultRect+6,TMultRect+6
call D_Set4Pat,in=(#RightGray:w)
call P_DrawFigure,in=(#P_RECTANGLE:w,TMultRect:l,TMultRect+4:l)
call D_Set4Pat,in=(#LeftGray:w)
NoMultDraw
call P_WaitMouse,in=(RealPt:l),out=(a:w)
beq EndWhile
jsr EraseStuff
brl WhileLoop
EndWhile
jsr EraseStuff
_PenNormal
tool _HUnlock,in=(ObjHdl:l)
call P_BuildUndo,in=(#P_MoveUndo:w)
tool _NewRgn,out=(UpdateRgn:l)
call P_ListOp,in=(P_ObjList:l,#PL_AddUpdate:w,UpdateRgn:l,#0:l)
call P_ListOp,in=(P_ObjList:l,#PL_OffsetObj:w,HDiff:w,VDiff:w,#0:l)
call P_ListOp,in=(P_ObjList:l,#PL_AddUpdate:w,UpdateRgn:l,#0:l)
call P_DrawRgn,in=(UpdateRgn:l)
Exit RETURN
EraseStuff
call P_DrawFigure,in=(ObjType:w,TRect:l,TRect+4:l)
cmpw ObjCount,#2
blt NoMultErase
call D_Set4Pat,in=(#RightGray:w)
call P_DrawFigure,in=(#P_RECTANGLE:w,TMultRect:l,TMultRect+4:l)
call D_Set4Pat,in=(#LeftGray:w)
NoMultErase
rts
ENDP
;------------------------------------------------------------------------------
;
; P_StretchObj (ObjHdl:l; HandleNo:w; StartPt:l; ModFlags:w)
;
P_StretchObj PROC EXPORT
;Using P_Data
;Using P_ObjData
;Using T_TextEqu
INPUT ObjHdl:l,HandleNo:w,StartPt:l,ModFlags:w
LOCAL ObjPtr:l,Q_Rect:r,NRect:r,NewPt:l,Swapped:w
LOCAL ObjType:w,HDiff:w,VDiff:w,UpdateRgn:l
LOCAL MousePt:l,AnchorPt:l
BEGIN
call P_WaitMouse,in=(StartPt:l),out=(a:w)
jeq Exit
rcall D_Deref,in=(ObjHdl:ax),out=(ObjPtr:ax)
moveword [ObjPtr]:#P_Type,ObjType
moverect [ObjPtr]:#P_ObjRect,Q_Rect
moveword [ObjPtr]:#P_Selected,a
beq NotSelected
call P_DrawHandles,in=(ObjPtr:l)
NotSelected
moveword #1,[ObjPtr]:#P_Selected
tool _SetPenMode,in=(#notXOR:w)
tool _SetPenSize,in=(#2:w,#1:w)
call D_Set4Pat,in=(#LeftGray:w)
movelong StartPt,AnchorPt ; bogus; should never have 0 handle
lda HandleNo
asl a
tax
jmp (
|