"Oh, wow--that totally rocks!
Thanks a million. You've saved me an incredible amount of work."

Mon Ful Ir, Aug 29 2008

"So I checked out the XSLT converter and my goodness: this is an amazing piece of work!
It's fantastic that you can convert DUNGEON.DAT into XML because this info can be used by anyone now (well, anyone who knows how to use XML files).
Excellent work!"

Gambit, Feb 13 2008

"Greatstone's work looks interesting."
Paul Stevens, Feb 14, 2008

i'm gathering info enough to render complete dungeon viewport (DM snes style) in some ways: (i) using sck (swoosh construction kit) to extract viewport information. it includes decoder for "558 item", very excellent!
Kentaro, Mar 11 2007

Technical documentation - Item data formats

This section is devoted to the description of the new item formats discovered/supported by the sck tool and not included in "". If the Encyclopedia site rewrites the "technical documentation" part to easily allow to add more item format descriptions, perhaps this section will be included in it. It is a work-in-progess and items will be added one by one. These new formats have been found by me and the "DM&CSB Encyclopaedia" webmaster, in a cooperative work. Some of the SNES formats have been extracted from Kentaro tools.
1.0 (21 January 2006): initial release with IMG5 format.

Formats specification

This format is used to store a 4 bits per pixel (4bpp) image, with each bit on a specific plane. The most significant (MSB) bit of each pixel is located in the first plane, the next bit in the next plane... and the less significant bit is located on the last plane. Consequently, we found 4 planes, i.e. 4 parts in the source data. Decoded pixels begin from the top left corner of the image and end to the bottom right corner. A pixel here is a color index from the corresponding palette (16 colors).
Algorithm description
input = list of bytes
for each plane
  for each pixels
    index of input byte to read = current pixel index / 8 + input bytes already read from previous planes
    bit index to extract in this input byte = MSB to LSB
    use read bit as bit "current plane index" of current pixel
input = list of bytes
NbrOfPlanes = 4
for each plane Pli (0 -> NbrOfPlanes - 1)
  for each pixels Pxi (0 -> trunc(input.size / NbrOfPlanes * 8) - 1)
    input_index = trunc(Pxi / 8) + Pli*trunc(input.size / NbrOfPlanes)
    bit_index = (8-1) - Pxi modulo 8
    Bit Pli of pixels Pxi = bit bit_index of input input_index
Java code
  byte[] pData = ...
  int lNbrOfPlanes = 4;
  int lPlaneSize = pData.length / lNbrOfPlanes;
  int lNbrOfPixels = lPlaneSize * 8;
  byte[] lPixels = new byte[lNbrOfPixels];
  for (int lPli = 0; lPli < lNbrOfPlanes; lPli++) {
    for (int lPxi = 0; lPxi < lNbrOfPixels; lPxi++) {
    int lInputIndex = lPxi / 8 + lPli*lPlaneSize;
    int lBitIndex = (8-1) - lPxi % 8;
    lPixels[lPxi] |= (byte)((((pData[lInputIndex] >>> lBitIndex) & 0x1) << lPli) & (int)Math.pow(2, lPli));