diff --git a/.Docs/KERNEL.md b/.Docs/KERNEL.md index fa2f804f..eb539dfe 100644 --- a/.Docs/KERNEL.md +++ b/.Docs/KERNEL.md @@ -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 diff --git a/.Floppies/A2OSX.BUILD.po b/.Floppies/A2OSX.BUILD.po index 111aaaa1..f9ac034f 100644 Binary files a/.Floppies/A2OSX.BUILD.po and b/.Floppies/A2OSX.BUILD.po differ diff --git a/.Floppies/A2OSX.SRC.po b/.Floppies/A2OSX.SRC.po index 12e9d9ff..86c47422 100644 Binary files a/.Floppies/A2OSX.SRC.po and b/.Floppies/A2OSX.SRC.po differ diff --git a/FNT2FON.S.txt b/FNT2FON.S.txt index feb9b63a..06fa1bde 100644 --- a/FNT2FON.S.txt +++ b/FNT2FON.S.txt @@ -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 diff --git a/SYS/KERNEL.S.STDIO.txt b/SYS/KERNEL.S.STDIO.txt index f7e85767..10040da2 100644 --- a/SYS/KERNEL.S.STDIO.txt +++ b/SYS/KERNEL.S.STDIO.txt @@ -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")