• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
3
Years
  • Age 32
  • Seen May 19, 2021
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
 

Lunos

Random Uruguayan User
3,113
Posts
15
Years
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?
a3QtuRj.png


If you do, delete it entirely from there and try to build a ROM again.
 
5
Posts
3
Years
  • Age 32
  • Seen May 19, 2021
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.
 

Lunos

Random Uruguayan User
3,113
Posts
15
Years
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:
5
Posts
3
Years
  • Age 32
  • Seen May 19, 2021
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?
 

Lunos

Random Uruguayan User
3,113
Posts
15
Years
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