VideoInterface: Don't crash when running Wii Freeloader

Datel's Wii Freeloaders set m_PictureConfiguration.WPL to 0 for
a while. Not sure if the fix in this commit is a proper fix or
just a hack, since I'm not very familiar with this code.

With this change, it's possible to run a Wii Freeloader if you
are running an old enough version of the Wii Menu, but the
"coloured bars" that Datel reference in their documentation
never show up. The screen just freezes for a few seconds instead.
This commit is contained in:
JosJuice 2019-10-27 10:49:50 +01:00
parent a825e7e09f
commit 090f04e01c

View File

@ -666,7 +666,9 @@ static void LogField(FieldType field, u32 xfb_address)
static void BeginField(FieldType field, u64 ticks)
{
// Could we fit a second line of data in the stride?
// (Datel's Wii FreeLoaders are the only titles known to set WPL to 0)
bool potentially_interlaced_xfb =
m_PictureConfiguration.WPL != 0 &&
((m_PictureConfiguration.STD / m_PictureConfiguration.WPL) == 2);
// Are there an odd number of half-lines per field (definition of interlaced video)
bool interlaced_video_mode = (GetHalfLinesPerEvenField() & 1) == 1;