EasyManua.ls Logo

Commodore Plus 4 - Page 402

Commodore Plus 4
464 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
390
Using
Peripheral
Devices
3.
Send
data
to
the
channel
with
BSOUT
($FFD2).
4.
Check
the
status
byte
for
errors.
5.
When
all
data
has
been
sent,
return
the
input
and
output
channels
to
default
(keyboard
and
screen)
by
calling
CLRCH
($FFCC)
and
close
the
file,
or
call
CLALL
($FFE7)
to
close
all
the
files
and
reset
the
input
and
output
channels.
Get
To
receive
information
from
the
RS232
port,
the
port
must
have
been
opened.
The
following
outlines
the
operations
required:
1.
Load
.X
with
the
logical
file
number
of
the
input
file.
Designate
it
as
the
input
channel
by
calling
CHKIN
($FFC6).
2.
Check
the
status
byte
for
errors.
3.
Receive
data
from
the
channel
with
BASIN
($FFCF).
4.
Check
the
status
byte
for
errors.
5.
When
all
data
received,
return
the
input
and
output
channels
to
default
(keyboard
and
screen)
by
calling
CLRCH
($FFCC)
and
close
the
file,
or
call
CLALL
($FFE7)
to
close
all
the
files
and
reset
the
input
and
output
channels.
The
Joystick
Ports
The
Commodore
Plus/4
is
equipped
with
two
joystick
ports
located
on
the
rear
of
the
computer.
The
Commodore
T-1341
joystick
is
compatible
with
the
Plus/4.
Older
Commodore
joysticks are
not
compatible.
The
ports
are
numbered
1
and
2.
Fundamentally,
a
Commodore
joystick
consists
of
five
switches,
each
of
which
is
assigned
to
one
of
the
following:
up,
down,
right,
left,
and
fire.
In
machine
language,
the
programmer
must
examine
a
bit
reflecting
the
status
of
each
switch
to
read
joystick
input.
In
BASIC,
however,
the
JOY
function
can
be
used
to
determine
the
joystick
status.
Using
Joysticks
with
BASIC
The
JOY
function
has
the
following
syntax:
JOY
(port)
where
port
is
the
joystick
port
to
use
(either
1
or
2).
The
function
returns
a