Kernel 0.92

This commit is contained in:
Rémy GIBERT 2019-01-11 16:06:05 +00:00
parent 0b1112e5a2
commit 5e87ac7bc3
9 changed files with 185 additions and 197 deletions

Binary file not shown.

View File

@ -13,7 +13,6 @@ AUTO 4,1
.INB INC/IO.I
.INB INC/GFX.I
.INB INC/GFX.EVE.I
.INB INC/LIBGUI.I
*--------------------------------------
ZPPtr .EQ ZPDRV
*--------------------------------------
@ -116,8 +115,16 @@ Dev.Detect >LDYA L.MSG.DETECT
>STYA $800
sta CLRWRITEAUX
sta SETHIRES
sta SET80STORE
ldx #191
jsr ClrScr
plp
.9 rts
*--------------------------------------
ClrScr ldx #191
lda #0
.4 ldy BASEL,x
@ -143,10 +150,7 @@ Dev.Detect >LDYA L.MSG.DETECT
dex
bpl .4
plp
.9 rts
rts
*--------------------------------------
CS.END
MSG.DETECT .AZ "Apple IIe/IIc DHGR Driver."

View File

@ -13,5 +13,78 @@ S.DCB.GFX.H .EQ 6
*
S.DCB.GFX .EQ 8
*--------------------------------------
* Resource Headers
*--------------------------------------
S.BM.F .EQ 0
S.BM.F.BBP1 .EQ %00000001
S.BM.F.BBP2 .EQ %00000010
S.BM.F.BBP4 .EQ %00000100
S.BM.F.BBP8 .EQ %00001000
S.BM.RowBytes .EQ 1
S.BM.W .EQ 2
S.BM.H .EQ 4
S.BM.MASK.OFS .EQ 6
*
S.BM .EQ 8
*--------------------------------------
S.FON.F .EQ 0
S.FON.Ascent .EQ 1
S.FON.PixW .EQ 2 if 0, variable W
S.FON.PixH .EQ 3
S.FON.First .EQ 4
S.FON.Last .EQ 5
S.FON.Default .EQ 6
S.FON.Break .EQ 7
*
S.FON .EQ 8
*--------------------------------------
* Command Block
*--------------------------------------
S.CB.CMD .EQ 0
S.CB.CMD.SETPIXEL .EQ 0
S.CB.CMD.GETPIXEL .EQ 2
S.CB.CMD.HLINE .EQ 4
S.CB.CMD.VLINE .EQ 6
S.CB.CMD.FILLRECT .EQ 8
S.CB.CMD.BITBLT .EQ 10
S.CB.CMD.GETRECTBUFSIZE .EQ 12
S.CB.CMD.DRAWLINE .EQ 14
S.CB.CMD.DRAWTEXT .EQ 16
S.CB.CMD.GETTEXTSIZE .EQ 18
S.CB.OP .EQ 1
S.CB.OP.XOR .EQ 0 screen EOR bitmap -> Screen
S.CB.OP.SET .EQ 2 replace screen with bitmap
S.CB.OP.ORA .EQ 4 combine screen & bitmap -> Screen
S.CB.OP.MASK .EQ %00001000 Apply BitMap mask before painting
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.COLOR .EQ %01000000 Assume BitMap is COLOR
S.CB.OP.F.B .EQ %00010000
S.CB.OP.F.I .EQ %00100000
S.CB.OP.F.U .EQ %01000000
S.CB.OP.F.G .EQ %10000000
S.CB.M .EQ 2
S.CB.M.MONO .EQ %00000001 b/w (1 bit/pixel)
*S.CB.M.C4 .EQ %00000010
*S.CB.M.C8 .EQ %00000100
S.CB.M.C16 .EQ %00001000 16 colors (4 bits/pixel)
*S.CB.M.C256 .EQ %00010000 256 colors (8 bits/pixel)
S.CB.COLOR .EQ 3 xPIXEL,xLINE,FILLRECT
S.CB.hFont .EQ 3 DRAWTEXT
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,DRAWLINE
S.CB.Y2 .EQ 10 HLINE,FILLRECT,DRAWLINE
S.CB.SrcW .EQ 8 BITBLT,GETRECTBUFSIZE
S.CB.SrcH .EQ 10 BITBLT,GETRECTBUFSIZE
S.CB.DstX .EQ 12 BITBLT,DRAWTEXT
S.CB.DstY .EQ 14 BITBLT,DRAWTEXT
S.CB.SrcPtr .EQ 16 BITBLT
S.CB.TxtPtr .EQ 16 DRAWTEXT
S.CB.DstPtr .EQ 18 BITBLT
*
S.CB .EQ 20
*--------------------------------------
MAN
SAVE INC/GFX.I

View File

@ -12,79 +12,6 @@ LIBGUI.ShowCursor .EQ 12
LIBGUI.UpdateCursor .EQ 14
LIBGUI.ReadMouse .EQ 16
*--------------------------------------
* Resource Headers
*--------------------------------------
S.BM.F .EQ 0
S.BM.F.BBP1 .EQ %00000001
S.BM.F.BBP2 .EQ %00000010
S.BM.F.BBP4 .EQ %00000100
S.BM.F.BBP8 .EQ %00001000
S.BM.RowBytes .EQ 1
S.BM.W .EQ 2
S.BM.H .EQ 4
S.BM.MASK.OFS .EQ 6
*
S.BM .EQ 8
*--------------------------------------
S.FON.F .EQ 0
S.FON.Ascent .EQ 1
S.FON.PixW .EQ 2 if 0, variable W
S.FON.PixH .EQ 3
S.FON.First .EQ 4
S.FON.Last .EQ 5
S.FON.Default .EQ 6
S.FON.Break .EQ 7
*
S.FON .EQ 8
*--------------------------------------
* Command Block
*--------------------------------------
S.CB.CMD .EQ 0
S.CB.CMD.SETPIXEL .EQ 0
S.CB.CMD.GETPIXEL .EQ 2
S.CB.CMD.HLINE .EQ 4
S.CB.CMD.VLINE .EQ 6
S.CB.CMD.FILLRECT .EQ 8
S.CB.CMD.BITBLT .EQ 10
S.CB.CMD.GETRECTBUFSIZE .EQ 12
S.CB.CMD.DRAWLINE .EQ 14
S.CB.CMD.DRAWTEXT .EQ 16
S.CB.CMD.GETTEXTSIZE .EQ 18
S.CB.OP .EQ 1
S.CB.OP.XOR .EQ 0 screen EOR bitmap -> Screen
S.CB.OP.SET .EQ 2 replace screen with bitmap
S.CB.OP.ORA .EQ 4 combine screen & bitmap -> Screen
S.CB.OP.MASK .EQ %00001000 Apply BitMap mask before painting
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.COLOR .EQ %01000000 Assume BitMap is COLOR
S.CB.OP.F.B .EQ %00010000
S.CB.OP.F.I .EQ %00100000
S.CB.OP.F.U .EQ %01000000
S.CB.OP.F.G .EQ %10000000
S.CB.M .EQ 2
S.CB.M.MONO .EQ %00000001 b/w (1 bit/pixel)
*S.CB.M.C4 .EQ %00000010
*S.CB.M.C8 .EQ %00000100
S.CB.M.C16 .EQ %00001000 16 colors (4 bits/pixel)
*S.CB.M.C256 .EQ %00010000 256 colors (8 bits/pixel)
S.CB.COLOR .EQ 3 xPIXEL,xLINE,FILLRECT
S.CB.hFont .EQ 3 DRAWTEXT
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,DRAWLINE
S.CB.Y2 .EQ 10 HLINE,FILLRECT,DRAWLINE
S.CB.SrcW .EQ 8 BITBLT,GETRECTBUFSIZE
S.CB.SrcH .EQ 10 BITBLT,GETRECTBUFSIZE
S.CB.DstX .EQ 12 BITBLT,DRAWTEXT
S.CB.DstY .EQ 14 BITBLT,DRAWTEXT
S.CB.SrcPtr .EQ 16 BITBLT
S.CB.TxtPtr .EQ 16 DRAWTEXT
S.CB.DstPtr .EQ 18 BITBLT
*
S.CB .EQ 20
*--------------------------------------
CUR.T.ARROW .EQ 0
CUR.T.RESIZEX .EQ 2
CUR.T.RESIZEY .EQ 4

View File

@ -115,17 +115,15 @@ K.LoadDrv >STYA .2+1 Save "BIN\0ARGS\0\0"
sec
rts
*--------------------------------------
BIN.FindLIB clc
.HS B0 BCS
BIN.FindDRV sec
BIN.FindLIB ldx #0
.HS 2C BIT ABS
BIN.FindDRV ldx #2
>STYA BIN.CmdLine
>LDYAI BIN.Find.ENV.LIB
bcc .1
>LDYAI BIN.Find.ENV.DRV
>LDYA BIN.Find.ENV,x
.1 jsr K.GetEnv get value for Search Path
jsr K.GetEnv get value for Search Path
bcs .9
>STYA ENV.SearchPath
@ -136,11 +134,13 @@ BIN.FindDRV sec
bcs .9
>LDYAI K.Buf256
clc
* clc
.9 rts
*--------------------------------------
BIN.Find.ENV.DRV .AZ "DRV"
BIN.Find.ENV.LIB .AZ "LIB"
BIN.Find.ENV .DA .1
.DA .2
.1 .AZ "LIB"
.2 .AZ "DRV"
*--------------------------------------
* BIN.Load
* in :
@ -285,7 +285,7 @@ BIN.Load.1
* ## RETURN VALUE
* Y,A = Ptr to installed driver
*\--------------------------------------
K.InsDrv >STYA ZPPtr1
K.InsDrv >STYA ZPPtr2 SRC PTR
>PULLW BIN.R.CS.Start
>PULLW BIN.R.CS.End
@ -295,60 +295,28 @@ K.InsDrv >STYA ZPPtr1
sec
sbc BIN.R.CS.Start
sta BIN.Move.Len
tay
lda BIN.R.End+1
sbc BIN.R.CS.Start+1
sta BIN.Move.Len+1
lda DevMgr.Free Compute new DevMgr.Free
clc
adc BIN.Move.Len
tay Save DRVEnd LO
lda DevMgr.Free+1
adc BIN.Move.Len+1 A = DRVEnd HI
bcs .9 we crossed $FFFF, out of mem
cpy #DevMgr.HiMem
sbc /DevMgr.HiMem
bcs .9 No More Room to load Driver....
>LDYA DevMgr.Free
jsr BIN.MoveToYA
jsr MEM.GetKrnlBuf Y,A = LEN
bcs .9 No More Room to load Driver
>STYA ZPPtr1 Y,A = DST Buf for RelDrv...
>STYA ZPPtr3 ...for move...
sty .7+1 ...and for exit
sta .8+1
lda DevMgr.Free
sta ZPPtr1
lda ZPPtr1
sec
sbc BIN.R.CS.Start
sta BIN.R.Offset
lda DevMgr.Free+1
sta ZPPtr1+1
lda ZPPtr1+1
sbc BIN.R.CS.Start+1
sta BIN.R.Offset+1
jsr BIN.RelDrv
lda DevMgr.Free
tay
clc
adc BIN.Move.Len
sta DevMgr.Free
lda DevMgr.Free+1
pha
adc BIN.Move.Len+1
sta DevMgr.Free+1
pla
clc
rts
.9 lda #E.OOM
sec
rts
*--------------------------------------
BIN.MoveToYA >STYA ZPPtr2
lda BIN.Move.Len+1
eor #$ff
pha
@ -360,21 +328,26 @@ BIN.MoveToYA >STYA ZPPtr2
.1 inx
bne .2
pla
inc
beq .3
pha
.2 lda (ZPPtr1),y
sta (ZPPtr2),y
.2 lda (ZPPtr2),y
sta (ZPPtr3),y
iny
bne .1
inc ZPPtr1+1
inc ZPPtr2+1
inc ZPPtr3+1
bra .1
.3 rts
.3 jsr BIN.RelDrv Relocate at Ptr1
.7 ldy #$ff SELF MODIFIED
.8 lda #$ff SELF MODIFIED
.9 rts
*--------------------------------------
BIN.RelExe ldy #H.BIN.T+1
lda (ZPPtr1),y
@ -388,15 +361,7 @@ BIN.RelExe ldy #H.BIN.T+1
rts
.1 ldy #H.BIN.JMP relocate Main JMP
lda (ZPPtr1),y
clc
adc BIN.R.Offset
sta (ZPPtr1),y
iny
lda (ZPPtr1),y
adc BIN.R.Offset+1
sta (ZPPtr1),y
jsr BIN.RelocateAtPtr1Y
ldy #H.BIN.EXE.REL.TABLE skip Header, CS.SIZE & DS.SIZE... (16 bytes)
@ -404,34 +369,14 @@ BIN.RelExe ldy #H.BIN.T+1
*--------------------------------------
BIN.RelDrv ldy #H.BIN.DRV.REL.TABLE
.1 lda (ZPPtr1),y Start Relocate JMP table
tax LO in X
iny
.1 iny
lda (ZPPtr1),y HI in A
beq .2 $00xx = end of table
cpx BIN.R.CS.Start
sbc BIN.R.CS.Start+1
bcc .11 addr < BIN.R.CS.Start, out of range
txa Get back LO
cpx BIN.R.End
lda (ZPPtr1),y Get HI
sbc BIN.R.End+1
bcs .11 addr > BIN.R.End, out of range
dey
txa get back LO
clc
adc BIN.R.Offset
sta (ZPPtr1),y
jsr BIN.RelocateAtPtr1Y
iny
lda (ZPPtr1),y
adc BIN.R.Offset+1
sta (ZPPtr1),y
.11 iny
bra .1
*--------------------------------------
@ -446,7 +391,7 @@ BIN.RelDrv ldy #H.BIN.DRV.REL.TABLE
lda BIN.R.CS.End+1
adc BIN.R.Offset+1
sta .71+1
sta .8+1
lda (ZPPtr1) get OPCODE
lsr /2
@ -466,31 +411,7 @@ BIN.RelDrv ldy #H.BIN.DRV.REL.TABLE
pha
ldy #1
lda (ZPPtr1),y Get LO
tax save LO in X
iny make Y point to HI
lda (ZPPtr1),y Get HI
cpx BIN.R.CS.Start
sbc BIN.R.CS.Start+1
bcc .5 addr < BIN.R.CS.Start, out of range
txa Get back LO
cpx BIN.R.End
lda (ZPPtr1),y Get HI
sbc BIN.R.End+1
bcs .5 addr > BIN.R.End, out of range
txa Get back LO
* clc CC from bcs .6
adc BIN.R.Offset add Offset to abs address
dey
sta (ZPPtr1),y store relocated addr LO
iny
lda (ZPPtr1),y Get HI
adc BIN.R.Offset+1
sta (ZPPtr1),y store relocated addr HI
jsr BIN.RelocateAtPtr1Y
.5 pla get back Opcode length...
@ -499,14 +420,44 @@ BIN.RelDrv ldy #H.BIN.DRV.REL.TABLE
sta ZPPtr1
bcc .7
inc ZPPtr1+1
clc Make sure exit with CC
.7 eor #$ff SELF MODIFIED A = ZPPtr1
bne .3
lda ZPPtr1+1
.71 eor #$ff SELF MODIFIED
.8 eor #$ff SELF MODIFIED
bne .3 next opcode....
.8 rts
rts
*--------------------------------------
BIN.RelocateAtPtr1Y
lda (ZPPtr1),y Get LO
tax save LO in X
iny make Y point to HI
lda (ZPPtr1),y Get HI
cpx BIN.R.CS.Start
sbc BIN.R.CS.Start+1
bcc .9 addr < BIN.R.CS.Start, out of range
txa Get back LO
cpx BIN.R.End
lda (ZPPtr1),y Get HI
sbc BIN.R.End+1
bcs .9 addr > BIN.R.End, out of range
txa Get back LO
dey
clc
adc BIN.R.Offset
sta (ZPPtr1),y
iny
lda (ZPPtr1),y
adc BIN.R.Offset+1
sta (ZPPtr1),y
.9 rts
*--------------------------------------
* 6502/65C02/65816 OPCODES
* Bit 3 : 1 = absolute addressing

View File

@ -18,7 +18,8 @@ K.OpenDir jsr PFT.CheckPathYA
bcs .99
>LDYAI S.FD.DIR
jsr K.GetMem0
ldx #S.MEM.F.INIT0+S.MEM.F.FD
jsr MEM.GetMem.YAX
bcs .99
>STYA pFD

View File

@ -598,6 +598,37 @@ K.LoadStkObj >SYSCALL LoadFile
sec
.99 rts
*--------------------------------------
* in Y,A = buf size
*--------------------------------------
MEM.GetKrnlBuf pha
tya
clc
adc DevMgr.Free
tax
pla
adc DevMgr.Free+1
bcs .99 we crossed $FFFF, out of mem
cpx #DevMgr.HiMem
pha
sbc /DevMgr.HiMem
bcs .98 No More Room...
ldy DevMgr.Free
stx DevMgr.Free
ldx DevMgr.Free+1
pla
sta DevMgr.Free+1
txa
* clc
rts
.98 pla
.99 lda #E.OOM
* sec
rts
*--------------------------------------
MEM.GetKeyCharY sta CLRREADAUX
lda (ZPSListKeyPtr),y
sta SETREADAUX

View File

@ -229,7 +229,8 @@ K.MKFIFO >LDYAI K.PIPE.SIZE
stx .1+1 save PIPE buffer
>LDYAI S.FD.PIPE
jsr K.GetMem0
ldx #S.MEM.F.INIT0+S.MEM.F.FD
jsr MEM.GetMem.YAX
bcs .9

View File

@ -13,7 +13,7 @@ AUTO 4,1
.INB INC/MLI.E.I
.INB INC/NET.TELNET.I
.INB INC/XY.MOUSE.I
.INB INC/GUI.I
.INB INC/GFX.I
.INB INC/KERNEL.I