Jump to content
Sign in to follow this  
ajxpk

[Bug] Issue with Japanese Trainer Names in 3rd Gen save files

Recommended Posts

I just want to make a little bug report. Should be easy to fix.
PKHeX doesn't recognizes the Katana "ア" when I want to use it in my Trainer Name.
As a result everytime I edit the Trainer Info I lose my name... which was just "ア", lol...

Pocket Monsters - Ruby (Japan) - PKHeX OT Name Bug.sav

Edited by ajxpk

Share this post


Link to post
Share on other sites

It occurs with イ, ウ and エ too. I didn't checked all yet but it looks like some characters are mapped correctly because オ is fine.

Edit:
More bugged Katakanas... シ, ネ &マ. And almost all Hiragana. The weird thing is that Pokemon Nicknames and OT Names are fine, shouldn't they using the same table?

Edited by ajxpk

Share this post


Link to post
Share on other sites

It's just a bad save file (detection wise)

// Japanese games are limited to 5 character OT names; any unused characters are 0xFF.
// 5 for JP, 7 for INT. There's always 1 terminator, thus we can check 0x6-0x7 being 0xFFFF = INT
// OT name is stored at the top of the first block.

In the save file provided, the values are FF FF FF FF FF FF FF FF for the OT; thus not being a Japanese save file.

However, if it was originally a JP save that was repeatedly edited (with existing code), it would write the 0xFF padding over that detection area, making it a non-JP sav.

public override string OT
{
    get => GetString(BlockOfs[0], 0x10);
    set => SetString(value, OTLength, PadWith:0xFF).CopyTo(Data, BlockOfs[0]);
}

OTLength is hardcoded to 7, so it ends up writing the 8 bytes of padding.

Fixed in latest commit, now writes padding how the game would (5 or 7 bytes of 0xFF), thus not breaking the JP detection. Thanks for reporting :)

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you!

And yeah, the save file was indeed edited. I just removed IDs and set the Playtime and RTC back all hack to 0 and stuff like that. But mainly because I always do that with test and research save files, especially when I plan to upload them... kinda one of my ways to mark my save files.

Edit:
Looks like it was not my editing. Things are getting more weird in an untouched Gen 3 save file. ア is desplayed as "¿" in the Trainer Info Setting.  
Maybe this is fixed now that it detects Japanese save files better but you might wanna check it out.

 

Pocket Monsters - Ruby (Japan) - Untouched.sav

Edited by ajxpk

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...