Skip to content

Commit

Permalink
Consider the overscan setting when getting the aspect ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiaholmquist authored and Screwtapello committed Aug 15, 2020
1 parent fdacdf9 commit d9f80db
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions bsnes/target-libretro/libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,27 @@ static int aspect_ratio_mode = 0;

static double get_aspect_ratio()
{
double ratio;

if (aspect_ratio_mode == 0 && program->superFamicom.region == "NTSC")
return 1.306122;
ratio = 1.306122;
else if (aspect_ratio_mode == 0 && program->superFamicom.region == "PAL")
return 1.584216;
ratio = 1.584216;
else if (aspect_ratio_mode == 1) // 8:7
return 8.0/7.0;
ratio = 8.0/7.0;
else if (aspect_ratio_mode == 2) // 4:3
return 4.0/3.0;
else if (aspect_ratio_mode == 3) // NTSC
return 1.306122;
ratio = 1.306122;
else if (aspect_ratio_mode == 4) // PAL
return 1.584216;
ratio = 1.584216;
else
ratio = 8.0/7.0; // Default

if (program->overscan)
return (ratio / 240) * 224;
else
return 8.0/7.0; // Default
return ratio;
}

static void flush_variables()
Expand Down

0 comments on commit d9f80db

Please sign in to comment.