Jump to content
  • 0

I challenge everybody, too...


xdaniel
 Share

Question

...to figure out the remaining, unknown commands in the scene/room headers! (hope JSA doesn't mind me borrowing his thread title and intro ;))

 

Here are OoT's unknown commands:

 

Command 0x05, used in rooms:

  • Dampe's Hut: 0x05000000 0xF600FE08
  • Hyrule Field: 0x05000000 0x50505000 and 0x05000000 0x50505001 (in one header)
  • Lake Hylia: 0x05000000 0x00000A04
  • Gerudo Valley: 0x05000000 0xF6000005
  • Desert Colossus: 0x05000000 0x0602FF82
  • Gerudo's Fortress: 0x05000000 0x00040A50, 0x05000000 0x0004288C (one header, room 0) and 0x05000000 0x000032C8 (one header, room 1)
  • Haunted Wasteland: 0x05000000 0x00000000 (room 0) and 0x05000000 0x0F286DBE (room 1)
  • Death Mountain: 0x05000000 0x9CFF1482 and 0x05000000 0x5A00FFFB (one header)
  • Ganon's Tower (outside): 0x05000000 0x00000F32
  • Sasatest: 0x05000000 0x5A005032

Command 0x09, used in rooms... or rather in exactly one, the Depth Test: 0x09000000 0x00000000

 

Command 0x0C... doesn't appear to be used anywhere.

 

Also, there's the remaining unknown/undocumented parameters in (partially) documented commands, such as 0x07 and 0x08, and making sure that the documentation of ex. the various sound and skybox commands is correct...

 

Link to comment
Share on other sites

Recommended Posts

  • 0

By some incredible coincidence, I ended up finding out part of what's behind the 05 command.

 

In these last days I have been decompiling and studying the "wooden post with a red cloth" actor to find out why there wasn't any wind animation when they were put on my custom maps. At last I stumbled upon a float value at 80222AF4 that when between 0 and 255 would affect the wind animation.

 

I had a hunch before this 05 command could be somehow related to it, since many scenes listed above happen to have the red cloth post actor on them.

After trying to load different scenes while breakpointing 80222AF4 on write, I found out the last byte on the 0x05 command is parsed to float then stored at that offset.

I wonder what else this command influences. Despite being very boring, it shouldn't be hard to use this same breakpoint to locate other actors reading from there to figure it out.

Link to comment
Share on other sites

  • 0

In Hyrule Field, that command is loaded only if you select one of the cutscenes. It's the one with Link dreaming about Ganondorf is pursuing Zelda out of Hyrule Castle, raining, at night.

Actually, it loads in other headers too, but overwriting a value of 00000000 with another 00000000.

 

Lake Hylia also, if I recall correctly, loads it during the ending credits cutscene. The most bogus ocurrence for me is at Dampé's Hut, which most likely is a leftover from a previous scene.

Link to comment
Share on other sites

  • 0

I almost think it affects (at least in part) wind direction.

Walk into the Deku Tree and facing north play the Song of Storms. If you watch the rain drops carefully, they will not fall straight down but rather at an angle (Top right to bottom left), simulating the wind pushing the raindrops. Go to Haunted Wasteland and play the Song of Storms facing north again. This time the raindrops should be almost horizontal, almost coming at you because you're facing the direction that the "wind" would be blowing based on the red cloth posts.

Edit: Look at the rain drop streak on the left in the left image vs the rain drop streak on the right in the right image

 

Posted Image

Link to comment
Share on other sites

  • 0

That's right, I see it too. That explains why it's evoked at the dream cutscene.

 

I made some tests with the other 3 values (505050-- from Hyrule Field) and these 50s are accessed somewhere in code.zasm, but I couldn't conclude anything yet.What I do know is that the red cloth post actor also parses these 3 values to floats and save them into the stack. Most likely to be used within a function at 800FD9AC... and that's it.

 

EDIT:

 

Ok, so with mzxrules' push I figured it out.

 

The 0x05 command follows a format of wwzzssff

 

WW will push the wind westward;

ZZ affects the wind vertically;

SS pushes the wind south;

FF alters the strength of the cloth flapping.

 

These values are limited between 00-FF - one byte - so while you will get believable results from the nature point of view, that won't give you full control over the wind engine.

 

WW is stored at 80222AEC on RAM (80222020 + ACC)

ZZ at 80222AEE on RAM (80222020 + ACE)

SS at 80222AF0 on RAM (80222020 + AD0)

 

Each of them get a halfword of storage space. That means an unreachable extra byte which would allow you to set higher or negative values.

WW and SS can then be changed to East and North directed winds and ZZ combined with a proper FF can make the cloth flap upwards.

Higher values also can make the rain fall in much higher angles, to the point of it being horizontal:

 

Posted Image

 

Finally, as mentioned in a post earlier, the FF value is parsed to a float and then stored into 80222AF4 (80222020 + AD4) and will self adjust if it's out of the 0 - 255 range.

  • Like 2
Link to comment
Share on other sites

  • 0

0C Command is not used in anywhere, but if you want to use it, heres is the format:

 

 

Command 0C: Can be used in .ZMAPS

 

 

Format:
0C XX 00 00 03 YY YY YY
 
 
Where:
XX = Enable/Disable the Color Illumination. (00 / 01).
YY YY YY = Is the offset of that list, follow the next Format.
 
 
Format:
01 VV WW XX YY ZZ ZZ ZZ
 
VV = ?
WW = Set the ? of Color Ilumination.
XX = ?
YY = Set the ? of Color Ilumination.
 
ZZ ZZ ZZ = Color Ilumination of Area/Actors. (RR GG BB)

 
 
Command 0F (Environment List Format): Used in .ZSCENES.

Format:
GG GG GG HH HH HH II II II JJ JJ JJ KK KK KK LL LL LL MM MM NN NN
 
 
Where:
GG GG GG = Controls the Main Ambient Ilumination (Format RR GG BB).
HH HH HH = ?
II II II = Controls the ilumination of Link from Up-Side (Format RR GG BB).
JJ JJ JJ = ?
KK KK KK = Controls the ilumination of Link from Down-Side (Format RR GG BB).
LL LL LL = Controls the Fog Color (Format RR GG BB).
MM MM = Fog Distance.
NN NN = Draw Distance.
 
 

Link to comment
Share on other sites

  • 0

That's wonderful! Strati and ChriisTiian, am I permitted to post this information on commands 05 and 0F on the wiki? Also, Strati, am I permitted to post your information on nighttime SFX on the wiki?

 

I won't post the 0C command now because I don't understand how it works. I don't understand the format of its list; is there only one "01 VV WW XX YY ZZ ZZ ZZ" in the list or are there multiple such entries?

 

This command is not used in game; how did you find out its format? It's incredible!

Link to comment
Share on other sites

  • 0

That's wonderful! Strati and ChriisTiian, am I permitted to post this information on commands 05 and 0F on the wiki? Also, Strati, am I permitted to post your information on nighttime SFX on the wiki?

 

I won't post the 0C command now because I don't understand how it works. I don't understand the format of its list; is there only one "01 VV WW XX YY ZZ ZZ ZZ" in the list or are there multiple such entries?

 

This command is not used in game; how did you find out its format? It's incredible!

 

Yes, is only one setting in the list.

 

I found this just changing random bytes in some .ZMAPS.

(I get about 50 - 60 crashes, but i figured how this works! ).

 

 

This is how Command 0C works:

 

 

Open spot01_room_0.zmap, (Kakariko Village), in a Hex Editor:

 

Ok, we need 8 bytes of free space, so, for now, we will change the actors numbers:

 

01 39 00 00 03 00 00 84

->

01 38 00 00 03 00 00 94

 

 

Now you have in the 0x84 offset free space, so, now, we will add the 0C command.

For now, we will replace the 08 command, and set the offset of that list, so:

 

 

08 00 00 00 00 00 00 00

->

0C 01 00 00 03 00 00 84

 

 

Ok, now, we will go to 0x84 offset and we will set the Color Ilumination:

 

(For Example, Red):

01 00 FF 00 FF FF 00 00

 

(Or Blue):

01 00 FF 00 FF 00 00 FF

 

 

 

It's done!, now, go to 0x2834000 offset in ROM and write all data and save.

Go to Kakariko Village and you will see something like this:

 

 

 

Posted Image

 

 

 

 

 

Posted Image

 

 

 

 

Note: Sorry for my bad english.. :( i hope you can understand this!

Link to comment
Share on other sites

  • 0

Your english isn't bad at all! Now I understand, thank you very much!

 

Command 0F is used for scenes and command 0C can be used for maps, but their effect "color/ambient illumination" is pretty similar, isn't it?

 

Can I post this information on the wiki?

Link to comment
Share on other sites

  • 0

Your english isn't bad at all! Now I understand, thank you very much!

 

Command 0F is used for scenes and command 0C can be used for maps, but their effect "color/ambient illumination" is pretty similar, isn't it?

 

Can I post this information on the wiki?

 

Thanks you!, sure!

 

And you're right, 0C and 0F have the same effect, maybe that is the reason of why is unused.

 

 

A thing:

 

In Environment Format:

 

HH HH HH and JJ JJ JJ, is different for 2D Backgrounds areas, but no idea what this change.

Link to comment
Share on other sites

  • 0

Mallos-> Yes, command 0F is used for environment effects in the game such as ambient light and fog.

 

ChriisTiian-> With some help, I found out more about the 0C command, about WW and YY:

 

Format:
01 VV WW XX YY ZZ ZZ ZZ
 
VV = ?
WW = Sets the north-south direction of Color Illumination. 00 = No color, 01-7E = Light from north, 7F-FF = Light from south.
XX = ?
YY = Sets the west-east direction of Color Illumination. 00 = No color, 01-7E = Light from east, 7F-FF = Light from west.
 
ZZ ZZ ZZ = Color Illumination of Area/Actors. (RR GG BB)
Link to comment
Share on other sites

  • 0

 

Mallos-> Yes, command 0F is used for environment effects in the game such as ambient light and fog.

 

ChriisTiian-> With some help, I found out more about the 0C command, about WW and YY:

 

Format:
01 VV WW XX YY ZZ ZZ ZZ
 
VV = ?
WW = Sets the north-south direction of Color Illumination. 00 = No color, 01-7E = Light from north, 7F-FF = Light from south.
XX = ?
YY = Sets the west-east direction of Color Illumination. 00 = No color, 01-7E = Light from east, 7F-FF = Light from west.
 
ZZ ZZ ZZ = Color Illumination of Area/Actors. (RR GG BB)

 

 

 

Yes!, yes!, that make sense!

If only we can figure out what VV and XX does, this will be complete!

 

 

I have looking the 09 command, and no idea what it does, BUT, i'm sure what this possibly make a definition of something, like the 08 command, and it doesn't have any offset list definition... (But this need more investigation...)

 

 

Command 1A, 1B, 1C already are figured out by fkualol, 1D and 1F need to be figured...

Link to comment
Share on other sites

  • 0

That's wonderful! Strati and ChriisTiian, am I permitted to post this information on commands 05 and 0F on the wiki? Also, Strati, am I permitted to post your information on nighttime SFX on the wiki?

 

Yes, no need to ask. It's not like I have any property over that information anyway.

 

By the way, wasn't the 0F command already figured out? Sharp Ocarina even has means to control all those colors and fog/draw distances and assign new environment settings.

 

Finally, the code for command 09 is almost moot. It has only two instructions saving values to the stack, that aren't read before being overwritten.

Link to comment
Share on other sites

  • 0

Just in case, here is the full documentation of Command 0C:

 

 

Command 0C: Can be used in .ZMAPS

 

Format:

00 XX 00 00 03 YY YY YY

 

XX = is the number of unused environments.

YY = is the offset of the list, follow this Format.

 

 

 

Format:

 

If starts with 00 (Ends the Unused Environment List).

 

 

If starts with 01 (Ambient Light):

 

 

 

01 00 WW 00 XX YY YY YY 00 00 00 00 00 00
 
Where:
 
WW = Noth-South direction the light is coming from (00 = no light from noth or south, 01-7E = light from north, 7F-FF light from south).
XX = East-West  direction the light is coming from (00 = no light from east or  west, 01-7E = light from  east, 7F-FF light from  west).
 
YY = Color of the Ambient Light (RR GG BB).

 

 

 

 

If starts with 02 (Transparent Cape with a Light):

 

 

 

02 00 UU 00 VV 00 WW 00 XX XX XX 00 YY 00
 
Where:
 
uu = Position X (Forward/Back) of Cape.
vv = Position Y (Up/Down) of Cape.
ww = Position Z (Left/Right) of Cape.
 
xx = Colour of Cape (RR GG BB).
 
yy = Size of Cape.

 

 

 

 

If starts with 03+ (Crashes).

 

 

 

I hope everyone can understand this!

Regards!

Link to comment
Share on other sites

  • 0

Strati-> Thank you!

 

SharpOcarina could edit these colors as Lighting A, B, C, D, E but had not information about their meaning (general ambient light, Link's upside or downside etc.).

 

So command 09 would be useless?

 

ChriisTiian-> Nice findings!

 

After some testing of the 02 format, I think I understand what you mean.

 

With Transparent Cape with a Light, you mean a punctual light source, am I right?

It can be positioned around like an actor.

But the size gets very big very fast. yy = 10 is as big as Kakariko!

 

Are you sure that the positions are only one byte long, not two? I mean, I think it is

"02 UUUU VVVV WWWW 00 XX XX XX 00 YY 00" instead of

"02 00 UU 00 VV 00 WW 00 XX XX XX 00 YY 00".

 

 

I have one question left, for the 01 (Ambient Light):

01 00 WW 00 XX YY YY YY 00 00 00 00 00 00

 

Do you think that the two 00 bytes highlighted in purple are unused? I tried many things for them, it didn't crash, but I didn't see any changes either.

Link to comment
Share on other sites

  • 0

Strati-> Thank you!

 

SharpOcarina could edit these colors as Lighting A, B, C, D, E but had not information about their meaning (general ambient light, Link's upside or downside etc.).

 

So command 09 would be useless?

 

ChriisTiian-> Nice findings!

 

After some testing of the 02 format, I think I understand what you mean.

 

With Transparent Cape with a Light, you mean a punctual light source, am I right?

It can be positioned around like an actor.

But the size gets very big very fast. yy = 10 is as big as Kakariko!

 

Are you sure that the positions are only one byte long, not two? I mean, I think it is

"02 UUUU VVVV WWWW 00 XX XX XX 00 YY 00" instead of

"02 00 UU 00 VV 00 WW 00 XX XX XX 00 YY 00".

 

 

I have one question left, for the 01 (Ambient Light):

01 00 WW 00 XX YY YY YY 00 00 00 00 00 00

 

Do you think that the two 00 bytes highlighted in purple are unused? I tried many things for them, it didn't crash, but I didn't see any changes either.

 

 

Yep, is like a punctual light source (weird)...

 

Yep, the positions are only one byte long, not two... d:

 

Yes, about the 01 Format, those bytes highlighted in purple are unused, BUT!:

01 00 WW 00 XX YY YY YY 00 00 00 00 00 00

 

About the highlighted purple bytes here, i'm not sure if have or not a effect...

Probably no because i changed this around 70 times and i didn't see any changes...

Link to comment
Share on other sites

  • 0

I didn't name the lighting color options in SO because I would've wanted to name them properly - ambient, diffuse, specular, etc., not just "upside" or "downside". And unless we figure out which color really is what, I won't be naming them anything other than "Color A", "Color B", etc. in SceneNavi either.

 

But that aside, really nice findings there, I need to experiment with them a bit too :)

  • Like 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

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