The PokéCommunity Forums Fan Games ROM Hacking
ASM & Hex How many in Pokedex?

ROM Hacking Need a helping hand? You can get help on any ROM Hacking-related problems or questions you have here.

Reply
 
Thread Tools
  #1    
Old 3 Weeks Ago (10:45 AM).
0x575446 0x575446 is offline
     
    Join Date: Sep 2018
    Posts: 3
    I'm new to ASM and ROM hacking, and because of that, I haven't quite figured out the best ways to find the information I need from the ROM. I'm using Firered as my test game since it's very heavily documented.

    I'm currently trying to write a c++ program that reads the ROM's bytes (like PGE or YAPE) and grabs the pokemon's information. Right now I'm trying to read out all of the pokemon names from 0x245EE0 to 0x2469b4. It works like it should, even running each name through the encoder/decoder that I wrote to give me ASCII.

    Here's the code I have for this part:
    Spoiler:
    void print_out_pokemon_names() {
    int pokemon_name_offset = 0x245EE0;
    int names_to_read = (0x2469b4 - pokemon_name_offset) / 11;

    fstream fstr("C:\\RomUtilsRes\\Fire Red.gba", ios::in | ios::out | ios::binary);

    fstr.seekg(pokemon_name_offset);

    for (int i = 0; i < names_to_read; i++) {
    char name[12];
    string str_name;

    fstr.read(name, 11);

    for (int j = 0; j < 11; j++) {
    string encoded = PokeEncode::Encode(name[j]); // This is the encoding/decoding class I put together.
    str_name += encoded;
    }

    cout << "\nEncoded Name: " << str_name << endl;
    }

    fstr.close();
    }

    I know that this code works but I'm kinda frustrated that I can't find any reference to where the game keeps the number of pokemon. I could set up a check to make sure that the 11 bytes never read "AC FF 00 00 00 00 00 00 00 00 00" (which is the case with the entry after CELEBI). I just think that there must be a better way. I've tried to find any information through the multitudes of forum posts, but I'm just lost now.

    Any help would be appreciated.
    Reply With Quote
      #2    
    Old 3 Weeks Ago (12:12 PM).
    0x575446 0x575446 is offline
       
      Join Date: Sep 2018
      Posts: 3
      I've found some more information.

      Using DoesntKnowHowToPlay's post on FireRed pokedex expanding, I found some in game pointers to the length of the pokedex. 0x103920 relates to the data "malloc'd" for the pokedex, 0x88ea4 relates to the pokedex count on the title screen and trainer card, and 0x104c28 relates to the count on the pokedex menu.

      All of these locations have the value 385 (0x81010000 -little endian-) which relates to the pokedex count. If I skip the beta unown locations (252-276), this allows me to read out all of the names stored at 0x245EE0.

      Sorry if this post sounds really confusing. I'm not really used to using forums.

      PS: I'm not allowed to post links until after my 5th post, so the thread I'm referencing is "[FR] Expanding The Pokedex"
      Reply With Quote
      Reply

      Quick Reply

      Join the conversation!

      Create an account to post a reply in this thread, participate in other discussions, and more!

      Create a PokéCommunity Account
      Thread Tools

      Posting Rules
      You may not post new threads
      You may not post replies
      You may not post attachments
      You may not edit your posts

      BB code is On
      Smilies are On
      [IMG] code is On
      HTML code is Off

      Forum Jump


      All times are GMT -8. The time now is 5:59 AM.