Counterstrike XBox SXWAD

From XentaxWiki
Jump to: navigation, search

SXWAD


Format Specifications

// MexCom - Recreation of Counterstrike XBox              .WAD
// THIS IS AN AUTOMATED SPECIFICATION
// READ WITH CARE
// ----------------------------
// LEGEND
// ----------------------------
// ==> (Jump to offset)
// #DECLARE (Set variable to value)
// $$ CALCULATE (Calculate a new value)
// ** (Section that repeats itself on condition)
// // (Comment)
// uint32{4} (Unsigned 32-bit value, 4 bytes)
// uint16{2} (Unsigned 16-bit value, 2 bytes)
// ubyte{1} (Unsigned 8-bit value, 1 byte)
// char{n} (String value, n bytes in length
// ----------------------------


// Format Specification



// COMPRESSION: ZLIB

uint32{4}		D
uint32{4}		FC
uint32{4}		HS
uint32{4}		D2


** Start Repeated entry (T) {FC}
#DECLARE OSOff = CURRENT OFFSET
uint32{4}		OSize
#DECLARE CSizeOff = CURRENT OFFSET
uint32{4}		CSize
#DECLARE OffOff = CURRENT OFFSET
uint32{4}		Offset
uint32{4}		NSize
char{NSize}  		Filename of resource (FN)
#DECLARE C = CURRENT OFFSET

$$ CALCULATE NSize + 4
$$ CALCULATE NSize /  4
$$ CALCULATE NSize * 4
$$ CALCULATE NSize - JP
$$ CALCULATE C + NSize


==>C


// Resources have a name (FN), are located at Offset have a compressed size of CSize, and an uncompressed size of OSize
** End Repeated entry (T)
// ----------------------------
// MexCom - Recreation complete 


MultiEx BMS

ImpType Standard ;
ComType ZLib1 ;
Get D Long 0 ;
Get FC Long 0 ;
Get HS Long 0 ;
Get D2 Long 0 ;
For T = 1 To FC ;
SavePos OSOff 0 ;
Get OSize Long 0 ;
SavePos CSizeOff 0 ;
Get CSize Long 0 ;
SavePos OffOff 0 ;
Get Offset Long 0 ;
Get NSize Long 0 ;
GetDString FN NSize 0 ;
SavePos C 0 ;
Set JP Long NSize ;
Math NSize += 4 ;
Math NSize /= 4 ;
Math NSize *= 4 ;
Math NSize -= JP ;
Math C += NSize ;
GoTo C 0 ;
CLog FN Offset CSize OffOff CSizeOff OSize OSOff ;
Next T ;


Supported by Programs