On real hardware Amiga and Atari ST mcie pin 5 (POTX) is not connected to anything when the right mouse button is not pressed, and connected to GND when pressed. The SID can't distinguish between these two states, thus the right mouse button can't be read.
In Vice, it behaves as though pin 5 were connected to +5V when the button is not pressed, and to GND when pressed. Thus, in Vice the button can be read.
(For comparison, two and three button joysticks on the C64 connect pins 5/9 (POTX/POTY) to +5V when pressed and leave them unconnected when not.)
True indeed. Strangely though, there ARE pull-ups in some schematics for those...
fixed in r45196
I have inspected a couple of Amiga mice and I can confirm that they have pull-up resistors connected to both buttons, so they should both be readable even from the C64.
Please note that the right button is connected to pin 9, not to pin 5. Maybe this is why your reading failed? Pin 5 is used for the middle button, if it exists.
Last edit: SukkoPera 2024-06-20
Original Amiga mice? I have never seen this - and it is common knowledge that there are none too (and they are not required with an Amiga either). Perhaps they exist only in the 3 button mouse? (I don't have any of these)
Yes, original ones. That was some time ago though and my memory might be playing tricks on me. Can't check again at the moment unfortunately, but I will get back to this some day :).
I've just measured my Commodore A 1B086056 and Atari STM1 mice.
When the right button is released, POTY is connected to neither GND nor VCC.
When the right button is pressed, the resistance between POTY and GND is about 2.5Ω, POTY and VCC 7,5kΩ (Amiga) / 9.5kΩ (ST).
So, no pullup resistor in either one.