Date : Fri, 22 Oct 1999 12:07:35 +0100
From : jgh@... (Jonathan Graham Harston)
Subject: Re: *FX2,1
Mark Scholes <mark@...> wrote:
> If you change *FX2,1 to *FX2,2 you should be able to input from the RS423
and
> the keyboard. Note the User Guide has a mistake in this part, mentioned in
the
> Errata in later editions:
>
> FX2,0 keyboard enabled, RS423 disabled
> FX2,1 keyboard disabled, RS423 enabled
> FX2,2 keyboard enabled, RS423 enabled
Not quite...
*Fx2,0 input comes from keyboard, RS423 disabled
*Fx2,1 input comes from RS423, RS423 enabled
*Fx2,2 input comes from keyboard, RS423 enabled
Input only ever comes from one source. Whether the /device/ is enabled or
not is a separate matter from where input comes from.
The keyboard is /disabled/ with *fx201.
If you want to input from /both/ the keyboard and the serial, you need to
use something like this:
REM On entry assumes *FX2,2 set to input from both sources
REM or *FX2,0 will input from keyboard only, as serial will not supply
REM any data
:
DEFFNinput
LOCAL A$
REPEAT
A%=FNget
IF A%>31 AND A%<>127 AND LENA$<255:A$=A$+CHR$A%:VDU A%
IF A%=8 OR A%=127 AND A$<>"":VDU 127:A$=LEFT$(A$,LENA$-1)
UNTIL A%=10 OR A%=13
PRINT
=A$
:
DEFFNget
REPEAT
A%=FNinkey
UNTIL A%<>-1
=A%
:
DEFFNinkey
IF ADVAL(-2):OS."FX2,1":A%=GET:OS."FX2,2":=A%
=INKEY(0)
:
--
J.G.Harston (JGH BBC PD Library) 70 Camm Street, Walkley, SHEFFIELD S6 3TR
jgh@... - Running on BBCs & Masters with SJ MDFS FileServer
Z80+6502/CoPro+Tubes/Econet+SJ -- http://mdfs.net/
Hummana hummana hawwa --- I didn't know you spoke Cherokee