Help with poketext source

Discussion in 'NDS - ROM Hacking and Translations' started by upbumpo190, Oct 27, 2008.

Oct 27, 2008

Help with poketext source by upbumpo190 at 8:25 PM (1,889 Views / 0 Likes) 8 replies

  1. upbumpo190
    OP

    Member upbumpo190 GBAtemp Regular

    Joined:
    Jun 9, 2007
    Messages:
    168
    Location:
    The 5th dimension
    Country:
    France
    Well, I've been playing around with poketext.cpp and managed to get it right, almost...

    When I compile I get one error,

    1>e:\documents and settings\christian\desktop\poketextsrc\poketext.cpp(145) : fatal error C1075: end of file found before the left brace '{' at 'e:\documents and settings\christian\desktop\poketextsrc\poketext.cpp(69)' was matched

    I'm using Visual C++ Express Edition.


    Here is the code, if anyone could tell me what I did wrong... any help is appreciated.

    CODE
    // PokeText PokemonDP text decrypter
    // Â 2006-2006 loadingNOW
    // table and unicode help ZhenLin
    // this is released under GPLv2

    typedef unsigned char u8;
    typedef unsigned short u16;
    typedef unsigned int u32;

    #include
    #include
    #include "japhtml.h"

    typedef struct stringdata{
    u32 Ptr;
    u32 chars;
    }SD;

    void DecyptPtrs(u32 count, u16 key, SD *sdptr)
    {
    key = key * 0x2FD;

    for(int i=1; iPtr, (sdptr+i)->chars);
    DecyptTxt((sdptr+i)->chars, i+1, data16+(((sdptr+i)->Ptr)/2), fpout);
    fprintf(fpout, "");

    }
    fprintf(fpout, "");

    fclose(fpout);

    sprintf(filename, "unenc\\%03d.bin", j);
    fpout = fopen(filename, "wb");
    fwrite(data16, 1, sze, fpout);
    fclose(fpout);

    free(data16);
    //free(data32);

    fp=fopen("dec.dat", "rb");
    fread(data16, 1, sze, fpout); // read decrypted binary file
    fclose(fp);

    for(int i=0; ichars, i+1, data16+(((sdptr+i)->Ptr)/2), fpout); // encrypte Txt
    DecyptPtrs(*data16, *(data16+1), sdptr); // and ptrs

    fpout = fopen("enc.dat", "wb");
    fwrite(data16, 1, sze, fpout);
    fclose(fpout);

    }


    Thanks
     
  2. DarkRey

    Member DarkRey still transfoooorming.... with sum lags!

    Joined:
    Mar 9, 2007
    Messages:
    983
    Location:
    Rotating around Toni
    Country:
    Croatia
    is this websta's( forgot his name) pokedex? didn't know he released his source.
    do u have every file in the right folders like graphics and other files.

    if you want help i would suggest to go to palib website and asked them
    or ask websta.
     
  3. ds22

    Member ds22 GBAtemp Regular

    Joined:
    Sep 27, 2008
    Messages:
    269
    Location:
    Rotterdam NL
    Country:
    Netherlands
    see bold sign at //free(data32) i added
    it worked for me [​IMG]
    EDIT:but the program stopt at 623.bin [​IMG]
     
  4. upbumpo190
    OP

    Member upbumpo190 GBAtemp Regular

    Joined:
    Jun 9, 2007
    Messages:
    168
    Location:
    The 5th dimension
    Country:
    France
    I tried adding the brace where you said to.
    But it spit out more errors than before. What compiler are you using? Or maybe there is another solution to the fatal error...?
     
  5. ds22

    Member ds22 GBAtemp Regular

    Joined:
    Sep 27, 2008
    Messages:
    269
    Location:
    Rotterdam NL
    Country:
    Netherlands
    Microsoft Visual Studio 9.0 C++
     
  6. Normmatt

    Member Normmatt Former AKAIO Programmer

    Joined:
    Dec 14, 2004
    Messages:
    2,135
    Country:
    New Zealand
     
  7. upbumpo190
    OP

    Member upbumpo190 GBAtemp Regular

    Joined:
    Jun 9, 2007
    Messages:
    168
    Location:
    The 5th dimension
    Country:
    France
    Thanks for the help everyone, it compiled with added braces. But won't launch, nor decrypt/encrypt the text files. Oh well, I can always wait till 2009 for the official translation. [​IMG]

    Chris
     
  8. ds22

    Member ds22 GBAtemp Regular

    Joined:
    Sep 27, 2008
    Messages:
    269
    Location:
    Rotterdam NL
    Country:
    Netherlands
    [​IMG] on mine computer it worked just fine
    i can check it for you if you still want [​IMG]
    EDIT:the source code i used.

    CODE// PokeText PokemonDP text decrypter
    // Â 2006-2006 loadingNOW
    // table and unicode help ZhenLin
    // this is released under GPLv2

    typedef unsigned char u8;
    typedef unsigned short u16;
    typedef unsigned int u32;

    #include
    #include
    #include "japhtml.h"

    typedef struct stringdata{
    u32 Ptr;
    u32 chars;
    }SD;

    void DecyptPtrs(u32 count, u16 key, SD *sdptr)
    {
    key = key * 0x2FD;

    for(int i=1; iPtr, (sdptr+i)->chars);
    DecyptTxt((sdptr+i)->chars, i+1, data16+(((sdptr+i)->Ptr)/2), fpout);
    fprintf(fpout, "");

    }
    fprintf(fpout, "");

    fclose(fpout);

    sprintf(filename, "unenc\\%03d.bin", j);
    fpout = fopen(filename, "wb");
    fwrite(data16, 1, sze, fpout);
    fclose(fpout);

    free(data16);
    //free(data32);
    }


    /*

    Scramle File again this code would work
    fp=fopen("dec.dat", "rb");
    fread(data16, 1, sze, fpout); reed decrypted binary file
    fclose(fp);

    for(int i=0; ichars, i+1, data16+(((sdptr+i)->Ptr)/2), fpout); encrypte Txt
    DecyptPtrs(*data16, *(data16+1), sdptr); and ptrs

    fpout = fopen("enc.dat", "wb");
    fwrite(data16, 1, sze, fpout);
    fclose(fpout); */

    }
     
  9. PokemonHaker94

    Member PokemonHaker94 GBAtemp Regular

    Joined:
    Oct 18, 2008
    Messages:
    122
    Location:
    NY City
    Country:
    United States
    why don't you make a video Tutorial?? it would be much easirer to explan that way
     

Share This Page