mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-03 07:11:49 +00:00
I have to make this tool available. Without it, the SKY.CPT file can't be included in debian.
Beware, it's full of shit and dirty hacks as I was never even dreaming about making either the source or binary public. But this has to be sufficient as I don't see the point in wasting my time rewriting a tool that noone needs in a clean way. svn-id: r19075
This commit is contained in:
parent
7f6402ef06
commit
0436bdeb0f
188
tools/skycpt/288diff.txt
Normal file
188
tools/skycpt/288diff.txt
Normal file
@ -0,0 +1,188 @@
|
||||
data_0[121][27] = 0x50;
|
||||
data_0[122][12] = 0x51;
|
||||
data_0[122][27] = 0x53;
|
||||
data_0[123][12] = 0x52;
|
||||
data_0[123][27] = 0x53;
|
||||
data_0[124][12] = 0x52;
|
||||
data_0[124][27] = 0x53;
|
||||
data_0[125][12] = 0x52;
|
||||
data_0[125][27] = 0x53;
|
||||
data_0[126][12] = 0x52;
|
||||
data_0[126][27] = 0x53;
|
||||
data_0[127][12] = 0x52;
|
||||
data_0[127][27] = 0x53;
|
||||
data_0[128][12] = 0x52;
|
||||
data_0[128][27] = 0x53;
|
||||
data_0[129][12] = 0x52;
|
||||
data_0[129][27] = 0x53;
|
||||
data_0[130][12] = 0x52;
|
||||
data_0[130][27] = 0x53;
|
||||
data_0[131][12] = 0x52;
|
||||
data_0[131][27] = 0x53;
|
||||
data_0[132][12] = 0x52;
|
||||
data_0[132][27] = 0x53;
|
||||
data_0[173][27] = 0x54;
|
||||
data_3[1][17] = 0x3032;
|
||||
data_3[1][27] = 0x3034;
|
||||
data_3[8][17] = 0x312B;
|
||||
data_3[8][27] = 0x3129;
|
||||
data_3[11][17] = 0x312D;
|
||||
data_3[14][11] = 0x312F;
|
||||
data_3[16][17] = 0x3131;
|
||||
data_3[25][17] = 0x3099;
|
||||
data_3[27][17] = 0x309B;
|
||||
data_3[36][17] = 0x30C0;
|
||||
data_3[39][17] = 0x309E;
|
||||
data_3[48][17] = 0x30AB;
|
||||
data_3[50][17] = 0x3134;
|
||||
data_3[59][17] = 0x3110;
|
||||
data_3[61][17] = 0x3112;
|
||||
data_3[70][17] = 0x302C;
|
||||
data_3[73][17] = 0x302E;
|
||||
data_3[82][17] = 0x30D5;
|
||||
data_3[84][17] = 0x3115;
|
||||
data_3[87][17] = 0x30D8;
|
||||
data_3[88][17] = 0x30D9;
|
||||
data_3[89][17] = 0x30DA;
|
||||
data_3[90][17] = 0x30DB;
|
||||
data_3[91][17] = 0x30DD;
|
||||
data_3[92][17] = 0x30EB;
|
||||
data_3[92][27] = 0x30EA;
|
||||
data_3[93][17] = 0x30E0;
|
||||
data_3[93][27] = 0x30E1;
|
||||
data_3[94][17] = 0x30A0;
|
||||
data_3[95][17] = 0x30A2;
|
||||
data_3[96][17] = 0x30A4;
|
||||
data_3[97][17] = 0x30A6;
|
||||
data_3[98][17] = 0x30AD;
|
||||
data_3[99][17] = 0x30AF;
|
||||
data_3[100][17] = 0x30B1;
|
||||
data_3[102][17] = 0x30E4;
|
||||
data_3[111][17] = 0x30EE;
|
||||
data_3[113][17] = 0x30F0;
|
||||
data_3[114][17] = 0x30F2;
|
||||
data_3[115][17] = 0x30F4;
|
||||
data_3[116][17] = 0x30F9;
|
||||
data_3[116][27] = 0x3103;
|
||||
data_3[117][17] = 0x30B3;
|
||||
data_3[119][27] = 0x30FD;
|
||||
data_3[129][17] = 0x30F6;
|
||||
data_3[132][17] = 0x310A;
|
||||
data_3[132][27] = 0x3104;
|
||||
data_3[137][17] = 0x30FF;
|
||||
data_3[137][27] = 0x310D;
|
||||
data_3[141][17] = 0x3106;
|
||||
data_3[141][27] = 0x3105;
|
||||
data_3[142][17] = 0x30C3;
|
||||
data_3[142][27] = 0x30C1;
|
||||
data_3[146][17] = 0x30CF;
|
||||
data_3[146][27] = 0x30C8;
|
||||
data_3[147][17] = 0x30CA;
|
||||
data_3[149][27] = 0x30CC;
|
||||
data_3[151][27] = 0x30CD;
|
||||
data_3[154][17] = 0x30B6;
|
||||
data_3[154][27] = 0x30B4;
|
||||
data_3[159][17] = 0x3118;
|
||||
data_3[168][17] = 0x3038;
|
||||
data_3[171][10] = 0x3039;
|
||||
data_3[171][17] = 0x303C;
|
||||
data_3[171][27] = 0x3040;
|
||||
data_3[174][17] = 0x303E;
|
||||
data_3[183][17] = 0x307C;
|
||||
data_3[186][10] = 0x3045;
|
||||
data_3[186][17] = 0x3048;
|
||||
data_3[186][27] = 0x3041;
|
||||
data_3[189][17] = 0x3044;
|
||||
data_3[198][17] = 0x305E;
|
||||
data_3[200][17] = 0x304B;
|
||||
data_3[201][17] = 0x304D;
|
||||
data_3[202][17] = 0x304F;
|
||||
data_3[204][17] = 0x307E;
|
||||
data_3[205][17] = 0x3080;
|
||||
data_3[206][17] = 0x3082;
|
||||
data_3[206][27] = 0x3089;
|
||||
data_3[207][17] = 0x3083;
|
||||
data_3[208][17] = 0x3086;
|
||||
data_3[208][27] = 0x3084;
|
||||
data_3[213][17] = 0x3088;
|
||||
data_3[217][17] = 0x308B;
|
||||
data_3[218][17] = 0x308D;
|
||||
data_3[219][17] = 0x308F;
|
||||
data_3[220][17] = 0x3091;
|
||||
data_3[221][17] = 0x3093;
|
||||
data_3[222][17] = 0x3060;
|
||||
data_3[223][17] = 0x3062;
|
||||
data_3[224][17] = 0x3064;
|
||||
data_3[226][17] = 0x3067;
|
||||
data_3[226][27] = 0x3065;
|
||||
data_3[228][17] = 0x306A;
|
||||
data_3[228][27] = 0x3068;
|
||||
data_3[229][17] = 0x306C;
|
||||
data_3[236][17] = 0x306E;
|
||||
data_3[237][17] = 0x3070;
|
||||
data_3[237][27] = 0x3071;
|
||||
data_3[238][17] = 0x3073;
|
||||
data_3[239][17] = 0x3075;
|
||||
data_3[246][17] = 0x3078;
|
||||
data_3[246][27] = 0x3076;
|
||||
data_3[253][17] = 0x30E8;
|
||||
data_3[253][27] = 0x30E6;
|
||||
data_3[257][17] = 0x30D1;
|
||||
data_3[258][17] = 0x3053;
|
||||
data_3[258][27] = 0x3051;
|
||||
data_3[267][17] = 0x3055;
|
||||
data_3[268][17] = 0x3057;
|
||||
data_3[270][27] = 0x3079;
|
||||
data_3[277][17] = 0x30B9;
|
||||
data_3[277][27] = 0x30B8;
|
||||
data_3[280][17] = 0x30BC;
|
||||
data_3[280][27] = 0x30BD;
|
||||
data_3[283][27] = 0x3094;
|
||||
data_3[286][27] = 0x310B;
|
||||
data_3[13][13] = 0x3138;
|
||||
data_3[300][17] = 0x3140;
|
||||
data_3[313][17] = 0x3018;
|
||||
data_3[313][27] = 0x3014;
|
||||
data_3[316][17] = 0x3018;
|
||||
data_3[316][27] = 0x3013;
|
||||
data_3[317][27] = 0x3015;
|
||||
data_3[319][27] = 0x3016;
|
||||
data_3[321][27] = 0x3016;
|
||||
data_3[324][27] = 0x3019;
|
||||
data_3[325][17] = 0x301C;
|
||||
data_3[325][27] = 0x301A;
|
||||
data_3[328][17] = 0x301E;
|
||||
data_3[332][17] = 0x3020;
|
||||
data_3[333][17] = 0x3020;
|
||||
data_3[334][17] = 0x3020;
|
||||
data_3[335][17] = 0x3020;
|
||||
data_3[336][17] = 0x3020;
|
||||
data_3[338][17] = 0x3025;
|
||||
data_3[339][17] = 0x3025;
|
||||
data_3[340][17] = 0x3025;
|
||||
data_3[341][17] = 0x3025;
|
||||
data_3[342][17] = 0x3025;
|
||||
data_3[343][17] = 0x3027;
|
||||
data_3[388][17] = 0x30A8;
|
||||
data_3[389][17] = 0x3142;
|
||||
data_3[390][17] = 0x3144;
|
||||
data_3[391][17] = 0x311F;
|
||||
data_3[392][17] = 0x3121;
|
||||
data_3[393][17] = 0x3030;
|
||||
data_3[406][17] = 0x3126;
|
||||
$s11_floor_table 33 3132 001C 3139 3017 3145 301B 3148 301D 314C 301F 314D 3021 314E 3022 314F 3023 3150 3024 3152 301F 3153 3021 3154 3022 3155 3023 3156 3024 3157 3026 0000 3028 FFFF
|
||||
$s19_floor_table 17 3042 001C 0002 002A 0000 302A 0001 3029 3046 302B 3049 302D 3189 302F 3001 3033 FFFF
|
||||
$s20_floor_table 37 30A4 001C 0002 002A 0000 3035 0001 303F 0003 3049 30A8 3037 30AB 303B 30BA 3047 30AE 303D 30BD 3043 30C8 304A 30C9 304C 30CA 304E 3102 3052 310B 3054 310C 3056 0017 3059 0018 305B FFFF
|
||||
$s21_floor_table 31 30C2 001C 0002 002A 0000 305C 30C6 305D 30DE 305F 30DF 3061 30E0 3063 30E2 3066 30E4 3069 30E5 306B 30EC 306D 30EE 3072 30EF 3074 30ED 306F 30F6 3077 FFFF
|
||||
$s22_floor_table 31 30B3 001C 0002 002A 0000 307A 30B7 307B 30CC 307D 30CD 307F 30CE 3081 30CF 3081 30D0 3085 30D5 3087 30D9 308A 30DA 308C 30DB 308E 30DC 3090 30DD 3092 FFFF
|
||||
$s23_floor_table 27 3015 001C 0002 002A 0000 3095 0001 3096 0003 3097 3019 3098 301B 309A 3027 309D 305E 309F 305F 30A1 3060 30A3 3061 30A5 3184 30A7 FFFF
|
||||
$s24_floor_table 23 302C 001C 0002 002A 0000 30A9 3030 30AA 3062 30AC 3063 30AE 3064 30B0 3075 30B2 309A 30B7 3115 30BA 3118 30BB FFFF
|
||||
$s25_floor_table 19 3020 001C 0002 002A 0000 30BE 3024 30BF 308E 30C4 0003 30C7 3093 30C9 3092 30CE 3101 30D0 FFFF
|
||||
$s26_floor_table 29 304E 001C 0002 002A 0000 30D3 0001 30D2 3052 30D4 3066 30E3 3057 30D7 3058 30D7 3059 30D7 305A 30D7 305B 30DC 305C 30E9 305D 30DF 30FD 30E7 FFFF
|
||||
$body_table 7 3081 30F5 3073 30F3 0018 30FC FFFF
|
||||
$chair_table 23 3081 001C 306B 30F7 306F 30F7 0017 30F7 3071 30F7 3072 30F7 3073 30F7 3074 30F7 3089 30F7 308D 30F7 3084 30F7 FFFF
|
||||
$s27_floor_table 29 306B 001C 306F 30ED 0002 002A 0017 30FA 0018 30FC 0000 30EC 3071 30EF 3072 30F1 3073 30F3 3074 30F8 3089 30FE 3081 30F5 3084 3109 308D 3108 FFFF
|
||||
$s28_floor_table 27 3037 001C 0002 002A 0000 310E 0001 3113 0003 3119 303B 310F 303D 3111 309F 3117 3054 3114 0017 311B 0018 311D 3196 3125 3199 3128 FFFF
|
||||
$s28_sml_table 13 318E 001C 0002 002A 3187 311E 3188 3120 0004 3122 0005 3123 FFFF
|
||||
$s29_floor_table 27 3004 001C 0002 002A 3008 312C 300B 312E 002A 3137 3010 3130 3032 3133 0001 3132 0003 3135 002A 3137 0017 313C 0018 313E 312C 313F FFFF
|
||||
$s29_sml_table 13 318A 001C 0002 002A 3185 3141 3186 3143 0004 3145 0005 3146 FFFF
|
40
tools/skycpt/AsciiCptCompile.cpp
Normal file
40
tools/skycpt/AsciiCptCompile.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
// AsciiCptCompile.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include "TextFile.h"
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned long uint32;
|
||||
typedef unsigned int uint;
|
||||
typedef signed char int8;
|
||||
typedef signed short int16;
|
||||
typedef signed long int32;
|
||||
|
||||
void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE *sve);
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
TextFile *cptDef = new TextFile("compact.txt");
|
||||
FILE *inf = fopen("compact.txt", "r");
|
||||
FILE *dbg = fopen("compact.dbg", "wb");
|
||||
FILE *out = fopen("compact.bin", "wb");
|
||||
FILE *sve = fopen("savedata.txt", "r");
|
||||
assert(inf && dbg && out && sve);
|
||||
doCompile(inf, dbg, out, cptDef, sve);
|
||||
fclose(inf);
|
||||
fclose(dbg);
|
||||
fclose(out);
|
||||
fclose(sve);
|
||||
printf("done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
21
tools/skycpt/AsciiCptCompile.sln
Normal file
21
tools/skycpt/AsciiCptCompile.sln
Normal file
@ -0,0 +1,21 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsciiCptCompile", "AsciiCptCompile.vcproj", "{BDAC73AF-42DE-45E7-95A8-C1D906AD19EF}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{BDAC73AF-42DE-45E7-95A8-C1D906AD19EF}.Debug.ActiveCfg = Debug|Win32
|
||||
{BDAC73AF-42DE-45E7-95A8-C1D906AD19EF}.Debug.Build.0 = Debug|Win32
|
||||
{BDAC73AF-42DE-45E7-95A8-C1D906AD19EF}.Release.ActiveCfg = Release|Win32
|
||||
{BDAC73AF-42DE-45E7-95A8-C1D906AD19EF}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
402
tools/skycpt/AsciiCptCompile.vcproj
Normal file
402
tools/skycpt/AsciiCptCompile.vcproj
Normal file
@ -0,0 +1,402 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="AsciiCptCompile"
|
||||
ProjectGUID="{BDAC73AF-42DE-45E7-95A8-C1D906AD19EF}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/AsciiCptCompile.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/AsciiCptCompile.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="4"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/AsciiCptCompile.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Quelldateien"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath=".\AsciiCptCompile.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\cptcompiler.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\cpthelp.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\idFinder.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\KmpSearch.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\TextFile.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Headerdateien"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath=".\cpthelp.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\KmpSearch.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\TextFile.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Ressourcendateien"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
<File
|
||||
RelativePath=".\asmSrc\0compact.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\101comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\102comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\10comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\11comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\12comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\13comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\14comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\15comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\16comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\17comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\18comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\19comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\1compact.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\20comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\21comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\22comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\23comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\24comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\25comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\26comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\27comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\288diff.txt">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\28comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\29comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\2compact.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\30comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\31comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\32comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\33comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\34comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\36comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\37comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\38comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\39comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\3compact.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\40comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\41comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\42comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\44comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\45comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\46comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\47comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\48comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\4compact.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\5compact.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\65comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\66comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\67comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\68comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\69comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\70comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\71comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\72comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\73comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\74comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\75comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\76comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\77comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\78comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\79comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\80comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\81comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\82comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\85comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\90comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\91comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\92comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\93comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\94comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\95comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\96comp.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\asmSrc\9compact.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Compact.txt">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\savedata.txt">
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
154465
tools/skycpt/COMPACT.TXT
Normal file
154465
tools/skycpt/COMPACT.TXT
Normal file
File diff suppressed because it is too large
Load Diff
129
tools/skycpt/KmpSearch.cpp
Normal file
129
tools/skycpt/KmpSearch.cpp
Normal file
@ -0,0 +1,129 @@
|
||||
#include "stdafx.h"
|
||||
#include "KmpSearch.h"
|
||||
|
||||
__declspec(naked) void __fastcall KmpSearch::init(const char *subStr) {
|
||||
__asm {
|
||||
// kmp initialization, make jump table for mismatches
|
||||
push esi
|
||||
push edi
|
||||
push ebp
|
||||
push ebx
|
||||
push ecx
|
||||
|
||||
mov esi, edx // edx: subStr argument
|
||||
lea edi, [ecx + KmpSearch::_subStr] // this + 0x100
|
||||
lea ebx, [ecx + KmpSearch::_retarget] // this
|
||||
lea ebp, [ecx + 1]
|
||||
|
||||
mov byte ptr [ebx], -1
|
||||
|
||||
xor eax, eax
|
||||
|
||||
loopStart:
|
||||
shr ecx, 8
|
||||
test al, 3
|
||||
jnz short dontLoad
|
||||
mov ecx, dword ptr [esi + eax] // load next 4 bytes of subStr
|
||||
mov dword ptr [edi], ecx // and copy them to this._subStr while we're at it
|
||||
lea edi, [edi + 4]
|
||||
dontLoad:
|
||||
|
||||
or cl, cl // end of subStr?
|
||||
jz short endOfString
|
||||
|
||||
mov edx, eax // save counter (i) in edx
|
||||
|
||||
xlat // al = retarget[i]
|
||||
inc al
|
||||
mov byte ptr [ebp + edx], al // retarget[i + 1] = retarget[i] + 1
|
||||
jz short decLoopEnd
|
||||
decrementLoop:
|
||||
dec al
|
||||
mov ah, byte ptr [esi + eax] // ah = sub[retarget[i + 1] - 1]
|
||||
cmp ah, cl // if (ah == sub[i])
|
||||
jz short decLoopEnd // goto decLoopEnd
|
||||
|
||||
xlat // al = retarget[retarget[i + 1] - 1]
|
||||
xor ah, ah
|
||||
inc al // al = retarget[retarget[i + 1] - 1] + 1
|
||||
mov byte ptr [ebp + edx], al // retarget[i + 1] = al
|
||||
jnz short decrementLoop
|
||||
decLoopEnd:
|
||||
lea eax, [edx + 1] // i = i + 1
|
||||
jmp short loopStart
|
||||
|
||||
endOfString:
|
||||
|
||||
pop ecx // this
|
||||
mov [ecx + KmpSearch::_strLen], eax // length of substring (without '\0')
|
||||
|
||||
pop ebx
|
||||
pop ebp
|
||||
pop edi
|
||||
pop esi
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked) char * __fastcall KmpSearch::search(const char *str) {
|
||||
__asm {
|
||||
push esi
|
||||
push edi
|
||||
push ebx
|
||||
|
||||
mov esi, edx // edx: str argument
|
||||
lea edi, [ecx + KmpSearch::_subStr]
|
||||
lea ebx, [ecx + KmpSearch::_retarget]
|
||||
mov ch, byte ptr [ecx + KmpSearch::_strLen]
|
||||
|
||||
or ch, ch // if (_strLen == 0)
|
||||
jz short endOfString // goto endOfString
|
||||
|
||||
xor edx, edx // index
|
||||
|
||||
mov cl, 3
|
||||
searchLoop:
|
||||
shr eax, 8
|
||||
inc cl
|
||||
test cl, 4
|
||||
jz short skipRead
|
||||
lodsd
|
||||
xor cl, cl
|
||||
skipRead:
|
||||
|
||||
test al, al
|
||||
jz short endOfString
|
||||
|
||||
newIndexLoop:
|
||||
cmp al, byte ptr [edi + edx] // while (c != sub[index]) {
|
||||
jz short gotNewIndex
|
||||
or edx, edx // if (index == 0)
|
||||
jz short searchLoop // goto searchLoop
|
||||
movzx edx, byte ptr [ebx + edx] // index = retarget[index]
|
||||
jmp short newIndexLoop // }
|
||||
|
||||
gotNewIndex:
|
||||
inc edx
|
||||
cmp dl, ch // if (index != _strLen)
|
||||
jne short searchLoop // goto searchLoop
|
||||
|
||||
movzx ebx, cl // bytes of eax used
|
||||
movzx ecx, ch // length of subStr
|
||||
|
||||
lea eax, [esi + ebx - 3]
|
||||
sub eax, ecx
|
||||
|
||||
pop ebx
|
||||
pop edi
|
||||
pop esi
|
||||
ret
|
||||
|
||||
endOfString:
|
||||
xor eax, eax // return NULL
|
||||
pop ebx
|
||||
pop edi
|
||||
pop esi
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
15
tools/skycpt/KmpSearch.h
Normal file
15
tools/skycpt/KmpSearch.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef __KmpSearch__
|
||||
#define __KmpSearch__
|
||||
|
||||
class KmpSearch {
|
||||
public:
|
||||
void __fastcall init(const char *subStr);
|
||||
char * __fastcall search(const char *str);
|
||||
//private:
|
||||
char _retarget[256], _subStr[256];
|
||||
unsigned long _strLen;
|
||||
};
|
||||
|
||||
#endif //__KmpSearch__
|
||||
|
||||
|
71
tools/skycpt/TextFile.cpp
Normal file
71
tools/skycpt/TextFile.cpp
Normal file
@ -0,0 +1,71 @@
|
||||
#include "stdafx.h"
|
||||
#include "TextFile.h"
|
||||
|
||||
TextFile::TextFile(char *name) {
|
||||
FILE *inf = fopen(name, "r");
|
||||
if (!inf) {
|
||||
printf("Unable to open file %s\n", name);
|
||||
getchar();
|
||||
}
|
||||
_lines = NULL;
|
||||
read(inf);
|
||||
fclose(inf);
|
||||
}
|
||||
|
||||
uint32 crop(char *line) {
|
||||
char *start = line;
|
||||
while (*line)
|
||||
if ((*line == 0xA) || (*line == 0xD))
|
||||
*line = '\0';
|
||||
else if ((line[0] == '/') && (line[1] == '/'))
|
||||
*line = '\0';
|
||||
else
|
||||
line++;
|
||||
|
||||
while (((*(line - 1) == ' ') || ((*(line - 1)) == '\t')) && (line > start)) {
|
||||
line--;
|
||||
*line = '\0';
|
||||
}
|
||||
return (uint32)(line - start);
|
||||
}
|
||||
|
||||
char *TextFile::giveLine(uint32 num) {
|
||||
if (num >= _numLines)
|
||||
return NULL;
|
||||
else
|
||||
return _lines[num];
|
||||
}
|
||||
|
||||
void TextFile::read(FILE *inf) {
|
||||
char *line = (char*)malloc(4096);
|
||||
_lines = (char**)malloc(4096 * sizeof(char *));
|
||||
_numLines = 0;
|
||||
uint32 linesMax = 4096;
|
||||
while (fgets(line, 4096, inf)) {
|
||||
if (_numLines >= linesMax) {
|
||||
_lines = (char**)realloc(_lines, linesMax * 2 * sizeof(char *));
|
||||
linesMax *= 2;
|
||||
}
|
||||
char *start = line;
|
||||
while ((*start == '\t') || (*start == ' '))
|
||||
start++;
|
||||
if (memcmp(start, "(int16)", 7) == 0) {
|
||||
start += 7;
|
||||
while ((*start == '\t') || (*start == ' '))
|
||||
start++;
|
||||
}
|
||||
uint32 length = crop(start);
|
||||
_lines[_numLines] = (char*)malloc(length + 1);
|
||||
memcpy(_lines[_numLines], start, length + 1);
|
||||
_numLines++;
|
||||
}
|
||||
free(line);
|
||||
}
|
||||
|
||||
int32 TextFile::findLine(KmpSearch *kmp, uint32 fromLine) {
|
||||
for (uint32 cnt = fromLine; cnt < _numLines; cnt++) {
|
||||
if (kmp->search(_lines[cnt]))
|
||||
return cnt;
|
||||
}
|
||||
return -1;
|
||||
}
|
21
tools/skycpt/TextFile.h
Normal file
21
tools/skycpt/TextFile.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef __TextFile__
|
||||
#define __TextFile__
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "KmpSearch.h"
|
||||
|
||||
class TextFile {
|
||||
public:
|
||||
TextFile(char *name);
|
||||
~TextFile(void);
|
||||
char *giveLine(uint32 num);
|
||||
int32 findLine(KmpSearch *kmp, uint32 fromLine = 0);
|
||||
private:
|
||||
void read(FILE *inf);
|
||||
char **_lines;
|
||||
uint32 _numLines;
|
||||
};
|
||||
|
||||
#endif
|
490
tools/skycpt/cptcompiler.cpp
Normal file
490
tools/skycpt/cptcompiler.cpp
Normal file
@ -0,0 +1,490 @@
|
||||
#include "stdafx.h"
|
||||
#include "cpthelp.h"
|
||||
#include "textfile.h"
|
||||
|
||||
uint32 crop(char *line);
|
||||
uint16 findCptId(char *name, TextFile *cptFile);
|
||||
|
||||
#define MAX_CPTS 0xA000
|
||||
#define MAX_OBJ_SIZE (0x2000 * 2)
|
||||
#define NUM_DATA_LISTS 9
|
||||
#define ASCII_SIZE (65536 * 2)
|
||||
|
||||
enum CptType {
|
||||
PTR_NULL = 0,
|
||||
COMPACT,
|
||||
TURNTAB,
|
||||
ANIMSEQ,
|
||||
MISCBIN,
|
||||
GETTOTAB,
|
||||
ROUTEBUF,
|
||||
MAINLIST
|
||||
};
|
||||
|
||||
void processMainLists(FILE *inf, CptObj *destArr, uint16 *idList) {
|
||||
char line[1024];
|
||||
dofgets(line, 1024, inf);
|
||||
assert(lineMatchSection(line, "MAINLISTS"));
|
||||
uint16 *resBuf = (uint16*)malloc(MAX_OBJ_SIZE);
|
||||
uint32 idNum = 0;
|
||||
do {
|
||||
dofgets(line, 1024, inf);
|
||||
if (!isEndOfSection(line)) {
|
||||
char cptName[50];
|
||||
uint16 id = getInfo(line, "MAINLST", cptName);
|
||||
CptObj *dest = destArr + id;
|
||||
assertEmpty(dest);
|
||||
dest->type = MAINLIST;
|
||||
dest->dbgName = (char*)malloc(strlen(cptName) + 1);
|
||||
strcpy(dest->dbgName, cptName);
|
||||
memset(resBuf, 0, MAX_OBJ_SIZE);
|
||||
uint32 resPos = 0;
|
||||
idList[idNum] = id;
|
||||
idNum++;
|
||||
|
||||
do {
|
||||
dofgets(line, 1024, inf);
|
||||
if (!isEndOfObject(line, "MAINLST", id)) {
|
||||
assert((line[0] == '\t') && (line[1] == '\t'));
|
||||
char *stopCh;
|
||||
uint16 destId = (uint16)strtoul(line + 2, &stopCh, 16);
|
||||
assert(stopCh == (line + 6));
|
||||
assert((stopCh[0] == ':') && (stopCh[1] == ':'));
|
||||
resBuf[resPos] = destId;
|
||||
resPos++;
|
||||
} else
|
||||
break;
|
||||
} while (1);
|
||||
assert(resPos < (MAX_OBJ_SIZE / 2));
|
||||
dest->len = resPos;
|
||||
dest->data = (uint16*)malloc(resPos * 2);
|
||||
memcpy(dest->data, resBuf, resPos * 2);
|
||||
} else
|
||||
break;
|
||||
} while(1);
|
||||
|
||||
free(resBuf);
|
||||
}
|
||||
|
||||
void processCpts(FILE *inf, CptObj *destArr) {
|
||||
char line[1024];
|
||||
dofgets(line, 1024, inf);
|
||||
assert(lineMatchSection(line, "COMPACTS"));
|
||||
uint16 *resBuf = (uint16*)malloc(MAX_OBJ_SIZE);
|
||||
do {
|
||||
dofgets(line, 1024, inf);
|
||||
if (!isEndOfSection(line)) {
|
||||
char cptName[50];
|
||||
uint16 id = getInfo(line, "COMPACT", cptName);
|
||||
CptObj *dest = destArr + id;
|
||||
assertEmpty(dest);
|
||||
dest->dbgName = (char*)malloc(strlen(cptName) + 1);
|
||||
dest->type = COMPACT;
|
||||
strcpy(dest->dbgName, cptName);
|
||||
memset(resBuf, 0, MAX_OBJ_SIZE);
|
||||
uint32 resPos = 0;
|
||||
|
||||
do {
|
||||
dofgets(line, 1024, inf);
|
||||
if (!isEndOfObject(line, "COMPACT", id)) {
|
||||
assert((line[0] == '\t') && (line[1] == '\t'));
|
||||
char *stopCh;
|
||||
uint16 destId = (uint16)strtoul(line + 2, &stopCh, 16);
|
||||
assert(stopCh != (line + 2));
|
||||
assert((stopCh[0] == '-') && (stopCh[1] == '>'));
|
||||
if (resPos == 23) { // grafixProg
|
||||
assert(destId == 0);
|
||||
resBuf[resPos] = resBuf[resPos + 1] = 0;
|
||||
resPos += 2;
|
||||
} else if (resPos == 48) { // turnProg. shouldn't it be 49?
|
||||
assert(destId == 0);
|
||||
resBuf[resPos] = resBuf[resPos + 1] = 0;
|
||||
resPos += 2;
|
||||
} else {
|
||||
resBuf[resPos] = destId;
|
||||
resPos++;
|
||||
}
|
||||
} else
|
||||
break;
|
||||
} while (1);
|
||||
assert(resPos < (MAX_OBJ_SIZE / 2));
|
||||
dest->len = resPos;
|
||||
dest->data = (uint16*)malloc(resPos * 2);
|
||||
memcpy(dest->data, resBuf, resPos * 2);
|
||||
} else
|
||||
break;
|
||||
} while(1);
|
||||
|
||||
free(resBuf);
|
||||
}
|
||||
|
||||
void processTurntabs(FILE *inf, CptObj *destArr) {
|
||||
char line[1024];
|
||||
dofgets(line, 1024, inf);
|
||||
assert(lineMatchSection(line, "TURNTABS"));
|
||||
uint16 *resBuf = (uint16*)malloc(MAX_OBJ_SIZE);
|
||||
do {
|
||||
dofgets(line, 1024, inf);
|
||||
if (!isEndOfSection(line)) {
|
||||
char cptName[50];
|
||||
uint16 id = getInfo(line, "TURNTAB", cptName);
|
||||
CptObj *dest = destArr + id;
|
||||
assertEmpty(dest);
|
||||
dest->dbgName = (char*)malloc(strlen(cptName) + 1);
|
||||
dest->type = TURNTAB;
|
||||
strcpy(dest->dbgName, cptName);
|
||||
memset(resBuf, 0, MAX_OBJ_SIZE);
|
||||
uint32 resPos = 0;
|
||||
|
||||
do {
|
||||
dofgets(line, 1024, inf);
|
||||
if (!isEndOfObject(line, "TURNTAB", id)) {
|
||||
assert((line[0] == '\t') && (line[1] == '\t'));
|
||||
char *stopCh;
|
||||
uint16 destId = (uint16)strtoul(line + 2, &stopCh, 16);
|
||||
assert(stopCh == (line + 6));
|
||||
assert((stopCh[0] == '-') && (stopCh[1] == '>'));
|
||||
resBuf[resPos] = destId;
|
||||
resPos++;
|
||||
} else
|
||||
break;
|
||||
} while (1);
|
||||
assert(resPos < (MAX_OBJ_SIZE / 2));
|
||||
dest->len = resPos;
|
||||
dest->data = (uint16*)malloc(resPos * 2);
|
||||
memcpy(dest->data, resBuf, resPos * 2);
|
||||
} else
|
||||
break;
|
||||
} while(1);
|
||||
|
||||
free(resBuf);
|
||||
}
|
||||
|
||||
void processBins(FILE *inf, CptObj *destArr, char *typeName, char *objName, uint8 cTypeId) {
|
||||
char line[1024];
|
||||
dofgets(line, 1024, inf);
|
||||
assert(lineMatchSection(line, typeName));
|
||||
uint16 *resBuf = (uint16*)malloc(MAX_OBJ_SIZE);
|
||||
do {
|
||||
dofgets(line, 1024, inf);
|
||||
if (!isEndOfSection(line)) {
|
||||
char cptName[50];
|
||||
uint16 id = getInfo(line, objName, cptName);
|
||||
CptObj *dest = destArr + id;
|
||||
assertEmpty(dest);
|
||||
dest->dbgName = (char*)malloc(strlen(cptName) + 1);
|
||||
dest->type = cTypeId;
|
||||
strcpy(dest->dbgName, cptName);
|
||||
memset(resBuf, 0, MAX_OBJ_SIZE);
|
||||
uint32 resPos = 0;
|
||||
|
||||
do {
|
||||
dofgets(line, 1024, inf);
|
||||
if (!isEndOfObject(line, objName, id)) {
|
||||
assert((line[0] == '\t') && (line[1] == '\t'));
|
||||
char *stopCh;
|
||||
uint16 destId = (uint16)strtoul(line + 2, &stopCh, 16);
|
||||
assert(stopCh == (line + 6));
|
||||
assert(*stopCh == '\0');
|
||||
resBuf[resPos] = destId;
|
||||
resPos++;
|
||||
} else
|
||||
break;
|
||||
} while (1);
|
||||
assert(resPos < (MAX_OBJ_SIZE / 2));
|
||||
dest->len = resPos;
|
||||
dest->data = (uint16*)malloc(resPos * 2);
|
||||
memcpy(dest->data, resBuf, resPos * 2);
|
||||
} else
|
||||
break;
|
||||
} while(1);
|
||||
|
||||
free(resBuf);
|
||||
}
|
||||
|
||||
uint16 dlinkCount = 0;
|
||||
static uint16 dlinks[1024];
|
||||
static char* dlinkNames[512];
|
||||
|
||||
void processSymlinks(FILE *inf, CptObj *destArr, uint16 *baseLists) {
|
||||
char line[1024];
|
||||
dofgets(line, 1024, inf);
|
||||
assert(lineMatchSection(line, "SYMLINKS"));
|
||||
do {
|
||||
dofgets(line, 1024, inf);
|
||||
if (!isEndOfSection(line)) {
|
||||
char cptName[50];
|
||||
uint16 fromId = getInfo(line, "SYMLINK", cptName);
|
||||
CptObj *from = destArr + fromId;
|
||||
assertEmpty(from);
|
||||
dlinkNames[dlinkCount] = (char*)malloc(strlen(cptName) + 1);
|
||||
strcpy(dlinkNames[dlinkCount], cptName);
|
||||
|
||||
dofgets(line, 1024, inf);
|
||||
assert((line[0] == '\t') && (line[1] == '\t') && (line[2] == '-') && (line[3] == '>'));
|
||||
char *stopCh;
|
||||
uint16 destId = (uint16)strtoul(line + 4, &stopCh, 16);
|
||||
assert(stopCh == (line + 8));
|
||||
assert((stopCh[0] == ':') && (stopCh[1] == ':'));
|
||||
|
||||
dlinks[dlinkCount * 2 + 0] = fromId;
|
||||
dlinks[dlinkCount * 2 + 1] = destId;
|
||||
|
||||
dlinkCount++;
|
||||
|
||||
dofgets(line, 1024, inf);
|
||||
assert(isEndOfObject(line, "SYMLINK", fromId));
|
||||
} else
|
||||
break;
|
||||
} while(1);
|
||||
}
|
||||
|
||||
void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE *sve) {
|
||||
uint16 maxStrl = 0;
|
||||
uint16 maxCptl = 0;
|
||||
|
||||
CptObj *resCpts;
|
||||
uint16 baseLists[NUM_DATA_LISTS];
|
||||
memset(baseLists, 0, NUM_DATA_LISTS * 2);
|
||||
resCpts = (CptObj*)malloc(MAX_CPTS * sizeof(CptObj));
|
||||
memset(resCpts, 0, MAX_CPTS * sizeof(CptObj));
|
||||
processMainLists(inf, resCpts, baseLists);
|
||||
processCpts(inf, resCpts);
|
||||
processTurntabs(inf, resCpts);
|
||||
processBins(inf, resCpts, "ANIMSEQS", "ANIMSEQ", ANIMSEQ);
|
||||
processBins(inf, resCpts, "MISCBINS", "MISCBIN", MISCBIN);
|
||||
processBins(inf, resCpts, "GETTOTAB", "GET_TOS", GETTOTAB);
|
||||
processBins(inf, resCpts, "SCRATCHR", "SCRATCH", ROUTEBUF);
|
||||
processSymlinks(inf, resCpts, baseLists);
|
||||
uint32 numCpts = 1;
|
||||
for (uint32 cnt = 1; cnt < MAX_CPTS; cnt++)
|
||||
if (resCpts[cnt].data || resCpts[cnt].dbgName || resCpts[cnt].len)
|
||||
numCpts++;
|
||||
|
||||
uint16 dataListLen[NUM_DATA_LISTS];
|
||||
for (uint32 cnt = 0; cnt < NUM_DATA_LISTS; cnt++)
|
||||
for (uint16 elemCnt = 0; elemCnt < 0x1000; elemCnt++) {
|
||||
uint32 id = (cnt << 12) | elemCnt;
|
||||
if (resCpts[id].data || resCpts[id].dbgName || resCpts[id].len)
|
||||
dataListLen[cnt] = elemCnt + 1;
|
||||
}
|
||||
|
||||
// write the header
|
||||
uint32 rev = 0;
|
||||
fwrite(&rev, 2, 1, debOutf);
|
||||
fwrite(&rev, 2, 1, resOutf);
|
||||
rev = NUM_DATA_LISTS;
|
||||
fwrite(&rev, 2, 1, debOutf);
|
||||
fwrite(&rev, 2, 1, resOutf);
|
||||
for (uint32 cnt = 0; cnt < NUM_DATA_LISTS; cnt++) {
|
||||
fwrite(dataListLen + cnt, 2, 1, debOutf);
|
||||
fwrite(dataListLen + cnt, 2, 1, resOutf);
|
||||
}
|
||||
|
||||
uint32 binSize = 0;
|
||||
uint32 binDest = ftell(debOutf);
|
||||
fwrite(&binSize, 1, 4, debOutf);
|
||||
fwrite(&binSize, 1, 4, resOutf);
|
||||
fwrite(&binSize, 1, 4, debOutf);
|
||||
fwrite(&binSize, 1, 4, resOutf);
|
||||
|
||||
char *asciiBuf = (char*)malloc(ASCII_SIZE);
|
||||
char *asciiPos = asciiBuf;
|
||||
|
||||
// now process all the compacts
|
||||
uint32 cptSize[2];
|
||||
cptSize[0] = ftell(debOutf);
|
||||
cptSize[1] = ftell(resOutf);
|
||||
for (uint32 lcnt = 0; lcnt < NUM_DATA_LISTS; lcnt++) {
|
||||
for (uint32 eCnt = 0; eCnt < dataListLen[lcnt]; eCnt++) {
|
||||
uint32 cId = (lcnt << 12) | eCnt;
|
||||
CptObj *cpt = resCpts + cId;
|
||||
if (resCpts[cId].data || resCpts[cId].dbgName || resCpts[cId].len || resCpts[cId].type) {
|
||||
strcpy(asciiPos, cpt->dbgName);
|
||||
asciiPos += strlen(cpt->dbgName) + 1;
|
||||
|
||||
assert(cpt->len < 0xFFFF);
|
||||
uint16 dlen = (uint16)cpt->len;
|
||||
if (dlen > maxCptl)
|
||||
maxCptl = dlen;
|
||||
binSize += dlen;
|
||||
assert(dlen != 0);
|
||||
|
||||
fwrite(&dlen, 2, 1, debOutf);
|
||||
fwrite(&dlen, 2, 1, resOutf);
|
||||
|
||||
uint16 field = resCpts[cId].type;
|
||||
fwrite(&field, 2, 1, debOutf);
|
||||
|
||||
fwrite(cpt->data, 2, dlen, debOutf);
|
||||
fwrite(cpt->data, 2, dlen, resOutf);
|
||||
} else {
|
||||
uint16 tmp = 0;
|
||||
fwrite(&tmp, 2, 1, debOutf);
|
||||
fwrite(&tmp, 2, 1, resOutf);
|
||||
}
|
||||
}
|
||||
}
|
||||
cptSize[0] = ftell(debOutf) - cptSize[0];
|
||||
cptSize[1] = ftell(resOutf) - cptSize[1];
|
||||
assert(!(cptSize[0] & 1));
|
||||
assert(!(cptSize[1] & 1));
|
||||
cptSize[0] /= 2;
|
||||
cptSize[1] /= 2;
|
||||
|
||||
for (uint32 cnt = 0; cnt < dlinkCount; cnt++) {
|
||||
strcpy(asciiPos, dlinkNames[cnt]);
|
||||
asciiPos += strlen(dlinkNames[cnt]) + 1;
|
||||
}
|
||||
|
||||
uint32 asciiSize = (uint32)(asciiPos - asciiBuf);
|
||||
fwrite(&asciiSize, 1, 4, debOutf);
|
||||
fwrite(asciiBuf, 1, asciiSize, debOutf);
|
||||
|
||||
// the direct links...
|
||||
fwrite(&dlinkCount, 2, 1, debOutf);
|
||||
fwrite(&dlinkCount, 2, 1, resOutf);
|
||||
for (uint32 cnt = 0; cnt < dlinkCount; cnt++) {
|
||||
fwrite(dlinks + cnt * 2 + 0, 2, 1, debOutf);
|
||||
fwrite(dlinks + cnt * 2 + 0, 2, 1, resOutf);
|
||||
|
||||
fwrite(dlinks + cnt * 2 + 1, 2, 1, debOutf);
|
||||
fwrite(dlinks + cnt * 2 + 1, 2, 1, resOutf);
|
||||
}
|
||||
// 288 diffdata
|
||||
FILE *dif = fopen("288diff.txt", "r");
|
||||
assert(dif);
|
||||
char line[1024];
|
||||
uint16 diff[8192];
|
||||
uint16 diffDest = 0;
|
||||
uint16 diffNo = 0;
|
||||
while (fgets(line, 1024, dif)) {
|
||||
crop(line);
|
||||
if (line[0] != '$') {
|
||||
assert(memcmp(line, "data_", 5) == 0);
|
||||
char *pos = line + 5;
|
||||
char *stopCh;
|
||||
uint16 lId = (uint16)strtoul(pos, &stopCh, 10);
|
||||
assert(*stopCh == '[');
|
||||
uint16 eId = (uint16)strtoul(stopCh + 1, &stopCh, 10);
|
||||
assert((stopCh[0] == ']') && (stopCh[1] == '[') && (eId <= 0xFFF) && (lId <= 7));
|
||||
uint16 id = (lId << 12) | eId;
|
||||
uint16 elemNo = (uint16)strtoul(stopCh + 2, &stopCh, 10);
|
||||
assert(*stopCh == ']');
|
||||
stopCh = strstr(stopCh, "0x") + 2;
|
||||
uint16 val = (uint16)strtoul(stopCh, &stopCh, 16);
|
||||
assert(*stopCh == ';');
|
||||
diff[diffDest++] = id;
|
||||
diff[diffDest++] = elemNo;
|
||||
diff[diffDest++] = 1;
|
||||
diff[diffDest++] = val;
|
||||
diffNo++;
|
||||
} else {
|
||||
char *pos = strchr(line, ' ');
|
||||
*pos = '\0';
|
||||
uint16 id = findCptId(line + 1, cptDef);
|
||||
assert(id);
|
||||
diff[diffDest++] = id;
|
||||
diff[diffDest++] = 0;
|
||||
pos++;
|
||||
uint16 len = (uint16)strtoul(pos, &pos, 10);
|
||||
diff[diffDest++] = len;
|
||||
assert(len);
|
||||
assert(resCpts[id].len == len);
|
||||
for (uint16 cnt = 0; cnt < len; cnt++) {
|
||||
assert(*pos == ' ');
|
||||
pos++;
|
||||
diff[diffDest++] = (uint16)strtoul(pos, &pos, 16);
|
||||
}
|
||||
assert(diff[diffDest - 1] == 0xFFFF);
|
||||
diffNo++;
|
||||
}
|
||||
}
|
||||
assert(diffDest <= 8192);
|
||||
fwrite(&diffNo, 1, 2, debOutf);
|
||||
fwrite(&diffDest, 1, 2, debOutf);
|
||||
fwrite(diff, 2, diffDest, debOutf);
|
||||
fwrite(&diffNo, 1, 2, resOutf);
|
||||
fwrite(&diffDest, 1, 2, resOutf);
|
||||
fwrite(diff, 2, diffDest, resOutf);
|
||||
|
||||
// the IDs of the compacts to be saved
|
||||
char cptName[1024];
|
||||
uint16 saveIds[2048];
|
||||
uint16 numIds = 0;
|
||||
while (fgets(cptName, 1024, sve)) {
|
||||
crop(cptName);
|
||||
uint16 resId = findCptId(cptName, cptDef);
|
||||
if (!resId)
|
||||
printf("ERROR: Can't find definition of %s\n", cptName);
|
||||
else {
|
||||
saveIds[numIds] = resId;
|
||||
numIds++;
|
||||
}
|
||||
}
|
||||
printf("%d saveIds\n", numIds);
|
||||
fwrite(&numIds, 2, 1, debOutf);
|
||||
fwrite(saveIds, 2, numIds, debOutf);
|
||||
fwrite(&numIds, 2, 1, resOutf);
|
||||
fwrite(saveIds, 2, numIds, resOutf);
|
||||
|
||||
// now append the reset data
|
||||
uint16 gameVers[6] = { 303, 331, 348, 365, 368, 372 };
|
||||
FILE *res288 = fopen("RESET.288", "rb");
|
||||
fseek(res288, 0, SEEK_END);
|
||||
assert((ftell(res288) / 2) < 65536);
|
||||
uint16 resSize = (uint16)(ftell(res288) / 2);
|
||||
fseek(res288, 0, SEEK_SET);
|
||||
uint16 *buf288 = (uint16*)malloc(resSize * 2);
|
||||
fread(buf288, 2, resSize, res288);
|
||||
fclose(res288);
|
||||
fwrite(&resSize, 1, 2, debOutf);
|
||||
fwrite(buf288, 2, resSize, debOutf);
|
||||
|
||||
uint16 tmp = 7;
|
||||
fwrite(&tmp, 2, 1, debOutf);
|
||||
tmp = 288;
|
||||
fwrite(&tmp, 2, 1, debOutf);
|
||||
tmp = 0;
|
||||
fwrite(&tmp, 2, 1, debOutf);
|
||||
printf("reset destination: %d\n", ftell(debOutf));
|
||||
for (int cnt = 0; cnt < 6; cnt++) {
|
||||
char inName[32];
|
||||
uint16 diff[8192];
|
||||
uint16 diffPos = 0;
|
||||
sprintf(inName, "reset.%03d", gameVers[cnt]);
|
||||
FILE *resDiff = fopen(inName, "rb");
|
||||
fseek(resDiff, 0, SEEK_END);
|
||||
assert(ftell(resDiff) == (resSize * 2));
|
||||
fseek(resDiff, 0, SEEK_SET);
|
||||
uint16 *bufDif = (uint16*)malloc(resSize *2);
|
||||
fread(bufDif, 2, resSize, resDiff);
|
||||
fclose(resDiff);
|
||||
for (uint16 eCnt = 0; eCnt < resSize; eCnt++)
|
||||
if (buf288[eCnt] != bufDif[eCnt]) {
|
||||
diff[diffPos++] = eCnt;
|
||||
diff[diffPos++] = bufDif[eCnt];
|
||||
}
|
||||
free(bufDif);
|
||||
fwrite(gameVers + cnt, 1, 2, debOutf);
|
||||
assert(!(diffPos & 1));
|
||||
diffPos /= 2;
|
||||
fwrite(&diffPos, 1, 2, debOutf);
|
||||
fwrite(diff, 2, 2 * diffPos, debOutf);
|
||||
printf("diff v0.0%03d: 2 * 2 * %d\n", gameVers[cnt], diffPos);
|
||||
}
|
||||
|
||||
// now fill the raw-compact-data-size header field
|
||||
fseek(resOutf, binDest, SEEK_SET);
|
||||
fseek(debOutf, binDest, SEEK_SET);
|
||||
fwrite(&binSize, 1, 4, debOutf);
|
||||
fwrite(&binSize, 1, 4, resOutf);
|
||||
fwrite(cptSize + 0, 1, 4, debOutf);
|
||||
fwrite(cptSize + 1, 1, 4, resOutf);
|
||||
|
||||
printf("%d diffs\n", diffNo);
|
||||
printf("%d Compacts in total\n", numCpts);
|
||||
printf("max strlen = %d\n", maxStrl);
|
||||
printf("raw size = 2 * %d\n", binSize);
|
||||
printf("max cptlen = %d\n", maxCptl);
|
||||
}
|
66
tools/skycpt/cpthelp.cpp
Normal file
66
tools/skycpt/cpthelp.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
#include "stdafx.h"
|
||||
#include "cpthelp.h"
|
||||
|
||||
void assertEmpty(CptObj *cpt) {
|
||||
assert((cpt->len == 0) && (cpt->data == NULL) && (cpt->dbgName == NULL) && (cpt->type == 0));
|
||||
}
|
||||
|
||||
uint16 getInfo(char *line, char *type, char *nameDest) {
|
||||
assert(*line == '\t');
|
||||
line++;
|
||||
assert(!memcmp(line, type, strlen(type)));
|
||||
line += strlen(type);
|
||||
assert((line[0] == ':') && (line[1] == ':'));
|
||||
line += 2;
|
||||
char *stopCh;
|
||||
uint16 res = (uint16)strtoul(line, &stopCh, 16);
|
||||
assert(line != stopCh);
|
||||
assert((stopCh[0] == ':') && (stopCh[1] == ':'));
|
||||
stopCh += 2;
|
||||
strcpy(nameDest, stopCh);
|
||||
assert(strlen(nameDest) < 32);
|
||||
assert(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
void dofgets(char *dest, int len, FILE *inf) {
|
||||
fgets(dest, len, inf);
|
||||
while (*dest)
|
||||
if ((*dest == 0xA) || (*dest == 0xD))
|
||||
*dest = '\0';
|
||||
else
|
||||
dest++;
|
||||
}
|
||||
|
||||
bool lineMatchSection(char *line, char *sec) {
|
||||
if (memcmp(line, "SECTION::", 9))
|
||||
return false;
|
||||
if (memcmp(line + 9, sec, strlen(sec)))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isEndOfSection(char *line) {
|
||||
if (strcmp(line, "SECTION::ENDS"))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isEndOfObject(char *line, char *type, uint16 id) {
|
||||
if (*line != '\t')
|
||||
return false;
|
||||
line++;
|
||||
if (memcmp(line, type, strlen(type)))
|
||||
return false;
|
||||
line += strlen(type);
|
||||
if ((line[0] != ':') || (line[1] != ':'))
|
||||
return false;
|
||||
line += 2;
|
||||
char *stopCh;
|
||||
uint16 idVal = (uint16)strtoul(line, &stopCh, 16);
|
||||
assert(stopCh != line);
|
||||
if (strcmp(stopCh, "::ENDS"))
|
||||
return false;
|
||||
assert(id == idVal);
|
||||
return true;
|
||||
}
|
8
tools/skycpt/cpthelp.h
Normal file
8
tools/skycpt/cpthelp.h
Normal file
@ -0,0 +1,8 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
void assertEmpty(CptObj *cpt);
|
||||
uint16 getInfo(char *line, char *type, char *nameDest);
|
||||
void dofgets(char *dest, int len, FILE *inf);
|
||||
bool lineMatchSection(char *line, char *sec);
|
||||
bool isEndOfSection(char *line);
|
||||
bool isEndOfObject(char *line, char *type, uint16 id);
|
28
tools/skycpt/idFinder.cpp
Normal file
28
tools/skycpt/idFinder.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include "stdafx.h"
|
||||
#include "TextFile.h"
|
||||
#include "KmpSearch.h"
|
||||
|
||||
uint16 findCptId(char *name, TextFile *cptFile) {
|
||||
KmpSearch *kmp = new KmpSearch();
|
||||
kmp->init(name);
|
||||
int cLine = 0;
|
||||
do {
|
||||
cLine = cptFile->findLine(kmp, cLine);
|
||||
if (cLine >= 0) {
|
||||
char *line = cptFile->giveLine(cLine);
|
||||
if ((strncmp(line, "COMPACT::", 9) == 0) ||
|
||||
(strncmp(line, "SCRATCH::", 9) == 0) ||
|
||||
(strncmp(line, "GET_TOS::", 9) == 0)) {
|
||||
char *stopCh;
|
||||
uint16 resId = (uint16)strtoul(line + 9, &stopCh, 16);
|
||||
if ((stopCh[0] == ':') && (stopCh[1] == ':') && (strcmp(stopCh + 2, name) == 0)) {
|
||||
delete kmp;
|
||||
return resId;
|
||||
}
|
||||
}
|
||||
cLine++;
|
||||
}
|
||||
} while (cLine != -1);
|
||||
delete kmp;
|
||||
return 0;
|
||||
}
|
854
tools/skycpt/savedata.txt
Normal file
854
tools/skycpt/savedata.txt
Normal file
@ -0,0 +1,854 @@
|
||||
forklift_cpt
|
||||
coordinate_test
|
||||
text_1
|
||||
text_2
|
||||
text_3
|
||||
text_4
|
||||
text_5
|
||||
text_6
|
||||
text_7
|
||||
text_8
|
||||
text_9
|
||||
text_10
|
||||
text_11
|
||||
joey
|
||||
joey_park
|
||||
foster
|
||||
floor
|
||||
r_talk_s2
|
||||
talk2
|
||||
low_floor
|
||||
stairs
|
||||
upstairs
|
||||
bar
|
||||
door
|
||||
small_door
|
||||
right_exit0
|
||||
outside_ledge
|
||||
r1_door
|
||||
s2_floor
|
||||
lamb
|
||||
monitor
|
||||
anita
|
||||
whole_screen
|
||||
menu_bar
|
||||
left_arrow
|
||||
right_arrow
|
||||
blank1
|
||||
blank2
|
||||
blank3
|
||||
blank4
|
||||
blank5
|
||||
blank6
|
||||
blank7
|
||||
blank8
|
||||
blank9
|
||||
blank10
|
||||
blank11
|
||||
crow_bar_menu
|
||||
sarnie_menu
|
||||
spanner_menu
|
||||
joeyb_menu
|
||||
citycard_menu
|
||||
shades_menu
|
||||
putty_menu
|
||||
lightbulb_menu
|
||||
wd40_menu
|
||||
skey_menu
|
||||
anita_card_menu
|
||||
anchor_menu
|
||||
magazine_menu
|
||||
tape_menu
|
||||
glass_menu
|
||||
rope_menu
|
||||
ticket_menu
|
||||
new_cable_menu
|
||||
secateurs_menu
|
||||
plaster_menu
|
||||
brick_menu
|
||||
tongs_menu
|
||||
dog_food_menu
|
||||
gallcard_menu
|
||||
full_screen
|
||||
cancel_button
|
||||
button_7
|
||||
button_8
|
||||
button_9
|
||||
button_4
|
||||
button_5
|
||||
button_6
|
||||
button_1
|
||||
button_2
|
||||
button_3
|
||||
button_0
|
||||
retina_scan
|
||||
restart_butt
|
||||
restore_butt
|
||||
exit_butt
|
||||
mini_so
|
||||
full_so
|
||||
load_point
|
||||
fire_notice
|
||||
fire_notice2
|
||||
ss_sign
|
||||
lfan1
|
||||
lfan2
|
||||
smoke1
|
||||
smoke2
|
||||
fire1
|
||||
fire2
|
||||
car_up
|
||||
car_down
|
||||
top_lift
|
||||
top_lift_2
|
||||
top_barrel
|
||||
light_one
|
||||
panel
|
||||
alarm_flash
|
||||
robot_shell
|
||||
dead_loader
|
||||
junk1
|
||||
junk2
|
||||
loader
|
||||
steve_watch
|
||||
low_barrel
|
||||
convey
|
||||
joey_fly
|
||||
furnace
|
||||
lights1
|
||||
eye_ball
|
||||
furnace_door
|
||||
slot
|
||||
shades
|
||||
eye_bolt
|
||||
smoulder
|
||||
low_lift
|
||||
low_lift_2
|
||||
low_lift_3
|
||||
sc4_floor
|
||||
sc4_left_exit
|
||||
r_talk_s4
|
||||
tv_screens_s4
|
||||
knob_s4
|
||||
chuck_s4
|
||||
lazer_s4
|
||||
cupboard_s4
|
||||
sarnie_s4
|
||||
spanner_s4
|
||||
monitors_s4
|
||||
buttons_s4
|
||||
postcard
|
||||
notice4
|
||||
jobsworth
|
||||
s6_floor
|
||||
stairs6
|
||||
joey_fly_6
|
||||
left_exit_s6
|
||||
s5_floor
|
||||
right_exit_s5
|
||||
right_exit_s6
|
||||
security_exit_s6
|
||||
s7_floor
|
||||
left_exit_s7
|
||||
left_exit_s5
|
||||
skorl_guard
|
||||
security_exit
|
||||
s8_floor
|
||||
right_exit_s7
|
||||
down_exit_s8
|
||||
wreck_guard
|
||||
factory_entry
|
||||
s7_card_slot
|
||||
lift_notice
|
||||
lift_s7
|
||||
linc_s7
|
||||
lift7_light
|
||||
cable_7
|
||||
copter
|
||||
s9_floor
|
||||
left_exit_s9
|
||||
fans
|
||||
lobby_door
|
||||
scanner
|
||||
lobby_slot
|
||||
dad
|
||||
son
|
||||
fake_floor_9
|
||||
linc_s9
|
||||
s12_floor
|
||||
factory_exit
|
||||
fact1_right_exit
|
||||
topbelt
|
||||
botbelt
|
||||
pipes
|
||||
anita_spy
|
||||
welder
|
||||
stump
|
||||
console_12
|
||||
s13_floor
|
||||
fact2_exit_left
|
||||
fact2_exit_right
|
||||
fact2_store_exit
|
||||
cogs
|
||||
gears
|
||||
belts1
|
||||
belts2
|
||||
pipe1
|
||||
pipe2
|
||||
pipe3
|
||||
pipe4
|
||||
sensor
|
||||
lite1
|
||||
lite2
|
||||
fact2_spy_and_window
|
||||
fact_console
|
||||
sensors
|
||||
foreman
|
||||
s14_floor
|
||||
fact3_exit_left
|
||||
fact3_exit_right
|
||||
locker3
|
||||
locker2
|
||||
locker1
|
||||
machine
|
||||
rad_screen
|
||||
console_14
|
||||
coat
|
||||
radman
|
||||
nu_floor
|
||||
s15_flooor
|
||||
store_exit
|
||||
junction_box
|
||||
whole_floor
|
||||
flap
|
||||
skey
|
||||
wd40
|
||||
floor_putty
|
||||
s16_floor
|
||||
entrance_exit
|
||||
reactor_console
|
||||
reactor_door
|
||||
reactor_lower
|
||||
s17_floor
|
||||
core_exit
|
||||
pulse
|
||||
pulseb
|
||||
anita_card
|
||||
s18_floor
|
||||
steam
|
||||
power_door
|
||||
power_motor
|
||||
socket
|
||||
power_switch
|
||||
power_chair
|
||||
left_skull
|
||||
right_skull
|
||||
power_bang
|
||||
left_lever
|
||||
right_lever
|
||||
s10_floor
|
||||
left_exit_10
|
||||
lift_10
|
||||
lift_slot_10
|
||||
scanner_10
|
||||
pod
|
||||
linc_10
|
||||
pod_light
|
||||
monitor_10
|
||||
liyt_1
|
||||
liyt_2
|
||||
liyt_3
|
||||
liyt_4
|
||||
litebank
|
||||
terminal_10
|
||||
fake_floor_10
|
||||
s11_floor
|
||||
cable_fall
|
||||
cable_fall2
|
||||
smashed_window
|
||||
bits
|
||||
bits2
|
||||
spy_11
|
||||
locker_11
|
||||
slot_11
|
||||
soccer_1
|
||||
soccer_2
|
||||
soccer_3
|
||||
soccer_4
|
||||
soccer_5
|
||||
slat_1
|
||||
slat_2
|
||||
slat_3
|
||||
slat_4
|
||||
slat_5
|
||||
right_exit_11
|
||||
s19_floor
|
||||
right_exit_19
|
||||
left_exit_19
|
||||
top_right_19
|
||||
useless_char
|
||||
s20_floor
|
||||
down_exit_20
|
||||
reich_door_20
|
||||
reich_slot
|
||||
lamb_door_20
|
||||
lamb_slot
|
||||
shrub_1
|
||||
shrub_2
|
||||
shrub_3
|
||||
gallager_bel
|
||||
reich_window
|
||||
lamb_window
|
||||
s21_floor
|
||||
left_exit_21
|
||||
lambs_books
|
||||
lambs_chair
|
||||
dispensor
|
||||
cat_food
|
||||
video
|
||||
cassette
|
||||
big_pict1
|
||||
video_screen
|
||||
big_pict2
|
||||
big_pict3
|
||||
cat
|
||||
fake_floor_21
|
||||
inner_lamb_door
|
||||
s22_floor
|
||||
right_exit_22
|
||||
lamb_bed
|
||||
lamb_tv
|
||||
fish_tank
|
||||
fish_poster
|
||||
pillow
|
||||
magazine
|
||||
reich_chair
|
||||
cabinet
|
||||
cert
|
||||
reich_picture
|
||||
fish_food
|
||||
fake_floor_22
|
||||
inner_reich_door
|
||||
s23_floor
|
||||
left_exit_23
|
||||
anchor_exit_23
|
||||
travel_exit_23
|
||||
bin_23
|
||||
sculpture
|
||||
link_23
|
||||
wreck_23
|
||||
small_exit_23
|
||||
s24_floor
|
||||
left_exit_24
|
||||
london_poster
|
||||
new_york_poster
|
||||
mural
|
||||
pidgeons
|
||||
trevor
|
||||
ticket
|
||||
globe
|
||||
s25_floor
|
||||
anchor_exit_25
|
||||
anchor
|
||||
statue_25
|
||||
hook
|
||||
lazer_25
|
||||
spark_25
|
||||
sales_chart
|
||||
s26_floor
|
||||
right_exit_26
|
||||
poster1
|
||||
poster2
|
||||
poster3
|
||||
poster4
|
||||
plant_26
|
||||
holo
|
||||
left_exit_26
|
||||
bio_door
|
||||
leaflet
|
||||
s27_floor
|
||||
right_exit_27
|
||||
chart1
|
||||
chart2
|
||||
gas
|
||||
medi_comp
|
||||
scanner_27
|
||||
chair_27
|
||||
helmet_cole
|
||||
body
|
||||
glass_slot
|
||||
burke
|
||||
s28_floor
|
||||
right_exit_28
|
||||
left_exit_28
|
||||
dustbin_28
|
||||
up_exit_28
|
||||
s28_sml_floor
|
||||
small_r_28
|
||||
small_l_28
|
||||
lift_28
|
||||
slot_28
|
||||
s29_floor
|
||||
lift_29
|
||||
s29_card_slot
|
||||
lift29_light
|
||||
right_exit_29
|
||||
left_exit_29
|
||||
cable_29
|
||||
s29_sml_floor
|
||||
small_r_29
|
||||
small_l_29
|
||||
sc30_floor
|
||||
sc30_exit_31
|
||||
sc30_exit_33
|
||||
sc30_exit_36
|
||||
sc30_court_door
|
||||
sc30_notice
|
||||
sc30_statue_1
|
||||
sc30_statue_2
|
||||
sc30_henri
|
||||
sc31_floor
|
||||
sc31_exit_30
|
||||
sc31_exit_32
|
||||
sc31_exit_39
|
||||
sc31_lift
|
||||
sc31_lift_slot
|
||||
sc31_end_of_rope
|
||||
sc31_rope
|
||||
sc31_bricks
|
||||
sc31_plank
|
||||
sc31_biscuits
|
||||
sc31_guard
|
||||
sc31_joey
|
||||
sc31_at_watcher
|
||||
sc32_floor
|
||||
sc32_exit_31
|
||||
sc32_exit_33
|
||||
sc32_lift
|
||||
sc32_terminal
|
||||
sc32_buzzer
|
||||
sc32_plant_1
|
||||
sc32_plant_2
|
||||
sc32_plant_3
|
||||
sc32_vincent
|
||||
sc32_gardener
|
||||
sc33_floor
|
||||
sc33_exit_30
|
||||
sc33_exit_32
|
||||
sc33_shed_door
|
||||
sc33_lock
|
||||
sc34_floor
|
||||
sc34_door
|
||||
sc34_secateurs
|
||||
sc34_tkt_machine
|
||||
sc34_map
|
||||
sc34_bricks
|
||||
sc36_floor
|
||||
sc36_low_floor
|
||||
sc36_exit_30
|
||||
sc36_sensor
|
||||
sc36_door
|
||||
sc36_band
|
||||
sc36_jukebox
|
||||
sc36_juke_light
|
||||
sc36_barman
|
||||
sc36_colston
|
||||
sc36_col_feet
|
||||
sc36_gallagher
|
||||
sc36_gal_legs
|
||||
sc36_cards
|
||||
sc36_glass
|
||||
sc36_babs
|
||||
sc37_floor
|
||||
sc37_holding_lid
|
||||
sc37_flimsy_box
|
||||
sc37_sensor
|
||||
sc37_door
|
||||
sc37_grill
|
||||
sc37_big_box
|
||||
sc37_lid
|
||||
sc37_wine_rack
|
||||
sc38_floor
|
||||
sc38_lift
|
||||
sc38_statue
|
||||
sc38_monitor
|
||||
sc38_video
|
||||
sc38_sofa
|
||||
sc38_dog_tray
|
||||
sc38_biscuits
|
||||
danielle
|
||||
spunky
|
||||
sc38_hand_set
|
||||
sc38_ringer
|
||||
dog_bark_thing
|
||||
sc39_floor
|
||||
sc39_exit_31
|
||||
sc39_exit_40
|
||||
sc39_exit_41
|
||||
sc39_walters
|
||||
sc40_floor
|
||||
sc40_exit_39
|
||||
sc40_cabinet
|
||||
sc40_trolley
|
||||
sc40_locker_1
|
||||
sc40_locker_2
|
||||
sc40_locker_3
|
||||
sc40_locker_4
|
||||
sc40_locker_5
|
||||
sc40_body_1
|
||||
sc40_body_2
|
||||
sc40_body_3
|
||||
sc40_body_4
|
||||
sc40_body_5
|
||||
sc41_floor
|
||||
sc41_exit_39
|
||||
sc41_heat_1
|
||||
sc41_heat_2
|
||||
sc41_heat_3
|
||||
sc42_judge
|
||||
sc42_clerk
|
||||
sc42_prosecution
|
||||
sc42_jobsworth
|
||||
sc42_sign
|
||||
sc44_floor
|
||||
sc44_exit_45
|
||||
sc44_grill
|
||||
sc44_rubble
|
||||
sc45_floor
|
||||
sc45_exit_44
|
||||
sc45_exit_46
|
||||
sc45_exit_47
|
||||
sc46_floor
|
||||
sc46_exit_45
|
||||
sc46_rubble
|
||||
sc47_floor
|
||||
sc47_exit_45
|
||||
sc47_exit_48
|
||||
sc48_floor
|
||||
sc48_exit_47
|
||||
sc48_exit_65
|
||||
sc48_socket
|
||||
sc48_hole
|
||||
sc48_eyes
|
||||
sc65_floor
|
||||
sc65_exit_48
|
||||
sc65_exit_66
|
||||
sc65_poster1
|
||||
sc65_poster2
|
||||
sc65_sign
|
||||
sc66_hole
|
||||
sc66_door
|
||||
sc66_hi_beam
|
||||
sc66_lo_beam
|
||||
sc66_rock1
|
||||
sc66_rock2
|
||||
sc66_rock3
|
||||
sc66_stones
|
||||
sc67_floor
|
||||
sc67_door
|
||||
sc67_brickwork
|
||||
sc67_plaster
|
||||
sc67_plaster
|
||||
sc67_brick
|
||||
sc67_clot
|
||||
sc67_vein
|
||||
sc67_rock
|
||||
sc67_pulse1
|
||||
sc67_pulse2
|
||||
sc67_pulse3
|
||||
sc67_pulse4
|
||||
sc67_crowbar
|
||||
sc67_mend
|
||||
sc68_floor
|
||||
sc68_door
|
||||
sc68_grill
|
||||
sc68_sensor
|
||||
sc68_stairs
|
||||
sc68_exit
|
||||
sc68_pulse1
|
||||
sc68_pulse2
|
||||
sc68_pulse3
|
||||
sc68_pulse4
|
||||
sc68_pulse5
|
||||
sc68_pulse6
|
||||
sc69_floor
|
||||
sc69_exit
|
||||
sc69_door
|
||||
sc69_grill
|
||||
sc69_pulse1
|
||||
sc69_pulse2
|
||||
sc69_pulse3
|
||||
sc69_pulse4
|
||||
sc69_pulse5
|
||||
sc69_pulse6
|
||||
sc70_floor
|
||||
sc70_pit
|
||||
sc70_door
|
||||
sc70_iris
|
||||
sc70_bar
|
||||
sc70_grill
|
||||
sc70_control
|
||||
sc71_fake_floor
|
||||
sc71_floor
|
||||
sc71_door69
|
||||
sc71_door72
|
||||
sc71_locked_door
|
||||
sc71_recharger
|
||||
sc71_panel2
|
||||
sc71_monitor
|
||||
sc71_controls
|
||||
sc71_light1
|
||||
sc71_chlite
|
||||
sc71_medi_slot
|
||||
medi
|
||||
sc72_fake_floor
|
||||
sc72_floor
|
||||
sc72_door
|
||||
sc72_exit
|
||||
sc72_tank
|
||||
sc72_tap
|
||||
sc72_spill
|
||||
sc72_grill
|
||||
sc72_chamber1
|
||||
sc72_cham1_light
|
||||
sc72_chamber2
|
||||
sc72_cham2_light
|
||||
sc72_chamber3
|
||||
sc72_computer
|
||||
sc72_computer2
|
||||
sc72_rot_light
|
||||
witness
|
||||
sc73_floor
|
||||
sc73_exit
|
||||
sc73_chamber3
|
||||
sc73_chamber4
|
||||
sc73_cham4_light
|
||||
sc73_chamber5
|
||||
sc73_cham5_light
|
||||
sc73_big_door
|
||||
sc73_sensor
|
||||
sc73_door
|
||||
sc73_locked_door
|
||||
sc73_bits
|
||||
sc73_bits2
|
||||
sc73_spray
|
||||
gallagher
|
||||
sc74_floor
|
||||
sc74_interface
|
||||
sc74_int_slot
|
||||
sc74_door
|
||||
sc74_monitor1
|
||||
sc74_monitor2
|
||||
sc74_monitor3
|
||||
sc74_monitor4
|
||||
sc74_left_tv
|
||||
sc74_right_tv
|
||||
sc74_lights
|
||||
sc74_terminal
|
||||
sc74_pod
|
||||
sc75_floor
|
||||
sc75_big_door
|
||||
sc75_door
|
||||
sc75_nitro_tank
|
||||
sc75_live_tank
|
||||
sc75_console
|
||||
sc75_light1
|
||||
sc75_light2
|
||||
sc75_tongs
|
||||
sc76_floor
|
||||
sc76_door75
|
||||
sc76_door77
|
||||
sc76_android_1
|
||||
sc76_android_2
|
||||
sc76_android_3
|
||||
sc76_console_1
|
||||
sc76_console_2
|
||||
sc76_console_3
|
||||
sc76_cabinet_1
|
||||
sc76_cabinet_2
|
||||
sc76_cabinet_3
|
||||
sc76_board_1
|
||||
sc76_board_2
|
||||
sc76_board_3
|
||||
sc76_light1
|
||||
sc76_light2
|
||||
sc76_light3
|
||||
sc76_light4
|
||||
sc76_light5
|
||||
sc76_light6
|
||||
sc76_light7
|
||||
sc76_light8
|
||||
sc76_light9
|
||||
ken
|
||||
sc77_floor
|
||||
sc77_door76
|
||||
sc77_big_door
|
||||
sc77_tank_1
|
||||
sc77_tank_2
|
||||
sc77_hand_1
|
||||
sc77_hand_2
|
||||
sc78_ledge
|
||||
sc78_pipe
|
||||
sc78_big_door
|
||||
sc78_exit
|
||||
sc78_support
|
||||
sc79_pipe
|
||||
sc79_exit
|
||||
sc79_support
|
||||
sc79_ladder
|
||||
sc79_knot
|
||||
sc79_rope
|
||||
sc80_spout
|
||||
sc80_ladder
|
||||
sc80_rope
|
||||
sc80_orifice
|
||||
sc80_exit
|
||||
sc80_sample
|
||||
sc80_goo
|
||||
sc80_bubble1
|
||||
sc80_bubble2
|
||||
sc80_bubble3
|
||||
sc80_bubble4
|
||||
sc80_bubble5
|
||||
sc80_bubble6
|
||||
sc80_bubble7
|
||||
sc80_bubble8
|
||||
sc80_bubble9
|
||||
sc80_bubble10
|
||||
sc80_bubble11
|
||||
sc80_bubble12
|
||||
sc81_father
|
||||
sc81_father_sat
|
||||
sc81_foster_sat
|
||||
sc81_ken_sat
|
||||
sc81_door
|
||||
sc81_chair
|
||||
sc81_helmet
|
||||
sc81_tent1
|
||||
sc81_tent2
|
||||
sc81_tent3
|
||||
sc81_tent4
|
||||
sc81_tent5
|
||||
sc81_tent6
|
||||
sc81_big_tent1
|
||||
sc81_big_tent2
|
||||
sc81_big_tent3
|
||||
sc82_jobsworth
|
||||
sc90_floor
|
||||
sc90_smfloor
|
||||
door_l90
|
||||
door_l90f
|
||||
door_r90
|
||||
door_r90f
|
||||
join_object
|
||||
oscillator
|
||||
eyeball_90
|
||||
sc91_floor
|
||||
door_l91
|
||||
door_l91f
|
||||
door_r91
|
||||
door_r91f
|
||||
door_t91
|
||||
door_t91r
|
||||
bag_91
|
||||
decomp_obj
|
||||
decrypt_obj
|
||||
report_book
|
||||
eyeball_91
|
||||
slab1
|
||||
slab2
|
||||
slab3
|
||||
slab4
|
||||
slab5
|
||||
slab6
|
||||
slab7
|
||||
slab8
|
||||
slab9
|
||||
bridge_a
|
||||
bridge_b
|
||||
bridge_c
|
||||
bridge_d
|
||||
bridge_e
|
||||
bridge_f
|
||||
bridge_g
|
||||
bridge_h
|
||||
door_l92
|
||||
door_l92f
|
||||
door_r92
|
||||
door_r92r
|
||||
green_circle
|
||||
red_circle
|
||||
sc93_floor
|
||||
door_l93
|
||||
door_l93f
|
||||
persona
|
||||
adjust_book
|
||||
sc94_floor
|
||||
door_l94
|
||||
door_l94r
|
||||
door_r94
|
||||
door_r94r
|
||||
hologram_pad
|
||||
hologram_a
|
||||
hologram_b
|
||||
sc95_floor
|
||||
door_l95
|
||||
door_l95f
|
||||
door_r95
|
||||
door_r95f
|
||||
door_t95
|
||||
door_t95r
|
||||
guardian
|
||||
weight
|
||||
sc96_floor
|
||||
door_l96
|
||||
door_l96f
|
||||
crystal
|
||||
virus
|
||||
info_menu
|
||||
read_menu
|
||||
open_menu
|
||||
charon_menu
|
||||
orders_menu
|
||||
orders2_menu
|
||||
join_menu
|
||||
green_menu
|
||||
red_menu
|
||||
report_menu
|
||||
report2_menu
|
||||
decomp_menu
|
||||
decrypt_menu
|
||||
persona_menu
|
||||
adjust_menu
|
||||
adjust2_menu
|
||||
playbak_menu
|
||||
blind_menu
|
||||
oscill_menu
|
||||
kill_menu
|
||||
virus_menu
|
||||
window_1
|
||||
window_2
|
||||
window_3
|
||||
window_4
|
||||
info_button
|
||||
babs_auto
|
||||
burke_auto
|
||||
dan_auto
|
||||
foreman_auto
|
||||
full_ss_auto
|
||||
gal_auto
|
||||
jobs_auto
|
||||
joey_auto
|
||||
ken_auto
|
||||
lamb_auto
|
||||
loader_auto
|
||||
medi_auto
|
||||
monitor_auto
|
||||
radman_auto
|
||||
shades_auto
|
||||
spu_auto
|
||||
ss_auto
|
||||
wit_auto
|
||||
minif_auto
|
||||
park_table
|
||||
high_floor_table
|
8
tools/skycpt/stdafx.cpp
Normal file
8
tools/skycpt/stdafx.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : Quelltextdatei, die nur die Standard-Includes einbindet
|
||||
// AsciiCptCompile.pch ist der vorcompilierte Header
|
||||
// stdafx.obj enthält die vorcompilierte Typinformation
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: Verweisen Sie auf zusätzliche Header, die in STDAFX.H
|
||||
// und nicht in dieser Datei erforderlich sind.
|
33
tools/skycpt/stdafx.h
Normal file
33
tools/skycpt/stdafx.h
Normal file
@ -0,0 +1,33 @@
|
||||
// stdafx.h : Includedatei für Standardsystem-Includedateien,
|
||||
// oder projektspezifische Includedateien, die häufig benutzt, aber
|
||||
// in unregelmäßigen Abständen geändert werden.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <tchar.h>
|
||||
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned long uint32;
|
||||
typedef unsigned int uint;
|
||||
typedef signed char int8;
|
||||
typedef signed short int16;
|
||||
typedef signed long int32;
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
struct CptObj {
|
||||
uint16 *data;
|
||||
uint32 len;
|
||||
char *dbgName;
|
||||
uint16 type;
|
||||
//uint16 id;
|
||||
};
|
||||
// TODO: Verweisen Sie hier auf zusätzliche Header, die Ihr Programm erfordert
|
Loading…
x
Reference in New Issue
Block a user