mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-04 13:47:04 -04:00
* License header formatting change
* New IFF chunk formats supported: CST, FBMP, CATS * Rebranded libfar to simply far * Started preliminary work on the hitutils package
This commit is contained in:
parent
55659f43b5
commit
bc51bb4aad
96 changed files with 2321 additions and 424 deletions
|
@ -1,3 +1,3 @@
|
|||
add_subdirectory(FARDive)
|
||||
add_subdirectory(iff2html)
|
||||
add_subdirectory(misc)
|
||||
add_subdirectory(hitutils)
|
||||
add_subdirectory(iff2html)
|
|
@ -1,5 +1,7 @@
|
|||
/*
|
||||
TSOSimulatorClient.cpp - Copyright (c) 2012 Fatbag <X-Fi6@phppoll.org>
|
||||
TSOSimulatorClient - TSOSimulatorClientD.dll injector
|
||||
iff2html.c - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
18
Tools/hitutils/CMakeLists.txt
Normal file
18
Tools/hitutils/CMakeLists.txt
Normal file
|
@ -0,0 +1,18 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
project(hitutils)
|
||||
|
||||
set(HITDUMP_SOURCES
|
||||
hitdump.cpp
|
||||
)
|
||||
|
||||
set(HITASM_SOURCES
|
||||
hitasm.cpp
|
||||
)
|
||||
|
||||
set(HITLD_SOURCES
|
||||
hitld.cpp
|
||||
)
|
||||
|
||||
add_executable(hitdump ${HITDUMP_SOURCES})
|
||||
add_executable(hitasm ${HITASM_SOURCES})
|
||||
add_executable(hitld ${HITLD_SOURCES})
|
32
Tools/hitutils/hitasm.cpp
Normal file
32
Tools/hitutils/hitasm.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
hitutils - The Sims HIT (dis)assembler and linker
|
||||
hitasm.cpp - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
printf("Usage: hitasm [-f] [-o outfile.o] infile.txt\n"
|
||||
"Compile a HIT source file to an intermediary object file\n"
|
||||
"which can be linked using hitld.\n"
|
||||
"\n"
|
||||
"Use -f to force overwriting without confirmation.\n"
|
||||
"\n"
|
||||
"Report bugs to <X-Fi6@phppoll.org>.\n"
|
||||
"hitutils is maintained by the Niotso project.\n"
|
||||
"Home page: <http://www.niotso.org/>\n");
|
||||
return 0;
|
||||
}
|
35
Tools/hitutils/hitdump.cpp
Normal file
35
Tools/hitutils/hitdump.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
hitutils - The Sims HIT (dis)assembler and linker
|
||||
hitdump.cpp - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
printf("Usage: hitdump [-f] [-o outfile.txt] [-hsm outfile.hsm]\n"
|
||||
" [-hot outfile.hot] infile.hit\n"
|
||||
"Disassemble a HIT binary.\n"
|
||||
"\n"
|
||||
"The HSM and HOT files associated with the HIT file are required\n"
|
||||
"as inputs; their paths default to same base name as the input\n"
|
||||
"file but can be changed with the above options.\n"
|
||||
"Use -f to force overwriting without confirmation.\n"
|
||||
"\n"
|
||||
"Report bugs to <X-Fi6@phppoll.org>.\n"
|
||||
"hitutils is maintained by the Niotso project.\n"
|
||||
"Home page: <http://www.niotso.org/>\n");
|
||||
return 0;
|
||||
}
|
35
Tools/hitutils/hitld.cpp
Normal file
35
Tools/hitutils/hitld.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
hitutils - The Sims HIT (dis)assembler and linker
|
||||
hitld.cpp - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
printf("Usage: hitld [-f] [-hsm infile.hsm] [-hot infile.hot]\n"
|
||||
" outfile.hit INFILES\n"
|
||||
"Link object files produced by hitasm into a HIT binary.\n"
|
||||
"\n"
|
||||
"The HSM and HOT files associated with the HIT file are required\n"
|
||||
"for modification; their paths are normally defined by one of the\n"
|
||||
"linked objects but can be forced using the above options.\n"
|
||||
"Use -f to force overwriting without confirmation.\n"
|
||||
"\n"
|
||||
"Report bugs to <X-Fi6@phppoll.org>.\n"
|
||||
"hitutils is maintained by the Niotso project.\n"
|
||||
"Home page: <http://www.niotso.org/>\n");
|
||||
return 0;
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
/*
|
||||
iff2html.c - Copyright (c) 2012 Fatbag <X-Fi6@phppoll.org>
|
||||
iff2html - iff web page description generator
|
||||
iff2html.c - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
Ahmed El-Mahdawy <aa.mahdawy.10@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -140,7 +143,7 @@ int main(int argc, char *argv[]){
|
|||
printf("%sChunk data is corrupt.", "iff2html: error: ");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* Calculate the MD5, and then we can free the IFF data because we're done with it */
|
||||
MD5Init(&md5c);
|
||||
MD5Update(&md5c, IFFData, FileSize);
|
||||
|
@ -269,7 +272,6 @@ int main(int argc, char *argv[]){
|
|||
fprintf(hFile, "\n");
|
||||
|
||||
for(i=1, ChunkData = IFFFileInfo->Chunks; i <= IFFFileInfo->ChunkCount; i++, ChunkData++){
|
||||
IFF_STR * StringData = (IFF_STR*) ChunkData->FormattedData;
|
||||
fprintf(hFile, "<h2 id=\"chunk%u_%.4x\">%u [%s] (%.4X)%s%s <a href=\"#chunk%u_%.4x\">(Jump)</a></h2>\n",
|
||||
i, ChunkData->ChunkID, i, ChunkData->Type, ChunkData->ChunkID,
|
||||
(ChunkData->Label[0] != 0x00) ? " – " : "", ChunkData->Label,
|
||||
|
@ -281,11 +283,13 @@ int main(int argc, char *argv[]){
|
|||
}else if(!strcmp(ChunkData->Type, "STR#") ||
|
||||
!strcmp(ChunkData->Type, "CTSS") ||
|
||||
!strcmp(ChunkData->Type, "FAMs") ||
|
||||
!strcmp(ChunkData->Type, "TTAs") ){
|
||||
!strcmp(ChunkData->Type, "TTAs") ||
|
||||
!strcmp(ChunkData->Type, "CST") ){
|
||||
/****
|
||||
** STR# parsing
|
||||
*/
|
||||
|
||||
IFFString * StringData = ChunkData->FormattedData;
|
||||
fprintf(hFile, "<table>\n");
|
||||
fprintf(hFile, "<tr><td>Format:</td><td>");
|
||||
switch(StringData->Format){
|
||||
|
@ -346,23 +350,71 @@ int main(int argc, char *argv[]){
|
|||
|
||||
fprintf(hFile, "</table>\n");
|
||||
}
|
||||
}else if(!strcmp(ChunkData->Type, "CATS")){
|
||||
/****
|
||||
** CATS parsing
|
||||
*/
|
||||
|
||||
IFFStringPair * Pair = ChunkData->FormattedData;
|
||||
|
||||
fprintf(hFile, "<table class=\"center\">\n");
|
||||
fprintf(hFile, "<tr><th>Key</th><th>Value</th></tr>\n");
|
||||
fprintf(hFile, "<tr><td>%s</td><td>%s</td></tr>\n",
|
||||
(Pair->Key) != NULL ? Pair->Key : "",
|
||||
(Pair->Value) != NULL ? Pair->Value : "");
|
||||
fprintf(hFile, "</table>\n");
|
||||
}else if(!strcmp(ChunkData->Type, "FWAV")){
|
||||
/****
|
||||
** Regular string
|
||||
*/
|
||||
|
||||
fprintf(hFile, "<table class=\"center\">\n");
|
||||
fprintf(hFile, "<tr><th>String</th></tr>\n");
|
||||
fprintf(hFile, "<tr><td>%s</td></tr>\n", ChunkData->FormattedData ? (char*) ChunkData->FormattedData : "");
|
||||
fprintf(hFile, "</table>\n");
|
||||
}else if(!strcmp(ChunkData->Type, "BCON")){
|
||||
/****
|
||||
** BCON parsing
|
||||
*/
|
||||
|
||||
IFF_BCON * BCONData = (IFF_BCON*) ChunkData->FormattedData;
|
||||
|
||||
IFF_BCON * BCONData = ChunkData->FormattedData;
|
||||
fprintf(hFile, "<table>\n");
|
||||
fprintf(hFile, "<tr><td>Flags:</td><td><tt>%02X</tt> (%d)</td></tr>\n", BCONData->Flags, BCONData->Flags);
|
||||
fprintf(hFile, "</table>\n");
|
||||
if(BCONData->ConstantCount > 0){
|
||||
unsigned ConstantIndex;
|
||||
unsigned i;
|
||||
|
||||
fprintf(hFile, "<br />\n");
|
||||
fprintf(hFile, "<table class=\"center\">\n");
|
||||
fprintf(hFile, "<tr><th colspan=\"2\">Constant Value</th></tr>\n");
|
||||
for(ConstantIndex=0; ConstantIndex<BCONData->ConstantCount; ConstantIndex++)
|
||||
fprintf(hFile, "<tr><td>%u</td><td>%u</td></tr>\n", ConstantIndex+1, BCONData->Constants[ConstantIndex]);
|
||||
for(i=0; i<BCONData->ConstantCount; i++)
|
||||
fprintf(hFile, "<tr><td>%u</td><td>%u</td></tr>\n", i+1, BCONData->Constants[i]);
|
||||
fprintf(hFile, "</table>\n");
|
||||
}
|
||||
}else if(!strcmp(ChunkData->Type, "TRCN")){
|
||||
/****
|
||||
** TRCN parsing
|
||||
*/
|
||||
|
||||
IFFRangeSet * RangeSet = ChunkData->FormattedData;
|
||||
fprintf(hFile, "<table>\n");
|
||||
fprintf(hFile, "<tr><td>Version:</td><td>%u</td></tr>\n", RangeSet->Version);
|
||||
fprintf(hFile, "</table>\n");
|
||||
if(RangeSet->RangeCount > 0){
|
||||
unsigned i;
|
||||
IFFRangeEntry * Range;
|
||||
|
||||
fprintf(hFile, "<br />\n");
|
||||
fprintf(hFile, "<table class=\"center\">\n");
|
||||
fprintf(hFile, "<tr><th>Used yet</th><th>Default value</th><th>Name</th>"
|
||||
"<th>Comment</th><th>Range is enforced</th><th>Minimum</th><th>Maximum</th></tr>\n");
|
||||
for(i=0, Range=RangeSet->Ranges; i<RangeSet->RangeCount; i++, Range++)
|
||||
fprintf(hFile, "<tr><td>%s</td><td>%u</td><td>%s</td><td>%s</td><td>%s</td><td>%u</td><td>%u</td></tr>\n",
|
||||
Range->IsUnused ? "No" : "Yes", Range->DefaultValue,
|
||||
Range->Name ? Range->Name : "",
|
||||
Range->Comment ? Range->Comment : "",
|
||||
Range->Enforced ? "Yes" : "No",
|
||||
Range->RangeMin, Range->RangeMax);
|
||||
fprintf(hFile, "</table>\n");
|
||||
}
|
||||
}
|
||||
|
@ -377,7 +429,7 @@ int main(int argc, char *argv[]){
|
|||
fprintf(hFile, "</body>\n");
|
||||
fprintf(hFile, "</html>");
|
||||
fclose(hFile);
|
||||
|
||||
|
||||
printf("Wrote contents to '%s'.\n", OutFile);
|
||||
return 0;
|
||||
}
|
|
@ -1,125 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Content-Style-Type" content="text/css; charset=utf-8" />
|
||||
<meta http-equiv="Content-Language" content="en" />
|
||||
<meta name="description" content="behavior.iff (iff2html)" />
|
||||
<meta name="generator" content="iff2html" />
|
||||
<title>behavior.iff (iff2html)</title>
|
||||
<style type="text/css" media="all">
|
||||
html, body {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
a:link, a:visited, a:hover, a:active { color: #00f; }
|
||||
a:link, a:visited { text-decoration: none; }
|
||||
a:hover, a:active { text-decoration: underline; }
|
||||
|
||||
#attributes {
|
||||
border-left: 2px solid #888; padding-left: 4px; margin-bottom: 1em;
|
||||
}
|
||||
|
||||
#toc {
|
||||
display: table-cell;
|
||||
margin-top: 1em;
|
||||
background: #eee; border: 1px solid #bbb;
|
||||
padding: .25em;
|
||||
}
|
||||
#toc div {
|
||||
border-bottom: 1px solid #aaa;
|
||||
}
|
||||
#toc ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
ul ul {
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
border-bottom: 1px solid #888;
|
||||
margin: 2em 0 0.25em 0;
|
||||
}
|
||||
h2 a {
|
||||
font-size: 9pt;
|
||||
}
|
||||
|
||||
table {
|
||||
border: 1px #aaa solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
th, td {
|
||||
border: 1px #aaa solid;
|
||||
padding: 0.2em;
|
||||
}
|
||||
|
||||
.center {
|
||||
margin: auto auto;
|
||||
}
|
||||
|
||||
#footer {
|
||||
margin-top: 1.75em;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>behavior.iff</h1>
|
||||
<div id="attributes">
|
||||
<div>9809b96803833f2891ddd31e474795a9 (md5), 42.4kB (43,446 bytes)</div>
|
||||
<div>Dumped by iff2html.</div></div>
|
||||
|
||||
<div id="toc"><div><b>Contents</b> – x chunks</div>
|
||||
<ul>
|
||||
<li><a href="#chunk1_00dd">1 [STR#] (00DD) – neighbor data labels</a></li>
|
||||
<li><a href="#chunk2_00ea">2 [STR#] (00EA) – build mode types</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h2 id="chunk1_00dd">1 [STR#] (00DD) – neighbor data labels <a href="#chunk1_00dd">(Jump)</a></h2>
|
||||
<div>
|
||||
<table>
|
||||
<tr><td>Format:</td><td><tt>FC FF</tt> (−4)</td></tr>
|
||||
</table><br />
|
||||
<table class="center">
|
||||
<tr><th>Language</th><th colspan="3">String pairs</th></tr>
|
||||
<tr><td rowspan="10">English (US)</td>
|
||||
<td>1</td><td>person instance id</td><td>4</td></tr>
|
||||
<tr><td>2</td><td>belongs in house</td><td>4</td></tr>
|
||||
<tr><td>3</td><td>person age</td><td>4</td></tr>
|
||||
<tr><td>4</td><td>relationship raw score</td><td>4</td></tr>
|
||||
<tr><td>5</td><td>relationship score</td><td>4</td></tr>
|
||||
<tr><td>6</td><td>friend count</td><td>4</td></tr>
|
||||
<tr><td>7</td><td>house number</td><td>4</td></tr>
|
||||
<tr><td>8</td><td>has telephone</td><td>4</td></tr>
|
||||
<tr><td>9</td><td>has baby</td><td>4</td></tr>
|
||||
<tr><td>10</td><td>family friend count</td><td>4</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h2 id="chunk2_00ea">2 [STR#] (00EA) – build mode types <a href="#chunk2_00ea">(Jump)</a></h2>
|
||||
<div>
|
||||
<table>
|
||||
<tr><td>Format:</td><td><tt>FC FF</tt> (−4)</td></tr>
|
||||
</table><br />
|
||||
<table class="center">
|
||||
<tr><th>Language</th><th colspan="3">String pairs</th></tr>
|
||||
<tr><td rowspan="8">English (US)</td>
|
||||
<td>1</td><td>none</td><td>4</td></tr>
|
||||
<tr><td>2</td><td>door</td><td>4</td></tr>
|
||||
<tr><td>3</td><td>window</td><td>4</td></tr>
|
||||
<tr><td>4</td><td>stair</td><td>4</td></tr>
|
||||
<tr><td>5</td><td>plant</td><td>4</td></tr>
|
||||
<tr><td>6</td><td>fireplace</td><td>4</td></tr>
|
||||
<tr><td>7</td><td>column</td><td>4</td></tr>
|
||||
<tr><td>8</td><td>pool equipment</td><td>4</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="footer">This page was generated by the use of <a href="http://www.niotso.org/">iff2html</a>.
|
||||
The content of this page may be subject to copyright by the author(s) of the original iff file.</div>
|
||||
</body>
|
||||
</html>
|
|
@ -107,7 +107,7 @@ void MD5Update(ctx, buf, len)
|
|||
}
|
||||
|
||||
/*
|
||||
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
||||
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
||||
* 1 0* (64-bit count of bits processed, MSB-first)
|
||||
*/
|
||||
void MD5Final(digest, ctx)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
the byteReverse function in md5.c must be invoked. However,
|
||||
byteReverse is coded in such a way that it is an identity
|
||||
function when run on a little-endian machine, so calling it
|
||||
on such a platform causes no harm apart from wasting time.
|
||||
on such a platform causes no harm apart from wasting time.
|
||||
If the platform is known to be little-endian, we speed
|
||||
things up by undefining HIGHFIRST, which defines
|
||||
byteReverse as a null macro. Doing things in this manner
|
||||
|
|
|
@ -5,4 +5,7 @@ Add these files:
|
|||
* Chair-Liv-Deco_large_front_z.png
|
||||
* tower_large_ne_a.png
|
||||
* tower_large_ne_p.png
|
||||
* tower_large_ne_z.png
|
||||
* tower_large_ne_z.png
|
||||
|
||||
Then open index.html in a web browser which supports the HTML5 canvas,
|
||||
and use the arrow keys.
|
Loading…
Add table
Add a link
Reference in a new issue