The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

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 May 21st, 2011, 03:01 AM
knizz's Avatar
knizz
 
Join Date: Aug 2007
If you're not interested in the techical details scroll down

As you probably know you can change the behaviourbyte of the grass block from 2 (normal grass) to 3(tall grass) in advancemap. However no animation is played for 3.

Everything starts at 083A70BC which is a table of functions. The interesting entries are at index 1 and 2: 080683C8 and 08068414. They end with:
Code:
08068402         MOVS    R0, #4
08068404         BL      overworld_effect_start
Code:
0806844E         MOVS    R0, #0x11
08068450         BL      overworld_effect_start
(the numbers that "overworld_effect_start" uses are the same as for the do_animation npc script command)
overworld_effect_start has a script collection (081D96AC) with it's own bytecode (dispatch table is at 083CBE30). The commands in bytecode are:
Code:
0 load graphics
1 load palette (v1)
2 load palette (v1)
3 call asm
4 end
5 combination of 0 1 3
6 combination of 0 3
7 combination of 1 3
Effect 0x4:
Code:
07 083A5348 080DB349 04
Effect 0x11:
Code:
07 083A5348 080DB5F5 04
Part of the function called from animation 0x4:
Code:
...
080DB368         LDR     R0, =0x083A0010 @ array of pointers to object templates (see http://www.pokecommunity.com/showthread.php?t=238937)
080DB36A         LDR     R0, [R0,#0x10]  @ selects the array-entry for the normal grass
...
080DB378         BL      template_instanciate
...
Part of the function called from animation 0x11
Code:
...
080DB614         LDR     R0, =0x083A0010 @ array of pointers to object templates (see http://www.pokecommunity.com/showthread.php?t=238937)
080DB616         LDR     R0, [R0,#0x3C]  @ selects the array-entry for the tall grass
...
080DB624         BL      template_instanciate
...
Code:
083A5420 grass_normal:object_template <0xFFFF, 0x1005, unk_083A36F0, \
083A5420                                    off_083A541C, stru_083A53DC, \
083A5420                                    rotscale_table_empty, objc_grass_normal>
Code:
083A593C grass_tall: object_template <0xFFFF, 0x1005, unk_083A36F0, \
083A593C                                    off_083A5938, stru_083A58F8, \
083A593C                                    rotscale_table_empty, objc_grass_tall>
The last entry in this structure is the callback that executed once every frame. Those are almost equal except for:
Code:
...
080DB46C         BL      complex_function
080DB470         LSLS    R0, R0, #0x18
080DB472         CMP     R0, #0
080DB474         BEQ     loc_080DB48C
...
Code:
...
080DB71C         BL      put_0_into_r0_and_do_nothing
080DB720         LSLS    R0, R0, #0x18
080DB722         CMP     R0, #0
080DB724         BEQ     loc_080DB73C
...
To make the tall grass work, a function, equivalent to the one used in the function for normal grass, needs to be written at the same offset.

HOW TO FIX IT
Start overwriting at 08059f34 with 00 21 00 06 00 0e 02 28 01 d0 d1 28 01 d1 01 20 00 e0 00 20 00 21 70 47 03 28 f5 e7

eh 08059f34 0x2100
eh 08059f48 0x2100
eh 08059f4a 0x4770
eh 08059f4c 0x2803
eh 08059f4e 0xE7F5

Have fun and please credit me.

EDIT
If you want to enable the tiny grass too overwrite at 0805A0EC with 0C 30 09 E0. (It's mapped to behaviour byte 7)
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)

Last edited by knizz; 2 Weeks Ago at 09:03 AM.
Reply With Quote
  #2    
Old May 21st, 2011, 05:33 PM
Crimson Stardust's Avatar
Crimson Stardust
Anime Addiction
 
Join Date: Mar 2009
Location: It is for me to noe and all of you to find out
Age: 21
Gender: Male
Nature: Relaxed
Send a message via AIM to Crimson Stardust Send a message via Windows Live Messenger to Crimson Stardust
Wow, finally someone do it,
i did post a thread about this, not exactly about this, but yeah same thing,
i was figuring out why the tall grass animation is not working..so this is great man..
__________________



Reply With Quote
  #3    
Old May 21st, 2011, 05:57 PM
Derlo's Avatar
Derlo
Braziliam Hacker!! De Mossoró
 
Join Date: Aug 2007
Send a message via Windows Live Messenger to Derlo
Man if there's one thing I always wanted to fix was that ...
Great job!
I wonder know if you have tried enable other animations from the 3rd generation? Like the grass with ash on it ...

I tried to do one thing:

Quote:
08068402 MOVS R0, # 4
08068404 BL dp02_exec_aka_do_animation
This #4 refers to animations that will be loaded into tile ... I tried to change this for any other byte below #40. And what I got was that instead of the normal animation of grass other animations were loaded (in fact I think all the animation tiles had been carried).

For example:
* If you place a # 01, the animation will be loaded, is when we use the cut on the grass tiles.
* And if you put # 07, the animation will be loaded is the grass with ash on top (which I referred to earlier), merged with a setmaptile with some tile of the second tileset.

And so on ...

Maybe this way there is how to enable other animations or even create new ones.

Good luck and thanks!
__________________



Pokémon
Essence of Light

Comming Soon...
Reply With Quote
  #4    
Old May 22nd, 2011, 12:18 AM
knizz's Avatar
knizz
 
Join Date: Aug 2007
I think that the ashgrass is also available via behaviourbytes but deactivated just like the tall grass. Finding a patch for that shouldn't be hard. I'll make one if I have time. And thank you Derlo for the animation-number of the ashgrass.
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)
Reply With Quote
  #5    
Old May 22nd, 2011, 04:10 AM
r0bert's Avatar
r0bert
Quitifyingly awesome.
 
Join Date: Jul 2010
Location: kewl places
Gender: Male
Nature: Naughty
You fix it with a Hex editor,right?
__________________
Reply With Quote
  #6    
Old May 22nd, 2011, 04:44 AM
knizz's Avatar
knizz
 
Join Date: Aug 2007
Patch for tall grass on behaviourbyte 0x03 and ash grass on behaviourbyte 0x24

eh 08059f34 0x2100
eh 08059f48 0x2100
eh 08059f4a 0x4770
eh 08059f4c 0x2803
eh 08059f4e 0xE7F5
eh 08059f50 0x2824
eh 08059f52 0xE7F3
eb 0806e820 0x04
eh 0806ebdc <special tile with ash>
eh 0806ebe0 <special tile without ash>
eh 0806ec00 <grass tile without ash>

Quote:
Originally Posted by r0bert View Post
You fix it with a hex editor, right?
Yes.
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)

Last edited by knizz; May 22nd, 2011 at 04:56 AM.
Reply With Quote
  #7    
Old May 22nd, 2011, 05:10 AM
Derlo's Avatar
Derlo
Braziliam Hacker!! De Mossoró
 
Join Date: Aug 2007
Send a message via Windows Live Messenger to Derlo
Great job man!
It worked perfectly ..

I'm making a list of all the animations I've ever encountered.
When this is done, I'll post here.

Good luck and thanks.
__________________



Pokémon
Essence of Light

Comming Soon...
Reply With Quote
  #8    
Old May 22nd, 2011, 05:43 AM
r0bert's Avatar
r0bert
Quitifyingly awesome.
 
Join Date: Jul 2010
Location: kewl places
Gender: Male
Nature: Naughty
I have a small problem:I'm using XVI32 and I can't find the offset.Should I use a different Hex-editor?
__________________
Reply With Quote
  #9    
Old May 22nd, 2011, 05:52 AM
knizz's Avatar
knizz
 
Join Date: Aug 2007
Quote:
Originally Posted by r0bert View Post
I have a small problem: I'm using XVI32 and I can't find the offset. Should I use a different hex-editor?
You can't even use a hex-editor correctly? I am disappoint. Sorry, I was in a bad mood when I wrote this.

I wrote addresses/pointers not offsets. In GBA the ROM Origin is 08000000. So if you want the offset you have to subtract this number from the address.
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)

Last edited by knizz; May 29th, 2013 at 08:51 AM.
Reply With Quote
  #10    
Old May 22nd, 2011, 06:45 AM
Derlo's Avatar
Derlo
Braziliam Hacker!! De Mossoró
 
Join Date: Aug 2007
Send a message via Windows Live Messenger to Derlo
Remember...
All of bytes, are written on the offset: 08068402. (Normal Grass)
And will activates when any OW steps on the tile.



01 - Animation of the HM CUT on the grass tiles. (Some leaves turning around the player)
02 - Same as before. (But without the animation of the leaves)
03 - Apparently nothing.
04 - Normal Grass.
05 - Ripple on the water when an OW step in puddles of water. (The animation appears only in these coordinates: x = y = 0d 13)
06 - Bar with a sprite POKEMON random. (The POKEMON that is shown depends on the coordinates X) [When load repeatedly times, Break the rom.]
07 - Grass with ashes on top, mixed with a setmaptile with some of the tiles.
08 - Loads the OW of HM SURF (pokemon in which the player stands on top in the water)
09 - Loads the HM SURF to the player.
0A - Dust when an OW performs a jump on the floor.
0B - Apparently nothing.
0C - effect when an OW performs a jump in the grass tiles.
0D - Footprints in the sand. (Animation is not complete, only one tile of the animation)
0E - effect when an OW performs a jump in the water tiles. (Splash)
0F - Apparently nothing.
10 - Splash of footsteps in the water.
11 - Apparently nothing.
12 - Another animation of grass. Very interesting ...
13 - Another animation of grass diferent than the previous. (The tile always gets excited. "shaking" lol.)
14 - Another animation of the grass #12. (The tile always gets excited. "shaking" lol.)
15 - A type of hole in the sand. [Possibly a WARP] (animated constantly)
16 - Submerge the water. [Possibly a WARP] (animated constantly)
17 - Apparently nothing.
18 - Same as # 0D
19 - Animation of Pokeballs in Pokecenter.
1A - 1D - Apparently nothing.
1E - Pokemon landing after using HMFLY. (The Standing animation always loaded in the player's position)
1F - 22 - Apparently nothing.
23 - BIKE Trail in the sand. (Animation is not complete, only one tile of the animation)
24 - Apparently nothing.
25 - Player using the Pokeball and POKEMON. (Possibly HM Strength)
26 - Player using the Pokeball and POKEMON. (Teleport to last WARP)
27 - Apparently nothing.
28 - Player using the Pokeball and POKEMON.
29 - 2A - Apparently nothing.
2B - Break the rom.
2C - Bar with Sprite POKEMON (Break the rom.)

2D - appears a drawing of a Pokeball in the left corner of the screen, then fades. (Possibly is not a tile)
2E - 30 - Apparently nothing.
31 - When we are sucked into the sand. (WARP)
32 - Splash water. (WARP)
33 - Animation SWEETSCENT.
34 - Apparently nothing.
35 - Bubbles on the floor.
36 - 39 - Apparently nothing.
3A - Leaves turning around the OW player.
3B - Bar with a sprit of a POKEMON.
3C - 3D - Apparently nothing.
3E - animation of the machine that records the data on FAMEHALL.
3F - Teleport to the center of the map.
40 - Apparently nothing.
41 - Animation VS.SEECKER. (Break the rom.)
42 - 44 - Apparently nothing.
45 - The screen flashes. (As a Flash)
46-9F - Resets the ROM or Break the rom.

EDIT:
A0-A1 - Resets the ROM or Break the rom.
A2 - Lock the screen, and the movements of the OW are slow.
A3-B7 - Resets the ROM or Break the rom.
B8 - Movement of the OW slower and damage their image.
B9-DD - Resets the ROM or Break the rom.
DE - Apparently nothing.
DF-E7 - Resets the ROM or Break the rom.
E8 - Apparently nothing.
E9-EE - Resets the ROM or Break the rom.
EF - Apparently nothing.
F0-F7 - Resets the ROM or Break the rom.
F8 - Apparently nothing.
F9-FF - Resets the ROM or Break the rom.
__________________



Pokémon
Essence of Light

Comming Soon...

Last edited by Derlo; May 22nd, 2011 at 07:04 AM. Reason: FINISH THE TABLE.
Reply With Quote
  #11    
Old May 22nd, 2011, 06:49 AM
knizz's Avatar
knizz
 
Join Date: Aug 2007
Quote:
Originally Posted by Derlo View Post
46-9F - Resets the ROM or Break the rom.

A0-FF - Still Searching ...
That's the limit. There isn't more than that.
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)
Reply With Quote
  #12    
Old May 22nd, 2011, 07:38 AM
sonic1's Avatar
sonic1
ASM is my life now...
 
Join Date: May 2008
Location: Portugal
Age: 19
Gender: Male
Nature: Timid
Quote:
Originally Posted by knizz View Post
That's the limit. There isn't more than that.
It is? Well, i'm not sure, but the command doanimation uses a word as parameter, not a byte. But i'm not sure, as there can be a table or something...

~Sonic1
__________________

My Site (UNDER CONSTRUCTION):

(mage by Xryo)

PORTUGUESE USER
Sou o Dark rayquaza da antiga myutsu.net


My Laptop SPECS:


Credits to Eagledelt for the wonderfull sign :D

Reply With Quote
  #13    
Old May 22nd, 2011, 08:04 AM
Quilava's Master's Avatar
Quilava's Master
Shattered Dreams '13
 
Join Date: Jul 2007
Nature: Adamant
This is beyond incredible. I definitely wish to implement this in Shattered Dreams. What I love most is how easy it is to understand for anyone who's ever worked with a hex editor! Many thanks Knizz! But I do have a question regarding the ash grass. Will it work in accordance with the "Soot Sack" item in the same vein as it did in RSE?

Note: I would have tested this myself before asking but my laptop is out of commission right now.
__________________
The return of Pokemon Shattered Dreams! Click the screenshot to visit the thread, you know you want to.

Last edited by Quilava's Master; May 22nd, 2011 at 08:06 AM. Reason: Damn you auto-correct!
Reply With Quote
  #14    
Old May 22nd, 2011, 11:45 AM
Shiny Quagsire's Avatar
Shiny Quagsire
Actually gone until Aug 20th .-.
 
Join Date: May 2009
Location: Hoenn Safari Zone
Age: 16
Gender: Male
Nature: Jolly
On the topic of animation ids, could you make a new tile that animates when stepped on?
__________________



Reply With Quote
  #15    
Old May 22nd, 2011, 01:14 PM
knizz's Avatar
knizz
 
Join Date: Aug 2007
Quote:
Originally Posted by sonic1 View Post
It is? Well, i'm not sure, but the command doanimation uses a word as parameter, not a byte. But i'm not sure, as there can be a table or something...

~Sonic1
It is a table it is at 081D96AC. And it has 0x46 entries.

Quote:
Originally Posted by Quilava's Master View Post
This is beyond incredible. I definitely wish to implement this in Shattered Dreams. What I love most is how easy it is to understand for anyone who's ever worked with a hex editor! Many thanks Knizz! But I do have a question regarding the ash grass. Will it work in accordance with the "Soot Sack" item in the same vein as it did in RSE?

Note: I would have tested this myself before asking but my laptop is out of commission right now.
I have no idea. I think this ash-grass doesn't even have pokemon encounters so it's at least broken in ONE way.

Quote:
Originally Posted by shiny quagsire View Post
On the topic of animation ids, could you make a new tile that animates when stepped on?
Can? Yes! Want? If you pay me. I can give you a few tips though if you're serious about it. Contact me via email, PN, MSN or IRC.
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)
Reply With Quote
  #16    
Old May 22nd, 2011, 01:50 PM
r0bert's Avatar
r0bert
Quitifyingly awesome.
 
Join Date: Jul 2010
Location: kewl places
Gender: Male
Nature: Naughty
excuse me for being noobish,but how can you activate the other animations?
__________________
Reply With Quote
  #17    
Old May 22nd, 2011, 02:04 PM
knizz's Avatar
knizz
 
Join Date: Aug 2007
Quote:
Originally Posted by r0bert View Post
excuse me for being noobish, but how can you activate the other animations?
Which other animations? You mean except for tall grass and ash? You can't. That'd require new patches. But no one wrote them yet. But lot's of animations are activated already. Just open AdvanceMaps block-editor and play around with the behaviour-byte.
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)
Reply With Quote
  #18    
Old May 22nd, 2011, 03:36 PM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 19
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
By reading the thread and attempting to understand it.
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
Reply With Quote
  #19    
Old May 22nd, 2011, 06:18 PM
shinyabsol1's Avatar
shinyabsol1
Pokemon DarkJasper!?
 
Join Date: Aug 2010
Gender: Male
Nature: Calm
So this activates the previously blocked tall grass animation...great! I'll try it when I have the time. Thanks!

One question though: does this mean the tall grass animation can now be edited into a new grassy patch animation?
Reply With Quote
  #20    
Old May 22nd, 2011, 09:55 PM
knizz's Avatar
knizz
 
Join Date: Aug 2007
Quote:
Originally Posted by shinyabsol1 View Post
So this activates the previously blocked tall grass animation...great! I'll try it when I have the time. Thanks!

One question though: does this mean the tall grass animation can now be edited into a new grassy patch animation?
When I said patch I meant "small modification".

You can replace the images used in the animation and edit their order. Just edit the corresponding "unknown_structure". (More infos in first post)
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)
Reply With Quote
  #21    
Old May 23rd, 2011, 12:44 PM
r0bert's Avatar
r0bert
Quitifyingly awesome.
 
Join Date: Jul 2010
Location: kewl places
Gender: Male
Nature: Naughty
Quote:
Originally Posted by knizz View Post
Which other animations? You mean except for tall grass and ash? You can't. That'd require new patches. But no one wrote them yet. But lot's of animations are activated already. Just open AdvanceMaps block-editor and play around with the behaviour-byte.
I kinda meant the micro grass animation.
also what are the rest of the animations?(pic in attachment)
the ones I can't recognise are in a blue square.
Attached Images
File Type: png 2_0.png‎ (2.1 KB, 139 views) (Save to Dropbox)
__________________
Reply With Quote
  #22    
Old June 1st, 2011, 02:20 AM
>Dante<'s Avatar
>Dante<
Call me Steven
 
Join Date: Jun 2008
Location: Torino (ITA)
Nature: Adamant
Send a message via Windows Live Messenger to >Dante<
oh WOW! This is totaly awesome!! Thank you very much friend but...yeah, there are a lot of bases animation such as the micro grass animation...look:



How to fix it?
__________________

Reply With Quote
  #23    
Old July 13th, 2011, 09:28 AM
hinkage's Avatar
hinkage
Go make some new disaster
Community Supporter
 
Join Date: Aug 2010
Age: 18
Sorry for being new and stupid, but what does this part mean?

"eh 08059f34 0x2100
eh 08059f48 0x2100
eh 08059f4a 0x4770
eh 08059f4c 0x2803
eh 08059f4e 0xE7F5"

What do I do with it? I DID research a little, and the only part that confuses me still is the 0x2100, etc.
Reply With Quote
  #24    
Old November 22nd, 2011, 01:14 PM
Hackrex
Unhatched Egg
 
Join Date: Aug 2007
Gender:
ok for all who didn´t understand it: The Offset you can see on the top are written in ASM.

So the most people don´t know where they can find it in there Hex Viewer....

So here is the "Hex" Offset:
059F34 for firered english
059F34 for firered german (feuerrot) - it´s really rare that the german rom has the same offset than the English

this is the hex code you have to use
00 21 00 06 00 0e 02 28 01 d0 d1 28 01 d1 01 20 00 e0 00 20 00 21 70 47 03 28 f5 e7

here you can see that it works



//Edit:
I have a question: How can I make that I can´t drive with the bike over the really tall grass block?
__________________
Temporarily not available

Last edited by Hackrex; November 23rd, 2011 at 07:24 AM.
Reply With Quote
  #25    
Old February 4th, 2012, 04:48 AM
DealNotTheDevil
 
Join Date: Jan 2012
Gender: Male
Hi, I wanted to check if one can create a new behavioural byte for pokemon emerald,
Because I am attempting to create a "super region",
And I want kanto maps that I port into Emerald to play kanto battle themes and wild encounter themes when I am on those maps!
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 08:54 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 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 - 2014 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.