English Amiga Board


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

 
 
Thread Tools
Old 26 January 2024, 23:10   #1
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,542
Way to detect 4 player joystick adapter?

I was wondering if there was a way to detect if a 4 player joystick adapter (Dynablaster style) is present.

Also if there's a general guide on how to use it. The closest I've found is the source code for a Blitz Basic third party library
earok is offline  
Old 27 January 2024, 11:56   #2
koobo
Registered User
 
koobo's Avatar
 
Join Date: Sep 2019
Location: Finland
Posts: 363
The joysticks are wired to parallel port pins which are directly available in the CIA registers:

bit 2 in $bfd000 = adapter port 1 fire
bit 0 in $bfd000 = adapter port 2 fire
bits 0-3 in $bfe101 = adapter port 1 directions
bits 4-7 in $bfe101 = adapter port 2 directions

These are active low signals. I read some example sources in the recent past where these were used, I added support to my own application successfully.
koobo is offline  
Old 27 January 2024, 12:08   #3
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Correct. I bought a 4-player adapter in the 90s and started to write some games using it, so I could check my old sources.

The directions are:
  • bit 7/3 : right
  • bit 6/2 : left
  • bit 5/1 : down
  • bit 4/0 : up
And don't forget to clear all bits in DDRB to make all lines of port B input.
phx is offline  
Old 27 January 2024, 22:45   #4
Korodny
Zone Friend
 
Join Date: Sep 2001
Location: Germany
Posts: 812
Quote:
Originally Posted by phx View Post
started to write some games using it
Anything that got released? Just wondering if I missed some four player classics
Korodny is offline  
Old 28 January 2024, 04:35   #5
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,542
Thanks all, that's a very handy reference!
earok is offline  
Old 29 January 2024, 01:24   #6
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by Korodny View Post
Anything that got released?
No. Most games we did in the 90s have never been finished. The source I checked for the 4-player adapter was M.U.L.E. 92 (only intro and player-selection exists): https://night.owl.de/index.php?id=56

Last edited by phx; 29 January 2024 at 01:58. Reason: typo
phx is offline  
Old 30 January 2024, 12:09   #7
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,346
Yup, reading is pretty simple as described. I have also seen (and built) adaptors that support two buttons on the extra controllers, but that's not a standard feature.

As for detection, there's no way to detect it because it's completely passive. All the joystick inputs are open-circuit until they're actually used, so electrically there's no difference between an empty parallel port and a 4-player adaptor with untouched joysticks. It would be trivial to add a little bit of logic to enable detection, but with so many passive adaptors out there, the horse has bolted on that one.
Daedalus is offline  
Old 01 February 2024, 06:35   #8
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,542
Quote:
Originally Posted by Daedalus View Post
Yup, reading is pretty simple as described. I have also seen (and built) adaptors that support two buttons on the extra controllers, but that's not a standard feature.
Do you mind if I ask how you would read the second button on such an adapter? I'm assuming it's just different bits on $bfd000 to the single button? Also does WinUAE emulate such an adapter?

The reason I'm interested in supporting second fire is future proofing for Scorpion - there are at least some four player games in development (notably Mixel's Wizonk). It would be cool to offer, for example, second fire jump on custom parallel port adapters that have that feature.
earok is offline  
Old 04 February 2024, 21:02   #9
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,346
Yeah, just reading a couple of the extra control bits in $bfd000 - the exact bit I'm not sure of. I'll have to dig out my adaptor to see which lines I used, but as far as I know, there's not a single game that uses it, and WinUAE doesn't emulate it. Probably the only software that does use it is ControllerTest, a controller tester I wrote.

I would suggest that adding it to Scorpion would be a good way of establishing a standard for 2-button 4-player adaptors, so any way you can get it working would be a valid approach.

Edit: Gah, now I'm just thinking about a way to go the whole hog and do an active 4-player adaptor with support for CD32-type controllers via the parallel port, with backwards compatibility for games expecting the standard 1-button 4-player adaptor. I don't need any more projects...

Last edited by Daedalus; 04 February 2024 at 21:15.
Daedalus is offline  
Old 06 February 2024, 19:40   #10
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
WinUAE has "Parallel port Joy1 Spare/2nd Button" input event that maps to normally unused parallel port pin (not mapped by default). I think there was at least one game that used it.
Toni Wilen 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
4 player adapter games... poppe Amiga scene 71 27 July 2023 10:13
Joystick not détect Mac-A500 support.FS-UAE 5 06 December 2021 19:58
How does WinUAE detect joystick inputs on pause? BeamCoder support.WinUAE 2 05 July 2021 18:22
Wanted: Joystick 2 Player Y-Adapter cebulba MarketPlace 2 07 January 2006 20:46
WinUAE doesn't detect joystick button (via ppjoy) oldpx support.WinUAE 16 15 July 2004 22: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 03:51.

Top

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