Unverified Commit 553ff478 authored by Tony's avatar Tony Committed by GitHub
Browse files

Merge pull request #459 from sonninnos/master

Maintenance
parents d47c0ea8 75f579b9
Pipeline #58777 passed with stages
in 38 minutes and 5 seconds
......@@ -2362,56 +2362,65 @@ error:
}
}
void retro_set_environment(retro_environment_t cb)
static const struct retro_controller_description joyport_controllers[] =
{
environ_cb = cb;
retro_set_core_options();
{ "CD32 Pad", RETRO_DEVICE_PUAE_CD32PAD },
{ "Analog Joystick", RETRO_DEVICE_PUAE_ANALOG },
{ "Joystick", RETRO_DEVICE_PUAE_JOYSTICK },
{ "Keyboard", RETRO_DEVICE_PUAE_KEYBOARD },
{ "None", RETRO_DEVICE_NONE },
{ NULL, 0 }
};
static const struct retro_controller_description p1_controllers[] = {
{ "CD32 Pad", RETRO_DEVICE_PUAE_CD32PAD },
{ "Analog Joystick", RETRO_DEVICE_PUAE_ANALOG },
{ "Joystick", RETRO_DEVICE_PUAE_JOYSTICK },
{ "Keyboard", RETRO_DEVICE_PUAE_KEYBOARD },
{ "None", RETRO_DEVICE_NONE },
};
static const struct retro_controller_description p2_controllers[] = {
{ "CD32 Pad", RETRO_DEVICE_PUAE_CD32PAD },
{ "Analog Joystick", RETRO_DEVICE_PUAE_ANALOG },
{ "Joystick", RETRO_DEVICE_PUAE_JOYSTICK },
{ "Keyboard", RETRO_DEVICE_PUAE_KEYBOARD },
{ "None", RETRO_DEVICE_NONE },
};
static const struct retro_controller_description p3_controllers[] = {
{ "Joystick", RETRO_DEVICE_PUAE_JOYSTICK },
{ "Keyboard", RETRO_DEVICE_PUAE_KEYBOARD },
{ "None", RETRO_DEVICE_NONE },
};
static const struct retro_controller_description p4_controllers[] = {
{ "Joystick", RETRO_DEVICE_PUAE_JOYSTICK },
{ "Keyboard", RETRO_DEVICE_PUAE_KEYBOARD },
{ "None", RETRO_DEVICE_NONE },
};
static const struct retro_controller_description p5_controllers[] = {
{ "Keyboard", RETRO_DEVICE_PUAE_KEYBOARD },
{ "None", RETRO_DEVICE_NONE },
};
static const struct retro_controller_description parport_controllers[] =
{
{ "Joystick", RETRO_DEVICE_PUAE_JOYSTICK },
{ "Keyboard", RETRO_DEVICE_PUAE_KEYBOARD },
{ "None", RETRO_DEVICE_NONE },
{ NULL, 0 }
};
static const struct retro_controller_description nonport_controllers[] =
{
{ "Keyboard", RETRO_DEVICE_PUAE_KEYBOARD },
{ "None", RETRO_DEVICE_NONE },
{ NULL, 0 }
};
static void retro_set_inputs(void)
{
unsigned i;
static const struct retro_controller_info ports[] = {
{ p1_controllers, 5 }, /* port 1 */
{ p2_controllers, 5 }, /* port 2 */
{ p3_controllers, 3 }, /* port 3 */
{ p4_controllers, 3 }, /* port 4 */
{ p5_controllers, 2 }, /* port 5 */
const struct retro_controller_info ports[] =
{
{ joyport_controllers, 6 },
{ joyport_controllers, 6 },
{ parport_controllers, 4 },
{ parport_controllers, 4 },
{ nonport_controllers, 3 },
{ nonport_controllers, 3 },
{ NULL, 0 }
};
cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports);
environ_cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports);
/* Reset analog device types to RetroPad */
for (i = 0; i < RETRO_DEVICES; i++)
if (retro_devices[i] == RETRO_DEVICE_ANALOG)
retro_devices[i] = RETRO_DEVICE_JOYPAD;
}
void retro_set_environment(retro_environment_t cb)
{
environ_cb = cb;
retro_set_core_options();
retro_set_inputs();
bool support_no_game = true;
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &support_no_game);
environ_cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &support_no_game);
static struct retro_led_interface led_interface;
cb(RETRO_ENVIRONMENT_GET_LED_INTERFACE, &led_interface);
environ_cb(RETRO_ENVIRONMENT_GET_LED_INTERFACE, &led_interface);
if (led_interface.set_led_state)
led_state_cb = led_interface.set_led_state;
}
......
......@@ -256,6 +256,5 @@ char* strright(const char* str, int len);
bool strstartswith(const char* str, const char* start);
bool strendswith(const char* str, const char* end);
void path_join(char* out, const char* basedir, const char* filename);
char* path_join_dup(const char* basedir, const char* filename);
#endif /* LIBRETRO_GLUE_H */
......@@ -80,6 +80,18 @@ unsigned int turbo_pulse = 6;
unsigned int turbo_state[RETRO_DEVICES] = {0};
unsigned int turbo_toggle[RETRO_DEVICES] = {0};
static void statusbar_text_show(const char *format, ...)
{
unsigned char statusbar_temp[RETRO_PATH_MAX] = {0};
va_list args;
va_start(args, format);
vsnprintf(statusbar_temp, sizeof(statusbar_temp), format, args);
snprintf(statusbar_text, sizeof(statusbar_text), "%c %-98s", (' ' | 0x80), statusbar_temp);
va_end(args);
imagename_timer = 50;
}
void emu_function(int function)
{
switch (function)
......@@ -100,9 +112,7 @@ void emu_function(int function)
case EMU_RESET:
retro_reset_soft();
/* Statusbar notification */
snprintf(statusbar_text, sizeof(statusbar_text), "%c Reset",
(' ' | 0x80));
imagename_timer = 50;
statusbar_text_show("%s", "Reset");
break;
case EMU_ASPECT_RATIO:
if (video_config_aspect == 0)
......@@ -115,9 +125,9 @@ void emu_function(int function)
/* Lock aspect ratio */
opt_aspect_ratio_locked = true;
/* Statusbar notification */
snprintf(statusbar_text, sizeof(statusbar_text), "%c Pixel Aspect %-40s",
(' ' | 0x80), (video_config_aspect == PUAE_VIDEO_PAL) ? "PAL" : "NTSC");
imagename_timer = 50;
statusbar_text_show("%s %s",
"Pixel Aspect",
(video_config_aspect == PUAE_VIDEO_PAL) ? "PAL" : "NTSC");
break;
case EMU_ZOOM_MODE:
if (zoom_mode_id == 0 && opt_zoom_mode_id == 0)
......@@ -128,18 +138,18 @@ void emu_function(int function)
zoom_mode_id = opt_zoom_mode_id;
request_update_av_info = true;
/* Statusbar notification */
snprintf(statusbar_text, sizeof(statusbar_text), "%c Zoom Mode %-43s",
(' ' | 0x80), (zoom_mode_id) ? "ON" : "OFF");
imagename_timer = 50;
statusbar_text_show("%s %s",
"Zoom Mode",
(zoom_mode_id) ? "ON" : "OFF");
break;
case EMU_TURBO_FIRE:
retro_turbo_fire = !retro_turbo_fire;
/* Lock turbo fire */
turbo_fire_locked = true;
/* Statusbar notification */
snprintf(statusbar_text, sizeof(statusbar_text), "%c Turbo Fire %-42s",
(' ' | 0x80), (retro_turbo_fire) ? "ON" : "OFF");
imagename_timer = 50;
statusbar_text_show("%s %s",
"Turbo Fire",
(retro_turbo_fire) ? "ON" : "OFF");
break;
case EMU_SAVE_DISK:
dc_save_disk_toggle(dc, false, true);
......
#ifndef LIBRETRO_MAPPER_H
#define LIBRETRO_MAPPER_H
#define RETRO_DEVICES 5
#define RETRO_DEVICES 6
#define RETRO_DEVICE_PUAE_JOYSTICK RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_ANALOG, 0)
#define RETRO_DEVICE_PUAE_CD32PAD RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_ANALOG, 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment