<commit_before>/*
 * Gamepad input implementation.
 *
 * This file deals with taking input inputs, and provides an abstract
 * Snepulator_Gamepad interface to be used in the emulated consoles.
 */

#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>

#include "snepulator_types.h"
#include "snepulator.h"
#include "gamepad.h"
#include "config.h"

extern Snepulator_State state;

#define MAX_STRING_SIZE 1024

const char *button_names [] = { "up", "down", "left", "right", "button_1", "button_2", "start" };


/* Stored gamepad configuration */
Gamepad_Config gamepad_config [128];
uint32_t gamepad_config_count = 0;

Gamepad_Config remap_config;
uint32_t gamepad_remap_step = GAMEPAD_BUTTON_COUNT;

/* List of detected gamepads */
Gamepad_Instance gamepad_list [128];
uint32_t gamepad_list_count = 0;

/*
 * Gamepad State
 *
 *   gamepad [0]: Gamepad selected in settings menu.
 *   gamepad [1]: Player 1.
 *   gamepad [2]: Player 2.
 *   remap_config: Uncommitted remap<commit_msg>maint: rename button properties in configuration file<commit_after>/*
 * Gamepad input implementation.
 *
 * This file deals with taking input inputs, and provides an abstract
 * Snepulator_Gamepad interface to be used in the emulated consoles.
 */

#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>

#include "snepulator_types.h"
#include "snepulator.h"
#include "gamepad.h"
#include "config.h"

extern Snepulator_State state;

#define MAX_STRING_SIZE 1024

const char *button_names [] = { "up", "down", "left", "right", "button-1", "button-2", "start" };


/* Stored gamepad configuration */
Gamepad_Config gamepad_config [128];
uint32_t gamepad_config_count = 0;

Gamepad_Config remap_config;
uint32_t gamepad_remap_step = GAMEPAD_BUTTON_COUNT;

/* List of detected gamepads */
Gamepad_Instance gamepad_list [128];
uint32_t gamepad_list_count = 0;

/*
 * Gamepad State
 *
 *   gamepad [0]: Gamepad selected in settings menu.
 *   gamepad [1]: Player 1.
 *   gamepad [2]: Player 2.
 *   remap_config: Uncommitted remap
{'fraction_non_alphanumeric': 0.11688931297709923, 'fraction_numerical': 0.02385496183206107, 'mean_word_length': 4.873949579831932, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5652573', 'n_tokens_mistral': 770, 'n_tokens_neox': 723, 'n_words': 209}