Kernel 0.9.1 : GUI, Font converter

This commit is contained in:
Rémy GIBERT 2017-12-13 07:38:43 +01:00
parent f7d3c424fc
commit 403e4f4e8a
5 changed files with 87 additions and 36 deletions

View File

@ -515,7 +515,7 @@ Close a file
## Out :
# FRead.A
Read ONE byte from file
Read ONE byte (A) from file (Y)
## In :
+ A = hFILE
@ -524,6 +524,7 @@ Read ONE byte from file
+ A = Byte Read
# FWrite.AY
Write ONE byte (A) To file (Y)
## In:
+ A = hFILE
@ -544,6 +545,7 @@ Read bytes from file
+ Y,A = Bytes Read
# FWrite
Write bytes to file
## In:
+ PUSHW = Src Ptr
@ -600,7 +602,7 @@ Rename a file
## Out :
# SScanF
Scan a PStr (in progress)
Scan a C-String (in progress)
## In:
+ PUSHW PTR to target buffer

Binary file not shown.

Binary file not shown.

View File

@ -58,7 +58,8 @@ ZPInputTblPtr .EQ ZPBIN+4
ZPInputBMPtr .EQ ZPBIN+6
ZPCharBufPtr .EQ ZPBIN+8
ZPOutPutTblPtr .EQ ZPBIN+10
ZPOutPutCharOfs .EQ ZPBIN+14
ZPOutPutCharOfs .EQ ZPBIN+12
ZPOutPutBufPtr .EQ ZPBIN+14
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
@ -217,6 +218,15 @@ CS.INIT.CREATEOUTPUT
>SYSCALL FOpen
bcs .9
>STA.G hOutputFile
>LDYAI 256
>SYSCALL GetMem.YA
bcs .9
>STYA ZPOutPutBufPtr
txa
>STA.G hOutPutBuf
.9 rts
*--------------------------------------
CS.RUN ldy #S.FNT.dfBreakChar
@ -342,7 +352,10 @@ CS.RUN.LOOP >SLEEP
inc ZPInputTblPtr+1
bra CS.RUN.LOOP
.8 jsr CS.RUN.WriteBMAndTbl
.8 jsr CS.RUN.FlushOutPutBuf
bcs .9
jsr CS.RUN.WriteBMAndTbl
bcs .9
>LDYA L.MSG.DONE
@ -707,6 +720,54 @@ CS.RUN.StoreChar
.9 plx
.99 rts
*--------------------------------------
CS.RUN.WriteByte
phy
phx
pha
>LDA.G OutPutPtr
tay
pla
sta (ZPOutPutBufPtr),y
tya
inc
>STA.G OutPutPtr
tay
bne .8
>PUSHW ZPOutPutBufPtr
>PUSHWI 256
>LDA.G hOutputFile
>PUSHA
>SYSCALL FWrite
bcs .9
.8 inc ZPOutPutCharOfs
bne .81
inc ZPOutPutCharOfs+1
.81 clc
.9 plx
ply
rts
*--------------------------------------
CS.RUN.FlushOutPutBuf
clc
>LDA.G OutPutPtr
beq .8
pha
>PUSHW ZPOutPutBufPtr
ply
lda #0
>PUSHYA
>LDA.G hOutputFile
>PUSHA
>SYSCALL FWrite
.8 rts
*--------------------------------------
CS.RUN.WriteBMAndTbl
>LDA.G hTblBuf
@ -717,42 +778,26 @@ CS.RUN.WriteBMAndTbl
clc
rts
*--------------------------------------
CS.RUN.WriteByte
phx
phy
pha
>LDA.G hOutputFile
tay
pla
>DEBUG
>SYSCALL FPutC.AY
inc ZPOutPutCharOfs
bne .1
inc ZPOutPutCharOfs+1
.1 ply
plx
rts
*--------------------------------------
CS.DOEVENT sec
rts
*--------------------------------------
CS.QUIT >LDA.G hOutputFile
CS.QUIT >LDA.G hOutPutBuf
beq .1
>SYSCALL FClose.A
.1 >LDA.G hInputBuf
beq .2
>SYSCALL FreeMem.A
.2 >LDA.G hCharBuf
.1 >LDA.G hOutputFile
beq .2
>SYSCALL FClose.A
.2 >LDA.G hInputBuf
beq .3
>SYSCALL FreeMem.A
.3 >LDA.G hTblBuf
.3 >LDA.G hCharBuf
beq .4
>SYSCALL FreeMem.A
.4 >LDA.G hTblBuf
beq .8
>SYSCALL FreeMem.A
@ -792,6 +837,8 @@ CharPixW .BS 1
CharByteW .BS 1
CharOutPixW .BS 1
CharOutByteW .BS 1
hOutPutBuf .BS 1
OutPutPtr .BS 1
BM.Offset .BS 4
DS.END

View File

@ -5,7 +5,7 @@ INC 1
AUTO 6
*/--------------------------------------
* # FPutC.AY
* Print A (char) to File
* Print A (char) to Node
* ## In:
* A : char to print
* Y = hFILE
@ -135,7 +135,7 @@ K.GetChar ldy #S.PS.hStdIn
lda (pPs),y
*/--------------------------------------
* # GetC.A
* Get char from File
* Get char from Node
* ## In:
* A = hFILE
* ## Out:
@ -208,7 +208,7 @@ K.FPutS
K.PutS.YA
*/--------------------------------------
* # FGetS
* Read String From FILE
* Read String From Node
* ## In:
* PUSHW : CPtr
* PUSHB : hFILE
@ -370,7 +370,7 @@ K.FClose.A.2 lda #$ff Self Modified
jmp K.FreeMem.A
*/--------------------------------------
* # FRead.A
* Read ONE byte from file
* Read ONE byte (A) from file (Y)
* ## In :
* A = hFILE
* ## Out :
@ -381,6 +381,7 @@ K.FRead.A jsr PFT.CheckNodeA
bra K.FReadWrite.0
*/--------------------------------------
* # FWrite.AY
* Write ONE byte (A) To file (Y)
* ## In:
* A = hFILE
* Y = char
@ -417,6 +418,7 @@ K.FRead jsr PFT.CheckNodeSTK
bra K.FReadWrite.1
*/--------------------------------------
* # FWrite
* Write bytes to file
* ## In:
* PUSHW = Src Ptr
* PUSHW = Bytes To Write
@ -618,7 +620,7 @@ K.Rename jsr PFT.CheckPathSTK
rts
*/--------------------------------------
* # SScanF
* Scan a PStr (in progress)
* Scan a C-String (in progress)
* ## In:
* PUSHW PTR to target buffer
* PUSHW PSTR pattern (ex: "%d.%d.%d.%d")