daniilS
busy trying to do stuff not done yet
- 409
- Posts
- 11
- Years
- Seen Jan 29, 2024
Alright, I have been asked to share the routines I made for form(e) changing in Platinum Red & Blue multiple times, and I finally found the time to do so. This thread will be updated as I clean up old routines and create new ones. Enjoy.
Rotom & Deoxys
Burmy
A note on spelling
Rotom & Deoxys
Spoiler:
This routine simply changes the index number of a Pokémon in your party.
Code:
.thumb
getpokeoffset:
push {r4, lr}
ldr r0, var8004
ldrh r2, [r0]
mov r0, #100
mul r2, r0
ldr r0, poke_slot_1
add r4, r2, r0
getandsetnewindexnumber:
ldr r2, var8005
mov r1, #0xB
mov r0, r4
ldr r3, pokemon_setattr
bl jump
recalc20bytes:
mov r0, r4
ldr r3, pokemon_calc_effective_stats
bl jump
pop {r4, pc}
jump:
mov pc, r3
.align 2
var8004: .word 0x020270B8 + 0x8004 * 2
poke_slot_1: .word 0x02024284
var8005: .word 0x020270B8 + 0x8005 * 2
pokemon_setattr: .word 0x0804037C
pokemon_calc_effective_stats: .word 0x0803e47c
/*insert anywhere. set var 0x8004 to the desired pokemon's slot and 0x8005 to the new index number, then callasm this routine+1.*/
Burmy
Spoiler:
These routines will transform any Burmy that enters the battlefield according to the terrain.
The first routine, burmytransformjump:
That routine loads a second routine, burmytransform:
Now, this routine uses a so-called burmytable. It has ten halfword entries, being either zero or the index number of the following forms:
Insert it anywhere, and place a pointer to it in the routine above.
The first routine, burmytransformjump:
Code:
.thumb
main:
ldr r3, burmytransform
mov pc, r3
burmytransform: .word 0x________ @address of burmytransform.asm here
continue:
str r0, [sp]
/*insert at 08030D40*/
That routine loads a second routine, burmytransform:
Code:
.thumb
getdex:
mov r1, #0xB
ldr r3, pokemon_getattr
bl jump
mov r6, r0
ldr r3, species_to_pokedex_index
bl jump
compareburmy:
ldr r1, burmy_dex
cmp r0, r1
bne ender
getform:
ldr r0, idx_for_battle_screen_elements_by_env
ldrb r0, [r0]
lsl r0, #0x1
ldr r2, area_to_burmy_cloak_table
add r2, r0
ldrh r0, [r2]
cmp r0, #0x0
beq ender
burmeeeeeeeeeeeeeeeeeeh:
mov r0, r4
mov r1, #0xB
ldr r3, pokemon_setattr
bl jump
ender:
mov r0, r6
ldr r3, return
jump:
mov pc, r3
.align
pokemon_getattr: .word 0x0803FBE8
species_to_pokedex_index: .word 0x08043298
idx_for_battle_screen_elements_by_env: .word 0x02022B50
area_to_burmy_cloak_table: .word 0x________ @pointer to burmytable here
pokemon_setattr: .word 0x0804037C
return: .word 0x08030D48
burmy_dex: .word ____ @dex number of burmy here
/*insert anywhere. place a pointer to this routine in burmytransformjump.*/
Now, this routine uses a so-called burmytable. It has ten halfword entries, being either zero or the index number of the following forms:
Code:
plant plant sandy 0000 0000 0000 sandy sandy trash plant
A note on spelling
Spoiler:
Please use the word forme for legendaries and form for other Pokémon. Thank you.
Last edited: