Castlevania: LOS – Mirror of Fate HD .bctex textures
-
zardalu
- veteran
- Posts: 123
- Joined: Sat Sep 13, 2008 3:13 pm
- Has thanked: 14 times
- Been thanked: 19 times
- Contact:
Castlevania: LOS – Mirror of Fate HD .bctex textures
Castlevania: Lords of Shadow – Mirror of Fate HD bctex textures
Thanks to Ekey, .pkg files can be extracted which contain textures with .bctex extension:
viewtopic.php?f=10&t=11080
I am interested in bctex conversion to .dds or .tga, or whatever.
Per forum rules, please PM me for additional data.
Thanks to Ekey, .pkg files can be extracted which contain textures with .bctex extension:
viewtopic.php?f=10&t=11080
I am interested in bctex conversion to .dds or .tga, or whatever.
Per forum rules, please PM me for additional data.
-
cienislaw
- n00b
- Posts: 15
- Joined: Fri Mar 29, 2013 10:22 pm
- Has thanked: 5 times
- Been thanked: 1 time
Re: Castlevania: LOS – Mirror of Fate HD .bctex textures
bitmap starts at 0x24, its two 8bit interleaved channels. first channel always 0xFF, second is what you need. bfont format is almost the same as mst in big Castlevanias. at 0x28 you have offset to chars table data and there x, y, w, h all shorts. one difference - chars 0x00-0x1f are skipped so there are definitions for 0x20-xff only.
You do not have the required permissions to view the files attached to this post.
-
destrator
- beginner
- Posts: 28
- Joined: Tue Aug 30, 2011 4:25 am
- Has thanked: 3 times
- Been thanked: 5 times
Re: Castlevania: LOS – Mirror of Fate HD .bctex textures
Template for PC version.
In fact, the Flags field is not an enumeration. It is a set of the flags. For example the flag 0x1 means the surface, 0x3 means the compressed format. Second word of enumeration is "usage", It also describes the format of texture.
But to extract textures you can ignore these details and use an enum TEXFORMAT.
Code: Select all
enum<DWORD> TEXFORMAT
{
TEXFMT_ARGB = 0x10001,
TEXFMT_ARGB_1 = 0x20001,
TEXFMT_A8 = 0x30001,
TEXFMT_A8_1 = 0x40001,
TEXFMT_R8G8_B8G8 = 0x50001,
TEXFMT_DXT1 = 0x10003,
TEXFMT_DXT5 = 0x20003,
TEXFMT_U8V8 = 0xC0001,
TEXFMT_DXT1_1 = 0xC0003,
};
struct Header
{
BYTE Signature[4];
DWORD Version <format=hex>; // or content ID. 0x30001 for all textures.
TEXFORMAT Flags<format=hex>;
DWORD Width;
DWORD Height;
DWORD MipLevels;
DWORD NameOffset <format=hex>;
DWORD DataOffset <format=hex>;
};
Header header;
DWORD MipLevelSizes[header.MipLevels];
local int i = 0;
FSeek(header.DataOffset);
for(i = 0; i < header.MipLevels; i++)
{
struct { BYTE Data[MipLevelSizes[i]]; } level;
}
FSeek(header.NameOffset);
string name;
But to extract textures you can ignore these details and use an enum TEXFORMAT.
-
namquang93
- veteran
- Posts: 115
- Joined: Mon Apr 09, 2012 8:40 am
- Has thanked: 50 times
- Been thanked: 5 times
Re: Castlevania: LOS – Mirror of Fate HD .bctex textures
How to convert .bctex to png and repack it? Thanks!cienislaw wrote:bitmap starts at 0x24, its two 8bit interleaved channels. first channel always 0xFF, second is what you need. bfont format is almost the same as mst in big Castlevanias. at 0x28 you have offset to chars table data and there x, y, w, h all shorts. one difference - chars 0x00-0x1f are skipped so there are definitions for 0x20-xff only.
-
destrator
- beginner
- Posts: 28
- Joined: Tue Aug 30, 2011 4:25 am
- Has thanked: 3 times
- Been thanked: 5 times
Re: Castlevania: LOS – Mirror of Fate HD .bctex textures
http://rghost.ru/54291693
This command line tool converts bctex texture to dds texture. Target surface remains in the same format as the original. Use bctex2dds <bctex_filename>.
This command line tool converts bctex texture to dds texture. Target surface remains in the same format as the original. Use bctex2dds <bctex_filename>.
-
namquang93
- veteran
- Posts: 115
- Joined: Mon Apr 09, 2012 8:40 am
- Has thanked: 50 times
- Been thanked: 5 times
Re: Castlevania: LOS – Mirror of Fate HD .bctex textures
Work perfect!destrator wrote:http://rghost.ru/54291693
This command line tool converts bctex texture to dds texture. Target surface remains in the same format as the original. Use bctex2dds <bctex_filename>.
How to converts dds texture to bctex texture? Thanks for your help! ^^
- TaylorMouse
- ultra-veteran

- Posts: 340
- Joined: Mon Sep 26, 2011 12:51 pm
- Has thanked: 11 times
- Been thanked: 84 times
Re: Castlevania: LOS – Mirror of Fate HD .bctex textures
Hi guys, I just got my copy of the HD game of LOS
I extracted the files with the bms script:
Works perfect!
Now the bctex2dds is nolonger available
So i had to come up with something else, C# code of course
but how do I write it out as a dds file ??
T.
I extracted the files with the bms script:
Code: Select all
get TABLESIZE long
get DATASIZE long
get FILES long
for i = 0 < FILES
getdstring NAME 1024
get OFFSET long
get SIZE long
math SIZE -= OFFSET
log NAME OFFSET SIZE
next
Now the bctex2dds is nolonger available
So i had to come up with something else, C# code of course
Code: Select all
public enum TEXFORMAT
{
TEXFMT_ARGB = 0x10001,
TEXFMT_ARGB_1 = 0x20001,
TEXFMT_A8 = 0x30001,
TEXFMT_A8_1 = 0x40001,
TEXFMT_R8G8_B8G8 = 0x50001,
TEXFMT_DXT1 = 0x10003,
TEXFMT_DXT5 = 0x20003,
TEXFMT_U8V8 = 0xC0001,
TEXFMT_DXT1_1 = 0xC0003,
};
public struct Header
{
public byte[] Signature; // 4 bytes
public uint Version; // <format=hex>; // or content ID. 0x30001 for all textures.
public TEXFORMAT Flags;// <format=hex>;
public uint Width;
public uint Height;
public uint MipLevels;
public uint NameOffset; // <format=hex>;
public uint DataOffset; // <format=hex>;
public uint[] MipLevelSizes;
};
public static void Convert2DDS(string fileName)
{
using (var br = new BinaryReader(File.Open(fileName, FileMode.Open)))
{
Header header = new Header()
{
Signature = br.ReadBytes(4), // MTXT
Version = br.ReadUInt32(),
Flags = (TEXFORMAT)br.ReadUInt32(),
Width = br.ReadUInt32(),
Height = br.ReadUInt32(),
MipLevels = br.ReadUInt32(),
NameOffset = br.ReadUInt32(),
DataOffset = br.ReadUInt32()
};
header.MipLevelSizes = new uint[(int)header.MipLevels];
for (int i = 0; i < header.MipLevels; i++)
{
header.MipLevelSizes[i] = br.ReadUInt32();
}
br.Close();
}
}
but how do I write it out as a dds file ??
T.
- TaylorMouse
- ultra-veteran

- Posts: 340
- Joined: Mon Sep 26, 2011 12:51 pm
- Has thanked: 11 times
- Been thanked: 84 times
Re: Castlevania: LOS – Mirror of Fate HD .bctex textures
Found it 
The header is 128 bytes, always, then write the exact data from the bctex file to the dds file and it works, well almost for every case.
for the formats DXT5 & DXT1, it works just fine, cause that is noted in the header:

but what is it I need to write when dealing with another format like
ARGB
ARGB_1
A8
A8_1
R8G8_B8G8
U8V8
DXT1_1
Anyone can help me out here?
T.
The header is 128 bytes, always, then write the exact data from the bctex file to the dds file and it works, well almost for every case.
for the formats DXT5 & DXT1, it works just fine, cause that is noted in the header:
but what is it I need to write when dealing with another format like
ARGB
ARGB_1
A8
A8_1
R8G8_B8G8
U8V8
DXT1_1
Anyone can help me out here?
T.
You do not have the required permissions to view the files attached to this post.
-
claudiuboy83
- n00b
- Posts: 14
- Joined: Sun Nov 02, 2014 8:38 am
- Has thanked: 1 time
-
claudiuboy83
- n00b
- Posts: 14
- Joined: Sun Nov 02, 2014 8:38 am
- Has thanked: 1 time
Re: Castlevania: LOS – Mirror of Fate HD .bctex textures
thank you but when i try to open is blinck it and disapear...is about win OS?
-
claudiuboy83
- n00b
- Posts: 14
- Joined: Sun Nov 02, 2014 8:38 am
- Has thanked: 1 time
Re: Castlevania: LOS – Mirror of Fate HD .bctex textures
Sorry but i get this info"has unknow surface format : 0x.01000400"
Can you explain me exacly how to do this?...to convert this type of files.Thank you!
Or someone have all that bctex files converted to dds?
Can you explain me exacly how to do this?...to convert this type of files.Thank you!
Or someone have all that bctex files converted to dds?

