• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

Code: [EM] Dizzy's Hacked Engine

794
Posts
10
Years
I'm amazed this isn't getting more attention, what you've done here (and with all your other Emerald works) is incredible, I'm having a lot of fun just adding them all to a ROM and messing around. One question though, how do you actually reuse the old dex flags after expanding Pokemon? Is there an existing way to check them, or would I need to write a new routine to do so? I realize it's probably not even necessary to use them (seeing as your flag check script finds over 300 unused flags, which is more than enough), but it'd be nice to have the option on the off chance that some of them do turn out to be used somewhere.

It might also be worth adding the flag and var expansion feature to the list in the OP, I could see it being very useful for a lot of people.

Thanks for the kind words.

And yeah I forgot to include that one feature in the OP. I'm going to do that soon. Here's how it works:

For flags you have the old ones that use space in the old saveblock: 0x0 - 0x95F
The number you specify in the 'NoOfNewFlags' refers to the flags in the saveblock. Those are 0x960 - 0x1FFF
Old dex flags' range is 0x2000 - 0x2660. Those flags are only used for checking whether a pokemon was seen/caught, so expanding pokedex automatically frees them. If you Set 'ReuseOldDexFlags' as true you won't have to write anything, you can just use a flag in that range(say 0x2100). Those are perfectly free to use after you expand pokemon.

The vars are much simpler. The new ones start right after the old ones, so 0x5000 is the first new var. You specify the number of vars in the build.py file.
 
1,591
Posts
10
Years
  • Age 30
  • Seen Mar 20, 2024
Thanks for the kind words.

And yeah I forgot to include that one feature in the OP. I'm going to do that soon. Here's how it works:

For flags you have the old ones that use space in the old saveblock: 0x0 - 0x95F
The number you specify in the 'NoOfNewFlags' refers to the flags in the saveblock. Those are 0x960 - 0x1FFF
Old dex flags' range is 0x2000 - 0x2660. Those flags are only used for checking whether a pokemon was seen/caught, so expanding pokedex automatically frees them. If you Set 'ReuseOldDexFlags' as true you won't have to write anything, you can just use a flag in that range(say 0x2100). Those are perfectly free to use after you expand pokemon.

The vars are much simpler. The new ones start right after the old ones, so 0x5000 is the first new var. You specify the number of vars in the build.py file.

Thanks for the quick reply! Good to know they're so straightforward to use. I don't think I'll ever need to expand the flags with so many freed up, but it is nice to have the option.

Just to clarify, if the new vars start right after the old ones, does that mean they're also stored in the old saveblock? If so, does that significantly limit the number of new vars you can add?
 
794
Posts
10
Years
Just to clarify, if the new vars start right after the old ones, does that mean they're also stored in the old saveblock? If so, does that significantly limit the number of new vars you can add?

No, I made a mistake. :P
Old vars are: 0x4000 - 0x40FF (use the old saveblock)
New vars are: 0x5000 - 0xXXX (use the new saveblock). You specify the number of new vars.
 
1,591
Posts
10
Years
  • Age 30
  • Seen Mar 20, 2024
No, I made a mistake. :P
Old vars are: 0x4000 - 0x40FF (use the old saveblock)
New vars are: 0x5000 - 0xXXX (use the new saveblock). You specify the number of new vars.

That makes sense. Thanks again, Dizzy.
 

Anthroyd

Professor
211
Posts
7
Years
Repost from battle upgrade thread for proper placement:

-------------------------------------------------

Suggestion: Dynamic overworld sprite palettes.

I've explained the technicalities in depth in my video here: https://www.youtube.com/watch?v=lyL2O8N0CBo&list=PLfI5DBI4tNyLBYGNhf1Ee8cgdmMtiilps&index=27

There is a Fire Red patch for this here: https://www.pokecommunity.com/showthread.php?t=359685

Unfortunately, no Emerald patch exists, and this overworld struggle is a major issue in Emerald ROM hacking in my opinion and experience.
 
Spoiler:
So I noticed some changes to the expanded Poke Balls on the Github as well as palette changes tied to the current time. Are the Poke Ball changes bug fixes? Is the new palette stuff Day and Night based on the built-in RTC? Any hope of getting specials that set and return the day of the week (I assume it'd just be the dayOfTheWeek = dayByteOfTheRTC % 7) as well? Or wait... Can we read from the RTC without ASM help with comparefarbytetobyte? It's been so long I can't remember.
 
794
Posts
10
Years
So I noticed some changes to the expanded Poke Balls on the Github as well as palette changes tied to the current time. Are the Poke Ball changes bug fixes? Is the new palette stuff Day and Night based on the built-in RTC? Any hope of getting specials that set and return the day of the week (I assume it'd just be the dayOfTheWeek = dayByteOfTheRTC % 7) as well? Or wait... Can we read from the RTC without ASM help with comparefarbytetobyte? It's been so long I can't remember.

I added const qualifier to some structs in the balls expansion file.
I also added the day night palette system, you're right about that. I'll wait with publishing it till I add day/night mons though.
As for getting the RTC time, you'd need to call a function that updates it first and then get the bytes. However, since the palette needs constant switching in the overworld, I made that function get called every frame, so you can just use the scripting commands to read the time bytes.
 
75
Posts
9
Years
I can not evolve after implementing it, I have tried everything but still nothing works, either because I know a movement or by gender does not evolve :(
 
16
Posts
6
Years
  • Age 28
  • Seen Aug 7, 2017
After I use the competitive trainers, the evs and ivs are set right but the value of status isn't changed.What can i do to make the system recalculate the value of status of the trainers' pokes?
 
55
Posts
14
Years
  • Seen Feb 1, 2023
I'm trying to run scripts/build.py and I'm getting this error:
Compiling ./src/DNS.c
Assembling ./src/DNS.s
<devkit_path>/devkitARM/bin/arm-none-eabi-ld:linker.ld:33: syntax error

All the defaults are set; I haven't enabled any features yet -- just wanted to see if it could build.

Any ideas? Thanks in advance :)

EDIT:
Found the issue: the last few lines of code are duplicated. Commenting them out fixed this. I'm kinda surprised no one found this before me...?
 
Last edited:
55
Posts
14
Years
  • Seen Feb 1, 2023
I can't seem to run the build.py. keep getting that there is an error

Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>
RESTART: C:\Users\Hacking\Desktop\Clean Roms\Various-EM-features-master\Various-EM-features-master\scripts\build.py
... (lines removed to save space)
Traceback (most recent call last):
...
FileNotFoundError: [Errno 2] No such file or directory: './src/defines.h'
>>>

Did you figure out your issue? I figure it's an old post, so maybe.

I believe the issue is that you ran "build.py" from the wrong directory. The folder from which you run Python, and then build.py makes a big difference. Try running
Code:
python scripts/build.py
from your Various-EM-features-master folder instead (in cmd.exe or whatever command line util you're using). I'll create a pull request with a fix for this in the near future :)

(Also, it shouldn't matter, but you're running python 3.4.4 and the main posts suggests using 3.5.x :P )
 
Last edited:
75
Posts
9
Years
Suppose, I want to change the evolutions so that it goes something like this: Eevee + Sun Stone = Espeon Eevee + Moon Stone = Umbreon Eevee + Leaf Stone = Leafeon Eevee + Ice Stone = Glaceon Eevee + Fairy Stone (I will create this stone) = Sylveon How do I edit this?

#if EEVEE_TABLE == true
#define eevee_evos 8
struct evolution_sub eevee_table[eevee_evos] = {
{7, ITEM_WATERSTONE, POKE_VAPOREON, 0x00, 0x00},
{7, ITEM_THUNDERSTONE, POKE_JOLTEON, 0x00, 0x00},
{7, ITEM_FIRESTONE, POKE_FLAREON, 0x00, 0x00},
{1, 0, POKE_ESPEON, 0x00, 0x00},
{2, 0, POKE_UMBREON, 0x00, 0x00},
{17, 0x00, 123, 0x00, 0x00}, // Map ID defs still need to be made
{17, 0x00, 123, 0x00, 0x00},
{29, TYPE_FAIRY, 124, 0x00, 0x00}, // XX is the index of Sylveon method
};
#endif // EEVEE_TABLE
 
131
Posts
9
Years
  • Age 23
  • Seen today
Suppose, I want to change the evolutions so that it goes something like this: Eevee + Sun Stone = Espeon Eevee + Moon Stone = Umbreon Eevee + Leaf Stone = Leafeon Eevee + Ice Stone = Glaceon Eevee + Fairy Stone (I will create this stone) = Sylveon How do I edit this?

#if EEVEE_TABLE == true
#define eevee_evos 8
struct evolution_sub eevee_table[eevee_evos] = {
{7, ITEM_WATERSTONE, POKE_VAPOREON, 0x00, 0x00},
{7, ITEM_THUNDERSTONE, POKE_JOLTEON, 0x00, 0x00},
{7, ITEM_FIRESTONE, POKE_FLAREON, 0x00, 0x00},
{1, 0, POKE_ESPEON, 0x00, 0x00},
{2, 0, POKE_UMBREON, 0x00, 0x00},
{17, 0x00, 123, 0x00, 0x00}, // Map ID defs still need to be made
{17, 0x00, 123, 0x00, 0x00},
{29, TYPE_FAIRY, 124, 0x00, 0x00}, // XX is the index of Sylveon method
};
#endif // EEVEE_TABLE

Code:
#if EEVEE_TABLE == true
    #define eevee_evos 8
    struct evolution_sub eevee_table[eevee_evos] =  {
    {7, ITEM_WATERSTONE, POKE_VAPOREON, 0x00, 0x00},
    {7, ITEM_THUNDERSTONE, POKE_JOLTEON, 0x00, 0x00},
    {7, ITEM_FIRESTONE, POKE_FLAREON, 0x00, 0x00},
    {7, ITEM_SUNSTONE, POKE_ESPEON, 0x00, 0x00},
    {7, ITEM_MOONSTONE, POKE_UMBREON, 0x00, 0x00},
    {7, ITEM_LEAFSTONE, 123, 0x00, 0x00},
    {7, ITEM_ICESTONE, 123, 0x00, 0x00},
    {7, ITEM_FAIRYSTONE, 124, 0x00, 0x00},
    };
#endif // EEVEE_TABLE

add ice stone and fairy stone to the list of item defines in items.h and items.s. also, setting both leafeon and glaceon to 123 means that leaf stone and ice stone will evolve into the same pokemon- probably edit that.
 
10
Posts
12
Years
  • Seen Jul 21, 2017
I need help figuring out the competitive trainers thing.

In my output config.ini, I have config_table at 8FF38FC and trainer_pokemon at 8FF1A80 but those addresses don't exist in the ROM (it doesn't go above FFFFFF). What am I doing wrong?
 
1,591
Posts
10
Years
  • Age 30
  • Seen Mar 20, 2024
I need help figuring out the competitive trainers thing.

In my output config.ini, I have config_table at 8FF38FC and trainer_pokemon at 8FF1A80 but those addresses don't exist in the ROM (it doesn't go above FFFFFF). What am I doing wrong?

The 8 just means that that address is part of the ROM; in the GBA's memory, the ROM starts at 0x8000000 and ends at 0x9FFFFFF. To get an offset from the start of the ROM, just subtract 0x8000000 from it (or just ignore the first 8) i.e. go to 0xFF38FC in the ROM and you'll find your table.
 
Back
Top