26 May 2016, 09:37 | #1 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
Joystick Buttons
Hi, I have problems querying the 2nd button in the joystick port...
Code:
bclr #5,d0 move.w $dff016,d1 btst #14,d1 bne.s .skip bset #5,d0 The 2nd button on the mouse port works. (btst #10,d1) any hints? |
26 May 2016, 11:47 | #2 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Try this somewhere in the initialization of your program :
Code:
move.w #$ff00,$dff034 |
26 May 2016, 12:03 | #3 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,570
|
Yeah, proper button read requires output mode and IO data set to 1. This is explained in HRM.
Joystick and mouse button line is "floating" when not pressed, grounded when pressed. Output mode with data=1 simulates pullup resistor, pulling non-pressed logic state back to 1. (This is not dangerous, IO lines are designed for this) Without pullup button releases would not work. Note that some 3rd party joypads and some mice have internal pullup resistor. They do work without output mode. This has caused lots of confusion.. |
26 May 2016, 13:05 | #4 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
Ah, ok... the POTGO register! How did I miss that one?
(I just wonder why I have to set the pins to OUTPUT, when I actually want read something... yes, yes, you explained it...) Anyway, it works! Excellent! |
12 June 2016, 15:25 | #5 |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,344
|
After first reading, it seems like 2nd buttos is allway pressed!
Issue resolved Last edited by sandruzzo; 12 June 2016 at 16:08. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
joystick buttons remap don't work | jotd | support.WinUAE | 9 | 06 March 2016 20:26 |
Map spare gamepad buttons to left/right mouse buttons (for skipping intros) | dreamkatcha | support.FS-UAE | 6 | 02 February 2013 23:03 |
Assigning joystick buttons to keyboard keys in PUAE | Gaula92 | support.OtherUAE | 3 | 16 September 2011 14:39 |
cannot change joystick buttons | fil | support.WinUAE | 3 | 19 August 2011 20:20 |
Joystick Buttons | Echo | Retrogaming General Discussion | 19 | 29 January 2003 19:42 |
|
|