From 54dbc7042dbf294af5084b4053723a45616d893b Mon Sep 17 00:00:00 2001 From: M&M Date: Sat, 7 Aug 2021 21:43:59 -0700 Subject: [PATCH] [Rio 2016] Add Aspect Ratio enhancement pack Currently separated as non-integer values with the resolution pack causes a bright screen. --- .../AspectRatio/patch_AspectRatio.asm | 25 +++++++ .../Enhancements/AspectRatio/rules.txt | 68 +++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 src/M&SRio2016/Enhancements/AspectRatio/patch_AspectRatio.asm create mode 100644 src/M&SRio2016/Enhancements/AspectRatio/rules.txt diff --git a/src/M&SRio2016/Enhancements/AspectRatio/patch_AspectRatio.asm b/src/M&SRio2016/Enhancements/AspectRatio/patch_AspectRatio.asm new file mode 100644 index 00000000..27035887 --- /dev/null +++ b/src/M&SRio2016/Enhancements/AspectRatio/patch_AspectRatio.asm @@ -0,0 +1,25 @@ +[unisonAspectRatio] +moduleMatches = 0xD44C22E3 + +.origin = codecave + +_width: +.float $width + +_height: +.float $height + +_aspectRatio: +; Scale the width of the viewport that it wants to calculate the ratio for +lis r13, _width@ha +lfs f12, _width@l(r13) +fsub f12, f12, f14 +; Scale the height of the viewport that it wants to calculate the ratio for +lis r14, _height@ha +lfs f13, _height@l(r14) +fsub f0, f13, f0 +; Original instruction that got replaced by the code cave jump, which divides the width and height to get the aspect ratio, then return to original code +fdivs f1, f12, f13 +blr + +0x0256975C = bla _aspectRatio ; Modify this instruction to go to the code cave which scales the height and width to the upscale ratios \ No newline at end of file diff --git a/src/M&SRio2016/Enhancements/AspectRatio/rules.txt b/src/M&SRio2016/Enhancements/AspectRatio/rules.txt new file mode 100644 index 00000000..95dbd449 --- /dev/null +++ b/src/M&SRio2016/Enhancements/AspectRatio/rules.txt @@ -0,0 +1,68 @@ +[Definition] +titleIds = 0005000010190300,00050000101E5300,00050000101E5400 +name = Aspect Ratio +path = "Mario & Sonic at the Rio 2016 Olympic Games/Enhancements/Aspect Ratio" +description = Allows you to change the game's aspect ratio.|Currently separated as non-integer values with the resolution pack causes a bright screen.||Made by M&&M. +version = 6 + +[Default] +$width = 1280 +$height = 720 +$gameWidth = 1280 +$gameHeight = 720 + +# Aspect Ratio + +[Preset] # 1.7~ +name = 16:9 +category = Aspect Ratio +$width = 16 +$height = 9 + +[Preset] # 1.6 +category = Aspect Ratio +name = 16:10 (1680x1050) +$width = 1680 +$height = 1050 + +[Preset] # 1.5~ +category = Aspect Ratio +name = 16:10 (1680x1080) +$width = 1680 +$height = 1080 + +[Preset] # 1.568627450980392 +category = Aspect Ratio +name = 16:10 (1920x1224) +$width = 1920 +$height = 1224 + +[Preset] # 1.568627450980392 +category = Aspect Ratio +name = 16:10 (2880x1800) +$width = 2880 +$height = 1800 + +[Preset] # 1.545893719806763 +category = Aspect Ratio +name = 16:10 (2560x1656) +$width = 2560 +$height = 1656 + +[Preset] # 2.370~ +category = Aspect Ratio +name = 21:9 (2560x1080) +$width = 2560 +$height = 1080 + +[Preset] # 2.38~ +category = Aspect Ratio +name = 21:9 (3440x1440) +$width = 3440 +$height = 1440 + +[Preset] +category = Aspect Ratio +name = 32:9 +$width = 32 +$height = 9