1 line
19 KiB
ArmAsm
1 line
19 KiB
ArmAsm
|
load 'macros.dump'
include 'driver.equ'
include 'pl.equ'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT Asc2Fix
IMPORT D_CloseDialog
IMPORT D_DecimalOnly
IMPORT D_Deref
IMPORT Fix2Asc
IMPORT D_GetNewModalDialog
IMPORT D_NeedHand
IMPORT P_AddGuide
IMPORT P_AllHGCount
IMPORT P_AllHGuides
IMPORT P_AllVGCount
IMPORT P_AllVGuides
IMPORT P_BuildUndo
IMPORT P_ContentRect
IMPORT P_DefSize
IMPORT P_DeleteData
IMPORT P_DoScritch
IMPORT P_DragStuff
IMPORT P_ExplodeGuide
IMPORT P_FindGuide
IMPORT P_Fix2Int
IMPORT P_FixPt
IMPORT P_H
IMPORT P_HorizGCount
IMPORT P_HorizGuides
IMPORT P_Local2PL
IMPORT P_LockGuides
IMPORT P_MergeGuides
IMPORT P_OldIdlePt
IMPORT P_PageMode
IMPORT P_PageRect
IMPORT P_PaperRect
IMPORT P_PrintHand
IMPORT P_SGuideDlog
IMPORT P_TrackMaskHorz
IMPORT P_TrackMaskVert
IMPORT P_TrackOn
IMPORT P_V
IMPORT P_VRulRect
IMPORT P_VertGCount
IMPORT P_VertGuides
IMPORT P_VisGuides
IMPORT D_Set4Pat
IMPORT D_SetCursor
IMPORT D_UnLock
IMPORT D_FastMult
IMPORT P_FullPaperRect
IMPORT D_UseStdColors
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY P_DrawAGuide
ENTRY P_KillOldGuides
; pguide.s
;-----------------------------------------------------------------------------
;
; P_NewGuide (Vert:w)
;
P_NewGuide PROC EXPORT
;Using P_Data
input Vert:w
local Amount:w,Count:w,Offset:w,guiderect:r
local Max:w,Min:w,array:l,dist:w,tmprect:r
local amt:l,newcount:w
error err
begin
stz err
lda vert
bne SetVert
call D_SetCursor,in=(#UpDownCursor:w)
bra DidCursor
SetVert call D_SetCursor,in=(#LeftRightCursor:w)
DidCursor
movelong P_ContentRect+4,tmprect+4
stz tmprect
moveword P_VRulRect+2,tmprect+2
tool _ClipRect,in=(!tmprect:l)
lda vert
bne VertArray
moveword P_AllHGCount,Count
movelong P_AllHGuides,array
moveword P_ContentRect,Min
moveword P_ContentRect+4,Max
moveword #2,dist
bra DidArrays
VertArray moveword P_AllVGCount,Count
movelong P_AllVGuides,array
moveword P_ContentRect+2,Min
moveword P_ContentRect+6,Max
moveword #4,dist
DidArrays
in #641:w,#201:w,count:w,array:l,#P_DrawAGuide:l,#RulerGuide:w
in Vert:w,Max:w,Min:w,dist:w,#0:w
out newcount:w,amt:w
xerr err
xcall P_DragStuff
call P_BuildUndo,in=(#P_GuideUndo:w)
cmpw count,newcount
beq DidMove
lda vert
beq GetHoriz
movelong P_VertGuides,array
moveword P_VertGCount,count
bra DidArrays2
GetHoriz movelong P_HorizGuides,array
moveword P_HorizGCount,count
DidArrays2 bne Unlocked
NeedNew call D_NeedHand,in=(#4:l),out=(array:l)
Unlocked
; ; Place it in the array.
in amt:w,array:l,count:w,#RulerGuide:w
out a:w
xerr err
xcall P_AddGuide
done lda vert
beq HorizCount
inc P_VertGCount
inc P_AllVGCount
movelong array,P_VertGuides
bra DidMove
HorizCount inc P_HorizGCount
inc P_AllHGCount
movelong array,P_HorizGuides
DidMove
exit call P_MergeGuides
tool _ClipRect,in=(#P_ContentRect:l)
return
ENDP
;-----------------------------------------------------------------------------
;
; P_MoveGuide (Pt:l) -- localized Q_Point
;
; D_MouseDown at Pt.
; Look through page's guidelists to see if it should be dragged.
; If so, rip it out of the master guidelist, then call the drag
; routine with the master guidelist. Rip it out of the page
; guide list and re-insert it if it still exists.
;
; DragStuff needs to return a Q_Point. Guide existance can be checked
; by looking at the input/output count. The returned Q_Point is used
; for insertion into the page's guidelist.
;
P_MoveGuide PROC EXPORT
;Using P_Data
input Pt:l
output MovedIt:w
local vert:w,offset:w,array:l,count:w
local amt:w,newcount:w,OrigPt:l
local Max:w,Min:w,Dist:w
local tmprect:r,NewPt:l
local _p_array:l,_p_count:w
local hwidth:w,vwidth:w,guidetype:w
error err
begin
; Q_Point needs to be 'widened'
|