Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-09-08 17:31:41 +02:00
parent 9dc0c1c279
commit ed201af3ae
7 changed files with 238 additions and 67 deletions

Binary file not shown.

View File

@ -77,8 +77,8 @@ S.CB.hFont .EQ 3 DRAWTEXT,GETTEXTSIZE
S.CB.X1 .EQ 4 xPIXEL,xLINE,FILLRECT,BITBLT,GETRECTBUFSIZE,DRAWLINE
S.CB.Y1 .EQ 6 xPIXEL,xLINE,FILLRECT,BITBLT,GETRECTBUFSIZE,DRAWLINE
S.CB.X2 .EQ 8 VLINE,FILLRECT,GETRECTBUFSIZE,DRAWLINE
S.CB.Y2 .EQ 10 HLINE,FILLRECT,GETRECTBUFSIZE,DRAWLINE
S.CB.X2 .EQ 8 HLINE,FILLRECT,GETRECTBUFSIZE,DRAWLINE
S.CB.Y2 .EQ 10 VLINE,FILLRECT,GETRECTBUFSIZE,DRAWLINE
S.CB.SrcX .EQ 12 BITBLT,DRAWTEXT,GETTEXTSIZE
S.CB.SrcY .EQ 14 BITBLT,DRAWTEXT,GETTEXTSIZE

View File

@ -9,6 +9,10 @@ LIBGUI.ShowCursor .EQ 12
LIBGUI.UpdateCursor .EQ 14
LIBGUI.ReadMouse .EQ 16
LIBGUI.GetScreenGC .EQ 18
LIBGUI.WND.Create .EQ 20
LIBGUI.WND.SetProp .EQ 22
LIBGUI.WND.GetProp .EQ 24
LIBGUI.WND.Show .EQ 26
*--------------------------------------
CUR.T.ARROW .EQ 0
CUR.T.RESIZEX .EQ 2
@ -51,7 +55,7 @@ S.RECT .EQ 8
*--------------------------------------
S.OBJ.T .EQ 0
S.OBJ.T.WND .EQ 0
S.OBJ.T.MENUBAR .EQ 2
S.OBJ.T.MBAR .EQ 2
S.OBJ.T.MENU .EQ 4
S.OBJ.T.MITEM .EQ 6
S.OBJ.T.BUT .EQ 8
@ -59,6 +63,7 @@ S.OBJ.T.TEXT .EQ 10
S.OBJ.F .EQ 1
S.OBJ.S .EQ 2
S.OBJ.S.VISIBLE .EQ %10000000
S.OBJ.ID .EQ 3
S.OBJ.hOWNER .EQ 4
S.OBJ.hPARENT .EQ 6
@ -82,18 +87,19 @@ S.WND.F.BORDER .EQ %00100000
S.WND.F.MODAL .EQ %01000000
S.WND.F.SYSMODAL .EQ %10000000
*
S.WND.S.ACTIVE .EQ %00000100
S.WND.S.MAX .EQ %00001000
S.WND.S.MIN .EQ %00010000
*
S.WND.MinW .EQ S.OBJ
S.WND.MinH .EQ S.OBJ+2
S.WND.hTITLE .EQ S.OBJ+4
S.WND.hMENUBAR .EQ S.OBJ+6
S.WND.hBKCOLOR .EQ S.OBJ+8
S.WND.hBKBM .EQ S.OBJ+10
S.WND.TITLE .EQ S.OBJ+4
S.WND.MBAR .EQ S.OBJ+6
S.WND.BGCOLOR .EQ S.OBJ+8
S.WND.BGBM .EQ S.OBJ+10
S.WND.hCUR .EQ S.OBJ+12
S.WND.hSTATUS .EQ S.OBJ+14
S.WND.hICON .EQ S.OBJ+16
S.WND.STATUS .EQ S.OBJ+14
S.WND.ICON .EQ S.OBJ+16
S.WND.InnerW .EQ S.OBJ+18
S.WND.InnerH .EQ S.OBJ+20
*
@ -133,10 +139,7 @@ S.BUT.F.DISABLED .EQ %10000000
S.BUT.S.PUSHED .EQ %10000000
*
S.BUT.hBM .EQ S.OBJ
S.BUT.TEXTX .EQ S.OBJ+2
S.BUT.TEXTY .EQ S.OBJ+4
S.BUT.TEXTLEN .EQ S.OBJ+6
S.BUT.TEXT .EQ S.OBJ+8
S.BUT.TEXT .EQ S.OBJ+2
* ...
*--------------------------------------
S.TEXT.F.DISABLED .EQ %10000000

View File

@ -3,7 +3,8 @@ NEW
*--------------------------------------
Draw >PULLW ZPCBPtr Get CB
>PULLYA Get GC
jsr OBJ.Get
DrawToYA jsr OBJ.Get
.1 lda (ZPCBPtr)
beq .8

View File

@ -72,23 +72,172 @@ WND.Quit lda WND.Screen+S.OBJ.hPARENT
.8 clc
rts
*--------------------------------------
WND.New >STYA ZPPtr1
>LDYAI S.WND
* F8, X116, Y116, W16, H16
*--------------------------------------
WND.Create >LDYAI S.WND
>SYSCALL2 getmem
bcs .9
>STYA ZPWNDPtr
>STYA ZPPtr1
lda #S.OBJ.T.WND
sta (ZPPtr1) S.OBJ.T
ldy #S.WND-1
lda #0
.1 lda (ZPPtr1),y
sta (ZPWNDPtr),y
.1 sta (ZPPtr1),y
dey
bpl .1
bne .1
>PULLA
ldy #S.OBJ.H
sta (ZPPtr1),y
>PULLA
iny
sta (ZPPtr1),y
>PULLA
ldy #S.OBJ.W
sta (ZPPtr1),y
>PULLA
iny
sta (ZPPtr1),y
>PULLA
ldy #S.OBJ.Y1
sta (ZPPtr1),y
>PULLA
iny
sta (ZPPtr1),y
>PULLA
ldy #S.OBJ.X1
sta (ZPPtr1),y
>PULLA
iny
sta (ZPPtr1),y
>PULLA
ldy #S.OBJ.F
sta (ZPPtr1),y
ldy #S.PS.PID
lda (pPs),y
ldy #S.OBJ.hOWNER
sta (ZPPtr1),y
txa ID
* clc
rts
.9 >RET 9
*--------------------------------------
* hWND8, Prop8, Value16
*--------------------------------------
WND.SetProp ldy #3
lda (pStack),y hWND
>SYSCALL2 GetMemPtr
>STYA ZPPtr1
ldy #2
lda (pStack),y
tay
>PULLA
sta (ZPPtr1),y
iny
>PULLA
sta (ZPPtr1),y
>RET 2
*--------------------------------------
* hWND8, Prop8
*--------------------------------------
WND.GetProp >PULLA
pha
>PULLA
>SYSCALL2 GetMemPtr
>STYA ZPPtr1
ply
lda (ZPPtr1),y
pha
iny
lda (ZPPtr1),y
ply
rts
*--------------------------------------
* A = hWND
*--------------------------------------
WND.Show >SYSCALL2 GetMemPtr
>STYA ZPPtr1
jsr OBJ.SetX2Y2
jsr GetCBBuf
bcs .9
stz Counter X
stz Counter+1 Y
ldy #S.OBJ.F
lda (ZPPtr1),y
and #S.WND.F.RESIZE+S.WND.F.BORDER
beq .10
inc Counter 1 pixel L
inc Counter 1 pixel R
inc Counter+1 1 top
inc Counter+1 1 bottom
lda #S.CB.CMD.HLINE
jsr PutCBBuf
lda #S.CB.OP.SET
jsr PutCBBuf
lda #S.CB.M.MONO
jsr PutCBBuf
lda PREFS.BORDERCOLOR
jsr PutCBBuf
ldy #S.OBJ.X1
.1 lda (ZPPtr1),y
jsr PutCBBuf
iny
cpy #S.OBJ.Y2+2
bne .1
.10
lda #0
jsr PutCBBuf
>LDYA L.WND.Screen
jsr DrawToYA
lda hCBBuf
>SYSCALL FreeMem
clc
.9 rts
*--------------------------------------
WND.New clc
rts
*--------------------------------------
WND.Paint >STYA ZPPtr1
clc

View File

@ -79,6 +79,8 @@ ZPObjPtr .BS 2
ZPCBPtr .BS 2
ZPWNDPtr .BS 2
CLIP.Line.P1 .BS 1
CLIP.Line.P2 .BS 1
DX .BS 2
DY .BS 2
IY .BS 1
@ -88,8 +90,9 @@ D .BS 2
INE .BS 2
Counter .BS 2
CLIP.Line.P1 .BS 1
CLIP.Line.P2 .BS 1
hCBBuf .BS 1
ZPCBBufPtr .BS 2
.ED
*--------------------------------------
* File Header (16 Bytes)
@ -116,6 +119,10 @@ CS.START cld
.DA UpdateCursor
.DA MOU.ReadMouse
.DA GetScreenGC
.DA WND.Create
.DA WND.SetProp
.DA WND.GetProp
.DA WND.Show
*--------------------------------------
J.Cmds .DA DrawLine
.DA DrawText2
@ -298,6 +305,21 @@ CB.Get >STYA .1+1
rts
*--------------------------------------
GetCBBuf >LDYAI 256
>SYSCALL GetMem
bcs .9
stx hCBBuf
>STYA ZPCBPtr
>STYA ZPCBBufPtr
.9 rts
*--------------------------------------
PutCBBuf sta (ZPCBBufPtr)
inc ZPCBBufPtr
bne .8
inc ZPCBBufPtr+1
.8 rts
*--------------------------------------
GFXWrite.CB >LDYA L.CB.Cache
GFXWrite.YA pha
@ -341,7 +363,7 @@ hDevMouse .BS 1
*--------------------------------------
CB.CmdLen .DA #S.CB.Y1+1 SETPIXEL
.DA #S.CB.Y1+1 GETPIXEL
.DA #S.CB.X2+1 HLINE
.DA #S.CB.Y2+1 HLINE
.DA #S.CB.Y2+1 VLINE
.DA #S.CB.Y2+1 FILLRECT
.DA #S.CB.DstPtr+1 BITBLT
@ -387,11 +409,21 @@ WND.SysBar.Childs
BUT.Sys .DA #S.OBJ.T.BUT
.DA #0 F
.DA #0 S
.DA #0 ID
.DA #2 ID
.DA 0 hOWNER
.DA 0 pPARENT
.BS S.OBJ-S.OBJ.X1
.BS 2 S.BUT.hBM
.AZ "A2osX" S.BUT.TEXT
*--------------------------------------
MENU.Sys
MENU.Sys .DA #2 ID
.DA #0 KEYMOD
.DA #0 KEY
.AZ "About..."
.DA #0
*--------------------------------------
PREFS.BORDERCOLOR .DA #0 BLACK
*--------------------------------------
MAN
SAVE usr/src/lib/libgui.s

View File

@ -43,7 +43,7 @@ CS.START cld
.DA CS.QUIT
L.LIBGUI .DA LIBGUI
L.MouseData .DA MouseData
L.CB.Paint .DA CB.Paint
L.WND.Title .DA L.WND.Title
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBGUI
@ -58,6 +58,10 @@ CS.RUN
CS.RUN.LOOP >SLEEP
* lda A2osX.ASCREEN
* cmp #8
* bne CS.RUN.LOOP
>PUSHW L.MouseData
>LIBCALL hLIBGUI,LIBGUI.ReadMouse
bcs .8
@ -69,28 +73,6 @@ CS.RUN.LOOP >SLEEP
>PUSHW L.MouseData
>LIBCALL hLIBGUI,LIBGUI.SetCursorPos
lda MouseData+S.MOUSE.X1
sta CB.Paint+S.CB.X1
clc
adc #39
sta CB.Paint+S.CB.X2
lda MouseData+S.MOUSE.X1+1
sta CB.Paint+S.CB.X1+1
adc #0
sta CB.Paint+S.CB.X2+1
lda MouseData+S.MOUSE.Y1
sta CB.Paint+S.CB.Y1
clc
adc #29
sta CB.Paint+S.CB.Y2
lda MouseData+S.MOUSE.Y1+1
sta CB.Paint+S.CB.Y1+1
adc #0
sta CB.Paint+S.CB.Y2+1
lda MouseData+S.MOUSE.S
.1 bit #S.MOUSE.S.CLK
@ -107,7 +89,7 @@ CS.RUN.LOOP >SLEEP
.2 >STA.G CUR.T
>LIBCALL hLIBGUI,LIBGUI.SetCursor
jsr Destop.Paint
jsr WND.Test
.4
@ -127,15 +109,26 @@ CS.DOEVENT lda (pEvent)
CS.QUIT clc
rts
*--------------------------------------
Destop.Paint >LIBCALL hLIBGUI,LIBGUI.HideCursor
WND.Test >PUSHBI S.WND.F.RESIZE+S.WND.F.MOVE+S.WND.F.CLOSE+S.WND.F.MAX+S.WND.F.MIN
>PUSHW MouseData+S.MOUSE.X1
>PUSHW MouseData+S.MOUSE.Y1
>PUSHWI 200
>PUSHWI 100
>LIBCALL hLIBGUI,LIBGUI.WND.Create
bcs .9
sta hWND
* >PUSHA
* >PUSHBI S.WND.TITLE
* >PUSHW L.WND.Title
* >LIBCALL hLIBGUI,LIBGUI.WND.SetProp
>LIBCALL hLIBGUI,LIBGUI.GetScreenGC
>PUSHYA
>PUSHW L.CB.Paint
>LIBCALL hLIBGUI,LIBGUI.Draw
>LIBCALL hLIBGUI,LIBGUI.ShowCursor
rts
lda hWND
>LIBCALL hLIBGUI,LIBGUI.WND.Show A = hWND
clc
.9 rts
*--------------------------------------
CS.END
LIBGUI .AZ "libgui"
@ -143,15 +136,8 @@ hLIBGUI .BS 1
*--------------------------------------
MouseData .BS S.MOUSE
*--------------------------------------
CB.Paint .DA #S.CB.CMD.FILLRECT
.DA #S.CB.OP.SET
.DA #S.CB.M.C16
.DA #11 Color
.DA 540 X1
.DA 160 Y1
.DA 579 X2
.DA 199 Y2
.DA #0
hWND .BS 1
WND.Title .AZ "Window Title"
*--------------------------------------
.DUMMY
.OR 0