Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-07-27 16:09:19 +02:00
parent ad341995dc
commit abfd50a7d4
8 changed files with 163 additions and 82 deletions

Binary file not shown.

Binary file not shown.

View File

@ -575,6 +575,6 @@ BUF.BufPtr.Realloc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/EDIT.S.BUF SAVE usr/src/bin/edit.s.buf
LOAD USR/SRC/BIN/EDIT.S LOAD usr/src/bin/edit.s
ASM ASM

View File

@ -652,6 +652,6 @@ Ctrl.Z jsr BUF.ComputeCOffset
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/EDIT.S.CTRL SAVE usr/src/bin/edit.s.ctrl
LOAD USR/SRC/BIN/EDIT.S LOAD usr/src/bin/edit.s
ASM ASM

View File

@ -842,6 +842,6 @@ DLG.VBarToLineBuf
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/EDIT.S.DLG SAVE usr/src/bin/edit.s.dlg
LOAD USR/SRC/BIN/EDIT.S LOAD usr/src/bin/edit.s
ASM ASM

View File

@ -91,7 +91,6 @@ FILE.Load.TXT stz FileLen
jsr FILE.OpenTypeX jsr FILE.OpenTypeX
bcs .99 bcs .99
sta TmpIndex
>PUSHA >PUSHA
>PUSHEA.G STATBUF >PUSHEA.G STATBUF
@ -101,10 +100,8 @@ FILE.Load.TXT stz FileLen
jsr FILE.GetBuffer jsr FILE.GetBuffer
.99 bcs .9 .99 bcs .9
.1 >PUSHWI 254 .1 ldy #254
>PUSHW ZPPTR1 jsr FILE.ReadY
lda TmpIndex
>SYSCALL FRead
bcs .7 bcs .7
lda #0 lda #0
@ -173,25 +170,17 @@ FILE.Load.ASM stz FileLen
ldx #$FA ldx #$FA
jsr FILE.OpenTypeX jsr FILE.OpenTypeX
bcs .99 bcs .99
sta TmpIndex .1 ldy #3
jsr FILE.ReadY
.1 >PUSHWI 3
>PUSHW ZPPTR1
lda TmpIndex
>SYSCALL FRead
bcs .7 bcs .7
lda #0
>PUSHA
lda (ZPPTR1) lda (ZPPTR1)
dec dec
dec dec
dec dec
>PUSHA tay
>PUSHW ZPPTR1 jsr FILE.ReadY
lda TmpIndex
>SYSCALL FRead
bcs .7 bcs .7
jsr FILE.Load.ASM.Decode jsr FILE.Load.ASM.Decode
@ -290,17 +279,6 @@ FILE.Load.ASM.2Buf
ply ply
rts rts
*-------------------------------------- *--------------------------------------
FILE.OpenTypeX tax
>LDA.G hFileName
>SYSCALL GetMemPtr
>PUSHYA
>PUSHBI O.RDONLY
txa
>PUSHA
>PUSHWZ Aux type
>SYSCALL FOpen
rts
*--------------------------------------
FILE.Save >LDYAI 256 FILE.Save >LDYAI 256
>SYSCALL GetMem >SYSCALL GetMem
bcs FILE.Save.9 bcs FILE.Save.9
@ -319,19 +297,12 @@ FILE.Save.CR clc
.HS B0 BCS .HS B0 BCS
FILE.Save.CRLF sec FILE.Save.CRLF sec
ror TmpIndex+1 ror TmpIndex+1
stz TmpIndex hFile
>LDA.G hFileName ldx #S.FI.T.TXT
>SYSCALL GetMemPtr jsr FILE.CreateTypeX
>PUSHYA
>PUSHBI O.CREATE+O.WRONLY
>PUSHBI S.FI.T.TXT
>PUSHWZ Aux type
>SYSCALL FOpen
bcs FILE.Save.9 bcs FILE.Save.9
sta TmpIndex
>LDYA.G BufBase >LDYA.G BufBase
>STYA BufPtr >STYA BufPtr
@ -364,53 +335,126 @@ FILE.Save.CRLF sec
clc clc
adc BufPtr adc BufPtr
sta BufPtr sta BufPtr
bcc .4 bcc .7
inc BufPtr+1 inc BufPtr+1
.4 lda #0 .7 jsr FILE.WriteY
>PUSHYA bcs FILE.Save.99
>PUSHW ZPPTR1
lda TmpIndex
>SYSCALL FWrite
bcs FILE.Close
bra .1 bra .1
.8 >STZ.G bUnSaved .8 >STZ.G bUnSaved
jmp FILE.Close FILE.Save.99 jmp FILE.Close
*-------------------------------------- *--------------------------------------
FILE.Save.ASM stz TmpIndex hFile FILE.Save.ASM stz TmpLen
stz TmpLen
stz TmpLen+1 stz TmpLen+1
>LDA.G hFileName
>SYSCALL GetMemPtr
>PUSHYA
>PUSHBI O.CREATE+O.WRONLY
>PUSHBI S.FI.T.ASM
>PUSHWZ Aux type
>SYSCALL FOpen
bcs FILE.Close
sta TmpIndex
inc TmpLen
ldx #$FA S-C/ASM
jsr FILE.CreateTypeX
bcs FILE.Save.99
>LDYA.G BufBase >LDYA.G BufBase
>STYA BufPtr >STYA BufPtr
.1 lda (BufPtr)
beq .8
ldy #1
lda TmpLen
sta (ZPPTR1),y
iny
lda TmpLen+1
sta (ZPPTR1),y
ldy #0
.2 iny
lda (BufPtr),y
beq .3
cmp #C.CR
bne .2
.3 ldy #3 Initial LEN
.4 lda (BufPtr)
beq .7
ldx #0
.40 inc BufPtr
bne .5
inc BufPtr+1
.5 cmp #C.CR
beq .7
cmp (BufPtr) same as next ?
bne .50 no -> flush
inx
cpx #$3F
bne .40
.50 cpx #0
beq .60 only one char....
cmp #C.SPACE
beq .61
cpx #3
bcs .62
.63 sta (ZPPTR1),y
iny
dex
bpl .63
bra .4
.62 pha
lda #$C0
sta (ZPPTR1),y
iny
txa
sta (ZPPTR1),y
iny
pla
sta (ZPPTR1),y
iny
bra .4
.61 txa
ora #$C0
.60 sta (ZPPTR1),y
iny
bra .4
.7 lda #0
sta (ZPPTR1),y
iny
tya
sta (ZPPTR1)
jsr FILE.WriteY
bcs FILE.Close
inc TmpLen
bne .1
inc TmpLen+1
bra .1
.8 >STZ.G bUnSaved .8 >STZ.G bUnSaved
*-------------------------------------- *--------------------------------------
@ -429,6 +473,43 @@ FILE.Close php
plp plp
rts rts
*-------------------------------------- *--------------------------------------
FILE.OpenTypeX lda #O.RDONLY
bra FILE.Open
FILE.CreateTypeX
lda #O.CREATE+O.WRONLY
FILE.Open stz TmpIndex
phx
pha
>LDA.G hFileName
>SYSCALL GetMemPtr
>PUSHYA
pla access
>PUSHA
pla type
>PUSHA
>PUSHWZ Aux type
>SYSCALL FOpen
bcs .9
sta TmpIndex
.9 rts
*--------------------------------------
FILE.ReadY lda #0
>PUSHYA
>PUSHW ZPPTR1
lda TmpIndex
>SYSCALL FRead
rts
*--------------------------------------
FILE.WriteY lda #0
>PUSHYA
>PUSHW ZPPTR1
lda TmpIndex
>SYSCALL FWrite
rts
*--------------------------------------
FILE.GetBuffer >LDA.G STATBUF+S.STAT.SIZE+3 FILE.GetBuffer >LDA.G STATBUF+S.STAT.SIZE+3
dey dey
ora (pData),y ora (pData),y
@ -457,6 +538,6 @@ FILE.GetBuffer.9
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/EDIT.S.FILE SAVE usr/src/bin/edit.s.file
LOAD USR/SRC/BIN/EDIT.S LOAD usr/src/bin/edit.s
ASM ASM

View File

@ -626,6 +626,6 @@ SCRN.LineBufOut lda #0
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/EDIT.S.SCRN SAVE usr/src/bin/edit.s.scrn
LOAD USR/SRC/BIN/EDIT.S LOAD usr/src/bin/edit.s
ASM ASM

View File

@ -3,12 +3,12 @@ NEW
.LIST OFF .LIST OFF
.OP 65C02 .OP 65C02
.OR $2000 .OR $2000
.TF BIN/EDIT .TF bin/edit
*-------------------------------------- *--------------------------------------
.INB INC/MACROS.I .INB inc/macros.i
.INB INC/A2OSX.I .INB inc/a2osx.i
.INB INC/MLI.I .INB inc/mli.i
.INB INC/MLI.E.I .INB inc/mli.e.i
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR ZPBIN .OR ZPBIN
@ -449,11 +449,11 @@ CharIn.TmpByte10pA
sta TmpByte sta TmpByte
rts rts
*-------------------------------------- *--------------------------------------
.INB USR/SRC/BIN/EDIT.S.BUF .INB usr/src/bin/edit.s.buf
.INB USR/SRC/BIN/EDIT.S.CTRL .INB usr/src/bin/edit.s.ctrl
.INB USR/SRC/BIN/EDIT.S.DLG .INB usr/src/bin/edit.s.dlg
.INB USR/SRC/BIN/EDIT.S.FILE .INB usr/src/bin/edit.s.file
.INB USR/SRC/BIN/EDIT.S.SCRN .INB usr/src/bin/edit.s.scrn
*-------------------------------------- *--------------------------------------
CS.END CS.END
SEQS .EQ * SEQS .EQ *
@ -683,5 +683,5 @@ DS.END
.ED .ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/EDIT.S SAVE usr/src/bin/edit.s
ASM ASM