Working Download & Rivalry is in MrDollSteak's Decap. and Attack Rombase ;)
ps: You already have Anger Point?
I just don't know how to extract: [
Now I do '-'
Working Download & Rivalry is in MrDollSteak's Decap. and Attack Rombase ;)
ps: You already have Anger Point?
I just don't know how to extract: [
Now I do '-'
I did it so that I applied a patch on a clean rom and checked the offset to these skills in the info file, then I just copied the bytes changing the offsets and putting in to my hack... I care about Anger Point, but no one has yet written a separate script for this ability... Hope you understand because my English is poor :D
I already have Anger Point.
I lack Rivalry so I can make them all available.
30 1C 20 30 01 78 48 46 00 28 40 D1 -- 29 01 D1
0F 20 3E E0 -- 29 01 D1 01 20 3A E0 -- 29 01 D1
03 20 36 E0 -- 29 01 D1 04 20 32 E0 -- 29 01 D1
05 20 2E E0 -- 29 01 D1 06 20 2A E0 -- 29 01 D1
07 20 26 E0 -- 29 01 D1 08 20 22 E0 -- 29 01 D1
0A 20 1E E0 -- 29 01 D1 0B 20 1A E0 -- 29 01 D1
0C 20 16 E0 -- 29 01 D1 0D 20 12 E0 -- 29 01 D1
0E 20 0E E0 -- 29 01 D1 10 20 0A E0 -- 29 01 D1
11 20 06 E0 -- 29 01 D1 17 20 02 E0 -- 29 10 D1
02 20 0D 49 09 68 13 31 0A 78 00 2A 09 D1 81 46
02 1C 0A 70 40 46 [B]B4[/B] 21 48 43 C0 09 80 46 4F 43
FF 09 01 98 40 89 06 90 F0 8D AF 28 01 D1 03 49
08 47 03 48 00 47 C0 46 E8 3F 02 02 87 ED 03 08
A1 ED 03 08
Ice
Fighting
Poison
Ground
Rock
Bug
Ghost
Steel
Fire
Water
Grass
Electric
Psychic
Dragon
Dark
Fairy
Flying
02 1C 0A 70 40 46 [B]B4[/B] 21 48 43 C0 09 80 46 4F 43
--
@ at 014DB0 insert 00 48 00 47 XX+1 XX XX 08
main:
add r0, r4, #0x0
push {r1-r7}
add r2, r0, #0x0
add r0, #0x20
add r2, #0x4c
ldrb r0, [r0, #0x0]
cmp r0, #0xXX @Quick Feet ID
bne skip
ldr r2, [r2, #0x0]
cmp r2, #0x0
beq skip
mov r1, #0x96
ldrh r0, [r4, #0x6]
mul r0, r1
mov r1, #0x64
bl div
pop {r1-r7}
add r3, r0, #0x0
b continue
skip: pop {r1-r7}
ldrh r0, [r4, #0x6]
mul r3, r0
continue: ldr r2, dead
mov r1, #0x1b
ldrh r1, [r4, r1]
lsl r1, r1, #0x1
add r0, r1, r2
ldrb r0, [r0, #0x0]
mul r0, r3
add r2, #0x1
add r1, r1, r2
ldrb r1, [r1, #0x0]
bl div
mov r8, r0
ldr r0, return
bx r0
div: ldr r2, divmod
bx r2
.align 2
dead: .word 0x0825dead
return: .word 0x08014dcf
divmod: .word 0x081e4019
@ After compiled, change 5A to 56
@ at 014E48 insert 00 48 00 47 XX+1 XX XX 08
main:
mov r0, #0x58
mov r3, r9
mul r0, r3
add r1, #0x20
add r0, r0, r1
ldrb r0, [r0, #0x0]
cmp r0, #0xXX @Quick Feet ID
beq skip
mov r0, #0x58
mov r3, r9
mul r0, r3
add r1, #0x2c
add r0, r0, r1
ldr r0, [r0, #0x0]
there: ldr r1, return
bx r1
skip: mov r0, #0x0
b there
.align 2
return: .word 0x08014e57
@ at 014E8C insert 00 48 00 47 XX+1 XX XX 08
main:
add r0, r4, #0x0
push {r1-r7}
add r2, r0, #0x0
add r0, #0x20
add r2, #0x4c
ldrb r0, [r0, #0x0]
cmp r0, #0xXX @Quick Feet ID
bne skip
ldr r2, [r2, #0x0]
cmp r2, #0x0
beq skip
mov r1, #0x96
ldrh r0, [r4, #0x6]
mul r0, r1
mov r1, #0x64
bl div
pop {r1-r7}
add r3, r0, #0x0
b continue
skip: pop {r1-r7}
ldrh r0, [r4, #0x6]
mul r7, r0
add r3, r7, #0x0
continue: ldr r2, dead
mov r1, #0x1b
ldrh r1, [r4, r1]
lsl r1, r1, #0x1
add r0, r1, r2
ldrb r0, [r0, #0x0]
mul r0, r3
add r2, #0x1
add r1, r1, r2
ldrb r1, [r1, #0x0]
bl div
add r7, r0, #0x0
ldr r0, return
bx r0
div: ldr r2, divmod
bx r2
.align 2
dead: .word 0x0825dead
return: .word 0x08014ead
divmod: .word 0x081e4019
@ After compiled, change 5A to 56
@ at 014F28 insert 00 48 00 47 XX+1 XX XX 08
main:
mov r0, #0x58
mov r1, r10
mul r0, r1
add r1, r2, #0x0
add r1, #0x20
add r0, r0, r1
ldrb r0, [r0, #0x0]
cmp r0, #0xXX @Quick Feet ID
beq skip
mov r0, #0x58
mov r1, r10
mul r0, r1
add r1, r2, #0x0
add r1, #0x4c
add r0, r0, r1
ldr r0, [r0, #0x0]
there: ldr r1, return
bx r1
skip: mov r0, #0x0
b there
.align 2
return: .word 0x08014f39
20 1C FE B4 02 1C 20 30 4C 32 00 78 [COLOR="Red"]id[/COLOR] 28 0B D1 12 68 00 2A 08 D0 96 21 E0 88 48 43 64 21 00 F0 15 F8 FE BC 03 1C 02 E0 FE BC E0 88 43 43 08 4A 1B 21 61 56 49 00 88 18 00 78 58 43 01 32 89 18 09 78 00 F0 03 F8 80 46 02 48 00 47 02 4A 10 47 AD DE 25 08 CF 4D 01 08 19 40 1E 08
58 20 4B 46 58 43 20 31 40 18 00 78 [COLOR="Red"]id[/COLOR] 28 07 D0 58 20 4B 46 58 43 2C 31 40 18 00 68 01 49 08 47 00 20 FB E7 57 4E 01 08
20 1C FE B4 02 1C 20 30 4C 32 00 78 [COLOR="Red"]id[/COLOR] 28 0B D1 12 68 00 2A 08 D0 96 21 E0 88 48 43 64 21 00 F0 16 F8 FE BC 03 1C 03 E0 FE BC E0 88 47 43 3B 1C 08 4A 1B 21 61 56 49 00 88 18 00 78 58 43 01 32 89 18 09 78 00 F0 03 F8 07 1C 03 48 00 47 03 4A 10 47 C0 46 AD DE 25 08 AD 4E 01 08 19 40 1E 08
58 20 51 46 48 43 11 1C 20 31 40 18 00 78 [COLOR="Red"]id[/COLOR] 28 08 D0 58 20 51 46 48 43 11 1C 4C 31 40 18 00 68 01 49 08 47 00 20 FB E7 39 4F 01 08
@ at 0281D4 insert 00 47
@ at 0281E4 insert XX+1 XX XX 08
main:
ldr r0, scriptloc
ldr r0, [r0, #0x0]
ldrb r1, [r0, #0x1]
cmp r1, #0x0
bne store
ldr r0, place
ldrb r0, [r0, #0x0]
mov r1, #0x58
mul r0, r1
ldr r1, place2
add r0, r0, r1
ldrb r0, [r0, #0x0]
cmp r0, #0xXX @Skill Link ID
bne normal
mov r1, #0x5
b store
normal: ldr r4, return
bx r4
store: ldr r0, storeloc
strb r1, [r0, #0x0]
ldr r1, return2
bx r1
.align 2
place: .word 0x02023d6b
place2: .word 0x02023c04
scriptloc: .word 0x02023d74
storeloc: .word 0x02023d72
return: .word 0x080281ed
return2: .word 0x08028207
0C 48 00 68 41 78 00 29 0C D1 08 48 00 78 58 21 48 43 07 49 40 18 00 78 [COLOR="Red"]id[/COLOR] 28 01 D1 05 21 01 E0 06 4C 20 47 04 48 01 70 05 49 08 47 6B 3D 02 02 04 3C 02 02 74 3D 02 02 72 3D 02 02 ED 81 02 08 07 82 02 08
09 98 04 78[COLOR="Red"] id [/COLOR]2C 16 D1 B1 1C C8 7F 49 46 48 45 04 D0 F1 1C C8 7F 49 46 48 45 0C D1 80 20 78 43 60 21 A4 F1 99 FE 07 1C 40 46 80 21 48 43 60 21 A4 F1 92 FE 80 46 4F E0 00 00 00 00
@ Credits to blackuser
@ at 01FBB0 insert 00 48 00 47 XX+1 XX XX 08
main:
ldrb r2, [r1]
mov r0, #0x29
and r0, r2
cmp r0, #0x0
bne noanger
ldr r0, .critmaker
ldrb r0, [r0]
cmp r0, #0x2
bne noanger
ldr r0, .targetbank
ldrb r0, [r0]
mov r4, #0x58
mul r0, r4
ldr r4, .battledata
add r0, r4
add r4, r0, #0x0
add r0, #0x20
ldrb r0, [r0]
cmp r0, #0xXX @Anger Point ID
bne noanger
ldrh r0, [r4, #0x28]
cmp r0, #0x0
beq noanger
ldr r0, [r4, #0x50]
ldr r6, .substatus
and r0, r6
cmp r0, #0x0
bne noanger
ldrb r0, [r4, #0x19]
cmp r0, #0xc
beq noanger
mov r0, #0xb
strb r0, [r4, #0x19]
bl scriptpusher
ldr r1, .stringramloc
ldr r0, .angerpointstring
str r0, [r1]
ldr r1, .scriptpointer
ldr r0, .angerpointscript
str r0, [r1]
pop {r4-r7}
pop {r0}
bx r0
scriptpusher:
ldr r1, .pushscript
bx r1
noanger:
mov r4, #0x1
add r0, r4, #0x0
and r0, r2
ldr r6, .return
bx r6
.align 2
.return: .word 0x0801fbb9
.critmaker: .word 0x02023d71
.scriptpointer: .word 0x02023d74
.targetbank: .word 0x02023d6c
.battledata: .word 0x02023be4
.substatus: .word 0x1000000
.pushscript: .word 0x08017545
.stringramloc: .word 0x0203c020
.angerpointscript: .word 0x08AAAAAA
.angerpointstring: .word 0x08CCCCCC
/*
AA AA AA
48 00 02 00 F8 BB+1 BB BB 08 10 84 01 12 40 00 3C
BB BB BB
04 48 00 78 58 21 48 43 03 49 40 18 0C 21 41 76 70 47 C0 46 6C 3D 02 02 E4 3B 02 02
CC CC CC
FD 10 00 E1 D5 EC D9 D8 00 DD E8 E7 FE BB CE CE BB BD C5 AB FF 00
*/
WARNING. I may just be an ultimate noob and asking something stupid because this is my first time trying out ASM editing lol.
Hey I want to know how to insert this part of the Tangled Feet Code:
Insert 00 49 08 47 xx xx xx 08 at 0801E0DC
I don't understand where its asking me to insert it as just now I tried and all I got was the rival not battling despite the cutscene playing out. I understand slightly on how to insert ASM code into my rom since I did it with Sturdy and that was successful, so I thought inserting tangled feet would be fine but it just failed. I battled several rattata with confuse ray and not once did they miss me. Is there something I'm not getting? I was using Firered by the way.
I should also note that I inserted the string above to 0801E0 because I thought that I needed to insert it at the place coloured. It's also likely that I just got unlucky with the rattata's not missing me (just like competive battling) and I was right in my instincts but i just want to know if anyone is having the same issue with me.
inverted routine:
example:
Routine - 800000 + 1= 800001 - inverted 80 00 01 - 01 00 80 08
01 00 80 08 - xx xx xx 08
01E0DC: 00 49 08 47 xx xx xx 08
01E0DC: 00 49 08 47 01 00 80 08
@ Credits to blackuser
@ at 01BCDC insert 00 48 00 47 XX+1 XX XX 08 A1 46
main:
mov r0, #0x58
mul r0, r2
add r0, r1
add r0, #0x20
ldrb r1, [r0]
ldrh r0, [r0, #0xe]
str r0, [sp, #0x14]
cmp r1, #0xXX @Gluttony ID
bne end
cmp r0, #0xA8
beq gluttony
cmp r0, #0xA9
beq gluttony
cmp r0, #0xAA
beq gluttony
cmp r0, #0xAB
beq gluttony
cmp r0, #0xAC
beq gluttony
cmp r0, #0xAD
beq gluttony
cmp r0, #0xAE
bne end
gluttony:
mov r4, #0x2
ldr r1, .return1
bx r1
end:
ldr r1, .return2
bx r1
.align 2
.return1: .word 0x0801bce5
.return2: .word 0x0801bce7
58 20 50 43 40 18 20 30 01 78 C0 89 05 90 [COLOR="Red"]id[/COLOR] 29 10 D1 A8 28 0B D0 A9 28 09 D0 AA 28 07 D0 AB 28 05 D0 AC 28 03 D0 AD 28 01 D0 AE 28 02 D1 02 24 01 49 08 47 01 49 08 47 E5 BC 01 08 E7 BC 01 08
@ Credits to blackuser
@ at 020190 insert 00 48 00 47 XX+1 XX XX 08
main:
mov r0, #0x58
mul r0, r1
add r0, r8
add r0, #0x20
mov r3, #0x2
eor r3, r1
ldrb r1, [r0]
cmp r1, #0xXX @Pastel Veil ID
beq preventpoison
ldr r1, .battletype
ldr r1, [r1]
push {r0}
mov r0, #0x1
and r1, r0
pop {r0}
cmp r1, #0x0
beq return
mov r1, #0x58
mul r1, r3
add r1, r8
ldrh r3, [r1, #0x28]
cmp r3, #0x0
beq return
add r1, #0x20
ldrb r1, [r1]
cmp r1, #0xXX @Pastel Veil ID
beq preventpoison
return:
ldr r1, .return1
bx r1
preventpoison:
ldr r1, .return2
bx r1
.align 2
.battletype: .word 0x02022b4c
.return1: .word 0x08020199
.return2: .word 0x08020571
@ Credits to blackuser
@ at 020444 insert 00 48 00 47 XX+1 XX XX 08
main:
mov r0, #0x58
mul r0, r1
add r0, r8
add r0, #0x20
mov r3, #0x2
eor r3, r1
ldrb r1, [r0]
cmp r1, #0xXX @Pastel Veil ID
beq preventbadpoison
ldr r1, .battletype
ldr r1, [r1]
push {r0}
mov r0, #0x1
and r1, r0
pop {r0}
cmp r1, #0x0
beq return
mov r1, #0x58
mul r1, r3
add r1, r8
ldrh r3, [r1, #0x28]
cmp r3, #0x0
beq return
add r1, #0x20
ldrb r1, [r1]
cmp r1, #0xXX @Pastel Veil ID
beq preventbadpoison
return:
ldr r1, .return1
bx r1
preventbadpoison:
ldr r1, .return2
bx r1
.align 2
.battletype: .word 0x02022b4c
.return1: .word 0x0802044d
.return2: .word 0x08020571
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
Spoiler:Fire Red
Spoiler: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.Code:.text .align 2 .thumb .thumb_func .global TurnOrderLoader .org 0x14CD8 Main: push {r4-r7, lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} add sp, #0x04 lsl r0, r0, #0x18 lsr r0, r0, #0x18 mov r9, r0 lsl r1, r1, #0x18 lsr r1, r1, #0x18 mov r10, r1 mov r0, #0x0 str r0, [sp, #0x0] #r9=UserBank #r10=TargetBank CheckTurn: cmp r2, #0x0 bne BracketCalc PriorityCalc: mov r0, r9 bl PriorityBL lsl r0, r0, #0x18 asr r3, r0, #0x18 mov r8, r3 mov r0, r10 bl PriorityBL lsl r0, r0, #0x18 asr r4, r0, #0x18 mov r3, r8 cmp r3, r4 beq BracketCalc cmp r3, r4 bge Exit @FirstBankGoesFirst mov r2, #0x1 str r2, [sp, #0x0] b Exit @SecondBankGoesFirst BracketCalc: mov r0, r9 bl BracketBL mov r8, r0 mov r0, r10 bl BracketBL mov r4, r0 mov r3, r8 cmp r3, r4 beq SpeedCalc cmp r3, r4 bge Exit @FirstBankGoesFirst mov r2, #0x1 str r2, [sp, #0x0] b Exit @SecondBankGoesFirst SpeedCalc: mov r0, r9 bl SpeedBL mov r8, r0 mov r0, r10 bl SpeedBL mov r4, r0 mov r3, r8 cmp r3, r4 bne TrickRoomCheck bl 0x044EC8 mov r1, #0x1 and r0, r1 cmp r0, #0x0 bne Exit mov r2, #0x2 @SpeedTie str r2, [sp, #0x0] b Exit TrickRoomCheck: ldr r0, .TrickRoomLoc ldrb r0, [r0] cmp r0, #0x0 beq SpeedCheck TrickRoom: mov r8, r3 mov r3, r4 mov r4, r8 SpeedCheck: cmp r3, r4 bcs Exit @FirstBankGoesFirst mov r2, #0x1 str r2, [sp, #0x0] Exit: ldr r0, [sp, #0x0] add sp, #0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2 .TrickRoomLoc: .word 0x02TRTRTR .align 2 PriorityBL: mov r3, r0 LoadMenuChoice: ldr r0, .MenuChoiceLoc add r1, r3, r0 mov r0, #0x0 ldrb r1, [r1] cmp r1, #0x0 bne Return FightOptionChosen: ldr r0, .ProtectStructure lsl r1, r3, #0x4 add r1, r1, r0 ldrb r0, [r1] lsl r0, r0, #0x1D cmp r0, #0x0 bge LoadMoveIndex Struggle: mov r4, #0xA5 b BufferMoveData LoadMoveIndex: ldr r0, .Pointer ldr r0, [r0, #0x0] add r0, r3 add r0, #0x80 ldrb r0, [r0] @MoveSlotChosen lsl r0, r0, #0x1 mov r1, #0x58 mul r1, r3 add r0, r0, r1 ldr r1, .BattleData add r0, r0, r1 ldrh r4, [r0, #0xC] BufferMoveData: ldr r2, .MoveData lsl r0, r4, #0x1 add r0, r0, r4 lsl r0, r0, #0x2 add r4, r0, r2 BufferBattleData: ldr r0, .BattleData add r0, #0x20 mov r1, #0x58 mul r1, r3 add r0, r0, r1 ldrb r1, [r0] mov r0, #0x0 PranksterCheck: cmp r1, #0x9F bne GaleWingsCheck Prankster: ldrb r1, [r4, #0xA] cmp r1, #0x2 bne LoadMovePriority mov r0, #0x1 b LoadMovePriority GaleWingsCheck: cmp r1, #0xB2 bne LoadMovePriority Galewings: ldrb r1, [r4, #0x2] cmp r1, #0x2 bne LoadMovePriority mov r0, #0x1 LoadMovePriority: ldrb r1, [r4, #0x7] add r0, r0, r1 Return: bx lr .align 2 .MenuChoiceLoc: .word 0x02023D7C .ProtectStructure: .word 0x02023E8C .Pointer: .word 0x02023FE8 .BattleData: .word 0x02023BE4 .MoveData: .word 0x08250C04 .align 2 BracketBL: push {lr} mov r3, r0 mov r1, #0x58 ldr r0, .BattleDataItem mul r1, r3 add r4, r0, r1 CheckItem: ldrh r0, [r4, #0xE] cmp r0, #0xAF bne LoadItemEffect EngimaBerry: ldr r1, .EnigmaRamLoc lsl r0, r3, #0x3 sub r0, r0, r3 lsl r0, r0, #0x2 add r0, r0, r1 ldrb r6, [r0, #0x7] ldrb r5, [r0, #0x1A] b QuickClawCheck LoadItemEffect: bl 0x9A924 lsl r0, r0, #0x18 lsl r6, r0, #0x18 ldrh r0, [r4, #0xE] bl 0x9A948 lsl r0, r0, #0x18 lsl r5, r0, #0x18 QuickClawCheck: cmp r6, #0x1A bne CustapBerryCheck QuickClawActivationCalc: ldr r0, .RandomLoc ldrh r7, [r0] lsl r0, r5, #0x10 sub r0, r0, r5 mov r1, #0x64 bl 0x1E4018 cmp r7, r0 bge StallCheck mov r7, #0x1 b StoreBracket CustapBerryCheck: cmp r6, #0x4D bne LaggingTailCheck CustapBerry: CheckHP: ldrh r0, [r4, #0x8] ldrh r1, [r4, #0xC] lsl r1, r1, #0x2 cmp r0, r1 bgt StallCheck SetRamLoc: mov r7, #0x1 ldr r0, .CustapBerryLoc strb r7, [r0] b StoreBracket LaggingTailCheck: cmp r6, #0x4A bne StallCheck LaggingTail: mov r0, #0x2 neg r7, r0 b StoreBracket StallCheck: mov r7, #0x0 ldrb r0, [r4] cmp r0, #0x65 bne StoreBracket Stall: mov r0, #0x1 neg r7, r0 StoreBracket: mov r0, r7 PopRegister: pop {r1} bx r1 .align 2 .BattleDataItem: .word 0x2023C04 .EnigmaRamLoc: .word 0x2023F54 .RandomLoc: .word 0x2023E80 .CustapBerryLoc: .word 0x02CCCCCC .align 2 SpeedBL: push {lr} add sp, #-0x4 mov r7, r0 mov r5, #0x58 ldr r6, .BattleData2 mul r5, r7 add r6, r5, r6 mov r5, #0x1 str r0, [sp, #0x0] ApplyStatBoost: ldrh r5, [r6, #0x6] ldr r2, .StatModTable ldrb r1, [r6, #0x1B] lsl r1, r1, #0x1 add r2, r1, r2 ldrb r0, [r2] mul r0, r5 ldrb r1, [r2, #0x1] bl 0x1E4018 mov r5, r0 CloudNineCheck: mov r0, #0x13 mov r1, #0x0 mov r2, #0xD mov r3, #0x0 bl 0x19F18 lsl r0, r0, #0x18 cmp r0, #0x0 bne NoWeather AirLockCheck: mov r0, #0x0 str r0, [sp, #0x0] mov r0, #0x13 mov r1, #0x0 mov r2, #0x4D mov r3, #0x0 bl 0x19F18 lsl r0, r0, #0x18 cmp r0, #0x0 bne NoWeather LoadWeather: ldr r4, .WeatherLoc ldrh r4, [r4] add r2, r2, r6 add r2, #0x20 ldrb r2, [r2] RainCheck: mov r0, #0x7 and r0, r4 cmp r0, #0x0 beq SunCheck SwiftSwimCheck: cmp r2, #0x21 beq WeatherBoost SunCheck: mov r0, #0x60 and r0, r4 cmp r0, #0x0 beq SandstormCheck ChlorophyllCheck: cmp r2, #0x22 beq WeatherBoost SandstormCheck: mov r0, #0x18 and r0, r4 cmp r0, #0x0 beq NoWeather SandRushCheck: cmp r2, #0x93 bne NoWeather WeatherBoost: lsl r5, r5, #0x1 NoWeather: mov r2, r6 add r2, #0x20 ldrb r2, [r2] SlowStartCheck: cmp r2, #0x71 bne TailwindCheck ldr r0, .SlowStartLoc add r0, r0, r7 CheckTurnCounter: ldrb r0, [r0, #0x0] cmp r0, #0x0 beq TailwindCheck lsr r5, r5, #0x1 TailwindCheck: ldr r0, .TailwindAddr cmp r7, #0x1 beq EnemyTailwind cmp r7, #0x3 beq EnemyTailwind PlayerTailwind: b CheckFlag EnemyTailwind: add r0, #0x1 CheckFlag: ldrb r0, [r0, #0x0] cmp r0, #0x0 beq CheckItem2 lsl r5, r5, #0x1 CheckItem2: ldrh r0, [r6, #0x2e] cmp r0, #0xAF bne LoadItemEffect2 EnigmaBerry2: ldr r1, .EnigmaRamLoc2 lsl r0, r7, #0x3 sub r0, r0, r3 lsl r0, r0, #0x2 add r0, r0, r1 ldrb r0, [r0, #0x7] b MachoBraceCheck LoadItemEffect2: bl 0x9A924 lsl r0, r0, #0x18 lsr r0, r0, #0x18 MachoBraceCheck: cmp r0, #0x18 bne IronBallCheck lsr r5, r5, #0x1 IronBallCheck: cmp r0, #0x47 bne QuickPowderCheck lsr r5, r5, #0x1 QuickPowderCheck: cmp r0, #0x48 bne ChoiceScarfCheck ldrh r0, [r6] cmp r0, #0x84 bne ChoiceScarfCheck lsr r1, r5, #0x1 add r5, r1, r5 ChoiceScarfCheck: cmp r0, #0x1D bne BadgeCheck bl 0x9A948 lsl r0, r0, #0x18 lsl r0, r0, #0x18 cmp r0, #0x2 bne BadgeCheck lsr r0, r5, #0x1 add r5, r0, r5 BadgeCheck: ldr r0, .BadgeLoc ldr r0, [r0] mov r1, #0x2 and r0, r1 cmp r0, #0x0 bne StatusCheck ldr r0, .Flag bl 0x6E6D0 lsl r0, r0, #0x18 cmp r0, #0x0 beq StatusCheck mov r0, r7 bl 0x751C4 lsl r0, r0, #0x18 cmp r0, #0x0 bne StatusCheck mov r0, #0x6E mul r0, r5 mov r1, #0x64 bl 0x1E460C mov r5, r0 StatusCheck: ldr r0, [r6, #0x4c] add r6, #0x20 ldrb r1, [r6, #0x0] cmp r1, #0x9B bne ParalysisCheck QuickFeetCheck: cmp r0, #0x0 beq ReturnSpeed lsl r5, r5, #0x1 b ReturnSpeed ParalysisCheck: mov r1, #0x40 and r0, r1 cmp r0, #0x0 beq ReturnSpeed lsr r5, r5, #0x2 ReturnSpeed: mov r0, r5 add sp, #0x4 pop {r1} bx r1 .align 2 .BattleData2: .word 0x02023BE4 .StatModTable: .word 0x0825DEAD .WeatherLoc: .word 0x02023F1C .SlowStartLoc: .word 0x02SSSSSS .TailwindAddr: .word 0x02TTTTTT .EnigmaRamLoc2: .word 0x02023F54 .BadgeLoc: .word 0x02022B4C .Flag: .word 0x00000822
Emerald
Spoiler: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.Code:.text .align 2 .thumb .thumb_func .global TurnOrderLoader .org 0x3CF10 Main: push {r4-r7, lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} add sp, #-0x4 lsl r0, r0, #0x18 lsr r0, r0, #0x18 mov r9, r0 lsl r1, r1, #0x18 lsr r1, r1, #0x18 mov r10, r1 mov r0, #0x0 str r0, [sp, #0x0] #r9=UserBank #r10=TargetBank CheckTurn: cmp r2, #0x0 bne BracketCalc PriorityCalc: mov r0, r9 bl PriorityBL lsl r0, r0, #0x18 asr r3, r0, #0x18 mov r8, r3 mov r0, r10 bl PriorityBL lsl r0, r0, #0x18 asr r4, r0, #0x18 mov r3, r8 cmp r3, r4 beq BracketCalc cmp r3, r4 bge Exit @FirstBankGoesFirst mov r2, #0x1 str r2, [sp, #0x0] b Exit @SecondBankGoesFirst BracketCalc: mov r0, r9 bl BracketBL mov r8, r0 mov r0, r10 bl BracketBL mov r4, r0 mov r3, r8 cmp r3, r4 beq SpeedCalc cmp r3, r4 bge Exit @FirstBankGoesFirst mov r2, #0x1 str r2, [sp, #0x0] b Exit @SecondBankGoesFirst SpeedCalc: mov r0, r9 bl SpeedBL mov r8, r0 mov r0, r10 bl SpeedBL mov r4, r0 mov r3, r8 cmp r3, r4 bne TrickRoomCheck bl 0x6F5CC mov r1, #0x1 and r0, r1 cmp r0, #0x0 bne Exit mov r2, #0x2 @SpeedTie str r2, [sp, #0x0] b Exit TrickRoomCheck: ldr r0, .TrickRoomLoc ldrb r0, [r0] cmp r0, #0x0 beq SpeedCheck TrickRoom: mov r8, r3 mov r3, r4 mov r4, r8 SpeedCheck: cmp r3, r4 bcs Exit @FirstBankGoesFirst mov r2, #0x1 str r2, [sp, #0x0] Exit: ldr r0, [sp, #0x0] add sp, #0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2 .TrickRoomLoc: .word 0x02TRTRTR .align 2 PriorityBL: mov r3, r0 LoadMenuChoice: ldr r0, .MenuChoiceLoc add r1, r3, r0 mov r0, #0x0 ldrb r1, [r1] cmp r1, #0x0 bne Return FightOptionChosen: ldr r0, .ProtectStructure lsl r1, r3, #0x4 add r1, r1, r0 ldrb r0, [r1] lsl r0, r0, #0x1D cmp r0, #0x0 bge LoadMoveIndex Struggle: mov r4, #0xA5 b BufferMoveData LoadMoveIndex: ldr r0, .Pointer ldr r0, [r0, #0x0] add r0, r3 add r0, #0x80 ldrb r0, [r0] @MoveSlotChosen lsl r0, r0, #0x1 mov r1, #0x58 mul r1, r3 add r0, r0, r1 ldr r1, .BattleData add r0, r0, r1 ldrh r4, [r0, #0xC] BufferMoveData: ldr r2, .MoveData lsl r0, r4, #0x1 add r0, r0, r4 lsl r0, r0, #0x2 add r4, r0, r2 BufferBattleData: ldr r0, .BattleData add r0, #0x20 mov r1, #0x58 mul r1, r3 add r0, r0, r1 ldrb r1, [r0] mov r0, #0x0 PranksterCheck: cmp r1, #0x9F bne GaleWingsCheck Prankster: ldrb r1, [r4, #0xA] cmp r1, #0x2 bne LoadMovePriority mov r0, #0x1 b LoadMovePriority GaleWingsCheck: cmp r1, #0xB2 bne LoadMovePriority Galewings: ldrb r1, [r4, #0x2] cmp r1, #0x2 bne LoadMovePriority mov r0, #0x1 LoadMovePriority: ldrb r1, [r4, #0x7] add r0, r0, r1 Return: bx lr .align 2 .MenuChoiceLoc: .word 0x0202421C .ProtectStructure: .word 0x0202433C .Pointer: .word 0x0202449C .BattleData: .word 0x02024084 .MoveData: .word 0x0831C198 .align 2 BracketBL: push {lr} mov r3, r0 mov r1, #0x58 ldr r0, .BattleDataItem mul r1, r3 add r4, r0, r1 CheckItem: ldrh r0, [r4, #0xE] cmp r0, #0xAF bne LoadItemEffect EngimaBerry: ldr r1, .EnigmaRamLoc lsl r0, r3, #0x3 sub r0, r0, r3 lsl r0, r0, #0x2 add r0, r0, r1 ldrb r6, [r0, #0x7] ldrb r5, [r0, #0x1A] b QuickClawCheck LoadItemEffect: bl 0xD74DC lsl r0, r0, #0x18 lsl r6, r0, #0x18 ldrh r0, [r4, #0xE] bl 0xD7500 lsl r0, r0, #0x18 lsl r5, r0, #0x18 QuickClawCheck: cmp r6, #0x1A bne CustapBerryCheck QuickClawActivationCalc: ldr r0, .RandomLoc ldrh r7, [r0] lsl r0, r5, #0x10 sub r0, r0, r5 mov r1, #0x64 bl 0x2E7540 cmp r7, r0 bge StallCheck mov r7, #0x1 b StoreBracket CustapBerryCheck: cmp r6, #0x4D bne LaggingTailCheck CustapBerry: CheckHP: ldrh r0, [r4, #0x8] ldrh r1, [r4, #0xC] lsl r1, r1, #0x2 cmp r0, r1 bgt StallCheck SetRamLoc: mov r7, #0x1 ldr r0, .CustapBerryLoc strb r7, [r0] b StoreBracket LaggingTailCheck: cmp r6, #0x4A bne StallCheck LaggingTail: mov r0, #0x2 neg r7, r0 b StoreBracket StallCheck: mov r7, #0x0 ldrb r0, [r4] cmp r0, #0x65 bne StoreBracket Stall: mov r0, #0x1 neg r7, r0 StoreBracket: mov r0, r7 PopRegister: pop {r1} bx r1 .align 2 .BattleDataItem: .word 0x020240A4 .EnigmaRamLoc: .word 0x02024404 .RandomLoc: .word 0x02024330 .CustapBerryLoc: .word 0x02CCCCCC .align 2 SpeedBL: push {lr} add sp, #-0x4 mov r7, r0 mov r5, #0x58 ldr r6, .BattleData2 mul r5, r7 add r6, r5, r6 mov r5, #0x1 str r0, [sp, #0x0] ApplyStatBoost: ldrh r5, [r6, #0x6] ldr r2, .StatModTable ldrb r1, [r6, #0x1B] lsl r1, r1, #0x1 add r2, r1, r2 ldrb r0, [r2] mul r0, r5 ldrb r1, [r2, #0x1] bl 0x2E7540 mov r5, r0 CloudNineCheck: mov r0, #0x13 mov r1, #0x0 mov r2, #0xD mov r3, #0x0 bl 0x42828 lsl r0, r0, #0x18 cmp r0, #0x0 bne NoWeather AirLockCheck: mov r0, #0x0 str r0, [sp, #0x0] mov r0, #0x13 mov r1, #0x0 mov r2, #0x4D mov r3, #0x0 bl 0x42828 lsl r0, r0, #0x18 cmp r0, #0x0 bne NoWeather LoadWeather: ldr r4, .WeatherLoc ldrh r4, [r4] add r2, r2, r6 add r2, #0x20 ldrb r2, [r2] RainCheck: mov r0, #0x7 and r0, r4 cmp r0, #0x0 beq SunCheck SwiftSwimCheck: cmp r2, #0x21 beq WeatherBoost SunCheck: mov r0, #0x60 and r0, r4 cmp r0, #0x0 beq SandstormCheck ChlorophyllCheck: cmp r2, #0x22 beq WeatherBoost SandstormCheck: mov r0, #0x18 and r0, r4 cmp r0, #0x0 beq NoWeather SandRushCheck: cmp r2, #0x93 bne NoWeather WeatherBoost: lsl r5, r5, #0x1 NoWeather: mov r2, r6 add r2, #0x20 ldrb r2, [r2] SlowStartCheck: cmp r2, #0x71 bne TailwindCheck ldr r0, .SlowStartLoc add r0, r0, r7 CheckTurnCounter: ldrb r0, [r0, #0x0] cmp r0, #0x0 beq TailwindCheck lsr r5, r5, #0x1 TailwindCheck: ldr r0, .TailwindAddr cmp r7, #0x1 beq EnemyTailwind cmp r7, #0x3 beq EnemyTailwind PlayerTailwind: b CheckFlag EnemyTailwind: add r0, #0x1 CheckFlag: ldrb r0, [r0, #0x0] cmp r0, #0x0 beq CheckItem2 lsl r5, r5, #0x1 CheckItem2: ldrh r0, [r6, #0x2e] cmp r0, #0xAF bne LoadItemEffect2 EnigmaBerry2: ldr r1, .EnigmaRamLoc2 lsl r0, r7, #0x3 sub r0, r0, r3 lsl r0, r0, #0x2 add r0, r0, r1 ldrb r0, [r0, #0x7] b MachoBraceCheck LoadItemEffect2: bl 0xD74DC lsl r0, r0, #0x18 lsr r0, r0, #0x18 MachoBraceCheck: cmp r0, #0x18 bne IronBallCheck lsr r5, r5, #0x1 IronBallCheck: cmp r0, #0x47 bne QuickPowderCheck lsr r5, r5, #0x1 QuickPowderCheck: cmp r0, #0x48 bne ChoiceScarfCheck ldrh r0, [r6] cmp r0, #0x84 bne ChoiceScarfCheck lsr r1, r5, #0x1 add r5, r1, r5 ChoiceScarfCheck: cmp r0, #0x1D bne BadgeCheck bl 0xD7500 lsl r0, r0, #0x18 lsl r0, r0, #0x18 cmp r0, #0x2 bne BadgeCheck lsr r0, r5, #0x1 add r5, r0, r5 BadgeCheck: ldr r0, .BadgeLoc ldr r0, [r0] ldr r1, .BadgeCheck and r0, r1 cmp r0, #0x0 bne StatusCheck ldr r0, .Flag bl 0x9D790 lsl r0, r0, #0x18 cmp r0, #0x0 beq StatusCheck mov r0, r7 bl 0xA6A30 lsl r0, r0, #0x18 cmp r0, #0x0 bne StatusCheck mov r0, #0x6E mul r0, r5 mov r1, #0x64 bl 0x2E7B68 mov r5, r0 StatusCheck: ldr r0, [r6, #0x4c] add r6, #0x20 ldrb r1, [r6, #0x0] cmp r1, #0x9B bne ParalysisCheck QuickFeetCheck: cmp r0, #0x0 beq ReturnSpeed lsl r5, r5, #0x1 b ReturnSpeed ParalysisCheck: mov r1, #0x40 and r0, r1 cmp r0, #0x0 beq ReturnSpeed lsr r5, r5, #0x2 ReturnSpeed: mov r0, r5 add sp, #0x4 pop {r1} bx r1 .align 2 .BattleData2: .word 0x02024084 .StatModTable: .word 0x08329D2E .WeatherLoc: .word 0x020243CC .SlowStartLoc: .word 0x02SSSSSS .TailwindAddr: .word 0x02TTTTTT .EnigmaRamLoc2: .word 0x02024404 .BadgeLoc: .word 0x02022FEC .BadgeCheck: .word 0x023F0102 .Flag: .word 0x00000868
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.
@Fix
change
add r2, r2, r6
to
mov r2, r6
Intimidate Update.
I know this is from 2015, but I tested this and it did not work. Do I need something like the Physical/Special split?Tinted Lens, Solid Rock, Filter (+ Expert Belt)
Spoiler:
Routine I does the actual Damage Manipulation and Routine II makes the AI recognize
Damage Modification due to these Abilities.
Replace KK with Held Item Effect Byte of Expert Belt.
Fire Red:-
Spoiler:
Routine I:
Code:.text .align 2 .thumb .thumb_func .global tintedlenssolidrockexpertbelt EffectivnessCheck: ldrb r1, [r0, #0x0] mov r0, #0x8 and r0, r1 cmp r0, #0x0 bne NotEffective MissCheck: mov r0, #0x31 and r0, r1 cmp r0, #0x0 bne Exit NotVeryEffectiveCheck: mov r0, #0x4 and r0, r1 cmp r0, #0x0 beq SuperEffectiveCheck ldr r0, .UserBank ldr r1, .BattleStruct mov r2, #0x58 ldrb r0, [r0] mul r2, r0 add r1, r1, r2 ldrb r1, [r1] cmp r1, [B][U]#0x6F[/U][/B] bne Exit HasTintedLens: ldr r0, .Damage ldrh r1, [r0] lsl r1, r1, #0x1 strh r1, [r0] b Exit SuperEffectiveCheck: mov r0, #0x2 and r0, r1 cmp r0, #0x0 beq Exit ldr r0, .TargetBank ldr r4, .BattleStruct mov r3, #0x58 ldrb r0, [r0] mul r0, r3 add r1, r0, r4 ldrb r0, [r1] cmp r0, [B][U]#0x75[/U][/B] beq HasSolidRock cmp r0, [B][U]#0x70[/U][/B] bne ExpertBeltCheck HasSolidRock: ldr r0, .Damage ldrh r1, [r0] lsl r2, r1, #0x1 add r1, r1, r2 lsr r1, r1, #0x2 cmp r1, #0x0 bne NotZero mov r1, #0x1 NotZero: strh r1, [r0] ExpertBeltCheck: ldr r0, .UserBank ldrb r0, [r0] mul r0, r3 add r1, r0, r4 add r1, #0xE ldrh r0, [r1] bl EffectGetter cmp r0, [U][B]#0xKK[/B][/U] bne Exit ldr r4, .Damage ldrh r0, [r4] mov r2, #0x6 mul r0, r2 mov r1, #0x5 bl Divider strh r0, [r4] Exit: ldr r1, =0x0801EA71 bx r1 NotEffective: ldr r1, =0x0801EA5F bx r1 EffectGetter: ldr r1, =0x0809A925 bx r1 Divider: ldr r2, =0x081E4019 bx r2 .align 2 .UserBank: .word 0x02023D6B .TargetBank: .word 0x02023D6C .BattleStruct: .word 0x02023C04 .Damage: .word 0x02023D50 /* 1EA54: 00 49 08 47 XX+1 XX XX 08 00 00*/
Routine II:
Code:.text .align 2 .thumb .thumb_func .global tintedlenssolidrockexpertbeltai StruggleCheck: mov r1, r10 cmp r1, #0xA5 beq Quit EffectivnessCheck: ldrb r1, [r0, #0x0] mov r0, #0x39 and r0, r1 cmp r0, #0x0 bne Exit NotVeryEffectiveCheck: mov r0, #0x4 and r0, r1 cmp r0, #0x0 beq SuperEffectiveCheck ldr r0, .UserBank ldr r1, .BattleStruct mov r2, #0x58 ldrb r0, [r0] mul r2, r0 add r1, r1, r2 ldrb r1, [r1] cmp r1, [B][U]#0x6F[/U][/B] bne Exit HasTintedLens: ldr r0, .Damage ldrh r1, [r0] lsl r1, r1, #0x1 strh r1, [r0] b Exit SuperEffectiveCheck: mov r0, #0x2 and r0, r1 cmp r0, #0x0 beq Exit ldr r0, .TargetBank ldr r4, .BattleStruct mov r3, #0x58 ldrb r0, [r0] mul r0, r3 add r1, r0, r4 ldrb r0, [r1] cmp r0, [B][U]#0x75[/U][/B] beq HasSolidRock cmp r0, [B][U]#0x70[/U][/B] bne ExpertBeltCheck HasSolidRock: ldr r0, .Damage ldrh r1, [r0] lsl r2, r1, #0x1 add r1, r1, r2 lsr r1, r1, #0x2 cmp r1, #0x0 bne NotZero mov r1, #0x1 NotZero: strh r1, [r0] ExpertBeltCheck: ldr r0, .UserBank ldrb r0, [r0] mul r0, r3 add r1, r0, r4 add r1, #0xE ldrh r0, [r1] bl EffectGetter cmp r0, [B][U]#0xKK[/U][/B] bne Exit ldr r4, .Damage ldrh r0, [r4] mov r2, #0x6 mul r0, r2 mov r1, #0x5 bl Divider strh r0, [r4] Exit: mov r0, sp ldrb r0, [r0, #0x0] Quit: add sp, #0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 EffectGetter: ldr r1, =0x0809A925 bx r1 Divider: ldr r2, =0x081E4019 bx r2 .align 2 .UserBank: .word 0x02023D6B .TargetBank: .word 0x02023D6C .BattleStruct: .word 0x02023C04 .Damage: .word 0x02023D50 /* 1EFAC: 00 00 00 00 00 49 08 47 XX+1 XX XX 08*/
Emerald:-
Spoiler:
Routine I:
Code:.text .align 2 .thumb .thumb_func .global tintedlenssolidrockexpertbelt EffectivnessCheck: ldrb r1, [r0, #0x0] mov r0, #0x8 and r0, r1 cmp r0, #0x0 bne NotEffective MissCheck: mov r0, #0x31 and r0, r1 cmp r0, #0x0 bne Exit NotVeryEffectiveCheck: mov r0, #0x4 and r0, r1 cmp r0, #0x0 beq SuperEffectiveCheck ldr r0, .UserBank ldr r1, .BattleStruct mov r2, #0x58 ldrb r0, [r0] mul r2, r0 add r1, r1, r2 ldrb r1, [r1] cmp r1, [B][U]#0x6F[/U][/B] bne Exit HasTintedLens: ldr r0, .Damage ldrh r1, [r0] lsl r1, r1, #0x1 strh r1, [r0] b Exit SuperEffectiveCheck: mov r0, #0x2 and r0, r1 cmp r0, #0x0 beq Exit ldr r0, .TargetBank ldr r4, .BattleStruct mov r3, #0x58 ldrb r0, [r0] mul r0, r3 add r1, r0, r4 ldrb r0, [r1] cmp r0, [B][U]#0x75[/U][/B] beq HasSolidRock cmp r0, [B][U]#0x70[/U][/B] bne ExpertBeltCheck HasSolidRock: ldr r0, .Damage ldrh r1, [r0] lsl r2, r1, #0x1 add r1, r1, r2 lsr r1, r1, #0x2 cmp r1, #0x0 bne NotZero mov r1, #0x1 NotZero: strh r1, [r0] ExpertBeltCheck: ldr r0, .UserBank ldrb r0, [r0] mul r0, r3 add r1, r0, r4 add r1, #0xE ldrh r0, [r1] bl EffectGetter cmp r0, [B][U]#0xKK[/U][/B] bne Exit ldr r4, .Damage ldrh r0, [r4] mov r2, #0x6 mul r0, r2 mov r1, #0x5 bl Divider strh r0, [r4] Exit: ldr r1, =0x08047261 bx r1 NotEffective: ldr r1, =0x0804724F bx r1 EffectGetter: ldr r1, =0x080D74DD bx r1 Divider: ldr r2, =0x082E7541 bx r2 .align 2 .UserBank: .word 0x0202420B .TargetBank: .word 0x0202420C .BattleStruct: .word 0x020240A4 .Damage: .word 0x020241F0 /* 47244: 00 49 08 47 XX+1 XX XX 08 00 00*/
Routine II:
Code:.text .align 2 .thumb .thumb_func .global tintedlenssolidrockexpertbeltai StruggleCheck: mov r1, r10 cmp r1, #0xA5 beq Quit EffectivnessCheck: ldrb r1, [r0, #0x0] mov r0, #0x39 and r0, r1 cmp r0, #0x0 bne Exit NotVeryEffectiveCheck: mov r0, #0x4 and r0, r1 cmp r0, #0x0 beq SuperEffectiveCheck ldr r0, .UserBank ldr r1, .BattleStruct mov r2, #0x58 ldrb r0, [r0] mul r2, r0 add r1, r1, r2 ldrb r1, [r1] cmp r1, [B][U]#0x6F[/U][/B] bne Exit HasTintedLens: ldr r0, .Damage ldrh r1, [r0] lsl r1, r1, #0x1 strh r1, [r0] b Exit SuperEffectiveCheck: mov r0, #0x2 and r0, r1 cmp r0, #0x0 beq Exit ldr r0, .TargetBank ldr r4, .BattleStruct mov r3, #0x58 ldrb r0, [r0] mul r0, r3 add r1, r0, r4 ldrb r0, [r1] cmp r0, [B][U]#0x75[/U][/B] beq HasSolidRock cmp r0, [B][U]#0x70[/U][/B] bne ExpertBeltCheck HasSolidRock: ldr r0, .Damage ldrh r1, [r0] lsl r2, r1, #0x1 add r1, r1, r2 lsr r1, r1, #0x2 cmp r1, #0x0 bne NotZero mov r1, #0x1 NotZero: strh r1, [r0] ExpertBeltCheck: ldr r0, .UserBank ldrb r0, [r0] mul r0, r3 add r1, r0, r4 add r1, #0xE ldrh r0, [r1] bl EffectGetter cmp r0, [B][U]#0xKK[/U][/B] bne Exit ldr r4, .Damage ldrh r0, [r4] mov r2, #0x6 mul r0, r2 mov r1, #0x5 bl Divider strh r0, [r4] Exit: mov r0, sp ldrb r0, [r0, #0x0] Quit: add sp, #0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 EffectGetter: ldr r1, =0x080D74DD bx r1 Divider: ldr r2, =0x082E7541 bx r2 .align 2 .UserBank: .word 0x0202420B .TargetBank: .word 0x0202420C .BattleStruct: .word 0x020240A4 .Damage: .word 0x020241F0 /* 4779C: 00 00 00 00 00 49 08 47 XX+1 XX XX 08 00 00*/
I have slightly updated Mold Breaker using MrDS's Emerald Ports for this routine. The old routines also work perfectly fine but the new one's are optimized and more understandable.