-
Notifications
You must be signed in to change notification settings - Fork 2.3k
bus/spectrum: Add Kempston Mouse Interface slot device #14908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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)
| // 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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