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 jsr BSX.Wait25600usec
ldy BSX.Slotn0 ldy BSX.Slotn0
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+6,y
lda IO.D2.Ph0Off,y lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+4,y lda IO.D2.Ph0Off+4,y
lda IO.D2.Ph0Off+6,y
* lda IO.D2.Ph0Off,y * lda IO.D2.Ph0Off,y

View File

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

View File

@ -203,13 +203,26 @@ CS.RUN.SETUP
bpl .8 bpl .8
jsr DHCP.INIT 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 jsr DHCP.QUIT
pla
sec
rts
.8 lda #0 .8 jsr DHCP.QUIT
lda #0
sec sec
CS.RUN.SETUP.RTS CS.RUN.SETUP.RTS

View File

@ -199,7 +199,7 @@ hLIBCRYPT .BS 1
OptionList .AS "Dd" OptionList .AS "Dd"
OptionVars .DA #bText,#bText 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 .DUMMY
.OR 0 .OR 0

View File

@ -184,7 +184,7 @@ CS.END
OptionList .AS "Dd" OptionList .AS "Dd"
OptionVars .DA #bText,#bText 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 .DUMMY
.OR 0 .OR 0

View File

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

View File

@ -425,13 +425,13 @@ IsDigit cmp #'0'
rts rts
*-------------------------------------- *--------------------------------------
CS.END CS.END
MSG.READ.KO .AZ "DS1216E Not Detected.\r\n" MSG.READ.KO .CZ "DS1216E Not Detected.\r\n"
MSG.READ.OK1 .AZ "DS1216E Detected : /OSC=%d, /RST=%d, mode=" MSG.READ.OK1 .CZ "DS1216E Detected : /OSC=%d, /RST=%d, mode="
MSG.READ.OK2.12 .AZ "am/pm" MSG.READ.OK2.12 .CZ "am/pm"
MSG.READ.OK2.24 .AZ "24h" MSG.READ.OK2.24 .CZ "24h"
MSG.READ.OK3 .AZ "\r\nCurrent Date/Time : " MSG.READ.OK3 .CZ "\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.USAGE .CS "\r\nTo Reset the chip and set clock, type:\r\nNSCUTIL YY/MM/DD,hh:mm:ss"
MSG.CRLF .AZ "\r\n" MSG.CRLF .CZ "\r\n"
DS121x.SIG .HS 5CA33AC55CA33AC5 Reverted 7->0 DS121x.SIG .HS 5CA33AC55CA33AC5 Reverted 7->0
*-------------------------------------- *--------------------------------------
DS.START DS.START

View File

@ -34,7 +34,7 @@ Flt.Table.cbLO .EQ $1368 K.FLT.MAX
Flt.Table.cbHI .EQ $136C K.FLT.MAX Flt.Table.cbHI .EQ $136C K.FLT.MAX
*-------------------------------------- *--------------------------------------
S.Table.hSID .EQ $1370 K.USR.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.PID .EQ $1380 K.PS.MAX
PS.Table.hPS .EQ $13A0 K.PS.MAX PS.Table.hPS .EQ $13A0 K.PS.MAX

View File

@ -167,10 +167,10 @@ D2.MoveHead >PULLB D2.TargetQTrack
jsr D2.Wait25600usec jsr D2.Wait25600usec
ldy D2.Slotn0 ldy D2.Slotn0
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+6,y
lda IO.D2.Ph0Off,y lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+4,y lda IO.D2.Ph0Off+4,y
lda IO.D2.Ph0Off+6,y
* lda IO.D2.Ph0Off,y * lda IO.D2.Ph0Off,y

View File

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

View File

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

View File

@ -325,10 +325,10 @@ BB.FX2.SeekReadD2
jsr BB.Wait100usecA jsr BB.Wait100usecA
ldy ROM.D2.Slotn0 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,y
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+4,y lda IO.D2.Ph0Off+4,y
lda IO.D2.Ph0Off+6,y
* lda IO.D2.Ph0Off,y * lda IO.D2.Ph0Off,y