Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-07-30 17:35:42 +02:00
parent b36efb0bb2
commit 4f4c4dd5e7
10 changed files with 241 additions and 47 deletions

Binary file not shown.

180
BIN/GTEST.S.txt Normal file
View File

@ -0,0 +1,180 @@
NEW
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
.TF BIN/GTEST
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/KERNEL.I
.INB INC/GFX.I
*--------------------------------------
.DUMMY
.OR ZPBIN
ZS.START
hDevGFX .BS 1
hFont .BS 1
ZS.END
.ED
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA #0 #S.PS.F.EVENT S.PS.F
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data Segment Size
.DA #64 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
.DA 0
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.DEVNAME.GFX .DA DEVNAME.GFX
L.FONTFILE .DA FONTFILE
L.CB.RECT .DA CB.RECT
L.CB.TEXT .DA CB.TEXT
L.CB.Apple .DA CB.Apple
L.BM.Apple .DA BM.Apple
L.MESSAGE .DA MESSAGE
.DA 0
*--------------------------------------
CS.INIT clc
rts
*--------------------------------------
CS.RUN jsr GFX.Open
bcs .9
>LDYA L.FONTFILE
>SYSCALL LoadStkObj
bcs .9
stx hFont
>LDYA L.CB.RECT
jsr GFX.Write.YA
>DEBUG
lda hFont
sta CB.TEXT+S.CB.hFont
>LDYA L.MESSAGE
>STYA CB.TEXT+S.CB.TxtPtr
>LDYA L.CB.TEXT
>SYSCALL OSD
bcs .9
>LDYA L.CB.TEXT
jsr GFX.Write.YA
>DEBUG
>LDYA L.BM.Apple
>STYA CB.Apple+S.CB.SrcPtr
>LDYA L.CB.Apple
jsr GFX.Write.YA
jsr GFX.Close
lda #0
sec
.9 rts
*--------------------------------------
CS.DOEVENT clc
rts
*--------------------------------------
CS.QUIT lda hFont
beq .8
>SYSCALL FreeStkObj
.8 clc
rts
*--------------------------------------
GFX.Open >PUSHBI 0
>LDYA L.DEVNAME.GFX
>SYSCALL open
bcs .9
sta hDevGFX
.9 rts
*--------------------------------------
GFX.Write.YA >PUSHYA
>PUSHBI IOCTL.WRITE
lda hDevGFX
>SYSCALL IOCTL
rts
*--------------------------------------
GFX.Close lda hDevGFX
>SYSCALL close
rts
*--------------------------------------
CS.END
DEVNAME.GFX .AZ "/DEV/GFX"
FONTFILE .AZ "${ROOT}SBIN/GUI/SYSX7"
MESSAGE .AZ " DHGR & OSD Drivers Test "
CB.RECT .DA #S.CB.CMD.FILLRECT
.DA #S.CB.OP.SET
.DA #S.CB.M.C16
.DA #6 Color
.DA 20
.DA 10
.DA 540
.DA 182
CB.TEXT .DA #S.CB.CMD.DRAWTEXT
.DA #S.CB.OP.SET
.DA #S.CB.M.MONO
.BS 1 hFONT
.DA 0 X1
.DA 0 Y1
.DA 0 X2
.DA 0 Y2
.DA 60 DstX
.DA 60 DstY
.BS 2 TXTPTR
.DA 0 DSTPTR
CB.Apple .DA #S.CB.CMD.BITBLT
.DA #S.CB.OP.SET+S.CB.OP.COLOR
.DA #S.CB.M.C16
.DA 0
.DA 0 X1
.DA 0 Y1
.DA 16 SrcW
.DA 7 SrcH
.DA 60 DstX
.DA 80 DstY
.BS 2 SrcPtr
.DA 0 DSTPTR
*--------------------------------------
BM.Apple .DA #S.BM.F.BBP4
.DA #2 RowBytes
.DA 16 W
.DA 7 H
.DA 0 no MASK.OFS
.HS FFF6 green (8)
.HS 6FF6 green (8)
.HS EEEE yellow (15)
.HS CCFC orange (14)
.HS 88F8 magenta (10)
.HS 9999 violet (11)
.HS 1FF1 Dark blue (4)
*--------------------------------------
.DUMMY
.OR 0
DS.START
DS.END
.ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/GTEST.S
ASM

View File

@ -123,32 +123,34 @@ Dev.Detect >LDYA L.MSG.DETECT
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
ClrScr ldx #191 ClrScr ldx #0
lda #0 lda #0
.4 ldy BASEL,x .1 ldy BASEL,x
sty ZPPtr sty ZPPtr
ldy BASEH,x ldy BASEH,x
sty ZPPtr+1 sty ZPPtr+1
sta SETPAGE2 sta SETPAGE2
ldy #39 jsr .2
.5 sta (ZPPtr),y
dey
bpl .5
sta CLRPAGE2 sta CLRPAGE2
ldy #39 jsr .2
.6 sta (ZPPtr),y inx
cpx #192
bne .1
rts
.2 ldy #39
.3 sta (ZPPtr),y
dey dey
bpl .6 bpl .3
dex
bpl .4
rts rts
*-------------------------------------- *--------------------------------------
CS.END CS.END

View File

@ -289,7 +289,7 @@ SYS.PutPW .EQ $D4
* .EQ $D8 * .EQ $D8
* .EQ $DA * .EQ $DA
* .EQ $DC * .EQ $DC
SYS.OSD .EQ $DF SYS.OSD .EQ $DE
*-------------------------------------- *--------------------------------------
SYS.GetMem .EQ $E0 SYS.GetMem .EQ $E0
SYS.GetMem0 .EQ $E2 SYS.GetMem0 .EQ $E2

View File

@ -59,10 +59,10 @@ S.CB.OP.SAVE .EQ %00010000 Save Screen to DstPtr before painting
S.CB.OP.RESTORE .EQ %00100000 Restore Screen From DstPtr S.CB.OP.RESTORE .EQ %00100000 Restore Screen From DstPtr
S.CB.OP.COLOR .EQ %01000000 Assume BitMap is COLOR S.CB.OP.COLOR .EQ %01000000 Assume BitMap is COLOR
S.CB.OP.F.B .EQ %00010000 S.CB.OP.F.B .EQ %00010000 BOLD
S.CB.OP.F.I .EQ %00100000 S.CB.OP.F.I .EQ %00100000 ITALIC
S.CB.OP.F.U .EQ %01000000 S.CB.OP.F.U .EQ %01000000 UNDERLINED
S.CB.OP.F.G .EQ %10000000 S.CB.OP.F.G .EQ %10000000 GREYED
S.CB.M .EQ 2 S.CB.M .EQ 2
S.CB.M.MONO .EQ %00000001 b/w (1 bit/pixel) S.CB.M.MONO .EQ %00000001 b/w (1 bit/pixel)
*S.CB.M.C4 .EQ %00000010 *S.CB.M.C4 .EQ %00000010
@ -73,14 +73,19 @@ S.CB.COLOR .EQ 3 xPIXEL,xLINE,FILLRECT
S.CB.hFont .EQ 3 DRAWTEXT S.CB.hFont .EQ 3 DRAWTEXT
S.CB.X1 .EQ 4 xPIXEL,xLINE,FILLRECT,BITBLT,GETRECTBUFSIZE,DRAWLINE S.CB.X1 .EQ 4 xPIXEL,xLINE,FILLRECT,BITBLT,GETRECTBUFSIZE,DRAWLINE
S.CB.Y1 .EQ 6 xPIXEL,xLINE,FILLRECT,BITBLT,GETRECTBUFSIZE,DRAWLINE S.CB.Y1 .EQ 6 xPIXEL,xLINE,FILLRECT,BITBLT,GETRECTBUFSIZE,DRAWLINE
S.CB.X2 .EQ 8 VLINE,FILLRECT,DRAWLINE S.CB.X2 .EQ 8 VLINE,FILLRECT,DRAWLINE
S.CB.Y2 .EQ 10 HLINE,FILLRECT,DRAWLINE
S.CB.SrcW .EQ 8 BITBLT,GETRECTBUFSIZE S.CB.SrcW .EQ 8 BITBLT,GETRECTBUFSIZE
S.CB.Y2 .EQ 10 HLINE,FILLRECT,DRAWLINE
S.CB.SrcH .EQ 10 BITBLT,GETRECTBUFSIZE S.CB.SrcH .EQ 10 BITBLT,GETRECTBUFSIZE
S.CB.DstX .EQ 12 BITBLT,DRAWTEXT S.CB.DstX .EQ 12 BITBLT,DRAWTEXT
S.CB.DstY .EQ 14 BITBLT,DRAWTEXT S.CB.DstY .EQ 14 BITBLT,DRAWTEXT
S.CB.SrcPtr .EQ 16 BITBLT S.CB.SrcPtr .EQ 16 BITBLT
S.CB.TxtPtr .EQ 16 DRAWTEXT S.CB.TxtPtr .EQ 16 DRAWTEXT
S.CB.DstPtr .EQ 18 BITBLT S.CB.DstPtr .EQ 18 BITBLT
* *
S.CB .EQ 20 S.CB .EQ 20

View File

@ -14,7 +14,7 @@ BUT.New >STYA ZPPtr1
beq .1 beq .1
ldy #S.BM.W ldy #S.BM.W
>SYSCALL2 GetStkObjProp * >SYSCALL2 GetStkObjProp
phy phy
ldy #S.OBJ.W+1 ldy #S.OBJ.W+1

View File

@ -318,7 +318,7 @@ DrawLine.IncX lda DX
DrawText >LDYA L.CB.Cache DrawText >LDYA L.CB.Cache
ldx #0 ldx #0
jsr SYS.GuiOSD.JMP >SYSCALL2 OSD
bcs .9 bcs .9
jsr GFXWrite.CB jsr GFXWrite.CB

View File

@ -9,9 +9,10 @@ FON.Init >PUSHWZ Aux type
bcs .9 bcs .9
sta hSYSFON sta hSYSFON
ldy #S.FON.PixH * ldy #S.FON.PixH
>SYSCALL2 GetStkObjProp * >SYSCALL2 GetStkObjProp
sty SYSFON.H lda #7
sta SYSFON.H
>PUSHWZ Aux type >PUSHWZ Aux type
>PUSHBI $CC Type >PUSHBI $CC Type

View File

@ -426,11 +426,11 @@ K.LoadStkObj ldx #SYS.LoadTxtFile To get ending \0
bne .1 bne .1
inc +1 for ending 0 inc +1 for ending 0
.1 >STYA A2L Save LEN temporarly .1 >STYA A2L Save LEN temporarly
ldx #SYS.NewStkObj ldx #SYS.NewStkObj
jsr K.SYSCALL2.AUX jsr K.SYSCALL2.AUX
bcs .9 bcs .9
stx .80+1 stx .80+1
>STYA A4L Save Destination Address in AUX >STYA A4L Save Destination Address in AUX

View File

@ -9,10 +9,10 @@ ZPCharPtr .EQ ZPDRV+8
ZPSrcBMPtr .EQ ZPDRV+10 ZPSrcBMPtr .EQ ZPDRV+10
ZPTmpPtr .EQ ZPDRV+14 ZPTmpPtr .EQ ZPDRV+14
*-------------------------------------- *--------------------------------------
* YA =Ptr to S.CB in MAIN * Y,A = Ptr to S.CB in MAIN
* X = DstBM hMem
*-------------------------------------- *--------------------------------------
X.OSD >STYA TXTPTR X.OSD >STYA ZPCmdPtr
>STYA TXTPTR
ldy #S.CB-1 ldy #S.CB-1
@ -21,25 +21,31 @@ X.OSD >STYA TXTPTR
dey dey
bpl .10 bpl .10
txa ldy CB.Cache+S.CB.DstPtr
beq .3 lda CB.Cache+S.CB.DstPtr+1
bne .11 Ptr To Aux
tya hBM in Aux
beq .8 no Src BM
jsr K.GetMemPtr jsr K.GetMemPtr
>STYA ZPDstBMPtr .11 >STYA ZPDstBMPtr
ldx #0 ldx #0
.1 lda (ZPDstBMPtr) .1 lda (ZPDstBMPtr)
sta DstBM.Cache,x sta DstBM.Cache,x
inc ZPDstBMPtr inc ZPDstBMPtr
bne .2 bne .2
inc ZPDstBMPtr+1 inc ZPDstBMPtr+1
.2 inx .2 inx
cpx #S.BM cpx #S.BM
bne .1 bne .1
.3 ldx CB.Cache+S.CB.CMD .8 ldx CB.Cache+S.CB.CMD
jmp (J.Cmds,x) jmp (J.Cmds,x)
*-------------------------------------- *--------------------------------------
@ -286,9 +292,7 @@ DRAWTEXT.END lda #$FF SELF MODIFIED
lda #S.CB.CMD.BITBLT lda #S.CB.CMD.BITBLT
sta CB.Cache+S.CB.CMD sta CB.Cache+S.CB.CMD
jsr CB.Update jmp CB.Update
clc
rts
*-------------------------------------- *--------------------------------------
DRAWTEXT.JMP asl DRAWTEXT.JMP asl
tax tax
@ -630,16 +634,18 @@ YAMultX stx GBYTE
rts rts
*-------------------------------------- *--------------------------------------
CB.Update >LDYA ZPCmdPtr CB.Update >LDYA ZPCmdPtr
>STYA A4L Dst Start Address (MAIN) >STYA ZPSListDataPtr
ldx #0
>LDYAI CB.Cache .1 lda CB.Cache,x
>STYA A1L Src Start Address (AUX) jsr SHARED.SetDataByte
inx
>LDYAI CB.Cache+S.CB-1 cpx #S.CB
>STYA A2L Src End Address (AUX) bne .1
clc Aux To Main clc
jmp AuxMove rts
*-------------------------------------- *--------------------------------------
CB.Cache .BS S.CB CB.Cache .BS S.CB
FON.Cache .BS S.FON FON.Cache .BS S.FON