Jump to content
cheesestraws

Joystick mouse replacement for Lisa/128/512/Plus

Recommended Posts

This is an analogue stick controller I built for pre-ADB Macs and the Lisa.  This is because I don't have room by the Lisa for a mouse, and I had the bits for this in the house (except for the case).

 

 

It's reasonably comfortable to hold.

 

61032074071__C917F95F-0E42-4046-A240-577DCBF8AF25.thumb.JPG.4a199aec54ac4c40319581c512ed3adb.JPG

 

The analogue stick module is a cheap eBay one (there are tons of sellers; that was just the first one in the list) that I seem to have ended up with a number of, which is just a couple of variable resistors acting as voltage dividers and a pushbutton switch.  The microcontroller is an 5v Arduino Pro Mini, which is gross overkill but does work.

 

The code that sits inside it is here.  It's a bit of a mess, but if anyone else is interested I'll clean it up a bit.  Assembling one is pretty easy; the pins are set by default so that all the wires from the joystick thingy go to one side of the board, and all the wires for the cable to the computer (except for +5v, unfortunately) go to the other.  Two digital I/O pins are used to provide +5v and 0v for the joystick's voltage dividers.

 

It's even reasonably neat inside.

 

61032015221__39E3DC58-A40A-4438-BC58-12C8EE3FFAAD.thumb.JPG.83c1d79a0e386eaf29d769f7f2d7553e.JPG

 

Share this post


Link to post
Share on other sites
4 minutes ago, LaPorta said:

I wish I had the mindset to create such things.

I have the mindset; I wish I had the skills to build such things.

Share this post


Link to post
Share on other sites
20 minutes ago, LaPorta said:

I'll build it if you think it ;)

How about a mouse with an ADB port and USB port so you can connect either cable and use it on old and new Macs?  Also, when plugged into USB, it's also a flash drive.  Optical too so no mouse ball required. ;)

Share this post


Link to post
Share on other sites
9 hours ago, LaPorta said:

I wish I had the mindset to create such things.

Honestly, the impetus here was "I seem to have ended up with a box of tiny joysticks, what on earth can I use these for".  No great creative thinking was involved.

 

8 hours ago, dcr said:

Also, when plugged into USB, it's also a flash drive

Can I have a bottle opener on it as well? ;-)

Share this post


Link to post
Share on other sites
4 hours ago, cheesestraws said:

Can I have a bottle opener on it as well? ;-)

You put the bottle opener on the front panel of the hard drive or unused bay on your tower case. ;)

Share this post


Link to post
Share on other sites

I absolutely want to make this. I searched far and wide last year to get a competent joystick that would let me send inputs to a Mac Plus mouse serial port in order to play Archon. All I found was the Gravis MouseStick 1 (ADB) that could run under a Mac SE with Archon with some glitches. It works relatively well, but I'd prefer running it on the Plus.

 

1) what's the exact product # for your arduino mini?

2) Did you do a lot of iterations to work out your stick's dead zone?

3) Which games have you tried it with

4) the dream setup would be to have two of those for a 2 player match for a Mac Plus, so that would mean using the printer port or the keyboard port. Would it be possible to code specific keystroke outputs to your code? Do you know enough how keystrokes are handled at the machine runtime level?

 

edit - I helped some of my students drive an EM nail gun project by using the modem port of a Mac Classic back in 2005 or 2006. I still have that C code laying around somewhere. All I was managing was setting it high and low for a short burst interval of time.

 

Edited by Mu0n

Share this post


Link to post
Share on other sites

There is definitely a MouseStick 1 that works via the serial interface. I'd seen one on an Apple IIe once.

Share this post


Link to post
Share on other sites

After checking your video, I'd put the mouse clicks on a separate button. Hmmm. Time for a dive into arcade maker hobby forums..

 

Share this post


Link to post
Share on other sites
2 minutes ago, LaPorta said:

There is definitely a MouseStick 1 that works via the serial interface. I'd seen one on an Apple IIe once.

For sure. Also, I've seen ads for the Kraft ugly square box joystick and definitely remember seeing it in stores and in Macintosh labs inside my brother's school. However, they are impossible to find on ebay. The MouseStick II is way more common and even less of the right era.

 

Share this post


Link to post
Share on other sites
1 hour ago, Mu0n said:

Mac Plus mouse serial port

It's not actually a serial port even though it looks like one, it's a quadrature mouse port.  So it emits two square waves per axis, where the frequency tells the computer how fast the mouse is moving, and which wave is leading tells it which direction it's going in.  See http://danceswithferrets.org/geekblog/?p=742 for more detailed information on what those signals look like.  So the code on the Arduino effectively plays back two square waves (defined at the top as arrays) at varying speeds and in either direction.  Happy to give more information about how this works if need be.

 

1 hour ago, Mu0n said:

1) what's the exact product # for your arduino mini? 

Honestly, I went on eBay and searched for 'arduino pro mini 5v' and bought the first ten pack that looked like it was from a moderately respectable seller some time ago.  Anything *5v* and pro-mini adjacent will do.  5v is important because the mouse port operates at 5v.  I mocked it up first on an Arduino Uno that I just happened to have in the cupboard, although this used too much power to be used at the same time as a FloppyEmu. 

 

1 hour ago, Mu0n said:

2) Did you do a lot of iterations to work out your stick's dead zone? 

No, added debugging to print out the stick positions and fiddled with it a bit, made a guess based on what it printed on the screen and only had to adjust it a little bit.

 

1 hour ago, Mu0n said:

3) Which games have you tried it with 

I have only used this with applications as yet; I'd have thought if you wanted to try it with games, you'd need to pay more attention to the speeds and dead zone and so forth.

 

1 hour ago, Mu0n said:

4) the dream setup would be to have two of those for a 2 player match for a Mac Plus, so that would mean using the printer port or the keyboard port. Would it be possible to code specific keystroke outputs to your code? Do you know enough how keystrokes are handled at the machine runtime level? 

As I noted above, the Mac Plus mouse port looks like a serial port, but isn't.  So, attaching one to a serial port would require completely different software/and or kettle of fish.  Personally, if I wanted to simulate keystrokes, I'd be inclined to interface with the keyboard port on the plus and have some kind of passthrough for the real keyboard, rather like the old external keypads did.  That is serial data, and the protocol for how to pretend to be one is pretty well documented.  See here for an example of building something that uses it and here for a documentation of the protocol.  An arduino-based project that speaks the keyboard protocol as a keyboard is here: https://github.com/trekawek/mac-plus-ps2.  If you wanted to pretend to be a keypad, my suggestion would be to have a box with an arduino in it that acts like a keypad, and then just have wires out to joysticks that are just switches with no intelligence at all, rather than trying to daisychain multiple arduinos (arduini?)

 

1 hour ago, Mu0n said:

I'd put the mouse clicks on a separate button

Yes, I think you're right.  The click is a bit unwieldy, and it probably would have been better to have the mouse button(s) on the side of the case so I could use them with my other fingers while fiddling with the stick.  I also should have put more buttons on—the Lisa hardware supports three, and the other platform I'm into that uses quadrature mice (Acorn Archimedes) requires three buttons to use the OS.  Oh well, iteration 2!

 

Hope this information is useful!  Would be happy to weigh in on/help write code for a Plus keypad emulator but I'm unlikely to immediately build one myself; I just don't need one and I have too many projects already clamouring for attention :-).

Edited by cheesestraws

Share this post


Link to post
Share on other sites

I'm about to order my parts:

 

Arduino (gonna get a bunch for more tests down the road): https://www.buyapi.ca/product/arduino-compatible-pro-mini/

Stick modules KY-023: https://arduinomodules.info/ky-023-joystick-dual-axis-module/

Button (??? open to suggestions):  https://www.sparkfun.com/products/9337

 

Needs:

-3D Design (fusion360) a not-too-big case that: seats the Arduino with small tabs making a rectangle contour. Holding it with...hot glue??

 

-Have a removable entry point to the data cable pins of the arduino so that it can be reprogrammed without opening the whole case

 

-Secure the button that's separate from the stick with screws elsewhere in the case

 

-Make a mouse-centric copy that *can* program deadzones and all the subtleties required. In Archon, I need to make sure the pure horizontal and vertical zones are large enough so that you don't accidently go diagonal - that's very frustrating during a game using a real mouse - to the point where your whole strategy revolves around getting those diagonal shots because it's that much harder to line the other ones.

 

-Maybe the code could host a few preprogrammed settings and a physical switch could turn on and off and interact with an IO pin on the arduino and the code would adjust between the settings on the fly? It all depends if there are enough pins to do this on the arduino. Did you have spares?

 

-Make a keyboard centric copy that plugs in the front of the mac. I know I can't use a regular phone cable because those use 2 wires while the mac uses all 4 of them - I have to be extra careful with the wiring. This way, I could hardcode these values just to get Archon to play:

 

image.png.57b1775168513f9e0e2fd99c150b157b.png

 

-Make a Y connector that allows to keep the original keyboard plugged in, but also add that keyboard-piggybacking keyboard as well. Any suggestions to make the electric circuit secure.

 

 

 

Edited by Mu0n

Share this post


Link to post
Share on other sites
12 minutes ago, Mu0n said:

Did you have spares? 

Plenty.  I'll go and check exactly how many later, if you would like.

 

12 minutes ago, Mu0n said:

I know I can't use a regular phone cable because those use 2 wires while the mac uses all 4 of them

The trick here is to use a replacement wire that goes between the phone base and the handset, not between the phone and the wall.  That's how I made my replacement Plus keyboard cables (with one end re-terminated)  Again, can dig out a link to what I used, if need be.

Share this post


Link to post
Share on other sites

@cheesestraws

I almost forgot to consider getting this. Do you confirm it's essential and you didn't jerry-rig something yourself?

image.png.84236ef60a47ba5831e757fbadf622bc.png 

 

I've started cracking open Inside Macintosh vol 3 (1985) to get detailed information on what the keyboard - Mac Plus communication's expectations are.

 

image.png.f3c7ffca8a85f399341ddf4a12ebdac1.png

image.png.7f56a8355b62dd558bca39877aaaf53e.png

and if I want to use a daisy chain connection configuration (mac to my joystick (akin to keypad) and joystick, it looks a bit more complex. Did you go that route?

 

image.png.3881aaed9f5b21ff63fa6919b4f83d21.png

 

I don't "need" to do it, but it would be less annoying to keep it connected instead of exclusively using the keyboard or my future second joystick.

 

 

 

Share this post


Link to post
Share on other sites
24 minutes ago, Mu0n said:

I almost forgot to consider getting this. Do you confirm it's essential and you didn't jerry-rig something yourself?

Yup, you need a serial adapter thing.  I got a cheapish one off eBay.

 

24 minutes ago, Mu0n said:

Did you go that route? 

I didn't, but it'd be totally different for a mouse anyway.  I agree it would make things much easier...

Edited by cheesestraws

Share this post


Link to post
Share on other sites

Still waiting for my parts, but I started some progress with my ATMega arduino board and checking out your mouse code.

 

I believe the only difference I needed for the Plus is to reverse the boolean on the mouse click output. You used a pullup input and it was constantly trying to eject the disk drive when I first plugged it in. Reversing it did the trick.

 

 

image.thumb.png.1687a53a86eec83f2fa5b9be30ee5115.png

Edited by Mu0n

Share this post


Link to post
Share on other sites
5 hours ago, Mu0n said:

reverse the boolean on the mouse click output

... you're right, that ought to be active-low and I'm treating it as if it was active high.

 

... ... why is mine working? :D

 

edit: because on mine the switch is wired between the input (with pullup) and ground, not 5v.  So when the switch is inactive, the pin reads high, and when it's pressed the pin reads low.  There's no pulldown internally on the boards I have.  So if I had the switch between 5v and the pin, I'd get random mouse clicks from whatever random noise happened to be around while I was debugging it - usually my hand accidentally prodding the solder joints.  I'd suggest doing as I did and making that input active-low and grounding it with the switch.

Edited by cheesestraws

Share this post


Link to post
Share on other sites

image.thumb.png.fabcfd2fc1b893bdc4de72448856ce0c.png

 

This is my first Fusion360 project so I'm FOR SURE, overthinking a few things in it. Here are my steps and wants:

 

-Added an image of the Arduino micro 5V I ordered (order still en route) where I tried using the website's image provided in a shot that also had an american quarter, so I deduced the dimensions as best I could

-The general size of the controller is very slightly smaller than an xbox360 controller and it's pretty silly since it'll have the one button

-the button hole on the right is only temporarily sized, I have no idea yet which of the button types I'll be using

-same for the stick hole, I'm waiting to receive my analog sticks to decide how large to make it

-I have 3 little "walls" to prevent the board to wiggle out. I made such little gaps around it and I'm thinking about giving it more space but I have no experience on how much is enough and how much is too much

-the arduino board gives 3 mounting holes which I made little riser posts for it (still need to do a larger part of the post undernearth the board).

-the hole in the back will attempt to be of the proper size for some cable securing nut-thing I got off digikey

-hole in front for the micro-usb connector that comes with the board, I'm only guesstimating the size right now

-one of the last steps I'll do is to split the top and bottom half of this thing so that they can be printed separately so that I can properly assemble it anyway.

-dunno which button I'll use, I need to have them in hand to decide based on ClickFeel

-I might be forced to get rid of the concave aspect of the outer shell underneath it, because it would just be too hard to 3d Print. It's a bummer, unless some of you have an idea

 

You can check out and move around the model with this public link: https://a360.co/2X7DvxZ

 

 

Parts ordered status:

-10x small clicky buttons from Amazon (received): https://www.amazon.ca/-/fr/gp/product/B07FKB6648/

-3x Adafruit 5V Trinket 16 Mhz from BuyaPi.ca (en route): https://www.buyapi.ca/product/adafruit-pro-trinket-5v-16mhz/

-3x Analog sticks (en route) from BuyaPi.ca: https://www.buyapi.ca/product/analog-2-axis-thumb-joystick-with-select-button/

-1x 16 mm illuminated green button from BuyaPi.ca (en route): https://www.buyapi.ca/product/16mm-illuminated-pushbutton-green-momentary/

-1x ?? mm red button (en route) from BuyaPi.ca: https://www.buyapi.ca/product/3a-125v-momentary-push-button-switch/

-2x cable glands (received) from DigiKey: https://www.digikey.ca/en/products/detail/bud-industries/IPG-2227/5291485

-2x DB-9 cables (en route) from monoprice: https://www.monoprice.com/product?c_id=301&cp_id=30112&cs_id=3011201&p_id=442&seq=1&format=2

 

Edited by Mu0n

Share this post


Link to post
Share on other sites
On 5/30/2020 at 1:34 PM, Mu0n said:

You can check out and move around the model with this public link: https://a360.co/2X7DvxZ

This is much classier than my "case"—I like it a lot!

 

On 5/30/2020 at 1:34 PM, Mu0n said:

-hole in front for the micro-usb connector that comes with the board, I'm only guesstimating the size right now

At least for me, with a Pro Mini, it could run perfectly comfortably off the current from the mouse port (at the same time as a Floppy Emu, so).  In fact, my Minis don't have a USB port at all, they use a separate breakout board for USB.  Though you might need it for the keyboard side of your project...

Share this post


Link to post
Share on other sites

Got my stuff (except the DB-9 cable) and a prototype is working!

 

The caption for this video is:

 

"Confinement Day 75"

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×