1 line
8.4 KiB
ArmAsm
1 line
8.4 KiB
ArmAsm
|
load 'macros.dump'
include 'driver.equ'
include 'pl.equ'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT P_PageRect
IMPORT P_FullPageRect
IMPORT P_PrintHand
IMPORT D_BitMapChanged
IMPORT D_Deref
IMPORT X_DoAsciitoPLText
IMPORT D_DrawIcon
IMPORT X_DrawPLText
IMPORT D_NeedHand
IMPORT P_AddObjRgn
IMPORT P_BtmHdl
IMPORT P_Constrain
IMPORT P_ContentRect
IMPORT P_CurrentWin
IMPORT P_DefColor
IMPORT P_DoHandles
IMPORT P_DrawContent
IMPORT P_FixRect
IMPORT P_GetPageMode
IMPORT P_LineSize
IMPORT P_Local2PL
IMPORT P_MagPt
IMPORT P_Mask
IMPORT P_MinHdl
IMPORT P_ObjList
IMPORT P_Page
IMPORT P_PageMode
IMPORT P_PlsHdl
IMPORT P_SpecStr
IMPORT P_TopHdl
IMPORT P_TrackCursor
IMPORT D_SectRgnRect
IMPORT D_Set4Pat
IMPORT T_ScalePort
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY P_SetPen
;-----------------------------------------------------------------------------
;
; P_DrawFigure (Figure:w,Pt1:l,Pt2:l)
;
P_DrawFigure PROC EXPORT
;Using P_Data
;Using P_ObjData
INPUT Figure:w,Pt1:l,Pt2:l
LOCAL Q_Rect:r,PageMode:w,Pen:l,Q_OvalSize:w
BEGIN
movelong Pt1,Q_Rect
movelong Pt2,Q_Rect+4
rcall P_GetPageMode,out=(PageMode:a)
call P_FixRect,in=(!Q_Rect:l,Figure:w,PageMode:w,#1:w)
lda Figure
asl a
tax
jmp (JumpTable,x)
JumpTable
DC.W DoRect ; 0
DC.W DoRect ; 1
DC.W DoRect ; 2
DC.W DoRect ; 3
DC.W DoLine ; 4
DC.W DoLine ; 5
DC.W DoRect ; 6
DC.W DoRoundRect ; 7
DC.W DoOval ; 8
DC.W DoRect ; 9
DoLine
cmpl Q_Rect,Q_Rect+4
beq ToExit
tool _MoveTo,in=(Q_Rect:l)
tool _LineTo,in=(Q_Rect+4:l)
ToExit bra Exit
DoRect
tool _FrameRect,in=(!Q_Rect:l)
bra Exit
DoRoundRect
moveword #20,Q_OvalSize
moveword #40,Q_OvalSize+2
lda PageMode
beq NoScale
tool _ScalePt,in=(!Q_OvalSize:l,#P_PageRect:l,#P_FullPageRect:l)
NoScale
tool _FrameRRect,in=(!Q_Rect:l,Q_OvalSize:l)
bra Exit
DoOval
tool _FrameOval,in=(!Q_Rect:l)
Exit
RETURN
ENDP
;------------------------------------------------------------------------------
;
; P_DrawSpec (ObjPtr:l)
;
P_DrawSpec PROC EXPORT
;Using P_Data
;Using P_ObjData
;Using T_Data
;Using D_GlobalData
INPUT ObjPtr:l
LOCAL AsciiHdl:l,StaticText:l,Lngth:l,Port:l
LOCAL Q_Rect:r,ScaleRect:r
BEGIN
lda P_SpecStr
and #$ff
sta Lngth
stz Lngth+2
call D_NeedHand,in=(Lngth:l),out=(AsciiHdl:l)
jcs Exit
tool _PtrToHand,in=(#P_SpecStr+1:l,AsciiHdl:l,Lngth:l)
in AsciiHdl:l,[ObjPtr]:#P_ItemFontId:l,[ObjPtr]:#P_ItemColor:w
out StaticText:l
xcall X_DoAsciitoPLText
jcs Done2
moverect [ObjPtr]:#P_ObjRect,Q_Rect
lda P_PageMode
bne OffScreen
call P_FixRect,in=(!Q_Rect:l,#P_RECTANGLE:w,#0:w,#1:w)
call X_DrawPLText,in=(StaticText:l,!Q_Rect:l)
brl Done1
OffScreen
subword Q_Rect+4,Q_Rect,a
cmp #100
blt VOkay
addword Q_Rect,#100,Q_Rect+4
VOkay
moverect Q_Rect,ScaleRect
tool _MapRect,in=(!ScaleRect:l,#P_PageRect:l,#P_FullPageRect:l)
subword Q_Rect+4,Q_Rect,Q_Rect+4
subword Q_Rect+6,Q_Rect+2,Q_Rect+6
stz Q_Rect
stz Q_Rect+2
tool _SetPort,in=(T_ScalePort:l)
tool _EraseRect,in=(!Q_Rect:l)
call X_DrawPLText,in=(StaticText:l,!Q_Rect:l)
tool _SetPort,in=(P_CurrentWin:l)
pushlong T_ScalePort ;Src LocInfo
pushlong P_CurrentWin ;Dest LocInfo
pushlong !Q_Rect ;Src Q_Rect
pushlong !ScaleRect ;Dest Q_Rect
pushword #NotBIC ;Mode
pushlong #0
_CopyPixels
moveword #1,>D_BitMapChanged
Done1 tool _DisposeHandle,in=(StaticText:l)
Done2 tool _DisposeHandle,in=(AsciiHdl:l)
Exit RETURN
ENDP
;------------------------------------------------------------------------------
;
; P_IsObjSel () : Result:w
;
; Returns true if an object is selected.
P_IsObjSel PROC EXPORT
;Using P_Data
;Using P_ObjData
OUTPUT Result:w
LOCAL ObjHdl:l,ObjPtr:l
BEGIN
stz Result
movelong P_ObjList,ObjHdl
Loop cpzl ObjHdl
beq Exit
movelong [Obj
|