• 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✓] LMA overlap in pokeemerald.map

  • 2
    Posts
    3
    Years
    • Seen Jan 26, 2022
    Hello.

    When I try to add a new overworld object, a new script, a new C function, or a new Pokémon cry to my Emerald Rom hack (decomp), the compiler gives this error:
    (It won't let me upload the screenshot, so I'm just going to write the message out):

    cd build/emerald && arm-none-eabi-ld -Map ../../pokeemerald.map -T ld_script.ld -o ../../pokeemerald.elf <objects> <lib>
    arm-none-eabi-ld: section anim_mon_front_pic_data LMA [0000000008b00000, 0000000008bb8f4b] overlaps section other_data LMA [0000000008ad1d70, 0000000008b00a43]
    Makefile:424: recipe for target 'pokeemerald.elf' failed

    It appears that adding anything that comes before other_data in pokeemerald.map will push other_data into overlap.

    I should note that I have already added quite a bit to the Rom (more Pokémon, later gen moves, maps, scripts, functions, etc.), but not an excessive amount. Other Rom hacks have certainly added more than I have (all the later gen Pokémon for example, while I've added just 30 or so.)
    However, judging by the error, I seem to be up against some sort of limit that I'm not aware of. Simply adding a new function to src/field_specials.c or declaring a new graphics label in src/data/object_events/object_event_graphics.h is enough to cause the error.

    Now the issue appears to be coming from pokeemerald.map. After adding a new graphics label to the aforementioned object_event_graphics.h and attempting to compile, the first change in pokeemerald.map is on line 23996. (I will note changes with "->")
    .rodata 0x0000000008336280 0x6f3c4c /*-> 0x6f464c*/
    src/main.o(.rodata)

    Then on line 26496
    .rodata 0x000000000852e614 0x78710 /*-> 0x79110*/ src/event_object_movement.o

    On line 26787
    0x000000000858d858 gFieldEffectObjectPic_SurfBlob
    0x000000000858de58 gObjectEventPic_QuintyPlump
    /*0x000000000858d858 is taken by the new label, pushing SurfBlob down to 0x000000000858e258, and QuintyPlump is likewise pushed down to 0x000000000858e858.*/

    What follows is a domino effect of thousands of shifted addresses, leading to other_data, which is pushed into overlapping anim_mon_front_pic_data, and thus the error. Like I mentioned earlier, this domino effect is also set off by adding a new cry, script, or function (certain other things, like new Pokemon battle sprites, are slotted in after other_data, so adding those doesn't cause the overlap). This is what it looks like:

    other_data 0x0000000008ad1300 /*-> 0x0000000008ad1d00*/ 0x2ecd4
    /*snipped. It's data related to "unknown serial data," the berry glitch fix, and Pokemon Colosseum*/
    0x0000000008afffd4 /*-> 0x0000000008b009d4*/ gMultiBootProgram_PokemonColosseum_End

    anim_mon_front_pic_data
    0x0000000008b00000 0xb8f4c /*no change*/

    The address changes stop at the other_data section, meaning anim_mon_front_pic_data doesn't "get out of the way" so to speak. That appears to be the problem. There are other changes later on, but those don't seem relevant (although feel free to ask for me to post them if they are relevant somehow).

    I will admit that, while I may be able to identify the issue, I lack the skill or knowledge to fix it (I'm new to programming). So that's why I'm posting this here. Have I really filled the game to its limit? I doubt it. I haven't added that much to the game compared to other Rom hacks, unless I'm underestimating something. Or is something else going wrong?
    I appreciate any help.
     
    Last edited:
    Hello.

    When I try to add a new overworld object, a new script, a new C function, or a new Pokémon cry to my Emerald Rom hack (decomp), the compiler gives this error:
    (It won't let me upload the screenshot, so I'm just going to write the message out):

    cd build/emerald && arm-none-eabi-ld -Map ../../pokeemerald.map -T ld_script.ld -o ../../pokeemerald.elf <objects> <lib>
    arm-none-eabi-ld: section anim_mon_front_pic_data LMA [0000000008b00000, 0000000008bb8f4b] overlaps section other_data LMA [0000000008ad1d70, 0000000008b00a43]
    Makefile:424: recipe for target 'pokeemerald.elf' failed

    It appears that adding anything that comes before other_data in pokeemerald.map will push other_data into overlap.

    I should note that I have already added quite a bit to the Rom (more Pokémon, later gen moves, maps, scripts, functions, etc.), but not an excessive amount. Other Rom hacks have certainly added more than I have (all the later gen Pokémon for example, while I've added just 30 or so.)
    However, judging by the error, I seem to be up against some sort of limit that I'm not aware of. Simply adding a new function to src/field_specials.c or declaring a new graphics label in src/data/object_events/object_event_graphics.h is enough to cause the error.

    Now the issue appears to be coming from pokeemerald.map. After adding a new graphics label to the aforementioned object_event_graphics.h and attempting to compile, the first change in pokeemerald.map is on line 23996. (I will note changes with "->")
    .rodata 0x0000000008336280 0x6f3c4c /*-> 0x6f464c*/
    src/main.o(.rodata)

    Then on line 26496
    .rodata 0x000000000852e614 0x78710 /*-> 0x79110*/ src/event_object_movement.o

    On line 26787
    0x000000000858d858 gFieldEffectObjectPic_SurfBlob
    0x000000000858de58 gObjectEventPic_QuintyPlump
    /*0x000000000858d858 is taken by the new label, pushing SurfBlob down to 0x000000000858e258, and QuintyPlump is likewise pushed down to 0x000000000858e858.*/

    What follows is a domino effect of thousands of shifted addresses, leading to other_data, which is pushed into overlapping anim_mon_front_pic_data, and thus the error. Like I mentioned earlier, this domino effect is also set off by adding a new cry, script, or function (certain other things, like new Pokemon battle sprites, are slotted in after other_data, so adding those doesn't cause the overlap). This is what it looks like:

    other_data 0x0000000008ad1300 /*-> 0x0000000008ad1d00*/ 0x2ecd4
    /*snipped. It's data related to "unknown serial data," the berry glitch fix, and Pokemon Colosseum*/
    0x0000000008afffd4 /*-> 0x0000000008b009d4*/ gMultiBootProgram_PokemonColosseum_End

    anim_mon_front_pic_data
    0x0000000008b00000 0xb8f4c /*no change*/

    The address changes stop at the other_data section, meaning anim_mon_front_pic_data doesn't "get out of the way" so to speak. That appears to be the problem. There are other changes later on, but those don't seem relevant (although feel free to ask for me to post them if they are relevant somehow).

    I will admit that, while I may be able to identify the issue, I lack the skill or knowledge to fix it (I'm new to programming). So that's why I'm posting this here. Have I really filled the game to its limit? I doubt it. I haven't added that much to the game compared to other Rom hacks, unless I'm underestimating something. Or is something else going wrong?
    I appreciate any help.

    You need to change these two lines at the start of ld_script.txt (or get rid of them like the comment above them states).
     
    It works! Thanks so much, you're a life saver. I'm glad it was just my lack of experience getting in the way.
     
    Back
    Top