Transport Tycoon CAT: Difference between revisions
Jump to navigation
Jump to search
imported>WATTO No edit summary |
imported>Ikskoks No edit summary |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 8: | Line 8: | ||
<tt><b> | <tt><b> | ||
<font color="blue"> ''' // for each file ''' </font> <br> | <font color="blue"> ''' // for each file ''' </font> <br> | ||
: uint32 {4} - File Offset <br> | : uint32 {4} - File Offset <br> | ||
| Line 15: | Line 13: | ||
<br> | <br> | ||
<font color="blue"> ''' // for each file ''' </font> <br> | <font color="blue"> ''' // for each file ''' </font> <br> | ||
: byte {1} - | : byte {1} - Title Length (including null terminator)<br> | ||
: char {X} - | : char {X} - Title <br> | ||
: byte {1} - null Title Terminator <br> | |||
: byte {X} - File Data <br> | : byte {X} - File Data <br> | ||
: byte {1} - <font color="red">''Unknown''</font> <br> | |||
: byte {1} - Filename Length (including null terminator)<br> | |||
: byte {X} - Filename <br> | |||
: byte {1} - null Filename Terminator <br> | |||
<br> | <br> | ||
uint32 {4} - Footer <font color="purple">(BANK)</font> <br> | |||
</b></tt> | </b></tt> | ||
=== MultiEx BMS Script === | === MultiEx BMS Script === | ||
<pre>Get FILENUM Long 0 ; | |||
GoTo EOF 0 ; | |||
SavePos EOFX 0 ; | |||
Math EOFX -= 3 ; | |||
GoTo EOFX 0 ; | |||
Get FOOTER Long 0 ; | |||
If FOOTER <> 1263419714 ; | |||
CleanExit ; | |||
EndIf ; | |||
Set CRAP String ? ; | |||
Math FILENUM /= 8 ; | |||
GoTo SOF 0 ; | |||
For F = 1 To FILENUM ; | |||
SavePos FOFFSETX 0 ; | |||
Get FOFFSET Long 0 ; | |||
SavePOS FSIZEX 0 ; | |||
Get FSIZE Long 0 ; | |||
SavePos NEXTFILE 0 ; | |||
GoTo FOFFSET 0 ; | |||
Get FNSIZE Byte 0 ; | |||
Math FOFFSET += FNSIZE ; | |||
Math FOFFSET += 1 ; | |||
GetDString FNAME FNSIZE 0 ; | |||
String FNAME -= CRAP ; | |||
SavePos TEMP 0 ; | |||
Math TEMP += FSIZE ; | |||
Math TEMP += 1 ; | |||
GoTo TEMP 0 ; | |||
Get EXTSIZE Byte 0 ; | |||
Math EXTSIZE -= 1 ; | |||
Do ; | |||
Get EXTB Byte 0 ; | |||
Math EXTSIZE -= 1 ; | |||
While EXTB <> 46 ; | |||
GetDString FNAMEEXT EXTSIZE 0 ; | |||
Set DOT String . ; | |||
String FNAME += DOT ; | |||
String FNAME += FNAMEEXT ; | |||
Log FNAME FOFFSET FSIZE 0 0 ; | |||
GoTo NEXTFILE 0 ; | |||
Next F ;</pre> | |||
Note: This script gets the Title and adds the real filename extension to it (since the filename is kinda boring (i.e. ''<font color="green">filetype</font><font color="blue">fileid</font><font color=purple>.extension</font>)) | |||
=== Compatible Programs === | === Compatible Programs === | ||
* [[Game Extractor|Game Extractor]]<br> | * [[Game Extractor|Game Extractor]]<br> | ||
* [[MultiEx Commander|MultiEx Commander]]<br> | |||
[[Category:File Format]] | |||
Latest revision as of 23:48, 24 January 2021
CAT
- Format Type : Archive
- Endian Order : Little Endian
Format Specifications
// for each file
- uint32 {4} - File Offset
- uint32 {4} - File Length
// for each file
- byte {1} - Title Length (including null terminator)
- char {X} - Title
- byte {1} - null Title Terminator
- byte {X} - File Data
- byte {1} - Unknown
- byte {1} - Filename Length (including null terminator)
- byte {X} - Filename
- byte {1} - null Filename Terminator
uint32 {4} - Footer (BANK)
MultiEx BMS Script
Get FILENUM Long 0 ; GoTo EOF 0 ; SavePos EOFX 0 ; Math EOFX -= 3 ; GoTo EOFX 0 ; Get FOOTER Long 0 ; If FOOTER <> 1263419714 ; CleanExit ; EndIf ; Set CRAP String ? ; Math FILENUM /= 8 ; GoTo SOF 0 ; For F = 1 To FILENUM ; SavePos FOFFSETX 0 ; Get FOFFSET Long 0 ; SavePOS FSIZEX 0 ; Get FSIZE Long 0 ; SavePos NEXTFILE 0 ; GoTo FOFFSET 0 ; Get FNSIZE Byte 0 ; Math FOFFSET += FNSIZE ; Math FOFFSET += 1 ; GetDString FNAME FNSIZE 0 ; String FNAME -= CRAP ; SavePos TEMP 0 ; Math TEMP += FSIZE ; Math TEMP += 1 ; GoTo TEMP 0 ; Get EXTSIZE Byte 0 ; Math EXTSIZE -= 1 ; Do ; Get EXTB Byte 0 ; Math EXTSIZE -= 1 ; While EXTB <> 46 ; GetDString FNAMEEXT EXTSIZE 0 ; Set DOT String . ; String FNAME += DOT ; String FNAME += FNAMEEXT ; Log FNAME FOFFSET FSIZE 0 0 ; GoTo NEXTFILE 0 ; Next F ;
Note: This script gets the Title and adds the real filename extension to it (since the filename is kinda boring (i.e. filetypefileid.extension))