libretro / libretro-database

Repository containing cheatcode files, content data files, etc.
Creative Commons Attribution Share Alike 4.0 International
931 stars 789 forks source link

Unwanted tags in some GBA game titles #1337

Open metchebe opened 1 year ago

metchebe commented 1 year ago

Hello.

For some reason, a recent update has added x### tags to some Game Boy Advance games in the playlist, for example:

x109 - Super Mario Advance 4 - Super Mario Bros. 3 (USA) (Rev 1) (Virtual Console)

which is the one I noticed. Checking the dat file it seems that the initial No-Intro number is filtered for number tags only (no x), examples:

Fixed:

    name "Super Mario Advance 4 - Super Mario 3 + Mario Brothers (Japan)"
    rom ( name "1076 - Super Mario Advance 4 - Super Mario 3 + Mario Brothers (Japan).gba" size 4194304 crc F3C87306 md5 E559E292AA9D44287B052342D6469967 sha1 19F7928BC4FFD733D71884DAE9AD9B7F4007D38D serial "AX4J" )

Not Fixed:

    name "x250 - Super Mario Advance 4 - Super Mario 3 + Mario Brothers (Japan) (Rev 2) (Virtual Console)"
    rom ( name "x250 - Super Mario Advance 4 - Super Mario 3 + Mario Brothers (Japan) (Rev 2) (Virtual Console).gba" size 8388608 crc 4AEE9C77 md5 ED52707B19848C480866A86F28268273 sha1 72CCC0ECCE6CE08EADCE1B3DA4873CDD91851496 serial "AX4J" )
RobLoach commented 1 year ago

Good catch. The regex to clean the names likely doesn't manage for x250 - cases: https://github.com/RobLoach/libretro-dats/blob/master/index.js#L248-L254

// Protect against #### - Game Name (Country) -- Remove the prefixing numbers.
    // Game Boy Advance only does this numbering?
    if (name.includes('Game Boy Advance')) {
        if (/^[0-9][0-9][0-9][0-9] - /.test(gameName)) {
            gameName = gameName.substring(7)
        }
    }

Could likely use some tweaks in that regex.