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

[TUTORIAL] Decomp - From start to finish

I've followed step by step this tutorial, but I can't get the last passage done, everytime I try to input Merge branch 'battle_engine_v2' Git says Merge:command not found, and if I try " Git Merge branch 'battle_engine_v2' " that's what it says
Spoiler:

What do I have to do?
 
You absolute legend you didnt need too do that! I'll add your edits to the tutorial and credit you, thank you so much holy shit

Your're welcome, didn't take long to do. You did miss just over half of the changes I made though :P If you quote my above message you should be able to copy/paste the edits fully. Step 12 in particular had a couple minor fixes that I didn't mention because there was a lot already.

Like I said though step 12-part 5 is removed from my post, because the conflict was unrelated to what you showed to change (they were on a different line too). Needs to be added back in, but I just let it merge over without editing, because the files (to my eyes) looked like they were just replacing old code with an updated one.
 
The discord image links in the main post are broken, please reupload them to a different site and edit the links.
 
Hi, i do everything till step 9, which give this error, ill try to do the others without this and give some other errors. +
other thing the git software dont do the compiled process whit de Lunos tutorial.
Spoiler:
 
Hi, TheRisingSean. It seems you had pictures in your tutorial, but they are not visible anymore (at least for me). Any chance you could reupload those images? Thanks a lot!
 
Hi, i do everything till step 9, which give this error, ill try to do the others without this and give some other errors. +
other thing the git software dont do the compiled process whit de Lunos tutorial.
Spoiler:

Hey, that was because I had not merged the latest pokeemerald commits. I just updated all my three repos and you should be able to merge all my stuff without any problems.
 
I think I managed to succesfully merge the three branches. However, when compiling the ROM (running 'make' in MSYS2) I get the following errors.

What's important to note is that I succesfully compiled a ROM yesterday before installing the branches. Then today I started working on these expansions and apparently something went wrong somewhere.

Spoiler:
As far as I can understand, most errors are in src/pokemon.c. I'm snipping the lines 2335-2346 below:
Spoiler:
Does anyone have an idea what caused this and how to fix this?
 
Does anyone have an idea what caused this and how to fix this?

Not sure specifically, but I feel like you might have made a mistake merging some of the files.
Code:
In file included from src/pokemon.c:40:
include/constants/abilities.h:260: warning: "ABILITIES_COUNT_GEN7" redefined
  260 | #define ABILITIES_COUNT_GEN7 234
      |
include/constants/abilities.h:257: note: this is the location of the previous definition
  257 | #define ABILITIES_COUNT_GEN7 235
This error (and the ones like it) are saying that you've defined ABILITIES_COUNT_GEN7 twice (in include/constants/abilities.h). And you've got two different definitions too, which is doubly-weird.

EDIT: The other error about "struct SpeciesItem" appears to be happening because there isn't a definition of SpeciesItem in scope. Probably a missing #include at the top of pokemon.c. You could try searching to see if a file defines "struct SpeciesItem { ... };" (stuff will be in that ... bit).
 
Last edited:
Not sure specifically, but I feel like you might have made a mistake merging some of the files.
Code:
In file included from src/pokemon.c:40:
include/constants/abilities.h:260: warning: "ABILITIES_COUNT_GEN7" redefined
  260 | #define ABILITIES_COUNT_GEN7 234
      |
include/constants/abilities.h:257: note: this is the location of the previous definition
  257 | #define ABILITIES_COUNT_GEN7 235
This error (and the ones like it) are saying that you've defined ABILITIES_COUNT_GEN7 twice (in include/constants/abilities.h). And you've got two different definitions too, which is doubly-weird.

EDIT: The other error about "struct SpeciesItem" appears to be happening because there isn't a definition of SpeciesItem in scope. Probably a missing #include at the top of pokemon.c. You could try searching to see if a file defines "struct SpeciesItem { ... };" (stuff will be in that ... bit).

Thanks for the quick response. I think I managed to fix it somehow: Looking into the files mentioned indeed revealed some clear merge conflicts or data missing. The ROM is now compiling, I'll update his post once it's completed.

I most definitely messed up with merging. I am pretty clueless when it comes to Git and Github, I admit, and have had to redo it several times, and probably something went wrong there. Perhaps I should start again from scratch for good measure, although for now it seems to work...

For the record, here's what I did:

  • There was a merge conflict in abilities.h and I had to remove the line that said "#define ABILITIES_COUNT_GEN7 234". This resolved that specific error, and for some reason also the ones referring to Altering Cave and "struct SpeciesItem"...
  • When trying again to compile, this was the output at that point:
  • Code:
    USER@COMPUTER MSYS /c/pokeemerald
    $ make -j2
    In file included from src/pokemon.c:1400:
    src/data/pokemon/level_up_learnsets.h:2: warning: "LEVEL_UP_END" redefined
        2 | #define LEVEL_UP_END (0xffff)
          |
    In file included from include/pokemon.h:4,
                     from include/global.h:520,
                     from src/pokemon.c:1:
    include/constants/pokemon.h:230: note: this is the location of the previous definition
      230 | #define LEVEL_UP_END       0xFFFF
          |
    arm-none-eabi-as -mcpu=arm7tdmi --defsym MODERN=0 -o build/emerald/src/battle_main.o build/emerald/src/battle_main.s
    arm-none-eabi-as -mcpu=arm7tdmi --defsym MODERN=0 -o build/emerald/src/title_screen.o build/emerald/src/title_screen.s
    In file included from src/pokemon.c:1402:
    src/data/pokemon/level_up_learnset_pointers.h:823: `sMeltanLevelUpLearnset' undeclared here (not in a function)
    src/data/pokemon/level_up_learnset_pointers.h:823: initializer element for `gLevelUpLearnsets[808]' is not constant
    src/data/pokemon/level_up_learnset_pointers.h:824: `sMelmetalLevelUpLearnset' undeclared here (not in a function)
    src/data/pokemon/level_up_learnset_pointers.h:824: initializer element for `gLevelUpLearnsets[809]' is not constant
    make: *** [Makefile:249: build/emerald/src/pokemon.o] Fout 1
    make: *** Wachten op onvoltooide taken...
    arm-none-eabi-as -mcpu=arm7tdmi --defsym MODERN=0 -o build/emerald/src/contest_effect.o build/emerald/src/contest_effect.s
  • Still not great, but much better. In level_up_learnset_pointers.h, it turned out that movesets for Meltan and Melmetal were missing. I manually copied and inserted the dummy movesets for these two Pokemon from DizzyEgg's repo.
  • Line 2 of level_up_learnset_pointers.h says "#define LEVEL_UP_END (0xffff)" but it should be "#define LEVEL_UP_END 0xFFFF" I believe. At least this is also how it is on DizzyEgg's repo, so I changed that too.

Fixing these things seems to have resolved these errors. The ROM is now being compiled. We'll see if it runs.

Interestingly enough, the error about "struct SpeciesItem" disappeared after tinkering with abilities.h. So I didn't do anything with that.

Update: The compilation has completed and the ROM works. I haven't tried out battle and Pokémon functionalities yet, but I am assuming there are no major problems.
 
Last edited:
in step 9 i typed "git pull EGG item expansion" and i got this message

Merge branch 'item_expansion' of ht tps://github.com/dizzyeggg/pokeemerald
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.


what should i do?
 
@Bottenham you can just accept that default message and let the merge finish. Not a Windows user, but I imagine it's as simple as closing the text editor that opened up with that message in it (note: not the command prompt itself). Possible options for that are Ctrl-X (nano), :wq (vim), or… I forget what Emacs uses.
 
[PokeCommunity.com] [TUTORIAL] Decomp - From start to finish
 
So I'm having some trouble... It might be really obvious, but I can't seem to figure out the problem.

So after following the compiler instrctions from Lunos I get this when running the "make -j4" command:

$ make -j4
/bin/bash: tools/agbcc/bin/agbcc.exe: No such file or directory
arm-none-eabi-as -mcpu=arm7tdmi --defsym MODERN=0 -o build/emerald/src/item_menu.o src/item_menu.s
/bin/bash: tools/agbcc/bin/agbcc.exe: No such file or directory
Assembler messages:
Error: can't open src/item_menu.s for reading: No such file or directory
make: *** [Makefile:276: build/emerald/src/item_menu.o] Error 1
make: *** Venter på uafsluttede job....
make: *** [Makefile:253: build/emerald/src/battle_anim_ground.o] Error 127
make: *** [Makefile:253: build/emerald/src/battle_setup.o] Error 127
In file included from include/gba/gba.h:4,
from src/agb_flash.c: 1 :
include/gba/defines.h: 4 : 10 : fatal error: stddef.h: No such file or directory
4 | #include <stddef.h>
| ^~~~~~~~~~
compilation terminated.
In file included from include/gba/gba.h:4,
from src/rtc.c: 1 :
include/gba/defines.h: 4 : 10 : fatal error: stddef.h: No such file or directory
4 | #include <stddef.h>
| In file included from ^~~~~~~~~~include/gba/gba.h:4
c,
from src/agb_flash_le.c:1m:
p linclude/gba/defines.h: 4 : 10 :at i nfatal error: terstddef.h: No such file or directory
4 | #include mina <stddef.h>d.
|
^~~~~~~~~~
compilation terminated.
In file included from include/gba/gba.h:4make[2]: *** [Makefile: 151 : build/src/agb_flash.o] Error 1
,
from make[2]: *** Venter på uafsluttede job....
src/main.c: 1 :
include/gba/defines.h: 4 : 10 : fatal error: stddef.h: No such file or directory
4 | #include <stddef.h>
| ^~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:151: build/src/main.o] Error 1
make[2]: *** [Makefile:151: build/src/agb_flash_le.o] Error 1
make[2]: *** [Makefile:151: build/src/rtc.o] Error 1
make[1]: *** [Makefile:169: payload] Error 2
make: *** [Makefile:332: berry_fix] Error 2

The problem seems to be in the fact that it can't find "stddef.h" for some reason.

EDIT: I placed some spaces here and there to not show emojies.
 
Last edited:
Pretty sure that happens when you don't have agbcc installed in your repository/Pokeemerald folder.

Yeah, I figured. Doesn't matter too much tho since I get a plethora of compiler errors :/
But thank you for your help! :)

To anyone reading this:

Does anyone coincidentally have a repo that is fully merged with all 3 branches on thier GitHub with no compiler errors that I can fork, clone and then compile? I won't have the time to look at the whole thing for quite a while after today, so it wóuld be really nice.
 
Yeah, I figured. Doesn't matter too much tho since I get a plethora of compiler errors :/
But thank you for your help! :)

To anyone reading this:

Does anyone coincidentally have a repo that is fully merged with all 3 branches on thier GitHub with no compiler errors that I can fork, clone and then compile? I won't have the time to look at the whole thing for quite a while after today, so it wóuld be really nice.

I do, but the folder /tools/agbcc is not synchronized with Github, so it won't be of much help for. In general, also, I don't think that's the best way to go about it anyway, as it may make it harder for you to keep everything up to date in the future.

(Setting everything up is pretty frustrating, but once you go through it, and try to understand why errors are given, it makes it much easier to go from there.)
 
I do, but the folder /tools/agbcc is not synchronized with Github, so it won't be of much help for. In general, also, I don't think that's the best way to go about it anyway, as it may make it harder for you to keep everything up to date in the future.

(Setting everything up is pretty frustrating, but once you go through it, and try to understand why errors are given, it makes it much easier to go from there.)

Man, thank you so much!
I owe you one ! :D

Alright, so I felt like I had to explain (sorry for the semi-wall of text):
Even though I'm studying game design, I'm really not good at it. Not to mention that our programming teacher isn't that great.
Well, I found out that pokeemerald was a thing quite a while ago, however I was just excited for more complex rom hacks.
I at some point sumpled upon DizzyEgg's expansions and I felt in love. These features was everything I ever wanted in a vanilla pokemon GBA game.
Howver, I couldn't find a rom hack vanilla enough with these additions to my taste, so I decided, "hell, I'll do it myself".
My plan with this whole thing was to have a one-time setup of a rom hack, that I would play on my PSP on the go etc.
The real problem was when I got so many problems when compiling and such.
I asked if someone by any chance had a completed version, and you did!
You're right in your statement above, it really isn't the best way to go about it, and so I've decided that I will use yours to compare with my own, so I can see where I mess up.
Thank you once again man :)

I'm not quite sure if these pokemon are fully programmed in, but...
Even though you could've easily done it yourself, I made the levelup learnsets for Lycanroc Midnight, Dusk, Meltan, and Melmetal. I feel like it was the least I could do.
Note: Double Iron Bash on Melmetal was commented out because it wasn't a programmed move.
Enjoy :)

static const struct LevelUpMove sMeltanLevelUpLearnset[] = {
LEVEL_UP_MOVE( 1, MOVE_HEADBUTT),
LEVEL_UP_MOVE( 1, MOVE_HARDEN),
LEVEL_UP_MOVE( 9, MOVE_TAIL_WHIP),
LEVEL_UP_MOVE( 18, MOVE_THUNDER_WAVE),
LEVEL_UP_MOVE( 27, MOVE_THUNDER_SHOCK),
LEVEL_UP_MOVE( 36, MOVE_ACID_ARMOR),
LEVEL_UP_MOVE( 45, MOVE_FLASH_CANNON),
LEVEL_UP_END
};

static const struct LevelUpMove sMelmetalLevelUpLearnset[] = {
LEVEL_UP_MOVE( 1, MOVE_THUNDER_PUNCH),
LEVEL_UP_MOVE( 1, MOVE_HEADBUTT),
LEVEL_UP_MOVE( 1, MOVE_HARDEN),
LEVEL_UP_MOVE( 1, MOVE_TAIL_WHIP),
LEVEL_UP_MOVE( 1, MOVE_THUNDER_WAVE),
LEVEL_UP_MOVE( 9, MOVE_TAIL_WHIP),
LEVEL_UP_MOVE( 18, MOVE_THUNDER_WAVE),
LEVEL_UP_MOVE( 27, MOVE_THUNDER_SHOCK),
LEVEL_UP_MOVE( 36, MOVE_ACID_ARMOR),
LEVEL_UP_MOVE( 45, MOVE_FLASH_CANNON),
LEVEL_UP_MOVE( 54, MOVE_MEGA_PUNCH),
LEVEL_UP_MOVE( 63, MOVE_PROTECT),
//LEVEL_UP_MOVE( 72, MOVE_DOUBLE_IRON_BASH),
LEVEL_UP_MOVE( 81, MOVE_SUPERPOWER),
LEVEL_UP_MOVE( 90, MOVE_HYPER_BEAM),
LEVEL_UP_END
};

static const struct LevelUpMove sLycanrocMidnightLevelUpLearnset[] = {
LEVEL_UP_MOVE( 1, MOVE_COUNTER),
LEVEL_UP_MOVE( 1, MOVE_REVERSAL),
LEVEL_UP_MOVE( 1, MOVE_TAUNT),
LEVEL_UP_MOVE( 1, MOVE_TACKLE),
LEVEL_UP_MOVE( 1, MOVE_LEER),
LEVEL_UP_MOVE( 1, MOVE_SAND_ATTACK),
LEVEL_UP_MOVE( 1, MOVE_BITE),
LEVEL_UP_MOVE( 4, MOVE_SAND_ATTACK),
LEVEL_UP_MOVE( 7, MOVE_BITE),
LEVEL_UP_MOVE( 12, MOVE_HOWL),
LEVEL_UP_MOVE( 15, MOVE_ROCK_THROW),
LEVEL_UP_MOVE( 18, MOVE_ODOR_SLEUTH),
LEVEL_UP_MOVE( 23, MOVE_ROCK_TOMB),
LEVEL_UP_MOVE( 26, MOVE_ROAR),
LEVEL_UP_MOVE( 29, MOVE_STEALTH_ROCK),
LEVEL_UP_MOVE( 34, MOVE_ROCK_SLIDE),
LEVEL_UP_MOVE( 37, MOVE_SCARY_FACE),
LEVEL_UP_MOVE( 40, MOVE_CRUNCH),
LEVEL_UP_MOVE( 45, MOVE_ROCK_CLIMB),
LEVEL_UP_MOVE( 48, MOVE_STONE_EDGE),
LEVEL_UP_END
};

static const struct LevelUpMove sLycanrocDuskLevelUpLearnset[] = {
LEVEL_UP_MOVE( 1, MOVE_THRASH),
LEVEL_UP_MOVE( 1, MOVE_ACCELEROCK),
LEVEL_UP_MOVE( 1, MOVE_COUNTER),
LEVEL_UP_MOVE( 1, MOVE_TACKLE),
LEVEL_UP_MOVE( 1, MOVE_LEER),
LEVEL_UP_MOVE( 1, MOVE_SAND_ATTACK),
LEVEL_UP_MOVE( 1, MOVE_BITE),
LEVEL_UP_MOVE( 4, MOVE_SAND_ATTACK),
LEVEL_UP_MOVE( 7, MOVE_BITE),
LEVEL_UP_MOVE( 12, MOVE_HOWL),
LEVEL_UP_MOVE( 15, MOVE_ROCK_THROW),
LEVEL_UP_MOVE( 18, MOVE_ODOR_SLEUTH),
LEVEL_UP_MOVE( 23, MOVE_ROCK_TOMB),
LEVEL_UP_MOVE( 26, MOVE_ROAR),
LEVEL_UP_MOVE( 29, MOVE_STEALTH_ROCK),
LEVEL_UP_MOVE( 34, MOVE_ROCK_SLIDE),
LEVEL_UP_MOVE( 37, MOVE_SCARY_FACE),
LEVEL_UP_MOVE( 40, MOVE_CRUNCH),
LEVEL_UP_MOVE( 45, MOVE_ROCK_CLIMB),
LEVEL_UP_MOVE( 48, MOVE_STONE_EDGE),
LEVEL_UP_END
 
Last edited:
Its pokemon emerald in its full completion? Noob doesn't know the languages and is watching wiseowl on youtube. what is?
 
Last edited:
Back
Top