SH: Piping Fix

This commit is contained in:
burniouf 2023-05-19 14:16:09 +02:00
parent 84a784807d
commit 6b5ca3da2f
2 changed files with 14 additions and 18 deletions

Binary file not shown.

View File

@ -299,7 +299,7 @@ CORE.Run.5 jsr CORE.GetCharNB
*--------------------------------------
CORE.Run.6 lda bState
bit #bState.PipeOut
beq .3
beq .1
jsr IO.Pipe.Out
bcs CORE.Run.Exit
@ -310,15 +310,13 @@ CORE.Run.6 lda bState
lda #S.PS.F.CLOSEONX ...and child PS must close StdOut on exit
tsb CORE.PSFlags
.3 jsr CORE.ExecCmd
.1 jsr CORE.ExecCmd
bcs CORE.Run.Exit
lda bState
bit #bState.PipeIn+bState.PipeOut
beq .8
.5 bit #bState.PipeIn
beq .6
bit #bState.PipeIn
beq .2
jsr IO.Pop.In restore Input piping app must close it
@ -327,8 +325,8 @@ CORE.Run.6 lda bState
lda bState
.6 bit #bState.PipeOut
beq .7
.2 bit #bState.PipeOut
beq .8
jsr IO.Pipe.In Set previous Pipe Out to StdIn for next CMD
bcs CORE.Run.Exit
@ -337,14 +335,14 @@ CORE.Run.6 lda bState
tsb bState
bit CORE.IntCmd
bmi .60
bmi .3
jsr IO.Reset.Out Internal : CLOSE output
bra .61
bra .4
.60 jsr IO.Pop.Out External : DONT Close Output, child process will close it
.3 jsr IO.Pop.Out External : DONT Close Output, child process will close it
.61 lda #bState.PipeOut
.4 lda #bState.PipeOut
trb bState
.7 jmp CORE.Run.1 Loop with Pipe IN
@ -388,11 +386,11 @@ CORE.ExecExtCmd >PUSHW ZPArgVBuf
tax CPID
lda CORE.PSFlags
and #S.PS.F.HOLD
bne .4
bne .1
lda bState
bit #bState.PipeOut
bne .4
bne .1
ldy #S.PS.hStdErr
lda (pPS),y
@ -405,14 +403,12 @@ CORE.ExecExtCmd >PUSHW ZPArgVBuf
>SYSCALL FPrintF
rts
.4 >SLEEP Suspend this PID
.1 >SLEEP Suspend this PID
sec
ldy #S.PS.RC CPID will update S.PS.RC
lda (pPS),y
bne .9
cmp #1
.8 clc
.9 rts
*--------------------------------------
CORE.SkipLine jsr CORE.GetNextCharNB