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

1 line
13 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 X_CopyOneHandle IMPORT D_Deref IMPORT X_DisposeThread IMPORT P_AddObjRgn IMPORT P_AddThreadRgn IMPORT P_ChangePage IMPORT P_ContentRect IMPORT P_CopyObjList IMPORT P_CurrentWin IMPORT P_DelMarkObj IMPORT P_DelObjList IMPORT P_DeselectAll IMPORT P_DrawContent IMPORT P_DrawRgn IMPORT P_FixMenus IMPORT P_HorizGCount IMPORT P_HorizGuides IMPORT P_ListOp IMPORT P_LoadPage IMPORT P_MergeGuides IMPORT P_NewTool IMPORT P_NotActive IMPORT P_ObjList IMPORT P_Page IMPORT P_SavePage IMPORT P_SetDelFlag IMPORT P_VertGCount IMPORT P_VertGuides IMPORT D_SetFileChanged IMPORT D_SetUndoStr IMPORT T_Clear IMPORT T_ClearPrim IMPORT T_Copy IMPORT T_CopyPrim IMPORT T_CurParHdl IMPORT T_DotLine IMPORT T_DotOffset IMPORT T_DotParag IMPORT T_FixParag IMPORT T_InvSelect IMPORT T_MarkOffset IMPORT T_MarkParag IMPORT T_Paste IMPORT T_ReThread IMPORT T_TextSelect IMPORT T_JunkRight IMPORT T_JunkLeft IMPORT T_MakeParStyle ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY P_ClearStr ENTRY P_ColorStr ENTRY P_CropStr ENTRY P_CutStr ENTRY P_FillStr ENTRY P_FontStr ENTRY P_GuideStr ENTRY P_KillBuild ENTRY P_MoveStr ENTRY P_PenSizeStr ENTRY P_SizeStr ENTRY P_StretchStr ENTRY P_StyleStr ENTRY P_TypeStr ENTRY P_UndoAux1 ENTRY P_UndoAux2 ENTRY P_UndoAux3 ENTRY P_UndoAux4 ENTRY P_UndoAuxHdl ENTRY P_UndoHdl ENTRY P_UndoPage ENTRY P_UndoStrings ENTRY P_UndoType ENTRY P_RedoFlag ;----------------------------------------------------------------------------- ; ; P_SetUndoStr () ; ; Sets the undo string according to whats in P_UndoType P_SetUndoStr PROC EXPORT ;Using P_Data ;Using P_UndoDataSeg begin lda P_UndoType asl a asl a tax pushlong P_UndoStrings:x lda P_UndoType bpl NotRedo lda 3,s ora #$8000 sta 3,s NotRedo call D_SetUndoStr,in=(:l,P_CurrentWin:l) Exit return ENDP ;------------------------------------------------------------------------------- ; ; P_KillUndo () ; ; Kills the undo by throwing away the undo and setting the menu. P_KillUndo PROC EXPORT ;Using P_UndoDataSeg begin call P_KillBuild call P_SetUndoStr Exit return ENDP ;------------------------------------------------------------------------------ ; ; P_KillBuild () ; ; Kills whatever has been stored for the undo. P_KillBuild PROC EXPORT ;Using P_Data ;Using P_ObjData ;Using P_UndoDataSeg local CurPage:w begin lda P_UndoType asl a tax jmp (KillTable,x) KillTable DC.W Exit ;Can't Undo DC.W PartDelete ;Move DC.W PartDelete ;Stretch DC.W PartDelete ;Crop DC.W PartDelete ;Fill DC.W PartDelete ;Q_PenSize DC.W PartDelete ;ObjFontID DC.W PartDelete ;ObjFont DC.W PartDelete ;ObjStyle DC.W PartDelete ;ObjSize DC.W PartDelete ;ObjColor DC.W FullDelete ;ObjClear DC.W FullDelete ;ObjCut DC.W GuideDispose ;Guide DC.W TextDelete ;TextClear DC.W TextDelete ;TextCut DC.W Typing ;Typing PartDelete call P_DelObjList,in=(P_UndoHdl:l,#0:w,#1:w) brl Exit FullDelete moveword P_Page,CurPage cmp P_UndoPage beq PageOkay call P_SavePage,in=(CurPage:w) call P_LoadPage,in=(P_UndoPage:w) PageOkay lda P_UndoType bmi Redo call P_DelMarkObj bra CkReset Redo call P_ListOp,in=(P_ObjList:l,#PL_ClrUndoData:w,#0:l,#0:l) CkReset cmpw CurPage,P_UndoPage beq Exit call P_SavePage,in=(P_UndoPage:w) call P_LoadPage,in=(CurPage:w) bra Exit GuideDispose cpzl P_UndoHdl beq NotMe tool _DisposeHandle,in=(P_UndoHdl:l) NotMe cpzl P_UndoAuxHdl beq NotMe2 tool _DisposeHandle,in=(P_UndoAuxHdl:l) NotMe2 bra Exit TextDelete lda P_UndoType bmi Exit TextDispose call X_DisposeThread,in=(P_UndoHdl:l,#1:w) bra Exit Typing lda P_UndoType bmi TextDispose Exit stzl P_UndoHdl stz P_UndoType return ENDP ;---------