Kernel 0.93++

This commit is contained in:
Rémy GIBERT 2020-02-12 15:42:07 +01:00
parent 3f81325deb
commit 262c280386
4 changed files with 66 additions and 46 deletions

Binary file not shown.

View File

@ -246,17 +246,24 @@ Ctrl.L jsr BUF.GetLine
*--------------------------------------
Ctrl.CR lda #C.CR
jsr BUF.InsertA
bcs .9
bcs .99
jsr SCRN.LineBufInitEdit EOL
jsr SCRN.LineBufInitEdit CEOL
>STZ.G FileX
>INCW.G FileY
>STZ.G CurX
>LDA.G CurY
>CMP.G ViewPortHm1
beq .8 Bottom line, all done
bne .1
dec
jsr SCRN.LineBufOut Bottom line, all done, just CEOL
bcs .99
jmp SCRN.GotoCurXCurY
.1 dec
>CMP.G ViewPortHm1
bne .6 No scroll needed
@ -270,7 +277,7 @@ Ctrl.CR lda #C.CR
>PUSHA
>PUSHBI 2
jsr SCRN.LineBufSprintf
bcs .9
.99 bcs .9
>PUSHW L.SEQ.SCROLLRGN
>LDA.G ScreenH
@ -283,10 +290,10 @@ Ctrl.CR lda #C.CR
.6 jsr SCRN.LineBufOut
bcs .9
.7 >INC.G CurY
jmp SCRN.UpdateCurrentLine
.8 jmp SCRN.LineBufOut
>INC.G CurY
jsr BUF.ComputeCOffset
jsr SCRN.UpdateCurrentLine
jmp SCRN.GotoCurXCurY
.9 rts
*--------------------------------------

View File

@ -48,35 +48,46 @@ FILE.Load jsr BUF.ResetSel
>SYSCALL GetMemPtr
bra FILE.New.1
.1 >LDA.G STATBUF+S.STAT.P.TYPE
.1 >LDYAI 256
>SYSCALL GetMem
bcs .9
>STYA ZPPTR1
stx TmpByte
>LDA.G STATBUF+S.STAT.P.TYPE
cmp #S.FI.T.TXT
beq FILE.Load.TXT
cmp #$FA S-C/ASM?
bne .9
bne .2
jsr FILE.Load.TXT
bra .8
jmp FILE.Load.ASM
.2 cmp #$FA S-C/ASM?
beq .3
.9 lda #MLI.E.INCFF
lda #MLI.E.INCFF
sec
rts
.3 jsr FILE.Load.ASM
.8 php
pha
lda TmpByte
>SYSCALL freemem
pla
plp
.9 rts
*--------------------------------------
FILE.Load.TXT stz FileLen
stz FileLen+1
jsr SCRN.Home
stz TmpByte hLineBuffer
stz TmpIndex hFile
>STZ.G FileType
>LDYAI 256
>SYSCALL GetMem
bcs .99
>STYA ZPPTR1
stx TmpByte
ldx #S.FI.T.TXT
jsr FILE.OpenTypeX
bcs .99
@ -159,13 +170,6 @@ FILE.Load.ASM stz FileLen
jsr FILE.GetBufferA 2k buffer
bcs .9
>LDYAI 256
>SYSCALL GetMem
bcs .99
>STYA ZPPTR1
stx TmpByte
ldx #$FA
jsr FILE.OpenTypeX
bcs .99
@ -218,7 +222,8 @@ FILE.Load.ASM.Decode
jsr FILE.Load.ASM.2Buf
bcc .1
rts
.9 rts
.2 cmp #$C0 REPEAT char?
bne .5
@ -231,6 +236,8 @@ FILE.Load.ASM.Decode
iny
.4 jsr FILE.Load.ASM.2Buf
bcs .9
dex
bne .4
@ -241,11 +248,12 @@ FILE.Load.ASM.Decode
lda #C.SPACE
.6 jsr FILE.Load.ASM.2Buf
bcs .9
dex
bne .6
bra .1
.9 rts
.8 lda #C.CR
*--------------------------------------

View File

@ -21,6 +21,7 @@ MEM.BestScore .EQ ZPMemMgrTmp1
* YA = ptr
* X = hMem
*\--------------------------------------
MEM.OldSize .BS 2
MEM.NewSize .BS 2
*--------------------------------------
K.Realloc >PULLW MEM.NewSize
@ -37,30 +38,34 @@ K.Realloc.I tax
lda (ZPMemMgrSPtr),y
ply
sty .2+1
sta .3+1
>STYA MEM.OldSize
jsr MEM.MoveToAux x = Src hMem, YA = LEN
jsr MEM.MoveToAux x = Src hMem, YA = Old size
bcs .99
stx .1+1
stx .7+1 Aux hMem
>LDYA MEM.NewSize
>STYA A2L size for MoveSetupA1A2
jsr K.getmem
bcs .99
stx .8+1 new main hMem
stx .8+1 new main hMem to return
>STYA A4L Save MAIN Ptr
.1 ldx #$ff SELF MODIFIED hMem AUX
.2 ldy #$ff SELF MODIFIED src LEN
.3 lda #$ff SELF MODIFIED src LEN
lda .7+1
>SYSCALL2 GetStkObjPtr
jsr MEM.MoveSetupA1A2 Setup AUX base & End Ptrs
jsr MEM.MoveToMain
bcs .99
clc Aux To Main
jsr AuxMove
.7 lda #$ff SELF MODIFIED
>SYSCALL2 FreeStkObj
.8 lda #$ff SELF MODIFIED
tax
tax X = new hMem
jmp k.GetMemPtr YA = new ptr
.99 rts