mirror of
https://github.com/antoinevignau/source.git
synced 2025-01-20 02:30:40 +00:00
1 line
10 KiB
ArmAsm
1 line
10 KiB
ArmAsm
|
load 'macros.dump'
include 'driver.equ'
include 'pl.equ'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT D_Deref
IMPORT D_DrawIcon
IMPORT P_ContentRect
IMPORT P_CtlBoxIcon
IMPORT P_CurrentWin
IMPORT P_DblPage
IMPORT P_DoScritch
IMPORT P_DrawGuides
IMPORT P_DrawObjList
IMPORT P_DrawRulers
IMPORT P_DrawTemplate
IMPORT P_DrawTools
IMPORT P_Entry
IMPORT P_FirstPOff
IMPORT P_FullPageRect
IMPORT P_FullPaperRect
IMPORT P_GrowIcon
IMPORT P_GrowRect
IMPORT P_H
IMPORT P_HScroll
IMPORT P_IconPalette
IMPORT P_LIcon
IMPORT P_LPageIcon
IMPORT P_L_ArrHollowIcon
IMPORT P_LastObj
IMPORT P_LoadWindowStuff
IMPORT P_NewClip
IMPORT P_NumberTab
IMPORT P_OldClip
IMPORT P_OldIdlePt
IMPORT P_PIconRect
IMPORT P_Page
IMPORT P_PageCount
IMPORT P_PageMode
IMPORT P_PageRect
IMPORT P_PageStart
IMPORT P_PaperRect
IMPORT P_PortRect
IMPORT P_RIcon
IMPORT P_RPageIcon
IMPORT P_R_ArrHollowIcon
IMPORT P_TIcon
IMPORT P_TrackOn
IMPORT P_UseTemplate
IMPORT P_V
IMPORT P_VScroll
IMPORT P_VisGuides
IMPORT P_VisPalette
IMPORT P_VisRuler
IMPORT P__LPIcon
IMPORT P__RPIcon
IMPORT D_RectSect
IMPORT D_Set4Pat
IMPORT T_BlinkCaret
IMPORT T_CaretDrawn
IMPORT T_Editing
IMPORT T_InvSelect
IMPORT T_TextSelect
IMPORT T_ThreadRgn
IMPORT D_UnLock
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY P_DrawAPage
ENTRY P_DrawContent
ENTRY P_PageIcons
ENTRY P_UpdateDoc
; pupdate.s
;-------------------------------------------------------------------------------
;
; P_ForceUpdate (WindowPtr:l)
;
; Forces an D_Update of the current window.
P_ForceUpdate PROC EXPORT
INPUT WindowPtr:l
BEGIN
tool _BeginUpdate,in=(WindowPtr:l)
call P_UpdateDoc,in=(WindowPtr:l)
tool _EndUpdate,in=(WindowPtr:l)
RETURN
ENDP
;------------------------------------------------------------------------------
;
; P_UpdateDoc (Window:l)
;
; Do not call BeginUpdate, EndUpdate or set your own origin.
;
P_UpdateDoc PROC EXPORT
;Using P_RulerData
;Using P_Data
;Using P_IconDATA
;Using P_ObjData
;Using T_Data
input window:l
local rectptr:l,rgn:l,OldWind:l,OldEdit:w,NotActive:w
local tmp:l,ObjHdl:l,ObjPtr:l,tmprect:r
begin +b
stz NotActive
cmpl Window,P_CurrentWin
beq DoUpdate
inc NotActive
movelong P_CurrentWin,OldWind
moveword T_Editing,OldEdit
stz T_Editing
call P_LoadWindowStuff,in=(window:l)
DoUpdate
tool _GetVisHandle,out=(rgn:l)
rcall D_Deref,in=(rgn:ax),out=(tmp:ax)
addlong tmp,#2,rectptr
tool _EraseRect,in=(RectPtr:l)
lda P_VisPalette
beq NoPalette
call D_RectSect,in=(rectptr:l,#P_IconPalette:l),out=(a:w)
beq NoPalette
moverect P_IconPalette,tmprect
moveword P_ContentRect+4,tmprect+4
tool _ClipRect,in=(!tmprect:l)
call P_DrawTools
NoPalette
DoRulers lda P_VisRuler
beq DoneRulers
call P_DrawRulers,in=(rgn:l)
DoneRulers
tool _ClipRect,in=(#P_PortRect:l)
; Redraw scritches.
lda P_TrackOn
beq CkGrow
call P_DoScritch,in=(P_OldIdlePt:l)
CkGrow
call D_RectSect,in=(rectptr:l,#P_GrowRect:l),out=(a:w)
beq CkScroll
pushlong #P_GrowIcon
subword P_GrowRect+2,#1,s
pushword P_GrowRect
pushword #modeCopy
jsl D_DrawIcon
CkScroll
movelong P_HScroll,tmp
spaceword
pushlong [tmp]:#0
addlong 1:s,#8,1:s ; get address of Q_Rect
call D_RectSect,in=(rectptr:l)
pla
beq CkVert
tool _DrawOneCtl,in=(P_HScroll:l)
CkVert
movelong P_VScroll,tmp
spaceword
pushlong [tmp]:#0
addlong 1:s,#8,1:s ; get address of Q_Rect
call D_RectSect,in=(rectptr:l)
pla
beq CkIcons
tool _DrawOneCtl,in=(P_VScroll:l)
CkIcons
call D_RectSect,in=(rectptr:l,#P_PIconRect:l),out=(a:w)
beq CkContent
call P_PageIcons
CkContent
call D_RectSect,in=(rectptr:l,#P_ContentRect:l),out=(a:w)
beq Done
tool _ClipRect,in=(#P_ContentRect:l)
call P_DrawContent,in=(rectptr:l,#0:w)
Done
rcall D_UnLock,in=(rgn:ax)
lda NotActive
beq Exit
call
|