dMZX Forums: Improved joypad support -> MegaZeux Feature Requests -> Tracker

Jump to content

Report ID 647 Title Improved joypad support
Product MegaZeux Feature Requests Status Duplicate Entry (Severity 2 - Fair)
Version 2.92 Fixed in -

Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

Report ID #647: Improved joypad support

#1 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 28 June 2017 - 04:11 AM

This one's pretty straightforward, and comes in three parts. The first two could be implemented at any time, but the third needs a minor version increase.

  • Automatic joypad detection; UI for joypad reassignment and key mapping. This has subparts:

    • Currently MZX ignores the SDL_JoyDeviceEvent, meaning the only joypads that work in MZX are those plugged in when MZX starts. This event should be properly implemented so joypads can be plugged and unplugged at runtime.
    • Joypad config UI: a submenu of F2. Allows the user to reassign joypads to different joypad numbers, see which joypads are currently plugged in, and manually edit joypad key mappings.


  • Improved config options. Currently, pad.config and game.cnf joypad mappings are indistinguishable, and a game.cnf mapping could easily make certain OS functions hard or impossible. pad.config may need the ability to define key mappings such that they can not be overridden or disabled.

  • Direct reading of the joypad input in Robotic. Since the J function counter namespace is currently nonexistent, this is easy to add without significantly impacting performance:

    /*
    
    New counters:
    
    joy!active  (read-only)  Return 1 if the joypad is available, otherwise 0.
    joy!.*      (read-only)  Action reading. The first parameter is the joypad number (1-16) and the second is an action name or an axis name.
                             Returns [0,1] for an action, [-32768,32767] for an axis, or -1 if the control doesn't exist.
    joymap      (write-only) When set to 0, disables the default MZX joypad key mapping behavior (FIXME should this even be implemented?).
    
    */


edit: updated to reflect actual counters implemented in this pull request.

This post has been edited by Lachesis: 08 July 2019 - 05:26 PM

"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository


Page 1 of 1  
  • Cannot start a new Issue
  • You cannot reply to this issue

Replies (1 - 5)

#2 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 06 September 2017 - 09:05 PM

Updating version to: 2.92
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#3 User is offline  
asiekierka 

  • ??
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,268
  • Joined: 06-April 06
  • Gender:Male
  • Location:Poland

Posted 16 September 2018 - 10:56 AM

Suggestion for #2: add a modifier joypad button which, when held, forces use of the "global, system, pad.config" mappings over "game-specific, game.cnf" mappings.
Huh.

#4 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 16 September 2018 - 12:43 PM

The plan for that is actually:

  • A button mapped to the exit event and a button mapped to the onscreen keyboard that can't be overriden, defined in pad.config or in code;
  • Generic identifiers that joypad buttons can be mapped to in pad.config that provide global behavior (examples might be "up", "a", "start");
  • New context function (see: core-context branch) that can interpret these generic controls in a context-sensitive manner. Example: for the play_game variant of the game_context, a function is provided that maps "a" to Space, "start" to Return, etc. If there's a key_pressed mapping instead of a generic mapping it would be handled as a fake key press (as it currently is) and this function would be skipped.


The exit event mapping would be sufficient for the user to return to the title screen or access the settings menu to provide custom gameplay key mappings, and global (generic or otherwise) mappings would activate as soon as a robot text box, scroll, prompt, etc is opened.

edit: Regarding games defining their own key values for joypad input, assigning generic identifiers to joypad buttons would be limited to config.txt-time probably. They don't really make sense as game-specific features.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#5 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 01 October 2018 - 08:18 PM

There's a slight problem with the previous post in that axis/button/hat → keycode mapping occurs when events are processed and we'd want to disable those outside of the gameplay context except when allowed by the current game. There's also the problem of probably needing to fall back to the keycode mappings or a generic UI keycode mapping for contexts that have not yet been moved to the core/context system. I need to think about this aspect some more.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#6 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 03 December 2018 - 05:59 AM

Updating status to: Duplicate Entry

Closing this issue because I've split it into several separate issues. All of these issues link back to this issue for reference:

SDL_JoyDeviceEvent is ignored FIXED
Add generic context-sensitive joypad actions IMPLEMENTED
Use SDL_GameController to automatically map joypads IMPLEMENTED
Add direct joypad access counters IMPLEMENTED
Distribute game-specific default joypad configurations with MegaZeux
[Config menu] Allow mapping an SDL joypad to a different MZX joypad number
[Config menu] Remap joypad buttons to different generic or key values
Allow use of key names for joystick bindings instead of raw keycodes IMPLEMENTED

This post has been edited by Lachesis: 19 July 2019 - 05:46 PM

"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository


Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

1 User(s) are reading this issue
1 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2024  IPS, Inc.