[comp.sys.m6809] CoCo3 OS-9 Level II

jimomura@lsuc.UUCP (06/09/87)

     I've been trying to read the "keyboard mouse" using GetStt / SS.Mouse
and I can't get anything useful out of it.  I'm not sure what "path"
to use (looks like path 0 should be right, but nothing in the documentation
makes it clear) and I don't know whether there's something you have to
do to make the "auto-select" (Register Y=0) function.

     Has anybody used this yet?

Cheers! -- Jim O.
-- 
Jim Omura, 2A King George's Drive, Toronto, (416) 652-3880
ihnp4!utzoo!lsuc!jimomura
Byte Information eXchange: jimomura

knudsen@ihwpt.UUCP (06/11/87)

In article <1851@lsuc.UUCP>, jimomura@lsuc.UUCP (Jim Omura) writes:
> I've been trying to read the "keyboard mouse" using GetStt / SS.Mouse
> and I can't get anything useful out of it.  I'm not sure what "path"
> to use (looks like path 0 should be right, but nothing in the docs
> makes it clear) and I don't know whether there's something you have to
> do to make the "auto-select" (Register Y=0) function.
>      Has anybody used this yet?

Hi Jim.  Thought I had posted something to the effect that I had
the HiRes mouse goodies working (and had found some bugs and/or
discrepancies between the manual and reality, so what else is new eh?)

Path 0 is what I use, tho 1 probably works just as well.
Someone told me that Paths 0 thru 2 are all just DUPes of one
read/write path to /W anyway.  I always thought that BASIC09 docs
were very sloppy about the std IO paths, compared to C docs.
(I assume you're testing this stuff in B09 for ease of debugging
before going to C or assembumbler.)

You didn't mention SS.Gip, so maybe you're omitting the crucial setup
call you do just once to turn on the hi-res system.  Look that one
up in the manual.  It is this GIP call that determines whether the
mouse is read hi or lo res and on which of the two joystick port holes.
GIP also controls keyboard auto-repeat (whew!  hooray!).

The auto-port-select stuff has not worked for me; in fact the SS.Mouse
calls just ignore whatever you put in the one register about resolution
and port.  Somoene hinted that if you called SS.GIP twice and started
the mouse on BOTH ports (sides), the auto-select would work.
I say to hell with it.  No less than Steve Bjork (6809er on DELPHI)
thinks that only the right port works on it anyway, but I *think* I had
it going on the left side too.
	I'm now looking for the best way to turn the hires mouse OFF
while doing other things (like screen refresh); it eats a lot of realtime
since the interrupts are blocked while timing the sawtooth.
Hackers have estimated close to a whole clock period (1/60 sec) goes
down the drain each time the mouse is scanned.
	When you get it working, ask me for the quick & dirty way to
put hysteresis/backlash in the mouse so your cursor doesn't quiver
around on the screen.  And of course ask for any other details.
BTW, I assume you know about the two undocumented bytes in the SS.Mouse
data structure just ahead of Pt.ToTM (or is it just after?...)
Anyway, imagine two extra bytes between Pt.Valid and the stuff you
*use* like Pt.AcX.  Only 4 of those two dozen fields are relevant
at this stage in our evolution.
	Finally, once working, try hitting CTRL-CLEAR to enable the
arrow-keys "mouse" (another CTRL-CLEAR toggles it back to the
real mouse).  This is a very neat feature of Coco-L2, allows precise
alignments and measurements of pixels, and costs NO hardware at all.
BTW, both this and the HiRes adaptor driver could be retrofitted
into Level 1 for old Cocos -- no Coco 3 hardware is involved.
-- 
Mike J Knudsen    ...ihnp4!ihwpt!knudsen  Bell Labs(AT&T)
    Delphi: RAGTIMER    CIS: <memory failure, too many digits>
		"Just say NO to MS-DOS!"

jimomura@lsuc.UUCP (06/13/87)

     Thanks Mike.  I had read your earlier posting, but mainly for the
the windowing info.  As such, I stuck it onto the stack and all I know is
"it's on file there somewhere".  Besides which, I felt that after a while
you might have more info (always a good excuse when I'm being lazy :-).

     Anyway, I'm writing a graphics program with what spare time I have.
I'm not sure what I'm going to do with it when I'm done.  I've considered
a few things, but currently it boils down to this:

     I'm writing a program which is sort of based on Jim Kent's "Flicker"
animation program for the Atari ST.  Jim's an old CoCo author (he wrote
the Micro Illustrator for the Color Computer--don't blame him for the
poor joystick interface because that wasn't his fault).  Jim allowed me
to copy his user interface.  Just recently however, I think Jim's gotten
interested in porting "Flicker" to the CoCo3 under OS-9.  I sent him
a note when I realized how *easy* it would be to do the animation parts.
Now, I'm going to write my program anyway, but if Jim comes out with
"Flicker" then it'll be the better program, so there won't be any point
in my doing anything until he decides whether he'd want to do anything
with "Flicker".

     As for C v. BASIC09, it's interesting.  I'm starting to think that
for this program C won't give any noticable advantage.  The graphics routines
in 'gfx2' are fine.  There are a few things that could be added, but then
you can always add another machine language file to call from BASIC09.
Mainly what BASIC09 will be doing will be following the mouse (one way or
the other).  Also, the way I program in BASIC09, it might be easier to
translate it to Assembler than to C.  In fact, I could try Pascal.  I
have the compiler but haven't used it since I switched to Level II.

     Now that I think about it, the main reason I didn't even start in C
was the fact that my C compiler is still not working pending a patch
to redirect the compiler from looking to /d1 for libraries and defs.
I still haven't found the patch to make that change.

Cheers! -- Jim O.
-- 
Jim Omura, 2A King George's Drive, Toronto, (416) 652-3880
ihnp4!utzoo!lsuc!jimomura
Byte Information eXchange: jimomura