[cc65] RS-232 on the C64

From: Agent Friday <64subnet1gmail.com>
Date: 2010-11-28 21:04:51
Hello,

I'm trying to do some RS-232 programming on the C64 and I am now
officially stumped.  I first looked at using stdio calls.  They
seemed rather tailored to use with disk files, so I had some serious
doubts it would be able to handle the idiosyncracies of RS-232;
probably need something a bit more native.

So I tried using cbm_open / cbm_read calls in cbm.h.  Problems:
cbm_open() returns an error code of 240 (not defined?).  However, it
still lets me do a cbm_write to that LFN w/o any error (if cbm_open
failed, I would expect a "file not open" error).  When I try to
read, however, the system hangs.  Stepping through a bit seems to
indicate it's waiting endlessly for a character that is apparently
never coming.  (I really need to be using something like cbm_get
rather than cbm_read, but that doesn't exist.  Oversight?)  I /have/
tested the telnet connection in VICE using a trivial BASIC terminal
(OPEN, PRINT#, GET#), and that works fine, so I'm beginning to think
that the cbm_xxx functions might not be acting exactly like the BASIC
counterparts.

Got tired of banging my head on that wall, and decided to look into
the cbm_k_ (kernal) routines.  They are a bit perplexing perplexing
to me as well.  There is no GETIN type call here either, but I
assume that's just an inadvertant omission.  There is no CHRIN or
CHROUT, but instead they're named after BASIN and BSOUT.
Technically, this should imply that they go through the system
vectors ($324 .. $327) and can be redirected.  Is this the case?

Do any of you C64 guys use these cbm-specific calls much, and what
is your success level?  Same question for RS-232 comms.... which API
is likely to work, or should I rely on my own interface functions?
It would be cool if the generic (POSIX?) I/O calls worked with
RS-232, but I'm guessing the kernal interface is the way to go,
adding a cbm_k_getin() along the way.

Thanks for any pointers,

// Agent Friday


P.S.  Did anyone see my last post to the list (about the -t and
-C switches)?  I haven't seen it come back through, but I'm not
sure if gmail is just being too "smart" about managing my
conversation threads for me...  Thanks.
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Nov 28 21:05:02 2010

This archive was generated by hypermail 2.1.8 : 2010-11-28 21:05:04 CET