//SIL.DEFS -- definitions for NSIL


manifest
[
//****The following 5 constants are also defined and compiled in CVRT.asm
Nwrds = 36 //number of words per scan line//****also compiled in Paint.asm
ScreenXmax = Nwrds*16 //raster points in x
ScreenYmax = 762 //I added 2 scan lines so Status fits at the bottom in grid 4 (R Bates)
C1778dflt = 1778; C50dflt = 50 //constants for "Alto Bits to Mica" conversion


Black=0; Red=1; Yellow=2; Green=3; Cyan=4; Violet=5; Magenta=6; White=7
Brown=#10; Orange=#11; Lime=#12; Turquoise=#13; Aqua=#14; UltraViolet=#15; Pink=#16; Smoke=#17

toWhite=0; toSelected=1; toBlack=-1; toBackground=-2
InitRev = ($a)*256 + $*n
NMfonts = 6 //number of macro fonts (4-9)
Mtsize = NMfonts*128 //macro table size
DirPreambleSize=6
CursorMap = #431
ksTypeReadOnly=1
ksTypeWriteOnly=2
ksTypeReadWrite=3
charItem=1
wordItem=2
verLatestCreate=#40000+2
BuildYmax = 760 //Define this constant for compatibility with old and new drawings
BlankLines = 16 //number of unused scan lines on top of display must be even (R Bates)
MarkChar = #73 //character in gates.al which is used for mark
OriginChar = #72 //character in gates.al used for origin

//I added two "pseudo Cursor position registers so I could move the display window
//away from the screen origin, and still have all of Sil’c calculations work
//correctly with "@Cursor" ty instructions

CursorTable = #340 //hides sil cursor table in unavailable static memory
//Now the real cursor coordinate assignments
DispCursorX = #426
//send the alto software CursorX from Tab1 to ScrenXMax + Tab1
DispCursorY = #427
//send the alto software CursorY from BlankLines to ScrenYMax + BL
MouseX = #424
MouseY = #425

Mark = 4
//cases of mouse events
Draw = #10
Select = #14
Shift = 1
Ctrl = 2
CtrlMark = Mark+Ctrl
ShiftMark = Mark+Shift
CtrlShMark = Mark+Ctrl+Shift
CtrlDraw = Draw+Ctrl
ShiftDelete = Draw+Shift
ShiftUndelete = Draw+Ctrl+Shift
CtrlSelect = Select+Ctrl
ShiftSelect = Select+Shift
CtrlShSelect = Select+Ctrl+Shift


//object states
Active = 0
Selected = 1
Dead = 7


FNameLength=20

Lmargin = 28
]

external
//static variables
[
//sil.bcpl
@OriginObject; @MarkObject; @StatusObject; @FNameObject
@Message; @Herrald
@Blink; @FlashSense; @UpdateStatus; @TickFlag
@LineWidth; @Mag; @GridMask; @HardCopy; @ScanCvrt
@FirstItem; @NewItem; @NSelectedItems
@ItalicsBuff
@Changed; @VirginSinceBuild
@MakeGrayOK
@PlaceSelected
@MaxStringHeight

@CursorX; @CursorY //X & Y location of Cursor in Bit-Map coordinates
@mx; @my//default location of StatusObject (may be altered by "X/Y: val" in user.cm)
@OldX; @OldY; @NewX; @NewY
@RebArea
@RwArea
@WindowXmin; @WindowYmin

@RebuildXmin; @RebuildYmin; @RebuildXmax; @RebuildYmax
@RebuilderState; @RestartRebuilder; @RebuilderLink
@Sweeping; @Slink; @Clink

@MouseBuffer; @Dcb; @Mact; @FontVec; @PrFaceVec; @AlFaceVec; @MaskTable
@DisplayArea; @SilZone
@SpaceBase //base of space
@SpaceTop //top of stpace with 128 words above for "NewItem" to expand into

//sila.bcpl

@CurrentFont //internal font number format
@CurrentUFont //font number to the user
@CurrentFace
@CurrentColor
@YLockFlag
@OneLevel

//silaa.bcpl

@AltS
@fpAlt
@AltLineCnt
@InitS
@fpSilInit
@LbMissing

//silb.bcpl

@lastlink
@mainl

//silc.bcpl

@Lprvec //vector of fp’s for libraries returned by LookUpEntries
@mousedown
@TABkey //indicates TAB key as apposed to CTRL i
@BSkey
//differentiates between ↑H and the BS key
@CtrlShift //indicates that a "Cont-Shift" function is in effect
@SelArea

//sild.bcpl

@WidthVec
@FileVec
@Font3Special

//silpress.bcpl

@PressS
@ncopies
@BackGndEn
@Xmargin
@Ymargin
@C1778
@C50
]

external
//O.S. procedures and statics
[
OpenFileFromFp
fpUserCm
fpSysDir
fpComCm
fpRemCm
FilePos
SetFilePos
Usc
InitializeZone
Gets
Puts
Wss
Ws
Wns
OpenFile
Closes
MoveBlock
SetKeyboardProc
lvCursorLink
Zero
CallSwat
Endofs
keys
lvUserFinishProc
Junta
CounterJunta
Resets
SetupReadParam
ReadParam
]

external
//Sil procedures
[
SilInitCode
MakeInitFile
PressInitCode
InitBlocks
LibUpdate //update mact from library files
ReadLibFps //get file pointers for library files
LookUpEntries
SilReInit
MoveLineEndpoints
SetCursor
Expand
GobbleFonts
ReadUserCmItem
ReadFont
CleanUp
MoveSelected
CopySelected
DeleteSelected
UnDelete
WriteItem
ReadItem
FileOut
FixFName
OpenSilFile
Update
Compact
FlashMark
//UpdateYCursor
MakeItem
GetMouseEvent
MakeMouseEvent
MouseProc
GetColor
PaintTicks
ZapRebuilder
ZapRebuilderItem
RemoveBuildMark
Cvrt
DoKeyboard
MouseBufferEmpty
PushCoords
MoveObjectTo
DoDraw
SelectArea
RememberArea
ClearSelections
MakeSelected
MakeUnSelected
SelectItem
SelectItemCleanup
RebuildSome
Paint
DisplayObject
ReWriteObj
AddText
DefineMacro
CheckMacro
RecursiveDefinition
FileIn
//NSilUtil
IncrementCoords
AddToList
FlushList
Length
StEq
GetNum
AppendC
AppendS
AppendN
//AppendB
FindAnalyzeLine
//silpress
MakePress
SetEntityColor
CheckColorCmmd
InitColorTable
InitCursor
WriteCursor
ReadCmEntry
GetSomeMem
]


structure str:
[
length byte
char↑1,255 byte
]


structure item:
[
link word
state bit 3; xmin bit 13
ymin word
color bit 4; xmax bit 12
[ font bit 4; blank bit 1; ymax bit 11 ]
=[
fullfont bit 5
=[ txtfont bit 3; face bit 2= [ bold bit; italic bit ] ]
blank bit 11
]
string: @str
]

manifest [ Xmin = 1; Ymin = 2; Xmax = 3; Ymax = 4 ] //matched to item structure

structure Mevent:
[
type bit 4
curx bit 12
cury word
]