The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Reload this Page Development Forms and Formes
Sign Up Rules/FAQ Daily Battle Blogs Mark Forums Read


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 January 1st, 2015 (1:15 PM). Edited February 18th, 2015 by daniilS.
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 16
Gender: Male
Posts: 409
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, 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
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.
__________________
Reply With Quote

Relevant Advertising!

  #2    
Old January 1st, 2015 (2:27 PM).
Joexv's Avatar
Joexv Joexv is offline
One World Under XV
Silver Tier
 
Join Date: Oct 2012
Location: Oregon
Age: 18
Gender: Male
Nature: Sassy
Posts: 983
Send a message via Skype™ to Joexv
Oh my gosh you've finally RELEASED IT!!
I hope you release the arceus forms soon.
__________________
Jesus Christ is my Savior
NEWS: Gentlemon is released HERE
I'm gonna be taking a long break from rom hacking....... Again........
Bros with Percy

My Rom hacks
A New Dawn---Gentlemon
Not in Production:
Blackened Night---Holiday Hacks
Reply With Quote
  #3    
Old January 1st, 2015 (2:42 PM).
Dark Zeta's Avatar
Dark Zeta Dark Zeta is offline
That guy you don't know yet
 
Join Date: Dec 2014
Location: Mississippi, U.S.
Age: 22
Gender: Male
Nature: Lax
Posts: 194
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?
__________________
D&D Editor
Romhack.me

Twitter
Reply With Quote
  #4    
Old January 1st, 2015 (2:46 PM).
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 16
Gender: Male
Posts: 409
Quote:
Originally Posted by joexv View Post
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 View Post
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 :/)
__________________
Reply With Quote
  #5    
Old January 2nd, 2015 (5:16 AM).
LCCoolJ95's Avatar
LCCoolJ95 LCCoolJ95 is offline
Limited Capacity
 
Join Date: May 2009
Location: The World That Never Was
Age: 21
Gender: Male
Nature: Naive
Posts: 360
....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

Pokémon Emerald 650 (Resource Patch): http://www.pokecommunity.com/showthread.php?t=346694
Pokémon Theta Emerald: http://www.pokecommunity.com/showthread.php?t=349258
Reply With Quote
  #6    
Old January 2nd, 2015 (5:18 AM).
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 16
Gender: Male
Posts: 409
Quote:
Originally Posted by LCCoolJ95 View Post
....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.
__________________
Reply With Quote
  #7    
Old January 2nd, 2015 (6:55 AM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 710
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
__________________
Please take time clicking this link http://pocketmoneyduty.com/?u=15594

My Threads

Reply With Quote
  #8    
Old January 2nd, 2015 (8:30 AM).
mkarthick98 mkarthick98 is offline
 
Join Date: Oct 2014
Gender: Male
Posts: 17
Yay, this is amazing! I have a doubt on this. Can I PM you?
Reply With Quote
  #9    
Old January 2nd, 2015 (8:58 AM). Edited January 3rd, 2015 by daniilS.
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 16
Gender: Male
Posts: 409
Quote:
Originally Posted by Lance32497 View Post
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 View Post
Yay, this is amazing! I have a doubt on this. Can I PM you?
Of course
__________________
Reply With Quote
  #10    
Old January 2nd, 2015 (8:59 AM).
Dark Zeta's Avatar
Dark Zeta Dark Zeta is offline
That guy you don't know yet
 
Join Date: Dec 2014
Location: Mississippi, U.S.
Age: 22
Gender: Male
Nature: Lax
Posts: 194
Quote:
Originally Posted by LCCoolJ95 View Post
....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 January 2nd, 2015 (10:02 AM).
wally-217's Avatar
wally-217 wally-217 is offline
 
Join Date: Nov 2012
Location: Yorkshire, UK
Gender: Male
Posts: 95
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 January 2nd, 2015 (10:06 AM).
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 16
Gender: Male
Posts: 409
Quote:
Originally Posted by wally-217 View Post
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.
__________________
Reply With Quote
  #13    
Old January 2nd, 2015 (3:41 PM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 710
Quote:
Originally Posted by daniilS View Post
I used this:
Code:
compare 0x8004 0x5
if 0x3 goto @end
Of course
I dont get it xD
what is 0x3?
__________________
Please take time clicking this link http://pocketmoneyduty.com/?u=15594

My Threads

Reply With Quote
  #14    
Old January 2nd, 2015 (9:19 PM).
CosmicBlazer's Avatar
CosmicBlazer CosmicBlazer is offline
Batman
 
Join Date: Jan 2013
Location: USA
Gender: Male
Posts: 193
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 January 3rd, 2015 (3:34 AM).
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 16
Gender: Male
Posts: 409
Quote:
Originally Posted by CosmicBlazer View Post
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.
__________________
Reply With Quote
  #16    
Old January 3rd, 2015 (4:53 AM).
KDS's Avatar
KDS KDS is online now
 
Join Date: Jul 2013
Age: 21
Gender: Male
Posts: 273
Quote:
Originally Posted by daniilS View Post
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 January 3rd, 2015 (4:57 AM).
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 16
Gender: Male
Posts: 409
Quote:
Originally Posted by KDS View Post
Will you work on Stance Change?
Maybe later, together with megas (and Cherrim)
__________________
Reply With Quote
  #18    
Old January 3rd, 2015 (7:13 AM).
CosmicBlazer's Avatar
CosmicBlazer CosmicBlazer is offline
Batman
 
Join Date: Jan 2013
Location: USA
Gender: Male
Posts: 193
Quote:
Originally Posted by daniilS View Post
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 January 3rd, 2015 (8:10 AM). Edited January 3rd, 2015 by daniilS.
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 16
Gender: Male
Posts: 409
Quote:
Originally Posted by Lance32497 View Post
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.
__________________
Reply With Quote
  #20    
Old January 3rd, 2015 (12:49 PM).
Dark Zeta's Avatar
Dark Zeta Dark Zeta is offline
That guy you don't know yet
 
Join Date: Dec 2014
Location: Mississippi, U.S.
Age: 22
Gender: Male
Nature: Lax
Posts: 194
Just a question.

Will you be going all out on Shaymin's formes?
__________________
D&D Editor
Romhack.me

Twitter
Reply With Quote
  #21    
Old January 3rd, 2015 (1:25 PM).
AtecainCorp.'s Avatar
AtecainCorp. AtecainCorp. is offline
Rejishan awake...
 
Join Date: Jun 2008
Location: Takoabe Town (Region Thonsu)
Age: 23
Gender: Male
Nature: Hardy
Posts: 906
It was any possible to convert this code into RUBY or EMERALD?
__________________
POKEMON RUBY RENEV - http://www.pokecommunity.com/showthread.php?t=341964

My FC is 2080-0646-1641
IGN - Ketrab
Reply With Quote
  #22    
Old January 3rd, 2015 (1:55 PM).
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 16
Gender: Male
Posts: 409
Quote:
Originally Posted by Dark Zeta View Post
Just a question.

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

dangitpcwhydomypostsevenneedtobe25charactersthisisridiculous
__________________
Reply With Quote
  #23    
Old January 3rd, 2015 (2:09 PM).
BlackStorm20x's Avatar
BlackStorm20x BlackStorm20x is offline
Don't trust people.
 
Join Date: Apr 2014
Location: Texas
Gender: Male
Nature: Quiet
Posts: 477
AWESOME. I'll need this for my hack. :D
__________________
I am a Christian. 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.




Reply With Quote
  #24    
Old January 3rd, 2015 (3:15 PM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 710
Quote:
Originally Posted by daniilS View Post
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
__________________
Please take time clicking this link http://pocketmoneyduty.com/?u=15594

My Threads

Reply With Quote
  #25    
Old January 3rd, 2015 (3:56 PM).
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 16
Gender: Male
Posts: 409
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!
__________________
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

Forum Jump


All times are GMT -8. The time now is 10:25 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2016 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2016.