Support Sticky Transforms + Minor Formatting Fixes

Sticky transforms have been stubbed, as they are on HOS/Android. Certain titles like Xenoblade Chronicles end up setting the sticky transform even if it doesn't do anything, as a result of this we cannot throw an exception for it and stub it without an exception (Aside from the cases where the value isn't recognized).
This commit is contained in:
PixelyIon 2021-07-06 00:19:53 +05:30
parent 0e02f1900f
commit e7aa439029
7 changed files with 37 additions and 24 deletions

View File

@ -364,10 +364,23 @@ namespace skyline::service::hosbinder {
throw exception("Application attempting to perform unknown transformation: {:#b}", static_cast<u32>(transform)); throw exception("Application attempting to perform unknown transformation: {:#b}", static_cast<u32>(transform));
} }
if (stickyTransform != NativeWindowTransform::Identity) switch (stickyTransform) {
// We do not support sticky transforms as they are only used by the LEGACY camera mode // Note: Sticky transforms are a legacy feature and aren't implemented in HOS nor the Android version it is based on, they are effectively inert
// Note: This is used on HOS to signal that the frame number should be returned but it's unimplemented // Certain games will still pass in values for sticky transforms (even if they don't do anything), we should not assert on these and verify their validity
throw exception("Any non-identity sticky transform is not supported: '{}' ({:#b})", ToString(stickyTransform), static_cast<u32>(stickyTransform)); case NativeWindowTransform::Identity:
case NativeWindowTransform::MirrorHorizontal:
case NativeWindowTransform::MirrorVertical:
case NativeWindowTransform::Rotate90:
case NativeWindowTransform::Rotate180:
case NativeWindowTransform::Rotate270:
case NativeWindowTransform::MirrorHorizontalRotate90:
case NativeWindowTransform::MirrorVerticalRotate90:
case NativeWindowTransform::InvertDisplay:
break;
default:
throw exception("Application attempting to perform unknown sticky transformation: {:#b}", static_cast<u32>(stickyTransform));
}
fence.Wait(state.soc->host1x); fence.Wait(state.soc->host1x);