[go: up one dir, main page]

Menu

#1785 Joysticks on MacOS not working.

v3.x
open
dqh
None
MacOS X
x64sc
6 days ago
2022-11-23
bothan
No

I've got a TheC64 USB joystick works like a charm on Windows.

On my Mac however, I can't get the Vice app (3.6.1) to work properly with the joystick. I can go into Settings > Input Devices > Joystick, and choose 'THE64 Joystick' as either Joystick 1 or 2. After that it will register the Fire buttons, but not the directions when moving the joystick. The little lights at the bottom of the interface indicating joystick usage only show the fire button. Is there some setting I'm missing?

It's also working on https://gamepad-tester.com/ (in brave) on both Mac and windows.

MacOS Ventura 13.0.1

Discussion

  • Andrew Hayes

    Andrew Hayes - 2022-12-24

    I have the same problem on Mac OS (M2) both GTK and SDL versions don't register movement with fire button held down. Also it's nothing to do with the joystick, it's the same when mapping keys to the Keysets.

     
  • (>Gate Keeper<)

    (>Gate Keeper<) - 2022-12-25

    Joysticks + Paddle Buttons are mapped to keyboard keys on the C64. Therefore, in some respects, keyboard mapping and joystick are one in the same. Deficiencies in the keyboard routines can translate to joystick issues.

     
  • Spoek

    Spoek - 2023-01-02

    I can see that in the source the following cases are missing:

                                case kHIDUsage_GD_DPadUp:
                                case kHIDUsage_GD_DPadDown:
                                case kHIDUsage_GD_DPadRight:
                                case kHIDUsage_GD_DPadLeft:
    

    These are needed imo.
    My SPEEDLINK PRO is also not working on the directionals, only the button, in Ventura.

     
  • Spoek

    Spoek - 2023-01-02

    I build the code without this check:

                       /* check for valid axis */
                        if(e->min_pvalue != e->max_pvalue) {
    

    on line 199-200 of joystick_osx.c

    and the joystick now works again.

    Here is a patch:

    Index: arch/gtk3/joystickdrv/joystick_osx.c
    ===================================================================
    --- arch/gtk3/joystickdrv/joystick_osx.c    (revision 42836)
    +++ arch/gtk3/joystickdrv/joystick_osx.c    (working copy)
    @@ -197,7 +197,7 @@
                         case kHIDUsage_GD_Slider:
                         /* axis found */
                         /* check for valid axis */
    -                    if(e->min_pvalue != e->max_pvalue) {
    +                    if(1) { // e->min_pvalue != e->max_pvalue) {
    
                             /* check if axis already occured ?
                                this works around broken HID devices
    
     

    Last edit: Spoek 2023-01-02
  • Michael Lauer

    Michael Lauer - 2023-01-25

    Could you share your build?

     
    • Spoek

      Spoek - 2023-02-06

      I could, but some other parts are not working in this build. Don't know why. But if the maintainers will do the patch I wrote, it should work.

       
  • Kevin Eagan

    Kevin Eagan - 2023-02-03

    I am having the same issues and I am on MacOS Ventura 13.1. Fire buttons work but x and y axes for movement on the joystick in games do not work. I am using a Hyperkin Trooper II. The joystick works on other emulators on this computer for other systems and on gamepad-tester.com.

     
  • (>Gate Keeper<)

    (>Gate Keeper<) - 2023-02-03

    I'm not sure where the refactoring of Joystick code is at the moment. For now, I have a hack that makes all of my wired joysticks work (and a few wireless ones). SDL has options for defining custom joystick configurations while GTK doesn't (or didn't). I see some movement in the joystick code but am not sure if the SDL capabilities have fully migrated to GTK now or not. Also, typically I need to compile my own source to get bleeding edge on Mac since .dmg installers are not released every time there is some code update (nor do I think it should).

    Once the code is ready - it would be worthwhile to see where joystick stands and if all of the axis "show up". The last GTK code I tested masked some axis due to how the joystick handling was done (made a few crude assumptions to optimize for very specific controllers).

     
  • gpz

    gpz - 2023-02-03

    The code is being merged/fixed just right now (so right now it is probably even more broken than before). The idea is to fix those things and port them to GTK soonish, and then make a release for people to test, perhaps in a month or two.

     
  • Dean Fabio

    Dean Fabio - 2023-09-21

    Are there any updates on this? I am having the same problem: fire button works but movements with the joystick do not work.

     

    Last edit: Dean Fabio 2023-09-21
  • bothan

    bothan - 2023-09-21

    for me I just use the windows version. I'm lucky to have both platforms available to me

     
  • compyx

    compyx - 2023-09-21
    • assigned_to: dqh
    • Version: v3.6 --> v3.x
     
  • compyx

    compyx - 2023-09-21

    We're reworked large parts of the joystick code in trunk, but there haven't been any changes to the MacOS-specific code, so the MacOS joystick driver will probably still not report the correct inputs to the generic joystick code.

    I see this ticket isn't assigned to anyone, so I'll assign it to our MacOS maintainer @dqh, though I doubt he has a THEC64 joystick.

     
  • dqh

    dqh - 2023-09-21

    im out of town for another week or so but i'll take a look when i get back. I only have PS and XB controllers to test with, though.

     
    • Dean Fabio

      Dean Fabio - 2023-09-21

      Thanks dqh. I think the PS controller should be good for test. I have used it in the past as an alternative of the THEC64 joystick

       
  • Al Righdee

    Al Righdee - 2025-05-16

    Hi all,

    I've submitted a patch (attached here, too) to the VICE development mailing list to address this issue.

    📧 Sent to: vice-devel@lists.sourceforge.net
    🧵 [PATCH] Add support for TheC64 Joystick on macOS (Fixes Bug #1785)

    This patch adds proper detection for the THEC64 USB joystick (Vendor ID 0x1c59, Product ID 0x0023) on macOS. The issue was that the device was not correctly recognized by the joystick input handler, so only the fire button worked, not directional movement.

    ✅ Changes:
    - Added support for the missing device ID in the macOS joystick driver
    - Ensured axis events are processed for devices like THEC64 joystick
    - Tested with the GTK3 build of VICE (x64sc and xvic)
    - Platform: macOS Sequoia 15.4.1 on M2 chip

    ❌ SDL build not tested

    This patch should resolve the problems described here and by others with similar devices (e.g., Hyperkin Trooper, SPEEDLINK PRO). Feedback welcome!

     

    Last edit: Al Righdee 2025-05-16
  • compyx

    compyx - 2025-05-16
     
  • compyx

    compyx - 2025-05-16

    Thanks for the patch, looks good as far as I can see (I don't have a Mac, nor any experience writing code for MacOS).

    The patch should at least make VICE build successfully on MacOS again, but the joystick code is a moving target currently, so there might be more changes coming to the API.

    The latest changes can currently be found in the compyx/joymap-003 branch, and I try to keep my API docs somewhat up-to-date in the file doc/joystick.md,

    As for merging this, perhaps it's best to wait a bit until I've merged my latest branch, to avoid possible merge conflicts, and perhaps @dqh can have a look?

     
  • Fixer

    Fixer - 6 days ago

    Hey! Sounds like you’ve already done solid testing — since it’s working fine on GamepadTester, the hardware itself seems okay. The issue might be with how VICE maps joystick axes on macOS. Try switching the input driver from “SDL” to “HID” under Settings → Joystick Settings → Device Type. Some users also fix it by resetting their .vice config file or toggling “swap ports.”

    If that doesn’t help, you can double-check your controller signals on https://gampadtester.com/ — it’ll confirm whether the directional inputs are being sent properly before tweaking more VICE settings.

     

Log in to post a comment.