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.
Character Swap would crash the game due to some change in Cemu 1.15.8 apparently (no real clue why although it's probably the hex values being weird). Reported by Revan.
Hyrule Warriors resolution pack has a pretty big blending bug in the menus for a bit too. Upscaling compressed formats never goes well. Reported by MelonSpeedruns.
Solves https://github.com/slashiee/cemu_graphic_packs/issues/422
Was requested over at the Cemu discord too after we took them away while we sanitized them, and there isn't really an issue with having these. Let's just keep those presets sanitized now.
Also found out that some random workaround had appeared in our resolutions folder 🤔.
Both were fully verified, so no issues should be present. This basically means that every game that runs properly (Star Wars doesn't go in-game, Tokyo Mirage is also very buggy and the upscaling filters don't work with cemu yet) before V5 will have graphic packs at least.
Didn't update the docs (will do that tomorrow), but I manually checked (didn't verify things, but I basically checked if it contained "uf_windowSpaceToClipSpaceTransform" and if the shader was made after a certain Cemu change was made due to how they're left out) to see if any graphic pack in here was *probably* safe.
I also didn't convert 5 graphic packs since they contained signs that needed to be manually checked or at least examined more:
- \Enhancements\TwilightPrincessHD_Bicubic
- \Resolutions\DevilsThird_Resolution
- \Resolutions\TwilightPrincessHD_Resolution (this one just needs to be fully verified since it's popular enough and has like 27 shaders)
- \Resolutions\LegoStarWars_Resolution
- \Resolutions\TokyoMirage_Resolution (this one could also be manually verified)
I hope I didn't make too many mistakes with this one.
I searched through quite a bit of commits to properly credit some packs. Some of the credits are based off memory. Please let me know if I incorrectly credited or forgot to credit somebody.
8x was overkill, and 4x is a tad unstable especially with 1.16.1 with texture allocation issues. Current pack settings will be reset back to 100% size due to preset naming changes.
Basically, the code previously would always replace the ratio calculation code for the 3d rendering and just load the upscaled width divided by the upscaled height. But the code gets passed other aspect ratios too, for example in the gear menu (and very likely other menus too).
So, even when users didn't use an ultrawide aspect ratio it would set the aspect ratio of anything that was 3d rendered to be 16:9, basically.
Comparison:
http://www.framecompare.com/image-compare/screenshotcomparison/D6WDWNNXhttps://cdn.discordapp.com/attachments/292733452590120961/663586520531337223/unknown.png
I made some assumptions about the other game versions regarding the floating point register that I use to load the scale float into, which is free to use in the EU 1.0.1 version at least.
I assume that the code for all of this is would be very similar though, since the previous ratio patch only had some addresses change across versions so it's probably fine.
This actually properly fixes https://github.com/slashiee/cemu_graphic_packs/issues/334 which was closed without any proper solution. Someone reported the issue in the Cemu Discord which made me fix it, since I thought the issue was addressed already.
Should fix the native anti-aliasing preset most importantly, but since I ported all of the packs now the script "watermark" is at least a proper sentence, heh.
Also, I fixed the porting scripts. Basically, there were a bug in the verification script that wouldn't check if the uf_* variables matched and the conversion script also had a fun bug where it wasn't automatically fixing an incorrect order of the uf_* variables. So that basically made both of them slip through. Both are now fixed however.
Don't know if it's needed to check the previously ported graphic packs to see if the error affected those, but it might not hurt.
3 unverified shaders, although one of them already had the Vulkan stuff in them. Can't find where the other two are.
280351fcf8e5949f_0000000000000000_vs
6d9067fd20086bc0_0000000000000000_vs