Author Topic: Are there any text editor for FF X?  (Read 3893 times)

marul

  • *
  • Posts: 2
    • View Profile
Are there any text editor for FF X?
« on: 2016-05-14 06:15:43 »
Do you know any text editor for this game? Because I really need one.

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: Are there any text editor for FF X?
« Reply #1 on: 2016-05-14 07:26:55 »
There's this, but it still needs to be coupled with an hex editor.

marul

  • *
  • Posts: 2
    • View Profile
Re: Are there any text editor for FF X?
« Reply #2 on: 2016-05-14 08:05:29 »
There's this, but it still needs to be coupled with an hex editor.

it says ps2, i'm looking for a pc version actually. is it compatible with pc version? just to make sure

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: Are there any text editor for FF X?
« Reply #3 on: 2016-05-14 08:37:34 »
Dunno, you'll have to try.
If it's not compatible with the Steam version, that means the texts are likely to be written in UTF-8 or a similar standard encoding. Most hex editors have a text-searching and editing feature that will work just fine in that case.

Husbjörn

  • *
  • Posts: 36
    • View Profile
Re: Are there any text editor for FF X?
« Reply #4 on: 2016-05-19 16:03:02 »
Both the PS2 and Steam versions of FFX use the same character encoding.
The following is C# code for setting up a pair of encode / decode maps that translates characters between FFX's charset and Unicode:
Code: [Select]
// Symbols
EncodeMap.Add((char)0, 0x00);             // Null character

// NOTE: 0x03 seems to be used as a newline character. We need to handle this separatedly since it needs to be represented
//       by two characters (\r\n) in unicode however.

EncodeMap.Add(' ', 0x3a);
EncodeMap.Add('!', 0x3b);
EncodeMap.Add('\"', 0x3c);
EncodeMap.Add('#', 0x3d);
EncodeMap.Add('$', 0x3e);
EncodeMap.Add('%', 0x3f);
EncodeMap.Add('&', 0x40);
EncodeMap.Add('\'', 0x41);
EncodeMap.Add('(', 0x42);
EncodeMap.Add(')', 0x43);
EncodeMap.Add('*', 0x44);
EncodeMap.Add('+', 0x45);
EncodeMap.Add(',', 0x46);
EncodeMap.Add('-', 0x47);
EncodeMap.Add('.', 0x48);
EncodeMap.Add('/', 0x49);
EncodeMap.Add(':', 0x4a);
EncodeMap.Add(';', 0x4b);
EncodeMap.Add('<', 0x4c);
EncodeMap.Add('=', 0x4d);
EncodeMap.Add('>', 0x4e);
EncodeMap.Add('?', 0x4f);

EncodeMap.Add('[', 0x6a);
EncodeMap.Add('\\', 0x6b);
EncodeMap.Add(']', 0x6c);
EncodeMap.Add((char)(0x0361), 0x6d);      //  ͡ , could maybe be replaced with '^'? «https://en.wikipedia.org/wiki/Inverted_breve»
EncodeMap.Add('_', 0x6e);                 // TODO: Replace with a normal underscore if no other (shorter) such is found in the game font
EncodeMap.Add('`', 0x6f);

EncodeMap.Add('{', 0x8a);
EncodeMap.Add('|', 0x8b);
EncodeMap.Add('}', 0x8c);
EncodeMap.Add('~', 0x8d);                 // Fullwidth tilde
EncodeMap.Add('•', 0x8e);
EncodeMap.Add('【', 0x8f);
EncodeMap.Add('】', 0x90);
EncodeMap.Add('♪', 0x91);
EncodeMap.Add('♥', 0x92);

EncodeMap.Add('“', 0x94);
EncodeMap.Add('”', 0x95);
EncodeMap.Add('—', 0x96);

EncodeMap.Add('¡', 0x98);
EncodeMap.Add('↑', 0x99);
EncodeMap.Add('↓', 0x9a);
EncodeMap.Add('←', 0x9b);
EncodeMap.Add('→', 0x9c);
EncodeMap.Add('̈', 0x9d);                 // TODO: Consider replacing with '¨' if this isn't represented by some other character code
EncodeMap.Add('«', 0x9e);
EncodeMap.Add('°', 0x9f);

EncodeMap.Add('»', 0xa1);
EncodeMap.Add('¿', 0xa2);
EncodeMap.Add('À', 0xa3);
EncodeMap.Add('Á', 0xa4);
EncodeMap.Add('Â', 0xa5);
EncodeMap.Add('Ä', 0xa6);
EncodeMap.Add('Ç', 0xa7);
EncodeMap.Add('È', 0xa8);
EncodeMap.Add('É', 0xa9);
EncodeMap.Add('Ê', 0xaa);
EncodeMap.Add('Ë', 0xab);
EncodeMap.Add('Ì', 0xac);
EncodeMap.Add('Í', 0xad);
EncodeMap.Add('Î', 0xae);
EncodeMap.Add('Ï', 0xaf);
EncodeMap.Add('Ñ', 0xb0);
EncodeMap.Add('Ò', 0xb1);
EncodeMap.Add('Ó', 0xb2);
EncodeMap.Add('Ô', 0xb3);
EncodeMap.Add('Ö', 0xb4);
EncodeMap.Add('Ù', 0xb5);
EncodeMap.Add('Ú', 0xb6);
EncodeMap.Add('Û', 0xb7);
EncodeMap.Add('Ü', 0xb8);
EncodeMap.Add('ß', 0xb9);
EncodeMap.Add('à', 0xba);
EncodeMap.Add('á', 0xbb);
EncodeMap.Add('â', 0xbc);
EncodeMap.Add('ä', 0xbd);
EncodeMap.Add('ç', 0xbe);
EncodeMap.Add('è', 0xbf);
EncodeMap.Add('é', 0xc0);
EncodeMap.Add('ê', 0xc1);
EncodeMap.Add('ë', 0xc2);
EncodeMap.Add('ì', 0xc3);
EncodeMap.Add('í', 0xc4);
EncodeMap.Add('î', 0xc5);
EncodeMap.Add('ï', 0xc6);
EncodeMap.Add('ñ', 0xc7);
EncodeMap.Add('ò', 0xc8);
EncodeMap.Add('ó', 0xc9);
EncodeMap.Add('ô', 0xca);
EncodeMap.Add('ö', 0xcb);
EncodeMap.Add('ù', 0xcc);
EncodeMap.Add('ú', 0xcd);
EncodeMap.Add('û', 0xce);
EncodeMap.Add('ü', 0xcf);
EncodeMap.Add(',', 0xd0);   // This appears to be another comma, positioned about one pixel higher vertically than the 0x46 one. We'll use a fullwidth one here.
EncodeMap.Add('ƒ', 0xd1);   // Not sure whether this is supposed to be a musical forte character or a mathematical function "f"; the former can't be represented
EncodeMap.Add('„', 0xd2);
EncodeMap.Add('…', 0xd3);
EncodeMap.Add('‘', 0xd4);
EncodeMap.Add('’', 0xd5);
EncodeMap.Add('▪', 0xd6);   // Not really what the in-game symbol looks like but it'll do I guess
EncodeMap.Add('–', 0xd7);   // Shorter dash than 0x96, but not a hyphen?
EncodeMap.Add('~', 0xd8);   // "Normal" tilde, as opposed to the fullwidth one at 0x8d
EncodeMap.Add('™', 0xd9);

// NOTE: 0x93, 0x97, 0xa0 and 0xda seem to be unused and will print nothing if used in game text

EncodeMap.Add('›', 0xdb);
EncodeMap.Add('§', 0xdc);
EncodeMap.Add('©', 0xdd);
EncodeMap.Add('ₐ', 0xde);   // This is actually a superscripted 'a' in the game's font, but this is the closest there seems to be in the 16-bit unicode charset
EncodeMap.Add('®', 0xdf);
EncodeMap.Add('±', 0xe0);
EncodeMap.Add('²', 0xe1);
EncodeMap.Add('³', 0xe2);
EncodeMap.Add('¼', 0xe3);
EncodeMap.Add('½', 0xe4);
EncodeMap.Add('¾', 0xe5);
EncodeMap.Add('×', 0xe6);
EncodeMap.Add('÷', 0xe7);
EncodeMap.Add('‹', 0xe8);
EncodeMap.Add('⋯', 0xe9);   // Midline horizontal ellipsis as opposed to the baseline version at character 0xd3

// The characters in-between do not print anything and are presumably either not valid characters or act as
// placeholders for character names and the like in certain contexts.

EncodeMap.Add('\t', 0xfc);  // Wide space or tab, not sure which; all the remaining characters up to 0xff appears this way when typed so probably not valid

// Create reverse mapping for the symbols in the encode map
foreach (char c in EncodeMap.Keys)
    DecodeMap.Add(EncodeMap[c], c);

// Digits
for (int n = 0; n < 10; n++) {
    EncodeMap.Add((char)(48 + n), (byte)(0x30 + n));
    DecodeMap.Add((byte)(0x30 + n), (char)(48 + n));
}

// Letters
for (int n = 0; n < 26; n++) {
    char uc = (char)(65 + n);             // Uppercase
    char lc = (char)(97 + n);             // Lowercase
    byte ub = (byte)(0x50 + n);
    byte lb = (byte)(0x70 + n);
    EncodeMap.Add(uc, ub);
    DecodeMap.Add(ub, uc);
    EncodeMap.Add(lc, lb);
    DecodeMap.Add(lb, lc);
}