Post by Jason777 on Aug 8, 2012 17:26:21 GMT -5
I'm writing this on my iPod so I can't really elaborate... I fix this post up a bit when I get home.
Tutorial by Jason777
I went and looked at the disassembly of 5 different actors whose damage charts have already been mapped out and I seem to have found a way to locate damage charts in the actor file and in the RAM (if it has one)...
In the RAM, an actor's damage chart can be located 0x98 bytes away from the start of "actor panel" or RAM actor structure.
In the ROM or actor file, it requires a bit more work to find...
To find the damage table in the assembled actor file (.zactor or .ovl)...
I'm pretty sure this has been found before... Anyways, this is in response to this thread: click me
I also do not take full credit for this tutorial since this topic seems to already have been coverred quite well by Xu Yuan and the Z64 Wiki. Some credit goes to DeathBasket for the help he gave me concerning disassembled actors.
Tutorial by Jason777
I went and looked at the disassembly of 5 different actors whose damage charts have already been mapped out and I seem to have found a way to locate damage charts in the actor file and in the RAM (if it has one)...
In the RAM, an actor's damage chart can be located 0x98 bytes away from the start of "actor panel" or RAM actor structure.
In the ROM or actor file, it requires a bit more work to find...
- Take the disassembled actor file and do a search for the integer of 152 (0x98 in hex), you should get very few results.
- Look for a result which stores a word of a registers contents at an offset which is 152 bytes away from the base register's value. For example, in dark link's file (En_Torch2.S) we find this instruction:
sw t1, 152 (s0) - Check the instructions before to see if the base register (in this case, s0) could hold the offset to the actor panel. If you're not sure, then it may still do you some good to continue to the next step.
- If so, check to see what the contents of the register that was stored (in this case, t1) by looking at the instructions before. For example, in dark link's file (En_Torch2.S) we find these instructions:
lui t1, %hi (data_80B1FA08)
..
addiu t1, t1, %lo (data_80B1FA08) - Take the value (it should be a virtual offset) and do a search for it (in this case, we would be searching for "data_80B1FA08"). Or, you could just go straight the virtual offset in .data section.
- And there you have the damage chart in the disassembled actor (in this case, 0x80B1FA08). The next 0x20 bytes are all part of the damage table.
To find the damage table in the assembled actor file (.zactor or .ovl)...
- Grab the actor's virtual entry point from this list (dark link's is 0x80B1D980): click me
- Take the virtual address of the damage table and subtract the actor's virtual entry point from it. The result is the offset of the damage chart in the assembled actor file.
I'm pretty sure this has been found before... Anyways, this is in response to this thread: click me
I also do not take full credit for this tutorial since this topic seems to already have been coverred quite well by Xu Yuan and the Z64 Wiki. Some credit goes to DeathBasket for the help he gave me concerning disassembled actors.