Atari ST/AMIGA mouse on SEGA?

For anything related to IO (joypad, serial, XE...)

Moderator: BigEvilCorporation

Post Reply
User avatar
Matej
Very interested
Posts: 58
Joined: Tue Feb 19, 2013 12:48 pm

Atari ST/AMIGA mouse on SEGA?

Post by Matej » Sat Jun 17, 2017 11:45 am

Sega Mouse is rare. So what about using Atari ST or AMIGA mouse instead of SEGA?
Simply by using simple driver in game / software?
There are also som reductions for AMIGA/ST:
http://amigastore.eu/en/414-rys-mkii-usb-adapter.html
http://www.mkl211015.altervista.org/ps2mhiiri627/
For using standard PC PS/2 or USB mouse...

I can imagine Arkanoid game or shooter game or paint program...

User avatar
TmEE co.(TM)
Very interested
Posts: 2285
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Atari ST/AMIGA mouse on SEGA?

Post by TmEE co.(TM) » Sat Jun 17, 2017 12:37 pm

Pinouts differ (VCC is in a totally different place), with a small modification those things could be used. No idea how hostile the protocol is, it might be better idea to just make your own adaptor and have existing Sega mice compatibility there, far more useful for most people I imagine.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

User avatar
Matej
Very interested
Posts: 58
Joined: Tue Feb 19, 2013 12:48 pm

Re: Atari ST/AMIGA mouse on SEGA?

Post by Matej » Sat Jun 17, 2017 5:54 pm

Here are some open source adapters:
USB-ps2 -> amiga mouse
http://bax.comlab.uni-rostock.de/en/har ... miga-maus/
SERIAL -> amiga mouse
https://github.com/shred/yami

I am no HW coder. Can someone adapt it to SEGA MOUSE protocol???

Charles MacDonalds doc on the Genesis IO, where you find this:

Sega Mega Mouse

This is a three button mouse (left, middle, right) with an extra button (Start) located near the thumb position. It uses a PIC16C54
microcontroller which manages the buttons and position tracking.
The Sega Mega Mouse that is distributed in North America is incompatible with the European version of Populous 2. The mouse
functions normally but has Y axis inverted so up is down and vice-versa. It may have been designed for the Japanese Mega Drive
mouse, which is a different product with 2 buttons and unique physical appearance.
The protocol works as follows: TH and TR are outputs which tell the microcontroller to stop or start a data transfer, and to
acknowledge received data. TL is an input which returns a busy flag for the microcontroller. D3-D0 are inputs that return the data.

Here's a table showing the communication process:
Write TH TR TL D3 D2 D1 D0 Description
$60 1 1 1 0 0 0 0 Request data
$20 0 1 1 0 0 0 0 ID #0 ($0)
$00 0 0 1 1 0 1 1 ID #1 ($B)
$20 0 1 0 1 1 1 1 ID #2 ($F)
$00 0 0 1 1 1 1 1 ID #3 ($F)
$20 0 1 0 Y Over X Over Y Sign X Sign Axis sign and overflow
$00 0 0 1 Start Middle Right Left Button state
$20 0 1 0 X7 X6 X5 X4 X axis MSN
$00 0 0 1 X3 X2 X1 X0 X axis LSN
$20 0 1 0 Y7 Y6 Y5 Y4 Y axis MSN
$00 0 0 1 Y3 Y2 Y1 Y0 Y axis LSN

Write #$60 when you are done polling to stop the data transfer. If you continue to poll the mouse after collecting all the data by
writing $20 / $00, the Y axis LSN will always be returned. Sega advises polling beyond this point will make the mouse behave
abnormally. It's possible that the PIC code in some versions of the Mega Mouse may have problems if the poll sequence is too
long.
The X/Y overflow flags are supposed to be set if the mouse is moved over a distance greater than can be measured. I can't get
them to become set, maybe the mouse supports a fairly wide range of movement.
You need a considerable delay between writing new values to TH/TR. I think the intention is to poll TL until the microcontroller
returns 'not busy', but I can't get this to work reliably. Sega's mouse reading code also has a timeout when checking TL which
would indicate it may get stuck in a certain state.
All buttons (start, left, middle, right) are active-high logic, so they return '1' when pressed and '0' when released.

Mask of Destiny
Very interested
Posts: 556
Joined: Thu Nov 30, 2006 6:30 am

Re: Atari ST/AMIGA mouse on SEGA?

Post by Mask of Destiny » Tue Jun 20, 2017 5:04 am

The Amiga mouse interface is very low level and depends on there being some hardware to do pulse counting. The Amiga counters can count pulses in a range of -128 to 127 and the hardware reference manual warns that "Fast-action games may need to read the mouse register twice per frame to prevent counter overrun". Even if we take 128 as a hard max, since the pulses are quadrature encoded, you would need to poll the port a minimum of 512 times per frame and possibly a good more times than that for truly consistent results.

An adapter could be made with a microcontroller, but if you're going to go that route I think you're better off going from PS/2 or even USB. That said, the US version of the Sega mouse seems to be relatively plentiful on ebay and doesn't seem to be terribly expensive (20 USD for "Buy It Now").

User avatar
KanedaFr
Administrateur
Posts: 1109
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Re: Atari ST/AMIGA mouse on SEGA?

Post by KanedaFr » Tue Jun 20, 2017 10:50 am

I remember I was looking for something similar, when I realized (not US) mouse price was just pure nightmare.

I planned to adapt this : https://www.msx.org/forum/msx-talk/hard ... msx?page=0
which is clearly something not that hard to do...I just lacked of time (as usual) and was waiting for a real reason to do it.
My only problem is the correctly handle the ID part (so the genny knows it's a mouse connector on port X)

If someone wants to try.... ;)

User avatar
Sik
Very interested
Posts: 583
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Atari ST/AMIGA mouse on SEGA?

Post by Sik » Wed Jun 21, 2017 10:23 am

Yikes that Amiga protocol.

And yeah, and that point, if you aren't going with the original thing then let's just make an adapter for an USB mouse. Do you really want to deal with cleaning the ball from an old non-optical mouse? =P (especially once it gets so dirty that the dirt is deep inside the mouse mechanism and nearly impossible to clean short of disassembling the whole thing)

The biggest problem is that most modern mouses have three buttons but the Mega Mouse has four. No idea if there's anything making any real use of the fourth button (or even the third, since the Sega Mouse has two buttons so why would you bother programming the third button?).
Sik is pronounced as "seek", not as "sick".

User avatar
TmEE co.(TM)
Very interested
Posts: 2285
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Atari ST/AMIGA mouse on SEGA?

Post by TmEE co.(TM) » Wed Jun 21, 2017 11:00 am

You got 3 buttons and a scroll wheel on vast majority of modern mice. The scroll wheel can be the 4th button.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

User avatar
Natsumi
Very interested
Posts: 80
Joined: Mon Oct 05, 2015 3:00 pm
Location: 0x0
Contact:

Re: Atari ST/AMIGA mouse on SEGA?

Post by Natsumi » Wed Jun 21, 2017 7:24 pm

Also gaming mice with way more than 4 buttons are actually fairly cheap nowadays. Sure, you are getting a shit mouse, but its not like you can use it to its full potential on a system thats almost 30 years old... :P

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest