[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Lost Chars on ttys
Martin-Eric Racine wrote:
> That might explain why I never succeeded in connecting the Stacy to
> my TT through nullmodem. Seems anytime MiNTos and HS-Modem are booted
> together, Stacy locks dead on bootup. Then again, booting without the
> HS-Modem package results in too many lost characters, so both of the
> serial ports of the Stacy are currently useless under MiNT.
>
> A friend who tried running STinG on his Stacy reports similar problems,
> though, so I'm begining to wonder if the hardware design of the Stacy
> isn't bugged to begin with...?
As I haven't installed HS-MODem yet, so I can't comment. I will try it.
My cure for the lost characters is the terminal program below. I found
I had to build in delays in the term prog to avoid lost chars.
It is different delay for a ST at 8mhz, to a mega ste at 16mhz, to a
TT. Also TT running single verses not affects terminal program. I use
one TT as a terminal for testing purposes and it does not make a good
terminal under MINT. When term prog is pre-emted, lost chars occur.
I think Terminal programs probably should have a methed of detecting
data transfer rates and properly adjusting for that. maybe that should
be the next project. I think I can do that, maybe.
> ----------------------------------------------------------------
This is GFA Basic code. Sorry, I'm not much of a programer either.
old hackers never change.
.he TERMINAL.GFA PAGE #
$m64000
ON ERROR GOSUB error_routine
@init_display ! SET UP TERMINAL DISPLAY, IN THIS CASE 80 X 50 SMALL
flushinp(void)
FOR delay=1 TO 100
NEXT delay
erase
OPEN "U",#1,"AUX:"
' @login_term
OUT (1),13
DO
WHILE INP?(1)<>0 ! START OF GET INPUT FROM SERIAL PORT
FOR delay=1 TO 100 ! DELAYS ARE TO NOT MISS DATA
NEXT delay
x$=INPAUX$
FOR delay=1 TO 100
NEXT delay
control&=INSTR(x$,CHR$(254))
IF control&>0 !TESTS FOR CONTROL CODE
IF control&>1
PRINT LEFT$(x$,control&-1)
ENDIF
endcontrol&=INSTR(x$,"*")
IF endcontrol&<=0
REPEAT
IF INP?(1)<>0
FOR delay=1 TO 100
NEXT delay
ix$=INPAUX$
ENDIF
IF ix$<>""
x$=x$+ix$
ENDIF
UNTIL INSTR(x$,"*")<>0 ! * SIGNIFY END OF CONTROL CODE
ENDIF
terminal_
REPEAT
UNTIL OUT?(1)
OUT 1,0
ELSE ! OR OUTPUTS TO STD I/O (SCREEN)
PRINT x$;
ENDIF
WEND !ENDIF
CLR x$
IF INP?(2) ! INPUT FROM KEYBOARD & I/O TO SERIAL PORT
KEYLOOK n%
IF n%=338493464
GOTO fini
ELSE
n%=0
ENDIF
k$=INKEY$
IF k$<>""
IF ASC(k$)<>0
char%=ASC(k$)
ELSE
char%=CVI(k$)
char%=char%+128
ENDIF
REPEAT
UNTIL OUT?(1)
OUT 1,char%
ENDIF
ENDIF
LOOP
CLOSE #1
fini:
restor_display
SYSTEM
' TERMINAL PROCEDURES
PROCEDURE prn_out ! TO REDIRECT TO PRINTER ATTACHED TO TERMINAL
x$=""
ckprnout
OPEN "",#99,"PRN:"
REPEAT
UNTIL OUT?(1)
OUT 1,0
REPEAT
IF INP?(1)
FOR delay=1 TO 5
NEXT delay
x$=INPAUX$
IF ASC(x$)=253
CLR x$
REPEAT
ix$=INPAUX$
IF ix$<>"" AND ASC(ix$)<>253
x$=x$+ix$
ENDIF
EXIT IF INSTR(ix$,CHR$(253))<>0
UNTIL ASC(ix$)=253
IF INSTR(x$,CHR$(253))<>0
pos&=INSTR(x$,CHR$(253))
x$=LEFT$(x$,pos&-1)
ENDIF
WHILE INSTR(x$,CHR$(252))<>0
pos&=INSTR(x$,CHR$(252))
MID$(x$,pos&,1)=CHR$(0)
WEND
IF ASC(x$)<>254
REPEAT
UNTIL OUT?(0)
PRINT #99;x$;
ENDIF
REPEAT
UNTIL OUT?(1)
OUT 1,0
ENDIF
ENDIF
UNTIL ASC(x$)=254
set_term
x$=""
CLOSE #99
RETURN
--
Brent
Thirsk Engine /Ponoka/Alberta/Canada
http://www.telusplanet.net/public/thirsk/thirsk_web_page/index.htm
Email thirsk@telusplanet.net