mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-25 20:33:13 +00:00
Kernel 0.93+
This commit is contained in:
parent
8d65f92fa0
commit
3ebca5bfa7
Binary file not shown.
@ -3,9 +3,9 @@ NEW
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
BUF.InsertClipboard
|
||||
ldy #hClipBoard
|
||||
lda (pData),y
|
||||
>LDA.G hClipBoard
|
||||
beq .8
|
||||
|
||||
>SYSCALL GetMemPtr
|
||||
>STYA ClipboardPtr
|
||||
jsr BUF.ComputeCOffset
|
||||
@ -21,16 +21,18 @@ BUF.InsertClipboard
|
||||
ply
|
||||
jsr BUF.GetNewYA
|
||||
bcs .9
|
||||
|
||||
>LDYA BUF.COffset
|
||||
jsr BUF.Start2YA
|
||||
|
||||
jsr BUF.CopyClipboard
|
||||
jsr BUF.CopyTail
|
||||
.4 ldy #ClipboardLen
|
||||
lda (pData),y
|
||||
|
||||
>LDA.G ClipboardLen
|
||||
clc
|
||||
adc BufLen
|
||||
sta BufLen
|
||||
|
||||
iny
|
||||
lda (pData),y
|
||||
adc BufLen+1
|
||||
@ -42,18 +44,18 @@ BUF.InsertClipboard
|
||||
BUF.InsertA sta TmpByte
|
||||
jsr BUF.ComputeCOffset
|
||||
cpy #255
|
||||
bne .10
|
||||
clc
|
||||
rts
|
||||
.10 lda BufLen
|
||||
beq .8
|
||||
|
||||
lda BufLen
|
||||
clc
|
||||
adc #2
|
||||
pha
|
||||
tay
|
||||
lda BufLen+1
|
||||
adc #0
|
||||
ply
|
||||
|
||||
jsr BUF.GetNewYA
|
||||
bcs .9
|
||||
|
||||
>LDYA BUF.COffset
|
||||
jsr BUF.Start2YA
|
||||
|
||||
@ -62,14 +64,14 @@ BUF.InsertA sta TmpByte
|
||||
inc BufPtr
|
||||
bne .3
|
||||
inc BufPtr+1
|
||||
|
||||
.3 jsr BUF.CopyTail
|
||||
.4 lda BufLen
|
||||
clc
|
||||
adc #1
|
||||
sta BufLen
|
||||
bcc .9
|
||||
|
||||
.4 inc BufLen
|
||||
bne .8
|
||||
inc BufLen+1
|
||||
clc
|
||||
|
||||
.8 clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
BUF.DelSel jsr BUF.GetSelLen
|
||||
@ -84,6 +86,7 @@ BUF.DelSel jsr BUF.GetSelLen
|
||||
iny
|
||||
bne .1
|
||||
inc
|
||||
|
||||
.1 jsr BUF.GetNewYA
|
||||
bcs .9
|
||||
|
||||
@ -97,6 +100,7 @@ BUF.DelSel jsr BUF.GetSelLen
|
||||
adc SelLen+1
|
||||
sta BufPtrBackup+1
|
||||
jsr BUF.CopyTail
|
||||
|
||||
lda BufLen
|
||||
sec
|
||||
sbc SelLen
|
||||
@ -125,11 +129,14 @@ BUF.DelCharAtCursor
|
||||
inc BufPtrBackup
|
||||
bne .4
|
||||
inc BufPtrBackup+1
|
||||
|
||||
.4 jsr BUF.CopyTail
|
||||
|
||||
lda BufLen
|
||||
bne .5
|
||||
dec BufLen+1
|
||||
.5 dec BufLen
|
||||
|
||||
jsr BUF.ResetSel
|
||||
pla Get back deleted char
|
||||
|
||||
@ -139,19 +146,24 @@ BUF.DelCharAtCursor
|
||||
BUF.SelToClipboard
|
||||
jsr BUF.GetSelLen
|
||||
bcs .8
|
||||
|
||||
>LDA.G hClipBoard
|
||||
beq .1
|
||||
|
||||
>SYSCALL FreeMem
|
||||
>STZ.G hClipBoard
|
||||
|
||||
.1 >LDYA SelLen
|
||||
>SYSCALL GetMem
|
||||
bcs .9
|
||||
|
||||
>STYA ClipboardPtr
|
||||
txa
|
||||
>STA.G hClipBoard
|
||||
ldy #hBuffer
|
||||
lda (pData),y
|
||||
|
||||
>LDA.G hBuffer
|
||||
>SYSCALL GetMemPtr
|
||||
|
||||
pha
|
||||
tya
|
||||
* clc
|
||||
@ -161,9 +173,10 @@ BUF.SelToClipboard
|
||||
pla
|
||||
>ADC.G SelStart+1
|
||||
sta BufPtr+1
|
||||
|
||||
lda SelLen
|
||||
ldy #ClipBoardLen
|
||||
sta (pData),y
|
||||
>STA.G ClipBoardLen
|
||||
|
||||
eor #$ff
|
||||
tax
|
||||
iny
|
||||
@ -171,17 +184,23 @@ BUF.SelToClipboard
|
||||
sta (pData),y
|
||||
eor #$ff
|
||||
pha
|
||||
|
||||
ldy #0
|
||||
|
||||
.2 inx
|
||||
bne .3
|
||||
|
||||
pla
|
||||
inc
|
||||
beq .8
|
||||
|
||||
pha
|
||||
|
||||
.3 lda (BufPtr),y
|
||||
sta (ClipboardPtr),y
|
||||
iny
|
||||
bne .2
|
||||
|
||||
inc BufPtr+1
|
||||
inc ClipboardPtr+1
|
||||
bra .2
|
||||
@ -197,26 +216,34 @@ BUF.CopyClipboard
|
||||
lda (pData),y
|
||||
eor #$ff
|
||||
pha
|
||||
|
||||
ldy #0
|
||||
|
||||
.1 inx
|
||||
bne .2
|
||||
|
||||
pla
|
||||
inc
|
||||
beq .3
|
||||
|
||||
pha
|
||||
|
||||
.2 lda (ClipboardPtr),y
|
||||
sta (BufPtr),y
|
||||
iny
|
||||
bne .1
|
||||
|
||||
inc ClipboardPtr+1
|
||||
inc BufPtr+1
|
||||
bra .1
|
||||
|
||||
.3 tya
|
||||
clc
|
||||
adc ClipboardPtr
|
||||
sta ClipboardPtr
|
||||
bcc BUF.CopyAddY
|
||||
inc ClipboardPtr+1
|
||||
|
||||
BUF.CopyAddY tya
|
||||
clc
|
||||
adc BufPtr
|
||||
@ -230,13 +257,17 @@ BUF.Start2YA eor #$ff
|
||||
tya
|
||||
eor #$ff
|
||||
tax
|
||||
|
||||
ldy #0
|
||||
|
||||
.1 inx
|
||||
bne .2
|
||||
pla
|
||||
inc
|
||||
beq .3
|
||||
|
||||
pha
|
||||
|
||||
.2 lda (BufPtrBackup),y
|
||||
sta (BufPtr),y
|
||||
iny
|
||||
@ -245,6 +276,7 @@ BUF.Start2YA eor #$ff
|
||||
inc BufPtrBackup+1
|
||||
inc BufPtr+1
|
||||
bra .1
|
||||
|
||||
.3 tya
|
||||
clc
|
||||
adc BufPtrBackup
|
||||
@ -258,8 +290,10 @@ BUF.CopyTail ldy #0
|
||||
.1 lda (BufPtrBackup),y
|
||||
sta (BufPtr),y
|
||||
beq .8
|
||||
|
||||
iny
|
||||
bne .1
|
||||
|
||||
inc BufPtrBackup+1
|
||||
inc BufPtr+1
|
||||
bra .1
|
||||
@ -274,8 +308,7 @@ BUF.ComputeCOffset
|
||||
|
||||
phy save line length
|
||||
|
||||
ldy #FileX
|
||||
lda (pData),y
|
||||
>LDA.G FileX
|
||||
clc
|
||||
adc BUF.LOffset
|
||||
sta BUF.COffset
|
||||
@ -289,27 +322,37 @@ BUF.ComputeCOffset
|
||||
clc
|
||||
.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
|
||||
adc #0
|
||||
tax
|
||||
dey
|
||||
lda (pData),y
|
||||
pla
|
||||
|
||||
BUF.GetLineAX sta BUF.TmpLine1
|
||||
stx BUF.TmpLine1+1
|
||||
|
||||
stz BUF.LOffset
|
||||
stz BUF.LOffset+1
|
||||
|
||||
ldy #hBuffer
|
||||
lda (pData),y
|
||||
>LDA.G hBuffer
|
||||
>SYSCALL GetMemPtr
|
||||
>STYA BufPtr
|
||||
|
||||
stz BUF.TmpLine2
|
||||
stz BUF.TmpLine2+1
|
||||
|
||||
.1 ldy #0
|
||||
|
||||
.2 lda (BufPtr),y
|
||||
beq .7
|
||||
|
||||
cmp #C.CR
|
||||
beq .3
|
||||
iny
|
||||
@ -318,15 +361,18 @@ BUF.GetLineAX sta BUF.TmpLine1
|
||||
.3 lda BUF.TmpLine1
|
||||
cmp BUF.TmpLine2
|
||||
bne .4
|
||||
|
||||
lda BUF.TmpLine1+1
|
||||
cmp BUF.TmpLine2+1
|
||||
beq .8
|
||||
|
||||
.4 tya
|
||||
sec
|
||||
adc BufPtr
|
||||
sta BufPtr
|
||||
bcc .5
|
||||
inc BufPtr+1
|
||||
|
||||
.5 tya
|
||||
sec
|
||||
adc BUF.LOffset
|
||||
@ -338,36 +384,60 @@ BUF.GetLineAX sta BUF.TmpLine1
|
||||
bne .1
|
||||
inc BUF.TmpLine2+1
|
||||
bra .1
|
||||
|
||||
.7 lda BUF.TmpLine1
|
||||
cmp BUF.TmpLine2
|
||||
bne .9
|
||||
|
||||
lda BUF.TmpLine1+1
|
||||
cmp BUF.TmpLine2+1
|
||||
bne .9
|
||||
|
||||
.8 clc Y = Line length
|
||||
rts
|
||||
|
||||
.9 sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
BUF.GetNewYA phy
|
||||
pha
|
||||
BUF.GetNewYA tax In 256 bytes page to avoid fragmentation
|
||||
|
||||
tya
|
||||
beq .10
|
||||
inx
|
||||
|
||||
.10 phx
|
||||
|
||||
>LDA.G hBufferBackup
|
||||
beq .1
|
||||
|
||||
>SYSCALL FreeMem
|
||||
|
||||
.1 >LDA.G hBuffer
|
||||
>STA.G hBufferBackup
|
||||
|
||||
>SYSCALL GetMemPtr
|
||||
>STYA BufPtrBackup
|
||||
|
||||
>STZ.G hBuffer
|
||||
|
||||
pla
|
||||
ply
|
||||
ldy #0
|
||||
|
||||
>SYSCALL GetMem
|
||||
bcs .9
|
||||
>STYA BufPtr
|
||||
txa
|
||||
>STA.G hBuffer
|
||||
|
||||
>LDA.G bSaved
|
||||
beq .8
|
||||
|
||||
jsr SCRN.UpdateTopBar
|
||||
bcs .9
|
||||
|
||||
>STZ.G bSaved
|
||||
.8
|
||||
* clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
BUF.ResetSel lda #$ff
|
||||
@ -378,7 +448,7 @@ BUF.ResetSel lda #$ff
|
||||
sta (pData),y
|
||||
|
||||
iny #SelEnd
|
||||
inc
|
||||
inc lda #0
|
||||
sta (pData),y
|
||||
iny
|
||||
sta (pData),y
|
||||
@ -392,6 +462,7 @@ BUF.CheckSelected
|
||||
iny
|
||||
sbc (pData),y
|
||||
bcc .9 CC:COffset < SelStart
|
||||
|
||||
iny #SelEnd
|
||||
lda (pData),y
|
||||
clc
|
||||
|
@ -30,17 +30,18 @@ NEW
|
||||
*--------------------------------------
|
||||
Prompt.Editor cmp #C.DEL
|
||||
beq Ctrl.DEL
|
||||
|
||||
cmp #C.SPACE
|
||||
bcc .3
|
||||
|
||||
jsr BUF.InsertA
|
||||
bcs .9
|
||||
|
||||
jsr SCRN.UpdateCurrentLine
|
||||
bcs .9
|
||||
jsr Ctrl.FS
|
||||
bcs .9
|
||||
|
||||
.8 clc
|
||||
jmp Ctrl.FS
|
||||
|
||||
.9 rts
|
||||
|
||||
.3 asl
|
||||
@ -72,7 +73,7 @@ Ctrl.A lda #PromptModeHelp
|
||||
stz .1+1
|
||||
.1 ldy #0
|
||||
ldx #0
|
||||
jsr GotoXY
|
||||
jsr SCRN.GotoXY
|
||||
lda (ZPPTR1)
|
||||
beq .8
|
||||
>PUSHW ZPPTR1
|
||||
@ -118,8 +119,12 @@ Ctrl.F lda #PromptModeFind
|
||||
Ctrl.G ldy #FileX
|
||||
lda (pData),y
|
||||
beq .8
|
||||
|
||||
lda #0
|
||||
sta (pData),y
|
||||
|
||||
jsr BUF.ComputeCOffset
|
||||
|
||||
jmp SCRN.UpdateViewPort
|
||||
|
||||
.8 clc
|
||||
@ -132,31 +137,33 @@ Ctrl.BS ldy #FileX
|
||||
dec
|
||||
sta (pData),y
|
||||
bra .3
|
||||
|
||||
.1 ldy #FileY+1
|
||||
lda (pData),y
|
||||
tax
|
||||
dey
|
||||
ora (pData),y
|
||||
beq .8
|
||||
|
||||
lda (pData),y
|
||||
bne .2
|
||||
|
||||
dex
|
||||
|
||||
.2 dec
|
||||
jsr BUF.GetLineAX
|
||||
bcs .8
|
||||
|
||||
tya
|
||||
ldy #FileX
|
||||
sta (pData),y
|
||||
sec
|
||||
ldy #FileY
|
||||
lda (pData),y
|
||||
sbc #1
|
||||
sta (pData),y
|
||||
iny
|
||||
lda (pData),y
|
||||
sbc #0
|
||||
sta (pData),y
|
||||
.3 jmp SCRN.UpdateViewPort
|
||||
|
||||
>DECW.G FileY
|
||||
|
||||
.3 jsr BUF.ComputeCOffset
|
||||
|
||||
jmp SCRN.UpdateViewPort
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -164,31 +171,21 @@ Ctrl.TAB
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
Ctrl.LF ldy #FileY+1
|
||||
lda (pData),y
|
||||
tax
|
||||
dey
|
||||
lda (pData),y
|
||||
inc
|
||||
bne .1
|
||||
inx
|
||||
.1 jsr BUF.GetLineAX
|
||||
Ctrl.LF jsr BUF.GetNextLine
|
||||
bcs .8
|
||||
|
||||
tya Y = line length
|
||||
ldy #FileX
|
||||
cmp (pData),y
|
||||
bcs .2
|
||||
|
||||
sta (pData),y
|
||||
.2 ldy #FileY
|
||||
lda (pData),y
|
||||
inc
|
||||
sta (pData),y
|
||||
bne .3
|
||||
iny
|
||||
lda (pData),y
|
||||
inc
|
||||
sta (pData),y
|
||||
.3 jmp SCRN.UpdateViewPort
|
||||
|
||||
.2 >INCW.G FileY
|
||||
|
||||
jsr BUF.ComputeCOffset
|
||||
|
||||
jmp SCRN.UpdateViewPort
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -198,35 +195,39 @@ Ctrl.VT ldy #FileY+1
|
||||
dey
|
||||
ora (pData),y
|
||||
beq .8
|
||||
|
||||
lda (pData),y
|
||||
bne .1
|
||||
|
||||
dex
|
||||
|
||||
.1 dec
|
||||
jsr BUF.GetLineAX
|
||||
bcs .8
|
||||
|
||||
tya Y = line length
|
||||
ldy #FileX
|
||||
cmp (pData),y
|
||||
bcs .2
|
||||
sta (pData),y
|
||||
.2 sec
|
||||
ldy #FileY
|
||||
lda (pData),y
|
||||
sbc #1
|
||||
sta (pData),y
|
||||
iny
|
||||
lda (pData),y
|
||||
sbc #0
|
||||
sta (pData),y
|
||||
|
||||
.2 >DECW.G FileY
|
||||
|
||||
jsr BUF.ComputeCOffset
|
||||
|
||||
jmp SCRN.UpdateViewPort
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
Ctrl.L jsr BUF.GetLine
|
||||
bcs .8
|
||||
|
||||
tya Y = line length
|
||||
ldy #FileX
|
||||
sta (pData),y
|
||||
|
||||
jsr BUF.ComputeCOffset
|
||||
|
||||
jmp SCRN.UpdateViewPort
|
||||
|
||||
.8 clc
|
||||
@ -236,9 +237,8 @@ Ctrl.CR lda #C.CR
|
||||
jsr BUF.InsertA
|
||||
bcs .9
|
||||
|
||||
ldy #FileX
|
||||
lda #0
|
||||
sta (pData),y
|
||||
>STZ.G FileX
|
||||
|
||||
jmp SCRN.UpdateMain
|
||||
|
||||
.9 rts
|
||||
@ -259,6 +259,7 @@ Ctrl.O ldy #FileY+1
|
||||
txa
|
||||
sbc #0
|
||||
bcc .8
|
||||
|
||||
ldy #FileY+1
|
||||
sta (pData),y
|
||||
dey
|
||||
@ -268,7 +269,10 @@ Ctrl.O ldy #FileY+1
|
||||
ldy #FileX
|
||||
sta (pData),y
|
||||
|
||||
jsr BUF.ComputeCOffset
|
||||
|
||||
jmp SCRN.UpdateViewPort
|
||||
|
||||
.8 pla
|
||||
jmp Ctrl.T
|
||||
*--------------------------------------
|
||||
@ -280,9 +284,10 @@ Ctrl.P ldy #FileY+1
|
||||
ldy #ViewPortH
|
||||
clc
|
||||
adc (pData),y
|
||||
|
||||
bcc .1
|
||||
|
||||
inx
|
||||
|
||||
.1 pha
|
||||
phx
|
||||
jsr BUF.GetLineAX A,X = FileY+PAGE
|
||||
@ -299,32 +304,42 @@ Ctrl.P ldy #FileY+1
|
||||
dey
|
||||
pla
|
||||
sta (pData),y
|
||||
|
||||
jsr BUF.ComputeCOffset
|
||||
|
||||
jmp SCRN.UpdateViewPort
|
||||
|
||||
.8 pla
|
||||
pla
|
||||
jmp Ctrl.Y
|
||||
*--------------------------------------
|
||||
Ctrl.Q lda #$FF
|
||||
>STA.G bCANCEL
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
Ctrl.R lda #PromptModeReplace
|
||||
>STA.G PromptMode
|
||||
jmp SCRN.UpdateStatusBar
|
||||
*--------------------------------------
|
||||
Ctrl.Q lda #$FF
|
||||
>STA.G bCANCEL
|
||||
|
||||
>LDA.G bSaved
|
||||
beq Ctrl.S
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
Ctrl.S 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
|
||||
|
||||
@ -332,10 +347,13 @@ Ctrl.S lda #PromptModeSave
|
||||
*--------------------------------------
|
||||
Ctrl.T >STZ.G FileX
|
||||
>STZW.G FileY
|
||||
>DEBUG
|
||||
jsr BUF.ComputeCOffset
|
||||
jmp SCRN.UpdateViewPort
|
||||
*--------------------------------------
|
||||
Ctrl.FS jsr BUF.GetLine
|
||||
bcs .8
|
||||
|
||||
tya Y = line length
|
||||
ldy #FileX
|
||||
cmp (pData),y
|
||||
@ -345,28 +363,17 @@ Ctrl.FS jsr BUF.GetLine
|
||||
inc
|
||||
sta (pData),y
|
||||
bra .3
|
||||
.1 ldy #FileY+1
|
||||
lda (pData),y
|
||||
tax
|
||||
dey
|
||||
lda (pData),y
|
||||
inc
|
||||
bne .2
|
||||
inx
|
||||
.2 jsr BUF.GetLineAX
|
||||
|
||||
.1 jsr BUF.GetNextLine
|
||||
bcs .8
|
||||
ldy #FileY CC
|
||||
lda (pData),y
|
||||
adc #1
|
||||
sta (pData),y
|
||||
iny
|
||||
lda (pData),y
|
||||
adc #0
|
||||
sta (pData),y
|
||||
ldy #FileX
|
||||
lda #0
|
||||
sta (pData),y
|
||||
.3 jmp SCRN.UpdateViewPort
|
||||
|
||||
>INCW.G FileY
|
||||
|
||||
>STZ.G FileX
|
||||
|
||||
.3 jsr BUF.ComputeCOffset
|
||||
|
||||
jmp SCRN.UpdateViewPort
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -424,26 +431,23 @@ Ctrl.Y ldy #FileY+1
|
||||
lda (pData),y
|
||||
inc
|
||||
bne .1
|
||||
|
||||
inx
|
||||
|
||||
.1 jsr BUF.GetLineAX
|
||||
|
||||
bcs .2
|
||||
|
||||
ldy #FileY
|
||||
lda (pData),y
|
||||
inc
|
||||
sta (pData),y
|
||||
bne Ctrl.Y
|
||||
iny
|
||||
lda (pData),y
|
||||
inc
|
||||
sta (pData),y
|
||||
>INCW.G FileY
|
||||
bra Ctrl.Y
|
||||
|
||||
.2 jsr BUF.GetLine
|
||||
|
||||
tya Y = line length
|
||||
>STA.G FileX
|
||||
|
||||
jsr BUF.ComputeCOffset
|
||||
|
||||
jmp SCRN.UpdateViewPort
|
||||
*--------------------------------------
|
||||
Ctrl.Z jsr BUF.ComputeCOffset
|
||||
@ -454,6 +458,7 @@ Ctrl.Z jsr BUF.ComputeCOffset
|
||||
lda BUF.COffset+1
|
||||
eor BufLen+1
|
||||
bne .1
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
@ -492,6 +497,7 @@ Prompt.Replace cmp #3
|
||||
jsr SCRN.UpdateStatusBar
|
||||
bcs .9
|
||||
rts
|
||||
|
||||
.1 cmp #C.CR
|
||||
bne .2
|
||||
.2
|
||||
@ -505,6 +511,7 @@ Prompt.Save cmp #3 Ctrl-C
|
||||
|
||||
>STZ.G PromptMode
|
||||
bra .80
|
||||
|
||||
.1 cmp #C.CR
|
||||
bne .2
|
||||
>LDA.G PromptBufPtr
|
||||
@ -522,9 +529,10 @@ Prompt.Save cmp #3 Ctrl-C
|
||||
>STZ.G PromptMode
|
||||
jsr SaveFile
|
||||
bcc .81
|
||||
.12 jsr SCRN.UpdateStatusBarErrA
|
||||
bcs .9
|
||||
rts
|
||||
|
||||
.12 jsr SCRN.LineBufInit
|
||||
jmp SCRN.UpdateStatusBarErrA
|
||||
|
||||
.2 cmp #C.DEL
|
||||
bne .3
|
||||
>LDA.G PromptBufPtr
|
||||
@ -538,12 +546,14 @@ Prompt.Save cmp #3 Ctrl-C
|
||||
bra .80
|
||||
.3 cmp #C.SPACE
|
||||
bcc .8
|
||||
|
||||
pha
|
||||
>LDA.G PromptBufPtr
|
||||
tay
|
||||
pla
|
||||
cpy #PromptBufMax
|
||||
beq .8
|
||||
|
||||
sta (pData),y
|
||||
iny
|
||||
lda #0
|
||||
@ -551,8 +561,10 @@ Prompt.Save cmp #3 Ctrl-C
|
||||
tya
|
||||
>STA.G PromptBufPtr
|
||||
bra .80
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
|
||||
.81 jsr SCRN.UpdateTopBar
|
||||
bcs .9
|
||||
.80 jmp SCRN.UpdateStatusBar
|
||||
|
@ -16,6 +16,7 @@ SCRN.Init >LDYAI 510+5+5+4+1 potentially 255*\\ NORM,INV,CEOL & \0
|
||||
>LDYA L.SEQ.INIT
|
||||
>SYSCALL printf
|
||||
bcs .9
|
||||
|
||||
lda #0
|
||||
|
||||
ldy #FileX
|
||||
@ -41,21 +42,49 @@ SCRN.Init >LDYAI 510+5+5+4+1 potentially 255*\\ NORM,INV,CEOL & \0
|
||||
jsr SCRN.UpdateMain
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
SCRN.UpdateTopBar
|
||||
lda #1
|
||||
jsr SCRN.InvLineA
|
||||
SCRN.UpdateTopBar
|
||||
jsr SCRN.LineBufInit
|
||||
|
||||
>PUSHBI 1
|
||||
>PUSHBI 1
|
||||
>PUSHBI 2
|
||||
>LDYA L.MSG.GOTOXY
|
||||
>SYSCALL printf
|
||||
bcs .9
|
||||
|
||||
>LDA.G hFileName
|
||||
beq .1
|
||||
|
||||
>SYSCALL GetMemPtr
|
||||
bra .2
|
||||
|
||||
.1 >LDYA L.MSG.NEWFILE
|
||||
|
||||
.2 >PUSHYA
|
||||
>PUSHBI 2
|
||||
>LDYA L.MSG.TOPBAR
|
||||
>SYSCALL printf
|
||||
.9 rts
|
||||
>PUSHW L.MSG.TOPBAR
|
||||
>LDYA ZPPTR1
|
||||
>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
|
||||
sta TmpIndex
|
||||
@ -67,6 +96,7 @@ SCRN.UpdateMain >LDA.G ScreenY
|
||||
sta TmpByte
|
||||
>LDA.G ViewPortH
|
||||
sta TmpCount
|
||||
|
||||
.1 lda TmpIndex
|
||||
ldx TmpIndex+1
|
||||
jsr BUF.GetLineAX Y = line length
|
||||
@ -75,24 +105,31 @@ SCRN.UpdateMain >LDA.G ScreenY
|
||||
lda TmpByte
|
||||
jsr SCRN.UpdateLineAtALenY
|
||||
bcs SCRN.UpdateMain.9
|
||||
|
||||
.3 inc TmpByte
|
||||
inc TmpIndex
|
||||
bne .4
|
||||
|
||||
inc TmpIndex+1
|
||||
.4 dec TmpCount
|
||||
bne .1
|
||||
|
||||
jmp SCRN.GotoCurXCurY
|
||||
|
||||
.5 ldx #0
|
||||
ldy TmpByte
|
||||
jsr GotoXY
|
||||
jsr SCRN.GotoXY
|
||||
bcs SCRN.UpdateMain.9
|
||||
|
||||
>PUSHBI 0
|
||||
>LDYA L.SEQ.CEOL
|
||||
>SYSCALL printf
|
||||
bcs SCRN.UpdateMain.9
|
||||
|
||||
inc TmpByte
|
||||
dec TmpCount
|
||||
bne .5
|
||||
|
||||
jmp SCRN.GotoCurXCurY
|
||||
|
||||
SCRN.UpdateMain.9
|
||||
@ -122,15 +159,27 @@ SCRN.UpdateLineAtALenY
|
||||
sty TmpLen
|
||||
ldx #0
|
||||
tay
|
||||
jsr GotoXY
|
||||
jsr SCRN.GotoXY
|
||||
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
|
||||
tax
|
||||
>LDA.G ScreenX
|
||||
cmp TmpLen
|
||||
bcs .8
|
||||
|
||||
tay
|
||||
clc
|
||||
adc BUF.LOffset
|
||||
@ -138,6 +187,7 @@ SCRN.UpdateLineAtALenY
|
||||
lda #0
|
||||
adc BUF.LOffset+1
|
||||
sta BUF.COffset+1
|
||||
|
||||
tya
|
||||
* clc
|
||||
adc BufPtr
|
||||
@ -147,43 +197,45 @@ SCRN.UpdateLineAtALenY
|
||||
|
||||
.1 lda (BufPtr)
|
||||
beq .8
|
||||
|
||||
cmp #C.CR
|
||||
beq .8
|
||||
|
||||
jsr BUF.CheckSelected
|
||||
eor bSelected
|
||||
bpl .5
|
||||
|
||||
jsr SCRN.ToggleSel
|
||||
|
||||
.5 lda (BufPtr)
|
||||
cmp #'\'
|
||||
beq .50
|
||||
cmp #'%'
|
||||
bne .51
|
||||
|
||||
.50 pha
|
||||
lda #'\'
|
||||
jsr SCRN.ToLineBuf
|
||||
pla
|
||||
|
||||
.51 jsr SCRN.ToLineBuf
|
||||
inc BufPtr
|
||||
bne .6
|
||||
inc BufPtr+1
|
||||
|
||||
.6 inc BUF.COffset
|
||||
bne .7
|
||||
inc BUF.COffset+1
|
||||
.7 dex
|
||||
bne .1
|
||||
|
||||
.8 bit bSelected
|
||||
bpl .80
|
||||
jsr SCRN.ToggleSel
|
||||
|
||||
.80 ldy #0
|
||||
|
||||
.81 lda SEQ.CEOL,y
|
||||
beq .82
|
||||
.80 lda #0
|
||||
jsr SCRN.ToLineBuf
|
||||
iny
|
||||
bra .81
|
||||
.82 sta (ZPPTR1)
|
||||
|
||||
>PUSHBI 0
|
||||
>LDYA LineBufPtr
|
||||
>SYSCALL printf
|
||||
@ -194,6 +246,7 @@ SCRN.ToggleSel ldy #0
|
||||
eor #$ff
|
||||
sta bSelected
|
||||
bpl .1
|
||||
|
||||
ldy #6
|
||||
|
||||
.1 lda SEQ.NORM,y
|
||||
@ -202,88 +255,99 @@ SCRN.ToggleSel ldy #0
|
||||
iny
|
||||
bra .1
|
||||
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
SCRN.ToLineBuf sta (ZPPTR1)
|
||||
inc ZPPTR1
|
||||
bne .8
|
||||
inc ZPPTR1+1
|
||||
.8 rts
|
||||
.8
|
||||
SCRN.ToggleSel.RTS
|
||||
rts
|
||||
*--------------------------------------
|
||||
SCRN.UpdateStatusBar
|
||||
jsr SCRN.LineBufInit
|
||||
|
||||
>PUSHBI 1
|
||||
>PUSHB.G ScreenH
|
||||
>PUSHBI 2
|
||||
>LDYA L.MSG.GOTOXY
|
||||
>SYSCALL printf
|
||||
bcs .9
|
||||
>PUSHBI 0
|
||||
>LDYA L.SEQ.INV
|
||||
>SYSCALL printf
|
||||
bcs .9
|
||||
bcs SCRN.ToggleSel.RTS
|
||||
|
||||
>LDA.G PromptMode
|
||||
bne .2
|
||||
|
||||
>LDA.G FileY
|
||||
tax
|
||||
iny
|
||||
lda (pData),y
|
||||
inx
|
||||
bne .1
|
||||
|
||||
inc
|
||||
|
||||
.1 >PUSHA
|
||||
txa
|
||||
>PUSHA
|
||||
>LDA.G FileX
|
||||
inc
|
||||
>PUSHA
|
||||
|
||||
>PUSHW BUF.COffset
|
||||
>PUSHW BufLen
|
||||
|
||||
>PUSHBI 5
|
||||
>LDYA L.MSG.STATUSBAR
|
||||
>SYSCALL printf
|
||||
bcs .9
|
||||
lda #58
|
||||
jsr SCRN.ClearEOLA
|
||||
bcs .9
|
||||
>PUSHBI 0
|
||||
>LDYA L.SEQ.NORM
|
||||
>PUSHBI 7
|
||||
bra SCRN.UpdateStatusBarOut
|
||||
*--------------------------------------
|
||||
.2 eor #PromptModeHelp
|
||||
beq .3
|
||||
|
||||
>PUSHW pData
|
||||
lda #2
|
||||
.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
|
||||
bcs .9
|
||||
|
||||
jmp SCRN.GotoCurXCurY
|
||||
.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
|
||||
.1 jsr BUF.ComputeCOffset
|
||||
bcc .8
|
||||
@ -294,53 +358,16 @@ SCRN.CursorAdjust
|
||||
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
SCRN.ClearEOLA pha
|
||||
|
||||
.1 pla
|
||||
ldy #ScreenW
|
||||
cmp (pData),y
|
||||
bcs .8
|
||||
inc
|
||||
pha
|
||||
lda #' '
|
||||
>SYSCALL PutChar
|
||||
bcc .1
|
||||
plx
|
||||
SCRN.LineBufInit
|
||||
>LDYA LineBufPtr
|
||||
>STYA ZPPTR1
|
||||
rts
|
||||
.8 clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
SCRN.InvLineA sta .2+1
|
||||
lda #1
|
||||
>PUSHA
|
||||
lda .2+1
|
||||
>PUSHA
|
||||
>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.ToLineBuf sta (ZPPTR1)
|
||||
inc ZPPTR1
|
||||
bne .8
|
||||
inc ZPPTR1+1
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
SCRN.GotoCurXCurY
|
||||
ldy #CurX
|
||||
@ -349,7 +376,8 @@ SCRN.GotoCurXCurY
|
||||
ldy #CurY
|
||||
lda (pData),y
|
||||
tay
|
||||
GotoXY txa
|
||||
|
||||
SCRN.GotoXY txa
|
||||
inc
|
||||
>PUSHA
|
||||
tya
|
||||
@ -359,22 +387,25 @@ GotoXY txa
|
||||
>PUSHBI 2
|
||||
>LDYA L.MSG.GOTOXY
|
||||
>SYSCALL printf
|
||||
GotoXY.RTS rts
|
||||
SCRN.GotoXY.RTS rts
|
||||
*--------------------------------------
|
||||
SCRN.UpdateViewPort
|
||||
lda #$ff
|
||||
sta bNotRepaint
|
||||
|
||||
.1 ldy #FileX
|
||||
lda (pData),y
|
||||
ldy #ScreenX
|
||||
cmp (pData),y
|
||||
bcs .2 out of left border ?
|
||||
|
||||
ldy #ScreenX yes
|
||||
lda (pData),y
|
||||
dec
|
||||
sta (pData),y
|
||||
stz bNotRepaint
|
||||
bra .1
|
||||
|
||||
.2 clc
|
||||
ldy #ScreenX
|
||||
lda (pData),y
|
||||
@ -384,12 +415,14 @@ SCRN.UpdateViewPort
|
||||
ldy #FileX
|
||||
cmp (pData),y
|
||||
bcs .3 out of right border ?
|
||||
|
||||
ldy #ScreenX
|
||||
lda (pData),y
|
||||
inc
|
||||
sta (pData),y
|
||||
stz bNotRepaint
|
||||
bra .2
|
||||
|
||||
.3 ldy #FileY+1
|
||||
lda (pData),y
|
||||
tax
|
||||
@ -401,6 +434,7 @@ SCRN.UpdateViewPort
|
||||
txa
|
||||
sbc (pData),y
|
||||
bcs .4 out of top border ?
|
||||
|
||||
ldy #ScreenY move viewport up one line....
|
||||
lda (pData),y
|
||||
sbc #0 CC from BCS
|
||||
@ -411,8 +445,10 @@ SCRN.UpdateViewPort
|
||||
sta (pData),y
|
||||
bit bNotRepaint
|
||||
bpl .3
|
||||
|
||||
jsr SCRN.scrollDn ...and move content one line down
|
||||
bcs GotoXY.RTS
|
||||
bcs SCRN.GotoXY.RTS
|
||||
|
||||
.4 ldy #ScreenY+1
|
||||
lda (pData),y
|
||||
tax
|
||||
@ -422,13 +458,16 @@ SCRN.UpdateViewPort
|
||||
clc
|
||||
adc (pData),y
|
||||
bcc .41
|
||||
|
||||
inx
|
||||
|
||||
.41 ldy #FileY A,X = screen bottom
|
||||
cmp (pData),y
|
||||
txa
|
||||
iny FileY > screen bottom ?
|
||||
sbc (pData),y
|
||||
bcs .5 CS : fileY>= screen bottom
|
||||
|
||||
* clc from BCS
|
||||
ldy #ScreenY move viewport down one line....
|
||||
lda (pData),y
|
||||
@ -440,9 +479,11 @@ SCRN.UpdateViewPort
|
||||
sta (pData),y
|
||||
bit bNotRepaint
|
||||
bpl .4
|
||||
|
||||
jsr SCRN.scrollUp ...and move content one line up
|
||||
bcs .9
|
||||
bra .4
|
||||
|
||||
.5 sec
|
||||
ldy #FileX
|
||||
lda (pData),y
|
||||
@ -459,10 +500,13 @@ SCRN.UpdateViewPort
|
||||
sta (pData),y
|
||||
bit bNotRepaint
|
||||
bmi .6
|
||||
|
||||
jsr SCRN.UpdateMain
|
||||
bcs .9
|
||||
|
||||
.6 jsr SCRN.UpdateStatusBar
|
||||
bcs .9
|
||||
|
||||
jmp SCRN.GotoCurXCurY
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
|
@ -24,19 +24,20 @@ BUF.TmpLine2 .BS 2
|
||||
|
||||
BufLen .BS 2
|
||||
SelLen .BS 2
|
||||
bNotRepaint .BS 1
|
||||
bSelected .BS 1
|
||||
|
||||
|
||||
ZPPTR1 .BS 2
|
||||
TmpLen .BS 2
|
||||
TmpIndex .BS 2
|
||||
|
||||
ZPPTR1 .BS 2
|
||||
|
||||
TmpCount .BS 1
|
||||
TmpByte .BS 1
|
||||
bNotRepaint .BS 1
|
||||
bSelected .BS 1
|
||||
|
||||
ZS.END .ED
|
||||
*--------------------------------------
|
||||
PromptBufMax .EQ 64
|
||||
*--------------------------------------
|
||||
PromptModeHelp .EQ 2
|
||||
PromptModeFind .EQ 4
|
||||
PromptModeReplace .EQ 6
|
||||
@ -67,16 +68,15 @@ L.SEQ.INIT .DA SEQ.INIT
|
||||
L.SEQ.RESET .DA SEQ.RESET
|
||||
L.SEQ.SCROLLUP .DA SEQ.SCROLLUP
|
||||
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.BAR .DA SEQ.BAR
|
||||
L.MSG.TOPBAR .DA MSG.TOPBAR
|
||||
L.MSG.STATUSBAR .DA MSG.STATUSBAR
|
||||
L.MSG.STATUSBAR.H .DA MSG.STATUSBAR.H
|
||||
L.MSG.STATUSBAR.F .DA MSG.STATUSBAR.F
|
||||
L.MSG.STATUSBAR.R .DA MSG.STATUSBAR.R
|
||||
L.MSG.STATUSBAR.S .DA MSG.STATUSBAR.S
|
||||
L.MSG.STATUSBAR.E .DA MSG.STATUSBAR.E
|
||||
.DA MSG.STATUSBAR.H
|
||||
.DA MSG.STATUSBAR.F
|
||||
.DA MSG.STATUSBAR.R
|
||||
.DA MSG.STATUSBAR.S
|
||||
.DA MSG.STATUSBAR.E
|
||||
L.MSG.NEWFILE .DA MSG.NEWFILE
|
||||
L.MSG.GOTOXY .DA MSG.GOTOXY
|
||||
L.MSG.HELPLINE .DA MSG.HELPLINE
|
||||
@ -127,11 +127,14 @@ CS.RUN >PUSHBI 0
|
||||
>LDYA L.SEQ.DETECT
|
||||
>SYSCALL printf Send Query for term W & H
|
||||
bcs CS.RUN.RTS
|
||||
|
||||
.1 >SYSCALL GetChar
|
||||
bcs CS.RUN.RTS
|
||||
|
||||
jsr CharIn
|
||||
>LDA.G ScreenW Wait for Response from terminal for W & H
|
||||
beq .1
|
||||
|
||||
lda #1
|
||||
>SYSCALL ArgV
|
||||
bcs .2 No arg, new file....
|
||||
@ -143,23 +146,30 @@ CS.RUN >PUSHBI 0
|
||||
|
||||
cmp #E.OOM
|
||||
beq CS.RUN.RTS
|
||||
|
||||
.2 >LDYAI 1 buffer size = 0 (+ 1 for ending 0)
|
||||
>SYSCALL GetMem0
|
||||
bcs CS.RUN.RTS
|
||||
|
||||
txa
|
||||
>STA.G hBuffer BufLen already set to 0
|
||||
|
||||
.3 lda #$ff
|
||||
>STA.G bSaved
|
||||
|
||||
jsr SCRN.Init
|
||||
bcs CS.RUN.RTS
|
||||
|
||||
CS.RUN.LOOP >SYSCALL GetChar
|
||||
bcs CS.RUN.RTS I/O error
|
||||
jsr CharIn
|
||||
bcs .9
|
||||
|
||||
>LDA.G bCancel
|
||||
bpl CS.RUN.LOOP
|
||||
|
||||
lda #0
|
||||
|
||||
.9 pha
|
||||
>PUSHBI 0
|
||||
>LDYA L.SEQ.RESET
|
||||
@ -212,6 +222,7 @@ CharIn tax
|
||||
bcc .8
|
||||
jsr CharIn.Esc
|
||||
bcs .8 Not translated, exit
|
||||
|
||||
.1 cmp #C.ESC
|
||||
bne .2
|
||||
|
||||
@ -222,6 +233,7 @@ CharIn tax
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
|
||||
.2 pha
|
||||
>LDA.G PromptMode
|
||||
tax
|
||||
@ -229,6 +241,7 @@ CharIn tax
|
||||
jmp (J.PROMPT,x)
|
||||
*--------------------------------------
|
||||
CharIn.Esc >STZ.G bEscMode
|
||||
|
||||
ldy #EscBuffer
|
||||
lda (pData),y
|
||||
clc
|
||||
@ -236,23 +249,30 @@ CharIn.Esc >STZ.G bEscMode
|
||||
tay
|
||||
lda (pData),y
|
||||
ldx EscChars
|
||||
.1 cmp EscChars,x
|
||||
|
||||
.1 cmp EscChars,x
|
||||
beq .2
|
||||
dex
|
||||
bne .1
|
||||
|
||||
cmp #'R' Response to cursor position query?
|
||||
beq .3
|
||||
|
||||
sec
|
||||
rts
|
||||
|
||||
.2 lda EscAscii,x
|
||||
clc
|
||||
rts
|
||||
|
||||
.3 stz TmpByte
|
||||
|
||||
ldy #EscBuffer+1
|
||||
|
||||
.4 lda (pData),y
|
||||
cmp #';'
|
||||
beq .5
|
||||
|
||||
and #$0f
|
||||
pha
|
||||
lda TmpByte
|
||||
@ -268,24 +288,30 @@ CharIn.Esc >STZ.G bEscMode
|
||||
sta TmpByte
|
||||
iny
|
||||
bra .4
|
||||
|
||||
.5 phy
|
||||
|
||||
lda TmpByte
|
||||
ldy #ScreenH
|
||||
sta (pData),y
|
||||
>STA.G ScreenH
|
||||
|
||||
dec Remove 2 (top & status bar) for viewportH
|
||||
dec
|
||||
ldy #ViewPortH
|
||||
sta (pData),y
|
||||
|
||||
>STA.G ViewPortH
|
||||
|
||||
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
|
||||
stz TmpByte
|
||||
|
||||
iny
|
||||
|
||||
.6 lda (pData),y
|
||||
cmp #'R'
|
||||
beq .7
|
||||
|
||||
and #$0f
|
||||
pha
|
||||
lda TmpByte
|
||||
@ -301,9 +327,10 @@ CharIn.Esc >STZ.G bEscMode
|
||||
sta TmpByte
|
||||
iny
|
||||
bra .6
|
||||
|
||||
.7 lda TmpByte
|
||||
ldy #ScreenW
|
||||
sta (pData),y
|
||||
>STA.G ScreenW
|
||||
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -327,17 +354,22 @@ LoadFile >PUSHWZ Aux type
|
||||
ldy #0
|
||||
|
||||
ldx #0
|
||||
|
||||
.1 lda (BufPtrBackup),y
|
||||
beq .8
|
||||
|
||||
cpx #C.CR
|
||||
bne .2
|
||||
|
||||
cmp #C.LF
|
||||
beq .5
|
||||
|
||||
.2 cmp #C.SPACE
|
||||
bcs .3
|
||||
|
||||
cmp #C.CR
|
||||
bne .5
|
||||
|
||||
.3 sta (BufPtr)
|
||||
inc BufPtr
|
||||
bne .4
|
||||
@ -345,16 +377,19 @@ LoadFile >PUSHWZ Aux type
|
||||
.4 inc BufLen
|
||||
bne .5
|
||||
inc BufLen+1
|
||||
|
||||
.5 tax set previous char
|
||||
iny
|
||||
bne .1
|
||||
|
||||
inc BufPtrBackup+1
|
||||
bra .1
|
||||
|
||||
.8 sta (BufPtr)
|
||||
clc
|
||||
.9 jmp BUF.ResetSel
|
||||
*--------------------------------------
|
||||
SaveFile >PUSHWZ Aux type
|
||||
SaveFile >PUSHWZ Aux type
|
||||
>PUSHBI S.FI.T.TXT
|
||||
>PUSHBI O.CREATE+O.WRONLY
|
||||
>LDA.G hFileName
|
||||
@ -380,9 +415,14 @@ SaveFile >PUSHWZ Aux type
|
||||
pla
|
||||
sec
|
||||
rts
|
||||
|
||||
.1 pla
|
||||
>SYSCALL FClose.9
|
||||
rts
|
||||
>SYSCALL FClose
|
||||
|
||||
lda #$80
|
||||
>STA.G bSaved
|
||||
jsr SCRN.UpdateTopBar
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
.INB USR/SRC/BIN/EDIT.S.BUF
|
||||
.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.SCROLLUP .AZ "\e[%d;%dH\eD"
|
||||
SEQ.SCROLLDN .AZ "\e[%d;%dH\eM"
|
||||
SEQ.BAR .AS "\e[40;37m\e[7m%s" +SEQ.NORM
|
||||
SEQ.NORM .AZ "\e[0m"
|
||||
SEQ.INV .AZ "\e[7m"
|
||||
SEQ.EDIT .AS "\e[93;44m" +SEQ.CEOL
|
||||
SEQ.CEOL .AZ "\e[K"
|
||||
MSG.TOPBAR .AZ "\e[1;1HA2osX Edit:%s\e[0m"
|
||||
MSG.STATUSBAR .AZ "Press Ctrl-A For Help Length:%5D,Col:%3d,Line:%5D"
|
||||
MSG.TOPBAR .AZ "A2osX Edit:%s"
|
||||
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.F .AZ "Find:%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.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)"
|
||||
>PSTR "------------"
|
||||
>PSTR " Ctrl-A : This help screen"
|
||||
|
@ -48,7 +48,7 @@ CL.READN0A >PUSHA
|
||||
CL.CHARIN tax
|
||||
|
||||
>LDA.G CL.bEscMode \e ?
|
||||
beq .13
|
||||
beq .4
|
||||
|
||||
cpx #'['
|
||||
beq .8 \e[
|
||||
@ -59,40 +59,40 @@ CL.CHARIN tax
|
||||
|
||||
ldx #EscChars.Cnt-1
|
||||
|
||||
.17 cmp EscChars,x
|
||||
beq .18
|
||||
.1 cmp EscChars,x
|
||||
beq .2
|
||||
|
||||
dex
|
||||
bpl .17
|
||||
bpl .1
|
||||
|
||||
.8 rts invalid \e[ sequence
|
||||
|
||||
.18 >LDA.G READ.N
|
||||
bne .19
|
||||
.2 >LDA.G READ.N
|
||||
bne .3
|
||||
|
||||
lda EscChars.Remap,x
|
||||
bra CL.READN0A
|
||||
|
||||
.19 txa
|
||||
.3 txa
|
||||
asl
|
||||
tax
|
||||
jmp (J.ESC,x)
|
||||
*--------------------------------------
|
||||
.13 cpx #C.ESC
|
||||
bne .11
|
||||
.4 cpx #C.ESC
|
||||
bne .5
|
||||
|
||||
lda #$ff
|
||||
>STA.G CL.bEscMode
|
||||
clc
|
||||
rts
|
||||
|
||||
.11 >LDA.G READ.N
|
||||
.5 >LDA.G READ.N
|
||||
beq CL.READN0X
|
||||
|
||||
cpx #C.SPACE
|
||||
bcc CL.CHARIN.CTRL
|
||||
|
||||
.1 cpx #C.DEL
|
||||
cpx #C.DEL
|
||||
bne CL.Insert
|
||||
*--------------------------------------
|
||||
* Erase char BEFORE cursor
|
||||
@ -102,10 +102,13 @@ CL.CHARIN tax
|
||||
>LDA.G CL.Ptr
|
||||
beq .8
|
||||
|
||||
>LDA.G bREAD.S
|
||||
bmi .6
|
||||
|
||||
lda #C.BS
|
||||
>SYSCALL PutChar
|
||||
|
||||
>DEC.G CL.Ptr
|
||||
.6 >DEC.G CL.Ptr
|
||||
jmp CL.DEL
|
||||
*--------------------------------------
|
||||
CL.Insert >LDA.G CL.Len
|
||||
@ -116,6 +119,7 @@ CL.Insert >LDA.G CL.Len
|
||||
>STA.G CL.Len
|
||||
|
||||
pha
|
||||
|
||||
.1 ply
|
||||
dey
|
||||
lda (ZPCLBuf),y Move from Ptr To end of buffer forward...
|
||||
@ -128,6 +132,7 @@ CL.Insert >LDA.G CL.Len
|
||||
bne .1
|
||||
|
||||
ply Y=CL.Ptr
|
||||
|
||||
* >LDA.G CL.Ptr
|
||||
|
||||
txa
|
||||
@ -136,6 +141,7 @@ CL.Insert >LDA.G CL.Len
|
||||
|
||||
>LDA.G bREAD.S
|
||||
bmi .7
|
||||
|
||||
txa
|
||||
>SYSCALL PutChar
|
||||
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
|
||||
dec
|
||||
bne .8
|
||||
|
||||
lda #$ff
|
||||
>STA.G CL.bReady
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -207,10 +215,13 @@ CL.RESET.1 >STA.G CL.Ptr
|
||||
*--------------------------------------
|
||||
CL.BS >LDA.G CL.Ptr
|
||||
beq .9
|
||||
|
||||
dec
|
||||
sta (pData),y
|
||||
|
||||
>LDA.G bREAD.S
|
||||
bmi .9
|
||||
|
||||
lda #C.BS
|
||||
>SYSCALL PutChar
|
||||
.9 rts
|
||||
@ -248,6 +259,10 @@ CL.DEL pha
|
||||
bne .1
|
||||
pla
|
||||
>DEC.G CL.Len
|
||||
>LDA.G bREAD.S
|
||||
bpl CL.PrintEOL
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CL.PrintEOL >LDA.G CL.Ptr
|
||||
.1 >CMP.G CL.Len
|
||||
|
@ -354,6 +354,7 @@ CMD.ECHO.RTS rts
|
||||
*--------------------------------------
|
||||
CMD.READ lda (ZPArgVBufPtr)
|
||||
beq .9
|
||||
|
||||
stz ZPVarNamePtr+1
|
||||
>STZ.G bREAD.S
|
||||
dec
|
||||
@ -406,6 +407,7 @@ CMD.READ lda (ZPArgVBufPtr)
|
||||
beq .9
|
||||
|
||||
CMD.READ.VAR jsr CL.Reset
|
||||
|
||||
.1 >SYSCALL GetChar
|
||||
bcs CMD.READ.VAR.9
|
||||
|
||||
|
@ -25,7 +25,7 @@ drivertbl2 .DA nodevice
|
||||
.DA nodevice
|
||||
.DA nodevice
|
||||
.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
|
||||
.HS 00000000000000
|
||||
.DA #0
|
||||
|
@ -6,35 +6,38 @@ ILDR.START jsr MLI check for file 'atinit'
|
||||
.DA gfi_list
|
||||
bcc gfi_ok branch if 'atinit' file found
|
||||
|
||||
cmp #$46 file not found?
|
||||
cmp #MLI.E.FNOTFND
|
||||
beq H23DF if so, continue loading interpreter
|
||||
bne H23E2
|
||||
|
||||
gfi_ok lda gfi_type
|
||||
cmp #$E2 is 'atinit' correct file type?
|
||||
bne H23E2 error - wrong file type
|
||||
|
||||
jsr MLI open 'atinit' file
|
||||
.DA #$C8
|
||||
.DA #MLIOPEN
|
||||
.DA atopen
|
||||
bne H23E2 error
|
||||
lda #$9F max size = 39.75k ($2000-$BF00)
|
||||
sta rdlen+1
|
||||
stz rdlen
|
||||
jsr MLI read 'atinit' file to 'sysentry'
|
||||
.DA #$CA
|
||||
.DA #MLIREAD
|
||||
.DA rdparm
|
||||
bne H23E2 error - too big
|
||||
jsr MLI close 'atinit' file
|
||||
.DA #$CC
|
||||
.DA #MLICLOSE
|
||||
.DA clparm
|
||||
bne H23E2 error
|
||||
lda RROMBNK2 enable ROM
|
||||
jsr sysentry execute ATinit
|
||||
H23DF jmp goloadint execute .system file
|
||||
|
||||
H23DF jmp ILDR.SYSTEM execute .system file
|
||||
|
||||
* fatal error
|
||||
|
||||
H23E2 ldx $23F0 BUG: should be ATINIT.ERR
|
||||
H23E5 lda $23F0,x BUG: should be ATINIT.ERR
|
||||
H23E2 ldx ATINIT.ERR
|
||||
H23E5 lda ATINIT.ERR,x
|
||||
sta vline16,x
|
||||
dex
|
||||
bne H23E5
|
||||
@ -54,11 +57,12 @@ atopen .HS 03
|
||||
.HS 01 ref# hard coded since no other files
|
||||
atinitname .DA #06 length of name
|
||||
.AS -"atinit" name of appletalk config file
|
||||
goloadint
|
||||
lda /dbuf search directory buffer
|
||||
*--------------------------------------
|
||||
ILDR.SYSTEM lda /dbuf search directory buffer
|
||||
sta idxl+1
|
||||
lda #$04 start 1 entry past header
|
||||
bne H2434 always.
|
||||
|
||||
H2432 lda idxl calc next entry position
|
||||
H2434 clc
|
||||
adc dbuf+35 inc to next entry address
|
||||
@ -72,6 +76,7 @@ H2434 clc
|
||||
cmp #$09 end of directory?
|
||||
bne H244D no.
|
||||
jmp nointrp no interpreter, go quit.
|
||||
|
||||
H244D lda #$04 reset index to 1st entry in next block.
|
||||
sta idxl
|
||||
H2451 inc idxl+1 inc to next page.
|
||||
@ -147,6 +152,7 @@ H24C8 jsr MLI close interpreter file
|
||||
bne H24DF if not.
|
||||
sta KBDSTROBE clear keyboard
|
||||
H24DF lda RROMBNK2 enable ROM
|
||||
|
||||
jmp sysentry go run interpreter
|
||||
|
||||
cflag .HS 00 set if a //c.
|
||||
@ -167,13 +173,17 @@ H24FA lda iomess,y
|
||||
dex
|
||||
dey
|
||||
bpl H24FA
|
||||
bmi H2511
|
||||
bra *
|
||||
|
||||
toolong ldy #$1E
|
||||
|
||||
H2508 lda lgmess,y
|
||||
sta vline16+5,y
|
||||
dey
|
||||
bpl H2508
|
||||
H2511 bmi H2511
|
||||
|
||||
bra *
|
||||
|
||||
lgmess .AS -"** System program too large **"
|
||||
iomess .AS -"** Unable to load"
|
||||
.AS -" X.System *********"
|
||||
|
@ -6,36 +6,35 @@ NEW
|
||||
* $2D9B-2DFF moved to $FF9B-FFFF
|
||||
*--------------------------------------
|
||||
IRQ.START
|
||||
* pha
|
||||
* lda accsav
|
||||
* sta oldacc
|
||||
* pla
|
||||
* sta accsav
|
||||
XDOS.IRQV ldx #$FA save 6 bytes of page 0
|
||||
|
||||
* pla get status register from stack
|
||||
* pha and put it back.
|
||||
* and #$10 is it a break or interrupt?
|
||||
* bne H2DC2 branch if break.
|
||||
.2 lda $00,x
|
||||
sta svzerop-$FA,x
|
||||
inx
|
||||
bne .2
|
||||
|
||||
* lda $D000 get ram bankid (LC1 = $D8, LC2=$EE)
|
||||
* eor #$D8 is the system active? ($D8)
|
||||
* beq sysactv branch if it is
|
||||
ldx #0
|
||||
|
||||
* lda #$FF
|
||||
.3 stx irqXindex
|
||||
|
||||
*sysactv sta bankid
|
||||
* sta afbank
|
||||
* lda /aftirq setup return address
|
||||
* pha
|
||||
* lda #aftirq
|
||||
* pha
|
||||
* lda #$04 status reg with interrupt flag set
|
||||
* pha
|
||||
lda inttbl+1,x test for a valid routine.
|
||||
beq .4 branch if no routine.
|
||||
|
||||
*H2DC2 lda /romirq setup ROM re-entry
|
||||
* pha
|
||||
* lda #romirq
|
||||
* pha
|
||||
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.
|
||||
|
||||
.LIST ON
|
||||
IRQ.FREE1 .EQ $ffc8-*
|
||||
@ -53,23 +52,20 @@ lreset lda /resetv-1
|
||||
pha
|
||||
jmp gorom
|
||||
|
||||
*rreset .DA resetv-1 rts to resetv
|
||||
irqdone ldx #$FA
|
||||
|
||||
*fix45 sta p8areg A register savearea
|
||||
* lda oldacc
|
||||
* sta accsav
|
||||
* lda RRAMWRAMBNK1 read/write RAM bank 1
|
||||
* lda RRAMWRAMBNK1
|
||||
* lda afbank
|
||||
* jmp irqxit0
|
||||
.1 lda svzerop-$FA,x restore the zero page
|
||||
sta $00,x
|
||||
inx
|
||||
bne .1
|
||||
|
||||
rti
|
||||
|
||||
stypfx sty newpfxptr fix appletalk PFI bug
|
||||
sty preflag prefix flag
|
||||
rts
|
||||
gointX jmp (inttbl,x) interrupt routine x
|
||||
|
||||
stapfx sta newpfxptr
|
||||
sta preflag
|
||||
rts
|
||||
irqcount .HS 00 # of unclaimed interrupts.
|
||||
irqXindex .HS 00
|
||||
svzerop .HS 000000000000
|
||||
|
||||
.LIST ON
|
||||
IRQ.FREE2 .EQ $fffa-*
|
||||
|
@ -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
|
@ -1,14 +1,25 @@
|
||||
NEW
|
||||
AUTO 3,1
|
||||
|
||||
.MA DEBUG
|
||||
:1 bit $C000
|
||||
bpl :1
|
||||
sta $C010
|
||||
.EM
|
||||
|
||||
H2000 jmp prostart
|
||||
jmp atalkset
|
||||
jmp p16start
|
||||
|
||||
LDR.MSG.0 .AS -"PRODOS FX: "
|
||||
LDR.MSG.0.LEN .EQ *-LDR.MSG.0
|
||||
LDR.MSG.0 .AS "PRODOS FX: "
|
||||
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
|
||||
atalkset inc setuprts set = 1 for appletalk rts
|
||||
p16start inc LDR.BootFlag set = 2 for GQuit rts
|
||||
atalkset inc LDR.BootFlag set = 1 for appletalk rts
|
||||
prostart lda unitnum
|
||||
sta LDR.MLIOL.P+1
|
||||
|
||||
@ -25,6 +36,7 @@ prostart lda unitnum
|
||||
|
||||
ldx #LDR.MSG.0.LEN-1
|
||||
.1 lda LDR.MSG.0,x
|
||||
and #$3F
|
||||
sta $400,x
|
||||
dex
|
||||
bpl .1
|
||||
@ -96,7 +108,12 @@ m64k sta idapple save machine id
|
||||
|
||||
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
|
||||
|
||||
@ -144,6 +161,8 @@ m128k lda #$30 set id = 128k present
|
||||
sta ZPOutBufPtr+1
|
||||
jsr X.Unpak
|
||||
|
||||
jsr lc1in switch in language card bank 1.
|
||||
|
||||
lda PAKME.XRW
|
||||
sta ZPInBufPtr
|
||||
lda PAKME.XRW+1
|
||||
@ -176,6 +195,12 @@ m128k lda #$30 set id = 128k present
|
||||
sta ZPOutBufPtr+1
|
||||
jsr X.Unpak
|
||||
|
||||
ldx #XDOS.DATA.LEN
|
||||
|
||||
.3 stz XDOS.DATA-1,x
|
||||
dex
|
||||
bne .3
|
||||
|
||||
lda PAKME.IRQ
|
||||
sta ZPInBufPtr
|
||||
lda PAKME.IRQ+1
|
||||
@ -189,13 +214,19 @@ m128k lda #$30 set id = 128k present
|
||||
lda kversion
|
||||
sta xdosver save current version for dir use
|
||||
|
||||
lda idapple
|
||||
sta MACHID
|
||||
|
||||
lda cortland
|
||||
beq LDR.II branch if // family
|
||||
|
||||
LDR.IIGS inc cortland it's a Cortland, set loader flag
|
||||
stz vmode force setvid to reset cursor
|
||||
LDR.IIGS stz vmode force setvid to reset cursor
|
||||
jsr setvid reset output to screen
|
||||
|
||||
ldx PAKME.CCLK
|
||||
ldy PAKME.CCLK+1
|
||||
jsr LDR.SetupCLK
|
||||
|
||||
ldx PAKME.SEL2
|
||||
ldy PAKME.SEL2+1
|
||||
|
||||
@ -209,26 +240,9 @@ LDR.IIGS inc cortland it's a Cortland, set loader flag
|
||||
|
||||
ldx PAKME.SEL2
|
||||
ldy PAKME.SEL2+1
|
||||
|
||||
stx ZPInBufPtr
|
||||
sty ZPInBufPtr+1
|
||||
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
|
||||
jsr LDR.SetupQC
|
||||
|
||||
lda LDR.BootFlag
|
||||
bne .1 branch if prodos 8 alone
|
||||
|
||||
* 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
|
||||
* put dispatcher in bank 2 of language card
|
||||
|
||||
LDR.II lda LDR.MLIOL.P+1 place boot devnum in globals
|
||||
sta LDR.MLIRB.P+1
|
||||
sta devnum last device used
|
||||
|
||||
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
|
||||
LDR.II ldx PAKME.SEL1
|
||||
ldy PAKME.SEL1+1
|
||||
jsr LDR.SetupQC
|
||||
|
||||
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
|
||||
|
||||
.2 sta CLRC3ROM
|
||||
lda rommap slot ROM bit map
|
||||
and #$08 mask all but 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
|
||||
* with interrupt routines? if so, enable it else use internal $C300 firmware.
|
||||
@ -396,47 +309,99 @@ hitswtch sta CLRC3ROM
|
||||
.1 sta CLRPAGE2
|
||||
sta CLR80STORE
|
||||
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
|
||||
ora #$02 turn bit 2 on (80-col card is present)
|
||||
lda #MACHID.COL80
|
||||
lda machid machine ID byte
|
||||
trb MACHID clear 80-col bit 2 (no card)
|
||||
bra CLK.Install
|
||||
|
||||
H2244 sta machid
|
||||
H2247 lda cortland are we running on a //gs ?
|
||||
beq H225D if not.
|
||||
lda #$4C enable clock routine by putting a jmp
|
||||
sta clockv in front of clock vector
|
||||
docard lda #MACHID.COL80
|
||||
tsb MACHID turn bit 2 on (80-col card is present)
|
||||
|
||||
CLK.Install jsr LDR.ClkDevScan
|
||||
*--------------------------------------
|
||||
RAMDRV.Install jsr lc1in
|
||||
ldx PAKME.RAM
|
||||
ldy PAKME.RAM+1
|
||||
|
||||
lda PAKME.CCLK
|
||||
sta ZPInBufPtr
|
||||
lda PAKME.CCLK+1
|
||||
sta ZPInBufPtr+1
|
||||
lda #$D742
|
||||
stx ZPInBufPtr
|
||||
sty ZPInBufPtr+1
|
||||
lda #$FF00
|
||||
sta ZPOutBufPtr
|
||||
lda /$D742
|
||||
lda /$FF00
|
||||
sta ZPOutBufPtr+1
|
||||
jsr X.Unpak
|
||||
|
||||
lda #$01 set bit 0 = clock present
|
||||
tsb machid
|
||||
H225D lda setuprts get setup entry point flag
|
||||
beq H2267 taken if normal boot.
|
||||
sta SETWRITEAUX
|
||||
|
||||
ldx PAKME.RAMX
|
||||
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
|
||||
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
|
||||
|
||||
H2267 jsr MLI
|
||||
LDR.ReadRoot jsr MLI
|
||||
.DA #MLIONLINE
|
||||
.DA LDR.MLIOL.P
|
||||
bcs relocerr
|
||||
bcs .9
|
||||
|
||||
lda pbuf+1 get volume name length.
|
||||
and #$0F strip devnum
|
||||
beq relocerr
|
||||
beq .9
|
||||
inc add 1 for leading '/'
|
||||
sta pbuf save prefix length.
|
||||
lda #'/' place leading '/' in prefix buffer
|
||||
@ -445,59 +410,50 @@ H2267 jsr MLI
|
||||
jsr MLI
|
||||
.DA #MLISETPREFIX
|
||||
.DA LDR.MLISETP.P
|
||||
bcs relocerr
|
||||
tax =0
|
||||
stx dst
|
||||
ldy #$02 read directory into buffer
|
||||
bcs .9
|
||||
|
||||
stz dst
|
||||
lda /DirBlkBuf
|
||||
H228E sta dst+1
|
||||
sta LDR.MLIRB.P+3
|
||||
sty LDR.MLIRB.P+4
|
||||
stx LDR.MLIRB.P+5
|
||||
ldy #$02 read directory into buffer
|
||||
ldx #0
|
||||
|
||||
.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
|
||||
.DA #MLIREADBLOCK
|
||||
.DA LDR.MLIRB.P
|
||||
bcs relocerr
|
||||
bcs .9
|
||||
|
||||
ldy #$03 get next block# from link
|
||||
lda (dst),y
|
||||
tax
|
||||
dey
|
||||
ora (dst),y if both bytes are the same
|
||||
beq H22B7 then no more blocks of directory.
|
||||
ora (dst),y 00 00 -> Last Block
|
||||
beq .8
|
||||
|
||||
lda (dst),y
|
||||
tay
|
||||
lda dst+1
|
||||
clc
|
||||
adc #$02 add $200 to buffer pointer
|
||||
inc
|
||||
inc add $200 to buffer pointer
|
||||
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
|
||||
|
||||
relocerr sta RROMBNK2
|
||||
.9 sta RROMBNK2
|
||||
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
|
||||
dey
|
||||
bpl .1
|
||||
bpl .91
|
||||
|
||||
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
|
||||
.DA #$60
|
||||
.DA pbuf+1
|
||||
@ -511,40 +467,49 @@ LDR.MLIRB.P
|
||||
.DA 0 2 byte block number
|
||||
|
||||
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
|
||||
.DA $D742 destination
|
||||
.DA TCLK.END-TCLK.START
|
||||
.DA TCLK source
|
||||
lda #$EE byte to distinguish LC bank 2
|
||||
sta $D000
|
||||
jmp lc1in switch in LC bank 1
|
||||
*--------------------------------------
|
||||
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
|
||||
.DA TCLK.START
|
||||
.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 #$4C enable clock routine by putting a jmp
|
||||
sta clockv in front of clock vector
|
||||
|
||||
lda #MACHID.CLK
|
||||
tsb MACHID
|
||||
rts
|
||||
*--------------------------------------
|
||||
* find all disk devices in system slots and set up address
|
||||
* and device table in prodos global page. if there is a disk
|
||||
* card in slot 2 then limit the # of devices in slot 5
|
||||
* smartport to only 2
|
||||
numdev2 .HS 0000000000000000 8 bytes for smartport call
|
||||
driveradr .DA 0
|
||||
d2idx .DA #0
|
||||
diskins2 .DA #0 msb clear if drive in slot 2
|
||||
|
||||
devsrch stz dst
|
||||
*--------------------------------------
|
||||
LDR.BlkDevScan stz dst
|
||||
stz dst+1
|
||||
stz idxl
|
||||
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.
|
||||
sta d2idx
|
||||
|
||||
@ -555,8 +520,10 @@ devsrch stz dst
|
||||
sta idxl+1 check slot 2
|
||||
jsr cmpid is there a disk in slot 2 ?
|
||||
ror diskins2 if so, clear msb else set it.
|
||||
|
||||
lda #$C7 search slots from high to low
|
||||
sta idxl+1
|
||||
|
||||
H26AB jsr cmpid
|
||||
bcs H270C if no ProDOS device in this slot.
|
||||
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.
|
||||
plp get back if it's a disk // (carry).
|
||||
bcc nxtdsk2 if not disk //.
|
||||
|
||||
dex move the list pointer back by 2 devices
|
||||
dex
|
||||
stx numdevs count (-1) active devices
|
||||
stx GP.numdevs count (-1) active devices
|
||||
dec d2idx increase the disk two index
|
||||
dec d2idx
|
||||
ldy d2idx
|
||||
@ -604,8 +572,10 @@ H26E6 sta driveradr+1
|
||||
sta devlist,y move then toward the end of the list
|
||||
lda devlist,x
|
||||
sta devlist+1,y
|
||||
dex back to numdevs again
|
||||
dex back to GP.numdevs again
|
||||
|
||||
nxtdsk2 clc
|
||||
|
||||
H270C jsr sltrom test for ROM in given slot and set flags
|
||||
dec idxl+1 next lower slot.
|
||||
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.
|
||||
* start by making the device count include disk //'s
|
||||
|
||||
ldx numdevs current device count - 1
|
||||
ldx GP.numdevs current device count - 1
|
||||
lda #$0E
|
||||
sec
|
||||
sbc d2idx
|
||||
beq H2747 if there were no disk //'s then done.
|
||||
|
||||
clc
|
||||
adc numdevs sum of disk //'s and others.
|
||||
sta numdevs
|
||||
adc GP.numdevs sum of disk //'s and others.
|
||||
sta GP.numdevs
|
||||
inx move to open space in regular list.
|
||||
ldy #$0D first disk // entry.
|
||||
|
||||
H272F lda devlist,y
|
||||
pha
|
||||
lda devlist,x
|
||||
@ -641,8 +613,9 @@ H272F lda devlist,y
|
||||
sty d2idx use as a temp
|
||||
cpx d2idx
|
||||
bcc H272F continue until indexes cross
|
||||
|
||||
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
|
||||
pha priority.
|
||||
@ -655,7 +628,7 @@ H274C lda devlist,x the boot device will have highest
|
||||
H275A dex
|
||||
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 ?
|
||||
beq H2777
|
||||
lda devnum make boot device 1st in search order.
|
||||
@ -668,48 +641,26 @@ H275A dex
|
||||
sta devlist,x
|
||||
dex
|
||||
bmi H277E branch if only 1 device, 2 drives.
|
||||
|
||||
H2777 pla
|
||||
sta devlist,x
|
||||
dex
|
||||
bpl H2777
|
||||
|
||||
H277E jsr fndtrd save accumulated machine id.
|
||||
beq .1
|
||||
sta machid machine ID byte
|
||||
.1 rts
|
||||
H277E rts
|
||||
|
||||
stadrv ora devid combine with attributes.
|
||||
ldx numdevs
|
||||
ldx GP.numdevs
|
||||
inx put device # into device list.
|
||||
sta devlist,x
|
||||
asl now form drive 2 device number, if any.
|
||||
rts
|
||||
|
||||
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
|
||||
|
||||
.2 ldy #$05
|
||||
ldy #$05
|
||||
lda (idxl),y
|
||||
cmp #$38
|
||||
bne H27E4
|
||||
@ -742,6 +693,7 @@ H27EC cmp (idxl) look for floating bus
|
||||
bne H2801 no rom
|
||||
inx
|
||||
bne H27EC
|
||||
|
||||
H27F3 lda idxl+1 mark a bit in slot byte
|
||||
and #$07 to indicate rom present.
|
||||
tax
|
||||
@ -755,31 +707,6 @@ dskid .HS 082028005803703C
|
||||
* slot bits
|
||||
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).
|
||||
lda idxl+1 get index to global device table
|
||||
and #$07 for this slot...
|
||||
@ -795,7 +722,7 @@ installdev php how many drives (carry).
|
||||
inx else presume that 2nd drive is present.
|
||||
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.
|
||||
lda driveradr get high address of device driver.
|
||||
sta drivertbl1,y device driver table 1.
|
||||
@ -1034,8 +961,8 @@ mount ldx #$0C
|
||||
lda spvect+2
|
||||
sta spvecthi-1,x
|
||||
lda RROMBNK2 write protect lc ram.
|
||||
inc numdevs
|
||||
ldx numdevs
|
||||
inc GP.numdevs
|
||||
ldx GP.numdevs
|
||||
tya
|
||||
lsr
|
||||
cmp #$08
|
||||
@ -1063,6 +990,11 @@ H29EB jsr cmpid is it a disk controller?
|
||||
clc smartport found
|
||||
.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
|
||||
|
||||
LDR.Test128 lda #$EE
|
||||
@ -1103,7 +1035,71 @@ lc1in lda RRAMWRAMBNK1
|
||||
lda RRAMWRAMBNK1
|
||||
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
|
||||
SAVE USR/SRC/PRODOS.FX/PRODOS.S.LDR.A
|
||||
SAVE USR/SRC/PRODOS.FX/PRODOS.S.LDR
|
||||
LOAD USR/SRC/PRODOS.FX/PRODOS.S
|
||||
ASM
|
91
ProDOS.FX/ProDOS.S.NCLK.txt
Normal file
91
ProDOS.FX/ProDOS.S.NCLK.txt
Normal 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
|
@ -74,7 +74,7 @@ H2D6A lda (A1L),y pointers set in card by 'setptr'
|
||||
sp1 .HS 0000
|
||||
a1l1 .BS 13 13 bytes of storage
|
||||
*--------------------------------------
|
||||
RAM.LEN .EQ RAM.START
|
||||
RAM.LEN .EQ *-RAM.START
|
||||
MAN
|
||||
SAVE USR/SRC/PRODOS.FX/PRODOS.S.RAM
|
||||
LOAD USR/SRC/PRODOS.FX/PRODOS.S
|
||||
|
@ -307,14 +307,6 @@ ex1 sta passit+1 also used by blockwrite
|
||||
clc transfer card to main
|
||||
clv use standard zeropage/stack
|
||||
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
|
||||
MAN
|
||||
|
@ -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
|
@ -26,7 +26,7 @@ L5D16 stz memmap,x P8 memory bitmap
|
||||
|
||||
* drive selector
|
||||
|
||||
ldx numdevs get device count and
|
||||
ldx GP.numdevs get device count and
|
||||
stx lstpntr store in zero page.
|
||||
lda devnum get last slot/drive
|
||||
bne volname
|
||||
@ -35,7 +35,7 @@ ds2 ldx lstpntr get device list pointer.
|
||||
lda devlist,x get unit number from list.
|
||||
cpx #$01 make sure it's real.
|
||||
bcs L5D3F if so, change list pointer.
|
||||
ldx numdevs get device count.
|
||||
ldx GP.numdevs get device count.
|
||||
inx
|
||||
L5D3F dex decrement list pointer and restore.
|
||||
stx lstpntr
|
||||
@ -399,7 +399,7 @@ rd_refn .HS 01 reference number
|
||||
|
||||
dhdr_len .HS 00 directory header length (actually uses 2 bytes)
|
||||
*--------------------------------------
|
||||
SEL1.LEN .EQ SEL1.START
|
||||
SEL1.LEN .EQ *-SEL1.START
|
||||
MAN
|
||||
SAVE USR/SRC/PRODOS.FX/PRODOS.S.SEL1
|
||||
LOAD USR/SRC/PRODOS.FX/PRODOS.S
|
||||
|
@ -435,7 +435,7 @@ button1 .DA #$0D
|
||||
button2 .DA #$0B
|
||||
.AS "Cancel: Esc"
|
||||
*--------------------------------------
|
||||
SEL2.LEN .EQ SEL2.START
|
||||
SEL2.LEN .EQ *-SEL2.START
|
||||
MAN
|
||||
SAVE USR/SRC/PRODOS.FX/PRODOS.S.SEL2
|
||||
LOAD USR/SRC/PRODOS.FX/PRODOS.S
|
||||
|
@ -198,85 +198,6 @@ dealcint ldy #$01 zero out interrupt vector
|
||||
clc
|
||||
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
|
||||
plx
|
||||
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.
|
||||
ldy pathbuf is it a null pathname?
|
||||
bne pfxerr error if not
|
||||
jsr stypfx indicate null prefix
|
||||
sty newpfxptr fix appletalk PFI bug
|
||||
sty preflag prefix flag
|
||||
clc no error
|
||||
rts
|
||||
H3333 jsr findfile go find specified prefix directory.
|
||||
@ -455,7 +377,8 @@ H334D tay
|
||||
bcc errsyn then error
|
||||
|
||||
tax
|
||||
jsr stapfx
|
||||
sta newpfxptr
|
||||
sta preflag
|
||||
lda d_dev save device #
|
||||
sta p_dev
|
||||
lda d_frst and address of 1st block
|
||||
|
@ -612,7 +612,7 @@ L39D4 lda vnptr make path ptr same as volume ptr
|
||||
jsr mvdevnums copy all device #'s to be examined.
|
||||
lda devnum log current device 1st before searching
|
||||
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.
|
||||
bne L39F4 branch if we've a device to look at.
|
||||
dex
|
||||
@ -621,7 +621,7 @@ L39ED lda #MLI.E.VNOTFND no mounted volume
|
||||
sec error
|
||||
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.
|
||||
beq L39FE branch if match.
|
||||
dex look until found.
|
||||
@ -645,13 +645,13 @@ L3A16 lda #$02 go read root dir into gbuf
|
||||
jsr cmppnam is this the volume ?
|
||||
bcs L39E2 if not
|
||||
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.
|
||||
and #$F0 strip device type info.
|
||||
sta loklst,x copy them to a temp workspace
|
||||
dex
|
||||
bpl L3A2D
|
||||
ldx numdevs
|
||||
ldx GP.numdevs
|
||||
rts
|
||||
fnddvcb lda #$00 look for vcb with this device#
|
||||
ldy #$FF
|
||||
|
@ -576,10 +576,7 @@ L4F65 and #$44 mask all but write allowed and write
|
||||
lda #$2B else return write protected error.
|
||||
L4F6D sec
|
||||
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)
|
||||
sp_unitnum .HS 00 unit number
|
||||
sp_bufptr .HS 0000 data buffer
|
||||
@ -643,7 +640,7 @@ deathmsg .HS 20
|
||||
.AS -"RESTART SYSTEM-$01"
|
||||
.HS 20
|
||||
|
||||
*** work space ***
|
||||
XDOS.DATA .DUMMY
|
||||
|
||||
* note: this area is accessed by code that depends on the order of these
|
||||
* variables in the file control block and temporary directory.
|
||||
@ -753,13 +750,27 @@ bufaddrl .HS 00
|
||||
bufaddrh .HS 00
|
||||
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.
|
||||
.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
|
||||
.BS XDOS.FREE
|
||||
.DA calldisp
|
||||
cortflag .HS 00 cortland flag. 1 = Cortland system (must stay within page boundary)
|
||||
*--------------------------------------
|
||||
XDOS.LEN .EQ *-XDOS.START
|
||||
MAN
|
||||
|
@ -954,16 +954,9 @@ docheck lda A4L command #.
|
||||
rts end of obj xrw_0
|
||||
|
||||
.LIST ON
|
||||
XRW.FREE .EQ $D6EC-* (ProDOS 2.0.3 = $02)
|
||||
XRW.FREE .EQ $D700-* (ProDOS 2.0.3 = $02)
|
||||
.LIST OFF
|
||||
.BS XRW.FREE pad bytes to $D6EC (pathbuf-$14)
|
||||
* 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)
|
||||
.BS XRW.FREE
|
||||
*--------------------------------------
|
||||
XRW.LEN .EQ *-XRW.START
|
||||
MAN
|
||||
|
@ -173,9 +173,9 @@ ZPBLOfsHBits .BS 1
|
||||
ZPBLLenBits .BS 1
|
||||
.ED
|
||||
*--------------------------------------
|
||||
.INB USR/SRC/PRODOS.FX/PRODOS.S.LDR.A
|
||||
.INB USR/SRC/PRODOS.FX/PRODOS.S.LDR.B
|
||||
.INB USR/SRC/PRODOS.FX/PRODOS.S.LDR
|
||||
.INB USR/SRC/SHARED/X.UNPAK.S
|
||||
*--------------------------------------
|
||||
PAKME.Table
|
||||
PAKME.ILDR .DA ILDR
|
||||
PAKME.GP .DA GP
|
||||
@ -184,6 +184,7 @@ PAKME.XDOS .DA XDOS
|
||||
PAKME.IRQ .DA IRQ
|
||||
PAKME.RAM .DA RAM
|
||||
PAKME.RAMX .DA RAMX
|
||||
PAKME.NCLK .DA NCLK
|
||||
PAKME.TCLK .DA TCLK
|
||||
PAKME.CCLK .DA CCLK
|
||||
PAKME.SEL1 .DA SEL1
|
||||
@ -236,6 +237,12 @@ RAMX .DA #0
|
||||
.INB USR/SRC/PRODOS.FX/PRODOS.S.RAMX
|
||||
.EP
|
||||
|
||||
NCLK .DA #0
|
||||
.DA NCLK.LEN
|
||||
.PH $D742
|
||||
.INB USR/SRC/PRODOS.FX/PRODOS.S.NCLK
|
||||
.EP
|
||||
|
||||
TCLK .DA #0
|
||||
.DA TCLK.LEN
|
||||
.PH $D742
|
||||
@ -262,7 +269,7 @@ SEL2 .DA #0
|
||||
*--------------------------------------
|
||||
.AS "PAKME" TAG
|
||||
.DA $2000 BIN ORG
|
||||
.DA #11 Chunk Count
|
||||
.DA #12 Chunk Count
|
||||
.DA PAKME.Table Chunks
|
||||
*--------------------------------------
|
||||
MAN
|
||||
|
@ -355,10 +355,10 @@ SLOTS .DA #0
|
||||
SLOTS.MAX .EQ *-SLOTS
|
||||
*--------------------------------------
|
||||
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.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.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"
|
||||
|
@ -443,6 +443,7 @@ CPU.Init.6502 >PUSHBI 0
|
||||
bpl .3
|
||||
|
||||
lda IO.IIC.CLRVBLIRQ yes, clear IRQ
|
||||
lda #0 wait for UP again
|
||||
|
||||
.3 ldy #4 (2)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user