12 June 2019, 20:52 | #1 | |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 260
|
Right mouse button check
Hi,
something trivial but actually I'm confrontated with a behaviour of the Paula hardware I don't understand. I wrote a routine which is nested in memory and survives a reset via the CoolCapture-Vector of the Exec-Base. The interrupts or DMA are untouched by my routine. In this routine I check if the right mouse button was pressed during the reset like this: Code:
... btst #2,$dff016 ;Check for the DATLY-bit (Paula Pin 36) of the POTINP-register beq.s rmb_pressed ;If bit2 of the upper byte=low then button is pressed ... But on the config A4000 CS Mk II 060, Picasso IV my test failed. Everytime the button was not pressed, the DATLY bit of POTINP was low. I read a little bit in the HRM an found the part DIGITAL I/O ON THE CONTROLLER PORT with this passage: Quote:
Maybe someone can enlighten me. Last edited by dissident; 12 June 2019 at 21:27. |
|
12 June 2019, 21:32 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,519
|
This is not the first time this topic has been discussed here but here is quick reply:
First the standard reply: KS ROM sets mouse port data direction=output automatically because with standard mice and input mode would cause stuck button read after first press (button pressed = shorted to ground, button release = floating, there is nothing to recharge the POT capacitor after release). BUT there are 3rd party mice (usually they have Amiga/ST switch) that have pullup resistors in button lines and they work without output mode. Joystick port is not set to output mode by default if KS 2.0+ (but KS 1.x does). Check that you didn't accidentally clear data direction/data bits and/or check type of your mouse by measuring resistance between button pin and gnd and +5v. Non-standard bonus reply: in your case reset may change register contents (I am not sure if POTGO gets reset) but if it does, you need to set it correctly and wait a bit before checking button state. It is also possible CSMK SCSI boot rom or Picasso IV boot rom pokes POTGO. (Perhaps they have "do/don't do something if right button is pressed" early boot checks?). I am also quite sure KS resets it early before it gets initialized (when input.device starts?) 2nd/3rd button handling is always tricky because as long as POT capacitor is charged, button press can work once even if POTGO is "incorrectly" configured. |
14 June 2019, 22:49 | #3 | |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 260
|
Quote:
Hi Toni, many thanks for your very detailed reply. It's always a pleasure discussing about hardware details with you. This is the background information I needed and it confirms my theory. I changed my routine and set POTGO to the OS standard value $0F00 so that DATLX (middle mousebutton) & DATLY (right mousebutton) have the data direction out and are set to high. Then I wait 5 rasterlines (about 320 us). This delay could be also done via the CIA timers. After that I check the right mouse button. That's all. Now tested successfully on the config A4000 CS Mk II 060, Picasso IV + Commodore 327124-15 mouse. Here's the code: Code:
MOVE.L #$DFF000,A5 MOVE.W #%0000111100000000,$34(A5) ;POTGO Set standard OS value MOVEQ #5-1,D2 ;Wait 5 rasterlines (~320 µs) MOVE.L #$0001FF00,D3 ;Mask for vertical beam position V0-V8 wait_loop1 MOVE.W 6(A5),D0 ;Get VHPOSR content SWAP D0 ;Move content to the upper word MOVE.W 4(A5),D0 ;Get VPOSR content AND.L D3,D0 ;Only bits V0-V8 wait_loop2 MOVE.W 6(A5),D1 ;Get VHPOSR content SWAP D1 ;Move content to the upper word MOVE.W 4(A5),D1 ;Get VPOSR content AND.L D3,D1 ;Only bits V0-V8 CMP.L D1,D0 ;Still the same vertical position? BEQ.S wait_loop2 ;Yes -> loop dbf d2,wait_loop1 BTST #2,$16(A5) ;POTINP Test bit 2 for the right mouse button BEQ.S RMB_pressed ;If low then branch |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A1200 mouse movement issues - check my working out | SpocksBeer | support.Hardware | 5 | 02 September 2023 19:38 |
A2000 left mouse button use in workbench causes mouse to stop responding. | gary_nz | support.Hardware | 5 | 17 September 2017 10:03 |
A600 right mouse button not working | protek | support.Hardware | 48 | 18 March 2013 14:57 |
Right mouse button not working? | NovaCoder | project.ClassicWB | 3 | 09 May 2011 06:26 |
Problem right mouse button | 3dfx4ever | support.Hardware | 3 | 17 February 2011 08:33 |
|
|