Zelda 64: JFIF Backgrounds

From z64 wiki
Jump to: navigation, search

All information by Underscore, Peardian

How JPG Renders Work

OoT uses the JPEG File Interchange Format (JFIF), a format that stopped being updated as of 1992. This format has a more in-depth document available at W3C (1992), however that document does not apply as strictly to the Legend of Zelda, so dwelling on it is not recommended.

JPG Renders are used in rooms in Ocarina of Time that do not tend to move, such as shops and the back alleys. These rooms have collision data that is separate from the pre-rendered image. This is done so that the game can conserve space by having a constant illusory camera angle, without having to render a given number of models that have to be textured, wasting the dynamic camera angle and system memory resources.

The JPG Renders are stored in various locations throughout the ROM and are listed below.

Format

The JPG Render format is as follows.

NameDataPurpose
BegnFF D8The marker to identify that the image started.
(Included in the actual image itself.
APP0FF E0A marker to identify that header has started.
Leng00 10The length of the header excluding the APP0 marker and all other markers. 0x0010 = 16 in dec. All images use a header length of 16.
Iden4A 46 49 46 00The JFIF identifier, followed by a null byte.
Vers01 01Version, first being major, second being the minor.
LoZ:OoT used version 1.01.
Dens00Density units.
00No units, aspect ratio only specified.
01Pixels per inch.
02Pixels per centimeter.
Xden00 01Integer horizontal pixel density. (1)
Yden00 01Integer vertical pixel density. (1)
Twid00Embedded thumbnail width. (0)
Thig00Embedded thumbnail height. (0)
Tdatn/aBecause thumbnails were not used or needed, and the length is not included in the header above, it is not needed. But, for the sake of completion, the length of this section would be Twid*Thig*3 (0)
MarkFF DBThis serves to note the end of the header and is not included in its length.
Data...This is the actual data for the image, but it is useless unless the header is also included with it.
EndFF D9The marker to identify that the image has finished. (Included in the actual image itself.)

(All data in hex, all data required for extraction.)

List of JPG Renders

This section lists all positions of JPG renders and their aliases.

PositionName
0x02B64480Kokiri Link's House
0x03028160Market Bombchu Shop
0x02B96490Kokiri Shop
0x02BC3430Kokiri Know-It-All-Brothers' House
0x02C4E370Market Entrance Day
0x02CA3FB0Bazaar
0x02D09120Market Back Alley 1 Day
0x02D2E920Market Back Alley 2 Day
0x02D54120Market Back Alley 3 Day
0x02D9E370Market Entrance Night
0x02DC5360Market Entrance Future
0x02DED110Market Back Alley 1 Night
0x02E12910Market Back Alley 2 Night
0x02E38110Market Back Alley 3 Night
0x02E6C0C0Kokiri Twins' House
0x02EAAA50Lon Lon Ranch Stable
0x02ED77C2Lon Lon Ranch House
0x02F1DDA0Kakariko Gravekeepr's Hut
0x02F809D0Goron Shop
0x02FA89E0Zora Shop
0x02FD6660Kakariko Potion Shop
0x02FFE430Market Potion Shop
0x030507A0Market Mamamu Yan's House
0x0307DEF0Kakariko Anju's House
0x030B2EA0Valley Tent
0x031C80F0Kokiri Mido's House
0x032030E0Kokiri Saria's House
0x03259D80Market Pink Pants House
0x032E6AF0Temple of Time Day
0x0330C2F0Temple of Time Path Day
0x03355B10Temple of Time Night
0x0337B310Temple of Time Path Night
0x033AAAF0Temple of Time Future
0x033D02F0Temple of Time Path Future
0x03554E40Market Happy Mask Shop

Usage in Zelda 64

Main article: Maps and Scenes

JFIF images are pointed to from within the map's mesh header, when header type 1 is used.