mirror of https://github.com/snes9xgit/snes9x.git
cleanups
This commit is contained in:
parent
4e04cbfe90
commit
f6ea61b41f
|
@ -732,26 +732,6 @@ static bool8 is_SufamiTurbo_Cart (const uint8 *data, uint32 size)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void retro_load_init_reset()
|
|
||||||
{
|
|
||||||
struct retro_memory_map map={ memorydesc+MAX_MAPS-memorydesc_c, memorydesc_c };
|
|
||||||
if (rom_loaded) environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &map);
|
|
||||||
|
|
||||||
int pixel_format = RGB555;
|
|
||||||
if(environ_cb) {
|
|
||||||
pixel_format = RGB565;
|
|
||||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
|
|
||||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
|
||||||
pixel_format = RGB555;
|
|
||||||
}
|
|
||||||
S9xGraphicsDeinit();
|
|
||||||
S9xSetRenderPixelFormat(pixel_format);
|
|
||||||
S9xGraphicsInit();
|
|
||||||
|
|
||||||
update_geometry();
|
|
||||||
audio_interp_max = 32768;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool retro_load_game(const struct retro_game_info *game)
|
bool retro_load_game(const struct retro_game_info *game)
|
||||||
{
|
{
|
||||||
init_descriptors();
|
init_descriptors();
|
||||||
|
@ -788,7 +768,8 @@ bool retro_load_game(const struct retro_game_info *game)
|
||||||
}
|
}
|
||||||
|
|
||||||
int pixel_format = RGB555;
|
int pixel_format = RGB555;
|
||||||
if(environ_cb) {
|
if(environ_cb)
|
||||||
|
{
|
||||||
pixel_format = RGB565;
|
pixel_format = RGB565;
|
||||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
|
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
|
||||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
||||||
|
@ -798,20 +779,19 @@ bool retro_load_game(const struct retro_game_info *game)
|
||||||
S9xSetRenderPixelFormat(pixel_format);
|
S9xSetRenderPixelFormat(pixel_format);
|
||||||
S9xGraphicsInit();
|
S9xGraphicsInit();
|
||||||
|
|
||||||
|
struct retro_memory_map map={ memorydesc+MAX_MAPS-memorydesc_c, memorydesc_c };
|
||||||
|
if (rom_loaded)
|
||||||
|
{
|
||||||
|
environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &map);
|
||||||
|
update_geometry();
|
||||||
|
}
|
||||||
|
|
||||||
if (!rom_loaded && log_cb)
|
if (!rom_loaded && log_cb)
|
||||||
log_cb(RETRO_LOG_ERROR, "[libretro]: Rom loading failed...\n");
|
log_cb(RETRO_LOG_ERROR, "[libretro]: Rom loading failed...\n");
|
||||||
|
|
||||||
struct retro_memory_map map={ memorydesc+MAX_MAPS-memorydesc_c, memorydesc_c };
|
|
||||||
if (rom_loaded) environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &map);
|
|
||||||
|
|
||||||
update_geometry();
|
|
||||||
|
|
||||||
return rom_loaded;
|
return rom_loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
void retro_unload_game(void)
|
|
||||||
{}
|
|
||||||
|
|
||||||
bool retro_load_game_special(unsigned game_type, const struct retro_game_info *info, size_t num_info)
|
bool retro_load_game_special(unsigned game_type, const struct retro_game_info *info, size_t num_info)
|
||||||
{
|
{
|
||||||
uint8_t *romptr[3];
|
uint8_t *romptr[3];
|
||||||
|
@ -897,11 +877,32 @@ bool retro_load_game_special(unsigned game_type, const struct retro_game_info *i
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rom_loaded) retro_load_init_reset();
|
if (rom_loaded)
|
||||||
|
{
|
||||||
|
int pixel_format = RGB555;
|
||||||
|
if(environ_cb)
|
||||||
|
{
|
||||||
|
pixel_format = RGB565;
|
||||||
|
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
|
||||||
|
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
||||||
|
pixel_format = RGB555;
|
||||||
|
}
|
||||||
|
S9xGraphicsDeinit();
|
||||||
|
S9xSetRenderPixelFormat(pixel_format);
|
||||||
|
S9xGraphicsInit();
|
||||||
|
|
||||||
|
struct retro_memory_map map={ memorydesc+MAX_MAPS-memorydesc_c, memorydesc_c };
|
||||||
|
environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &map);
|
||||||
|
update_geometry();
|
||||||
|
audio_interp_max = 32768;
|
||||||
|
}
|
||||||
|
|
||||||
return rom_loaded;
|
return rom_loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void retro_unload_game(void)
|
||||||
|
{}
|
||||||
|
|
||||||
static void map_buttons();
|
static void map_buttons();
|
||||||
|
|
||||||
static void check_system_specs(void)
|
static void check_system_specs(void)
|
||||||
|
|
Loading…
Reference in New Issue