• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Joystick mouse replacement for Lisa/128/512/Plus

cheesestraws

Well-known member
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).


View attachment 61032109110__9A2C2F53-9387-449C-BC64-B0B94C479ACA.MOV





It's reasonably comfortable to hold.

61032074071__C917F95F-0E42-4046-A240-577DCBF8AF25.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.JPG

 

dcr

Well-known member
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.  ;)

 

Mu0n

Well-known member
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.

 
Last edited by a moderator:

LaPorta

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

 

Mu0n

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

 

Mu0n

Well-known member
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.

 

cheesestraws

Well-known member
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) 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. 

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.

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.

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?)

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 :) .

 
Last edited by a moderator:

Mu0n

Well-known member
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

-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.

 
Last edited by a moderator:

Mu0n

Well-known member
Also, I'm centralizing the info in this thread for future reference:

image.png

2d689b4b55bd6703107523e8eb991bf6.png.7ed14d4ea9cae242febfc54309a5eff6.png


image.png

Source for these: http://myoldmac.net/FAQ/MacintoshPlus-Pinouts.php

 
Last edited by a moderator:

cheesestraws

Well-known member
Did you have spares? 
Plenty.  I'll go and check exactly how many later, if you would like.

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.

 

Mu0n

Well-known member
@cheesestraws

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

image.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

image.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

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.

 
Top