Male
Seen November 12th, 2021
Posted April 30th, 2020
218 posts
10.2 Years

Arceus and Giratina forms


Spoiler:

Emerald
Spoiler:

Insert this routine anywhere :
Spoiler:

.thumb
.thumb_func

.equ GriseousIndex, 0x____
.equ GiratinaIndex, 0x____
.equ GiratinaOIndex, 0x____

.equ ArceusNormal, 0x____

.equ FistPlateIndex, 0x____
.equ ArceusFight, 0x____

.equ SkyPlateIndex, 0x____
.equ ArceusFly, 0x____

.equ ToxicPlateIndex, 0x____
.equ ArceusPoison, 0x____

.equ EarthPlateIndex, 0x____
.equ ArceusGround, 0x____

.equ StonePlateIndex, 0x____
.equ ArceusRock, 0x____

.equ InsectPlateIndex, 0x____
.equ ArceusBug, 0x____

.equ SpookyPlateIndex, 0x____
.equ ArceusGhost, 0x____

.equ IronPlateIndex, 0x____
.equ ArceusSteel, 0x____

.equ FlamePlateIndex, 0x____
.equ ArceusFire, 0x____

.equ SplashPlateIndex, 0x____
.equ ArceusWater, 0x____

.equ ZapPlateIndex, 0x____
.equ ArceusElectric, 0x____

.equ MeadowPlateIndex, 0x____
.equ ArceusGrass, 0x____

.equ IciclePlateIndex, 0x____
.equ ArceusIce, 0x____

.equ DracoPlateIndex, 0x____
.equ ArceusDragon, 0x____

.equ DreadPlateIndex, 0x____
.equ ArceusDark, 0x____

.equ PixiPlateIndex, 0x____
.equ ArceusFairy, 0x____

Start:
ldrb r1, [r4]
ldrb r0, [r4, #1]
lsl r0, r0, #8
add r1, r1, r0
mov r0, r8
strh r1, [r0, #2]
push {r0-r7}

Initialising:
ldrh r2, [r0]
ldr r6, GiratinaO
cmp r2, r6
beq GrisCheck
ldr r6, Giratina
cmp r2, r6
beq GrisCheck2

LoadGivenItem:
mov r6, #6
adr r5, Table
add r5, #4
mov r7, r1
bl LoopLoad
cmp r6, #0
bne ItemInTable

ItemNotInTable:
adr r5, Table
add r5, #6
mov r6, #6
mov r7, r2
bl LoopLoad
cmp r6, #1
bne Return
ldrh r4, [r5, #2]
b Changing

GrisCheck:
ldr r6, GriseousOrb
cmp r1, r6
beq LoadGivenItem
ldr r4, Giratina
b Changing

GrisCheck2:
ldr r6, GriseousOrb
cmp r1, r6
bne LoadGivenItem
ldr r4, GiratinaO
b Changing

ItemInTable:
ldrh r3, [r5, #2]
mov r7, r2
mov r6, #6
adr r5, Table
bl LoopLoad
cmp r6, #1
bne Return
mov r4, r3
b Changing

Return:
pop {r0-r7}
Return3:
ldr r0, Back
bx r0
Return2:
ldr r0, Back2
bx r0

Changing:
strh r4, [r0]
pop {r0-r7}
ldr r3, Limit
cmp r0, r3
bhi Return3
mov r0, r7
ldr r3, pokemon_calc_checksum
bl Call
strh r0, [r7, #0x1C]
mov r0, r7
ldr r3, pokemon_encrypt
bl Call
mov r0, r7
ldr r3, pokemon_calculate_stats
bl Call
b Return2

LoopLoad:
push {lr}
Looping:
ldrh r4, [r5]
cmp r4, #0
beq Nope
cmp r4, r7
beq Yep
add r5, r6
b Looping
Nope:
mov r6, #0
pop {pc}
Yep:
mov r6, #1
pop {pc}

Call:
mov pc, r3

.align 2
GriseousOrb: .word GriseousIndex
Giratina: .word GiratinaIndex
GiratinaO: .word GiratinaOIndex
pokemon_calc_checksum: .word 0x08068C78
pokemon_encrypt: .word 0x0806A228
pokemon_calculate_stats: .word 0x08068D0C
Back: .word 0x0806B3D8+1
Back2: .word 0x0806B3EC+1
Limit: .word 0x02024744
Table:
.hword ArceusNormal, ArceusNormal, FistPlateIndex, ArceusFight, ArceusNormal, SkyPlateIndex, ArceusFly, ArceusNormal, ToxicPlateIndex
.hword ArceusPoison, ArceusNormal, EarthPlateIndex, ArceusGround, ArceusNormal, StonePlateIndex, ArceusRock, ArceusNormal, InsectPlateIndex
.hword ArceusBug, ArceusNormal, SpookyPlateIndex, ArceusGhost, ArceusNormal, IronPlateIndex, ArceusSteel, ArceusNormal, FlamePlateIndex
.hword ArceusFire, ArceusNormal, SplashPlateIndex, ArceusWater, ArceusNormal, ZapPlateIndex, ArceusElectric, ArceusNormal, MeadowPlateIndex
.hword ArceusGrass, ArceusNormal, IciclePlateIndex, ArceusIce, ArceusNormal, DracoPlateIndex, ArceusDragon, ArceusNormal, DreadPlateIndex
.hword ArceusDark, ArceusNormal, PixiPlateIndex, ArceusFairy, ArceusNormal, 0x0, 0x0, 0x0, 0x0

How to use it ? :
Spoiler:

At the start of the routine, just replace the 0x___ with the values you use.

/* 00 49 08 47 xx+1 xx xx 08 at 0806B04C with xx xx xx being the reversed address of your routine*/


Fire Red :
Spoiler:

Insert this routine anywhere :
Spoiler:

.thumb
.thumb_func

.equ GriseousIndex, 0x____
.equ GiratinaIndex, 0x____
.equ GiratinaOIndex, 0x____

.equ ArceusNormal, 0x____

.equ FistPlateIndex, 0x____
.equ ArceusFight, 0x____

.equ SkyPlateIndex, 0x____
.equ ArceusFly, 0x____

.equ ToxicPlateIndex, 0x____
.equ ArceusPoison, 0x____

.equ EarthPlateIndex, 0x____
.equ ArceusGround, 0x____

.equ StonePlateIndex, 0x____
.equ ArceusRock, 0x____

.equ InsectPlateIndex, 0x____
.equ ArceusBug, 0x____

.equ SpookyPlateIndex, 0x____
.equ ArceusGhost, 0x____

.equ IronPlateIndex, 0x____
.equ ArceusSteel, 0x____

.equ FlamePlateIndex, 0x____
.equ ArceusFire, 0x____

.equ SplashPlateIndex, 0x____
.equ ArceusWater, 0x____

.equ ZapPlateIndex, 0x____
.equ ArceusElectric, 0x____

.equ MeadowPlateIndex, 0x____
.equ ArceusGrass, 0x____

.equ IciclePlateIndex, 0x____
.equ ArceusIce, 0x____

.equ DracoPlateIndex, 0x____
.equ ArceusDragon, 0x____

.equ DreadPlateIndex, 0x____
.equ ArceusDark, 0x____

.equ PixiPlateIndex, 0x____
.equ ArceusFairy, 0x____

Start:
ldrb r1, [r4]
ldrb r0, [r4, #1]
lsl r0, r0, #8
add r1, r1, r0
mov r0, r8
strh r1, [r0, #2]
push {r0-r7}

Initialising:
ldrh r2, [r0]
ldr r6, GiratinaO
cmp r2, r6
beq GrisCheck
ldr r6, Giratina
cmp r2, r6
beq GrisCheck2

LoadGivenItem:
mov r6, #6
adr r5, Table
add r5, #4
mov r7, r1
bl LoopLoad
cmp r6, #0
bne ItemInTable

ItemNotInTable:
adr r5, Table
add r5, #6
mov r6, #6
mov r7, r2
bl LoopLoad
cmp r6, #1
bne Return
ldrh r4, [r5, #2]
b Changing

GrisCheck:
ldr r6, GriseousOrb
cmp r1, r6
beq LoadGivenItem
ldr r4, Giratina
b Changing

GrisCheck2:
ldr r6, GriseousOrb
cmp r1, r6
bne LoadGivenItem
ldr r4, GiratinaO
b Changing

ItemInTable:
ldrh r3, [r5, #2]
mov r7, r2
mov r6, #6
adr r5, Table
bl LoopLoad
cmp r6, #1
bne Return
mov r4, r3
b Changing

Return:
pop {r0-r7}
Return3:
ldr r0, Back
bx r0
Return2:
ldr r0, Back2
bx r0

Changing:
strh r4, [r0]
pop {r0-r7}
ldr r3, Limit
cmp r0, r3
bhi Return3
mov r0, r7
ldr r3, pokemon_calc_checksum
bl Call
strh r0, [r7, #0x1C]
mov r0, r7
ldr r3, pokemon_encrypt
bl Call
mov r0, r7
ldr r3, pokemon_calculate_stats
bl Call
b Return2

LoopLoad:
push {lr}
Looping:
ldrh r4, [r5]
cmp r4, #0
beq Nope
cmp r4, r7
beq Yep
add r5, r6
b Looping
Nope:
mov r6, #0
pop {pc}
Yep:
mov r6, #1
pop {pc}

Call:
mov pc, r3

.align 2
GriseousOrb: .word GriseousIndex
Giratina: .word GiratinaIndex
GiratinaO: .word GiratinaOIndex
pokemon_calc_checksum:	.word 0x0803E3E8+1
pokemon_encrypt:	.word 0x0803F8F8+1
pokemon_calculate_stats:	.word 0x0803E47C+1
Back:	.word 0x08040ADA+1
Back2:	.word 0x08040AEE+1
Limit: .word 0x02024540
Table:
.hword ArceusNormal, ArceusNormal, FistPlateIndex, ArceusFight, ArceusNormal, SkyPlateIndex, ArceusFly, ArceusNormal, ToxicPlateIndex
.hword ArceusPoison, ArceusNormal, EarthPlateIndex, ArceusGround, ArceusNormal, StonePlateIndex, ArceusRock, ArceusNormal, InsectPlateIndex
.hword ArceusBug, ArceusNormal, SpookyPlateIndex, ArceusGhost, ArceusNormal, IronPlateIndex, ArceusSteel, ArceusNormal, FlamePlateIndex
.hword ArceusFire, ArceusNormal, SplashPlateIndex, ArceusWater, ArceusNormal, ZapPlateIndex, ArceusElectric, ArceusNormal, MeadowPlateIndex
.hword ArceusGrass, ArceusNormal, IciclePlateIndex, ArceusIce, ArceusNormal, DracoPlateIndex, ArceusDragon, ArceusNormal, DreadPlateIndex
.hword ArceusDark, ArceusNormal, PixiPlateIndex, ArceusFairy, ArceusNormal, 0x0, 0x0, 0x0, 0x0

How to use it :
Spoiler:

At the start of the routine, just replace the 0x___ with the values you use.

/* 00 49 08 47 xx+1 xx xx 08 at 08040780 with xx xx xx being the reversed address of your routine*/