mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-11-29 21:04:14 +01:00
3f87a42f4f
Fixes https://github.com/slashiee/cemu_graphic_packs/issues/437 The aspect ratio mod apparently relied more on a shotgun approach, which caused major issues with Vulkan. Using @getdls addresses, I found out that 2 of the addresses that were being patched to jump to the code cave were unrelated to the aspect ratio, so I had those removed. Those random jumps probably didn't cause issues because they would jump to code that would just utilize floating point registers that were in-use and then put the result in the wrong register too. While the picked registers would work with the 3D rendering aspect ratio instruction, it wouldn't fail for the other registers since they weren't specific to those. Anyway, the proper fix was to just make a second code cave for the aspect ratio, which outputted the culling ratio in the proper register. And also make sure it didn't use in-use registers. I also reverted some of the shader code changes since they are inconsistent with how we've done them for all the other packs. And made them more compatible with the ultrawide resolutions.
29 lines
561 B
NASM
29 lines
561 B
NASM
[Bayo2_AspectRatio_V0]
|
|
moduleMatches = 0xAF5D1A85
|
|
|
|
.origin = codecave
|
|
_widthScaleRatio:
|
|
.float $width
|
|
_heightScaleRatio:
|
|
.float $height
|
|
|
|
_calculateARForRendering:
|
|
lis r7, _widthScaleRatio@ha
|
|
lfs f13, _widthScaleRatio@l(r7)
|
|
lis r7, _heightScaleRatio@ha
|
|
lfs f31, _heightScaleRatio@l(r7)
|
|
fdivs f2, f13, f31
|
|
blr
|
|
|
|
_calculateARForCulling:
|
|
lis r7, _widthScaleRatio@ha
|
|
lfs f13, _widthScaleRatio@l(r7)
|
|
lis r7, _heightScaleRatio@ha
|
|
lfs f1, _heightScaleRatio@l(r7)
|
|
fdivs f10, f13, f1
|
|
blr
|
|
|
|
|
|
0x032F2E6C = bla _calculateARForRendering
|
|
0x032F2044 = bla _calculateARForCulling
|