Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-11-04 08:21:40 +01:00
parent 8d65f92fa0
commit 3ebca5bfa7
25 changed files with 923 additions and 1086 deletions

Binary file not shown.

View File

@ -3,9 +3,9 @@ NEW
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
BUF.InsertClipboard BUF.InsertClipboard
ldy #hClipBoard >LDA.G hClipBoard
lda (pData),y
beq .8 beq .8
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA ClipboardPtr >STYA ClipboardPtr
jsr BUF.ComputeCOffset jsr BUF.ComputeCOffset
@ -21,16 +21,18 @@ BUF.InsertClipboard
ply ply
jsr BUF.GetNewYA jsr BUF.GetNewYA
bcs .9 bcs .9
>LDYA BUF.COffset >LDYA BUF.COffset
jsr BUF.Start2YA jsr BUF.Start2YA
jsr BUF.CopyClipboard jsr BUF.CopyClipboard
jsr BUF.CopyTail jsr BUF.CopyTail
.4 ldy #ClipboardLen
lda (pData),y >LDA.G ClipboardLen
clc clc
adc BufLen adc BufLen
sta BufLen sta BufLen
iny iny
lda (pData),y lda (pData),y
adc BufLen+1 adc BufLen+1
@ -42,18 +44,18 @@ BUF.InsertClipboard
BUF.InsertA sta TmpByte BUF.InsertA sta TmpByte
jsr BUF.ComputeCOffset jsr BUF.ComputeCOffset
cpy #255 cpy #255
bne .10 beq .8
clc
rts lda BufLen
.10 lda BufLen
clc clc
adc #2 adc #2
pha tay
lda BufLen+1 lda BufLen+1
adc #0 adc #0
ply
jsr BUF.GetNewYA jsr BUF.GetNewYA
bcs .9 bcs .9
>LDYA BUF.COffset >LDYA BUF.COffset
jsr BUF.Start2YA jsr BUF.Start2YA
@ -62,14 +64,14 @@ BUF.InsertA sta TmpByte
inc BufPtr inc BufPtr
bne .3 bne .3
inc BufPtr+1 inc BufPtr+1
.3 jsr BUF.CopyTail .3 jsr BUF.CopyTail
.4 lda BufLen
clc .4 inc BufLen
adc #1 bne .8
sta BufLen
bcc .9
inc BufLen+1 inc BufLen+1
clc
.8 clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
BUF.DelSel jsr BUF.GetSelLen BUF.DelSel jsr BUF.GetSelLen
@ -84,6 +86,7 @@ BUF.DelSel jsr BUF.GetSelLen
iny iny
bne .1 bne .1
inc inc
.1 jsr BUF.GetNewYA .1 jsr BUF.GetNewYA
bcs .9 bcs .9
@ -97,6 +100,7 @@ BUF.DelSel jsr BUF.GetSelLen
adc SelLen+1 adc SelLen+1
sta BufPtrBackup+1 sta BufPtrBackup+1
jsr BUF.CopyTail jsr BUF.CopyTail
lda BufLen lda BufLen
sec sec
sbc SelLen sbc SelLen
@ -125,11 +129,14 @@ BUF.DelCharAtCursor
inc BufPtrBackup inc BufPtrBackup
bne .4 bne .4
inc BufPtrBackup+1 inc BufPtrBackup+1
.4 jsr BUF.CopyTail .4 jsr BUF.CopyTail
lda BufLen lda BufLen
bne .5 bne .5
dec BufLen+1 dec BufLen+1
.5 dec BufLen .5 dec BufLen
jsr BUF.ResetSel jsr BUF.ResetSel
pla Get back deleted char pla Get back deleted char
@ -139,19 +146,24 @@ BUF.DelCharAtCursor
BUF.SelToClipboard BUF.SelToClipboard
jsr BUF.GetSelLen jsr BUF.GetSelLen
bcs .8 bcs .8
>LDA.G hClipBoard >LDA.G hClipBoard
beq .1 beq .1
>SYSCALL FreeMem >SYSCALL FreeMem
>STZ.G hClipBoard >STZ.G hClipBoard
.1 >LDYA SelLen .1 >LDYA SelLen
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 bcs .9
>STYA ClipboardPtr >STYA ClipboardPtr
txa txa
>STA.G hClipBoard >STA.G hClipBoard
ldy #hBuffer
lda (pData),y >LDA.G hBuffer
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
pha pha
tya tya
* clc * clc
@ -161,9 +173,10 @@ BUF.SelToClipboard
pla pla
>ADC.G SelStart+1 >ADC.G SelStart+1
sta BufPtr+1 sta BufPtr+1
lda SelLen lda SelLen
ldy #ClipBoardLen >STA.G ClipBoardLen
sta (pData),y
eor #$ff eor #$ff
tax tax
iny iny
@ -171,17 +184,23 @@ BUF.SelToClipboard
sta (pData),y sta (pData),y
eor #$ff eor #$ff
pha pha
ldy #0 ldy #0
.2 inx .2 inx
bne .3 bne .3
pla pla
inc inc
beq .8 beq .8
pha pha
.3 lda (BufPtr),y .3 lda (BufPtr),y
sta (ClipboardPtr),y sta (ClipboardPtr),y
iny iny
bne .2 bne .2
inc BufPtr+1 inc BufPtr+1
inc ClipboardPtr+1 inc ClipboardPtr+1
bra .2 bra .2
@ -197,26 +216,34 @@ BUF.CopyClipboard
lda (pData),y lda (pData),y
eor #$ff eor #$ff
pha pha
ldy #0 ldy #0
.1 inx .1 inx
bne .2 bne .2
pla pla
inc inc
beq .3 beq .3
pha pha
.2 lda (ClipboardPtr),y .2 lda (ClipboardPtr),y
sta (BufPtr),y sta (BufPtr),y
iny iny
bne .1 bne .1
inc ClipboardPtr+1 inc ClipboardPtr+1
inc BufPtr+1 inc BufPtr+1
bra .1 bra .1
.3 tya .3 tya
clc clc
adc ClipboardPtr adc ClipboardPtr
sta ClipboardPtr sta ClipboardPtr
bcc BUF.CopyAddY bcc BUF.CopyAddY
inc ClipboardPtr+1 inc ClipboardPtr+1
BUF.CopyAddY tya BUF.CopyAddY tya
clc clc
adc BufPtr adc BufPtr
@ -230,13 +257,17 @@ BUF.Start2YA eor #$ff
tya tya
eor #$ff eor #$ff
tax tax
ldy #0 ldy #0
.1 inx .1 inx
bne .2 bne .2
pla pla
inc inc
beq .3 beq .3
pha pha
.2 lda (BufPtrBackup),y .2 lda (BufPtrBackup),y
sta (BufPtr),y sta (BufPtr),y
iny iny
@ -245,6 +276,7 @@ BUF.Start2YA eor #$ff
inc BufPtrBackup+1 inc BufPtrBackup+1
inc BufPtr+1 inc BufPtr+1
bra .1 bra .1
.3 tya .3 tya
clc clc
adc BufPtrBackup adc BufPtrBackup
@ -258,8 +290,10 @@ BUF.CopyTail ldy #0
.1 lda (BufPtrBackup),y .1 lda (BufPtrBackup),y
sta (BufPtr),y sta (BufPtr),y
beq .8 beq .8
iny iny
bne .1 bne .1
inc BufPtrBackup+1 inc BufPtrBackup+1
inc BufPtr+1 inc BufPtr+1
bra .1 bra .1
@ -274,8 +308,7 @@ BUF.ComputeCOffset
phy save line length phy save line length
ldy #FileX >LDA.G FileX
lda (pData),y
clc clc
adc BUF.LOffset adc BUF.LOffset
sta BUF.COffset sta BUF.COffset
@ -289,27 +322,37 @@ BUF.ComputeCOffset
clc clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
BUF.GetLine ldy #FileY+1 BUF.GetNextLine sec
.HS 90 BCC
BUF.GetLine clc
>LDA.G FileY
adc #0
pha
iny
lda (pData),y lda (pData),y
adc #0
tax tax
dey pla
lda (pData),y
BUF.GetLineAX sta BUF.TmpLine1 BUF.GetLineAX sta BUF.TmpLine1
stx BUF.TmpLine1+1 stx BUF.TmpLine1+1
stz BUF.LOffset stz BUF.LOffset
stz BUF.LOffset+1 stz BUF.LOffset+1
ldy #hBuffer >LDA.G hBuffer
lda (pData),y
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA BufPtr >STYA BufPtr
stz BUF.TmpLine2 stz BUF.TmpLine2
stz BUF.TmpLine2+1 stz BUF.TmpLine2+1
.1 ldy #0 .1 ldy #0
.2 lda (BufPtr),y .2 lda (BufPtr),y
beq .7 beq .7
cmp #C.CR cmp #C.CR
beq .3 beq .3
iny iny
@ -318,15 +361,18 @@ BUF.GetLineAX sta BUF.TmpLine1
.3 lda BUF.TmpLine1 .3 lda BUF.TmpLine1
cmp BUF.TmpLine2 cmp BUF.TmpLine2
bne .4 bne .4
lda BUF.TmpLine1+1 lda BUF.TmpLine1+1
cmp BUF.TmpLine2+1 cmp BUF.TmpLine2+1
beq .8 beq .8
.4 tya .4 tya
sec sec
adc BufPtr adc BufPtr
sta BufPtr sta BufPtr
bcc .5 bcc .5
inc BufPtr+1 inc BufPtr+1
.5 tya .5 tya
sec sec
adc BUF.LOffset adc BUF.LOffset
@ -338,36 +384,60 @@ BUF.GetLineAX sta BUF.TmpLine1
bne .1 bne .1
inc BUF.TmpLine2+1 inc BUF.TmpLine2+1
bra .1 bra .1
.7 lda BUF.TmpLine1 .7 lda BUF.TmpLine1
cmp BUF.TmpLine2 cmp BUF.TmpLine2
bne .9 bne .9
lda BUF.TmpLine1+1 lda BUF.TmpLine1+1
cmp BUF.TmpLine2+1 cmp BUF.TmpLine2+1
bne .9 bne .9
.8 clc Y = Line length .8 clc Y = Line length
rts rts
.9 sec .9 sec
rts rts
*-------------------------------------- *--------------------------------------
BUF.GetNewYA phy BUF.GetNewYA tax In 256 bytes page to avoid fragmentation
pha
tya
beq .10
inx
.10 phx
>LDA.G hBufferBackup >LDA.G hBufferBackup
beq .1 beq .1
>SYSCALL FreeMem >SYSCALL FreeMem
.1 >LDA.G hBuffer .1 >LDA.G hBuffer
>STA.G hBufferBackup >STA.G hBufferBackup
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA BufPtrBackup >STYA BufPtrBackup
>STZ.G hBuffer >STZ.G hBuffer
pla pla
ply ldy #0
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 bcs .9
>STYA BufPtr >STYA BufPtr
txa txa
>STA.G hBuffer >STA.G hBuffer
>LDA.G bSaved
beq .8
jsr SCRN.UpdateTopBar
bcs .9
>STZ.G bSaved
.8
* clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
BUF.ResetSel lda #$ff BUF.ResetSel lda #$ff
@ -378,7 +448,7 @@ BUF.ResetSel lda #$ff
sta (pData),y sta (pData),y
iny #SelEnd iny #SelEnd
inc inc lda #0
sta (pData),y sta (pData),y
iny iny
sta (pData),y sta (pData),y
@ -392,6 +462,7 @@ BUF.CheckSelected
iny iny
sbc (pData),y sbc (pData),y
bcc .9 CC:COffset < SelStart bcc .9 CC:COffset < SelStart
iny #SelEnd iny #SelEnd
lda (pData),y lda (pData),y
clc clc

View File

@ -30,17 +30,18 @@ NEW
*-------------------------------------- *--------------------------------------
Prompt.Editor cmp #C.DEL Prompt.Editor cmp #C.DEL
beq Ctrl.DEL beq Ctrl.DEL
cmp #C.SPACE cmp #C.SPACE
bcc .3 bcc .3
jsr BUF.InsertA jsr BUF.InsertA
bcs .9 bcs .9
jsr SCRN.UpdateCurrentLine jsr SCRN.UpdateCurrentLine
bcs .9 bcs .9
jsr Ctrl.FS
bcs .9
.8 clc jmp Ctrl.FS
.9 rts .9 rts
.3 asl .3 asl
@ -72,7 +73,7 @@ Ctrl.A lda #PromptModeHelp
stz .1+1 stz .1+1
.1 ldy #0 .1 ldy #0
ldx #0 ldx #0
jsr GotoXY jsr SCRN.GotoXY
lda (ZPPTR1) lda (ZPPTR1)
beq .8 beq .8
>PUSHW ZPPTR1 >PUSHW ZPPTR1
@ -118,8 +119,12 @@ Ctrl.F lda #PromptModeFind
Ctrl.G ldy #FileX Ctrl.G ldy #FileX
lda (pData),y lda (pData),y
beq .8 beq .8
lda #0 lda #0
sta (pData),y sta (pData),y
jsr BUF.ComputeCOffset
jmp SCRN.UpdateViewPort jmp SCRN.UpdateViewPort
.8 clc .8 clc
@ -132,31 +137,33 @@ Ctrl.BS ldy #FileX
dec dec
sta (pData),y sta (pData),y
bra .3 bra .3
.1 ldy #FileY+1 .1 ldy #FileY+1
lda (pData),y lda (pData),y
tax tax
dey dey
ora (pData),y ora (pData),y
beq .8 beq .8
lda (pData),y lda (pData),y
bne .2 bne .2
dex dex
.2 dec .2 dec
jsr BUF.GetLineAX jsr BUF.GetLineAX
bcs .8 bcs .8
tya tya
ldy #FileX ldy #FileX
sta (pData),y sta (pData),y
sec
ldy #FileY >DECW.G FileY
lda (pData),y
sbc #1 .3 jsr BUF.ComputeCOffset
sta (pData),y
iny jmp SCRN.UpdateViewPort
lda (pData),y
sbc #0
sta (pData),y
.3 jmp SCRN.UpdateViewPort
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
@ -164,31 +171,21 @@ Ctrl.TAB
clc clc
rts rts
*-------------------------------------- *--------------------------------------
Ctrl.LF ldy #FileY+1 Ctrl.LF jsr BUF.GetNextLine
lda (pData),y
tax
dey
lda (pData),y
inc
bne .1
inx
.1 jsr BUF.GetLineAX
bcs .8 bcs .8
tya Y = line length tya Y = line length
ldy #FileX ldy #FileX
cmp (pData),y cmp (pData),y
bcs .2 bcs .2
sta (pData),y sta (pData),y
.2 ldy #FileY
lda (pData),y .2 >INCW.G FileY
inc
sta (pData),y jsr BUF.ComputeCOffset
bne .3
iny jmp SCRN.UpdateViewPort
lda (pData),y
inc
sta (pData),y
.3 jmp SCRN.UpdateViewPort
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
@ -198,35 +195,39 @@ Ctrl.VT ldy #FileY+1
dey dey
ora (pData),y ora (pData),y
beq .8 beq .8
lda (pData),y lda (pData),y
bne .1 bne .1
dex dex
.1 dec .1 dec
jsr BUF.GetLineAX jsr BUF.GetLineAX
bcs .8 bcs .8
tya Y = line length tya Y = line length
ldy #FileX ldy #FileX
cmp (pData),y cmp (pData),y
bcs .2 bcs .2
sta (pData),y sta (pData),y
.2 sec
ldy #FileY .2 >DECW.G FileY
lda (pData),y
sbc #1 jsr BUF.ComputeCOffset
sta (pData),y
iny
lda (pData),y
sbc #0
sta (pData),y
jmp SCRN.UpdateViewPort jmp SCRN.UpdateViewPort
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
Ctrl.L jsr BUF.GetLine Ctrl.L jsr BUF.GetLine
bcs .8 bcs .8
tya Y = line length tya Y = line length
ldy #FileX ldy #FileX
sta (pData),y sta (pData),y
jsr BUF.ComputeCOffset
jmp SCRN.UpdateViewPort jmp SCRN.UpdateViewPort
.8 clc .8 clc
@ -236,9 +237,8 @@ Ctrl.CR lda #C.CR
jsr BUF.InsertA jsr BUF.InsertA
bcs .9 bcs .9
ldy #FileX >STZ.G FileX
lda #0
sta (pData),y
jmp SCRN.UpdateMain jmp SCRN.UpdateMain
.9 rts .9 rts
@ -259,6 +259,7 @@ Ctrl.O ldy #FileY+1
txa txa
sbc #0 sbc #0
bcc .8 bcc .8
ldy #FileY+1 ldy #FileY+1
sta (pData),y sta (pData),y
dey dey
@ -268,7 +269,10 @@ Ctrl.O ldy #FileY+1
ldy #FileX ldy #FileX
sta (pData),y sta (pData),y
jsr BUF.ComputeCOffset
jmp SCRN.UpdateViewPort jmp SCRN.UpdateViewPort
.8 pla .8 pla
jmp Ctrl.T jmp Ctrl.T
*-------------------------------------- *--------------------------------------
@ -280,9 +284,10 @@ Ctrl.P ldy #FileY+1
ldy #ViewPortH ldy #ViewPortH
clc clc
adc (pData),y adc (pData),y
bcc .1 bcc .1
inx inx
.1 pha .1 pha
phx phx
jsr BUF.GetLineAX A,X = FileY+PAGE jsr BUF.GetLineAX A,X = FileY+PAGE
@ -299,32 +304,42 @@ Ctrl.P ldy #FileY+1
dey dey
pla pla
sta (pData),y sta (pData),y
jsr BUF.ComputeCOffset
jmp SCRN.UpdateViewPort jmp SCRN.UpdateViewPort
.8 pla .8 pla
pla pla
jmp Ctrl.Y jmp Ctrl.Y
*-------------------------------------- *--------------------------------------
Ctrl.Q lda #$FF
>STA.G bCANCEL
clc
rts
*--------------------------------------
Ctrl.R lda #PromptModeReplace Ctrl.R lda #PromptModeReplace
>STA.G PromptMode >STA.G PromptMode
jmp SCRN.UpdateStatusBar jmp SCRN.UpdateStatusBar
*-------------------------------------- *--------------------------------------
Ctrl.Q lda #$FF
>STA.G bCANCEL
>LDA.G bSaved
beq Ctrl.S
clc
rts
*--------------------------------------
Ctrl.S lda #PromptModeSave Ctrl.S lda #PromptModeSave
>STA.G PromptMode >STA.G PromptMode
>LDA.G hFileName >LDA.G hFileName
beq .2 beq .2
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA ZPPTR1 >STYA ZPPTR1
ldy #$ff ldy #$ff
.1 iny .1 iny
lda (ZPPTR1),y lda (ZPPTR1),y
sta (pData),y sta (pData),y
bne .1 bne .1
tya tya
.2 >STA.G PromptBufPtr .2 >STA.G PromptBufPtr
@ -332,10 +347,13 @@ Ctrl.S lda #PromptModeSave
*-------------------------------------- *--------------------------------------
Ctrl.T >STZ.G FileX Ctrl.T >STZ.G FileX
>STZW.G FileY >STZW.G FileY
>DEBUG
jsr BUF.ComputeCOffset
jmp SCRN.UpdateViewPort jmp SCRN.UpdateViewPort
*-------------------------------------- *--------------------------------------
Ctrl.FS jsr BUF.GetLine Ctrl.FS jsr BUF.GetLine
bcs .8 bcs .8
tya Y = line length tya Y = line length
ldy #FileX ldy #FileX
cmp (pData),y cmp (pData),y
@ -345,28 +363,17 @@ Ctrl.FS jsr BUF.GetLine
inc inc
sta (pData),y sta (pData),y
bra .3 bra .3
.1 ldy #FileY+1
lda (pData),y .1 jsr BUF.GetNextLine
tax
dey
lda (pData),y
inc
bne .2
inx
.2 jsr BUF.GetLineAX
bcs .8 bcs .8
ldy #FileY CC
lda (pData),y >INCW.G FileY
adc #1
sta (pData),y >STZ.G FileX
iny
lda (pData),y .3 jsr BUF.ComputeCOffset
adc #0
sta (pData),y jmp SCRN.UpdateViewPort
ldy #FileX
lda #0
sta (pData),y
.3 jmp SCRN.UpdateViewPort
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
@ -424,26 +431,23 @@ Ctrl.Y ldy #FileY+1
lda (pData),y lda (pData),y
inc inc
bne .1 bne .1
inx inx
.1 jsr BUF.GetLineAX .1 jsr BUF.GetLineAX
bcs .2 bcs .2
ldy #FileY >INCW.G FileY
lda (pData),y
inc
sta (pData),y
bne Ctrl.Y
iny
lda (pData),y
inc
sta (pData),y
bra Ctrl.Y bra Ctrl.Y
.2 jsr BUF.GetLine .2 jsr BUF.GetLine
tya Y = line length tya Y = line length
>STA.G FileX >STA.G FileX
jsr BUF.ComputeCOffset
jmp SCRN.UpdateViewPort jmp SCRN.UpdateViewPort
*-------------------------------------- *--------------------------------------
Ctrl.Z jsr BUF.ComputeCOffset Ctrl.Z jsr BUF.ComputeCOffset
@ -454,6 +458,7 @@ Ctrl.Z jsr BUF.ComputeCOffset
lda BUF.COffset+1 lda BUF.COffset+1
eor BufLen+1 eor BufLen+1
bne .1 bne .1
clc clc
rts rts
@ -492,6 +497,7 @@ Prompt.Replace cmp #3
jsr SCRN.UpdateStatusBar jsr SCRN.UpdateStatusBar
bcs .9 bcs .9
rts rts
.1 cmp #C.CR .1 cmp #C.CR
bne .2 bne .2
.2 .2
@ -505,6 +511,7 @@ Prompt.Save cmp #3 Ctrl-C
>STZ.G PromptMode >STZ.G PromptMode
bra .80 bra .80
.1 cmp #C.CR .1 cmp #C.CR
bne .2 bne .2
>LDA.G PromptBufPtr >LDA.G PromptBufPtr
@ -522,9 +529,10 @@ Prompt.Save cmp #3 Ctrl-C
>STZ.G PromptMode >STZ.G PromptMode
jsr SaveFile jsr SaveFile
bcc .81 bcc .81
.12 jsr SCRN.UpdateStatusBarErrA
bcs .9 .12 jsr SCRN.LineBufInit
rts jmp SCRN.UpdateStatusBarErrA
.2 cmp #C.DEL .2 cmp #C.DEL
bne .3 bne .3
>LDA.G PromptBufPtr >LDA.G PromptBufPtr
@ -538,12 +546,14 @@ Prompt.Save cmp #3 Ctrl-C
bra .80 bra .80
.3 cmp #C.SPACE .3 cmp #C.SPACE
bcc .8 bcc .8
pha pha
>LDA.G PromptBufPtr >LDA.G PromptBufPtr
tay tay
pla pla
cpy #PromptBufMax cpy #PromptBufMax
beq .8 beq .8
sta (pData),y sta (pData),y
iny iny
lda #0 lda #0
@ -551,8 +561,10 @@ Prompt.Save cmp #3 Ctrl-C
tya tya
>STA.G PromptBufPtr >STA.G PromptBufPtr
bra .80 bra .80
.8 clc .8 clc
rts rts
.81 jsr SCRN.UpdateTopBar .81 jsr SCRN.UpdateTopBar
bcs .9 bcs .9
.80 jmp SCRN.UpdateStatusBar .80 jmp SCRN.UpdateStatusBar

View File

@ -16,6 +16,7 @@ SCRN.Init >LDYAI 510+5+5+4+1 potentially 255*\\ NORM,INV,CEOL & \0
>LDYA L.SEQ.INIT >LDYA L.SEQ.INIT
>SYSCALL printf >SYSCALL printf
bcs .9 bcs .9
lda #0 lda #0
ldy #FileX ldy #FileX
@ -41,21 +42,49 @@ SCRN.Init >LDYAI 510+5+5+4+1 potentially 255*\\ NORM,INV,CEOL & \0
jsr SCRN.UpdateMain jsr SCRN.UpdateMain
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
SCRN.UpdateTopBar SCRN.UpdateTopBar
lda #1 jsr SCRN.LineBufInit
jsr SCRN.InvLineA
>PUSHBI 1
>PUSHBI 1
>PUSHBI 2
>LDYA L.MSG.GOTOXY
>SYSCALL printf
bcs .9 bcs .9
>LDA.G hFileName >LDA.G hFileName
beq .1 beq .1
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
bra .2 bra .2
.1 >LDYA L.MSG.NEWFILE .1 >LDYA L.MSG.NEWFILE
.2 >PUSHYA .2 >PUSHYA
>PUSHBI 2 >PUSHBI 2
>LDYA L.MSG.TOPBAR >PUSHW L.MSG.TOPBAR
>SYSCALL printf >LDYA ZPPTR1
.9 rts >SYSCALL sprintf
bcs .9
>LDA.G bSaved
bne .8
ldy #255
.3 iny
lda (ZPPTR1),y
bne .3
lda #"*"
sta (ZPPTR1),y
iny
lda #0
sta (ZPPTR1),y
.8 jmp SCRN.LineBufOutBar
.9 rts
*-------------------------------------- *--------------------------------------
SCRN.UpdateMain >LDA.G ScreenY SCRN.UpdateMain >LDA.G ScreenY
sta TmpIndex sta TmpIndex
@ -67,6 +96,7 @@ SCRN.UpdateMain >LDA.G ScreenY
sta TmpByte sta TmpByte
>LDA.G ViewPortH >LDA.G ViewPortH
sta TmpCount sta TmpCount
.1 lda TmpIndex .1 lda TmpIndex
ldx TmpIndex+1 ldx TmpIndex+1
jsr BUF.GetLineAX Y = line length jsr BUF.GetLineAX Y = line length
@ -75,24 +105,31 @@ SCRN.UpdateMain >LDA.G ScreenY
lda TmpByte lda TmpByte
jsr SCRN.UpdateLineAtALenY jsr SCRN.UpdateLineAtALenY
bcs SCRN.UpdateMain.9 bcs SCRN.UpdateMain.9
.3 inc TmpByte .3 inc TmpByte
inc TmpIndex inc TmpIndex
bne .4 bne .4
inc TmpIndex+1 inc TmpIndex+1
.4 dec TmpCount .4 dec TmpCount
bne .1 bne .1
jmp SCRN.GotoCurXCurY jmp SCRN.GotoCurXCurY
.5 ldx #0 .5 ldx #0
ldy TmpByte ldy TmpByte
jsr GotoXY jsr SCRN.GotoXY
bcs SCRN.UpdateMain.9 bcs SCRN.UpdateMain.9
>PUSHBI 0 >PUSHBI 0
>LDYA L.SEQ.CEOL >LDYA L.SEQ.CEOL
>SYSCALL printf >SYSCALL printf
bcs SCRN.UpdateMain.9 bcs SCRN.UpdateMain.9
inc TmpByte inc TmpByte
dec TmpCount dec TmpCount
bne .5 bne .5
jmp SCRN.GotoCurXCurY jmp SCRN.GotoCurXCurY
SCRN.UpdateMain.9 SCRN.UpdateMain.9
@ -122,15 +159,27 @@ SCRN.UpdateLineAtALenY
sty TmpLen sty TmpLen
ldx #0 ldx #0
tay tay
jsr GotoXY jsr SCRN.GotoXY
bcs SCRN.UpdateMain.9 bcs SCRN.UpdateMain.9
>LDYA LineBufPtr
>STYA ZPPTR1 jsr SCRN.LineBufInit
ldy #$ff
.10 iny
lda SEQ.EDIT,y
beq .11
jsr SCRN.ToLineBuf
bra .10
.11 ldy #0
>LDA.G ScreenW >LDA.G ScreenW
tax tax
>LDA.G ScreenX >LDA.G ScreenX
cmp TmpLen cmp TmpLen
bcs .8 bcs .8
tay tay
clc clc
adc BUF.LOffset adc BUF.LOffset
@ -138,6 +187,7 @@ SCRN.UpdateLineAtALenY
lda #0 lda #0
adc BUF.LOffset+1 adc BUF.LOffset+1
sta BUF.COffset+1 sta BUF.COffset+1
tya tya
* clc * clc
adc BufPtr adc BufPtr
@ -147,43 +197,45 @@ SCRN.UpdateLineAtALenY
.1 lda (BufPtr) .1 lda (BufPtr)
beq .8 beq .8
cmp #C.CR cmp #C.CR
beq .8 beq .8
jsr BUF.CheckSelected jsr BUF.CheckSelected
eor bSelected eor bSelected
bpl .5 bpl .5
jsr SCRN.ToggleSel jsr SCRN.ToggleSel
.5 lda (BufPtr) .5 lda (BufPtr)
cmp #'\' cmp #'\'
beq .50 beq .50
cmp #'%' cmp #'%'
bne .51 bne .51
.50 pha .50 pha
lda #'\' lda #'\'
jsr SCRN.ToLineBuf jsr SCRN.ToLineBuf
pla pla
.51 jsr SCRN.ToLineBuf .51 jsr SCRN.ToLineBuf
inc BufPtr inc BufPtr
bne .6 bne .6
inc BufPtr+1 inc BufPtr+1
.6 inc BUF.COffset .6 inc BUF.COffset
bne .7 bne .7
inc BUF.COffset+1 inc BUF.COffset+1
.7 dex .7 dex
bne .1 bne .1
.8 bit bSelected .8 bit bSelected
bpl .80 bpl .80
jsr SCRN.ToggleSel jsr SCRN.ToggleSel
.80 ldy #0 .80 lda #0
.81 lda SEQ.CEOL,y
beq .82
jsr SCRN.ToLineBuf jsr SCRN.ToLineBuf
iny
bra .81
.82 sta (ZPPTR1)
>PUSHBI 0 >PUSHBI 0
>LDYA LineBufPtr >LDYA LineBufPtr
>SYSCALL printf >SYSCALL printf
@ -194,6 +246,7 @@ SCRN.ToggleSel ldy #0
eor #$ff eor #$ff
sta bSelected sta bSelected
bpl .1 bpl .1
ldy #6 ldy #6
.1 lda SEQ.NORM,y .1 lda SEQ.NORM,y
@ -202,88 +255,99 @@ SCRN.ToggleSel ldy #0
iny iny
bra .1 bra .1
.8 rts .8
*-------------------------------------- SCRN.ToggleSel.RTS
SCRN.ToLineBuf sta (ZPPTR1) rts
inc ZPPTR1
bne .8
inc ZPPTR1+1
.8 rts
*-------------------------------------- *--------------------------------------
SCRN.UpdateStatusBar SCRN.UpdateStatusBar
jsr SCRN.LineBufInit
>PUSHBI 1 >PUSHBI 1
>PUSHB.G ScreenH >PUSHB.G ScreenH
>PUSHBI 2 >PUSHBI 2
>LDYA L.MSG.GOTOXY >LDYA L.MSG.GOTOXY
>SYSCALL printf >SYSCALL printf
bcs .9 bcs SCRN.ToggleSel.RTS
>PUSHBI 0
>LDYA L.SEQ.INV
>SYSCALL printf
bcs .9
>LDA.G PromptMode >LDA.G PromptMode
bne .2 bne .2
>LDA.G FileY >LDA.G FileY
tax tax
iny iny
lda (pData),y lda (pData),y
inx inx
bne .1 bne .1
inc inc
.1 >PUSHA .1 >PUSHA
txa txa
>PUSHA >PUSHA
>LDA.G FileX >LDA.G FileX
inc inc
>PUSHA >PUSHA
>PUSHW BUF.COffset
>PUSHW BufLen >PUSHW BufLen
>PUSHBI 5 >PUSHBI 7
>LDYA L.MSG.STATUSBAR bra SCRN.UpdateStatusBarOut
>SYSCALL printf *--------------------------------------
bcs .9 .2 eor #PromptModeHelp
lda #58 beq .3
jsr SCRN.ClearEOLA
bcs .9 >PUSHW pData
>PUSHBI 0 lda #2
>LDYA L.SEQ.NORM .3 >PUSHA
bra SCRN.UpdateStatusBarOut
*--------------------------------------
SCRN.UpdateStatusBarErrA
>PUSHA
>PUSHBI 1
ldx #10
bra SCRN.UpdateStatusBarOutErr
SCRN.UpdateStatusBarOut
ldy #PromptMode
lda (pData),y
tax
SCRN.UpdateStatusBarOutErr
>PUSHW L.MSG.STATUSBAR,x
>LDYA ZPPTR1
>SYSCALL sprintf
SCRN.LineBufOutBar
>LDA.G ScreenW
tax
ldy #0
.1 lda (ZPPTR1),y
beq .2
iny
dex
bne .1
bra .4
.2 lda #C.SPACE
.3 sta (ZPPTR1),y
iny
dex
bne .3
lda #0
sta (ZPPTR1),y
.4 >PUSHW LineBufPtr
>PUSHBI 2
>LDYA L.SEQ.BAR
>SYSCALL printf >SYSCALL printf
bcs .9 bcs .9
jmp SCRN.GotoCurXCurY jmp SCRN.GotoCurXCurY
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
.2 eor #PromptModeHelp
beq .3
>PUSHW pData
lda #2
.3 >PUSHA
>LDA.G ScreenH
jsr SCRN.InvLineA
bcs .9
ldy #PromptMode
lda (pData),y
tax
>LDYA L.MSG.STATUSBAR,x
>SYSCALL printf
bcs .9
rts
*--------------------------------------
SCRN.UpdateStatusBarErrA
pha
ldy #ScreenH
lda (pData),y
dec
jsr SCRN.InvLineA
pla
>PUSHA
>PUSHBI 1
>LDYA L.MSG.STATUSBAR.E
>SYSCALL printf
rts
*--------------------------------------
SCRN.CursorAdjust SCRN.CursorAdjust
.1 jsr BUF.ComputeCOffset .1 jsr BUF.ComputeCOffset
bcc .8 bcc .8
@ -294,53 +358,16 @@ SCRN.CursorAdjust
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
SCRN.ClearEOLA pha SCRN.LineBufInit
>LDYA LineBufPtr
.1 pla >STYA ZPPTR1
ldy #ScreenW
cmp (pData),y
bcs .8
inc
pha
lda #' '
>SYSCALL PutChar
bcc .1
plx
rts rts
.8 clc
.9 rts
*-------------------------------------- *--------------------------------------
SCRN.InvLineA sta .2+1 SCRN.ToLineBuf sta (ZPPTR1)
lda #1 inc ZPPTR1
>PUSHA bne .8
lda .2+1 inc ZPPTR1+1
>PUSHA .8 rts
>PUSHBI 2
>LDYA L.MSG.GOTOXY
>SYSCALL printf
bcs .9
>PUSHBI 0
>LDYA L.SEQ.INV
>SYSCALL printf
bcs .9
ldy #ScreenW
lda (pData),y
.1 pha
lda #' '
>SYSCALL PutChar
pla
bcs .9
dec
bne .1
lda #1
>PUSHA
.2 lda #$ff
>PUSHA
>PUSHBI 2
>LDYA L.MSG.GOTOXY
>SYSCALL printf
.9 rts
*-------------------------------------- *--------------------------------------
SCRN.GotoCurXCurY SCRN.GotoCurXCurY
ldy #CurX ldy #CurX
@ -349,7 +376,8 @@ SCRN.GotoCurXCurY
ldy #CurY ldy #CurY
lda (pData),y lda (pData),y
tay tay
GotoXY txa
SCRN.GotoXY txa
inc inc
>PUSHA >PUSHA
tya tya
@ -359,22 +387,25 @@ GotoXY txa
>PUSHBI 2 >PUSHBI 2
>LDYA L.MSG.GOTOXY >LDYA L.MSG.GOTOXY
>SYSCALL printf >SYSCALL printf
GotoXY.RTS rts SCRN.GotoXY.RTS rts
*-------------------------------------- *--------------------------------------
SCRN.UpdateViewPort SCRN.UpdateViewPort
lda #$ff lda #$ff
sta bNotRepaint sta bNotRepaint
.1 ldy #FileX .1 ldy #FileX
lda (pData),y lda (pData),y
ldy #ScreenX ldy #ScreenX
cmp (pData),y cmp (pData),y
bcs .2 out of left border ? bcs .2 out of left border ?
ldy #ScreenX yes ldy #ScreenX yes
lda (pData),y lda (pData),y
dec dec
sta (pData),y sta (pData),y
stz bNotRepaint stz bNotRepaint
bra .1 bra .1
.2 clc .2 clc
ldy #ScreenX ldy #ScreenX
lda (pData),y lda (pData),y
@ -384,12 +415,14 @@ SCRN.UpdateViewPort
ldy #FileX ldy #FileX
cmp (pData),y cmp (pData),y
bcs .3 out of right border ? bcs .3 out of right border ?
ldy #ScreenX ldy #ScreenX
lda (pData),y lda (pData),y
inc inc
sta (pData),y sta (pData),y
stz bNotRepaint stz bNotRepaint
bra .2 bra .2
.3 ldy #FileY+1 .3 ldy #FileY+1
lda (pData),y lda (pData),y
tax tax
@ -401,6 +434,7 @@ SCRN.UpdateViewPort
txa txa
sbc (pData),y sbc (pData),y
bcs .4 out of top border ? bcs .4 out of top border ?
ldy #ScreenY move viewport up one line.... ldy #ScreenY move viewport up one line....
lda (pData),y lda (pData),y
sbc #0 CC from BCS sbc #0 CC from BCS
@ -411,8 +445,10 @@ SCRN.UpdateViewPort
sta (pData),y sta (pData),y
bit bNotRepaint bit bNotRepaint
bpl .3 bpl .3
jsr SCRN.scrollDn ...and move content one line down jsr SCRN.scrollDn ...and move content one line down
bcs GotoXY.RTS bcs SCRN.GotoXY.RTS
.4 ldy #ScreenY+1 .4 ldy #ScreenY+1
lda (pData),y lda (pData),y
tax tax
@ -422,13 +458,16 @@ SCRN.UpdateViewPort
clc clc
adc (pData),y adc (pData),y
bcc .41 bcc .41
inx inx
.41 ldy #FileY A,X = screen bottom .41 ldy #FileY A,X = screen bottom
cmp (pData),y cmp (pData),y
txa txa
iny FileY > screen bottom ? iny FileY > screen bottom ?
sbc (pData),y sbc (pData),y
bcs .5 CS : fileY>= screen bottom bcs .5 CS : fileY>= screen bottom
* clc from BCS * clc from BCS
ldy #ScreenY move viewport down one line.... ldy #ScreenY move viewport down one line....
lda (pData),y lda (pData),y
@ -440,9 +479,11 @@ SCRN.UpdateViewPort
sta (pData),y sta (pData),y
bit bNotRepaint bit bNotRepaint
bpl .4 bpl .4
jsr SCRN.scrollUp ...and move content one line up jsr SCRN.scrollUp ...and move content one line up
bcs .9 bcs .9
bra .4 bra .4
.5 sec .5 sec
ldy #FileX ldy #FileX
lda (pData),y lda (pData),y
@ -459,10 +500,13 @@ SCRN.UpdateViewPort
sta (pData),y sta (pData),y
bit bNotRepaint bit bNotRepaint
bmi .6 bmi .6
jsr SCRN.UpdateMain jsr SCRN.UpdateMain
bcs .9 bcs .9
.6 jsr SCRN.UpdateStatusBar .6 jsr SCRN.UpdateStatusBar
bcs .9 bcs .9
jmp SCRN.GotoCurXCurY jmp SCRN.GotoCurXCurY
.9 rts .9 rts
*-------------------------------------- *--------------------------------------

View File

@ -24,19 +24,20 @@ BUF.TmpLine2 .BS 2
BufLen .BS 2 BufLen .BS 2
SelLen .BS 2 SelLen .BS 2
bNotRepaint .BS 1
bSelected .BS 1
ZPPTR1 .BS 2
TmpLen .BS 2 TmpLen .BS 2
TmpIndex .BS 2 TmpIndex .BS 2
ZPPTR1 .BS 2
TmpCount .BS 1 TmpCount .BS 1
TmpByte .BS 1 TmpByte .BS 1
bNotRepaint .BS 1
bSelected .BS 1
ZS.END .ED ZS.END .ED
*-------------------------------------- *--------------------------------------
PromptBufMax .EQ 64 PromptBufMax .EQ 64
*--------------------------------------
PromptModeHelp .EQ 2 PromptModeHelp .EQ 2
PromptModeFind .EQ 4 PromptModeFind .EQ 4
PromptModeReplace .EQ 6 PromptModeReplace .EQ 6
@ -67,16 +68,15 @@ L.SEQ.INIT .DA SEQ.INIT
L.SEQ.RESET .DA SEQ.RESET L.SEQ.RESET .DA SEQ.RESET
L.SEQ.SCROLLUP .DA SEQ.SCROLLUP L.SEQ.SCROLLUP .DA SEQ.SCROLLUP
L.SEQ.SCROLLDN .DA SEQ.SCROLLDN L.SEQ.SCROLLDN .DA SEQ.SCROLLDN
L.SEQ.INV .DA SEQ.INV
L.SEQ.NORM .DA SEQ.NORM
L.SEQ.CEOL .DA SEQ.CEOL L.SEQ.CEOL .DA SEQ.CEOL
L.SEQ.BAR .DA SEQ.BAR
L.MSG.TOPBAR .DA MSG.TOPBAR L.MSG.TOPBAR .DA MSG.TOPBAR
L.MSG.STATUSBAR .DA MSG.STATUSBAR L.MSG.STATUSBAR .DA MSG.STATUSBAR
L.MSG.STATUSBAR.H .DA MSG.STATUSBAR.H .DA MSG.STATUSBAR.H
L.MSG.STATUSBAR.F .DA MSG.STATUSBAR.F .DA MSG.STATUSBAR.F
L.MSG.STATUSBAR.R .DA MSG.STATUSBAR.R .DA MSG.STATUSBAR.R
L.MSG.STATUSBAR.S .DA MSG.STATUSBAR.S .DA MSG.STATUSBAR.S
L.MSG.STATUSBAR.E .DA MSG.STATUSBAR.E .DA MSG.STATUSBAR.E
L.MSG.NEWFILE .DA MSG.NEWFILE L.MSG.NEWFILE .DA MSG.NEWFILE
L.MSG.GOTOXY .DA MSG.GOTOXY L.MSG.GOTOXY .DA MSG.GOTOXY
L.MSG.HELPLINE .DA MSG.HELPLINE L.MSG.HELPLINE .DA MSG.HELPLINE
@ -127,11 +127,14 @@ CS.RUN >PUSHBI 0
>LDYA L.SEQ.DETECT >LDYA L.SEQ.DETECT
>SYSCALL printf Send Query for term W & H >SYSCALL printf Send Query for term W & H
bcs CS.RUN.RTS bcs CS.RUN.RTS
.1 >SYSCALL GetChar .1 >SYSCALL GetChar
bcs CS.RUN.RTS bcs CS.RUN.RTS
jsr CharIn jsr CharIn
>LDA.G ScreenW Wait for Response from terminal for W & H >LDA.G ScreenW Wait for Response from terminal for W & H
beq .1 beq .1
lda #1 lda #1
>SYSCALL ArgV >SYSCALL ArgV
bcs .2 No arg, new file.... bcs .2 No arg, new file....
@ -143,23 +146,30 @@ CS.RUN >PUSHBI 0
cmp #E.OOM cmp #E.OOM
beq CS.RUN.RTS beq CS.RUN.RTS
.2 >LDYAI 1 buffer size = 0 (+ 1 for ending 0) .2 >LDYAI 1 buffer size = 0 (+ 1 for ending 0)
>SYSCALL GetMem0 >SYSCALL GetMem0
bcs CS.RUN.RTS bcs CS.RUN.RTS
txa txa
>STA.G hBuffer BufLen already set to 0 >STA.G hBuffer BufLen already set to 0
.3 lda #$ff .3 lda #$ff
>STA.G bSaved >STA.G bSaved
jsr SCRN.Init jsr SCRN.Init
bcs CS.RUN.RTS bcs CS.RUN.RTS
CS.RUN.LOOP >SYSCALL GetChar CS.RUN.LOOP >SYSCALL GetChar
bcs CS.RUN.RTS I/O error bcs CS.RUN.RTS I/O error
jsr CharIn jsr CharIn
bcs .9 bcs .9
>LDA.G bCancel >LDA.G bCancel
bpl CS.RUN.LOOP bpl CS.RUN.LOOP
lda #0 lda #0
.9 pha .9 pha
>PUSHBI 0 >PUSHBI 0
>LDYA L.SEQ.RESET >LDYA L.SEQ.RESET
@ -212,6 +222,7 @@ CharIn tax
bcc .8 bcc .8
jsr CharIn.Esc jsr CharIn.Esc
bcs .8 Not translated, exit bcs .8 Not translated, exit
.1 cmp #C.ESC .1 cmp #C.ESC
bne .2 bne .2
@ -222,6 +233,7 @@ CharIn tax
.8 clc .8 clc
rts rts
.2 pha .2 pha
>LDA.G PromptMode >LDA.G PromptMode
tax tax
@ -229,6 +241,7 @@ CharIn tax
jmp (J.PROMPT,x) jmp (J.PROMPT,x)
*-------------------------------------- *--------------------------------------
CharIn.Esc >STZ.G bEscMode CharIn.Esc >STZ.G bEscMode
ldy #EscBuffer ldy #EscBuffer
lda (pData),y lda (pData),y
clc clc
@ -236,23 +249,30 @@ CharIn.Esc >STZ.G bEscMode
tay tay
lda (pData),y lda (pData),y
ldx EscChars ldx EscChars
.1 cmp EscChars,x
.1 cmp EscChars,x
beq .2 beq .2
dex dex
bne .1 bne .1
cmp #'R' Response to cursor position query? cmp #'R' Response to cursor position query?
beq .3 beq .3
sec sec
rts rts
.2 lda EscAscii,x .2 lda EscAscii,x
clc clc
rts rts
.3 stz TmpByte .3 stz TmpByte
ldy #EscBuffer+1 ldy #EscBuffer+1
.4 lda (pData),y .4 lda (pData),y
cmp #';' cmp #';'
beq .5 beq .5
and #$0f and #$0f
pha pha
lda TmpByte lda TmpByte
@ -268,24 +288,30 @@ CharIn.Esc >STZ.G bEscMode
sta TmpByte sta TmpByte
iny iny
bra .4 bra .4
.5 phy .5 phy
lda TmpByte lda TmpByte
ldy #ScreenH >STA.G ScreenH
sta (pData),y
dec Remove 2 (top & status bar) for viewportH dec Remove 2 (top & status bar) for viewportH
dec dec
ldy #ViewPortH
sta (pData),y >STA.G ViewPortH
dec dec
ldy #ViewPortHm1 Remove 1 more to store offsert to last line of viewport
sta (pData),y >STA.G ViewPortHm1 Remove 1 more to store offsert to last line of viewport
ply ply
stz TmpByte stz TmpByte
iny iny
.6 lda (pData),y .6 lda (pData),y
cmp #'R' cmp #'R'
beq .7 beq .7
and #$0f and #$0f
pha pha
lda TmpByte lda TmpByte
@ -301,9 +327,10 @@ CharIn.Esc >STZ.G bEscMode
sta TmpByte sta TmpByte
iny iny
bra .6 bra .6
.7 lda TmpByte .7 lda TmpByte
ldy #ScreenW >STA.G ScreenW
sta (pData),y
sec sec
rts rts
*-------------------------------------- *--------------------------------------
@ -327,17 +354,22 @@ LoadFile >PUSHWZ Aux type
ldy #0 ldy #0
ldx #0 ldx #0
.1 lda (BufPtrBackup),y .1 lda (BufPtrBackup),y
beq .8 beq .8
cpx #C.CR cpx #C.CR
bne .2 bne .2
cmp #C.LF cmp #C.LF
beq .5 beq .5
.2 cmp #C.SPACE .2 cmp #C.SPACE
bcs .3 bcs .3
cmp #C.CR cmp #C.CR
bne .5 bne .5
.3 sta (BufPtr) .3 sta (BufPtr)
inc BufPtr inc BufPtr
bne .4 bne .4
@ -345,16 +377,19 @@ LoadFile >PUSHWZ Aux type
.4 inc BufLen .4 inc BufLen
bne .5 bne .5
inc BufLen+1 inc BufLen+1
.5 tax set previous char .5 tax set previous char
iny iny
bne .1 bne .1
inc BufPtrBackup+1 inc BufPtrBackup+1
bra .1 bra .1
.8 sta (BufPtr) .8 sta (BufPtr)
clc clc
.9 jmp BUF.ResetSel .9 jmp BUF.ResetSel
*-------------------------------------- *--------------------------------------
SaveFile >PUSHWZ Aux type SaveFile >PUSHWZ Aux type
>PUSHBI S.FI.T.TXT >PUSHBI S.FI.T.TXT
>PUSHBI O.CREATE+O.WRONLY >PUSHBI O.CREATE+O.WRONLY
>LDA.G hFileName >LDA.G hFileName
@ -380,9 +415,14 @@ SaveFile >PUSHWZ Aux type
pla pla
sec sec
rts rts
.1 pla .1 pla
>SYSCALL FClose.9 >SYSCALL FClose
rts
lda #$80
>STA.G bSaved
jsr SCRN.UpdateTopBar
.9 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
@ -394,18 +434,20 @@ SEQ.INIT .AZ "\ec\e[?7l\e[2;%dr"
SEQ.RESET .AZ "\ec" SEQ.RESET .AZ "\ec"
SEQ.SCROLLUP .AZ "\e[%d;%dH\eD" SEQ.SCROLLUP .AZ "\e[%d;%dH\eD"
SEQ.SCROLLDN .AZ "\e[%d;%dH\eM" SEQ.SCROLLDN .AZ "\e[%d;%dH\eM"
SEQ.BAR .AS "\e[40;37m\e[7m%s" +SEQ.NORM
SEQ.NORM .AZ "\e[0m" SEQ.NORM .AZ "\e[0m"
SEQ.INV .AZ "\e[7m" SEQ.INV .AZ "\e[7m"
SEQ.EDIT .AS "\e[93;44m" +SEQ.CEOL
SEQ.CEOL .AZ "\e[K" SEQ.CEOL .AZ "\e[K"
MSG.TOPBAR .AZ "\e[1;1HA2osX Edit:%s\e[0m" MSG.TOPBAR .AZ "A2osX Edit:%s"
MSG.STATUSBAR .AZ "Press Ctrl-A For Help Length:%5D,Col:%3d,Line:%5D" MSG.STATUSBAR .AZ "(Press Ctrl-A For Help) Len: %5D Pos: %5D Col: %3d Line: %5D"
MSG.STATUSBAR.H .AZ "Press any key to exit this screen:" MSG.STATUSBAR.H .AZ "Press any key to exit this screen:"
MSG.STATUSBAR.F .AZ "Find:%s" MSG.STATUSBAR.F .AZ "Find:%s"
MSG.STATUSBAR.R .AZ "Replace:%s" MSG.STATUSBAR.R .AZ "Replace:%s"
MSG.STATUSBAR.S .AZ "Save:%s" MSG.STATUSBAR.S .AZ "Save (Ctrl-C):%s"
MSG.STATUSBAR.E .AZ "Error:%h" MSG.STATUSBAR.E .AZ "Error:%h"
MSG.GOTOXY .AZ "\e[%d;%dH" MSG.GOTOXY .AZ "\e[%d;%dH"
MSG.HELPLINE .AZ "%S\e[K" MSG.HELPLINE .AZ "\e[93;44m%S\e[K"
MSG.HELP >PSTR "All commands: (* = Not yet implemented)" MSG.HELP >PSTR "All commands: (* = Not yet implemented)"
>PSTR "------------" >PSTR "------------"
>PSTR " Ctrl-A : This help screen" >PSTR " Ctrl-A : This help screen"

View File

@ -48,7 +48,7 @@ CL.READN0A >PUSHA
CL.CHARIN tax CL.CHARIN tax
>LDA.G CL.bEscMode \e ? >LDA.G CL.bEscMode \e ?
beq .13 beq .4
cpx #'[' cpx #'['
beq .8 \e[ beq .8 \e[
@ -59,40 +59,40 @@ CL.CHARIN tax
ldx #EscChars.Cnt-1 ldx #EscChars.Cnt-1
.17 cmp EscChars,x .1 cmp EscChars,x
beq .18 beq .2
dex dex
bpl .17 bpl .1
.8 rts invalid \e[ sequence .8 rts invalid \e[ sequence
.18 >LDA.G READ.N .2 >LDA.G READ.N
bne .19 bne .3
lda EscChars.Remap,x lda EscChars.Remap,x
bra CL.READN0A bra CL.READN0A
.19 txa .3 txa
asl asl
tax tax
jmp (J.ESC,x) jmp (J.ESC,x)
*-------------------------------------- *--------------------------------------
.13 cpx #C.ESC .4 cpx #C.ESC
bne .11 bne .5
lda #$ff lda #$ff
>STA.G CL.bEscMode >STA.G CL.bEscMode
clc clc
rts rts
.11 >LDA.G READ.N .5 >LDA.G READ.N
beq CL.READN0X beq CL.READN0X
cpx #C.SPACE cpx #C.SPACE
bcc CL.CHARIN.CTRL bcc CL.CHARIN.CTRL
.1 cpx #C.DEL cpx #C.DEL
bne CL.Insert bne CL.Insert
*-------------------------------------- *--------------------------------------
* Erase char BEFORE cursor * Erase char BEFORE cursor
@ -102,10 +102,13 @@ CL.CHARIN tax
>LDA.G CL.Ptr >LDA.G CL.Ptr
beq .8 beq .8
>LDA.G bREAD.S
bmi .6
lda #C.BS lda #C.BS
>SYSCALL PutChar >SYSCALL PutChar
>DEC.G CL.Ptr .6 >DEC.G CL.Ptr
jmp CL.DEL jmp CL.DEL
*-------------------------------------- *--------------------------------------
CL.Insert >LDA.G CL.Len CL.Insert >LDA.G CL.Len
@ -116,6 +119,7 @@ CL.Insert >LDA.G CL.Len
>STA.G CL.Len >STA.G CL.Len
pha pha
.1 ply .1 ply
dey dey
lda (ZPCLBuf),y Move from Ptr To end of buffer forward... lda (ZPCLBuf),y Move from Ptr To end of buffer forward...
@ -128,6 +132,7 @@ CL.Insert >LDA.G CL.Len
bne .1 bne .1
ply Y=CL.Ptr ply Y=CL.Ptr
* >LDA.G CL.Ptr * >LDA.G CL.Ptr
txa txa
@ -136,6 +141,7 @@ CL.Insert >LDA.G CL.Len
>LDA.G bREAD.S >LDA.G bREAD.S
bmi .7 bmi .7
txa txa
>SYSCALL PutChar >SYSCALL PutChar
jsr CL.PrintEOL jsr CL.PrintEOL
@ -143,8 +149,10 @@ CL.Insert >LDA.G CL.Len
.7 >LDA.G READ.N READ N = 1, don't wait for CR .7 >LDA.G READ.N READ N = 1, don't wait for CR
dec dec
bne .8 bne .8
lda #$ff lda #$ff
>STA.G CL.bReady >STA.G CL.bReady
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
@ -207,10 +215,13 @@ CL.RESET.1 >STA.G CL.Ptr
*-------------------------------------- *--------------------------------------
CL.BS >LDA.G CL.Ptr CL.BS >LDA.G CL.Ptr
beq .9 beq .9
dec dec
sta (pData),y sta (pData),y
>LDA.G bREAD.S >LDA.G bREAD.S
bmi .9 bmi .9
lda #C.BS lda #C.BS
>SYSCALL PutChar >SYSCALL PutChar
.9 rts .9 rts
@ -248,6 +259,10 @@ CL.DEL pha
bne .1 bne .1
pla pla
>DEC.G CL.Len >DEC.G CL.Len
>LDA.G bREAD.S
bpl CL.PrintEOL
clc
rts
*-------------------------------------- *--------------------------------------
CL.PrintEOL >LDA.G CL.Ptr CL.PrintEOL >LDA.G CL.Ptr
.1 >CMP.G CL.Len .1 >CMP.G CL.Len

View File

@ -354,6 +354,7 @@ CMD.ECHO.RTS rts
*-------------------------------------- *--------------------------------------
CMD.READ lda (ZPArgVBufPtr) CMD.READ lda (ZPArgVBufPtr)
beq .9 beq .9
stz ZPVarNamePtr+1 stz ZPVarNamePtr+1
>STZ.G bREAD.S >STZ.G bREAD.S
dec dec
@ -406,6 +407,7 @@ CMD.READ lda (ZPArgVBufPtr)
beq .9 beq .9
CMD.READ.VAR jsr CL.Reset CMD.READ.VAR jsr CL.Reset
.1 >SYSCALL GetChar .1 >SYSCALL GetChar
bcs CMD.READ.VAR.9 bcs CMD.READ.VAR.9

View File

@ -25,7 +25,7 @@ drivertbl2 .DA nodevice
.DA nodevice .DA nodevice
.DA nodevice .DA nodevice
.DA #0 devnum .DA #0 devnum
numdevs .DA #$ff count (-1) active devices GP.numdevs .DA #$ff count (-1) active devices
devlist .HS 00000000000000 up to 14 units may be active devlist .HS 00000000000000 up to 14 units may be active
.HS 00000000000000 .HS 00000000000000
.DA #0 .DA #0

View File

@ -6,35 +6,38 @@ ILDR.START jsr MLI check for file 'atinit'
.DA gfi_list .DA gfi_list
bcc gfi_ok branch if 'atinit' file found bcc gfi_ok branch if 'atinit' file found
cmp #$46 file not found? cmp #MLI.E.FNOTFND
beq H23DF if so, continue loading interpreter beq H23DF if so, continue loading interpreter
bne H23E2 bne H23E2
gfi_ok lda gfi_type gfi_ok lda gfi_type
cmp #$E2 is 'atinit' correct file type? cmp #$E2 is 'atinit' correct file type?
bne H23E2 error - wrong file type bne H23E2 error - wrong file type
jsr MLI open 'atinit' file jsr MLI open 'atinit' file
.DA #$C8 .DA #MLIOPEN
.DA atopen .DA atopen
bne H23E2 error bne H23E2 error
lda #$9F max size = 39.75k ($2000-$BF00) lda #$9F max size = 39.75k ($2000-$BF00)
sta rdlen+1 sta rdlen+1
stz rdlen stz rdlen
jsr MLI read 'atinit' file to 'sysentry' jsr MLI read 'atinit' file to 'sysentry'
.DA #$CA .DA #MLIREAD
.DA rdparm .DA rdparm
bne H23E2 error - too big bne H23E2 error - too big
jsr MLI close 'atinit' file jsr MLI close 'atinit' file
.DA #$CC .DA #MLICLOSE
.DA clparm .DA clparm
bne H23E2 error bne H23E2 error
lda RROMBNK2 enable ROM lda RROMBNK2 enable ROM
jsr sysentry execute ATinit jsr sysentry execute ATinit
H23DF jmp goloadint execute .system file
H23DF jmp ILDR.SYSTEM execute .system file
* fatal error * fatal error
H23E2 ldx $23F0 BUG: should be ATINIT.ERR H23E2 ldx ATINIT.ERR
H23E5 lda $23F0,x BUG: should be ATINIT.ERR H23E5 lda ATINIT.ERR,x
sta vline16,x sta vline16,x
dex dex
bne H23E5 bne H23E5
@ -54,11 +57,12 @@ atopen .HS 03
.HS 01 ref# hard coded since no other files .HS 01 ref# hard coded since no other files
atinitname .DA #06 length of name atinitname .DA #06 length of name
.AS -"atinit" name of appletalk config file .AS -"atinit" name of appletalk config file
goloadint *--------------------------------------
lda /dbuf search directory buffer ILDR.SYSTEM lda /dbuf search directory buffer
sta idxl+1 sta idxl+1
lda #$04 start 1 entry past header lda #$04 start 1 entry past header
bne H2434 always. bne H2434 always.
H2432 lda idxl calc next entry position H2432 lda idxl calc next entry position
H2434 clc H2434 clc
adc dbuf+35 inc to next entry address adc dbuf+35 inc to next entry address
@ -72,6 +76,7 @@ H2434 clc
cmp #$09 end of directory? cmp #$09 end of directory?
bne H244D no. bne H244D no.
jmp nointrp no interpreter, go quit. jmp nointrp no interpreter, go quit.
H244D lda #$04 reset index to 1st entry in next block. H244D lda #$04 reset index to 1st entry in next block.
sta idxl sta idxl
H2451 inc idxl+1 inc to next page. H2451 inc idxl+1 inc to next page.
@ -147,6 +152,7 @@ H24C8 jsr MLI close interpreter file
bne H24DF if not. bne H24DF if not.
sta KBDSTROBE clear keyboard sta KBDSTROBE clear keyboard
H24DF lda RROMBNK2 enable ROM H24DF lda RROMBNK2 enable ROM
jmp sysentry go run interpreter jmp sysentry go run interpreter
cflag .HS 00 set if a //c. cflag .HS 00 set if a //c.
@ -167,13 +173,17 @@ H24FA lda iomess,y
dex dex
dey dey
bpl H24FA bpl H24FA
bmi H2511 bra *
toolong ldy #$1E toolong ldy #$1E
H2508 lda lgmess,y H2508 lda lgmess,y
sta vline16+5,y sta vline16+5,y
dey dey
bpl H2508 bpl H2508
H2511 bmi H2511
bra *
lgmess .AS -"** System program too large **" lgmess .AS -"** System program too large **"
iomess .AS -"** Unable to load" iomess .AS -"** Unable to load"
.AS -" X.System *********" .AS -" X.System *********"

View File

@ -6,36 +6,35 @@ NEW
* $2D9B-2DFF moved to $FF9B-FFFF * $2D9B-2DFF moved to $FF9B-FFFF
*-------------------------------------- *--------------------------------------
IRQ.START IRQ.START
* pha XDOS.IRQV ldx #$FA save 6 bytes of page 0
* lda accsav
* sta oldacc
* pla
* sta accsav
* pla get status register from stack .2 lda $00,x
* pha and put it back. sta svzerop-$FA,x
* and #$10 is it a break or interrupt? inx
* bne H2DC2 branch if break. bne .2
* lda $D000 get ram bankid (LC1 = $D8, LC2=$EE) ldx #0
* eor #$D8 is the system active? ($D8)
* beq sysactv branch if it is
* lda #$FF .3 stx irqXindex
*sysactv sta bankid lda inttbl+1,x test for a valid routine.
* sta afbank beq .4 branch if no routine.
* lda /aftirq setup return address
* pha
* lda #aftirq
* pha
* lda #$04 status reg with interrupt flag set
* pha
*H2DC2 lda /romirq setup ROM re-entry jsr gointX execute
* pha
* lda #romirq bcc irqdone
* pha
.4 ldx irqXindex
inx
inx
cpx #10
bne .3
inc irqcount allow 255 unclaimed interrupts
bne irqdone before system death.
lda #$01 bad irq so
jsr sysdeath kill the system.
.LIST ON .LIST ON
IRQ.FREE1 .EQ $ffc8-* IRQ.FREE1 .EQ $ffc8-*
@ -53,23 +52,20 @@ lreset lda /resetv-1
pha pha
jmp gorom jmp gorom
*rreset .DA resetv-1 rts to resetv irqdone ldx #$FA
*fix45 sta p8areg A register savearea .1 lda svzerop-$FA,x restore the zero page
* lda oldacc sta $00,x
* sta accsav inx
* lda RRAMWRAMBNK1 read/write RAM bank 1 bne .1
* lda RRAMWRAMBNK1
* lda afbank rti
* jmp irqxit0
stypfx sty newpfxptr fix appletalk PFI bug gointX jmp (inttbl,x) interrupt routine x
sty preflag prefix flag
rts
stapfx sta newpfxptr irqcount .HS 00 # of unclaimed interrupts.
sta preflag irqXindex .HS 00
rts svzerop .HS 000000000000
.LIST ON .LIST ON
IRQ.FREE2 .EQ $fffa-* IRQ.FREE2 .EQ $fffa-*

View File

@ -1,71 +0,0 @@
NEW
AUTO 3,1
*--------------------------------------
* patch to gsos vectors so error is returned for os calls - rev note #101
patch101 php
sei disable interrupts
clc
xce full native mode
>LONGMX
phb save DBR
pha
pha
pea $0000 length of patch
pea $0010 0000/0010 = 16 bytes
pea $3101 user id for prodos 8
pea $8018 attributes (locked/nospec/nocross)
pha
pha
>IIGS NewHandle
lda $01,s retrieve handle
tax
lda $03,s
tay
pea $0000 copy the code into the handle
pea L2C4D
phy
phx
pea $0000 length of patch = 0000/0010
pea $0010
>IIGS PtrToHand
plx low word of handle
plb set DBR to handle's bank
lda >1,x get upper 16 bits of 24 bit address
tay save in y
lda >0,x get low 8 bits of address
and ##$00FF clear high byte
xba put address in high byte
ora ##$005C include JML opcode
sta GSOS2 store in gsos vectors
clc
adc ##$000B
sta GSOS
tya store upper 16 bits too
sta GSOS2+2
adc ##$0000 adj for possible page crossing
sta GSOS+2
plb remove garbage byte from stack
plb restore DBR.
sec
xce back to emulation mode
plp
rts
* copy of the code that goes in the handle
L2C4D lda 1,s
sta 7,s
lda 2,s
sta 8,s
pla
pla
pla
lda ##$00FF #NoOS
sec
rtl
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.LDR.B
LOAD USR/SRC/PRODOS.FX/PRODOS.S
ASM

View File

@ -1,14 +1,25 @@
NEW NEW
AUTO 3,1 AUTO 3,1
.MA DEBUG
:1 bit $C000
bpl :1
sta $C010
.EM
H2000 jmp prostart H2000 jmp prostart
jmp atalkset jmp atalkset
jmp p16start jmp p16start
LDR.MSG.0 .AS -"PRODOS FX: " LDR.MSG.0 .AS "PRODOS FX: "
LDR.MSG.0.LEN .EQ *-LDR.MSG.0 LDR.MSG.0.LEN .EQ *-LDR.MSG.0
LDR.MSG.UNSUPP .AS -"UNSUPPORTED HARDWARE."
LDR.MSG.UNSUPP.LEN .EQ *-LDR.MSG.UNSUPP
LDR.MSG.ROOTERR .AS -"Unable To read ROOT dir."
LDR.MSG.ROOTERR.LEN .EQ *-LDR.MSG.ROOTERR
p16start inc setuprts set = 2 for GQuit rts p16start inc LDR.BootFlag set = 2 for GQuit rts
atalkset inc setuprts set = 1 for appletalk rts atalkset inc LDR.BootFlag set = 1 for appletalk rts
prostart lda unitnum prostart lda unitnum
sta LDR.MLIOL.P+1 sta LDR.MLIOL.P+1
@ -25,6 +36,7 @@ prostart lda unitnum
ldx #LDR.MSG.0.LEN-1 ldx #LDR.MSG.0.LEN-1
.1 lda LDR.MSG.0,x .1 lda LDR.MSG.0,x
and #$3F
sta $400,x sta $400,x
dex dex
bpl .1 bpl .1
@ -96,7 +108,12 @@ m64k sta idapple save machine id
bra m128k bra m128k
LDR.UNSUPP.HW jmp H22EB need enhanced IIe LDR.UNSUPP.HW ldy #LDR.MSG.UNSUPP.LEN-1
.1 lda LDR.MSG.UNSUPP,y
sta vline14+2,y
dey
bpl .1
bmi *
* we have 128k * we have 128k
@ -144,6 +161,8 @@ m128k lda #$30 set id = 128k present
sta ZPOutBufPtr+1 sta ZPOutBufPtr+1
jsr X.Unpak jsr X.Unpak
jsr lc1in switch in language card bank 1.
lda PAKME.XRW lda PAKME.XRW
sta ZPInBufPtr sta ZPInBufPtr
lda PAKME.XRW+1 lda PAKME.XRW+1
@ -176,6 +195,12 @@ m128k lda #$30 set id = 128k present
sta ZPOutBufPtr+1 sta ZPOutBufPtr+1
jsr X.Unpak jsr X.Unpak
ldx #XDOS.DATA.LEN
.3 stz XDOS.DATA-1,x
dex
bne .3
lda PAKME.IRQ lda PAKME.IRQ
sta ZPInBufPtr sta ZPInBufPtr
lda PAKME.IRQ+1 lda PAKME.IRQ+1
@ -189,13 +214,19 @@ m128k lda #$30 set id = 128k present
lda kversion lda kversion
sta xdosver save current version for dir use sta xdosver save current version for dir use
lda idapple
sta MACHID
lda cortland lda cortland
beq LDR.II branch if // family beq LDR.II branch if // family
LDR.IIGS inc cortland it's a Cortland, set loader flag LDR.IIGS stz vmode force setvid to reset cursor
stz vmode force setvid to reset cursor
jsr setvid reset output to screen jsr setvid reset output to screen
ldx PAKME.CCLK
ldy PAKME.CCLK+1
jsr LDR.SetupCLK
ldx PAKME.SEL2 ldx PAKME.SEL2
ldy PAKME.SEL2+1 ldy PAKME.SEL2+1
@ -209,26 +240,9 @@ LDR.IIGS inc cortland it's a Cortland, set loader flag
ldx PAKME.SEL2 ldx PAKME.SEL2
ldy PAKME.SEL2+1 ldy PAKME.SEL2+1
jsr LDR.SetupQC
stx ZPInBufPtr
sty ZPInBufPtr+1 lda LDR.BootFlag
lda #$D100
sta ZPOutBufPtr
lda /$D100
sta ZPOutBufPtr+1
jsr X.Unpak
lda PAKME.CCLK
sta ZPInBufPtr
lda PAKME.CCLK+1
sta ZPInBufPtr+1
lda #$D742
sta ZPOutBufPtr
lda /$D742
sta ZPOutBufPtr+1
jsr X.Unpak
lda setuprts
bne .1 branch if prodos 8 alone bne .1 branch if prodos 8 alone
* running from gs/os shell so zero out os_boot for appletalk * running from gs/os shell so zero out os_boot for appletalk
@ -239,118 +253,17 @@ LDR.IIGS inc cortland it's a Cortland, set loader flag
.1 jmp RAMDRV.Install .1 jmp RAMDRV.Install
* put dispatcher in bank 2 of language card * put dispatcher in bank 2 of language card
LDR.II lda LDR.MLIOL.P+1 place boot devnum in globals LDR.II ldx PAKME.SEL1
sta LDR.MLIRB.P+1 ldy PAKME.SEL1+1
sta devnum last device used jsr LDR.SetupQC
jsr devsrch finish setting up globals
lda LDR.MLIRB.P+1
sta devnum
jsr lc1in switch in language card bank 1.
lda PAKME.TCLK
sta ZPInBufPtr
lda PAKME.TCLK+1
sta ZPInBufPtr+1
lda #$D742
sta ZPOutBufPtr
lda /$D742
sta ZPOutBufPtr+1
jsr X.Unpak
lda #calldisp
sta jspare+1 P8 system death vector
lda /calldisp
sta jspare+2
lda RRAMWRAMBNK2 read/write RAM bank 2
lda RRAMWRAMBNK2
ldx PAKME.SEL1 else, use Bird's Better Bye
ldy PAKME.SEL1+1 if correct machine.
stx ZPInBufPtr
sty ZPInBufPtr+1
lda #$D100
sta ZPOutBufPtr
lda /$D100
sta ZPOutBufPtr+1
jsr X.Unpak
lda #$EE byte to distinguish LC bank 2
sta $D000
jsr lc1in switch in LC bank 1
RAMDRV.Install ldy #$99 move $9A bytesfrom lcsrc to lcdest.
.1 lda RAM,y transfer main bank portion of driver
sta RAMDRV,y
dey
cpy #$FF
bne .1
ldx #RAMX set up to move aux portion of driver
stx A1L
dex
stx A2L
ldx /RAMX
stx A1L+1
inx
stx A2L+1
lda #RAMXDRV
sta A4L
lda /RAMXDRV RAMX to RAMXDRV
sta A4L+1
sec irection = to aux bank.
jsr auxmove move aux bank portion of driver.
lda #RAMDRV put driver address into
sta drivertbl2+6 slot 3, drive 2.
lda /RAMDRV
sta drivertbl2+7
inc numdevs count (-1) active devices
ldx numdevs
lda #$BF unit num of /RAM
sta devlist,x
* check interrupt vector to determine ROM version
noramdsk lda RROMWRAMBNK2
ldy irqv interrupt vector
ldx irqv+1 x = high byte
jsr lc1in set language card bank 1 to r/w
cpx #$D0 is it > $D000 (old roms)
* lda #$00 was for setting removed IRQFLAG
bcc .1
jmp H22EB need enhanced Roms
.1 sta SETALTZP
lda #$FF set aux sp = $FF
sta auxsp
stx irqv+1 interrupt vector
sty irqv save irq vector in aux lc
sta CLRALTZP
stx irqv+1 save irq vector in main lc
sty irqv
* lda #$01 was for setting removed IRQFLAG
stz cortflag assume not Cortland system
lda cortland running on a Cortland ?
beq .2 branch if not.
inc cortflag yes it's Cortland
bra docard
* check for a rom in slot 3. if no rom, use internal $C300 firmware * check for a rom in slot 3. if no rom, use internal $C300 firmware
.2 sta CLRC3ROM .2 sta CLRC3ROM
lda rommap slot ROM bit map lda rommap slot ROM bit map
and #$08 mask all but slot 3 and #$08 mask all but slot 3
bne isromin3 taken if rom in slot 3 bne isromin3 taken if rom in slot 3
bra H2247 else continue booting bra CLK.Install else continue booting
* found a rom in slot 3. is it an external, identifiable 80 col card * found a rom in slot 3. is it an external, identifiable 80 col card
* with interrupt routines? if so, enable it else use internal $C300 firmware. * with interrupt routines? if so, enable it else use internal $C300 firmware.
@ -396,47 +309,99 @@ hitswtch sta CLRC3ROM
.1 sta CLRPAGE2 .1 sta CLRPAGE2
sta CLR80STORE sta CLR80STORE
beq docard branch if card is there beq docard branch if card is there
lda machid machine ID byte
and #$FD clear 80-col bit 2 (no card)
bne H2244 always
docard lda machid lda #MACHID.COL80
ora #$02 turn bit 2 on (80-col card is present) lda machid machine ID byte
trb MACHID clear 80-col bit 2 (no card)
bra CLK.Install
H2244 sta machid docard lda #MACHID.COL80
H2247 lda cortland are we running on a //gs ? tsb MACHID turn bit 2 on (80-col card is present)
beq H225D if not.
lda #$4C enable clock routine by putting a jmp CLK.Install jsr LDR.ClkDevScan
sta clockv in front of clock vector *--------------------------------------
RAMDRV.Install jsr lc1in
ldx PAKME.RAM
ldy PAKME.RAM+1
lda PAKME.CCLK stx ZPInBufPtr
sta ZPInBufPtr sty ZPInBufPtr+1
lda PAKME.CCLK+1 lda #$FF00
sta ZPInBufPtr+1
lda #$D742
sta ZPOutBufPtr sta ZPOutBufPtr
lda /$D742 lda /$FF00
sta ZPOutBufPtr+1 sta ZPOutBufPtr+1
jsr X.Unpak jsr X.Unpak
lda #$01 set bit 0 = clock present sta SETWRITEAUX
tsb machid
H225D lda setuprts get setup entry point flag ldx PAKME.RAMX
beq H2267 taken if normal boot. ldy PAKME.RAMX+1
stx ZPInBufPtr
sty ZPInBufPtr+1
lda #$0200
sta ZPOutBufPtr
lda /$0200
sta ZPOutBufPtr+1
jsr X.Unpak
sta CLRWRITEAUX
lda #RAMDRV put driver address into
sta drivertbl2+6 slot 3, drive 2.
lda /RAMDRV
sta drivertbl2+7
inc GP.numdevs count (-1) active devices
ldx GP.numdevs
lda #$BF unit num of /RAM
sta devlist,x
LDR.IRQ lda RROMWRAMBNK2
ldy irqv interrupt vector
ldx irqv+1 x = high byte
jsr lc1in set language card bank 1 to r/w
sta SETALTZP
lda #$FF set aux sp = $FF
sta auxsp
stx irqv+1 interrupt vector
sty irqv save irq vector in aux lc
sta CLRALTZP
stx irqv+1 save irq vector in main lc
sty irqv
lda LDR.MLIOL.P+1 place boot devnum in globals
sta LDR.MLIRB.P+1
sta devnum last device used
jsr LDR.BlkDevScan finish setting up globals
lda LDR.MLIRB.P+1
sta devnum
lda #calldisp
sta jspare+1 P8 system death vector
lda /calldisp
sta jspare+2
lda LDR.BootFlag get setup entry point flag
beq LDR.ReadRoot taken if normal boot.
lda RROMBNK2 lda RROMBNK2
rts return to caller at setup entry point. rts return to caller at setup entry point.
setuprts .DA #$00 0 = normal boot, <>0 = return
LDR.BootFlag .DA #$00 0 = normal boot, <>0 = return
* set prefix to boot device * set prefix to boot device
H2267 jsr MLI LDR.ReadRoot jsr MLI
.DA #MLIONLINE .DA #MLIONLINE
.DA LDR.MLIOL.P .DA LDR.MLIOL.P
bcs relocerr bcs .9
lda pbuf+1 get volume name length. lda pbuf+1 get volume name length.
and #$0F strip devnum and #$0F strip devnum
beq relocerr beq .9
inc add 1 for leading '/' inc add 1 for leading '/'
sta pbuf save prefix length. sta pbuf save prefix length.
lda #'/' place leading '/' in prefix buffer lda #'/' place leading '/' in prefix buffer
@ -445,59 +410,50 @@ H2267 jsr MLI
jsr MLI jsr MLI
.DA #MLISETPREFIX .DA #MLISETPREFIX
.DA LDR.MLISETP.P .DA LDR.MLISETP.P
bcs relocerr bcs .9
tax =0
stx dst stz dst
ldy #$02 read directory into buffer
lda /DirBlkBuf lda /DirBlkBuf
H228E sta dst+1 ldy #$02 read directory into buffer
sta LDR.MLIRB.P+3 ldx #0
sty LDR.MLIRB.P+4
stx LDR.MLIRB.P+5 .1 sta dst+1
sta LDR.MLIRB.P+3 Data buf HI
sty LDR.MLIRB.P+4 Blk Num LO
stx LDR.MLIRB.P+5 Blk Num HI
jsr MLI jsr MLI
.DA #MLIREADBLOCK .DA #MLIREADBLOCK
.DA LDR.MLIRB.P .DA LDR.MLIRB.P
bcs relocerr bcs .9
ldy #$03 get next block# from link ldy #$03 get next block# from link
lda (dst),y lda (dst),y
tax tax
dey dey
ora (dst),y if both bytes are the same ora (dst),y 00 00 -> Last Block
beq H22B7 then no more blocks of directory. beq .8
lda (dst),y lda (dst),y
tay tay
lda dst+1 lda dst+1
clc inc
adc #$02 add $200 to buffer pointer inc add $200 to buffer pointer
cmp /dbuf+$800 until it points past end of buffer. cmp /dbuf+$800 until it points past end of buffer.
bcc H228E if ok, read next block. bcc .1 if ok, read next block.
H22B7 jmp $800 jmp to "load interpreter" code .8 jmp $800 jmp to "load interpreter" code
* relocation/configuration error .9 sta RROMBNK2
relocerr sta RROMBNK2
jsr home jsr home
ldy #$1D ldy #LDR.MSG.ROOTERR-1
.1 lda LDR.MSG.LdrErr,y .91 lda LDR.MSG.ROOTERR,y
sta vline12+4,y sta vline12+4,y
dey dey
bpl .1 bpl .91
bmi * bmi *
LDR.MSG.LdrErr .AS -"Relocation/Configuration Error"
H22EB ldy #$23
.1 lda LDR.MSG.EnhErr,y
sta vline14+2,y
dey
bpl .1
bmi *
LDR.MSG.EnhErr .AS -"REQUIRES ENHANCED APPLE IIE OR LATER"
LDR.MLIOL.P .DA #2 LDR.MLIOL.P .DA #2
.DA #$60 .DA #$60
.DA pbuf+1 .DA pbuf+1
@ -511,40 +467,49 @@ LDR.MLIRB.P
.DA 0 2 byte block number .DA 0 2 byte block number
cortland .BS 1 cortland loader flag (1 = Cortland) cortland .BS 1 cortland loader flag (1 = Cortland)
newquitflag .BS 1 1 = old quit code *--------------------------------------
LDR.SetupQC bit RRAMWRAMBNK2 read/write RAM bank 2
bit RRAMWRAMBNK2
* move thunderclock stx ZPInBufPtr
sty ZPInBufPtr+1
lda #$D100
sta ZPOutBufPtr
lda /$D100
sta ZPOutBufPtr+1
jsr X.Unpak
rlclk64 .DA #$01 relocation table. 1=move src to dst lda #$EE byte to distinguish LC bank 2
.DA $D742 destination sta $D000
.DA TCLK.END-TCLK.START jmp lc1in switch in LC bank 1
.DA TCLK source *--------------------------------------
LDR.ClkDevScan rts
*--------------------------------------
LDR.SetupCLK stx ZPInBufPtr
sty ZPInBufPtr+1
lda #$D742
sta ZPOutBufPtr
lda /$D742
sta ZPOutBufPtr+1
jsr X.Unpak
.DA #$04 4=relocate and move program lda #$4C enable clock routine by putting a jmp
.DA TCLK.START sta clockv in front of clock vector
.DA TCLK.CEND-TCLK.START
.DA TCLK.START
.HS 00
.HS C1C1
clock64 .DA #$00
.HS FF done
* determine which system model and save in machine id (idapple)
lda #MACHID.CLK
tsb MACHID
rts
*--------------------------------------
* find all disk devices in system slots and set up address * find all disk devices in system slots and set up address
* and device table in prodos global page. if there is a disk * and device table in prodos global page. if there is a disk
* card in slot 2 then limit the # of devices in slot 5 * card in slot 2 then limit the # of devices in slot 5
* smartport to only 2 * smartport to only 2
numdev2 .HS 0000000000000000 8 bytes for smartport call *--------------------------------------
driveradr .DA 0 LDR.BlkDevScan stz dst
d2idx .DA #0
diskins2 .DA #0 msb clear if drive in slot 2
devsrch stz dst
stz dst+1 stz dst+1
stz idxl stz idxl
ldx #$FF init to no active devices. ldx #$FF init to no active devices.
stx numdevs count (-1) active devices. stx GP.numdevs count (-1) active devices.
lda #$0E start disk // area at end of devlist. lda #$0E start disk // area at end of devlist.
sta d2idx sta d2idx
@ -555,8 +520,10 @@ devsrch stz dst
sta idxl+1 check slot 2 sta idxl+1 check slot 2
jsr cmpid is there a disk in slot 2 ? jsr cmpid is there a disk in slot 2 ?
ror diskins2 if so, clear msb else set it. ror diskins2 if so, clear msb else set it.
lda #$C7 search slots from high to low lda #$C7 search slots from high to low
sta idxl+1 sta idxl+1
H26AB jsr cmpid H26AB jsr cmpid
bcs H270C if no ProDOS device in this slot. bcs H270C if no ProDOS device in this slot.
lda (idxl),y check last byte of $Cn rom (y = $ff) lda (idxl),y check last byte of $Cn rom (y = $ff)
@ -593,9 +560,10 @@ H26E6 sta driveradr+1
jsr installdev install 1 or 2 devices from this slot. jsr installdev install 1 or 2 devices from this slot.
plp get back if it's a disk // (carry). plp get back if it's a disk // (carry).
bcc nxtdsk2 if not disk //. bcc nxtdsk2 if not disk //.
dex move the list pointer back by 2 devices dex move the list pointer back by 2 devices
dex dex
stx numdevs count (-1) active devices stx GP.numdevs count (-1) active devices
dec d2idx increase the disk two index dec d2idx increase the disk two index
dec d2idx dec d2idx
ldy d2idx ldy d2idx
@ -604,8 +572,10 @@ H26E6 sta driveradr+1
sta devlist,y move then toward the end of the list sta devlist,y move then toward the end of the list
lda devlist,x lda devlist,x
sta devlist+1,y sta devlist+1,y
dex back to numdevs again dex back to GP.numdevs again
nxtdsk2 clc nxtdsk2 clc
H270C jsr sltrom test for ROM in given slot and set flags H270C jsr sltrom test for ROM in given slot and set flags
dec idxl+1 next lower slot. dec idxl+1 next lower slot.
lda idxl+1 lda idxl+1
@ -620,16 +590,18 @@ H270C jsr sltrom test for ROM in given slot and set flags
* now copy the disk // list to the end of the regular list. * now copy the disk // list to the end of the regular list.
* start by making the device count include disk //'s * start by making the device count include disk //'s
ldx numdevs current device count - 1 ldx GP.numdevs current device count - 1
lda #$0E lda #$0E
sec sec
sbc d2idx sbc d2idx
beq H2747 if there were no disk //'s then done. beq H2747 if there were no disk //'s then done.
clc clc
adc numdevs sum of disk //'s and others. adc GP.numdevs sum of disk //'s and others.
sta numdevs sta GP.numdevs
inx move to open space in regular list. inx move to open space in regular list.
ldy #$0D first disk // entry. ldy #$0D first disk // entry.
H272F lda devlist,y H272F lda devlist,y
pha pha
lda devlist,x lda devlist,x
@ -641,8 +613,9 @@ H272F lda devlist,y
sty d2idx use as a temp sty d2idx use as a temp
cpx d2idx cpx d2idx
bcc H272F continue until indexes cross bcc H272F continue until indexes cross
H2747 ldy #$00 H2747 ldy #$00
ldx numdevs now change the device order so that ldx GP.numdevs now change the device order so that
H274C lda devlist,x the boot device will have highest H274C lda devlist,x the boot device will have highest
pha priority. pha priority.
@ -655,7 +628,7 @@ H274C lda devlist,x the boot device will have highest
H275A dex H275A dex
bpl H274C bpl H274C
ldx numdevs now reverse order of search, hi to lo. ldx GP.numdevs now reverse order of search, hi to lo.
tya was boot device found ? tya was boot device found ?
beq H2777 beq H2777
lda devnum make boot device 1st in search order. lda devnum make boot device 1st in search order.
@ -668,48 +641,26 @@ H275A dex
sta devlist,x sta devlist,x
dex dex
bmi H277E branch if only 1 device, 2 drives. bmi H277E branch if only 1 device, 2 drives.
H2777 pla H2777 pla
sta devlist,x sta devlist,x
dex dex
bpl H2777 bpl H2777
H277E jsr fndtrd save accumulated machine id. H277E rts
beq .1
sta machid machine ID byte
.1 rts
stadrv ora devid combine with attributes. stadrv ora devid combine with attributes.
ldx numdevs ldx GP.numdevs
inx put device # into device list. inx put device # into device list.
sta devlist,x sta devlist,x
asl now form drive 2 device number, if any. asl now form drive 2 device number, if any.
rts rts
sltrom bcc H27F3 branch if disk drive sltrom bcc H27F3 branch if disk drive
* test for clock card
ldy #$06
.1 lda (idxl),y
cmp dskid,y
bne .2 no clock
dey
dey
bpl .1
lda idxl+1 transfer hi slot address
sbc #$C1 minus $C1 (default) to relocate
sta clock64 references to clock rom.
lda #$4C enable jump vector in globals.
sta clockv P8 clock vector.
lda idapple mark clock as present.
beq H277E
ora #$01
sta idapple xxxxxxx1 = clock present.
bne H27F3 always taken.
* test for 80 col card * test for 80 col card
.2 ldy #$05 ldy #$05
lda (idxl),y lda (idxl),y
cmp #$38 cmp #$38
bne H27E4 bne H27E4
@ -742,6 +693,7 @@ H27EC cmp (idxl) look for floating bus
bne H2801 no rom bne H2801 no rom
inx inx
bne H27EC bne H27EC
H27F3 lda idxl+1 mark a bit in slot byte H27F3 lda idxl+1 mark a bit in slot byte
and #$07 to indicate rom present. and #$07 to indicate rom present.
tax tax
@ -755,31 +707,6 @@ dskid .HS 082028005803703C
* slot bits * slot bits
sltbit .HS 0002040810204080 sltbit .HS 0002040810204080
fndtrd clc
ldy sltbit
.1 lda (lookptr),y
and #$DF
adc sltbit
sta sltbit
rol sltbit
iny
cpy sltbit+3
bne .1
tya
asl
asl
asl
asl
tay
eor sltbit
adc #$0B
bne .2
lda idapple
rts
.2 lda #$00
rts
installdev php how many drives (carry). installdev php how many drives (carry).
lda idxl+1 get index to global device table lda idxl+1 get index to global device table
and #$07 for this slot... and #$07 for this slot...
@ -795,7 +722,7 @@ installdev php how many drives (carry).
inx else presume that 2nd drive is present. inx else presume that 2nd drive is present.
sta devlist,x active device list. sta devlist,x active device list.
.1 stx numdevs save updated device count. .1 stx GP.numdevs save updated device count.
asl shift # of drives back into carry. asl shift # of drives back into carry.
lda driveradr get high address of device driver. lda driveradr get high address of device driver.
sta drivertbl1,y device driver table 1. sta drivertbl1,y device driver table 1.
@ -1034,8 +961,8 @@ mount ldx #$0C
lda spvect+2 lda spvect+2
sta spvecthi-1,x sta spvecthi-1,x
lda RROMBNK2 write protect lc ram. lda RROMBNK2 write protect lc ram.
inc numdevs inc GP.numdevs
ldx numdevs ldx GP.numdevs
tya tya
lsr lsr
cmp #$08 cmp #$08
@ -1063,6 +990,11 @@ H29EB jsr cmpid is it a disk controller?
clc smartport found clc smartport found
.9 rts .9 rts
numdev2 .HS 0000000000000000 8 bytes for smartport call
driveradr .DA 0
d2idx .DA #0
diskins2 .DA #0 msb clear if drive in slot 2
* test for 128k. use page 0 for this routine * test for 128k. use page 0 for this routine
LDR.Test128 lda #$EE LDR.Test128 lda #$EE
@ -1103,7 +1035,71 @@ lc1in lda RRAMWRAMBNK1
lda RRAMWRAMBNK1 lda RRAMWRAMBNK1
rts rts
* patch to gsos vectors so error is returned for os calls - rev note #101
patch101 php
sei disable interrupts
clc
xce full native mode
>LONGMX
phb save DBR
pha
pha
pea $0000 length of patch
pea $0010 0000/0010 = 16 bytes
pea $3101 user id for prodos 8
pea $8018 attributes (locked/nospec/nocross)
pha
pha
>IIGS NewHandle
lda $01,s retrieve handle
tax
lda $03,s
tay
pea $0000 copy the code into the handle
pea L2C4D
phy
phx
pea $0000 length of patch = 0000/0010
pea $0010
>IIGS PtrToHand
plx low word of handle
plb set DBR to handle's bank
lda >1,x get upper 16 bits of 24 bit address
tay save in y
lda >0,x get low 8 bits of address
and ##$00FF clear high byte
xba put address in high byte
ora ##$005C include JML opcode
sta GSOS2 store in gsos vectors
clc
adc ##$000B
sta GSOS
tya store upper 16 bits too
sta GSOS2+2
adc ##$0000 adj for possible page crossing
sta GSOS+2
plb remove garbage byte from stack
plb restore DBR.
sec
xce back to emulation mode
plp
rts
* copy of the code that goes in the handle
L2C4D lda 1,s
sta 7,s
lda 2,s
sta 8,s
pla
pla
pla
lda ##$00FF #NoOS
sec
rtl
MAN MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.LDR.A SAVE USR/SRC/PRODOS.FX/PRODOS.S.LDR
LOAD USR/SRC/PRODOS.FX/PRODOS.S LOAD USR/SRC/PRODOS.FX/PRODOS.S
ASM ASM

View File

@ -0,0 +1,91 @@
NEW
AUTO 3,1
*--------------------------------------
* Driver For DS1216E
*--------------------------------------
NCLK.START php
sei
sta $CFFF Make cards release $C8xx space
sta $C300
lda $C304 Reset DS1216E comparison register with READ A2=1
ldy #7 Read 8 bytes...
.1 lda DS1216E.PATTERN,y
phy
ldy #8 ....of 8 bits
.2 ldx #0
lsr
bcc .3
inx
.3 bit $C300,x Write Pattern bit in A0, with A2=0
dey
bne .2
ply
dey
bpl .1
ldx #7
.4 ldy #8
.5 lda $C304 Read Byte...
lsr
ror DS1216E.DATA,x
dey
bne .5
lda DS1216E.DATA,x
pha
lsr
lsr
lsr
lsr
tay
pla
and #$0F
clc
.HS 2C Bit Absolute to skip adc #$0A
.6 adc #$0A
dey
bpl .6
sta DS1216E.DATA,x
dex
bpl .4
lda DS1216E.DATA+4 Get HH
sta TIMELO+1
lda DS1216E.DATA+5 Get mm
sta TIMELO
lda DS1216E.DATA+1 Get MM
asl
asl
asl
asl
asl
ora DS1216E.DATA+2 Get DD
sta DATELO
lda DS1216E.DATA Get YY
rol
sta DATELO+1
plp
rts
*--------------------------------------
DS1216E.PATTERN .HS 5CA33AC55CA33AC5 Reverted 7->0
DS1216E.DATA .BS 8 Reverted YY MM DD Day HH mm SS CS
*--------------------------------------
NCLK.LEN .EQ *-NCLK.START
*--------------------------------------
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.NCLK
LOAD USR/SRC/PRODOS.FX/PRODOS.S
ASM

View File

@ -74,7 +74,7 @@ H2D6A lda (A1L),y pointers set in card by 'setptr'
sp1 .HS 0000 sp1 .HS 0000
a1l1 .BS 13 13 bytes of storage a1l1 .BS 13 13 bytes of storage
*-------------------------------------- *--------------------------------------
RAM.LEN .EQ RAM.START RAM.LEN .EQ *-RAM.START
MAN MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.RAM SAVE USR/SRC/PRODOS.FX/PRODOS.S.RAM
LOAD USR/SRC/PRODOS.FX/PRODOS.S LOAD USR/SRC/PRODOS.FX/PRODOS.S

View File

@ -307,14 +307,6 @@ ex1 sta passit+1 also used by blockwrite
clc transfer card to main clc transfer card to main
clv use standard zeropage/stack clv use standard zeropage/stack
jmp xfer jmp back from language card. jmp xfer jmp back from language card.
* NOTE: the previous section of code MUST NOT use $3FE or $3FF
* since the interrupt vector must go there if aux interrupts
* are to be used. no room for expansion here !!
.HS 0000 $3FE-$3FF
* end of obj ram_0
*-------------------------------------- *--------------------------------------
RAMX.LEN .EQ *-RAMX.START RAMX.LEN .EQ *-RAMX.START
MAN MAN

View File

@ -1,298 +0,0 @@
NEW
AUTO 3,1
* object code = sel_0
*
* dispatcher 1 - this code org's and operates at 'dispadr' (=$1000) but
* is resident in memory at 'displc2' (=$D100) in the alternate 4k bank
* of the language card. the quit call vectors to a routine high in the
* mli that moves dispatcher 1 down and jumps to it. the move routine
* must remain somewhere between $E000-$F7FF. this routine must be less
* than 3 pages in length.
SEL0.START lda RROMBNK2 read ROM
sta CLR80DISP disable 80 col hardware
sta CLRALTCHAR normal LC, flashing UC
sta CLR80STORE disable 80 column store
jsr setnorm set normal text mode
jsr init init text screen
jsr setvid reset output to screen
jsr setkbd reset input to keyboard
ldx #$17 clear the memory bitmap
lda #$01 but protect page $BF00.
sta memmap,x P8 memory bitmap
dex
lda #$00
L5A22 sta memmap,x
dex
bpl L5A22
lda #$CF protect zero page, stack and
sta memmap $400-$7FF (text screen display)
L5A2D jsr home clear screen
jsr crout position top/left
ldx #dsp1msg0-dsp1msgs
jsr prntmsg 'enter prefix...'
lda #$03 line 3
sta cv
jsr crout
jsr MLI get prefix
.DA #$C7
.DA dsp1pfx
ldx pbuf get prefix length
lda #$00 put 0 at end of prefix
sta pbuf+1,x
ldx pbuf get length.
beq L5A5D if no prefix to display.
L5A52 lda pbuf,x display prefix directly to screen
ora #$80 normal text
sta vline5-1,x line 5
dex
bne L5A52
L5A5D ldx #$00
dec cv
jsr crout
getkey jsr rdkey input char with cursor
cmp #$8D cr ?
beq L5ABD yes, accept what is entered.
pha no, save the char.
jsr clreol clear rest of line.
pla get char back
cmp #$9B esc ?
beq L5A2D yes, start over
cmp #$98 ctrl-x ?
L5A76 beq L5A2D then start over
cmp #$89 tab ?
beq badkey
cmp #$FF delete ?
beq L5A84 if yes
cmp #$88 backspace ?
bne L5A91 if not
L5A84 cpx #$00 at column 0 ?
beq L5A8B if so, do nothing
dec ch else move left
dex dec char count
L5A8B jsr clreol clear rest of line
jmp getkey get another char
L5A91 bcs L5A99
badkey jsr bell output bell for bad key
jmp getkey and get another.
L5A99 cmp #$DB below 'Z' ?
bcc L5A9F if yes
and #$DF else shift to uppercase.
L5A9F cmp #$AE below '.' ?
bcc badkey
cmp #$DB above 'Z' ?
bcs badkey
cmp #$BA below ':' ?
bcc goodkey
cmp #$C1 at or above 'A' ?
bcc badkey
goodkey inx
cpx #$27 more than 39 chars ?
bcs L5A76 then too many, go restart.
sta pbuf,x save it
jsr cout
jmp getkey get another.
L5ABD cpx #$00 prefix length = 0 ?
beq L5AD3 if yes, don't set length.
stx pbuf set prefix length.
jsr MLI call mli to set prefix.
.DA #$C6
.DA dsp1pfx
bcc L5AD3 if ok, go get filename.
jsr bell if not, ring bell
lda #$00 and try again for prefix.
L5AD1 beq L5A76
L5AD3 jsr home clear screen for application name.
jsr crout
ldx #disp1msg-dsp1msgs
jsr prntmsg 'enter pathname...'
retryrich lda #$03 line 3
sta cv
jsr crout
ldx #$00
loop1 jsr rdkey input char with cursor.
cmp #$9B esc ?
bne L5AF4 if not esc.
lda ch esc pressed in column 0 ?
bne L5AD3 if not, get pathname again.
beq L5AD1 if so, get prefix again.
L5AF4 cmp #$98 ctrl-x ?
L5AF6 beq L5AD3 then cancel and get pathname again.
cmp #$89 tab ?
beq L5B09 not good.
cmp #$FF delete ?
beq L5B04 delete char.
cmp #$88 backspace ?
bne L5B07
L5B04 jmp delchar delete char.
L5B07 bcs L5B0F if > $88 then char may be acceptable.
L5B09 jsr bell output bell (ctl-G)
jmp loop1 not good.
L5B0F cmp #$8D cr ?
beq L5B3C then done.
cmp #$DB less than 'Z' ?
bcc L5B19 no.
and #$DF make sure it's uppercase.
L5B19 cmp #$AE '.' ?
bcc L5B09 not good if less.
cmp #$DB less than '[' ?
bcs L5B09 not good.
cmp #$BA <= '9' ?
bcc L5B29 then ok.
cmp #$C1 greater than 'A' ?
bcc L5B09 if not, then no good.
L5B29 pha it's good, save it.
jsr clreol clear to end of line
pla
jsr cout print it
inx
cpx #$27 more than 39 chars ?
bcs L5AF6 too long, get pathname again.
sta pbuf,x store it.
jmp loop1 get another char
L5B3C lda #$A0
jsr cout after cr, blank out the cursor.
stx pbuf put length in front of the name.
jsr MLI get file info for pathname in pbuf
.DA #$C4
.DA dsp1info
bcc L5B4F if no errors.
jmp dsp1error
L5B4F lda dsp1type
cmp #$FF is it a SYS file ?
beq L5B5B yes.
lda #$01 not SYS file error.
jmp dsp1error
L5B5B lda #$00 it's a system file
sta dsp1cln
jsr MLI close all open files
.DA #$CC
.DA dsp1cls
bcc L5B6B
jmp dsp1error
L5B6B lda dsp1acess check for proper access.
and #$01 is read disabled ?
bne L5B77 no, access ok.
lda #$27 i/o error
jmp dsp1error
L5B77 jsr MLI open the file
.DA #$C8
.DA dsp1open
bcc L5B82
jmp dsp1error
L5B82 lda dsp1refn copy the reference number
sta dsp1rdn
sta dsp1eofn
jsr MLI get eof
.DA #$D1
.DA dsp1eof
bcs dsp1error
lda dsp1eofb+2 3rd of 3 bytes.
beq L5B9C if 0 then ok
lda #$27 else i/o error because
bne dsp1error file is too large.
L5B9C lda dsp1eofb move eof to # of bytes to read.
sta dsp1cnt
lda dsp1eofb+1
sta dsp1cnt+1
jsr MLI read the file
.DA #$CA
.DA dsp1read
php save the status.
jsr MLI close the file.
.DA #$CC
.DA dsp1cls
bcc L5BBB
L5BB7 plp get status (it is irrelevant now)
bne dsp1error if close generated an error
plp here if close was ok.
L5BBB bcs L5BB7 error.
jmp sysentry execute system file
delchar lda ch is cursor in column 0 ?
beq L5BD3 yes, ignore it.
dex
lda #$A0 blank out the cursor
jsr cout
dec ch
dec ch point to last char entered
jsr cout and blank it too.
dec ch point to that location.
L5BD3 jmp loop1 get next char.
prntmsg lda dsp1msgs,x
beq L5BE1
jsr cout
inx
bne prntmsg
L5BE1 rts
* dispatcher 1 error handler
dsp1error sta errnum
lda #$0C display error message on line 13
sta cv
jsr crout
lda errnum
cmp #$01
bne L5BF5
ldx #dsp1err1-dsp1msgs not a type 'sys' file
bne L5C0B handled separately.
L5BF5 cmp #$40 syntax error in pathname ?
beq L5C09
cmp #$44 bad subdirectory path ?
beq L5C09
cmp #$45 volume not found ?
beq L5C09
cmp #$46 file not found ?
beq L5C09
ldx #dsp1err2-dsp1msgs if not the errors above then 'i/o error'
bne L5C0B
L5C09 ldx #dsp1err3-dsp1msgs otherwise display 'file/path not found'
L5C0B jsr prntmsg
jmp retryrich retry for application pathname
dsp1msgs .EQ *
dsp1msg0 .EQ *
.AS -'ENTER PREFIX (PRESS "RETURN" TO ACCEPT)'
.HS 00
disp1msg .AS -"ENTER PATHNAME OF NEXT APPLICATION"
.HS 00
dsp1err1 .DA #$87
.AS -'NOT A TYPE "SYS" FILE'
.HS 00
dsp1err2 .DA #$87
.AS -"I/O ERROR "
.HS 00
dsp1err3 .DA #$87
.AS -"FILE/PATH NOT FOUND "
.HS 00
dsp1info .DA #$0A 10 parameters
.DA pbuf pathname buffer
dsp1acess .HS 00 access
dsp1type .HS 00 file type
.BS 13 the rest are unimportant
dsp1open .HS 03 3 parameters for open
.DA pbuf pathname buffer
.DA fbuf fcb buffer
dsp1refn .HS 00 reference #
dsp1cls .DA #01 1 parameter for close
dsp1cln .HS 00 reference #
dsp1read .HS 04 4 parameters for read
dsp1rdn .HS 00 reference #
.DA sysentry .SYS load address
dsp1cnt .HS 0000 byte count
.HS 0000
dsp1eof .HS 02 2 parameters
dsp1eofn .HS 00 reference #
dsp1eofb .HS 000000 3 byte eof
dsp1pfx .DA #01 1 parameter
.DA pbuf prefix buffer
.BS $1300-* fill to page boundary
* end of obj sel_0
*--------------------------------------
SEL0.LEN .EQ SEL0.START
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.SEL0
LOAD USR/SRC/PRODOS.FX/PRODOS.S
ASM

View File

@ -26,7 +26,7 @@ L5D16 stz memmap,x P8 memory bitmap
* drive selector * drive selector
ldx numdevs get device count and ldx GP.numdevs get device count and
stx lstpntr store in zero page. stx lstpntr store in zero page.
lda devnum get last slot/drive lda devnum get last slot/drive
bne volname bne volname
@ -35,7 +35,7 @@ ds2 ldx lstpntr get device list pointer.
lda devlist,x get unit number from list. lda devlist,x get unit number from list.
cpx #$01 make sure it's real. cpx #$01 make sure it's real.
bcs L5D3F if so, change list pointer. bcs L5D3F if so, change list pointer.
ldx numdevs get device count. ldx GP.numdevs get device count.
inx inx
L5D3F dex decrement list pointer and restore. L5D3F dex decrement list pointer and restore.
stx lstpntr stx lstpntr
@ -399,7 +399,7 @@ rd_refn .HS 01 reference number
dhdr_len .HS 00 directory header length (actually uses 2 bytes) dhdr_len .HS 00 directory header length (actually uses 2 bytes)
*-------------------------------------- *--------------------------------------
SEL1.LEN .EQ SEL1.START SEL1.LEN .EQ *-SEL1.START
MAN MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.SEL1 SAVE USR/SRC/PRODOS.FX/PRODOS.S.SEL1
LOAD USR/SRC/PRODOS.FX/PRODOS.S LOAD USR/SRC/PRODOS.FX/PRODOS.S

View File

@ -435,7 +435,7 @@ button1 .DA #$0D
button2 .DA #$0B button2 .DA #$0B
.AS "Cancel: Esc" .AS "Cancel: Esc"
*-------------------------------------- *--------------------------------------
SEL2.LEN .EQ SEL2.START SEL2.LEN .EQ *-SEL2.START
MAN MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.SEL2 SAVE USR/SRC/PRODOS.FX/PRODOS.S.SEL2
LOAD USR/SRC/PRODOS.FX/PRODOS.S LOAD USR/SRC/PRODOS.FX/PRODOS.S

View File

@ -198,85 +198,6 @@ dealcint ldy #$01 zero out interrupt vector
clc clc
rts rts
*-------------------------------------- *--------------------------------------
XDOS.IRQV
* lda accsav get acc from where old ROM put it.
* sta p8areg
* stx p8xreg entry point on ram card interrupt
* sty p8yreg
* tsx
* stx p8sreg
* lda irqflag irq flag = 0 if old roms
* bne .1 and 1 if new roms.
* pla restore return address and p-reg.
* sta p8preg
* pla
* sta intadr interrupt return address
* pla
* sta intadr+1
*.1
* txs
* lda mslot set up to re-enable $Cn00 rom
* sta irqdev+2
ldx #$FA save 6 bytes of page 0
.2 lda $00,x
sta svzerop-$FA,x
inx
bne .2
* poll interrupt routines for a claimer
ldx #0
.3 stx irqXindex
lda inttbl+1,x test for a valid routine.
beq .4 branch if no routine.
jsr gointX execute
bcc irqdone
.4 ldx irqXindex
inx
inx
cpx #10
bne .3
inc irqcount allow 255 unclaimed interrupts
bne irqdone before system death.
lda #$01 bad irq so
jsr sysdeath kill the system.
irqdone ldx #$FA
H31AE lda svzerop-$FA,x restore the zero page
sta $00,x
inx
bne H31AE
* lda irqflag check for old roms.
* bne H31DD branch if new roms.
* ldy p8yreg restore registers.
* ldx p8xreg
* lda CLRC8ROM re-enable i/o card.
*irqdev lda $C100 Cn is self modifying.
* lda irqdev+2 restore device id.
* sta mslot slot being accessed.
*H31DD jmp GP.IrqExit do necessary bank switches and return.
rti
*irqflag .HS 00 0 = old roms. 1 = new roms.
irqcount .HS 00 # of unclaimed interrupts.
irqXindex .HS 00
svzerop .HS 000000000000
gointX jmp (inttbl,x) interrupt routine x
XDOS.syserr sta p8error P8 error code XDOS.syserr sta p8error P8 error code
plx plx
plx pop 1 level of return plx pop 1 level of return
@ -433,7 +354,8 @@ setprefx jsr setpath call is made to detect if a null path.
bcc H3333 path ok. bcc H3333 path ok.
ldy pathbuf is it a null pathname? ldy pathbuf is it a null pathname?
bne pfxerr error if not bne pfxerr error if not
jsr stypfx indicate null prefix sty newpfxptr fix appletalk PFI bug
sty preflag prefix flag
clc no error clc no error
rts rts
H3333 jsr findfile go find specified prefix directory. H3333 jsr findfile go find specified prefix directory.
@ -455,7 +377,8 @@ H334D tay
bcc errsyn then error bcc errsyn then error
tax tax
jsr stapfx sta newpfxptr
sta preflag
lda d_dev save device # lda d_dev save device #
sta p_dev sta p_dev
lda d_frst and address of 1st block lda d_frst and address of 1st block

View File

@ -612,7 +612,7 @@ L39D4 lda vnptr make path ptr same as volume ptr
jsr mvdevnums copy all device #'s to be examined. jsr mvdevnums copy all device #'s to be examined.
lda devnum log current device 1st before searching lda devnum log current device 1st before searching
bne L39F1 others. bne L39F1 others.
L39E2 ldx numdevs scan look list for devices we need L39E2 ldx GP.numdevs scan look list for devices we need
L39E5 lda loklst,x to search for the requested volume. L39E5 lda loklst,x to search for the requested volume.
bne L39F4 branch if we've a device to look at. bne L39F4 branch if we've a device to look at.
dex dex
@ -621,7 +621,7 @@ L39ED lda #MLI.E.VNOTFND no mounted volume
sec error sec error
L39F0 rts L39F0 rts
L39F1 ldx numdevs now remove the device from the list L39F1 ldx GP.numdevs now remove the device from the list
L39F4 cmp loklst,x of prospective devices. L39F4 cmp loklst,x of prospective devices.
beq L39FE branch if match. beq L39FE branch if match.
dex look until found. dex look until found.
@ -645,13 +645,13 @@ L3A16 lda #$02 go read root dir into gbuf
jsr cmppnam is this the volume ? jsr cmppnam is this the volume ?
bcs L39E2 if not bcs L39E2 if not
L3A29 rts L3A29 rts
mvdevnums ldx numdevs copy all dev #'s to be checked. mvdevnums ldx GP.numdevs copy all dev #'s to be checked.
L3A2D lda devlist,x active device list. L3A2D lda devlist,x active device list.
and #$F0 strip device type info. and #$F0 strip device type info.
sta loklst,x copy them to a temp workspace sta loklst,x copy them to a temp workspace
dex dex
bpl L3A2D bpl L3A2D
ldx numdevs ldx GP.numdevs
rts rts
fnddvcb lda #$00 look for vcb with this device# fnddvcb lda #$00 look for vcb with this device#
ldy #$FF ldy #$FF

View File

@ -576,10 +576,7 @@ L4F65 and #$44 mask all but write allowed and write
lda #$2B else return write protected error. lda #$2B else return write protected error.
L4F6D sec L4F6D sec
L4F6E rts L4F6E rts
spvectlo .HS 0000000000000000 storage for low byte of smartport entry.
.HS 00000000000000
spvecthi .HS 0000000000000000 storage for high byte of smartport entry.
.HS 00000000000000
statparms .HS 03 # of parms (always 3 except format) statparms .HS 03 # of parms (always 3 except format)
sp_unitnum .HS 00 unit number sp_unitnum .HS 00 unit number
sp_bufptr .HS 0000 data buffer sp_bufptr .HS 0000 data buffer
@ -643,7 +640,7 @@ deathmsg .HS 20
.AS -"RESTART SYSTEM-$01" .AS -"RESTART SYSTEM-$01"
.HS 20 .HS 20
*** work space *** XDOS.DATA .DUMMY
* note: this area is accessed by code that depends on the order of these * note: this area is accessed by code that depends on the order of these
* variables in the file control block and temporary directory. * variables in the file control block and temporary directory.
@ -753,13 +750,27 @@ bufaddrl .HS 00
bufaddrh .HS 00 bufaddrh .HS 00
delflag .HS 00 used by 'detree' to know if called from delete (destroy). delflag .HS 00 used by 'detree' to know if called from delete (destroy).
* variables used by mli for smartport interface
spstatlist .HS 00000000
spunit .HS 0000000000000000
.HS 0000000000000000
spvectlo .HS 0000000000000000 storage for low byte of smartport entry.
.HS 00000000000000
spvecthi .HS 0000000000000000 storage for high byte of smartport entry.
.HS 00000000000000
cortflag .HS 00 cortland flag. 1 = Cortland system (must stay within page boundary)
XDOS.DATA.LEN .EQ *-XDOS.DATA
.ED
* zero fill to page boundary - 3 ($FEFD). so that cortland flag stays within page boundary. * zero fill to page boundary - 3 ($FEFD). so that cortland flag stays within page boundary.
.LIST ON .LIST ON
XDOS.FREE .EQ $FEFD-* (ProDOS 2.0.3 = $0C) XDOS.FREE .EQ $FF00-*-XDOS.DATA.LEN (ProDOS 2.0.3 = $0C)
.LIST OFF .LIST OFF
.BS XDOS.FREE
.DA calldisp
cortflag .HS 00 cortland flag. 1 = Cortland system (must stay within page boundary)
*-------------------------------------- *--------------------------------------
XDOS.LEN .EQ *-XDOS.START XDOS.LEN .EQ *-XDOS.START
MAN MAN

View File

@ -954,16 +954,9 @@ docheck lda A4L command #.
rts end of obj xrw_0 rts end of obj xrw_0
.LIST ON .LIST ON
XRW.FREE .EQ $D6EC-* (ProDOS 2.0.3 = $02) XRW.FREE .EQ $D700-* (ProDOS 2.0.3 = $02)
.LIST OFF .LIST OFF
.BS XRW.FREE pad bytes to $D6EC (pathbuf-$14) .BS XRW.FREE
* variables used by mli for smartport interface
spstatlist .HS 00000000 ref pathbuf-$14 smartport status list buffer
spunit .HS 0000000000000000 ref pathbuf-$10 smartport unit numbers
.HS 0000000000000000
* pathname buffer starts at this page boundary (pathbuf = $D700)
*-------------------------------------- *--------------------------------------
XRW.LEN .EQ *-XRW.START XRW.LEN .EQ *-XRW.START
MAN MAN

View File

@ -173,9 +173,9 @@ ZPBLOfsHBits .BS 1
ZPBLLenBits .BS 1 ZPBLLenBits .BS 1
.ED .ED
*-------------------------------------- *--------------------------------------
.INB USR/SRC/PRODOS.FX/PRODOS.S.LDR.A .INB USR/SRC/PRODOS.FX/PRODOS.S.LDR
.INB USR/SRC/PRODOS.FX/PRODOS.S.LDR.B
.INB USR/SRC/SHARED/X.UNPAK.S .INB USR/SRC/SHARED/X.UNPAK.S
*--------------------------------------
PAKME.Table PAKME.Table
PAKME.ILDR .DA ILDR PAKME.ILDR .DA ILDR
PAKME.GP .DA GP PAKME.GP .DA GP
@ -184,6 +184,7 @@ PAKME.XDOS .DA XDOS
PAKME.IRQ .DA IRQ PAKME.IRQ .DA IRQ
PAKME.RAM .DA RAM PAKME.RAM .DA RAM
PAKME.RAMX .DA RAMX PAKME.RAMX .DA RAMX
PAKME.NCLK .DA NCLK
PAKME.TCLK .DA TCLK PAKME.TCLK .DA TCLK
PAKME.CCLK .DA CCLK PAKME.CCLK .DA CCLK
PAKME.SEL1 .DA SEL1 PAKME.SEL1 .DA SEL1
@ -236,6 +237,12 @@ RAMX .DA #0
.INB USR/SRC/PRODOS.FX/PRODOS.S.RAMX .INB USR/SRC/PRODOS.FX/PRODOS.S.RAMX
.EP .EP
NCLK .DA #0
.DA NCLK.LEN
.PH $D742
.INB USR/SRC/PRODOS.FX/PRODOS.S.NCLK
.EP
TCLK .DA #0 TCLK .DA #0
.DA TCLK.LEN .DA TCLK.LEN
.PH $D742 .PH $D742
@ -262,7 +269,7 @@ SEL2 .DA #0
*-------------------------------------- *--------------------------------------
.AS "PAKME" TAG .AS "PAKME" TAG
.DA $2000 BIN ORG .DA $2000 BIN ORG
.DA #11 Chunk Count .DA #12 Chunk Count
.DA PAKME.Table Chunks .DA PAKME.Table Chunks
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -355,10 +355,10 @@ SLOTS .DA #0
SLOTS.MAX .EQ *-SLOTS SLOTS.MAX .EQ *-SLOTS
*-------------------------------------- *--------------------------------------
FILENAME .AZ "${ROOT}A2osX.KCONFIG" FILENAME .AZ "${ROOT}A2osX.KCONFIG"
MSG.TOPBAR .AZ "\e[37;100m\ec\e[7m\e[1;1HA2osX Kernel Config Utility : " MSG.TOPBAR .AZ "\e[40;37m\e[7m\e[1;1HA2osX Kernel Config Utility : "
MSG.TOPBAR.OK .AZ "KCONFIG File Successfully Loaded. \e[0m" MSG.TOPBAR.OK .AZ "KCONFIG File Successfully Loaded. \e[0m"
MSG.TOPBAR.KO .AZ "Invalid/missing KCONFIG File. \e[0m" MSG.TOPBAR.KO .AZ "Invalid/missing KCONFIG File. \e[0m"
MSG.STATUSBAR .AZ "\e[37;100m\e[7m\e[24;1HSlot 1-7:En/Dis Ctrl:(Q)uit,(S)ave,(T)iming,(C)HRoot,(P)reemptive,TT(Y)s \e[0m" MSG.STATUSBAR .AZ "\e[40;37m\e[7m\e[24;1HSlot 1-7:En/Dis Ctrl:(Q)uit,(S)ave,(T)iming,(C)HRoot,(P)reemptive,TT(Y)s \e[0m"
MSG.KCONF .AZ "\e[93;44m\e[2;1H------ Actual Kernel Configuration ------\e[K\r\n" MSG.KCONF .AZ "\e[93;44m\e[2;1H------ Actual Kernel Configuration ------\e[K\r\n"
MSG.FCONF .AZ "\e[93;44m\e[13;1H------ KCONFIG File Configuration -------\e[K\r\n" MSG.FCONF .AZ "\e[93;44m\e[13;1H------ KCONFIG File Configuration -------\e[K\r\n"
MSG.HZ .AZ " Machine Timing : %d0 Hz\e[K\r\n" MSG.HZ .AZ " Machine Timing : %d0 Hz\e[K\r\n"

View File

@ -443,6 +443,7 @@ CPU.Init.6502 >PUSHBI 0
bpl .3 bpl .3
lda IO.IIC.CLRVBLIRQ yes, clear IRQ lda IO.IIC.CLRVBLIRQ yes, clear IRQ
lda #0 wait for UP again
.3 ldy #4 (2) .3 ldy #4 (2)