Fix Wii U port when TV is set to 1080p

WUT's bugged. See here:
https://github.com/devkitPro/wut/issues/119

It apparently got this bug from the Decaf emulator. Maybe I should
tell those guys too.
This commit is contained in:
Clownacy 2020-04-25 00:03:20 +01:00
parent 22c9987191
commit c5691d7570
2 changed files with 18 additions and 18 deletions

View file

@ -169,21 +169,21 @@ RenderBackend_Surface* RenderBackend_Init(const char *window_title, int screen_w
// Calculate centred viewports
switch (GX2GetSystemTVScanMode())
{
case GX2_TV_SCAN_MODE_NONE: // lolwut
break;
case GX2_TV_SCAN_MODE_480I:
case GX2_TV_SCAN_MODE_480P:
// For now, we have to match WUT's broken behaviour (its `GX2TVScanMode`
// enum is missing values, and the rest are off-by-one)
//case GX2_TV_SCAN_MODE_576I:
case GX2_TV_SCAN_MODE_480I: // Actually 576i
case GX2_TV_SCAN_MODE_480P: // Actually 480i
CalculateViewport(854, 480, &tv_viewport);
break;
case GX2_TV_SCAN_MODE_720P:
case 4: // Why the hell doesn't WUT have an enum for this? It always returns this value for me!
case GX2_TV_SCAN_MODE_720P: // Actually 480p
default: // Funnel the *real* 1080p into this
CalculateViewport(1280, 720, &tv_viewport);
break;
case GX2_TV_SCAN_MODE_1080I:
case GX2_TV_SCAN_MODE_1080P:
case GX2_TV_SCAN_MODE_1080I: // Actually invalid
case GX2_TV_SCAN_MODE_1080P: // Actually 1080i
CalculateViewport(1920, 1080, &tv_viewport);
break;
}

View file

@ -154,21 +154,21 @@ bool WindowBackend_Software_CreateWindow(const char *window_title, int screen_wi
// Calculate centred viewports
switch (GX2GetSystemTVScanMode())
{
case GX2_TV_SCAN_MODE_NONE: // lolwut
break;
case GX2_TV_SCAN_MODE_480I:
case GX2_TV_SCAN_MODE_480P:
// For now, we have to match WUT's broken behaviour (its `GX2TVScanMode`
// enum is missing values, and the rest are off-by-one)
//case GX2_TV_SCAN_MODE_576I:
case GX2_TV_SCAN_MODE_480I: // Actually 576i
case GX2_TV_SCAN_MODE_480P: // Actually 480i
CalculateViewport(854, 480, &tv_viewport);
break;
case GX2_TV_SCAN_MODE_720P:
case 4: // Why the hell doesn't WUT have an enum for this? It always returns this value for me!
case GX2_TV_SCAN_MODE_720P: // Actually 480p
default: // Funnel the *real* 1080p into this
CalculateViewport(1280, 720, &tv_viewport);
break;
case GX2_TV_SCAN_MODE_1080I:
case GX2_TV_SCAN_MODE_1080P:
case GX2_TV_SCAN_MODE_1080I: // Actually invalid
case GX2_TV_SCAN_MODE_1080P: // Actually 1080i
CalculateViewport(1920, 1080, &tv_viewport);
break;
}