Skip to content

Commit e2ba0cd

Browse files
committed
Update bdat template
1 parent 7654a67 commit e2ba0cd

File tree

2 files changed

+63
-32
lines changed

2 files changed

+63
-32
lines changed

XbTool/XbTool/Data/010-editor-templates/bdat.bt

+61-32
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------
22
//--- 010 Editor v8.0 Binary Template
33
//
4-
// File:
4+
// File: Xenoblade BDAT data file
55
// Authors:
66
// Version:
77
// Purpose:
@@ -11,40 +11,80 @@
1111
// History:
1212
//------------------------------------------------
1313

14-
local int i;
15-
16-
struct TextEntry(int size) {
17-
uchar Data[size];
14+
enum <byte> ValueType
15+
{
16+
VT_None = 0,
17+
UInt8 = 1,
18+
UInt16 = 2,
19+
UInt32 = 3,
20+
Int8 = 4,
21+
Int16 = 5,
22+
Int32 = 6,
23+
String = 7,
24+
FP32 = 8
1825
};
1926

20-
struct BdatMember {
21-
short MemberDescOffset;
22-
short NextHashCollisionOffset;
23-
short NameOffset;
27+
enum <byte> MemberType
28+
{
29+
MT_None = 0,
30+
Scalar = 1,
31+
Array = 2,
32+
Flag = 3
2433
};
2534

26-
struct BdatMemberDesc {
27-
uchar Type;
28-
uchar ValType;
35+
local int i;
36+
37+
typedef struct(int size) {
38+
uchar Data[size];
39+
} TextEntry;
40+
41+
typedef struct {
42+
MemberType Type;
43+
ValueType ValType;
2944
ushort MemberOffset;
30-
if(Type == 2)
45+
if(Type == Array)
3146
{
3247
ushort ArrayLength;
3348
}
34-
};
49+
} BdatMemberDesc;
3550

36-
struct BdatId(int size){
51+
typedef struct(int base) {
52+
SetBackColor(cLtRed);
53+
short MemberDescOffset;
54+
short NextHashCollisionOffset;
55+
short NameOffset;
56+
57+
SetBackColor(cAqua);
58+
local int end = FTell();
59+
FSeek(base + NameOffset);
60+
string Name;
61+
62+
SetBackColor(cLtPurple);
63+
FSeek(base + MemberDescOffset);
64+
BdatMemberDesc Description;
65+
66+
FSeek(end);
67+
} BdatMember <read=BdatMemberRead>;
68+
69+
string BdatMemberRead( BdatMember &m )
70+
{
71+
string s;
72+
SPrintf( s, "%-6s %-6s %s", EnumToString(m.Description.Type), EnumToString(m.Description.ValType), m.Name);
73+
return s;
74+
}
75+
76+
typedef struct(int size){
3777
if(size > 0) {
3878
uchar Data[size];
3979
}
40-
};
80+
} BdatId;
4181

42-
struct BdatFile {
82+
typedef struct {
4383
local int base = FTell();
4484
local int i;
4585
SetBackColor(cAqua);
4686
char ID[4];
47-
uint16 Field4;
87+
uint16 Flags;
4888
uint16 NamesOffset;
4989
uint16 ItemSize;
5090
uint16 HashTableOffset;
@@ -59,34 +99,23 @@ struct BdatFile {
5999
uint16 MemberTableOffset;
60100
uint16 MemberCount;
61101

62-
Printf("%i\n", BaseId);
63102
FSeek(base + HashTableOffset);
64103
SetBackColor(cGray);
65-
uint16 Hashes[HashTableLength];
104+
uint16 HashLookupTable[HashTableLength];
66105

67106
FSeek(base + MemberTableOffset);
68107
SetBackColor(cLtRed);
69108

70109
if(MemberCount > 0) {
71-
BdatMember Members[MemberCount];
72-
}
73-
74-
75-
for(i = 0; i < MemberCount; i++)
76-
{
77-
FSeek(base + Members[i].MemberDescOffset);
78-
SetBackColor(cLtPurple);
79-
BdatMemberDesc MemberDesc;
110+
BdatMember Members(base)[MemberCount] <optimize=false>;
80111
}
81112

82113
SetBackColor(cSilver);
83114
FSeek(base + ItemTableOffset);
84115
if(ItemSize > 0) {
85116
BdatId Ids(ItemSize)[ItemCount] <optimize=false>;
86117
}
87-
};
88-
89-
118+
} BdatFile;
90119

91120
int32 FileCount;
92121
int32 ArchiveSize;

XbTool/XbTool/Data/xb2_fieldInfo.csv

+2
Original file line numberDiff line numberDiff line change
@@ -774,3 +774,5 @@ SYS_MapJumpList,MapList,Reference,FLD_maplist,,0,
774774
Vo_Battle_Enemy,CondEx,Reference,FLD_ConditionList,,0,
775775
Vo_Field_Filter,Condition,Reference,FLD_ConditionList,,0,
776776
Vo_WinSp,FLD_CondID,Reference,FLD_ConditionList,,0,
777+
CHR_EnParam,AwakeLev,Reference,BTL_EnAwake,,0,
778+
BTL_EnAwake,Name,Message,btl_buff_ms,,0,

0 commit comments

Comments
 (0)