0.5 MB is quite abit of space for BWD files though, that would be a good temporary solution for adding maps.
BWD files on average only are 1-15 KB
Subfolder locations in PRJ
Moderator: Skyfaller
- Sir MMPD Radick
- Clan Nova Captain
- Posts: 1625
- Joined: Tue Jan 22, 2008 10:07 am
Re: Subfolder locations in PRJ
James 3:5-10: My Reminder
And the tongue is a fire, a world of iniquity: so is the tongue among our members, that it defileth the whole body. Out of the same mouth proceedeth blessing and cursing. My brethren, these things ought not so to be.
And the tongue is a fire, a world of iniquity: so is the tongue among our members, that it defileth the whole body. Out of the same mouth proceedeth blessing and cursing. My brethren, these things ought not so to be.
- quota4stupid
- House Steiner Private First Class
- Posts: 81
- Joined: Mon Dec 29, 2008 7:40 am
- Location: Australia
Re: Subfolder locations in PRJ
True, but that space isn't contiguous In the mercs PRJ file, there are only 13 FREE blocks that are over 10K (plus another ~50 that are over 1K).
- Sir MMPD Radick
- Clan Nova Captain
- Posts: 1625
- Joined: Tue Jan 22, 2008 10:07 am
Re: Subfolder locations in PRJ
good point.
James 3:5-10: My Reminder
And the tongue is a fire, a world of iniquity: so is the tongue among our members, that it defileth the whole body. Out of the same mouth proceedeth blessing and cursing. My brethren, these things ought not so to be.
And the tongue is a fire, a world of iniquity: so is the tongue among our members, that it defileth the whole body. Out of the same mouth proceedeth blessing and cursing. My brethren, these things ought not so to be.
- quota4stupid
- House Steiner Private First Class
- Posts: 81
- Joined: Mon Dec 29, 2008 7:40 am
- Location: Australia
Re: Subfolder locations in PRJ
I've got an update on this that I stumbled upon while trying to decode the TBL files:quota4stupid wrote:
struct MW2_PRJ_directory_header {
char marker[4]; // Marker string INDX
DWORD structSize; // Size of this record, plus MW2_PRJ_Directory_Entries, minus 8
DWORD unknown;
char directoryName[4];
WORD maxEntries; // (see below)
WORD entryCount; // Number of entries after this header, including an initial NULL record
WORD unknown2; // (see below)
}; // 22 bytes
0 - 3 : "INDX"
4 - 7 : Record size - 8
8 - 11 : ??
12 - 15 : Directory name
16 - 17 : maxCount - Maximum entries in table (for current size)
18 - 19 : validCount - Number of valid entries in table (see below)
20 - 21 : entryCount - Number of entries that follow (see below)
In most cases those last two fields will be the same, but in some (ie: the MEK folder for DOS 31cc) the number of entries is greater than the number of valid entries. In a nutshell, you would examine "entryCount" number of records after the INDX header, of which "validCount" are valid entries (the rest are NULL - all zeros). In these counts, the initial NULL record (ID 0) appears to count as a valid record.
The only place this logic doesn't seem to hold is in the FREE table, where "entryCount" is always 1 and "validCount" gives the number of entries that point to FREE records.
- Col.Kell
- House Steiner Archon
- Posts: 868
- Joined: Sat Sep 27, 2008 7:44 am
- Location: An Isolated Tennessee Valley.
Re: Subfolder locations in PRJ
Hopefully you'll be able to shed some light and figure it out, quota. This stuff goes far beyond me.
MechWarrior 2: 31stCC
- quota4stupid
- House Steiner Private First Class
- Posts: 81
- Joined: Mon Dec 29, 2008 7:40 am
- Location: Australia
Re: Subfolder locations in PRJ
I *think* I've got most of the essentials worked out now, although there are still a few fields that I can't figure (I tried looking for some pattern in them the other night and eventually gave up). With any luck I'll finish the project for my missus soon and then I can go gangbusters on MW2 again
- quota4stupid
- House Steiner Private First Class
- Posts: 81
- Joined: Mon Dec 29, 2008 7:40 am
- Location: Australia
Re: Subfolder locations in PRJ
Additional: the 32-bit field at offset 8 of the DDIT, INDX, SYMB and DATA chunks is a checksum field. It is a simple unsigned sum of all of the bytes in the chunk (header & payload) excluding the first 12 bytes (the tag, size and checksum fields). I've tested this successfully against all of the DOS versions, and mostly successfully against the TT version of Mercs (there were a few mismatches, but by the look of it that project file has a bunch of other errors anyway, so suspect it may just be faulty - will have a closer look later).
This doesn't appear to be the case for the field at offset 8 of the main header (PROJ). In all of the files I've checked this is the constant value 0x0c070162 (I've checked the DOS & TT versions of 31cc/GBL/Mercs for this), so I doubt it's a checksum.
This doesn't appear to be the case for the field at offset 8 of the main header (PROJ). In all of the files I've checked this is the constant value 0x0c070162 (I've checked the DOS & TT versions of 31cc/GBL/Mercs for this), so I doubt it's a checksum.