Skip to content

DAT Files (PC port)

Kevin Kline edited this page Oct 17, 2026 · 1 revision

DAT files (the PC port)

The 2001 Chinese PC port of Breath of Fire III ships its data in DAT/, 742 files, each with the same name as a PlayStation .EMI. A .DAT is the EMI with its table of contents inlined into per-section headers, its audio decoded to WAV, its music removed and its MIPS code sections dropped. 2,120 of its 2,680 paired sections are byte-identical to the Japanese disc; the port was built from the Japanese release, and that holds chunk for chunk.

Nothing is encrypted or compressed at the container level.

Chunk format

A .DAT is a flat stream of chunks: no file header, no trailer, no alignment.

chunk header, 16 bytes, little-endian
  0x00  u32  kind    0 data | 1 image | 2 sound bank | 3 (one instance: the font)
  0x04  u32  tag     meaning depends on kind, below
  0x08  u32  size    payload bytes, header excluded
  0x0C  u32  zero
payload; the next header is at +16 + size

All 742 files walk to exactly their end under this rule: 3,582 chunks (data 2,087, image 593, sound bank 901, kind 3 once). The original loader reads the kind as a signed byte compared unsigned against 3, so any higher kind is skipped.

Kind 0: data

The payload is copied to one data arena in the executable's memory at 0x803580 + tag. The tag is therefore an offset into that arena, not a PlayStation address, and it is not a constant rebase of one: 0x80010000 becomes 0x0000, 0x80014000 becomes 0x4000, 0x8002B800 becomes 0x8000, 0x800E4000 becomes 0xC2000, 0x80104000 becomes 0xC8000, 0x80033800 becomes 0x10000. The mapping from PlayStation destination to tag is one-to-one and constant across all 200 area files, with three distinct deltas between blocks. The pointers inside the data were not relocated: 0x80xxxxxx words in an identical section are byte-equal on the PC, so the engine translates them at run time.

Kind 1: image

The payload is identical to the EMI's type-3 section, 32 x 32-halfword tiles, and the tag is the EMI's packed VRAM word verbatim in 593 of 593 cases. The port kept the PlayStation GPU model down to the file format: it maintains a 1 MB VRAM shadow and composes textures out of it.

Kind 2: sound bank

One chunk replaces an EMI's type 6/8/7 group; the tag is the group's bank id. Offsets relative to the payload:

0x000  24 cues x 16 bytes: four voice words each (0 = none)
         word: bits 0..7 the voice entry (0xFF stops the channel)
               bits 8..12 the channel (16 + n), bit 15 loop
               bits 16..31 the playback rate in Hz
0x180  64 voice entries x 8 bytes: (offset in the payload, size); entry 0 unused
0x380  the WAVs, contiguous in voice order: RIFF, PCM, mono, 16-bit,
       header rate always 22,050 (the cue word carries the real rate)

The samples are the PlayStation's VAG blocks decoded by the port's own converter, which runs the ADPCM recurrence in double precision and wraps rather than clamps; reproducing it gives 901 of 901 banks byte-identical from the Japanese or US disc. The wrap is a defect: nine samples in five sounds click where the SPU would clamp. 123 banks hold no sample at all. The rate in each cue word is 44100 * 2^((key - centre + fine/128) / 12) from the tone's fields.

Kind 3: the font

One chunk, in FIRST.DAT: the port's Chinese font, 2,451 glyphs of 24 x 24 pixels at 4 bits a pixel, low nibble first, 288 bytes each. The glyph index is the text code (0x21..0x7F single-byte, 0x80.. two-byte, ((b0 & 0x7F) << 8) + b1), which replaced the PlayStation's kana and kanji sheets.

What the port did to the EMI

EMI section in the .DAT
type 6 / 8 / 7 group one kind-2 bank, exact in 742 of 742 files
type 6 / 10 / 7 group (music) dropped: 38 files lose their sequenced music; the port plays MP3 renders from BGM/
type 3 image kind 1, same bytes, same tag
type 0 data kind 0, retagged
type 1 compressed arena kind 0, decompressed
type 0 code (542 sections) dropped: the overlays were recompiled into BOF3.exe; 44 of the 542 were all-zero BSS

Beyond the format, the port changed 35 chunks, all measured against every PlayStation disc held:

  • The enemy table in all 200 areas has its name field widened from 8 to 12 bytes (record stride 0x88 to 0x8C, block 1,160 to 1,192 bytes). Everything outside the names is byte-equal.
  • The message blocks of 199 areas and the two system pools are re-encoded for the Chinese font: same 256 slots, Chinese text.
  • The world-map page in the 16 world-map areas has 14 of 128 tiles repainted: a keyboard legend (SPACE / X / ENTER) where the PlayStation draws its buttons, and restyled gauge frames.
  • The item-type icons in FIRST.DAT moved from a 24-pixel to a 32-pixel pitch with no pixel changed.
  • Fourteen arenas were hand-edited after decompression: in eight PL files, ten of member 2's animation scripts move single sprite parts by a pixel, add parts and drop never-reached frames (352 bytes shorter); in BPLD012/015/016 member 1's first script gains two parts; in BPLD27A/BPLU27A one four-step loop is held 8 ticks a step instead of 4. START.DAT ships PL012's arena in place of its own.
  • One byte of Ryu's form data in RYUD00..03 differs, inside image 10 of the bank's 16.

The port's own additions are only two: the Chinese font (kind 3) and the Chinese message blocks. The language-bearing art the Western discs change (the title's mark and copyright, the world-map plates, a few walls) is Japanese on the PC.

The Japanese disc has 138 EMIs with no .DAT: the 81 BGM* music files, 19 SCENA chapters, 18 PLP character modules, 10 MAGIC effect modules, 5 SCE* and a few singletons: all of them code or music, both of which the port moved elsewhere.

This project's own kinds

The living port's language overlays (never shipped, built on the player's machine from their own disc) add two kinds the original loader skips: kind 4, a pen advance per glyph, and kind 5, one of the executable's 16-byte-name tables. They are ledgered as DIV-0006 and DIV-0008 and are not part of Capcom's format.

SND/ and BGM/ are not containers

Both directories use the .DAT extension but hold bare files. SND/ has 880 WAVs (mono, 22,050 Hz, 16-bit): 876 numbered NNN_KK.DAT are the Japanese disc's MAGIC00.STR XA stream cut into clips (every file is a whole number of XA sectors, 4,704 bytes each), VOICE00..04 are the five channels of VOICE.STR, and the eleven named jingles (Win, Item01, Oyasumi...) are clips of S_XA00.STR. The boot executable's own cut table regenerates all 880 byte for byte. BGM/ has 166 MP3s numbered 000..166, renders of the sequenced songs, with an N suffix on the nine tracks that play once rather than loop; the loader tries the plain name first and falls back to the N name, and that failure is how it learns the track does not loop.

Sources: DAT_CONTAINER.md, asset-loading-path.md, sound-import.md, disc-data-inventory.md, arena-edits.md.

Clone this wiki locally