diff options
author | 2023-01-14 03:07:57 +1100 | |
---|---|---|
committer | 2023-01-14 03:13:59 +1100 | |
commit | bf2707f4c76abaeaeda2d9c4444a608d7d0afed5 (patch) | |
tree | 992e3090717dd4c36922b80615d8680588183384 /src/osd/modules/lib/osdobj_common.h | |
parent | e817a3d0c8e7697b55ce75c8e0939328022f5ecc (diff) |
osd: Added support for mapping files to sdlgame joystick provider and made it default with SDL.
This changes behaviour, however I think it's a net positive:
* Most games using Steam Input or SDL2 to read game controllers have
this behaviour, so users have come to expect it.
* This module is better at giving meaningful names to buttons on
common controller, and assigning axes consistently.
* Button/axis mapping files using a widely-used format are supported.
* The old behaviour is still available with `-joystickprovider sdljoy`
if anyone wants it.
The new option for controller mapping files is in the general OSD
options rather than SDL options as it can be extended to DirectInput in
the future.
Diffstat (limited to 'src/osd/modules/lib/osdobj_common.h')
-rw-r--r-- | src/osd/modules/lib/osdobj_common.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h index 55ed36e5060..92a9a498c3c 100644 --- a/src/osd/modules/lib/osdobj_common.h +++ b/src/osd/modules/lib/osdobj_common.h @@ -2,30 +2,40 @@ // copyright-holders:Aaron Giles /*************************************************************************** - osdepend.h + osdobj_common.h OS-dependent code interface. *******************************************************************c********/ - -#pragma once - #ifndef MAME_OSD_LIB_OSDOBJ_COMMON_H #define MAME_OSD_LIB_OSDOBJ_COMMON_H +#pragma once + #include "osdcore.h" #include "osdepend.h" + #include "modules/osdmodule.h" #include "modules/output/output_module.h" + #include "emuopts.h" + #include "strformat.h" + +#include <iosfwd> #include <list> +#include <string> +#include <memory> +#include <unordered_map> +#include <vector> + //============================================================ // Defines //============================================================ #define OSDOPTION_UIMODEKEY "uimodekey" +#define OSDOPTION_CONTROLLER_MAP_FILE "controller_map" #define OSDCOMMAND_LIST_MIDI_DEVICES "listmidi" #define OSDCOMMAND_LIST_NETWORK_ADAPTERS "listnetwork" @@ -98,6 +108,7 @@ public: // keyboard mapping const char *ui_mode_key() const { return value(OSDOPTION_UIMODEKEY); } + const char *controller_mapping_file() const { return value(OSDOPTION_CONTROLLER_MAP_FILE); } // debugging options const char *debugger() const { return value(OSDOPTION_DEBUGGER); } |