From 2458040cd9c50bd9f4a74c38dc4cc70d5c53d079 Mon Sep 17 00:00:00 2001 From: bbtufty Date: Thu, 19 Dec 2024 10:38:19 +0000 Subject: [PATCH] Add N64 - Added N64 - Updated regex - Ensure MD5 is lowercase for RA --- CHANGES.rst | 11 +++++++++++ README.md | 1 + docs/intro.rst | 5 +++-- romsearch/configs/clonelists/retool.yml | 12 ++++++++++-- romsearch/configs/dats/no-intro.yml | 5 ++++- romsearch/configs/defaults.yml | 3 ++- .../configs/platforms/Nintendo - Nintendo 64.yml | 6 ++++++ romsearch/configs/regex.yml | 14 ++++++++++++++ romsearch/modules/romparser.py | 9 +++++++-- 9 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 romsearch/configs/platforms/Nintendo - Nintendo 64.yml diff --git a/CHANGES.rst b/CHANGES.rst index d772465..87c99e7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,12 +1,23 @@ 0.1.2 (Unreleased) ================== +Features +-------- + +- Added N64 + Fixes ----- +ROMParser +~~~~~~~~~ + +- Ensure MD5 hash is lowercase from RetroAchievements + General ~~~~~~~ +- Updated regex - Add more tests 0.1.1 (2024-12-18) diff --git a/README.md b/README.md index 8f4a05d..4e9fe45 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ works for the following consoles: * Nintendo (Home) * Nintendo Entertainment System * Super Nintendo Entertainment System + * Nintendo 64 * GameCube * Sony (Handheld) * PlayStation Portable diff --git a/docs/intro.rst b/docs/intro.rst index 734bdd5..52cd0f0 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -46,9 +46,10 @@ has the capability for: * Nintendo (Home) + * Nintendo Entertainment System + * Super Nintendo Entertainment System + * Nintendo 64 * GameCube - * Nintendo - Nintendo Entertainment System - * Nintendo - Super Nintendo Entertainment System * Sony (Handheld) diff --git a/romsearch/configs/clonelists/retool.yml b/romsearch/configs/clonelists/retool.yml index 3601ff5..be54edc 100644 --- a/romsearch/configs/clonelists/retool.yml +++ b/romsearch/configs/clonelists/retool.yml @@ -1,11 +1,19 @@ url: "https://raw.githubusercontent.com/unexpectedpanda/retool-clonelists-metadata/main/clonelists" +# Nintendo Handhelds Nintendo - Game Boy: "Nintendo - Game Boy (No-Intro).json" Nintendo - Game Boy Color: "Nintendo - Game Boy Color (No-Intro).json" Nintendo - Game Boy Advance: "Nintendo - Game Boy Advance (No-Intro).json" -Nintendo - GameCube: "Nintendo - GameCube (Redump).json" + +# Nintendo Home Consoles Nintendo - Nintendo Entertainment System: "Nintendo - Nintendo Entertainment System (No-Intro).json" Nintendo - Super Nintendo Entertainment System: "Nintendo - Super Nintendo Entertainment System (No-Intro).json" +Nintendo - Nintendo 64: "Nintendo - Nintendo 64 (No-Intro).json" +Nintendo - GameCube: "Nintendo - GameCube (Redump).json" + +# Sony Handhelds +Sony - PlayStation Portable: "Sony - PlayStation Portable (Redump).json" + +# Sony Home Consoles Sony - PlayStation: "Sony - PlayStation (Redump).json" Sony - PlayStation 2: "Sony - PlayStation 2 (Redump).json" -Sony - PlayStation Portable: "Sony - PlayStation Portable (Redump).json" diff --git a/romsearch/configs/dats/no-intro.yml b/romsearch/configs/dats/no-intro.yml index ef745f7..b5fc37d 100644 --- a/romsearch/configs/dats/no-intro.yml +++ b/romsearch/configs/dats/no-intro.yml @@ -11,4 +11,7 @@ Nintendo - Nintendo Entertainment System: file_mapping: "Nintendo - Nintendo Entertainment System (Headered) (*)" Nintendo - Super Nintendo Entertainment System: - file_mapping: "Nintendo - Super Nintendo Entertainment System (*)" \ No newline at end of file + file_mapping: "Nintendo - Super Nintendo Entertainment System (*)" + +Nintendo - Nintendo 64: + file_mapping: "Nintendo - Nintendo 64 (BigEndian) (*)" \ No newline at end of file diff --git a/romsearch/configs/defaults.yml b/romsearch/configs/defaults.yml index 59a86a8..288667b 100644 --- a/romsearch/configs/defaults.yml +++ b/romsearch/configs/defaults.yml @@ -7,9 +7,10 @@ platforms: - "Nintendo - Game Boy" - "Nintendo - Game Boy Color" - "Nintendo - Game Boy Advance" - - "Nintendo - GameCube" - "Nintendo - Nintendo Entertainment System" - "Nintendo - Super Nintendo Entertainment System" + - "Nintendo - Nintendo 64" + - "Nintendo - GameCube" - "Sony - PlayStation" - "Sony - PlayStation 2" - "Sony - PlayStation Portable" diff --git a/romsearch/configs/platforms/Nintendo - Nintendo 64.yml b/romsearch/configs/platforms/Nintendo - Nintendo 64.yml new file mode 100644 index 0000000..8ad720e --- /dev/null +++ b/romsearch/configs/platforms/Nintendo - Nintendo 64.yml @@ -0,0 +1,6 @@ +group: "No-Intro" +dir: "/No-Intro/Nintendo - Nintendo 64 (BigEndian)/" +unzip: false + +ra_id: 2 +ra_hash_method: "md5" diff --git a/romsearch/configs/regex.yml b/romsearch/configs/regex.yml index 170cc5b..f8e7104 100644 --- a/romsearch/configs/regex.yml +++ b/romsearch/configs/regex.yml @@ -296,6 +296,10 @@ sgb_enhanced_gb_compatible: pattern: "\\(SGB Enhanced, GB Compatible\\)" group: "improved_version" +shindou_edition: + pattern: "\\(Shindou Edition\\)" + group: "improved_version" + subor_keyboard: pattern: "\\(Subor Keyboard\\)" group: "improved_version" @@ -700,6 +704,10 @@ limited_run: pattern: "\\(Limited Run Games\\)" group: "demoted_version" +lodgenet: + pattern: "\\(LodgeNet\\)" + group: "demoted_version" + mb91: pattern: "\\(MB-91\\)" group: "demoted_version" @@ -790,6 +798,12 @@ pal: pattern: "([?:-][\\s])?[(]?PAL(?: [a-zA-Z]+| 50[Hh]z)?(?:\\)?| (?=\\())" flags: "NOFLAG" +presence_of_mind: + pattern: "\\(Presence of Mind \\'98\\)" + +summer64: + pattern: "\\(Summer64\\)" + supervision: pattern: "\\(SuperVision\\)" diff --git a/romsearch/modules/romparser.py b/romsearch/modules/romparser.py index e512e4d..38f2bb7 100644 --- a/romsearch/modules/romparser.py +++ b/romsearch/modules/romparser.py @@ -734,11 +734,16 @@ def get_ra_match( if any([l not in self.ra_labels for l in h["Labels"]]): continue - # Use the md5 as the unique key, and then name as the thing we'll match to - md5 = copy.deepcopy(h["MD5"]) + # Use the md5 as the unique key, and then name as the thing we'll match to. + # Ensure we lowercase the hash, just to be sure + md5 = copy.deepcopy(h["MD5"].lower()) name = copy.deepcopy(h[key]) name = name.strip() + # Ensure we also lowercase the hash here, if we need to + if key in ["MD5"]: + name = name.lower() + # If we're dealing with names, there might # be file extensions to strip if key in ["Name"]: