Professor Layton Portuguese Translation

Discussion in 'NDS - ROM Hacking and Translations' started by WeaponKnight, Jan 5, 2009.

  1. WeaponKnight
    OP

    WeaponKnight Newbie

    Newcomer
    8
    0
    Dec 22, 2007
    Brazil
    Hi there, fellas =]

    I am currently working on a Brazilian Portuguese translation of Professor Layton and the Curious Village.
    When I get to know the file structure and actually start translating, I'll update this posts with the details.

    Status:
    Trying to figure out how the packed files are organized.
     


  2. Vampires

    Vampires Member

    Newcomer
    17
    0
    Mar 16, 2008
    Serbia, Republic of
    Europe version don't use special chars, it's just use tags. For example: < - (open tag), ^ - (reverted character tag), ! - (character), > - (close tag) = . That will be reverted !. Other characters: ,
     
  3. cocomonk22

    cocomonk22 GBAtemp Fan

    Member
    304
    22
    Oct 24, 2006
    United States
    I agree with Vampires on using the European version instead. Look into lz77 packing tools.
     
  4. WeaponKnight
    OP

    WeaponKnight Newbie

    Newcomer
    8
    0
    Dec 22, 2007
    Brazil
    I guess I'll have to try the European version then. There is not enough space in the US font, because we use ALL the English characters there, plus ours =/

    Thanks for the help, I'll post here once I look into it =]
     
  5. ninhokova

    ninhokova Newbie

    Newcomer
    5
    0
    May 30, 2008
    United States
    Enfim uma tadução para esse jogo em português!!!!!!!
     
  6. Jax

    Jax Pip Pip Cheerioink!

    Member
    4,126
    282
    Jul 31, 2006
    Portugal
    L.A.V.
    Pena que é para o português do Brasil... [​IMG]
     
  7. Noitora

    Noitora ::

    Member
    3,765
    0
    Aug 9, 2007
    Greece
    Athens
    This is an English speaking community guys.
     
  8. Toni Plutonij

    Toni Plutonij *has TrolleyDave & tiny p1ngy on moderating shelf!

    Former Staff
    8,153
    314
    Dec 22, 2007
    Croatia
    Depths of Nuclear powerplant
    Listen to Noitora, please speak in english, because we are multi-national community that accepted english as speaking language..People of other nations can't understand you, so anyone who posts in other language then english after this post, will get moderated!

    Fallow the rules! [​IMG]
     
  9. psycoblaster

    psycoblaster Divine

    Member
    2,132
    2
    Jan 26, 2008
    Seoul.. (in Korea)
    NVM

    make sure the game supports additional characters.
    Try using an S-JIS font file and see if it works.
     
  10. Noitora

    Noitora ::

    Member
    3,765
    0
    Aug 9, 2007
    Greece
    Athens
    Lucky me I have a table and font mapped with Greek [​IMG]
     
  11. ninhokova

    ninhokova Newbie

    Newcomer
    5
    0
    May 30, 2008
    United States
    Im sorry, I had forgotten.
    My English is terrible!!!!!
     
  12. WeaponKnight
    OP

    WeaponKnight Newbie

    Newcomer
    8
    0
    Dec 22, 2007
    Brazil
     
  13. psycoblaster

    psycoblaster Divine

    Member
    2,132
    2
    Jan 26, 2008
    Seoul.. (in Korea)
    when dealing lz77 compression, use crystaltile2.
     
  14. Vampires

    Vampires Member

    Newcomer
    17
    0
    Mar 16, 2008
    Serbia, Republic of
    WeaponKnight, search in google for GbaDecmp for decompression (don't pack files with it) and GBACrusher for comression. Read basics about GBA lz77 to undestand how it works. (I've my own lz77 decompression C++ source code, if you know C++ I can share it with you.)
    In Layton there're 1 archive can store several txt files. So, first you need unpack file, then extract all txt's from decompressed file. Translate it, convert special chars to tags, make an archive and compress it.
     
  15. WeaponKnight
    OP

    WeaponKnight Newbie

    Newcomer
    8
    0
    Dec 22, 2007
    Brazil
    I was typing when you posted =P
    I'm learning Java. People say C++ and Java are very alike so that may help. Having the code in a language I'm at least a little familiar with would make learning LZ77 a lot easier, thank you [​IMG]

    I got GbaDecmp, and it worked like Crystaltile2, so I guess I need to learn how to extrat the txts and then how to pack them. Gonna look for GBACrusher now.

    lol I chose Layton because it seemed easy and now I'm jumping into packing and compressing files [​IMG]
    Thanks for all the help so far, guys. You all rock [​IMG]
     
  16. psycoblaster

    psycoblaster Divine

    Member
    2,132
    2
    Jan 26, 2008
    Seoul.. (in Korea)
    I made a language file for it. Ask noitora, he has it.
     
  17. Vampires

    Vampires Member

    Newcomer
    17
    0
    Mar 16, 2008
    Serbia, Republic of
    WeaponKnight, yeah, I think this two languager pretty similar.
    It's pure C++, maybe you'll need to add some header files. It's full function, so you'll just need to call it from main code. It's returning size of decompressed file.
    CODE#include

    int LZ77UnComp(LPSTR input, LPSTR output, int comOffset);
    int LZ77UnComp(LPSTR input, LPSTR output, int comOffset)
    {
    int firstByte = 0, sysByte = 0, gbaByte = 0, decByte = 0, gbaBit = 0, size = 0, readsizoff = 0, readsize = 0, offset = 0;

    FILE *lzCom, *lzDec;

    fopen_s (&lzCom, input, "rb");
    fopen_s (&lzDec, output, "wb");

    fseek (lzCom, comOffset, SEEK_SET);

    fread(&firstByte, 1, 1, lzCom);

    if (firstByte != 0x10)
    {
    fclose (lzCom);
    fclose (lzDec);
    return -1;
    }

    fread(&size, 1, 3, lzCom);

    while (1)
    {
    if (ftell(lzDec) >= size)
    {
    break;
    }
    fread(&sysByte, 1, 1, lzCom);
    for (int i = 0; i < 8; i++)
    {
    if (ftell(lzDec) >= size)
    {
    break;
    }
    gbaBit = (sysByte & 0x80) >> 7;
    sysByte = sysByte 12) + 3;
    offset = readsizoff & 0xFFF;
    offset = offset + 1;

    fseek (lzDec, ftell(lzDec) - offset, SEEK_SET);

    for (int j = 0; j < readsize; j++)
    {
    fread(&decByte, 1, 1, lzDec);
    offset = ftell(lzDec);
    fseek (lzDec, 0, SEEK_END);
    fwrite(&decByte, 1, 1, lzDec);
    fseek (lzDec, offset, SEEK_SET);
    }
    fseek (lzDec, 0, SEEK_END);
    readsizoff = 0, readsize = 0, offset = 0;
    }
    }
    sysByte = 0, gbaByte = 0, decByte = 0, gbaBit = 0, readsize = 0, offset = 0, readsizoff = 0;
    }
    fclose (lzCom);
    fclose (lzDec);
    return size;
    }
     
  18. knl

    knl I can change this?

    Member
    658
    0
    Jun 2, 2003
    Brazil
    I couldn't help but think you were being sarcastic at this point.
    I mean, come on, "fallow"?

    anyways, good luck with the translation!
     
  19. WeaponKnight
    OP

    WeaponKnight Newbie

    Newcomer
    8
    0
    Dec 22, 2007
    Brazil
    Hey there guys!

    It's been months since I last worked on this translation, but I found some tips lately and got some progress and motivation to go on =]

    Thanks to your help, I managed to decompress the LZ77 files, but got stuck after that as I didn't know what to do. After some research (especially here and the current thread) I found out how the files are organized, BUT there are still two things left:

    [​IMG]

    This is otext.pcm, in the French otext folder.
    The first line is the package file header. It's one of the things I don't know what means yet, but I'll leave that for last.

    In the second line:
    20 00 00 00 B0 00 00 00 00 00 00 00 86 00 00 00

    - A byte 0x20, which I guess means the start of a file.
    - A single byte, wich is the one I'm trying to figure out. I have no idea of what it does. In the first file it's 0xB0, then 0x90 in the second, 0xB0 again in the third and 0xA0 in the fourth file. I tried to see a pattern here but failed.
    - The last byte is the file size, no problem.

    Then, in the following line, we have the file name, and finally the data, starting at the next line and going for the size marked previously.

    My main concern now is: what does that single byte mean in each header? Any ideas?

    If anyone wants to take a look, here's the file shown in the pic.
     
  20. Vampires

    Vampires Member

    Newcomer
    17
    0
    Mar 16, 2008
    Serbia, Republic of
    It's an archive file. For example first file block start at 0x10.
    4 bytes (0x00000020) - textOffset. I think it's always will be 0x20. Beginning of the block + textOffset = beginning of the text.
    4 bytes (0x000000B0) - fileSize. Beginning of the block + fileSize = original size of this whole block.
    4 bytes (0x00000086) - textSize. Go to textOffset, read textSize = original size of the text block.

    As you can see there's nothing hard about it. It woud be easier to do it if you know any programming language.