antoine-source/appleworksgs/PL/Src/PARRANGE.S

1 line
5.3 KiB
ArmAsm
Raw Normal View History

2023-03-04 02:45:20 +00:00
load 'macros.dump' include 'driver.equ' include 'pl.equ' ;----------------------------------------------- ; ; Imported addresses ; ;----------------------------------------------- IMPORT D_Deref IMPORT D_LoadSegment IMPORT Q_ManglePict IMPORT Q_ManglePoint IMPORT D_MemoryError IMPORT P_AddObjRgn IMPORT P_BoundsRect IMPORT P_BuildUndo IMPORT P_DrawRgn IMPORT P_FixRect IMPORT P_FixSpecRect IMPORT P_InsertObj IMPORT P_LastObj IMPORT P_ObjList IMPORT P_PrintHand IMPORT P_RemoveObj IMPORT T_ReThread IMPORT D_UnloadSegment ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY P_DoRotate ENTRY P_RotateRect ;------------------------------------------------------------------------- ; ; P_BringFront () ; P_BringFront PROC EXPORT ;Using P_Data ;Using P_ObjData local ObjHdl:l,PlaceHdl:l,ObjPtr:l,NextObj:l,UpdateRgn:l begin +b call P_BuildUndo,in=(#P_NoUndo:w) tool _NewRgn,out=(UpdateRgn:l) movelong P_ObjList,ObjHdl stzl PlaceHdl Loop cpzl ObjHdl beq EndLoop movelong [ObjHdl],ObjPtr movelong [ObjPtr],NextObj moveword [ObjPtr]:#P_Selected,a beq NoChange tool _HLock,in=(ObjHdl:l) call P_AddObjRgn,in=(ObjPtr:l,UpdateRgn:l) tool _HUnlock,in=(ObjHdl:l) call P_RemoveObj,in=(ObjHdl:l) call P_InsertObj,in=(ObjHdl:l,PlaceHdl:l) movelong ObjHdl,PlaceHdl NoChange movelong NextObj,ObjHdl bra Loop EndLoop call P_DrawRgn,in=(UpdateRgn:l) return ENDP ;------------------------------------------------------------------------- ; ; P_SendBack () P_SendBack PROC EXPORT ;Using P_Data ;Using P_ObjData local ObjHdl:l,ObjPtr:l,NextObj:l,UpdateRgn:l,LastObj:l begin +b call P_BuildUndo,in=(#P_NoUndo:w) tool _NewRgn,out=(UpdateRgn:l) movelong P_ObjList,ObjHdl movelong P_LastObj,LastObj cpzl ObjHdl beq EndLoop Loop movelong [ObjHdl],ObjPtr movelong [ObjPtr],NextObj moveword [ObjPtr]:#P_Selected,a beq NoChange tool _HLock,in=(ObjHdl:l) call P_AddObjRgn,in=(ObjPtr:l,UpdateRgn:l) call P_RemoveObj,in=(ObjHdl:l) call P_InsertObj,in=(ObjHdl:l,P_LastObj:l) NoChange cmpl ObjHdl,LastObj beq EndLoop movelong NextObj,ObjHdl bra Loop EndLoop call P_DrawRgn,in=(UpdateRgn:l) Exit return ENDP ;--------------------------------------------------------------------------- ; ; P_FlipHoriz () ; P_FlipHoriz PROC EXPORT begin call P_DoRotate,in=(#0:w) return ENDP ;--------------------------------------------------------------------------- ; ; P_FlipVert () ; P_FlipVert PROC EXPORT begin call P_DoRotate,in=(#1:w) return ENDP ;--------------------------------------------------------------------------- ; ; P_RotateLeft ; P_RotateLeft PROC EXPORT begin call P_DoRotate,in=(#3:w) return ENDP ;--------------------------------------------------------------------------- ; ; P_RotateRight ; P_RotateRight PROC EXPORT begin call P_DoRotate,in=(#2:w) return ENDP ;------------------------------------------------------------------------------ ; ; P_DoRotate (Verb:w) ; P_DoRotate PROC EXPORT ;Using P_Data ;Using P_ObjData input Verb:w local ObjHdl:l,ObjPtr:l,UpdateRgn:l,UnionRect:r local PrintHdl:l,PrintPtr:l,Scale:l,ObjType:w local PictHdl1:l,PictHdl2:l begin +b call D_LoadSegment,in=(#segPict:w,#4:w),out=(a:l) jcs _MemErr call P_BuildUndo,in=(#P_NoUndo:w) movelong P_PrintHand,PrintHdl movelong [PrintHdl],PrintPtr tool _FixRatio,in=([PrintPtr]:#6:w,[PrintPtr]:#4:w),out=(Scale:l) movelong P_ObjList,ObjHdl call P_BoundsRect,in=(P_ObjList:l,!UnionRect:l),out=(a:w) tool _NewRgn,out=(UpdateRgn:l) movelong P_ObjList,ObjHdl Loop cpzl ObjHdl jeq EndLoop rcall D_Deref,in=(ObjHdl:ax),out=(ObjPtr:ax) moveword [ObjPtr]:#P_Selected,a jeq NextObj call P_AddObjRgn,in=(ObjPtr:l,UpdateRgn:l) moveword [ObjPtr]:#P_Type,ObjType cmp #P_PICTURE jne NotPict movelong [ObjPtr]:#P_PictHandle,PictHdl1 call Q_ManglePict,in=(PictHdl1:l,Verb: