English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 26 May 2016, 09:37   #1
Lazycow
Registered User
 
Lazycow's Avatar
 
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
It seems like the 2nd button is always pressed. The Hardware reference manual says that the pin for the 2nd button can be configured as input or output, maybe that has to be prepared first? (But I don't know how)

The 2nd button on the mouse port works. (btst #10,d1)

any hints?
Lazycow is offline  
Old 26 May 2016, 11:47   #2
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Try this somewhere in the initialization of your program :
Code:
 move.w #$ff00,$dff034
How exactly it works, is still unclear to me.
meynaf is offline  
Old 26 May 2016, 12:03   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
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..
Toni Wilen is offline  
Old 26 May 2016, 13:05   #4
Lazycow
Registered User
 
Lazycow's Avatar
 
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!
Lazycow is offline  
Old 12 June 2016, 15:25   #5
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
After first reading, it seems like 2nd buttos is allway pressed!

Issue resolved

Last edited by sandruzzo; 12 June 2016 at 16:08.
sandruzzo is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:02.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11983 seconds with 13 queries