Jump to content
  • 0

Disassembled Actors..


Jason777
 Share

Question

I have some questions about disassembled actors which would help me make a little more sense of all the code and data if answered. I also plan to come up with a list of mappings for each actor panel in the unknown areas and beyond 0x128 bytes from the start of the panel.

 

  • I was wondering if there were set of default values each register contained at the start of the actor? At the very start I would assume that a0 holds the RAM address to the "actor panel" and a1 holds the RAM address to the object due to the arguments which need to be provided to an actor's "initialization" function? I was reading some notes on the disassembly of the "en_arrow" actor and it gave me the values that each register starts off with... I doubt that those notes apply to every single actor. Here are the notes I am referring to: click me

  • How would I know how large an actor panel would be? At first I thought that each actor panel was defined by the .data section of each actor so that would mean that the actor panel would be as large as the .data section, but I realized that the start of the .data section is not always the start of the initial actor panel. Plus, you could find the virtual offsets of an actor panel through the actor table.

  • Lastly, is .rodata also a part of a RAM actor? If so, where? Also, is it possible to change one of values in the .rodata via the RAM? I read in one thread on Z64, that trying to change any of the .rodata in link's RAM actor resulted in the changes not being made... Here is a link to the thread: click me

  • I forgot to include this one... I want to know if the .bss section is also locateable through actor panel?

Thanks to anyone who can help.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
  • For functions pointed to by the actor 'header' (initalisation, drawing, etc.) the arguments are always a0 = pointer to actor structure, a1 = 0x80212020, all other registers are free (except s registers, $sp and $ra obviously). For all other functions the arguments are defined by the actor unless they're not being called from the actor itself, in which case you'd have to work them out for yourself.
  • The actor structure is not the same thing as the .data section of an actor. I'm not really sure how to find its size, could be related to something in the actor 'header'.
  • Yes. I'm not sure, try looking for something that reads from there to see where it is.
  • Most actors don't use it so I've never even looked for it.
Link to comment
Share on other sites

  • 0

Thanks for the help, DeathBasket, the first question was of the most importance to me and am glad to have that cleared up.

 

Kinda Off-topic Subject

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

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.