Mouse Support for Mega Drive and Mega CD Cores

User avatar
Moondandy
Top Contributor
Posts: 535
Joined: Mon May 25, 2020 2:14 am
Location: Edinburgh, Scotland
Has thanked: 32 times
Been thanked: 102 times

Mouse Support for Mega Drive and Mega CD Cores

Unread post 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/
User avatar
TLPD-AVW
Posts: 107
Joined: Sat Jul 11, 2020 9:59 am
Has thanked: 18 times
Been thanked: 42 times

Re: Mouse Support for Mega Drive and Mega CD Cores

Unread post 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.
dshadoff
Core Developer
Posts: 547
Joined: Sun May 24, 2020 9:30 pm
Has thanked: 20 times
Been thanked: 145 times

Re: Mouse Support for Mega Drive and Mega CD Cores

Unread post by dshadoff »

There's no reason that the core couldn't use a side button (ie. "back"/"forward") as the Start button.
User avatar
TLPD-AVW
Posts: 107
Joined: Sat Jul 11, 2020 9:59 am
Has thanked: 18 times
Been thanked: 42 times

Re: Mouse Support for Mega Drive and Mega CD Cores

Unread post 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.
dshadoff
Core Developer
Posts: 547
Joined: Sun May 24, 2020 9:30 pm
Has thanked: 20 times
Been thanked: 145 times

Re: Mouse Support for Mega Drive and Mega CD Cores

Unread post 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.
User avatar
Moondandy
Top Contributor
Posts: 535
Joined: Mon May 25, 2020 2:14 am
Location: Edinburgh, Scotland
Has thanked: 32 times
Been thanked: 102 times

Re: Mouse Support for Mega Drive and Mega CD Cores

Unread post 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?
dshadoff
Core Developer
Posts: 547
Joined: Sun May 24, 2020 9:30 pm
Has thanked: 20 times
Been thanked: 145 times

Re: Mouse Support for Mega Drive and Mega CD Cores

Unread post by dshadoff »

It must have... lots more attention on that core, and more mouse games AFAIK
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Mouse Support for Mega Drive and Mega CD Cores

Unread post 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.
birdybro~
User avatar
Moondandy
Top Contributor
Posts: 535
Joined: Mon May 25, 2020 2:14 am
Location: Edinburgh, Scotland
Has thanked: 32 times
Been thanked: 102 times

Re: Mouse Support for Mega Drive and Mega CD Cores

Unread post by Moondandy »

Thanks for the info! Does the Mega Drive mouse work via SNAC on the Meg Drive and Mega CD cores?
dshadoff
Core Developer
Posts: 547
Joined: Sun May 24, 2020 9:30 pm
Has thanked: 20 times
Been thanked: 145 times

Re: Mouse Support for Mega Drive and Mega CD Cores

Unread post 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.
dshadoff
Core Developer
Posts: 547
Joined: Sun May 24, 2020 9:30 pm
Has thanked: 20 times
Been thanked: 145 times

Re: Mouse Support for Mega Drive and Mega CD Cores

Unread post 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).
Post Reply