Post by Aryan 10 on Jun 19, 2017 8:17:40 GMT 5.5
Weather Rocks
The following routines hijack the setweather commands and make them check your held item's effect byte.
First, insert this routine, and keep note of where you inserted this. This returns the held item effect byte to r0:
Next, insert these routines:
Smooth Rock:
Damp Rock:
Heat Rock:
Icy Rock:
In every rock routine
Change the XXXXXX to the address you inserted your first routine (the item check routine) at.
Credit goes to HidoRanBlaze!
The following routines hijack the setweather commands and make them check your held item's effect byte.
First, insert this routine, and keep note of where you inserted this. This returns the held item effect byte to r0:
.text
.align 2
.thumb
.thumb_func
.global itemcheck
main:
ldr r0, .items
ldr r1, .struct
ldr r2, .bank
ldrb r2, [r2]
mov r3, #0x58
mul r2, r3
add r1, r2
add r1, #0x2E
ldrh r1, [r1]
mov r2, #0x2C
mul r1, r2
add r0, r1
ldrb r0, [r0, #0x12]
bx lr
.align 2
.items: .word 0x083DB028
.struct: .word 0x02023BE4
.bank: .word 0x02023D6B
Next, insert these routines:
Smooth Rock:
.text
.align 2
.thumb
.thumb_func
.global smoothrock
main:
mov r0, #0x3
strb r0, [r1, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x48 @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return
itemcheck:
ldr r0, .routine
bx r0
original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]
return:
ldr r0, .return
bx r0
.align 2
.routine: .word 0x08XXXXXX
.weatherturns: .word 0x02023F48
.return: .word 0x08028CD7
@ insert 01 48 00 47 C0 46 XX XX XX 08 at 08028CCA
.align 2
.thumb
.thumb_func
.global smoothrock
main:
mov r0, #0x3
strb r0, [r1, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x48 @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return
itemcheck:
ldr r0, .routine
bx r0
original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]
return:
ldr r0, .return
bx r0
.align 2
.routine: .word 0x08XXXXXX
.weatherturns: .word 0x02023F48
.return: .word 0x08028CD7
@ insert 01 48 00 47 C0 46 XX XX XX 08 at 08028CCA
Damp Rock:
.text
.align 2
.thumb
.thumb_func
.global damprock
main:
ldr r0, .address
strb r1, [r0, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x49 @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return
itemcheck:
ldr r0, .routine
bx r0
original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]
return:
ldr r0, .return
bx r0
.align 2
.address: .word 0x02023E82
.routine: .word 0x08XXXXXX
.weatherturns: .word 0x02023F48
.return: .word 0x080274E5
@ insert 00 48 00 47 XX XX XX 08 at 080274D8
.align 2
.thumb
.thumb_func
.global damprock
main:
ldr r0, .address
strb r1, [r0, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x49 @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return
itemcheck:
ldr r0, .routine
bx r0
original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]
return:
ldr r0, .return
bx r0
.align 2
.address: .word 0x02023E82
.routine: .word 0x08XXXXXX
.weatherturns: .word 0x02023F48
.return: .word 0x080274E5
@ insert 00 48 00 47 XX XX XX 08 at 080274D8
Heat Rock:
.text
.align 2
.thumb
.thumb_func
.global heatrock
main:
ldr r1, .address
mov r0, #0x4
strb r0, [r1, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x4A @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return
itemcheck:
ldr r0, .routine
bx r0
original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]
return:
ldr r0, .return
bx r0
.align 2
.address: .word 0x02023E82
.routine: .word 0x08XXXXXX
.weatherturns: .word 0x02023F48
.return: .word 0x0802B313
@ insert 00 49 08 47 XX XX XX 08 at 0802B304
.align 2
.thumb
.thumb_func
.global heatrock
main:
ldr r1, .address
mov r0, #0x4
strb r0, [r1, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x4A @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return
itemcheck:
ldr r0, .routine
bx r0
original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]
return:
ldr r0, .return
bx r0
.align 2
.address: .word 0x02023E82
.routine: .word 0x08XXXXXX
.weatherturns: .word 0x02023F48
.return: .word 0x0802B313
@ insert 00 49 08 47 XX XX XX 08 at 0802B304
Icy Rock:
.text
.align 2
.thumb
.thumb_func
.global icyrock
main:
mov r1, #0x5
strb r1, [r0, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x4B @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return
itemcheck:
ldr r0, .routine
bx r0
original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]
return:
ldr r0, .return
bx r0
.align 2
.routine: .word 0x08XXXXXX
.weatherturns: .word 0x02023F48
.return: .word 0x0802BCB3
@ insert 00 49 08 47 XX XX XX 08 at 0802BCA8
.align 2
.thumb
.thumb_func
.global icyrock
main:
mov r1, #0x5
strb r1, [r0, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x4B @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return
itemcheck:
ldr r0, .routine
bx r0
original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]
return:
ldr r0, .return
bx r0
.align 2
.routine: .word 0x08XXXXXX
.weatherturns: .word 0x02023F48
.return: .word 0x0802BCB3
@ insert 00 49 08 47 XX XX XX 08 at 0802BCA8
In every rock routine
.routine: .word 0x08XXXXXX
Change the XXXXXX to the address you inserted your first routine (the item check routine) at.
Credit goes to HidoRanBlaze!