Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

188
devtools/skycpt/288diff.txt Normal file
View 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

View File

@@ -0,0 +1,61 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// AsciiCptCompile.cpp
#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 main(int argc, char* argv[])
{
volatile uint32 t = 0x11223344;
if (*((volatile uint8 *)&t) != 0x44) {
printf("Sorry, this program only works on little endian systems.\nGoodbye.\n");
return 0;
}
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;
}

154465
devtools/skycpt/COMPACT.TXT Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,34 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "stdafx.h"
#include "KmpSearch.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void KmpSearch::init(const char *subStr) {
strcpy(_subStr, subStr);
}
const char *KmpSearch::search(const char *str) {
return strstr(str, _subStr);
}

View File

@@ -0,0 +1,33 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef SKYCPT_KMPSEARCH_H
#define SKYCPT_KMPSEARCH_H
class KmpSearch {
public:
void init(const char *subStr);
const char *search(const char *str);
private:
char _subStr[256];
};
#endif //__KmpSearch__

58
devtools/skycpt/README Normal file
View File

@@ -0,0 +1,58 @@
Since V.0.8.0 ScummVM requires the SKY.CPT file for running Beneath a Steel Sky.
This file contains data that was originally included in the SKY.EXE and was also included
in the ScummVM executable before 0.8.0.
Including all this data in the executable has the disadvantage that it wastes memory.
Even when playing a completely different game (like, e.g. Day of the Tentacle) ScummVM would
have the Beneath a Steel Sky data lying around in memory. This doesn't make much of a difference
on a 1GB RAM windows system, but for platforms like PALM and PocketPC it's a real problem,
so this data was moved into the SKY.CPT file and is loaded at runtime when BASS is started.
This program creates the SKY.CPT file.
If you want to create your own file, *PLEASE* simply forget about it.
It's a long and annoying procedure and won't help you with anything.
This program was only included in ScummVM's source tree because the Debian license
forces us to.
Instead download the file from https://www.scummvm.org/
Also, please be aware that if you create your own CPT file (if it isn't exactly the same as the
one we offer for download at www.scummvm.org), it will be incompatible and the saved games
produced using the file will be incompatible with ScummVM using the normal CPT file.
The incompatibility will not be detected by ScummVM, it will most probably simply crash.
If you still want to waste your time by creating this file:
1) compile the tool
2) run it once, it'll complain that it's missing 7 files, the RESET.* files but
it creates an incomplete COMPACT.DBG file anyways, which you rename to SKY.CPT.
3) download the seven different Beneath a Steel Sky versions:
v.0.00288: The first floppy version that was released
v.0.00303: Another floppy version
v.0.00331: Another floppy version
v.0.00348: Another floppy version
v.0.00365: CD Demo
v.0.00368: Full CD version
v.0.00372: Final CD version
4) Apply the supplied skycpt-engine.patch to a clean copy of the ScummVM
codebase. This modifies the sky engine to allow savefiles to be generated
containing the required data for the skycpt tool.
5) Compile the patched ScummVM.
6) Start each of the BASS versions with this patched version, enjoy the intro
over and over again.
Afterwards, it'll automatically show the load/save dialog where you save the game.
7) Rename the Savegame files you created (SKY-VM.000 etc., not the ASD or SAV
file) to "RESET.*", depending on the version.
e.g. RESET.288 for v.0.00288
8) Rename each file with a ".gz" suffix and run gunzip on it.
This removes the ScummVM gzip savefile compression.
Failing to do this will cause skycpt to abort at a filesize assert
when reading the "RESET.*" files.
9) Copy the files into the skycpt tool directory, execute the tool again.
It'll create a new COMPACT.DBG.
10) Rename this file to SKY.CPT.
11) DELETE IT BECAUSE IT'S PROBABLY BROKEN, NOT WORTH BOTHERING WITH ANYWAYS
AND DOWNLOAD THE SKY.CPT FILE FROM THE URL ABOVE!!
Oh, I almost forgot.
The program only works on little endian systems and probably isn't alignment safe either.
It may also leak memory or accidentially reformat your harddisk. Who knows.
You've been warned.

View File

@@ -0,0 +1,93 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "stdafx.h"
#include "TextFile.h"
TextFile::TextFile(const char *name) {
FILE *inf = fopen(name, "r");
_lines = nullptr;
if (!inf) {
printf("Unable to open file %s\n", name);
getchar();
} else {
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 nullptr;
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;
}

View File

@@ -0,0 +1,42 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef SKYCPT_TEXTFILE_H
#define SKYCPT_TEXTFILE_H
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include "KmpSearch.h"
class TextFile {
public:
TextFile(const 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

View File

@@ -0,0 +1,562 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "stdafx.h"
#include "cpthelp.h"
#include "TextFile.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.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, const char *typeName, const 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;
printf("Processing...\n");
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));
printf(" MainLists...\n");
processMainLists(inf, resCpts, baseLists);
printf(" Compacts...\n");
processCpts(inf, resCpts);
printf(" Turntables...\n");
processTurntabs(inf, resCpts);
printf(" Animation tables...\n");
processBins(inf, resCpts, "ANIMSEQS", "ANIMSEQ", ANIMSEQ);
printf(" Unknown binaries...\n");
processBins(inf, resCpts, "MISCBINS", "MISCBIN", MISCBIN);
printf(" Get To tables...\n");
processBins(inf, resCpts, "GETTOTAB", "GET_TOS", GETTOTAB);
printf(" Scratch buffers...\n");
processBins(inf, resCpts, "SCRATCHR", "SCRATCH", ROUTEBUF);
printf(" Symbolic links...\n");
processSymlinks(inf, resCpts, baseLists);
printf("Converting to binary data...\n");
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);
}
}
printf("DEBUG lcnt: %lu Output File Position: 0x%08lX\r\n", lcnt, ftell(debOutf));
}
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);
free(asciiBuf);
// 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);
}
printf("Processing diff data...\n");
printf("DEBUG Output File Position: 0x%08lX\r\n", ftell(debOutf));
// 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++;
}
}
fclose(dif);
free(resCpts);
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);
printf("Converting Save data...\n");
printf("DEBUG Output File Position: 0x%08lX\r\n", ftell(debOutf));
// 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);
printf("Converting Reset data...\n");
// now append the reset data
uint16 gameVers[7] = { 303, 331, 348, 365, 368, 372, 288 };
// make sure all files exist
bool filesExist = true;
char inName[32];
for (int i = 0; i < 7; i++) {
sprintf(inName, "RESET.%03d", gameVers[i]);
FILE *test = fopen(inName, "rb");
if (test)
fclose(test);
else {
filesExist = false;
printf("File %s not found\n", inName);
}
}
if (filesExist) {
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("DEBUG Output File Position: 0x%08lX\r\n", ftell(debOutf));
printf("reset destination: %ld\n", ftell(debOutf));
for (int cnt = 0; cnt < 6; cnt++) {
printf("Processing diff v0.0%03d\n", gameVers[cnt]);
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);
printf("DEBUG Output File Position: 0x%08lX\r\n", ftell(debOutf));
}
free(buf288);
} else {
printf("Creating CPT file with Dummy reset data @ %ld\n", ftell(debOutf));
uint16 resetFields16 = 4;
fwrite(&resetFields16, 2, 1, debOutf);
uint32 blah = 8;
fwrite(&blah, 4, 1, debOutf); // size field: 8 bytes
blah = (uint32)-1;
fwrite(&blah, 4, 1, debOutf); // save file revision. -1 is unknown to scummvm, so it'll refuse to load it.
resetFields16 = 0;
fwrite(&resetFields16, 2, 1, debOutf); // numDiffs: 0, no further reset blocks.
}
// 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("%ld Compacts in total\n", numCpts);
printf("max strlen = %d\n", maxStrl);
printf("raw size = 2 * %ld\n", binSize);
printf("max cptlen = %d\n", maxCptl);
}

View File

@@ -0,0 +1,87 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "stdafx.h"
#include "cpthelp.h"
void assertEmpty(CptObj *cpt) {
assert((cpt->len == 0) && (cpt->data == nullptr) && (cpt->dbgName == nullptr) && (cpt->type == 0));
}
uint16 getInfo(const char *line, const 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(const char *line, const char *sec) {
if (memcmp(line, "SECTION::", 9))
return false;
if (memcmp(line + 9, sec, strlen(sec)))
return false;
return true;
}
bool isEndOfSection(const char *line) {
if (strcmp(line, "SECTION::ENDS"))
return false;
return true;
}
bool isEndOfObject(const char *line, const 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;
}

29
devtools/skycpt/cpthelp.h Normal file
View File

@@ -0,0 +1,29 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "stdafx.h"
void assertEmpty(CptObj *cpt);
uint16 getInfo(const char *line, const char *type, char *nameDest);
void dofgets(char *dest, int len, FILE *inf);
bool lineMatchSection(const char *line, const char *sec);
bool isEndOfSection(const char *line);
bool isEndOfObject(const char *line, const char *type, uint16 id);

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "stdafx.h"
#include "TextFile.h"
#include "KmpSearch.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.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;
}

16
devtools/skycpt/module.mk Normal file
View File

@@ -0,0 +1,16 @@
MODULE := devtools/skycpt
MODULE_OBJS := \
AsciiCptCompile.o \
KmpSearch.o \
TextFile.o \
cptcompiler.o \
cpthelp.o \
idFinder.o
# Set the name of the executable
TOOL_EXECUTABLE := skycpt
# Include common rules
include $(srcdir)/rules.mk

View 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

View File

@@ -0,0 +1,66 @@
Index: engines/sky/compact.cpp
===================================================================
--- engines/sky/compact.cpp (revision 53162)
+++ engines/sky/compact.cpp (working copy)
@@ -138,11 +138,15 @@
if (fileVersion != 0)
error("unknown \"sky.cpt\" version");
+#if 0
+ // Disabled as sky.cpt / compact.dbg used during RESET.* generation is
+ // a different size from expected.
if (SKY_CPT_SIZE != _cptFile->size()) {
GUI::MessageDialog dialog("The \"sky.cpt\" file has an incorrect size.\nPlease (re)download it from www.scummvm.org", "OK", NULL);
dialog.runModal();
error("Incorrect sky.cpt size (%d, expected: %d)", _cptFile->size(), SKY_CPT_SIZE);
}
+#endif
// set the necessary data structs up...
_numDataLists = _cptFile->readUint16LE();
Index: engines/sky/control.cpp
===================================================================
--- engines/sky/control.cpp (revision 53162)
+++ engines/sky/control.cpp (working copy)
@@ -416,8 +416,8 @@
}
void Control::doLoadSavePanel() {
- if (SkyEngine::isDemo())
- return; // I don't think this can even happen
+ //if (SkyEngine::isDemo())
+ // return; // I don't think this can even happen
initPanel();
_skyScreen->clearScreen();
if (SkyEngine::_systemVars.gameVersion < 331)
@@ -427,12 +427,17 @@
_savedMouse = _skyMouse->giveCurrentMouseType();
_savedCharSet = _skyText->giveCurrentCharSet();
- _skyText->fnSetFont(2);
+ // Demo lacks any fonts apart from 0
+ if (SkyEngine::isDemo())
+ _skyText->fnSetFont(0);
+ else
+ _skyText->fnSetFont(2);
_skyMouse->spriteMouse(MOUSE_NORMAL, 0, 0);
_lastButton = -1;
_curButtonText = 0;
- saveRestorePanel(false);
+ // Parameter modified to true to ensure save dialog, not load is shown
+ saveRestorePanel(true);
memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
_system->copyRectToScreen(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
Index: engines/sky/logic.cpp
===================================================================
--- engines/sky/logic.cpp (revision 53162)
+++ engines/sky/logic.cpp (working copy)
@@ -2376,6 +2376,7 @@
bool Logic::fnSkipIntroCode(uint32 a, uint32 b, uint32 c) {
SkyEngine::_systemVars.pastIntro = true;
+ _skyControl->doLoadSavePanel();
return true;
}

View File

@@ -0,0 +1,22 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "stdafx.h"

58
devtools/skycpt/stdafx.h Normal file
View File

@@ -0,0 +1,58 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// stdafx.h : Includedatei für Standardsystem-Includedateien,
// oder projektspezifische Includedateien, die häufig benutzt, aber
// in unregelmäßigen Abständen geändert werden.
#ifndef SKYCPT_STDAFX_H
#define SKYCPT_STDAFX_H
#ifdef _MSC_VER
#pragma once
#include <iostream>
#include <tchar.h>
#endif
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 <string.h>
#include <assert.h>
struct CptObj {
uint16 *data;
uint32 len;
char *dbgName;
uint16 type;
//uint16 id;
};
#endif // __STDAFX_H__