GRAF:Broken Sword 4 PAK
Back to index | Edit this page
PAK
{{GRAFPageMisc{{ subst:#if: Archive | {{subst:!}}Archive }}{{ subst:#if: Little Endian | {{subst:!}}Little Endian }}}}
Format Specifications
// MexCom - Recreation of pak.bms
// 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
char{12} MW
uint32{4} DataEnd
uint32{4} FNum
uint32{4} Version
#DECLARE S = CURRENT OFFSET
$$ CALCULATE DataEnd / 256
$$ CALCULATE DataEnd + 1
$$ CALCULATE DataEnd * 256
#DECLARE D = 12
$$ CALCULATE D * FNum
$$ CALCULATE S + D
#DECLARE P = CURRENT OFFSET
** Start Repeated entry (T) {FNum}
==>P
uint32{4} RFNO
#DECLARE FSO = CURRENT OFFSET
uint32{4} FS
#DECLARE FOO = CURRENT OFFSET
uint32{4} Offset of resource (FO)
$$ CALCULATE J + RFNO
#DECLARE P = CURRENT OFFSET
==>J
char{} Filename of resource (FN)
// Resources have a name (FN), are located at FO and have a size of FS
** End Repeated entry (T)
// ----------------------------
// MexCom - Recreation complete
Notes and Comments
Even though the MexScript will enable importation of resources in MexCom, this is not 100%, so do not use it.
MultiEx BMS Script
<bms ext="pak" games="'Broken Sword 4: The Angel of Death'" platforms="'PC'" version="1.0" author="Mr.Mouse" silence="no" verbose="no">
- Broken Sword 4: Angel of Death PAK files
- By Mr.Mouse
ImpType Standard ; GetDString MW 12 0 ; Get DataEnd Long 0 ; Get FNum Long 0 ; Get Version Long 0 ; SavePos S 0 ; Math DataEnd /= 256 ; Math DataEnd += 1 ; Math DataEnd *= 256 ; Set DataOff Long DataEnd ; Set D Long 12 ; Math D *= FNum ; Math S += D ; SavePos P 0 ; For T = 1 To FNum ; GoTo P 0 ; Get RFNO Long 0 ; SavePos FSO 0 ; Get FS Long 0 ; SavePos FOO 0 ; Get FO Long 0 ; Set J Long P ; Math J += RFNO ; SavePos P 0 ; GoTo J 0 ; Get FN String 0 ; Log FN FO FS FOO FSO ; Next T ;</bms>
Supported by Programs
MultiEx Commander http://multiex.xentax.com
Documentation
None
Games
Broken Sword 4