Well, this is what I did, while learning how to do stuff like debugging and doing new mechanics changes in the game.
Thanks to Touched-sensei, who helped me through the entire process. Thanks to daniilS and kleenexfeu, who also helped in the very end. This is for Fire Red:
- First, go to 0xA1E30. Change 01 21 to 00 21 (with this, Pokéballs won't be deleted when you select them in your bag);
- Now, find some free space and insert this routine there:
Here's a compiled version:
This is the code that deletes the Pokéball;
- Finally, go to 0x2D924 and paste write this "00 48 00 47 XX XX XX 08" there. It's a hook to the routine you just inserted. Change the XX XX XX for the pointer to the offset you placed the above routine. Remember to +1 the offset before changing it to a pointer.
With this hack, you won't spend Pokéballs if you don't capture a wild Pokémon. I wanted to do it inspired in the anime.
Again, simple, some people will think it's a broken functionality, but it will do well for that time when you encounter a shiny Pokémon with that one single Pokéball in your bag. =P
Thanks again, everybody. Hope it's helpful.
EDIT:
Thanks to mbcn10ww, I fixed this hack.
Unfortunately, I couldn't test it on the Safari area, as it's saying other saves are not compatible (but I don't know why, since I might have tried to use saves of games with other different hacks. It's been more than a semester I don't even see my games).
Nevertheless, I tested it on regular places and areas, and it is still working. From the previous hack, I set a new condition before removing item from the bag.
I call the removing routine anyway. The difference is that I pass on a 0 value as the number of items to be deleted if it's not a pokeball.
The "cmp r0, #0xC" compares the last item used with the last pokeball index (Premier Ball). If it is lower or equal to that, it is a pokeball. Else, r1 receives 0 and no item should be deleted.
Thanks for the heads up, mbcn10ww!
If anyone can test the Safari part, jumping straight there, or anything, I would appreciate!