Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development

Notices
For all updates, view the main page.

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.



Reply
 
Thread Tools
  #1    
Old 4 Weeks Ago (01:15 PM). Edited 3 Weeks Ago by daniilS.
daniilS's Avatar
daniilS
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 15
Gender: Male
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
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:
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, speciestodexnumber
	bl jump
compareburmy:
	ldr r1, burmy_dex
	cmp r0, r1
	bne ender
getform:
	ldr r0, battle_type_area_thingy
	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
Insert it anywhere, and place a pointer to it in the routine above.


A note on spelling
Spoiler:
Please use the word forme for legendaries and form for other Pokémon. Thank you.
__________________

Thanks to JPAN, Jambo51, Shiny Quagsire and knizz for teaching me almost everything I know about hacking, through tutorials or in person.
Reply With Quote
  #2    
Old 4 Weeks Ago (02:27 PM).
joexv's Avatar
joexv
The True XV
Community Supporter
 
Join Date: Oct 2012
Location: Oregon
Age: 17
Gender: Male
Nature: Quiet
Send a message via Skype™ to joexv
Oh my gosh you've finally RELEASED IT!!
I hope you release the arceus forms soon.
__________________

I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this in your signature.
Just remember, you cant spell slaughter without laughter.
Reply With Quote
  #3    
Old 4 Weeks Ago (02:42 PM).
Dark Zeta's Avatar
Dark Zeta
They call me... "The Rod"
 
Join Date: Dec 2014
Location: Mississippi, U.S.
Age: 20
Gender: Male
Nature: Lax
I came home from work to this. I exploded from joy...

I really can't wait for the rest, but I do have a question. Will you be doing the moves related to Rotom?
Reply With Quote
  #4    
Old 4 Weeks Ago (02:46 PM).
daniilS's Avatar
daniilS
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 15
Gender: Male
Quote originally posted by joexv:
Oh my gosh you've finally RELEASED IT!!
I hope you release the arceus forms soon.
Yup, they're next! :D
Quote originally posted by Dark Zeta:
I came home from work to this. I exploded from joy...

I really can't wait for the rest, but I do have a question. Will you be doing the moves related to Rotom?
Nope, the moves can be handled from the script. Ask Bela if you want an example


(by the way guys, an ugly version of this first routine has been available for quite some time :/)
__________________

Thanks to JPAN, Jambo51, Shiny Quagsire and knizz for teaching me almost everything I know about hacking, through tutorials or in person.
Reply With Quote
  #5    
Old 4 Weeks Ago (05:16 AM).
LCCoolJ95's Avatar
LCCoolJ95
Limited Capacity
 
Join Date: May 2009
Location: The World That Never Was
Age: 19
Gender: Male
Nature: Naive
....I'm lost, what does this routine do, and how can I implement it?
__________________
"The greatest obstacle in life is Yourself. Overcome it, and you will achieve the greatest accomplishment of all." -Art Beins, 1982

Fairy-type in Pokémon Emerald: http://www.pokecommunity.com/showpost.php?p=8185719&postcount=288
Reply With Quote
  #6    
Old 4 Weeks Ago (05:18 AM).
daniilS's Avatar
daniilS
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 15
Gender: Male
Quote originally posted by LCCoolJ95:
....I'm lost, what does this routine do, and how can I implement it?
It changes the index number of the Pokémon in party slot X (var 0x8004) to Y (var 0x8005). Instructions on how to implement it are in the last line of the routine, as always.
__________________

Thanks to JPAN, Jambo51, Shiny Quagsire and knizz for teaching me almost everything I know about hacking, through tutorials or in person.
Reply With Quote
  #7    
Old 4 Weeks Ago (06:55 AM).
Lance32497's Avatar
Lance32497
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
so the script

Quote:
...
special 0x9F
waitstate
compare 0x8004 0x0
if false goto @1
setvar 0x8005 0x85
callasm 0x800000
...
by the way, thanks for this routine
__________________
My Threads

Reply With Quote
  #8    
Old 4 Weeks Ago (08:30 AM).
mkarthick98
 
Join Date: Oct 2014
Gender: Male
Yay, this is amazing! I have a doubt on this. Can I PM you?
Reply With Quote
  #9    
Old 4 Weeks Ago (08:58 AM). Edited 3 Weeks Ago by daniilS.
daniilS's Avatar
daniilS
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 15
Gender: Male
Quote originally posted by Lance32497:
so the script
by the way, thanks for this routine
I used this:
Code:
compare 0x8004 0x5
if 0x2 goto @end
Quote originally posted by mkarthick98:
Yay, this is amazing! I have a doubt on this. Can I PM you?
Of course
__________________

Thanks to JPAN, Jambo51, Shiny Quagsire and knizz for teaching me almost everything I know about hacking, through tutorials or in person.
Reply With Quote
  #10    
Old 4 Weeks Ago (08:59 AM).
Dark Zeta's Avatar
Dark Zeta
They call me... "The Rod"
 
Join Date: Dec 2014
Location: Mississippi, U.S.
Age: 20
Gender: Male
Nature: Lax
Quote originally posted by LCCoolJ95:
....I'm lost, what does this routine do, and how can I implement it?
It's very simple. Say you want to change Rotom to Wash Rotom. Well you use special 0x9F to choose the Rotom from your party and it is indexed at 0x10. Well this routine takes that Rotom and changes its index from 0x10 to whatever you set var 0x8005 to (we will use 0x11 in this case). Thus changing Rotom (0x10) to Wash Rotom (0x11).
Reply With Quote
  #11    
Old 4 Weeks Ago (10:02 AM).
wally-217's Avatar
wally-217
 
Join Date: Nov 2012
Location: Yorkshire, UK
Gender: Male
Apologies if this doesn't contribute much to the thread but when you say "Platinum Red & Blue", what do you mean by that? Which rom is this for?
- Thanks,
__________________
Reply With Quote
  #12    
Old 4 Weeks Ago (10:06 AM).
daniilS's Avatar
daniilS
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 15
Gender: Male
Quote originally posted by wally-217:
Apologies if this doesn't contribute much to the thread but when you say "Platinum Red & Blue", what do you mean by that? Which rom is this for?
- Thanks,
By that I mean they're the routines used in this hack: link
Everything is just FR so far, until somebody ports it.
__________________

Thanks to JPAN, Jambo51, Shiny Quagsire and knizz for teaching me almost everything I know about hacking, through tutorials or in person.
Reply With Quote
  #13    
Old 3 Weeks Ago (03:41 PM).
Lance32497's Avatar
Lance32497
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Quote originally posted by daniilS:
I used this:
Code:
compare 0x8004 0x5
if 0x3 goto @end
Of course
I dont get it xD
what is 0x3?
__________________
My Threads

Reply With Quote
  #14    
Old 3 Weeks Ago (09:19 PM).
CosmicBlazer's Avatar
CosmicBlazer
Batman
 
Join Date: Jan 2013
Location: USA
Gender: Male
Could this asm be used in a way to get Mega Evolutions? Just a theory. I dont know much about ASM xD so yeah.
__________________
Pokemon Cosmic: A New Threat

For God so loved the world, that he gave his only begotten Son, that who ever believe in him should not perish, but have everlasting life. - John 3:16

I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this in your signature.[/sig-reason]
Reply With Quote
  #15    
Old 3 Weeks Ago (03:34 AM).
daniilS's Avatar
daniilS
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 15
Gender: Male
Quote originally posted by CosmicBlazer:
Could this asm be used in a way to get Mega Evolutions? Just a theory. I dont know much about ASM xD so yeah.
Not in its current form. Touched and I might create something for it later.
__________________

Thanks to JPAN, Jambo51, Shiny Quagsire and knizz for teaching me almost everything I know about hacking, through tutorials or in person.
Reply With Quote
  #16    
Old 3 Weeks Ago (04:53 AM).
KDS's Avatar
KDS
 
Join Date: Jul 2013
Age: 20
Gender: Male
Quote originally posted by daniilS:
Not in its current form. Touched and I might create something for it later.
Will you work on Stance Change?
Reply With Quote
  #17    
Old 3 Weeks Ago (04:57 AM).
daniilS's Avatar
daniilS
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 15
Gender: Male
Quote originally posted by KDS:
Will you work on Stance Change?
Maybe later, together with megas (and Cherrim)
__________________

Thanks to JPAN, Jambo51, Shiny Quagsire and knizz for teaching me almost everything I know about hacking, through tutorials or in person.
Reply With Quote
  #18    
Old 3 Weeks Ago (07:13 AM).
CosmicBlazer's Avatar
CosmicBlazer
Batman
 
Join Date: Jan 2013
Location: USA
Gender: Male
Quote originally posted by daniilS:
Not in its current form. Touched and I might create something for it later.
Alright well good luck on it. Thanks for everything you contribute.
__________________
Pokemon Cosmic: A New Threat

For God so loved the world, that he gave his only begotten Son, that who ever believe in him should not perish, but have everlasting life. - John 3:16

I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this in your signature.[/sig-reason]
Reply With Quote
  #19    
Old 3 Weeks Ago (08:10 AM). Edited 3 Weeks Ago by daniilS.
daniilS's Avatar
daniilS
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 15
Gender: Male
Quote originally posted by Lance32497:
I dont get it xD
what is 0x3?
I'm sorry, didn't see this one at first. Typo: I meant 0x2 , which means if greater than. Special 0x9F will return a party slot from 0 to 5, and 7 if no pokemon is selected.
Also, for the full script you need to check if the selected pokemon is in fact a Rotom or Deoxys too, of course.

EDIT: whoops, seems like I missed the fact that in Platinum you never actually have to select a Rotom or a Deoxys... :/
Derp here, so I guess this would require one of FBI's routines instead.
__________________

Thanks to JPAN, Jambo51, Shiny Quagsire and knizz for teaching me almost everything I know about hacking, through tutorials or in person.
Reply With Quote
  #20    
Old 3 Weeks Ago (12:49 PM).
Dark Zeta's Avatar
Dark Zeta
They call me... "The Rod"
 
Join Date: Dec 2014
Location: Mississippi, U.S.
Age: 20
Gender: Male
Nature: Lax
Just a question.

Will you be going all out on Shaymin's formes?
Reply With Quote
  #21    
Old 3 Weeks Ago (01:25 PM).
AtecainCorp.'s Avatar
AtecainCorp.
Rejishan awake...
 
Join Date: Jun 2008
Location: Takoabe Town (Region Thonsu)
Age: 22
Gender: Male
Nature: Hardy
It was any possible to convert this code into RUBY or EMERALD?
__________________
- Thonsu Region will never die when Rejishan take care about them. Even the evilnesse of Team Mystic do not destroy land of Thonsu.

POKEMON DIRTY SUN - Comming Soon.
POKEMON RUBY RENEV - http://www.pokecommunity.com/showthread.php?t=341964

In case of any Questions... Go HERE
Reply With Quote
  #22    
Old 3 Weeks Ago (01:55 PM).
daniilS's Avatar
daniilS
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 15
Gender: Male
Quote originally posted by Dark Zeta:
Just a question.

Will you be going all out on Shaymin's formes?
Yes
Quote originally posted by Ksiazek Bartlomiej:
It was any possible to convert this code into RUBY or EMERALD?
Yes

dangitpcwhydomypostsevenneedtobe25charactersthisisridiculous
__________________

Thanks to JPAN, Jambo51, Shiny Quagsire and knizz for teaching me almost everything I know about hacking, through tutorials or in person.
Reply With Quote
  #23    
Old 3 Weeks Ago (02:09 PM).
BlackStorm20x's Avatar
BlackStorm20x
Did you say rom hacking?
 
Join Date: Apr 2014
Location: United States
Age: 14
Gender: Male
Nature: Lonely
AWESOME. I'll need this for my hack. :D
__________________
I'm a Christian, and I'm not afraid to share it. I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
-------------------------Hacks I Like----------------------



Reply With Quote
  #24    
Old 3 Weeks Ago (03:15 PM).
Lance32497's Avatar
Lance32497
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Quote originally posted by daniilS:
I'm sorry, didn't see this one at first. Typo: I meant 0x2 , which means if greater than. Special 0x9F will return a party slot from 0 to 5, and 7 if no pokemon is selected.
Also, for the full script you need to check if the selected pokemon is in fact a Rotom or Deoxys too, of course.

EDIT: whoops, seems like I missed the fact that in Platinum you never actually have to select a Rotom or a Deoxys... :/
Derp here, so I guess this would require one of FBI's routines instead.
ahhhhh.... thanks I was just confused what and why 0x3
__________________
My Threads

Reply With Quote
  #25    
Old 3 Weeks Ago (03:56 PM).
daniilS's Avatar
daniilS
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 15
Gender: Male
Arceus and Giratina will have to wait because Game Freak ignored logic when coding the Pokémon Storage System. However, the first post has been updated for BURMY!
__________________

Thanks to JPAN, Jambo51, Shiny Quagsire and knizz for teaching me almost everything I know about hacking, through tutorials or in person.
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 11:43 AM.