Dungeon Ledger

Prince of PersiaFile formats

Classic Game File Formats: DAT Containers, Sprites, Palettes and Sound

Games of the DOS era packed their assets into a few large container files. This section explains how that works for Prince of Persia and what a .dat file means in general.

Stacked layers of pixel blocks standing for the contents of a data container

DAT containers

A container is one file that holds many resources. The DOS release of Prince of Persia keeps its graphics, sounds and levels in a few of them, and fan-made editors can open them, list the parts and write changed parts back. The full explanation is on the Prince of Persia DAT page below.

Sprites, palettes and sound

Inside a container each resource has its own type. Images are the sprites that make up the prince, the guards and the dungeon tiles, and each image is drawn with a palette that sets its colours. Sound effects and music are stored as separate resources. Tools such as PR export them as ordinary BMP, PAL, WAV and MIDI files, which makes them editable in common software.

The pages in this section

Anyone holding a mystery file can try the DAT file opener first. The game these formats come from is described on the 1989 game page, and the editors that work with them are on the modding tools page.

How to approach an unknown container

A container file rarely explains itself. The extension says only that the file holds data, and the real format shows in the first few bytes, in the program that created the file and in the files that sit beside it. For a game, the neighbours are the best clue: a game folder with a handful of large files next to the executable usually means the resources are packed into them.

Work on a copy, keep the original name when a game must find the file again, and use a tool built for that container instead of a general archive program. The Prince of Persia DAT page shows what that looks like for one game, and the DAT file opener handles the more general case of a file that came from somewhere else entirely.

Why the formats matter for modding

Most changes to a classic game start with a format. A new sprite has to be drawn with the palette the game expects, a translated text has to fit the field it replaces, and a new sound has to be written in the type of file the container holds. Editors hide much of this work, but a modder who knows what a container, a resource type and a palette are can tell why an edit failed and which part of the file to check first.

The same knowledge helps outside games. Fan communities around old software keep documentation of file layouts because the original makers rarely published it, and that documentation is often the only reason a format can still be opened today. The pages in this section follow that tradition for Prince of Persia: they describe what the files hold and how the tools treat them, and they leave the game files themselves to the people who own them. A practical habit follows from this. Before touching any resource, note its size and its place in the container, and compare both after the edit. A sprite that has grown, a palette that now has the wrong number of colours or a sound in the wrong sample format are the usual reasons a game crashes or shows garbage after a change, and each is easy to spot when the numbers from before are on hand.

Beyond Prince of Persia

The same logic carries over to other old formats. A game console cartridge dump can carry a small header that emulators and patch tools treat differently, which is the reason for the SMC and SFC difference on the Super Nintendo. A mail attachment named winmail.dat is a container too, with attachments packed inside, and the DAT file opener names it from its first bytes. In each case the file extension is a hint at best, and the content decides.

  1. 01SMC vs SFC: SNES ROM File Extensions and Headers

    The .smc, .sfc, .swc and .fig extensions, the copier header and how to check a file for one.

Frequently asked questions

What do the file formats on this site cover?

They cover the resource containers of the Prince of Persia games and the general question of what a .dat file is. The aim is to describe each format well enough to open, inspect or edit it with the right tool.

Why do old games use container files at all?

Packing many resources into one file saved disk space and directory entries, and let the program load a resource by number instead of by name. It also kept a game's assets together, which made them harder to casually swap.

Which file types come out of a Prince of Persia DAT file?

A resource editor such as PR exports entries as BMP images, PAL palettes, WAV sounds and MIDI music. The container itself stays a single file, and edited resources are imported back into it.

Where should a reader start with an unknown file?

Start with where the file came from, then look at its first bytes. The DAT file opener on this site does the second step in the browser and names the likely format.