mirror of
https://github.com/libretro/beetle-pce-fast-libretro.git
synced 2024-11-26 17:40:40 +00:00
Auto hookup gamepad ports on startup
This commit is contained in:
parent
5ee9c30c32
commit
310b9b5aa2
22
libretro.cpp
22
libretro.cpp
@ -28,10 +28,6 @@ static MDFN_Surface *surf;
|
||||
|
||||
static bool failed_init;
|
||||
|
||||
static void hookup_ports(bool force);
|
||||
|
||||
static bool initial_ports_hookup = false;
|
||||
|
||||
std::string retro_base_directory;
|
||||
std::string retro_base_name;
|
||||
std::string retro_save_directory;
|
||||
@ -249,20 +245,6 @@ static void check_variables(void)
|
||||
#define MAX_BUTTONS 13
|
||||
static uint8_t input_buf[MAX_PLAYERS][2] = {0};
|
||||
|
||||
static void hookup_ports(bool force)
|
||||
{
|
||||
MDFNGI *currgame = game;
|
||||
|
||||
if (initial_ports_hookup && !force)
|
||||
return;
|
||||
|
||||
// Possible endian bug ...
|
||||
for (unsigned i = 0; i < MAX_PLAYERS; i++)
|
||||
currgame->SetInput(i, "gamepad", &input_buf[i][0]);
|
||||
|
||||
initial_ports_hookup = true;
|
||||
}
|
||||
|
||||
bool retro_load_game(const struct retro_game_info *info)
|
||||
{
|
||||
if (failed_init)
|
||||
@ -294,6 +276,10 @@ bool retro_load_game(const struct retro_game_info *info)
|
||||
|
||||
check_variables();
|
||||
|
||||
// Possible endian bug ...
|
||||
for (unsigned i = 0; i < MAX_PLAYERS; i++)
|
||||
game->SetInput(i, "gamepad", &input_buf[i][0]);
|
||||
|
||||
return game;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user