mirror of
https://github.com/libretro/bsnes-libretro.git
synced 2024-11-26 18:40:47 +00:00
Merge pull request #53 from ds22x/master
Simplify SGB path code & remove flashing bottom line when playing SGB games
This commit is contained in:
commit
ba7a60f6af
@ -693,12 +693,12 @@ RETRO_API bool retro_load_game(const retro_game_info *game)
|
||||
|
||||
flush_variables();
|
||||
|
||||
if (string(game->path).endsWith(".gb"))
|
||||
if (string(game->path).endsWith(".gb") || string(game->path).endsWith(".gbc"))
|
||||
{
|
||||
const char *system_dir;
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &system_dir);
|
||||
string sgb_full_path = string(game->path).transform("\\", "/");
|
||||
string sgb_full_path2 = string(sgb_full_path).replace(".gb", ".sfc");
|
||||
string sgb_full_path2 = string(sgb_full_path).replace(".gbc", ".sfc").replace(".gb", ".sfc");
|
||||
if (!file::exists(sgb_full_path2)) {
|
||||
string sgb_full_path = string(system_dir, "/", sgb_bios).transform("\\", "/");
|
||||
program->superFamicom.location = sgb_full_path;
|
||||
@ -711,25 +711,6 @@ RETRO_API bool retro_load_game(const retro_game_info *game)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (string(game->path).endsWith(".gbc"))
|
||||
{
|
||||
const char *system_dir;
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &system_dir);
|
||||
string sgb_full_path = string(game->path).transform("\\", "/");
|
||||
string sgb_full_path2 = string(sgb_full_path).replace(".gbc", ".sfc");
|
||||
if (!file::exists(sgb_full_path2)) {
|
||||
string sgb_full_path = string(system_dir, "/", sgb_bios).transform("\\", "/");
|
||||
program->superFamicom.location = sgb_full_path;
|
||||
}
|
||||
else {
|
||||
program->superFamicom.location = sgb_full_path2;
|
||||
}
|
||||
program->gameBoy.location = string(game->path);
|
||||
if (!file::exists(program->superFamicom.location)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
else if (string(game->path).endsWith(".bs"))
|
||||
{
|
||||
const char *system_dir;
|
||||
|
@ -394,7 +394,14 @@ auto Program::videoFrame(const uint16* data, uint pitch, uint width, uint height
|
||||
{
|
||||
uint multiplier = height / 240;
|
||||
data += 8 * (pitch >> 1) * multiplier;
|
||||
height -= 16 * multiplier;
|
||||
if (program->gameBoy.program)
|
||||
{
|
||||
height -= 16.1 * multiplier;
|
||||
}
|
||||
else
|
||||
{
|
||||
height -= 16 * multiplier;
|
||||
}
|
||||
}
|
||||
video_cb(data, width, height, pitch);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user