Don't set pixel_format in retro_init
libretro.h says "This function should be called inside retro_load_game() or retro_get_system_av_info().", let's do as it says.
This commit is contained in:
@@ -981,18 +981,11 @@ static void check_system_specs(void)
|
||||
void retro_init(void)
|
||||
{
|
||||
bool achievements = true;
|
||||
enum retro_pixel_format rgb565;
|
||||
log_cb.log=default_logger;
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log_cb);
|
||||
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_SUPPORT_ACHIEVEMENTS, &achievements);
|
||||
|
||||
#ifdef FRONTEND_SUPPORTS_RGB565
|
||||
rgb565 = RETRO_PIXEL_FORMAT_RGB565;
|
||||
if(environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &rgb565))
|
||||
log_cb.log(RETRO_LOG_INFO, "Frontend supports RGB565 - will use that instead of XRGB1555.\n");
|
||||
#endif
|
||||
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_INPUT_BITMASKS, NULL))
|
||||
libretro_supports_bitmasks = true;
|
||||
}
|
||||
@@ -2309,6 +2302,7 @@ bool retro_load_game(const struct retro_game_info *game)
|
||||
char* sav_dir=NULL;
|
||||
size_t fourscore_len = sizeof(fourscore_db_list) / sizeof(fourscore_db_list[0]);
|
||||
size_t famicom_4p_len = sizeof(famicom_4p_db_list) / sizeof(famicom_4p_db_list[0]);
|
||||
enum retro_pixel_format rgb565;
|
||||
|
||||
struct retro_input_descriptor desc[] = {
|
||||
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" },
|
||||
@@ -2367,6 +2361,12 @@ bool retro_load_game(const struct retro_game_info *game)
|
||||
if (!game)
|
||||
return false;
|
||||
|
||||
#ifdef FRONTEND_SUPPORTS_RGB565
|
||||
rgb565 = RETRO_PIXEL_FORMAT_RGB565;
|
||||
if(environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &rgb565))
|
||||
log_cb.log(RETRO_LOG_INFO, "Frontend supports RGB565 - will use that instead of XRGB1555.\n");
|
||||
#endif
|
||||
|
||||
/* initialize some of the default variables */
|
||||
#ifdef GEKKO
|
||||
sndsamplerate = 32000;
|
||||
|
||||
Reference in New Issue
Block a user