Post by Deleted on Jan 6, 2009 14:36:02 GMT -5
First off, here's what the Zmap header looks like:
The Zmap header is the part in red.
Currently, anything you do here can only be done on the Debug ROM, because the others are compressed, and have no distinguishable header. However, I am in the process of making sense of the compressed ones.
To find a Zmap header, either go to the start offset of a map in the ROM, or edit the map file of the area you want if you have extracted it from the ROM.
For a list of offsets, go here:
www.64.vg/wiki/index.php?title=Zelda_64:_Debug_ROM_File_Listing
Each part of the header is 8 bytes long.
First off,
18 00 00 00 03 xx xx xx
The first 8 bytes just state that there is more than one map file, so you can just ignore that one in most cases.
The 03 states that the following bytes are a pointer.
The last 3 bytes in yellow tell you the offset from the beginning of the map file where the pointers to other maps in the file are found.
So in our example at the top, we see that the pointers to the other maps start at 00 00 50.
Note that the 18 command is not present in all map files because not all of them have more than one map to them, e.g. dungeons.
The next part of the header is:
16 00 00 00 00 00 00 xx
Where xx controls the level of echo. Most maps have 07, but you can use any value from 00 to FF.
The next part looks like:
08 00 00 00 00 00 xx xx
Where xx xx is the object set being used, in most cases you should try to leave this as it is.
The next part is:
12 00 00 00 00 00 00 00
To be honest, I'm not entirely sure what this part does.
After that we can see:
10 00 00 00 xx xx yy 00
This is a good one to play around with,
xx xx = The time it is when the map is loaded, for the current in-game time use FF FF.
yy = Speed of time flow, 00 or FF = none, 0A = default, 03 = Majora's Mask value, FE = LOL.
Next one:
05 00 00 00 xx xx xx xx
Not sure what this one does either, and it isn't used in all maps.
Next one is:
0A 00 00 00 03 xx xx xx
Again, 03 signals that the following bytes are a pointer.
xx xx xx In this case points to the mesh data (offset from the start of he Zmap) used for the map, and as you can clearly see, I have been screwing around with some of the stuff in our example Zmap (the order and structure of the data remains the same though).
The next part is:
0B xx 00 00 03 yy yy yy
xx = The number of groups.
yy yy yy Points to the offset (from the start of the Zmap) of the start of the group's data.
Next one is:
01 xx 00 00 03 yy yy yy
xx = Number of actors
yy yy yy Points to the offset (from the start of the Zmap) of the start of the actors' data.
Don't modify the number of groups or actors unless you actually know what you're doing/how to add extra actors and groups.
And finally,
14 00 00 00 00 00 00 00
Just signals that this is the end of the Zmap's header.
For compressed Zmaps, I'm still figuring out how they work, so I'll probably post some stuff about those in the near future.
Hope you find this useful! ;D
The Zmap header is the part in red.
Currently, anything you do here can only be done on the Debug ROM, because the others are compressed, and have no distinguishable header. However, I am in the process of making sense of the compressed ones.
To find a Zmap header, either go to the start offset of a map in the ROM, or edit the map file of the area you want if you have extracted it from the ROM.
For a list of offsets, go here:
www.64.vg/wiki/index.php?title=Zelda_64:_Debug_ROM_File_Listing
Each part of the header is 8 bytes long.
First off,
18 00 00 00 03 xx xx xx
The first 8 bytes just state that there is more than one map file, so you can just ignore that one in most cases.
The 03 states that the following bytes are a pointer.
The last 3 bytes in yellow tell you the offset from the beginning of the map file where the pointers to other maps in the file are found.
So in our example at the top, we see that the pointers to the other maps start at 00 00 50.
Note that the 18 command is not present in all map files because not all of them have more than one map to them, e.g. dungeons.
The next part of the header is:
16 00 00 00 00 00 00 xx
Where xx controls the level of echo. Most maps have 07, but you can use any value from 00 to FF.
The next part looks like:
08 00 00 00 00 00 xx xx
Where xx xx is the object set being used, in most cases you should try to leave this as it is.
The next part is:
12 00 00 00 00 00 00 00
To be honest, I'm not entirely sure what this part does.
After that we can see:
10 00 00 00 xx xx yy 00
This is a good one to play around with,
xx xx = The time it is when the map is loaded, for the current in-game time use FF FF.
yy = Speed of time flow, 00 or FF = none, 0A = default, 03 = Majora's Mask value, FE = LOL.
Next one:
05 00 00 00 xx xx xx xx
Not sure what this one does either, and it isn't used in all maps.
Next one is:
0A 00 00 00 03 xx xx xx
Again, 03 signals that the following bytes are a pointer.
xx xx xx In this case points to the mesh data (offset from the start of he Zmap) used for the map, and as you can clearly see, I have been screwing around with some of the stuff in our example Zmap (the order and structure of the data remains the same though).
The next part is:
0B xx 00 00 03 yy yy yy
xx = The number of groups.
yy yy yy Points to the offset (from the start of the Zmap) of the start of the group's data.
Next one is:
01 xx 00 00 03 yy yy yy
xx = Number of actors
yy yy yy Points to the offset (from the start of the Zmap) of the start of the actors' data.
Don't modify the number of groups or actors unless you actually know what you're doing/how to add extra actors and groups.
And finally,
14 00 00 00 00 00 00 00
Just signals that this is the end of the Zmap's header.
For compressed Zmaps, I'm still figuring out how they work, so I'll probably post some stuff about those in the near future.
Hope you find this useful! ;D