General

.vcn files contains graphics for the walls including the background. All walls graphics and the background is made up of 8x8 blocks. The .vcn file contains the data for these blocks, not how to put them together. The description how to put these 8x8 blocks into correct walls is defined in the .vmp files.

There are 3 variations of the format:
PC version, EOB 1&2 (32 colors:16 for backdrop / 16 for Wallsets)
Amiga version, EOB 1&2 (16 colors: for backdrop & Wallsets)
PC version, Lands Of Lore (128 colors: for backdrop & Wallsets)



PC version, EOB 1&2 (32 colors:16 for backdrop / 16 for Wallsets)


In the final PC version every VCN file is compressed like any other CPS file. Look there for information on unpacking. Also take a glance over the tools section. EOB demo files are uncompressed.

After unpacking the file (e.g. to memory) it is structured the way described in the following:

struct VCN
{
   unsigned short nbrOfBlocks;
   unsigned char backdrop_palette[16];
   unsigned char wall_palette[16];
   struct Block
   {
     unsigned char rawData[4][8];
   } blocks[nbrOfBlocks]
 
}

nbrOfBlocks

A 16-bit value stating how many blocks that this file contains.

palette

A table of two 16 colors position entries in 256 current palette. The first is used for backdrop (VMP gives last number of blocks used for backdrop) others one use second palette.
Those entries are index to the real palette. So a color is given by mypalette[index1].

blocks

And array of struct Blocks entires. The number of entries is stated by the nbrOfBlocks field.

rawData

An 8x8 sized graphical block.
Every byte is 2 pixel, and is the index to a palette entries (wall or backdrop).

ex. rawData is 15h, then color 1 and 5 in the offset pal above.
Real pixel color is:
color_pixel1 = myPalette[ wall_palette[1] ];
color_pixel2 = myPalette[ wall_palette[5] ];

myPalette can be found in the various .pal files (one for each tileset brick,blue,drow,green & xanatha).




Amiga version, EOB 1&2 (16 colors: for backdrop & Wallsets)

struct VCN
{
   unsigned short nbrOfBlocks;
   unsigned short palette[16];
   struct Block
   {
      unsigned char rawPlanarData[5][8];
   } blocks[nbrOfBlocks];
};

nbrOfBlocks

A 16-bit value stating how many blocks that this file contains.

palette

A table of 16 palette entries. The palette uses the same format as in the .cps files. Each entry [I] in this palette replaces index [I]+1 of the global palette. The default global palette can be obtained from the file INVENT.CPS. Black colors (i.e. of value 0x0000), are ignored and does not replace entries in the global palette.
(Remark: EOB2 use external file palette 32 colors / 1 word by color/ $xRGB format )

blocks

And array of struct Blocks entires. The number of entries is stated by the nbrOfBlocks field.

rawPlanarData

An 8x8 sized graphical block in 5 bitplanes.
Planar to chunky source:
unsigned char chunkyBlock[8][8]; /* output */
for (int y=0;y<8;y++)
{
   for (int x=0;x<8;x++)
   {
      int bit=1<<(7-x);
      unsigned char data=0;
      for (int plane=0;plane<5;plane++)
      {
         data|=(rawPlanarData[plane][y]&bit)==0?0:(1<<plane);
      }
      chunkyBlock[x][y]=data;
   }
}




PC version, Lands Of Lore (128 colors : for backdrop & Wallsets)

struct VCN
{
   unsigned short nbrOfBlocks;
 
   struct BlockPalettePosTable
   {
     unsigned char Num_palettes[1];
   } blocksPalettePosTable[nbrOfBlocks]
 
   struct PosPaletteTables
   {
     unsigned char backdrop_wall_palettes[16];
   } PosPaletteTables[8]
 
   unsigned char Palette[3*128];
 
   struct Block
   {
     unsigned char rawData[4][8];
   } blocks[nbrOfBlocks]
 
}
remark: Filelength=nbrOfBlocks*4*8+nbrOfBlocks+16*16+2

=

=

nbrOfBlocks

A 16-bit value stating how many blocks that this file contains.

BlockPalettePosTable

A 8-bits table values stating offset to found good PosPaletteTable

PosPaletteTables

8 tables of 16 entries; It's colors position in the current 256 palette .

palette

128 colors palette (3*128 using EOB palette format) .

blocks

And array of struct Blocks entires. The number of entries is stated by the nbrOfBlocks field.

rawData

An 8x8 sized graphical block.
Every byte is 2 pixel, and is the index to a palette entries (wall or backdrop).

ex. rawData is 15h, then color 1 and 5 in the offset pal above. And BlockPaletteNumTable = $70 (7*16)
Real pixel color is:
color_pixel1 = palette[PosPaletteTables[7].backdrop_wall_palettes[1]];
color_pixel2 = palette[PosPaletteTables[7].backdrop_wall_palettes[5]];