libretro-common icon indicating copy to clipboard operation
libretro-common copied to clipboard

RETRO_ENVIRONMENT_GET_INPUT_BITMASKS documentation unclear

Open celerizer opened this issue 1 year ago • 1 comments

#define RETRO_ENVIRONMENT_GET_INPUT_BITMASKS (51 | RETRO_ENVIRONMENT_EXPERIMENTAL)
                                            /* bool * --
                                            * Boolean value that indicates whether or not the frontend supports
                                            * input bitmasks being returned by retro_input_state_t. The advantage
                                            * of this is that retro_input_state_t has to be only called once to
                                            * grab all button states instead of multiple times.
                                            *
                                            * If it returns true, you can pass RETRO_DEVICE_ID_JOYPAD_MASK as 'id'
                                            * to retro_input_state_t (make sure 'device' is set to RETRO_DEVICE_JOYPAD).
                                            * It will return a bitmask of all the digital buttons.
                                            */

The documentation implies this is a pointer to a bool which should be set to the correct value, but many cores pass NULL instead. Either the data type for this environment callback should be listed as N/A (null) or there should be a note mentioning a core can pass NULL here like RETRO_ENVIRONMENT_GET_DEVICE_POWER:

* The return value indicates whether the frontend can provide this information,
                                            * even if the parameter is NULL.

celerizer avatar Dec 27 '23 19:12 celerizer

This has been updated quite a bit in https://github.com/libretro/RetroArch/blob/41db4b022a684292b9f4606775ed6ec1a3004127/libretro-common/include/libretro.h#L1815 . Mind reviewing there? Thanks.

RobLoach avatar May 17 '24 16:05 RobLoach

Appears to have been fixed in 5cb6e217833af863a6efc684fd859da9f46a65f8; now states the passed parameter is ignored

celerizer avatar Sep 17 '24 04:09 celerizer