Format

This breaks down into-xy: Start/End Virtual Rom addresses of the actor fileab: Start/End Virtual Ram addresses of the actor filep: Ram address of actor file (00000000 if overlay isn't loaded, or if in ROM)i: Virtual Ram address of the start of the actor instance initialization variables, located within the filen: Address of actor filename (Debug ROM only, value is 0 in commercial roms)c: Number of actor instances of this type currently loaded (ram only)

Note: The record for Link's actor in rom (the first record in the table) only sets the vram address that points to the start of the variable info for Link's actor, and the actor file name pointer if it's the Debug Rom.

Categories

Actor instances are added into a doubly-linked list based on a category id. Ids can be set in the overlay file, but can also be pro grammatically modified (ex. Skulltula/Gold Skulltula actor). There are 12 categories total. Majora's Mask may use 16 different categories.

Loading Actors

What is currently known about the loading and execution of code from actors in Zelda 64 is that:

The first time an actor is loaded (spawned), its overlay file is transferred to RAM

The transferred file has its offsets relocated to a real address space in RAM

The actor file remains allocated in ram until all instances of that actor have despawned

The game begins to create an instance of the actor

For each actor instance, actors are given a certain amount of memory as defined in the actor file. However, the minimum space required by the game's engine is 0x128 bytes in OoT (MM may vary).

Within this given memory is information such as

Location

Rotation

Scale

Pointer to damage chart (if the actor has one)

Pointers to actor functions

Initialization - run when actor instance is loaded.

Main - always run during gameplay.

Drawing - to be run when actor is close enough to the camera.

Pointer to Next/Previous actor(s) of this actor's category

Whatever else that actor needs (ex. instanced variables).

At Global Context + 0x1CB0 is a list of actor categories (see above), each element structured as follows:

int numOfActors;
ptr firstActor;
int unknown;

The pointer points to the first allocated entry for an actor. The integer is the number of actors of that category, the first entry being type 0, and the last last being type 11 (chests). Actors after the first actor are pointed to through the next/previous pointers within each allocated actor.

Custom Actors

A number of custom actors have been created. For more information, see Overlays.