Skip to content

Commit

Permalink
Bleh.
Browse files Browse the repository at this point in the history
  • Loading branch information
XerTheSquirrel committed Dec 23, 2023
1 parent 8c0f968 commit 89d06c7
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 15 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ endif

ifeq ($(DEBUG), 1)
OBJDIR := $(OBJDIR_BASE)/debug
CFLAGS ?= -O0 -g
CXXFLAGS ?= -O0 -g
# TODO: Temporary revert back
CFLAGS=-O0 -g3 -ggdb
CXXFLAGS=-O0 -g3 -ggdb
#CFLAGS ?= -O0 -g
#CXXFLAGS ?= -O0 -g
DEFINES += -DDEBUG -D_DEBUG
else
OBJDIR := $(OBJDIR_BASE)/release
Expand Down
3 changes: 3 additions & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ enum midi_driver_enum
#define DECLARE_BIND(base, bind, desc) { #base, desc, 0, bind, true }
#define DECLARE_META_BIND(level, base, bind, desc) { #base, desc, level, bind, true }

#define DECLARE_EXTRA_BIND(id

const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
DECLARE_BIND(b, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B),
DECLARE_BIND(y, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y),
Expand Down Expand Up @@ -399,6 +401,7 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
* These binds cannot be bound at all and are entirely virtualized.
* These are respectively @c RARCH_BIND_ID_EXTRA_BUTTON_START and
* the end point is @c RARCH_BIND_ID_EXTRA_BUTTON_END... */

#if 0
/* Deprecated */
DECLARE_META_BIND(2, send_debug_info, RARCH_SEND_DEBUG_INFO, MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO),
Expand Down
1 change: 1 addition & 0 deletions input/input_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

#define RARCH_MAX_EXTRA_BUTTON (RETRO_DEVICE_ID_JOYPAD_MASK - RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS)
#define RARCH_EXTRA_BUTTON_ID(id) (RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS + (id))
#define RARCH_EXTRA_TOTAL_BUTTONS (RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS + RARCH_STATIC_MAX_EXTRA_BUTTON)

#define RARCH_EXTRA_BUTTON_ID_END (RARCH_FIRST_META_KEY + RARCH_MAX_EXTRA_BUTTON)

Expand Down
4 changes: 2 additions & 2 deletions input/input_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ const unsigned input_config_bind_order[RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS] = {

/**************************************/
/* TODO/FIXME - turn these into static global variable */
retro_keybind_set input_config_binds[MAX_USERS];
retro_keybind_set input_autoconf_binds[MAX_USERS];
retro_keybind_set input_config_binds[RARCH_EXTRA_TOTAL_BUTTONS];
retro_keybind_set input_autoconf_binds[RARCH_EXTRA_TOTAL_BUTTONS];
uint64_t lifecycle_state = 0;

static void *input_null_init(const char *joypad_driver) { return (void*)-1; }
Expand Down
4 changes: 2 additions & 2 deletions input/input_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -1122,8 +1122,8 @@ extern hid_driver_t wiiusb_hid;
extern hid_driver_t wiiu_hid;
#endif /* HAVE_HID */

extern retro_keybind_set input_config_binds[MAX_USERS];
extern retro_keybind_set input_autoconf_binds[MAX_USERS];
extern retro_keybind_set input_config_binds[RARCH_EXTRA_TOTAL_BUTTONS];
extern retro_keybind_set input_autoconf_binds[RARCH_EXTRA_TOTAL_BUTTONS];

RETRO_END_DECLS

Expand Down
10 changes: 6 additions & 4 deletions input/input_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ struct input_bind_map
/* Turbo support. */
struct turbo_buttons
{
int32_t turbo_pressed[MAX_USERS];
int32_t turbo_pressed[RARCH_EXTRA_TOTAL_BUTTONS];
unsigned count;
uint16_t enable[MAX_USERS];
bool frame_enable[MAX_USERS];
bool mode1_enable[MAX_USERS];
uint16_t enable[RARCH_EXTRA_TOTAL_BUTTONS];
bool frame_enable[RARCH_EXTRA_TOTAL_BUTTONS];
bool mode1_enable[RARCH_EXTRA_TOTAL_BUTTONS];
};

struct retro_keybind
Expand Down Expand Up @@ -122,6 +122,8 @@ typedef struct input_game_focus_state

extern const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL];

void rarch_fill_extra_button_input_config_bind_map(void);

typedef struct rarch_joypad_driver input_device_driver_t;
typedef struct input_keyboard_line input_keyboard_line_t;
typedef struct rarch_joypad_info rarch_joypad_info_t;
Expand Down
14 changes: 9 additions & 5 deletions menu/menu_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -9290,10 +9290,6 @@ static bool setting_append_list_input_player_options(
if (isExtraKey)
{
logicalIndex = RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS + (bindIndex - RARCH_BIND_ID_EXTRA_BUTTON_START);

/* Debug. */
RARCH_LOG("Reassigned bindIndex %d to logicalIndex %d\n",
bindIndex, logicalIndex);
}

/* Debug. */
Expand All @@ -9317,13 +9313,21 @@ static bool setting_append_list_input_player_options(
}
}
else if (!isExtraKey)
{
strlcpy(label + _len,
input_config_bind_map_get_desc(logicalIndex),
sizeof(label) - _len);
}

/* Not a valid controller key. */
/* Not a valid controller bind. */
else
{
/* Debug. */
RARCH_LOG("Invalid controller bind: bind = %d, logical = %d\n",
bindIndex, logicalIndex);

continue;
}

snprintf(name, sizeof(name), "p%u_%s", user + 1, input_config_bind_map_get_base(logicalIndex));

Expand Down

0 comments on commit 89d06c7

Please sign in to comment.