- 79
- Posts
- 16
- Years
- Seen Apr 13, 2014
![[PokeCommunity.com] Simple Questions (PLEASE USE THE SEARCH BUTTON BEFORE ASKING) [PokeCommunity.com] Simple Questions (PLEASE USE THE SEARCH BUTTON BEFORE ASKING)](https://i794.photobucket.com/albums/yy221/darkprince909/grassissues.png)
This is an edited Route 113 tileset on Ruby. The tiles outlined in green already switch using cmda6 0x1 (although I couldn't find a reference to blocks 206 and 20E in Fire Red's version of the subroutine. I don't know where to find Ruby's subroutines, which is part of my question.) What I'd like to do is add one more set of blocks that will switch using this command. What I have on top is what is currently in the rom, and the bottom part is what I would like it to be.
In the ASM, I found the section relevant to the actual switching of the blocks. Again, this is from a dissassembly of the Fire Red code, since I can't find Ruby's yet.
Spoiler:
r0 = signed halfword [sp] // = player X
r1 = signed halfword [r4] // = player Y
call 0x08058E48 // r0 = Number of the loaded tile at (r0, r1)
r1 = [0x0806EBDC] // = 0x0000020A = Route 113 tileset: ash tall grass
r0 = signed halfword [sp] // = player X
r1 = signed halfword [r4] // = player Y
if (r0 == r1) {
r2 = [0x0806EC00] // This pretty much never happens.
} else {
r2 = [0x0806EBE0] // = 0x00000212 = Route 113 tileset: normal tall grass
}
r1 = signed halfword [r4] // = player Y
call 0x08058E48 // r0 = Number of the loaded tile at (r0, r1)
r1 = [0x0806EBDC] // = 0x0000020A = Route 113 tileset: ash tall grass
r0 = signed halfword [sp] // = player X
r1 = signed halfword [r4] // = player Y
if (r0 == r1) {
r2 = [0x0806EC00] // This pretty much never happens.
} else {
r2 = [0x0806EBE0] // = 0x00000212 = Route 113 tileset: normal tall grass
}
I understand that it basically checks if the block you're walking onto is the ashy grass block (20A in the default rom) and if it is, it replaces it with the matching one (212). I have no experience with ASM, however. How would I go about adding another set of blocks to this code?
Also, what would need to be done for this to work on more than one map? I haven't checked in the rom if it does or not, because I have homework I need to get done.