A2osX/LIB/LIBGUI.S.WND.txt

995 lines
16 KiB
Plaintext
Raw Normal View History

NEW
2019-07-30 08:57:25 +00:00
AUTO 3,1
*--------------------------------------
2019-01-08 16:29:26 +00:00
WND.Init >PUSHBI 0
>LDYA L.DEVNAME.GFX
2019-05-05 17:15:37 +00:00
>SYSCALL2 open
2018-05-16 06:02:57 +00:00
bcs .9
2020-09-02 15:47:23 +00:00
2020-09-06 12:24:04 +00:00
sta WND.Screen+S.OBJ.hPARENT
2020-09-02 15:47:23 +00:00
2019-01-09 16:42:20 +00:00
>LDYA L.DCB.GFX
>STYA IOCTL+S.IOCTL.BUFPTR
2021-05-04 17:31:21 +00:00
lda #S.IOCTL.S.GETDCB
sta IOCTL+S.IOCTL.S
2020-09-13 19:05:38 +00:00
2020-09-06 12:24:04 +00:00
>PUSHB WND.Screen+S.OBJ.hPARENT
2019-01-09 16:42:20 +00:00
>PUSHBI IOCTL.STATUS
2020-09-02 15:47:23 +00:00
>PUSHW L.IOCTL
2019-05-05 17:15:37 +00:00
>SYSCALL2 IOCTL
2020-09-06 12:24:04 +00:00
2019-10-03 06:25:27 +00:00
.9 rts
2019-01-10 16:26:58 +00:00
*--------------------------------------
2020-10-26 06:38:50 +00:00
WND.Setup
2020-10-20 06:01:04 +00:00
* stz WND.Stack.Top
* stz MENU.Stack.Top
2020-10-08 15:33:38 +00:00
>LDYA DCB.GFX+S.DCB.GFX.W
2020-09-06 12:24:04 +00:00
>STYA WND.Screen+S.OBJ.W
2019-01-10 16:26:58 +00:00
>STYA WND.Desktop+S.OBJ.W
>STYA WND.SysBar+S.OBJ.W
2020-09-06 12:24:04 +00:00
2020-10-06 06:27:35 +00:00
lda SYSFON.Hp2
2019-01-10 16:26:58 +00:00
sta WND.SysBar+S.OBJ.H
2020-09-06 12:24:04 +00:00
2019-01-09 06:58:19 +00:00
lda DCB.GFX+S.DCB.GFX.H
2020-09-06 12:24:04 +00:00
sta WND.Screen+S.OBJ.H
2020-10-06 06:27:35 +00:00
2018-05-16 06:02:57 +00:00
sec
2019-01-10 16:26:58 +00:00
sbc WND.SysBar+S.OBJ.H
sta WND.Desktop+S.OBJ.H
2020-10-26 06:38:50 +00:00
2020-10-06 06:27:35 +00:00
sta WND.SysBar+S.OBJ.Y1
2020-10-20 06:01:04 +00:00
sta RECT.SysBut+S.RECT.Y1
sta RECT.SysWNDs+S.RECT.Y1
sta RECT.SysClk+S.RECT.Y1
2020-10-26 06:38:50 +00:00
2020-10-20 06:01:04 +00:00
lda DCB.GFX+S.DCB.GFX.H
dec
sta RECT.SysBut+S.RECT.Y2
sta RECT.SysWNDs+S.RECT.Y2
sta RECT.SysClk+S.RECT.Y2
2020-09-02 15:47:23 +00:00
2020-09-06 12:24:04 +00:00
>LDYA L.WND.Screen
2020-10-06 06:27:35 +00:00
>STYA WND.Desktop+S.OBJ.hPARENT
>STYA WND.SysBar+S.OBJ.hPARENT
2019-01-10 16:26:58 +00:00
jsr OBJ.SetX2Y2
2020-10-26 06:38:50 +00:00
2019-01-10 16:26:58 +00:00
>LDYA L.WND.Desktop
jsr OBJ.SetX2Y2
2020-09-02 15:47:23 +00:00
2019-01-10 16:26:58 +00:00
>LDYA L.WND.SysBar
2020-09-05 13:38:04 +00:00
jsr OBJ.SetX2Y2
2020-10-26 06:38:50 +00:00
2020-10-08 15:33:38 +00:00
>LDYA L.WND.SysBar.2osX
ldx hSYSFON
jsr FON.GetTextSize
lda CB.Cache+S.CB.SrcW
clc
adc #24 4 + BM width + 4
2020-10-20 06:01:04 +00:00
sta RECT.SysBut+S.RECT.X2
sta RECT.SysWNDs+S.RECT.X1
2020-10-26 06:38:50 +00:00
2020-10-20 06:01:04 +00:00
>LDYA L.WND.SysBar.Clk
ldx hSYSFON
jsr FON.GetTextSize
2020-09-13 19:05:38 +00:00
2020-10-20 06:01:04 +00:00
lda CB.Cache+S.CB.SrcW
sec for sbc below
adc #8 4 + 00:00 + 4
sta RECT.SysWNDs+S.RECT.X2
2020-10-26 06:38:50 +00:00
2020-10-20 06:01:04 +00:00
lda DCB.GFX+S.DCB.GFX.W
sec
sbc RECT.SysWNDs+S.RECT.X2
sta RECT.SysWNDs+S.RECT.X2
sta RECT.SysClk+S.RECT.X1
lda DCB.GFX+S.DCB.GFX.W+1
sbc #0
sta RECT.SysWNDs+S.RECT.X2+1
sta RECT.SysClk+S.RECT.X1+1
2020-10-26 06:38:50 +00:00
2020-10-20 06:01:04 +00:00
lda DCB.GFX+S.DCB.GFX.W
sec
sbc #0
sta RECT.SysClk+S.RECT.X2
lda DCB.GFX+S.DCB.GFX.W
sbc #0
sta RECT.SysClk+S.RECT.X2+1
2020-10-26 06:38:50 +00:00
2020-10-06 06:27:35 +00:00
jsr SYSBAR.Show
2019-01-10 16:26:58 +00:00
rts
2018-05-16 06:02:57 +00:00
*--------------------------------------
2020-09-06 12:24:04 +00:00
WND.Quit lda WND.Screen+S.OBJ.hPARENT
2019-01-08 16:29:26 +00:00
beq .8
2020-09-06 12:24:04 +00:00
2019-01-08 16:29:26 +00:00
pha
>PUSHBI IOCTL.CLOSE
2019-06-07 15:02:51 +00:00
>PUSHWZ
2019-01-08 16:29:26 +00:00
pla
2019-05-05 17:15:37 +00:00
>SYSCALL2 IOCTL
2019-01-08 16:29:26 +00:00
2019-10-03 06:25:27 +00:00
.8 clc
2020-10-01 15:30:25 +00:00
WND.Quit.RTS rts
*--------------------------------------
2020-09-08 15:31:41 +00:00
* F8, X116, Y116, W16, H16
*--------------------------------------
2020-10-01 15:30:25 +00:00
WND.New >LDYAI S.WND
2019-05-05 17:15:37 +00:00
>SYSCALL2 getmem
2020-10-09 06:02:45 +00:00
bcs .9
2020-09-06 12:24:04 +00:00
2020-09-15 14:48:35 +00:00
>STYA ZPWNDPtr
2020-09-08 15:31:41 +00:00
2020-10-01 15:30:25 +00:00
ldy WND.Stack.Top
cpy #WND.MAX
2020-10-06 06:27:35 +00:00
bcc .10
2020-10-26 06:38:50 +00:00
2020-10-06 06:27:35 +00:00
lda #E.OOH
2020-10-09 06:02:45 +00:00
.9 >POP 9
rts
2020-10-01 15:30:25 +00:00
2020-10-06 06:27:35 +00:00
.10 lda #S.OBJ.T.WND
2020-09-15 14:48:35 +00:00
sta (ZPWNDPtr) S.OBJ.T
2020-09-06 12:24:04 +00:00
2018-05-16 06:02:57 +00:00
ldy #S.WND-1
2020-09-08 15:31:41 +00:00
lda #0
2020-09-06 12:24:04 +00:00
2020-09-15 14:48:35 +00:00
.1 sta (ZPWNDPtr),y
2018-05-16 06:02:57 +00:00
dey
2020-09-08 15:31:41 +00:00
bne .1
2020-09-13 19:05:38 +00:00
2020-10-01 15:30:25 +00:00
ldy #S.WND.fPaint
lda L.WND.fPaint
sta (ZPWNDPtr),y
iny
lda L.WND.fPaint+1
sta (ZPWNDPtr),y
2020-09-08 15:31:41 +00:00
>PULLA
ldy #S.OBJ.H
2020-09-15 14:48:35 +00:00
sta (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
pha
2020-09-08 15:31:41 +00:00
>PULLA
iny
2020-09-15 14:48:35 +00:00
sta (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
ldy #S.WND.InnerH+1
sta (ZPWNDPtr),y
pla
dey
sta (ZPWNDPtr),y
2020-10-26 16:32:51 +00:00
2020-09-08 15:31:41 +00:00
>PULLA
ldy #S.OBJ.W
2020-09-15 14:48:35 +00:00
sta (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
pha
2020-09-08 15:31:41 +00:00
>PULLA
iny
2020-09-15 14:48:35 +00:00
sta (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
ldy #S.WND.InnerW+1
sta (ZPWNDPtr),y
pla
dey
sta (ZPWNDPtr),y
2020-09-13 19:05:38 +00:00
2020-09-08 15:31:41 +00:00
>PULLA
ldy #S.OBJ.Y1
2020-09-15 14:48:35 +00:00
sta (ZPWNDPtr),y
2020-09-08 15:31:41 +00:00
>PULLA
iny
2020-09-15 14:48:35 +00:00
sta (ZPWNDPtr),y
2020-09-08 15:31:41 +00:00
>PULLA
ldy #S.OBJ.X1
2020-09-14 14:31:41 +00:00
and PREFS.BESTVIEWEDX
2020-09-15 14:48:35 +00:00
sta (ZPWNDPtr),y
2020-09-08 15:31:41 +00:00
>PULLA
iny
2020-09-15 14:48:35 +00:00
sta (ZPWNDPtr),y
2020-09-13 19:05:38 +00:00
2020-09-08 15:31:41 +00:00
>PULLA
2020-10-23 06:03:23 +00:00
bit #S.WND.F.RESIZE
beq .2
2020-10-26 06:38:50 +00:00
2020-10-23 06:03:23 +00:00
ora #S.WND.F.BORDER
.2 ldy #S.OBJ.F
2020-09-15 14:48:35 +00:00
sta (ZPWNDPtr),y
2020-09-08 15:31:41 +00:00
ldy #S.PS.PID
lda (pPs),y
ldy #S.OBJ.hOWNER
2020-09-15 14:48:35 +00:00
sta (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
2020-10-06 06:27:35 +00:00
lda L.WND.Desktop
ldy #S.OBJ.hPARENT
sta (ZPWNDPtr),y
iny
lda L.WND.Desktop+1
sta (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
2020-09-08 15:31:41 +00:00
txa ID
2020-09-13 19:05:38 +00:00
2020-09-08 15:31:41 +00:00
* clc
rts
*--------------------------------------
2020-10-01 15:30:25 +00:00
WND.Destroy clc
rts
*--------------------------------------
2020-10-26 06:38:50 +00:00
WND.Activate >SYSCALL2 GetMemPtr
2020-09-15 14:48:35 +00:00
>STYA ZPWNDPtr
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
clc
WND.Activate.RTS
rts
*--------------------------------------
WND.Bring2Front ldx WND.Stack.Idx
cpx WND.Stack.Top
beq WND.Activate.RTS
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
lda WND.Stack-1,x
pha
2020-09-08 15:31:41 +00:00
2020-10-26 06:38:50 +00:00
.1 lda WND.Stack,x
sta WND.Stack-1,x
inx
cpx WND.Stack.Top
bne .1
dec WND.Stack.Top
2020-09-08 15:31:41 +00:00
2020-10-26 06:38:50 +00:00
.2 pla
2020-09-08 15:31:41 +00:00
*--------------------------------------
2020-10-26 06:38:50 +00:00
* A = hWND
2020-09-08 15:31:41 +00:00
*--------------------------------------
2020-10-26 06:38:50 +00:00
WND.Show sta WND.hWND
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
ldx WND.Stack.Top
beq WND.Show1
lda WND.Stack-1,x
2020-09-08 15:31:41 +00:00
>SYSCALL2 GetMemPtr
2020-09-15 14:48:35 +00:00
>STYA ZPWNDPtr
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
lda #S.WND.S.ACTIVE
jsr WND.ClrStatus
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
jsr GetCBBuf
bcs WND.Activate.RTS
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
jsr WND.PaintTopBar
WND.Show1 lda WND.hWND
ldy WND.Stack.Top
sta WND.Stack,y
inc WND.Stack.Top
>SYSCALL2 GetMemPtr
2020-09-15 14:48:35 +00:00
>STYA ZPWNDPtr
2020-09-13 19:05:38 +00:00
2020-09-08 15:31:41 +00:00
jsr OBJ.SetX2Y2
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
WND.Show2 jsr GetCBBuf
bcs WND.Activate.RTS
2020-09-29 15:37:26 +00:00
2020-10-01 15:30:25 +00:00
lda #S.WND.S.ACTIVE
jsr WND.SetStatus
2020-09-29 15:37:26 +00:00
ldy #S.OBJ.Y1
lda (ZPWNDPtr),y
tax
iny
lda (ZPWNDPtr),y
2020-09-30 15:32:54 +00:00
2020-10-02 14:57:05 +00:00
ldy #S.WND.TBarY2+1
2020-09-29 15:37:26 +00:00
sta (ZPWNDPtr),y
txa
dey
sta (ZPWNDPtr),y
2020-09-13 19:05:38 +00:00
2020-09-08 15:31:41 +00:00
stz Counter X
stz Counter+1 Y
2020-09-13 19:05:38 +00:00
2020-09-08 15:31:41 +00:00
ldy #S.OBJ.F
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-23 06:03:23 +00:00
and #S.WND.F.BORDER
2020-09-10 15:28:59 +00:00
beq .1
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
lda #1
jsr WND.ShowBorders
2020-09-13 19:05:38 +00:00
2020-09-10 15:28:59 +00:00
.1 ldy #S.WND.TITLE+1
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-13 19:05:38 +00:00
bne .2
ldy #S.OBJ.S
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-13 19:05:38 +00:00
and #S.WND.F.MOVE+S.WND.F.CLOSE+S.WND.F.MIN+S.WND.F.MAX
beq .3
2020-09-08 15:31:41 +00:00
2020-09-13 19:05:38 +00:00
.2 lda Counter+1
2020-09-10 15:28:59 +00:00
clc
2020-09-15 14:48:35 +00:00
adc SYSFON.Hp2
2020-09-10 15:28:59 +00:00
sta Counter+1
2020-09-08 15:31:41 +00:00
2020-10-02 14:57:05 +00:00
ldy #S.WND.TBarY2
2020-09-29 15:37:26 +00:00
lda (ZPWNDPtr),y
clc
adc SYSFON.Hp2
sta (ZPWNDPtr),y
iny
lda (ZPWNDPtr),y
adc #0
sta (ZPWNDPtr),y
lda #S.WND.S.HASTBAR
2020-09-13 19:05:38 +00:00
jsr WND.SetStatus
jsr WND.PaintTopBar
2020-10-26 06:38:50 +00:00
bcs .9
2020-10-02 05:59:41 +00:00
*--------------------------------------
2020-09-29 15:37:26 +00:00
.3 ldy #S.WND.MBAR+1
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
beq .7
2020-09-30 15:32:54 +00:00
2020-09-15 14:48:35 +00:00
lda Counter+1
clc
adc SYSFON.Hp2
sta Counter+1
2020-09-30 15:32:54 +00:00
2020-10-02 14:57:05 +00:00
ldy #S.WND.TBarY2
2020-09-29 15:37:26 +00:00
lda (ZPWNDPtr),y
clc
2020-09-30 15:32:54 +00:00
adc SYSFON.H
2020-09-29 15:37:26 +00:00
tax
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
iny
lda (ZPWNDPtr),y
adc #0
2020-10-02 14:57:05 +00:00
ldy #S.WND.MBarY2+1
2020-09-29 15:37:26 +00:00
sta (ZPWNDPtr),y
txa
dey
sta (ZPWNDPtr),y
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
lda #S.WND.S.HASMBAR
2020-09-15 14:48:35 +00:00
jsr WND.SetStatus
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
jsr WND.PaintMBar
2020-10-02 05:59:41 +00:00
*--------------------------------------
2020-09-15 06:12:52 +00:00
.7 ldy #S.WND.STATUS+1
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-15 06:12:52 +00:00
beq .8
2020-09-30 15:32:54 +00:00
2020-09-15 06:12:52 +00:00
lda Counter+1
clc
2020-09-15 14:48:35 +00:00
adc SYSFON.Hp2
2020-09-15 06:12:52 +00:00
sta Counter+1
2020-09-30 15:32:54 +00:00
2020-10-02 05:59:41 +00:00
ldy #S.OBJ.Y2
lda (ZPWNDPtr),y
sec
sbc SYSFON.H
tax
iny
lda (ZPWNDPtr),y
sbc #0
2020-10-02 14:57:05 +00:00
ldy #S.WND.SBarY1+1
2020-10-02 05:59:41 +00:00
sta (ZPWNDPtr),y
txa
dey
sta (ZPWNDPtr),y
2020-09-29 15:37:26 +00:00
lda #S.WND.S.HASSBAR
2020-09-15 14:48:35 +00:00
jsr WND.SetStatus
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
jsr WND.PaintSBar
2020-10-02 05:59:41 +00:00
*--------------------------------------
2020-10-06 06:27:35 +00:00
.8 ldy #S.WND.InnerH
lda (ZPWNDPtr),y
sec
sbc Counter+1
sta (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
2020-10-06 06:27:35 +00:00
iny
lda (ZPWNDPtr),y
sbc #0
sta (ZPWNDPtr),y
2020-09-13 19:05:38 +00:00
2020-10-06 06:27:35 +00:00
>LDYA L.WND.Desktop
2020-10-26 16:32:51 +00:00
jsr DrawCBBufToYA
2020-10-26 06:38:50 +00:00
lda WND.hWND
pha
bra WND.Paint1
2020-09-08 15:31:41 +00:00
2020-10-26 16:32:51 +00:00
.9
WND.Show.RTS rts
2018-05-16 06:02:57 +00:00
*--------------------------------------
2020-10-01 15:30:25 +00:00
WND.Paint pha hWND
>SYSCALL2 GetMemPtr
>STYA ZPWNDPtr
2020-10-26 06:38:50 +00:00
WND.Paint1 ldy #S.WND.fPaint
lda (ZPWNDPtr),y
2020-10-01 15:30:25 +00:00
sta ZPPtr1
iny
2020-10-26 06:38:50 +00:00
lda (ZPWNDPtr),y
2020-10-01 15:30:25 +00:00
sta ZPPtr1+1
2020-10-26 06:38:50 +00:00
2020-10-01 15:30:25 +00:00
pla
2020-10-26 06:38:50 +00:00
2020-10-01 15:30:25 +00:00
jmp (ZPPtr1)
2020-09-08 15:31:41 +00:00
*--------------------------------------
2020-10-26 06:38:50 +00:00
WND.fPaint >SYSCALL2 GetMemPtr
>STYA ZPWNDPtr
jsr GetCBBuf
2020-10-26 16:32:51 +00:00
bcs WND.Show.RTS
2020-10-01 15:30:25 +00:00
lda #S.CB.CMD.FILLRECT
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.CMD
2020-10-01 15:30:25 +00:00
2020-10-26 16:32:51 +00:00
lda #S.CB.OP.SET+S.CB.OP.COLOR
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.OP
2020-10-02 14:57:05 +00:00
lda #S.CB.M.MONO
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.M
2020-10-01 15:30:25 +00:00
ldy #S.WND.BGCOLOR
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.COLOR
2020-10-01 15:30:25 +00:00
ldy #S.OBJ.X1
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.X1
2020-10-01 15:30:25 +00:00
iny
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.X1+1
2020-10-02 14:57:05 +00:00
ldy #S.WND.InnerY1
2020-10-01 15:30:25 +00:00
lda (ZPWNDPtr),y
2020-10-02 05:59:41 +00:00
clc
adc #1
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.Y1
2020-10-01 15:30:25 +00:00
iny
lda (ZPWNDPtr),y
2020-10-02 05:59:41 +00:00
adc #0
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.Y1+1
2020-10-01 15:30:25 +00:00
ldy #S.OBJ.X2
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.X2
2020-10-01 15:30:25 +00:00
iny
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.X2+1
2020-10-01 15:30:25 +00:00
2020-10-02 14:57:05 +00:00
ldy #S.WND.InnerY2
2020-10-01 15:30:25 +00:00
lda (ZPWNDPtr),y
2020-10-02 14:57:05 +00:00
sec
sbc #1
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.Y2
2020-10-01 15:30:25 +00:00
iny
lda (ZPWNDPtr),y
2020-10-02 14:57:05 +00:00
sbc #0
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.Y2+1
jsr PutCBCache2CBBuf
2020-10-26 16:32:51 +00:00
ldy #S.WND.BGBM
2020-10-26 06:38:50 +00:00
lda (ZPWNDPtr),y
2020-10-26 16:32:51 +00:00
sta CB.Cache+S.CB.SrcPtr
iny
ora (ZPWNDPtr),y
beq .8
lda (ZPWNDPtr),y
sta CB.Cache+S.CB.SrcPtr+1
stz S.CB.SrcX
stz S.CB.SrcX+1
stz S.CB.SrcY
stz S.CB.SrcY+1
2020-10-01 15:30:25 +00:00
2020-10-26 16:32:51 +00:00
ldy #S.WND.InnerW+3
ldx #3
2020-10-01 15:30:25 +00:00
2020-10-26 16:32:51 +00:00
.1 lda (ZPWNDPtr),y
sta CB.Cache+S.CB.SrcW,x
dey
dex
bpl .1
2020-09-14 14:31:41 +00:00
2020-10-26 16:32:51 +00:00
lda #S.CB.CMD.BITBLT
sta CB.Cache+S.CB.CMD
jsr PutCBCache2CBBuf
2020-09-10 15:28:59 +00:00
2020-10-26 16:32:51 +00:00
.8 >LDYA L.WND.Desktop
jmp DrawCBBufToYA
2020-10-26 06:38:50 +00:00
*--------------------------------------
WND.ShowBorders sta IY
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
lda #S.CB.CMD.HLINE
jsr CB.InitCacheA
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
lda #S.CB.OP.SET
sta CB.Cache+S.CB.OP
lda #S.CB.M.MONO
sta CB.Cache+S.CB.M
lda PREFS.BORDERCOLOR
sta CB.Cache+S.CB.COLOR
2020-09-14 14:31:41 +00:00
ldy #S.OBJ.X1
2020-10-26 06:38:50 +00:00
lda (ZPWNDPtr),y
sec
sbc IY
sta CB.Cache+S.CB.X1
iny
lda (ZPWNDPtr),y
sbc #0
sta CB.Cache+S.CB.X1+1
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
iny #S.OBJ.Y1
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
lda (ZPWNDPtr),y
sec
sbc IY
sta CB.Cache+S.CB.Y1
sta CB.Cache+S.CB.Y2
iny
lda (ZPWNDPtr),y
sbc #0
sta CB.Cache+S.CB.Y1+1
sta CB.Cache+S.CB.Y2+1 top X1-1,Y1-1,X2+1,Y1-1
2020-09-10 15:28:59 +00:00
2020-10-26 06:38:50 +00:00
iny #S.OBJ.X2
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
lda (ZPWNDPtr),y
clc
adc IY
sta CB.Cache+S.CB.X2
iny
lda (ZPWNDPtr),y
adc #0
sta CB.Cache+S.CB.X2+1
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
jsr PutCBCache2CBBuf
2020-09-13 19:05:38 +00:00
2020-09-10 15:28:59 +00:00
ldy #S.OBJ.Y2
2020-10-26 06:38:50 +00:00
lda (ZPWNDPtr),y
clc
adc IY
sta CB.Cache+S.CB.Y1
sta CB.Cache+S.CB.Y2
iny
lda (ZPWNDPtr),y
adc #0
sta CB.Cache+S.CB.Y1+1
sta CB.Cache+S.CB.Y2+1 bottom X1-1,Y2+1,X2+1,Y2+1
2020-09-10 15:28:59 +00:00
2020-10-26 06:38:50 +00:00
jsr PutCBCache2CBBuf
2020-09-10 15:28:59 +00:00
2020-10-26 06:38:50 +00:00
lda #S.CB.CMD.VLINE
sta CB.Cache+S.CB.CMD
2020-09-10 15:28:59 +00:00
2020-10-26 06:38:50 +00:00
ldy #S.OBJ.Y1
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-14 14:31:41 +00:00
sec
2020-10-26 06:38:50 +00:00
sbc IY
sta CB.Cache+S.CB.Y1
2020-09-14 14:31:41 +00:00
iny
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-14 14:31:41 +00:00
sbc #0
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.Y1+1
lda CB.Cache+S.CB.X1
sta CB.Cache+S.CB.X2
lda CB.Cache+S.CB.X1+1
sta CB.Cache+S.CB.X2+1 left X1-1,Y1-1,X1-1,Y2+1
jsr PutCBCache2CBBuf
2020-09-14 14:31:41 +00:00
2020-10-26 06:38:50 +00:00
ldy #S.OBJ.X2
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-14 14:31:41 +00:00
clc
2020-10-26 06:38:50 +00:00
adc IY
sta CB.Cache+S.CB.X1
sta CB.Cache+S.CB.X2
2020-09-10 15:28:59 +00:00
iny
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
adc #0
sta CB.Cache+S.CB.X1+1
sta CB.Cache+S.CB.X2+1 right X2+1,Y1-1,X2+1,Y2+1
jmp PutCBCache2CBBuf
2020-09-10 15:28:59 +00:00
*--------------------------------------
2020-09-13 19:05:38 +00:00
WND.PaintTopBar lda #S.CB.CMD.FILLRECT
2020-10-26 06:38:50 +00:00
jsr CB.InitCacheA
2020-09-13 19:05:38 +00:00
lda #S.CB.OP.SET
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.OP
2020-09-13 19:05:38 +00:00
lda #S.CB.M.C16
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.M
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
ldx PREFS.TBARCOLORI
2020-09-30 15:32:54 +00:00
2020-09-15 14:48:35 +00:00
ldy #S.OBJ.S
lda (ZPWNDPtr),y
and #S.WND.S.ACTIVE
beq .10
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
ldx PREFS.TBARCOLORA
2020-09-30 15:32:54 +00:00
2020-10-26 06:38:50 +00:00
.10 stx CB.Cache+S.CB.COLOR
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
ldy #S.OBJ.X1+5 X1,Y1,X2
ldx #5
2020-09-14 14:31:41 +00:00
2020-10-26 06:38:50 +00:00
.11 lda (ZPWNDPtr),y
sta CB.Cache+S.CB.X1,x
dey
dex
bpl .11
2020-09-14 14:31:41 +00:00
2020-10-26 06:38:50 +00:00
>LDYA CB.Cache+S.CB.X1
>STYA DX
2020-09-14 14:31:41 +00:00
ldy #S.OBJ.Y1
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta DY
2020-09-14 14:31:41 +00:00
sec
adc SYSFON.H
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.Y2
2020-09-14 14:31:41 +00:00
iny
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta DY+1
2020-09-14 14:31:41 +00:00
adc #0
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.Y2+1
jsr PutCBCache2CBBuf
inc DY
bne .12
inc DY+1
2020-09-14 14:31:41 +00:00
* TOP LEFT ICON
2020-10-26 06:38:50 +00:00
.12 ldy #S.WND.ICON+1
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-13 19:05:38 +00:00
tax
dey
2020-09-15 14:48:35 +00:00
ora (ZPWNDPtr),y
2020-09-13 19:05:38 +00:00
bne .1
2020-10-26 06:38:50 +00:00
>LDYA L.BM.Apple
2020-09-13 19:05:38 +00:00
bra .2
2020-09-15 14:48:35 +00:00
.1 lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
tay
txa
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
.2 jsr DRAW.yaBMAtDXDY
2020-09-13 19:05:38 +00:00
2020-09-14 14:31:41 +00:00
jsr WND.PaintTopBarTitle
bcs .9
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
* TOP RIGHT ICONS
ldy #S.OBJ.X2
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-14 14:31:41 +00:00
sec
2020-10-26 06:38:50 +00:00
sbc #48
sta DX
2020-09-14 14:31:41 +00:00
iny
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-14 14:31:41 +00:00
sbc #0
2020-10-26 06:38:50 +00:00
sta DX+1
2020-09-30 15:32:54 +00:00
2020-10-26 06:38:50 +00:00
ldy #S.OBJ.F
lda (ZPWNDPtr),y
bit #S.WND.F.MIN
beq .3
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
ldx #BM.ID.MIN
jsr DRAW.xBMAtDXDY
2020-09-14 14:31:41 +00:00
2020-10-26 06:38:50 +00:00
.3 lda DX
clc
adc #16
sta DX
bcc .31
inc DX+1
2020-09-30 15:32:54 +00:00
2020-10-26 06:38:50 +00:00
.31 ldy #S.OBJ.F
lda (ZPWNDPtr),y
bit #S.WND.F.MAX
2020-09-14 14:31:41 +00:00
beq .4
2020-09-30 15:32:54 +00:00
2020-10-26 06:38:50 +00:00
ldx #BM.ID.MAX
jsr DRAW.xBMAtDXDY
2020-09-30 15:32:54 +00:00
2020-10-26 06:38:50 +00:00
.4 lda DX
clc
adc #16
sta DX
bcc .41
inc DX+1
2020-09-14 14:31:41 +00:00
2020-10-26 06:38:50 +00:00
.41 ldy #S.OBJ.F
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
bit #S.WND.F.CLOSE
2020-09-14 14:31:41 +00:00
beq .8
2020-09-30 15:32:54 +00:00
2020-10-26 06:38:50 +00:00
ldx #BM.ID.CLOSE
jsr DRAW.xBMAtDXDY
2020-09-14 14:31:41 +00:00
.8 clc
2020-09-13 19:05:38 +00:00
.9 rts
*--------------------------------------
WND.PaintTopBarTitle
ldy #S.WND.TITLE
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-01 15:30:25 +00:00
pha
2020-09-13 19:05:38 +00:00
iny
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-01 15:30:25 +00:00
ply
2020-09-13 19:05:38 +00:00
2020-10-01 15:30:25 +00:00
ldx hSYSFONB
jsr FON.GetTextSize
2020-09-13 19:05:38 +00:00
2020-09-14 14:31:41 +00:00
ldy #S.OBJ.W
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-14 14:31:41 +00:00
sec
sbc CB.Cache+S.CB.SrcW
2020-09-30 15:32:54 +00:00
2020-09-14 14:31:41 +00:00
sta DX
2020-09-30 15:32:54 +00:00
2020-09-14 14:31:41 +00:00
iny
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-14 14:31:41 +00:00
sbc CB.Cache+S.CB.SrcW+1
lsr
ror DX
sta DX+1
2020-09-30 15:32:54 +00:00
2020-09-14 14:31:41 +00:00
ldy #S.OBJ.X1
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-11 20:54:15 +00:00
clc
2020-09-14 14:31:41 +00:00
adc DX
2020-09-15 06:12:52 +00:00
and PREFS.BESTVIEWEDX
2020-10-26 06:38:50 +00:00
sta DX
2020-09-14 14:31:41 +00:00
2020-09-11 20:54:15 +00:00
iny
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-09-14 14:31:41 +00:00
adc DX+1
2020-10-26 06:38:50 +00:00
sta DX+1
2020-09-30 15:32:54 +00:00
2020-10-26 06:38:50 +00:00
ldy #S.WND.TITLE
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
pha
2020-09-11 20:54:15 +00:00
iny
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
ply
2020-09-13 19:05:38 +00:00
2020-10-26 06:38:50 +00:00
ldx hSYSFONB
2020-09-10 15:28:59 +00:00
clc
2020-10-26 06:38:50 +00:00
jmp DRAW.YATextAtDXDY
2020-09-15 06:12:52 +00:00
*--------------------------------------
2020-10-26 06:38:50 +00:00
WND.PaintMBar lda #S.CB.CMD.FILLRECT
jsr CB.InitCacheA
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
lda #S.CB.OP.SET
sta CB.Cache+S.CB.OP
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
lda #S.CB.M.MONO
sta CB.Cache+S.CB.M
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
lda PREFS.MBARCOLOR
2020-09-30 15:32:54 +00:00
sta CB.Cache+S.CB.COLOR
2020-09-29 15:37:26 +00:00
ldy #S.OBJ.X1
lda (ZPWNDPtr),y
sta CB.Cache+S.CB.X1
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
iny
lda (ZPWNDPtr),y
sta CB.Cache+S.CB.X1+1
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
ldy #S.OBJ.X2
lda (ZPWNDPtr),y
sta CB.Cache+S.CB.X2
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
iny
lda (ZPWNDPtr),y
sta CB.Cache+S.CB.X2+1
2020-10-02 14:57:05 +00:00
ldy #S.WND.MBarY1
2020-09-29 15:37:26 +00:00
lda (ZPWNDPtr),y
sta CB.Cache+S.CB.Y1
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
iny
lda (ZPWNDPtr),y
sta CB.Cache+S.CB.Y1+1
2020-09-15 14:48:35 +00:00
2020-10-02 14:57:05 +00:00
iny #S.WND.MBarY2
2020-09-29 15:37:26 +00:00
lda (ZPWNDPtr),y
sta CB.Cache+S.CB.Y2
2020-09-30 15:32:54 +00:00
2020-09-29 15:37:26 +00:00
iny
lda (ZPWNDPtr),y
sta CB.Cache+S.CB.Y2+1
jsr PutCBCache2CBBuf
2020-09-30 15:32:54 +00:00
ldy #S.WND.MBAR
lda (ZPWNDPtr),y
pha
iny
lda (ZPWNDPtr),y
ply
2020-10-23 15:23:19 +00:00
jsr MBAR.Init
2020-09-30 15:32:54 +00:00
.1 lda (ZPMENUPtr)
beq .8
2020-10-02 14:57:05 +00:00
jsr CB.ClearCache
2020-09-30 15:32:54 +00:00
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
2020-10-28 16:35:04 +00:00
lda hSYSFON
2020-09-30 15:32:54 +00:00
sta CB.CACHE+S.CB.hFont
2020-10-23 15:23:19 +00:00
ldy #S.MBITEM.XT
2020-09-30 15:32:54 +00:00
lda (ZPMENUPtr),y
clc
ldy #S.OBJ.X1
adc (ZPWNDPtr),y
sta CB.CACHE+S.CB.X1
2020-10-26 06:38:50 +00:00
2020-10-23 15:23:19 +00:00
ldy #S.MBITEM.XT+1
2020-09-30 15:32:54 +00:00
lda (ZPMENUPtr),y
ldy #S.OBJ.X1+1
adc (ZPWNDPtr),y
sta CB.CACHE+S.CB.X1+1
2020-09-29 15:37:26 +00:00
2020-10-02 14:57:05 +00:00
ldy #S.WND.MBarY1
2020-09-30 15:32:54 +00:00
lda (ZPWNDPtr),y
2020-10-01 06:08:33 +00:00
clc
adc #1
2020-09-30 15:32:54 +00:00
sta CB.CACHE+S.CB.Y1
iny
lda (ZPWNDPtr),y
2020-10-01 06:08:33 +00:00
adc #0
2020-09-30 15:32:54 +00:00
sta CB.CACHE+S.CB.Y1+1
2020-10-23 15:23:19 +00:00
lda #S.MBITEM.TEXT
2020-09-30 15:32:54 +00:00
clc
adc ZPMENUPtr
sta CB.CACHE+S.CB.TxtPtr
2020-10-26 06:38:50 +00:00
2020-09-30 15:32:54 +00:00
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
2020-09-15 14:48:35 +00:00
*--------------------------------------
2020-09-29 15:37:26 +00:00
WND.PaintSBar lda #S.CB.CMD.HLINE
2020-10-26 06:38:50 +00:00
jsr CB.InitCacheA
2020-09-30 15:32:54 +00:00
2020-10-26 06:38:50 +00:00
lda #S.CB.OP.SET
2020-09-15 06:12:52 +00:00
sta CB.Cache+S.CB.OP
lda #S.CB.M.MONO
sta CB.Cache+S.CB.M
2020-10-26 06:38:50 +00:00
lda PREFS.BORDERCOLOR
sta CB.Cache+S.CB.COLOR
2020-09-15 06:12:52 +00:00
2020-10-26 06:38:50 +00:00
ldy #S.OBJ.X1
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.X1
sta DX
2020-09-15 06:12:52 +00:00
iny
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.X1+1
sta DX+1
2020-09-15 06:12:52 +00:00
2020-10-26 06:38:50 +00:00
ldy #S.WND.SBarY1
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.Y1
clc
adc #1
sta DY
2020-09-15 06:12:52 +00:00
iny
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.Y1+1
adc #0
sta DY+1
2020-09-15 06:12:52 +00:00
2020-10-26 06:38:50 +00:00
ldy #S.OBJ.X2
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.X2
2020-09-15 06:12:52 +00:00
iny
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.X2+1
2020-09-15 06:12:52 +00:00
2020-09-15 14:48:35 +00:00
jsr PutCBCache2CBBuf
lda #S.CB.CMD.FILLRECT
sta CB.Cache+S.CB.CMD
2020-10-26 06:38:50 +00:00
* lda #S.CB.OP.SET
* sta CB.Cache+S.CB.OP
* lda #S.CB.M.MONO
* sta CB.Cache+S.CB.M
2020-09-29 15:37:26 +00:00
lda PREFS.SBARCOLOR
2020-10-26 06:38:50 +00:00
sta CB.Cache+S.CB.COLOR
2020-09-30 15:32:54 +00:00
2020-10-26 06:38:50 +00:00
inc CB.Cache+S.CB.Y1
bne .1
inc CB.Cache+S.CB.Y1+1
2020-09-15 14:48:35 +00:00
2020-10-26 06:38:50 +00:00
.1 ldy #S.OBJ.Y2
2020-09-15 14:48:35 +00:00
lda (ZPWNDPtr),y
sta CB.Cache+S.CB.Y2
iny
lda (ZPWNDPtr),y
sta CB.Cache+S.CB.Y2+1
2020-09-15 06:12:52 +00:00
2020-09-15 14:48:35 +00:00
jsr PutCBCache2CBBuf
2020-09-15 06:12:52 +00:00
2020-10-26 06:38:50 +00:00
ldy #S.WND.STATUS
lda (ZPWNDPtr),y
pha
iny
lda (ZPWNDPtr),y
ply
2020-09-15 06:12:52 +00:00
2020-10-26 06:38:50 +00:00
ldx hSYSFON
clc
jmp DRAW.YATextAtDXDY
2020-09-13 19:05:38 +00:00
*--------------------------------------
WND.ClrStatus ldy #S.OBJ.S
eor #$ff
2020-09-15 14:48:35 +00:00
and (ZPWNDPtr),y
sta (ZPWNDPtr),y
2020-09-13 19:05:38 +00:00
rts
*--------------------------------------
WND.SetStatus ldy #S.OBJ.S
2020-09-15 14:48:35 +00:00
ora (ZPWNDPtr),y
sta (ZPWNDPtr),y
2020-09-13 19:05:38 +00:00
rts
2020-09-10 15:28:59 +00:00
*--------------------------------------
MAN
2020-06-30 15:32:23 +00:00
SAVE usr/src/lib/libgui.s.wnd
LOAD usr/src/lib/libgui.s
ASM