The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Research & Development (https://www.pokecommunity.com/forumdisplay.php?f=195)
-   -   Code Ability Resource Thread (https://www.pokecommunity.com/showthread.php?t=343264)

MrDollSteak January 10th, 2016 5:41 AM

Quote:

Originally Posted by DizzyEgg (Post 9069814)
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.

Hrm, I'll look into it. Might be before the str r0, I think it might be add r0, r0, r2 instead of r0, r0, r3.

LCCoolJ95 January 11th, 2016 11:32 AM

For some of the codes, some say "insert XX XX XX 08 at this offset", while others say "insert XX+1 XX XX 08 at this offset". Is it XX XX XX 08 or XX+1 XX XX 08?

Trainer 781 January 11th, 2016 11:49 AM

Quote:

Originally Posted by LCCoolJ95 (Post 9072062)
For some of the codes, some say "insert XX XX XX 08 at this offset", while others say "insert XX+1 XX XX 08 at this offset". Is it XX XX XX 08 or XX+1 XX XX 08?

When you are refering to a Battle Script, Table etc. you use XX XX XX 08.
For ASM code you use XX+1 XX XX 08.

Though there may be some exceptions, but usually this is the case.

kleenexfeu January 11th, 2016 12:17 PM

Quote:

Originally Posted by KDS (Post 9072084)
When you are refering to a Battle Script, Table etc. you use XX XX XX 08.
For ASM code you use XX+1 XX XX 08.

Though there may be some exceptions, but usually this is the case.

The only exception would be when usin the bl instruction, but usually when we use it the address is given, like "bl 0xD7500" or "bl some_routine"

Even when there's a switch statement, we can use the +1, because mov pc, rX automatically nuliffy the LSB and considers we're in thumb mode

So yeah, you can consider pointers for ASM always having this "+1"

mamamama January 19th, 2016 9:50 AM

Quote:

Originally Posted by MrDollSteak (Post 8824750)
Wonder Skin and Snow Cloak

I am unable to compile Wonder Skin and the 2nd Snow Cloak routine. Kleenex has posted a Snow Cloak no hail damage routine but I want the no hail damage for Overcoat etc. that was posted.

Is there a fix for this?

Thanks for all the hard work you put in!

pokefreak890 January 19th, 2016 12:47 PM

i got u mamamamama

snow cloak part 1
.text
.text
.align 2
.thumb
.thumb_func
.global snowcloak

BufferAbility:
ldr r0, .TargetBank
ldrb r0, [r0]
mul r0, r5
add r0, r0, r7
add r0, #0x20
ldrb r0, [r0]
SandVeilCheck:
cmp r0, #0x8
bne SnowCloakCheck
SandVeil:
ldr r0, .Return
bx r0
SnowCloakCheck:
cmp r0, #0x52
bne Return
SnowCloak:
ldr r0, .WeatherLoc
ldrh r1, [r0]
mov r0, #0x18
lsl r0, r0, #0x4
and r0, r1
cmp r0, #0x0
beq Return
ldr r1, .Return2
bx r1
Return:
ldr r0, .Return3
bx r0

.align 2

.TargetBank: .word 0x0202420C
.Return: .word 0x0804689D
.WeatherLoc: .word 0x020243CC
.Return2: .word 0x080468A9
.Return3: .word 0x080468B9

snow cloak part 2 (this one does compile)

.text
.align 2
.thumb
.thumb_func
.global preventfromhail

Start:
mov r0, r2
add r0, #0x20
ldrb r1, [r0]
cmp r1, #0x52
bne Return

Untouched:
ldr r1, UntouchedBack
bx r1

Return:
add r0, #1
ldrb r0, [r0]
cmp r0, #0xF
beq Untouched
ldr r1, Back
bx r1

.align 2
Back: .word 0x08051BFA+1
UntouchedBack: .word 0x08051C3C+1

wonderskin

.text
.text
.align 2
.thumb
.thumb_func
.global wonderskin

BufferAbility:
ldr r0, .TargetBank
ldrb r0, [r0]
mul r0, r2
add r0, r0, r3
add r0, #0x20
ldrb r0, [r0]
ldrb r3, [r7, #0x3]
CheckWonderSkin:
cmp r0, #0x94
bne Return
WonderSkin:
ldrb r0, [r7, #0xA]
cmp r0, #0x2
bne Return
cmp r3, #0x32
ble Return
mov r3, #0x32
Return:
mov r8, r3
mov r0, #0x0
str r0, [sp]
mov r0, #0x13
ldr r1, .Return
bx r2

.align 2

.TargetBank: .word 0x0202420C
.Return: .word 0x080467E5

sorry its like this but i dont know how to do spoilers

mamamama January 19th, 2016 6:37 PM

Quote:

Originally Posted by pokefreak890 (Post 9083421)
i got u mamamamama

Thanks!

Wonder Skin compiles now, but the game freezes when I try to use Spore on a Pokemon with this ability. It seems to be related to the 01 48 00 47 00 00 XX+1 XX XX 08 bytes. Have you made any changes to them?

The Snow Cloak fix doesn't seem to contain the checks for future and current abilities such as Ice Body and Overcoat like the original posted by Mr. DollSteak did. It would be great if that routine was able to be corrected.

Quote:

Originally Posted by MrDollSteak (Post 9070537)
No Guard

I can confirm that this routine, despite the fix by kleenexfeu, does not work. During my tests, Dynamicpunch still missed, did not hit flying types, and the opposing Pokemon still missed mine at times despite me having No Guard.

Trainer 781 January 20th, 2016 2:02 AM

Quote:

Originally Posted by mamamama (Post 9083798)

I can confirm that this routine, despite the fix by kleenexfeu, does not work. During my tests, Dynamicpunch still missed, did not hit flying types, and the opposing Pokemon still missed mine at times despite me having No Guard.

There is a typo in the third line. Change ldr r0, [r0] to ldrb r0, [r0]

MrDollSteak January 20th, 2016 4:02 AM

Quote:

Originally Posted by mamamama (Post 9083798)
Thanks!

Wonder Skin compiles now, but the game freezes when I try to use Spore on a Pokemon with this ability. It seems to be related to the 01 48 00 47 00 00 XX+1 XX XX 08 bytes. Have you made any changes to them?

The Snow Cloak fix doesn't seem to contain the checks for future and current abilities such as Ice Body and Overcoat like the original posted by Mr. DollSteak did. It would be great if that routine was able to be corrected.



I can confirm that this routine, despite the fix by kleenexfeu, does not work. During my tests, Dynamicpunch still missed, did not hit flying types, and the opposing Pokemon still missed mine at times despite me having No Guard.

The problem for all of these routines in typos I made. In Wonder Skin it should be bx r1 in the last line in both Fire Red and Emerald. I have fixed those now.

In Snow Cloak I had two Returns available for some reason, there should only be one, which is why the compiling error occurred. Also KDS is right, for some reason in the emerald no guard it was saying ldr instead of ldrb, whereas the fire red one had ldrb correctly. I obviously haven't been copying these routines from my rombase as accurately as I thought haha!

Weird no one's pointed these out before but thanks mamamama and KDS for pointing these out to me.

mamamama January 21st, 2016 12:30 AM

Quote:

Originally Posted by MrDollSteak (Post 8599873)
Toxic Boost

Small bug: Toxic Boost boosts when my Pokemon is poisoned, but not when it is badly poisoned.

EDIT: Solved other glitches, self-inflicted

MrDollSteak January 21st, 2016 3:32 AM

Quote:

Originally Posted by mamamama (Post 9085392)
Small bug: Toxic Boost boosts when my Pokemon is poisoned, but not when it is badly poisoned.



Another small bug: Toxic always hits regardless of whether the user is poison type. For example: A Normal type can hit flyers with Toxic. I am using the original Toxic Script without any changes to it.

Another one: Blizzard always hits, even without hail. Using the original script here aswell

Would you be able to provide the full list of moves that are affected by the changes made to the accuracycheck(?) command?

EDIT: Overall, after implementing the accuracy abilities, it seems like moves just generally seem to miss a lot. I missed 3 100% accuracy pounds in a row for no reason when having Overgrow as ability attacking another Pokemon with Pick Up as ability. I will try to investigate which exact ability causes this issue.

Fixed the issue with Toxic always hitting, there was a ldr instead of the ldrb. Not sure what the issue with Toxic Boost is, because the check looks right.

Not sure about the others, might just be that bad bank command from earlier.

Trainer 781 January 21st, 2016 4:37 AM

Quote:

Originally Posted by MrDollSteak (Post 9085449)
Fixed the issue with Toxic always hitting, there was a ldr instead of the ldrb. Not sure what the issue with Toxic Boost is, because the check looks right.

Not sure about the others, might just be that bad bank command from earlier.

In No Guard, make sure to call the Method BL in the AutoHit label too. That BL is for Protect check. Otherwise, No Guard will bypass new protection moves like King Shield.

mamamama January 25th, 2016 8:47 PM

Quote:

Originally Posted by MrDollSteak (Post 9026157)
Prankster, Gale Wings, Stall, Sand Rush, Slow Start and Quick Feet

1. I tried to implement this but the routine does not compile. I have tried changing the line mov r10, r1 to mov r0, r1, but it does not help (I also noticed it is written as just mov 10, r1 in the routine). Is it possible that there are any more typos?

2. I suppose the "Move Data" is supposed to be changed if you have expanded your move data table. But the fact that you use 31C198 makes me unsure. Is that just a typo for 31C898, which is the move data location in Emerald?

3. Kleenexfeu told me that the free RAM location in Emerald start at 0203E320, does that mean I can use say E320, E321, E322 etc. or do I need to have some space in-between each?

MrDollSteak January 25th, 2016 9:17 PM

Quote:

Originally Posted by mamamama (Post 9091733)
1. I tried to implement this but the routine does not compile. I have tried changing the line mov r10, r1 to mov r0, r1, but it does not help (I also noticed it is written as just mov 10, r1 in the routine). Is it possible that there are any more typos?

2. I suppose the "Move Data" is supposed to be changed if you have expanded your move data table. But the fact that you use 31C198 makes me unsure. Is that just a typo for 31C898, which is the move data location in Emerald?

3. Kleenexfeu told me that the free RAM location in Emerald start at 0203E320, does that mean I can use say E320, E321, E322 etc. or do I need to have some space in-between each?

I have fixed that damn routine so many times haha, it definitely compiles now.

The ram locations I've been using are 203E324 and beyond. Most of them take 2 or 4 bytes. Trick room is one, and tailwind is two, the others are 4 I think.

FamiliaWerneck January 26th, 2016 7:28 AM

Just a quick question. Is there a limit for how many characteres I can use to make an ability description?
Because I was expanding an already expanded table, and all the descriptions that were there already took up 32 characters (the ones that didn't had FFs completing it until they were 32 bytes long).
But the very first ability I try to insert is longer than that (I'm reinserting it, actually, thus I know it's already in the game and it has more than 32 characters).
If they don't have a limit, why the first abilities I read had all FFs completing 32 bytes? Also, if I can use more than 32 characters, how can I do it? Just an FF between two abilities descriptions is enough?

MrDollSteak January 26th, 2016 8:20 AM

Quote:

Originally Posted by FamiliaWerneck (Post 9092206)
Just a quick question. Is there a limit for how many characteres I can use to make an ability description?
Because I was expanding an already expanded table, and all the descriptions that were there already took up 32 characters (the ones that didn't had FFs completing it until they were 32 bytes long).
But the very first ability I try to insert is longer than that (I'm reinserting it, actually, thus I know it's already in the game and it has more than 32 characters).
If they don't have a limit, why the first abilities I read had all FFs completing 32 bytes? Also, if I can use more than 32 characters, how can I do it? Just an FF between two abilities descriptions is enough?

Emerald you can't, but Fire Red you can probably push it to about 50-60?

FamiliaWerneck January 26th, 2016 4:39 PM

Quote:

Originally Posted by MrDollSteak (Post 9092269)
Emerald you can't, but Fire Red you can probably push it to about 50-60?

Got it. I thought there was a limit, but I'll be more free to do stuff that way, then. Thanks MrDollSteak.

Homerzilla2k January 27th, 2016 5:05 PM

I'm trying to add Protean to my ROM, and I can't seem to get it right. I complied it and inserted it into the ROM (00954460, if that matters). Then I added the 00 49 08 47 60 44 95 08 at 1D7D8. When I used "Paste Insert" to add it Gen III suite freaked out and took my to the .ini restore thing. When I overwrote it 1D7D8 with the new code and opened it, Gen III Suite worked fine, but I couldn't find it in my abilities menu. Am I missing a step somewhere?

I'm also using Mr.DollSteak's ROM base. I read in the thread that I have to edit the move data when using the the ROM base, but I'm not sure exactly how or what I'm supposed to do in that regard.

LCCoolJ95 January 27th, 2016 6:08 PM

You're supposed to Paste Write, not Paste Insert.

mamamama January 27th, 2016 9:39 PM

Quote:

Originally Posted by MrDollSteak (Post 9091765)
I have fixed that damn routine so many times haha, it definitely compiles now.

Prankster, Gale Wing etc.:The routine still wont compile for me. Thumb closes down too fast for me to have a look, but there seems to be two lines that creates the failure.

Overcoat: Works fine in Hail and Sandstorm. However, it doesn't stop Stun Spore/Effect Spore etc. from working (1st routine) and the game resets when an Overcoated 'mon uses an attack such as pound on an effect spore 'mon (2nd routine).

No Guard: The ability itself seems to work fine now. Still a problem with toxic though. Toxic now misses as if it were a non-poison 'mon using it even though the 'mon is a poison-type.

MrDollSteak January 27th, 2016 11:32 PM

Quote:

Originally Posted by mamamama (Post 9094404)
Prankster, Gale Wing etc.:The routine still wont compile for me. Thumb closes down too fast for me to have a look, but there seems to be two lines that creates the failure.

Overcoat: Works fine in Hail and Sandstorm. However, it doesn't stop Stun Spore/Effect Spore etc. from working (1st routine) and the game resets when an Overcoated 'mon uses an attack such as pound on an effect spore 'mon (2nd routine).

No Guard: The ability itself seems to work fine now. Still a problem with toxic though. Toxic now misses as if it were a non-poison 'mon using it even though the 'mon is a poison-type.

Yeah they're all 100% fixed now. The issue with the first one was that in my rom I'm compiling the BLs with 08 at the front, but I'd removed them all except for one in the routine.

The others were all typos.

The only thing I couldn't replicate was the issue you found with the 1st routine. Are you sure you've set up the table correctly from the prerequisites? and pointed to the right tables?

Homerzilla2k January 28th, 2016 4:11 AM

Quote:

Originally Posted by LCCoolJ95 (Post 9094187)
You're supposed to Paste Write, not Paste Insert.

I tried that and Gen III Suite opened fine, but Protean is not in the abilities drop down menu.

Reshiram white as snow February 22nd, 2016 3:00 PM

Can you make new abilities into a patch for emerald?

pokefreak890 March 21st, 2016 2:00 PM

Why did u delete the patch? I'm confused

Xencleamas March 30th, 2016 7:34 AM

Quote:

Originally Posted by MrDollSteak (Post 8844504)
Magic Guard, Overcoat

This isn't Ability-related but I wonder if Safety Goggles can be included there. The item's effect is to immune weather-related damage and powder moves.


All times are GMT -8. The time now is 8:52 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.