VI: Restore forced-progressive hack with option

Bugfix: TargetRefreshRate uses rounded result
NTSC's 59.94 was becoming 59 with integer division.
This commit is contained in:
booto committed 2015-09-01 20:24:40 +08:00
1 parent 480dbb22f2
commit acc9a74174
3 files changed
+20 -7

No files matched your search

+16 -7
View File
@@ -18,6 +18,7 @@
#include "Core/PowerPC/PowerPC.h"
#include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h"
namespace VideoInterface
{
@@ -520,7 +521,7 @@ void UpdateParameters()
s_even_field_last_hl = s_odd_field_first_hl - 1;
s_odd_field_last_hl = s_odd_field_first_hl + GetHalfLinesPerOddField() - 1;
TargetRefreshRate = 2 * SystemTimers::GetTicksPerSecond() / (GetTicksPerEvenField() + GetTicksPerOddField());
TargetRefreshRate = lround(2.0 * SystemTimers::GetTicksPerSecond() / (GetTicksPerEvenField() + GetTicksPerOddField()));
}
u32 GetTicksPerHalfLine()
@@ -564,13 +565,21 @@ static void BeginField(FieldType field)
u32 xfbAddr;
if (field == FieldType::FIELD_EVEN)
{
xfbAddr = GetXFBAddressTop();
if (g_ActiveConfig.bForceProgressive && (multiplier == 2)) {
if (m_VBlankTimingOdd.PRB < m_VBlankTimingEven.PRB)
xfbAddr = GetXFBAddressTop();
else
xfbAddr = GetXFBAddressBottom();
}
else
{
xfbAddr = GetXFBAddressBottom();
else {
if (field == FieldType::FIELD_EVEN)
{
xfbAddr = GetXFBAddressTop();
}
else
{
xfbAddr = GetXFBAddressBottom();
}
}
static const char* const fieldTypeNames[] = { "Odd", "Even" };