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. Just pokemon-encounters.
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 dp02_exec_aka_do_animation
Code:
0806844E MOVS R0, #0x11
08068450 BL dp02_exec_aka_do_animation
Both use the do_animation script-command. do_animation has a script collection (081D96AC) with it's own scripting-language (083CBE30). The commands in do_animation-language are:
Code:
0 ?
1 ?
2 ?
3 call asm
4 end
5 ?
6 ?
7 call asm with an argument
Animation 0x4:
Code:
07 083A5348 080DB349 04
Animation 0x11:
Code:
07 083A5348 080DB5F5 04
Part of the function called from animation 0x4:
Code:
...
080DB368 LDR R0, =0x083A0010 @ an array with lots of "unknown_structures" as explained in http://www.pokecommunity.com/showthread.php?t=238937
080DB36A LDR R0, [R0,#0x10] @ selects the array-entry for the normal grass
...
080DB378 BL spawn_oam_thingie_from_uns
...
Part of the function called from animation 0x11
Code:
...
080DB614 LDR R0, =0x083A0010 @ an array with lots of "unknown_structures" as explained in http://www.pokecommunity.com/showthread.php?t=238937
080DB616 LDR R0, [R0,#0x3C] @ selects the array-entry for the tall grass
...
080DB624 BL spawn_oam_thingie_from_uns
...
Code:
083A5420 uns_grass_normal:unknown_structure <0xFFFF, 0x1005, unk_083A36F0, \
083A5420 off_083A541C, stru_083A53DC, \
083A5420 animtable_empty_2, sub_080DB3EE>
Code:
083A593C uns_grass_tall: unknown_structure <0xFFFF, 0x1005, unk_083A36F0, \
083A593C off_083A5938, stru_083A58F8, \
083A593C animtable_empty_2, sub_080DB69E>
(If you truly understand "unknown_structures" you can even change the graphics and the animations of the grass)
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.