Transworld Snowboarding HPF: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
imported>Ikskoks
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[GRAFs|Back to index]]
* [[GRAFs|Return to the list of games]]


Choose archive extension:
Choose archive extension:  


<!-- insert the extension of the file here -->
== HPF ==  
== HPF ==  


Line 11: Line 10:


=== Format Specifications ===  
=== Format Specifications ===  
<pre>
// MexCom - Recreation of TransWorld Snowboarding\hpf.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
// ----------------------------


 
<tt><b>
// Format Specification
char {32}&nbsp;&nbsp;&nbsp; - Header <font color="purple">("HMG_PACKED_FILE" + null + spaces to fill)</font> <br>  
 
char {256}&nbsp;&nbsp; - Absolute Archive Path <font color="purple">(null terminated, spaces to fill)</font> <br>
 
uint32 {4}&nbsp;&nbsp; - Number Of Files <br>
FileID  'HMG_PACKED_FILE'
<br>
#DECLARE S = 32
<font color="blue"> ''' // for each file (80 bytes for each entry) ''' </font> <br>  
 
: uint32 {4}&nbsp;&nbsp; - File/Directory Identifier <font color="purple">(0/3)</font> <br>
 
<br>
==>S
: <font color="blue"> ''' if (FileDirID == 0){ ''' </font> <br>
char{}   OriginalName
:: <font color="blue"> ''' // file ''' </font> <br>
$$ CALCULATE S + 256
:: uint32 {4}&nbsp;&nbsp; - null <br>
 
:: uint32 {4}&nbsp;&nbsp; - File Offset <font color="purple">(relative to the start of the file data)</font> <br>
 
:: uint32 {4}&nbsp;&nbsp; - File Length <br>
==>S
:: char {64}&nbsp;&nbsp;&nbsp; - Filename <font color="purple">(null terminated, filled with spaces after the null)</font> <br>
uint32{4} Entries
:: <font color="blue"> ''' } ''' </font> <br>
#DECLARE S = CURRENT OFFSET
: <font color="blue"> ''' else if (FileDirID == 3){ ''' </font> <br>
$$ CALCULATE Entries * 80
:: <font color="blue"> ''' // directory ''' </font> <br>
$$ CALCULATE S + Entries
:: uint32 {4}&nbsp;&nbsp; - null <br>
uint32{4} AType
:: uint32 {4}&nbsp;&nbsp; - File ID <font color="purple">(incremental from 48)</font> -OR- Root Directory Identifier <font color="purple">(=<font color="purple">(byte)</font>1)</font> <br>  
uint32{4} Unknown
<br>
uint32{4} Unknown
:: <font color="blue"> ''' if (fileID == (byte)1){ ''' </font> <br>
uint32{4} FileNum
::: uint32 {4}&nbsp;&nbsp; - File ID <font color="purple">(incremental from 48)</font> <br>
#DECLARE J = CURRENT OFFSET
::: <font color="blue"> ''' } ''' </font> <br>
$$ CALCULATE J + 64
:: <font color="blue"> ''' else { ''' </font> <br>
 
::: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown <font color="purple">(1)</font> '' </font> <br>
 
::: <font color="blue"> ''' } ''' </font> <br>
==>J
<br>
 
:: char {64}&nbsp;&nbsp;&nbsp; - Directory Name <font color="purple">(null terminated, filled with spaces after the null)</font> <br>
 
:: <font color="blue"> ''' } ''' </font> <br>
** Start Repeated entry (T) {FileNum}
<br>
uint32{4} RType
byte {X}&nbsp;&nbsp;&nbsp;&nbsp; - File Data <br>
uint32{4} Unknown
</b></tt>
uint32{4} ROff
uint32{4} Size
char{64} Name
$$ CALCULATE ROff + S
 
 
// Resources have a name (Name), are located at ROff and have a size of Size
** End Repeated entry (T)
// ----------------------------
// MexCom - Recreation complete
</pre>


=== MultiEx BMS ===  
=== MultiEx BMS ===  
<!--  Insert BMS script here using <pre></pre> -->


<pre>IDString 0 HMG_PACKED_FILE ;
<pre>IDString 0 HMG_PACKED_FILE ;
Line 103: Line 73:
Next T ;</pre>
Next T ;</pre>


=== Supported Programs ===


=== Notes and Comments ===
* [[Game Extractor|Game Extractor]]<br>
<!-- Insert comments here -->
* [[MultiEx Commander]]


Some archives don't follow the same rule.


=== Supported by Programs ===
[[Category:File Format]]
<!-- Insert programs that open the format here -->
* [[MultiEx Commander]]

Latest revision as of 23:48, 24 January 2021

Choose archive extension:

HPF


Format Specifications

char {32}    - Header ("HMG_PACKED_FILE" + null + spaces to fill)
char {256}   - Absolute Archive Path (null terminated, spaces to fill)
uint32 {4}   - Number Of Files

// for each file (80 bytes for each entry)

uint32 {4}   - File/Directory Identifier (0/3)


if (FileDirID == 0){
// file
uint32 {4}   - null
uint32 {4}   - File Offset (relative to the start of the file data)
uint32 {4}   - File Length
char {64}    - Filename (null terminated, filled with spaces after the null)
}
else if (FileDirID == 3){
// directory
uint32 {4}   - null
uint32 {4}   - File ID (incremental from 48) -OR- Root Directory Identifier (=(byte)1)


if (fileID == (byte)1){
uint32 {4}   - File ID (incremental from 48)
}
else {
uint32 {4}   - Unknown (1)
}


char {64}    - Directory Name (null terminated, filled with spaces after the null)
}


byte {X}     - File Data

MultiEx BMS

IDString 0 HMG_PACKED_FILE ;
Set S Long 32 ;
GoTo S 0 ;
Get OriginalName String 0 ;
Math S += 256 ;
GoTo S 0 ;
Get Entries Long 0 ;
SavePos S 0 ;
Math Entries *= 80 ;
Math S += Entries ;
Get AType Long 0 ;
Get Unknown Long 0 ;
Get Unknown Long 0 ;
Get FileNum Long 0 ;
SavePos J 0 ;
Math J += 64 ;
GoTo J 0 ;
For T = 1 To FileNum ;
Get RType Long 0 ;
Get Unknown Long 0 ;
Get ROff Long 0 ;
Get Size Long 0 ;
GetDString Name 64 0 ;
Math ROff += S ;
Log Name ROff Size 0 0 ;
Next T ;

Supported Programs