antoine-source/appleworksgs/SS/Src/Draw2.aii
2023-03-04 03:45:20 +01:00

1 line
4.1 KiB
Plaintext
Executable File

LOAD 'Macros.dump'
INCLUDE 'SS.equ'
; INCLUDE 'Driver.equ'
; INCLUDE 'Heap.aii.i'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT S_CurBRTitle
IMPORT S_CurContHt
IMPORT S_CurContWd
IMPORT S_CurContXpt
IMPORT S_CurContYpt
IMPORT S_CurTLCell
IMPORT S_CurTLTitle
IMPORT S_DrawRegion
IMPORT S_SectRange
IMPORT S_WhereCell
IMPORT S_WhichCell
;-----------------------------------------------------------------------------
; S_RedrawCellRange( TLCell:l,BRCell:l )
;
; This routine draws the values of the range of cells passed to it,
; including cells found in titles.
S_RedrawCellRange PROC EXPORT
;Using S_CurrentData
input BRCell:l,TLCell:l
local WorkBRCell1:l,WorkTLCell1:l
local WorkBRCell2:l,WorkTLCell2:l
local InPtr:l,Work1Ptr:l,Work2Ptr:l
local CurCol:w,Xcnt:w,Ycnt:w
local Cell:l,Widths:l,Xpt2:w,Ypt2:w,Xpt:w,Ypt:w
local WindowBRCell:l,ColOKFlag:w
BEGIN
lda BRCell ; everybody is sending
ldx TLCell ; these inputs in the
sta TLCell ; wrong order
stx BRCell
lda BRCell+2
ldx TLCell+2
sta TLCell+2
stx BRCell+2
in S_CurContWd:w,S_CurContHt:w
out WindowBRCell:l,a:w,a:w
XCall S_WhichCell
MoveLong !WorkTLCell1,Work1Ptr
MoveLong !WorkTLCell2,Work2Ptr
MoveLong !TLCell,InPtr
stz ColOKFlag
MoveLong S_CurTLCell,WorkTLCell2
MoveLong WindowBRCell,WorkBRCell2
in Work2Ptr:l,InPtr:l,Work1Ptr:l
out a:w
XCall S_SectRange
in WorkTLCell1:l
out a:w,a:w,Xpt:w,Ypt:w
XCall S_WhereCell
in WorkBRCell1:l
out Xpt2:w,Ypt2:w,a:w,a:w
XCall S_WhereCell
; Does BothTitle need to be drawn ;
CmpWord #S_EditHeight+S_ColLabelHeight,S_CurContYpt
jeq doneBothTitle
CmpWord #S_NumLabelWidth,S_CurContXpt
jeq doneBothTitle
; Is BothTitle in range ;
in InPtr:l,#S_CurTLTitle:l,Work2Ptr:l
out a:w
XCall S_SectRange
bne doBoth
brl doneBothTitle
doBoth
in S_CurContXpt:w,S_CurContYpt:w
in #S_NumLabelWidth:w,#S_EditHeight+S_ColLabelHeight:w
in S_CurTLTitle:l,S_CurBRTitle:l,#0:w
in #S_NumLabelWidth:w
XCall S_DrawRegion
in S_CurContXpt:w,#S_EditHeight+S_ColLabelHeight:w
XTool _MoveTo
Tool _LineTo,in=(S_CurContXpt:w,S_CurContYpt:w)
Tool _MoveTo,in=(#S_NumLabelWidth:w,S_CurContYpt:w)
Tool _LineTo,in=(S_CurContXpt:w,S_CurContYpt:w)
doneBothTitle
; Does Top Title need to be drawn ;
lda WorkTLCell1+2
bne doTop
brl doneTopTitle
doTop
lda WorkBRCell1+2
beq doneTopTitle
inc ColOKFlag
CmpWord #S_EditHeight+S_ColLabelHeight,S_CurContYpt
beq doneTopTitle
; Is Top Title in range ;
MoveWord S_CurTLTitle,WorkTLCell2
MoveWord #1,WorkTLCell2+2
MoveWord S_CurBRTitle,WorkBRCell2
MoveWord #702,WorkBRCell2+2
in Work2Ptr:l,InPtr:l,Work2Ptr:l
out a:w
XCall S_SectRange
beq doneTopTitle
in Xpt2:w,S_CurContYpt:w
in Xpt:w,#S_EditHeight+S_ColLabelHeight:w
in WorkTLCell1+2:w,S_CurTLTitle:w
in WorkBRCell1+2:w,S_CurBRTitle:w,#0:w
in S_CurContXpt:w
XCall S_DrawRegion
Tool _MoveTo,in=(S_CurContXpt:w,S_CurContYpt:w)
Tool _LineTo,in=(S_CurContWd:w,S_CurContYpt:w)
doneTopTitle
; Does Left Title need to be drawn ;
lda WorkTLCell1
jeq Exit
lda WorkBRCell1
jeq Exit
CmpWord #S_NumLabelWidth,S_CurContXpt
beq chkContArea
; Is Left Title in range ;
MoveWord #1,WorkTLCell2
MoveWord S_CurTLTitle+2,WorkTLCell2+2
MoveWord #9999,WorkBRCell2
MoveWord S_CurBRTitle+2,WorkBRCell2+2
in Work2Ptr:l,InPtr:l,Work2Ptr:l
out a:w
XCall S_SectRange
beq chkContArea
in S_CurContXpt:w,Ypt2:w
in #S_NumLabelWidth:w,Ypt:w
in S_CurTLTitle+2:w,WorkTLCell1:w
in S_CurBRTitle+2:w,WorkBRCell1:w,#0:w
in #S_NumLabelWidth:w
XCall S_DrawRegion
Tool _MoveTo,in=(S_CurContXpt:w,S_CurContYpt:w)
Tool _LineTo,in=(S_CurContXpt:w,S_CurContHt:w)
chkContArea
; Does the Content area need to be drawn ;
lda ColOKFlag
beq Exit
in Xpt2:w,Ypt2:w,Xpt:w,Ypt:w
in WorkTLCell1:l,WorkBRCell1:l,#1:w
in S_CurContXpt:w
XCall S_DrawRegion
Exit
RETURN
ENDP
END