mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-04 03:05:43 +00:00
1065 lines
17 KiB
Plaintext
1065 lines
17 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*--------------------------------------
|
||
WND.Init >PUSHBI 0
|
||
>LDYA L.DEVNAME.GFX
|
||
>SYSCALL2 open
|
||
bcs .9
|
||
|
||
sta WND.Screen+S.OBJ.hPARENT
|
||
|
||
>LDYA L.DCB.GFX
|
||
>STYA IOCTL+S.IOCTL.BUFPTR
|
||
lda #S.IOCTL.STATCODE.GETDCB
|
||
sta IOCTL+S.IOCTL.STATCODE
|
||
|
||
>PUSHB WND.Screen+S.OBJ.hPARENT
|
||
>PUSHBI IOCTL.STATUS
|
||
>PUSHW L.IOCTL
|
||
>SYSCALL2 IOCTL
|
||
|
||
.9 rts
|
||
*--------------------------------------
|
||
WND.Setup stz WND.Stack.Top
|
||
|
||
>LDYA DCB.GFX+S.DCB.GFX.W
|
||
>STYA WND.Screen+S.OBJ.W
|
||
>STYA WND.Desktop+S.OBJ.W
|
||
>STYA WND.SysBar+S.OBJ.W
|
||
|
||
lda SYSFON.Hp2
|
||
sta WND.SysBar+S.OBJ.H
|
||
|
||
lda DCB.GFX+S.DCB.GFX.H
|
||
sta WND.Screen+S.OBJ.H
|
||
|
||
sec
|
||
sbc WND.SysBar+S.OBJ.H
|
||
sta WND.Desktop+S.OBJ.H
|
||
sta WND.SysBar+S.OBJ.Y1
|
||
|
||
>LDYA L.WND.Screen
|
||
>STYA WND.Desktop+S.OBJ.hPARENT
|
||
>STYA WND.SysBar+S.OBJ.hPARENT
|
||
jsr OBJ.SetX2Y2
|
||
|
||
>LDYA L.WND.Desktop
|
||
jsr OBJ.SetX2Y2
|
||
|
||
>LDYA L.WND.SysBar
|
||
jsr OBJ.SetX2Y2
|
||
|
||
>LDYA L.WND.SysBar.2osX
|
||
ldx hSYSFON
|
||
jsr FON.GetTextSize
|
||
|
||
lda CB.Cache+S.CB.SrcW
|
||
clc
|
||
adc #24 4 + BM width + 4
|
||
sta WND.SysBar.W.X1
|
||
|
||
>LDYA L.WND.Screen+S.OBJ.X2
|
||
>STYA WND.SysBar.W.X2
|
||
|
||
lda #CUR.T.ARROW
|
||
sta WND.Desktop+S.WND.hCUR
|
||
sta WND.SysBar+S.WND.hCUR
|
||
|
||
jsr SYSBAR.Show
|
||
|
||
rts
|
||
*--------------------------------------
|
||
WND.Quit lda WND.Screen+S.OBJ.hPARENT
|
||
beq .8
|
||
|
||
pha
|
||
>PUSHBI IOCTL.CLOSE
|
||
>PUSHWZ
|
||
pla
|
||
>SYSCALL2 IOCTL
|
||
|
||
.8 clc
|
||
WND.Quit.RTS rts
|
||
*--------------------------------------
|
||
* F8, X116, Y116, W16, H16
|
||
*--------------------------------------
|
||
WND.New >LDYAI S.WND
|
||
>SYSCALL2 getmem
|
||
bcs .9
|
||
|
||
>STYA ZPWNDPtr
|
||
|
||
ldy WND.Stack.Top
|
||
cpy #WND.MAX
|
||
bcc .10
|
||
|
||
lda #E.OOH
|
||
|
||
.9 >POP 9
|
||
|
||
rts
|
||
|
||
.10 lda #S.OBJ.T.WND
|
||
sta (ZPWNDPtr) S.OBJ.T
|
||
|
||
ldy #S.WND-1
|
||
lda #0
|
||
|
||
.1 sta (ZPWNDPtr),y
|
||
dey
|
||
bne .1
|
||
|
||
ldy #S.WND.fPaint
|
||
lda L.WND.fPaint
|
||
sta (ZPWNDPtr),y
|
||
iny
|
||
lda L.WND.fPaint+1
|
||
sta (ZPWNDPtr),y
|
||
|
||
>PULLA
|
||
ldy #S.OBJ.H
|
||
sta (ZPWNDPtr),y
|
||
>PULLA
|
||
iny
|
||
sta (ZPWNDPtr),y
|
||
|
||
>PULLA
|
||
ldy #S.OBJ.W
|
||
sta (ZPWNDPtr),y
|
||
>PULLA
|
||
iny
|
||
sta (ZPWNDPtr),y
|
||
|
||
>PULLA
|
||
ldy #S.OBJ.Y1
|
||
sta (ZPWNDPtr),y
|
||
>PULLA
|
||
iny
|
||
sta (ZPWNDPtr),y
|
||
|
||
>PULLA
|
||
ldy #S.OBJ.X1
|
||
and PREFS.BESTVIEWEDX
|
||
sta (ZPWNDPtr),y
|
||
>PULLA
|
||
iny
|
||
sta (ZPWNDPtr),y
|
||
|
||
>PULLA
|
||
ldy #S.OBJ.F
|
||
sta (ZPWNDPtr),y
|
||
|
||
ldy #S.PS.PID
|
||
lda (pPs),y
|
||
|
||
ldy #S.OBJ.hOWNER
|
||
sta (ZPWNDPtr),y
|
||
|
||
lda L.WND.Desktop
|
||
ldy #S.OBJ.hPARENT
|
||
sta (ZPWNDPtr),y
|
||
iny
|
||
lda L.WND.Desktop+1
|
||
sta (ZPWNDPtr),y
|
||
|
||
txa ID
|
||
ldy WND.Stack.Top
|
||
sta WND.Stack,y
|
||
inc WND.Stack.Top
|
||
|
||
* clc
|
||
rts
|
||
*--------------------------------------
|
||
WND.Destroy clc
|
||
rts
|
||
*--------------------------------------
|
||
* hWND8, Prop8, Value16
|
||
*--------------------------------------
|
||
WND.SetProp ldy #3
|
||
|
||
lda (pStack),y hWND
|
||
|
||
>SYSCALL2 GetMemPtr
|
||
>STYA ZPWNDPtr
|
||
|
||
ldy #2
|
||
lda (pStack),y
|
||
|
||
tay
|
||
|
||
>PULLA
|
||
sta (ZPWNDPtr),y
|
||
|
||
iny
|
||
>PULLA
|
||
sta (ZPWNDPtr),y
|
||
|
||
>RET 2
|
||
*--------------------------------------
|
||
* hWND8, Prop8
|
||
*--------------------------------------
|
||
WND.GetProp >PULLA
|
||
pha
|
||
|
||
>PULLA
|
||
>SYSCALL2 GetMemPtr
|
||
>STYA ZPWNDPtr
|
||
|
||
ply
|
||
|
||
lda (ZPWNDPtr),y
|
||
pha
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
ply
|
||
|
||
WND.GetProp.RTS rts
|
||
*--------------------------------------
|
||
* A = hWND
|
||
*--------------------------------------
|
||
WND.Show >SYSCALL2 GetMemPtr
|
||
>STYA ZPWNDPtr
|
||
|
||
jsr OBJ.SetX2Y2
|
||
|
||
jsr GetCBBuf
|
||
bcs WND.GetProp.RTS
|
||
|
||
lda #S.WND.S.ACTIVE
|
||
jsr WND.SetStatus
|
||
|
||
ldy #S.OBJ.Y1
|
||
lda (ZPWNDPtr),y
|
||
tax
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
|
||
ldy #S.WND.TBarY2+1
|
||
sta (ZPWNDPtr),y
|
||
txa
|
||
dey
|
||
sta (ZPWNDPtr),y
|
||
|
||
stz Counter X
|
||
stz Counter+1 Y
|
||
|
||
ldy #S.OBJ.F
|
||
lda (ZPWNDPtr),y
|
||
and #S.WND.F.RESIZE+S.WND.F.BORDER
|
||
beq .1
|
||
|
||
jsr WND.PaintBorders
|
||
|
||
.1 ldy #S.WND.TITLE+1
|
||
lda (ZPWNDPtr),y
|
||
bne .2
|
||
|
||
ldy #S.OBJ.S
|
||
lda (ZPWNDPtr),y
|
||
and #S.WND.F.MOVE+S.WND.F.CLOSE+S.WND.F.MIN+S.WND.F.MAX
|
||
beq .3
|
||
|
||
.2 lda Counter+1
|
||
clc
|
||
adc SYSFON.Hp2
|
||
sta Counter+1
|
||
|
||
ldy #S.WND.TBarY2
|
||
lda (ZPWNDPtr),y
|
||
clc
|
||
adc SYSFON.Hp2
|
||
sta (ZPWNDPtr),y
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
adc #0
|
||
sta (ZPWNDPtr),y
|
||
|
||
lda #S.WND.S.HASTBAR
|
||
jsr WND.SetStatus
|
||
|
||
jsr WND.PaintTopBar
|
||
bcs WND.GetProp.RTS
|
||
*--------------------------------------
|
||
.3 ldy #S.WND.MBAR+1
|
||
lda (ZPWNDPtr),y
|
||
beq .7
|
||
|
||
lda Counter+1
|
||
clc
|
||
adc SYSFON.Hp2
|
||
sta Counter+1
|
||
|
||
ldy #S.WND.TBarY2
|
||
lda (ZPWNDPtr),y
|
||
clc
|
||
adc SYSFON.H
|
||
tax
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
adc #0
|
||
ldy #S.WND.MBarY2+1
|
||
sta (ZPWNDPtr),y
|
||
txa
|
||
dey
|
||
sta (ZPWNDPtr),y
|
||
|
||
lda #S.WND.S.HASMBAR
|
||
jsr WND.SetStatus
|
||
|
||
jsr WND.PaintMBar
|
||
*--------------------------------------
|
||
.7 ldy #S.WND.STATUS+1
|
||
lda (ZPWNDPtr),y
|
||
beq .8
|
||
|
||
lda Counter+1
|
||
clc
|
||
adc SYSFON.Hp2
|
||
sta Counter+1
|
||
|
||
ldy #S.OBJ.Y2
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc SYSFON.H
|
||
tax
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc #0
|
||
ldy #S.WND.SBarY1+1
|
||
sta (ZPWNDPtr),y
|
||
txa
|
||
dey
|
||
sta (ZPWNDPtr),y
|
||
|
||
lda #S.WND.S.HASSBAR
|
||
jsr WND.SetStatus
|
||
|
||
jsr WND.PaintSBar
|
||
*--------------------------------------
|
||
.8 ldy #S.WND.InnerH
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc Counter+1
|
||
sta (ZPWNDPtr),y
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc #0
|
||
sta (ZPWNDPtr),y
|
||
|
||
>LDYA L.WND.Desktop
|
||
|
||
jmp DrawCBPtrToYA1
|
||
|
||
.9 rts
|
||
*--------------------------------------
|
||
WND.Paint pha hWND
|
||
|
||
>SYSCALL2 GetMemPtr
|
||
>STYA ZPWNDPtr
|
||
|
||
ldy #S.WND.fPaint
|
||
lda (ZPWNDPtr),y
|
||
sta ZPPtr1
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sta ZPPtr1+1
|
||
|
||
pla
|
||
|
||
jmp (ZPPtr1)
|
||
*--------------------------------------
|
||
WND.fPaint
|
||
* >SYSCALL2 GetMemPtr done by WND.Paint
|
||
* >STYA ZPWNDPtr
|
||
|
||
ldy #S.WND.BGBM+1
|
||
lda (ZPWNDPtr),y
|
||
bne .1
|
||
|
||
lda #S.CB.CMD.FILLRECT
|
||
sta CB.Buf+S.CB.CMD
|
||
|
||
lda #S.CB.OP.SET
|
||
sta CB.Buf+S.CB.OP
|
||
|
||
lda #S.CB.M.MONO
|
||
sta CB.Buf+S.CB.M
|
||
|
||
ldy #S.WND.BGCOLOR
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Buf+S.CB.COLOR
|
||
|
||
ldy #S.OBJ.X1
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Buf+S.CB.X1
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Buf+S.CB.X1+1
|
||
|
||
ldy #S.WND.InnerY1
|
||
lda (ZPWNDPtr),y
|
||
clc
|
||
adc #1
|
||
sta CB.Buf+S.CB.Y1
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
adc #0
|
||
sta CB.Buf+S.CB.Y1+1
|
||
|
||
ldy #S.OBJ.X2
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Buf+S.CB.X2
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Buf+S.CB.X2+1
|
||
|
||
ldy #S.WND.InnerY2
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc #1
|
||
sta CB.Buf+S.CB.Y2
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc #0
|
||
sta CB.Buf+S.CB.Y2+1
|
||
|
||
stz CB.Buf+S.CB.Y2+2 Ending 0
|
||
|
||
>LDYA L.WND.Desktop
|
||
jmp DrawCBBufToYA
|
||
|
||
.1 clc
|
||
rts
|
||
*--------------------------------------
|
||
WND.PaintBorders
|
||
lda #S.CB.CMD.HLINE TOP
|
||
jsr WND.PaintBorders.H
|
||
|
||
ldy #S.OBJ.X1
|
||
jsr WND.PaintPushWYm1
|
||
|
||
ldy #S.OBJ.Y1
|
||
jsr WND.PaintPushWYm1
|
||
|
||
ldy #S.OBJ.X2
|
||
jsr WND.PaintPushWYp1
|
||
|
||
ldy #S.OBJ.Y1
|
||
jsr WND.PaintPushWYm1
|
||
|
||
lda #S.CB.CMD.VLINE LEFT
|
||
jsr WND.PaintBorders.H
|
||
|
||
ldy #S.OBJ.X1
|
||
jsr WND.PaintPushWYm1
|
||
|
||
ldy #S.OBJ.Y1
|
||
jsr WND.PaintPushWYm1
|
||
|
||
ldy #S.OBJ.X1
|
||
jsr WND.PaintPushWYm1
|
||
|
||
ldy #S.OBJ.Y2
|
||
jsr WND.PaintPushWYp1
|
||
|
||
lda #S.CB.CMD.VLINE RIGHT
|
||
jsr WND.PaintBorders.H
|
||
|
||
ldy #S.OBJ.X2
|
||
jsr WND.PaintPushWYp1
|
||
|
||
ldy #S.OBJ.Y1
|
||
jsr WND.PaintPushWYm1
|
||
|
||
ldy #S.OBJ.X2
|
||
jsr WND.PaintPushWYp1
|
||
|
||
ldy #S.OBJ.Y2
|
||
jsr WND.PaintPushWYp1
|
||
|
||
lda #S.CB.CMD.HLINE BOTTOM
|
||
jsr WND.PaintBorders.H
|
||
|
||
ldy #S.OBJ.X1
|
||
jsr WND.PaintPushWYm1
|
||
|
||
ldy #S.OBJ.Y2
|
||
jsr WND.PaintPushWYp1
|
||
|
||
ldy #S.OBJ.X2
|
||
jsr WND.PaintPushWYp1
|
||
|
||
ldy #S.OBJ.Y2
|
||
jsr WND.PaintPushWYp1
|
||
|
||
rts
|
||
|
||
WND.PaintBorders.H
|
||
jsr PutA2CBBuf
|
||
lda #S.CB.OP.SET
|
||
jsr PutA2CBBuf
|
||
lda #S.CB.M.MONO
|
||
jsr PutA2CBBuf
|
||
lda PREFS.BORDERCOLOR
|
||
jmp PutA2CBBuf
|
||
|
||
WND.PaintPushWYm1
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc #1
|
||
jsr PutA2CBBuf
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc #0
|
||
jsr PutA2CBBuf
|
||
rts
|
||
|
||
WND.PaintPushWYp1
|
||
lda (ZPWNDPtr),y
|
||
clc
|
||
adc #1
|
||
jsr PutA2CBBuf
|
||
iny
|
||
adc #0
|
||
lda (ZPWNDPtr),y
|
||
jsr PutA2CBBuf
|
||
rts
|
||
*--------------------------------------
|
||
WND.PaintTopBar lda #S.CB.CMD.FILLRECT
|
||
jsr PutA2CBBuf
|
||
lda #S.CB.OP.SET
|
||
jsr PutA2CBBuf
|
||
lda #S.CB.M.C16
|
||
jsr PutA2CBBuf
|
||
|
||
ldx PREFS.TBARCOLORI
|
||
|
||
ldy #S.OBJ.S
|
||
lda (ZPWNDPtr),y
|
||
and #S.WND.S.ACTIVE
|
||
beq .10
|
||
|
||
ldx PREFS.TBARCOLORA
|
||
|
||
.10 txa
|
||
jsr PutA2CBBuf
|
||
|
||
ldy #S.OBJ.X1
|
||
lda (ZPWNDPtr),y
|
||
jsr PutA2CBBuf
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
jsr PutA2CBBuf
|
||
|
||
iny ldy #S.OBJ.Y1
|
||
lda (ZPWNDPtr),y
|
||
jsr PutA2CBBuf
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
jsr PutA2CBBuf
|
||
|
||
iny ldy #S.OBJ.X2
|
||
lda (ZPWNDPtr),y
|
||
jsr PutA2CBBuf
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
jsr PutA2CBBuf
|
||
|
||
ldy #S.OBJ.Y1
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
adc SYSFON.H
|
||
jsr PutA2CBBuf
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
adc #0
|
||
jsr PutA2CBBuf
|
||
* TOP LEFT ICON
|
||
ldy #S.WND.ICON+1
|
||
lda (ZPWNDPtr),y
|
||
tax
|
||
dey
|
||
ora (ZPWNDPtr),y
|
||
bne .1
|
||
|
||
lda L.BM.Apple
|
||
ldx L.BM.Apple+1
|
||
bra .2
|
||
|
||
.1 lda (ZPWNDPtr),y
|
||
|
||
.2 sta ZPObjPtr
|
||
stx ZPObjPtr+1
|
||
|
||
lda #0
|
||
ldx #0
|
||
|
||
jsr WND.PaintTopBarBMAtAX
|
||
|
||
jsr WND.PaintTopBarTitle
|
||
bcs .9
|
||
* TOP RIGHT ICONS
|
||
ldy #S.OBJ.F
|
||
lda (ZPWNDPtr),y
|
||
bit #S.WND.F.CLOSE
|
||
beq .3
|
||
|
||
pha
|
||
|
||
lda L.BM.Close
|
||
ldx L.BM.Close+1
|
||
sta ZPObjPtr
|
||
stx ZPObjPtr+1
|
||
|
||
ldy #S.OBJ.W
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc #16
|
||
pha
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc #0
|
||
|
||
tax
|
||
pla
|
||
|
||
jsr WND.PaintTopBarBMAtAX
|
||
|
||
pla
|
||
|
||
.3 bit #S.WND.F.MAX
|
||
beq .4
|
||
|
||
pha
|
||
|
||
lda L.BM.Max
|
||
ldx L.BM.Max+1
|
||
sta ZPObjPtr
|
||
stx ZPObjPtr+1
|
||
|
||
ldy #S.OBJ.W
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc #32
|
||
pha
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc #0
|
||
|
||
tax
|
||
pla
|
||
|
||
jsr WND.PaintTopBarBMAtAX
|
||
|
||
pla
|
||
|
||
.4 bit #S.WND.F.MIN
|
||
beq .8
|
||
|
||
lda L.BM.Min
|
||
ldx L.BM.Min+1
|
||
sta ZPObjPtr
|
||
stx ZPObjPtr+1
|
||
|
||
ldy #S.OBJ.W
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc #48
|
||
pha
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc #0
|
||
|
||
tax
|
||
pla
|
||
|
||
jsr WND.PaintTopBarBMAtAX
|
||
|
||
|
||
.8 clc
|
||
|
||
.9 rts
|
||
*--------------------------------------
|
||
WND.PaintTopBarBMAtAX
|
||
clc
|
||
ldy #S.OBJ.X1
|
||
adc (ZPWNDPtr),y
|
||
pha
|
||
|
||
iny
|
||
|
||
txa
|
||
adc (ZPWNDPtr),y
|
||
|
||
tax
|
||
|
||
lda #S.CB.CMD.BITBLT
|
||
jsr PutA2CBBuf
|
||
lda #S.CB.OP.MASK+S.CB.OP.ORA+S.CB.OP.COLOR
|
||
jsr PutA2CBBuf
|
||
lda #S.CB.M.C16
|
||
jsr PutA2CBBuf
|
||
|
||
lda #0
|
||
jsr PutA2CBBuf
|
||
|
||
pla S.CB.X1
|
||
jsr PutAX2CBBuf
|
||
|
||
ldy #S.OBJ.Y1 S.CB.Y1
|
||
lda (ZPWNDPtr),y
|
||
clc
|
||
adc #1
|
||
jsr PutA2CBBuf
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
adc #0
|
||
jsr PutA2CBBuf
|
||
|
||
lda #0 S.CB.X2
|
||
jsr PutA2CBBuf
|
||
jsr PutA2CBBuf
|
||
|
||
jsr PutA2CBBuf S.CB.Y2
|
||
jsr PutA2CBBuf
|
||
|
||
jsr PutA2CBBuf S.CB.SrcX
|
||
jsr PutA2CBBuf
|
||
|
||
jsr PutA2CBBuf S.CB.SrcY
|
||
jsr PutA2CBBuf
|
||
|
||
ldx #4
|
||
|
||
ldy #S.BM.W
|
||
|
||
.1 lda (ZPObjPtr),y S.CB.SrcW,S.CB.SrcH
|
||
jsr PutA2CBBuf
|
||
iny
|
||
dex
|
||
bne .1
|
||
|
||
lda ZPObjPtr S.CB.SrcPtr
|
||
jsr PutA2CBBuf
|
||
|
||
lda ZPObjPtr+1
|
||
jsr PutA2CBBuf
|
||
|
||
lda #0 S.CB.DstPtr
|
||
jsr PutA2CBBuf
|
||
jsr PutA2CBBuf
|
||
|
||
rts
|
||
*--------------------------------------
|
||
WND.PaintTopBarTitle
|
||
jsr CB.ClearCache
|
||
|
||
ldy #S.WND.TITLE
|
||
lda (ZPWNDPtr),y
|
||
pha
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
ply
|
||
|
||
ldx hSYSFONB
|
||
jsr FON.GetTextSize
|
||
|
||
lda #S.CB.CMD.DRAWTEXT2
|
||
sta CB.Cache+S.CB.CMD
|
||
lda #S.CB.OP.SET+S.CB.OP.INVERSE
|
||
sta CB.Cache+S.CB.OP
|
||
lda #S.CB.M.MONO
|
||
sta CB.Cache+S.CB.M
|
||
|
||
ldy #S.OBJ.W
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc CB.Cache+S.CB.SrcW
|
||
|
||
sta DX
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc CB.Cache+S.CB.SrcW+1
|
||
|
||
lsr
|
||
ror DX
|
||
sta DX+1
|
||
|
||
ldy #S.OBJ.X1
|
||
lda (ZPWNDPtr),y
|
||
clc
|
||
adc DX
|
||
and PREFS.BESTVIEWEDX
|
||
sta CB.Cache+S.CB.X1
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
adc DX+1
|
||
sta CB.Cache+S.CB.X1+1
|
||
|
||
ldy #S.OBJ.Y1
|
||
lda (ZPWNDPtr),y
|
||
clc
|
||
adc #1
|
||
sta CB.Cache+S.CB.Y1
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
adc #0
|
||
sta CB.Cache+S.CB.Y1+1
|
||
|
||
jsr PutCBCache2CBBuf
|
||
|
||
clc
|
||
|
||
rts
|
||
*--------------------------------------
|
||
WND.PaintMBar jsr CB.ClearCache
|
||
|
||
lda #S.CB.CMD.FILLRECT
|
||
sta CB.Cache+S.CB.CMD
|
||
|
||
lda #S.CB.OP.SET
|
||
sta CB.Cache+S.CB.OP
|
||
|
||
lda #S.CB.M.MONO
|
||
sta CB.Cache+S.CB.M
|
||
|
||
lda PREFS.MBARCOLOR
|
||
sta CB.Cache+S.CB.COLOR
|
||
|
||
ldy #S.OBJ.X1
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.X1
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.X1+1
|
||
|
||
ldy #S.OBJ.X2
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.X2
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.X2+1
|
||
|
||
ldy #S.WND.MBarY1
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.Y1
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.Y1+1
|
||
|
||
iny #S.WND.MBarY2
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.Y2
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.Y2+1
|
||
|
||
jsr PutCBCache2CBBuf
|
||
|
||
ldy #S.WND.MBAR
|
||
lda (ZPWNDPtr),y
|
||
pha
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
ply
|
||
|
||
jsr MENU.MBarInit
|
||
|
||
.1 lda (ZPMENUPtr)
|
||
beq .8
|
||
|
||
jsr CB.ClearCache
|
||
|
||
lda #S.CB.CMD.DRAWTEXT2
|
||
sta CB.CACHE+S.CB.CMD
|
||
|
||
lda #S.CB.OP.SET+S.CB.OP.INVERSE
|
||
sta CB.Cache+S.CB.OP
|
||
|
||
lda #S.CB.M.MONO
|
||
sta CB.Cache+S.CB.M
|
||
|
||
lda hSYSFONB
|
||
sta CB.CACHE+S.CB.hFont
|
||
|
||
ldy #S.MBAR.XT
|
||
lda (ZPMENUPtr),y
|
||
clc
|
||
ldy #S.OBJ.X1
|
||
adc (ZPWNDPtr),y
|
||
sta CB.CACHE+S.CB.X1
|
||
|
||
ldy #S.MBAR.XT+1
|
||
lda (ZPMENUPtr),y
|
||
ldy #S.OBJ.X1+1
|
||
adc (ZPWNDPtr),y
|
||
sta CB.CACHE+S.CB.X1+1
|
||
|
||
ldy #S.WND.MBarY1
|
||
lda (ZPWNDPtr),y
|
||
clc
|
||
adc #1
|
||
sta CB.CACHE+S.CB.Y1
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
adc #0
|
||
sta CB.CACHE+S.CB.Y1+1
|
||
|
||
lda #S.MBAR.TEXT
|
||
clc
|
||
adc ZPMENUPtr
|
||
sta CB.CACHE+S.CB.TxtPtr
|
||
|
||
lda #0
|
||
adc ZPMENUPtr+1
|
||
sta CB.CACHE+S.CB.TxtPtr+1
|
||
|
||
jsr PutCBCache2CBBuf
|
||
|
||
lda (ZPMENUPtr)
|
||
clc
|
||
adc ZPMENUPtr
|
||
sta ZPMENUPtr
|
||
bcc .1
|
||
inc ZPMENUPtr+1
|
||
bra .1
|
||
|
||
.8 clc
|
||
|
||
rts
|
||
*--------------------------------------
|
||
WND.PaintSBar lda #S.CB.CMD.HLINE
|
||
jsr WND.PaintBorders.H
|
||
|
||
ldy #S.OBJ.X1
|
||
lda (ZPWNDPtr),y
|
||
jsr PutA2CBBuf
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
jsr PutA2CBBuf
|
||
|
||
ldy #S.OBJ.Y2
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc SYSFON.H
|
||
jsr PutA2CBBuf
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc #0
|
||
jsr PutA2CBBuf
|
||
|
||
ldy #S.OBJ.X2
|
||
lda (ZPWNDPtr),y
|
||
jsr PutA2CBBuf
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
jsr PutA2CBBuf
|
||
|
||
lda #0
|
||
jsr PutA2CBBuf
|
||
jsr PutA2CBBuf
|
||
|
||
jsr CB.ClearCache S.CB.Y2
|
||
|
||
lda #S.CB.CMD.DRAWTEXT+S.CB.CMD.OSD
|
||
sta CB.Cache+S.CB.CMD
|
||
lda #S.CB.OP.SET+S.CB.OP.INVERSE
|
||
sta CB.Cache+S.CB.OP
|
||
lda #S.CB.M.MONO
|
||
sta CB.Cache+S.CB.M
|
||
lda hSYSFON
|
||
sta CB.Cache+S.CB.hFont
|
||
|
||
ldy #S.WND.STATUS
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.TxtPtr
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.TxtPtr+1
|
||
|
||
jsr GFXWrite.CB
|
||
bcs .9
|
||
|
||
ldy #S.OBJ.X1
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.X1
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.X1+1
|
||
|
||
ldy #S.OBJ.Y2
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc SYSFON.Hm1
|
||
sta CB.Cache+S.CB.Y1
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc #0
|
||
sta CB.Cache+S.CB.Y1+1
|
||
|
||
jsr PutCBCache2CBBuf
|
||
|
||
lda #S.CB.CMD.FILLRECT
|
||
sta CB.Cache+S.CB.CMD
|
||
lda #S.CB.OP.SET
|
||
sta CB.Cache+S.CB.OP
|
||
lda #S.CB.M.MONO
|
||
sta CB.Cache+S.CB.M
|
||
lda PREFS.SBARCOLOR
|
||
sta CB.Cache+S.CB.OP.COLOR
|
||
|
||
lda CB.Cache+S.CB.X1
|
||
clc
|
||
adc CB.Cache+S.CB.SrcW
|
||
sta CB.Cache+S.CB.X1
|
||
|
||
lda CB.Cache+S.CB.X1+1
|
||
adc CB.Cache+S.CB.SrcW+1
|
||
sta CB.Cache+S.CB.X1+1
|
||
|
||
ldy #S.OBJ.X2
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.X2
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.X2+1
|
||
|
||
ldy #S.OBJ.Y2
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.Y2
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sta CB.Cache+S.CB.Y2+1
|
||
|
||
jsr PutCBCache2CBBuf
|
||
|
||
clc
|
||
|
||
.9 rts
|
||
*--------------------------------------
|
||
WND.ClrStatus ldy #S.OBJ.S
|
||
eor #$ff
|
||
and (ZPWNDPtr),y
|
||
sta (ZPWNDPtr),y
|
||
rts
|
||
*--------------------------------------
|
||
WND.SetStatus ldy #S.OBJ.S
|
||
ora (ZPWNDPtr),y
|
||
sta (ZPWNDPtr),y
|
||
rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/lib/libgui.s.wnd
|
||
LOAD usr/src/lib/libgui.s
|
||
ASM
|