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

1 line
16 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_BeachBall IMPORT X_CopyOneHandle IMPORT D_Deref IMPORT D_FastMult IMPORT D_GrowHandle IMPORT D_NeedHand IMPORT P_CheckHand IMPORT P_FixMenus IMPORT T_ClearRulers IMPORT T_CopyParEnd IMPORT T_CurColor IMPORT T_CurFont IMPORT T_CurParHdl IMPORT T_CurStyle IMPORT T_DeletePars IMPORT T_DotLine IMPORT T_DotOffset IMPORT T_DotParag IMPORT T_FixParag IMPORT T_GetObjBound IMPORT T_GetParPtr IMPORT T_GetParSize IMPORT T_GetTextPtr IMPORT T_InvSelect IMPORT T_JunkLeft IMPORT T_JunkRight IMPORT T_LessRoom IMPORT T_MarkOffset IMPORT T_MarkParag IMPORT T_MulParag IMPORT T_NewParHdl IMPORT T_NewPars IMPORT T_PastePar IMPORT T_SetRulers IMPORT T_TextSelect IMPORT T_TrackFont IMPORT T_UnuseRuler IMPORT T_UpdatePars IMPORT P_RedoFlag IMPORT T_InsertFont ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY T_ClearPrim ENTRY T_CopyPrim ENTRY T_CopyText ENTRY T_MakeParStyle ;------------------------------------------------------------------------------ ; ; T_Clear () ; T_Clear PROC EXPORT ;Using T_Data ;Using T_TextEqu LOCAL CharCount:w,Temp:w,Ptr:l,StyleCount:w,DotPtr:l BEGIN jsl T_InvSelect pushword T_DotOffSet lda T_TextSelect jeq Exit jsl T_MakeParStyle cmpw T_DotOffset,#T_ParHeader beq NoJunk rcall T_JunkLeft,in=(T_MarkParag:a,T_MarkOffset:x) sta T_MarkOffset NoJunk rcall T_JunkRight,in=(T_DotParag:a,T_DotOffset:x) sta T_DotOffset in T_DotParag:w,T_DotOffset:w,T_MarkParag:w,T_MarkOffset:w out CharCount:w xcall T_ClearPrim bcs Exit stz T_TextSelect call T_FixParag,in=(T_DotParag:w,T_DotLine:w,CharCount:w) jsl P_FixMenus Exit pullword T_DotOffSet RETURN ENDP ******************************************************************** * * * T_MakeParStyle * This routine takes any style changes at the end of a selection (T_MarkOffSet) * and puts them in the parheader. * * Wednesday, September 6, 1989 4:44:21 PM (SFS) ******************************************************************** T_MakeParStyle PROC EXPORT LOCAL Temp:w,Ptr:l,StyleCount:w,DotPtr:l BEGIN cmpw T_DotOffset,#T_ParHeader bne Exit moveword T_MarkOffSet,Temp rcall T_JunkRight,in=(T_MarkParag:a,T_MarkOffset:x) sta T_MarkOffSet cmp Temp beq Exit subword T_MarkOffSet,Temp,StyleCount rcall T_GetTextPtr,in=(T_MarkParag:a),out=(Ptr:ax) rcall T_GetTextPtr,in=(T_DotParag:a),out=(DotPtr:ax) FontLoop ldy Temp lda [ptr],y jsr MakeMasterFont lda StyleCount bne FontLoop Exit Return MakeMasterFont and #$ff Shortm asl a tax iny lda [Ptr],y ;get the change value jmp (JumpTable,x) DoFont ldy #T_ParFont sta [DotPtr],y iny inc temp phy ldy temp iny lda [Ptr],y ply dec StyleCount bra AllDone DoStyle ldy #T_ParStyle bra AllDone DoSize ldy #T_ParSize bra AllDone DoColor ldy #T_ParColor AllDone sta [DotPtr],y inc temp inc temp dec StyleCount dec StyleCount Next longm rts JumpTable ds.b 2 ;nothing dc.w DoFont dc.w DoStyle dc.w DoSize dc.w Docolor EndP ;------------------------------------------------------------------------------ ; ; T_Paste (PasteHdl:l,MoveDot:w) ; T_Paste PROC EXPORT ;Using T_Data ;Using T_TextEqu INPUT PasteHdl:l,MoveDot:w LOCAL Ptr:l,NewTextHdl:l,RulerHdl:l,FirstRuler:l,NewPCount:w LOCAL Hdl:l,Dest:l,CharCount:w,BytesLess:w,CopySize:w LOCAL ParagPtr:l,TextBlock:l,TPtr:l,Offset:w LOCAL SPar:w,NewParag:w,NewOffset:w LOCAL ParagPtr1:l,ParagPtr2:l,ParOffset1:w,ParOffset2:w,ParagNo:w LOCAL TextHdl1:l,TextHdl2:l,TextPtr1:l,TextPtr2:l,OldTextHdl:l LOCAL TextSize1:w,TextSize2:w,ParDiff:w LOCAL TempHdl:l,TempPtr:l,OldDot:w ERROR Err BEGIN stz Err jsl T_Clear * This