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

1 line
14 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_BitMapChanged IMPORT D_BitMapPtr IMPORT D_ClearBitMap IMPORT D_Deref IMPORT D_DrawText IMPORT D_GetStats IMPORT D_KillFont IMPORT P_ContentRect IMPORT P_CurrentWin IMPORT P_DrawFigure IMPORT P_H IMPORT P_Page IMPORT P_PageMode IMPORT P_V IMPORT D_RectZap IMPORT D_SelectFont IMPORT D_Set4Pat IMPORT T_CountSpaces IMPORT T_CurColor IMPORT T_CurFont IMPORT T_CurParHdl IMPORT T_CurRulBits IMPORT T_CurSize IMPORT T_CurStyle IMPORT T_GetParPtr IMPORT T_GetSpacing IMPORT T_GetStart IMPORT T_LockLines IMPORT T_LockRuler IMPORT T_MulLine IMPORT T_ScalePort IMPORT T_TrackFont IMPORT T_UnlockRuler IMPORT T_UseTab IMPORT P_PageRect IMPORT P_FullPageRect ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY T_DrawLine ENTRY T_DrawLines ENTRY T_DrawOSLine ;------------------------------------------------------------------------------- ; ; T_Update (ObjHdl:l; Printing:w) ; T_Update PROC EXPORT ;Using P_Data ;Using P_ObjData ;Using T_Data ;Using T_TextEqu INPUT ObjHdl:l,Printing:w LOCAL ObjPtr:l,ParagHdl:l,ParagPtr:l LOCAL ParagNo:w,StartLine:w,VertPos:w,Q_Rect:r LOCAL ParagCount:w,MaxHeight:w BEGIN pushlong T_CurParHdl rcall D_Deref,in=(ObjHdl:ax),out=(ObjPtr:ax) movelong [ObjPtr]:#P_ParagHdl,ParagHdl movelong ParagHdl,T_CurParHdl rcall T_GetParPtr,in=(#0:a),out=(ParagPtr:ax) moveword [ParagPtr],ParagCount moverect [ObjPtr]:#P_ObjRect,Q_Rect subword Q_Rect+4,Q_Rect,MaxHeight lda Printing bne Skip tool _SetPensize,in=(#2:w,#1:w) call D_Set4Pat,in=(#3:w) call P_DrawFigure,in=(#P_RECTANGLE:w,Q_Rect:l,Q_Rect+4:l) tool _PenNormal Skip moveword [ObjPtr]:#P_StartParag,ParagNo moveword [ObjPtr]:#P_StartLine,StartLine stz VertPos lda ParagNo cmp #$FFFF beq Done ParLoop rcall T_GetParPtr,in=(ParagNo:a),out=(ParagPtr:ax) in ObjPtr:l,ParagNo:w,StartLine:w,[ParagPtr]:#T_LineCount:w in VertPos:w,#0:w out VertPos:w xcall T_DrawLines cmp MaxHeight bge Done inc ParagNo cmpw ParagNo,ParagCount bge Done stz StartLine bra ParLoop Done pulllong T_CurParHdl tool _HUnlock,in=(ObjHdl:l) RETURN ENDP ;------------------------------------------------------------------------------- ; ; T_DrawParag (ParagNo:w,StartLine:w,MaxLine:w,VertPos:w) ; ; Draw the specified lines in the specified paragraph. Cross object bounds ; if neccessary. ; ; Current Bugs ; 1. May not handle MaxLine correctly if it is not the last Q_Line ; and the paragraph crosses objects. T_DrawParag PROC EXPORT ;Using P_Data ;Using P_ObjData ;Using T_TextEqu ;Using T_Data INPUT ParagNo:w,StartLine:w,MaxLine:w,VertPos:w LOCAL ObjHdl:l,ObjPtr:l,ParagPtr:l BEGIN rcall T_GetParPtr,in=(ParagNo:a),out=(ParagPtr:ax) movelong [ParagPtr]:#T_ObjHdl,ObjHdl movelong [ObjHdl],ObjPtr ObjLoop cmpw ParagNo,[ObjPtr]:#P_EndParag blt CkDraw cmpw StartLine,[ObjPtr]:#P_EndLine bge NextObject CkDraw cmpw [ObjPtr]:#P_PageNo,P_Page bne NextObject tool _HLock,in=(ObjHdl:l) in ObjPtr:l,ParagNo:w,StartLine:w,MaxLine:w,VertPos:w,#1:w out a:w xcall T_DrawLines tool _HUnlock,in=(ObjHdl:l) NextObject movelong [ObjPtr]:#P_NThread,ObjHdl cpzl ObjHdl beq Exit movelong [ObjHdl],ObjPtr cmpw [ObjPtr]:#P_StartParag,ParagNo bne Exit moveword [ObjPtr]:#P_StartLine,StartLine stz VertPos brl ObjLoop Exit RETURN ENDP ;------------------------------------------------------------------------------- ; ; _DrawLines (ObjPtr:l,ParagNo:w,StartLine:w,EndLine:w,StartVert:w ; OffScreen:w): EndVert:w ; ; Draws the part of the paragraph specified by StartLine and EndLine. ; EndLine is really one larger than the last Q_Line drawn. ; It doesn't draw across object boundaries. T_DrawLines PROC EXPORT ;Using P_