Jump to content

MM-only Header Command Documentation


43512
 Share

Recommended Posts

With the reliable HxD hex editor (I can't believe I used XVI32 over this for so long) and the handy-dandy Yaz0 encoding program, I've been working at deciphering the apparently undocumented -- I couldn't find anything about them on the wiki, at least -- scene header commands for Majora's Mask.  I apologize ahead of time if any of the below turns out to be inaccurate; I did my best to be meticulous with everything.

 

 

0x1B command:

 

 

1B xx 00 00 yy yy yy yy
 - x = number of entries
 - y = offset of entries (including the bank)

All MM scene files are required to have at least ten (10) entries of 0x1B data.  These entries represent universal actions (i.e. actions that Link can perform anywhere) that involve cutscenes, such as putting on a Transformation Mask, playing the Ocarina, and using an item in a bottle.  The area will load and run correctly with only nine entries, but may soft-lock when the next day arrives without a tenth.
"Dawn of the X Day" cutscene  - always chooses entry 10?  If none present, Link freezes in place and doesn't respond to controls; time doesn't pass.
"Night of the X Day" cutscene - always chooses entry 11?  If none present, clock disappears while purple text bar is on-screen; Link can still move freely.

Entry format (two letters = one byte):
qqqqrrrr sssstttt uuuuvvww 00xxyyzz
 - q = unknown
    0000 = camera doesn't move to cutscene position, bars don't appear; using the ocarina with this value makes Link stop responding to controls (can be unfrozen by lifting him in the air with noclip and dropping him)

 - r = length of time camera remains in cutscene position
    wxyz
       w = blocks of 256 seconds
       x = blocks of 16 seconds
       y = seconds
       z = 1/16ths of seconds
    In entries that use a 0x02 data entry, the camera remains in the position specified by that entry for the given time.
    In entries that use the universal/Link-relative positions, the camera remains in cutscene position for the specified time even after the animation completes or the dialog box is closed; despite the camera's position and the cutscene bars being present, however, Link can move around freely once the action is completed.  If Link doesn't complete the action before the timer runs out, the timer will restart; the cutscene bars visible move up and down slightly when this looping occurs.  If Link does something to trigger an unrelated cutscene while the camera is still in position and the bars still present, said cutscene will not occur until after the timer runs out.
    Using FFFF in the latter case will make the timer stop immediately when Link finishes the action; be careful, though, as using FFFF in the former case will functionally soft-lock the game, as the player will theoretically have to wait over an hour for the timer to run out before control is returned to them.

 - s = which 0x02 camera data entry to use
    FFFF = none
    Universal/Link-relative camera positions?:
    FFF5 = using a Transformation Mask (putting on AND removing)
    FFF7 = unknown
    FFF8 = unknown
    FFF9 = unknown
    FFFA = song-triggered cutscenes (Song of Double Time, Inverted Song of Time, Song of Soaring, etc)
    FFFB = holding Magic Beans or an Event Item aloft
    FFFC = using a bottled item
    FFFD = holding and playing the Ocarina
    FFFE = "get item" cutscene (e.g. getting a Piece of Heart)

 - t = which 0x17 cutscene data entry to use; cutscene overrides settings in calling entry?
    FFFF = none

 - u = unknown; some sort of index?

 - v = sound effect that plays when cutscene finishes
    00 = nothing
    01 = "completed small objective" jingle
    02 = "completed large objective" jingle
    03+ = nothing

 - w = unknown
    01 = ?
    0A = ?
    1E = ?
    FF = nothing?

 - x = HUD fadeout during cutscene
    00 = hearts, rupees, clock, buttons all fade as cutscene begins
    01 = hearts, rupees, clock, buttons remain visible throughout unless cutscene overrides for a specific icon (A during dialogue, B while playing Ocarina, etc)
    02 = hearts, rupees, and A button remain visible unless overridden
    03 = hearts, rupees, and C buttons remain visible unless overridden
    04 = same as 01
    05 = clock and all buttons remain visible unless overridden
    06 = clock and B button remain visible unless overridden
    07 = the A button remains visible unless overridden
    08+ = same as 01

 - y = behavior of camera once cutscene ends
    00 = camera drifts away slightly from its cutscene position
    01 = camera teleports behind Link into "default" position
    02 = short cutscene plays; the camera moves behind Link into "default" position, then cutscene ends
    03+ = same as 00

 - z = thickness of cutscene bars
    00 = no bars
    FF = no bars
    For most other values, the size of the bars is directly proportional to the specified value.  That is, the larger or smaller the value, the larger or smaller the bars, respectively.  1B and 20 are the defaults used by the game, with 20 being overwhelmingly more common.

 

 

 

This header command controls the behavior of small cutscenes, such as when hitting the bell in the Laundry Pool, drinking a potion, or warping somewhere with the Song of Soaring.  From what I could gather, all of the scenes in MM have at least the same nine entries, which involve universal actions (i.e. actions that Link can perform in any area); they seem to be required, as the level won't load if those entries aren't present.  These data are typically listed at the top of the segment pointed to by the command offset, and usually occur in the following order:

 

 

02 BC FF FF FF FD FF FF 00 01 00 FF 00 00 00 1B - Holding and playing the Ocarina

02 58 FF FF FF FE FF FF 00 02 00 FF 00 00 00 1B - "Get item" cutscene

02 BC FF FF FF FC FF FF 00 03 00 FF 00 00 01 1B - Using a bottled item (bug, potion, etc)

02 BC FF FF FF FB FF FF 00 04 00 FF 00 00 00 1B - Holding Magic Beans or an Event Item aloft

01 F4 FF FF FF F9 FF FF 00 05 00 FF 00 00 00 20 - Unknown

01 90 FF FF FF F5 FF FF 00 06 00 FF 00 00 01 20 - Using a Transformation Mask (putting on AND removing)

00 64 FF FF FF F8 FF FF 00 07 00 FF 00 00 00 20 - Unknown

00 C8 FF FF FF F7 FF FF 00 08 00 FF 00 00 00 20 - Unknown

03 20 FF FF FF FA FF FF FF FF 00 FF 00 00 00 20 - Song-triggered cutscenes (Song of Double Time, Song of Soaring, etc)

 

 

 

Although these are by default the same from area to area, they can be set to different configurations for different levels and it'll still work perfectly fine.

 

 

0x02 command:

 

 

02 xx 00 00 yy yy yy yy
 - x = number of entries
 - y = offset of entries (including the bank)

Entry format (two letters = one byte):
xxxxyyyy zzzzzzzz
 - x = type?
    001F = default?
    0020 = ?
    003B = ?

 - y = unknown; always 0003?

 - z = offset to entry data (including the bank)


With no rotation, camera faces perfectly horizontally, diagonal exactly between negative z and positive x axes?

Data format (two letters = one byte):
rrrrssss ttttuuuu vvvvwwww xxxxyyyy zzzz
 - r = x-coordinate of camera
 - s = y-coordinate of camera
 - t = z-coordinate of camera
 - u = x rotation
 - v = y rotation
 - w = z rotation
 - x = zoom
    0000 = maximum zoom in
    ...
    003B = minimum zoom in
    003C = no zoom
    003D = minimum zoom out
    ...
    00A4 = maximum zoom out (i.e. w/o glitching)
    Values above 00A4 cause the screen to distort and glitch.
    FFFF = no zoom

 - y = speed at which camera moves into position
    0000 = cutscene occurs, but camera does not move to position
    0001 = at cutscene start, camera slowly drifts into position
    0002 = same as 0001 except camera moves more quickly
    0003 = same as 0001 except faster than 0002
    0004 = same as 0001 except faster than 0003
    ...
    0077 = camera moves blindingly fast into position
    Values just above 0077 will cause the camera to twitch and shake upon reaching its destination.
    Values too much higher than that will cause the game to freeze, with the camera whirling around madly shortly beforehand.
    FFFF = camera teleports into position instantaneously

 - z = unknown; always FFFF?
    FFFF = nothing?

 

 

 

The 0x02 header command specifies the position of, rotation of, and effects applied to the camera for 0x1B-defined cutscenes.  The entries control whether the camera teleports to the given position or visibly moves there and how zoomed-in or zoomed-out the view is.

 

 

Those two are the only ones I've figured out thus far.  I'll update this post with any other information I can find.  Also, by all means double-check this documentation and make sure that it's correct, and please do what you can fill the holes I left in it if you feel motivated to do so.

  • Like 2
Link to comment
Share on other sites

  • 3 months later...

Related: I recently modified VerboseOcarina to print out stats on scenes and rooms, and I discovered weird actor numbers within the actor list.

 

What I think is happening is that the first 4 bits for what should be part of an actor's number are used for something else. For example, pots in the final fight scene have a number of 2082 rather than 0082.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

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