Skip to content

Conversation

@dotkoval
Copy link
Contributor

@dotkoval dotkoval commented Feb 1, 2026

  • classic 2-button mouse interface
  • available for classic ZX Spectrum models (48/128/+2/+3)

* classic 2-button mouse interface
* available for classic ZX Spectrum models (48/128/+2/+3)
Comment on lines 40 to 42
// The right key was the primary key in most implementations in the 1980s–1990s.
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_NAME("Mouse Button Right") PORT_CODE(MOUSECODE_BUTTON2)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_NAME("Mouse Button Left") PORT_CODE(MOUSECODE_BUTTON1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't mean it should map arbitrarily. It's IPT_BUTTON1 / IPT_BUTTON2, numbers are relative to your device, leaving the user to assign inputs if the defaults aren't satisfactory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that mapping matches what I did before for the clones without exp slot.
I would prefer to keep them consistent and fix everywhere in one shot.
Let's not make him responsible for my mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Thanks for pointing this out. I've updated it to use IPT_BUTTON1/IPT_BUTTON2. I kept the PORT_CODE(MOUSECODE_...) defaults to ensure correct 2-button behaviour, as otherwise BUTTON2 maps to the middle mouse button by default.


**********************************************************************/

// Original Kempston mouse interface description:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move up, inside header comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rgr! Fixed in the latest commit :)

* Use IPT_BUTTON1/IPT_BUTTON2 as logical device buttons
* Override default host mapping to ensure correct 2-button behavior
@@ -0,0 +1,107 @@
// license:BSD-3-Clause
// copyright-holders: Oleksandr Kovalchuk
// Thanks to: Nigel Barnes (based on kempjoy implementation)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the Thanks, it's a very common device template.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to check - should I remove the "Thanks" line?
I think expressing appreciation is never a bad thing :) but if it doesn't match the usual template or project rules, I'll gladly remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, remove, it's thanking me though I haven't contributed to this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it! Done.



//-------------------------------------------------
// input_ports - device-specific input ports
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't like these mumbling comments anymore. Anybody confirm?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally don't see the point to them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up the comments according to your suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me now

//-------------------------------------------------

static INPUT_PORTS_START( kempmouse )
PORT_START("mouse_x") /* 0xFBDF */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and block comments for single line

@ajrhacker ajrhacker merged commit 6edb7a1 into mamedev:master Feb 7, 2026
jmvannieu pushed a commit to jmvannieu/mame that referenced this pull request Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants