I get an error, the screen freezes:
.align 2
.thumb
.thumb_func
@ 00 48 00 47 XX XX XX 08 00 00 00 at 0803EFF8
@ also change gItems and gBattleMoves at the bottom of the post
CheckAnyItem:
cmp r2, #0x43 @ boost life orb held effect
beq Lifeorb
cmp r2, #0x44 @ boost fairy type held effect
beq FairyPlate
cmp r2, #0x45 @ adamant orb held effect
beq AdamantOrb
cmp r2, #0x46 @ lustrous orb held effect
beq LustrousOrb
cmp r2, #0x47 @ griseous orb held effect
beq GriseousOrb
cmp r2, #0x2D
bne Back
ldrh r0, [r6]
cmp r0, #0x19
beq Lightball
b Back
FairyPlate:
mov r0, #9 @ your fairy type
mov r1, #9 @ your fairy type
b CheckTypeOfAttack
AdamantOrb:
mov r0, #8
mov r1, #16
b CheckTypeOfAttack
LustrousOrb:
mov r0, #0xB
mov r1, #16
b CheckTypeOfAttack
GriseousOrb:
mov r0, #7
mov r1, #16
@b CheckTypeOfAttack @ fall through
CheckTypeOfAttack:
ldr r4, gBattleStruct
ldr r4, [r4]
ldrb r4, [r4, #0x13] @ check for the dynamic move type
cmp r4, #0
beq GetMoveType
mov r5, #0x3F
and r4, r5
cmp r4, r1
beq Boost
cmp r4, r2
beq Boost
b PopAndBack
GetMoveType:
ldr r3, gCurrentMove
ldrh r3, [r3]
ldr r4, gBattleMoves
mov r5, #0xC
mul r5, r3
add r4, r5
ldrb r4, [r4, #2]
cmp r4, r1
beq Boost
cmp r4, r2
bne PopAndBack
@ fall through
Boost:
pop {r0-r5}
ldrh r3, [r6, #0x2E]
lsl r0, r3, #4
push {r1}
mov r1, #6
mul r3, r1
pop {r1}
add r3, r0
lsl r3, #1
ldr r0, gItems
add r3, r0
add r3, #0x13
ldrb r0, [r3]
mov r3, #0x52
mul r0, r3
lsr r0, #6
add r0, #0x7B
mul r7, r0
lsr r7, #7
mov r3, r8
mul r3, r0
lsr r3, #7
mov r8, r3
b Back
Lifeorb:
mov r0, r8
mov r3, #0xA7
mul r0, r3
lsr r0, #7
mov r8, r0
mul r7, r3
lsr r7, #7
b Back
Lightball:
mov r0, r8
lsl r0, r0, #0x1
mov r8, r0
lsl r7, r7, #0x1
Back:
ldr r0, Return
bx r0
PopAndBack:
pop {r0-r5}
b Back
.align 2
Return: .word 0x0803F00A | 1
gCurrentMove: .word 0x02023D4A
gBattleMoves: .word 0x08250C04 @ change this
gBattleStruct: .word 0x02023FE8
gItems: .word 0x083DB028 @ change this
43 2A 47 D0 4D 2A 0B D0 4E 2A 0C D0 4F 2A 0D D0 50 2A 0E D0 2D 2A 49 D1 30 88 19 28 42 D0 45 E0 17 20 17 21 07 E0 08 20 10 21 04 E0 0B 20 10 21 01 E0 07 20 10 21 22 4C 24 68 E4 7C 00 2C 06 D0 3F 25 2C 40 8C 42 0D D0 94 42 0B D0 30 E0 1A 4B 1B 88 1A 4C 0C 25 5D 43 64 19 A4 78 8C 42 01 D0 94 42 25 D1 3F BC F3 8D 18 01 02 B4 06 21 4B 43 02 BC 1B 18 5B 00 13 48 1B 18 13 33 18 78 52 23 58 43 80 09 7B 30 47 43 FF 09 43 46 43 43 DB 09 98 46 0B E0 40 46 A7 23 58 43 C0 09 80 46 5F 43 FF 09 03 E0 40 46 40 00 80 46 7F 00 01 48 00 47 3F BC FB E7 0B F0 03 08 4A 3D 02 02 00 00 90 08 E8 3F 02 02 10 57 96 08