Joystick support changes

Discuss ADFFS development and download test releases
Post Reply
JonAbbott
Posts: 2446
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Joystick support changes

Post by JonAbbott »

Last week, I started looking at adding Joystick support for games that do not natively support Joysticks.

I started working through the games from A-Z, the first two I hit were 2060 BC, which needs buttons for flapping and picking/dropping things and Alerion which needs two fire buttons. So...off the back of those two games I completely rewrote the * command for mapping Joysticks to keys, so it supports up to 8 fire buttons.

I've also modified the direction key mapping, so it also checks the 16bit Joystick interface which USBJoystick maps to thumb wheels if available. So on XB360 controllers you can use the thumb sticks, or D-Pad to move.

Alerion has however thrown up an issue I need to investigate. When Joystick keymapping is enabled, Alerion randomly crashes which appears to be down to ADFFS calling the KeyV vector to trigger the key press. I've tried various workarounds, such as calling KeyV via CallBack, checking for threading etc. None of which worked.

I think what I'm going to do is continue adding Joystick key mapping to games and see just how many are affected - its possible it is simply a re-entry bug in Alerion which needs patching.

Abuse and Blood Lust pose another challenge as they use the mouse for the fire direction, so I need to figure out a solution. I did try using the mouse mapping in USBJoystick, but couldn't get it working - I've not had a chance yet to figure out why that didn't work.

Games with Joystick Key mapping added (2.74k):
  • F10001 2067 BC (1993) (Oregan Developments)
  • F10006 Aggressor (1992) (Atomic Software)
  • F10706 Alien Invasion (1990) (Alien Images) (not currently packaged)
  • F10010 Alerion (1988) (DABS Press)
  • F10015 Alone In the Dark (1995) (Krisalis Software)
  • F10231 Ballarena (1990) (Sisteme)
  • F10036 Ballarena (1994) (Uffenkamp Computer Systeme)
  • F10041 Big Bang (1996) (Psycore)
  • F10046 Blitz! (1991) (Arxe Systems)
  • F10048 Blood Sport (1993) (Matt Black)
  • F10047 BloodLust (1998) (The Fourth Dimension)
  • F10052 Bobby Blockhead vs The Dark Planet (1991) (Atomic Software)
  • F10053 Boogie Buggy (1991) (The Fourth Dimension)
  • F10058 Bubble Impact [demo version] (1997) (Moving Pixels)
  • F10059 Bug Hunter & Moondash (1990) (Minerva)
  • F10060 Bug Hunter in Space (1990) (Minerva)
  • F10067 Carnage Inc. (1993) (The Fourth Dimension)
  • F10355 Cascade (1992) (Milo Shaffer and Richard Norman)
  • F10071 Cataclysm (1991) (The Fourth Dimension)
  • F10482 Cataclysm [SA version] (1998) (The Fourth Dimension)
  • F10289 Provocator (1991) (Computer Tutorial Services)

richw
Posts: 152
Joined: Sat Sep 14, 2013 9:05 pm

Re: Joystick support changes

Post by richw »

I think I had some issues getting the mouse emulation to work, so that will be my bad. I think it is unfinished.

I really must get the Pi out, as it has been hibernating for some time!

JonAbbott
Posts: 2446
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Joystick support changes

Post by JonAbbott »

richw wrote:
Thu Nov 19, 2020 12:38 am
I think I had some issues getting the mouse emulation to work, so that will be my bad. I think it is unfinished.
Thanks for confirming what I suspected.

The version of USB Joystick publicly available here and the version bundled with ADFFS are a few versions out of step...ADFFS being several versions ahead, which might explain it.

JonAbbott
Posts: 2446
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Joystick support changes

Post by JonAbbott »

I've put an ADFFS beta package up, with support for the games in the OP.

Although the Alerion package has also been updated, it's currently crashing due to the Joystick checks; please ignore testing it until I come up with a fix.

JonAbbott
Posts: 2446
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Joystick support changes

Post by JonAbbott »

JonAbbott wrote:
Thu Dec 24, 2020 4:46 pm
Although the Alerion package has also been updated, it's currently crashing due to the Joystick checks; please ignore testing it until I come up with a fix.
This is now resolved. It was a combination of bugs in the game itself, not only did it alter R13 in its IRQ handler, without disabling IRQ's, but also didn't handle IRQ re-entrancy.

ADFFS 2.74h beta is now up, along with the updated packages for the games above to add Joystick support.

JonAbbott
Posts: 2446
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Joystick support changes

Post by JonAbbott »

ADFFS 2.74k beta has been uploaded for testing. Many Joystick changes such as adding DeadZone and Mouse support, damping is still work-in-progress.

It now also writes any changes back to floppy images if they are either ADF or JFD with the Auto flush flag set. JFD's can time some time to save and as I've yet to add an hourglass, it can appear to lock the machine whilst its saving - this is particularity noticeable if it needs to write the image file at shutdown.

Vanfanel
Posts: 527
Joined: Mon Sep 16, 2013 12:01 am

Re: Joystick support changes

Post by Vanfanel »

@Jon This is truly fantastic to see new betas with improved joystick support!!
IS there anything special to test on games? Previously I had 1 button support working with latest stable ADFFS (2 buttons support so we can avoid the "up-to-jump" syndrome would be great!).

JonAbbott
Posts: 2446
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Joystick support changes

Post by JonAbbott »

It supports 8 Joystick buttons, the D-pad, the first thumb-stick and eight directions. Which game is up/jump mapped to the same button? I am aware that there’s a need to split the D-Pad and Thumb-stick, or support two Thumb-sticks in some games. Bloodlust for example.

There’s nothing specific to test, only to confirm games with Joystick support added still work correctly and don’t crash.

I’m hoping to have another beta up soon with Mouse support in a more polished state and some games updated to use it.

Post Reply