Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-11-28 17:50:08 +01:00
parent f795bc523a
commit 0c83cbab62
5 changed files with 198 additions and 77 deletions

Binary file not shown.

View File

@ -438,29 +438,15 @@ Ctrl.Q lda #$FF
Ctrl.S >LDYA L.DLG.SAVE
jsr DLG.Open
jsr DLG.Run
jsr DLG.Close
cmp #C.CR
bne .8
jsr FILE.Save
.8 jsr DLG.Close
clc
rts
lda #PromptModeSave
>STA.G PromptMode
>LDA.G hFileName
beq .2
>SYSCALL GetMemPtr
>STYA ZPPTR1
ldy #$ff
.1 iny
lda (ZPPTR1),y
sta (pData),y
bne .1
tya
.2 >STA.G PromptBufPtr
jmp SCRN.UpdateStatusBar
*--------------------------------------
Ctrl.FS jsr BUF.GetLine
bcs .8

View File

@ -117,16 +117,24 @@ DLG.Run >SYSCALL getchar
beq .8
cmp #C.TAB
bne DLG.Run
beq DLG.NextFocus
pha
jsr DLG.NextFocus
bcc DLG.Run
ldy #S.DLG.Focus
lda (ZPPTR1),y get actual focused Ctrl
tay
pla
jsr DLG.CTRL.CharIn
bra DLG.Run
rts
.8 clc
.9
DLG.Run.RTS rts
.9 rts
*--------------------------------------
DLG.NextFocus ldy #S.DLG.Focus
lda (ZPPTR1),y get actual focused Ctrl
@ -158,14 +166,10 @@ DLG.NextFocus ldy #S.DLG.Focus
jsr DLG.CTRL.Focus
pla
jmp DLG.CTRL.Focus
jsr DLG.CTRL.Focus
jmp DLG.Run
*--------------------------------------
DLG.Close ldy #S.DLG.H
lda (ZPPTR1),y
sta TmpCount
ldy #S.DLG.Y
DLG.Close ldy #S.DLG.Y
lda (ZPPTR1),y
sta TmpByte
@ -179,24 +183,11 @@ DLG.Close ldy #S.DLG.H
>LDA.G ScreenY+1
adc #0
sta TmpIndex+1
ldy #S.DLG.H
lda (ZPPTR1),y
lda TmpIndex
ldx TmpIndex+1
jsr BUF.GetLineAX
bcs .8
lda TmpByte
jsr SCRN.UpdateLineAtALenY
inc TmpIndex
bne .2
inc TmpIndex+1
.2 inc TmpByte
dec TmpCount
bne .1
.8 clc
rts
jmp SCRN.UpdateMain.1
*--------------------------------------
DLG.CTRL.Draw sta TmpByte A=CtrlID
tay
@ -278,6 +269,8 @@ DLG.CTRL.Draw.TB
iny
iny
txa
sta (ZPPTR1),y CURPOS
iny
.3 txa
@ -309,6 +302,7 @@ DLG.CTRL.Draw.OL
iny
iny
iny
iny
lda (ZPPTR1),y value
@ -374,7 +368,10 @@ DLG.CTRL.Draw.BUT
.9 rts
*--------------------------------------
DLG.CTRL.Focus sta TmpByte A=CtrlID
tay
jsr SCRN.LineBufInitNorm
ldy TmpByte
lda (ZPPTR1),y Ctrl Definition
tay
lda (ZPPTR1),y Ctrl Type
@ -396,8 +393,8 @@ DLG.CTRL.Focus.TB
.1 lda #C.SPACE
bcc .2
lda #'['
.2 >SYSCALL putchar
.2 jsr SCRN.ToLineBuf
jsr DLG.CTRL.GotoEnd
ldy #S.DLG.Focus
@ -409,7 +406,9 @@ DLG.CTRL.Focus.TB
.3 lda #C.SPACE
bcc .4
lda #']'
.4 >SYSCALL putchar
.4 jsr SCRN.ToLineBuf
jsr SCRN.LineBufOut
ldy TmpByte CtrlID
lda (ZPPTR1),y
@ -464,7 +463,7 @@ DLG.CTRL.Focus.OL
.1 lda #'('
bcc .2
lda #'['
.2 >SYSCALL putchar
.2 jsr SCRN.ToLineBuf
jsr DLG.CTRL.GotoEnd
@ -477,9 +476,9 @@ DLG.CTRL.Focus.OL
.3 lda #')'
bcc .4
lda #']'
.4 >SYSCALL putchar
clc
rts
.4 jsr SCRN.ToLineBuf
jmp SCRN.LineBufOut
DLG.CTRL.Focus.BUT
jsr DLG.CTRL.GotoOrg
@ -493,7 +492,7 @@ DLG.CTRL.Focus.BUT
.1 lda #C.SPACE
bcc .2
lda #'['
.2 >SYSCALL putchar
.2 jsr SCRN.ToLineBuf
jsr DLG.CTRL.GotoEnd
@ -506,10 +505,9 @@ DLG.CTRL.Focus.BUT
.3 lda #C.SPACE
bcc .4
lda #']'
.4 >SYSCALL putchar
.4 jsr SCRN.ToLineBuf
clc
rts
jmp SCRN.LineBufOut
*--------------------------------------
DLG.CTRL.GotoOrg
clc
@ -530,12 +528,12 @@ DLG.CTRL.GotoEnd
adc (ZPPTR1),y
plp
bcc .1
>PUSHA
jsr DLG.CTRL.GetWitdh
sec
inc pData
adc (pData)
clc
adc (pStack)
inc pStack
.1 tax
@ -553,7 +551,27 @@ DLG.CTRL.GotoEnd
tay
jmp SCRN.GotoXY
DLG.CTRL.GotoXY
txa
inc
>PUSHA
tya
inc
inc
>PUSHA
>PUSHBI 2
>PUSHW L.MSG.GOTOXY
>LDYA LineBufPtr
>SYSCALL sprintf
.2 lda (LineBufPtr)
beq .8
inc LineBufPtr
bne .2
inc LineBufPtr+1
bra .2
.8 rts
*--------------------------------------
DLG.SetOrigin ldy #S.DLG.X
lda (ZPPTR1),y
@ -625,10 +643,6 @@ DLG.CTRL.GetWitdh.OL
lda (ZPPTR1),y
bne .1
iny
lda (ZPPTR1),y
bne .1
txa
rts
@ -647,6 +661,112 @@ DLG.CTRL.GetWitdh.BUT
txa
rts
*--------------------------------------
DLG.CTRL.CharIn sty TmpByte A=CtrlID
pha
lda (ZPPTR1),y Ctrl Definition
tay
lda (ZPPTR1),y Ctrl Type
tax
pla
jmp (J.DLG.CTRL.CharIn,x)
*--------------------------------------
DLG.CTRL.CharIn.LBL
sec
rts
*--------------------------------------
DLG.CTRL.CharIn.TB
cmp #C.DEL
beq .5
pha
iny
iny
iny
lda (ZPPTR1),y CURPOS
iny
cmp (ZPPTR1),y MAXCHAR
beq .7
pha
inc
dey
sta (ZPPTR1),y CURPOS
iny
iny
lda (ZPPTR1),y hMem
tay
lda (pData),y
>SYSCALL getmemptr
>STYA ZPPTR2
ply
pla
pha
sta (ZPPTR2),y
iny
lda #0
sta (ZPPTR2),y
pla
>SYSCALL putchar
clc
rts
.5 iny
iny
iny
lda (ZPPTR1),y CURPOS
beq .8
dec
sta (ZPPTR1),y
pha
iny
iny
lda (ZPPTR1),y hMem
tay
lda (pData),y
>SYSCALL getmemptr
>STYA ZPPTR2
ply
lda #0
sta (ZPPTR2),y
lda #C.DEL
>SYSCALL putchar
clc
rts
.7 pla
.8 clc
rts
*--------------------------------------
DLG.CTRL.CharIn.OL
cmp #C.SPACE
bne .8
.8 clc
rts
*--------------------------------------
DLG.CTRL.CharIn.BUT
clc
rts
*--------------------------------------
DLG.DrawInvBar phy
jsr SCRN.LineBufInitInv

View File

@ -148,6 +148,11 @@ J.DLG.CTRL.GetWitdh
.DA DLG.CTRL.GetWitdh.TB
.DA DLG.CTRL.GetWitdh.OL
.DA DLG.CTRL.GetWitdh.BUT
J.DLG.CTRL.CharIn
.DA DLG.CTRL.CharIn.LBL
.DA DLG.CTRL.CharIn.TB
.DA DLG.CTRL.CharIn.OL
.DA DLG.CTRL.CharIn.BUT
.DA 0
*--------------------------------------
CS.INIT clc
@ -412,14 +417,14 @@ MSG.HELP >PSTR "All commands: (* = Not yet implemented)"
>PSTR " Ctrl-C : Copy selection to clipboard"
>PSTR " Ctrl-D : Delete selection"
>PSTR " Ctrl-E : Mark end of selection"
>PSTR " Ctrl-F : * Find a string..."
>PSTR " Ctrl-F : Find/Replace..."
>PSTR " Ctrl-G : Go to start of current line"
>PSTR " Ctrl-L : Go to end of current line"
>PSTR " Ctrl-N : * Find next"
>PSTR " Ctrl-N : Find next"
>PSTR " Ctrl-O : Page up"
>PSTR " Ctrl-P : Page down"
>PSTR " Ctrl-Q : Quit"
>PSTR " Ctrl-R : * Replace found string with..."
>PSTR " Ctrl-R : Replace next"
>PSTR " Ctrl-S : Save file..."
>PSTR " Ctrl-T : Go to top of file"
>PSTR " Ctrl-V : Past clipboard at cursor position"
@ -478,17 +483,20 @@ DLG.SAVE.3 .DA #S.DLG.Ctrl.LBL,#2,#5
DLG.SAVE.4 .DA #S.DLG.Ctrl.OL,#2,#6
.DA #18 Ctrl-R
.DA #FileType
.DA #0
.AZ "TXT/CR"
DLG.SAVE.5 .DA #S.DLG.Ctrl.OL,#13,#6
.DA #12 Ctrl-L
.DA #0
.DA #FileType
.DA #2
.AZ "TXT/CRLF"
DLG.SAVE.6 .DA #S.DLG.Ctrl.OL,#26,#6
.DA #1 Ctrl-A
.DA #0
.DA #FileType
.DA #4
.AZ "S-C/ASM"
DLG.SAVE.7 .DA #S.DLG.Ctrl.BUT,#40,#8
@ -500,7 +508,7 @@ DLG.SAVE.8 .DA #S.DLG.Ctrl.BUT,#52,#8
.AZ " Cancel "
DLG.SAVE.T .AZ "Save As..." Title
DLG.SAVE.S .AZ "CR:Save, Ctrl-T:Change Type, Ctrl-C:Cancel"
DLG.SAVE.S .AZ "CR:Save, Ctrl-R/L/A:Change Type, Ctrl-C:Cancel"
DLG.SAVE.LEN .EQ *-DLG.SAVE
*--------------------------------------
.DUMMY

View File

@ -255,14 +255,21 @@ MATH.Dec2ACC32 jsr MATH.ACC32ZERO
bne .1
inc ACC32+3
bne .1 if 0, overflow!!!
.9 lda #E.INUM
sec
rts
.8 tya no digit parsed...error
beq .9
.80 lda #$FF SELF MODIFIED
bpl .88
phy
jsr MATH.ACC32NEG
ply
.88 clc
rts
*--------------------------------------