• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Solved] Enabling National Pokédex by default in Fire Red

  • 37
    Posts
    1
    Years
    • Seen Apr 6, 2025
    I've getting into decomp hacking due to the more options and fewer technical issues (like pointers and memory spaces and all that).

    The first major change I want to work on is having encounters include Johto Pokémon (like the second half of Gen II). So, the National 'Dex is needed from the start.

    I found the following chunk of code in src/event_data.c . I assume this would be what I want to change.
    C-like:
    // Unused
    static void DisableNationalPokedex_RSE(void)
    {
        u16 *ptr = GetVarPointer(VAR_0x403C);
        gSaveBlock2Ptr->pokedex.unused = 0;
        *ptr = 0;
        FlagClear(FLAG_0x838);
    }
    
    // The magic numbers used here (0xDA and 0x0302) correspond to those
    // used in RSE for enabling the national Pokedex
    void EnableNationalPokedex_RSE(void)
    {
        // Note: the var, struct member, and flag are never used
        u16 *ptr = GetVarPointer(VAR_0x403C);
        gSaveBlock2Ptr->pokedex.unused = 0xDA;
        *ptr = 0x0302;
        FlagSet(FLAG_0x838);
    }
    
    // Unused
    static bool32 IsNationalPokedexEnabled_RSE(void)
    {
        if (gSaveBlock2Ptr->pokedex.unused == 0xDA
                && VarGet(VAR_0x403C) == 0x0302
                && FlagGet(FLAG_0x838))
            return TRUE;
    
        return FALSE;
    }
    
    void DisableNationalPokedex(void)
    {
        u16 *nationalDexVar = GetVarPointer(VAR_NATIONAL_DEX);
        gSaveBlock2Ptr->pokedex.nationalMagic = 0;
        *nationalDexVar = 0;
        FlagClear(FLAG_SYS_NATIONAL_DEX);
    }
    
    void EnableNationalPokedex(void)
    {
        u16 *nationalDexVar = GetVarPointer(VAR_NATIONAL_DEX);
        gSaveBlock2Ptr->pokedex.nationalMagic = 0xB9;
        *nationalDexVar = 0x6258;
        FlagSet(FLAG_SYS_NATIONAL_DEX);
    }
    
    bool32 IsNationalPokedexEnabled(void)
    {
        if (gSaveBlock2Ptr->pokedex.nationalMagic == 0xB9
                && VarGet(VAR_NATIONAL_DEX) == 0x6258
                && FlagGet(FLAG_SYS_NATIONAL_DEX))
            return TRUE;
    
        return FALSE;
    While I'm not entirely clueless on what to try, I would like some advice to help familiarize myself with this. Also, is this all I'd have to change to enable non-Kanto 'Mons to evolve from the start?
     
    Just so we're clear here, you don't need to enable the National Dex to have Johto 'mons, you could just include them in your game's Kanto Dex.
    But anyway, if you want to enable the National Pokédex from the get go, you don't need to jump into the deeper parts of the codebase. You could just throw in a special EnableNationalPokedex right after setflag FLAG_SYS_POKEDEX_GET in PalletTown_ProfessorOaksLab_EventScript_ReceiveDexScene at data/maps/PalletTown_ProfessorOaksLab/scripts.inc and call it a day.
     
    Just so we're clear here, you don't need to enable the National Dex to have Johto 'mons, you could just include them in your game's Kanto Dex.
    But anyway, if you want to enable the National Pokédex from the get go, you don't need to jump into the deeper parts of the codebase. You could just throw in a special EnableNationalPokedex right after setflag FLAG_SYS_POKEDEX_GET in PalletTown_ProfessorOaksLab_EventScript_ReceiveDexScene at data/maps/PalletTown_ProfessorOaksLab/scripts.inc and call it a day.
    That's a lot simpler than I ever would have guessed possible. Though, to be fair, I don't know much yet about scripts, but I do have experience in coding, which is why I was combing through those files.

    So, just for clarity's sake, it should look like this?
    Code:
        message PalletTown_ProfessorOaksLab_Text_ReceivedPokedexFromOak
        waitmessage
        waitfanfare
        call EventScript_RestorePrevTextColor
        setflag FLAG_SYS_POKEDEX_GET
        special EnableNationalPokedex
        special SetUnlockedPokedexFlags
        setvar VAR_MAP_SCENE_POKEMON_CENTER_TEALA, 1
        msgbox PalletTown_ProfessorOaksLab_Text_OakCatchMonsForDataTakeThese
     
    That's a lot simpler than I ever would have guessed possible. Though, to be fair, I don't know much yet about scripts, but I do have experience in coding, which is why I was combing through those files.

    So, just for clarity's sake, it should look like this?
    Code:
        message PalletTown_ProfessorOaksLab_Text_ReceivedPokedexFromOak
        waitmessage
        waitfanfare
        call EventScript_RestorePrevTextColor
        setflag FLAG_SYS_POKEDEX_GET
        special EnableNationalPokedex
        special SetUnlockedPokedexFlags
        setvar VAR_MAP_SCENE_POKEMON_CENTER_TEALA, 1
        msgbox PalletTown_ProfessorOaksLab_Text_OakCatchMonsForDataTakeThese
    Yup.
     
    Back
    Top