Page 1 of 1

Mouse Support for Mega Drive and Mega CD Cores

Posted: Fri Aug 20, 2021 1:08 pm
by Moondandy
Hey guys, was news to me, but there was actually an official mouse release for the Mega Drive and Mega CD with a number of games supporting it. Interestingly you could actually flip the mouse over and use it as a track wheel for games like Marble Madness.

Would it be possible to get usb mouse support added into the cores?

Here is some info and a list of games.

https://segaretro.org/Sega_Mouse

Mega Drive:

Body Count
Cannon Fodder
Fun 'n' Games
Janou Touryuumon
Jimmy White's Whirlwind Snooker
Lemmings 2: The Tribes
Lord Monarch: Tokoton Sentou Densetsu
Marble Madness
Nobunaga no Yabou: Haouden
Nobunaga's Ambition
Richard Scarry's Busytown
Shanghai II: Dragon's Eye
Wacky Worlds

Mega CD:

Crime Patrol
Dungeon Master II: Skullkeep
Eye of the Beholder
Links: The Challenge of Golf
Mad Dog II: The Lost Gold
Mad Dog McCree
Might and Magic III: Isles of Terra
My Paint: The Animated Paint Program
Nobunaga no Yabou: Haouden
Panic!
Shin Megami Tensei
StarBlade
The Secret of Monkey Island
Urusei Yatsura: Dear My Friends
Warau Salesman
Who Shot Johnny Rock?
Yumemi Mystery Mansion

Another interesting tit bit, there was a planned keyboard release but it never made it past prototype phase and nobody really knows what it would be used for.
https://www.segadriven.com/sega-mega-dr ... nreleased/

Re: Mouse Support for Mega Drive and Mega CD Cores

Posted: Fri Aug 20, 2021 3:47 pm
by TLPD-AVW
These cores already have USB mouse support. You can enable it in core's Input menu. The hidden button under the mouse ball is mapped to the middle button. The only issue with implementation I can come up with is that Shanghai II in particular was built around the American Mega Mouse model with the Start button (Japanese/European mouses did not have it), so you have to use a regular controller to access the options menu in game.

Re: Mouse Support for Mega Drive and Mega CD Cores

Posted: Fri Aug 20, 2021 5:06 pm
by dshadoff
There's no reason that the core couldn't use a side button (ie. "back"/"forward") as the Start button.

Re: Mouse Support for Mega Drive and Mega CD Cores

Posted: Fri Aug 20, 2021 6:33 pm
by TLPD-AVW
Just tested My Paint on Sega CD with a USB mouse with two side buttons. Those buttons seem to mimic Right and Middle mouse buttons (B and C on gamepad). If there's no technical reason not to use side buttons, that would be indeed an elegant solution to assign the Start button on them.

Re: Mouse Support for Mega Drive and Mega CD Cores

Posted: Fri Aug 20, 2021 7:49 pm
by dshadoff
I was just doing a dive into this (for PC Engine reasons); looks like there might need to be a bit of plumbing built first - but it will be made available.

Re: Mouse Support for Mega Drive and Mega CD Cores

Posted: Sat Aug 21, 2021 3:23 pm
by Moondandy
Ah very cool, didn't realise there was mouse support already - might be worth adding to the core notes. If the side buttons can be used to work as start that would be nice.

As an aside, does SNES have similar mouse support?

Re: Mouse Support for Mega Drive and Mega CD Cores

Posted: Sat Aug 21, 2021 4:03 pm
by dshadoff
It must have... lots more attention on that core, and more mouse games AFAIK

Re: Mouse Support for Mega Drive and Mega CD Cores

Posted: Sat Aug 21, 2021 8:54 pm
by aberu
Moondandy wrote: Sat Aug 21, 2021 3:23 pm Ah very cool, didn't realise there was mouse support already - might be worth adding to the core notes. If the side buttons can be used to work as start that would be nice.

As an aside, does SNES have similar mouse support?
Yes, USB Mice are supported in the SNES core. https://github.com/MiSTer-devel/SNES_MiSTer#features

And with SNAC you can even use a real SNES Mouse.

Two mice at the same time are not supported however. I think you can do it with a USB Mouse + SNAC SNES Mouse, maybe.

Re: Mouse Support for Mega Drive and Mega CD Cores

Posted: Mon Aug 23, 2021 1:39 pm
by Moondandy
Thanks for the info! Does the Mega Drive mouse work via SNAC on the Meg Drive and Mega CD cores?

Re: Mouse Support for Mega Drive and Mega CD Cores

Posted: Mon Aug 23, 2021 1:58 pm
by dshadoff
All original devices are supposed to work on SNAC.
It flips the bits on the port exactly as the original device would.

As Sorgelig likes to remind us, SNAC wasn't built with the intention of using it for regular controllers; it's for any special devices which might not be covered by the framework.

Re: Mouse Support for Mega Drive and Mega CD Cores

Posted: Thu Aug 26, 2021 4:02 am
by dshadoff
As a follow-up, if somebody wants to add it into the cores (I'm not sure where the mouse handling code is...)
You will need to:
1) just before the definition of hps_io, after "wire [24:0] ps2_mouse;", add a line:
wire [15:0] ps2_mouse_ext;

2) in the definition of hps_io, add (right after ".ps2_mouse(ps2_mouse)," ):
.ps2_mouse_ext(ps2_mouse_ext),

3) wherever you need to reference the side button, use "ps2_mouse_ext[8]" (which is the 'back' button on the modern mouse), keeping in mind that this value will be '0' when not pressed and '1' when pressed (which could be the opposite of what the core expects from the Sega mouse).