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

1 line
9.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_IsAlphaNum IMPORT D_IsDigit IMPORT D_IsLetter IMPORT P_KillUndo IMPORT P_Local2PL IMPORT P_TrackCursor IMPORT T_ClickCount IMPORT T_Dot IMPORT T_DotLine IMPORT T_DotObj IMPORT T_DotOffset IMPORT T_DotParag IMPORT T_DotPixs IMPORT T_DrawRuler IMPORT T_EraseCaret IMPORT T_GetLinePtr IMPORT T_GetTextPtr IMPORT T_InvSelect IMPORT T_InvertArea IMPORT T_JunkLeft IMPORT T_JunkRight IMPORT T_LastOffset IMPORT T_LastParag IMPORT T_Mark IMPORT T_MarkLine IMPORT T_MarkObj IMPORT T_MarkOffset IMPORT T_MarkParag IMPORT T_MarkPixs IMPORT T_NextChar IMPORT T_Offset2Pix IMPORT T_Pt2Offset IMPORT T_TextSelect ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY T_InWord ENTRY T_SelectLine ENTRY T_SelectWord ENTRY T_WordBounds ;-------------------------------------------------------------------------- ; ; T_SwapDotMark () ; T_SwapDotMark PROC EXPORT ;Using T_Data lda T_DotParag ldx T_MarkParag sta T_MarkParag stx T_DotParag lda T_DotOffset ldx T_MarkOffset sta T_MarkOffset stx T_DotOffset lda T_DotLine ldx T_MarkLine sta T_MarkLine stx T_DotLine lda T_DotPixs ldx T_MarkPixs sta T_MarkPixs stx T_DotPixs pushlong T_DotObj movelong T_MarkObj,T_DotObj pulllong T_MarkObj rtl ENDP ;------------------------------------------------------------------------------; ; ; T_Click (ObjHdl:l; Pt:l; ModFlags:w; Click:w) ; ; ThePoint should be in local coordinates. T_Click PROC EXPORT ;Using P_Data ;Using P_ObjData ;Using T_Data ;Using T_TextEqu INPUT ObjHdl:l,Pt:l,ModFlags:w,Click:w LOCAL ObjPtr:l LOCAL NewParag:w,NewLine:w,NewOffset:w,NewPixs:w,NewObj:l LOCAL EndPixs:w,EndPos:w,StartPixs:w,StartPos:w BEGIN jsl P_KillUndo jsl T_EraseCaret in ObjHdl:l,Pt:l out NewParag:w,NewOffset:w,NewLine:w,NewPixs:w xcall T_Pt2Offset movelong ObjHdl,NewObj lda Click cmp #1 jeq SingleClick cmpw NewParag,T_LastParag bne SingleClick cmpw NewOffset,T_LastOffset bne SingleClick lda T_ClickCount beq SingleClick cmp #1 beq DoubleClick TripleClick inc T_ClickCount inc T_TextSelect jsl T_InvSelect spacelong spacelong pushword NewParag pushword NewLine jsl T_SelectLine bra InitSelect DoubleClick inc T_ClickCount inc T_TextSelect jsl T_InvSelect spacelong spacelong pushword NewParag pushword NewOffset pushword NewLine jsl T_SelectWord InitSelect pullword T_MarkPixs pullword T_MarkOffset pullword T_DotPixs pullword T_DotOffset moveword NewParag,T_DotParag moveword a,T_MarkParag moveword NewLine,T_DotLine moveword a,T_MarkLine inc T_TextSelect jsl T_InvSelect brl DragLoop SingleClick moveword #1,T_ClickCount lda ModFlags and #ShiftKey beq ShiftUp lda T_TextSelect beq _NoSelect cmpw NewParag,T_DotParag blt Swap cmpw NewOffset,T_DotOffset bge ToAdd Swap jsl T_SwapDotMark ToAdd brl AddSelect _NoSelect movelong T_Dot,T_Mark movelong T_Dot+4,T_Mark+4 movelong T_Dot+8,T_Mark+8 brl AddSelect ShiftUp jsl T_InvSelect moveword NewParag,T_DotParag sta T_MarkParag moveword NewOffset,T_DotOffset sta T_MarkOffset moveword NewLine,T_DotLine sta T_MarkLine moveword NewPixs,T_DotPixs sta T_MarkPixs movelong NewObj,T_DotObj movelong NewObj,T_MarkObj DragLoop tool _StillDown,in=(#0:w),out=(a:w) jeq Up tool _GetMouse,in=(!Pt:l) call P_TrackCursor,in=(!Pt:l) rcall P_Local2PL,in=(Pt:ax),out=(Pt:ax) in ObjHdl:l,Pt:l out NewParag:w,NewOffset:w,NewLine:w,NewPixs:w xcall T_Pt2Offset lda T_ClickCount cmp #1 beq AddSelect cmp #2 beq ByWord ByLine spacelong spacelong pushword NewParag pushword NewLine jsl T_SelectLine bra SetNew ByWord spacelong spacelong pushword NewParag pushword Ne