• 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 Trading Card Game 2 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.

[Other] Battle_Engine - Problem with "unknown_table.h"

  • 5
    Posts
    4
    Years
    • Seen Jul 21, 2024
    Hi,

    I pulled the "battle_engine"-branch of RHH for my Pokeemerald and ended up with the new file "unknown_table.h" that now contains the entries of the "sUnused"-array in src/data.c. The problem is, that i can´t compile anymore without getting the errors
    "duplicate array index in initializer for `sUnused'" and "duplicate initializer for `sUnused'"

    I´m not an expert in C, but i guess it would be fixable by changing the indexes of the entries, but is that really the solution? The change wouldn´t have been made without checking if everything stills works right? Can someome give me a hint how to handle this without changing the files which will be changed/added with the next pull again?

    Thanks in advance
     
    Hi,

    I pulled the "battle_engine"-branch of RHH for my Pokeemerald and ended up with the new file "unknown_table.h" that now contains the entries of the "sUnused"-array in src/data.c. The problem is, that i can´t compile anymore without getting the errors
    "duplicate array index in initializer for `sUnused'" and "duplicate initializer for `sUnused'"

    I´m not an expert in C, but i guess it would be fixable by changing the indexes of the entries, but is that really the solution? The change wouldn´t have been made without checking if everything stills works right? Can someome give me a hint how to handle this without changing the files which will be changed/added with the next pull again?

    Thanks in advance
    The first thing I can think of is that you may have the array sUnused in 2 different locations.
    Can you check if you have sUnused in your src/data.c file?
    [PokeCommunity.com] Battle_Engine - Problem with "unknown_table.h"


    If you do, delete it entirely from there and try to build a ROM again.
     
    Hi,

    thanks for your answer. "sUnused" does not exist in data.c and the "unknown_table.h" is only used there, so other appearances of an "sUnused" somewhere in the code shouldn´t be a problem right? I also cleaned and rebuilt the ROM again but the error still remains.
     
    Hi,

    thanks for your answer. "sUnused" does not exist in data.c and the "unknown_table.h" is only used there, so other appearances of an "sUnused" somewhere in the code shouldn´t be a problem right? I also cleaned and rebuilt the ROM again but the error still remains.
    Having one same array defined and laid out in 2 different places at the same time would definitely be a problem.
    I'd suggest to use git grep "sUnused", but you're likely to get multiple results since there's multiple arrays labelled as "sUnused".

    You could probably just delete the src/data/pokemon_graphics/unknown_table.h file and any lines that try to #include said file just fine, since it's all unused data that will soon be removed from the pokemon_expansion anyway.
     
    Last edited:
    Hi,

    I deleted the file and the include and got afterwards 2 new errors:
    undefined reference to `HandleLoadSpecialPokePic_DontHandleDeoxys'
    undefined reference to `HandleLoadSpecialPokePic_2'

    Both occured in "src/pokemon_summary_screen.c". I renamed the "HandleLoadSpecialPokePic_2" to "HandleLoadSpecialPokePic" (this one already exists) and implemented a dummy for "HandleLoadSpecialPokePic_DontHandleDeoxys" in "decompress.c" (it just calls the normal function "HandleLoadSpecialPokePic"). For the moment it now compiles and seems to work. Is it maybe possible that some personal changes of someone slipped in?
     
    Hi,

    I deleted the file and the include and got afterwards 2 new errors:
    undefined reference to `HandleLoadSpecialPokePic_DontHandleDeoxys'
    undefined reference to `HandleLoadSpecialPokePic_2'

    Both occured in "src/pokemon_summary_screen.c". I renamed the "HandleLoadSpecialPokePic_2" to "HandleLoadSpecialPokePic" (this one already exists) and implemented a dummy for "HandleLoadSpecialPokePic_DontHandleDeoxys" in "decompress.c" (it just calls the normal function "HandleLoadSpecialPokePic"). For the moment it now compiles and seems to work. Is it maybe possible that some personal changes of someone slipped in?

    It's extremely weird that you had to change calls to those functions in src/pokemon_summary_screen.c manually, unless it's code that you wrote on your own.
    But yeah, those functions were modified during the removal of the Deoxys hack in the pokemon_expansion branch, so if you're using it, it's normal.
     
    Last edited:
    Back
    Top