• 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.

[Pokeemerald] About the basics of Git and starting a project with the Pokeemerald-expansion

Lunos

Random Uruguayan User
3,114
Posts
15
Years
  • -Moved the instructions to solve the merge conflict at include/constants/hold_effects.h to the 6th step of the tutorial (the one in which the user pulls the item_expansion branch).
    -Added instructions to solve the merge conflict at src/battle_gfx_sfx_util.c.
    -Added extra instructions before building a ROM as changes to a battle_engine exclusive file are required in order to build one.

    As usual, if anyone sees anything wrong, please let me know.
     
    1
    Posts
    3
    Years
    • Seen May 13, 2021
    First of all, thanks for the tutorial!

    I got an error while building though.

    Any clue why?
    Spoiler:

    Maybe a wrong merge in src/pokemon.c? You mentioned merging the pokemon.c file in one of the merge spoilers in the main post, but it seems to be gone now

    Edit: Huh. Maybe I should have tried to fix the error before posting here? It was indeed a wrong merge of the src/pokemon.c file. Discarding the incoming changes seems to have fixed it. :)
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • It looks like I somehow deleted the merge conflict solutions for the src/pokemon.c file by accident. I just restored them.
    Sorry for the troubles.
     
    3
    Posts
    3
    Years
    • Seen Feb 17, 2023
    Hey firstly this guide is AWESOME thank you so much for your attention to detail and for keeping everything up to date. I really appreciate the work you did here. :)

    Second, I've run into something weird. I was able to build the ROM without errors... but when I battle my Pokemon's sprite is backwards.

    2LRBxLv.gif


    Haha while it did make me laugh, I would like to fix it. I'm assuming I messed up something while following along to your guide. I'm pretty new to this, so I wasn't sure where I may have gone wrong to make the sprites change directions though. Here is the repo built using your guide.

    Thanks again so much for this guide, it has not only gotten me off the ground with Pokemon decomps but it has also really helped me to better learn how to navigate GitHub and Git.
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Hey firstly this guide is AWESOME thank you so much for your attention to detail and for keeping everything up to date. I really appreciate the work you did here. :)

    Second, I've run into something weird. I was able to build the ROM without errors... but when I battle my Pokemon's sprite is backwards.

    2LRBxLv.gif


    Haha while it did make me laugh, I would like to fix it. I'm assuming I messed up something while following along to your guide. I'm pretty new to this, so I wasn't sure where I may have gone wrong to make the sprites change directions though. Here is the repo built using your guide.

    Thanks again so much for this guide, it has not only gotten me off the ground with Pokemon decomps but it has also really helped me to better learn how to navigate GitHub and Git.
    Check the steps involving the src/battle_gfx_sfx_util.c file again.
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Juicy news. The Master branch of the Pokeemerald-expansion repository is now a merged branch.
    Effectively, instead of being an outdated mirror of Pret's Pokeemerald, the master branch of the repository now contains the 3 feature branches: BE, IE and PE.

    What does this mean?
    It means that instead of dealing with multiple merge conflicts, newcomers can now simply use that branch as the basis for their projects, and git pull from it every now and then to update their project.

    I'll update the main post in the upcoming hours as a result, once I figure out how do I want to go about this.
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • I'll update the main post in the upcoming hours as a result, once I figure out how do I want to go about this.
    W-Well... after 20 days of completely avoiding it, it's finally here. The main post has been updated.
    If anyone spots any mistakes, please let me know.
     
    8
    Posts
    6
    Years
    • Seen Nov 22, 2022
    I can only congrats you on this outstanding tutorial and the time you dedicate to keep it update.

    I followed this tutorial months ago in order to configure my project. But now I realize there is a huge upgrade.

    Sorry for the super noob question, but which should be the easiest way to update my ongoing project? Should I create a new remote repository and redo again all the process of your updated tutorial? and then make a pull to my project?
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Sorry for the super noob question, but which should be the easiest way to update my ongoing project? Should I create a new remote repository and redo again all the process of your updated tutorial? and then make a pull to my project?
    There aren't many choices in how to handle this, so there isn't an easiest way per se.
    If your project doesn't have the feature branches, then just follow the tutorial in the main post.

    If it does though, you'll have to use git pull keyword branch, where keyword is the keyword you're tracking RHH's Pokeemerald-expansion repository with, and branch is the name of the branch you want to pull.
     
    45
    Posts
    6
    Years
    • Seen today
    when i go to make the file in pokeemerald_egg, i'm met with
    Spoiler:

    i have AGBCC installed in the directory, so i'm not sure what im missing here.
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • when i go to make the file in pokeemerald_egg, i'm met with
    Spoiler:

    i have AGBCC installed in the directory, so i'm not sure what im missing here.

    make compare is worthless when it comes to these branches. You're guaranteed to get a failed sha1 check because the ROM will not produce the same sha1 as a vanilla Pokémon Emerald ROM, which is the only one that make compare checks.

    That being said, errors related to #include <stddef.h> are normally related to a lack of agbcc.
    Are you sure that agbcc was built successfully on your end, and that you installed it in the right folder afterward (that is, pokeemerald_egg specifically)?
     
    45
    Posts
    6
    Years
    • Seen today
    i THINK i got it to set up correctly? i think i saw a few libpng errors, but it gave me the file and it seems to be running fine. thanks for this awesome tutorial, agbcc was installing in the wrong directory.

    is it normal for some things to be decapped but not everything? natures are still in caps for me (ex JOLLY)
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • i THINK i got it to set up correctly? i think i saw a few libpng errors, but it gave me the file and it seems to be running fine. thanks for this awesome tutorial, agbcc was installing in the wrong directory.

    is it normal for some things to be decapped but not everything? natures are still in caps for me (ex JOLLY)
    If you got a ROM built successfully, then you probably didn't see any actual errors.

    As for the nature names, yes, those remain uncapped now that you mention it.
    I'll bring that up for discussion in the RHH Discord server.
     
    39
    Posts
    3
    Years
    • Seen Aug 23, 2023
    Hello, thanks for the guide 🙂

    I'm wondering if there's any information on merging pret's repo with this one. I'm somewhat lost on the merge conflicts, as there're many fields now identified but may or may not be 'obsolete'?
    For example, in "include/battle.h", there's the following in "struct BattleStruct"
    Code:
        u8 field_180; // weird field, used in battle_main.c, once accessed as an array of u32 overwriting the field below
        u8 field_181;
        u8 field_182;
        u8 field_183;
        struct BattleEnigmaBerry battleEnigmaBerry;

    In pret's repository, this has been identified as a union:
    Code:
        union {
            struct LinkBattlerHeader linkBattlerHeader;
            u32 battleVideo[2];
        } multiBuffer;

    Git creates a conflict with the definitions of "struct LinkBattlerHeader" and "struct Illusion". Since "field_180" is still used in "rh-hideout/master", the proper solution should be to include both changes?

    On the other hand, I'm completely unsure how to handle this in "asm/macros/battle_scripts.inc":

    Code:
      <<<<<<< HEAD
     +	.macro setembargo ptr
      =======
    + 	.macro friendshiptodamagecalculation
      >>>>>>> 5cb8ec424764845b1cb38871586346a885601b0f
      	.byte 0xb6
     +	.4byte \ptr
      	.endm

    Another conflict in "include/pokemon_icon.h":
    Code:
     <<<<<<< HEAD
     +u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority);
     +void FreeMonIconPalette(u16 species);
     +void FreeAndDestroyMonIconSprite(struct Sprite *sprite);
     +u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality);
      =======
    + u8 CreateMonIconNoPersonality(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 handleDeoxys);
    + void FreeMonIconPalette(u16 species);
    + void FreeAndDestroyMonIconSprite(struct Sprite *sprite);
    + u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality, bool32 handleDeoxys);
      >>>>>>> 5cb8ec424764845b1cb38871586346a885601b0f

    Is the "handleDeoxys" parameter obsolete?

    I'm wondering if there's existing information on these? There're still a lot of conflicts to go through 😅
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Hello, thanks for the guide 🙂

    I'm wondering if there's any information on merging pret's repo with this one. I'm somewhat lost on the merge conflicts, as there're many fields now identified but may or may not be 'obsolete'?
    For example, in "include/battle.h", there's the following in "struct BattleStruct"
    Code:
        u8 field_180; // weird field, used in battle_main.c, once accessed as an array of u32 overwriting the field below
        u8 field_181;
        u8 field_182;
        u8 field_183;
        struct BattleEnigmaBerry battleEnigmaBerry;

    In pret's repository, this has been identified as a union:
    Code:
        union {
            struct LinkBattlerHeader linkBattlerHeader;
            u32 battleVideo[2];
        } multiBuffer;

    Git creates a conflict with the definitions of "struct LinkBattlerHeader" and "struct Illusion". Since "field_180" is still used in "rh-hideout/master", the proper solution should be to include both changes?

    On the other hand, I'm completely unsure how to handle this in "asm/macros/battle_scripts.inc":

    Code:
      <<<<<<< HEAD
     +	.macro setembargo ptr
      =======
    + 	.macro friendshiptodamagecalculation
      >>>>>>> 5cb8ec424764845b1cb38871586346a885601b0f
      	.byte 0xb6
     +	.4byte \ptr
      	.endm

    Another conflict in "include/pokemon_icon.h":
    Code:
     <<<<<<< HEAD
     +u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority);
     +void FreeMonIconPalette(u16 species);
     +void FreeAndDestroyMonIconSprite(struct Sprite *sprite);
     +u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality);
      =======
    + u8 CreateMonIconNoPersonality(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 handleDeoxys);
    + void FreeMonIconPalette(u16 species);
    + void FreeAndDestroyMonIconSprite(struct Sprite *sprite);
    + u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality, bool32 handleDeoxys);
      >>>>>>> 5cb8ec424764845b1cb38871586346a885601b0f

    Is the "handleDeoxys" parameter obsolete?

    I'm wondering if there's existing information on these? There're still a lot of conflicts to go through 😅
    RHH merges with Pret on their own, so the user simply has to pull the master branch or the 3 feature branches every once in a while and that's it.
    Because of that, this tutorial doesn't cover merging with Pret.

    If for whatever reason you want to do it by yourself and you want to get some help, you're free to open a new thread in the Decomp & Disassembly Help Section.

    To answer the question though, yes, the handleDeoxys variable was erased from the pokemon_expansion branch specifically, alongside the rest of "the Deoxys hack".
    https://github.com/rh-hideout/pokeemerald-expansion/pull/1311
     
    Last edited:
    39
    Posts
    3
    Years
    • Seen Aug 23, 2023
    I believe I'm on the latest master branch, will try pulling the other branches or wait for an update. Thanks very much! 🙂
     

    8SomaCruz

    Trying to be Something
    12
    Posts
    5
    Years
  • Hi. I'm kinda of new to everything, and was having problems with getting this to work. I'm using Msys2 on Windows 7. Everything seemed to work until I actually tried to build it. Here's the error:

    Code:
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x0): multiple definition of `gMonFrontPic_CircledQuestionMark'; src/graphics.o:(.rodata+0x3d60c): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x338): multiple definition of `gMonFrontPic_Bulbasaur'; src/graphics.o:(.rodata+0x3dbb4): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x84c): multiple definition of `gMonFrontPic_Ivysaur'; src/graphics.o:(.rodata+0x3e0c8): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0xe50): multiple definition of `gMonFrontPic_Venusaur'; src/graphics.o:(.rodata+0x3e6cc): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x181c): multiple definition of `gMonFrontPic_Charmander'; src/graphics.o:(.rodata+0x3f098): first defined here
    ...
    ... etc. for every line in anim_mon_front_pics.o
    ...
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x9255c): multiple definition of `gMonFrontPic_UnownT'; src/graphics.o:(.rodata+0x17f948): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x92800): multiple definition of `gMonFrontPic_UnownU'; src/graphics.o:(.rodata+0x17fbec): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x92b0c): multiple definition of `gMonFrontPic_UnownV'; src/graphics.o:(.rodata+0x17fef8): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x92de4): multiple definition of `gMonFrontPic_UnownW'; src/graphics.o:(.rodata+0x1801d0): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x930ac): multiple definition of `gMonFrontPic_UnownX'; src/graphics.o:(.rodata+0x180498): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x93360): multiple definition of `gMonFrontPic_UnownY'; src/graphics.o:(.rodata+0x18074c): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x93628): multiple definition of `gMonFrontPic_UnownZ'; src/graphics.o:(.rodata+0x180a14): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x938cc): multiple definition of `gMonFrontPic_UnownExclamationMark'; src/graphics.o:(.rodata+0x180cb8): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x93b50): multiple definition of `gMonFrontPic_UnownQuestionMark'; src/graphics.o:(.rodata+0x180f3c): first defined here
    make: *** [Makefile:335: pokeemerald.elf] Error 1

    I honestly have no idea what went wrong. Can someone help me?
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Hi. I'm kinda of new to everything, and was having problems with getting this to work. I'm using Msys2 on Windows 7. Everything seemed to work until I actually tried to build it. Here's the error:

    Code:
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x0): multiple definition of `gMonFrontPic_CircledQuestionMark'; src/graphics.o:(.rodata+0x3d60c): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x338): multiple definition of `gMonFrontPic_Bulbasaur'; src/graphics.o:(.rodata+0x3dbb4): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x84c): multiple definition of `gMonFrontPic_Ivysaur'; src/graphics.o:(.rodata+0x3e0c8): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0xe50): multiple definition of `gMonFrontPic_Venusaur'; src/graphics.o:(.rodata+0x3e6cc): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x181c): multiple definition of `gMonFrontPic_Charmander'; src/graphics.o:(.rodata+0x3f098): first defined here
    ...
    ... etc. for every line in anim_mon_front_pics.o
    ...
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x9255c): multiple definition of `gMonFrontPic_UnownT'; src/graphics.o:(.rodata+0x17f948): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x92800): multiple definition of `gMonFrontPic_UnownU'; src/graphics.o:(.rodata+0x17fbec): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x92b0c): multiple definition of `gMonFrontPic_UnownV'; src/graphics.o:(.rodata+0x17fef8): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x92de4): multiple definition of `gMonFrontPic_UnownW'; src/graphics.o:(.rodata+0x1801d0): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x930ac): multiple definition of `gMonFrontPic_UnownX'; src/graphics.o:(.rodata+0x180498): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x93360): multiple definition of `gMonFrontPic_UnownY'; src/graphics.o:(.rodata+0x18074c): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x93628): multiple definition of `gMonFrontPic_UnownZ'; src/graphics.o:(.rodata+0x180a14): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x938cc): multiple definition of `gMonFrontPic_UnownExclamationMark'; src/graphics.o:(.rodata+0x180cb8): first defined here
    C:\devkitPro\devkitARM\bin\arm-none-eabi-ld.exe: src/anim_mon_front_pics.o:(.rodata+0x93b50): multiple definition of `gMonFrontPic_UnownQuestionMark'; src/graphics.o:(.rodata+0x180f3c): first defined here
    make: *** [Makefile:335: pokeemerald.elf] Error 1

    I honestly have no idea what went wrong. Can someone help me?
    I really can't. I never had such weird errors before, and I don't know how to solve them, specially without knowing what exactly did you do. Sorry.

    I'll try to check later today that everything is still working normally though, as new conflicts may have been introduced since I last updated the main post after all.
    I'd suggest you to wait for me to confirm that everything is still working as intended and then start from scratch, following the instructions in the main post carefully.
     

    8SomaCruz

    Trying to be Something
    12
    Posts
    5
    Years
  • Appreciate the speedy reply. The thing that I found odd is that it only seemed to be having issues with the already existing gen 1-3 mon sprites, not the new ones. I'll keep my eye on this thread for the time being.
     
    Back
    Top