1 line
21 KiB
ArmAsm
1 line
21 KiB
ArmAsm
|
load 'macros.dump'
include 'driver.equ'
include 'pl.equ'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT D_AddRectRgn
IMPORT D_Deref
IMPORT P_DrawHandles
IMPORT P_Fix2Int
IMPORT P_FixRect
IMPORT P_GetModifiers
IMPORT P_GetPageMode
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY P_AddObjRgn
ENTRY P_DoHandles
ENTRY P_FixSpecRect
ENTRY P_PtInLine
ENTRY P_PtInOval
ENTRY P_ValidRect
;------------------------------------------------------------------------------
;
; P_ListOp (ObjList:l,Oper:w,Data:l,Data2:l)
;
; Automatically skips any object with the Deleted flag set.
P_ListOp PROC EXPORT
;Using P_ObjData
INPUT ObjList:l,Oper:w,Data:l,Data2:l
LOCAL ObjPtr:l,ObjType:w,Selected:w,Q_Rect:r
BEGIN
ObjLoop cpzl ObjList
beq Exit
movelong [ObjList],ObjPtr
moveword [ObjPtr]:#P_Deleted,a
bne NextObj
tool _HLock,in=(ObjList:l)
moveword [ObjPtr]:#P_Type,ObjType
moveword [ObjPtr]:#P_Selected,Selected
moverect [ObjPtr]:#P_ObjRect,Q_Rect
lda Oper
asl a
tax
jsr (JumpTable,x)
tool _HUnlock,in=(ObjList:l)
NextObj movelong [ObjPtr],ObjList
bra ObjLoop
Exit RETURN
JumpTable
DC.W SelectRect
DC.W DeselectAll
DC.W SelectAll
DC.W FixTObj
DC.W OffsetObj
DC.W AddUpdate
DC.W ClrUndoData
DC.W SetUndoData
DC.W CpyUndoData
; -------- Operation 0
SelectRect
;TopLeft
tool _PtInRect,in=(!Q_Rect:l,Data:l),out=(a:w)
beq Exit0
;BottomRight
tool _PtInRect,in=(!Q_Rect+4:l,Data:l),out=(a:w)
beq Exit0
lda Selected
eor #1
moveword a,[ObjPtr]:#P_Selected
call P_DrawHandles,in=(ObjPtr:l)
Exit0 rts
; -------- Operation 1
;
; If Data is not 0, then don't D_Update the screen.
DeselectAll
lda Selected
beq Exit1
moveword #0,[ObjPtr]:#P_Selected
lda Data
bne Exit1
call P_DrawHandles,in=(ObjPtr:l)
Exit1 rts
; ------- Operation 2
SelectAll
lda Selected
bne Exit2
inc a
moveword a,[ObjPtr]:#P_Selected
call P_DrawHandles,in=(ObjPtr:l)
Exit2 rts
; ------- Operation 3
FixTObj
cmpw ObjType,#P_ALPHA
bne Exit3
moveword Data,[ObjPtr]:#P_PageNo
Exit3 rts
; ------- Operation 4
; Offsets all object Q_Rects by Data.
OffsetObj
lda Selected
beq Exit4
addword Q_Rect,Data,[ObjPtr]:#P_ObjRect
addword Q_Rect+4,Data,[ObjPtr]:#P_ObjRect+4
addword Q_Rect+2,Data+2,[ObjPtr]:#P_ObjRect+2
addword Q_Rect+6,Data+2,[ObjPtr]:#P_ObjRect+6
cmpw ObjType,#P_PICTURE
bne PictSet
addword [ObjPtr]:#P_PictRect,Data,[ObjPtr]:#P_PictRect
addword [ObjPtr]:#P_PictRect+4,Data,[ObjPtr]:#P_PictRect+4
addword [ObjPtr]:#P_PictRect+2,Data+2,[ObjPtr]:#P_PictRect+2
addword [ObjPtr]:#P_PictRect+6,Data+2,[ObjPtr]:#P_PictRect+6
PictSet
call P_FixSpecRect,in=(ObjPtr:l)
Exit4 rts
; ------- Operation 5
; Adds the selected objects to the D_Update Q_Region passed in Data.
AddUpdate
lda Selected
beq Exit5
call P_AddObjRgn,in=(ObjPtr:l,Data:l)
Exit5 rts
; ------ Operation 6
; Sets the UndoData for all selected objects.
ClrUndoData
moveword #0,[ObjPtr]:#P_UndoData
Exit6 rts
; ------ Operation 7
; Sets the UndoData for all selected objects.
SetUndoData
lda Selected
beq Exit7
moveword Data,[ObjPtr]:#P_UndoData
Exit7 rts
; ------ Operation 8
; Copies the UndoData into the Selected field. Used for redo of obj deletion.
CpyUndoData
moveword [ObjPtr]:#P_UndoData,[ObjPtr]:#P_Selected
Exit8 rts
ENDP
;------------------------------------------------------------------------------
;
; P_FindObject (ObjList:l,Pt:l) : ObjHdl:l,Handle:w
;
; Pt must be in screen coordinates.
;
; Returns 0 for ObjHdl if no object is found.
; Handle ranges from 1 to 4 for normal objects, and includes
; 5 and 6 for Q_Text objects.
;
; [BOGUS] -- leaves ObjHdl X_Locked.
P_FindObject PROC EXPORT
;Using P_Data
;Using P_ObjData
INPUT ObjList:l,Pt:l
OUTPUT ObjHdl:l,Handle:w
LOCAL ObjPtr:l,Q_Rect:r,InnerRect:r,HRect:r,PageMode:w
LOCAL ObjType:w,Q_PenSize:w
|