RayCarrot / SpyroGBALocPatcher

Tool for patching Spyro GBA games localization
MIT License
2 stars 1 forks source link

Spyro 2, default config, collaboration #1

Closed PonPonTheBonBon closed 1 month ago

PonPonTheBonBon commented 1 month ago

I looked into the characters of Spyro 2 and they are slightly different, and I wanted to contribue something towards this, which might get the ball rolling towards supporting Spyro 2 with a default config. This map would apply to the EU-version, but might also work for the US-version. I do not know the LocAdress or LocLength so I wouldn't be able to extract the text from the game anyway.

I was unable to figure out some of the characters, so they are listed as �. Since the characters are listed in the same order as for Spyro 1, some can be infered, such as hex 02 and 03 would be two out of "%&, and hex 0A and 16 are likely / and ; respecively. Hex 55,56 are two out of ÉÌÍ and 58,59 are two out of ÓÖÚ, so some characters have been removed from Spyro 1.

I have also figured out the first hex of each language: English: 00180803 "G'day, cobber! Those cheeky Rhynocs have turned off the space heaters." French: 0018C0BB "Salut mon pote! Ces sacrés rhinos ont éteint les radiateurs galactiques." Spanish: 001985C7 "Buenos días, amigo mío. Esos rinocs descarados han apagado los calentadores espaciales." German: 001A49DF "Tachchen, Kumpel! Diese frechen Rhinoxe haben die Heizer ausgeschaltet." Italian: 001B14FA "Ängiorno, amico! Quegli insolenti dei rinoc hanno spento i caloriferi dello spazio." (I do not know why Italian has the word "Ängiorno")

public static char[] DefaultFont_Spyro2 => new char[]
    {
        ' ', '!', '�', '�', '\'', '(', ')', ',', '-', '.', '�',
        '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
        ':', '�', '?',
        'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 
        'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
        'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
        'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
        '�', '¡', '�', '�', '¿',
        'Á', 'Ä', 'Ç', 'È', '�', '�', 'Ñ', '�', '�', 'Ü',
        'ß', 'à', 'á', 'â', 'ä', 'ç', 'è', 'é', 'ê', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'ö', 'ù', 'ú', 'û', 'ü'
    };

By extracting the strings, we could see in what context the missing characters are used in, and figure out that way. Unless someone is able to extract some character-map like a spritesheet?

RayCarrot commented 1 month ago

Hi! 🙂

Ray1Map already supports viewing the text from Season of Flame (and Attack of the Rhynocs). However I didn't go as in-depth as I did with Season of Ice, so the font tables here are only estimations from the text. That's why I never added it here.

If you'd like to help out by adding full support to Season of Flame that would be great! Here's what I could gather for it:

These are the localization addresses and lengths for the EU version (from the function at 08002430): English: 08180130 (length 47288) French: 0818b9e8 (length 50444) Spanish: 08197ef4 (length 50200) German: 081a430c (length 51996) Italian: 081b0e28 (length 50936)

And for the US version (from the function at 08002420): English: 0817fde4 (length 48140)

And here are the exported font sheets, along with the text extracted using it (luckily the code I wrote to do this for Season of Ice works in Season of Flame too!): Spyro Season of Flame Localization.zip

If you fill out the font arrays I could add it in, or if you want to make a PR I can merge that. Either way works for me!

PonPonTheBonBon commented 1 month ago

@RayCarrot Thank you, I tested each and they work fine.

After looking into it, apparently it is "ngiorno, amico!" in Italian, and "ngiorno" is a valid dialectal word, but I don't know why it doesn't start with a capital.

Since Ray1Map put a question regarding é for US Flame, I had to check, and it does use é in the position where EU has è, so using the EU-map it gives "Brulè".

image

Pull request created: #2

RayCarrot commented 1 month ago

Thanks a lot! I've merged it and published a new release now!

RayCarrot commented 1 month ago

Oh I probably shouldn't have been so quick 😅 @PonPonTheBonBon I think you might have indexed some of the font characters wrong. Exporting the text for Season of Flame with these generated configs just gives garbage text. I had a look at the font tables and the EU one seems identical to the Season of Ice one which I don't think it should be? Also at index 4 you have added the "&" character which seems to be offsetting everything afterwards by 1.

PonPonTheBonBon commented 1 month ago

@RayCarrot oh, you're right. I forgot one important step in the process, to actually insert the actual table. That's silly of me.

However, I took extra time into discovering what the deal was with the extra space. It's only used in French and German as a non-breaking space. If it actually works as a non-breaking space in-game, I do not know. But they are used in that manner, since the space appears as normal width.

This also made me discover that the '<' '>' are actually '«' '»'

image

I made a new request that should hopefully yield the correct results now: #3

RayCarrot commented 1 month ago

Thanks for fixing it so quickly! It all seems to work as it should now, so I made a new release. I also updated the Ray1Map repo with the respective changes. Reg. the non-breaking space - that's interesting! I also wonder if it's functional in-game or not? I would imagine so if they reserved a space for it in the font.