Kernel 0.9.1 : LibGui, Fonts.....

This commit is contained in:
Rémy GIBERT 2017-12-08 17:10:39 +01:00
parent 62a907d0b3
commit b5bd89a76e
8 changed files with 220 additions and 156 deletions

Binary file not shown.

Binary file not shown.

View File

@ -509,7 +509,7 @@ MSG.DIREXT >CSTR "\e[32m%16s\e[0m <dir> %s %s %s\r\n"
MSG.FILE >CSTR "%19s"
MSG.FILEEXT >CSTR "%15s %S $%H %s %10u %s %s\r\n"
*--------------------------------------
PRODOS.FT.HEX .HS 0406FAFCFDE2CBFF
PRODOS.FT.HEX .HS 0406FAFCFDE2CBCCFF
PRODOS.FT.TXT >PSTR "TXT"
>PSTR "BIN"
>PSTR "ASM"
@ -517,6 +517,7 @@ PRODOS.FT.TXT >PSTR "TXT"
>PSTR "VAR"
>PSTR "ATK"
>PSTR "PIX"
>PSTR "FON"
>PSTR "SYS"
PRODOS.FT.DFLT >PSTR "$ "
MSG.NODATE >CSTR " <No-Date> "

View File

@ -12,14 +12,54 @@ AUTO 6
.INB /A2OSX.BUILD/INC/A2OSX.I
.INB /A2OSX.BUILD/INC/LIBGUI.I
*--------------------------------------
S.FNT.dfVersion .EQ 0
S.FNT.dfSize .EQ 2
S.FNT.dfCopyright .EQ 6
S.FNT.dfType .EQ 66
S.FNT.dfPoints .EQ 68
S.FNT.dfVertRes .EQ 70
S.FNT.dfHorizRes .EQ 72
S.FNT.dfAscent .EQ 74
S.FNT.dfInternalLeading .EQ 76
S.FNT.dfExternalLeading .EQ 78
S.FNT.dfItalic .EQ 80
S.FNT.dfUnderline .EQ 81
S.FNT.dfStrikeOut .EQ 82
S.FNT.dfWeight .EQ 83
S.FNT.dfCharSet .EQ 85
S.FNT.dfPixWidth .EQ 86
S.FNT.dfPixHeight .EQ 88
S.FNT.dfPitchAndFamily .EQ 90
S.FNT.dfAvgWidth .EQ 91
S.FNT.dfMaxWidth .EQ 93
S.FNT.dfFirstChar .EQ 95
S.FNT.dfLastChar .EQ 96
S.FNT.dfDefaultChar .EQ 97
S.FNT.dfBreakChar .EQ 98
S.FNT.dfWidthBytes .EQ 99
S.FNT.dfDevice .EQ 101
S.FNT.dfFace .EQ 105
S.FNT.dfBitsPointer .EQ 109
S.FNT.dfBitsOffset .EQ 113
S.FNT.dfReserved .EQ 117
S.FNT.dfCharTable2 .EQ 118
*S.FNT.dfFlags3 .EQ 118
*S.FNT.dfAspace3 .EQ 122
*S.FNT.dfBspace3 .EQ 124
*S.FNT.dfCspace3 .EQ 126
*S.FNT.dfColorPointer3 .EQ 128
*S.FNT.dfReserved13 .EQ 132
S.FNT.dfCharTable3 .EQ 148
*--------------------------------------
ZPPTR1 .EQ ZPBIN
ZPInputBufPtr .EQ ZPBIN+2
ZPInputBufLen .EQ ZPBIN+4
ZPInputDataPtr .EQ ZPBIN+6
ZPBMPRowBytes .EQ ZPBIN+8
ZPPIXRowBytes .EQ ZPBIN+10
ZPBufPtr .EQ ZPBIN+12
ZPLineCount .EQ ZPBIN+14
ZPInputTblPtr .EQ ZPBIN+6
ZPInputBMPtr .EQ ZPBIN+8
ZPOutPutTblPtr .EQ ZPBIN+10
ZPOutPutBMPtr .EQ ZPBIN+12
ZPBufPtr .EQ ZPBIN+14
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
@ -44,6 +84,7 @@ L.MSG.USAGE .DA MSG.USAGE
L.MSG.FILE.OK .DA MSG.FILE.OK
L.MSG.HEADER.OK .DA MSG.HEADER.OK
L.MSG.HEADER.KO .DA MSG.HEADER.KO
L.MSG.RANGE .DA MSG.RANGE
L.MSG.DONE .DA MSG.DONE
.DA 0
*--------------------------------------
@ -94,7 +135,7 @@ CS.INIT
.7 >LDA.G hOutputFile
beq .99
>LDYAI 256
>LDYAI 8192 max 256x256 pixels
>SYSCALL GetMem.YA
bcs CS.INIT.RTS
@ -124,49 +165,37 @@ CS.INIT.OPENINPUT
>LDYA L.MSG.FILE.OK
>SYSCALL PrintF.YA
lda (ZPInputBufPtr)
cmp #'B'
bne .99
ldy #1
lda (ZPInputBufPtr),y
cmp #'M'
bne .99
ldy #$1C BBP LO
lda (ZPInputBufPtr),y
cmp #1
bne .99
iny BBP HI
ldy #S.FNT.dfVersion
lda (ZPInputBufPtr),y
bne .99
ldy #$16 H LO
iny
lda (ZPInputBufPtr),y
>STA.G PIX.Header+S.BM.H
pha
eor #$ff
sta ZPLineCount
cmp #2
beq .1
ldy #$17 H HI
lda (ZPInputBufPtr),y
>STA.G PIX.Header+S.BM.H+1
>PUSHA
eor #$ff
sta ZPLineCount+1
cmp #3
bne .99
pla
>PUSHA
ldy #$12 W LO
lda (ZPInputBufPtr),y
>STA.G PIX.Header+S.BM.W
.1 asl *2 = Entry Len in Tbl
>STA.G FNT.Version
pha
ldy #$13 W HI
ldy #S.FNT.dfAscent
lda (ZPInputBufPtr),y
>STA.G PIX.Header+S.BM.W+1
>STA.G FON.Header+S.FON.Ascent
>PUSHA
ldy #S.FNT.dfPixHeight
lda (ZPInputBufPtr),y
>STA.G FON.Header+S.FON.PixH
>PUSHA
ldy #S.FNT.dfPixWidth
lda (ZPInputBufPtr),y
>STA.G FON.Header+S.FON.PixW
>PUSHA
pla
>PUSHA
@ -183,7 +212,7 @@ CS.INIT.OPENINPUT
*--------------------------------------
CS.INIT.CREATEOUTPUT
>PUSHWI 0 Aux type
>PUSHBI $CB PIX Type
>PUSHBI $CC FON Type
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
>PUSHW ZPPtr1
>SYSCALL FOpen
@ -191,114 +220,71 @@ CS.INIT.CREATEOUTPUT
>STA.G hOutputFile
.9 rts
*--------------------------------------
CS.RUN lda #S.BM.F.BBP1
>STA.G PIX.Header+S.BM.F
>LDA.G PIX.Header+S.BM.W
sta ZPBMPRowBytes
sta ZPPIXRowBytes
iny
lda (pData),y
sta ZPBMPRowBytes+1
sta ZPPIXRowBytes+1
lda ZPBMPRowBytes
and #%00011111
beq .1
lda ZPBMPRowBytes
and #%11100000
clc
adc #%00100000
bcc .1
inc ZPBMPRowBytes+1
.1 lsr ZPBMPRowBytes+1
ror
lsr ZPBMPRowBytes+1
ror
lsr ZPBMPRowBytes+1
ror
sta ZPBMPRowBytes
lda ZPPIXRowBytes
and #%00000111
beq .2
lda ZPPIXRowBytes
and #%11111000
clc
adc #%00001000
bcc .2
inc ZPPIXRowBytes+1
.2 lsr ZPPIXRowBytes+1
ror
lsr ZPPIXRowBytes+1
ror
lsr ZPPIXRowBytes+1
ror
sta ZPPIXRowBytes
>STA.G PIX.Header+S.BM.RowBytes
lda ZPInputBufPtr
clc
adc ZPInputBufLen
sta ZPInputDataPtr
lda ZPInputBufPtr+1
adc ZPInputBufLen+1
sta ZPInputDataPtr+1
>PUSHEA.G PIX.Header
>PUSHWI S.BM
>LDA.G hOutputFile
CS.RUN ldy #S.FNT.dfBreakChar
lda (ZPInputBufPtr),y
>STA.G FON.Header+S.FON.Break
>PUSHA
ldy #S.FNT.dfDefaultChar
lda (ZPInputBufPtr),y
>STA.G FON.Header+S.FON.Default
>PUSHA
>SYSCALL FWrite
bcs CS.RUN.RTS
CS.RUN.LOOP inc ZPLineCount
ldy #S.FNT.dfLastChar
lda (ZPInputBufPtr),y
>STA.G FON.Header+S.FON.Last
>PUSHA
ldy #S.FNT.dfFirstChar
lda (ZPInputBufPtr),y
>STA.G FON.Header+S.FON.First
>PUSHA
>LDYA L.MSG.RANGE
>SYSCALL PrintF.YA
>LDA.G FON.Header+S.FON.Last
>SBC.G FON.Header+S.FON.First
>STA.G CharCount
>LDA.G FNT.Version
ldx #S.FNT.dfCharTable2
cmp #4
bne .1
inc ZPLineCount+1
ldx #S.FNT.dfCharTable3
.1 txa
clc
adc ZPInputBufPtr
sta ZPInputTblPtr
lda #0
adc ZPInputBufPtr+1
sta ZPInputTblPtr+1
.2 ldy #2
lda (ZPInputTblPtr),y Get Char BitMap Offset
clc
adc ZPInputBufPtr
sta ZPInputBMPtr
iny
lda (ZPInputTblPtr),y
adc ZPInputBufPtr+1
sta ZPInputBMPtr+1
lda (ZPInputTblPtr) Get Char PixW
jsr CS.RUN.GetChar
>DEC.G CharCount
beq .8
.1 lda ZPInputDataPtr
sec
sbc ZPBMPRowBytes
sta ZPInputDataPtr
lda ZPInputDataPtr+1
sbc ZPBMPRowBytes+1
sta ZPInputDataPtr+1
>LDYA ZPBufPtr
>STYA ZPPTR1
ldy #0
.2 lda (ZPInputDataPtr),y
tax
lda TWIST,x
sta (ZPPTR1)
inc ZPPTR1
bne .3
inc ZPPTR1+1
.3 iny
cpy ZPPIXRowBytes
bne .2
>PUSHW ZPBufPtr
>PUSHW ZPPIXRowBytes
>LDA.G hOutputFile
>PUSHA
>SYSCALL FWrite
bcs CS.RUN.RTS
bra CS.RUN.LOOP
lda ZPInputTblPtr
clc
>ADC.G FNT.Version
sta ZPInputTblPtr
bcc .2
inc ZPInputTblPtr+1
bra .2
.8 >LDYA L.MSG.DONE
>SYSCALL PrintF.YA
@ -307,18 +293,73 @@ CS.RUN.LOOP inc ZPLineCount
sec
CS.RUN.RTS rts
*--------------------------------------
* A=PixW, ZPInputBMPtr->DATA
*--------------------------------------
CS.RUN.GetChar pha
lsr
lsr
lsr
tax
pla
and #7
beq .1
inx
txa
>STA.G CharByteW
ldx #0 0 > X > CharByteW
.1 >LDA.G ON.Header+S.FON.PixH
.2 pha
clc
adc ZPBufPtr
sta ZPPTR1
lda #0
adc ZPBufPtr+1
sta ZPPTR1+1
.3 lda (ZPInputBMPtr)
inc ZPInputBMPtr
bne .4
inc ZPInputBMPtr+1
.4 sta (ZPPTR1)
lda ZPPTR1
clc
>ADC.G CharByteW
sta ZPPTR1
bcc .5
inc ZPPTR1+1
.5 inx
txa
pla
dec
bne .1
clc
rts
*--------------------------------------
CS.DOEVENT sec
rts
*--------------------------------------
CS.QUIT >LDA.G hBuf
CS.QUIT >LDA.G hOutputFile
beq .1
>SYSCALL FreeMem.A
.1 >LDA.G hOutputFile
beq .8
>SYSCALL FClose.A
.1 >LDA.G hInputBuf
beq .1
>SYSCALL FreeMem.A
.2 >LDA.G hBuf
beq .1
>SYSCALL FreeMem.A
.8 clc
rts
*--------------------------------------
@ -359,20 +400,24 @@ TWIST .DA #%00000000,#%10000000,#%01000000,#%11000000,#%00100000,#%10100000,#%
OptionList >PSTR "Vv"
OptionVars .DA #bVerbose,#bVerbose
MSG.USAGE >CSTR "Usage : FNT2FON FNT-File \r\n -V : Verbose Mode\r\n"
MSG.FILE.OK >CSTR "Font File Loaded, %D Bytes Read\r\n"
MSG.HEADER.OK >CSTR "Font File Size : %D x %D pixels\r\n"
MSG.HEADER.KO >CSTR "Invalid Input File Format\r\n"
MSG.FILE.OK >CSTR "FNT File Loaded, %D Bytes Read\r\n"
MSG.HEADER.OK >CSTR "FNT File Version : %d, Size : %d x %d pixels, Ascent : %d\r\n"
MSG.HEADER.KO >CSTR "Invalid Input File Format\r\n"
MSG.RANGE >CSTR "First/Last Char : %d/%d, Default : %d, Break : %d\r\n"
MSG.DONE >CSTR "All Done!!!\r\n"
*--------------------------------------
.DUMMY
.OR 0
DS.START
PIX.Header .BS S.BM
FNT.Version .BS 1
FON.Header .BS S.FON
ArgCount .BS 1
hInputBuf .BS 1
hOutputFile .BS 1
bVerbose .BS 1
hBuf .BS 1
CharCount .BS 1
CharByteW .BS 1
DS.END
.ED
*--------------------------------------

View File

@ -46,6 +46,15 @@ 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.LEFT .EQ 0
S.CB.OP.F.RIGHT .EQ 2
S.CB.OP.F.CENTERED .EQ 4
S.CB.OP.F.JUSTIFIED .EQ 6
S.CB.OP.F.BOLD .EQ %00010000
S.CB.OP.F.ITALIC .EQ %00100000
S.CB.OP.F.UNDERLINE .EQ %01000000
S.CB.OP.F.GRAYED .EQ %10000000
S.CB.MODE .EQ 2
S.CB.MODE.MONO .EQ %00000001 b/w (1 bit/pixel)
*S.CB.MODE.C4 .EQ %00000010
@ -53,7 +62,7 @@ S.CB.MODE.MONO .EQ %00000001 b/w (1 bit/pixel)
S.CB.MODE.C16 .EQ %00001000 16 colors (4 bits/pixel)
*S.CB.MODE.C256 .EQ %00010000 256 colors (8 bits/pixel)
S.CB.COLOR .EQ 3 xPIXEL,xLINE,FILLRECT
S.CB.FONT .EQ 3 DRAWTEXT
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
@ -88,7 +97,7 @@ S.BM.MASK.OFS .EQ 6
*
S.BM .EQ 8
*--------------------------------------
S.FON.H .EQ 0
S.FON.F .EQ 0
S.FON.Ascent .EQ 1
S.FON.PixW .EQ 2 if 0, variable W
S.FON.PixH .EQ 3

View File

@ -19,7 +19,7 @@ Kernel 0.9.1 stable enough to resume building.
+ Improved Command Line editing and history.
(SUPPR key is emulated with Ctrl-X using //e keyboard)
+ New DevMgr enumeration stratey, now including /RAM and other virtual Block Devices
+ New DevMgr enumeration strategy, now including /RAM and other virtual Block Devices
+ Math API (Hacked from APPLESOFT ROM ;-)
@ -97,16 +97,25 @@ Several subprojects are now indentified :
## Screenshots
UNIX-Like Shell...
![](./.screen-shots/ScreenShot.LS.png)
TCP/IP Stack...
![](./.screen-shots/ScreenShot.IP1.png)
![](./.screen-shots/ScreenShot.IP2.png)
Full screen editor ...
![](./.screen-shots/ScreenShot.EDIT.png)
Kernel Configuration Utility...
![](./.screen-shots/ScreenShot.KCONFIG.png)
Color ANSI/VT100 Support !!!
![](./.screen-shots/PuTTY.png)
## General Information: