[Coco] Re: [Color Computer] Inkey for Microware C Compiler

Mannequin* mannequin at primary.net
Sun Dec 7 18:10:00 EST 2003


On Sat, 6 Dec 2003 22:52:20 EST
KnudsenMJ-YDxpq3io04c at public.gmane.org wrote:

> In a message dated 12/6/03 6:54:27 PM Eastern Standard Time, 
> mannequin-n6Ta2snkUAvR7s880joybQ at public.gmane.org writes:
> 
> > Does anyone know of a way to use Inkey (or make one) that can be
> > used
> >  with Microware's C Compiler v1.00.00?
> 
> It's very simple, no asm needed, and I can post the code tomorrow.

Sounds good. I need something to look at, so I can take a good learning
step.

> 1. Call getstt() to read the number of chars in the input buffer
> (channel 0).  You can find the proper args in the manual.  You can do
> it all in C, using a defined struct that represents the 6809's
> registers.  See the _os9() function.
> 2. If 0, return 0 or whatever code you choose for null char.
> 3. Otherwise, read one character with read(0, 1, &charvar) and return
> charvar.  This read() call won't block, since you've pre-tested for at
> least one char present.
> 
> BTW, the existence of the stat call in step (1) is a major superiority
> of OS-9 over UNIX or Linux in this regard, where a paragraph of
> garbage code is required to do a non-blocking read.  That's probably
> why the standard C I/O lib lacks such a call.
> --Mike K.

Yeah, I've had experience with such a beast under Linux. Garbage code is
a very appropriate name for it. :)

Thanks for your help!
- Mannequin*

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/CFFolB/TM
---------------------------------------------------------------------~->

Brought to you by the 6809, the 6803 and their cousins! 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the Coco mailing list