Binary Hack Research & DevelopmentGot a well-founded knack with your binary Pokémon hacks? Love reverse-engineering them? For the traditional Pokémon ROM hacker, this is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
i have another request for abilites can u guys do ice body and magician for emerald?
Ice Body is written up at the moment but it's part of a huge set of routines so it might be a while. Magician I haven't looked into but I imagine it can go into the table that KDS did for the Life Orb thing.
So the Speed and Priority abilities are something I've had written up for awhile but since edited because of KDS and Kleenex's rewrite of the Turn Order Loader. This routine has new items included in it as well, and a few moves such as Trick Room and Tailwind.
Prankster, Gale Wings, Stall, Sand Rush, Slow Start and Quick Feet
This routine replaces the entire Turn Order calculation to make it more efficient and to work with Gyro Ball and Electro Ball. The locations for Trick Room, Custap Berry, Slow Start and Tailwind refer to free ram locations that you allocate yourself. The one for Slow Start must be the same as the other routines for the ability.
This routine replaces the entire Turn Order calculation to make it more efficient and to work with Gyro Ball and Electro Ball. The locations for Trick Room, Custap Berry, Slow Start and Tailwind refer to free ram locations that you allocate yourself. The one for Slow Start must be the same as the other routines for the ability.
If the command mov r10, r1 at the beginning of both routines is having trouble compiling, just set it to mov r0, r1, and once its inserted in your rom, change the hex manually of that section to 8A 46. It should be at 14CEE in Fire Red or 3CF26 in Emerald.
Ice Body is written up at the moment but it's part of a huge set of routines so it might be a while. Magician I haven't looked into but I imagine it can go into the table that KDS did for the Life Orb thing.
So the Speed and Priority abilities are something I've had written up for awhile but since edited because of KDS and Kleenex's rewrite of the Turn Order Loader. This routine has new items included in it as well, and a few moves such as Trick Room and Tailwind.
Prankster, Gale Wings, Stall, Sand Rush, Slow Start and Quick Feet
This routine replaces the entire Turn Order calculation to make it more efficient and to work with Gyro Ball and Electro Ball. The locations for Trick Room, Custap Berry, Slow Start and Tailwind refer to free ram locations that you allocate yourself. The one for Slow Start must be the same as the other routines for the ability.
This routine replaces the entire Turn Order calculation to make it more efficient and to work with Gyro Ball and Electro Ball. The locations for Trick Room, Custap Berry, Slow Start and Tailwind refer to free ram locations that you allocate yourself. The one for Slow Start must be the same as the other routines for the ability.
Little thing to note, you miss the fact that there might be more than one poke with slow start.
You can use 2 bytes instead of one, and use 3 bits for each bank, to code the five turns.
Other than that, looks great!
EDIT : My bad, I guess r7 is the bank. Well, you can still use 2 bytes instead of 4.
Also, I don't see where you decrease the counter for slow start, will it be in the end turn routine maybe ?
Little thing to note, you miss the fact that there might be more than one poke with slow start.
You can use 2 bytes instead of one, and use 3 bits for each bank, to code the five turns.
Other than that, looks great!
What? No I don't. The routine is called for each banked pokemon. It adds the bank. So far I'm using 4 bytes, one for each of the banks.
EDIT: Yes it will be in a separate routine. So far it uses 4. One when the pokemon enters that sets the routine, counter decrease, then the attack and speed reductions.
I haven't posted the enter or end of turn routines yet because there are so many haha! Also KDS rewrote the enter routines to be a bit better so I am yet to completely redo them to match his new system. The counter decrease routines are going to be very annoying because there are so many new moves and abilities with counters.
Oh i see well cant wait to see ice body and sorry to request again on the same day but do u have download and cursed body?
Download and Cursed body are in a similar boat to Ice Body. They're both part of huge routines with lots of pre requisites, namely entry and contact abilities.
This slightly off topic question is mostly directed at MrDollSteak/KDS/kleenexfeu based on number of contributions to this thread, though anyone can reply. Do any of you have a very detailed idb with a strong focus on the battle engine that you’d be willing to share? I get annoyed by adding a ton of little hooks here and there within a single routine/ also wanted to research battling in general, so I was going through the routines from which some of your hooks originate. I was plowing through the damage multiplier section with relative ease, throwing in easy additions like new ability and item multipliers. I thought I was making quick progress until I bumped into the horrendous ability_somethingeverything routine. There is (so far) no specific part of it that is terribly difficult to understand, but the sheer size makes me want to cry. Also, I’m guessing that I’m wasting my time as it seems likely that at least one of you has already documented these horrendous 7.3 kilobytes. I understand if you’d prefer not to, but if you’d be willing to share you research, I’d be very grateful :D
I've update my signature, you can find a link on my IDB, I wouldn't call it a "strong focus on the battle engine" but it's still something, I guess.
For battlestuffs, look in the name windows, the labels with check_something, or battle_something.
There are others labels I used but I don't have them all on the top of my head.
Also, it's emerald, not FR, but the battle engines are praticly the same (not completly though).
I don't know why we didn't do that earlier : I think it should be linked in the OP, in case people want to see/help.
Perhaps KDS has a better documentation, he seems far more organised than I am x)
#210Link to this post, but load the entire thread.
December 10th, 2015 (1:26 AM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by azurile13
I thought I was making quick progress until I bumped into the horrendous ability_somethingeverything routine. There is (so far) no specific part of it that is terribly difficult to understand, but the sheer size makes me want to cry. Also, I’m guessing that I’m wasting my time as it seems likely that at least one of you has already documented these horrendous 7.3 kilobytes. I understand if you’d prefer not to, but if you’d be willing to share you research, I’d be very grateful :D
Actually, this routine is a collection of around 18 different sections. The table which contains pointers to different sections is located at x1a0dc (FR). Each section has different purpose i.e one is for switchin abilities, one for contact, one for end turn abilities, etc. This routine is referenced from different locations for different purposes using r0 as a parameter to execute different section of this routine.
What? No I don't. The routine is called for each banked pokemon. It adds the bank. So far I'm using 4 bytes, one for each of the banks.
EDIT: Yes it will be in a separate routine. So far it uses 4. One when the pokemon enters that sets the routine, counter decrease, then the attack and speed reductions.
I haven't posted the enter or end of turn routines yet because there are so many haha! Also KDS rewrote the enter routines to be a bit better so I am yet to completely redo them to match his new system. The counter decrease routines are going to be very annoying because there are so many new moves and abilities with counters.
This message is addressed both to MrDS and KDS, is the switch-in system on the first page up to date ?
Because I made one myself, using more or less the same principle, except I hooked at the same place than weathers abilities. It has the advantage tu support mega evolution without having the call different parts of ability_something.
Indeed after the mega evo, I call ability_something with r0 = 0 (for switch in), and it's the same for role play/trace etc.
It also support custom messages etc.
With that I've made of the switch-in abilities (I think) : mold breaker, pressure and auras messages, download, imposter, updated weathers (snow warning, mega primal, drizzle/drought/sand stream)
So, my point here is to ask, did I forgot something apart from the counter for slow start ?
And, what system do you use for switch-in ? To see which one we should use
This message is addressed both to MrDS and KDS, is the switch-in system on the first page up to date ?
Because I made one myself, using more or less the same principle, except I hooked at the same place than weathers abilities. It has the advantage tu support mega evolution without having the call different parts of ability_something.
Indeed after the mega evo, I call ability_something with r0 = 0 (for switch in), and it's the same for role play/trace etc.
It also support custom messages etc.
With that I've made of the switch-in abilities (I think) : mold breaker, pressure and auras messages, download, imposter, updated weathers (snow warning, mega primal, drizzle/drought/sand stream)
So, my point here is to ask, did I forgot something apart from the counter for slow start ?
And, what system do you use for switch-in ? To see which one we should use
The one KDS posted is the most recent one yes. It's the one I would recommend as it fixes intimidate though I guess you could handle that separately.
The full list of abilities discounting weather afaik are:
2E - Pressure entry Message
59 - Download
69 - Mold Breaker entry Message
6C - Anticipation
6D - Forewarn
71 - Slow Start counter set and entry message
78 - Frisk
80 - Unnerve entry Message
97 - Imposter
A4 - Turboblaze entry Message
A5 - Teravolt entry Message
BB - Dark Aura entry Message
BC - Fairy Aura entry Message
BD - Aura Break entry Message
I've done Anticipation and Forewarn on my old system as well as the ones you've mentioned. I've done the Slow Start one too. I have some code for Frisk working but I couldn't get it to cycle through the battle script twice for Double Battles, though KDS has explained a bit better how to do that.
Actually, this routine is a collection of around 18 different sections. The table which contains pointers to different sections is located at x1a0dc (FR). Each section has different purpose i.e one is for switchin abilities, one for contact, one for end turn abilities, etc. This routine is referenced from different locations for different purposes using r0 as a parameter to execute different section of this routine.
Yep, I saw the jumptable and knizz pointed out the "huge switch,", but after going through the first case, I had posted my requests in hopes that I wouldn't have to read the rest of them >_<
Prankster, Gale Wings, Stall, Sand Rush, Slow Start and Quick Feet
Line 14: add sp, #-x04?
Line 20: mov 10, r1. Is it r10 for real?
Line 39: Forgotten the comma between r0 and #0x18
Line 73: Branch out of range
Line 150: Another BufferMoveData? I guess should it be BufferBattleData or what?
Line 212: Branch out of range
Line 216: Branch out of range
Line 218: Forgotten the comma between r0 and #0x18
Line 228: Branch out of range
Line 414: Branch out of range
Line 416: Forgotten the comma between r0 and #0x18
Line 472: Is it actually EnigmaRamLoc2?
Line 14: add sp, #-x04? used to save some data sometimes
Line 20: mov 10, r1. Is it r10 for real? Yeah, why not ?
Line 39: Forgotten the comma between r0 and #0x18
Line 73: Branch out of range
Line 150: Another BufferMoveData? I guess should it be BufferBattleData or what?
Line 212: Branch out of range
Line 216: Branch out of range
Line 218: Forgotten the comma between r0 and #0x18
Line 228: Branch out of range
Line 414: Branch out of range
Line 416: Forgotten the comma between r0 and #0x18
Line 472: Is it actually EnigmaRamLoc2? Yeah, enigma is actually a placeholder for other items or berries, in link or some stuff like that
Is anybody currently researching Anger Point? This ability is one that I am eager to implement in my hack. Not trying to be pushy or anything, I'm just curious if there's any progress on this ability. :)
#217Link to this post, but load the entire thread.
December 24th, 2015 (1:28 PM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by Exodrake
Is anybody currently researching Anger Point? This ability is one that I am eager to implement in my hack. Not trying to be pushy or anything, I'm just curious if there's any progress on this ability. :)
Fairly easy to implement. It requires to expand the table at x1a848 and write small amount of code for it. If you're using MrDS's rombase, then I think the table routine and the table have been changed so you might need to account for that.
Fairly easy to implement. It requires to expand the table at x1a848 and write small amount of code for it. If you're using MrDS's rombase, then I think the table routine and the table have been changed so you might need to account for that.
what about for emerald would it be the same or would there be a diffrent offset?
The byte changes actually re-insert the routine for you. The implementation was broken, so the byte changes make it reflect this new routine.
Fur Coat and Multiscale definitely work 100% as intended, no breaking at all.
I fixed No Guard, basically I put a ldr, instead of ldrb, for the bank check, it definitely works now.
Mold Breaker, Teravolt and Turboblaze
Spoiler:
Emerald (credits to KDS for the original Fire Red routines)
Insert this table if your ROM has the abilities in the same order that is mentioned in the OP (otherwise you will have to modify according to the format.
There are 256 entries in this table which equal to the maximum No. of abilities that can be accomodated in a GBA rom.
An entry for each ability takes one byte of space and there are entries for every ability. The entry is set to 00 if Mold Breaker does not negate the ability, 01 (or a non-zero value) if Mold Breaker is able to negate it and 02 if the the ability is negated to simulate the Gen V hazard effect.
For e.g, the first entry is for Ability ID 0x0 and does not need to be negated by mold breaker so its entry is set to 00. The second entry is for Stench (ID = 0x1) so set to 00. The 6th entry is set to 01 because MB negates Sturdy (ID = 0x5).
There are some abilities that do not work with this method and require special explicit checks and there entry is set to 00 to avoid wastage of time.
Spoiler:
1. Damp (it checks in the whole battle field rather than a single target, so the 'faintifnotdamp' battlescript command needs to be edited for this. I'm leaving this for now)
2. Lightning and Storm Drain (mold breaker should allow redirection of move).
3. Friend Guard, Aroma Veil, Sweet Veil, Flower Veil (the target's boosts are sometimes by virtue of its ally's ability).
Modify the table accordingly if there is a need to.
Step 2 1a. Replace x8TTTTTT in the routines with the offset of the Mold breaker table. 1b. Insert these routines with byte changes in the respective code comments.
Spoiler:
Routine 1 (Checks for user's Mold Breaker prior to move execution and then disables abilities that negate, also probably the best place to insert Stance Change)
In the routine that makes pokemon forced to switch-out being affected by the entry hazards, we shouldn't use the index 0xFF, it is used to set the weather depending on the map :
#222Link to this post, but load the entire thread.
January 9th, 2016 (8:43 AM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by kleenexfeu
In the routine that makes pokemon forced to switch-out being affected by the entry hazards, we shouldn't use the index 0xFF, it is used to set the weather depending on the map :
Good find! 0x0 should not be used because of Gastro Acid. 0xFE would bhi better in this case.
What is the matter with gastro acid ?
Also 0xFE is used to check water or mudsport, I don't remember. Though when rewritting the damage calculator I updated them so it shouldn't be a problem
Perhaps we could change the index to something that has no effect in battle, like pickup
Sorry for the lack of updates in a while guys, I've got heaps of projects going on, and am very busy in real life at the moment. Anyway I've since written up the Regenerator routine that my rombase uses, it was improved immensely by Doesnt. It's bug free as far as I can tell considering I just fixed the bug wherein it broke Natural Cure.
The buffer health change command as far as I can tell gets the game to recognise the changes in both status for natural cure, and health for Regenerator, it likely updates the graphics also.
The buffer health change command as far as I can tell gets the game to recognise the changes in both status for natural cure, and health for Regenerator, it likely updates the graphics also.
Regenerator doesn't work for me in double battles or when AI switches out.(Fire Red) HP may not update, kill AI pokemon or break health bar depending on the position of a pokemon. I played with it for a while and it seems the problem lies in str r0, [sp]. This only works for user, changing it to str r0, [sp, #0x28] will work for AI but freeze the game if player switches out. Double battles won't work either way. I think it has to do with bank position of switching and aforementioned sp.
EDIT: So I did some tests and it turns out that AI switching statused Pokemon with Natural Care in double battles also doesn't work. It doesn't have to do with your routine though, it just doesn't work in vanilla FR. Nvm, vanilla natural care works fine with all Pokemon, so the problem is somewhere in your routine.
#225Link to this post, but load the entire thread.
January 10th, 2016 (12:17 AM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by kleenexfeu
What is the matter with gastro acid ?
Also 0xFE is used to check water or mudsport, I don't remember. Though when rewritting the damage calculator I updated them so it shouldn't be a problem
Perhaps we could change the index to something that has no effect in battle, like pickup
Actually, 0x0 turns out to be good. I verified by re-evaluating the situation.