POST 2600, fixes #1

This commit is contained in:
burniouf 2023-06-02 22:31:09 +02:00
parent 77c818cfcb
commit 6ae9b75ac8
15 changed files with 292 additions and 276 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -122,10 +122,10 @@ BSX.MoveHead sta BSX.TargetQTrack
jsr BSX.Wait25600usec
ldy BSX.Slotn0
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+6,y
lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+4,y
lda IO.D2.Ph0Off+6,y
* lda IO.D2.Ph0Off,y

View File

@ -5,8 +5,6 @@ DHCP.INIT lda IPCFG+S.NETCFG.STATUS
and #S.IPCFG.STATUS.OK
bne .99 Already Configured, exit
stz IPCFG+S.NETCFG.STATUS
ldx #3
.1 eor A2osX.TIMER16,x
@ -24,7 +22,7 @@ DHCP.INIT lda IPCFG+S.NETCFG.STATUS
bpl .2
clc
.9 rts
rts
.99 >LDYA L.MSG.DHCP.NA
@ -32,7 +30,9 @@ DHCP.INIT lda IPCFG+S.NETCFG.STATUS
sec
rts
*--------------------------------------
DHCP.RUN >PUSHBI S.SOCKET.T.DGRAM
DHCP.RUN stz IPCFG+S.NETCFG.STATUS
>PUSHBI S.SOCKET.T.DGRAM
>PUSHBI 0 no protocol
>LIBCALL hLIBTCPIP,LIBTCPIP.Socket
bcc .1
@ -61,9 +61,6 @@ DHCP.RUN >PUSHBI S.SOCKET.T.DGRAM
>SLEEP
lda #3
sta RetryCount
DHCP.RUN.SDISC >PUSHB hSocket
>PUSHW L.DHCP.DISC
>PUSHWI DHCP.DISC.LEN
@ -75,14 +72,11 @@ DHCP.RUN.SDISC >PUSHB hSocket
jmp DHCP.RUN.KO
.1 lda #S.IPCFG.STATUS.SDISC
sta IPCFG
sta IPCFG+S.NETCFG.STATUS
DHCP.RUN.ROFFER jsr DHCP.RUN.SKT.RECV
bcc .1
dec RetryCount
bne DHCP.RUN.SDISC
lda #1
jmp DHCP.RUN.KO
@ -90,7 +84,7 @@ DHCP.RUN.ROFFER jsr DHCP.RUN.SKT.RECV
bcs DHCP.RUN.ROFFER
lda #S.IPCFG.STATUS.ROFFER
sta IPCFG
sta IPCFG+S.NETCFG.STATUS
DHCP.RUN.SREQ >PUSHW L.MSG.DHCP.CFG2
ldx #0
@ -111,7 +105,7 @@ DHCP.RUN.SREQ >PUSHW L.MSG.DHCP.CFG2
bcs DHCP.RUN.KO
lda #S.IPCFG.STATUS.SREQ
sta IPCFG
sta IPCFG+S.NETCFG.STATUS
DHCP.RUN.RACK jsr DHCP.RUN.SKT.RECV
bcc .1
@ -123,7 +117,7 @@ DHCP.RUN.RACK jsr DHCP.RUN.SKT.RECV
bcs DHCP.RUN.RACK
DHCP.RUN.OK lda #S.IPCFG.STATUS.OK
sta IPCFG
sta IPCFG+S.NETCFG.STATUS
>PUSHW L.IPCFG
>LIBCALL hLIBTCPIP,LIBTCPIP.SETCFG
@ -148,9 +142,7 @@ DHCP.RUN.OK lda #S.IPCFG.STATUS.OK
>PUSHBI 8
>SYSCALL PrintF
lda #0 Leave with NO ERROR
sec
rts
rts Leave with NO ERROR
DHCP.RUN.KO pha
>PUSHW L.MSG.DHCP.KO

View File

@ -203,13 +203,26 @@ CS.RUN.SETUP
bpl .8
jsr DHCP.INIT
bcs .8
bcs CS.RUN.SETUP.RTS
jsr DHCP.RUN
lda #3
sta RetryCount
.7 jsr DHCP.RUN
bcc .8
dec RetryCount
bne .7
pha
jsr DHCP.QUIT
pla
sec
rts
.8 lda #0
.8 jsr DHCP.QUIT
lda #0
sec
CS.RUN.SETUP.RTS

View File

@ -199,7 +199,7 @@ hLIBCRYPT .BS 1
OptionList .AS "Dd"
OptionVars .DA #bText,#bText
*--------------------------------------
MSG.USAGE .AZ "Usage : MD4 [ -d input text | input file ]\r\n"
MSG.USAGE .CZ "Usage : MD4 [ -d input text | input file ]\r\n"
*--------------------------------------
.DUMMY
.OR 0

View File

@ -184,7 +184,7 @@ CS.END
OptionList .AS "Dd"
OptionVars .DA #bText,#bText
*--------------------------------------
MSG.USAGE .AZ "Usage : MD5 [ -d input text | input file ]\r\n"
MSG.USAGE .CZ "Usage : MD5 [ -d input text | input file ]\r\n"
*--------------------------------------
.DUMMY
.OR 0

View File

@ -1,275 +1,293 @@
NEW
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
.TF bin/nl
.LIST OFF
.OP 65C02
.OR $2000
.TF bin/nl
*--------------------------------------
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/kernel.i
.INB inc/mli.i
.INB inc/mli.e.i
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/kernel.i
.INB inc/mli.i
.INB inc/mli.e.i
*--------------------------------------
.DUMMY
.OR ZPBIN
.DUMMY
.OR ZPBIN
ZS.START
ArgIndex .BS 1
ArgPattern .BS 1
ZPPtr1 .BS 2
ZPBufPtr .BS 2
hFile .BS 1
hBuf .BS 1
char .BS 1
LineCount .BS 2
bPause .BS 1
bPipe .BS 1
bIsTTY .BS 1
bNewLine .BS 1
bDummy .BS 1
ArgIndex .BS 1
ArgPattern .BS 1
ZPPtr1 .BS 2
ZPBufPtr .BS 2
hFile .BS 1
hBuf .BS 1
char .BS 1
LineCount .BS 2
bPause .BS 1
bPipe .BS 1
bIsTTY .BS 1
bNewLine .BS 1
bDummy .BS 1
ZS.END .ED
ZS.END .ED
*--------------------------------------
* File Header (16 Bytes)
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA #0 S.PS.F.EVENT
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data Segment Size
.DA #16 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
.DA 0
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA #0 S.PS.F.EVENT
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data Segment Size
.DA #16 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.MSG.USAGE .DA MSG.USAGE
L.MSG.CRLF .DA MSG.CRLF
L.MSG.LINENUM .DA MSG.LINENUM
.DA 0
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.MSG.USAGE .DA MSG.USAGE
L.MSG.CRLF .DA MSG.CRLF
L.MSG.LINENUM .DA MSG.LINENUM
.DA 0
*--------------------------------------
CS.INIT clc
rts
CS.INIT clc
rts
*--------------------------------------
CS.RUN stz bPipe
stz bIsTTY
stz bNewLine
inc bNewLine
jsr CS.RUN.ISATTY
jsr CS.RUN.CheckArgs
bcs CS.RUN.LOOP.RTS
CS.RUN stz bPipe
stz bIsTTY
stz bNewLine
inc bNewLine
jsr CS.RUN.ISATTY
jsr CS.RUN.CheckArgs
bcs CS.RUN.LOOP.RTS
stz LineCount
stz LineCount+1
inc LineCount
stz LineCount
stz LineCount+1
inc LineCount
CS.RUN.LOOP lda bPipe If reading from pipe
bne .2 No ^C/^S handling
CS.RUN.LOOP lda bPipe If reading from pipe
bne .2 No ^C/^S handling
ldy #S.PS.hStdIn
lda (pPS),y
>SYSCALL FEOF
bcs .9 I/O Error
ldy #S.PS.hStdIn
lda (pPS),y
>SYSCALL FEOF
bcs .9 I/O Error
tay
bne .1 No char
tay
bne .1 No char
>SYSCALL GetChar
bcs .9 I/O error
cmp #$03 Ctrl-C
beq .9
cmp #$13 Ctrl-S
bne .1
lda bPause
eor #$ff
sta bPause
bne CS.RUN.LOOP
>SYSCALL GetChar
bcs .9 I/O error
.1 lda bPause
bne CS.RUN.LOOP
cmp #$03 Ctrl-C
beq .9
.2 >SLEEP
cmp #$13 Ctrl-S
bne .1
lda hFile
>SYSCALL GetC
bcs .7
lda bPause
eor #$ff
sta bPause
bne CS.RUN.LOOP
jsr CS.RUN.PRINTBYTE
bra CS.RUN.LOOP
.1 lda bPause
bne CS.RUN.LOOP
.7 cmp #MLI.E.EOF
bne .9
.2 >SLEEP
.8 lda #0 Exit with no Error
lda hFile
>SYSCALL GetC
bcs .7
.9 sec
CS.RUN.LOOP.RTS rts
jsr CS.RUN.PRINTBYTE
bra CS.RUN.LOOP
.7 cmp #MLI.E.EOF
bne .9
.8 lda #0 Exit with no Error
.9 sec
CS.RUN.LOOP.RTS rts
*--------------------------------------
CS.RUN.CheckArgs jsr CS.RUN.NextArg
bcs .4
CS.RUN.CheckArgs
jsr CS.RUN.NextArg
bcs .4
lda (ZPPtr1)
cmp #'-'
beq .1
lda (ZPPtr1)
cmp #'-'
beq .1
.11 lda hFile
bne .97
.11 lda hFile
bne .97
>LDYA ZPPtr1
jsr CS.RUN.OPEN
bcs .9
>LDYA ZPPtr1
jsr CS.RUN.OPEN
bcs .9
sta hFile
bra CS.RUN.CheckArgs
sta hFile
bra CS.RUN.CheckArgs
.1 ldy #1
lda (ZPPtr1),y
.1 ldy #1
lda (ZPPtr1),y
ldx #OptionList.Cnt-1
ldx #OptionList.Cnt-1
.2 cmp OptionList,x
beq .3
.2 cmp OptionList,x
beq .3
dex
bpl .2
dex
bpl .2
bra .97
bra .97
.3 txa
lsr
beq .98
.3 txa
lsr
beq .98
tax
lda #$80
sta bDummy-1,x
bra CS.RUN.CheckArgs
.4 lda hFile
bne .80
tax
lda #$80
sta bDummy-1,x
bra CS.RUN.CheckArgs
ldy #S.PS.hStdIn
lda (pPS),y
tax
lda hFDs-1,x
>SYSCALL GetMemPtr
>STYA ZPPtr1
lda (ZPPtr1)
cmp #S.FD.T.PIPE
bne .97
ldy #S.PS.hStdIn
lda (pPS),y
sta hFile
inc bPipe
.4 lda hFile
bne .80
.80 >LDYAI 256
>SYSCALL GetMem
bcs .9
ldy #S.PS.hStdIn
lda (pPS),y
tax
>STYA ZPBufPtr
stx hBuf
lda hFDs-1,x
>SYSCALL GetMemPtr
>STYA ZPPtr1
lda (ZPPtr1)
cmp #S.FD.T.PIPE
bne .97
* clc
ldy #S.PS.hStdIn
lda (pPS),y
sta hFile
inc bPipe
.9 rts
.80 >LDYAI 256
>SYSCALL GetMem
bcs .9
.97 lda #E.SYN
>STYA ZPBufPtr
stx hBuf
.98 pha
>PUSHW L.MSG.USAGE
>PUSHBI 0
>SYSCALL PrintF
pla
sec
rts
* clc
.9 rts
.97 lda #E.SYN
.98 pha
>PUSHW L.MSG.USAGE
>PUSHBI 0
>SYSCALL PrintF
pla
sec
rts
*--------------------------------------
CS.RUN.NextArg inc ArgIndex
lda ArgIndex
>SYSCALL ArgV
bcs .9
CS.RUN.NextArg inc ArgIndex
lda ArgIndex
>SYSCALL ArgV
bcs .9
>STYA ZPPtr1
>STYA ZPPtr1
.9 rts
.9 rts
*--------------------------------------
CS.RUN.OPEN >PUSHYA
>PUSHBI O.RDONLY+O.TEXT
>PUSHBI S.FI.T.TXT
>PUSHWZ Aux type
>SYSCALL FOpen
bcs .9
sta hFile
.9 rts
CS.RUN.OPEN >PUSHYA
>PUSHBI O.RDONLY+O.TEXT
>PUSHBI S.FI.T.TXT
>PUSHWZ Aux type
>SYSCALL FOpen
bcs .9
sta hFile
.9 rts
*--------------------------------------
CS.RUN.ISATTY ldy #S.PS.hStdOut
lda (pPS),y
tax
lda hFDs-1,x
>SYSCALL GetMemPtr
>STYA ZPPtr1
lda (ZPPtr1)
beq .9
inc bIsTTY
.9 rts
CS.RUN.ISATTY ldy #S.PS.hStdOut
lda (pPS),y
tax
lda hFDs-1,x
>SYSCALL GetMemPtr
>STYA ZPPtr1
lda (ZPPtr1)
beq .9
inc bIsTTY
.9 rts
*--------------------------------------
CS.QUIT lda hFile
beq .1
>SYSCALL FClose
.1 lda hBuf
beq .8
>SYSCALL FreeMem
.8 clc
rts
CS.QUIT lda hFile
beq .1
>SYSCALL FClose
.1 lda hBuf
beq .8
>SYSCALL FreeMem
.8 clc
rts
*--------------------------------------
CS.RUN.PRINTBYTE pha
lda bNewLine
beq .2
stz bNewLine
>PUSHW L.MSG.LINENUM
>PUSHW LineCount
>PUSHBI 2
>SYSCALL PrintF
.2 pla
pha
>SYSCALL PutChar
pla
cmp #C.CR
bne .9
lda bIsTTY
beq .4
lda #C.LF
>SYSCALL PutChar
.4 inc bNewLine
inc LineCount
bne .9
inc LineCount+1
.9 rts
CS.RUN.PRINTBYTE
pha
lda bNewLine
beq .2
stz bNewLine
>PUSHW L.MSG.LINENUM
>PUSHW LineCount
>PUSHBI 2
>SYSCALL PrintF
.2 pla
pha
>SYSCALL PutChar
pla
cmp #C.CR
bne .9
lda bIsTTY
beq .4
lda #C.LF
>SYSCALL PutChar
.4 inc bNewLine
inc LineCount
bne .9
inc LineCount+1
.9 rts
*--------------------------------------
CS.DOEVENT sec
rts
CS.DOEVENT sec
rts
*--------------------------------------
CS.END
*--------------------------------------
OptionList .AS "x"
OptionList.Cnt .EQ *-OptionList
OptionList .AS "x"
OptionList.Cnt .EQ *-OptionList
*--------------------------------------
MSG.USAGE .AS "Usage : NL <File> or CMD|NL"
MSG.CRLF .AZ "\r\n"
MSG.LINENUM .AZ "%5D "
MSG.USAGE .CS "Usage : NL <File> or CMD|NL"
MSG.CRLF .CZ "\r\n"
MSG.LINENUM .CZ "%5D "
*--------------------------------------
.DUMMY
.OR 0
.DUMMY
.OR 0
DS.START
DS.END .ED
DS.END .ED
*--------------------------------------
MAN
SAVE usr/src/bin/nl.s

View File

@ -7,7 +7,7 @@ NEW
.OR $2000
.TF bin/nscutil
*--------------------------------------
NSC.IOBASE .EQ $C300
NSC.IOBASE .EQ $C300
*--------------------------------------
.INB inc/macros.i
.INB inc/io.i
@ -175,7 +175,7 @@ NSC.Init php
lda RDCXROM
php
sta SETCXROM
ldx #8
@ -204,7 +204,7 @@ NSC.Read php
lda RDCXROM
php
sta SETCXROM
jsr NSC.Select
@ -235,7 +235,7 @@ NSC.Write php
lda RDCXROM
php
sta SETCXROM
jsr NSC.Select
@ -280,7 +280,7 @@ NSC.Select sta NSC.IOBASE
.3 lda DS121x.SIG-1,y
phy
ldy #8 ....of 8 bits
.4 ldx #0
@ -425,13 +425,13 @@ IsDigit cmp #'0'
rts
*--------------------------------------
CS.END
MSG.READ.KO .AZ "DS1216E Not Detected.\r\n"
MSG.READ.OK1 .AZ "DS1216E Detected : /OSC=%d, /RST=%d, mode="
MSG.READ.OK2.12 .AZ "am/pm"
MSG.READ.OK2.24 .AZ "24h"
MSG.READ.OK3 .AZ "\r\nCurrent Date/Time : "
MSG.USAGE .AS "\r\nTo Reset the chip and set clock, type:\r\nNSCUTIL YY/MM/DD,hh:mm:ss"
MSG.CRLF .AZ "\r\n"
MSG.READ.KO .CZ "DS1216E Not Detected.\r\n"
MSG.READ.OK1 .CZ "DS1216E Detected : /OSC=%d, /RST=%d, mode="
MSG.READ.OK2.12 .CZ "am/pm"
MSG.READ.OK2.24 .CZ "24h"
MSG.READ.OK3 .CZ "\r\nCurrent Date/Time : "
MSG.USAGE .CS "\r\nTo Reset the chip and set clock, type:\r\nNSCUTIL YY/MM/DD,hh:mm:ss"
MSG.CRLF .CZ "\r\n"
DS121x.SIG .HS 5CA33AC55CA33AC5 Reverted 7->0
*--------------------------------------
DS.START

View File

@ -34,7 +34,7 @@ Flt.Table.cbLO .EQ $1368 K.FLT.MAX
Flt.Table.cbHI .EQ $136C K.FLT.MAX
*--------------------------------------
S.Table.hSID .EQ $1370 K.USR.MAX
S.Table.hFile .EQ $1278 K.USR.MAX
S.Table.hFile .EQ $1378 K.USR.MAX
*--------------------------------------
PS.Table.PID .EQ $1380 K.PS.MAX
PS.Table.hPS .EQ $13A0 K.PS.MAX

View File

@ -60,9 +60,9 @@ D2.Recalibrate >PULLB D2.DrvSlt
lda IO.D2.Ph0Off,y
plp
* clc
jmp D2.Wait25600usec
.9 rts
@ -167,19 +167,19 @@ D2.MoveHead >PULLB D2.TargetQTrack
jsr D2.Wait25600usec
ldy D2.Slotn0
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+6,y
lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+4,y
lda IO.D2.Ph0Off+6,y
* lda IO.D2.Ph0Off,y
* bcc .10
* lda IO.D2.Ph0Off,x
* clc
* lda IO.D2.Ph0Off,y
*.10 jsr D2.Wait25600usec
plp

View File

@ -716,19 +716,12 @@ XRW.TrackSelect lda #2
ora A2L
tay y = n0/n2
iny
jsr XRW.Ph04Off
* lda IO.D2.Ph0On,y
* lda IO.D2.Ph0On+4,y
lda IO.D2.Ph0On,y PhOn 0/2 for Head0 or 1/3 for Head1
lda IO.D2.Ph0On+4,y
jsr XRW.Wait100usec
dey
jsr XRW.Ph04Off
*
* lda IO.D2.Ph0Off,y
* lda IO.D2.Ph0Off+4,y
jsr XRW.AllPhOff
lda XRW.AddrField.T
sta XRW.D2Trk-1,x
@ -844,12 +837,12 @@ XRW.SeekYA sta XRW.D2Trk-1,x will be current track at the end
jsr XRW.Wait25600usec
ldy A2L
XRW.AllPhOff ldy A2L
lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+6,y
XRW.Ph04Off lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off+4,y
lda IO.D2.Ph0Off+6,y
* lda IO.D2.Ph0Off,y

View File

@ -76,8 +76,8 @@ CS.DOEVENT sec
rts
*--------------------------------------
CS.END
MSG.USAGE .AZ "Usage: insdrv file.drv <args>"
MSG.LOAD .AZ "INSDRV:Loading %s...\r\n"
MSG.USAGE .CZ "Usage: insdrv file.drv <args>"
MSG.LOAD .CZ "INSDRV:Loading %s...\r\n"
*--------------------------------------
MAN
SAVE usr/src/sbin/insdrv.s

View File

@ -325,10 +325,10 @@ BB.FX2.SeekReadD2
jsr BB.Wait100usecA
ldy ROM.D2.Slotn0
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+6,y
lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+4,y
lda IO.D2.Ph0Off+6,y
* lda IO.D2.Ph0Off,y