From e7f751e18714a0db80ec1a472d12307cb17c35fc Mon Sep 17 00:00:00 2001 From: Alex Chirila Date: Wed, 18 Oct 2017 09:46:57 +0300 Subject: [PATCH] Added function to get title. Updated rules for multiple games to use title function. --- Source/Bayonetta/rules.txt | 3 +- Source/Bayonetta2/rules.txt | 3 +- .../0b9b8f5dfa16ad58_0000000000000000_vs.txt | 2 +- .../0bcd653c18367d59_0000000000000000_vs.txt | 2 +- .../0d6127fbed646d2b_0000000000000000_vs.txt | 2 +- .../0f2b9ee517917425_00000000000003c9_ps.txt | 2 +- .../1a14de8e58d5b30a_0000000000000000_vs.txt | 2 +- .../22c410044398c7af_0000000000000000_vs.txt | 2 +- .../2a2f55a2b2d64474_0000000000000000_vs.txt | 2 +- .../381d034349896360_0000000000000000_vs.txt | 2 +- .../4721609a424e9a1f_0000000000000000_vs.txt | 2 +- .../5c1761d13feccdff_0000000000000000_vs.txt | 2 +- .../5c975b0e3dac0562_0000000000000000_vs.txt | 2 +- .../75a85b0cbcab764b_0000000000000000_vs.txt | 2 +- .../771e24915acbb074_0000000000000000_vs.txt | 2 +- .../81eb264a750163d9_0000000000000000_vs.txt | 2 +- .../8cab2ed476b991ea_0000000000000000_vs.txt | 2 +- .../a5b3a5e5ab2938bc_0000000000001e49_ps.txt | 2 +- .../bb50d2ee4fa87bc2_0000000000000000_vs.txt | 2 +- .../c92c1c4c0a2fb839_0000000000001e49_ps.txt | 2 +- .../c9f2fd37115b0ee1_0000000000000000_vs.txt | 2 +- .../ea9a49a6185cf1e5_0000000000000000_vs.txt | 2 +- .../f14bb57cd5c9cb77_00000000000003c9_ps.txt | 2 +- .../f69e84515ae56e70_0000000000000000_vs.txt | 2 +- .../fc3e63a2007625f8_0000000000000000_vs.txt | 2 +- Source/BreathOfTheWild/rules.txt | 7 ++-- Source/CaptainToad/rules.txt | 8 ++--- Source/HyruleWarriors/rules.txt | 3 +- Source/MarioKart8/rules.txt | 7 ++-- Source/Splatoon/rules.txt | 7 ++-- Source/SuperMario3DWorld/rules.txt | 8 ++--- Source/functions.php | 35 +++++++++++++++++++ build.sh | 8 +++++ functions.php | 3 -- 34 files changed, 82 insertions(+), 56 deletions(-) create mode 100644 Source/functions.php delete mode 100644 functions.php diff --git a/Source/Bayonetta/rules.txt b/Source/Bayonetta/rules.txt index 825dde24..f82b79be 100644 --- a/Source/Bayonetta/rules.txt +++ b/Source/Bayonetta/rules.txt @@ -1,10 +1,11 @@ [Definition] titleIds = 000500001014DB00,0005000010157E00,0005000010157F00 diff --git a/Source/Bayonetta2/rules.txt b/Source/Bayonetta2/rules.txt index 178cc844..f56a2477 100644 --- a/Source/Bayonetta2/rules.txt +++ b/Source/Bayonetta2/rules.txt @@ -1,10 +1,11 @@ [Definition] titleIds = 0005000010172600,0005000010172700,000500001011B900 diff --git a/Source/BreathOfTheWild/0b9b8f5dfa16ad58_0000000000000000_vs.txt b/Source/BreathOfTheWild/0b9b8f5dfa16ad58_0000000000000000_vs.txt index 9e4baccc..0095ee57 100644 --- a/Source/BreathOfTheWild/0b9b8f5dfa16ad58_0000000000000000_vs.txt +++ b/Source/BreathOfTheWild/0b9b8f5dfa16ad58_0000000000000000_vs.txt @@ -1,5 +1,5 @@ [Definition] titleIds = 00050000101C9300,00050000101C9400,00050000101C9500 diff --git a/Source/CaptainToad/rules.txt b/Source/CaptainToad/rules.txt index 74e5e7e5..b7da3ecb 100644 --- a/Source/CaptainToad/rules.txt +++ b/Source/CaptainToad/rules.txt @@ -1,4 +1,5 @@ [Definition] titleIds = 0005000010180600,0005000010180700,0005000010180500 diff --git a/Source/HyruleWarriors/rules.txt b/Source/HyruleWarriors/rules.txt index 1cc098ce..de7d7f4e 100644 --- a/Source/HyruleWarriors/rules.txt +++ b/Source/HyruleWarriors/rules.txt @@ -1,10 +1,11 @@ [Definition] titleIds = 000500001017D800,000500001017D900,000500001017CD00 diff --git a/Source/MarioKart8/rules.txt b/Source/MarioKart8/rules.txt index b0784622..32b6b07a 100644 --- a/Source/MarioKart8/rules.txt +++ b/Source/MarioKart8/rules.txt @@ -1,14 +1,11 @@ [Definition] titleIds = 000500001010ec00,000500001010ed00,000500001010eb00,ffffffff85887bc1 diff --git a/Source/Splatoon/rules.txt b/Source/Splatoon/rules.txt index ef37d43f..17e18ae2 100644 --- a/Source/Splatoon/rules.txt +++ b/Source/Splatoon/rules.txt @@ -1,14 +1,11 @@ [Definition] titleIds = 0005000010176900,0005000010176A00,0005000010162B00 diff --git a/Source/SuperMario3DWorld/rules.txt b/Source/SuperMario3DWorld/rules.txt index 8e8907a2..a92e5cb6 100644 --- a/Source/SuperMario3DWorld/rules.txt +++ b/Source/SuperMario3DWorld/rules.txt @@ -1,4 +1,5 @@ [Definition] titleIds = 0005000010145D00,0005000010145C00,0005000010106100 diff --git a/Source/functions.php b/Source/functions.php new file mode 100644 index 00000000..5809e976 --- /dev/null +++ b/Source/functions.php @@ -0,0 +1,35 @@ + 0) { + $a = $b; + $b = $r; + $r = $a % $b; + } + return $b; +} +function simplify($num,$den) { + $g = gcd($num,$den); + return Array($num/$g,$den/$g); +} +function get_title($width, $height) { + $title = $width . "x" . $height; + $ratio = simplify($width, $height); + if ($ratio[0] != 16 && $ratio[1] != 9) { + if ($ratio[0] == 64 && $ratio[1] == 27) { + // 64:27 is the true ratio, but 21:9 is the common approximation + $title = $title . " (21:9)"; + } else if ($ratio[0] == 8 && $ratio[1] == 5) { + // common sense + $title = $title . " (16:10)"; + } else { + $title = $title . " (" . $ratio[0] .":". $ratio[1] . ")"; + } + } + return $title; +} +?> \ No newline at end of file diff --git a/build.sh b/build.sh index 715d104b..2e6855af 100644 --- a/build.sh +++ b/build.sh @@ -36,6 +36,14 @@ build_dir () { done } +build_dir "Source/Bayonetta" "Enthusiast/Bayonetta_1280×800" 1280 800 +build_dir "Source/Bayonetta" "Enthusiast/Bayonetta_1440×900" 1440 900 +build_dir "Source/Bayonetta" "Enthusiast/Bayonetta_1680×1050" 1680 1050 +build_dir "Source/Bayonetta" "Enthusiast/Bayonetta_1920×1200" 1920 1200 +build_dir "Source/Bayonetta" "Enthusiast/Bayonetta_2560x1600" 2560 1600 +build_dir "Source/Bayonetta" "Enthusiast/Bayonetta_640×480" 640 480 +build_dir "Source/Bayonetta" "Enthusiast/Bayonetta_720x480" 720 480 +build_dir "Source/Bayonetta" "Enthusiast/Bayonetta_800x480" 800 480 build_dir "Source/Bayonetta" "Enthusiast/Bayonetta_2880p" 5120 2880 build_dir "Source/Bayonetta" "Enthusiast/Bayonetta_4320p" 7680 4320 build_dir "Source/Bayonetta" "Enthusiast/Bayonetta_5760p" 10240 5760 diff --git a/functions.php b/functions.php deleted file mode 100644 index 9d89d852..00000000 --- a/functions.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file