keirf / amiga-stuff

The Unlicense
257 stars 26 forks source link

[AmigaTestKit v1.7] Middle mouse-button (MMB) not detected with 1d A1200 mainboard #19

Closed Drag0nFly closed 4 years ago

Drag0nFly commented 4 years ago

The middle mouse-button is not detected with the "Mouse, Joystick, Gamepad" (F4) test on one of my A1200s. It works fine on my 1d4 board (also w/ previous versions of SysTest going back to October 2017), but neither of them detects the MMB on the 1d (rarer, older mainboard), despite the MMB working properly in WHDLoad, and with the same mouse and adapter (TOM+) being used on both A1200s.

keirf commented 4 years ago

Have you tried on the other port on the non-working board (ie. port 2, usually joystick)?

Suspicion is that this is board related, even if it does work in WHDLoad. The circuitry and method for reading middle and right mouse buttons is basically identical. If one works and the other doesn't, Test Kit may be showing that there's something marginal about the hardware regarding pin 5 of joy/mouse port 1.

Drag0nFly commented 4 years ago

I believe I tested this previously, but I checked it again now to make sure with the same mouse in port #2/joystick: It shows the same behaviour; i.e, LMB & RMB are detected properly, but not MMB.

Drag0nFly commented 4 years ago

And yes, I agree with you wrt. the circuitry regarding RMB & MMB - I even looked at the schematics. This had some other users baffled as well.

Could it be that this 1d revision actually does not conform to the later spec? It seems utterly strange that the MMB would be intercepted only by Workbench & WHDLoad but not SysTest/AmigaTestKit when RMB is detected properly in your test suite on both ports.

keirf commented 4 years ago

What kickstart, workbench, whdload versions? It may be that I am not setting POTGO register to a "usual" value; perhaps to a value not tested with your Tom mouse adapter. I note that whdload changed its POTGO setting (probably away from how I currently set it) back in 1999 due to RMB issues. I can perhaps have a dig around under emulation and see if there's a better value to configure pins 5 and 9 which better represent typical Amiga software.

keirf commented 4 years ago

Had a bit of a look on EAB (http://eab.abime.net/showthread.php?t=97692) and also a quick look at Kickstart v3.0. Former suggests writing 0F00 to POTGO (which sets port 1 pins 5 and 9 into output mode, disconnects potentiometer-sensing circuitry, and pulls the pins high); Latter actually does seem to do that.

However that is basically same as Test Kit, which sets POTGO to FF00 (done because I want to be able to test 2- and 3-button gamepads too, on port 2). So I'm not clear what's wrong! :)

keirf commented 4 years ago

The only dissenting info I found was one release note for WHDLoad 9.0 (back in 1999): "fix: potgo set to input mode now, fixes right mouse button problem with ArcherMcLeanPool and JimmyWhiteSnooker (Mr.Larmer)"

I will ask on EAB if anyone has an opinion. I wonder if TOM+ pin 5 is just electrically marginal on that board. But if it works reliably on WB/WHDLoad and not at all on TK that is pretty weird all the same.

EDIT: https://eab.abime.net/showthread.php?p=1392362

Drag0nFly commented 4 years ago

What kickstart, workbench, whdload versions? It may be that I am not setting POTGO register to a "usual" value; perhaps to a value not tested with your Tom mouse adapter. I note that whdload changed its POTGO setting (probably away from how I currently set it) back in 1999 due to RMB issues. I can perhaps have a dig around under emulation and see if there's a better value to configure pins 5 and 9 which better represent typical Amiga software.

The system is on 3.1 ROMs & WB – so Kickstart version 40.68 and Workbench 40.42 + Exec 40.10.

And WHDLoad 18.5. The same behaviour was seen on 18.3 & 18.4 though.

Drag0nFly commented 4 years ago

I can do some more testing to see how accurate it works with WHDLoad. What I have noticed though is that the MMB works right after the slave is launched (but not LMB/RMB - unless configured as $QuitKey). Once the slave has been running for a while (10 seconds or more), it does not exit. I suspect this is due to how the buttonpress is intercepted (i.e, some interrupt-disable thing). I did not test this on several slaves, so it might be dependent on one demo though. (Not sure how useful this information is, but putting it out there all the same.) ;)

keirf commented 4 years ago

I got no response on EAB so far. Does MMB work consistently in Workbench?

Drag0nFly commented 4 years ago

I can test this weekend. Do you know of any application other than WHDLoad which utilizes the middle mouse-button?

keirf commented 4 years ago

Cheers. I think you need a tool like Freewheel to assign third button behaviour in Workbench.

Drag0nFly commented 4 years ago

First of all, sorry for the lateness. Summer finally came here and Everyone(tm) is outdoors. ;-)

Well, this is getting stranger by the minute: The demo I was testing the MMB with was Network's "Synthesis". It consistently exists the demo when I assign QuitKey=258 (hex $102) at the beginning of the demo (within the first few secs).

If I let it run past the initial opening screen (only a couple of seconds later) it still exits the demo, but requires at least three MMB presses to do so.

When I re-assign the QuitKey to something else (usually F10), MMB (or RMB) does not do anything at all. Similarly for RMB when quitkey is set to 258. (since these two buttons should be handled the same way, i.e if RMB works MMB sohould also, etc.)

I ran the demo approx. 30 times, and it intercepts every MMB press at the beginning (and exists as expected) - consistently every time. I then tested some other demos, like Virtual Dream & Fairlight's "Love" demo, where MMB also works but needs a couple of presses.

I seem to recall something similar with my 1d4 board (where ATK/SysTest detected the MMB). There were for sure some WHDLoad demos + games which just would not exit. (I assigned this as I did not have a keyboard attached to the A1200)

Out of curiousity I tested MMB with Jimmy White's Snooker where it did absolutely nothing when assigned as the quitkey. Same with Archer Maclean's Pool - but those two are the same game I guess from the looks of it...

I will do some more testing with Freewheel later on. It might be some weird incompatibility with the TOM+ adapter if Freewheel behaves the same way.

Drag0nFly commented 4 years ago

Tested Freewheel on the 1d board; it also does not detect any MMB mouse-presses (after rebooting the A1200). Did a few more tests with WHDLoad, and it behaved similarly (i.e, MMB presses are sometimes passed through to the app when $QuitKey=258 (and always with Network - Synthesis, during the first few secs), and never when $QuitKey is set to something other than MMB.

Then tested the TOM+ adapter on my other A1200 1d4 board, and it behaves as it should – MMB presses are detected (with the same mouse) on ATK and WHDLoad.

I was beginning to think this was some strange incompatibility between the TOM+ and the a1200. However, it does not explain why RMB works (consistently) on both models, and only the MMB on one of them, when the circuitry for reading the mouse-presses should be identical for MMB + RMB.

Sorry for not being of more help; I will keep digging. (Maybe there is an undocumented thing somewhere relating to early-revision a1200 boards (if I had Dave Haynie's contact details I would contact him directly ;)

keirf commented 4 years ago

Then I think I can close this ticket, as the issue seems to be in the board, or perhaps a marginal voltage output on the TOM+ (how low exactly does it pull the output pin when the MMB is pressed). It's clearly not ATK, which is actually correctly flagging an issue visible with other software on that board, too.

Drag0nFly commented 4 years ago

Yes, it is clearly not ATKs fault. Although it would be interesting to know /what/ exactly it might be. Perhaps the developer of the TOM+ could shed some light on it.

Drag0nFly commented 4 years ago

And thanks for your help looking into it regardless – feel free to let me know if any details from EAB should emerge at a later date. Guess there's not that many 1d rev. boards around, if the issue is not with the CIAs (although it would be strange that it affected both ports), or maybe Paula.