Merge pull request #53 from ds22x/master

Simplify SGB path code & remove flashing bottom line when playing SGB games
This commit is contained in:
Autechre 2021-02-08 18:02:55 +01:00 committed by GitHub
commit ba7a60f6af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 22 deletions

View File

@ -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;

View File

@ -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);
}