It is not clear to me how the Input API works.

This is copied (without understanding) from other examples.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2020-12-12 13:24:06 +00:00
parent cec0c10286
commit 120cb8be50
3 changed files with 11 additions and 2 deletions

View file

@ -24,3 +24,5 @@ retro_audio_sample_t audio_cb;
retro_audio_sample_batch_t audio_batch_cb;
std::string retro_base_directory;
unsigned int retro_devices[RETRO_DEVICES] = {};

View file

@ -13,3 +13,7 @@ extern retro_audio_sample_t audio_cb;
extern retro_audio_sample_batch_t audio_batch_cb;
extern std::string retro_base_directory;
#define RETRO_DEVICES 5
extern unsigned int retro_devices[RETRO_DEVICES];

View file

@ -40,6 +40,9 @@ void retro_set_controller_port_device(unsigned port, unsigned device)
{
log_cb(RETRO_LOG_INFO, "RA2: %s\n", __FUNCTION__);
log_cb(RETRO_LOG_INFO, "Plugging device %u into port %u.\n", device, port);
if (port < RETRO_DEVICES)
retro_devices[port] = device;
}
void retro_get_system_info(retro_system_info *info)
@ -78,7 +81,7 @@ void retro_set_environment(retro_environment_t cb)
log_cb = logging.log;
else
log_cb = fallback_log;
/*
static const retro_controller_description controllers[] =
{
{ "Apple Keyboard", RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_KEYBOARD, 0) },
@ -90,7 +93,7 @@ void retro_set_environment(retro_environment_t cb)
{ NULL, 0 },
};
cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports);
cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports);*/
}
void retro_set_audio_sample(retro_audio_sample_t cb)