Skip to content

Commit 89d06c7

Browse files
Bleh.
1 parent 8c0f968 commit 89d06c7

File tree

7 files changed

+28
-15
lines changed

7 files changed

+28
-15
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ endif
3838

3939
ifeq ($(DEBUG), 1)
4040
OBJDIR := $(OBJDIR_BASE)/debug
41-
CFLAGS ?= -O0 -g
42-
CXXFLAGS ?= -O0 -g
41+
# TODO: Temporary revert back
42+
CFLAGS=-O0 -g3 -ggdb
43+
CXXFLAGS=-O0 -g3 -ggdb
44+
#CFLAGS ?= -O0 -g
45+
#CXXFLAGS ?= -O0 -g
4346
DEFINES += -DDEBUG -D_DEBUG
4447
else
4548
OBJDIR := $(OBJDIR_BASE)/release

configuration.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ enum midi_driver_enum
282282
#define DECLARE_BIND(base, bind, desc) { #base, desc, 0, bind, true }
283283
#define DECLARE_META_BIND(level, base, bind, desc) { #base, desc, level, bind, true }
284284

285+
#define DECLARE_EXTRA_BIND(id
286+
285287
const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
286288
DECLARE_BIND(b, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B),
287289
DECLARE_BIND(y, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y),
@@ -399,6 +401,7 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
399401
* These binds cannot be bound at all and are entirely virtualized.
400402
* These are respectively @c RARCH_BIND_ID_EXTRA_BUTTON_START and
401403
* the end point is @c RARCH_BIND_ID_EXTRA_BUTTON_END... */
404+
402405
#if 0
403406
/* Deprecated */
404407
DECLARE_META_BIND(2, send_debug_info, RARCH_SEND_DEBUG_INFO, MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO),

input/input_defines.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
#define RARCH_MAX_EXTRA_BUTTON (RETRO_DEVICE_ID_JOYPAD_MASK - RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS)
4141
#define RARCH_EXTRA_BUTTON_ID(id) (RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS + (id))
42+
#define RARCH_EXTRA_TOTAL_BUTTONS (RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS + RARCH_STATIC_MAX_EXTRA_BUTTON)
4243

4344
#define RARCH_EXTRA_BUTTON_ID_END (RARCH_FIRST_META_KEY + RARCH_MAX_EXTRA_BUTTON)
4445

input/input_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ const unsigned input_config_bind_order[RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS] = {
121121

122122
/**************************************/
123123
/* TODO/FIXME - turn these into static global variable */
124-
retro_keybind_set input_config_binds[MAX_USERS];
125-
retro_keybind_set input_autoconf_binds[MAX_USERS];
124+
retro_keybind_set input_config_binds[RARCH_EXTRA_TOTAL_BUTTONS];
125+
retro_keybind_set input_autoconf_binds[RARCH_EXTRA_TOTAL_BUTTONS];
126126
uint64_t lifecycle_state = 0;
127127

128128
static void *input_null_init(const char *joypad_driver) { return (void*)-1; }

input/input_driver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,8 +1122,8 @@ extern hid_driver_t wiiusb_hid;
11221122
extern hid_driver_t wiiu_hid;
11231123
#endif /* HAVE_HID */
11241124

1125-
extern retro_keybind_set input_config_binds[MAX_USERS];
1126-
extern retro_keybind_set input_autoconf_binds[MAX_USERS];
1125+
extern retro_keybind_set input_config_binds[RARCH_EXTRA_TOTAL_BUTTONS];
1126+
extern retro_keybind_set input_autoconf_binds[RARCH_EXTRA_TOTAL_BUTTONS];
11271127

11281128
RETRO_END_DECLS
11291129

input/input_types.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ struct input_bind_map
5555
/* Turbo support. */
5656
struct turbo_buttons
5757
{
58-
int32_t turbo_pressed[MAX_USERS];
58+
int32_t turbo_pressed[RARCH_EXTRA_TOTAL_BUTTONS];
5959
unsigned count;
60-
uint16_t enable[MAX_USERS];
61-
bool frame_enable[MAX_USERS];
62-
bool mode1_enable[MAX_USERS];
60+
uint16_t enable[RARCH_EXTRA_TOTAL_BUTTONS];
61+
bool frame_enable[RARCH_EXTRA_TOTAL_BUTTONS];
62+
bool mode1_enable[RARCH_EXTRA_TOTAL_BUTTONS];
6363
};
6464

6565
struct retro_keybind
@@ -122,6 +122,8 @@ typedef struct input_game_focus_state
122122

123123
extern const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL];
124124

125+
void rarch_fill_extra_button_input_config_bind_map(void);
126+
125127
typedef struct rarch_joypad_driver input_device_driver_t;
126128
typedef struct input_keyboard_line input_keyboard_line_t;
127129
typedef struct rarch_joypad_info rarch_joypad_info_t;

menu/menu_setting.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9290,10 +9290,6 @@ static bool setting_append_list_input_player_options(
92909290
if (isExtraKey)
92919291
{
92929292
logicalIndex = RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS + (bindIndex - RARCH_BIND_ID_EXTRA_BUTTON_START);
9293-
9294-
/* Debug. */
9295-
RARCH_LOG("Reassigned bindIndex %d to logicalIndex %d\n",
9296-
bindIndex, logicalIndex);
92979293
}
92989294

92999295
/* Debug. */
@@ -9317,13 +9313,21 @@ static bool setting_append_list_input_player_options(
93179313
}
93189314
}
93199315
else if (!isExtraKey)
9316+
{
93209317
strlcpy(label + _len,
93219318
input_config_bind_map_get_desc(logicalIndex),
93229319
sizeof(label) - _len);
9320+
}
93239321

9324-
/* Not a valid controller key. */
9322+
/* Not a valid controller bind. */
93259323
else
9324+
{
9325+
/* Debug. */
9326+
RARCH_LOG("Invalid controller bind: bind = %d, logical = %d\n",
9327+
bindIndex, logicalIndex);
9328+
93269329
continue;
9330+
}
93279331

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

0 commit comments

Comments
 (0)