[Coco] simulation a hi-res joystick adaptor

Roger Taylor operator at coco3.com
Sun Feb 10 23:01:19 EST 2008

Hey guys,

While Robert Gault is checking to see if a recent bug fix cured a 
mouse cursor problem, I'm looking at the latest code for my hi-res 
simulator giving a smooth traveling, smart behaving mouse/joystick 
cursor in my Jeweled game.  The formula is quite simple and combines 
speed-based delta movement with direct coordinates to give a cursor 
similar to how it works on the PC.

The only difference is that on a PC it appears to be 100% delta 
based, meaning that if you position the mouse cursor, unplug your 
mouse, move the mouse around randomly, plug it back in, the cursor 
will still be in the same spot, then you can move it from that 
location.  On the CoCo using my code, the cursor travels towards the 
actual coordinates in a smooth fashion, fast or slow depending on the 
speed you move the mouse or joystick.  I'm seeing almost 1 or 2-pixel 
precision over a 320x200 graphics screen using the standard 6-bit 
ADC.  Ofcourse, there's no guarantee you can land the cursor on a 
certain pixel since the formula doesn't try to do this, but if you 
move the mouse slow enough you can see it travel a pixel or two at a 
time in any direction.  Move the mouse faster and the cursor travels 
faster to that location but still in a smooth fashion.  This is 
actually a forumla I proved to work back in the late 80's but moved 
onto other projects and whatever I was working on at the time was 
forgotten about.  I think it was a Windows type interface for CoCo 2 BASIC.

OS-9 Level II could have a hi-res mouse for Multi-Vu without any 
adaptor using any ole standard black cube stick, deluxe joystick, or 
better yet... a CoCo box mouse.  :)   I'll post the code for my mouse 
routine when I pretty up the comments.  The code is unrolled for 
speed which is VERY important for any game, OS, or app that polls the 
joystick and needs all-around speed.

The Jeweled game hopefully can now progress to the next level which 
is the actual game logic.  The framework to the game is pretty much 
done, using a 128k memory map and playable on any CoCo 3 at this 
point, but I'm considering making it a 512k game so I can add in the 
rocking jams and sound effects to make the game more thrilling.  The 
framework can be used as a game engine for future games and that's 
where most of the work has gone in the beginning, preparing to make 
other games even quicker to design.

I expect to continue my "Agent C" adventure after Jeweled.  It will 
also feature the smart mouse cursor, larger but fewer sprites, and 
lots of screens in the cartoonish Microsloth headquarters.  Agent C 
will be a 512k game.  The main part of that game will be the rooms 
and objects information, and there will be much more data than code 
in that game and Jeweled as well.

Btw, check out the new screenshot of Jeweled on coco3.com.  That's 
not a mockup image but it's a snapshot from M.E.S.S. which is showing 
what you would see on a RGB monitor.

More information about the Coco mailing list